QElectroTech  0.70
qtextorientationspinboxwidget.cpp
Go to the documentation of this file.
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 */
19 
25  QWidget(parent)
26 {
27  build();
28 }
29 
34 }
35 
40  return(orientation_widget_);
41 }
42 
46 QDoubleSpinBox *QTextOrientationSpinBoxWidget::spinBox() const {
47  return(spin_box_);
48 }
49 
54  return(orientation_widget_ -> orientation());
55 }
56 
63  return(orientation());
64 }
65 
70  return(orientation_widget_ -> isReadOnly());
71 }
72 
79 }
80 
86 void QTextOrientationSpinBoxWidget::setValue(const double &value) {
88 }
89 
96 }
97 
103  orientation_widget_ -> setMinimumSize(90.0, 90.0);
104 
105  spin_box_ = new QDoubleSpinBox();
106  spin_box_ -> setRange(-360.0, 360.0);
107  spin_box_ -> setSuffix("°");
108 
109  // met en place les relations entre le SpinBox et le QTextOrientationWidget
110  connect(spin_box_, SIGNAL(valueChanged(double)), orientation_widget_, SLOT(setOrientation(double)));
111  connect(orientation_widget_, SIGNAL(orientationChanged(double)), spin_box_, SLOT(setValue(double)));
112 
113  // cliquer sur un des carres du QTextOrientationWidget revient a finir une saisie dans le SpinBox
114  connect(orientation_widget_, SIGNAL(orientationChanged(double)), spin_box_, SIGNAL(editingFinished()));
115 
116  // lorsque l'utilisateur a change l'orientation, on emet un signal avec la valeur de la nouvelle orientation
117  connect(spin_box_, SIGNAL(editingFinished()), this, SLOT(emitChangeSignals()));
118 
119  // dispose les widgets : le QTextOrientationWidget a gauche, le SpinBox a droite
120  QHBoxLayout *main_layout = new QHBoxLayout();
121  main_layout -> addWidget(orientation_widget_);
122  main_layout -> addWidget(spin_box_);
123  main_layout -> addStretch();
124  setLayout(main_layout);
125 }
126 
127 
132  emit(editingFinished(orientation()));
133  emit(editingFinished());
134 }
QTextOrientationWidget * orientationWidget() const
QIcon ro
Definition: qeticons.cpp:199
QTextOrientationWidget * orientation_widget_