64 QDoubleSpinBox* doublespinbox; |
64 QDoubleSpinBox* doublespinbox; |
65 QSlider* slider; |
65 QSlider* slider; |
66 QCheckBox* checkbox; |
66 QCheckBox* checkbox; |
67 QPushButton* button; |
67 QPushButton* button; |
68 |
68 |
69 if ((le = qobject_cast<QLineEdit*> (widget)) != nullptr) |
69 if ((le = qobject_cast<QLineEdit*> (widget))) |
70 { |
70 { |
71 le->setText (value.toString()); |
71 le->setText (value.toString()); |
72 } |
72 } |
73 else if ((spinbox = qobject_cast<QSpinBox*> (widget)) != nullptr) |
73 else if ((spinbox = qobject_cast<QSpinBox*> (widget))) |
74 { |
74 { |
75 spinbox->setValue (value.toInt()); |
75 spinbox->setValue (value.toInt()); |
76 } |
76 } |
77 else if ((doublespinbox = qobject_cast<QDoubleSpinBox*> (widget)) != nullptr) |
77 else if ((doublespinbox = qobject_cast<QDoubleSpinBox*> (widget))) |
78 { |
78 { |
79 doublespinbox->setValue (value.toDouble()); |
79 doublespinbox->setValue (value.toDouble()); |
80 } |
80 } |
81 else if ((slider = qobject_cast<QSlider*> (widget)) != nullptr) |
81 else if ((slider = qobject_cast<QSlider*> (widget))) |
82 { |
82 { |
83 slider->setValue (value.toInt()); |
83 slider->setValue (value.toInt()); |
84 } |
84 } |
85 else if ((checkbox = qobject_cast<QCheckBox*> (widget)) != nullptr) |
85 else if ((checkbox = qobject_cast<QCheckBox*> (widget))) |
86 { |
86 { |
87 checkbox->setChecked (value.toBool()); |
87 checkbox->setChecked (value.toBool()); |
88 } |
88 } |
89 else if ((button = qobject_cast<QPushButton*> (widget)) != nullptr) |
89 else if ((button = qobject_cast<QPushButton*> (widget))) |
90 { |
90 { |
91 setButtonBackground (button, value.toString()); |
91 setButtonBackground (button, value.toString()); |
92 connect (button, SIGNAL (clicked()), this, SLOT (setButtonColor())); |
92 connect (button, SIGNAL (clicked()), this, SLOT (setButtonColor())); |
93 } |
93 } |
94 else |
94 else |
228 QDoubleSpinBox* doublespinbox; |
228 QDoubleSpinBox* doublespinbox; |
229 QSlider* slider; |
229 QSlider* slider; |
230 QCheckBox* checkbox; |
230 QCheckBox* checkbox; |
231 QPushButton* button; |
231 QPushButton* button; |
232 |
232 |
233 if ((le = qobject_cast<QLineEdit*> (widget)) != nullptr) |
233 if ((le = qobject_cast<QLineEdit*> (widget))) |
234 value = le->text(); |
234 value = le->text(); |
235 else if ((spinbox = qobject_cast<QSpinBox*> (widget)) != nullptr) |
235 else if ((spinbox = qobject_cast<QSpinBox*> (widget))) |
236 value = spinbox->value(); |
236 value = spinbox->value(); |
237 else if ((doublespinbox = qobject_cast<QDoubleSpinBox*> (widget)) != nullptr) |
237 else if ((doublespinbox = qobject_cast<QDoubleSpinBox*> (widget))) |
238 value = doublespinbox->value(); |
238 value = doublespinbox->value(); |
239 else if ((slider = qobject_cast<QSlider*> (widget)) != nullptr) |
239 else if ((slider = qobject_cast<QSlider*> (widget))) |
240 value = slider->value(); |
240 value = slider->value(); |
241 else if ((checkbox = qobject_cast<QCheckBox*> (widget)) != nullptr) |
241 else if ((checkbox = qobject_cast<QCheckBox*> (widget))) |
242 value = checkbox->isChecked(); |
242 value = checkbox->isChecked(); |
243 else if ((button = qobject_cast<QPushButton*> (widget)) != nullptr) |
243 else if ((button = qobject_cast<QPushButton*> (widget))) |
244 value = m_buttonColors[button]; |
244 value = m_buttonColors[button]; |
245 else |
245 else |
246 { |
246 { |
247 print ("Unknown widget of type %1\n", widget->metaObject()->className()); |
247 print ("Unknown widget of type %1\n", widget->metaObject()->className()); |
248 return; |
248 return; |