mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Minor improvement
Element query widget, when "all" is selected, report and slave is not selected anymore. Summary should be smaller.
This commit is contained in:
@@ -327,35 +327,36 @@ QString ElementQueryWidget::queryStr() const
|
|||||||
QString from = " FROM element_nomenclature_view";
|
QString from = " FROM element_nomenclature_view";
|
||||||
|
|
||||||
QString where;
|
QString where;
|
||||||
if (ui->m_all_cb->checkState() == Qt::PartiallyChecked)
|
where = " WHERE (";
|
||||||
{
|
bool b = false;
|
||||||
where = " WHERE (";
|
if (ui->m_terminal_cb->isChecked()) {
|
||||||
bool b = false;
|
if (b) where +=" OR";
|
||||||
if (ui->m_terminal_cb->isChecked()) {
|
where += " element_type = 'Terminale'";
|
||||||
if (b) where +=" OR";
|
b = true;
|
||||||
where += " element_type = 'Terminale'";
|
}
|
||||||
b = true;
|
if (ui->m_simple_cb->isChecked()) {
|
||||||
}
|
if (b) where +=" OR";
|
||||||
if (ui->m_simple_cb->isChecked()) {
|
where += " element_type = 'Simple'";
|
||||||
if (b) where +=" OR";
|
b = true;
|
||||||
where += " element_type = 'Simple'";
|
}
|
||||||
b = true;
|
if (ui->m_button_cb->isChecked()) {
|
||||||
}
|
if (b) where +=" OR";
|
||||||
if (ui->m_button_cb->isChecked()) {
|
where += " element_sub_type = 'commutator'";
|
||||||
if (b) where +=" OR";
|
b = true;
|
||||||
where += " element_sub_type = 'commutator'";
|
}
|
||||||
b = true;
|
if (ui->m_coil_cb->isChecked()) {
|
||||||
}
|
if (b) where +=" OR";
|
||||||
if (ui->m_coil_cb->isChecked()) {
|
where += " element_sub_type = 'coil'";
|
||||||
if (b) where +=" OR";
|
b = true;
|
||||||
where += " element_sub_type = 'coil'";
|
}
|
||||||
b = true;
|
if (ui->m_protection_cb->isChecked()) {
|
||||||
}
|
if (b) where +=" OR";
|
||||||
if (ui->m_protection_cb->isChecked()) {
|
where += " element_sub_type = 'protection'";
|
||||||
if (b) where +=" OR";
|
}
|
||||||
where += " element_sub_type = 'protection'";
|
where.append(")");
|
||||||
}
|
|
||||||
where.append(")");
|
if (where == " WHERE ()") {
|
||||||
|
where.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (where.isEmpty() && !filter_.isEmpty()) {
|
if (where.isEmpty() && !filter_.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user