7#include <QtGui/qicon.h>
9#include <QtCore/qhash.h>
37 Q_DECLARE_PUBLIC(QtAbstractPropertyManager)
50
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
101
102
103
104
105
106
107
108
109
117
118
119
120
121
122
123
124
127 auto *parent = d_ptr->m_parentItem;
129 parent->d_ptr->m_manager->d_ptr->propertyRemoved(
this, parent);
131 d_ptr->m_manager->d_ptr->propertyDestroyed(
this);
133 for (QtProperty *property : std::as_const(d_ptr->m_subItems))
134 property->d_ptr->m_parentItem =
nullptr;
137 parent->d_ptr->m_subItems.removeAll(
this);
141
142
143
144
145
146
147
150 return d_ptr->m_subItems;
155 return d_ptr->m_parentItem;
159
160
163 return d_ptr->m_manager;
167
168
169
172
173
174
175
176
177
178
181 return d_ptr->m_valueToolTip;
185
186
187
188
189
190
191
194 return d_ptr->m_descriptionToolTip;
198
199
200
201
204 return d_ptr->m_statusTip;
208
209
210
211
214 return d_ptr->m_whatsThis;
218
219
220
221
224 return d_ptr->m_name;
228
229
230
231
234 return d_ptr->m_enabled;
238
239
240
241
244 return d_ptr->m_modified;
248
249
250
251
254 return d_ptr->m_manager->hasValue(
this);
258
259
260
261
262
263
264
267 return d_ptr->m_manager->valueIcon(
this);
271
272
273
274
275
276
277
280 return d_ptr->m_manager->valueText(
this);
284
285
286
287
288
291 if (d_ptr->m_valueToolTip == text)
294 d_ptr->m_valueToolTip = text;
299
300
301
302
303
306 if (d_ptr->m_descriptionToolTip == text)
309 d_ptr->m_descriptionToolTip = text;
314
315
316
317
320 if (d_ptr->m_statusTip == text)
323 d_ptr->m_statusTip = text;
328
329
330
331
334 if (d_ptr->m_whatsThis == text)
337 d_ptr->m_whatsThis = text;
342
343
344
345
346
347
350 if (d_ptr->m_name == text)
353 d_ptr->m_name = text;
358
359
360
361
364 if (d_ptr->m_enabled == enable)
367 d_ptr->m_enabled = enable;
372
373
374
375
378 if (d_ptr->m_modified == modified)
381 d_ptr->m_modified = modified;
386
387
388
389
390
391
392
396 if (!d_ptr->m_subItems.empty())
397 after = d_ptr->m_subItems.last();
402
403
404
405
406
407
408
409
410
411
412
413
420 if (property ==
this)
424 auto pendingList = property->subProperties();
425 QHash<QtProperty *,
bool> visited;
426 while (!pendingList.isEmpty()) {
430 pendingList.removeFirst();
431 if (visited.contains(i))
434 pendingList += i->subProperties();
437 pendingList = subProperties();
441 while (pos < pendingList.size()) {
445 if (i == afterProperty) {
447 properAfterProperty = afterProperty;
452 d_ptr->m_subItems.insert(newPos, property);
453 Q_ASSERT(property->d_ptr->m_parentItem ==
nullptr);
454 property->d_ptr->m_parentItem =
this;
456 d_ptr->m_manager->d_ptr->propertyInserted(property,
this, properAfterProperty);
460
461
462
463
464
470 d_ptr->m_manager->d_ptr->propertyRemoved(property,
this);
472 auto pendingList = subProperties();
474 while (pos < pendingList.size()) {
475 if (pendingList.at(pos) == property) {
476 d_ptr->m_subItems.removeAt(pos);
478 property->d_ptr->m_parentItem =
nullptr;
486
487
490 d_ptr->m_manager->d_ptr->propertyChanged(
this);
497 const auto it = m_properties.constFind(property);
498 if (it != m_properties.cend()) {
499 emit q_ptr->propertyDestroyed(property);
500 q_ptr->uninitializeProperty(property);
501 m_properties.erase(it);
507 emit q_ptr->propertyChanged(property);
513 emit q_ptr->propertyRemoved(property, parentProperty);
519 emit q_ptr->propertyInserted(property, parentProperty, afterProperty);
523
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
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
594
595
596
597
598
599
600
601
602
603
606
607
608
609
610
611
612
613
614
615
616
619
620
621
622
623
624
625
626
627
628
631
632
633
634
635
636
639
640
642 : QObject(parent), d_ptr(
new QtAbstractPropertyManagerPrivate)
649
650
651
658
659
660
661
664 while (!d_ptr->m_properties.isEmpty())
665 delete *d_ptr->m_properties.cbegin();
669
670
671
672
675 return d_ptr->m_properties;
679
680
681
682
683
684
692
693
694
695
696
697
698
699
707
708
709
710
711
712
713
714
722
723
724
725
726
727
728
733 property->setPropertyName(name);
734 d_ptr->m_properties.insert(property);
741
742
743
744
745
746
747
748
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
774
775
776
777
778
779
780
781
790
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
834
835
836
837
838
839
840
841
842
843
844
845
848
849
850
851
854
855
856
857
858
859
860
861
862
865
866
867
868
869
870
871
872
873
876
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
943
944
945
946
947
948
951
952
953
954
955
958
959
960
961
962
963
964
965
966
967
968
971
972
973
974
975
976
977
978
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1030
1031
1032
1033
1034
1035
1036
1037
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1053
1054
1055
1056
1080 if (m_children.contains(index))
1082 qsizetype idx = m_children.indexOf(after) + 1;
1083 m_children.insert(idx, index);
1088 m_children.removeAll(index);
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1116
1117
1118
1119
1120
1121
1125 return d_ptr->m_property;
1129
1130
1131
1132
1133
1137 return d_ptr->m_parent;
1141
1142
1143
1144
1145
1146
1147
1148
1152 return d_ptr->m_children;
1156
1157
1161 return d_ptr->m_browser;
1165 : d_ptr(
new QtBrowserItemPrivate(browser, property, parent))
1167 d_ptr->q_ptr =
this;
1174using Map1 = QHash<QtAbstractPropertyBrowser *,
1175 QHash<QtAbstractPropertyManager *, QtAbstractEditorFactoryBase *>>;
1176using Map2 = QHash<QtAbstractPropertyManager *,
1177 QHash<QtAbstractEditorFactoryBase *, QList<QtAbstractPropertyBrowser *>>>;
1179Q_GLOBAL_STATIC(Map1, m_viewToManagerToFactory)
1180Q_GLOBAL_STATIC(Map2, m_managerToFactoryToViews)
1182class QtAbstractPropertyBrowserPrivate
1184 QtAbstractPropertyBrowser *q_ptr;
1185 Q_DECLARE_PUBLIC(QtAbstractPropertyBrowser)
1187 void insertSubTree(QtProperty *property,
1188 QtProperty *parentProperty);
1189 void removeSubTree(QtProperty *property,
1190 QtProperty *parentProperty);
1191 void createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty);
1192 void removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty);
1193 QtBrowserItem *createBrowserIndex(QtProperty *property, QtBrowserItem *parentIndex, QtBrowserItem *afterIndex);
1194 void removeBrowserIndex(QtBrowserItem *index);
1195 void clearIndex(QtBrowserItem *index);
1197 void slotPropertyInserted(QtProperty *property,
1198 QtProperty *parentProperty, QtProperty *afterProperty);
1199 void slotPropertyRemoved(QtProperty *property, QtProperty *parentProperty);
1200 void slotPropertyDestroyed(QtProperty *property);
1201 void slotPropertyDataChanged(QtProperty *property);
1203 QList<QtProperty *> m_subItems;
1204 QHash<QtAbstractPropertyManager *, QList<QtProperty *> > m_managerToProperties;
1205 QHash<QtProperty *, QList<QtProperty *> > m_propertyToParents;
1207 QHash<QtProperty *, QtBrowserItem *> m_topLevelPropertyToIndex;
1208 QList<QtBrowserItem *> m_topLevelIndexes;
1209 QHash<QtProperty *, QList<QtBrowserItem *> > m_propertyToIndexes;
1211 QtBrowserItem *m_currentItem =
nullptr;
1214void QtAbstractPropertyBrowserPrivate::insertSubTree(QtProperty *property,
1215 QtProperty *parentProperty)
1217 const auto it = m_propertyToParents.find(property);
1218 if (it != m_propertyToParents.end()) {
1222 it.value().append(parentProperty);
1227 QtAbstractPropertyManager *manager = property->propertyManager();
1228 if (m_managerToProperties[manager].isEmpty()) {
1230 QObject::connect(manager, &QtAbstractPropertyManager::propertyInserted,
1231 q_ptr, [
this](QtProperty *property, QtProperty *parent, QtProperty *after) {
1232 slotPropertyInserted(property, parent, after);
1234 QObject::connect(manager, &QtAbstractPropertyManager::propertyRemoved,
1235 q_ptr, [
this](QtProperty *property, QtProperty *parent) {
1236 slotPropertyRemoved(property, parent);
1238 QObject::connect(manager, &QtAbstractPropertyManager::propertyDestroyed,
1239 q_ptr, [
this](QtProperty *property) { slotPropertyDestroyed(property); });
1240 QObject::connect(manager, &QtAbstractPropertyManager::propertyChanged,
1241 q_ptr, [
this](QtProperty *property) { slotPropertyDataChanged(property); });
1243 m_managerToProperties[manager].append(property);
1244 m_propertyToParents[property].append(parentProperty);
1246 const auto subList = property->subProperties();
1247 for (QtProperty *subProperty : subList)
1248 insertSubTree(subProperty, property);
1251void QtAbstractPropertyBrowserPrivate::removeSubTree(QtProperty *property,
1252 QtProperty *parentProperty)
1254 const auto pit = m_propertyToParents.find(property);
1255 if (pit == m_propertyToParents.end())
1257 pit.value().removeAll(parentProperty);
1258 if (!pit.value().isEmpty())
1261 m_propertyToParents.erase(pit);
1262 QtAbstractPropertyManager *manager = property->propertyManager();
1264 const auto mit = m_managerToProperties.find(manager);
1265 Q_ASSERT(mit != m_managerToProperties.end());
1266 mit.value().removeAll(property);
1267 if (mit.value().isEmpty()) {
1269 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyInserted,
1271 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyRemoved,
1273 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyDestroyed, q_ptr,
nullptr);
1274 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyChanged,
1277 m_managerToProperties.erase(mit);
1280 const auto subList = property->subProperties();
1281 for (QtProperty *subProperty : subList)
1282 removeSubTree(subProperty, property);
1285void QtAbstractPropertyBrowserPrivate::createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty)
1287 QHash<QtBrowserItem *, QtBrowserItem *> parentToAfter;
1288 if (afterProperty) {
1289 const auto it = m_propertyToIndexes.constFind(afterProperty);
1290 if (it == m_propertyToIndexes.constEnd())
1293 for (QtBrowserItem *idx : it.value()) {
1294 QtBrowserItem *parentIdx = idx->parent();
1295 if ((parentProperty && parentIdx && parentIdx->property() == parentProperty) || (!parentProperty && !parentIdx))
1296 parentToAfter[idx->parent()] = idx;
1298 }
else if (parentProperty) {
1299 const auto it = m_propertyToIndexes.find(parentProperty);
1300 if (it == m_propertyToIndexes.constEnd())
1303 for (QtBrowserItem *idx : std::as_const(it.value()))
1304 parentToAfter[idx] =
nullptr;
1306 parentToAfter[
nullptr] =
nullptr;
1309 for (
auto it = parentToAfter.cbegin(), pcend = parentToAfter.cend(); it != pcend; ++it)
1310 createBrowserIndex(property, it.key(), it.value());
1313QtBrowserItem *QtAbstractPropertyBrowserPrivate::createBrowserIndex(QtProperty *property,
1314 QtBrowserItem *parentIndex, QtBrowserItem *afterIndex)
1316 auto *newIndex =
new QtBrowserItem(q_ptr, property, parentIndex);
1318 parentIndex->d_ptr->addChild(newIndex, afterIndex);
1320 m_topLevelPropertyToIndex[property] = newIndex;
1321 m_topLevelIndexes.insert(m_topLevelIndexes.indexOf(afterIndex) + 1, newIndex);
1323 m_propertyToIndexes[property].append(newIndex);
1325 q_ptr->itemInserted(newIndex, afterIndex);
1327 const auto subItems = property->subProperties();
1328 QtBrowserItem *afterChild =
nullptr;
1329 for (QtProperty *child : subItems)
1330 afterChild = createBrowserIndex(child, newIndex, afterChild);
1334void QtAbstractPropertyBrowserPrivate::removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty)
1336 QList<QtBrowserItem *> toRemove;
1337 const auto it = m_propertyToIndexes.constFind(property);
1338 if (it == m_propertyToIndexes.constEnd())
1341 for (QtBrowserItem *idx : it.value()) {
1342 QtBrowserItem *parentIdx = idx->parent();
1343 if ((parentProperty && parentIdx && parentIdx->property() == parentProperty) || (!parentProperty && !parentIdx))
1344 toRemove.append(idx);
1347 for (QtBrowserItem *index : std::as_const(toRemove))
1348 removeBrowserIndex(index);
1351void QtAbstractPropertyBrowserPrivate::removeBrowserIndex(QtBrowserItem *index)
1353 const auto children = index->children();
1354 for (qsizetype i = children.size(); i > 0; i--) {
1355 removeBrowserIndex(children.at(i - 1));
1358 q_ptr->itemRemoved(index);
1360 if (index->parent()) {
1361 index->parent()->d_ptr->removeChild(index);
1363 m_topLevelPropertyToIndex.remove(index->property());
1364 m_topLevelIndexes.removeAll(index);
1367 QtProperty *property = index->property();
1369 m_propertyToIndexes[property].removeAll(index);
1370 if (m_propertyToIndexes[property].isEmpty())
1371 m_propertyToIndexes.remove(property);
1376void QtAbstractPropertyBrowserPrivate::clearIndex(QtBrowserItem *index)
1378 const auto children = index->children();
1379 for (QtBrowserItem *item : children)
1384void QtAbstractPropertyBrowserPrivate::slotPropertyInserted(QtProperty *property,
1385 QtProperty *parentProperty, QtProperty *afterProperty)
1387 if (!m_propertyToParents.contains(parentProperty))
1389 createBrowserIndexes(property, parentProperty, afterProperty);
1390 insertSubTree(property, parentProperty);
1394void QtAbstractPropertyBrowserPrivate::slotPropertyRemoved(QtProperty *property,
1395 QtProperty *parentProperty)
1397 if (!m_propertyToParents.contains(parentProperty))
1399 removeSubTree(property, parentProperty);
1401 removeBrowserIndexes(property, parentProperty);
1404void QtAbstractPropertyBrowserPrivate::slotPropertyDestroyed(QtProperty *property)
1406 if (!m_subItems.contains(property))
1408 q_ptr->removeProperty(property);
1411void QtAbstractPropertyBrowserPrivate::slotPropertyDataChanged(QtProperty *property)
1413 if (!m_propertyToParents.contains(property))
1416 const auto it = m_propertyToIndexes.constFind(property);
1417 if (it == m_propertyToIndexes.constEnd())
1420 const auto &indexes = it.value();
1421 for (QtBrowserItem *idx : indexes)
1422 q_ptr->itemChanged(idx);
1427
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
1513
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
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1598
1599
1601 : QWidget(parent), d_ptr(
new QtAbstractPropertyBrowserPrivate)
1603 d_ptr->q_ptr =
this;
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1621 const auto indexes = topLevelItems();
1622 for (QtBrowserItem *item : indexes)
1623 d_ptr->clearIndex(item);
1627
1628
1629
1630
1631
1632
1633
1636 return d_ptr->m_subItems;
1640
1641
1642
1643
1644
1645
1646
1650 return d_ptr->m_propertyToIndexes.value(property);
1654
1655
1656
1657
1658
1659
1660
1664 return d_ptr->m_topLevelPropertyToIndex.value(property);
1668
1669
1670
1671
1675 return d_ptr->m_topLevelIndexes;
1679
1680
1681
1682
1683
1686 const auto subList = properties();
1687 for (
auto rit = subList.crbegin(), rend = subList.crend(); rit != rend; ++rit)
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1706 if (!d_ptr->m_subItems.empty())
1707 afterProperty = d_ptr->m_subItems.last();
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1734 auto pendingList = properties();
1737 while (pos < pendingList.size()) {
1739 if (prop == property)
1741 if (prop == afterProperty) {
1746 d_ptr->createBrowserIndexes(property,
nullptr, afterProperty);
1749 d_ptr->insertSubTree(property,
nullptr);
1751 d_ptr->m_subItems.insert(newPos, property);
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1772 auto pendingList = properties();
1774 while (pos < pendingList.size()) {
1775 if (pendingList.at(pos) == property) {
1776 d_ptr->m_subItems.removeAt(pos);
1777 d_ptr->removeSubTree(property,
1781 d_ptr->removeBrowserIndexes(property,
nullptr);
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1813 QWidget *w =
nullptr;
1814 const auto vit = m_viewToManagerToFactory()->constFind(
this);
1815 if (vit != m_viewToManagerToFactory()->cend()) {
1817 if (fit != vit.value().cend())
1818 w = fit.value()->createEditor(property, parent);
1826 w->setFocusPolicy(Qt::WheelFocus);
1833 bool connectNeeded =
false;
1834 if (!m_managerToFactoryToViews()->contains(abstractManager) ||
1835 !(*m_managerToFactoryToViews())[abstractManager].contains(abstractFactory)) {
1836 connectNeeded =
true;
1837 }
else if ((*m_managerToFactoryToViews())[abstractManager][abstractFactory]
1839 return connectNeeded;
1842 if (m_viewToManagerToFactory()->contains(
this) &&
1843 (*m_viewToManagerToFactory())[
this].contains(abstractManager)) {
1847 (*m_managerToFactoryToViews())[abstractManager][abstractFactory].append(
this);
1848 (*m_viewToManagerToFactory())[
this][abstractManager] = abstractFactory;
1850 return connectNeeded;
1854
1855
1856
1857
1858
1859
1862 if (!m_viewToManagerToFactory()->contains(
this) ||
1863 !(*m_viewToManagerToFactory())[
this].contains(manager)) {
1868 (*m_viewToManagerToFactory())[
this][manager];
1869 (*m_viewToManagerToFactory())[
this].remove(manager);
1870 if ((*m_viewToManagerToFactory())[
this].isEmpty()) {
1871 (*m_viewToManagerToFactory()).remove(
this);
1874 (*m_managerToFactoryToViews())[manager][abstractFactory].removeAll(
this);
1875 if ((*m_managerToFactoryToViews())[manager][abstractFactory].isEmpty()) {
1876 (*m_managerToFactoryToViews())[manager].remove(abstractFactory);
1878 if ((*m_managerToFactoryToViews())[manager].isEmpty()) {
1879 (*m_managerToFactoryToViews()).remove(manager);
1885
1886
1887
1888
1891 return d_ptr->m_currentItem;
1895
1896
1897
1898
1902 d_ptr->m_currentItem = item;
1903 if (oldItem != item)
1904 emit currentItemChanged(item);
1909#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.
Combined button and popup list for selecting options.