QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Slots | Private Attributes | List of all members
ElementQueryWidget Class Reference

The ElementQueryWidget class A widget use to edit a sql query for get element information This widget only work to get information from ProjectDataBase. More...

#include <elementquerywidget.h>

Inherits QWidget.

Collaboration diagram for ElementQueryWidget:
Collaboration graph

Public Member Functions

 ElementQueryWidget (QWidget *parent=nullptr)
 ElementQueryWidget::ElementQueryWidget.
 
 ~ElementQueryWidget ()
 ElementQueryWidget::~ElementQueryWidget.
 
void setQuery (const QString &query)
 ElementQueryWidget::setQuery.
 
QString queryStr () const
 ElementQueryWidget::queryStr.
 
void setGroupBy (QString text, bool set=true)
 ElementQueryWidget::setGroupBy Add the query instruction GROUP BY.
 
void setCount (QString text, bool set=true)
 ElementQueryWidget::setCount Add the query instruction COUNT. Unlike setGroupBy, you have to write the entire sentence. ex : text = "COUNT(*) AS designation_qty". the query will contain what you write.
 

Static Public Member Functions

static QString modelIdentifier ()
 

Private Slots

void on_m_up_pb_clicked ()
 ElementQueryWidget::on_m_up_pb_clicked.
 
void on_m_add_pb_clicked ()
 ElementQueryWidget::on_m_add_pb_clicked.
 
void on_m_remove_pb_clicked ()
 ElementQueryWidget::on_m_remove_pb_clicked.
 
void on_m_down_pb_clicked ()
 ElementQueryWidget::on_m_down_pb_clicked.
 
void on_m_edit_sql_query_cb_clicked ()
 ElementQueryWidget::on_m_edit_sql_query_cb_clicked.
 
void on_m_filter_le_textEdited (const QString &arg1)
 ElementQueryWidget::on_m_filter_le_textEdited.
 
void on_m_filter_type_cb_activated (int index)
 ElementQueryWidget::on_m_filter_type_cb_activated.
 
void on_m_load_pb_clicked ()
 ElementQueryWidget::on_m_load_pb_clicked Load a query from nomenclature.json file.
 
void on_m_save_current_conf_pb_clicked ()
 ElementQueryWidget::on_m_save_current_conf_pb_clicked Save the actual query to nomenclature.json file.
 
void on_m_save_name_le_textChanged (const QString &arg1)
 
void on_m_choosen_list_currentItemChanged (QListWidgetItem *current, QListWidgetItem *previous)
 
void on_m_var_list_itemDoubleClicked (QListWidgetItem *item)
 
void on_m_choosen_list_itemDoubleClicked (QListWidgetItem *item)
 
void updateQueryLine ()
 ElementQueryWidget::updateQueryLine.
 
QStringList selectedKeys () const
 ElementQueryWidget::selectedKeys.
 
void setUpItems ()
 ElementQueryWidget::setUpItems.
 
QPair< int, QString > FilterFor (const QString &key) const
 ElementQueryWidget::FilterFor.
 
void fillSavedQuery ()
 ElementQueryWidget::fillSavedQuery Fill the combobox of saved queries.
 
void reset ()
 ElementQueryWidget::reset Clear this widget aka set to initial state.
 

Private Attributes

Ui::ElementQueryWidget * ui
 
QHash< QString, QString > m_export_info
 
QButtonGroup m_button_group
 
QList< QListWidgetItem * > m_items_list
 
QString m_custom_query
 
QString m_group_by
 
QString m_count
 
QHash< QString, QPair< int, QString > > m_filter
 

Detailed Description

The ElementQueryWidget class A widget use to edit a sql query for get element information This widget only work to get information from ProjectDataBase.

Constructor & Destructor Documentation

◆ ElementQueryWidget()

ElementQueryWidget::ElementQueryWidget ( QWidget *  parent = nullptr)
explicit

ElementQueryWidget::ElementQueryWidget.

Parameters
parent
Here is the call graph for this function:

◆ ~ElementQueryWidget()

ElementQueryWidget::~ElementQueryWidget ( )

Member Function Documentation

◆ fillSavedQuery

void ElementQueryWidget::fillSavedQuery ( )
privateslot

ElementQueryWidget::fillSavedQuery Fill the combobox of saved queries.

Here is the call graph for this function:

◆ FilterFor

QPair< int, QString > ElementQueryWidget::FilterFor ( const QString &  key) const
privateslot

ElementQueryWidget::FilterFor.

Parameters
key
Returns
the filter associated to key
Here is the caller graph for this function:

◆ modelIdentifier()

static QString ElementQueryWidget::modelIdentifier ( )
inlinestatic

◆ on_m_add_pb_clicked

void ElementQueryWidget::on_m_add_pb_clicked ( )
privateslot

ElementQueryWidget::on_m_add_pb_clicked.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_m_choosen_list_currentItemChanged

void ElementQueryWidget::on_m_choosen_list_currentItemChanged ( QListWidgetItem *  current,
QListWidgetItem *  previous 
)
privateslot
Here is the call graph for this function:

◆ on_m_choosen_list_itemDoubleClicked

void ElementQueryWidget::on_m_choosen_list_itemDoubleClicked ( QListWidgetItem *  item)
privateslot
Here is the call graph for this function:

◆ on_m_down_pb_clicked

void ElementQueryWidget::on_m_down_pb_clicked ( )
privateslot

ElementQueryWidget::on_m_down_pb_clicked.

Here is the call graph for this function:

◆ on_m_edit_sql_query_cb_clicked

void ElementQueryWidget::on_m_edit_sql_query_cb_clicked ( )
privateslot

ElementQueryWidget::on_m_edit_sql_query_cb_clicked.

Here is the call graph for this function:

◆ on_m_filter_le_textEdited

void ElementQueryWidget::on_m_filter_le_textEdited ( const QString &  arg1)
privateslot

ElementQueryWidget::on_m_filter_le_textEdited.

Parameters
arg1
Here is the call graph for this function:

◆ on_m_filter_type_cb_activated

void ElementQueryWidget::on_m_filter_type_cb_activated ( int  index)
privateslot

ElementQueryWidget::on_m_filter_type_cb_activated.

Parameters
index
Here is the call graph for this function:

◆ on_m_load_pb_clicked

void ElementQueryWidget::on_m_load_pb_clicked ( )
privateslot

ElementQueryWidget::on_m_load_pb_clicked Load a query from nomenclature.json file.

Here is the call graph for this function:

◆ on_m_remove_pb_clicked

void ElementQueryWidget::on_m_remove_pb_clicked ( )
privateslot

ElementQueryWidget::on_m_remove_pb_clicked.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_m_save_current_conf_pb_clicked

void ElementQueryWidget::on_m_save_current_conf_pb_clicked ( )
privateslot

ElementQueryWidget::on_m_save_current_conf_pb_clicked Save the actual query to nomenclature.json file.

Here is the call graph for this function:

◆ on_m_save_name_le_textChanged

void ElementQueryWidget::on_m_save_name_le_textChanged ( const QString &  arg1)
privateslot

◆ on_m_up_pb_clicked

void ElementQueryWidget::on_m_up_pb_clicked ( )
privateslot

ElementQueryWidget::on_m_up_pb_clicked.

Here is the call graph for this function:

◆ on_m_var_list_itemDoubleClicked

void ElementQueryWidget::on_m_var_list_itemDoubleClicked ( QListWidgetItem *  item)
privateslot
Here is the call graph for this function:

◆ queryStr()

QString ElementQueryWidget::queryStr ( ) const

ElementQueryWidget::queryStr.

Returns
The current query
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset

void ElementQueryWidget::reset ( )
privateslot

ElementQueryWidget::reset Clear this widget aka set to initial state.

Here is the caller graph for this function:

◆ selectedKeys

QStringList ElementQueryWidget::selectedKeys ( ) const
privateslot

ElementQueryWidget::selectedKeys.

Returns
the current keys of selected infos to be exported
Here is the caller graph for this function:

◆ setCount()

void ElementQueryWidget::setCount ( QString  text,
bool  set = true 
)

ElementQueryWidget::setCount Add the query instruction COUNT. Unlike setGroupBy, you have to write the entire sentence. ex : text = "COUNT(*) AS designation_qty". the query will contain what you write.

Parameters
text: the count instruction
set: true by default -> count will be used. false -> count will be not used.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGroupBy()

void ElementQueryWidget::setGroupBy ( QString  text,
bool  set = true 
)

ElementQueryWidget::setGroupBy Add the query instruction GROUP BY.

Parameters
text: the text of the GROUP BY instruction: ex : if text = designation, the query will contain "GROUP BY designation"
set: true by default -> GROUP BY will be used. false -> GROUP BY will be not used
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setQuery()

void ElementQueryWidget::setQuery ( const QString &  query)

ElementQueryWidget::setQuery.

Parameters
querySet the current query to query. If it's possible, rebuild the state of the widget from the query
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUpItems

void ElementQueryWidget::setUpItems ( )
privateslot

ElementQueryWidget::setUpItems.

Here is the call graph for this function:

◆ updateQueryLine

void ElementQueryWidget::updateQueryLine ( )
privateslot

ElementQueryWidget::updateQueryLine.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_button_group

QButtonGroup ElementQueryWidget::m_button_group
private

◆ m_count

QString ElementQueryWidget::m_count
private

◆ m_custom_query

QString ElementQueryWidget::m_custom_query
private

◆ m_export_info

QHash<QString, QString> ElementQueryWidget::m_export_info
private

◆ m_filter

QHash<QString, QPair<int, QString> > ElementQueryWidget::m_filter
private

◆ m_group_by

QString ElementQueryWidget::m_group_by
private

◆ m_items_list

QList<QListWidgetItem *> ElementQueryWidget::m_items_list
private

◆ ui

Ui::ElementQueryWidget* ElementQueryWidget::ui
private

The documentation for this class was generated from the following files: