8#include <QtWidgets/qabstractitemview.h>
9#include <QtWidgets/qapplication.h>
10#include <QtWidgets/qboxlayout.h>
11#include <QtWidgets/qcolordialog.h>
12#include <QtWidgets/qcombobox.h>
13#if QT_CONFIG(datetimeedit)
14#include <QtWidgets/qdatetimeedit.h>
16#include <QtWidgets/qfontdialog.h>
17#include <QtWidgets/qkeysequenceedit.h>
18#include <QtWidgets/qlabel.h>
19#include <QtWidgets/qlayoutitem.h>
20#include <QtWidgets/qlineedit.h>
21#include <QtWidgets/qmenu.h>
22#include <QtWidgets/qscrollbar.h>
23#include <QtWidgets/qspinbox.h>
24#include <QtWidgets/qtoolbutton.h>
26#include <QtGui/qevent.h>
27#include <QtGui/qvalidator.h>
29#include <QtCore/qhash.h>
30#include <QtCore/qregularexpression.h>
39 enum { DecorationMargin = 4 };
40 if (QApplication::layoutDirection() == Qt::LeftToRight)
41 lt->setContentsMargins(DecorationMargin, 0, 0, 0);
43 lt->setContentsMargins(0, 0, DecorationMargin, 0);
49template <
class Editor>
67template <
class Editor>
70 auto *editor =
new Editor(parent);
75template <
class Editor>
78 auto it = m_createdEditors.find(property);
79 if (it == m_createdEditors.end())
80 it = m_createdEditors.insert(property, EditorList());
81 it.value().append(editor);
84template <
class Editor>
87 auto pred = [object] (
const Editor *e) {
return object == e; };
88 for (
auto it = m_createdEditors.begin(), end = m_createdEditors.end(); it != end; ++it) {
89 auto &editorList = it.value();
90 auto listIt = std::find_if(editorList.cbegin(), editorList.cend(), pred);
91 if (listIt != editorList.cend()) {
92 editorList.erase(listIt);
93 if (editorList.isEmpty())
94 m_createdEditors.erase(it) ;
100template <
class Editor>
103 for (
auto it = m_createdEditors.begin(), end = m_createdEditors.end(); it != end; ++it)
104 qDeleteAll(it.value());
105 m_createdEditors.clear();
113 Q_DECLARE_PUBLIC(QtSpinBoxFactory)
124 const auto it = m_createdEditors.constFind(property);
125 if (it == m_createdEditors.cend())
127 for (QSpinBox *editor : it.value()) {
128 if (editor->value() != value) {
129 editor->blockSignals(
true);
130 editor->setValue(value);
131 editor->blockSignals(
false);
138 const auto it = m_createdEditors.constFind(property);
139 if (it == m_createdEditors.cend())
146 for (QSpinBox *editor : it.value()) {
147 editor->blockSignals(
true);
148 editor->setRange(min, max);
149 editor->setValue(manager->value(property));
150 editor->blockSignals(
false);
156 const auto it = m_createdEditors.constFind(property);
157 if (it == m_createdEditors.cend())
159 for (QSpinBox *editor : it.value()) {
160 editor->blockSignals(
true);
161 editor->setSingleStep(step);
162 editor->blockSignals(
false);
169 manager->setValue(property, value);
173
174
175
176
177
178
179
180
181
182
185
186
188 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSpinBoxFactoryPrivate())
195
196
199 d_ptr->deleteEditors();
203
204
205
206
209 connect(manager, &QtIntPropertyManager::valueChanged,
211 { d_ptr->slotPropertyChanged(property, value); });
213 this, [
this](
QtProperty *property,
int min,
int max)
214 { d_ptr->slotRangeChanged(property, min, max); });
217 { d_ptr->slotSingleStepChanged(property, value); });
221
222
223
224
228 QSpinBox *editor = d_ptr->createEditor(property, parent);
231 editor->setValue(manager
->value(property
));
232 editor->setKeyboardTracking(
false);
234 connect(editor, &QSpinBox::valueChanged,
235 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
236 connect(editor, &QObject::destroyed,
237 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
242
243
244
245
248 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
258 Q_DECLARE_PUBLIC(QtSliderFactory)
268 const auto it = m_createdEditors.constFind(property);
269 if (it == m_createdEditors.cend())
271 for (QSlider *editor : it.value()) {
272 editor->blockSignals(
true);
273 editor->setValue(value);
274 editor->blockSignals(
false);
280 const auto it = m_createdEditors.constFind(property);
281 if (it == m_createdEditors.cend())
288 for (QSlider *editor : it.value()) {
289 editor->blockSignals(
true);
290 editor->setRange(min, max);
291 editor->setValue(manager->value(property));
292 editor->blockSignals(
false);
298 const auto it = m_createdEditors.constFind(property);
299 if (it == m_createdEditors.cend())
301 for (QSlider *editor : it.value()) {
302 editor->blockSignals(
true);
303 editor->setSingleStep(step);
304 editor->blockSignals(
false);
311 manager->setValue(property, value);
315
316
317
318
319
320
321
322
323
324
327
328
330 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSliderFactoryPrivate())
337
338
341 d_ptr->deleteEditors();
345
346
347
348
351 connect(manager, &QtIntPropertyManager::valueChanged,
353 { d_ptr->slotPropertyChanged(property, value); });
355 this, [
this](
QtProperty *property,
int min,
int max)
356 { d_ptr->slotRangeChanged(property, min, max); });
359 { d_ptr->slotSingleStepChanged(property, value); });
363
364
365
366
370 auto *editor =
new QSlider(Qt::Horizontal, parent);
371 d_ptr->initializeEditor(property, editor);
374 editor->setValue(manager
->value(property
));
376 connect(editor, &QSlider::valueChanged,
377 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
378 connect(editor, &QObject::destroyed,
379 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
384
385
386
387
390 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
400 Q_DECLARE_PUBLIC(QtScrollBarFactory)
410 const auto it = m_createdEditors.constFind(property);
411 if (it == m_createdEditors.cend())
414 for (QScrollBar *editor : it.value()) {
415 editor->blockSignals(
true);
416 editor->setValue(value);
417 editor->blockSignals(
false);
423 const auto it = m_createdEditors.constFind(property);
424 if (it == m_createdEditors.cend())
431 for (QScrollBar *editor : it.value()) {
432 editor->blockSignals(
true);
433 editor->setRange(min, max);
434 editor->setValue(manager->value(property));
435 editor->blockSignals(
false);
441 const auto it = m_createdEditors.constFind(property);
442 if (it == m_createdEditors.cend())
444 for (QScrollBar *editor : it.value()) {
445 editor->blockSignals(
true);
446 editor->setSingleStep(step);
447 editor->blockSignals(
false);
454 manager->setValue(property, value);
458
459
460
461
462
463
464
465
466
467
470
471
473 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtScrollBarFactoryPrivate())
480
481
484 d_ptr->deleteEditors();
488
489
490
491
494 connect(manager, &QtIntPropertyManager::valueChanged,
496 { d_ptr->slotPropertyChanged(property, value); });
498 this, [
this](
QtProperty *property,
int min,
int max)
499 { d_ptr->slotRangeChanged(property, min, max); });
502 { d_ptr->slotSingleStepChanged(property, value); });
506
507
508
509
513 auto *editor =
new QScrollBar(Qt::Horizontal, parent);
514 d_ptr->initializeEditor(property, editor);
517 editor->setValue(manager
->value(property
));
518 connect(editor, &QScrollBar::valueChanged,
519 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
520 connect(editor, &QObject::destroyed,
521 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
526
527
528
529
532 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
542 Q_DECLARE_PUBLIC(QtCheckBoxFactory)
550 const auto it = m_createdEditors.constFind(property);
551 if (it == m_createdEditors.cend())
554 for (QtBoolEdit *editor : it.value()) {
555 editor->blockCheckBoxSignals(
true);
556 editor->setChecked(value);
557 editor->blockCheckBoxSignals(
false);
564 manager->setValue(property, value);
568
569
570
571
572
573
574
575
576
577
580
581
583 : QtAbstractEditorFactory<QtBoolPropertyManager>(parent), d_ptr(
new QtCheckBoxFactoryPrivate())
590
591
594 d_ptr->deleteEditors();
598
599
600
601
604 connect(manager, &QtBoolPropertyManager::valueChanged,
605 this, [
this](
QtProperty *property,
bool value)
606 { d_ptr->slotPropertyChanged(property, value); });
610
611
612
613
617 QtBoolEdit *editor = d_ptr->createEditor(property, parent);
620 connect(editor, &QtBoolEdit::toggled,
621 this, [
this, property](
bool value) { d_ptr->slotSetValue(property, value); });
622 connect(editor, &QObject::destroyed,
623 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
628
629
630
631
634 disconnect(manager, &QtBoolPropertyManager::valueChanged,
this,
nullptr);
642 Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
654 const auto it = m_createdEditors.constFind(property);
655 if (it == m_createdEditors.cend())
657 for (QDoubleSpinBox *editor : it.value()) {
658 if (editor->value() != value) {
659 editor->blockSignals(
true);
660 editor->setValue(value);
661 editor->blockSignals(
false);
667 double min,
double max)
669 const auto it = m_createdEditors.constFind(property);
670 if (it == m_createdEditors.cend())
677 for (QDoubleSpinBox *editor : it.value()) {
678 editor->blockSignals(
true);
679 editor->setRange(min, max);
680 editor->setValue(manager->value(property));
681 editor->blockSignals(
false);
687 const auto it = m_createdEditors.constFind(property);
688 if (it == m_createdEditors.cend())
695 for (QDoubleSpinBox *editor : it.value()) {
696 editor->blockSignals(
true);
697 editor->setSingleStep(step);
698 editor->blockSignals(
false);
704 const auto it = m_createdEditors.constFind(property);
705 if (it == m_createdEditors.constEnd())
712 for (QDoubleSpinBox *editor : it.value()) {
713 editor->blockSignals(
true);
714 editor->setDecimals(prec);
715 editor->setValue(manager->value(property));
716 editor->blockSignals(
false);
723 manager->setValue(property, value);
727
728
729
730
731
732
733
734
735
738
739
741 : QtAbstractEditorFactory<QtDoublePropertyManager>(parent), d_ptr(
new QtDoubleSpinBoxFactoryPrivate())
748
749
752 d_ptr->deleteEditors();
756
757
758
759
762 connect(manager, &QtDoublePropertyManager::valueChanged,
763 this, [
this](
QtProperty *property,
double value)
764 { d_ptr->slotPropertyChanged(property, value); });
766 this, [
this](
QtProperty *property,
double min,
double max)
767 { d_ptr->slotRangeChanged(property, min, max); });
769 this, [
this](
QtProperty *property,
double value)
770 { d_ptr->slotSingleStepChanged(property, value); });
773 { d_ptr->slotDecimalsChanged(property, value); });
777
778
779
780
784 QDoubleSpinBox *editor = d_ptr->createEditor(property, parent);
788 editor->setValue(manager
->value(property
));
789 editor->setKeyboardTracking(
false);
791 connect(editor, &QDoubleSpinBox::valueChanged,
792 this, [
this, property](
double value) { d_ptr->slotSetValue(property, value); });
793 connect(editor, &QObject::destroyed,
794 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
799
800
801
802
805 disconnect(manager, &QtDoublePropertyManager::valueChanged,
this,
nullptr);
816 Q_DECLARE_PUBLIC(QtLineEditFactory)
825 const QString &value)
827 const auto it = m_createdEditors.constFind(property);
828 if (it == m_createdEditors.constEnd())
831 for (QLineEdit *editor : it.value()) {
832 if (editor->text() != value)
833 editor->setText(value);
838 const QRegularExpression ®Exp)
840 const auto it = m_createdEditors.constFind(property);
841 if (it == m_createdEditors.constEnd())
848 for (QLineEdit *editor : it.value()) {
849 editor->blockSignals(
true);
850 const QValidator *oldValidator = editor->validator();
851 QValidator *newValidator =
nullptr;
852 if (regExp.isValid()) {
853 newValidator =
new QRegularExpressionValidator(regExp, editor);
855 editor->setValidator(newValidator);
857 editor->blockSignals(
false);
864 manager->setValue(property, value);
868
869
870
871
872
873
874
875
876
877
880
881
883 : QtAbstractEditorFactory<QtStringPropertyManager>(parent), d_ptr(
new QtLineEditFactoryPrivate())
890
891
894 d_ptr->deleteEditors();
898
899
900
901
904 connect(manager, &QtStringPropertyManager::valueChanged,
905 this, [
this](
QtProperty *property,
const QString &value)
906 { d_ptr->slotPropertyChanged(property, value); });
908 this, [
this](
QtProperty *property,
const QRegularExpression &value)
909 { d_ptr->slotRegExpChanged(property, value); });
913
914
915
916
920 QLineEdit *editor = d_ptr->createEditor(property, parent);
921 QRegularExpression regExp = manager->regExp(property);
922 if (regExp.isValid() && !regExp.pattern().isEmpty()) {
923 auto *validator =
new QRegularExpressionValidator(regExp, editor);
924 editor->setValidator(validator);
926 editor->setText(manager->value(property));
928 connect(editor, &QLineEdit::textEdited,
929 this, [
this, property](
const QString &value) { d_ptr->slotSetValue(property, value); });
930 connect(editor, &QObject::destroyed,
931 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
936
937
938
939
942 disconnect(manager, &QtStringPropertyManager::valueChanged,
this,
nullptr);
951 Q_DECLARE_PUBLIC(QtDateEditFactory)
961 const auto it = m_createdEditors.constFind(property);
962 if (it == m_createdEditors.constEnd())
964 for (QDateEdit *editor : it.value()) {
965 editor->blockSignals(
true);
966 editor->setDate(value);
967 editor->blockSignals(
false);
973 const auto it = m_createdEditors.constFind(property);
974 if (it == m_createdEditors.constEnd())
981 for (QDateEdit *editor : it.value()) {
982 editor->blockSignals(
true);
983 editor->setDateRange(min, max);
984 editor->setDate(manager->value(property));
985 editor->blockSignals(
false);
992 manager->setValue(property, value);
996
997
998
999
1000
1001
1002
1003
1004
1005
1008
1009
1011 : QtAbstractEditorFactory<QtDatePropertyManager>(parent), d_ptr(
new QtDateEditFactoryPrivate())
1013 d_ptr->q_ptr =
this;
1018
1019
1022 d_ptr->deleteEditors();
1026
1027
1028
1029
1032 connect(manager, &QtDatePropertyManager::valueChanged,
1033 this, [
this](
QtProperty *property, QDate value)
1034 { d_ptr->slotPropertyChanged(property, value); });
1036 this, [
this](
QtProperty *property, QDate min, QDate max)
1037 { d_ptr->slotRangeChanged(property, min, max); });
1041
1042
1043
1044
1048 QDateEdit *editor = d_ptr->createEditor(property, parent);
1049 editor->setDisplayFormat(QtPropertyBrowserUtils::dateFormat());
1050 editor->setCalendarPopup(
true);
1052 editor->setDate(manager
->value(property));
1054 connect(editor, &QDateEdit::dateChanged,
1055 this, [
this, property](QDate value) { d_ptr->slotSetValue(property, value); });
1056 connect(editor, &QObject::destroyed,
1057 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1062
1063
1064
1065
1068 disconnect(manager, &QtDatePropertyManager::valueChanged,
this,
nullptr);
1077 Q_DECLARE_PUBLIC(QtTimeEditFactory)
1086 const auto it = m_createdEditors.constFind(property);
1087 if (it == m_createdEditors.constEnd())
1089 for (QTimeEdit *editor : it.value()) {
1090 editor->blockSignals(
true);
1091 editor->setTime(value);
1092 editor->blockSignals(
false);
1099 manager->setValue(property, value);
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1115
1116
1118 : QtAbstractEditorFactory<QtTimePropertyManager>(parent), d_ptr(
new QtTimeEditFactoryPrivate())
1120 d_ptr->q_ptr =
this;
1125
1126
1129 d_ptr->deleteEditors();
1133
1134
1135
1136
1139 connect(manager, &QtTimePropertyManager::valueChanged,
1140 this, [
this](
QtProperty *property, QTime value)
1141 { d_ptr->slotPropertyChanged(property, value); });
1145
1146
1147
1148
1152 QTimeEdit *editor = d_ptr->createEditor(property, parent);
1153 editor->setDisplayFormat(QtPropertyBrowserUtils::timeFormat());
1154 editor->setTime(manager
->value(property));
1156 connect(editor, &QTimeEdit::timeChanged,
1157 this, [
this, property](QTime value) { d_ptr->slotSetValue(property, value); });
1158 connect(editor, &QObject::destroyed,
1159 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1164
1165
1166
1167
1170 disconnect(manager, &QtTimePropertyManager::valueChanged,
this,
nullptr);
1173#if QT_CONFIG(datetimeedit)
1176class QtDateTimeEditFactoryPrivate :
public EditorFactoryPrivate<QDateTimeEdit>
1178 QtDateTimeEditFactory *q_ptr =
nullptr;
1179 Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
1182 void slotPropertyChanged(QtProperty *property,
const QDateTime &value);
1183 void slotSetValue(QtProperty *property,
const QDateTime &value);
1187void QtDateTimeEditFactoryPrivate::slotPropertyChanged(QtProperty *property,
1188 const QDateTime &value)
1190 const auto it = m_createdEditors.constFind(property);
1191 if (it == m_createdEditors.constEnd())
1194 for (QDateTimeEdit *editor : it.value()) {
1195 editor->blockSignals(
true);
1196 editor->setDateTime(value);
1197 editor->blockSignals(
false);
1201void QtDateTimeEditFactoryPrivate::slotSetValue(QtProperty *property,
const QDateTime &value)
1203 if (QtDateTimePropertyManager *manager = q_ptr->propertyManager(property))
1204 manager->setValue(property, value);
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1220
1221
1222QtDateTimeEditFactory::QtDateTimeEditFactory(QObject *parent)
1223 : QtAbstractEditorFactory<QtDateTimePropertyManager>(parent), d_ptr(
new QtDateTimeEditFactoryPrivate())
1225 d_ptr->q_ptr =
this;
1230
1231
1232QtDateTimeEditFactory::~QtDateTimeEditFactory()
1234 d_ptr->deleteEditors();
1238
1239
1240
1241
1242void QtDateTimeEditFactory::connectPropertyManager(QtDateTimePropertyManager *manager)
1244 connect(manager, &QtDateTimePropertyManager::valueChanged,
1245 this, [
this](QtProperty *property,
const QDateTime &value)
1246 { d_ptr->slotPropertyChanged(property, value); });
1250
1251
1252
1253
1254QWidget *QtDateTimeEditFactory::createEditor(QtDateTimePropertyManager *manager,
1255 QtProperty *property, QWidget *parent)
1257 QDateTimeEdit *editor = d_ptr->createEditor(property, parent);
1258 editor->setDisplayFormat(QtPropertyBrowserUtils::dateTimeFormat());
1259 editor->setDateTime(manager->value(property));
1261 connect(editor, &QDateTimeEdit::dateTimeChanged,
1262 this, [
this, property](
const QDateTime &value) { d_ptr->slotSetValue(property, value); });
1263 connect(editor, &QObject::destroyed,
1264 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1269
1270
1271
1272
1273void QtDateTimeEditFactory::disconnectPropertyManager(QtDateTimePropertyManager *manager)
1275 disconnect(manager, &QtDateTimePropertyManager::valueChanged,
this,
nullptr);
1284 Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
1292 const QKeySequence &value)
1294 const auto it = m_createdEditors.constFind(property);
1295 if (it == m_createdEditors.constEnd())
1298 for (QKeySequenceEdit *editor : it.value()) {
1299 editor->blockSignals(
true);
1300 editor->setKeySequence(value);
1301 editor->blockSignals(
false);
1308 manager->setValue(property, value);
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1324
1325
1327 : QtAbstractEditorFactory<QtKeySequencePropertyManager>(parent), d_ptr(
new QtKeySequenceEditorFactoryPrivate())
1329 d_ptr->q_ptr =
this;
1334
1335
1338 d_ptr->deleteEditors();
1342
1343
1344
1345
1348 connect(manager, &QtKeySequencePropertyManager::valueChanged,
1349 this, [
this](
QtProperty *property,
const QKeySequence &value)
1350 { d_ptr->slotPropertyChanged(property, value); });
1354
1355
1356
1357
1361 QKeySequenceEdit *editor = d_ptr->createEditor(property, parent);
1362 editor->setKeySequence(manager->value(property));
1364 connect(editor, &QKeySequenceEdit::keySequenceChanged,
1365 this, [
this, property](
const QKeySequence &value) { d_ptr->slotSetValue(property, value); });
1366 connect(editor, &QObject::destroyed,
1367 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1372
1373
1374
1375
1378 disconnect(manager, &QtKeySequencePropertyManager::valueChanged,
this,
nullptr);
1404 void handleKeyEvent(QKeyEvent *e);
1407 QLineEdit *m_lineEdit;
1411 : QWidget(parent), m_lineEdit(
new QLineEdit(
this))
1413 auto *layout =
new QHBoxLayout(
this);
1414 layout->addWidget(m_lineEdit);
1415 layout->setContentsMargins(QMargins());
1416 m_lineEdit->installEventFilter(
this);
1417 m_lineEdit->setReadOnly(
true);
1418 m_lineEdit->setFocusProxy(
this);
1419 setFocusPolicy(m_lineEdit->focusPolicy());
1420 setAttribute(Qt::WA_InputMethodEnabled);
1425 if (o == m_lineEdit && e->type() == QEvent::ContextMenu) {
1426 QContextMenuEvent *c =
static_cast<QContextMenuEvent *>(e);
1427 QMenu *menu = m_lineEdit->createStandardContextMenu();
1428 const auto actions = menu->actions();
1429 for (QAction *action : actions) {
1430 action->setShortcut(QKeySequence());
1431 QString actionString = action->text();
1432 const auto pos = actionString.lastIndexOf(QLatin1Char(
'\t'));
1434 actionString = actionString.remove(pos, actionString.size() - pos);
1435 action->setText(actionString);
1437 QAction *actionBefore =
nullptr;
1438 if (!actions.empty())
1439 actionBefore = actions[0];
1440 auto *clearAction =
new QAction(tr(
"Clear Char"), menu);
1441 menu->insertAction(actionBefore, clearAction);
1442 menu->insertSeparator(actionBefore);
1443 clearAction->setEnabled(!m_value.isNull());
1444 connect(clearAction, &QAction::triggered,
this, &QtCharEdit::slotClearChar);
1445 menu->exec(c->globalPos());
1451 return QWidget::eventFilter(o, e);
1456 if (m_value.isNull())
1459 emit valueChanged(m_value);
1464 const int key = e->key();
1466 case Qt::Key_Control:
1470 case Qt::Key_Super_L:
1471 case Qt::Key_Return:
1477 const QString text = e->text();
1478 if (text.size() != 1)
1481 const QChar c = text.at(0);
1489 const QString str = m_value.isNull() ? QString() : QString(m_value);
1490 m_lineEdit->setText(str);
1492 emit valueChanged(m_value);
1497 if (value == m_value)
1501 QString str = value.isNull() ? QString() : QString(value);
1502 m_lineEdit->setText(str);
1512 m_lineEdit->event(e);
1513 m_lineEdit->selectAll();
1514 QWidget::focusInEvent(e);
1519 m_lineEdit->event(e);
1520 QWidget::focusOutEvent(e);
1531 m_lineEdit->event(e);
1537 case QEvent::Shortcut:
1538 case QEvent::ShortcutOverride:
1539 case QEvent::KeyRelease:
1545 return QWidget::event(e);
1553 Q_DECLARE_PUBLIC(QtCharEditorFactory)
1564 const auto it = m_createdEditors.constFind(property);
1565 if (it == m_createdEditors.constEnd())
1568 for (QtCharEdit *editor : it.value()) {
1569 editor->blockSignals(
true);
1570 editor->setValue(value);
1571 editor->blockSignals(
false);
1578 manager->setValue(property, value);
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1594
1595
1597 : QtAbstractEditorFactory<QtCharPropertyManager>(parent), d_ptr(
new QtCharEditorFactoryPrivate())
1599 d_ptr->q_ptr =
this;
1604
1605
1608 d_ptr->deleteEditors();
1612
1613
1614
1615
1618 connect(manager, &QtCharPropertyManager::valueChanged,
1619 this, [
this](
QtProperty *property,
const QChar &value)
1620 { d_ptr->slotPropertyChanged(property, value); });
1624
1625
1626
1627
1631 QtCharEdit *editor = d_ptr->createEditor(property, parent);
1632 editor->setValue(manager->value(property));
1634 connect(editor, &QtCharEdit::valueChanged,
1635 this, [
this, property](
const QChar &value) { d_ptr->slotSetValue(property, value); });
1636 connect(editor, &QObject::destroyed,
1637 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1642
1643
1644
1645
1648 disconnect(manager, &QtCharPropertyManager::valueChanged,
this,
nullptr);
1656 Q_DECLARE_PUBLIC(QtEnumEditorFactory)
1667 const auto it = m_createdEditors.constFind(property);
1668 if (it == m_createdEditors.constEnd())
1671 for (QComboBox *editor : it.value()) {
1672 editor->blockSignals(
true);
1673 editor->setCurrentIndex(value);
1674 editor->blockSignals(
false);
1679 const QStringList &enumNames)
1681 const auto it = m_createdEditors.constFind(property);
1682 if (it == m_createdEditors.constEnd())
1689 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1691 for (QComboBox *editor : it.value()) {
1692 editor->blockSignals(
true);
1694 editor->addItems(enumNames);
1695 const auto nameCount = enumNames.size();
1696 for (qsizetype i = 0; i < nameCount; i++)
1697 editor->setItemIcon(i, enumIcons.value(i));
1698 editor->setCurrentIndex(manager->value(property));
1699 editor->blockSignals(
false);
1704 const QMap<
int, QIcon> &enumIcons)
1706 const auto it = m_createdEditors.constFind(property);
1707 if (it == m_createdEditors.constEnd())
1714 const QStringList enumNames = manager->enumNames(property);
1715 for (QComboBox *editor : it.value()) {
1716 editor->blockSignals(
true);
1717 const auto nameCount = enumNames.size();
1718 for (qsizetype i = 0; i < nameCount; i++)
1719 editor->setItemIcon(i, enumIcons.value(i));
1720 editor->setCurrentIndex(manager->value(property));
1721 editor->blockSignals(
false);
1728 manager->setValue(property, value);
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1744
1745
1747 : QtAbstractEditorFactory<QtEnumPropertyManager>(parent), d_ptr(
new QtEnumEditorFactoryPrivate())
1749 d_ptr->q_ptr =
this;
1754
1755
1758 d_ptr->deleteEditors();
1762
1763
1764
1765
1768 connect(manager, &QtEnumPropertyManager::valueChanged,
1769 this, [
this](
QtProperty *property,
int value)
1770 { d_ptr->slotPropertyChanged(property, value); });
1771 connect(manager, &QtEnumPropertyManager::enumNamesChanged,
1772 this, [
this](
QtProperty *property,
const QStringList &value)
1773 { d_ptr->slotEnumNamesChanged(property, value); });
1777
1778
1779
1780
1784 QComboBox *editor = d_ptr->createEditor(property, parent);
1785 editor->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
1786 editor->view()->setTextElideMode(Qt::ElideRight);
1787 QStringList enumNames = manager->enumNames(property);
1788 editor->addItems(enumNames);
1789 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1790 const auto enumNamesCount = enumNames.size();
1791 for (qsizetype i = 0; i < enumNamesCount; i++)
1792 editor->setItemIcon(i, enumIcons.value(i));
1793 editor->setCurrentIndex(manager
->value(property
));
1795 connect(editor, &QComboBox::currentIndexChanged,
1796 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
1797 connect(editor, &QObject::destroyed,
1798 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1803
1804
1805
1806
1809 disconnect(manager, &QtEnumPropertyManager::valueChanged,
this,
nullptr);
1810 disconnect(manager, &QtEnumPropertyManager::enumNamesChanged,
this,
nullptr);
1818 Q_DECLARE_PUBLIC(QtCursorEditorFactory)
1837 QtProperty *enumProp = m_propertyToEnum.value(property);
1852 QtProperty *prop = m_enumToProperty.value(property);
1860 cursorManager->setValue(prop, QCursor(cdb->valueToCursor(value)));
1869 for (
auto itEditor = m_editorToEnum.cbegin(), ecend = m_editorToEnum.cend(); itEditor != ecend; ++itEditor)
1870 if (itEditor.key() == object) {
1871 QWidget *editor = itEditor.key();
1873 m_editorToEnum.remove(editor);
1874 m_enumToEditors[enumProp].removeAll(editor);
1875 if (m_enumToEditors[enumProp].isEmpty()) {
1876 m_enumToEditors.remove(enumProp);
1877 QtProperty *property = m_enumToProperty.value(enumProp);
1878 m_enumToProperty.remove(enumProp);
1879 m_propertyToEnum.remove(property);
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1899
1900
1902 : QtAbstractEditorFactory<QtCursorPropertyManager>(parent), d_ptr(
new QtCursorEditorFactoryPrivate())
1904 d_ptr->q_ptr =
this;
1906 d_ptr->m_enumEditorFactory =
new QtEnumEditorFactory(
this);
1907 d_ptr->m_enumPropertyManager =
new QtEnumPropertyManager(
this);
1908 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::valueChanged,
1909 this, [
this](
QtProperty *property,
int value)
1910 { d_ptr->slotEnumChanged(property, value); });
1911 d_ptr->m_enumEditorFactory->addPropertyManager(d_ptr->m_enumPropertyManager);
1915
1916
1920
1921
1922
1923
1926 connect(manager, &QtCursorPropertyManager::valueChanged,
1927 this, [
this](
QtProperty *property,
const QCursor &value)
1928 { d_ptr->slotPropertyChanged(property, value); });
1932
1933
1934
1935
1939 QtProperty *enumProp = d_ptr->m_propertyToEnum.value(property,
nullptr);
1940 if (enumProp ==
nullptr) {
1941 enumProp = d_ptr->m_enumPropertyManager->addProperty(property->propertyName());
1943 d_ptr->m_enumPropertyManager->setEnumNames(enumProp, cdb->cursorShapeNames());
1944 d_ptr->m_enumPropertyManager->setEnumIcons(enumProp, cdb->cursorShapeIcons());
1946 d_ptr->m_enumPropertyManager->setValue(enumProp, cdb->cursorToValue(manager->value(property)));
1948 d_ptr->m_propertyToEnum[property] = enumProp;
1949 d_ptr->m_enumToProperty[enumProp] = property;
1952 QWidget *editor = af->createEditor(enumProp, parent);
1953 d_ptr->m_enumToEditors[enumProp].append(editor);
1954 d_ptr->m_editorToEnum[editor] = enumProp;
1955 connect(editor, &QObject::destroyed,
1956 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1961
1962
1963
1964
1967 disconnect(manager, &QtCursorPropertyManager::valueChanged,
this,
nullptr);
1993 QLabel *m_pixmapLabel;
1995 QToolButton *m_button;
2000 m_pixmapLabel(
new QLabel),
2001 m_label(
new QLabel),
2002 m_button(
new QToolButton)
2004 auto *lt =
new QHBoxLayout(
this);
2005 setupTreeViewEditorMargin(lt);
2007 lt->addWidget(m_pixmapLabel);
2008 lt->addWidget(m_label);
2009 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2011 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2012 m_button->setFixedWidth(20);
2013 setFocusProxy(m_button);
2014 setFocusPolicy(m_button->focusPolicy());
2015 m_button->setText(tr(
"..."));
2016 m_button->installEventFilter(
this);
2017 connect(m_button, &QAbstractButton::clicked,
this, &QtColorEditWidget::buttonClicked);
2018 lt->addWidget(m_button);
2022void QtColorEditWidget::setValue(QColor c)
2030void QtColorEditWidget::updateColor()
2033 QtPropertyBrowserUtils::brushValuePixmap(QBrush(m_color),
2034 QtPropertyBrowserUtils::itemViewIconSize,
2035 devicePixelRatioF());
2036 m_pixmapLabel->setPixmap(pm);
2037 m_label->setText(QtPropertyBrowserUtils::colorValueText(m_color));
2040void QtColorEditWidget::buttonClicked()
2042 const QColor newColor = QColorDialog::getColor(m_color,
this, QString(), QColorDialog::ShowAlphaChannel);
2043 if (newColor.isValid() && newColor != m_color) {
2045 emit valueChanged(m_color);
2049bool QtColorEditWidget::eventFilter(QObject *obj, QEvent *ev)
2051 if (obj == m_button) {
2052 switch (ev->type()) {
2053 case QEvent::KeyPress:
2054 case QEvent::KeyRelease: {
2055 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2056 case Qt::Key_Escape:
2058 case Qt::Key_Return:
2070 return QWidget::eventFilter(obj, ev);
2075class QtColorEditorFactoryPrivate :
public EditorFactoryPrivate<QtColorEditWidget>
2077 QtColorEditorFactory *q_ptr =
nullptr;
2078 Q_DECLARE_PUBLIC(QtColorEditorFactory)
2081 void slotPropertyChanged(QtProperty *property, QColor value);
2082 void slotSetValue(QtProperty *property, QColor value);
2085void QtColorEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2088 const auto it = m_createdEditors.constFind(property);
2089 if (it == m_createdEditors.constEnd())
2092 for (QtColorEditWidget *e : it.value())
2096void QtColorEditorFactoryPrivate::slotSetValue(QtProperty *property, QColor value)
2098 if (QtColorPropertyManager *manager = q_ptr->propertyManager(property))
2099 manager->setValue(property, value);
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2115
2116
2118 QtAbstractEditorFactory<QtColorPropertyManager>(parent),
2119 d_ptr(
new QtColorEditorFactoryPrivate())
2121 d_ptr->q_ptr =
this;
2125
2126
2129 d_ptr->deleteEditors();
2133
2134
2135
2136
2139 connect(manager, &QtColorPropertyManager::valueChanged,
2140 this, [
this](
QtProperty *property, QColor value)
2141 { d_ptr->slotPropertyChanged(property, value); });
2145
2146
2147
2148
2153 editor->setValue(manager->value(property));
2154 connect(editor, &QtColorEditWidget::valueChanged,
2155 this, [
this, property](QColor value) { d_ptr->slotSetValue(property, value); });
2156 connect(editor, &QObject::destroyed,
2157 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2162
2163
2164
2165
2168 disconnect(manager, &QtColorPropertyManager::valueChanged,
this,
nullptr);
2194 QLabel *m_pixmapLabel;
2196 QToolButton *m_button;
2201 m_pixmapLabel(
new QLabel),
2202 m_label(
new QLabel),
2203 m_button(
new QToolButton)
2205 auto *lt =
new QHBoxLayout(
this);
2206 setupTreeViewEditorMargin(lt);
2208 lt->addWidget(m_pixmapLabel);
2209 lt->addWidget(m_label);
2210 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2212 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2213 m_button->setFixedWidth(20);
2214 setFocusProxy(m_button);
2215 setFocusPolicy(m_button->focusPolicy());
2216 m_button->setText(tr(
"..."));
2217 m_button->installEventFilter(
this);
2218 connect(m_button, &QAbstractButton::clicked,
this, &QtFontEditWidget::buttonClicked);
2219 lt->addWidget(m_button);
2223void QtFontEditWidget::updateFont()
2225 const auto pm = QtPropertyBrowserUtils::fontValuePixmap(
2226 m_font, QtPropertyBrowserUtils::itemViewIconSize, devicePixelRatioF());
2227 m_pixmapLabel->setPixmap(pm);
2228 m_label->setText(QtPropertyBrowserUtils::fontValueText(m_font));
2231void QtFontEditWidget::setValue(
const QFont &f)
2239void QtFontEditWidget::buttonClicked()
2242 QFont newFont = QFontDialog::getFont(&ok, m_font,
this, tr(
"Select Font"));
2243 if (ok && newFont != m_font) {
2246 if (m_font.family() != newFont.family())
2247 f.setFamily(newFont.family());
2248 if (m_font.pointSize() != newFont.pointSize())
2249 f.setPointSize(newFont.pointSize());
2250 if (m_font.bold() != newFont.bold())
2251 f.setBold(newFont.bold());
2252 if (m_font.italic() != newFont.italic())
2253 f.setItalic(newFont.italic());
2254 if (m_font.underline() != newFont.underline())
2255 f.setUnderline(newFont.underline());
2256 if (m_font.strikeOut() != newFont.strikeOut())
2257 f.setStrikeOut(newFont.strikeOut());
2259 emit valueChanged(m_font);
2263bool QtFontEditWidget::eventFilter(QObject *obj, QEvent *ev)
2265 if (obj == m_button) {
2266 switch (ev->type()) {
2267 case QEvent::KeyPress:
2268 case QEvent::KeyRelease: {
2269 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2270 case Qt::Key_Escape:
2272 case Qt::Key_Return:
2284 return QWidget::eventFilter(obj, ev);
2289class QtFontEditorFactoryPrivate :
public EditorFactoryPrivate<QtFontEditWidget>
2291 QtFontEditorFactory *q_ptr =
nullptr;
2292 Q_DECLARE_PUBLIC(QtFontEditorFactory)
2295 void slotPropertyChanged(QtProperty *property,
const QFont &value);
2296 void slotSetValue(QtProperty *property,
const QFont &value);
2299void QtFontEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2302 const auto it = m_createdEditors.constFind(property);
2303 if (it == m_createdEditors.constEnd())
2306 for (QtFontEditWidget *e : it.value())
2310void QtFontEditorFactoryPrivate::slotSetValue(QtProperty *property,
const QFont &value)
2312 if (QtFontPropertyManager *manager = q_ptr->propertyManager(property))
2313 manager->setValue(property, value);
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2329
2330
2332 QtAbstractEditorFactory<QtFontPropertyManager>(parent),
2333 d_ptr(
new QtFontEditorFactoryPrivate())
2335 d_ptr->q_ptr =
this;
2339
2340
2343 d_ptr->deleteEditors();
2347
2348
2349
2350
2353 connect(manager, &QtFontPropertyManager::valueChanged,
2354 this, [
this](
QtProperty *property,
const QFont &value)
2355 { d_ptr->slotPropertyChanged(property, value); });
2359
2360
2361
2362
2367 editor->setValue(manager->value(property));
2368 connect(editor, &QtFontEditWidget::valueChanged,
2369 this, [
this, property](
const QFont &value) { d_ptr->slotSetValue(property, value); });
2370 connect(editor, &QObject::destroyed,
2371 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2376
2377
2378
2379
2382 disconnect(manager, &QtFontPropertyManager::valueChanged,
this,
nullptr);
2387#include "moc_qteditorfactory_p.cpp"
2388#include "qteditorfactory.moc"
PropertyToEditorListMap m_createdEditors
Editor * createEditor(QtProperty *property, QWidget *parent)
void initializeEditor(QtProperty *property, Editor *e)
void slotEditorDestroyed(QObject *object)
The QtAbstractEditorFactoryBase provides an interface for editor factories.
The QtBoolPropertyManager class provides and manages boolean properties.
bool value(const QtProperty *property) const
Returns the given property's value.
void focusInEvent(QFocusEvent *e) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus receive...
void focusOutEvent(QFocusEvent *e) override
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) f...
void keyPressEvent(QKeyEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
void keyReleaseEvent(QKeyEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive key release events...
bool event(QEvent *e) override
This virtual function receives events to an object and should return true if the event e was recogniz...
bool eventFilter(QObject *o, QEvent *e) override
Filters events if this object has been installed as an event filter for the watched object.
void slotSetValue(QtProperty *property, const QChar &value)
The QtCharEditorFactory class provides editor widgets for properties created by QtCharPropertyManager...
void disconnectPropertyManager(QtCharPropertyManager *manager) override
~QtCharEditorFactory() override
Destroys this factory, and all the widgets it has created.
void connectPropertyManager(QtCharPropertyManager *manager) override
QWidget * createEditor(QtCharPropertyManager *manager, QtProperty *property, QWidget *parent) override
The QtCharPropertyManager provides and manages QChar properties.
void slotSetValue(QtProperty *property, bool value)
The QtCheckBoxFactory class provides QCheckBox widgets for properties created by QtBoolPropertyManage...
~QtCheckBoxFactory() override
Destroys this factory, and all the widgets it has created.
QWidget * createEditor(QtBoolPropertyManager *manager, QtProperty *property, QWidget *parent) override
void disconnectPropertyManager(QtBoolPropertyManager *manager) override
void connectPropertyManager(QtBoolPropertyManager *manager) override
The QtColorEditorFactory class provides color editing for properties created by QtColorPropertyManage...
void disconnectPropertyManager(QtColorPropertyManager *manager) override
void connectPropertyManager(QtColorPropertyManager *manager) override
QWidget * createEditor(QtColorPropertyManager *manager, QtProperty *property, QWidget *parent) override
~QtColorEditorFactory() override
Destroys this factory, and all the widgets it has created.
The QtColorPropertyManager provides and manages QColor properties.
static QtCursorDatabase * instance()
QtEnumPropertyManager * m_enumPropertyManager
QHash< QWidget *, QtProperty * > m_editorToEnum
QHash< QtProperty *, QWidgetList > m_enumToEditors
QtEnumEditorFactory * m_enumEditorFactory
QHash< QtProperty *, QtProperty * > m_propertyToEnum
QHash< QtProperty *, QtProperty * > m_enumToProperty
void slotEnumChanged(QtProperty *property, int value)
void slotEditorDestroyed(QObject *object)
The QtCursorEditorFactory class provides QComboBox widgets for properties created by QtCursorProperty...
~QtCursorEditorFactory() override
Destroys this factory, and all the widgets it has created.
void disconnectPropertyManager(QtCursorPropertyManager *manager) override
void connectPropertyManager(QtCursorPropertyManager *manager) override
QWidget * createEditor(QtCursorPropertyManager *manager, QtProperty *property, QWidget *parent) override
The QtCursorPropertyManager provides and manages QCursor properties.
void slotSetValue(QtProperty *property, QDate value)
void slotRangeChanged(QtProperty *property, QDate min, QDate max)
The QtDateEditFactory class provides QDateEdit widgets for properties created by QtDatePropertyManage...
void disconnectPropertyManager(QtDatePropertyManager *manager) override
void connectPropertyManager(QtDatePropertyManager *manager) override
~QtDateEditFactory() override
Destroys this factory, and all the widgets it has created.
QWidget * createEditor(QtDatePropertyManager *manager, QtProperty *property, QWidget *parent) override
The QtDatePropertyManager provides and manages QDate properties.
void rangeChanged(QtProperty *property, QDate minVal, QDate maxVal)
This signal is emitted whenever a property created by this manager changes its range of valid dates,...
QDate minimum(const QtProperty *property) const
Returns the given property's minimum date.
QDate maximum(const QtProperty *property) const
Returns the given property's maximum date.
QDate value(const QtProperty *property) const
Returns the given property's value.
The QtDoublePropertyManager provides and manages double properties.
double singleStep(const QtProperty *property) const
Returns the given property's step value.
int decimals(const QtProperty *property) const
Returns the given property's precision, in decimals.
void singleStepChanged(QtProperty *property, double step)
This signal is emitted whenever a property created by this manager changes its single step property,...
void decimalsChanged(QtProperty *property, int prec)
This signal is emitted whenever a property created by this manager changes its precision of value,...
double minimum(const QtProperty *property) const
Returns the given property's minimum value.
double value(const QtProperty *property) const
Returns the given property's value.
void rangeChanged(QtProperty *property, double minVal, double maxVal)
This signal is emitted whenever a property created by this manager changes its range of valid values,...
double maximum(const QtProperty *property) const
Returns the given property's maximum value.
void slotSetValue(QtProperty *property, double value)
void slotSingleStepChanged(QtProperty *property, double step)
void slotDecimalsChanged(QtProperty *property, int prec)
void slotRangeChanged(QtProperty *property, double min, double max)
The QtDoubleSpinBoxFactory class provides QDoubleSpinBox widgets for properties created by QtDoublePr...
QWidget * createEditor(QtDoublePropertyManager *manager, QtProperty *property, QWidget *parent) override
void connectPropertyManager(QtDoublePropertyManager *manager) override
void disconnectPropertyManager(QtDoublePropertyManager *manager) override
~QtDoubleSpinBoxFactory() override
Destroys this factory, and all the widgets it has created.
void slotEnumNamesChanged(QtProperty *property, const QStringList &)
void slotEnumIconsChanged(QtProperty *property, const QMap< int, QIcon > &)
void slotSetValue(QtProperty *property, int value)
The QtEnumEditorFactory class provides QComboBox widgets for properties created by QtEnumPropertyMana...
~QtEnumEditorFactory() override
Destroys this factory, and all the widgets it has created.
QWidget * createEditor(QtEnumPropertyManager *manager, QtProperty *property, QWidget *parent) override
void disconnectPropertyManager(QtEnumPropertyManager *manager) override
void connectPropertyManager(QtEnumPropertyManager *manager) override
The QtEnumPropertyManager provides and manages enum properties.
int value(const QtProperty *property) const
Returns the given property's value which is an index in the list returned by enumNames().
The QtFontEditorFactory class provides font editing for properties created by QtFontPropertyManager o...
void disconnectPropertyManager(QtFontPropertyManager *manager) override
QWidget * createEditor(QtFontPropertyManager *manager, QtProperty *property, QWidget *parent) override
~QtFontEditorFactory() override
Destroys this factory, and all the widgets it has created.
void connectPropertyManager(QtFontPropertyManager *manager) override
The QtFontPropertyManager provides and manages QFont properties.
The QtIntPropertyManager provides and manages int properties.
void rangeChanged(QtProperty *property, int minVal, int maxVal)
This signal is emitted whenever a property created by this manager changes its range of valid values,...
void singleStepChanged(QtProperty *property, int step)
This signal is emitted whenever a property created by this manager changes its single step property,...
int singleStep(const QtProperty *property) const
Returns the given property's step value.
int minimum(const QtProperty *property) const
Returns the given property's minimum value.
int value(const QtProperty *property) const
Returns the given property's value.
int maximum(const QtProperty *property) const
Returns the given property's maximum value.
void slotSetValue(QtProperty *property, const QKeySequence &value)
The QtKeySequenceEditorFactory class provides editor widgets for properties created by QtKeySequenceP...
void connectPropertyManager(QtKeySequencePropertyManager *manager) override
~QtKeySequenceEditorFactory() override
Destroys this factory, and all the widgets it has created.
QWidget * createEditor(QtKeySequencePropertyManager *manager, QtProperty *property, QWidget *parent) override
void disconnectPropertyManager(QtKeySequencePropertyManager *manager) override
The QtKeySequencePropertyManager provides and manages QKeySequence properties.
void slotSetValue(QtProperty *property, const QString &value)
void slotRegExpChanged(QtProperty *property, const QRegularExpression ®Exp)
The QtLineEditFactory class provides QLineEdit widgets for properties created by QtStringPropertyMana...
void disconnectPropertyManager(QtStringPropertyManager *manager) override
QWidget * createEditor(QtStringPropertyManager *manager, QtProperty *property, QWidget *parent) override
void connectPropertyManager(QtStringPropertyManager *manager) override
~QtLineEditFactory() override
Destroys this factory, and all the widgets it has created.
The QtProperty class encapsulates an instance of a property.
void slotSetValue(QtProperty *property, int value)
void slotSingleStepChanged(QtProperty *property, int step)
void slotRangeChanged(QtProperty *property, int min, int max)
The QtSliderFactory class provides QSlider widgets for properties created by QtIntPropertyManager obj...
void connectPropertyManager(QtIntPropertyManager *manager) override
void disconnectPropertyManager(QtIntPropertyManager *manager) override
QWidget * createEditor(QtIntPropertyManager *manager, QtProperty *property, QWidget *parent) override
~QtSliderFactory() override
Destroys this factory, and all the widgets it has created.
void slotRangeChanged(QtProperty *property, int min, int max)
void slotSetValue(QtProperty *property, int value)
void slotSingleStepChanged(QtProperty *property, int step)
The QtSpinBoxFactory class provides QSpinBox widgets for properties created by QtIntPropertyManager o...
void disconnectPropertyManager(QtIntPropertyManager *manager) override
void connectPropertyManager(QtIntPropertyManager *manager) override
~QtSpinBoxFactory() override
Destroys this factory, and all the widgets it has created.
QWidget * createEditor(QtIntPropertyManager *manager, QtProperty *property, QWidget *parent) override
The QtStringPropertyManager provides and manages QString properties.
void regExpChanged(QtProperty *property, const QRegularExpression ®Exp)
This signal is emitted whenever a property created by this manager changes its currenlty set regular ...
void slotSetValue(QtProperty *property, QTime value)
The QtTimeEditFactory class provides QTimeEdit widgets for properties created by QtTimePropertyManage...
QWidget * createEditor(QtTimePropertyManager *manager, QtProperty *property, QWidget *parent) override
void disconnectPropertyManager(QtTimePropertyManager *manager) override
void connectPropertyManager(QtTimePropertyManager *manager) override
~QtTimeEditFactory() override
Destroys this factory, and all the widgets it has created.
The QtTimePropertyManager provides and manages QTime properties.
QTime value(const QtProperty *property) const
Returns the given property's value.
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE void setupTreeViewEditorMargin(QLayout *lt)