QElectroTech  0.70
texteditor.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 TEXTEDITOR_H
19 #define TEXTEDITOR_H
20 
21 #include "elementitemeditor.h"
22 
23 #include <QWidget>
24 #include <QPointer>
25 
26 class PartText;
27 
28 namespace Ui {
29 class TextEditor;
30 }
31 
33 {
34  Q_OBJECT
35 
36  public:
37  explicit TextEditor(QETElementEditor *editor, PartText *text = nullptr, QWidget *parent = nullptr);
38  ~TextEditor() override;
39 
40  void updateForm() override;
41  bool setPart(CustomElementPart *part) override;
42  CustomElementPart *currentPart() const override;
43 
44  private slots:
45  void on_m_font_pb_clicked();
46  void on_m_color_pb_changed(const QColor &newColor);
47  private:
48  void setUpEditConnection();
49 
50  private:
51  Ui::TextEditor *ui;
52 
53  QPointer <PartText> m_text;
54  QList <QMetaObject::Connection> m_edit_connection;
55  QList <QMetaObject::Connection> m_change_connection;
56 };
57 
58 #endif // TEXTEDITOR_H
QList< QMetaObject::Connection > m_edit_connection
Definition: texteditor.h:54
void on_m_color_pb_changed(const QColor &newColor)
TextEditor::on_m_color_pb_changed.
Definition: texteditor.cpp:216
QPointer< PartText > m_text
Definition: texteditor.h:53
bool setPart(CustomElementPart *part) override
TextEditor::setPart Set the current text to edit. Set to nullptr to clear the current text...
Definition: texteditor.cpp:83
~TextEditor() override
TextEditor::~TextEditor.
Definition: texteditor.cpp:46
TextEditor(QETElementEditor *editor, PartText *text=nullptr, QWidget *parent=nullptr)
TextEditor::TextEditor Default constructor.
Definition: texteditor.cpp:30
void on_m_font_pb_clicked()
TextEditor::on_m_font_pb_clicked.
Definition: texteditor.cpp:194
void updateForm() override
TextEditor::updateForm Update the gui.
Definition: texteditor.cpp:54
CustomElementPart * currentPart() const override
TextEditor::currentPart.
Definition: texteditor.cpp:120
Ui::TextEditor * ui
Definition: texteditor.h:51
void setUpEditConnection()
TextEditor::setUpEditConnection Setup the connection between the widgets of this editor and the undo ...
Definition: texteditor.cpp:129
QList< QMetaObject::Connection > m_change_connection
Definition: texteditor.h:55