QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementquerywidget.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef ELEMENTQUERYWIDGET_H
19#define ELEMENTQUERYWIDGET_H
20
21#include <QWidget>
22#include <QButtonGroup>
23#include <QHash>
24
25class QListWidgetItem;
26
27namespace Ui {
29}
30
36class ElementQueryWidget : public QWidget
37{
38 Q_OBJECT
39
40 public:
41 explicit ElementQueryWidget(QWidget *parent = nullptr);
43
44 void setQuery(const QString &query);
45 QString queryStr() const;
46 void setGroupBy(QString text, bool set = true);
47 void setCount(QString text, bool set = true);
48
49 static QString modelIdentifier() {return "nomenclature";}
50
51 private slots:
52 void on_m_up_pb_clicked();
57 void on_m_filter_le_textEdited(const QString &arg1);
58 void on_m_filter_type_cb_activated(int index);
61 void on_m_save_name_le_textChanged(const QString &arg1);
62 void on_m_choosen_list_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
63 void on_m_var_list_itemDoubleClicked(QListWidgetItem *item);
64 void on_m_choosen_list_itemDoubleClicked(QListWidgetItem *item);
65
66 void updateQueryLine();
67 QStringList selectedKeys() const;
68 void setUpItems();
69 QPair<int, QString> FilterFor(const QString &key) const;
70 void fillSavedQuery();
71
72
73 void reset();
74
75 private:
76 Ui::ElementQueryWidget *ui;
77 QHash <QString, QString> m_export_info;
78 QButtonGroup m_button_group;
79 QList <QListWidgetItem *> m_items_list;
83 QHash <QString, QPair<int, QString>> m_filter;
84};
85
86#endif // ELEMENTQUERYWIDGET_H
The ElementQueryWidget class A widget use to edit a sql query for get element information This widget...
Definition elementquerywidget.h:37
void setGroupBy(QString text, bool set=true)
ElementQueryWidget::setGroupBy Add the query instruction GROUP BY.
Definition elementquerywidget.cpp:395
void reset()
ElementQueryWidget::reset Clear this widget aka set to initial state.
Definition elementquerywidget.cpp:710
QList< QListWidgetItem * > m_items_list
Definition elementquerywidget.h:79
void setQuery(const QString &query)
ElementQueryWidget::setQuery.
Definition elementquerywidget.cpp:118
QButtonGroup m_button_group
Definition elementquerywidget.h:78
void on_m_filter_le_textEdited(const QString &arg1)
ElementQueryWidget::on_m_filter_le_textEdited.
Definition elementquerywidget.cpp:586
QString m_group_by
Definition elementquerywidget.h:81
void on_m_up_pb_clicked()
ElementQueryWidget::on_m_up_pb_clicked.
Definition elementquerywidget.cpp:507
void on_m_filter_type_cb_activated(int index)
ElementQueryWidget::on_m_filter_type_cb_activated.
Definition elementquerywidget.cpp:603
Ui::ElementQueryWidget * ui
Definition elementquerywidget.h:76
void setUpItems()
ElementQueryWidget::setUpItems.
Definition elementquerywidget.cpp:455
QString m_custom_query
Definition elementquerywidget.h:80
void on_m_choosen_list_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
Definition elementquerywidget.cpp:682
QString m_count
Definition elementquerywidget.h:82
~ElementQueryWidget()
ElementQueryWidget::~ElementQueryWidget.
Definition elementquerywidget.cpp:107
void on_m_remove_pb_clicked()
ElementQueryWidget::on_m_remove_pb_clicked.
Definition elementquerywidget.cpp:536
void on_m_choosen_list_itemDoubleClicked(QListWidgetItem *item)
Definition elementquerywidget.cpp:701
void on_m_load_pb_clicked()
ElementQueryWidget::on_m_load_pb_clicked Load a query from nomenclature.json file.
Definition elementquerywidget.cpp:621
QHash< QString, QPair< int, QString > > m_filter
Definition elementquerywidget.h:83
void updateQueryLine()
ElementQueryWidget::updateQueryLine.
Definition elementquerywidget.cpp:429
QPair< int, QString > FilterFor(const QString &key) const
ElementQueryWidget::FilterFor.
Definition elementquerywidget.cpp:481
void setCount(QString text, bool set=true)
ElementQueryWidget::setCount Add the query instruction COUNT. Unlike setGroupBy, you have to write th...
Definition elementquerywidget.cpp:416
void on_m_save_name_le_textChanged(const QString &arg1)
Definition elementquerywidget.cpp:678
void on_m_var_list_itemDoubleClicked(QListWidgetItem *item)
Definition elementquerywidget.cpp:696
QStringList selectedKeys() const
ElementQueryWidget::selectedKeys.
Definition elementquerywidget.cpp:438
QString queryStr() const
ElementQueryWidget::queryStr.
Definition elementquerywidget.cpp:285
void on_m_edit_sql_query_cb_clicked()
ElementQueryWidget::on_m_edit_sql_query_cb_clicked.
Definition elementquerywidget.cpp:565
static QString modelIdentifier()
Definition elementquerywidget.h:49
void on_m_down_pb_clicked()
ElementQueryWidget::on_m_down_pb_clicked.
Definition elementquerywidget.cpp:548
void on_m_save_current_conf_pb_clicked()
ElementQueryWidget::on_m_save_current_conf_pb_clicked Save the actual query to nomenclature....
Definition elementquerywidget.cpp:651
QHash< QString, QString > m_export_info
Definition elementquerywidget.h:77
void on_m_add_pb_clicked()
ElementQueryWidget::on_m_add_pb_clicked.
Definition elementquerywidget.cpp:524
void fillSavedQuery()
ElementQueryWidget::fillSavedQuery Fill the combobox of saved queries.
Definition elementquerywidget.cpp:490
Definition autonumberingdockwidget.h:26