7#include <QtWidgets/qabstractitemview.h>
8#include <QtWidgets/qapplication.h>
9#include <QtWidgets/qboxlayout.h>
10#include <QtWidgets/qcolordialog.h>
11#include <QtWidgets/qcombobox.h>
12#include <QtWidgets/qdatetimeedit.h>
13#include <QtWidgets/qfontdialog.h>
14#include <QtWidgets/qkeysequenceedit.h>
15#include <QtWidgets/qlabel.h>
16#include <QtWidgets/qlayoutitem.h>
17#include <QtWidgets/qlineedit.h>
18#include <QtWidgets/qmenu.h>
19#include <QtWidgets/qscrollbar.h>
20#include <QtWidgets/qspinbox.h>
21#include <QtWidgets/qtoolbutton.h>
23#include <QtGui/qevent.h>
24#include <QtGui/qvalidator.h>
26#include <QtCore/qhash.h>
27#include <QtCore/qregularexpression.h>
36 enum { DecorationMargin = 4 };
37 if (QApplication::layoutDirection() == Qt::LeftToRight)
38 lt->setContentsMargins(DecorationMargin, 0, 0, 0);
40 lt->setContentsMargins(0, 0, DecorationMargin, 0);
46template <
class Editor>
63template <
class Editor>
66 auto *editor =
new Editor(parent);
71template <
class Editor>
74 auto it = m_createdEditors.find(property);
75 if (it == m_createdEditors.end())
76 it = m_createdEditors.insert(property, EditorList());
77 it.value().append(editor);
78 m_editorToProperty.insert(editor, property);
81template <
class Editor>
84 const auto ecend = m_editorToProperty.end();
85 for (
auto itEditor = m_editorToProperty.begin(); itEditor != ecend; ++itEditor) {
86 if (itEditor.key() == object) {
87 Editor *editor = itEditor.key();
89 const auto pit = m_createdEditors.find(property);
90 if (pit != m_createdEditors.end()) {
91 pit.value().removeAll(editor);
92 if (pit.value().isEmpty())
93 m_createdEditors.erase(pit);
95 m_editorToProperty.erase(itEditor);
106 Q_DECLARE_PUBLIC(QtSpinBoxFactory)
117 const auto it = m_createdEditors.constFind(property);
118 if (it == m_createdEditors.cend())
120 for (QSpinBox *editor : it.value()) {
121 if (editor->value() != value) {
122 editor->blockSignals(
true);
123 editor->setValue(value);
124 editor->blockSignals(
false);
131 const auto it = m_createdEditors.constFind(property);
132 if (it == m_createdEditors.cend())
139 for (QSpinBox *editor : it.value()) {
140 editor->blockSignals(
true);
141 editor->setRange(min, max);
142 editor->setValue(manager->value(property));
143 editor->blockSignals(
false);
149 const auto it = m_createdEditors.constFind(property);
150 if (it == m_createdEditors.cend())
152 for (QSpinBox *editor : it.value()) {
153 editor->blockSignals(
true);
154 editor->setSingleStep(step);
155 editor->blockSignals(
false);
161 QObject *object = q_ptr->sender();
162 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor) {
163 if (itEditor.key() == object) {
168 manager->setValue(property, value);
175
176
177
178
179
180
181
182
183
184
187
188
190 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSpinBoxFactoryPrivate())
197
198
201 qDeleteAll(d_ptr->m_editorToProperty.keys());
205
206
207
208
211 connect(manager, &QtIntPropertyManager::valueChanged,
213 { d_ptr->slotPropertyChanged(property, value); });
215 this, [
this](
QtProperty *property,
int min,
int max)
216 { d_ptr->slotRangeChanged(property, min, max); });
219 { d_ptr->slotSingleStepChanged(property, value); });
223
224
225
226
230 QSpinBox *editor = d_ptr->createEditor(property, parent);
233 editor->setValue(manager
->value(property
));
234 editor->setKeyboardTracking(
false);
236 connect(editor, &QSpinBox::valueChanged,
237 this, [
this](
int value) { d_ptr->slotSetValue(value); });
238 connect(editor, &QObject::destroyed,
239 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
244
245
246
247
250 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
260 Q_DECLARE_PUBLIC(QtSliderFactory)
270 const auto it = m_createdEditors.constFind(property);
271 if (it == m_createdEditors.cend())
273 for (QSlider *editor : it.value()) {
274 editor->blockSignals(
true);
275 editor->setValue(value);
276 editor->blockSignals(
false);
282 const auto it = m_createdEditors.constFind(property);
283 if (it == m_createdEditors.cend())
290 for (QSlider *editor : it.value()) {
291 editor->blockSignals(
true);
292 editor->setRange(min, max);
293 editor->setValue(manager->value(property));
294 editor->blockSignals(
false);
300 const auto it = m_createdEditors.constFind(property);
301 if (it == m_createdEditors.cend())
303 for (QSlider *editor : it.value()) {
304 editor->blockSignals(
true);
305 editor->setSingleStep(step);
306 editor->blockSignals(
false);
312 QObject *object = q_ptr->sender();
313 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor ) {
314 if (itEditor.key() == object) {
319 manager->setValue(property, value);
326
327
328
329
330
331
332
333
334
335
338
339
341 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSliderFactoryPrivate())
348
349
352 qDeleteAll(d_ptr->m_editorToProperty.keys());
356
357
358
359
362 connect(manager, &QtIntPropertyManager::valueChanged,
364 { d_ptr->slotPropertyChanged(property, value); });
366 this, [
this](
QtProperty *property,
int min,
int max)
367 { d_ptr->slotRangeChanged(property, min, max); });
370 { d_ptr->slotSingleStepChanged(property, value); });
374
375
376
377
381 auto *editor =
new QSlider(Qt::Horizontal, parent);
382 d_ptr->initializeEditor(property, editor);
385 editor->setValue(manager
->value(property
));
387 connect(editor, &QSlider::valueChanged,
388 this, [
this](
int value) { d_ptr->slotSetValue(value); });
389 connect(editor, &QObject::destroyed,
390 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
395
396
397
398
401 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
411 Q_DECLARE_PUBLIC(QtScrollBarFactory)
421 const auto it = m_createdEditors.constFind(property);
422 if (it == m_createdEditors.cend())
425 for (QScrollBar *editor : it.value()) {
426 editor->blockSignals(
true);
427 editor->setValue(value);
428 editor->blockSignals(
false);
434 const auto it = m_createdEditors.constFind(property);
435 if (it == m_createdEditors.cend())
442 for (QScrollBar *editor : it.value()) {
443 editor->blockSignals(
true);
444 editor->setRange(min, max);
445 editor->setValue(manager->value(property));
446 editor->blockSignals(
false);
452 const auto it = m_createdEditors.constFind(property);
453 if (it == m_createdEditors.cend())
455 for (QScrollBar *editor : it.value()) {
456 editor->blockSignals(
true);
457 editor->setSingleStep(step);
458 editor->blockSignals(
false);
464 QObject *object = q_ptr->sender();
465 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
466 if (itEditor.key() == object) {
471 manager->setValue(property, value);
477
478
479
480
481
482
483
484
485
486
489
490
492 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtScrollBarFactoryPrivate())
499
500
503 qDeleteAll(d_ptr->m_editorToProperty.keys());
507
508
509
510
513 connect(manager, &QtIntPropertyManager::valueChanged,
515 { d_ptr->slotPropertyChanged(property, value); });
517 this, [
this](
QtProperty *property,
int min,
int max)
518 { d_ptr->slotRangeChanged(property, min, max); });
521 { d_ptr->slotSingleStepChanged(property, value); });
525
526
527
528
532 auto *editor =
new QScrollBar(Qt::Horizontal, parent);
533 d_ptr->initializeEditor(property, editor);
536 editor->setValue(manager
->value(property
));
537 connect(editor, &QScrollBar::valueChanged,
538 this, [
this](
int value) { d_ptr->slotSetValue(value); });
539 connect(editor, &QObject::destroyed,
540 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
545
546
547
548
551 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
561 Q_DECLARE_PUBLIC(QtCheckBoxFactory)
569 const auto it = m_createdEditors.constFind(property);
570 if (it == m_createdEditors.cend())
573 for (QtBoolEdit *editor : it.value()) {
574 editor->blockCheckBoxSignals(
true);
575 editor->setChecked(value);
576 editor->blockCheckBoxSignals(
false);
582 QObject *object = q_ptr->sender();
584 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
585 if (itEditor.key() == object) {
590 manager->setValue(property, value);
596
597
598
599
600
601
602
603
604
605
608
609
611 : QtAbstractEditorFactory<QtBoolPropertyManager>(parent), d_ptr(
new QtCheckBoxFactoryPrivate())
618
619
622 qDeleteAll(d_ptr->m_editorToProperty.keys());
626
627
628
629
632 connect(manager, &QtBoolPropertyManager::valueChanged,
633 this, [
this](
QtProperty *property,
bool value)
634 { d_ptr->slotPropertyChanged(property, value); });
638
639
640
641
645 QtBoolEdit *editor = d_ptr->createEditor(property, parent);
648 connect(editor, &QtBoolEdit::toggled,
649 this, [
this](
bool value) { d_ptr->slotSetValue(value); });
650 connect(editor, &QObject::destroyed,
651 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
656
657
658
659
662 disconnect(manager, &QtBoolPropertyManager::valueChanged,
this,
nullptr);
670 Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
682 const auto it = m_createdEditors.constFind(property);
683 if (it == m_createdEditors.cend())
685 for (QDoubleSpinBox *editor : it.value()) {
686 if (editor->value() != value) {
687 editor->blockSignals(
true);
688 editor->setValue(value);
689 editor->blockSignals(
false);
695 double min,
double max)
697 const auto it = m_createdEditors.constFind(property);
698 if (it == m_createdEditors.cend())
705 for (QDoubleSpinBox *editor : it.value()) {
706 editor->blockSignals(
true);
707 editor->setRange(min, max);
708 editor->setValue(manager->value(property));
709 editor->blockSignals(
false);
715 const auto it = m_createdEditors.constFind(property);
716 if (it == m_createdEditors.cend())
723 for (QDoubleSpinBox *editor : it.value()) {
724 editor->blockSignals(
true);
725 editor->setSingleStep(step);
726 editor->blockSignals(
false);
732 const auto it = m_createdEditors.constFind(property);
733 if (it == m_createdEditors.constEnd())
740 for (QDoubleSpinBox *editor : it.value()) {
741 editor->blockSignals(
true);
742 editor->setDecimals(prec);
743 editor->setValue(manager->value(property));
744 editor->blockSignals(
false);
750 QObject *object = q_ptr->sender();
751 for (
auto itEditor = m_editorToProperty.cbegin(), itcend = m_editorToProperty.cend(); itEditor != itcend; ++itEditor) {
752 if (itEditor.key() == object) {
757 manager->setValue(property, value);
764
765
766
767
768
769
770
771
772
775
776
778 : QtAbstractEditorFactory<QtDoublePropertyManager>(parent), d_ptr(
new QtDoubleSpinBoxFactoryPrivate())
785
786
789 qDeleteAll(d_ptr->m_editorToProperty.keys());
793
794
795
796
799 connect(manager, &QtDoublePropertyManager::valueChanged,
800 this, [
this](
QtProperty *property,
double value)
801 { d_ptr->slotPropertyChanged(property, value); });
803 this, [
this](
QtProperty *property,
double min,
double max)
804 { d_ptr->slotRangeChanged(property, min, max); });
806 this, [
this](
QtProperty *property,
double value)
807 { d_ptr->slotSingleStepChanged(property, value); });
810 { d_ptr->slotDecimalsChanged(property, value); });
814
815
816
817
821 QDoubleSpinBox *editor = d_ptr->createEditor(property, parent);
825 editor->setValue(manager
->value(property
));
826 editor->setKeyboardTracking(
false);
828 connect(editor, &QDoubleSpinBox::valueChanged,
829 this, [
this](
double value) { d_ptr->slotSetValue(value); });
830 connect(editor, &QObject::destroyed,
831 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
836
837
838
839
842 disconnect(manager, &QtDoublePropertyManager::valueChanged,
this,
nullptr);
853 Q_DECLARE_PUBLIC(QtLineEditFactory)
862 const QString &value)
864 const auto it = m_createdEditors.constFind(property);
865 if (it == m_createdEditors.constEnd())
868 for (QLineEdit *editor : it.value()) {
869 if (editor->text() != value)
870 editor->setText(value);
875 const QRegularExpression ®Exp)
877 const auto it = m_createdEditors.constFind(property);
878 if (it == m_createdEditors.constEnd())
885 for (QLineEdit *editor : it.value()) {
886 editor->blockSignals(
true);
887 const QValidator *oldValidator = editor->validator();
888 QValidator *newValidator =
nullptr;
889 if (regExp.isValid()) {
890 newValidator =
new QRegularExpressionValidator(regExp, editor);
892 editor->setValidator(newValidator);
894 editor->blockSignals(
false);
900 QObject *object = q_ptr->sender();
901 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
902 if (itEditor.key() == object) {
907 manager->setValue(property, value);
913
914
915
916
917
918
919
920
921
922
925
926
928 : QtAbstractEditorFactory<QtStringPropertyManager>(parent), d_ptr(
new QtLineEditFactoryPrivate())
935
936
939 qDeleteAll(d_ptr->m_editorToProperty.keys());
943
944
945
946
949 connect(manager, &QtStringPropertyManager::valueChanged,
950 this, [
this](
QtProperty *property,
const QString &value)
951 { d_ptr->slotPropertyChanged(property, value); });
953 this, [
this](
QtProperty *property,
const QRegularExpression &value)
954 { d_ptr->slotRegExpChanged(property, value); });
958
959
960
961
965 QLineEdit *editor = d_ptr->createEditor(property, parent);
966 QRegularExpression regExp = manager->regExp(property);
967 if (regExp.isValid() && !regExp.pattern().isEmpty()) {
968 auto *validator =
new QRegularExpressionValidator(regExp, editor);
969 editor->setValidator(validator);
971 editor->setText(manager->value(property));
973 connect(editor, &QLineEdit::textEdited,
974 this, [
this](
const QString &value) { d_ptr->slotSetValue(value); });
975 connect(editor, &QObject::destroyed,
976 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
981
982
983
984
987 disconnect(manager, &QtStringPropertyManager::valueChanged,
this,
nullptr);
996 Q_DECLARE_PUBLIC(QtDateEditFactory)
1006 const auto it = m_createdEditors.constFind(property);
1007 if (it == m_createdEditors.constEnd())
1009 for (QDateEdit *editor : it.value()) {
1010 editor->blockSignals(
true);
1011 editor->setDate(value);
1012 editor->blockSignals(
false);
1018 const auto it = m_createdEditors.constFind(property);
1019 if (it == m_createdEditors.constEnd())
1026 for (QDateEdit *editor : it.value()) {
1027 editor->blockSignals(
true);
1028 editor->setDateRange(min, max);
1029 editor->setDate(manager->value(property));
1030 editor->blockSignals(
false);
1036 QObject *object = q_ptr->sender();
1037 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1038 if (itEditor.key() == object) {
1043 manager->setValue(property, value);
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1061
1062
1064 : QtAbstractEditorFactory<QtDatePropertyManager>(parent), d_ptr(
new QtDateEditFactoryPrivate())
1066 d_ptr->q_ptr =
this;
1071
1072
1075 qDeleteAll(d_ptr->m_editorToProperty.keys());
1079
1080
1081
1082
1085 connect(manager, &QtDatePropertyManager::valueChanged,
1086 this, [
this](
QtProperty *property, QDate value)
1087 { d_ptr->slotPropertyChanged(property, value); });
1089 this, [
this](
QtProperty *property, QDate min, QDate max)
1090 { d_ptr->slotRangeChanged(property, min, max); });
1094
1095
1096
1097
1101 QDateEdit *editor = d_ptr->createEditor(property, parent);
1102 editor->setDisplayFormat(QtPropertyBrowserUtils::dateFormat());
1103 editor->setCalendarPopup(
true);
1105 editor->setDate(manager
->value(property));
1107 connect(editor, &QDateEdit::dateChanged,
1108 this, [
this](QDate value) { d_ptr->slotSetValue(value); });
1109 connect(editor, &QObject::destroyed,
1110 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1115
1116
1117
1118
1121 disconnect(manager, &QtDatePropertyManager::valueChanged,
this,
nullptr);
1130 Q_DECLARE_PUBLIC(QtTimeEditFactory)
1139 const auto it = m_createdEditors.constFind(property);
1140 if (it == m_createdEditors.constEnd())
1142 for (QTimeEdit *editor : it.value()) {
1143 editor->blockSignals(
true);
1144 editor->setTime(value);
1145 editor->blockSignals(
false);
1151 QObject *object = q_ptr->sender();
1152 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1153 if (itEditor.key() == object) {
1158 manager->setValue(property, value);
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1176
1177
1179 : QtAbstractEditorFactory<QtTimePropertyManager>(parent), d_ptr(
new QtTimeEditFactoryPrivate())
1181 d_ptr->q_ptr =
this;
1186
1187
1190 qDeleteAll(d_ptr->m_editorToProperty.keys());
1194
1195
1196
1197
1200 connect(manager, &QtTimePropertyManager::valueChanged,
1201 this, [
this](
QtProperty *property, QTime value)
1202 { d_ptr->slotPropertyChanged(property, value); });
1206
1207
1208
1209
1213 QTimeEdit *editor = d_ptr->createEditor(property, parent);
1214 editor->setDisplayFormat(QtPropertyBrowserUtils::timeFormat());
1215 editor->setTime(manager
->value(property));
1217 connect(editor, &QTimeEdit::timeChanged,
1218 this, [
this](QTime value) { d_ptr->slotSetValue(value); });
1219 connect(editor, &QObject::destroyed,
1220 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1225
1226
1227
1228
1231 disconnect(manager, &QtTimePropertyManager::valueChanged,
this,
nullptr);
1239 Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
1248 const QDateTime &value)
1250 const auto it = m_createdEditors.constFind(property);
1251 if (it == m_createdEditors.constEnd())
1254 for (QDateTimeEdit *editor : it.value()) {
1255 editor->blockSignals(
true);
1256 editor->setDateTime(value);
1257 editor->blockSignals(
false);
1263 QObject *object = q_ptr->sender();
1264 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1265 if (itEditor.key() == object) {
1270 manager->setValue(property, value);
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1288
1289
1291 : QtAbstractEditorFactory<QtDateTimePropertyManager>(parent), d_ptr(
new QtDateTimeEditFactoryPrivate())
1293 d_ptr->q_ptr =
this;
1298
1299
1302 qDeleteAll(d_ptr->m_editorToProperty.keys());
1306
1307
1308
1309
1312 connect(manager, &QtDateTimePropertyManager::valueChanged,
1313 this, [
this](
QtProperty *property,
const QDateTime &value)
1314 { d_ptr->slotPropertyChanged(property, value); });
1318
1319
1320
1321
1325 QDateTimeEdit *editor = d_ptr->createEditor(property, parent);
1326 editor->setDisplayFormat(QtPropertyBrowserUtils::dateTimeFormat());
1327 editor->setDateTime(manager
->value(property));
1329 connect(editor, &QDateTimeEdit::dateTimeChanged,
1330 this, [
this](
const QDateTime &value) { d_ptr->slotSetValue(value); });
1331 connect(editor, &QObject::destroyed,
1332 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1337
1338
1339
1340
1343 disconnect(manager, &QtDateTimePropertyManager::valueChanged,
this,
nullptr);
1351 Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
1359 const QKeySequence &value)
1361 const auto it = m_createdEditors.constFind(property);
1362 if (it == m_createdEditors.constEnd())
1365 for (QKeySequenceEdit *editor : it.value()) {
1366 editor->blockSignals(
true);
1367 editor->setKeySequence(value);
1368 editor->blockSignals(
false);
1374 QObject *object = q_ptr->sender();
1375 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1376 if (itEditor.key() == object) {
1381 manager->setValue(property, value);
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1399
1400
1402 : QtAbstractEditorFactory<QtKeySequencePropertyManager>(parent), d_ptr(
new QtKeySequenceEditorFactoryPrivate())
1404 d_ptr->q_ptr =
this;
1409
1410
1413 qDeleteAll(d_ptr->m_editorToProperty.keys());
1417
1418
1419
1420
1423 connect(manager, &QtKeySequencePropertyManager::valueChanged,
1424 this, [
this](
QtProperty *property,
const QKeySequence &value)
1425 { d_ptr->slotPropertyChanged(property, value); });
1429
1430
1431
1432
1436 QKeySequenceEdit *editor = d_ptr->createEditor(property, parent);
1437 editor->setKeySequence(manager->value(property));
1439 connect(editor, &QKeySequenceEdit::keySequenceChanged,
1440 this, [
this](
const QKeySequence &value) { d_ptr->slotSetValue(value); });
1441 connect(editor, &QObject::destroyed,
1442 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1447
1448
1449
1450
1453 disconnect(manager, &QtKeySequencePropertyManager::valueChanged,
this,
nullptr);
1479 void handleKeyEvent(QKeyEvent *e);
1482 QLineEdit *m_lineEdit;
1486 : QWidget(parent), m_lineEdit(
new QLineEdit(
this))
1488 auto *layout =
new QHBoxLayout(
this);
1489 layout->addWidget(m_lineEdit);
1490 layout->setContentsMargins(QMargins());
1491 m_lineEdit->installEventFilter(
this);
1492 m_lineEdit->setReadOnly(
true);
1493 m_lineEdit->setFocusProxy(
this);
1494 setFocusPolicy(m_lineEdit->focusPolicy());
1495 setAttribute(Qt::WA_InputMethodEnabled);
1500 if (o == m_lineEdit && e->type() == QEvent::ContextMenu) {
1501 QContextMenuEvent *c =
static_cast<QContextMenuEvent *>(e);
1502 QMenu *menu = m_lineEdit->createStandardContextMenu();
1503 const auto actions = menu->actions();
1504 for (QAction *action : actions) {
1505 action->setShortcut(QKeySequence());
1506 QString actionString = action->text();
1507 const auto pos = actionString.lastIndexOf(QLatin1Char(
'\t'));
1509 actionString = actionString.remove(pos, actionString.size() - pos);
1510 action->setText(actionString);
1512 QAction *actionBefore =
nullptr;
1513 if (!actions.empty())
1514 actionBefore = actions[0];
1515 auto *clearAction =
new QAction(tr(
"Clear Char"), menu);
1516 menu->insertAction(actionBefore, clearAction);
1517 menu->insertSeparator(actionBefore);
1518 clearAction->setEnabled(!m_value.isNull());
1519 connect(clearAction, &QAction::triggered,
this, &QtCharEdit::slotClearChar);
1520 menu->exec(c->globalPos());
1526 return QWidget::eventFilter(o, e);
1531 if (m_value.isNull())
1534 emit valueChanged(m_value);
1539 const int key = e->key();
1541 case Qt::Key_Control:
1545 case Qt::Key_Super_L:
1546 case Qt::Key_Return:
1552 const QString text = e->text();
1553 if (text.size() != 1)
1556 const QChar c = text.at(0);
1564 const QString str = m_value.isNull() ? QString() : QString(m_value);
1565 m_lineEdit->setText(str);
1567 emit valueChanged(m_value);
1572 if (value == m_value)
1576 QString str = value.isNull() ? QString() : QString(value);
1577 m_lineEdit->setText(str);
1587 m_lineEdit->event(e);
1588 m_lineEdit->selectAll();
1589 QWidget::focusInEvent(e);
1594 m_lineEdit->event(e);
1595 QWidget::focusOutEvent(e);
1606 m_lineEdit->event(e);
1612 case QEvent::Shortcut:
1613 case QEvent::ShortcutOverride:
1614 case QEvent::KeyRelease:
1620 return QWidget::event(e);
1628 Q_DECLARE_PUBLIC(QtCharEditorFactory)
1639 const auto it = m_createdEditors.constFind(property);
1640 if (it == m_createdEditors.constEnd())
1643 for (QtCharEdit *editor : it.value()) {
1644 editor->blockSignals(
true);
1645 editor->setValue(value);
1646 editor->blockSignals(
false);
1652 QObject *object = q_ptr->sender();
1653 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1654 if (itEditor.key() == object) {
1659 manager->setValue(property, value);
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1677
1678
1680 : QtAbstractEditorFactory<QtCharPropertyManager>(parent), d_ptr(
new QtCharEditorFactoryPrivate())
1682 d_ptr->q_ptr =
this;
1687
1688
1691 qDeleteAll(d_ptr->m_editorToProperty.keys());
1695
1696
1697
1698
1701 connect(manager, &QtCharPropertyManager::valueChanged,
1702 this, [
this](
QtProperty *property,
const QChar &value)
1703 { d_ptr->slotPropertyChanged(property, value); });
1707
1708
1709
1710
1714 QtCharEdit *editor = d_ptr->createEditor(property, parent);
1715 editor->setValue(manager->value(property));
1717 connect(editor, &QtCharEdit::valueChanged,
1718 this, [
this](
const QChar &value) { d_ptr->slotSetValue(value); });
1719 connect(editor, &QObject::destroyed,
1720 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1725
1726
1727
1728
1731 disconnect(manager, &QtCharPropertyManager::valueChanged,
this,
nullptr);
1739 Q_DECLARE_PUBLIC(QtEnumEditorFactory)
1750 const auto it = m_createdEditors.constFind(property);
1751 if (it == m_createdEditors.constEnd())
1754 for (QComboBox *editor : it.value()) {
1755 editor->blockSignals(
true);
1756 editor->setCurrentIndex(value);
1757 editor->blockSignals(
false);
1762 const QStringList &enumNames)
1764 const auto it = m_createdEditors.constFind(property);
1765 if (it == m_createdEditors.constEnd())
1772 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1774 for (QComboBox *editor : it.value()) {
1775 editor->blockSignals(
true);
1777 editor->addItems(enumNames);
1778 const auto nameCount = enumNames.size();
1779 for (qsizetype i = 0; i < nameCount; i++)
1780 editor->setItemIcon(i, enumIcons.value(i));
1781 editor->setCurrentIndex(manager->value(property));
1782 editor->blockSignals(
false);
1787 const QMap<
int, QIcon> &enumIcons)
1789 const auto it = m_createdEditors.constFind(property);
1790 if (it == m_createdEditors.constEnd())
1797 const QStringList enumNames = manager->enumNames(property);
1798 for (QComboBox *editor : it.value()) {
1799 editor->blockSignals(
true);
1800 const auto nameCount = enumNames.size();
1801 for (qsizetype i = 0; i < nameCount; i++)
1802 editor->setItemIcon(i, enumIcons.value(i));
1803 editor->setCurrentIndex(manager->value(property));
1804 editor->blockSignals(
false);
1810 QObject *object = q_ptr->sender();
1811 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1812 if (itEditor.key() == object) {
1817 manager->setValue(property, value);
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1835
1836
1838 : QtAbstractEditorFactory<QtEnumPropertyManager>(parent), d_ptr(
new QtEnumEditorFactoryPrivate())
1840 d_ptr->q_ptr =
this;
1845
1846
1849 qDeleteAll(d_ptr->m_editorToProperty.keys());
1853
1854
1855
1856
1859 connect(manager, &QtEnumPropertyManager::valueChanged,
1860 this, [
this](
QtProperty *property,
int value)
1861 { d_ptr->slotPropertyChanged(property, value); });
1862 connect(manager, &QtEnumPropertyManager::enumNamesChanged,
1863 this, [
this](
QtProperty *property,
const QStringList &value)
1864 { d_ptr->slotEnumNamesChanged(property, value); });
1868
1869
1870
1871
1875 QComboBox *editor = d_ptr->createEditor(property, parent);
1876 editor->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
1877 editor->view()->setTextElideMode(Qt::ElideRight);
1878 QStringList enumNames = manager->enumNames(property);
1879 editor->addItems(enumNames);
1880 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1881 const auto enumNamesCount = enumNames.size();
1882 for (qsizetype i = 0; i < enumNamesCount; i++)
1883 editor->setItemIcon(i, enumIcons.value(i));
1884 editor->setCurrentIndex(manager
->value(property
));
1886 connect(editor, &QComboBox::currentIndexChanged,
1887 this, [
this](
int value) { d_ptr->slotSetValue(value); });
1888 connect(editor, &QObject::destroyed,
1889 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1894
1895
1896
1897
1900 disconnect(manager, &QtEnumPropertyManager::valueChanged,
this,
nullptr);
1901 disconnect(manager, &QtEnumPropertyManager::enumNamesChanged,
this,
nullptr);
1909 Q_DECLARE_PUBLIC(QtCursorEditorFactory)
1928 QtProperty *enumProp = m_propertyToEnum.value(property);
1943 QtProperty *prop = m_enumToProperty.value(property);
1951 cursorManager->setValue(prop, QCursor(cdb->valueToCursor(value)));
1960 for (
auto itEditor = m_editorToEnum.cbegin(), ecend = m_editorToEnum.cend(); itEditor != ecend; ++itEditor)
1961 if (itEditor.key() == object) {
1962 QWidget *editor = itEditor.key();
1964 m_editorToEnum.remove(editor);
1965 m_enumToEditors[enumProp].removeAll(editor);
1966 if (m_enumToEditors[enumProp].isEmpty()) {
1967 m_enumToEditors.remove(enumProp);
1968 QtProperty *property = m_enumToProperty.value(enumProp);
1969 m_enumToProperty.remove(enumProp);
1970 m_propertyToEnum.remove(property);
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1990
1991
1993 : QtAbstractEditorFactory<QtCursorPropertyManager>(parent), d_ptr(
new QtCursorEditorFactoryPrivate())
1995 d_ptr->q_ptr =
this;
1997 d_ptr->m_enumEditorFactory =
new QtEnumEditorFactory(
this);
1998 d_ptr->m_enumPropertyManager =
new QtEnumPropertyManager(
this);
1999 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::valueChanged,
2000 this, [
this](
QtProperty *property,
int value)
2001 { d_ptr->slotEnumChanged(property, value); });
2002 d_ptr->m_enumEditorFactory->addPropertyManager(d_ptr->m_enumPropertyManager);
2006
2007
2011
2012
2013
2014
2017 connect(manager, &QtCursorPropertyManager::valueChanged,
2018 this, [
this](
QtProperty *property,
const QCursor &value)
2019 { d_ptr->slotPropertyChanged(property, value); });
2023
2024
2025
2026
2030 QtProperty *enumProp = d_ptr->m_propertyToEnum.value(property,
nullptr);
2031 if (enumProp ==
nullptr) {
2032 enumProp = d_ptr->m_enumPropertyManager->addProperty(property->propertyName());
2034 d_ptr->m_enumPropertyManager->setEnumNames(enumProp, cdb->cursorShapeNames());
2035 d_ptr->m_enumPropertyManager->setEnumIcons(enumProp, cdb->cursorShapeIcons());
2037 d_ptr->m_enumPropertyManager->setValue(enumProp, cdb->cursorToValue(manager->value(property)));
2039 d_ptr->m_propertyToEnum[property] = enumProp;
2040 d_ptr->m_enumToProperty[enumProp] = property;
2043 QWidget *editor = af->createEditor(enumProp, parent);
2044 d_ptr->m_enumToEditors[enumProp].append(editor);
2045 d_ptr->m_editorToEnum[editor] = enumProp;
2046 connect(editor, &QObject::destroyed,
2047 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2052
2053
2054
2055
2058 disconnect(manager, &QtCursorPropertyManager::valueChanged,
this,
nullptr);
2084 QLabel *m_pixmapLabel;
2086 QToolButton *m_button;
2091 m_pixmapLabel(
new QLabel),
2092 m_label(
new QLabel),
2093 m_button(
new QToolButton)
2095 auto *lt =
new QHBoxLayout(
this);
2096 setupTreeViewEditorMargin(lt);
2098 lt->addWidget(m_pixmapLabel);
2099 lt->addWidget(m_label);
2100 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2102 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2103 m_button->setFixedWidth(20);
2104 setFocusProxy(m_button);
2105 setFocusPolicy(m_button->focusPolicy());
2106 m_button->setText(tr(
"..."));
2107 m_button->installEventFilter(
this);
2108 connect(m_button, &QAbstractButton::clicked,
this, &QtColorEditWidget::buttonClicked);
2109 lt->addWidget(m_button);
2113void QtColorEditWidget::setValue(QColor c)
2121void QtColorEditWidget::updateColor()
2124 QtPropertyBrowserUtils::brushValuePixmap(QBrush(m_color),
2125 QtPropertyBrowserUtils::itemViewIconSize,
2126 devicePixelRatioF());
2127 m_pixmapLabel->setPixmap(pm);
2128 m_label->setText(QtPropertyBrowserUtils::colorValueText(m_color));
2131void QtColorEditWidget::buttonClicked()
2133 const QColor newColor = QColorDialog::getColor(m_color,
this, QString(), QColorDialog::ShowAlphaChannel);
2134 if (newColor.isValid() && newColor != m_color) {
2136 emit valueChanged(m_color);
2140bool QtColorEditWidget::eventFilter(QObject *obj, QEvent *ev)
2142 if (obj == m_button) {
2143 switch (ev->type()) {
2144 case QEvent::KeyPress:
2145 case QEvent::KeyRelease: {
2146 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2147 case Qt::Key_Escape:
2149 case Qt::Key_Return:
2161 return QWidget::eventFilter(obj, ev);
2166class QtColorEditorFactoryPrivate :
public EditorFactoryPrivate<QtColorEditWidget>
2168 QtColorEditorFactory *q_ptr =
nullptr;
2169 Q_DECLARE_PUBLIC(QtColorEditorFactory)
2172 void slotPropertyChanged(QtProperty *property, QColor value);
2173 void slotSetValue(QColor value);
2176void QtColorEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2179 const auto it = m_createdEditors.constFind(property);
2180 if (it == m_createdEditors.constEnd())
2183 for (QtColorEditWidget *e : it.value())
2187void QtColorEditorFactoryPrivate::slotSetValue(QColor value)
2189 QObject *object = q_ptr->sender();
2190 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
2191 if (itEditor.key() == object) {
2192 QtProperty *property = itEditor.value();
2193 QtColorPropertyManager *manager = q_ptr->propertyManager(property);
2196 manager->setValue(property, value);
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2214
2215
2217 QtAbstractEditorFactory<QtColorPropertyManager>(parent),
2218 d_ptr(
new QtColorEditorFactoryPrivate())
2220 d_ptr->q_ptr =
this;
2224
2225
2228 qDeleteAll(d_ptr->m_editorToProperty.keys());
2232
2233
2234
2235
2238 connect(manager, &QtColorPropertyManager::valueChanged,
2239 this, [
this](
QtProperty *property, QColor value)
2240 { d_ptr->slotPropertyChanged(property, value); });
2244
2245
2246
2247
2252 editor->setValue(manager->value(property));
2253 connect(editor, &QtColorEditWidget::valueChanged,
2254 this, [
this](QColor value) { d_ptr->slotSetValue(value); });
2255 connect(editor, &QObject::destroyed,
2256 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2261
2262
2263
2264
2267 disconnect(manager, &QtColorPropertyManager::valueChanged,
this,
nullptr);
2293 QLabel *m_pixmapLabel;
2295 QToolButton *m_button;
2300 m_pixmapLabel(
new QLabel),
2301 m_label(
new QLabel),
2302 m_button(
new QToolButton)
2304 auto *lt =
new QHBoxLayout(
this);
2305 setupTreeViewEditorMargin(lt);
2307 lt->addWidget(m_pixmapLabel);
2308 lt->addWidget(m_label);
2309 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2311 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2312 m_button->setFixedWidth(20);
2313 setFocusProxy(m_button);
2314 setFocusPolicy(m_button->focusPolicy());
2315 m_button->setText(tr(
"..."));
2316 m_button->installEventFilter(
this);
2317 connect(m_button, &QAbstractButton::clicked,
this, &QtFontEditWidget::buttonClicked);
2318 lt->addWidget(m_button);
2322void QtFontEditWidget::updateFont()
2324 const auto pm = QtPropertyBrowserUtils::fontValuePixmap(
2325 m_font, QtPropertyBrowserUtils::itemViewIconSize, devicePixelRatioF());
2326 m_pixmapLabel->setPixmap(pm);
2327 m_label->setText(QtPropertyBrowserUtils::fontValueText(m_font));
2330void QtFontEditWidget::setValue(
const QFont &f)
2338void QtFontEditWidget::buttonClicked()
2341 QFont newFont = QFontDialog::getFont(&ok, m_font,
this, tr(
"Select Font"));
2342 if (ok && newFont != m_font) {
2345 if (m_font.family() != newFont.family())
2346 f.setFamily(newFont.family());
2347 if (m_font.pointSize() != newFont.pointSize())
2348 f.setPointSize(newFont.pointSize());
2349 if (m_font.bold() != newFont.bold())
2350 f.setBold(newFont.bold());
2351 if (m_font.italic() != newFont.italic())
2352 f.setItalic(newFont.italic());
2353 if (m_font.underline() != newFont.underline())
2354 f.setUnderline(newFont.underline());
2355 if (m_font.strikeOut() != newFont.strikeOut())
2356 f.setStrikeOut(newFont.strikeOut());
2358 emit valueChanged(m_font);
2362bool QtFontEditWidget::eventFilter(QObject *obj, QEvent *ev)
2364 if (obj == m_button) {
2365 switch (ev->type()) {
2366 case QEvent::KeyPress:
2367 case QEvent::KeyRelease: {
2368 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2369 case Qt::Key_Escape:
2371 case Qt::Key_Return:
2383 return QWidget::eventFilter(obj, ev);
2388class QtFontEditorFactoryPrivate :
public EditorFactoryPrivate<QtFontEditWidget>
2390 QtFontEditorFactory *q_ptr =
nullptr;
2391 Q_DECLARE_PUBLIC(QtFontEditorFactory)
2394 void slotPropertyChanged(QtProperty *property,
const QFont &value);
2395 void slotSetValue(
const QFont &value);
2398void QtFontEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2401 const auto it = m_createdEditors.constFind(property);
2402 if (it == m_createdEditors.constEnd())
2405 for (QtFontEditWidget *e : it.value())
2409void QtFontEditorFactoryPrivate::slotSetValue(
const QFont &value)
2411 QObject *object = q_ptr->sender();
2412 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
2413 if (itEditor.key() == object) {
2414 QtProperty *property = itEditor.value();
2415 QtFontPropertyManager *manager = q_ptr->propertyManager(property);
2418 manager->setValue(property, value);
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2436
2437
2439 QtAbstractEditorFactory<QtFontPropertyManager>(parent),
2440 d_ptr(
new QtFontEditorFactoryPrivate())
2442 d_ptr->q_ptr =
this;
2446
2447
2450 qDeleteAll(d_ptr->m_editorToProperty.keys());
2454
2455
2456
2457
2460 connect(manager, &QtFontPropertyManager::valueChanged,
2461 this, [
this](
QtProperty *property,
const QFont &value)
2462 { d_ptr->slotPropertyChanged(property, value); });
2466
2467
2468
2469
2474 editor->setValue(manager->value(property));
2475 connect(editor, &QtFontEditWidget::valueChanged,
2476 this, [
this](
const QFont &value) { d_ptr->slotSetValue(value); });
2477 connect(editor, &QObject::destroyed,
2478 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2483
2484
2485
2486
2489 disconnect(manager, &QtFontPropertyManager::valueChanged,
this,
nullptr);
2494#include "moc_qteditorfactory_p.cpp"
2495#include "qteditorfactory.moc"
PropertyToEditorListMap m_createdEditors
Editor * createEditor(QtProperty *property, QWidget *parent)
void initializeEditor(QtProperty *property, Editor *e)
void slotEditorDestroyed(QObject *object)
EditorToPropertyMap m_editorToProperty
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(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(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(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.
void slotSetValue(const QDateTime &value)
The QtDateTimeEditFactory class provides QDateTimeEdit widgets for properties created by QtDateTimePr...
void disconnectPropertyManager(QtDateTimePropertyManager *manager) override
~QtDateTimeEditFactory() override
Destroys this factory, and all the widgets it has created.
void connectPropertyManager(QtDateTimePropertyManager *manager) override
QWidget * createEditor(QtDateTimePropertyManager *manager, QtProperty *property, QWidget *parent) override
The QtDateTimePropertyManager provides and manages QDateTime properties.
QDateTime 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 slotSingleStepChanged(QtProperty *property, double step)
void slotSetValue(double value)
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(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(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 slotRegExpChanged(QtProperty *property, const QRegularExpression ®Exp)
void slotSetValue(const QString &value)
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(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(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(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)