6#include <QtGui/qicon.h>
8#include <QtCore/qhash.h>
36 Q_DECLARE_PUBLIC(QtAbstractPropertyManager)
49
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
100
101
102
103
104
105
106
107
108
116
117
118
119
120
121
122
123
126 auto *parent = d_ptr->m_parentItem;
128 parent->d_ptr->m_manager->d_ptr->propertyRemoved(
this, parent);
130 d_ptr->m_manager->d_ptr->propertyDestroyed(
this);
132 for (QtProperty *property : std::as_const(d_ptr->m_subItems))
133 property->d_ptr->m_parentItem =
nullptr;
136 parent->d_ptr->m_subItems.removeAll(
this);
140
141
142
143
144
145
146
149 return d_ptr->m_subItems;
154 return d_ptr->m_parentItem;
158
159
162 return d_ptr->m_manager;
166
167
168
171
172
173
174
175
176
177
180 return d_ptr->m_valueToolTip;
184
185
186
187
188
189
190
193 return d_ptr->m_descriptionToolTip;
197
198
199
200
203 return d_ptr->m_statusTip;
207
208
209
210
213 return d_ptr->m_whatsThis;
217
218
219
220
223 return d_ptr->m_name;
227
228
229
230
233 return d_ptr->m_enabled;
237
238
239
240
243 return d_ptr->m_modified;
247
248
249
250
253 return d_ptr->m_manager->hasValue(
this);
257
258
259
260
261
262
263
266 return d_ptr->m_manager->valueIcon(
this);
270
271
272
273
274
275
276
279 return d_ptr->m_manager->valueText(
this);
283
284
285
286
287
290 if (d_ptr->m_valueToolTip == text)
293 d_ptr->m_valueToolTip = text;
298
299
300
301
302
305 if (d_ptr->m_descriptionToolTip == text)
308 d_ptr->m_descriptionToolTip = text;
313
314
315
316
319 if (d_ptr->m_statusTip == text)
322 d_ptr->m_statusTip = text;
327
328
329
330
333 if (d_ptr->m_whatsThis == text)
336 d_ptr->m_whatsThis = text;
341
342
343
344
345
346
349 if (d_ptr->m_name == text)
352 d_ptr->m_name = text;
357
358
359
360
363 if (d_ptr->m_enabled == enable)
366 d_ptr->m_enabled = enable;
371
372
373
374
377 if (d_ptr->m_modified == modified)
380 d_ptr->m_modified = modified;
385
386
387
388
389
390
391
395 if (!d_ptr->m_subItems.empty())
396 after = d_ptr->m_subItems.last();
401
402
403
404
405
406
407
408
409
410
411
412
419 if (property ==
this)
423 auto pendingList = property->subProperties();
424 QHash<QtProperty *,
bool> visited;
425 while (!pendingList.isEmpty()) {
429 pendingList.removeFirst();
430 if (visited.contains(i))
433 pendingList += i->subProperties();
436 pendingList = subProperties();
440 while (pos < pendingList.size()) {
444 if (i == afterProperty) {
446 properAfterProperty = afterProperty;
451 d_ptr->m_subItems.insert(newPos, property);
452 Q_ASSERT(property->d_ptr->m_parentItem ==
nullptr);
453 property->d_ptr->m_parentItem =
this;
455 d_ptr->m_manager->d_ptr->propertyInserted(property,
this, properAfterProperty);
459
460
461
462
463
469 d_ptr->m_manager->d_ptr->propertyRemoved(property,
this);
471 auto pendingList = subProperties();
473 while (pos < pendingList.size()) {
474 if (pendingList.at(pos) == property) {
475 d_ptr->m_subItems.removeAt(pos);
477 property->d_ptr->m_parentItem =
nullptr;
485
486
489 d_ptr->m_manager->d_ptr->propertyChanged(
this);
496 const auto it = m_properties.constFind(property);
497 if (it != m_properties.cend()) {
498 emit q_ptr->propertyDestroyed(property);
499 q_ptr->uninitializeProperty(property);
500 m_properties.erase(it);
506 emit q_ptr->propertyChanged(property);
512 emit q_ptr->propertyRemoved(property, parentProperty);
518 emit q_ptr->propertyInserted(property, parentProperty, afterProperty);
522
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
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
593
594
595
596
597
598
599
600
601
602
605
606
607
608
609
610
611
612
613
614
615
618
619
620
621
622
623
624
625
626
627
630
631
632
633
634
635
638
639
641 : QObject(parent), d_ptr(
new QtAbstractPropertyManagerPrivate)
648
649
650
657
658
659
660
663 while (!d_ptr->m_properties.isEmpty())
664 delete *d_ptr->m_properties.cbegin();
668
669
670
671
674 return d_ptr->m_properties;
678
679
680
681
682
683
691
692
693
694
695
696
697
698
706
707
708
709
710
711
712
713
721
722
723
724
725
726
727
732 property->setPropertyName(name);
733 d_ptr->m_properties.insert(property);
740
741
742
743
744
745
746
747
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
773
774
775
776
777
778
779
780
789
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
833
834
835
836
837
838
839
840
841
842
843
844
847
848
849
850
853
854
855
856
857
858
859
860
861
864
865
866
867
868
869
870
871
872
875
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
942
943
944
945
946
947
950
951
952
953
954
957
958
959
960
961
962
963
964
965
966
967
970
971
972
973
974
975
976
977
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1029
1030
1031
1032
1033
1034
1035
1036
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1052
1053
1054
1055
1079 if (m_children.contains(index))
1081 qsizetype idx = m_children.indexOf(after) + 1;
1082 m_children.insert(idx, index);
1087 m_children.removeAll(index);
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1115
1116
1117
1118
1119
1120
1124 return d_ptr->m_property;
1128
1129
1130
1131
1132
1136 return d_ptr->m_parent;
1140
1141
1142
1143
1144
1145
1146
1147
1151 return d_ptr->m_children;
1155
1156
1160 return d_ptr->m_browser;
1164 : d_ptr(
new QtBrowserItemPrivate(browser, property, parent))
1166 d_ptr->q_ptr =
this;
1173using Map1 = QHash<QtAbstractPropertyBrowser *,
1174 QHash<QtAbstractPropertyManager *, QtAbstractEditorFactoryBase *>>;
1175using Map2 = QHash<QtAbstractPropertyManager *,
1176 QHash<QtAbstractEditorFactoryBase *, QList<QtAbstractPropertyBrowser *>>>;
1178Q_GLOBAL_STATIC(Map1, m_viewToManagerToFactory)
1179Q_GLOBAL_STATIC(Map2, m_managerToFactoryToViews)
1181class QtAbstractPropertyBrowserPrivate
1183 QtAbstractPropertyBrowser *q_ptr;
1184 Q_DECLARE_PUBLIC(QtAbstractPropertyBrowser)
1186 void insertSubTree(QtProperty *property,
1187 QtProperty *parentProperty);
1188 void removeSubTree(QtProperty *property,
1189 QtProperty *parentProperty);
1190 void createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty);
1191 void removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty);
1192 QtBrowserItem *createBrowserIndex(QtProperty *property, QtBrowserItem *parentIndex, QtBrowserItem *afterIndex);
1193 void removeBrowserIndex(QtBrowserItem *index);
1194 void clearIndex(QtBrowserItem *index);
1196 void slotPropertyInserted(QtProperty *property,
1197 QtProperty *parentProperty, QtProperty *afterProperty);
1198 void slotPropertyRemoved(QtProperty *property, QtProperty *parentProperty);
1199 void slotPropertyDestroyed(QtProperty *property);
1200 void slotPropertyDataChanged(QtProperty *property);
1202 QList<QtProperty *> m_subItems;
1203 QHash<QtAbstractPropertyManager *, QList<QtProperty *> > m_managerToProperties;
1204 QHash<QtProperty *, QList<QtProperty *> > m_propertyToParents;
1206 QHash<QtProperty *, QtBrowserItem *> m_topLevelPropertyToIndex;
1207 QList<QtBrowserItem *> m_topLevelIndexes;
1208 QHash<QtProperty *, QList<QtBrowserItem *> > m_propertyToIndexes;
1210 QtBrowserItem *m_currentItem =
nullptr;
1213void QtAbstractPropertyBrowserPrivate::insertSubTree(QtProperty *property,
1214 QtProperty *parentProperty)
1216 const auto it = m_propertyToParents.find(property);
1217 if (it != m_propertyToParents.end()) {
1221 it.value().append(parentProperty);
1226 QtAbstractPropertyManager *manager = property->propertyManager();
1227 if (m_managerToProperties[manager].isEmpty()) {
1229 QObject::connect(manager, &QtAbstractPropertyManager::propertyInserted,
1230 q_ptr, [
this](QtProperty *property, QtProperty *parent, QtProperty *after) {
1231 slotPropertyInserted(property, parent, after);
1233 QObject::connect(manager, &QtAbstractPropertyManager::propertyRemoved,
1234 q_ptr, [
this](QtProperty *property, QtProperty *parent) {
1235 slotPropertyRemoved(property, parent);
1237 QObject::connect(manager, &QtAbstractPropertyManager::propertyDestroyed,
1238 q_ptr, [
this](QtProperty *property) { slotPropertyDestroyed(property); });
1239 QObject::connect(manager, &QtAbstractPropertyManager::propertyChanged,
1240 q_ptr, [
this](QtProperty *property) { slotPropertyDataChanged(property); });
1242 m_managerToProperties[manager].append(property);
1243 m_propertyToParents[property].append(parentProperty);
1245 const auto subList = property->subProperties();
1246 for (QtProperty *subProperty : subList)
1247 insertSubTree(subProperty, property);
1250void QtAbstractPropertyBrowserPrivate::removeSubTree(QtProperty *property,
1251 QtProperty *parentProperty)
1253 const auto pit = m_propertyToParents.find(property);
1254 if (pit == m_propertyToParents.end())
1256 pit.value().removeAll(parentProperty);
1257 if (!pit.value().isEmpty())
1260 m_propertyToParents.erase(pit);
1261 QtAbstractPropertyManager *manager = property->propertyManager();
1263 const auto mit = m_managerToProperties.find(manager);
1264 Q_ASSERT(mit != m_managerToProperties.end());
1265 mit.value().removeAll(property);
1266 if (mit.value().isEmpty()) {
1268 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyInserted,
1270 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyRemoved,
1272 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyDestroyed, q_ptr,
nullptr);
1273 QObject::disconnect(manager, &QtAbstractPropertyManager::propertyChanged,
1276 m_managerToProperties.erase(mit);
1279 const auto subList = property->subProperties();
1280 for (QtProperty *subProperty : subList)
1281 removeSubTree(subProperty, property);
1284void QtAbstractPropertyBrowserPrivate::createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty)
1286 QHash<QtBrowserItem *, QtBrowserItem *> parentToAfter;
1287 if (afterProperty) {
1288 const auto it = m_propertyToIndexes.constFind(afterProperty);
1289 if (it == m_propertyToIndexes.constEnd())
1292 for (QtBrowserItem *idx : it.value()) {
1293 QtBrowserItem *parentIdx = idx->parent();
1294 if ((parentProperty && parentIdx && parentIdx->property() == parentProperty) || (!parentProperty && !parentIdx))
1295 parentToAfter[idx->parent()] = idx;
1297 }
else if (parentProperty) {
1298 const auto it = m_propertyToIndexes.find(parentProperty);
1299 if (it == m_propertyToIndexes.constEnd())
1302 for (QtBrowserItem *idx : std::as_const(it.value()))
1303 parentToAfter[idx] =
nullptr;
1305 parentToAfter[
nullptr] =
nullptr;
1308 for (
auto it = parentToAfter.cbegin(), pcend = parentToAfter.cend(); it != pcend; ++it)
1309 createBrowserIndex(property, it.key(), it.value());
1312QtBrowserItem *QtAbstractPropertyBrowserPrivate::createBrowserIndex(QtProperty *property,
1313 QtBrowserItem *parentIndex, QtBrowserItem *afterIndex)
1315 auto *newIndex =
new QtBrowserItem(q_ptr, property, parentIndex);
1317 parentIndex->d_ptr->addChild(newIndex, afterIndex);
1319 m_topLevelPropertyToIndex[property] = newIndex;
1320 m_topLevelIndexes.insert(m_topLevelIndexes.indexOf(afterIndex) + 1, newIndex);
1322 m_propertyToIndexes[property].append(newIndex);
1324 q_ptr->itemInserted(newIndex, afterIndex);
1326 const auto subItems = property->subProperties();
1327 QtBrowserItem *afterChild =
nullptr;
1328 for (QtProperty *child : subItems)
1329 afterChild = createBrowserIndex(child, newIndex, afterChild);
1333void QtAbstractPropertyBrowserPrivate::removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty)
1335 QList<QtBrowserItem *> toRemove;
1336 const auto it = m_propertyToIndexes.constFind(property);
1337 if (it == m_propertyToIndexes.constEnd())
1340 for (QtBrowserItem *idx : it.value()) {
1341 QtBrowserItem *parentIdx = idx->parent();
1342 if ((parentProperty && parentIdx && parentIdx->property() == parentProperty) || (!parentProperty && !parentIdx))
1343 toRemove.append(idx);
1346 for (QtBrowserItem *index : std::as_const(toRemove))
1347 removeBrowserIndex(index);
1350void QtAbstractPropertyBrowserPrivate::removeBrowserIndex(QtBrowserItem *index)
1352 const auto children = index->children();
1353 for (qsizetype i = children.size(); i > 0; i--) {
1354 removeBrowserIndex(children.at(i - 1));
1357 q_ptr->itemRemoved(index);
1359 if (index->parent()) {
1360 index->parent()->d_ptr->removeChild(index);
1362 m_topLevelPropertyToIndex.remove(index->property());
1363 m_topLevelIndexes.removeAll(index);
1366 QtProperty *property = index->property();
1368 m_propertyToIndexes[property].removeAll(index);
1369 if (m_propertyToIndexes[property].isEmpty())
1370 m_propertyToIndexes.remove(property);
1375void QtAbstractPropertyBrowserPrivate::clearIndex(QtBrowserItem *index)
1377 const auto children = index->children();
1378 for (QtBrowserItem *item : children)
1383void QtAbstractPropertyBrowserPrivate::slotPropertyInserted(QtProperty *property,
1384 QtProperty *parentProperty, QtProperty *afterProperty)
1386 if (!m_propertyToParents.contains(parentProperty))
1388 createBrowserIndexes(property, parentProperty, afterProperty);
1389 insertSubTree(property, parentProperty);
1393void QtAbstractPropertyBrowserPrivate::slotPropertyRemoved(QtProperty *property,
1394 QtProperty *parentProperty)
1396 if (!m_propertyToParents.contains(parentProperty))
1398 removeSubTree(property, parentProperty);
1400 removeBrowserIndexes(property, parentProperty);
1403void QtAbstractPropertyBrowserPrivate::slotPropertyDestroyed(QtProperty *property)
1405 if (!m_subItems.contains(property))
1407 q_ptr->removeProperty(property);
1410void QtAbstractPropertyBrowserPrivate::slotPropertyDataChanged(QtProperty *property)
1412 if (!m_propertyToParents.contains(property))
1415 const auto it = m_propertyToIndexes.constFind(property);
1416 if (it == m_propertyToIndexes.constEnd())
1419 const auto &indexes = it.value();
1420 for (QtBrowserItem *idx : indexes)
1421 q_ptr->itemChanged(idx);
1426
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
1512
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
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1597
1598
1600 : QWidget(parent), d_ptr(
new QtAbstractPropertyBrowserPrivate)
1602 d_ptr->q_ptr =
this;
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1620 const auto indexes = topLevelItems();
1621 for (QtBrowserItem *item : indexes)
1622 d_ptr->clearIndex(item);
1626
1627
1628
1629
1630
1631
1632
1635 return d_ptr->m_subItems;
1639
1640
1641
1642
1643
1644
1645
1649 return d_ptr->m_propertyToIndexes.value(property);
1653
1654
1655
1656
1657
1658
1659
1663 return d_ptr->m_topLevelPropertyToIndex.value(property);
1667
1668
1669
1670
1674 return d_ptr->m_topLevelIndexes;
1678
1679
1680
1681
1682
1685 const auto subList = properties();
1686 for (
auto rit = subList.crbegin(), rend = subList.crend(); rit != rend; ++rit)
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1705 if (!d_ptr->m_subItems.empty())
1706 afterProperty = d_ptr->m_subItems.last();
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1733 auto pendingList = properties();
1736 while (pos < pendingList.size()) {
1738 if (prop == property)
1740 if (prop == afterProperty) {
1745 d_ptr->createBrowserIndexes(property,
nullptr, afterProperty);
1748 d_ptr->insertSubTree(property,
nullptr);
1750 d_ptr->m_subItems.insert(newPos, property);
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1771 auto pendingList = properties();
1773 while (pos < pendingList.size()) {
1774 if (pendingList.at(pos) == property) {
1775 d_ptr->m_subItems.removeAt(pos);
1776 d_ptr->removeSubTree(property,
1780 d_ptr->removeBrowserIndexes(property,
nullptr);
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1812 QWidget *w =
nullptr;
1813 const auto vit = m_viewToManagerToFactory()->constFind(
this);
1814 if (vit != m_viewToManagerToFactory()->cend()) {
1816 if (fit != vit.value().cend())
1817 w = fit.value()->createEditor(property, parent);
1825 w->setFocusPolicy(Qt::WheelFocus);
1832 bool connectNeeded =
false;
1833 if (!m_managerToFactoryToViews()->contains(abstractManager) ||
1834 !(*m_managerToFactoryToViews())[abstractManager].contains(abstractFactory)) {
1835 connectNeeded =
true;
1836 }
else if ((*m_managerToFactoryToViews())[abstractManager][abstractFactory]
1838 return connectNeeded;
1841 if (m_viewToManagerToFactory()->contains(
this) &&
1842 (*m_viewToManagerToFactory())[
this].contains(abstractManager)) {
1846 (*m_managerToFactoryToViews())[abstractManager][abstractFactory].append(
this);
1847 (*m_viewToManagerToFactory())[
this][abstractManager] = abstractFactory;
1849 return connectNeeded;
1853
1854
1855
1856
1857
1858
1861 if (!m_viewToManagerToFactory()->contains(
this) ||
1862 !(*m_viewToManagerToFactory())[
this].contains(manager)) {
1867 (*m_viewToManagerToFactory())[
this][manager];
1868 (*m_viewToManagerToFactory())[
this].remove(manager);
1869 if ((*m_viewToManagerToFactory())[
this].isEmpty()) {
1870 (*m_viewToManagerToFactory()).remove(
this);
1873 (*m_managerToFactoryToViews())[manager][abstractFactory].removeAll(
this);
1874 if ((*m_managerToFactoryToViews())[manager][abstractFactory].isEmpty()) {
1875 (*m_managerToFactoryToViews())[manager].remove(abstractFactory);
1877 if ((*m_managerToFactoryToViews())[manager].isEmpty()) {
1878 (*m_managerToFactoryToViews()).remove(manager);
1884
1885
1886
1887
1890 return d_ptr->m_currentItem;
1894
1895
1896
1897
1901 d_ptr->m_currentItem = item;
1902 if (oldItem != item)
1903 emit currentItemChanged(item);
1908#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.