9# pragma warning(disable: 4786
)
38 Q_DECLARE_PUBLIC(QtAbstractPropertyManager)
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
102
103
104
105
106
107
108
109
110
118
119
120
121
122
123
124
125
128 auto *parent = d_ptr->m_parentItem;
130 parent->d_ptr->m_manager->d_ptr->propertyRemoved(
this, parent);
132 d_ptr->m_manager->d_ptr->propertyDestroyed(
this);
134 for (QtProperty *property : std::as_const(d_ptr->m_subItems))
135 property->d_ptr->m_parentItem =
nullptr;
138 parent->d_ptr->m_subItems.removeAll(
this);
142
143
144
145
146
147
148
151 return d_ptr->m_subItems;
156 return d_ptr->m_parentItem;
160
161
164 return d_ptr->m_manager;
168
169
170
173
174
175
176
177
178
179
182 return d_ptr->m_valueToolTip;
186
187
188
189
190
191
192
195 return d_ptr->m_descriptionToolTip;
199
200
201
202
205 return d_ptr->m_statusTip;
209
210
211
212
215 return d_ptr->m_whatsThis;
219
220
221
222
225 return d_ptr->m_name;
229
230
231
232
235 return d_ptr->m_enabled;
239
240
241
242
245 return d_ptr->m_modified;
249
250
251
252
255 return d_ptr->m_manager->hasValue(
this);
259
260
261
262
263
264
265
268 return d_ptr->m_manager->valueIcon(
this);
272
273
274
275
276
277
278
281 return d_ptr->m_manager->valueText(
this);
285
286
287
288
289
292 if (d_ptr->m_valueToolTip == text)
295 d_ptr->m_valueToolTip = text;
300
301
302
303
304
307 if (d_ptr->m_descriptionToolTip == text)
310 d_ptr->m_descriptionToolTip = text;
315
316
317
318
321 if (d_ptr->m_statusTip == text)
324 d_ptr->m_statusTip = text;
329
330
331
332
335 if (d_ptr->m_whatsThis == text)
338 d_ptr->m_whatsThis = text;
343
344
345
346
347
348
351 if (d_ptr->m_name == text)
354 d_ptr->m_name = text;
359
360
361
362
365 if (d_ptr->m_enabled == enable)
368 d_ptr->m_enabled = enable;
373
374
375
376
379 if (d_ptr->m_modified == modified)
382 d_ptr->m_modified = modified;
387
388
389
390
391
392
393
397 if (!d_ptr->m_subItems.empty())
398 after = d_ptr->m_subItems.last();
403
404
405
406
407
408
409
410
411
412
413
414
421 if (property ==
this)
425 auto pendingList = property->subProperties();
426 QHash<QtProperty *,
bool> visited;
427 while (!pendingList.isEmpty()) {
431 pendingList.removeFirst();
432 if (visited.contains(i))
435 pendingList += i->subProperties();
438 pendingList = subProperties();
442 while (pos < pendingList.size()) {
446 if (i == afterProperty) {
448 properAfterProperty = afterProperty;
453 d_ptr->m_subItems.insert(newPos, property);
454 Q_ASSERT(property->d_ptr->m_parentItem ==
nullptr);
455 property->d_ptr->m_parentItem =
this;
457 d_ptr->m_manager->d_ptr->propertyInserted(property,
this, properAfterProperty);
461
462
463
464
465
471 d_ptr->m_manager->d_ptr->propertyRemoved(property,
this);
473 auto pendingList = subProperties();
475 while (pos < pendingList.size()) {
476 if (pendingList.at(pos) == property) {
477 d_ptr->m_subItems.removeAt(pos);
479 property->d_ptr->m_parentItem =
nullptr;
487
488
491 d_ptr->m_manager->d_ptr->propertyChanged(
this);
498 const auto it = m_properties.constFind(property);
499 if (it != m_properties.cend()) {
500 emit q_ptr->propertyDestroyed(property);
501 q_ptr->uninitializeProperty(property);
502 m_properties.erase(it);
508 emit q_ptr->propertyChanged(property);
514 emit q_ptr->propertyRemoved(property, parentProperty);
520 emit q_ptr->propertyInserted(property, parentProperty, afterProperty);
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
595
596
597
598
599
600
601
602
603
604
607
608
609
610
611
612
613
614
615
616
617
620
621
622
623
624
625
626
627
628
629
632
633
634
635
636
637
640
641
643 : QObject(parent), d_ptr(
new QtAbstractPropertyManagerPrivate)
650
651
652
659
660
661
662
665 while (!d_ptr->m_properties.isEmpty())
666 delete *d_ptr->m_properties.cbegin();
670
671
672
673
676 return d_ptr->m_properties;
680
681
682
683
684
685
693
694
695
696
697
698
699
700
708
709
710
711
712
713
714
715
723
724
725
726
727
728
729
734 property->setPropertyName(name);
735 d_ptr->m_properties.insert(property);
742
743
744
745
746
747
748
749
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
775
776
777
778
779
780
781
782
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
835
836
837
838
839
840
841
842
843
844
845
846
849
850
851
852
855
856
857
858
859
860
861
862
863
866
867
868
869
870
871
872
873
874
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
944
945
946
947
948
949
952
953
954
955
956
959
960
961
962
963
964
965
966
967
968
969
972
973
974
975
976
977
978
979
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1031
1032
1033
1034
1035
1036
1037
1038
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1054
1055
1056
1057
1081 if (m_children.contains(index))
1083 qsizetype idx = m_children.indexOf(after) + 1;
1084 m_children.insert(idx, index);
1089 m_children.removeAll(index);
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1117
1118
1119
1120
1121
1122
1126 return d_ptr->m_property;
1130
1131
1132
1133
1134
1138 return d_ptr->m_parent;
1142
1143
1144
1145
1146
1147
1148
1149
1153 return d_ptr->m_children;
1157
1158
1162 return d_ptr->m_browser;
1166 : d_ptr(
new QtBrowserItemPrivate(browser, property, parent))
1168 d_ptr->q_ptr =
this;
1175using Map1 = QHash<QtAbstractPropertyBrowser *,
1176 QHash<QtAbstractPropertyManager *, QtAbstractEditorFactoryBase *>>;
1177using Map2 = QHash<QtAbstractPropertyManager *,
1178 QHash<QtAbstractEditorFactoryBase *, QList<QtAbstractPropertyBrowser *>>>;
1180Q_GLOBAL_STATIC(Map1, m_viewToManagerToFactory)
1181Q_GLOBAL_STATIC(Map2, m_managerToFactoryToViews)
1183class QtAbstractPropertyBrowserPrivate
1185 QtAbstractPropertyBrowser *q_ptr;
1186 Q_DECLARE_PUBLIC(QtAbstractPropertyBrowser)
1188 void insertSubTree(QtProperty *property,
1189 QtProperty *parentProperty);
1190 void removeSubTree(QtProperty *property,
1191 QtProperty *parentProperty);
1192 void createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty);
1193 void removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty);
1194 QtBrowserItem *createBrowserIndex(QtProperty *property, QtBrowserItem *parentIndex, QtBrowserItem *afterIndex);
1195 void removeBrowserIndex(QtBrowserItem *index);
1196 void clearIndex(QtBrowserItem *index);
1198 void slotPropertyInserted(QtProperty *property,
1199 QtProperty *parentProperty, QtProperty *afterProperty);
1200 void slotPropertyRemoved(QtProperty *property, QtProperty *parentProperty);
1201 void slotPropertyDestroyed(QtProperty *property);
1202 void slotPropertyDataChanged(QtProperty *property);
1204 QList<QtProperty *> m_subItems;
1205 QHash<QtAbstractPropertyManager *, QList<QtProperty *> > m_managerToProperties;
1206 QHash<QtProperty *, QList<QtProperty *> > m_propertyToParents;
1208 QHash<QtProperty *, QtBrowserItem *> m_topLevelPropertyToIndex;
1209 QList<QtBrowserItem *> m_topLevelIndexes;
1210 QHash<QtProperty *, QList<QtBrowserItem *> > m_propertyToIndexes;
1212 QtBrowserItem *m_currentItem =
nullptr;
1215void QtAbstractPropertyBrowserPrivate::insertSubTree(QtProperty *property,
1216 QtProperty *parentProperty)
1218 const auto it = m_propertyToParents.find(property);
1219 if (it != m_propertyToParents.end()) {
1223 it.value().append(parentProperty);
1228 QtAbstractPropertyManager *manager = property->propertyManager();
1229 if (m_managerToProperties[manager].isEmpty()) {
1231 QObject::connect(manager, &QtAbstractPropertyManager::propertyInserted,
1232 q_ptr, [
this](QtProperty *property, QtProperty *parent, QtProperty *after) {
1233 slotPropertyInserted(property, parent, after);
1235 QObject::connect(manager, &QtAbstractPropertyManager::propertyRemoved,
1236 q_ptr, [
this](QtProperty *property, QtProperty *parent) {
1237 slotPropertyRemoved(property, parent);
1239 QObject::connect(manager, &QtAbstractPropertyManager::propertyDestroyed,
1240 q_ptr, [
this](QtProperty *property) { slotPropertyDestroyed(property); });
1241 QObject::connect(manager, &QtAbstractPropertyManager::propertyChanged,
1242 q_ptr, [
this](QtProperty *property) { slotPropertyDataChanged(property); });
1244 m_managerToProperties[manager].append(property);
1245 m_propertyToParents[property].append(parentProperty);
1247 const auto subList = property->subProperties();
1248 for (QtProperty *subProperty : subList)
1249 insertSubTree(subProperty, property);
1252void QtAbstractPropertyBrowserPrivate::removeSubTree(QtProperty *property,
1253 QtProperty *parentProperty)
1255 const auto pit = m_propertyToParents.find(property);
1256 if (pit == m_propertyToParents.end())
1258 pit.value().removeAll(parentProperty);
1259 if (!pit.value().isEmpty())
1262 m_propertyToParents.erase(pit);
1263 QtAbstractPropertyManager *manager = property->propertyManager();
1265 const auto mit = m_managerToProperties.find(manager);
1266 Q_ASSERT(mit != m_managerToProperties.end());
1267 mit.value().removeAll(property);
1268 if (mit.value().isEmpty()) {
1270 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyInserted,
1272 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyRemoved,
1274 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyDestroyed, q_ptr,
nullptr);
1275 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyChanged,
1278 m_managerToProperties.erase(mit);
1281 const auto subList = property->subProperties();
1282 for (QtProperty *subProperty : subList)
1283 removeSubTree(subProperty, property);
1286void QtAbstractPropertyBrowserPrivate::createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty)
1288 QHash<QtBrowserItem *, QtBrowserItem *> parentToAfter;
1289 if (afterProperty) {
1290 const auto it = m_propertyToIndexes.constFind(afterProperty);
1291 if (it == m_propertyToIndexes.constEnd())
1294 for (QtBrowserItem *idx : it.value()) {
1295 QtBrowserItem *parentIdx = idx->parent();
1296 if ((parentProperty && parentIdx && parentIdx->property() == parentProperty) || (!parentProperty && !parentIdx))
1297 parentToAfter[idx->parent()] = idx;
1299 }
else if (parentProperty) {
1300 const auto it = m_propertyToIndexes.find(parentProperty);
1301 if (it == m_propertyToIndexes.constEnd())
1304 for (QtBrowserItem *idx : it.value())
1305 parentToAfter[idx] =
nullptr;
1307 parentToAfter[
nullptr] =
nullptr;
1310 for (
auto it = parentToAfter.cbegin(), pcend = parentToAfter.cend(); it != pcend; ++it)
1311 createBrowserIndex(property, it.key(), it.value());
1314QtBrowserItem *QtAbstractPropertyBrowserPrivate::createBrowserIndex(QtProperty *property,
1315 QtBrowserItem *parentIndex, QtBrowserItem *afterIndex)
1317 auto *newIndex =
new QtBrowserItem(q_ptr, property, parentIndex);
1319 parentIndex->d_ptr->addChild(newIndex, afterIndex);
1321 m_topLevelPropertyToIndex[property] = newIndex;
1322 m_topLevelIndexes.insert(m_topLevelIndexes.indexOf(afterIndex) + 1, newIndex);
1324 m_propertyToIndexes[property].append(newIndex);
1326 q_ptr->itemInserted(newIndex, afterIndex);
1328 const auto subItems = property->subProperties();
1329 QtBrowserItem *afterChild =
nullptr;
1330 for (QtProperty *child : subItems)
1331 afterChild = createBrowserIndex(child, newIndex, afterChild);
1335void QtAbstractPropertyBrowserPrivate::removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty)
1337 QList<QtBrowserItem *> toRemove;
1338 const auto it = m_propertyToIndexes.constFind(property);
1339 if (it == m_propertyToIndexes.constEnd())
1342 for (QtBrowserItem *idx : it.value()) {
1343 QtBrowserItem *parentIdx = idx->parent();
1344 if ((parentProperty && parentIdx && parentIdx->property() == parentProperty) || (!parentProperty && !parentIdx))
1345 toRemove.append(idx);
1348 for (QtBrowserItem *index : std::as_const(toRemove))
1349 removeBrowserIndex(index);
1352void QtAbstractPropertyBrowserPrivate::removeBrowserIndex(QtBrowserItem *index)
1354 const auto children = index->children();
1355 for (qsizetype i = children.size(); i > 0; i--) {
1356 removeBrowserIndex(children.at(i - 1));
1359 q_ptr->itemRemoved(index);
1361 if (index->parent()) {
1362 index->parent()->d_ptr->removeChild(index);
1364 m_topLevelPropertyToIndex.remove(index->property());
1365 m_topLevelIndexes.removeAll(index);
1368 QtProperty *property = index->property();
1370 m_propertyToIndexes[property].removeAll(index);
1371 if (m_propertyToIndexes[property].isEmpty())
1372 m_propertyToIndexes.remove(property);
1377void QtAbstractPropertyBrowserPrivate::clearIndex(QtBrowserItem *index)
1379 const auto children = index->children();
1380 for (QtBrowserItem *item : children)
1385void QtAbstractPropertyBrowserPrivate::slotPropertyInserted(QtProperty *property,
1386 QtProperty *parentProperty, QtProperty *afterProperty)
1388 if (!m_propertyToParents.contains(parentProperty))
1390 createBrowserIndexes(property, parentProperty, afterProperty);
1391 insertSubTree(property, parentProperty);
1395void QtAbstractPropertyBrowserPrivate::slotPropertyRemoved(QtProperty *property,
1396 QtProperty *parentProperty)
1398 if (!m_propertyToParents.contains(parentProperty))
1400 removeSubTree(property, parentProperty);
1402 removeBrowserIndexes(property, parentProperty);
1405void QtAbstractPropertyBrowserPrivate::slotPropertyDestroyed(QtProperty *property)
1407 if (!m_subItems.contains(property))
1409 q_ptr->removeProperty(property);
1412void QtAbstractPropertyBrowserPrivate::slotPropertyDataChanged(QtProperty *property)
1414 if (!m_propertyToParents.contains(property))
1417 const auto it = m_propertyToIndexes.constFind(property);
1418 if (it == m_propertyToIndexes.constEnd())
1421 const auto &indexes = it.value();
1422 for (QtBrowserItem *idx : indexes)
1423 q_ptr->itemChanged(idx);
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1599
1600
1602 : QWidget(parent), d_ptr(
new QtAbstractPropertyBrowserPrivate)
1604 d_ptr->q_ptr =
this;
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1622 const auto indexes = topLevelItems();
1623 for (QtBrowserItem *item : indexes)
1624 d_ptr->clearIndex(item);
1628
1629
1630
1631
1632
1633
1634
1637 return d_ptr->m_subItems;
1641
1642
1643
1644
1645
1646
1647
1651 return d_ptr->m_propertyToIndexes.value(property);
1655
1656
1657
1658
1659
1660
1661
1665 return d_ptr->m_topLevelPropertyToIndex.value(property);
1669
1670
1671
1672
1676 return d_ptr->m_topLevelIndexes;
1680
1681
1682
1683
1684
1687 const auto subList = properties();
1688 for (
auto rit = subList.crbegin(), rend = subList.crend(); rit != rend; ++rit)
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1707 if (!d_ptr->m_subItems.empty())
1708 afterProperty = d_ptr->m_subItems.last();
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1735 auto pendingList = properties();
1738 while (pos < pendingList.size()) {
1740 if (prop == property)
1742 if (prop == afterProperty) {
1747 d_ptr->createBrowserIndexes(property,
nullptr, afterProperty);
1750 d_ptr->insertSubTree(property,
nullptr);
1752 d_ptr->m_subItems.insert(newPos, property);
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1773 auto pendingList = properties();
1775 while (pos < pendingList.size()) {
1776 if (pendingList.at(pos) == property) {
1777 d_ptr->m_subItems.removeAt(pos);
1778 d_ptr->removeSubTree(property,
1782 d_ptr->removeBrowserIndexes(property,
nullptr);
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1814 QWidget *w =
nullptr;
1815 const auto vit = m_viewToManagerToFactory()->constFind(
this);
1816 if (vit != m_viewToManagerToFactory()->cend()) {
1818 if (fit != vit.value().cend())
1819 w = fit.value()->createEditor(property, parent);
1827 w->setFocusPolicy(Qt::WheelFocus);
1834 bool connectNeeded =
false;
1835 if (!m_managerToFactoryToViews()->contains(abstractManager) ||
1836 !(*m_managerToFactoryToViews())[abstractManager].contains(abstractFactory)) {
1837 connectNeeded =
true;
1838 }
else if ((*m_managerToFactoryToViews())[abstractManager][abstractFactory]
1840 return connectNeeded;
1843 if (m_viewToManagerToFactory()->contains(
this) &&
1844 (*m_viewToManagerToFactory())[
this].contains(abstractManager)) {
1848 (*m_managerToFactoryToViews())[abstractManager][abstractFactory].append(
this);
1849 (*m_viewToManagerToFactory())[
this][abstractManager] = abstractFactory;
1851 return connectNeeded;
1855
1856
1857
1858
1859
1860
1863 if (!m_viewToManagerToFactory()->contains(
this) ||
1864 !(*m_viewToManagerToFactory())[
this].contains(manager)) {
1869 (*m_viewToManagerToFactory())[
this][manager];
1870 (*m_viewToManagerToFactory())[
this].remove(manager);
1871 if ((*m_viewToManagerToFactory())[
this].isEmpty()) {
1872 (*m_viewToManagerToFactory()).remove(
this);
1875 (*m_managerToFactoryToViews())[manager][abstractFactory].removeAll(
this);
1876 if ((*m_managerToFactoryToViews())[manager][abstractFactory].isEmpty()) {
1877 (*m_managerToFactoryToViews())[manager].remove(abstractFactory);
1879 if ((*m_managerToFactoryToViews())[manager].isEmpty()) {
1880 (*m_managerToFactoryToViews()).remove(manager);
1886
1887
1888
1889
1892 return d_ptr->m_currentItem;
1896
1897
1898
1899
1903 d_ptr->m_currentItem = item;
1904 if (oldItem != item)
1905 emit currentItemChanged(item);
1910#include "moc_qtpropertybrowser_p.cpp"
The QtAbstractEditorFactoryBase provides an interface for editor factories.
virtual void breakConnection(QtAbstractPropertyManager *manager)=0
QtAbstractPropertyBrowser provides a base class for implementing property browsers.
QtBrowserItem * currentItem() const
Returns the current item in the property browser.
QList< QtBrowserItem * > items(QtProperty *property) const
Returns the property browser's list of all items associated with the given property.
QList< QtBrowserItem * > topLevelItems() const
Returns the list of top-level items.
QList< QtProperty * > properties() const
Returns the property browser's list of top level properties.
QtBrowserItem * topLevelItem(QtProperty *property) const
Returns the top-level items associated with the given property.
void removeProperty(QtProperty *property)
Removes the specified property (and its subproperties) from the property browser's list of top level ...
void unsetFactoryForManager(QtAbstractPropertyManager *manager)
Removes the association between the given manager and the factory bound to it, automatically calling ...
~QtAbstractPropertyBrowser() override
Destroys the property browser, and destroys all the items that were created by this property browser.
QtBrowserItem * insertProperty(QtProperty *property, QtProperty *afterProperty)
Inserts the given property (and its subproperties) after the specified afterProperty in the browser's...
void setCurrentItem(QtBrowserItem *)
Sets the current item in the property browser to item.
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)
Creates an editing widget (with the given parent) for the given property according to the previously ...
void clear()
Removes all the properties from the editor, but does not delete them since they can still be used in ...
void propertyChanged(QtProperty *property) const
void propertyInserted(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty) const
void propertyRemoved(QtProperty *property, QtProperty *parentProperty) const
QSet< QtProperty * > m_properties
The QtAbstractPropertyManager provides an interface for property managers.
virtual void initializeProperty(QtProperty *property)=0
This function is called whenever a new valid property pointer has been created, passing the pointer a...
~QtAbstractPropertyManager() override
Destroys the manager.
virtual QIcon valueIcon(const QtProperty *property) const
Returns an icon representing the current state of the given property.
QSet< QtProperty * > properties() const
Returns the set of properties created by this manager.
virtual bool hasValue(const QtProperty *property) const
Returns whether the given property has a value.
QtProperty * addProperty(const QString &name=QString())
Creates a property with the given name which then is owned by this manager.
virtual QtProperty * createProperty()
Creates a property.
void clear() const
Destroys all the properties that this manager has created.
virtual QString valueText(const QtProperty *property) const
Returns a string representing the current state of the given property.
virtual void uninitializeProperty(QtProperty *property)
This function is called just before the specified property is destroyed.
QtBrowserItemPrivate(QtAbstractPropertyBrowser *browser, QtProperty *property, QtBrowserItem *parent)
QtAbstractPropertyBrowser *const m_browser
void addChild(QtBrowserItem *index, QtBrowserItem *after)
void removeChild(QtBrowserItem *index)
QList< QtBrowserItem * > m_children
The QtBrowserItem class represents a property in a property browser instance.
QtProperty * property() const
Returns the property which is accosiated with this item.
QtAbstractPropertyBrowser * browser() const
Returns the property browser which owns this item.
QList< QtBrowserItem * > children() const
Returns the children items of this item.
QtBrowserItem * parent() const
Returns the parent item of this item.
QtPropertyPrivate(QtAbstractPropertyManager *manager)
QString m_descriptionToolTip
QtAbstractPropertyManager *const m_manager
QtProperty * m_parentItem
QList< QtProperty * > m_subItems
The QtProperty class encapsulates an instance of a property.
void setModified(bool modified)
Sets the property's modified state according to the passed modified value.
QtProperty * parentProperty() const
void addSubProperty(QtProperty *property)
Appends the given property to this property's subproperties.
QString propertyName() const
Returns the property's name.
bool isEnabled() const
Returns whether the property is enabled.
void setEnabled(bool enable)
Enables or disables the property according to the passed enable value.
bool hasValue() const
Returns whether the property has a value.
void insertSubProperty(QtProperty *property, QtProperty *afterProperty)
Inserts the given property after the specified precedingProperty into this property's list of subprop...
QList< QtProperty * > subProperties() const
Returns the set of subproperties.
QString whatsThis() const
Returns the property's "What's This" help text.
void removeSubProperty(QtProperty *property)
Removes the given property from the list of subproperties without deleting it.
void setValueToolTip(const QString &text)
Sets the property value's tool tip to the given text.
QString statusTip() const
Returns the property's status tip.
QIcon valueIcon() const
Returns an icon representing the current state of this property.
bool isModified() const
Returns whether the property is modified.
virtual ~QtProperty()
Destroys this property.
void setPropertyName(const QString &text)
Sets the property's name to the given name.
void setDescriptionToolTip(const QString &text)
Sets the property description's tool tip to the given text.
QString valueText() const
Returns a string representing the current state of this property.
QString valueToolTip() const
Returns the property value's tool tip.
void setStatusTip(const QString &text)
Sets the property's status tip to the given text.
QtProperty(QtAbstractPropertyManager *manager)
Creates a property with the given manager.
void setWhatsThis(const QString &text)
Sets the property's "What's This" help text to the given text.
QString descriptionToolTip() const
Returns the property description's tool tip.
QtAbstractPropertyManager * propertyManager() const
Returns a pointer to the manager that owns this property.