QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
linksingleelementwidget.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 LINKSINGLEELEMENTWIDGET_H
19#define LINKSINGLEELEMENTWIDGET_H
20
21#include "../properties/elementdata.h"
23
24#include <QHash>
25
26class QTreeWidgetItem;
27class Element;
28class QMenu;
29
30namespace Ui {
32}
33
46{
47 Q_OBJECT
48
50 public:
51 explicit LinkSingleElementWidget(Element *elmt,
52 QWidget *parent = nullptr);
53 ~LinkSingleElementWidget() override;
54
55 void setElement (Element *element) override;
56 void apply() override;
57 QUndoCommand *associatedUndo() const override;
58 QString title() const override;
59
60 public slots:
61 void updateUi() override;
62 void buildTree();
63
64 public:
65 bool setLiveEdit(bool live_edit) override;
66
67 private :
68 QVector <QPointer<Element>> availableElements();
69 void setUpCompleter();
70 void clearTreeWidget();
71 void setUpHeaderLabels();
72
73 private slots:
76 void linkTriggered();
77 void hideButtons();
78 void showButtons();
79 void headerCustomContextMenuRequested(const QPoint &pos);
80
82 void on_m_tree_widget_itemDoubleClicked(QTreeWidgetItem *item, int column);
83 void on_m_tree_widget_customContextMenuRequested(const QPoint &pos);
86
87 void on_m_search_field_textEdited(const QString &arg1);
88
89 private:
90 Ui::LinkSingleElementWidget *ui;
91
92 bool m_unlink = false;
94
95 QHash <QTreeWidgetItem*, Element*> m_qtwi_elmt_hash;
96 QHash <QTreeWidgetItem*, QStringList> m_qtwi_strl_hash;
97
98 QTreeWidgetItem *m_qtwi_at_context_menu = nullptr,
99 *m_pending_qtwi = nullptr;
100
103
104 QMenu *m_context_menu{nullptr};
105 QAction *m_link_action{nullptr},
106 *m_show_qtwi{nullptr},
107 *m_show_element{nullptr},
109};
110
111#endif // LINKSINGLEELEMENTWIDGET_H
The AbstractElementPropertiesEditorWidget class This class provide common method for all widget used ...
Definition abstractelementpropertieseditorwidget.h:32
Type
Definition elementdata.h:36
Definition element.h:43
Definition autonumberingdockwidget.h:26