2019-03-10 17:58:33 +00:00
|
|
|
|
/*
|
2019-01-13 16:56:12 +00:00
|
|
|
|
Copyright 2006-2019 The QElectroTech Team
|
2007-12-01 10:47:15 +00:00
|
|
|
|
This file is part of QElectroTech.
|
2019-03-10 17:58:33 +00:00
|
|
|
|
|
2007-12-01 10:47:15 +00:00
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
2019-03-10 17:58:33 +00:00
|
|
|
|
|
2007-12-01 10:47:15 +00:00
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
2019-03-10 17:58:33 +00:00
|
|
|
|
|
2007-12-01 10:47:15 +00:00
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2019-03-10 17:58:33 +00:00
|
|
|
|
#ifndef TEXTEDITOR_H
|
|
|
|
|
#define TEXTEDITOR_H
|
2015-07-24 12:56:27 +00:00
|
|
|
|
|
2007-08-25 03:43:05 +00:00
|
|
|
|
#include "elementitemeditor.h"
|
2015-07-24 12:56:27 +00:00
|
|
|
|
|
2019-03-10 17:58:33 +00:00
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
2007-06-30 17:41:07 +00:00
|
|
|
|
class PartText;
|
2015-07-24 12:56:27 +00:00
|
|
|
|
|
2019-03-10 17:58:33 +00:00
|
|
|
|
namespace Ui {
|
|
|
|
|
class TextEditor;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-24 12:56:27 +00:00
|
|
|
|
class TextEditor : public ElementItemEditor
|
|
|
|
|
{
|
2019-03-10 17:58:33 +00:00
|
|
|
|
Q_OBJECT
|
2015-07-24 12:56:27 +00:00
|
|
|
|
|
2007-06-30 17:41:07 +00:00
|
|
|
|
public:
|
2019-03-10 17:58:33 +00:00
|
|
|
|
explicit TextEditor(QETElementEditor *editor, PartText *text = nullptr, QWidget *parent = nullptr);
|
2017-08-05 02:10:01 +00:00
|
|
|
|
~TextEditor() override;
|
2019-03-10 17:58:33 +00:00
|
|
|
|
|
2017-08-05 02:10:01 +00:00
|
|
|
|
void updateForm() override;
|
2019-03-10 17:58:33 +00:00
|
|
|
|
bool setPart(CustomElementPart *part) override;
|
2020-05-28 18:36:02 +02:00
|
|
|
|
bool setParts(QList <CustomElementPart *>) override;
|
2019-03-10 17:58:33 +00:00
|
|
|
|
CustomElementPart *currentPart() const override;
|
2020-06-01 20:45:01 +02:00
|
|
|
|
QList<CustomElementPart*> currentParts() const override;
|
2019-03-10 17:58:33 +00:00
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void on_m_font_pb_clicked();
|
|
|
|
|
void on_m_color_pb_changed(const QColor &newColor);
|
2007-08-25 03:43:05 +00:00
|
|
|
|
private:
|
2019-03-10 17:58:33 +00:00
|
|
|
|
void setUpEditConnection();
|
2020-05-28 18:36:02 +02:00
|
|
|
|
void setUpChangeConnection(QPointer<PartText> part);
|
|
|
|
|
void disconnectChangeConnection();
|
|
|
|
|
void disconnectEditConnection();
|
2019-03-10 17:58:33 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Ui::TextEditor *ui;
|
|
|
|
|
|
|
|
|
|
QPointer <PartText> m_text;
|
2020-05-28 20:48:56 +02:00
|
|
|
|
QList<PartText*> m_parts;
|
2019-03-10 17:58:33 +00:00
|
|
|
|
QList <QMetaObject::Connection> m_edit_connection;
|
2020-05-28 18:36:02 +02:00
|
|
|
|
QList <QMetaObject::Connection> m_change_connection;
|
2007-06-30 17:41:07 +00:00
|
|
|
|
};
|
2019-03-10 17:58:33 +00:00
|
|
|
|
|
|
|
|
|
#endif // TEXTEDITOR_H
|