mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-07 22:22:33 +01:00
Query can be edited. Project database can be exported
User can now define the information to display in the nomenclature table. WIP The internal database of project can be exported to file.
This commit is contained in:
@@ -18,6 +18,10 @@
|
||||
#include "nomenclaturemodelpropertieswidget.h"
|
||||
#include "ui_nomenclaturemodelpropertieswidget.h"
|
||||
#include "nomenclaturemodel.h"
|
||||
#include "qetproject.h"
|
||||
#include "elementquerywidget.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
/**
|
||||
* @brief NomenclatureModelPropertiesWidget::NomenclatureModelPropertiesWidget
|
||||
@@ -49,11 +53,30 @@ void NomenclatureModelPropertiesWidget::setModel(NomenclatureModel *model) {
|
||||
m_model = model;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NomenclatureModelPropertiesWidget::on_m_edit_query_pb_clicked
|
||||
*/
|
||||
void NomenclatureModelPropertiesWidget::on_m_edit_query_pb_clicked()
|
||||
{}
|
||||
{
|
||||
QDialog d(this);
|
||||
auto l = new QVBoxLayout(this);
|
||||
d.setLayout(l);
|
||||
|
||||
void NomenclatureModelPropertiesWidget::on_m_refresh_pb_clicked() {
|
||||
if (m_model) {
|
||||
m_model->query("SELECT plant, location, label, comment, description FROM element_info ORDER BY plant, location, label, comment, description");
|
||||
auto query_widget = new ElementQueryWidget(&d);
|
||||
l->addWidget(query_widget);
|
||||
|
||||
auto button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
l->addWidget(button_box);
|
||||
connect(button_box, &QDialogButtonBox::accepted, &d, &QDialog::accept);
|
||||
connect(button_box, &QDialogButtonBox::rejected, &d, &QDialog::reject);
|
||||
|
||||
if (d.exec()) {
|
||||
m_model->query(query_widget->queryStr());
|
||||
}
|
||||
}
|
||||
|
||||
void NomenclatureModelPropertiesWidget::on_m_refresh_pb_clicked() {
|
||||
if (m_model && m_model->project()) {
|
||||
m_model->project()->dataBase()->updateDB();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user