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 Q_TEXT_ORIENTATION_SPINBOX_WIDGET_H 19 #define Q_TEXT_ORIENTATION_SPINBOX_WIDGET_H 20 #include <QtWidgets> 21 #include "qtextorientationwidget.h" 22 /** 23 This class provides a widget grouping a QTextOrientationWidget and QSpinBox 24 next to each other. 25 @see QTextOrientationWidget 26 */ 27 class QTextOrientationSpinBoxWidget : public QWidget { 28 Q_OBJECT 29 30 // constructors, destructor 31 public: 32 QTextOrientationSpinBoxWidget(QWidget * = nullptr); 33 ~QTextOrientationSpinBoxWidget() override; 34 private: 35 QTextOrientationSpinBoxWidget(const QTextOrientationSpinBoxWidget &); 36 37 signals: 38 /** 39 Signals emitted when users have finished editing the orientation. 40 */ 41 void editingFinished(double); 42 void editingFinished(); 43 44 // methods 45 public: 46 QTextOrientationWidget *orientationWidget() const; 47 QDoubleSpinBox *spinBox() const; 48 double orientation() const; 49 double value() const; 50 bool isReadOnly() const; 51 52 public slots: 53 void setOrientation(const double &); 54 void setValue(const double &); 55 void setReadOnly(bool); 56 57 private: 58 void build(); 59 60 private slots: 61 void emitChangeSignals(); 62 63 // attributes 64 private: 65 QTextOrientationWidget *orientation_widget_; 66 QDoubleSpinBox *spin_box_; 67 }; 68 #endif 69