QElectroTech  0.8-dev
graphicstablepropertieseditor.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 GRAPHICSTABLEPROPERTIESEDITOR_H
19 #define GRAPHICSTABLEPROPERTIESEDITOR_H
20 
22 #include <QPointer>
23 #include <QButtonGroup>
24 
25 namespace Ui {
27 }
28 
30 class QAbstractItemModel;
31 class QUndoStack;
32 class QButtonGroup;
33 
39 {
40  Q_OBJECT
41 
42  public:
43  explicit GraphicsTablePropertiesEditor(QetGraphicsTableItem *table = nullptr, QWidget *parent = nullptr);
45 
46  void setTable(QetGraphicsTableItem *table);
47  virtual void apply() override;
48  QUndoCommand * associatedUndo() const override;
49  virtual bool setLiveEdit(bool live_edit) override;
50 
51  private slots:
54  virtual void updateUi() override;
55  void updateInfoLabel();
56  void on_m_table_name_le_textEdited(const QString &arg1);
57  void on_m_previous_table_cb_activated(int index);
59  void on_m_next_pb_clicked();
62 
63  private:
64  void setUpEditConnection();
65 
66  private:
67  Ui::GraphicsTablePropertiesEditor *ui;
68  QPointer<QetGraphicsTableItem> m_table_item;
69  QList <QMetaObject::Connection> m_connect_list,
71  QButtonGroup *m_header_button_group = nullptr,
73  QWidget *m_current_model_editor = nullptr;
74  QVector<QetGraphicsTableItem *> m_other_table_vector;
75 };
76 
77 Q_DECLARE_METATYPE(QMargins)
78 
79 #endif // GRAPHICSTABLEPROPERTIESEDITOR_H
GraphicsTablePropertiesEditor::m_table_item
QPointer< QetGraphicsTableItem > m_table_item
Definition: graphicstablepropertieseditor.h:68
PropertiesEditorWidget
The PropertiesEditorWidget class This class extend QWidget method for have common way to edit propert...
Definition: propertieseditorwidget.h:31
GraphicsTablePropertiesEditor
The GraphicsTablePropertiesEditor class This widget is used to edit the property of both QetGraphicsT...
Definition: graphicstablepropertieseditor.h:39
PropertiesEditorWidget::m_live_edit
bool m_live_edit
Definition: propertieseditorwidget.h:50
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(NamesList)
GraphicsTablePropertiesEditor::on_m_next_pb_clicked
void on_m_next_pb_clicked()
Definition: graphicstablepropertieseditor.cpp:403
GraphicsTablePropertiesEditor::on_m_previous_pb_clicked
void on_m_previous_pb_clicked()
Definition: graphicstablepropertieseditor.cpp:394
ElementProvider
Definition: elementprovider.h:37
GraphicsTablePropertiesEditor::associatedUndo
QUndoCommand * associatedUndo() const override
GraphicsTablePropertiesEditor::associatedUndo.
Definition: graphicstablepropertieseditor.cpp:119
QetGraphicsTableItem
The QetGraphicsTableItem class This item display a table destined to represent the content of a QAbst...
Definition: qetgraphicstableitem.h:43
GraphicsTablePropertiesEditor::on_m_previous_table_cb_activated
void on_m_previous_table_cb_activated(int index)
Definition: graphicstablepropertieseditor.cpp:385
GraphicsTablePropertiesEditor::m_current_model_editor
QWidget * m_current_model_editor
Definition: graphicstablepropertieseditor.h:73
GraphicsTablePropertiesEditor::updateUi
virtual void updateUi() override
GraphicsTablePropertiesEditor::updateUi.
Definition: graphicstablepropertieseditor.cpp:246
itemmodelcommand.h
ModelHeaderDataCommand
The ModelHeaderDataCommand class Change the data of a header.
Definition: itemmodelcommand.h:53
GraphicsTablePropertiesEditor::on_m_table_name_le_textEdited
void on_m_table_name_le_textEdited(const QString &arg1)
Definition: graphicstablepropertieseditor.cpp:381
GraphicsTablePropertiesEditor::updateInfoLabel
void updateInfoLabel()
Definition: graphicstablepropertieseditor.cpp:313
GraphicsTablePropertiesEditor::on_m_apply_geometry_to_linked_table_pb_clicked
void on_m_apply_geometry_to_linked_table_pb_clicked()
GraphicsTablePropertiesEditor::on_m_apply_geometry_to_linked_table_pb_clicked.
Definition: graphicstablepropertieseditor.cpp:425
ModelIndexCommand
The ModelIndexCommand class Change a data of an index of QAbstractItemModel.
Definition: itemmodelcommand.h:32
GraphicsTablePropertiesEditor::ui
Ui::GraphicsTablePropertiesEditor * ui
Definition: graphicstablepropertieseditor.h:67
GraphicsTablePropertiesEditor::~GraphicsTablePropertiesEditor
~GraphicsTablePropertiesEditor() override
GraphicsTablePropertiesEditor::~GraphicsTablePropertiesEditor.
Definition: graphicstablepropertieseditor.cpp:62
elementprovider.h
QetGraphicsTableItem::adjustTableToFolio
static void adjustTableToFolio(QetGraphicsTableItem *table, QMargins margins=QMargins(20, 20, 20, 0))
QetGraphicsTableItem::adjustTableToFolio Adjust the table to fit at best the folio.
Definition: qetgraphicstableitem.cpp:42
propertieseditorwidget.h
GraphicsTablePropertiesEditor::on_m_header_font_pb_clicked
void on_m_header_font_pb_clicked()
GraphicsTablePropertiesEditor::on_m_header_font_pb_clicked.
Definition: graphicstablepropertieseditor.cpp:203
QETUtils::marginsToString
QString marginsToString(const QMargins &margins)
QETUtils::marginsToString.
Definition: qetutils.cpp:27
qpropertyundocommand.h
GraphicsTablePropertiesEditor::m_header_button_group
QButtonGroup * m_header_button_group
Definition: graphicstablepropertieseditor.h:71
GraphicsTablePropertiesEditor::m_edit_connection
QList< QMetaObject::Connection > m_edit_connection
Definition: graphicstablepropertieseditor.h:70
GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor
GraphicsTablePropertiesEditor(QetGraphicsTableItem *table=nullptr, QWidget *parent=nullptr)
GraphicsTablePropertiesEditor::GraphicsTablePropertiesEditor.
Definition: graphicstablepropertieseditor.cpp:37
propertieseditorfactory.h
Ui
Definition: autonumberingdockwidget.h:25
GraphicsTablePropertiesEditor::setUpEditConnection
void setUpEditConnection()
GraphicsTablePropertiesEditor::setUpEditConnection.
Definition: graphicstablepropertieseditor.cpp:348
qetgraphicsheaderitem.h
qetgraphicstableitem.h
GraphicsTablePropertiesEditor::m_table_button_group
QButtonGroup * m_table_button_group
Definition: graphicstablepropertieseditor.h:72
qetutils.h
QETUtils::marginsFromString
QMargins marginsFromString(const QString &string)
QETUtils::marginsFromString.
Definition: qetutils.cpp:46
GraphicsTablePropertiesEditor::setLiveEdit
virtual bool setLiveEdit(bool live_edit) override
PropertiesEditorWidget::setLiveEdit Set the editor in live edit mode. When an editor is in live edit ...
Definition: graphicstablepropertieseditor.cpp:189
ElementProvider::table
QVector< QetGraphicsTableItem * > table(QetGraphicsTableItem *table=nullptr, QAbstractItemModel *model=nullptr)
ElementProvider::table.
Definition: elementprovider.cpp:120
QetGraphicsTableItem::model
QAbstractItemModel * model() const
QetGraphicsTableItem::model.
Definition: qetgraphicstableitem.cpp:187
GraphicsTablePropertiesEditor::setTable
void setTable(QetGraphicsTableItem *table)
GraphicsTablePropertiesEditor::setTable Set the table to be edited.
Definition: graphicstablepropertieseditor.cpp:71
GraphicsTablePropertiesEditor::m_connect_list
QList< QMetaObject::Connection > m_connect_list
Definition: graphicstablepropertieseditor.h:69
GraphicsTablePropertiesEditor::m_other_table_vector
QVector< QetGraphicsTableItem * > m_other_table_vector
Definition: graphicstablepropertieseditor.h:74
graphicstablepropertieseditor.h
GraphicsTablePropertiesEditor::on_m_auto_geometry_pb_clicked
void on_m_auto_geometry_pb_clicked()
GraphicsTablePropertiesEditor::on_m_auto_geometry_pb_clicked.
Definition: graphicstablepropertieseditor.cpp:415
GraphicsTablePropertiesEditor::on_m_table_font_pb_clicked
void on_m_table_font_pb_clicked()
GraphicsTablePropertiesEditor::on_m_table_font_pb_clicked.
Definition: graphicstablepropertieseditor.cpp:224
QET::Horizontal
@ Horizontal
Horizontal segment.
Definition: qet.h:89
PropertiesEditorFactory::propertiesEditor
PropertiesEditorWidget * propertiesEditor(QAbstractItemModel *model, PropertiesEditorWidget *editor=nullptr, QWidget *parent=nullptr)
PropertiesEditorFactory::propertiesEditor.
Definition: propertieseditorfactory.cpp:47
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
GraphicsTablePropertiesEditor::apply
virtual void apply() override
GraphicsTablePropertiesEditor::apply Apply the current edition.
Definition: graphicstablepropertieseditor.cpp:103
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
diagram.h