mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-18 09:39:58 +01:00
Element query widget : widget restor is state according to the current query
This commit is contained in:
@@ -187,6 +187,14 @@ void NomenclatureModel::query(const QString &query)
|
||||
if (rm_) { emit endResetModel();}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NomenclatureModel::queryString
|
||||
* @return the current query used by this model
|
||||
*/
|
||||
QString NomenclatureModel::queryString() const {
|
||||
return m_query;
|
||||
}
|
||||
|
||||
QETProject *NomenclatureModel::project() const {
|
||||
return m_project.data();
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ class NomenclatureModel : public QAbstractTableModel
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
void query(const QString &query);
|
||||
QString queryString() const;
|
||||
QETProject *project() const;
|
||||
void autoHeaders();
|
||||
|
||||
|
||||
@@ -59,10 +59,11 @@ void NomenclatureModelPropertiesWidget::setModel(NomenclatureModel *model) {
|
||||
void NomenclatureModelPropertiesWidget::on_m_edit_query_pb_clicked()
|
||||
{
|
||||
QDialog d(this);
|
||||
auto l = new QVBoxLayout(this);
|
||||
auto l = new QVBoxLayout;
|
||||
d.setLayout(l);
|
||||
|
||||
auto query_widget = new ElementQueryWidget(&d);
|
||||
query_widget->setQuery(m_model->queryString());
|
||||
l->addWidget(query_widget);
|
||||
|
||||
auto button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
|
||||
Reference in New Issue
Block a user