QElectroTech  0.8-dev
inditextpropertieswidget.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 INDITEXTPROPERTIESWIDGET_H
19 #define INDITEXTPROPERTIESWIDGET_H
20 
22 #include <QPointer>
24 
25 namespace Ui {
27 }
28 
34 {
35  Q_OBJECT
36 
37  public:
38  IndiTextPropertiesWidget(IndependentTextItem *text = nullptr, QWidget *parent = nullptr);
39  IndiTextPropertiesWidget(QList <IndependentTextItem *> text_list, QWidget *parent = nullptr);
40  ~IndiTextPropertiesWidget() override;
41  void setText (IndependentTextItem *text);
42  void setText (QList<IndependentTextItem *> text_list);
43 
44  void apply() override;
45  bool setLiveEdit(bool live_edit) override;
46  QUndoCommand* associatedUndo() const override;
47 
48  private slots:
51  void on_m_font_pb_clicked();
52 
53  private:
54  void setUpEditConnection();
55  void updateUi() override;
56 
57  private:
58  Ui::IndiTextPropertiesWidget *ui;
59  QPointer <IndependentTextItem> m_text;
60  QList <QPointer<IndependentTextItem>> m_text_list;
61  QList <QMetaObject::Connection> m_connect_list,
64  bool m_font_is_selected = false;
65 };
66 
67 #endif // INDITEXTPROPERTIESWIDGET_H
IndiTextPropertiesWidget::m_edit_connection
QList< QMetaObject::Connection > m_edit_connection
Definition: inditextpropertieswidget.h:62
IndiTextPropertiesWidget::updateUi
void updateUi() override
IndiTextPropertiesWidget::updateUi.
Definition: inditextpropertieswidget.cpp:346
PropertiesEditorWidget
The PropertiesEditorWidget class This class extend QWidget method for have common way to edit propert...
Definition: propertieseditorwidget.h:31
diagramcommands.h
PropertiesEditorWidget::m_live_edit
bool m_live_edit
Definition: propertieseditorwidget.h:50
IndiTextPropertiesWidget::~IndiTextPropertiesWidget
~IndiTextPropertiesWidget() override
IndiTextPropertiesWidget::~IndiTextPropertiesWidget.
Definition: inditextpropertieswidget.cpp:60
IndiTextPropertiesWidget::IndiTextPropertiesWidget
IndiTextPropertiesWidget(IndependentTextItem *text=nullptr, QWidget *parent=nullptr)
IndiTextPropertiesWidget::IndiTextPropertiesWidget.
Definition: inditextpropertieswidget.cpp:32
IndiTextPropertiesWidget::m_selected_font
QFont m_selected_font
Definition: inditextpropertieswidget.h:63
IndiTextPropertiesWidget::m_text
QPointer< IndependentTextItem > m_text
Definition: inditextpropertieswidget.h:59
IndiTextPropertiesWidget::m_connect_list
QList< QMetaObject::Connection > m_connect_list
Definition: inditextpropertieswidget.h:61
IndiTextPropertiesWidget::apply
void apply() override
IndiTextPropertiesWidget::apply Apply the current edition through a QUndoCommand pushed to the undo s...
Definition: inditextpropertieswidget.cpp:118
IndiTextPropertiesWidget::ui
Ui::IndiTextPropertiesWidget * ui
Definition: inditextpropertieswidget.h:58
IndiTextPropertiesWidget::m_font_is_selected
bool m_font_is_selected
Definition: inditextpropertieswidget.h:64
inditextpropertieswidget.h
IndiTextPropertiesWidget::associatedUndo
QUndoCommand * associatedUndo() const override
IndiTextPropertiesWidget::associatedUndo.
Definition: inditextpropertieswidget.cpp:170
IndiTextPropertiesWidget::on_m_font_pb_clicked
void on_m_font_pb_clicked()
Definition: inditextpropertieswidget.cpp:442
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
propertieseditorwidget.h
DiagramTextItem::fontChanged
void fontChanged(QFont font)
qpropertyundocommand.h
IndiTextPropertiesWidget::m_text_list
QList< QPointer< IndependentTextItem > > m_text_list
Definition: inditextpropertieswidget.h:60
Diagram::undoStack
QUndoStack & undoStack()
Diagram::undoStack.
Definition: diagram.h:397
QPropertyUndoCommand::setAnimated
void setAnimated(bool animate=true, bool first_time=true)
QPropertyUndoCommand::setAnimated.
Definition: qpropertyundocommand.cpp:103
IndiTextPropertiesWidget::on_m_break_html_pb_clicked
void on_m_break_html_pb_clicked()
Definition: inditextpropertieswidget.cpp:430
Ui
Definition: autonumberingdockwidget.h:25
IndiTextPropertiesWidget::setText
void setText(IndependentTextItem *text)
IndiTextPropertiesWidget::setText.
Definition: inditextpropertieswidget.cpp:68
independenttextitem.h
ChangeDiagramTextCommand
The ChangeDiagramTextCommand class This commad modifies a text item.
Definition: diagramcommands.h:206
IndiTextPropertiesWidget::setUpEditConnection
void setUpEditConnection()
IndiTextPropertiesWidget::setUpEditConnection Disconnect the previous connection, and reconnect the c...
Definition: inditextpropertieswidget.cpp:322
IndependentTextItem
Definition: independenttextitem.h:28
IndiTextPropertiesWidget
The IndiTextPropertiesWidget class This widget is used to edit the properties of one or several indep...
Definition: inditextpropertieswidget.h:34
QPropertyUndoCommand
The QPropertyUndoCommand class This undo command manage QProperty of a QObject. This undo command can...
Definition: qpropertyundocommand.h:34
IndiTextPropertiesWidget::setLiveEdit
bool setLiveEdit(bool live_edit) override
IndiTextPropertiesWidget::setLiveEdit.
Definition: inditextpropertieswidget.cpp:147
IndiTextPropertiesWidget::on_m_advanced_editor_pb_clicked
void on_m_advanced_editor_pb_clicked()
IndiTextPropertiesWidget::on_m_advanced_editor_pb_clicked.
Definition: inditextpropertieswidget.cpp:424
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
diagram.h
DiagramTextItem::textEdited
void textEdited(const QString &old_str, const QString &new_str)