8#include <QtWidgets/qabstractitemview.h>
9#include <QtWidgets/qapplication.h>
10#include <QtWidgets/qboxlayout.h>
11#include <QtWidgets/qcolordialog.h>
12#include <QtWidgets/qcombobox.h>
13#include <QtWidgets/qdatetimeedit.h>
14#include <QtWidgets/qfontdialog.h>
15#include <QtWidgets/qkeysequenceedit.h>
16#include <QtWidgets/qlabel.h>
17#include <QtWidgets/qlayoutitem.h>
18#include <QtWidgets/qlineedit.h>
19#include <QtWidgets/qmenu.h>
20#include <QtWidgets/qscrollbar.h>
21#include <QtWidgets/qspinbox.h>
22#include <QtWidgets/qtoolbutton.h>
24#include <QtGui/qevent.h>
25#include <QtGui/qvalidator.h>
27#include <QtCore/qhash.h>
28#include <QtCore/qregularexpression.h>
37 enum { DecorationMargin = 4 };
38 if (QApplication::layoutDirection() == Qt::LeftToRight)
39 lt->setContentsMargins(DecorationMargin, 0, 0, 0);
41 lt->setContentsMargins(0, 0, DecorationMargin, 0);
47template <
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);
82template <
class Editor>
85 auto pred = [object] (
const Editor *e) {
return object == e; };
86 for (
auto it = m_createdEditors.begin(), end = m_createdEditors.end(); it != end; ++it) {
87 auto &editorList = it.value();
88 auto listIt = std::find_if(editorList.cbegin(), editorList.cend(), pred);
89 if (listIt != editorList.cend()) {
90 editorList.erase(listIt);
91 if (editorList.isEmpty())
92 m_createdEditors.erase(it) ;
98template <
class Editor>
101 for (
auto it = m_createdEditors.begin(), end = m_createdEditors.end(); it != end; ++it)
102 qDeleteAll(it.value());
103 m_createdEditors.clear();
111 Q_DECLARE_PUBLIC(QtSpinBoxFactory)
122 const auto it = m_createdEditors.constFind(property);
123 if (it == m_createdEditors.cend())
125 for (QSpinBox *editor : it.value()) {
126 if (editor->value() != value) {
127 editor->blockSignals(
true);
128 editor->setValue(value);
129 editor->blockSignals(
false);
136 const auto it = m_createdEditors.constFind(property);
137 if (it == m_createdEditors.cend())
144 for (QSpinBox *editor : it.value()) {
145 editor->blockSignals(
true);
146 editor->setRange(min, max);
147 editor->setValue(manager->value(property));
148 editor->blockSignals(
false);
154 const auto it = m_createdEditors.constFind(property);
155 if (it == m_createdEditors.cend())
157 for (QSpinBox *editor : it.value()) {
158 editor->blockSignals(
true);
159 editor->setSingleStep(step);
160 editor->blockSignals(
false);
167 manager->setValue(property, value);
171
172
173
174
175
176
177
178
179
180
183
184
186 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSpinBoxFactoryPrivate())
193
194
197 d_ptr->deleteEditors();
201
202
203
204
207 connect(manager, &QtIntPropertyManager::valueChanged,
209 { d_ptr->slotPropertyChanged(property, value); });
211 this, [
this](
QtProperty *property,
int min,
int max)
212 { d_ptr->slotRangeChanged(property, min, max); });
215 { d_ptr->slotSingleStepChanged(property, value); });
219
220
221
222
226 QSpinBox *editor = d_ptr->createEditor(property, parent);
229 editor->setValue(manager
->value(property
));
230 editor->setKeyboardTracking(
false);
232 connect(editor, &QSpinBox::valueChanged,
233 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
234 connect(editor, &QObject::destroyed,
235 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
240
241
242
243
246 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
256 Q_DECLARE_PUBLIC(QtSliderFactory)
266 const auto it = m_createdEditors.constFind(property);
267 if (it == m_createdEditors.cend())
269 for (QSlider *editor : it.value()) {
270 editor->blockSignals(
true);
271 editor->setValue(value);
272 editor->blockSignals(
false);
278 const auto it = m_createdEditors.constFind(property);
279 if (it == m_createdEditors.cend())
286 for (QSlider *editor : it.value()) {
287 editor->blockSignals(
true);
288 editor->setRange(min, max);
289 editor->setValue(manager->value(property));
290 editor->blockSignals(
false);
296 const auto it = m_createdEditors.constFind(property);
297 if (it == m_createdEditors.cend())
299 for (QSlider *editor : it.value()) {
300 editor->blockSignals(
true);
301 editor->setSingleStep(step);
302 editor->blockSignals(
false);
309 manager->setValue(property, value);
313
314
315
316
317
318
319
320
321
322
325
326
328 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtSliderFactoryPrivate())
335
336
339 d_ptr->deleteEditors();
343
344
345
346
349 connect(manager, &QtIntPropertyManager::valueChanged,
351 { d_ptr->slotPropertyChanged(property, value); });
353 this, [
this](
QtProperty *property,
int min,
int max)
354 { d_ptr->slotRangeChanged(property, min, max); });
357 { d_ptr->slotSingleStepChanged(property, value); });
361
362
363
364
368 auto *editor =
new QSlider(Qt::Horizontal, parent);
369 d_ptr->initializeEditor(property, editor);
372 editor->setValue(manager
->value(property
));
374 connect(editor, &QSlider::valueChanged,
375 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
376 connect(editor, &QObject::destroyed,
377 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
382
383
384
385
388 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
398 Q_DECLARE_PUBLIC(QtScrollBarFactory)
408 const auto it = m_createdEditors.constFind(property);
409 if (it == m_createdEditors.cend())
412 for (QScrollBar *editor : it.value()) {
413 editor->blockSignals(
true);
414 editor->setValue(value);
415 editor->blockSignals(
false);
421 const auto it = m_createdEditors.constFind(property);
422 if (it == m_createdEditors.cend())
429 for (QScrollBar *editor : it.value()) {
430 editor->blockSignals(
true);
431 editor->setRange(min, max);
432 editor->setValue(manager->value(property));
433 editor->blockSignals(
false);
439 const auto it = m_createdEditors.constFind(property);
440 if (it == m_createdEditors.cend())
442 for (QScrollBar *editor : it.value()) {
443 editor->blockSignals(
true);
444 editor->setSingleStep(step);
445 editor->blockSignals(
false);
452 manager->setValue(property, value);
456
457
458
459
460
461
462
463
464
465
468
469
471 : QtAbstractEditorFactory<QtIntPropertyManager>(parent), d_ptr(
new QtScrollBarFactoryPrivate())
478
479
482 d_ptr->deleteEditors();
486
487
488
489
492 connect(manager, &QtIntPropertyManager::valueChanged,
494 { d_ptr->slotPropertyChanged(property, value); });
496 this, [
this](
QtProperty *property,
int min,
int max)
497 { d_ptr->slotRangeChanged(property, min, max); });
500 { d_ptr->slotSingleStepChanged(property, value); });
504
505
506
507
511 auto *editor =
new QScrollBar(Qt::Horizontal, parent);
512 d_ptr->initializeEditor(property, editor);
515 editor->setValue(manager
->value(property
));
516 connect(editor, &QScrollBar::valueChanged,
517 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
518 connect(editor, &QObject::destroyed,
519 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
524
525
526
527
530 disconnect(manager, &QtIntPropertyManager::valueChanged,
this,
nullptr);
540 Q_DECLARE_PUBLIC(QtCheckBoxFactory)
548 const auto it = m_createdEditors.constFind(property);
549 if (it == m_createdEditors.cend())
552 for (QtBoolEdit *editor : it.value()) {
553 editor->blockCheckBoxSignals(
true);
554 editor->setChecked(value);
555 editor->blockCheckBoxSignals(
false);
562 manager->setValue(property, value);
566
567
568
569
570
571
572
573
574
575
578
579
581 : QtAbstractEditorFactory<QtBoolPropertyManager>(parent), d_ptr(
new QtCheckBoxFactoryPrivate())
588
589
592 d_ptr->deleteEditors();
596
597
598
599
602 connect(manager, &QtBoolPropertyManager::valueChanged,
603 this, [
this](
QtProperty *property,
bool value)
604 { d_ptr->slotPropertyChanged(property, value); });
608
609
610
611
615 QtBoolEdit *editor = d_ptr->createEditor(property, parent);
618 connect(editor, &QtBoolEdit::toggled,
619 this, [
this, property](
bool value) { d_ptr->slotSetValue(property, value); });
620 connect(editor, &QObject::destroyed,
621 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
626
627
628
629
632 disconnect(manager, &QtBoolPropertyManager::valueChanged,
this,
nullptr);
640 Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
652 const auto it = m_createdEditors.constFind(property);
653 if (it == m_createdEditors.cend())
655 for (QDoubleSpinBox *editor : it.value()) {
656 if (editor->value() != value) {
657 editor->blockSignals(
true);
658 editor->setValue(value);
659 editor->blockSignals(
false);
665 double min,
double max)
667 const auto it = m_createdEditors.constFind(property);
668 if (it == m_createdEditors.cend())
675 for (QDoubleSpinBox *editor : it.value()) {
676 editor->blockSignals(
true);
677 editor->setRange(min, max);
678 editor->setValue(manager->value(property));
679 editor->blockSignals(
false);
685 const auto it = m_createdEditors.constFind(property);
686 if (it == m_createdEditors.cend())
693 for (QDoubleSpinBox *editor : it.value()) {
694 editor->blockSignals(
true);
695 editor->setSingleStep(step);
696 editor->blockSignals(
false);
702 const auto it = m_createdEditors.constFind(property);
703 if (it == m_createdEditors.constEnd())
710 for (QDoubleSpinBox *editor : it.value()) {
711 editor->blockSignals(
true);
712 editor->setDecimals(prec);
713 editor->setValue(manager->value(property));
714 editor->blockSignals(
false);
721 manager->setValue(property, value);
725
726
727
728
729
730
731
732
733
736
737
739 : QtAbstractEditorFactory<QtDoublePropertyManager>(parent), d_ptr(
new QtDoubleSpinBoxFactoryPrivate())
746
747
750 d_ptr->deleteEditors();
754
755
756
757
760 connect(manager, &QtDoublePropertyManager::valueChanged,
761 this, [
this](
QtProperty *property,
double value)
762 { d_ptr->slotPropertyChanged(property, value); });
764 this, [
this](
QtProperty *property,
double min,
double max)
765 { d_ptr->slotRangeChanged(property, min, max); });
767 this, [
this](
QtProperty *property,
double value)
768 { d_ptr->slotSingleStepChanged(property, value); });
771 { d_ptr->slotDecimalsChanged(property, value); });
775
776
777
778
782 QDoubleSpinBox *editor = d_ptr->createEditor(property, parent);
786 editor->setValue(manager
->value(property
));
787 editor->setKeyboardTracking(
false);
789 connect(editor, &QDoubleSpinBox::valueChanged,
790 this, [
this, property](
double value) { d_ptr->slotSetValue(property, value); });
791 connect(editor, &QObject::destroyed,
792 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
797
798
799
800
803 disconnect(manager, &QtDoublePropertyManager::valueChanged,
this,
nullptr);
814 Q_DECLARE_PUBLIC(QtLineEditFactory)
823 const QString &value)
825 const auto it = m_createdEditors.constFind(property);
826 if (it == m_createdEditors.constEnd())
829 for (QLineEdit *editor : it.value()) {
830 if (editor->text() != value)
831 editor->setText(value);
836 const QRegularExpression ®Exp)
838 const auto it = m_createdEditors.constFind(property);
839 if (it == m_createdEditors.constEnd())
846 for (QLineEdit *editor : it.value()) {
847 editor->blockSignals(
true);
848 const QValidator *oldValidator = editor->validator();
849 QValidator *newValidator =
nullptr;
850 if (regExp.isValid()) {
851 newValidator =
new QRegularExpressionValidator(regExp, editor);
853 editor->setValidator(newValidator);
855 editor->blockSignals(
false);
862 manager->setValue(property, value);
866
867
868
869
870
871
872
873
874
875
878
879
881 : QtAbstractEditorFactory<QtStringPropertyManager>(parent), d_ptr(
new QtLineEditFactoryPrivate())
888
889
892 d_ptr->deleteEditors();
896
897
898
899
902 connect(manager, &QtStringPropertyManager::valueChanged,
903 this, [
this](
QtProperty *property,
const QString &value)
904 { d_ptr->slotPropertyChanged(property, value); });
906 this, [
this](
QtProperty *property,
const QRegularExpression &value)
907 { d_ptr->slotRegExpChanged(property, value); });
911
912
913
914
918 QLineEdit *editor = d_ptr->createEditor(property, parent);
919 QRegularExpression regExp = manager->regExp(property);
920 if (regExp.isValid() && !regExp.pattern().isEmpty()) {
921 auto *validator =
new QRegularExpressionValidator(regExp, editor);
922 editor->setValidator(validator);
924 editor->setText(manager->value(property));
926 connect(editor, &QLineEdit::textEdited,
927 this, [
this, property](
const QString &value) { d_ptr->slotSetValue(property, value); });
928 connect(editor, &QObject::destroyed,
929 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
934
935
936
937
940 disconnect(manager, &QtStringPropertyManager::valueChanged,
this,
nullptr);
949 Q_DECLARE_PUBLIC(QtDateEditFactory)
959 const auto it = m_createdEditors.constFind(property);
960 if (it == m_createdEditors.constEnd())
962 for (QDateEdit *editor : it.value()) {
963 editor->blockSignals(
true);
964 editor->setDate(value);
965 editor->blockSignals(
false);
971 const auto it = m_createdEditors.constFind(property);
972 if (it == m_createdEditors.constEnd())
979 for (QDateEdit *editor : it.value()) {
980 editor->blockSignals(
true);
981 editor->setDateRange(min, max);
982 editor->setDate(manager->value(property));
983 editor->blockSignals(
false);
990 manager->setValue(property, value);
994
995
996
997
998
999
1000
1001
1002
1003
1006
1007
1009 : QtAbstractEditorFactory<QtDatePropertyManager>(parent), d_ptr(
new QtDateEditFactoryPrivate())
1011 d_ptr->q_ptr =
this;
1016
1017
1020 d_ptr->deleteEditors();
1024
1025
1026
1027
1030 connect(manager, &QtDatePropertyManager::valueChanged,
1031 this, [
this](
QtProperty *property, QDate value)
1032 { d_ptr->slotPropertyChanged(property, value); });
1034 this, [
this](
QtProperty *property, QDate min, QDate max)
1035 { d_ptr->slotRangeChanged(property, min, max); });
1039
1040
1041
1042
1046 QDateEdit *editor = d_ptr->createEditor(property, parent);
1047 editor->setDisplayFormat(QtPropertyBrowserUtils::dateFormat());
1048 editor->setCalendarPopup(
true);
1050 editor->setDate(manager
->value(property));
1052 connect(editor, &QDateEdit::dateChanged,
1053 this, [
this, property](QDate value) { d_ptr->slotSetValue(property, value); });
1054 connect(editor, &QObject::destroyed,
1055 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1060
1061
1062
1063
1066 disconnect(manager, &QtDatePropertyManager::valueChanged,
this,
nullptr);
1075 Q_DECLARE_PUBLIC(QtTimeEditFactory)
1084 const auto it = m_createdEditors.constFind(property);
1085 if (it == m_createdEditors.constEnd())
1087 for (QTimeEdit *editor : it.value()) {
1088 editor->blockSignals(
true);
1089 editor->setTime(value);
1090 editor->blockSignals(
false);
1097 manager->setValue(property, value);
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1113
1114
1116 : QtAbstractEditorFactory<QtTimePropertyManager>(parent), d_ptr(
new QtTimeEditFactoryPrivate())
1118 d_ptr->q_ptr =
this;
1123
1124
1127 d_ptr->deleteEditors();
1131
1132
1133
1134
1137 connect(manager, &QtTimePropertyManager::valueChanged,
1138 this, [
this](
QtProperty *property, QTime value)
1139 { d_ptr->slotPropertyChanged(property, value); });
1143
1144
1145
1146
1150 QTimeEdit *editor = d_ptr->createEditor(property, parent);
1151 editor->setDisplayFormat(QtPropertyBrowserUtils::timeFormat());
1152 editor->setTime(manager
->value(property));
1154 connect(editor, &QTimeEdit::timeChanged,
1155 this, [
this, property](QTime value) { d_ptr->slotSetValue(property, value); });
1156 connect(editor, &QObject::destroyed,
1157 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1162
1163
1164
1165
1168 disconnect(manager, &QtTimePropertyManager::valueChanged,
this,
nullptr);
1176 Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
1185 const QDateTime &value)
1187 const auto it = m_createdEditors.constFind(property);
1188 if (it == m_createdEditors.constEnd())
1191 for (QDateTimeEdit *editor : it.value()) {
1192 editor->blockSignals(
true);
1193 editor->setDateTime(value);
1194 editor->blockSignals(
false);
1201 manager->setValue(property, value);
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1217
1218
1220 : QtAbstractEditorFactory<QtDateTimePropertyManager>(parent), d_ptr(
new QtDateTimeEditFactoryPrivate())
1222 d_ptr->q_ptr =
this;
1227
1228
1231 d_ptr->deleteEditors();
1235
1236
1237
1238
1241 connect(manager, &QtDateTimePropertyManager::valueChanged,
1242 this, [
this](
QtProperty *property,
const QDateTime &value)
1243 { d_ptr->slotPropertyChanged(property, value); });
1247
1248
1249
1250
1254 QDateTimeEdit *editor = d_ptr->createEditor(property, parent);
1255 editor->setDisplayFormat(QtPropertyBrowserUtils::dateTimeFormat());
1256 editor->setDateTime(manager
->value(property));
1258 connect(editor, &QDateTimeEdit::dateTimeChanged,
1259 this, [
this, property](
const QDateTime &value) { d_ptr->slotSetValue(property, value); });
1260 connect(editor, &QObject::destroyed,
1261 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1266
1267
1268
1269
1272 disconnect(manager, &QtDateTimePropertyManager::valueChanged,
this,
nullptr);
1280 Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
1288 const QKeySequence &value)
1290 const auto it = m_createdEditors.constFind(property);
1291 if (it == m_createdEditors.constEnd())
1294 for (QKeySequenceEdit *editor : it.value()) {
1295 editor->blockSignals(
true);
1296 editor->setKeySequence(value);
1297 editor->blockSignals(
false);
1304 manager->setValue(property, value);
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1320
1321
1323 : QtAbstractEditorFactory<QtKeySequencePropertyManager>(parent), d_ptr(
new QtKeySequenceEditorFactoryPrivate())
1325 d_ptr->q_ptr =
this;
1330
1331
1334 d_ptr->deleteEditors();
1338
1339
1340
1341
1344 connect(manager, &QtKeySequencePropertyManager::valueChanged,
1345 this, [
this](
QtProperty *property,
const QKeySequence &value)
1346 { d_ptr->slotPropertyChanged(property, value); });
1350
1351
1352
1353
1357 QKeySequenceEdit *editor = d_ptr->createEditor(property, parent);
1358 editor->setKeySequence(manager->value(property));
1360 connect(editor, &QKeySequenceEdit::keySequenceChanged,
1361 this, [
this, property](
const QKeySequence &value) { d_ptr->slotSetValue(property, value); });
1362 connect(editor, &QObject::destroyed,
1363 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1368
1369
1370
1371
1374 disconnect(manager, &QtKeySequencePropertyManager::valueChanged,
this,
nullptr);
1400 void handleKeyEvent(QKeyEvent *e);
1403 QLineEdit *m_lineEdit;
1407 : QWidget(parent), m_lineEdit(
new QLineEdit(
this))
1409 auto *layout =
new QHBoxLayout(
this);
1410 layout->addWidget(m_lineEdit);
1411 layout->setContentsMargins(QMargins());
1412 m_lineEdit->installEventFilter(
this);
1413 m_lineEdit->setReadOnly(
true);
1414 m_lineEdit->setFocusProxy(
this);
1415 setFocusPolicy(m_lineEdit->focusPolicy());
1416 setAttribute(Qt::WA_InputMethodEnabled);
1421 if (o == m_lineEdit && e->type() == QEvent::ContextMenu) {
1422 QContextMenuEvent *c =
static_cast<QContextMenuEvent *>(e);
1423 QMenu *menu = m_lineEdit->createStandardContextMenu();
1424 const auto actions = menu->actions();
1425 for (QAction *action : actions) {
1426 action->setShortcut(QKeySequence());
1427 QString actionString = action->text();
1428 const auto pos = actionString.lastIndexOf(QLatin1Char(
'\t'));
1430 actionString = actionString.remove(pos, actionString.size() - pos);
1431 action->setText(actionString);
1433 QAction *actionBefore =
nullptr;
1434 if (!actions.empty())
1435 actionBefore = actions[0];
1436 auto *clearAction =
new QAction(tr(
"Clear Char"), menu);
1437 menu->insertAction(actionBefore, clearAction);
1438 menu->insertSeparator(actionBefore);
1439 clearAction->setEnabled(!m_value.isNull());
1440 connect(clearAction, &QAction::triggered,
this, &QtCharEdit::slotClearChar);
1441 menu->exec(c->globalPos());
1447 return QWidget::eventFilter(o, e);
1452 if (m_value.isNull())
1455 emit valueChanged(m_value);
1460 const int key = e->key();
1462 case Qt::Key_Control:
1466 case Qt::Key_Super_L:
1467 case Qt::Key_Return:
1473 const QString text = e->text();
1474 if (text.size() != 1)
1477 const QChar c = text.at(0);
1485 const QString str = m_value.isNull() ? QString() : QString(m_value);
1486 m_lineEdit->setText(str);
1488 emit valueChanged(m_value);
1493 if (value == m_value)
1497 QString str = value.isNull() ? QString() : QString(value);
1498 m_lineEdit->setText(str);
1508 m_lineEdit->event(e);
1509 m_lineEdit->selectAll();
1510 QWidget::focusInEvent(e);
1515 m_lineEdit->event(e);
1516 QWidget::focusOutEvent(e);
1527 m_lineEdit->event(e);
1533 case QEvent::Shortcut:
1534 case QEvent::ShortcutOverride:
1535 case QEvent::KeyRelease:
1541 return QWidget::event(e);
1549 Q_DECLARE_PUBLIC(QtCharEditorFactory)
1560 const auto it = m_createdEditors.constFind(property);
1561 if (it == m_createdEditors.constEnd())
1564 for (QtCharEdit *editor : it.value()) {
1565 editor->blockSignals(
true);
1566 editor->setValue(value);
1567 editor->blockSignals(
false);
1574 manager->setValue(property, value);
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1590
1591
1593 : QtAbstractEditorFactory<QtCharPropertyManager>(parent), d_ptr(
new QtCharEditorFactoryPrivate())
1595 d_ptr->q_ptr =
this;
1600
1601
1604 d_ptr->deleteEditors();
1608
1609
1610
1611
1614 connect(manager, &QtCharPropertyManager::valueChanged,
1615 this, [
this](
QtProperty *property,
const QChar &value)
1616 { d_ptr->slotPropertyChanged(property, value); });
1620
1621
1622
1623
1627 QtCharEdit *editor = d_ptr->createEditor(property, parent);
1628 editor->setValue(manager->value(property));
1630 connect(editor, &QtCharEdit::valueChanged,
1631 this, [
this, property](
const QChar &value) { d_ptr->slotSetValue(property, value); });
1632 connect(editor, &QObject::destroyed,
1633 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1638
1639
1640
1641
1644 disconnect(manager, &QtCharPropertyManager::valueChanged,
this,
nullptr);
1652 Q_DECLARE_PUBLIC(QtEnumEditorFactory)
1663 const auto it = m_createdEditors.constFind(property);
1664 if (it == m_createdEditors.constEnd())
1667 for (QComboBox *editor : it.value()) {
1668 editor->blockSignals(
true);
1669 editor->setCurrentIndex(value);
1670 editor->blockSignals(
false);
1675 const QStringList &enumNames)
1677 const auto it = m_createdEditors.constFind(property);
1678 if (it == m_createdEditors.constEnd())
1685 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1687 for (QComboBox *editor : it.value()) {
1688 editor->blockSignals(
true);
1690 editor->addItems(enumNames);
1691 const auto nameCount = enumNames.size();
1692 for (qsizetype i = 0; i < nameCount; i++)
1693 editor->setItemIcon(i, enumIcons.value(i));
1694 editor->setCurrentIndex(manager->value(property));
1695 editor->blockSignals(
false);
1700 const QMap<
int, QIcon> &enumIcons)
1702 const auto it = m_createdEditors.constFind(property);
1703 if (it == m_createdEditors.constEnd())
1710 const QStringList enumNames = manager->enumNames(property);
1711 for (QComboBox *editor : it.value()) {
1712 editor->blockSignals(
true);
1713 const auto nameCount = enumNames.size();
1714 for (qsizetype i = 0; i < nameCount; i++)
1715 editor->setItemIcon(i, enumIcons.value(i));
1716 editor->setCurrentIndex(manager->value(property));
1717 editor->blockSignals(
false);
1724 manager->setValue(property, value);
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1740
1741
1743 : QtAbstractEditorFactory<QtEnumPropertyManager>(parent), d_ptr(
new QtEnumEditorFactoryPrivate())
1745 d_ptr->q_ptr =
this;
1750
1751
1754 d_ptr->deleteEditors();
1758
1759
1760
1761
1764 connect(manager, &QtEnumPropertyManager::valueChanged,
1765 this, [
this](
QtProperty *property,
int value)
1766 { d_ptr->slotPropertyChanged(property, value); });
1767 connect(manager, &QtEnumPropertyManager::enumNamesChanged,
1768 this, [
this](
QtProperty *property,
const QStringList &value)
1769 { d_ptr->slotEnumNamesChanged(property, value); });
1773
1774
1775
1776
1780 QComboBox *editor = d_ptr->createEditor(property, parent);
1781 editor->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
1782 editor->view()->setTextElideMode(Qt::ElideRight);
1783 QStringList enumNames = manager->enumNames(property);
1784 editor->addItems(enumNames);
1785 QMap<
int, QIcon> enumIcons = manager->enumIcons(property);
1786 const auto enumNamesCount = enumNames.size();
1787 for (qsizetype i = 0; i < enumNamesCount; i++)
1788 editor->setItemIcon(i, enumIcons.value(i));
1789 editor->setCurrentIndex(manager
->value(property
));
1791 connect(editor, &QComboBox::currentIndexChanged,
1792 this, [
this, property](
int value) { d_ptr->slotSetValue(property, value); });
1793 connect(editor, &QObject::destroyed,
1794 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1799
1800
1801
1802
1805 disconnect(manager, &QtEnumPropertyManager::valueChanged,
this,
nullptr);
1806 disconnect(manager, &QtEnumPropertyManager::enumNamesChanged,
this,
nullptr);
1814 Q_DECLARE_PUBLIC(QtCursorEditorFactory)
1833 QtProperty *enumProp = m_propertyToEnum.value(property);
1848 QtProperty *prop = m_enumToProperty.value(property);
1856 cursorManager->setValue(prop, QCursor(cdb->valueToCursor(value)));
1865 for (
auto itEditor = m_editorToEnum.cbegin(), ecend = m_editorToEnum.cend(); itEditor != ecend; ++itEditor)
1866 if (itEditor.key() == object) {
1867 QWidget *editor = itEditor.key();
1869 m_editorToEnum.remove(editor);
1870 m_enumToEditors[enumProp].removeAll(editor);
1871 if (m_enumToEditors[enumProp].isEmpty()) {
1872 m_enumToEditors.remove(enumProp);
1873 QtProperty *property = m_enumToProperty.value(enumProp);
1874 m_enumToProperty.remove(enumProp);
1875 m_propertyToEnum.remove(property);
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1895
1896
1898 : QtAbstractEditorFactory<QtCursorPropertyManager>(parent), d_ptr(
new QtCursorEditorFactoryPrivate())
1900 d_ptr->q_ptr =
this;
1902 d_ptr->m_enumEditorFactory =
new QtEnumEditorFactory(
this);
1903 d_ptr->m_enumPropertyManager =
new QtEnumPropertyManager(
this);
1904 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::valueChanged,
1905 this, [
this](
QtProperty *property,
int value)
1906 { d_ptr->slotEnumChanged(property, value); });
1907 d_ptr->m_enumEditorFactory->addPropertyManager(d_ptr->m_enumPropertyManager);
1911
1912
1916
1917
1918
1919
1922 connect(manager, &QtCursorPropertyManager::valueChanged,
1923 this, [
this](
QtProperty *property,
const QCursor &value)
1924 { d_ptr->slotPropertyChanged(property, value); });
1928
1929
1930
1931
1935 QtProperty *enumProp = d_ptr->m_propertyToEnum.value(property,
nullptr);
1936 if (enumProp ==
nullptr) {
1937 enumProp = d_ptr->m_enumPropertyManager->addProperty(property->propertyName());
1939 d_ptr->m_enumPropertyManager->setEnumNames(enumProp, cdb->cursorShapeNames());
1940 d_ptr->m_enumPropertyManager->setEnumIcons(enumProp, cdb->cursorShapeIcons());
1942 d_ptr->m_enumPropertyManager->setValue(enumProp, cdb->cursorToValue(manager->value(property)));
1944 d_ptr->m_propertyToEnum[property] = enumProp;
1945 d_ptr->m_enumToProperty[enumProp] = property;
1948 QWidget *editor = af->createEditor(enumProp, parent);
1949 d_ptr->m_enumToEditors[enumProp].append(editor);
1950 d_ptr->m_editorToEnum[editor] = enumProp;
1951 connect(editor, &QObject::destroyed,
1952 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
1957
1958
1959
1960
1963 disconnect(manager, &QtCursorPropertyManager::valueChanged,
this,
nullptr);
1989 QLabel *m_pixmapLabel;
1991 QToolButton *m_button;
1996 m_pixmapLabel(
new QLabel),
1997 m_label(
new QLabel),
1998 m_button(
new QToolButton)
2000 auto *lt =
new QHBoxLayout(
this);
2001 setupTreeViewEditorMargin(lt);
2003 lt->addWidget(m_pixmapLabel);
2004 lt->addWidget(m_label);
2005 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2007 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2008 m_button->setFixedWidth(20);
2009 setFocusProxy(m_button);
2010 setFocusPolicy(m_button->focusPolicy());
2011 m_button->setText(tr(
"..."));
2012 m_button->installEventFilter(
this);
2013 connect(m_button, &QAbstractButton::clicked,
this, &QtColorEditWidget::buttonClicked);
2014 lt->addWidget(m_button);
2018void QtColorEditWidget::setValue(QColor c)
2026void QtColorEditWidget::updateColor()
2029 QtPropertyBrowserUtils::brushValuePixmap(QBrush(m_color),
2030 QtPropertyBrowserUtils::itemViewIconSize,
2031 devicePixelRatioF());
2032 m_pixmapLabel->setPixmap(pm);
2033 m_label->setText(QtPropertyBrowserUtils::colorValueText(m_color));
2036void QtColorEditWidget::buttonClicked()
2038 const QColor newColor = QColorDialog::getColor(m_color,
this, QString(), QColorDialog::ShowAlphaChannel);
2039 if (newColor.isValid() && newColor != m_color) {
2041 emit valueChanged(m_color);
2045bool QtColorEditWidget::eventFilter(QObject *obj, QEvent *ev)
2047 if (obj == m_button) {
2048 switch (ev->type()) {
2049 case QEvent::KeyPress:
2050 case QEvent::KeyRelease: {
2051 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2052 case Qt::Key_Escape:
2054 case Qt::Key_Return:
2066 return QWidget::eventFilter(obj, ev);
2071class QtColorEditorFactoryPrivate :
public EditorFactoryPrivate<QtColorEditWidget>
2073 QtColorEditorFactory *q_ptr =
nullptr;
2074 Q_DECLARE_PUBLIC(QtColorEditorFactory)
2077 void slotPropertyChanged(QtProperty *property, QColor value);
2078 void slotSetValue(QtProperty *property, QColor value);
2081void QtColorEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2084 const auto it = m_createdEditors.constFind(property);
2085 if (it == m_createdEditors.constEnd())
2088 for (QtColorEditWidget *e : it.value())
2092void QtColorEditorFactoryPrivate::slotSetValue(QtProperty *property, QColor value)
2094 if (QtColorPropertyManager *manager = q_ptr->propertyManager(property))
2095 manager->setValue(property, value);
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2111
2112
2114 QtAbstractEditorFactory<QtColorPropertyManager>(parent),
2115 d_ptr(
new QtColorEditorFactoryPrivate())
2117 d_ptr->q_ptr =
this;
2121
2122
2125 d_ptr->deleteEditors();
2129
2130
2131
2132
2135 connect(manager, &QtColorPropertyManager::valueChanged,
2136 this, [
this](
QtProperty *property, QColor value)
2137 { d_ptr->slotPropertyChanged(property, value); });
2141
2142
2143
2144
2149 editor->setValue(manager->value(property));
2150 connect(editor, &QtColorEditWidget::valueChanged,
2151 this, [
this, property](QColor value) { d_ptr->slotSetValue(property, value); });
2152 connect(editor, &QObject::destroyed,
2153 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2158
2159
2160
2161
2164 disconnect(manager, &QtColorPropertyManager::valueChanged,
this,
nullptr);
2190 QLabel *m_pixmapLabel;
2192 QToolButton *m_button;
2197 m_pixmapLabel(
new QLabel),
2198 m_label(
new QLabel),
2199 m_button(
new QToolButton)
2201 auto *lt =
new QHBoxLayout(
this);
2202 setupTreeViewEditorMargin(lt);
2204 lt->addWidget(m_pixmapLabel);
2205 lt->addWidget(m_label);
2206 lt->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2208 m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2209 m_button->setFixedWidth(20);
2210 setFocusProxy(m_button);
2211 setFocusPolicy(m_button->focusPolicy());
2212 m_button->setText(tr(
"..."));
2213 m_button->installEventFilter(
this);
2214 connect(m_button, &QAbstractButton::clicked,
this, &QtFontEditWidget::buttonClicked);
2215 lt->addWidget(m_button);
2219void QtFontEditWidget::updateFont()
2221 const auto pm = QtPropertyBrowserUtils::fontValuePixmap(
2222 m_font, QtPropertyBrowserUtils::itemViewIconSize, devicePixelRatioF());
2223 m_pixmapLabel->setPixmap(pm);
2224 m_label->setText(QtPropertyBrowserUtils::fontValueText(m_font));
2227void QtFontEditWidget::setValue(
const QFont &f)
2235void QtFontEditWidget::buttonClicked()
2238 QFont newFont = QFontDialog::getFont(&ok, m_font,
this, tr(
"Select Font"));
2239 if (ok && newFont != m_font) {
2242 if (m_font.family() != newFont.family())
2243 f.setFamily(newFont.family());
2244 if (m_font.pointSize() != newFont.pointSize())
2245 f.setPointSize(newFont.pointSize());
2246 if (m_font.bold() != newFont.bold())
2247 f.setBold(newFont.bold());
2248 if (m_font.italic() != newFont.italic())
2249 f.setItalic(newFont.italic());
2250 if (m_font.underline() != newFont.underline())
2251 f.setUnderline(newFont.underline());
2252 if (m_font.strikeOut() != newFont.strikeOut())
2253 f.setStrikeOut(newFont.strikeOut());
2255 emit valueChanged(m_font);
2259bool QtFontEditWidget::eventFilter(QObject *obj, QEvent *ev)
2261 if (obj == m_button) {
2262 switch (ev->type()) {
2263 case QEvent::KeyPress:
2264 case QEvent::KeyRelease: {
2265 switch (
static_cast<
const QKeyEvent*>(ev)->key()) {
2266 case Qt::Key_Escape:
2268 case Qt::Key_Return:
2280 return QWidget::eventFilter(obj, ev);
2285class QtFontEditorFactoryPrivate :
public EditorFactoryPrivate<QtFontEditWidget>
2287 QtFontEditorFactory *q_ptr =
nullptr;
2288 Q_DECLARE_PUBLIC(QtFontEditorFactory)
2291 void slotPropertyChanged(QtProperty *property,
const QFont &value);
2292 void slotSetValue(QtProperty *property,
const QFont &value);
2295void QtFontEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
2298 const auto it = m_createdEditors.constFind(property);
2299 if (it == m_createdEditors.constEnd())
2302 for (QtFontEditWidget *e : it.value())
2306void QtFontEditorFactoryPrivate::slotSetValue(QtProperty *property,
const QFont &value)
2308 if (QtFontPropertyManager *manager = q_ptr->propertyManager(property))
2309 manager->setValue(property, value);
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2325
2326
2328 QtAbstractEditorFactory<QtFontPropertyManager>(parent),
2329 d_ptr(
new QtFontEditorFactoryPrivate())
2331 d_ptr->q_ptr =
this;
2335
2336
2339 d_ptr->deleteEditors();
2343
2344
2345
2346
2349 connect(manager, &QtFontPropertyManager::valueChanged,
2350 this, [
this](
QtProperty *property,
const QFont &value)
2351 { d_ptr->slotPropertyChanged(property, value); });
2355
2356
2357
2358
2363 editor->setValue(manager->value(property));
2364 connect(editor, &QtFontEditWidget::valueChanged,
2365 this, [
this, property](
const QFont &value) { d_ptr->slotSetValue(property, value); });
2366 connect(editor, &QObject::destroyed,
2367 this, [
this](QObject *object) { d_ptr->slotEditorDestroyed(object); });
2372
2373
2374
2375
2378 disconnect(manager, &QtFontPropertyManager::valueChanged,
this,
nullptr);
2383#include "moc_qteditorfactory_p.cpp"
2384#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)