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 ARC_EDITOR_H 19 #define ARC_EDITOR_H 20 21 #include "elementitemeditor.h" 22 23 class PartArc; 24 class StyleEditor; 25 class QDoubleSpinBox; 26 class QSpinBox; 27 28 /** 29 This class provides a widget to edit elliptical arcs within the element editor. 30 */ 31 class ArcEditor : public ElementItemEditor 32 { 33 Q_OBJECT 34 35 // constructors, destructor 36 public: 37 ArcEditor(QETElementEditor *, PartArc * = nullptr, QWidget * = nullptr); 38 ~ArcEditor() override; 39 private: 40 ArcEditor(const ArcEditor &); 41 42 // attributes 43 private: 44 PartArc *part; 45 StyleEditor *style_; 46 QDoubleSpinBox *x, *y, *h, *v; 47 QSpinBox *angle, *start_angle; 48 bool m_locked; 49 50 // methods 51 public: 52 bool setPart(CustomElementPart *) override; 53 CustomElementPart *currentPart() const override; 54 55 public slots: 56 void updateArcS(); 57 void updateArcA(); 58 void updateArcRect(); 59 void updateForm() override; 60 61 private: 62 void activeConnections(bool); 63 }; 64 #endif 65