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>
64template <
class Editor>
67 auto *editor =
new Editor(parent);
72template <
class Editor>
75 auto it = m_createdEditors.find(property);
76 if (it == m_createdEditors.end())
77 it = m_createdEditors.insert(property, EditorList());
78 it.value().append(editor);
81template <
class Editor>
84 auto pred = [object] (
const Editor *e) {
return object == e; };
85 for (
auto it = m_createdEditors.begin(), end = m_createdEditors.end(); it != end; ++it) {
86 auto &editorList = it.value();
87 auto listIt = std::find_if(editorList.cbegin(), editorList.cend(), pred);
88 if (listIt != editorList.cend()) {
89 editorList.erase(listIt);
90 if (editorList.isEmpty())
91 m_createdEditors.erase(it) ;
97template <
class Editor>
100 for (
auto it = m_createdEditors.begin(), end = m_createdEditors.end(); it != end; ++it)
101 qDeleteAll(it.value());
102 m_createdEditors.clear();
110 Q_DECLARE_PUBLIC(QtSpinBoxFactory)
121 const auto it = m_createdEditors.constFind(property);
122 if (it == m_createdEditors.cend())
124 for (QSpinBox *editor : it.value()) {
125 if (editor->value() != value) {
126 editor->blockSignals(
true);
127 editor->setValue(value);
128 editor->blockSignals(
false);
135 const auto it = m_createdEditors.constFind(property);
136 if (it == m_createdEditors.cend())
143 for (QSpinBox *editor : it.value()) {
144 editor->blockSignals(
true);
145 editor->setRange(min, max);
146 editor->setValue(manager->value(property));
147 editor->blockSignals(
false);
153 const auto it = m_createdEditors.constFind(property);
154 if (it == m_createdEditors.cend())
156 for (QSpinBox *editor : it.value()) {
157 editor->blockSignals(
true);
158 editor->setSingleStep(step);
159 editor->blockSignals(
false);
166 manager->setValue(property, value);
170
171
172
173
174
175
176
177
178
179
182
183
185 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSpinBoxFactoryPrivate())
192
193
196 d_ptr->deleteEditors();
200
201
202
203
206 connect(manager, &QtIntPropertyManager::valueChanged,
208 { d_ptr->slotPropertyChanged(property, value); });
210 this, [
this](
QtProperty *property,
int min,
int max)
211 { d_ptr->slotRangeChanged(property, min, max); });
214 { d_ptr->slotSingleStepChanged(property, value); });
218
219
220
221
225 QSpinBox *editor = d_ptr->createEditor(property, parent);
228 editor->setValue(manager
->value(property
));
229 editor->setKeyboardTracking(
false);
231 connect(editor, &QSpinBox::valueChanged,
232 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
233 connect(editor, &QObject::destroyed,
234 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
239
240
241
242
245 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
255 Q_DECLARE_PUBLIC(QtSliderFactory)
265 const auto it = m_createdEditors.constFind(property);
266 if (it == m_createdEditors.cend())
268 for (QSlider *editor : it.value()) {
269 editor->blockSignals(
true);
270 editor->setValue(value);
271 editor->blockSignals(
false);
277 const auto it = m_createdEditors.constFind(property);
278 if (it == m_createdEditors.cend())
285 for (QSlider *editor : it.value()) {
286 editor->blockSignals(
true);
287 editor->setRange(min, max);
288 editor->setValue(manager->value(property));
289 editor->blockSignals(
false);
295 const auto it = m_createdEditors.constFind(property);
296 if (it == m_createdEditors.cend())
298 for (QSlider *editor : it.value()) {
299 editor->blockSignals(
true);
300 editor->setSingleStep(step);
301 editor->blockSignals(
false);
308 manager->setValue(property, value);
312
313
314
315
316
317
318
319
320
321
324
325
327 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSliderFactoryPrivate())
334
335
338 d_ptr->deleteEditors();
342
343
344
345
348 connect(manager, &QtIntPropertyManager::valueChanged,
350 { d_ptr->slotPropertyChanged(property, value); });
352 this, [
this](
QtProperty *property,
int min,
int max)
353 { d_ptr->slotRangeChanged(property, min, max); });
356 { d_ptr->slotSingleStepChanged(property, value); });
360
361
362
363
367 auto *editor =
new QSlider(Qt::Horizontal, parent);
368 d_ptr->initializeEditor(property, editor);
371 editor->setValue(manager
->value(property
));
373 connect(editor, &QSlider::valueChanged,
374 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
375 connect(editor, &QObject::destroyed,
376 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
381
382
383
384
387 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
397 Q_DECLARE_PUBLIC(QtScrollBarFactory)
407 const auto it = m_createdEditors.constFind(property);
408 if (it == m_createdEditors.cend())
411 for (QScrollBar *editor : it.value()) {
412 editor->blockSignals(
true);
413 editor->setValue(value);
414 editor->blockSignals(
false);
420 const auto it = m_createdEditors.constFind(property);
421 if (it == m_createdEditors.cend())
428 for (QScrollBar *editor : it.value()) {
429 editor->blockSignals(
true);
430 editor->setRange(min, max);
431 editor->setValue(manager->value(property));
432 editor->blockSignals(
false);
438 const auto it = m_createdEditors.constFind(property);
439 if (it == m_createdEditors.cend())
441 for (QScrollBar *editor : it.value()) {
442 editor->blockSignals(
true);
443 editor->setSingleStep(step);
444 editor->blockSignals(
false);
451 manager->setValue(property, value);
455
456
457
458
459
460
461
462
463
464
467
468
470 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtScrollBarFactoryPrivate())
477
478
481 d_ptr->deleteEditors();
485
486
487
488
491 connect(manager, &QtIntPropertyManager::valueChanged,
493 { d_ptr->slotPropertyChanged(property, value); });
495 this, [
this](
QtProperty *property,
int min,
int max)
496 { d_ptr->slotRangeChanged(property, min, max); });
499 { d_ptr->slotSingleStepChanged(property, value); });
503
504
505
506
510 auto *editor =
new QScrollBar(Qt::Horizontal, parent);
511 d_ptr->initializeEditor(property, editor);
514 editor->setValue(manager
->value(property
));
515 connect(editor, &QScrollBar::valueChanged,
516 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
517 connect(editor, &QObject::destroyed,
518 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
523
524
525
526
529 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
539 Q_DECLARE_PUBLIC(QtCheckBoxFactory)
547 const auto it = m_createdEditors.constFind(property);
548 if (it == m_createdEditors.cend())
551 for (QtBoolEdit *editor : it.value()) {
552 editor->blockCheckBoxSignals(
true);
553 editor->setChecked(value);
554 editor->blockCheckBoxSignals(
false);
561 manager->setValue(property, value);
565
566
567
568
569
570
571
572
573
574
577
578
580 : QtAbstractEditorFactory<QtBoolPropertyManager>(parent), d_ptr(
new QtCheckBoxFactoryPrivate())
587
588
591 d_ptr->deleteEditors();
595
596
597
598
601 connect(manager, &QtBoolPropertyManager::valueChanged,
602 this, [
this](
QtProperty *property,
bool value)
603 { d_ptr->slotPropertyChanged(property, value); });
607
608
609
610
614 QtBoolEdit *editor = d_ptr->createEditor(property, parent);
617 connect(editor, &QtBoolEdit::toggled,
618 this, [
this, property](
bool value) { d_ptr->slotSetValue(property, value); });
619 connect(editor, &QObject::destroyed,
620 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
625
626
627
628
631 disconnect(manager, &QtBoolPropertyManager::valueChanged,
this,
nullptr);
639 Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
651 const auto it = m_createdEditors.constFind(property);
652 if (it == m_createdEditors.cend())
654 for (QDoubleSpinBox *editor : it.value()) {
655 if (editor->value() != value) {
656 editor->blockSignals(
true);
657 editor->setValue(value);
658 editor->blockSignals(
false);
664 double min,
double max)
666 const auto it = m_createdEditors.constFind(property);
667 if (it == m_createdEditors.cend())
674 for (QDoubleSpinBox *editor : it.value()) {
675 editor->blockSignals(
true);
676 editor->setRange(min, max);
677 editor->setValue(manager->value(property));
678 editor->blockSignals(
false);
684 const auto it = m_createdEditors.constFind(property);
685 if (it == m_createdEditors.cend())
692 for (QDoubleSpinBox *editor : it.value()) {
693 editor->blockSignals(
true);
694 editor->setSingleStep(step);
695 editor->blockSignals(
false);
701 const auto it = m_createdEditors.constFind(property);
702 if (it == m_createdEditors.constEnd())
709 for (QDoubleSpinBox *editor : it.value()) {
710 editor->blockSignals(
true);
711 editor->setDecimals(prec);
712 editor->setValue(manager->value(property));
713 editor->blockSignals(
false);
720 manager->setValue(property, value);
724
725
726
727
728
729
730
731
732
735
736
738 : QtAbstractEditorFactory<QtDoublePropertyManager>(parent), d_ptr(
new QtDoubleSpinBoxFactoryPrivate())
745
746
749 d_ptr->deleteEditors();
753
754
755
756
759 connect(manager, &QtDoublePropertyManager::valueChanged,
760 this, [
this](
QtProperty *property,
double value)
761 { d_ptr->slotPropertyChanged(property, value); });
763 this, [
this](
QtProperty *property,
double min,
double max)
764 { d_ptr->slotRangeChanged(property, min, max); });
766 this, [
this](
QtProperty *property,
double value)
767 { d_ptr->slotSingleStepChanged(property, value); });
770 { d_ptr->slotDecimalsChanged(property, value); });
774
775
776
777
781 QDoubleSpinBox *editor = d_ptr->createEditor(property, parent);
785 editor->setValue(manager
->value(property
));
786 editor->setKeyboardTracking(
false);
788 connect(editor, &QDoubleSpinBox::valueChanged,
789 this, [
this, property](
double value) { d_ptr->slotSetValue(property, value); });
790 connect(editor, &QObject::destroyed,
791 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
796
797
798
799
802 disconnect(manager, &QtDoublePropertyManager::valueChanged,
this,
nullptr);
813 Q_DECLARE_PUBLIC(QtLineEditFactory)
822 const QString &value)
824 const auto it = m_createdEditors.constFind(property);
825 if (it == m_createdEditors.constEnd())
828 for (QLineEdit *editor : it.value()) {
829 if (editor->text() != value)
830 editor->setText(value);
835 const QRegularExpression ®Exp)
837 const auto it = m_createdEditors.constFind(property);
838 if (it == m_createdEditors.constEnd())
845 for (QLineEdit *editor : it.value()) {
846 editor->blockSignals(
true);
847 const QValidator *oldValidator = editor->validator();
848 QValidator *newValidator =
nullptr;
849 if (regExp.isValid()) {
850 newValidator =
new QRegularExpressionValidator(regExp, editor);
852 editor->setValidator(newValidator);
854 editor->blockSignals(
false);
861 manager->setValue(property, value);
865
866
867
868
869
870
871
872
873
874
877
878
880 : QtAbstractEditorFactory<QtStringPropertyManager>(parent), d_ptr(
new QtLineEditFactoryPrivate())
887
888
891 d_ptr->deleteEditors();
895
896
897
898
901 connect(manager, &QtStringPropertyManager::valueChanged,
902 this, [
this](
QtProperty *property,
const QString &value)
903 { d_ptr->slotPropertyChanged(property, value); });
905 this, [
this](
QtProperty *property,
const QRegularExpression &value)
906 { d_ptr->slotRegExpChanged(property, value); });
910
911
912
913
917 QLineEdit *editor = d_ptr->createEditor(property, parent);
918 QRegularExpression regExp = manager->regExp(property);
919 if (regExp.isValid() && !regExp.pattern().isEmpty()) {
920 auto *validator =
new QRegularExpressionValidator(regExp, editor);
921 editor->setValidator(validator);
923 editor->setText(manager->value(property));
925 connect(editor, &QLineEdit::textEdited,
926 this, [
this, property](
const QString &value) { d_ptr->slotSetValue(property, value); });
927 connect(editor, &QObject::destroyed,
928 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
933
934
935
936
939 disconnect(manager, &QtStringPropertyManager::valueChanged,
this,
nullptr);
948 Q_DECLARE_PUBLIC(QtDateEditFactory)
958 const auto it = m_createdEditors.constFind(property);
959 if (it == m_createdEditors.constEnd())
961 for (QDateEdit *editor : it.value()) {
962 editor->blockSignals(
true);
963 editor->setDate(value);
964 editor->blockSignals(
false);
970 const auto it = m_createdEditors.constFind(property);
971 if (it == m_createdEditors.constEnd())
978 for (QDateEdit *editor : it.value()) {
979 editor->blockSignals(
true);
980 editor->setDateRange(min, max);
981 editor->setDate(manager->value(property));
982 editor->blockSignals(
false);
989 manager->setValue(property, value);
993
994
995
996
997
998
999
1000
1001
1002
1005
1006
1008 : QtAbstractEditorFactory<QtDatePropertyManager>(parent), d_ptr(
new QtDateEditFactoryPrivate())
1010 d_ptr->q_ptr =
this;
1015
1016
1019 d_ptr->deleteEditors();
1023
1024
1025
1026
1029 connect(manager, &QtDatePropertyManager::valueChanged,
1030 this, [
this](
QtProperty *property, QDate value)
1031 { d_ptr->slotPropertyChanged(property, value); });
1033 this, [
this](
QtProperty *property, QDate min, QDate max)
1034 { d_ptr->slotRangeChanged(property, min, max); });
1038
1039
1040
1041
1045 QDateEdit *editor = d_ptr->createEditor(property, parent);
1046 editor->setDisplayFormat(QtPropertyBrowserUtils::dateFormat());
1047 editor->setCalendarPopup(
true);
1049 editor->setDate(manager
->value(property));
1051 connect(editor, &QDateEdit::dateChanged,
1052 this, [
this, property](QDate value) { d_ptr->slotSetValue(property, value); });
1053 connect(editor, &QObject::destroyed,
1054 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1059
1060
1061
1062
1065 disconnect(manager, &QtDatePropertyManager::valueChanged,
this,
nullptr);
1074 Q_DECLARE_PUBLIC(QtTimeEditFactory)
1083 const auto it = m_createdEditors.constFind(property);
1084 if (it == m_createdEditors.constEnd())
1086 for (QTimeEdit *editor : it.value()) {
1087 editor->blockSignals(
true);
1088 editor->setTime(value);
1089 editor->blockSignals(
false);
1096 manager->setValue(property, value);
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1112
1113
1115 : QtAbstractEditorFactory<QtTimePropertyManager>(parent), d_ptr(
new QtTimeEditFactoryPrivate())
1117 d_ptr->q_ptr =
this;
1122
1123
1126 d_ptr->deleteEditors();
1130
1131
1132
1133
1136 connect(manager, &QtTimePropertyManager::valueChanged,
1137 this, [
this](
QtProperty *property, QTime value)
1138 { d_ptr->slotPropertyChanged(property, value); });
1142
1143
1144
1145
1149 QTimeEdit *editor = d_ptr->createEditor(property, parent);
1150 editor->setDisplayFormat(QtPropertyBrowserUtils::timeFormat());
1151 editor->setTime(manager
->value(property));
1153 connect(editor, &QTimeEdit::timeChanged,
1154 this, [
this, property](QTime value) { d_ptr->slotSetValue(property, value); });
1155 connect(editor, &QObject::destroyed,
1156 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1161
1162
1163
1164
1167 disconnect(manager, &QtTimePropertyManager::valueChanged,
this,
nullptr);
1175 Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
1184 const QDateTime &value)
1186 const auto it = m_createdEditors.constFind(property);
1187 if (it == m_createdEditors.constEnd())
1190 for (QDateTimeEdit *editor : it.value()) {
1191 editor->blockSignals(
true);
1192 editor->setDateTime(value);
1193 editor->blockSignals(
false);
1200 manager->setValue(property, value);
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1216
1217
1219 : QtAbstractEditorFactory<QtDateTimePropertyManager>(parent), d_ptr(
new QtDateTimeEditFactoryPrivate())
1221 d_ptr->q_ptr =
this;
1226
1227
1230 d_ptr->deleteEditors();
1234
1235
1236
1237
1240 connect(manager, &QtDateTimePropertyManager::valueChanged,
1241 this, [
this](
QtProperty *property,
const QDateTime &value)
1242 { d_ptr->slotPropertyChanged(property, value); });
1246
1247
1248
1249
1253 QDateTimeEdit *editor = d_ptr->createEditor(property, parent);
1254 editor->setDisplayFormat(QtPropertyBrowserUtils::dateTimeFormat());
1255 editor->setDateTime(manager
->value(property));
1257 connect(editor, &QDateTimeEdit::dateTimeChanged,
1258 this, [
this, property](
const QDateTime &value) { d_ptr->slotSetValue(property, value); });
1259 connect(editor, &QObject::destroyed,
1260 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1265
1266
1267
1268
1271 disconnect(manager, &QtDateTimePropertyManager::valueChanged,
this,
nullptr);
1279 Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
1287 const QKeySequence &value)
1289 const auto it = m_createdEditors.constFind(property);
1290 if (it == m_createdEditors.constEnd())
1293 for (QKeySequenceEdit *editor : it.value()) {
1294 editor->blockSignals(
true);
1295 editor->setKeySequence(value);
1296 editor->blockSignals(
false);
1303 manager->setValue(property, value);
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1319
1320
1322 : QtAbstractEditorFactory<QtKeySequencePropertyManager>(parent), d_ptr(
new QtKeySequenceEditorFactoryPrivate())
1324 d_ptr->q_ptr =
this;
1329
1330
1333 d_ptr->deleteEditors();
1337
1338
1339
1340
1343 connect(manager, &QtKeySequencePropertyManager::valueChanged,
1344 this, [
this](
QtProperty *property,
const QKeySequence &value)
1345 { d_ptr->slotPropertyChanged(property, value); });
1349
1350
1351
1352
1356 QKeySequenceEdit *editor = d_ptr->createEditor(property, parent);
1357 editor->setKeySequence(manager->value(property));
1359 connect(editor, &QKeySequenceEdit::keySequenceChanged,
1360 this, [
this, property](
const QKeySequence &value) { d_ptr->slotSetValue(property, value); });
1361 connect(editor, &QObject::destroyed,
1362 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1367
1368
1369
1370
1373 disconnect(manager, &QtKeySequencePropertyManager::valueChanged,
this,
nullptr);
1399 void handleKeyEvent(QKeyEvent *e);
1402 QLineEdit *m_lineEdit;
1406 : QWidget(parent), m_lineEdit(
new QLineEdit(
this))
1408 auto *layout =
new QHBoxLayout(
this);
1409 layout->addWidget(m_lineEdit);
1410 layout->setContentsMargins(QMargins());
1411 m_lineEdit->installEventFilter(
this);
1412 m_lineEdit->setReadOnly(
true);
1413 m_lineEdit->setFocusProxy(
this);
1414 setFocusPolicy(m_lineEdit->focusPolicy());
1415 setAttribute(Qt::WA_InputMethodEnabled);
1420 if (o == m_lineEdit && e->type() == QEvent::ContextMenu) {
1421 QContextMenuEvent *c =
static_cast<QContextMenuEvent *>(e);
1422 QMenu *menu = m_lineEdit->createStandardContextMenu();
1423 const auto actions = menu->actions();
1424 for (QAction *action : actions) {
1425 action->setShortcut(QKeySequence());
1426 QString actionString = action->text();
1427 const auto pos = actionString.lastIndexOf(QLatin1Char(
'\t'));
1429 actionString = actionString.remove(pos, actionString.size() - pos);
1430 action->setText(actionString);
1432 QAction *actionBefore =
nullptr;
1433 if (!actions.empty())
1434 actionBefore = actions[0];
1435 auto *clearAction =
new QAction(tr(
"Clear Char"), menu);
1436 menu->insertAction(actionBefore, clearAction);
1437 menu->insertSeparator(actionBefore);
1438 clearAction->setEnabled(!m_value.isNull());
1439 connect(clearAction, &QAction::triggered,
this, &QtCharEdit::slotClearChar);
1440 menu->exec(c->globalPos());
1446 return QWidget::eventFilter(o, e);
1451 if (m_value.isNull())
1454 emit valueChanged(m_value);
1459 const int key = e->key();
1461 case Qt::Key_Control:
1465 case Qt::Key_Super_L:
1466 case Qt::Key_Return:
1472 const QString text = e->text();
1473 if (text.size() != 1)
1476 const QChar c = text.at(0);
1484 const QString str = m_value.isNull() ? QString() : QString(m_value);
1485 m_lineEdit->setText(str);
1487 emit valueChanged(m_value);
1492 if (value == m_value)
1496 QString str = value.isNull() ? QString() : QString(value);
1497 m_lineEdit->setText(str);
1507 m_lineEdit->event(e);
1508 m_lineEdit->selectAll();
1509 QWidget::focusInEvent(e);
1514 m_lineEdit->event(e);
1515 QWidget::focusOutEvent(e);
1526 m_lineEdit->event(e);
1532 case QEvent::Shortcut:
1533 case QEvent::ShortcutOverride:
1534 case QEvent::KeyRelease:
1540 return QWidget::event(e);
1548 Q_DECLARE_PUBLIC(QtCharEditorFactory)
1559 const auto it = m_createdEditors.constFind(property);
1560 if (it == m_createdEditors.constEnd())
1563 for (QtCharEdit *editor : it.value()) {
1564 editor->blockSignals(
true);
1565 editor->setValue(value);
1566 editor->blockSignals(
false);
1573 manager->setValue(property, value);
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1589
1590
1592 : QtAbstractEditorFactory<QtCharPropertyManager>(parent), d_ptr(
new QtCharEditorFactoryPrivate())
1594 d_ptr->q_ptr =
this;
1599
1600
1603 d_ptr->deleteEditors();
1607
1608
1609
1610
1613 connect(manager, &QtCharPropertyManager::valueChanged,
1614 this, [
this](
QtProperty *property,
const QChar &value)
1615 { d_ptr->slotPropertyChanged(property, value); });
1619
1620
1621
1622
1626 QtCharEdit *editor = d_ptr->createEditor(property, parent);
1627 editor->setValue(manager->value(property));
1629 connect(editor, &QtCharEdit::valueChanged,
1630 this, [
this, property](
const QChar &value) { d_ptr->slotSetValue(property, value); });
1631 connect(editor, &QObject::destroyed,
1632 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1637
1638
1639
1640
1643 disconnect(manager, &QtCharPropertyManager::valueChanged,
this,
nullptr);
1651 Q_DECLARE_PUBLIC(QtEnumEditorFactory)
1662 const auto it = m_createdEditors.constFind(property);
1663 if (it == m_createdEditors.constEnd())
1666 for (QComboBox *editor : it.value()) {
1667 editor->blockSignals(
true);
1668 editor->setCurrentIndex(value);
1669 editor->blockSignals(
false);
1674 const QStringList &enumNames)
1676 const auto it = m_createdEditors.constFind(property);
1677 if (it == m_createdEditors.constEnd())
1684 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1686 for (QComboBox *editor : it.value()) {
1687 editor->blockSignals(
true);
1689 editor->addItems(enumNames);
1690 const auto nameCount = enumNames.size();
1691 for (qsizetype i = 0; i < nameCount; i++)
1692 editor->setItemIcon(i, enumIcons.value(i));
1693 editor->setCurrentIndex(manager->value(property));
1694 editor->blockSignals(
false);
1699 const QMap<
int, QIcon> &enumIcons)
1701 const auto it = m_createdEditors.constFind(property);
1702 if (it == m_createdEditors.constEnd())
1709 const QStringList enumNames = manager->enumNames(property);
1710 for (QComboBox *editor : it.value()) {
1711 editor->blockSignals(
true);
1712 const auto nameCount = enumNames.size();
1713 for (qsizetype i = 0; i < nameCount; i++)
1714 editor->setItemIcon(i, enumIcons.value(i));
1715 editor->setCurrentIndex(manager->value(property));
1716 editor->blockSignals(
false);
1723 manager->setValue(property, value);
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1739
1740
1742 : QtAbstractEditorFactory<QtEnumPropertyManager>(parent), d_ptr(
new QtEnumEditorFactoryPrivate())
1744 d_ptr->q_ptr =
this;
1749
1750
1753 d_ptr->deleteEditors();
1757
1758
1759
1760
1763 connect(manager, &QtEnumPropertyManager::valueChanged,
1764 this, [
this](
QtProperty *property,
int value)
1765 { d_ptr->slotPropertyChanged(property, value); });
1766 connect(manager, &QtEnumPropertyManager::enumNamesChanged,
1767 this, [
this](
QtProperty *property,
const QStringList &value)
1768 { d_ptr->slotEnumNamesChanged(property, value); });
1772
1773
1774
1775
1779 QComboBox *editor = d_ptr->createEditor(property, parent);
1780 editor->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
1781 editor->view()->setTextElideMode(Qt::ElideRight);
1782 QStringList enumNames = manager->enumNames(property);
1783 editor->addItems(enumNames);
1784 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1785 const auto enumNamesCount = enumNames.size();
1786 for (qsizetype i = 0; i < enumNamesCount; i++)
1787 editor->setItemIcon(i, enumIcons.value(i));
1788 editor->setCurrentIndex(manager
->value(property
));
1790 connect(editor, &QComboBox::currentIndexChanged,
1791 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
1792 connect(editor, &QObject::destroyed,
1793 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1798
1799
1800
1801
1804 disconnect(manager, &QtEnumPropertyManager::valueChanged,
this,
nullptr);
1805 disconnect(manager, &QtEnumPropertyManager::enumNamesChanged,
this,
nullptr);
1813 Q_DECLARE_PUBLIC(QtCursorEditorFactory)
1832 QtProperty *enumProp = m_propertyToEnum.value(property);
1847 QtProperty *prop = m_enumToProperty.value(property);
1855 cursorManager->setValue(prop, QCursor(cdb->valueToCursor(value)));
1864 for (
auto itEditor = m_editorToEnum.cbegin(), ecend = m_editorToEnum.cend(); itEditor != ecend; ++itEditor)
1865 if (itEditor.key() == object) {
1866 QWidget *editor = itEditor.key();
1868 m_editorToEnum.remove(editor);
1869 m_enumToEditors[enumProp].removeAll(editor);
1870 if (m_enumToEditors[enumProp].isEmpty()) {
1871 m_enumToEditors.remove(enumProp);
1872 QtProperty *property = m_enumToProperty.value(enumProp);
1873 m_enumToProperty.remove(enumProp);
1874 m_propertyToEnum.remove(property);
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1894
1895
1897 : QtAbstractEditorFactory<QtCursorPropertyManager>(parent), d_ptr(
new QtCursorEditorFactoryPrivate())
1899 d_ptr->q_ptr =
this;
1901 d_ptr->m_enumEditorFactory =
new QtEnumEditorFactory(
this);
1902 d_ptr->m_enumPropertyManager =
new QtEnumPropertyManager(
this);
1903 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::valueChanged,
1904 this, [
this](
QtProperty *property,
int value)
1905 { d_ptr->slotEnumChanged(property, value); });
1906 d_ptr->m_enumEditorFactory->addPropertyManager(d_ptr->m_enumPropertyManager);
1910
1911
1915
1916
1917
1918
1921 connect(manager, &QtCursorPropertyManager::valueChanged,
1922 this, [
this](
QtProperty *property,
const QCursor &value)
1923 { d_ptr->slotPropertyChanged(property, value); });
1927
1928
1929
1930
1934 QtProperty *enumProp = d_ptr->m_propertyToEnum.value(property,
nullptr);
1935 if (enumProp ==
nullptr) {
1936 enumProp = d_ptr->m_enumPropertyManager->addProperty(property->propertyName());
1938 d_ptr->m_enumPropertyManager->setEnumNames(enumProp, cdb->cursorShapeNames());
1939 d_ptr->m_enumPropertyManager->setEnumIcons(enumProp, cdb->cursorShapeIcons());
1941 d_ptr->m_enumPropertyManager->setValue(enumProp, cdb->cursorToValue(manager->value(property)));
1943 d_ptr->m_propertyToEnum[property] = enumProp;
1944 d_ptr->m_enumToProperty[enumProp] = property;
1947 QWidget *editor = af->createEditor(enumProp, parent);
1948 d_ptr->m_enumToEditors[enumProp].append(editor);
1949 d_ptr->m_editorToEnum[editor] = enumProp;
1950 connect(editor, &QObject::destroyed,
1951 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1956
1957
1958
1959
1962 disconnect(manager, &QtCursorPropertyManager::valueChanged,
this,
nullptr);
1988 QLabel *m_pixmapLabel;
1990 QToolButton *m_button;
1995 m_pixmapLabel(
new QLabel),
1996 m_label(
new QLabel),
1997 m_button(
new QToolButton)
1999 auto *lt =
new QHBoxLayout(
this);
2000 setupTreeViewEditorMargin(lt);
2002 lt->addWidget(m_pixmapLabel);
2003 lt->addWidget(m_label);
2004 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2006 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2007 m_button->setFixedWidth(20);
2008 setFocusProxy(m_button);
2009 setFocusPolicy(m_button->focusPolicy());
2010 m_button->setText(tr(
"..."));
2011 m_button->installEventFilter(
this);
2012 connect(m_button, &QAbstractButton::clicked,
this, &QtColorEditWidget::buttonClicked);
2013 lt->addWidget(m_button);
2017void QtColorEditWidget::setValue(QColor c)
2025void QtColorEditWidget::updateColor()
2028 QtPropertyBrowserUtils::brushValuePixmap(QBrush(m_color),
2029 QtPropertyBrowserUtils::itemViewIconSize,
2030 devicePixelRatioF());
2031 m_pixmapLabel->setPixmap(pm);
2032 m_label->setText(QtPropertyBrowserUtils::colorValueText(m_color));
2035void QtColorEditWidget::buttonClicked()
2037 const QColor newColor = QColorDialog::getColor(m_color,
this, QString(), QColorDialog::ShowAlphaChannel);
2038 if (newColor.isValid() && newColor != m_color) {
2040 emit valueChanged(m_color);
2044bool QtColorEditWidget::eventFilter(QObject *obj, QEvent *ev)
2046 if (obj == m_button) {
2047 switch (ev->type()) {
2048 case QEvent::KeyPress:
2049 case QEvent::KeyRelease: {
2050 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2051 case Qt::Key_Escape:
2053 case Qt::Key_Return:
2065 return QWidget::eventFilter(obj, ev);
2070class QtColorEditorFactoryPrivate :
public EditorFactoryPrivate<QtColorEditWidget>
2072 QtColorEditorFactory *q_ptr =
nullptr;
2073 Q_DECLARE_PUBLIC(QtColorEditorFactory)
2076 void slotPropertyChanged(QtProperty *property, QColor value);
2077 void slotSetValue(QtProperty *property, QColor value);
2080void QtColorEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2083 const auto it = m_createdEditors.constFind(property);
2084 if (it == m_createdEditors.constEnd())
2087 for (QtColorEditWidget *e : it.value())
2091void QtColorEditorFactoryPrivate::slotSetValue(QtProperty *property, QColor value)
2093 if (QtColorPropertyManager *manager = q_ptr->propertyManager(property))
2094 manager->setValue(property, value);
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2110
2111
2113 QtAbstractEditorFactory<QtColorPropertyManager>(parent),
2114 d_ptr(
new QtColorEditorFactoryPrivate())
2116 d_ptr->q_ptr =
this;
2120
2121
2124 d_ptr->deleteEditors();
2128
2129
2130
2131
2134 connect(manager, &QtColorPropertyManager::valueChanged,
2135 this, [
this](
QtProperty *property, QColor value)
2136 { d_ptr->slotPropertyChanged(property, value); });
2140
2141
2142
2143
2148 editor->setValue(manager->value(property));
2149 connect(editor, &QtColorEditWidget::valueChanged,
2150 this, [
this, property](QColor value) { d_ptr->slotSetValue(property, value); });
2151 connect(editor, &QObject::destroyed,
2152 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2157
2158
2159
2160
2163 disconnect(manager, &QtColorPropertyManager::valueChanged,
this,
nullptr);
2189 QLabel *m_pixmapLabel;
2191 QToolButton *m_button;
2196 m_pixmapLabel(
new QLabel),
2197 m_label(
new QLabel),
2198 m_button(
new QToolButton)
2200 auto *lt =
new QHBoxLayout(
this);
2201 setupTreeViewEditorMargin(lt);
2203 lt->addWidget(m_pixmapLabel);
2204 lt->addWidget(m_label);
2205 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2207 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2208 m_button->setFixedWidth(20);
2209 setFocusProxy(m_button);
2210 setFocusPolicy(m_button->focusPolicy());
2211 m_button->setText(tr(
"..."));
2212 m_button->installEventFilter(
this);
2213 connect(m_button, &QAbstractButton::clicked,
this, &QtFontEditWidget::buttonClicked);
2214 lt->addWidget(m_button);
2218void QtFontEditWidget::updateFont()
2220 const auto pm = QtPropertyBrowserUtils::fontValuePixmap(
2221 m_font, QtPropertyBrowserUtils::itemViewIconSize, devicePixelRatioF());
2222 m_pixmapLabel->setPixmap(pm);
2223 m_label->setText(QtPropertyBrowserUtils::fontValueText(m_font));
2226void QtFontEditWidget::setValue(
const QFont &f)
2234void QtFontEditWidget::buttonClicked()
2237 QFont newFont = QFontDialog::getFont(&ok, m_font,
this, tr(
"Select Font"));
2238 if (ok && newFont != m_font) {
2241 if (m_font.family() != newFont.family())
2242 f.setFamily(newFont.family());
2243 if (m_font.pointSize() != newFont.pointSize())
2244 f.setPointSize(newFont.pointSize());
2245 if (m_font.bold() != newFont.bold())
2246 f.setBold(newFont.bold());
2247 if (m_font.italic() != newFont.italic())
2248 f.setItalic(newFont.italic());
2249 if (m_font.underline() != newFont.underline())
2250 f.setUnderline(newFont.underline());
2251 if (m_font.strikeOut() != newFont.strikeOut())
2252 f.setStrikeOut(newFont.strikeOut());
2254 emit valueChanged(m_font);
2258bool QtFontEditWidget::eventFilter(QObject *obj, QEvent *ev)
2260 if (obj == m_button) {
2261 switch (ev->type()) {
2262 case QEvent::KeyPress:
2263 case QEvent::KeyRelease: {
2264 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2265 case Qt::Key_Escape:
2267 case Qt::Key_Return:
2279 return QWidget::eventFilter(obj, ev);
2284class QtFontEditorFactoryPrivate :
public EditorFactoryPrivate<QtFontEditWidget>
2286 QtFontEditorFactory *q_ptr =
nullptr;
2287 Q_DECLARE_PUBLIC(QtFontEditorFactory)
2290 void slotPropertyChanged(QtProperty *property,
const QFont &value);
2291 void slotSetValue(QtProperty *property,
const QFont &value);
2294void QtFontEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2297 const auto it = m_createdEditors.constFind(property);
2298 if (it == m_createdEditors.constEnd())
2301 for (QtFontEditWidget *e : it.value())
2305void QtFontEditorFactoryPrivate::slotSetValue(QtProperty *property,
const QFont &value)
2307 if (QtFontPropertyManager *manager = q_ptr->propertyManager(property))
2308 manager->setValue(property, value);
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2324
2325
2327 QtAbstractEditorFactory<QtFontPropertyManager>(parent),
2328 d_ptr(
new QtFontEditorFactoryPrivate())
2330 d_ptr->q_ptr =
this;
2334
2335
2338 d_ptr->deleteEditors();
2342
2343
2344
2345
2348 connect(manager, &QtFontPropertyManager::valueChanged,
2349 this, [
this](
QtProperty *property,
const QFont &value)
2350 { d_ptr->slotPropertyChanged(property, value); });
2354
2355
2356
2357
2362 editor->setValue(manager->value(property));
2363 connect(editor, &QtFontEditWidget::valueChanged,
2364 this, [
this, property](
const QFont &value) { d_ptr->slotSetValue(property, value); });
2365 connect(editor, &QObject::destroyed,
2366 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2371
2372
2373
2374
2377 disconnect(manager, &QtFontPropertyManager::valueChanged,
this,
nullptr);
2382#include "moc_qteditorfactory_p.cpp"
2383#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.
void slotSetValue(QtProperty *property, 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 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)