8#include <QtCore/QRegularExpression>
9#include <QtGui/QKeyEvent>
10#include <QtGui/QRegularExpressionValidator>
11#include <QtWidgets/QAbstractItemView>
12#include <QtWidgets/QApplication>
13#include <QtWidgets/QBoxLayout>
14#include <QtWidgets/QColorDialog>
15#include <QtWidgets/QComboBox>
16#include <QtWidgets/QDateTimeEdit>
17#include <QtWidgets/QFontDialog>
18#include <QtWidgets/QKeySequenceEdit>
19#include <QtWidgets/QLabel>
20#include <QtWidgets/QLineEdit>
21#include <QtWidgets/QMenu>
22#include <QtWidgets/QScrollBar>
23#include <QtWidgets/QSpacerItem>
24#include <QtWidgets/QSpinBox>
25#include <QtWidgets/QToolButton>
28# pragma warning(disable: 4786
)
38 enum { DecorationMargin = 4 };
39 if (QApplication::layoutDirection() == Qt::LeftToRight)
40 lt->setContentsMargins(DecorationMargin, 0, 0, 0);
42 lt->setContentsMargins(0, 0, DecorationMargin, 0);
48template <
class Editor>
65template <
class Editor>
68 auto *editor =
new Editor(parent);
73template <
class Editor>
76 auto it = m_createdEditors.find(property);
77 if (it == m_createdEditors.end())
78 it = m_createdEditors.insert(property, EditorList());
79 it.value().append(editor);
80 m_editorToProperty.insert(editor, property);
83template <
class Editor>
86 const auto ecend = m_editorToProperty.end();
87 for (
auto itEditor = m_editorToProperty.begin(); itEditor != ecend; ++itEditor) {
88 if (itEditor.key() == object) {
89 Editor *editor = itEditor.key();
91 const auto pit = m_createdEditors.find(property);
92 if (pit != m_createdEditors.end()) {
93 pit.value().removeAll(editor);
94 if (pit.value().isEmpty())
95 m_createdEditors.erase(pit);
97 m_editorToProperty.erase(itEditor);
108 Q_DECLARE_PUBLIC(QtSpinBoxFactory)
119 const auto it = m_createdEditors.constFind(property);
120 if (it == m_createdEditors.cend())
122 for (QSpinBox *editor : it.value()) {
123 if (editor->value() != value) {
124 editor->blockSignals(
true);
125 editor->setValue(value);
126 editor->blockSignals(
false);
133 const auto it = m_createdEditors.constFind(property);
134 if (it == m_createdEditors.cend())
141 for (QSpinBox *editor : it.value()) {
142 editor->blockSignals(
true);
143 editor->setRange(min, max);
144 editor->setValue(manager->value(property));
145 editor->blockSignals(
false);
151 const auto it = m_createdEditors.constFind(property);
152 if (it == m_createdEditors.cend())
154 for (QSpinBox *editor : it.value()) {
155 editor->blockSignals(
true);
156 editor->setSingleStep(step);
157 editor->blockSignals(
false);
163 QObject *object = q_ptr->sender();
164 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor) {
165 if (itEditor.key() == object) {
170 manager->setValue(property, value);
177
178
179
180
181
182
183
184
185
186
189
190
192 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSpinBoxFactoryPrivate())
199
200
203 qDeleteAll(d_ptr->m_editorToProperty.keys());
207
208
209
210
213 connect(manager, &QtIntPropertyManager::valueChanged,
214 this, [
this](QtProperty *property,
int value)
215 { d_ptr->slotPropertyChanged(property, value); });
217 this, [
this](
QtProperty *property,
int min,
int max)
218 { d_ptr->slotRangeChanged(property, min, max); });
221 { d_ptr->slotSingleStepChanged(property, value); });
225
226
227
228
232 QSpinBox *editor = d_ptr->createEditor(property, parent);
235 editor->setValue(manager
->value(property
));
236 editor->setKeyboardTracking(
false);
238 connect(editor, &QSpinBox::valueChanged,
239 this, [
this](
int value) { d_ptr->slotSetValue(value); });
240 connect(editor, &QObject::destroyed,
241 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
246
247
248
249
252 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
262 Q_DECLARE_PUBLIC(QtSliderFactory)
272 const auto it = m_createdEditors.constFind(property);
273 if (it == m_createdEditors.cend())
275 for (QSlider *editor : it.value()) {
276 editor->blockSignals(
true);
277 editor->setValue(value);
278 editor->blockSignals(
false);
284 const auto it = m_createdEditors.constFind(property);
285 if (it == m_createdEditors.cend())
292 for (QSlider *editor : it.value()) {
293 editor->blockSignals(
true);
294 editor->setRange(min, max);
295 editor->setValue(manager->value(property));
296 editor->blockSignals(
false);
302 const auto it = m_createdEditors.constFind(property);
303 if (it == m_createdEditors.cend())
305 for (QSlider *editor : it.value()) {
306 editor->blockSignals(
true);
307 editor->setSingleStep(step);
308 editor->blockSignals(
false);
314 QObject *object = q_ptr->sender();
315 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor ) {
316 if (itEditor.key() == object) {
321 manager->setValue(property, value);
328
329
330
331
332
333
334
335
336
337
340
341
343 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSliderFactoryPrivate())
350
351
354 qDeleteAll(d_ptr->m_editorToProperty.keys());
358
359
360
361
364 connect(manager, &QtIntPropertyManager::valueChanged,
365 this, [
this](QtProperty *property,
int value)
366 { d_ptr->slotPropertyChanged(property, value); });
368 this, [
this](
QtProperty *property,
int min,
int max)
369 { d_ptr->slotRangeChanged(property, min, max); });
372 { d_ptr->slotSingleStepChanged(property, value); });
376
377
378
379
383 auto *editor =
new QSlider(Qt::Horizontal, parent);
384 d_ptr->initializeEditor(property, editor);
387 editor->setValue(manager
->value(property
));
389 connect(editor, &QSlider::valueChanged,
390 this, [
this](
int value) { d_ptr->slotSetValue(value); });
391 connect(editor, &QObject::destroyed,
392 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
397
398
399
400
403 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
413 Q_DECLARE_PUBLIC(QtScrollBarFactory)
423 const auto it = m_createdEditors.constFind(property);
424 if (it == m_createdEditors.cend())
427 for (QScrollBar *editor : it.value()) {
428 editor->blockSignals(
true);
429 editor->setValue(value);
430 editor->blockSignals(
false);
436 const auto it = m_createdEditors.constFind(property);
437 if (it == m_createdEditors.cend())
444 for (QScrollBar *editor : it.value()) {
445 editor->blockSignals(
true);
446 editor->setRange(min, max);
447 editor->setValue(manager->value(property));
448 editor->blockSignals(
false);
454 const auto it = m_createdEditors.constFind(property);
455 if (it == m_createdEditors.cend())
457 for (QScrollBar *editor : it.value()) {
458 editor->blockSignals(
true);
459 editor->setSingleStep(step);
460 editor->blockSignals(
false);
466 QObject *object = q_ptr->sender();
467 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
468 if (itEditor.key() == object) {
473 manager->setValue(property, value);
479
480
481
482
483
484
485
486
487
488
491
492
494 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtScrollBarFactoryPrivate())
501
502
505 qDeleteAll(d_ptr->m_editorToProperty.keys());
509
510
511
512
515 connect(manager, &QtIntPropertyManager::valueChanged,
516 this, [
this](QtProperty *property,
int value)
517 { d_ptr->slotPropertyChanged(property, value); });
519 this, [
this](
QtProperty *property,
int min,
int max)
520 { d_ptr->slotRangeChanged(property, min, max); });
523 { d_ptr->slotSingleStepChanged(property, value); });
527
528
529
530
534 auto *editor =
new QScrollBar(Qt::Horizontal, parent);
535 d_ptr->initializeEditor(property, editor);
538 editor->setValue(manager
->value(property
));
539 connect(editor, &QScrollBar::valueChanged,
540 this, [
this](
int value) { d_ptr->slotSetValue(value); });
541 connect(editor, &QObject::destroyed,
542 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
547
548
549
550
553 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
563 Q_DECLARE_PUBLIC(QtCheckBoxFactory)
571 const auto it = m_createdEditors.constFind(property);
572 if (it == m_createdEditors.cend())
575 for (QtBoolEdit *editor : it.value()) {
576 editor->blockCheckBoxSignals(
true);
577 editor->setChecked(value);
578 editor->blockCheckBoxSignals(
false);
584 QObject *object = q_ptr->sender();
586 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
587 if (itEditor.key() == object) {
592 manager->setValue(property, value);
598
599
600
601
602
603
604
605
606
607
610
611
613 : QtAbstractEditorFactory<QtBoolPropertyManager>(parent), d_ptr(
new QtCheckBoxFactoryPrivate())
620
621
624 qDeleteAll(d_ptr->m_editorToProperty.keys());
628
629
630
631
634 connect(manager, &QtBoolPropertyManager::valueChanged,
635 this, [
this](QtProperty *property,
bool value)
636 { d_ptr->slotPropertyChanged(property, value); });
640
641
642
643
647 QtBoolEdit *editor = d_ptr->createEditor(property, parent);
650 connect(editor, &QtBoolEdit::toggled,
651 this, [
this](
bool value) { d_ptr->slotSetValue(value); });
652 connect(editor, &QObject::destroyed,
653 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
658
659
660
661
664 disconnect(manager, &QtBoolPropertyManager::valueChanged,
this,
nullptr);
672 Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
684 const auto it = m_createdEditors.constFind(property);
685 if (it == m_createdEditors.cend())
687 for (QDoubleSpinBox *editor : it.value()) {
688 if (editor->value() != value) {
689 editor->blockSignals(
true);
690 editor->setValue(value);
691 editor->blockSignals(
false);
697 double min,
double max)
699 const auto it = m_createdEditors.constFind(property);
700 if (it == m_createdEditors.cend())
707 for (QDoubleSpinBox *editor : it.value()) {
708 editor->blockSignals(
true);
709 editor->setRange(min, max);
710 editor->setValue(manager->value(property));
711 editor->blockSignals(
false);
717 const auto it = m_createdEditors.constFind(property);
718 if (it == m_createdEditors.cend())
725 for (QDoubleSpinBox *editor : it.value()) {
726 editor->blockSignals(
true);
727 editor->setSingleStep(step);
728 editor->blockSignals(
false);
734 const auto it = m_createdEditors.constFind(property);
735 if (it == m_createdEditors.constEnd())
742 for (QDoubleSpinBox *editor : it.value()) {
743 editor->blockSignals(
true);
744 editor->setDecimals(prec);
745 editor->setValue(manager->value(property));
746 editor->blockSignals(
false);
752 QObject *object = q_ptr->sender();
753 for (
auto itEditor = m_editorToProperty.cbegin(), itcend = m_editorToProperty.cend(); itEditor != itcend; ++itEditor) {
754 if (itEditor.key() == object) {
759 manager->setValue(property, value);
766
767
768
769
770
771
772
773
774
777
778
780 : QtAbstractEditorFactory<QtDoublePropertyManager>(parent), d_ptr(
new QtDoubleSpinBoxFactoryPrivate())
787
788
791 qDeleteAll(d_ptr->m_editorToProperty.keys());
795
796
797
798
801 connect(manager, &QtDoublePropertyManager::valueChanged,
802 this, [
this](QtProperty *property,
double value)
803 { d_ptr->slotPropertyChanged(property, value); });
805 this, [
this](
QtProperty *property,
double min,
double max)
806 { d_ptr->slotRangeChanged(property, min, max); });
808 this, [
this](
QtProperty *property,
double value)
809 { d_ptr->slotSingleStepChanged(property, value); });
812 { d_ptr->slotDecimalsChanged(property, value); });
816
817
818
819
823 QDoubleSpinBox *editor = d_ptr->createEditor(property, parent);
827 editor->setValue(manager
->value(property
));
828 editor->setKeyboardTracking(
false);
830 connect(editor, &QDoubleSpinBox::valueChanged,
831 this, [
this](
double value) { d_ptr->slotSetValue(value); });
832 connect(editor, &QObject::destroyed,
833 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
838
839
840
841
844 disconnect(manager, &QtDoublePropertyManager::valueChanged,
this,
nullptr);
855 Q_DECLARE_PUBLIC(QtLineEditFactory)
864 const QString &value)
866 const auto it = m_createdEditors.constFind(property);
867 if (it == m_createdEditors.constEnd())
870 for (QLineEdit *editor : it.value()) {
871 if (editor->text() != value)
872 editor->setText(value);
877 const QRegularExpression ®Exp)
879 const auto it = m_createdEditors.constFind(property);
880 if (it == m_createdEditors.constEnd())
887 for (QLineEdit *editor : it.value()) {
888 editor->blockSignals(
true);
889 const QValidator *oldValidator = editor->validator();
890 QValidator *newValidator =
nullptr;
891 if (regExp.isValid()) {
892 newValidator =
new QRegularExpressionValidator(regExp, editor);
894 editor->setValidator(newValidator);
897 editor->blockSignals(
false);
903 QObject *object = q_ptr->sender();
904 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
905 if (itEditor.key() == object) {
910 manager->setValue(property, value);
916
917
918
919
920
921
922
923
924
925
928
929
931 : QtAbstractEditorFactory<QtStringPropertyManager>(parent), d_ptr(
new QtLineEditFactoryPrivate())
938
939
942 qDeleteAll(d_ptr->m_editorToProperty.keys());
946
947
948
949
952 connect(manager, &QtStringPropertyManager::valueChanged,
953 this, [
this](QtProperty *property,
const QString &value)
954 { d_ptr->slotPropertyChanged(property, value); });
956 this, [
this](
QtProperty *property,
const QRegularExpression &value)
957 { d_ptr->slotRegExpChanged(property, value); });
961
962
963
964
968 QLineEdit *editor = d_ptr->createEditor(property, parent);
969 QRegularExpression regExp = manager->regExp(property);
970 if (regExp.isValid() && !regExp.pattern().isEmpty()) {
971 auto *validator =
new QRegularExpressionValidator(regExp, editor);
972 editor->setValidator(validator);
974 editor->setText(manager->value(property));
976 connect(editor, &QLineEdit::textEdited,
977 this, [
this](
const QString &value) { d_ptr->slotSetValue(value); });
978 connect(editor, &QObject::destroyed,
979 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
984
985
986
987
990 disconnect(manager, &QtStringPropertyManager::valueChanged,
this,
nullptr);
999 Q_DECLARE_PUBLIC(QtDateEditFactory)
1009 const auto it = m_createdEditors.constFind(property);
1010 if (it == m_createdEditors.constEnd())
1012 for (QDateEdit *editor : it.value()) {
1013 editor->blockSignals(
true);
1014 editor->setDate(value);
1015 editor->blockSignals(
false);
1021 const auto it = m_createdEditors.constFind(property);
1022 if (it == m_createdEditors.constEnd())
1029 for (QDateEdit *editor : it.value()) {
1030 editor->blockSignals(
true);
1031 editor->setDateRange(min, max);
1032 editor->setDate(manager->value(property));
1033 editor->blockSignals(
false);
1039 QObject *object = q_ptr->sender();
1040 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1041 if (itEditor.key() == object) {
1046 manager->setValue(property, value);
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1064
1065
1067 : QtAbstractEditorFactory<QtDatePropertyManager>(parent), d_ptr(
new QtDateEditFactoryPrivate())
1069 d_ptr->q_ptr =
this;
1074
1075
1078 qDeleteAll(d_ptr->m_editorToProperty.keys());
1082
1083
1084
1085
1088 connect(manager, &QtDatePropertyManager::valueChanged,
1089 this, [
this](QtProperty *property, QDate value)
1090 { d_ptr->slotPropertyChanged(property, value); });
1092 this, [
this](
QtProperty *property, QDate min, QDate max)
1093 { d_ptr->slotRangeChanged(property, min, max); });
1097
1098
1099
1100
1104 QDateEdit *editor = d_ptr->createEditor(property, parent);
1105 editor->setDisplayFormat(QtPropertyBrowserUtils::dateFormat());
1106 editor->setCalendarPopup(
true);
1108 editor->setDate(manager
->value(property));
1110 connect(editor, &QDateEdit::dateChanged,
1111 this, [
this](QDate value) { d_ptr->slotSetValue(value); });
1112 connect(editor, &QObject::destroyed,
1113 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1118
1119
1120
1121
1124 disconnect(manager, &QtDatePropertyManager::valueChanged,
this,
nullptr);
1133 Q_DECLARE_PUBLIC(QtTimeEditFactory)
1142 const auto it = m_createdEditors.constFind(property);
1143 if (it == m_createdEditors.constEnd())
1145 for (QTimeEdit *editor : it.value()) {
1146 editor->blockSignals(
true);
1147 editor->setTime(value);
1148 editor->blockSignals(
false);
1154 QObject *object = q_ptr->sender();
1155 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1156 if (itEditor.key() == object) {
1161 manager->setValue(property, value);
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1179
1180
1182 : QtAbstractEditorFactory<QtTimePropertyManager>(parent), d_ptr(
new QtTimeEditFactoryPrivate())
1184 d_ptr->q_ptr =
this;
1189
1190
1193 qDeleteAll(d_ptr->m_editorToProperty.keys());
1197
1198
1199
1200
1203 connect(manager, &QtTimePropertyManager::valueChanged,
1204 this, [
this](QtProperty *property, QTime value)
1205 { d_ptr->slotPropertyChanged(property, value); });
1209
1210
1211
1212
1216 QTimeEdit *editor = d_ptr->createEditor(property, parent);
1217 editor->setDisplayFormat(QtPropertyBrowserUtils::timeFormat());
1218 editor->setTime(manager
->value(property));
1220 connect(editor, &QTimeEdit::timeChanged,
1221 this, [
this](QTime value) { d_ptr->slotSetValue(value); });
1222 connect(editor, &QObject::destroyed,
1223 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1228
1229
1230
1231
1234 disconnect(manager, &QtTimePropertyManager::valueChanged,
this,
nullptr);
1242 Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
1251 const QDateTime &value)
1253 const auto it = m_createdEditors.constFind(property);
1254 if (it == m_createdEditors.constEnd())
1257 for (QDateTimeEdit *editor : it.value()) {
1258 editor->blockSignals(
true);
1259 editor->setDateTime(value);
1260 editor->blockSignals(
false);
1266 QObject *object = q_ptr->sender();
1267 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1268 if (itEditor.key() == object) {
1273 manager->setValue(property, value);
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1291
1292
1294 : QtAbstractEditorFactory<QtDateTimePropertyManager>(parent), d_ptr(
new QtDateTimeEditFactoryPrivate())
1296 d_ptr->q_ptr =
this;
1301
1302
1305 qDeleteAll(d_ptr->m_editorToProperty.keys());
1309
1310
1311
1312
1315 connect(manager, &QtDateTimePropertyManager::valueChanged,
1316 this, [
this](QtProperty *property,
const QDateTime &value)
1317 { d_ptr->slotPropertyChanged(property, value); });
1321
1322
1323
1324
1328 QDateTimeEdit *editor = d_ptr->createEditor(property, parent);
1329 editor->setDisplayFormat(QtPropertyBrowserUtils::dateTimeFormat());
1330 editor->setDateTime(manager
->value(property));
1332 connect(editor, &QDateTimeEdit::dateTimeChanged,
1333 this, [
this](
const QDateTime &value) { d_ptr->slotSetValue(value); });
1334 connect(editor, &QObject::destroyed,
1335 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1340
1341
1342
1343
1346 disconnect(manager, &QtDateTimePropertyManager::valueChanged,
this,
nullptr);
1354 Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
1362 const QKeySequence &value)
1364 const auto it = m_createdEditors.constFind(property);
1365 if (it == m_createdEditors.constEnd())
1368 for (QKeySequenceEdit *editor : it.value()) {
1369 editor->blockSignals(
true);
1370 editor->setKeySequence(value);
1371 editor->blockSignals(
false);
1377 QObject *object = q_ptr->sender();
1378 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1379 if (itEditor.key() == object) {
1384 manager->setValue(property, value);
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1402
1403
1405 : QtAbstractEditorFactory<QtKeySequencePropertyManager>(parent), d_ptr(
new QtKeySequenceEditorFactoryPrivate())
1407 d_ptr->q_ptr =
this;
1412
1413
1416 qDeleteAll(d_ptr->m_editorToProperty.keys());
1420
1421
1422
1423
1426 connect(manager, &QtKeySequencePropertyManager::valueChanged,
1427 this, [
this](QtProperty *property,
const QKeySequence &value)
1428 { d_ptr->slotPropertyChanged(property, value); });
1432
1433
1434
1435
1439 QKeySequenceEdit *editor = d_ptr->createEditor(property, parent);
1440 editor->setKeySequence(manager->value(property));
1442 connect(editor, &QKeySequenceEdit::keySequenceChanged,
1443 this, [
this](
const QKeySequence &value) { d_ptr->slotSetValue(value); });
1444 connect(editor, &QObject::destroyed,
1445 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1450
1451
1452
1453
1456 disconnect(manager, &QtKeySequencePropertyManager::valueChanged,
this,
nullptr);
1482 void handleKeyEvent(QKeyEvent *e);
1485 QLineEdit *m_lineEdit;
1489 : QWidget(parent), m_lineEdit(
new QLineEdit(
this))
1491 auto *layout =
new QHBoxLayout(
this);
1492 layout->addWidget(m_lineEdit);
1493 layout->setContentsMargins(QMargins());
1494 m_lineEdit->installEventFilter(
this);
1495 m_lineEdit->setReadOnly(
true);
1496 m_lineEdit->setFocusProxy(
this);
1497 setFocusPolicy(m_lineEdit->focusPolicy());
1498 setAttribute(Qt::WA_InputMethodEnabled);
1503 if (o == m_lineEdit && e->type() == QEvent::ContextMenu) {
1504 QContextMenuEvent *c =
static_cast<QContextMenuEvent *>(e);
1505 QMenu *menu = m_lineEdit->createStandardContextMenu();
1506 const auto actions = menu->actions();
1507 for (QAction *action : actions) {
1508 action->setShortcut(QKeySequence());
1509 QString actionString = action->text();
1510 const int pos = actionString.lastIndexOf(QLatin1Char(
'\t'));
1512 actionString = actionString.remove(pos, actionString.size() - pos);
1513 action->setText(actionString);
1515 QAction *actionBefore =
nullptr;
1516 if (actions.size() > 0)
1517 actionBefore = actions[0];
1518 auto *clearAction =
new QAction(tr(
"Clear Char"), menu);
1519 menu->insertAction(actionBefore, clearAction);
1520 menu->insertSeparator(actionBefore);
1521 clearAction->setEnabled(!m_value.isNull());
1522 connect(clearAction, &QAction::triggered,
this, &QtCharEdit::slotClearChar);
1523 menu->exec(c->globalPos());
1529 return QWidget::eventFilter(o, e);
1534 if (m_value.isNull())
1537 emit valueChanged(m_value);
1542 const int key = e->key();
1544 case Qt::Key_Control:
1548 case Qt::Key_Super_L:
1549 case Qt::Key_Return:
1555 const QString text = e->text();
1556 if (text.size() != 1)
1559 const QChar c = text.at(0);
1567 const QString str = m_value.isNull() ? QString() : QString(m_value);
1568 m_lineEdit->setText(str);
1570 emit valueChanged(m_value);
1575 if (value == m_value)
1579 QString str = value.isNull() ? QString() : QString(value);
1580 m_lineEdit->setText(str);
1590 m_lineEdit->event(e);
1591 m_lineEdit->selectAll();
1592 QWidget::focusInEvent(e);
1597 m_lineEdit->event(e);
1598 QWidget::focusOutEvent(e);
1609 m_lineEdit->event(e);
1615 case QEvent::Shortcut:
1616 case QEvent::ShortcutOverride:
1617 case QEvent::KeyRelease:
1623 return QWidget::event(e);
1631 Q_DECLARE_PUBLIC(QtCharEditorFactory)
1642 const auto it = m_createdEditors.constFind(property);
1643 if (it == m_createdEditors.constEnd())
1646 for (QtCharEdit *editor : it.value()) {
1647 editor->blockSignals(
true);
1648 editor->setValue(value);
1649 editor->blockSignals(
false);
1655 QObject *object = q_ptr->sender();
1656 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1657 if (itEditor.key() == object) {
1662 manager->setValue(property, value);
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1680
1681
1683 : QtAbstractEditorFactory<QtCharPropertyManager>(parent), d_ptr(
new QtCharEditorFactoryPrivate())
1685 d_ptr->q_ptr =
this;
1690
1691
1694 qDeleteAll(d_ptr->m_editorToProperty.keys());
1698
1699
1700
1701
1704 connect(manager, &QtCharPropertyManager::valueChanged,
1705 this, [
this](QtProperty *property,
const QChar &value)
1706 { d_ptr->slotPropertyChanged(property, value); });
1710
1711
1712
1713
1717 QtCharEdit *editor = d_ptr->createEditor(property, parent);
1718 editor->setValue(manager->value(property));
1720 connect(editor, &QtCharEdit::valueChanged,
1721 this, [
this](
const QChar &value) { d_ptr->slotSetValue(value); });
1722 connect(editor, &QObject::destroyed,
1723 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1728
1729
1730
1731
1734 disconnect(manager, &QtCharPropertyManager::valueChanged,
this,
nullptr);
1742 Q_DECLARE_PUBLIC(QtEnumEditorFactory)
1753 const auto it = m_createdEditors.constFind(property);
1754 if (it == m_createdEditors.constEnd())
1757 for (QComboBox *editor : it.value()) {
1758 editor->blockSignals(
true);
1759 editor->setCurrentIndex(value);
1760 editor->blockSignals(
false);
1765 const QStringList &enumNames)
1767 const auto it = m_createdEditors.constFind(property);
1768 if (it == m_createdEditors.constEnd())
1775 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1777 for (QComboBox *editor : it.value()) {
1778 editor->blockSignals(
true);
1780 editor->addItems(enumNames);
1781 const int nameCount = enumNames.size();
1782 for (
int i = 0; i < nameCount; i++)
1783 editor->setItemIcon(i, enumIcons.value(i));
1784 editor->setCurrentIndex(manager->value(property));
1785 editor->blockSignals(
false);
1790 const QMap<
int, QIcon> &enumIcons)
1792 const auto it = m_createdEditors.constFind(property);
1793 if (it == m_createdEditors.constEnd())
1800 const QStringList enumNames = manager->enumNames(property);
1801 for (QComboBox *editor : it.value()) {
1802 editor->blockSignals(
true);
1803 const int nameCount = enumNames.size();
1804 for (
int i = 0; i < nameCount; i++)
1805 editor->setItemIcon(i, enumIcons.value(i));
1806 editor->setCurrentIndex(manager->value(property));
1807 editor->blockSignals(
false);
1813 QObject *object = q_ptr->sender();
1814 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
1815 if (itEditor.key() == object) {
1820 manager->setValue(property, value);
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1838
1839
1841 : QtAbstractEditorFactory<QtEnumPropertyManager>(parent), d_ptr(
new QtEnumEditorFactoryPrivate())
1843 d_ptr->q_ptr =
this;
1848
1849
1852 qDeleteAll(d_ptr->m_editorToProperty.keys());
1856
1857
1858
1859
1862 connect(manager, &QtEnumPropertyManager::valueChanged,
1863 this, [
this](QtProperty *property,
int value)
1864 { d_ptr->slotPropertyChanged(property, value); });
1865 connect(manager, &QtEnumPropertyManager::enumNamesChanged,
1866 this, [
this](
QtProperty *property,
const QStringList &value)
1867 { d_ptr->slotEnumNamesChanged(property, value); });
1871
1872
1873
1874
1878 QComboBox *editor = d_ptr->createEditor(property, parent);
1879 editor->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
1880 editor->view()->setTextElideMode(Qt::ElideRight);
1881 QStringList enumNames = manager->enumNames(property);
1882 editor->addItems(enumNames);
1883 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1884 const int enumNamesCount = enumNames.size();
1885 for (
int i = 0; i < enumNamesCount; i++)
1886 editor->setItemIcon(i, enumIcons.value(i));
1887 editor->setCurrentIndex(manager
->value(property
));
1889 connect(editor, &QComboBox::currentIndexChanged,
1890 this, [
this](
int value) { d_ptr->slotSetValue(value); });
1891 connect(editor, &QObject::destroyed,
1892 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1897
1898
1899
1900
1903 disconnect(manager, &QtEnumPropertyManager::valueChanged,
this,
nullptr);
1904 disconnect(manager, &QtEnumPropertyManager::enumNamesChanged,
this,
nullptr);
1912 Q_DECLARE_PUBLIC(QtCursorEditorFactory)
1939 QtProperty *enumProp = m_propertyToEnum.value(property);
1954 QtProperty *prop = m_enumToProperty.value(property);
1962 cursorManager->setValue(prop, QCursor(cdb->valueToCursor(value)));
1971 for (
auto itEditor = m_editorToEnum.cbegin(), ecend = m_editorToEnum.cend(); itEditor != ecend; ++itEditor)
1972 if (itEditor.key() == object) {
1973 QWidget *editor = itEditor.key();
1975 m_editorToEnum.remove(editor);
1976 m_enumToEditors[enumProp].removeAll(editor);
1977 if (m_enumToEditors[enumProp].isEmpty()) {
1978 m_enumToEditors.remove(enumProp);
1979 QtProperty *property = m_enumToProperty.value(enumProp);
1980 m_enumToProperty.remove(enumProp);
1981 m_propertyToEnum.remove(property);
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
2001
2002
2004 : QtAbstractEditorFactory<QtCursorPropertyManager>(parent), d_ptr(
new QtCursorEditorFactoryPrivate())
2006 d_ptr->q_ptr =
this;
2008 d_ptr->m_enumEditorFactory =
new QtEnumEditorFactory(
this);
2009 d_ptr->m_enumPropertyManager =
new QtEnumPropertyManager(
this);
2010 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::valueChanged,
2011 this, [
this](QtProperty *property,
int value)
2012 { d_ptr->slotEnumChanged(property, value); });
2013 d_ptr->m_enumEditorFactory->addPropertyManager(d_ptr->m_enumPropertyManager);
2017
2018
2024
2025
2026
2027
2030 connect(manager, &QtCursorPropertyManager::valueChanged,
2031 this, [
this](QtProperty *property,
const QCursor &value)
2032 { d_ptr->slotPropertyChanged(property, value); });
2036
2037
2038
2039
2044 if (d_ptr->m_propertyToEnum.contains(property)) {
2045 enumProp = d_ptr->m_propertyToEnum[property];
2047 enumProp = d_ptr->m_enumPropertyManager->addProperty(property->propertyName());
2049 d_ptr->m_enumPropertyManager->setEnumNames(enumProp, cdb->cursorShapeNames());
2050 d_ptr->m_enumPropertyManager->setEnumIcons(enumProp, cdb->cursorShapeIcons());
2052 d_ptr->m_enumPropertyManager->setValue(enumProp, cdb->cursorToValue(manager->value(property)));
2054 d_ptr->m_propertyToEnum[property] = enumProp;
2055 d_ptr->m_enumToProperty[enumProp] = property;
2058 QWidget *editor = af->createEditor(enumProp, parent);
2059 d_ptr->m_enumToEditors[enumProp].append(editor);
2060 d_ptr->m_editorToEnum[editor] = enumProp;
2061 connect(editor, &QObject::destroyed,
2062 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2067
2068
2069
2070
2073 disconnect(manager, &QtCursorPropertyManager::valueChanged,
this,
nullptr);
2097 QLabel *m_pixmapLabel;
2099 QToolButton *m_button;
2104 m_pixmapLabel(
new QLabel),
2105 m_label(
new QLabel),
2106 m_button(
new QToolButton)
2108 auto *lt =
new QHBoxLayout(
this);
2109 setupTreeViewEditorMargin(lt);
2111 lt->addWidget(m_pixmapLabel);
2112 lt->addWidget(m_label);
2113 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2115 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2116 m_button->setFixedWidth(20);
2117 setFocusProxy(m_button);
2118 setFocusPolicy(m_button->focusPolicy());
2119 m_button->setText(tr(
"..."));
2120 m_button->installEventFilter(
this);
2121 connect(m_button, &QAbstractButton::clicked,
this, &QtColorEditWidget::buttonClicked);
2122 lt->addWidget(m_button);
2123 m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::brushValuePixmap(QBrush(m_color)));
2124 m_label->setText(QtPropertyBrowserUtils::colorValueText(m_color));
2127void QtColorEditWidget::setValue(QColor c)
2131 m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::brushValuePixmap(QBrush(c)));
2132 m_label->setText(QtPropertyBrowserUtils::colorValueText(c));
2136void QtColorEditWidget::buttonClicked()
2138 const QColor newColor = QColorDialog::getColor(m_color,
this, QString(), QColorDialog::ShowAlphaChannel);
2139 if (newColor.isValid() && newColor != m_color) {
2141 emit valueChanged(m_color);
2145bool QtColorEditWidget::eventFilter(QObject *obj, QEvent *ev)
2147 if (obj == m_button) {
2148 switch (ev->type()) {
2149 case QEvent::KeyPress:
2150 case QEvent::KeyRelease: {
2151 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2152 case Qt::Key_Escape:
2154 case Qt::Key_Return:
2166 return QWidget::eventFilter(obj, ev);
2171class QtColorEditorFactoryPrivate :
public EditorFactoryPrivate<QtColorEditWidget>
2173 QtColorEditorFactory *q_ptr =
nullptr;
2174 Q_DECLARE_PUBLIC(QtColorEditorFactory)
2177 void slotPropertyChanged(QtProperty *property, QColor value);
2178 void slotSetValue(QColor value);
2181void QtColorEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2184 const auto it = m_createdEditors.constFind(property);
2185 if (it == m_createdEditors.constEnd())
2188 for (QtColorEditWidget *e : it.value())
2192void QtColorEditorFactoryPrivate::slotSetValue(QColor value)
2194 QObject *object = q_ptr->sender();
2195 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
2196 if (itEditor.key() == object) {
2197 QtProperty *property = itEditor.value();
2198 QtColorPropertyManager *manager = q_ptr->propertyManager(property);
2201 manager->setValue(property, value);
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2219
2220
2221QtColorEditorFactory::QtColorEditorFactory(QObject *parent) :
2222 QtAbstractEditorFactory<QtColorPropertyManager>(parent),
2223 d_ptr(
new QtColorEditorFactoryPrivate())
2225 d_ptr->q_ptr =
this;
2229
2230
2231QtColorEditorFactory::~QtColorEditorFactory()
2233 qDeleteAll(d_ptr->m_editorToProperty.keys());
2237
2238
2239
2240
2241void QtColorEditorFactory::connectPropertyManager(QtColorPropertyManager *manager)
2243 connect(manager, &QtColorPropertyManager::valueChanged,
2244 this, [
this](QtProperty *property, QColor value)
2245 { d_ptr->slotPropertyChanged(property, value); });
2249
2250
2251
2252
2253QWidget *QtColorEditorFactory::createEditor(QtColorPropertyManager *manager,
2254 QtProperty *property, QWidget *parent)
2256 QtColorEditWidget *editor = d_ptr->createEditor(property, parent);
2257 editor->setValue(manager->value(property));
2258 connect(editor, &QtColorEditWidget::valueChanged,
2259 this, [
this](QColor value) { d_ptr->slotSetValue(value); });
2260 connect(editor, &QObject::destroyed,
2261 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2266
2267
2268
2269
2270void QtColorEditorFactory::disconnectPropertyManager(QtColorPropertyManager *manager)
2272 disconnect(manager, &QtColorPropertyManager::valueChanged,
this,
nullptr);
2277class QtFontEditWidget :
public QWidget {
2281 QtFontEditWidget(QWidget *parent);
2283 bool eventFilter(QObject *obj, QEvent *ev) override;
2286 void setValue(
const QFont &value);
2289 void buttonClicked();
2292 void valueChanged(
const QFont &value);
2296 QLabel *m_pixmapLabel;
2298 QToolButton *m_button;
2301QtFontEditWidget::QtFontEditWidget(QWidget *parent) :
2303 m_pixmapLabel(
new QLabel),
2304 m_label(
new QLabel),
2305 m_button(
new QToolButton)
2307 auto *lt =
new QHBoxLayout(
this);
2308 setupTreeViewEditorMargin(lt);
2310 lt->addWidget(m_pixmapLabel);
2311 lt->addWidget(m_label);
2312 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2314 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2315 m_button->setFixedWidth(20);
2316 setFocusProxy(m_button);
2317 setFocusPolicy(m_button->focusPolicy());
2318 m_button->setText(tr(
"..."));
2319 m_button->installEventFilter(
this);
2320 connect(m_button, &QAbstractButton::clicked,
this, &QtFontEditWidget::buttonClicked);
2321 lt->addWidget(m_button);
2322 m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::fontValuePixmap(m_font));
2323 m_label->setText(QtPropertyBrowserUtils::fontValueText(m_font));
2326void QtFontEditWidget::setValue(
const QFont &f)
2330 m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::fontValuePixmap(f));
2331 m_label->setText(QtPropertyBrowserUtils::fontValueText(f));
2335void QtFontEditWidget::buttonClicked()
2338 QFont newFont = QFontDialog::getFont(&ok, m_font,
this, tr(
"Select Font"));
2339 if (ok && newFont != m_font) {
2342 if (m_font.family() != newFont.family())
2343 f.setFamily(newFont.family());
2344 if (m_font.pointSize() != newFont.pointSize())
2345 f.setPointSize(newFont.pointSize());
2346 if (m_font.bold() != newFont.bold())
2347 f.setBold(newFont.bold());
2348 if (m_font.italic() != newFont.italic())
2349 f.setItalic(newFont.italic());
2350 if (m_font.underline() != newFont.underline())
2351 f.setUnderline(newFont.underline());
2352 if (m_font.strikeOut() != newFont.strikeOut())
2353 f.setStrikeOut(newFont.strikeOut());
2355 emit valueChanged(m_font);
2359bool QtFontEditWidget::eventFilter(QObject *obj, QEvent *ev)
2361 if (obj == m_button) {
2362 switch (ev->type()) {
2363 case QEvent::KeyPress:
2364 case QEvent::KeyRelease: {
2365 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2366 case Qt::Key_Escape:
2368 case Qt::Key_Return:
2380 return QWidget::eventFilter(obj, ev);
2385class QtFontEditorFactoryPrivate :
public EditorFactoryPrivate<QtFontEditWidget>
2387 QtFontEditorFactory *q_ptr =
nullptr;
2388 Q_DECLARE_PUBLIC(QtFontEditorFactory)
2391 void slotPropertyChanged(QtProperty *property,
const QFont &value);
2392 void slotSetValue(
const QFont &value);
2395void QtFontEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2398 const auto it = m_createdEditors.constFind(property);
2399 if (it == m_createdEditors.constEnd())
2402 for (QtFontEditWidget *e : it.value())
2406void QtFontEditorFactoryPrivate::slotSetValue(
const QFont &value)
2408 QObject *object = q_ptr->sender();
2409 for (
auto itEditor = m_editorToProperty.cbegin(), ecend = m_editorToProperty.cend(); itEditor != ecend; ++itEditor)
2410 if (itEditor.key() == object) {
2411 QtProperty *property = itEditor.value();
2412 QtFontPropertyManager *manager = q_ptr->propertyManager(property);
2415 manager->setValue(property, value);
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2433
2434
2435QtFontEditorFactory::QtFontEditorFactory(QObject *parent) :
2436 QtAbstractEditorFactory<QtFontPropertyManager>(parent),
2437 d_ptr(
new QtFontEditorFactoryPrivate())
2439 d_ptr->q_ptr =
this;
2443
2444
2445QtFontEditorFactory::~QtFontEditorFactory()
2447 qDeleteAll(d_ptr->m_editorToProperty.keys());
2451
2452
2453
2454
2455void QtFontEditorFactory::connectPropertyManager(QtFontPropertyManager *manager)
2457 connect(manager, &QtFontPropertyManager::valueChanged,
2458 this, [
this](QtProperty *property,
const QFont &value)
2459 { d_ptr->slotPropertyChanged(property, value); });
2463
2464
2465
2466
2467QWidget *QtFontEditorFactory::createEditor(QtFontPropertyManager *manager,
2468 QtProperty *property, QWidget *parent)
2470 QtFontEditWidget *editor = d_ptr->createEditor(property, parent);
2471 editor->setValue(manager->value(property));
2472 connect(editor, &QtFontEditWidget::valueChanged,
2473 this, [
this](
const QFont &value) { d_ptr->slotSetValue(value); });
2474 connect(editor, &QObject::destroyed,
2475 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2480
2481
2482
2483
2484void QtFontEditorFactory::disconnectPropertyManager(QtFontPropertyManager *manager)
2486 disconnect(manager, &QtFontPropertyManager::valueChanged,
this,
nullptr);
2491#include "moc_qteditorfactory_p.cpp"
2492#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
void connectPropertyManager(QtCharPropertyManager *manager) override
~QtCharEditorFactory()
Destroys this factory, and all the widgets it has created.
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()
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
static QtCursorDatabase * instance()
QtEnumPropertyManager * m_enumPropertyManager
QHash< QWidget *, QtProperty * > m_editorToEnum
void slotPropertyChanged(QtProperty *property, const QCursor &cursor)
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...
void disconnectPropertyManager(QtCursorPropertyManager *manager) override
void connectPropertyManager(QtCursorPropertyManager *manager) override
~QtCursorEditorFactory()
Destroys this factory, and all the widgets it has created.
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
QWidget * createEditor(QtDatePropertyManager *manager, QtProperty *property, QWidget *parent) override
~QtDateEditFactory()
Destroys this factory, and all the widgets it has created.
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()
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...
~QtDoubleSpinBoxFactory()
Destroys this factory, and all the widgets it has created.
QWidget * createEditor(QtDoublePropertyManager *manager, QtProperty *property, QWidget *parent) override
void connectPropertyManager(QtDoublePropertyManager *manager) override
void disconnectPropertyManager(QtDoublePropertyManager *manager) override
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()
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 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...
~QtKeySequenceEditorFactory()
Destroys this factory, and all the widgets it has created.
void connectPropertyManager(QtKeySequencePropertyManager *manager) override
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
~QtLineEditFactory()
Destroys this factory, and all the widgets it has created.
QWidget * createEditor(QtStringPropertyManager *manager, QtProperty *property, QWidget *parent) override
void connectPropertyManager(QtStringPropertyManager *manager) override
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...
~QtSliderFactory()
Destroys this factory, and all the widgets it has created.
void connectPropertyManager(QtIntPropertyManager *manager) override
void disconnectPropertyManager(QtIntPropertyManager *manager) override
QWidget * createEditor(QtIntPropertyManager *manager, QtProperty *property, QWidget *parent) override
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()
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
~QtTimeEditFactory()
Destroys this factory, and all the widgets it has created.
void disconnectPropertyManager(QtTimePropertyManager *manager) override
void connectPropertyManager(QtTimePropertyManager *manager) override
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)