2009-04-03 19:30:25 +00:00
|
|
|
/*
|
2017-01-20 10:55:49 +00:00
|
|
|
Copyright 2006-2017 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/>.
|
|
|
|
*/
|
|
|
|
#ifndef RECTANGLE_EDITOR_H
|
|
|
|
#define RECTANGLE_EDITOR_H
|
2015-07-23 09:32:21 +00:00
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
#include "elementitemeditor.h"
|
2015-07-23 09:32:21 +00:00
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
class PartRectangle;
|
2010-02-18 00:42:41 +00:00
|
|
|
class StyleEditor;
|
2015-07-23 09:32:21 +00:00
|
|
|
class QDoubleSpinBox;
|
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
This class provides a widget to edit rectangles within the element editor.
|
2009-04-03 19:30:25 +00:00
|
|
|
*/
|
2015-07-22 13:19:43 +00:00
|
|
|
class RectangleEditor : public ElementItemEditor
|
|
|
|
{
|
2009-04-03 19:30:25 +00:00
|
|
|
Q_OBJECT
|
2015-07-22 13:19:43 +00:00
|
|
|
|
|
|
|
// constructors, destructor
|
2009-04-03 19:30:25 +00:00
|
|
|
public:
|
2017-08-05 02:06:59 +00:00
|
|
|
RectangleEditor(QETElementEditor *, PartRectangle * = nullptr, QWidget * = nullptr);
|
2017-08-05 02:10:01 +00:00
|
|
|
~RectangleEditor() override;
|
2009-04-03 19:30:25 +00:00
|
|
|
private:
|
2015-07-22 13:19:43 +00:00
|
|
|
RectangleEditor(const RectangleEditor &);
|
2009-04-03 19:30:25 +00:00
|
|
|
|
2015-07-22 13:19:43 +00:00
|
|
|
// attributes
|
2009-04-03 19:30:25 +00:00
|
|
|
private:
|
2015-07-22 13:19:43 +00:00
|
|
|
PartRectangle *part;
|
|
|
|
StyleEditor *style_;
|
|
|
|
QDoubleSpinBox *x, *y, *w, *h;
|
|
|
|
bool m_locked;
|
2009-04-03 19:30:25 +00:00
|
|
|
|
2015-07-22 13:19:43 +00:00
|
|
|
// methods
|
2010-02-18 00:42:41 +00:00
|
|
|
public:
|
2017-08-05 02:10:01 +00:00
|
|
|
bool setPart(CustomElementPart *) override;
|
|
|
|
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;
|
2015-07-22 13:19:43 +00:00
|
|
|
void editingFinished();
|
2009-04-03 19:30:25 +00:00
|
|
|
|
|
|
|
private:
|
2015-07-22 13:19:43 +00:00
|
|
|
void activeConnections(bool);
|
2009-04-03 19:30:25 +00:00
|
|
|
};
|
|
|
|
#endif
|