mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-05 18:54:14 +02:00
8434b88eb8
Since #849 the parts list has a row for every contact block (slave) and terminal-type element. Users who draw the dots and bends where wires branch as terminal-type symbols (114_connections) get one empty row per junction: 109 of 151 rows on one reported cabinet. Two options, both off by default so existing exports are unchanged: - leave out the contact blocks: --no-slaves, "no_slaves" in qet_export, or uncheck the new "Contacts esclaves" element type in the dialog; - leave out the junctions: terminal-type elements with no label, designation, manufacturer or manufacturer reference. --no-junctions, "no_junctions", or "Laisser de côté les jonctions" in the dialog. A terminal block with a label or a part number stays. The element type filter had no box for slaves, so every query it built left them out: the export dialog never listed contact blocks, although the command line has since #849. The dialog now checks the new box by default and gives the same rows as --export-bom. The box is unchecked by default elsewhere, so nomenclature tables keep their rows. docs/smart-device-bom.md still said slaves and terminals were excluded; corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
94 lines
2.8 KiB
C++
94 lines
2.8 KiB
C++
/*
|
|
Copyright 2006-2026 The QElectroTech Team
|
|
This file is part of QElectroTech.
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef ELEMENTQUERYWIDGET_H
|
|
#define ELEMENTQUERYWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QButtonGroup>
|
|
#include <QHash>
|
|
|
|
class QListWidgetItem;
|
|
|
|
namespace Ui {
|
|
class ElementQueryWidget;
|
|
}
|
|
|
|
/**
|
|
@brief The ElementQueryWidget class
|
|
A widget use to edit a sql query for get element information
|
|
This widget only work to get information from ProjectDataBase
|
|
*/
|
|
class ElementQueryWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ElementQueryWidget(QWidget *parent = nullptr);
|
|
~ElementQueryWidget();
|
|
|
|
void setQuery(const QString &query);
|
|
QString queryStr() const;
|
|
void setGroupBy(QString text, bool set = true);
|
|
void setCount(QString text, bool set = true);
|
|
void setSlavesIncluded(bool included);
|
|
void setExtraFilter(const QString &text, bool set = true);
|
|
|
|
static QString modelIdentifier() {return "nomenclature";}
|
|
|
|
private slots:
|
|
void on_m_up_pb_clicked();
|
|
void on_m_add_pb_clicked();
|
|
void on_m_remove_pb_clicked();
|
|
void on_m_down_pb_clicked();
|
|
void on_m_edit_sql_query_cb_clicked();
|
|
void on_m_filter_le_textEdited(const QString &arg1);
|
|
void on_m_filter_type_cb_activated(int index);
|
|
void on_m_load_pb_clicked();
|
|
void on_m_save_current_conf_pb_clicked();
|
|
void on_m_save_name_le_textChanged(const QString &arg1);
|
|
void on_m_import_reports_pb_clicked();
|
|
void on_m_export_reports_pb_clicked();
|
|
void checkQueryValidity();
|
|
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();
|
|
void updateAllCheckState();
|
|
QStringList selectedKeys() const;
|
|
void setUpItems();
|
|
QPair<int, QString> FilterFor(const QString &key) const;
|
|
void fillSavedQuery();
|
|
|
|
|
|
void reset();
|
|
|
|
private:
|
|
Ui::ElementQueryWidget *ui;
|
|
QHash <QString, QString> m_export_info;
|
|
QButtonGroup m_button_group;
|
|
QList <QListWidgetItem *> m_items_list;
|
|
QString m_custom_query,
|
|
m_group_by,
|
|
m_count,
|
|
m_extra_filter;
|
|
QHash <QString, QPair<int, QString>> m_filter;
|
|
};
|
|
|
|
#endif // ELEMENTQUERYWIDGET_H
|