mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Element::Thumbnail WIP
This commit is contained in:
@@ -45,6 +45,7 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) :
|
||||
m_button_group.addButton(ui->m_button_cb, 3);
|
||||
m_button_group.addButton(ui->m_coil_cb, 4);
|
||||
m_button_group.addButton(ui->m_protection_cb, 5);
|
||||
m_button_group.addButton(ui->m_thumbnail_cb,6);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // ### Qt 6: remove
|
||||
connect(&m_button_group, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), [this](int id)
|
||||
#else
|
||||
@@ -185,8 +186,13 @@ void ElementQueryWidget::setQuery(const QString &query)
|
||||
if (ui->m_protection_cb) {
|
||||
++c;
|
||||
}
|
||||
|
||||
ui->m_thumbnail_cb->setChecked (str_type.contains("Thumbnail") ? true : false);
|
||||
if (ui->m_thumbnail_cb->isChecked()) {
|
||||
++c;
|
||||
}
|
||||
|
||||
if (c == 5) {
|
||||
if (c == 6) {
|
||||
ui->m_all_cb->setCheckState(Qt::Checked);
|
||||
} else if (c > 0) {
|
||||
ui->m_all_cb->setCheckState(Qt::PartiallyChecked);
|
||||
@@ -337,6 +343,11 @@ QString ElementQueryWidget::queryStr() const
|
||||
where += " element_type = 'Terminale'";
|
||||
b = true;
|
||||
}
|
||||
if (ui->m_thumbnail_cb->isChecked()) {
|
||||
if (b) where +=" OR";
|
||||
where += " element_type = 'thumbnail'";
|
||||
b = true;
|
||||
}
|
||||
if (ui->m_simple_cb->isChecked()) {
|
||||
if (b) where +=" OR";
|
||||
where += " element_type = 'Simple'";
|
||||
|
||||
Reference in New Issue
Block a user