2009-04-03 19:30:25 +00:00
|
|
|
/*
|
2018-07-17 12:19:56 +00:00
|
|
|
Copyright 2006-2018 The QElectroTech Team
|
2009-04-03 19:30:25 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2018-07-17 12:19:56 +00:00
|
|
|
#ifndef RECTANGLEEDITOR_H
|
|
|
|
#define RECTANGLEEDITOR_H
|
2015-07-23 09:32:21 +00:00
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
#include "elementitemeditor.h"
|
2018-07-17 12:19:56 +00:00
|
|
|
#include <QWidget>
|
2015-07-23 09:32:21 +00:00
|
|
|
|
2010-02-18 00:42:41 +00:00
|
|
|
class StyleEditor;
|
2018-07-17 12:19:56 +00:00
|
|
|
class PartRectangle;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class RectangleEditor;
|
|
|
|
}
|
2015-07-23 09:32:21 +00:00
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
/**
|
2018-07-17 12:19:56 +00:00
|
|
|
* @brief The RectangleEditor class
|
|
|
|
* This class provides a widget to edit rectangles within the element editor.
|
|
|
|
*/
|
2015-07-22 13:19:43 +00:00
|
|
|
class RectangleEditor : public ElementItemEditor
|
|
|
|
{
|
2009-04-03 19:30:25 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2010-02-18 00:42:41 +00:00
|
|
|
public:
|
2018-07-17 12:19:56 +00:00
|
|
|
explicit RectangleEditor(QETElementEditor *editor, PartRectangle *rect = nullptr, QWidget *parent = nullptr);
|
|
|
|
~RectangleEditor();
|
|
|
|
|
|
|
|
bool setPart(CustomElementPart *part) override;
|
2017-08-05 02:10:01 +00:00
|
|
|
CustomElementPart *currentPart() const override;
|
2015-07-22 13:19:43 +00:00
|
|
|
QPointF editedTopLeft () const;
|
2010-02-18 00:42:41 +00:00
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
public slots:
|
2017-08-05 02:10:01 +00:00
|
|
|
void updateForm() override;
|
2018-07-17 12:19:56 +00:00
|
|
|
private:
|
2015-07-22 13:19:43 +00:00
|
|
|
void editingFinished();
|
2018-07-17 12:19:56 +00:00
|
|
|
void activeConnections(bool active);
|
2009-04-03 19:30:25 +00:00
|
|
|
|
|
|
|
private:
|
2018-07-17 12:19:56 +00:00
|
|
|
bool m_locked = false;
|
|
|
|
StyleEditor *m_style;
|
|
|
|
PartRectangle *m_part;
|
|
|
|
Ui::RectangleEditor *ui;
|
2009-04-03 19:30:25 +00:00
|
|
|
};
|
2018-07-17 12:19:56 +00:00
|
|
|
|
|
|
|
#endif // RECTANGLEEDITOR_H
|