QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
linksingleelementwidget.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 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 LINKSINGLEELEMENTWIDGET_H
19#define LINKSINGLEELEMENTWIDGET_H
20
23
24#include <QHash>
25#include <QDialog>
26#include <QComboBox>
27
28class QTreeWidgetItem;
29class Element;
30class QMenu;
31
32namespace Ui {
33 class LinkSingleElementWidget;
34}
35
48{
49 Q_OBJECT
50
52 public:
53 explicit LinkSingleElementWidget(Element *elmt,
54 QWidget *parent = nullptr);
55 ~LinkSingleElementWidget() override;
56
57 void setElement (Element *element) override;
58 void apply() override;
59 QUndoCommand *associatedUndo() const override;
60 QString title() const override;
61
62 public slots:
63 void updateUi() override;
64 void buildTree();
65
66 public:
67 bool setLiveEdit(bool live_edit) override;
68
69 private :
70 QVector <QPointer<Element>> availableElements();
71 void setUpCompleter();
72 void clearTreeWidget();
73 void setUpHeaderLabels();
74
75 private slots:
78 void linkTriggered();
79 void hideButtons();
80 void showButtons();
81 void headerCustomContextMenuRequested(const QPoint &pos);
82
84 void on_m_tree_widget_itemDoubleClicked(QTreeWidgetItem *item, int column);
85 void on_m_tree_widget_customContextMenuRequested(const QPoint &pos);
88
89 void on_m_search_field_textEdited(const QString &arg1);
90
91 private:
92 Ui::LinkSingleElementWidget *ui;
93
94 bool m_unlink = false;
96
97 QHash <QTreeWidgetItem*, Element*> m_qtwi_elmt_hash;
98 QHash <QTreeWidgetItem*, QStringList> m_qtwi_strl_hash;
99
100 QTreeWidgetItem *m_qtwi_at_context_menu = nullptr,
101 *m_pending_qtwi = nullptr;
102
105
107
108 QMenu *m_context_menu{nullptr};
109 QAction *m_link_action{nullptr},
110 *m_show_qtwi{nullptr},
111 *m_show_element{nullptr},
113};
114
115#endif // LINKSINGLEELEMENTWIDGET_H
AbstractElementPropertiesEditorWidget(QWidget *parent=nullptr)
Definition abstractelementpropertieseditorwidget.cpp:20
Type
Definition elementdata.h:40
Definition element.h:44
Definition autonumberingdockwidget.h:30