7#include <QtCore/QDateTime>
9#include <QtCore/QLocale>
11#include <QtCore/QMetaEnum>
12#include <QtCore/QRegularExpression>
13#include <QtCore/QTimer>
14#include <QtGui/QFontDatabase>
16#include <QtGui/QPainter>
17#include <QtWidgets/QApplication>
18#include <QtWidgets/QLabel>
19#include <QtWidgets/QStyle>
20#include <QtWidgets/QStyleOption>
30# pragma warning(disable: 4786
)
35using DisambiguatedTranslation = std::pair<
const char *,
const char *>;
38 QFont::Thin, QFont::ExtraLight, QFont::Light, QFont::Normal, QFont::Medium, QFont::DemiBold,
39 QFont::Bold, QFont::ExtraBold, QFont::Black
44 auto it =
std::find(
std::begin(weightValues),
std::end(weightValues), w);
45 return int(it -
std::begin(weightValues));
50 return weightValues[i];
53template <
class PrivateData,
class Value>
56 data->minVal = minVal;
57 if (data->maxVal < data->minVal)
58 data->maxVal = data->minVal;
60 if (data->val < data->minVal)
61 data->val = data->minVal;
64template <
class PrivateData,
class Value>
67 data->maxVal = maxVal;
68 if (data->minVal > data->maxVal)
69 data->minVal = data->maxVal;
71 if (data->val > data->maxVal)
72 data->val = data->maxVal;
75template <
class PrivateData,
class Value>
78 data->minVal = newMinVal;
79 if (data->maxVal.width() < data->minVal.width())
80 data->maxVal.setWidth(data->minVal.width());
81 if (data->maxVal.height() < data->minVal.height())
82 data->maxVal.setHeight(data->minVal.height());
84 if (data->val.width() < data->minVal.width())
85 data->val.setWidth(data->minVal.width());
86 if (data->val.height() < data->minVal.height())
87 data->val.setHeight(data->minVal.height());
90template <
class PrivateData,
class Value>
93 data->maxVal = newMaxVal;
94 if (data->minVal.width() > data->maxVal.width())
95 data->minVal.setWidth(data->maxVal.width());
96 if (data->minVal.height() > data->maxVal.height())
97 data->minVal.setHeight(data->maxVal.height());
99 if (data->val.width() > data->maxVal.width())
100 data->val.setWidth(data->maxVal.width());
101 if (data->val.height() > data->maxVal.height())
102 data->val.setHeight(data->maxVal.height());
105template <
class SizeValue>
106static SizeValue
qBoundSize(
const SizeValue &minVal,
const SizeValue &val,
const SizeValue &maxVal)
108 SizeValue croppedVal = val;
109 if (minVal.width() > val.width())
110 croppedVal.setWidth(minVal.width());
111 else if (maxVal.width() < val.width())
112 croppedVal.setWidth(maxVal.width());
114 if (minVal.height() > val.height())
115 croppedVal.setHeight(minVal.height());
116 else if (maxVal.height() < val.height())
117 croppedVal.setHeight(maxVal.height());
125 return qBoundSize(minVal, val, maxVal);
130 return qBoundSize(minVal, val, maxVal);
136template <
class Value>
137void orderBorders(Value &minVal, Value &maxVal)
140 qSwap(minVal, maxVal);
143template <
class Value>
144static void orderSizeBorders(Value &minVal, Value &maxVal)
146 Value fromSize = minVal;
147 Value toSize = maxVal;
148 if (fromSize.width() > toSize.width()) {
149 fromSize.setWidth(maxVal.width());
150 toSize.setWidth(minVal.width());
152 if (fromSize.height() > toSize.height()) {
153 fromSize.setHeight(maxVal.height());
154 toSize.setHeight(minVal.height());
160void orderBorders(QSize &minVal, QSize &maxVal)
162 orderSizeBorders(minVal, maxVal);
165void orderBorders(QSizeF &minVal, QSizeF &maxVal)
167 orderSizeBorders(minVal, maxVal);
174template <
class Value,
class PrivateData>
175static Value
getData(
const QHash<
const QtProperty *, PrivateData> &propertyMap,
176 Value PrivateData::*data,
177 const QtProperty *property,
const Value &defaultValue = Value())
179 const auto it = propertyMap.constFind(property);
180 if (it == propertyMap.constEnd())
182 return it.value().*data;
185template <
class Value,
class PrivateData>
186static Value
getValue(
const QHash<
const QtProperty *, PrivateData> &propertyMap,
187 const QtProperty *property,
const Value &defaultValue = Value())
189 return getData<Value>(propertyMap, &PrivateData::val, property, defaultValue);
192template <
class Value,
class PrivateData>
193static Value
getMinimum(
const QHash<
const QtProperty *, PrivateData> &propertyMap,
194 const QtProperty *property,
const Value &defaultValue = Value())
196 return getData<Value>(propertyMap, &PrivateData::minVal, property, defaultValue);
199template <
class Value,
class PrivateData>
200static Value
getMaximum(
const QHash<
const QtProperty *, PrivateData> &propertyMap,
201 const QtProperty *property,
const Value &defaultValue = Value())
203 return getData<Value>(propertyMap, &PrivateData::maxVal, property, defaultValue);
206template <
class ValueChangeParameter,
class Value,
class PropertyManager>
208 PropertyManager *manager,
209 void (PropertyManager::*propertyChangedSignal)(
QtProperty *),
210 void (PropertyManager::*valueChangedSignal)(
QtProperty *, ValueChangeParameter),
213 const auto it = propertyMap.find(property);
214 if (it == propertyMap.end())
217 if (it.value() == val)
222 emit (manager->*propertyChangedSignal)(property);
223 emit (manager->*valueChangedSignal)(property, val);
226template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value>
227static void setValueInRange(PropertyManager *manager, PropertyManagerPrivate *managerPrivate,
228 void (PropertyManager::*propertyChangedSignal)(
QtProperty *),
229 void (PropertyManager::*valueChangedSignal)(
QtProperty *, ValueChangeParameter),
231 void (PropertyManagerPrivate::*setSubPropertyValue)(
QtProperty *, ValueChangeParameter))
233 const auto it = managerPrivate->m_values.find(property);
234 if (it == managerPrivate->m_values.end())
237 auto &data = it.value();
242 const Value oldVal = data.val;
244 data.val = qBound(data.minVal, val, data.maxVal);
246 if (data.val == oldVal)
249 if (setSubPropertyValue)
250 (managerPrivate->*setSubPropertyValue)(property, data.val);
252 emit (manager->*propertyChangedSignal)(property);
253 emit (manager->*valueChangedSignal)(property, data.val);
256template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value>
257static void setBorderValues(PropertyManager *manager, PropertyManagerPrivate *managerPrivate,
258 void (PropertyManager::*propertyChangedSignal)(
QtProperty *),
259 void (PropertyManager::*valueChangedSignal)(
QtProperty *, ValueChangeParameter),
260 void (PropertyManager::*rangeChangedSignal)(
QtProperty *, ValueChangeParameter, ValueChangeParameter),
261 QtProperty *property, ValueChangeParameter minVal, ValueChangeParameter maxVal,
262 void (PropertyManagerPrivate::*setSubPropertyRange)(
QtProperty *,
263 ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
265 const auto it = managerPrivate->m_values.find(property);
266 if (it == managerPrivate->m_values.end())
269 Value fromVal = minVal;
270 Value toVal = maxVal;
271 orderBorders(fromVal, toVal);
273 auto &data = it.value();
275 if (data.minVal == fromVal && data.maxVal == toVal)
278 const Value oldVal = data.val;
280 data.setMinimumValue(fromVal);
281 data.setMaximumValue(toVal);
283 emit (manager->*rangeChangedSignal)(property, data.minVal, data.maxVal);
285 if (setSubPropertyRange)
286 (managerPrivate->*setSubPropertyRange)(property, data.minVal, data.maxVal, data.val);
288 if (data.val == oldVal)
291 emit (manager->*propertyChangedSignal)(property);
292 emit (manager->*valueChangedSignal)(property, data.val);
295template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value,
class PrivateData>
296static void setBorderValue(PropertyManager *manager, PropertyManagerPrivate *managerPrivate,
297 void (PropertyManager::*propertyChangedSignal)(
QtProperty *),
298 void (PropertyManager::*valueChangedSignal)(
QtProperty *, ValueChangeParameter),
299 void (PropertyManager::*rangeChangedSignal)(
QtProperty *, ValueChangeParameter, ValueChangeParameter),
301 Value (PrivateData::*getRangeVal)()
const,
302 void (PrivateData::*setRangeVal)(ValueChangeParameter),
const Value &borderVal,
303 void (PropertyManagerPrivate::*setSubPropertyRange)(
QtProperty *,
304 ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
306 const auto it = managerPrivate->m_values.find(property);
307 if (it == managerPrivate->m_values.end())
310 PrivateData &data = it.value();
312 if ((data.*getRangeVal)() == borderVal)
315 const Value oldVal = data.val;
317 (data.*setRangeVal)(borderVal);
319 emit (manager->*rangeChangedSignal)(property, data.minVal, data.maxVal);
321 if (setSubPropertyRange)
322 (managerPrivate->*setSubPropertyRange)(property, data.minVal, data.maxVal, data.val);
324 if (data.val == oldVal)
327 emit (manager->*propertyChangedSignal)(property);
328 emit (manager->*valueChangedSignal)(property, data.val);
331template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value,
class PrivateData>
332static void setMinimumValue(PropertyManager *manager, PropertyManagerPrivate *managerPrivate,
333 void (PropertyManager::*propertyChangedSignal)(
QtProperty *),
334 void (PropertyManager::*valueChangedSignal)(
QtProperty *, ValueChangeParameter),
335 void (PropertyManager::*rangeChangedSignal)(
QtProperty *, ValueChangeParameter, ValueChangeParameter),
338 void (PropertyManagerPrivate::*setSubPropertyRange)(
QtProperty *,
339 ValueChangeParameter, ValueChangeParameter, ValueChangeParameter) = 0;
340 setBorderValue<ValueChangeParameter, PropertyManagerPrivate, PropertyManager, Value, PrivateData>(manager, managerPrivate,
341 propertyChangedSignal, valueChangedSignal, rangeChangedSignal,
342 property, &PropertyManagerPrivate::Data::minimumValue, &PropertyManagerPrivate::Data::setMinimumValue, minVal, setSubPropertyRange);
345template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value,
class PrivateData>
346static void setMaximumValue(PropertyManager *manager, PropertyManagerPrivate *managerPrivate,
347 void (PropertyManager::*propertyChangedSignal)(
QtProperty *),
348 void (PropertyManager::*valueChangedSignal)(
QtProperty *, ValueChangeParameter),
349 void (PropertyManager::*rangeChangedSignal)(
QtProperty *, ValueChangeParameter, ValueChangeParameter),
352 void (PropertyManagerPrivate::*setSubPropertyRange)(
QtProperty *,
353 ValueChangeParameter, ValueChangeParameter, ValueChangeParameter) = 0;
354 setBorderValue<ValueChangeParameter, PropertyManagerPrivate, PropertyManager, Value, PrivateData>(manager, managerPrivate,
355 propertyChangedSignal, valueChangedSignal, rangeChangedSignal,
356 property, &PropertyManagerPrivate::Data::maximumValue, &PropertyManagerPrivate::Data::setMaximumValue, maxVal, setSubPropertyRange);
362 Q_PROPERTY(QSizePolicy::Policy policy READ policy)
381 void indexToLocale(
int languageIndex,
int territoryIndex, QLocale::Language *language, QLocale::Territory *territory)
const;
382 void localeToIndex(QLocale::Language language, QLocale::Territory territory,
int *languageIndex,
int *territoryIndex)
const;
387 QStringList m_policyEnumNames;
388 QStringList m_languageEnumNames;
389 QMap<QLocale::Language, QStringList> m_territoryEnumNames;
390 QMap<
int, QLocale::Language> m_indexToLanguage;
391 QMap<QLocale::Language,
int> m_languageToIndex;
392 QMap<
int, QMap<
int, QLocale::Territory> > m_indexToTerritory;
394 QMetaEnum m_policyEnum;
399 QMultiMap<QString, QLocale::Territory> nameToTerritory;
400 for (
const QLocale &locale : locales) {
401 const auto territory = locale.territory();
402 nameToTerritory.insert(QLocale::territoryToString(territory), territory);
404 return nameToTerritory.values();
409 QMultiMap<QString, QLocale::Language> nameToLanguage;
410 for (
int l = QLocale::C, last = QLocale::LastLanguage; l <= last; ++l) {
411 const QLocale::Language language =
static_cast<QLocale::Language>(l);
412 QLocale locale(language);
413 if (locale.language() == language)
414 nameToLanguage.insert(QLocale::languageToString(language), language);
417 const QLocale system = QLocale::system();
418 if (!nameToLanguage.contains(QLocale::languageToString(system.language())))
419 nameToLanguage.insert(QLocale::languageToString(system.language()), system.language());
421 const auto languages = nameToLanguage.values();
422 for (QLocale::Language language : languages) {
423 auto locales = QLocale::matchingLocales(language, QLocale::AnyScript,
424 QLocale::AnyTerritory);
426 if (!locales.isEmpty() && !m_languageToIndex.contains(language)) {
427 const auto territories = sortedTerritories(locales);
428 int langIdx = m_languageEnumNames.size();
429 m_indexToLanguage[langIdx] = language;
430 m_languageToIndex[language] = langIdx;
431 QStringList territoryNames;
432 int territoryIdx = 0;
433 for (QLocale::Territory territory : territories) {
434 territoryNames << QLocale::territoryToString(territory);
435 m_indexToTerritory[langIdx][territoryIdx] = territory;
436 m_territoryToIndex[language][territory] = territoryIdx;
439 m_languageEnumNames << QLocale::languageToString(language);
440 m_territoryEnumNames[language] = territoryNames;
449 p = QtMetaEnumWrapper::staticMetaObject.property(
450 QtMetaEnumWrapper::staticMetaObject.propertyOffset() + 0);
451 m_policyEnum = p.enumerator();
452 const int keyCount = m_policyEnum.keyCount();
453 for (
int i = 0; i < keyCount; i++)
454 m_policyEnumNames << QLatin1StringView(m_policyEnum.key(i));
461 return static_cast<QSizePolicy::Policy>(m_policyEnum.value(index));
466 const int keyCount = m_policyEnum.keyCount();
467 for (
int i = 0; i < keyCount; i++)
468 if (indexToSizePolicy(i) == policy)
475 QLocale::Language l = QLocale::C;
476 QLocale::Territory c = QLocale::AnyTerritory;
477 if (m_indexToLanguage.contains(languageIndex)) {
478 l = m_indexToLanguage[languageIndex];
479 if (m_indexToTerritory.contains(languageIndex) && m_indexToTerritory[languageIndex].contains(territoryIndex))
480 c = m_indexToTerritory[languageIndex][territoryIndex];
492 if (m_languageToIndex.contains(language)) {
493 l = m_languageToIndex[language];
494 if (m_territoryToIndex.contains(language) && m_territoryToIndex[language].contains(territory))
495 c = m_territoryToIndex[language][territory];
509
510
511
512
513
514
515
516
517
518
519
522
523
531
532
533QtGroupPropertyManager::~QtGroupPropertyManager()
539
540
548
549
556
557
568 Q_DECLARE_PUBLIC(QtIntPropertyManager)
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
612
613
614
615
616
617
618
619
622
623
624
625
626
627
628
629
632
633
634
635
636
637
638
639
642
643
651
652
659
660
661
662
663
664
665
668 return getValue<
int>(d_ptr->m_values, property, 0);
672
673
674
675
678 return getMinimum<
int>(d_ptr->m_values, property, 0);
682
683
684
685
688 return getMaximum<
int>(d_ptr->m_values, property, 0);
692
693
694
695
696
697
700 return getData<
int>(d_ptr->m_values, &QtIntPropertyManagerPrivate::Data::singleStep, property, 0);
704
705
708 const auto it = d_ptr->m_values.constFind(property);
709 if (it == d_ptr->m_values.constEnd())
711 return QString::number(it.value().val);
715
716
717
718
719
720
721
722
723
724
727 void (QtIntPropertyManagerPrivate::*setSubPropertyValue)(
QtProperty *,
int) =
nullptr;
728 setValueInRange<
int, QtIntPropertyManagerPrivate, QtIntPropertyManager,
int>(
this, d_ptr.data(),
729 &QtIntPropertyManager::propertyChanged,
730 &QtIntPropertyManager::valueChanged,
731 property, val, setSubPropertyValue);
735
736
737
738
739
740
741
742
745 setMinimumValue<
int, QtIntPropertyManagerPrivate, QtIntPropertyManager,
int, QtIntPropertyManagerPrivate::Data>(
this, d_ptr.data(),
746 &QtIntPropertyManager::propertyChanged,
747 &QtIntPropertyManager::valueChanged,
748 &QtIntPropertyManager::rangeChanged,
753
754
755
756
757
758
759
760
763 setMaximumValue<
int, QtIntPropertyManagerPrivate, QtIntPropertyManager,
int, QtIntPropertyManagerPrivate::Data>(
this, d_ptr.data(),
764 &QtIntPropertyManager::propertyChanged,
765 &QtIntPropertyManager::valueChanged,
766 &QtIntPropertyManager::rangeChanged,
771
772
773
774
775
776
777
778
779
780
781
782
783
786 void (QtIntPropertyManagerPrivate::*setSubPropertyRange)(
QtProperty *,
int,
int,
int) =
nullptr;
787 setBorderValues<
int, QtIntPropertyManagerPrivate, QtIntPropertyManager,
int>(
this, d_ptr.data(),
788 &QtIntPropertyManager::propertyChanged,
789 &QtIntPropertyManager::valueChanged,
790 &QtIntPropertyManager::rangeChanged,
791 property, minVal, maxVal, setSubPropertyRange);
795
796
797
798
799
800
803 const auto it = d_ptr->m_values.find(property);
804 if (it == d_ptr->m_values.end())
807 QtIntPropertyManagerPrivate::Data data = it.value();
812 if (data.singleStep == step)
815 data.singleStep = step;
819 emit singleStepChanged(property, data.singleStep);
823
824
827 d_ptr->m_values[property] = QtIntPropertyManagerPrivate::Data();
831
832
835 d_ptr->m_values.remove(property);
843 Q_DECLARE_PUBLIC(QtDoublePropertyManager)
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
889
890
891
892
893
894
895
896
899
900
901
902
903
904
905
906
909
910
911
912
913
914
915
916
919
920
921
922
923
924
925
926
929
930
938
939
946
947
948
949
950
951
952
955 return getValue<
double>(d_ptr->m_values, property, 0.0);
959
960
961
962
965 return getMinimum<
double>(d_ptr->m_values, property, 0.0);
969
970
971
972
975 return getMaximum<
double>(d_ptr->m_values, property, 0.0);
979
980
981
982
983
984
987 return getData<
double>(d_ptr->m_values, &QtDoublePropertyManagerPrivate::Data::singleStep, property, 0);
991
992
993
994
997 return getData<
int>(d_ptr->m_values, &QtDoublePropertyManagerPrivate::Data::decimals, property, 0);
1001
1002
1005 const auto it = d_ptr->m_values.constFind(property);
1006 if (it == d_ptr->m_values.constEnd())
1008 return QString::number(it.value().val,
'f', it.value().decimals);
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1024 void (QtDoublePropertyManagerPrivate::*setSubPropertyValue)(
QtProperty *,
double) =
nullptr;
1025 setValueInRange<
double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager,
double>(
this, d_ptr.data(),
1026 &QtDoublePropertyManager::propertyChanged,
1027 &QtDoublePropertyManager::valueChanged,
1028 property, val, setSubPropertyValue);
1032
1033
1034
1035
1036
1037
1040 const auto it = d_ptr->m_values.find(property);
1041 if (it == d_ptr->m_values.end())
1044 QtDoublePropertyManagerPrivate::Data data = it.value();
1049 if (data.singleStep == step)
1052 data.singleStep = step;
1056 emit singleStepChanged(property, data.singleStep);
1060
1061
1062
1063
1064
1065
1066
1067
1070 const auto it = d_ptr->m_values.find(property);
1071 if (it == d_ptr->m_values.end())
1074 QtDoublePropertyManagerPrivate::Data data = it.value();
1081 if (data.decimals == prec)
1084 data.decimals = prec;
1088 emit decimalsChanged(property, data.decimals);
1092
1093
1094
1095
1096
1097
1098
1099
1102 setMinimumValue<
double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager,
double, QtDoublePropertyManagerPrivate::Data>(
this, d_ptr.data(),
1103 &QtDoublePropertyManager::propertyChanged,
1104 &QtDoublePropertyManager::valueChanged,
1105 &QtDoublePropertyManager::rangeChanged,
1110
1111
1112
1113
1114
1115
1116
1117
1120 setMaximumValue<
double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager,
double, QtDoublePropertyManagerPrivate::Data>(
this, d_ptr.data(),
1121 &QtDoublePropertyManager::propertyChanged,
1122 &QtDoublePropertyManager::valueChanged,
1123 &QtDoublePropertyManager::rangeChanged,
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1143 void (QtDoublePropertyManagerPrivate::*setSubPropertyRange)(
QtProperty *,
double,
double,
double) =
nullptr;
1144 setBorderValues<
double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager,
double>(
this, d_ptr.data(),
1145 &QtDoublePropertyManager::propertyChanged,
1146 &QtDoublePropertyManager::valueChanged,
1147 &QtDoublePropertyManager::rangeChanged,
1148 property, minVal, maxVal, setSubPropertyRange);
1152
1153
1156 d_ptr->m_values[property] = QtDoublePropertyManagerPrivate::Data();
1160
1161
1164 d_ptr->m_values.remove(property);
1172 Q_DECLARE_PUBLIC(QtStringPropertyManager)
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1208
1209
1210
1211
1212
1213
1214
1215
1218
1219
1220
1221
1222
1223
1224
1225
1228
1229
1233 d_ptr->q_ptr =
this;
1237
1238
1245
1246
1247
1248
1249
1250
1251
1254 return getValue<QString>(d_ptr->m_values, property);
1258
1259
1260
1261
1262
1263
1264
1267 return getData<QRegularExpression>(d_ptr->m_values, &QtStringPropertyManagerPrivate::Data::regExp, property, QRegularExpression());
1271
1272
1275 const auto it = d_ptr->m_values.constFind(property);
1276 if (it == d_ptr->m_values.constEnd())
1278 return it.value().val;
1282
1283
1284
1285
1286
1287
1288
1289
1290
1293 const auto it = d_ptr->m_values.find(property);
1294 if (it == d_ptr->m_values.end())
1297 QtStringPropertyManagerPrivate::Data data = it.value();
1299 if (data.val == val)
1302 if (data.regExp.isValid() && !data.regExp.pattern().isEmpty()
1303 && !data.regExp.match(val).hasMatch()) {
1311 emit propertyChanged(property);
1312 emit valueChanged(property, data.val);
1316
1317
1318
1319
1322 const auto it = d_ptr->m_values.find(property);
1323 if (it == d_ptr->m_values.end())
1326 QtStringPropertyManagerPrivate::Data data = it.value() ;
1328 if (data.regExp == regExp)
1331 data.regExp = regExp;
1335 emit regExpChanged(property, data.regExp);
1339
1340
1343 d_ptr->m_values[property] = QtStringPropertyManagerPrivate::Data();
1347
1348
1351 d_ptr->m_values.remove(property);
1358 QStyleOptionButton opt;
1359 opt.state |= value ? QStyle::State_On : QStyle::State_Off;
1360 opt.state |= QStyle::State_Enabled;
1361 const QStyle *style = QApplication::style();
1365 const int indicatorWidth = style->pixelMetric(QStyle::PM_IndicatorWidth, &opt);
1366 const int indicatorHeight = style->pixelMetric(QStyle::PM_IndicatorHeight, &opt);
1367 const int listViewIconSize = indicatorWidth;
1368 const int pixmapWidth = indicatorWidth;
1369 const int pixmapHeight = qMax(indicatorHeight, listViewIconSize);
1371 opt.rect = QRect(0, 0, indicatorWidth, indicatorHeight);
1372 QPixmap pixmap = QPixmap(pixmapWidth, pixmapHeight);
1373 pixmap.fill(Qt::transparent);
1376 const int xoff = (pixmapWidth > indicatorWidth) ? (pixmapWidth - indicatorWidth) / 2 : 0;
1377 const int yoff = (pixmapHeight > indicatorHeight) ? (pixmapHeight - indicatorHeight) / 2 : 0;
1378 QPainter painter(&pixmap);
1379 painter.translate(xoff, yoff);
1380 style->drawPrimitive(QStyle::PE_IndicatorCheckBox, &opt, &painter);
1382 return QIcon(pixmap);
1388 Q_DECLARE_PUBLIC(QtBoolPropertyManager)
1398 m_checkedIcon(drawCheckBox(
true)),
1399 m_uncheckedIcon(drawCheckBox(
false))
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1422
1423
1424
1425
1426
1427
1430
1431
1435 d_ptr->q_ptr =
this;
1439
1440
1447
1448
1449
1450
1451
1452
1453
1456 return d_ptr->m_values.value(property,
false);
1460
1461
1464 const auto it = d_ptr->m_values.constFind(property);
1465 if (it == d_ptr->m_values.constEnd())
1468 static const QString trueText = tr(
"True");
1469 static const QString falseText = tr(
"False");
1470 return it.value() ? trueText : falseText;
1474
1475
1478 const auto it = d_ptr->m_values.constFind(property);
1479 if (it == d_ptr->m_values.constEnd())
1482 return it.value() ? d_ptr->m_checkedIcon : d_ptr->m_uncheckedIcon;
1486
1487
1488
1489
1490
1491
1494 setSimpleValue<
bool,
bool, QtBoolPropertyManager>(d_ptr->m_values,
this,
1495 &QtBoolPropertyManager::propertyChanged,
1496 &QtBoolPropertyManager::valueChanged,
1501
1502
1505 d_ptr->m_values[property] =
false;
1509
1510
1513 d_ptr->m_values.remove(property);
1521 Q_DECLARE_PUBLIC(QtDatePropertyManager)
1543 m_format(QtPropertyBrowserUtils::dateFormat())
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1573
1574
1575
1576
1577
1578
1579
1580
1583
1584
1585
1586
1587
1588
1589
1590
1593
1594
1601
1602
1609
1610
1611
1612
1613
1614
1615
1618 return getValue<QDate>(d_ptr->m_values, property);
1622
1623
1624
1625
1628 return getMinimum<QDate>(d_ptr->m_values, property);
1632
1633
1634
1635
1638 return getMaximum<QDate>(d_ptr->m_values, property);
1642
1643
1646 const auto it = d_ptr->m_values.constFind(property);
1647 if (it == d_ptr->m_values.constEnd())
1649 return it.value().val.toString(d_ptr->m_format);
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1665 void (QtDatePropertyManagerPrivate::*setSubPropertyValue)(
QtProperty *, QDate) =
nullptr;
1666 setValueInRange<QDate, QtDatePropertyManagerPrivate, QtDatePropertyManager,
const QDate>(
this, d_ptr.data(),
1667 &QtDatePropertyManager::propertyChanged,
1668 &QtDatePropertyManager::valueChanged,
1669 property, val, setSubPropertyValue);
1673
1674
1675
1676
1677
1678
1679
1680
1683 setMinimumValue<QDate, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate, QtDatePropertyManagerPrivate::Data>(
this, d_ptr.data(),
1684 &QtDatePropertyManager::propertyChanged,
1685 &QtDatePropertyManager::valueChanged,
1686 &QtDatePropertyManager::rangeChanged,
1691
1692
1693
1694
1695
1696
1697
1698
1701 setMaximumValue<QDate, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate, QtDatePropertyManagerPrivate::Data>(
this, d_ptr.data(),
1702 &QtDatePropertyManager::propertyChanged,
1703 &QtDatePropertyManager::valueChanged,
1704 &QtDatePropertyManager::rangeChanged,
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1724 void (QtDatePropertyManagerPrivate::*setSubPropertyRange)(
QtProperty *, QDate, QDate, QDate) =
nullptr;
1725 setBorderValues<QDate, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate>(
this, d_ptr.data(),
1726 &QtDatePropertyManager::propertyChanged,
1727 &QtDatePropertyManager::valueChanged,
1728 &QtDatePropertyManager::rangeChanged,
1729 property, minVal, maxVal, setSubPropertyRange);
1733
1734
1737 d_ptr->m_values[property] = QtDatePropertyManagerPrivate::Data();
1741
1742
1745 d_ptr->m_values.remove(property);
1753 Q_DECLARE_PUBLIC(QtTimePropertyManager)
1764 m_format(QtPropertyBrowserUtils::timeFormat())
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1787
1788
1789
1790
1791
1792
1793
1794
1797
1798
1805
1806
1813
1814
1815
1816
1817
1818
1819
1822 return d_ptr->m_values.value(property, QTime());
1826
1827
1830 const auto it = d_ptr->m_values.constFind(property);
1831 if (it == d_ptr->m_values.constEnd())
1833 return it.value().toString(d_ptr->m_format);
1837
1838
1839
1840
1841
1842
1845 setSimpleValue<QTime, QTime, QtTimePropertyManager>(d_ptr->m_values,
this,
1846 &QtTimePropertyManager::propertyChanged,
1847 &QtTimePropertyManager::valueChanged,
1852
1853
1856 d_ptr->m_values[property] = QTime::currentTime();
1860
1861
1864 d_ptr->m_values.remove(property);
1872 Q_DECLARE_PUBLIC(QtDateTimePropertyManager)
1883 m_format(QtPropertyBrowserUtils::dateTimeFormat())
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1904
1905
1906
1907
1908
1909
1912
1913
1920
1921
1928
1929
1930
1931
1932
1933
1934
1937 return d_ptr->m_values.value(property, QDateTime());
1941
1942
1945 const auto it = d_ptr->m_values.constFind(property);
1946 if (it == d_ptr->m_values.constEnd())
1948 return it.value().toString(d_ptr->m_format);
1952
1953
1954
1955
1956
1957
1960 setSimpleValue<
const QDateTime &, QDateTime, QtDateTimePropertyManager>(d_ptr->m_values,
this,
1961 &QtDateTimePropertyManager::propertyChanged,
1962 &QtDateTimePropertyManager::valueChanged,
1967
1968
1971 d_ptr->m_values[property] = QDateTime::currentDateTime();
1975
1976
1979 d_ptr->m_values.remove(property);
1987 Q_DECLARE_PUBLIC(QtKeySequencePropertyManager)
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2013
2014
2015
2016
2017
2018
2021
2022
2026 d_ptr->q_ptr =
this;
2030
2031
2038
2039
2040
2041
2042
2043
2044
2047 return d_ptr->m_values.value(property, QKeySequence());
2051
2052
2055 const auto it = d_ptr->m_values.constFind(property);
2056 if (it == d_ptr->m_values.constEnd())
2058 return it.value().toString(QKeySequence::NativeText);
2062
2063
2064
2065
2066
2067
2070 setSimpleValue<
const QKeySequence &, QKeySequence, QtKeySequencePropertyManager>(d_ptr->m_values,
this,
2071 &QtKeySequencePropertyManager::propertyChanged,
2072 &QtKeySequencePropertyManager::valueChanged,
2077
2078
2081 d_ptr->m_values[property] = QKeySequence();
2085
2086
2089 d_ptr->m_values.remove(property);
2097 Q_DECLARE_PUBLIC(QtCharPropertyManager)
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2121
2122
2123
2124
2125
2126
2129
2130
2134 d_ptr->q_ptr =
this;
2138
2139
2146
2147
2148
2149
2150
2151
2152
2155 return d_ptr->m_values.value(property, QChar());
2159
2160
2163 const auto it = d_ptr->m_values.constFind(property);
2164 if (it == d_ptr->m_values.constEnd())
2166 const QChar c = it.value();
2167 return c.isNull() ? QString() : QString(c);
2171
2172
2173
2174
2175
2176
2179 setSimpleValue<
const QChar &, QChar, QtCharPropertyManager>(d_ptr->m_values,
this,
2180 &QtCharPropertyManager::propertyChanged,
2181 &QtCharPropertyManager::valueChanged,
2186
2187
2190 d_ptr->m_values[property] = QChar();
2194
2195
2198 d_ptr->m_values.remove(property);
2206 Q_DECLARE_PUBLIC(QtLocalePropertyManager)
2225 if (
QtProperty *prop = m_languageToProperty.value(property,
nullptr)) {
2226 const QLocale loc = m_values[prop];
2227 QLocale::Language newLanguage = loc.language();
2228 QLocale::Territory newTerritory = loc.territory();
2229 metaEnumProvider()->indexToLocale(value, 0, &newLanguage, 0);
2230 QLocale newLoc(newLanguage, newTerritory);
2231 q_ptr->setValue(prop, newLoc);
2232 }
else if (
QtProperty *prop = m_territoryToProperty.value(property,
nullptr)) {
2233 const QLocale loc = m_values[prop];
2234 QLocale::Language newLanguage = loc.language();
2235 QLocale::Territory newTerritory = loc.territory();
2236 metaEnumProvider()->indexToLocale(m_enumPropertyManager->value(m_propertyToLanguage.value(prop)), value, &newLanguage, &newTerritory);
2237 QLocale newLoc(newLanguage, newTerritory);
2238 q_ptr->setValue(prop, newLoc);
2244 if (
QtProperty *subProp = m_languageToProperty.value(property,
nullptr)) {
2245 m_propertyToLanguage[subProp] =
nullptr;
2246 m_languageToProperty.remove(property);
2247 }
else if (
QtProperty *subProp = m_territoryToProperty.value(property,
nullptr)) {
2248 m_propertyToTerritory[subProp] =
nullptr;
2249 m_territoryToProperty.remove(property);
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2278
2279
2280
2281
2282
2283
2284
2285
2288
2289
2293 d_ptr->q_ptr =
this;
2295 d_ptr->m_enumPropertyManager =
new QtEnumPropertyManager(
this);
2296 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::valueChanged,
this,
2297 [
this](QtProperty *property,
int value) { d_ptr->slotEnumChanged(property, value); });
2298 connect(d_ptr->m_enumPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
2299 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
2303
2304
2311
2312
2313
2314
2315
2316
2317
2318
2319
2322 return d_ptr->m_enumPropertyManager;
2326
2327
2328
2329
2330
2331
2332
2335 return d_ptr->m_values.value(property, QLocale());
2339
2340
2343 const auto it = d_ptr->m_values.constFind(property);
2344 if (it == d_ptr->m_values.constEnd())
2347 const QLocale loc = it.value();
2350 int territoryIdx = 0;
2352 me->localeToIndex(loc.language(), loc.territory(), &langIdx, &territoryIdx);
2354 qWarning(
"QtLocalePropertyManager::valueText: Unknown language %d", loc.language());
2355 return tr(
"<Invalid>");
2357 const QString languageName = me->languageEnumNames().at(langIdx);
2358 if (territoryIdx < 0) {
2359 qWarning(
"QtLocalePropertyManager::valueText: Unknown territory %d for %s", loc.territory(), qPrintable(languageName));
2360 return languageName;
2362 const QString territoryName = me->territoryEnumNames(loc.language()).at(territoryIdx);
2363 return tr(
"%1, %2").arg(languageName, territoryName);
2367
2368
2369
2370
2371
2372
2373
2376 const auto it = d_ptr->m_values.find(property);
2377 if (it == d_ptr->m_values.end())
2380 const QLocale loc = it.value();
2387 int territoryIdx = 0;
2388 metaEnumProvider()->localeToIndex(val.language(), val.territory(), &langIdx, &territoryIdx);
2389 if (loc.language() != val.language()) {
2390 d_ptr->m_enumPropertyManager->setValue(d_ptr->m_propertyToLanguage.value(property), langIdx);
2391 d_ptr->m_enumPropertyManager->setEnumNames(d_ptr->m_propertyToTerritory.value(property),
2392 metaEnumProvider()->territoryEnumNames(val.language()));
2394 d_ptr->m_enumPropertyManager->setValue(d_ptr->m_propertyToTerritory.value(property), territoryIdx);
2396 emit propertyChanged(property);
2397 emit valueChanged(property, val);
2401
2402
2406 d_ptr->m_values[property] = val;
2409 int territoryIdx = 0;
2410 metaEnumProvider()->localeToIndex(val.language(), val.territory(), &langIdx, &territoryIdx);
2412 QtProperty *languageProp = d_ptr->m_enumPropertyManager->addProperty();
2413 languageProp->setPropertyName(tr(
"Language"));
2414 d_ptr->m_enumPropertyManager->setEnumNames(languageProp, metaEnumProvider()->languageEnumNames());
2415 d_ptr->m_enumPropertyManager->setValue(languageProp, langIdx);
2416 d_ptr->m_propertyToLanguage[property] = languageProp;
2417 d_ptr->m_languageToProperty[languageProp] = property;
2420 QtProperty *territoryProp = d_ptr->m_enumPropertyManager->addProperty();
2421 territoryProp->setPropertyName(tr(
"Territory"));
2422 d_ptr->m_enumPropertyManager->setEnumNames(territoryProp, metaEnumProvider()->territoryEnumNames(val.language()));
2423 d_ptr->m_enumPropertyManager->setValue(territoryProp, territoryIdx);
2424 d_ptr->m_propertyToTerritory[property] = territoryProp;
2425 d_ptr->m_territoryToProperty[territoryProp] = property;
2430
2431
2434 QtProperty *languageProp = d_ptr->m_propertyToLanguage[property];
2436 d_ptr->m_languageToProperty.remove(languageProp);
2437 delete languageProp;
2439 d_ptr->m_propertyToLanguage.remove(property);
2441 QtProperty *territoryProp = d_ptr->m_propertyToTerritory[property];
2442 if (territoryProp) {
2443 d_ptr->m_territoryToProperty.remove(territoryProp);
2444 delete territoryProp;
2446 d_ptr->m_propertyToTerritory.remove(property);
2448 d_ptr->m_values.remove(property);
2456 Q_DECLARE_PUBLIC(QtPointPropertyManager)
2475 if (
QtProperty *xprop = m_xToProperty.value(property,
nullptr)) {
2476 QPoint p = m_values[xprop];
2478 q_ptr->setValue(xprop, p);
2479 }
else if (
QtProperty *yprop = m_yToProperty.value(property,
nullptr)) {
2480 QPoint p = m_values[yprop];
2482 q_ptr->setValue(yprop, p);
2488 if (
QtProperty *pointProp = m_xToProperty.value(property,
nullptr)) {
2489 m_propertyToX[pointProp] =
nullptr;
2490 m_xToProperty.remove(property);
2491 }
else if (
QtProperty *pointProp = m_yToProperty.value(property,
nullptr)) {
2492 m_propertyToY[pointProp] =
nullptr;
2493 m_yToProperty.remove(property);
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2521
2522
2523
2524
2525
2526
2527
2528
2531
2532
2536 d_ptr->q_ptr =
this;
2538 d_ptr->m_intPropertyManager =
new QtIntPropertyManager(
this);
2539 connect(d_ptr->m_intPropertyManager, &QtIntPropertyManager::valueChanged,
this,
2540 [
this](QtProperty *property,
int value) { d_ptr->slotIntChanged(property, value); });
2541 connect(d_ptr->m_intPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
2542 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
2546
2547
2554
2555
2556
2557
2558
2559
2560
2561
2562
2565 return d_ptr->m_intPropertyManager;
2569
2570
2571
2572
2573
2574
2575
2578 return d_ptr->m_values.value(property, QPoint());
2582
2583
2586 const auto it = d_ptr->m_values.constFind(property);
2587 if (it == d_ptr->m_values.constEnd())
2589 const QPoint v = it.value();
2590 return tr(
"(%1, %2)").arg(v.x()).arg(v.y());
2594
2595
2596
2597
2598
2599
2600
2603 const auto it = d_ptr->m_values.find(property);
2604 if (it == d_ptr->m_values.end())
2607 if (it.value() == val)
2611 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToX[property], val.x());
2612 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToY[property], val.y());
2614 emit propertyChanged(property);
2615 emit valueChanged(property, val);
2619
2620
2623 d_ptr->m_values[property] = QPoint(0, 0);
2625 QtProperty *xProp = d_ptr->m_intPropertyManager->addProperty();
2626 xProp->setPropertyName(tr(
"X"));
2627 d_ptr->m_intPropertyManager->setValue(xProp, 0);
2628 d_ptr->m_propertyToX[property] = xProp;
2629 d_ptr->m_xToProperty[xProp] = property;
2632 QtProperty *yProp = d_ptr->m_intPropertyManager->addProperty();
2633 yProp->setPropertyName(tr(
"Y"));
2634 d_ptr->m_intPropertyManager->setValue(yProp, 0);
2635 d_ptr->m_propertyToY[property] = yProp;
2636 d_ptr->m_yToProperty[yProp] = property;
2641
2642
2645 QtProperty *xProp = d_ptr->m_propertyToX[property];
2647 d_ptr->m_xToProperty.remove(xProp);
2650 d_ptr->m_propertyToX.remove(property);
2652 QtProperty *yProp = d_ptr->m_propertyToY[property];
2654 d_ptr->m_yToProperty.remove(yProp);
2657 d_ptr->m_propertyToY.remove(property);
2659 d_ptr->m_values.remove(property);
2667 Q_DECLARE_PUBLIC(QtPointFPropertyManager)
2692 if (
QtProperty *prop = m_xToProperty.value(property,
nullptr)) {
2693 QPointF p = m_values[prop].val;
2695 q_ptr->setValue(prop, p);
2696 }
else if (
QtProperty *prop = m_yToProperty.value(property,
nullptr)) {
2697 QPointF p = m_values[prop].val;
2699 q_ptr->setValue(prop, p);
2705 if (
QtProperty *pointProp = m_xToProperty.value(property,
nullptr)) {
2706 m_propertyToX[pointProp] =
nullptr;
2707 m_xToProperty.remove(property);
2708 }
else if (
QtProperty *pointProp = m_yToProperty.value(property,
nullptr)) {
2709 m_propertyToY[pointProp] =
nullptr;
2710 m_yToProperty.remove(property);
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2738
2739
2740
2741
2742
2743
2744
2745
2748
2749
2750
2751
2752
2753
2754
2755
2758
2759
2763 d_ptr->q_ptr =
this;
2765 d_ptr->m_doublePropertyManager =
new QtDoublePropertyManager(
this);
2766 connect(d_ptr->m_doublePropertyManager, &QtDoublePropertyManager::valueChanged,
this,
2767 [
this](QtProperty *property,
double value) { d_ptr->slotDoubleChanged(property, value); });
2768 connect(d_ptr->m_doublePropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
2769 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
2773
2774
2781
2782
2783
2784
2785
2786
2787
2788
2789
2792 return d_ptr->m_doublePropertyManager;
2796
2797
2798
2799
2800
2801
2802
2805 return getValue<QPointF>(d_ptr->m_values, property);
2809
2810
2811
2812
2815 return getData<
int>(d_ptr->m_values, &QtPointFPropertyManagerPrivate::Data::decimals, property, 0);
2819
2820
2823 const auto it = d_ptr->m_values.constFind(property);
2824 if (it == d_ptr->m_values.constEnd())
2826 const QPointF v = it.value().val;
2827 const int dec = it.value().decimals;
2828 return tr(
"(%1, %2)").arg(QString::number(v.x(),
'f', dec),
2829 QString::number(v.y(),
'f', dec));
2833
2834
2835
2836
2837
2838
2839
2842 const auto it = d_ptr->m_values.find(property);
2843 if (it == d_ptr->m_values.end())
2846 if (it.value().val == val)
2849 it.value().val = val;
2850 d_ptr->m_doublePropertyManager->setValue(d_ptr->m_propertyToX[property], val.x());
2851 d_ptr->m_doublePropertyManager->setValue(d_ptr->m_propertyToY[property], val.y());
2853 emit propertyChanged(property);
2854 emit valueChanged(property, val);
2858
2859
2860
2861
2862
2863
2864
2865
2868 const auto it = d_ptr->m_values.find(property);
2869 if (it == d_ptr->m_values.end())
2872 QtPointFPropertyManagerPrivate::Data data = it.value();
2879 if (data.decimals == prec)
2882 data.decimals = prec;
2883 d_ptr->m_doublePropertyManager->setDecimals(d_ptr->m_propertyToX[property], prec);
2884 d_ptr->m_doublePropertyManager->setDecimals(d_ptr->m_propertyToY[property], prec);
2888 emit decimalsChanged(property, data.decimals);
2892
2893
2896 d_ptr->m_values[property] = QtPointFPropertyManagerPrivate::Data();
2898 QtProperty *xProp = d_ptr->m_doublePropertyManager->addProperty();
2899 xProp->setPropertyName(tr(
"X"));
2900 d_ptr->m_doublePropertyManager->setDecimals(xProp, decimals(property));
2901 d_ptr->m_doublePropertyManager->setValue(xProp, 0);
2902 d_ptr->m_propertyToX[property] = xProp;
2903 d_ptr->m_xToProperty[xProp] = property;
2906 QtProperty *yProp = d_ptr->m_doublePropertyManager->addProperty();
2907 yProp->setPropertyName(tr(
"Y"));
2908 d_ptr->m_doublePropertyManager->setDecimals(yProp, decimals(property));
2909 d_ptr->m_doublePropertyManager->setValue(yProp, 0);
2910 d_ptr->m_propertyToY[property] = yProp;
2911 d_ptr->m_yToProperty[yProp] = property;
2916
2917
2920 QtProperty *xProp = d_ptr->m_propertyToX[property];
2922 d_ptr->m_xToProperty.remove(xProp);
2925 d_ptr->m_propertyToX.remove(property);
2927 QtProperty *yProp = d_ptr->m_propertyToY[property];
2929 d_ptr->m_yToProperty.remove(yProp);
2932 d_ptr->m_propertyToY.remove(property);
2934 d_ptr->m_values.remove(property);
2942 Q_DECLARE_PUBLIC(QtSizePropertyManager)
2949 QSize minVal, QSize maxVal, QSize val);
2975 if (
QtProperty *prop = m_wToProperty.value(property,
nullptr)) {
2976 QSize s = m_values[prop].val;
2978 q_ptr->setValue(prop, s);
2979 }
else if (
QtProperty *prop = m_hToProperty.value(property,
nullptr)) {
2980 QSize s = m_values[prop].val;
2982 q_ptr->setValue(prop, s);
2988 if (
QtProperty *pointProp = m_wToProperty.value(property,
nullptr)) {
2989 m_propertyToW[pointProp] =
nullptr;
2990 m_wToProperty.remove(property);
2991 }
else if (
QtProperty *pointProp = m_hToProperty.value(property,
nullptr)) {
2992 m_propertyToH[pointProp] =
nullptr;
2993 m_hToProperty.remove(property);
2999 m_intPropertyManager->setValue(m_propertyToW.value(property), val.width());
3000 m_intPropertyManager->setValue(m_propertyToH.value(property), val.height());
3004 QSize minVal, QSize maxVal, QSize val)
3006 QtProperty *wProperty = m_propertyToW.value(property);
3007 QtProperty *hProperty = m_propertyToH.value(property);
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3047
3048
3049
3050
3051
3052
3053
3054
3057
3058
3059
3060
3061
3062
3063
3064
3067
3068
3072 d_ptr->q_ptr =
this;
3074 d_ptr->m_intPropertyManager =
new QtIntPropertyManager(
this);
3075 connect(d_ptr->m_intPropertyManager, &QtIntPropertyManager::valueChanged,
this,
3076 [
this](QtProperty *property,
int value) { d_ptr->slotIntChanged(property, value); });
3077 connect(d_ptr->m_intPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
3078 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
3082
3083
3090
3091
3092
3093
3094
3095
3096
3097
3098
3101 return d_ptr->m_intPropertyManager;
3105
3106
3107
3108
3109
3110
3111
3114 return getValue<QSize>(d_ptr->m_values, property);
3118
3119
3120
3121
3124 return getMinimum<QSize>(d_ptr->m_values, property);
3128
3129
3130
3131
3134 return getMaximum<QSize>(d_ptr->m_values, property);
3138
3139
3142 const auto it = d_ptr->m_values.constFind(property);
3143 if (it == d_ptr->m_values.constEnd())
3145 const QSize v = it.value().val;
3146 return tr(
"%1 x %2").arg(v.width()).arg(v.height());
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3162 setValueInRange<QSize, QtSizePropertyManagerPrivate, QtSizePropertyManager,
const QSize>(
this, d_ptr.data(),
3163 &QtSizePropertyManager::propertyChanged,
3164 &QtSizePropertyManager::valueChanged,
3165 property, val, &QtSizePropertyManagerPrivate::setValue);
3169
3170
3171
3172
3173
3174
3175
3176
3179 setBorderValue<QSize, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize, QtSizePropertyManagerPrivate::Data>(
this, d_ptr.data(),
3180 &QtSizePropertyManager::propertyChanged,
3181 &QtSizePropertyManager::valueChanged,
3182 &QtSizePropertyManager::rangeChanged,
3184 &QtSizePropertyManagerPrivate::Data::minimumValue,
3185 &QtSizePropertyManagerPrivate::Data::setMinimumValue,
3186 minVal, &QtSizePropertyManagerPrivate::setRange);
3190
3191
3192
3193
3194
3195
3196
3197
3200 setBorderValue<QSize, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize, QtSizePropertyManagerPrivate::Data>(
this, d_ptr.data(),
3201 &QtSizePropertyManager::propertyChanged,
3202 &QtSizePropertyManager::valueChanged,
3203 &QtSizePropertyManager::rangeChanged,
3205 &QtSizePropertyManagerPrivate::Data::maximumValue,
3206 &QtSizePropertyManagerPrivate::Data::setMaximumValue,
3207 maxVal, &QtSizePropertyManagerPrivate::setRange);
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3226 setBorderValues<QSize, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize>(
this, d_ptr.data(),
3227 &QtSizePropertyManager::propertyChanged,
3228 &QtSizePropertyManager::valueChanged,
3229 &QtSizePropertyManager::rangeChanged,
3230 property, minVal, maxVal, &QtSizePropertyManagerPrivate::setRange);
3234
3235
3238 d_ptr->m_values[property] = QtSizePropertyManagerPrivate::Data();
3240 QtProperty *wProp = d_ptr->m_intPropertyManager->addProperty();
3241 wProp->setPropertyName(tr(
"Width"));
3242 d_ptr->m_intPropertyManager->setValue(wProp, 0);
3243 d_ptr->m_intPropertyManager->setMinimum(wProp, 0);
3244 d_ptr->m_propertyToW[property] = wProp;
3245 d_ptr->m_wToProperty[wProp] = property;
3248 QtProperty *hProp = d_ptr->m_intPropertyManager->addProperty();
3249 hProp->setPropertyName(tr(
"Height"));
3250 d_ptr->m_intPropertyManager->setValue(hProp, 0);
3251 d_ptr->m_intPropertyManager->setMinimum(hProp, 0);
3252 d_ptr->m_propertyToH[property] = hProp;
3253 d_ptr->m_hToProperty[hProp] = property;
3258
3259
3262 QtProperty *wProp = d_ptr->m_propertyToW[property];
3264 d_ptr->m_wToProperty.remove(wProp);
3267 d_ptr->m_propertyToW.remove(property);
3269 QtProperty *hProp = d_ptr->m_propertyToH[property];
3271 d_ptr->m_hToProperty.remove(hProp);
3274 d_ptr->m_propertyToH.remove(property);
3276 d_ptr->m_values.remove(property);
3284 Q_DECLARE_PUBLIC(QtSizeFPropertyManager)
3291 QSizeF minVal, QSizeF maxVal, QSizeF val);
3318 if (
QtProperty *prop = m_wToProperty.value(property,
nullptr)) {
3319 QSizeF s = m_values[prop].val;
3321 q_ptr->setValue(prop, s);
3322 }
else if (
QtProperty *prop = m_hToProperty.value(property,
nullptr)) {
3323 QSizeF s = m_values[prop].val;
3325 q_ptr->setValue(prop, s);
3331 if (
QtProperty *pointProp = m_wToProperty.value(property,
nullptr)) {
3332 m_propertyToW[pointProp] =
nullptr;
3333 m_wToProperty.remove(property);
3334 }
else if (
QtProperty *pointProp = m_hToProperty.value(property,
nullptr)) {
3335 m_propertyToH[pointProp] =
nullptr;
3336 m_hToProperty.remove(property);
3342 m_doublePropertyManager->setValue(m_propertyToW.value(property), val.width());
3343 m_doublePropertyManager->setValue(m_propertyToH.value(property), val.height());
3347 QSizeF minVal, QSizeF maxVal, QSizeF val)
3349 m_doublePropertyManager->setRange(m_propertyToW[property], minVal.width(), maxVal.width());
3350 m_doublePropertyManager->setValue(m_propertyToW[property], val.width());
3351 m_doublePropertyManager->setRange(m_propertyToH[property], minVal.height(), maxVal.height());
3352 m_doublePropertyManager->setValue(m_propertyToH[property], val.height());
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3388
3389
3390
3391
3392
3393
3394
3395
3398
3399
3400
3401
3402
3403
3404
3405
3408
3409
3410
3411
3412
3413
3414
3415
3418
3419
3423 d_ptr->q_ptr =
this;
3425 d_ptr->m_doublePropertyManager =
new QtDoublePropertyManager(
this);
3426 connect(d_ptr->m_doublePropertyManager, &QtDoublePropertyManager::valueChanged,
this,
3427 [
this](QtProperty *property,
double value) { d_ptr->slotDoubleChanged(property, value); });
3428 connect(d_ptr->m_doublePropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
3429 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
3433
3434
3441
3442
3443
3444
3445
3446
3447
3448
3449
3452 return d_ptr->m_doublePropertyManager;
3456
3457
3458
3459
3460
3461
3462
3465 return getValue<QSizeF>(d_ptr->m_values, property);
3469
3470
3471
3472
3475 return getData<
int>(d_ptr->m_values, &QtSizeFPropertyManagerPrivate::Data::decimals, property, 0);
3479
3480
3481
3482
3485 return getMinimum<QSizeF>(d_ptr->m_values, property);
3489
3490
3491
3492
3495 return getMaximum<QSizeF>(d_ptr->m_values, property);
3499
3500
3503 const auto it = d_ptr->m_values.constFind(property);
3504 if (it == d_ptr->m_values.constEnd())
3506 const QSizeF v = it.value().val;
3507 const int dec = it.value().decimals;
3508 return tr(
"%1 x %2").arg(QString::number(v.width(),
'f', dec),
3509 QString::number(v.height(),
'f', dec));
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3525 setValueInRange<QSizeF, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF>(
this, d_ptr.data(),
3526 &QtSizeFPropertyManager::propertyChanged,
3527 &QtSizeFPropertyManager::valueChanged,
3528 property, val, &QtSizeFPropertyManagerPrivate::setValue);
3532
3533
3534
3535
3536
3537
3538
3539
3542 const auto it = d_ptr->m_values.find(property);
3543 if (it == d_ptr->m_values.end())
3557 d_ptr->m_doublePropertyManager->setDecimals(d_ptr->m_propertyToW[property], prec);
3558 d_ptr->m_doublePropertyManager->setDecimals(d_ptr->m_propertyToH[property], prec);
3562 emit decimalsChanged(property, data.decimals);
3566
3567
3568
3569
3570
3571
3572
3573
3576 setBorderValue<QSizeF, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF, QtSizeFPropertyManagerPrivate::Data>(
this, d_ptr.data(),
3577 &QtSizeFPropertyManager::propertyChanged,
3578 &QtSizeFPropertyManager::valueChanged,
3579 &QtSizeFPropertyManager::rangeChanged,
3581 &QtSizeFPropertyManagerPrivate::Data::minimumValue,
3582 &QtSizeFPropertyManagerPrivate::Data::setMinimumValue,
3583 minVal, &QtSizeFPropertyManagerPrivate::setRange);
3587
3588
3589
3590
3591
3592
3593
3594
3597 setBorderValue<QSizeF, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF, QtSizeFPropertyManagerPrivate::Data>(
this, d_ptr.data(),
3598 &QtSizeFPropertyManager::propertyChanged,
3599 &QtSizeFPropertyManager::valueChanged,
3600 &QtSizeFPropertyManager::rangeChanged,
3602 &QtSizeFPropertyManagerPrivate::Data::maximumValue,
3603 &QtSizeFPropertyManagerPrivate::Data::setMaximumValue,
3604 maxVal, &QtSizeFPropertyManagerPrivate::setRange);
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3623 setBorderValues<QSizeF, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF>(
this, d_ptr.data(),
3624 &QtSizeFPropertyManager::propertyChanged,
3625 &QtSizeFPropertyManager::valueChanged,
3626 &QtSizeFPropertyManager::rangeChanged,
3627 property, minVal, maxVal, &QtSizeFPropertyManagerPrivate::setRange);
3631
3632
3635 d_ptr->m_values[property] = QtSizeFPropertyManagerPrivate::Data();
3637 QtProperty *wProp = d_ptr->m_doublePropertyManager->addProperty();
3638 wProp->setPropertyName(tr(
"Width"));
3639 d_ptr->m_doublePropertyManager->setDecimals(wProp, decimals(property));
3640 d_ptr->m_doublePropertyManager->setValue(wProp, 0);
3641 d_ptr->m_doublePropertyManager->setMinimum(wProp, 0);
3642 d_ptr->m_propertyToW[property] = wProp;
3643 d_ptr->m_wToProperty[wProp] = property;
3646 QtProperty *hProp = d_ptr->m_doublePropertyManager->addProperty();
3647 hProp->setPropertyName(tr(
"Height"));
3648 d_ptr->m_doublePropertyManager->setDecimals(hProp, decimals(property));
3649 d_ptr->m_doublePropertyManager->setValue(hProp, 0);
3650 d_ptr->m_doublePropertyManager->setMinimum(hProp, 0);
3651 d_ptr->m_propertyToH[property] = hProp;
3652 d_ptr->m_hToProperty[hProp] = property;
3657
3658
3661 QtProperty *wProp = d_ptr->m_propertyToW[property];
3663 d_ptr->m_wToProperty.remove(wProp);
3666 d_ptr->m_propertyToW.remove(property);
3668 QtProperty *hProp = d_ptr->m_propertyToH[property];
3670 d_ptr->m_hToProperty.remove(hProp);
3673 d_ptr->m_propertyToH.remove(property);
3675 d_ptr->m_values.remove(property);
3683 Q_DECLARE_PUBLIC(QtRectPropertyManager)
3713 if (
QtProperty *prop = m_xToProperty.value(property,
nullptr)) {
3714 QRect r = m_values[prop].val;
3716 q_ptr->setValue(prop, r);
3717 }
else if (
QtProperty *prop = m_yToProperty.value(property)) {
3718 QRect r = m_values[prop].val;
3720 q_ptr->setValue(prop, r);
3721 }
else if (
QtProperty *prop = m_wToProperty.value(property,
nullptr)) {
3722 Data data = m_values[prop];
3725 if (!data.constraint.isNull() && data.constraint.x() + data.constraint.width() < r.x() + r.width()) {
3726 r.moveLeft(data.constraint.left() + data.constraint.width() - r.width());
3728 q_ptr->setValue(prop, r);
3729 }
else if (
QtProperty *prop = m_hToProperty.value(property,
nullptr)) {
3730 Data data = m_values[prop];
3733 if (!data.constraint.isNull() && data.constraint.y() + data.constraint.height() < r.y() + r.height()) {
3734 r.moveTop(data.constraint.top() + data.constraint.height() - r.height());
3736 q_ptr->setValue(prop, r);
3742 if (
QtProperty *pointProp = m_xToProperty.value(property,
nullptr)) {
3743 m_propertyToX[pointProp] =
nullptr;
3744 m_xToProperty.remove(property);
3745 }
else if (
QtProperty *pointProp = m_yToProperty.value(property,
nullptr)) {
3746 m_propertyToY[pointProp] =
nullptr;
3747 m_yToProperty.remove(property);
3748 }
else if (
QtProperty *pointProp = m_wToProperty.value(property,
nullptr)) {
3749 m_propertyToW[pointProp] =
nullptr;
3750 m_wToProperty.remove(property);
3751 }
else if (
QtProperty *pointProp = m_hToProperty.value(property,
nullptr)) {
3752 m_propertyToH[pointProp] =
nullptr;
3753 m_hToProperty.remove(property);
3758 QRect constraint, QRect val)
3760 const bool isNull = constraint.isNull();
3761 const int left = isNull ? INT_MIN : constraint.left();
3762 const int right = isNull ? INT_MAX : constraint.left() + constraint.width();
3763 const int top = isNull ? INT_MIN : constraint.top();
3764 const int bottom = isNull ? INT_MAX : constraint.top() + constraint.height();
3765 const int width = isNull ? INT_MAX : constraint.width();
3766 const int height = isNull ? INT_MAX : constraint.height();
3768 m_intPropertyManager->setRange(m_propertyToX[property], left, right);
3769 m_intPropertyManager->setRange(m_propertyToY[property], top, bottom);
3770 m_intPropertyManager->setRange(m_propertyToW[property], 0, width);
3771 m_intPropertyManager->setRange(m_propertyToH[property], 0, height);
3773 m_intPropertyManager->setValue(m_propertyToX[property], val.x());
3774 m_intPropertyManager->setValue(m_propertyToY[property], val.y());
3775 m_intPropertyManager->setValue(m_propertyToW[property], val.width());
3776 m_intPropertyManager->setValue(m_propertyToH[property], val.height());
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3810
3811
3812
3813
3814
3815
3816
3817
3820
3821
3822
3823
3824
3825
3826
3827
3830
3831
3835 d_ptr->q_ptr =
this;
3837 d_ptr->m_intPropertyManager =
new QtIntPropertyManager(
this);
3838 connect(d_ptr->m_intPropertyManager, &QtIntPropertyManager::valueChanged,
this,
3839 [
this](QtProperty *property,
int value) { d_ptr->slotIntChanged(property, value); });
3840 connect(d_ptr->m_intPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
3841 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
3845
3846
3853
3854
3855
3856
3857
3858
3859
3860
3861
3864 return d_ptr->m_intPropertyManager;
3868
3869
3870
3871
3872
3873
3874
3877 return getValue<QRect>(d_ptr->m_values, property);
3881
3882
3883
3884
3887 return getData<QRect>(d_ptr->m_values, &QtRectPropertyManagerPrivate::Data::constraint, property, QRect());
3891
3892
3895 const auto it = d_ptr->m_values.constFind(property);
3896 if (it == d_ptr->m_values.constEnd())
3898 const QRect v = it.value().val;
3899 return tr(
"[(%1, %2), %3 x %4]").arg(v.x()) .arg(v.y())
3900 .arg(v.width()).arg(v.height());
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3917 const auto it = d_ptr->m_values.find(property);
3918 if (it == d_ptr->m_values.end())
3923 QRect newRect = val.normalized();
3924 if (!data.constraint.isNull() && !data.constraint.contains(newRect)) {
3925 const QRect r1 = data.constraint;
3926 const QRect r2 = newRect;
3927 newRect.setLeft(qMax(r1.left(), r2.left()));
3928 newRect.setRight(qMin(r1.right(), r2.right()));
3929 newRect.setTop(qMax(r1.top(), r2.top()));
3930 newRect.setBottom(qMin(r1.bottom(), r2.bottom()));
3931 if (newRect.width() < 0 || newRect.height() < 0)
3935 if (data.val == newRect)
3941 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToX[property], newRect.x());
3942 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToY[property], newRect.y());
3943 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToW[property], newRect.width());
3944 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToH[property], newRect.height());
3946 emit propertyChanged(property);
3947 emit valueChanged(property, data.val);
3951
3952
3953
3954
3955
3956
3957
3958
3959
3962 const auto it = d_ptr->m_values.find(property);
3963 if (it == d_ptr->m_values.end())
3968 QRect newConstraint = constraint.normalized();
3969 if (data.constraint == newConstraint)
3972 const QRect oldVal = data.val;
3974 data.constraint = newConstraint;
3976 if (!data.constraint.isNull() && !data.constraint.contains(oldVal)) {
3977 QRect r1 = data.constraint;
3978 QRect r2 = data.val;
3980 if (r2.width() > r1.width())
3981 r2.setWidth(r1.width());
3982 if (r2.height() > r1.height())
3983 r2.setHeight(r1.height());
3984 if (r2.left() < r1.left())
3985 r2.moveLeft(r1.left());
3986 else if (r2.right() > r1.right())
3987 r2.moveRight(r1.right());
3988 if (r2.top() < r1.top())
3989 r2.moveTop(r1.top());
3990 else if (r2.bottom() > r1.bottom())
3991 r2.moveBottom(r1.bottom());
3998 emit constraintChanged(property, data.constraint);
4000 d_ptr->setConstraint(property, data.constraint, data.val);
4002 if (data.val == oldVal)
4005 emit propertyChanged(property);
4006 emit valueChanged(property, data.val);
4010
4011
4014 d_ptr->m_values[property] = QtRectPropertyManagerPrivate::Data();
4016 QtProperty *xProp = d_ptr->m_intPropertyManager->addProperty();
4017 xProp->setPropertyName(tr(
"X"));
4018 d_ptr->m_intPropertyManager->setValue(xProp, 0);
4019 d_ptr->m_propertyToX[property] = xProp;
4020 d_ptr->m_xToProperty[xProp] = property;
4023 QtProperty *yProp = d_ptr->m_intPropertyManager->addProperty();
4024 yProp->setPropertyName(tr(
"Y"));
4025 d_ptr->m_intPropertyManager->setValue(yProp, 0);
4026 d_ptr->m_propertyToY[property] = yProp;
4027 d_ptr->m_yToProperty[yProp] = property;
4030 QtProperty *wProp = d_ptr->m_intPropertyManager->addProperty();
4031 wProp->setPropertyName(tr(
"Width"));
4032 d_ptr->m_intPropertyManager->setValue(wProp, 0);
4033 d_ptr->m_intPropertyManager->setMinimum(wProp, 0);
4034 d_ptr->m_propertyToW[property] = wProp;
4035 d_ptr->m_wToProperty[wProp] = property;
4038 QtProperty *hProp = d_ptr->m_intPropertyManager->addProperty();
4039 hProp->setPropertyName(tr(
"Height"));
4040 d_ptr->m_intPropertyManager->setValue(hProp, 0);
4041 d_ptr->m_intPropertyManager->setMinimum(hProp, 0);
4042 d_ptr->m_propertyToH[property] = hProp;
4043 d_ptr->m_hToProperty[hProp] = property;
4048
4049
4052 QtProperty *xProp = d_ptr->m_propertyToX[property];
4054 d_ptr->m_xToProperty.remove(xProp);
4057 d_ptr->m_propertyToX.remove(property);
4059 QtProperty *yProp = d_ptr->m_propertyToY[property];
4061 d_ptr->m_yToProperty.remove(yProp);
4064 d_ptr->m_propertyToY.remove(property);
4066 QtProperty *wProp = d_ptr->m_propertyToW[property];
4068 d_ptr->m_wToProperty.remove(wProp);
4071 d_ptr->m_propertyToW.remove(property);
4073 QtProperty *hProp = d_ptr->m_propertyToH[property];
4075 d_ptr->m_hToProperty.remove(hProp);
4078 d_ptr->m_propertyToH.remove(property);
4080 d_ptr->m_values.remove(property);
4088 Q_DECLARE_PUBLIC(QtRectFPropertyManager)
4119 if (
QtProperty *prop = m_xToProperty.value(property,
nullptr)) {
4120 QRectF r = m_values[prop].val;
4122 q_ptr->setValue(prop, r);
4123 }
else if (
QtProperty *prop = m_yToProperty.value(property,
nullptr)) {
4124 QRectF r = m_values[prop].val;
4126 q_ptr->setValue(prop, r);
4127 }
else if (
QtProperty *prop = m_wToProperty.value(property,
nullptr)) {
4128 Data data = m_values[prop];
4129 QRectF r = data.val;
4131 if (!data.constraint.isNull() && data.constraint.x() + data.constraint.width() < r.x() + r.width()) {
4132 r.moveLeft(data.constraint.left() + data.constraint.width() - r.width());
4134 q_ptr->setValue(prop, r);
4135 }
else if (
QtProperty *prop = m_hToProperty.value(property,
nullptr)) {
4136 Data data = m_values[prop];
4137 QRectF r = data.val;
4139 if (!data.constraint.isNull() && data.constraint.y() + data.constraint.height() < r.y() + r.height()) {
4140 r.moveTop(data.constraint.top() + data.constraint.height() - r.height());
4142 q_ptr->setValue(prop, r);
4148 if (
QtProperty *pointProp = m_xToProperty.value(property,
nullptr)) {
4149 m_propertyToX[pointProp] =
nullptr;
4150 m_xToProperty.remove(property);
4151 }
else if (
QtProperty *pointProp = m_yToProperty.value(property,
nullptr)) {
4152 m_propertyToY[pointProp] =
nullptr;
4153 m_yToProperty.remove(property);
4154 }
else if (
QtProperty *pointProp = m_wToProperty.value(property,
nullptr)) {
4155 m_propertyToW[pointProp] =
nullptr;
4156 m_wToProperty.remove(property);
4157 }
else if (
QtProperty *pointProp = m_hToProperty.value(property,
nullptr)) {
4158 m_propertyToH[pointProp] =
nullptr;
4159 m_hToProperty.remove(property);
4164 const QRectF &constraint,
const QRectF &val)
4166 const bool isNull = constraint.isNull();
4167 const float left = isNull ? FLT_MIN : constraint.left();
4168 const float right = isNull ? FLT_MAX : constraint.left() + constraint.width();
4169 const float top = isNull ? FLT_MIN : constraint.top();
4170 const float bottom = isNull ? FLT_MAX : constraint.top() + constraint.height();
4171 const float width = isNull ? FLT_MAX : constraint.width();
4172 const float height = isNull ? FLT_MAX : constraint.height();
4174 m_doublePropertyManager->setRange(m_propertyToX[property], left, right);
4175 m_doublePropertyManager->setRange(m_propertyToY[property], top, bottom);
4176 m_doublePropertyManager->setRange(m_propertyToW[property], 0, width);
4177 m_doublePropertyManager->setRange(m_propertyToH[property], 0, height);
4179 m_doublePropertyManager->setValue(m_propertyToX[property], val.x());
4180 m_doublePropertyManager->setValue(m_propertyToY[property], val.y());
4181 m_doublePropertyManager->setValue(m_propertyToW[property], val.width());
4182 m_doublePropertyManager->setValue(m_propertyToH[property], val.height());
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4216
4217
4218
4219
4220
4221
4222
4223
4226
4227
4228
4229
4230
4231
4232
4233
4236
4237
4238
4239
4240
4241
4242
4243
4246
4247
4251 d_ptr->q_ptr =
this;
4253 d_ptr->m_doublePropertyManager =
new QtDoublePropertyManager(
this);
4254 connect(d_ptr->m_doublePropertyManager, &QtDoublePropertyManager::valueChanged,
this,
4255 [
this](QtProperty *property,
double value) { d_ptr->slotDoubleChanged(property, value); });
4256 connect(d_ptr->m_doublePropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
4257 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
4261
4262
4269
4270
4271
4272
4273
4274
4275
4276
4277
4280 return d_ptr->m_doublePropertyManager;
4284
4285
4286
4287
4288
4289
4290
4293 return getValue<QRectF>(d_ptr->m_values, property);
4297
4298
4299
4300
4303 return getData<
int>(d_ptr->m_values, &QtRectFPropertyManagerPrivate::Data::decimals, property, 0);
4307
4308
4309
4310
4313 return getData<QRectF>(d_ptr->m_values, &QtRectFPropertyManagerPrivate::Data::constraint, property, QRect());
4317
4318
4321 const auto it = d_ptr->m_values.constFind(property);
4322 if (it == d_ptr->m_values.constEnd())
4324 const QRectF v = it.value().val;
4325 const int dec = it.value().decimals;
4326 return QString(tr(
"[(%1, %2), %3 x %4]").arg(QString::number(v.x(),
'f', dec),
4327 QString::number(v.y(),
'f', dec),
4328 QString::number(v.width(),
'f', dec),
4329 QString::number(v.height(),
'f', dec)));
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4346 const auto it = d_ptr->m_values.find(property);
4347 if (it == d_ptr->m_values.end())
4352 QRectF newRect = val.normalized();
4353 if (!data.constraint.isNull() && !data.constraint.contains(newRect)) {
4354 const QRectF r1 = data.constraint;
4355 const QRectF r2 = newRect;
4356 newRect.setLeft(qMax(r1.left(), r2.left()));
4357 newRect.setRight(qMin(r1.right(), r2.right()));
4358 newRect.setTop(qMax(r1.top(), r2.top()));
4359 newRect.setBottom(qMin(r1.bottom(), r2.bottom()));
4360 if (newRect.width() < 0 || newRect.height() < 0)
4364 if (data.val == newRect)
4370 d_ptr->m_doublePropertyManager->setValue(d_ptr->m_propertyToX[property], newRect.x());
4371 d_ptr->m_doublePropertyManager->setValue(d_ptr->m_propertyToY[property], newRect.y());
4372 d_ptr->m_doublePropertyManager->setValue(d_ptr->m_propertyToW[property], newRect.width());
4373 d_ptr->m_doublePropertyManager->setValue(d_ptr->m_propertyToH[property], newRect.height());
4375 emit propertyChanged(property);
4376 emit valueChanged(property, data.val);
4380
4381
4382
4383
4384
4385
4386
4387
4388
4391 const auto it = d_ptr->m_values.find(property);
4392 if (it == d_ptr->m_values.end())
4397 QRectF newConstraint = constraint.normalized();
4398 if (data.constraint == newConstraint)
4401 const QRectF oldVal = data.val;
4403 data.constraint = newConstraint;
4405 if (!data.constraint.isNull() && !data.constraint.contains(oldVal)) {
4406 QRectF r1 = data.constraint;
4407 QRectF r2 = data.val;
4409 if (r2.width() > r1.width())
4410 r2.setWidth(r1.width());
4411 if (r2.height() > r1.height())
4412 r2.setHeight(r1.height());
4413 if (r2.left() < r1.left())
4414 r2.moveLeft(r1.left());
4415 else if (r2.right() > r1.right())
4416 r2.moveRight(r1.right());
4417 if (r2.top() < r1.top())
4418 r2.moveTop(r1.top());
4419 else if (r2.bottom() > r1.bottom())
4420 r2.moveBottom(r1.bottom());
4427 emit constraintChanged(property, data.constraint);
4429 d_ptr->setConstraint(property, data.constraint, data.val);
4431 if (data.val == oldVal)
4434 emit propertyChanged(property);
4435 emit valueChanged(property, data.val);
4439
4440
4441
4442
4443
4444
4445
4446
4449 const auto it = d_ptr->m_values.find(property);
4450 if (it == d_ptr->m_values.end())
4464 d_ptr->m_doublePropertyManager->setDecimals(d_ptr->m_propertyToX[property], prec);
4465 d_ptr->m_doublePropertyManager->setDecimals(d_ptr->m_propertyToY[property], prec);
4466 d_ptr->m_doublePropertyManager->setDecimals(d_ptr->m_propertyToW[property], prec);
4467 d_ptr->m_doublePropertyManager->setDecimals(d_ptr->m_propertyToH[property], prec);
4471 emit decimalsChanged(property, data.decimals);
4475
4476
4479 d_ptr->m_values[property] = QtRectFPropertyManagerPrivate::Data();
4481 QtProperty *xProp = d_ptr->m_doublePropertyManager->addProperty();
4482 xProp->setPropertyName(tr(
"X"));
4483 d_ptr->m_doublePropertyManager->setDecimals(xProp, decimals(property));
4484 d_ptr->m_doublePropertyManager->setValue(xProp, 0);
4485 d_ptr->m_propertyToX[property] = xProp;
4486 d_ptr->m_xToProperty[xProp] = property;
4489 QtProperty *yProp = d_ptr->m_doublePropertyManager->addProperty();
4490 yProp->setPropertyName(tr(
"Y"));
4491 d_ptr->m_doublePropertyManager->setDecimals(yProp, decimals(property));
4492 d_ptr->m_doublePropertyManager->setValue(yProp, 0);
4493 d_ptr->m_propertyToY[property] = yProp;
4494 d_ptr->m_yToProperty[yProp] = property;
4497 QtProperty *wProp = d_ptr->m_doublePropertyManager->addProperty();
4498 wProp->setPropertyName(tr(
"Width"));
4499 d_ptr->m_doublePropertyManager->setDecimals(wProp, decimals(property));
4500 d_ptr->m_doublePropertyManager->setValue(wProp, 0);
4501 d_ptr->m_doublePropertyManager->setMinimum(wProp, 0);
4502 d_ptr->m_propertyToW[property] = wProp;
4503 d_ptr->m_wToProperty[wProp] = property;
4506 QtProperty *hProp = d_ptr->m_doublePropertyManager->addProperty();
4507 hProp->setPropertyName(tr(
"Height"));
4508 d_ptr->m_doublePropertyManager->setDecimals(hProp, decimals(property));
4509 d_ptr->m_doublePropertyManager->setValue(hProp, 0);
4510 d_ptr->m_doublePropertyManager->setMinimum(hProp, 0);
4511 d_ptr->m_propertyToH[property] = hProp;
4512 d_ptr->m_hToProperty[hProp] = property;
4517
4518
4521 QtProperty *xProp = d_ptr->m_propertyToX[property];
4523 d_ptr->m_xToProperty.remove(xProp);
4526 d_ptr->m_propertyToX.remove(property);
4528 QtProperty *yProp = d_ptr->m_propertyToY[property];
4530 d_ptr->m_yToProperty.remove(yProp);
4533 d_ptr->m_propertyToY.remove(property);
4535 QtProperty *wProp = d_ptr->m_propertyToW[property];
4537 d_ptr->m_wToProperty.remove(wProp);
4540 d_ptr->m_propertyToW.remove(property);
4542 QtProperty *hProp = d_ptr->m_propertyToH[property];
4544 d_ptr->m_hToProperty.remove(hProp);
4547 d_ptr->m_propertyToH.remove(property);
4549 d_ptr->m_values.remove(property);
4557 Q_DECLARE_PUBLIC(QtEnumPropertyManager)
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4597
4598
4599
4600
4601
4602
4603
4604
4607
4608
4609
4610
4611
4612
4613
4614
4617
4618
4619
4620
4621
4622
4623
4624
4627
4628
4632 d_ptr->q_ptr =
this;
4636
4637
4644
4645
4646
4647
4648
4649
4650
4651
4654 return getValue<
int>(d_ptr->m_values, property, -1);
4658
4659
4660
4661
4664 return getData<QStringList>(d_ptr->m_values, &QtEnumPropertyManagerPrivate::Data::enumNames, property, QStringList());
4668
4669
4670
4671
4674 return getData<QMap<
int, QIcon> >(d_ptr->m_values, &QtEnumPropertyManagerPrivate::Data::enumIcons, property, QMap<
int, QIcon>());
4678
4679
4682 const auto it = d_ptr->m_values.constFind(property);
4683 if (it == d_ptr->m_values.constEnd())
4686 const QtEnumPropertyManagerPrivate::Data &data = it.value();
4688 const int v = data.val;
4689 if (v >= 0 && v < data.enumNames.size())
4690 return data.enumNames.at(v);
4695
4696
4699 const auto it = d_ptr->m_values.constFind(property);
4700 if (it == d_ptr->m_values.constEnd())
4703 const QtEnumPropertyManagerPrivate::Data &data = it.value();
4705 const int v = data.val;
4706 return data.enumIcons.value(v);
4710
4711
4712
4713
4714
4715
4716
4717
4718
4721 const auto it = d_ptr->m_values.find(property);
4722 if (it == d_ptr->m_values.end())
4725 QtEnumPropertyManagerPrivate::Data data = it.value();
4727 if (val >= data.enumNames.size())
4730 if (val < 0 && data.enumNames.size() > 0)
4736 if (data.val == val)
4743 emit propertyChanged(property);
4744 emit valueChanged(property, data.val);
4748
4749
4750
4751
4752
4753
4754
4755
4756
4759 const auto it = d_ptr->m_values.find(property);
4760 if (it == d_ptr->m_values.end())
4763 QtEnumPropertyManagerPrivate::Data data = it.value();
4765 if (data.enumNames == enumNames)
4768 data.enumNames = enumNames;
4772 if (enumNames.size() > 0)
4777 emit enumNamesChanged(property, data.enumNames);
4779 emit propertyChanged(property);
4780 emit valueChanged(property, data.val);
4784
4785
4786
4787
4788
4789
4790
4793 const auto it = d_ptr->m_values.find(property);
4794 if (it == d_ptr->m_values.end())
4797 it.value().enumIcons = enumIcons;
4799 emit enumIconsChanged(property, it.value().enumIcons);
4801 emit propertyChanged(property);
4805
4806
4809 d_ptr->m_values[property] = QtEnumPropertyManagerPrivate::Data();
4813
4814
4817 d_ptr->m_values.remove(property);
4825 Q_DECLARE_PUBLIC(QtFlagPropertyManager)
4848 QtProperty *prop = m_flagToProperty.value(property,
nullptr);
4849 if (prop ==
nullptr)
4852 const auto pfit = m_propertyToFlags.constFind(prop);
4853 if (pfit == m_propertyToFlags.constEnd())
4856 for (QtProperty *p : pfit.value()) {
4857 if (p == property) {
4858 int v = m_values[prop].val;
4864 q_ptr->setValue(prop, v);
4873 QtProperty *flagProperty = m_flagToProperty.value(property,
nullptr);
4874 if (flagProperty ==
nullptr)
4877 m_propertyToFlags[flagProperty].replace(m_propertyToFlags[flagProperty].indexOf(property), 0);
4878 m_flagToProperty.remove(property);
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4916
4917
4918
4919
4920
4921
4922
4923
4926
4927
4928
4929
4930
4931
4932
4933
4936
4937
4941 d_ptr->q_ptr =
this;
4943 d_ptr->m_boolPropertyManager =
new QtBoolPropertyManager(
this);
4944 connect(d_ptr->m_boolPropertyManager, &QtBoolPropertyManager::valueChanged,
this,
4945 [
this](QtProperty *property,
bool value) { d_ptr->slotBoolChanged(property, value); });
4946 connect(d_ptr->m_boolPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
4947 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
4951
4952
4959
4960
4961
4962
4963
4964
4965
4966
4967
4970 return d_ptr->m_boolPropertyManager;
4974
4975
4976
4977
4978
4979
4980
4983 return getValue<
int>(d_ptr->m_values, property, 0);
4987
4988
4989
4990
4993 return getData<QStringList>(d_ptr->m_values, &QtFlagPropertyManagerPrivate::Data::flagNames, property, QStringList());
4997
4998
5001 const auto it = d_ptr->m_values.constFind(property);
5002 if (it == d_ptr->m_values.constEnd())
5009 const QChar bar = QLatin1Char(
'|');
5010 for (
const auto &name : data.flagNames) {
5011 if (data.val & (1 << level)) {
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5037 const auto it = d_ptr->m_values.find(property);
5038 if (it == d_ptr->m_values.end())
5043 if (data
.val == val)
5046 if (val > (1 << data.flagNames.size()) - 1)
5056 const auto pfit = d_ptr->m_propertyToFlags.constFind(property);
5058 if (pfit != d_ptr->m_propertyToFlags.constEnd()) {
5059 for (QtProperty *prop : pfit.value()) {
5061 d_ptr->m_boolPropertyManager->setValue(prop, val & (1 << level));
5066 emit propertyChanged(property);
5067 emit valueChanged(property, data.val);
5071
5072
5073
5074
5075
5076
5079 const auto it = d_ptr->m_values.find(property);
5080 if (it == d_ptr->m_values.end())
5085 if (data.flagNames == flagNames)
5088 data.flagNames = flagNames;
5093 const auto pfit = d_ptr->m_propertyToFlags.find(property);
5094 if (pfit != d_ptr->m_propertyToFlags.end()) {
5095 for (QtProperty *prop : std::as_const(pfit.value())) {
5098 d_ptr->m_flagToProperty.remove(prop);
5101 pfit.value().clear();
5104 for (
const QString &flagName : flagNames) {
5105 QtProperty *prop = d_ptr->m_boolPropertyManager->addProperty();
5106 prop->setPropertyName(flagName);
5107 property->addSubProperty(prop);
5108 d_ptr->m_propertyToFlags[property].append(prop);
5109 d_ptr->m_flagToProperty[prop] = property;
5112 emit flagNamesChanged(property, data.flagNames);
5114 emit propertyChanged(property);
5115 emit valueChanged(property, data.val);
5119
5120
5123 d_ptr->m_values[property] = QtFlagPropertyManagerPrivate::Data();
5125 d_ptr->m_propertyToFlags[property] = QList<QtProperty *>();
5129
5130
5133 const auto it = d_ptr->m_propertyToFlags.find(property);
5134 if (it != d_ptr->m_propertyToFlags.end()) {
5135 for (QtProperty *prop : std::as_const(it.value())) {
5137 d_ptr->m_flagToProperty.remove(prop);
5142 d_ptr->m_propertyToFlags.erase(it);
5144 d_ptr->m_values.remove(property);
5152 Q_DECLARE_PUBLIC(QtSizePolicyPropertyManager)
5183 if (
QtProperty *prop = m_hStretchToProperty.value(property,
nullptr)) {
5184 QSizePolicy sp = m_values[prop];
5185 sp.setHorizontalStretch(value);
5186 q_ptr->setValue(prop, sp);
5187 }
else if (
QtProperty *prop = m_vStretchToProperty.value(property,
nullptr)) {
5188 QSizePolicy sp = m_values[prop];
5189 sp.setVerticalStretch(value);
5190 q_ptr->setValue(prop, sp);
5196 if (
QtProperty *prop = m_hPolicyToProperty.value(property,
nullptr)) {
5197 QSizePolicy sp = m_values[prop];
5198 sp.setHorizontalPolicy(metaEnumProvider()->indexToSizePolicy(value));
5199 q_ptr->setValue(prop, sp);
5200 }
else if (
QtProperty *prop = m_vPolicyToProperty.value(property,
nullptr)) {
5201 QSizePolicy sp = m_values[prop];
5202 sp.setVerticalPolicy(metaEnumProvider()->indexToSizePolicy(value));
5203 q_ptr->setValue(prop, sp);
5209 if (
QtProperty *pointProp = m_hStretchToProperty.value(property,
nullptr)) {
5210 m_propertyToHStretch[pointProp] =
nullptr;
5211 m_hStretchToProperty.remove(property);
5212 }
else if (
QtProperty *pointProp = m_vStretchToProperty.value(property,
nullptr)) {
5213 m_propertyToVStretch[pointProp] =
nullptr;
5214 m_vStretchToProperty.remove(property);
5215 }
else if (
QtProperty *pointProp = m_hPolicyToProperty.value(property,
nullptr)) {
5216 m_propertyToHPolicy[pointProp] =
nullptr;
5217 m_hPolicyToProperty.remove(property);
5218 }
else if (
QtProperty *pointProp = m_vPolicyToProperty.value(property,
nullptr)) {
5219 m_propertyToVPolicy[pointProp] =
nullptr;
5220 m_vPolicyToProperty.remove(property);
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5251
5252
5253
5254
5255
5256
5257
5258
5261
5262
5266 d_ptr->q_ptr =
this;
5268 d_ptr->m_intPropertyManager =
new QtIntPropertyManager(
this);
5269 connect(d_ptr->m_intPropertyManager, &QtIntPropertyManager::valueChanged,
this,
5270 [
this](QtProperty *property,
int value) { d_ptr->slotIntChanged(property, value); });
5271 connect(d_ptr->m_intPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
5272 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
5274 d_ptr->m_enumPropertyManager =
new QtEnumPropertyManager(
this);
5275 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::valueChanged,
this,
5276 [
this](QtProperty *property,
int value) { d_ptr->slotEnumChanged(property, value); });
5277 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::propertyDestroyed,
this,
5278 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
5282
5283
5290
5291
5292
5293
5294
5295
5296
5297
5298
5301 return d_ptr->m_intPropertyManager;
5305
5306
5307
5308
5309
5310
5311
5312
5313
5316 return d_ptr->m_enumPropertyManager;
5320
5321
5322
5323
5324
5325
5326
5329 return d_ptr->m_values.value(property, QSizePolicy());
5333
5334
5337 const auto it = d_ptr->m_values.constFind(property);
5338 if (it == d_ptr->m_values.constEnd())
5341 const QSizePolicy sp = it.value();
5343 const int hIndex = mep->sizePolicyToIndex(sp.horizontalPolicy());
5344 const int vIndex = mep->sizePolicyToIndex(sp.verticalPolicy());
5346 const QString hPolicy = hIndex != -1 ? mep->policyEnumNames().at(hIndex) : tr(
"<Invalid>");
5347 const QString vPolicy = vIndex != -1 ? mep->policyEnumNames().at(vIndex) : tr(
"<Invalid>");
5348 const QString str = tr(
"[%1, %2, %3, %4]").arg(hPolicy, vPolicy).arg(sp.horizontalStretch()).arg(sp.verticalStretch());
5353
5354
5355
5356
5357
5358
5359
5362 const auto it = d_ptr->m_values.find(property);
5363 if (it == d_ptr->m_values.end())
5366 if (it.value() == val)
5371 d_ptr->m_enumPropertyManager->setValue(d_ptr->m_propertyToHPolicy[property],
5372 metaEnumProvider()->sizePolicyToIndex(val.horizontalPolicy()));
5373 d_ptr->m_enumPropertyManager->setValue(d_ptr->m_propertyToVPolicy[property],
5374 metaEnumProvider()->sizePolicyToIndex(val.verticalPolicy()));
5375 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToHStretch[property],
5376 val.horizontalStretch());
5377 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToVStretch[property],
5378 val.verticalStretch());
5380 emit propertyChanged(property);
5381 emit valueChanged(property, val);
5385
5386
5390 d_ptr->m_values[property] = val;
5392 QtProperty *hPolicyProp = d_ptr->m_enumPropertyManager->addProperty();
5393 hPolicyProp->setPropertyName(tr(
"Horizontal Policy"));
5394 d_ptr->m_enumPropertyManager->setEnumNames(hPolicyProp, metaEnumProvider()->policyEnumNames());
5395 d_ptr->m_enumPropertyManager->setValue(hPolicyProp,
5396 metaEnumProvider()->sizePolicyToIndex(val.horizontalPolicy()));
5397 d_ptr->m_propertyToHPolicy[property] = hPolicyProp;
5398 d_ptr->m_hPolicyToProperty[hPolicyProp] = property;
5401 QtProperty *vPolicyProp = d_ptr->m_enumPropertyManager->addProperty();
5402 vPolicyProp->setPropertyName(tr(
"Vertical Policy"));
5403 d_ptr->m_enumPropertyManager->setEnumNames(vPolicyProp, metaEnumProvider()->policyEnumNames());
5404 d_ptr->m_enumPropertyManager->setValue(vPolicyProp,
5405 metaEnumProvider()->sizePolicyToIndex(val.verticalPolicy()));
5406 d_ptr->m_propertyToVPolicy[property] = vPolicyProp;
5407 d_ptr->m_vPolicyToProperty[vPolicyProp] = property;
5410 QtProperty *hStretchProp = d_ptr->m_intPropertyManager->addProperty();
5411 hStretchProp->setPropertyName(tr(
"Horizontal Stretch"));
5412 d_ptr->m_intPropertyManager->setValue(hStretchProp, val.horizontalStretch());
5413 d_ptr->m_intPropertyManager->setRange(hStretchProp, 0, 0xff);
5414 d_ptr->m_propertyToHStretch[property] = hStretchProp;
5415 d_ptr->m_hStretchToProperty[hStretchProp] = property;
5418 QtProperty *vStretchProp = d_ptr->m_intPropertyManager->addProperty();
5419 vStretchProp->setPropertyName(tr(
"Vertical Stretch"));
5420 d_ptr->m_intPropertyManager->setValue(vStretchProp, val.verticalStretch());
5421 d_ptr->m_intPropertyManager->setRange(vStretchProp, 0, 0xff);
5422 d_ptr->m_propertyToVStretch[property] = vStretchProp;
5423 d_ptr->m_vStretchToProperty[vStretchProp] = property;
5429
5430
5433 QtProperty *hPolicyProp = d_ptr->m_propertyToHPolicy[property];
5435 d_ptr->m_hPolicyToProperty.remove(hPolicyProp);
5438 d_ptr->m_propertyToHPolicy.remove(property);
5440 QtProperty *vPolicyProp = d_ptr->m_propertyToVPolicy[property];
5442 d_ptr->m_vPolicyToProperty.remove(vPolicyProp);
5445 d_ptr->m_propertyToVPolicy.remove(property);
5447 QtProperty *hStretchProp = d_ptr->m_propertyToHStretch[property];
5449 d_ptr->m_hStretchToProperty.remove(hStretchProp);
5450 delete hStretchProp;
5452 d_ptr->m_propertyToHStretch.remove(property);
5454 QtProperty *vStretchProp = d_ptr->m_propertyToVStretch[property];
5456 d_ptr->m_vStretchToProperty.remove(vStretchProp);
5457 delete vStretchProp;
5459 d_ptr->m_propertyToVStretch.remove(property);
5461 d_ptr->m_values.remove(property);
5475 Q_DECLARE_PUBLIC(QtFontPropertyManager)
5519 m_fontDatabaseChangeTimer(0)
5527 if (
QtProperty *prop = m_pointSizeToProperty.value(property,
nullptr)) {
5528 QFont f = m_values[prop];
5529 f.setPointSize(value);
5530 q_ptr->setValue(prop, f);
5538 if (
QtProperty *prop = m_familyToProperty.value(property,
nullptr)) {
5539 QFont f = m_values[prop];
5540 f.setFamily(m_familyNames.at(value));
5541 q_ptr->setValue(prop, f);
5542 }
else if (
auto *prop = m_weightToProperty.value(property,
nullptr)) {
5543 QFont f = m_values[prop];
5544 f.setWeight(weightFromIndex(value));
5545 q_ptr->setValue(prop, f);
5553 if (
QtProperty *prop = m_boldToProperty.value(property,
nullptr)) {
5554 QFont f = m_values[prop];
5556 q_ptr->setValue(prop, f);
5557 }
else if (
QtProperty *prop = m_italicToProperty.value(property,
nullptr)) {
5558 QFont f = m_values[prop];
5560 q_ptr->setValue(prop, f);
5561 }
else if (
QtProperty *prop = m_underlineToProperty.value(property,
nullptr)) {
5562 QFont f = m_values[prop];
5563 f.setUnderline(value);
5564 q_ptr->setValue(prop, f);
5565 }
else if (
QtProperty *prop = m_strikeOutToProperty.value(property,
nullptr)) {
5566 QFont f = m_values[prop];
5567 f.setStrikeOut(value);
5568 q_ptr->setValue(prop, f);
5569 }
else if (
QtProperty *prop = m_kerningToProperty.value(property,
nullptr)) {
5570 QFont f = m_values[prop];
5571 f.setKerning(value);
5572 q_ptr->setValue(prop, f);
5578 if (
QtProperty *pointProp = m_pointSizeToProperty.value(property,
nullptr)) {
5579 m_propertyToPointSize[pointProp] =
nullptr;
5580 m_pointSizeToProperty.remove(property);
5581 }
else if (
QtProperty *pointProp = m_familyToProperty.value(property,
nullptr)) {
5582 m_propertyToFamily[pointProp] =
nullptr;
5583 m_familyToProperty.remove(property);
5584 }
else if (
QtProperty *pointProp = m_boldToProperty.value(property,
nullptr)) {
5585 m_propertyToBold[pointProp] =
nullptr;
5586 m_boldToProperty.remove(property);
5587 }
else if (
QtProperty *pointProp = m_italicToProperty.value(property,
nullptr)) {
5588 m_propertyToItalic[pointProp] =
nullptr;
5589 m_italicToProperty.remove(property);
5590 }
else if (
QtProperty *pointProp = m_underlineToProperty.value(property,
nullptr)) {
5591 m_propertyToUnderline[pointProp] =
nullptr;
5592 m_underlineToProperty.remove(property);
5593 }
else if (
QtProperty *pointProp = m_strikeOutToProperty.value(property,
nullptr)) {
5594 m_propertyToStrikeOut[pointProp] =
nullptr;
5595 m_strikeOutToProperty.remove(property);
5596 }
else if (
QtProperty *pointProp = m_kerningToProperty.value(property,
nullptr)) {
5597 m_propertyToKerning[pointProp] =
nullptr;
5598 m_kerningToProperty.remove(property);
5599 }
else if (
QtProperty *weightProp = m_weightToProperty.value(property,
nullptr)) {
5600 m_propertyToWeight[weightProp] =
nullptr;
5601 m_weightToProperty.remove(property);
5607 if (!m_fontDatabaseChangeTimer) {
5608 m_fontDatabaseChangeTimer =
new QTimer(q_ptr);
5609 m_fontDatabaseChangeTimer->setInterval(0);
5610 m_fontDatabaseChangeTimer->setSingleShot(
true);
5611 QObject::connect(m_fontDatabaseChangeTimer, &QTimer::timeout, q_ptr,
5612 [
this] { slotFontDatabaseDelayedChange(); });
5614 if (!m_fontDatabaseChangeTimer->isActive())
5615 m_fontDatabaseChangeTimer->start();
5621 const QStringList oldFamilies = m_familyNames;
5622 m_familyNames = QFontDatabase::families();
5625 if (!m_propertyToFamily.isEmpty()) {
5626 for (QtProperty *familyProp : std::as_const(m_propertyToFamily)) {
5627 const int oldIdx = m_enumPropertyManager->value(familyProp);
5628 int newIdx = m_familyNames.indexOf(oldFamilies.at(oldIdx));
5631 m_enumPropertyManager->setEnumNames(familyProp, m_familyNames);
5632 m_enumPropertyManager->setValue(familyProp, newIdx);
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5665
5666
5667
5668
5669
5670
5671
5672
5675
5676
5680 d_ptr->q_ptr =
this;
5681 QObject::connect(qApp, &QGuiApplication::fontDatabaseChanged,
this,
5682 [
this] { d_ptr->slotFontDatabaseChanged(); });
5684 d_ptr->m_intPropertyManager =
new QtIntPropertyManager(
this);
5685 connect(d_ptr->m_intPropertyManager, &QtIntPropertyManager::valueChanged,
this,
5686 [
this](QtProperty *property,
int value) { d_ptr->slotIntChanged(property, value); });
5687 connect(d_ptr->m_intPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
5688 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
5690 d_ptr->m_enumPropertyManager =
new QtEnumPropertyManager(
this);
5691 connect(d_ptr->m_enumPropertyManager, &QtEnumPropertyManager::valueChanged,
this,
5692 [
this](QtProperty *property,
int value) { d_ptr->slotEnumChanged(property, value); });
5693 connect(d_ptr->m_enumPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
5694 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
5696 d_ptr->m_boolPropertyManager =
new QtBoolPropertyManager(
this);
5697 connect(d_ptr->m_boolPropertyManager, &QtBoolPropertyManager::valueChanged,
this,
5698 [
this](QtProperty *property,
bool value) { d_ptr->slotBoolChanged(property, value); });
5699 connect(d_ptr->m_boolPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
5700 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
5704
5705
5712
5713
5714
5715
5716
5717
5718
5719
5722 return d_ptr->m_intPropertyManager;
5726
5727
5728
5729
5730
5731
5732
5733
5736 return d_ptr->m_enumPropertyManager;
5740
5741
5742
5743
5744
5745
5746
5747
5748
5751 return d_ptr->m_boolPropertyManager;
5755
5756
5757
5758
5759
5760
5761
5762
5765 return d_ptr->m_values.value(property, QFont());
5769
5770
5773 const auto it = d_ptr->m_values.constFind(property);
5774 if (it == d_ptr->m_values.constEnd())
5777 return QtPropertyBrowserUtils::fontValueText(it.value());
5781
5782
5785 const auto it = d_ptr->m_values.constFind(property);
5786 if (it == d_ptr->m_values.constEnd())
5789 return QtPropertyBrowserUtils::fontValueIcon(it.value());
5793
5794
5795
5796
5797
5798
5799
5802 const auto it = d_ptr->m_values.find(property);
5803 if (it == d_ptr->m_values.end())
5806 const QFont oldVal = it.value();
5807 if (oldVal == val && oldVal.resolveMask() == val.resolveMask())
5812 int idx = d_ptr->m_familyNames.indexOf(val.family());
5815 bool settingValue = d_ptr->m_settingValue;
5816 d_ptr->m_settingValue =
true;
5817 d_ptr->m_enumPropertyManager->setValue(d_ptr->m_propertyToFamily[property], idx);
5818 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToPointSize[property], val.pointSize());
5819 d_ptr->m_boolPropertyManager->setValue(d_ptr->m_propertyToBold[property], val.bold());
5820 d_ptr->m_boolPropertyManager->setValue(d_ptr->m_propertyToItalic[property], val.italic());
5821 d_ptr->m_boolPropertyManager->setValue(d_ptr->m_propertyToUnderline[property], val.underline());
5822 d_ptr->m_boolPropertyManager->setValue(d_ptr->m_propertyToStrikeOut[property], val.strikeOut());
5823 d_ptr->m_boolPropertyManager->setValue(d_ptr->m_propertyToKerning[property], val.kerning());
5824 d_ptr->m_enumPropertyManager->setValue(d_ptr->m_propertyToWeight[property],
5825 indexOfFontWeight(val.weight()));
5826 d_ptr->m_settingValue = settingValue;
5828 emit propertyChanged(property);
5829 emit valueChanged(property, val);
5834 static const DisambiguatedTranslation weightsC[] = {
5835 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"Thin",
"QFont::Weight combo"),
5836 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"ExtraLight",
"QFont::Weight combo"),
5837 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"Light",
"QFont::Weight combo"),
5838 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"Normal",
"QFont::Weight combo"),
5839 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"Medium",
"QFont::Weight combo"),
5840 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"DemiBold",
"QFont::Weight combo"),
5841 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"Bold",
"QFont::Weight combo"),
5842 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"ExtraBold",
"QFont::Weight combo"),
5843 QT_TRANSLATE_NOOP3(
"FontPropertyManager",
"Black",
"QFont::Weight combo")
5847 for (
const auto &w : weightsC)
5848 result.append(QCoreApplication::translate(
"FontPropertyManager", w.first, w.second));
5853
5854
5858 d_ptr->m_values[property] = val;
5860 QtProperty *familyProp = d_ptr->m_enumPropertyManager->addProperty();
5861 familyProp->setPropertyName(tr(
"Family"));
5862 if (d_ptr->m_familyNames.isEmpty())
5863 d_ptr->m_familyNames = QFontDatabase::families();
5864 d_ptr->m_enumPropertyManager->setEnumNames(familyProp, d_ptr->m_familyNames);
5865 int idx = d_ptr->m_familyNames.indexOf(val.family());
5868 d_ptr->m_enumPropertyManager->setValue(familyProp, idx);
5869 d_ptr->m_propertyToFamily[property] = familyProp;
5870 d_ptr->m_familyToProperty[familyProp] = property;
5873 QtProperty *pointSizeProp = d_ptr->m_intPropertyManager->addProperty();
5874 pointSizeProp->setPropertyName(tr(
"Point Size"));
5875 d_ptr->m_intPropertyManager->setValue(pointSizeProp, val.pointSize());
5876 d_ptr->m_intPropertyManager->setMinimum(pointSizeProp, 1);
5877 d_ptr->m_propertyToPointSize[property] = pointSizeProp;
5878 d_ptr->m_pointSizeToProperty[pointSizeProp] = property;
5881 QtProperty *boldProp = d_ptr->m_boolPropertyManager->addProperty();
5882 boldProp->setPropertyName(tr(
"Bold",
"Bold toggle"));
5883 d_ptr->m_boolPropertyManager->setValue(boldProp, val.bold());
5884 d_ptr->m_propertyToBold[property] = boldProp;
5885 d_ptr->m_boldToProperty[boldProp] = property;
5888 QtProperty *italicProp = d_ptr->m_boolPropertyManager->addProperty();
5889 italicProp->setPropertyName(tr(
"Italic"));
5890 d_ptr->m_boolPropertyManager->setValue(italicProp, val.italic());
5891 d_ptr->m_propertyToItalic[property] = italicProp;
5892 d_ptr->m_italicToProperty[italicProp] = property;
5895 QtProperty *underlineProp = d_ptr->m_boolPropertyManager->addProperty();
5896 underlineProp->setPropertyName(tr(
"Underline"));
5897 d_ptr->m_boolPropertyManager->setValue(underlineProp, val.underline());
5898 d_ptr->m_propertyToUnderline[property] = underlineProp;
5899 d_ptr->m_underlineToProperty[underlineProp] = property;
5902 QtProperty *strikeOutProp = d_ptr->m_boolPropertyManager->addProperty();
5903 strikeOutProp->setPropertyName(tr(
"Strikeout"));
5904 d_ptr->m_boolPropertyManager->setValue(strikeOutProp, val.strikeOut());
5905 d_ptr->m_propertyToStrikeOut[property] = strikeOutProp;
5906 d_ptr->m_strikeOutToProperty[strikeOutProp] = property;
5909 QtProperty *kerningProp = d_ptr->m_boolPropertyManager->addProperty();
5910 kerningProp->setPropertyName(tr(
"Kerning"));
5911 d_ptr->m_boolPropertyManager->setValue(kerningProp, val.kerning());
5912 d_ptr->m_propertyToKerning[property] = kerningProp;
5913 d_ptr->m_kerningToProperty[kerningProp] = property;
5916 auto *weightProp = d_ptr->m_enumPropertyManager->addProperty();
5917 weightProp->setPropertyName(tr(
"Weight"));
5918 static const QStringList weightNames = fontWeightNames();
5919 d_ptr->m_enumPropertyManager->setEnumNames(weightProp, weightNames);
5920 d_ptr->m_enumPropertyManager->setValue(weightProp, indexOfFontWeight(val.weight()));
5921 d_ptr->m_propertyToWeight[property] = weightProp;
5922 d_ptr->m_weightToProperty[weightProp] = property;
5927
5928
5931 QtProperty *familyProp = d_ptr->m_propertyToFamily[property];
5933 d_ptr->m_familyToProperty.remove(familyProp);
5936 d_ptr->m_propertyToFamily.remove(property);
5938 QtProperty *pointSizeProp = d_ptr->m_propertyToPointSize[property];
5939 if (pointSizeProp) {
5940 d_ptr->m_pointSizeToProperty.remove(pointSizeProp);
5941 delete pointSizeProp;
5943 d_ptr->m_propertyToPointSize.remove(property);
5945 QtProperty *boldProp = d_ptr->m_propertyToBold[property];
5947 d_ptr->m_boldToProperty.remove(boldProp);
5950 d_ptr->m_propertyToBold.remove(property);
5952 QtProperty *italicProp = d_ptr->m_propertyToItalic[property];
5954 d_ptr->m_italicToProperty.remove(italicProp);
5957 d_ptr->m_propertyToItalic.remove(property);
5959 QtProperty *underlineProp = d_ptr->m_propertyToUnderline[property];
5960 if (underlineProp) {
5961 d_ptr->m_underlineToProperty.remove(underlineProp);
5962 delete underlineProp;
5964 d_ptr->m_propertyToUnderline.remove(property);
5966 QtProperty *strikeOutProp = d_ptr->m_propertyToStrikeOut[property];
5967 if (strikeOutProp) {
5968 d_ptr->m_strikeOutToProperty.remove(strikeOutProp);
5969 delete strikeOutProp;
5971 d_ptr->m_propertyToStrikeOut.remove(property);
5973 QtProperty *kerningProp = d_ptr->m_propertyToKerning[property];
5975 d_ptr->m_kerningToProperty.remove(kerningProp);
5978 d_ptr->m_propertyToKerning.remove(property);
5980 if (
auto weightProp = d_ptr->m_propertyToWeight[property]) {
5981 d_ptr->m_weightToProperty.remove(weightProp);
5985 d_ptr->m_values.remove(property);
5993 Q_DECLARE_PUBLIC(QtColorPropertyManager)
6016 if (
QtProperty *prop = m_rToProperty.value(property,
nullptr)) {
6017 QColor c = m_values[prop];
6019 q_ptr->setValue(prop, c);
6020 }
else if (
QtProperty *prop = m_gToProperty.value(property,
nullptr)) {
6021 QColor c = m_values[prop];
6023 q_ptr->setValue(prop, c);
6024 }
else if (
QtProperty *prop = m_bToProperty.value(property,
nullptr)) {
6025 QColor c = m_values[prop];
6027 q_ptr->setValue(prop, c);
6028 }
else if (
QtProperty *prop = m_aToProperty.value(property,
nullptr)) {
6029 QColor c = m_values[prop];
6031 q_ptr->setValue(prop, c);
6037 if (
QtProperty *pointProp = m_rToProperty.value(property,
nullptr)) {
6038 m_propertyToR[pointProp] =
nullptr;
6039 m_rToProperty.remove(property);
6040 }
else if (
QtProperty *pointProp = m_gToProperty.value(property,
nullptr)) {
6041 m_propertyToG[pointProp] =
nullptr;
6042 m_gToProperty.remove(property);
6043 }
else if (
QtProperty *pointProp = m_bToProperty.value(property,
nullptr)) {
6044 m_propertyToB[pointProp] =
nullptr;
6045 m_bToProperty.remove(property);
6046 }
else if (
QtProperty *pointProp = m_aToProperty.value(property,
nullptr)) {
6047 m_propertyToA[pointProp] =
nullptr;
6048 m_aToProperty.remove(property);
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6078
6079
6080
6081
6082
6083
6084
6085
6088
6089
6093 d_ptr->q_ptr =
this;
6095 d_ptr->m_intPropertyManager =
new QtIntPropertyManager(
this);
6096 connect(d_ptr->m_intPropertyManager, &QtIntPropertyManager::valueChanged,
this,
6097 [
this](QtProperty *property,
int value) { d_ptr->slotIntChanged(property, value); });
6098 connect(d_ptr->m_intPropertyManager, &QtAbstractPropertyManager::propertyDestroyed,
this,
6099 [
this](QtProperty *property) { d_ptr->slotPropertyDestroyed(property); });
6103
6104
6111
6112
6113
6114
6115
6116
6117
6118
6119
6122 return d_ptr->m_intPropertyManager;
6126
6127
6128
6129
6130
6131
6132
6135 return d_ptr->m_values.value(property, QColor());
6139
6140
6144 const auto it = d_ptr->m_values.constFind(property);
6145 if (it == d_ptr->m_values.constEnd())
6148 return QtPropertyBrowserUtils::colorValueText(it.value());
6152
6153
6157 const auto it = d_ptr->m_values.constFind(property);
6158 if (it == d_ptr->m_values.constEnd())
6160 return QtPropertyBrowserUtils::brushValueIcon(QBrush(it.value()));
6164
6165
6166
6167
6168
6169
6170
6173 const auto it = d_ptr->m_values.find(property);
6174 if (it == d_ptr->m_values.end())
6177 if (it.value() == val)
6182 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToR[property], val.red());
6183 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToG[property], val.green());
6184 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToB[property], val.blue());
6185 d_ptr->m_intPropertyManager->setValue(d_ptr->m_propertyToA[property], val.alpha());
6187 emit propertyChanged(property);
6188 emit valueChanged(property, val);
6192
6193
6197 d_ptr->m_values[property] = val;
6199 QtProperty *rProp = d_ptr->m_intPropertyManager->addProperty();
6200 rProp->setPropertyName(tr(
"Red"));
6201 d_ptr->m_intPropertyManager->setValue(rProp, val.red());
6202 d_ptr->m_intPropertyManager->setRange(rProp, 0, 0xFF);
6203 d_ptr->m_propertyToR[property] = rProp;
6204 d_ptr->m_rToProperty[rProp] = property;
6207 QtProperty *gProp = d_ptr->m_intPropertyManager->addProperty();
6208 gProp->setPropertyName(tr(
"Green"));
6209 d_ptr->m_intPropertyManager->setValue(gProp, val.green());
6210 d_ptr->m_intPropertyManager->setRange(gProp, 0, 0xFF);
6211 d_ptr->m_propertyToG[property] = gProp;
6212 d_ptr->m_gToProperty[gProp] = property;
6215 QtProperty *bProp = d_ptr->m_intPropertyManager->addProperty();
6216 bProp->setPropertyName(tr(
"Blue"));
6217 d_ptr->m_intPropertyManager->setValue(bProp, val.blue());
6218 d_ptr->m_intPropertyManager->setRange(bProp, 0, 0xFF);
6219 d_ptr->m_propertyToB[property] = bProp;
6220 d_ptr->m_bToProperty[bProp] = property;
6223 QtProperty *aProp = d_ptr->m_intPropertyManager->addProperty();
6224 aProp->setPropertyName(tr(
"Alpha"));
6225 d_ptr->m_intPropertyManager->setValue(aProp, val.alpha());
6226 d_ptr->m_intPropertyManager->setRange(aProp, 0, 0xFF);
6227 d_ptr->m_propertyToA[property] = aProp;
6228 d_ptr->m_aToProperty[aProp] = property;
6233
6234
6237 QtProperty *rProp = d_ptr->m_propertyToR[property];
6239 d_ptr->m_rToProperty.remove(rProp);
6242 d_ptr->m_propertyToR.remove(property);
6244 QtProperty *gProp = d_ptr->m_propertyToG[property];
6246 d_ptr->m_gToProperty.remove(gProp);
6249 d_ptr->m_propertyToG.remove(property);
6251 QtProperty *bProp = d_ptr->m_propertyToB[property];
6253 d_ptr->m_bToProperty.remove(bProp);
6256 d_ptr->m_propertyToB.remove(property);
6258 QtProperty *aProp = d_ptr->m_propertyToA[property];
6260 d_ptr->m_aToProperty.remove(aProp);
6263 d_ptr->m_propertyToA.remove(property);
6265 d_ptr->m_values.remove(property);
6273 Q_DECLARE_PUBLIC(QtCursorPropertyManager)
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6296
6297
6298
6299
6300
6301
6302
6303
6306
6307
6311 d_ptr->q_ptr =
this;
6315
6316
6323
6324
6325
6326
6327
6328
6329
6333 return d_ptr->m_values.value(property, QCursor());
6338
6339
6342 const auto it = d_ptr->m_values.constFind(property);
6343 if (it == d_ptr->m_values.constEnd())
6350
6351
6354 const auto it = d_ptr->m_values.constFind(property);
6355 if (it == d_ptr->m_values.constEnd())
6362
6363
6364
6365
6366
6367
6371 const auto it = d_ptr->m_values.find(property);
6372 if (it == d_ptr->m_values.end())
6375 if (it.value().shape() == value.shape() && value.shape() != Qt::BitmapCursor)
6380 emit propertyChanged(property);
6381 emit valueChanged(property, value);
6386
6387
6391 d_ptr->m_values[property] = QCursor();
6396
6397
6400 d_ptr->m_values.remove(property);
6405#include "moc_qtpropertymanager_p.cpp"
6406#include "qtpropertymanager.moc"
The QtAbstractPropertyManager provides an interface for property managers.
void clear() const
Destroys all the properties that this manager has created.
QHash< const QtProperty *, bool > m_values
const QIcon m_uncheckedIcon
const QIcon m_checkedIcon
The QtBoolPropertyManager class provides and manages boolean properties.
QIcon valueIcon(const QtProperty *property) const override
\reimp
bool value(const QtProperty *property) const
Returns the given property's value.
~QtBoolPropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
The QtCharPropertyManager provides and manages QChar properties.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QChar value(const QtProperty *property) const
Returns the given property's value.
~QtCharPropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
QtIntPropertyManager * m_intPropertyManager
QHash< const QtProperty *, QtProperty * > m_propertyToA
QHash< const QtProperty *, QtProperty * > m_propertyToB
QHash< const QtProperty *, QtProperty * > m_gToProperty
QHash< const QtProperty *, QtProperty * > m_propertyToR
QHash< const QtProperty *, QtProperty * > m_bToProperty
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, QtProperty * > m_propertyToG
QHash< const QtProperty *, QColor > m_values
QHash< const QtProperty *, QtProperty * > m_aToProperty
QHash< const QtProperty *, QtProperty * > m_rToProperty
The QtColorPropertyManager provides and manages QColor properties.
~QtColorPropertyManager()
Destroys this manager, and all the properties it has created.
void initializeProperty(QtProperty *property) override
\reimp
QIcon valueIcon(const QtProperty *property) const override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that produces the nested red, green and blue subproperties.
QColor value(const QtProperty *property) const
Returns the given property's value.
QString valueText(const QtProperty *property) const override
\reimp
static QtCursorDatabase * instance()
The QtCursorPropertyManager provides and manages QCursor properties.
QString valueText(const QtProperty *property) const override
\reimp
QIcon valueIcon(const QtProperty *property) const override
\reimp
~QtCursorPropertyManager()
Destroys this manager, and all the properties it has created.
void uninitializeProperty(QtProperty *property) override
\reimp
QCursor value(const QtProperty *property) const
Returns the given property's value.
void initializeProperty(QtProperty *property) override
\reimp
QHash< const QtProperty *, Data > m_values
The QtDatePropertyManager provides and manages QDate properties.
void setMaximum(QtProperty *property, QDate maxVal)
Sets the maximum value for the given property to maxVal.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
void setMinimum(QtProperty *property, QDate minVal)
Sets the minimum value for the given property to minVal.
~QtDatePropertyManager()
Destroys this manager, and all the properties it has created.
void setRange(QtProperty *property, QDate minVal, QDate maxVal)
Sets the 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.
QHash< const QtProperty *, QDateTime > m_values
The QtDateTimePropertyManager provides and manages QDateTime properties.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QDateTime value(const QtProperty *property) const
Returns the given property's value.
~QtDateTimePropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
QHash< const QtProperty *, Data > m_values
The QtDoublePropertyManager provides and manages double properties.
QString valueText(const QtProperty *property) const override
\reimp
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 setMaximum(QtProperty *property, double maxVal)
Sets the maximum value for the given property to maxVal.
void uninitializeProperty(QtProperty *property) override
\reimp
void setDecimals(QtProperty *property, int prec)
Sets the precision of the given property to prec.
double minimum(const QtProperty *property) const
Returns the given property's minimum value.
~QtDoublePropertyManager()
Destroys this manager, and all the properties it has created.
double value(const QtProperty *property) const
Returns the given property's value.
void setSingleStep(QtProperty *property, double step)
Sets the step value for the given property to step.
void initializeProperty(QtProperty *property) override
\reimp
void setMinimum(QtProperty *property, double minVal)
Sets the minimum value for the given property to minVal.
double maximum(const QtProperty *property) const
Returns the given property's maximum value.
void setRange(QtProperty *property, double minVal, double maxVal)
Sets the range of valid values.
QHash< const QtProperty *, Data > m_values
The QtEnumPropertyManager provides and manages enum properties.
void setEnumIcons(QtProperty *property, const QMap< int, QIcon > &icons)
Sets the given property's map of enum values to their icons to enumIcons.
QMap< int, QIcon > enumIcons(const QtProperty *property) const
Returns the given property's map of enum values to their icons.
QStringList enumNames(const QtProperty *property) const
Returns the given property's list of enum names.
QString valueText(const QtProperty *property) const override
\reimp
QIcon valueIcon(const QtProperty *property) const override
\reimp
void setEnumNames(QtProperty *property, const QStringList &names)
Sets the given property's list of enum names to enumNames.
void initializeProperty(QtProperty *property) override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
~QtEnumPropertyManager()
Destroys this manager, and all the properties it has created.
int value(const QtProperty *property) const
Returns the given property's value which is an index in the list returned by enumNames()
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, Data > m_values
QtBoolPropertyManager * m_boolPropertyManager
QHash< const QtProperty *, QList< QtProperty * > > m_propertyToFlags
QHash< const QtProperty *, QtProperty * > m_flagToProperty
The QtFlagPropertyManager provides and manages flag properties.
~QtFlagPropertyManager()
Destroys this manager, and all the properties it has created.
void uninitializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
QtBoolPropertyManager * subBoolPropertyManager() const
Returns the manager that produces the nested boolean subproperties representing each flag.
void setFlagNames(QtProperty *property, const QStringList &names)
Sets the given property's list of flag names to flagNames.
void initializeProperty(QtProperty *property) override
\reimp
QStringList flagNames(const QtProperty *property) const
Returns the given property's list of flag names.
int value(const QtProperty *property) const
Returns the given property's value.
QHash< const QtProperty *, QtProperty * > m_propertyToItalic
QStringList m_familyNames
QtIntPropertyManager * m_intPropertyManager
void slotFontDatabaseDelayedChange()
QHash< const QtProperty *, QtProperty * > m_strikeOutToProperty
QHash< const QtProperty *, QtProperty * > m_pointSizeToProperty
void slotEnumChanged(QtProperty *property, int value)
QHash< const QtProperty *, QtProperty * > m_kerningToProperty
QHash< const QtProperty *, QtProperty * > m_familyToProperty
QHash< const QtProperty *, QtProperty * > m_propertyToStrikeOut
void slotIntChanged(QtProperty *property, int value)
QHash< const QtProperty *, QtProperty * > m_propertyToBold
QtEnumPropertyManager * m_enumPropertyManager
QHash< const QtProperty *, QFont > m_values
QtBoolPropertyManager * m_boolPropertyManager
QHash< const QtProperty *, QtProperty * > m_weightToProperty
QHash< const QtProperty *, QtProperty * > m_propertyToWeight
void slotFontDatabaseChanged()
QHash< const QtProperty *, QtProperty * > m_propertyToFamily
QHash< const QtProperty *, QtProperty * > m_propertyToKerning
QHash< const QtProperty *, QtProperty * > m_propertyToPointSize
void slotBoolChanged(QtProperty *property, bool value)
QHash< const QtProperty *, QtProperty * > m_italicToProperty
QHash< const QtProperty *, QtProperty * > m_underlineToProperty
QHash< const QtProperty *, QtProperty * > m_propertyToUnderline
QTimer * m_fontDatabaseChangeTimer
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, QtProperty * > m_boldToProperty
The QtFontPropertyManager provides and manages QFont properties.
void uninitializeProperty(QtProperty *property) override
\reimp
QFont value(const QtProperty *property) const
Returns the given property's value.
void initializeProperty(QtProperty *property) override
\reimp
QtBoolPropertyManager * subBoolPropertyManager() const
Returns the manager that creates the bold, italic, underline, strikeOut and kerning subproperties.
QIcon valueIcon(const QtProperty *property) const override
\reimp
QtEnumPropertyManager * subEnumPropertyManager() const
Returns the manager that create the family subproperty.
QString valueText(const QtProperty *property) const override
\reimp
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the pointSize subproperty.
~QtFontPropertyManager()
Destroys this manager, and all the properties it has created.
The QtGroupPropertyManager provides and manages group properties.
bool hasValue(const QtProperty *property) const override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
QHash< const QtProperty *, Data > m_values
The QtIntPropertyManager provides and manages int properties.
void uninitializeProperty(QtProperty *property) override
\reimp
~QtIntPropertyManager()
Destroys this manager, and all the properties it has created.
void setRange(QtProperty *property, int minVal, int maxVal)
Sets the range of valid values.
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.
QString valueText(const QtProperty *property) const override
\reimp
int value(const QtProperty *property) const
Returns the given property's value.
void setMaximum(QtProperty *property, int maxVal)
Sets the maximum value for the given property to maxVal.
void setMinimum(QtProperty *property, int minVal)
Sets the minimum value for the given property to minVal.
int maximum(const QtProperty *property) const
Returns the given property's maximum value.
void setSingleStep(QtProperty *property, int step)
Sets the step value for the given property to step.
void initializeProperty(QtProperty *property) override
\reimp
QHash< const QtProperty *, QKeySequence > m_values
The QtKeySequencePropertyManager provides and manages QKeySequence properties.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QKeySequence value(const QtProperty *property) const
Returns the given property's value.
QString valueText(const QtProperty *property) const override
\reimp
~QtKeySequencePropertyManager()
Destroys this manager, and all the properties it has created.
QtEnumPropertyManager * m_enumPropertyManager
QHash< const QtProperty *, QtProperty * > m_territoryToProperty
QHash< const QtProperty *, QtProperty * > m_languageToProperty
QHash< const QtProperty *, QtProperty * > m_propertyToTerritory
QHash< const QtProperty *, QtProperty * > m_propertyToLanguage
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, QLocale > m_values
The QtLocalePropertyManager provides and manages QLocale properties.
void uninitializeProperty(QtProperty *property) override
\reimp
~QtLocalePropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
QtEnumPropertyManager * subEnumPropertyManager() const
Returns the manager that creates the nested language and territory subproperties.
void initializeProperty(QtProperty *property) override
\reimp
QLocale value(const QtProperty *property) const
Returns the given property's value.
QHash< const QtProperty *, QtProperty * > m_yToProperty
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, QtProperty * > m_xToProperty
void slotDoubleChanged(QtProperty *property, double value)
QHash< const QtProperty *, Data > m_values
QHash< const QtProperty *, QtProperty * > m_propertyToY
QtDoublePropertyManager * m_doublePropertyManager
QHash< const QtProperty *, QtProperty * > m_propertyToX
The QtPointFPropertyManager provides and manages QPointF properties.
void initializeProperty(QtProperty *property) override
\reimp
void setDecimals(QtProperty *property, int prec)
Sets the precision of the given property to prec.
void uninitializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
QPointF value(const QtProperty *property) const
Returns the given property's value.
QtDoublePropertyManager * subDoublePropertyManager() const
Returns the manager that creates the nested x and y subproperties.
~QtPointFPropertyManager()
Destroys this manager, and all the properties it has created.
int decimals(const QtProperty *property) const
Returns the given property's precision, in decimals.
QHash< const QtProperty *, QtProperty * > m_yToProperty
QtIntPropertyManager * m_intPropertyManager
QHash< const QtProperty *, QtProperty * > m_xToProperty
QHash< const QtProperty *, QPoint > m_values
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, QtProperty * > m_propertyToY
QHash< const QtProperty *, QtProperty * > m_propertyToX
The QtPointPropertyManager provides and manages QPoint properties.
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the nested x and y subproperties.
~QtPointPropertyManager()
Destroys this manager, and all the properties it has created.
void initializeProperty(QtProperty *property) override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
QPoint value(const QtProperty *property) const
Returns the given property's value.
The QtProperty class encapsulates an instance of a property.
void addSubProperty(QtProperty *property)
Appends the given property to this property's subproperties.
QHash< const QtProperty *, QtProperty * > m_propertyToX
QHash< const QtProperty *, QtProperty * > m_xToProperty
QHash< const QtProperty *, QtProperty * > m_yToProperty
QHash< const QtProperty *, QtProperty * > m_hToProperty
QHash< const QtProperty *, Data > m_values
QHash< const QtProperty *, QtProperty * > m_wToProperty
QtDoublePropertyManager * m_doublePropertyManager
void setConstraint(QtProperty *property, const QRectF &constraint, const QRectF &val)
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, QtProperty * > m_propertyToW
QHash< const QtProperty *, QtProperty * > m_propertyToH
QHash< const QtProperty *, QtProperty * > m_propertyToY
The QtRectFPropertyManager provides and manages QRectF properties.
QRectF constraint(const QtProperty *property) const
Returns the given property's constraining rectangle.
QRectF value(const QtProperty *property) const
Returns the given property's value.
QtDoublePropertyManager * subDoublePropertyManager() const
Returns the manager that creates the nested x, y, width and height subproperties.
void uninitializeProperty(QtProperty *property) override
\reimp
int decimals(const QtProperty *property) const
Returns the given property's precision, in decimals.
void initializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
void setDecimals(QtProperty *property, int prec)
Sets the precision of the given property to prec.
void setConstraint(QtProperty *property, const QRectF &constraint)
Sets the given property's constraining rectangle to constraint.
~QtRectFPropertyManager()
Destroys this manager, and all the properties it has created.
QHash< const QtProperty *, Data > m_values
void setConstraint(QtProperty *property, QRect constraint, QRect val)
QHash< const QtProperty *, QtProperty * > m_propertyToX
QHash< const QtProperty *, QtProperty * > m_xToProperty
QHash< const QtProperty *, QtProperty * > m_wToProperty
QtIntPropertyManager * m_intPropertyManager
QHash< const QtProperty *, QtProperty * > m_propertyToW
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, QtProperty * > m_propertyToY
QHash< const QtProperty *, QtProperty * > m_propertyToH
QHash< const QtProperty *, QtProperty * > m_yToProperty
QHash< const QtProperty *, QtProperty * > m_hToProperty
The QtRectPropertyManager provides and manages QRect properties.
QRect value(const QtProperty *property) const
Returns the given property's value.
void initializeProperty(QtProperty *property) override
\reimp
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the nested x, y, width and height subproperties.
~QtRectPropertyManager()
Destroys this manager, and all the properties it has created.
QString valueText(const QtProperty *property) const override
\reimp
QRect constraint(const QtProperty *property) const
Returns the given property's constraining rectangle.
void setConstraint(QtProperty *property, QRect constraint)
Sets the given property's constraining rectangle to constraint.
void uninitializeProperty(QtProperty *property) override
\reimp
void setRange(QtProperty *property, QSizeF minVal, QSizeF maxVal, QSizeF val)
QHash< const QtProperty *, QtProperty * > m_hToProperty
QHash< const QtProperty *, QtProperty * > m_propertyToH
QHash< const QtProperty *, Data > m_values
QHash< const QtProperty *, QtProperty * > m_wToProperty
void setValue(QtProperty *property, QSizeF val)
void slotPropertyDestroyed(QtProperty *property)
QHash< const QtProperty *, QtProperty * > m_propertyToW
QtDoublePropertyManager * m_doublePropertyManager
The QtSizeFPropertyManager provides and manages QSizeF properties.
QSizeF value(const QtProperty *property) const
Returns the given property's value.
~QtSizeFPropertyManager()
Destroys this manager, and all the properties it has created.
void setDecimals(QtProperty *property, int prec)
Sets the precision of the given property to prec.
QSizeF maximum(const QtProperty *property) const
Returns the given property's maximum size value.
int decimals(const QtProperty *property) const
Returns the given property's precision, in decimals.
void initializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
QSizeF minimum(const QtProperty *property) const
Returns the given property's minimum size value.
void setMinimum(QtProperty *property, QSizeF minVal)
Sets the minimum size value for the given property to minVal.
QtDoublePropertyManager * subDoublePropertyManager() const
Returns the manager that creates the nested width and height subproperties.
void uninitializeProperty(QtProperty *property) override
\reimp
void setRange(QtProperty *property, QSizeF minVal, QSizeF maxVal)
Sets the range of valid values.
void setMaximum(QtProperty *property, QSizeF maxVal)
Sets the maximum size value for the given property to maxVal.
void slotIntChanged(QtProperty *property, int value)
QtEnumPropertyManager * m_enumPropertyManager
QHash< const QtProperty *, QtProperty * > m_propertyToHPolicy
void slotPropertyDestroyed(QtProperty *property)
QtIntPropertyManager * m_intPropertyManager
QHash< const QtProperty *, QtProperty * > m_vPolicyToProperty
QHash< const QtProperty *, QSizePolicy > m_values
QHash< const QtProperty *, QtProperty * > m_propertyToHStretch
QHash< const QtProperty *, QtProperty * > m_propertyToVPolicy
QHash< const QtProperty *, QtProperty * > m_hStretchToProperty
void slotEnumChanged(QtProperty *property, int value)
QHash< const QtProperty *, QtProperty * > m_propertyToVStretch
QHash< const QtProperty *, QtProperty * > m_hPolicyToProperty
QHash< const QtProperty *, QtProperty * > m_vStretchToProperty
The QtSizePolicyPropertyManager provides and manages QSizePolicy properties.
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the nested horizontalStretch and verticalStretch subproperties.
QtEnumPropertyManager * subEnumPropertyManager() const
Returns the manager that creates the nested horizontalPolicy and verticalPolicy subproperties.
~QtSizePolicyPropertyManager()
Destroys this manager, and all the properties it has created.
void uninitializeProperty(QtProperty *property) override
\reimp
void initializeProperty(QtProperty *property) override
\reimp
QSizePolicy value(const QtProperty *property) const
Returns the given property's value.
QString valueText(const QtProperty *property) const override
\reimp
void slotPropertyDestroyed(QtProperty *property)
void setRange(QtProperty *property, QSize minVal, QSize maxVal, QSize val)
QHash< const QtProperty *, QtProperty * > m_propertyToW
QHash< const QtProperty *, QtProperty * > m_hToProperty
QHash< const QtProperty *, QtProperty * > m_wToProperty
void setValue(QtProperty *property, QSize val)
QHash< const QtProperty *, QtProperty * > m_propertyToH
QHash< const QtProperty *, Data > m_values
QtIntPropertyManager * m_intPropertyManager
The QtSizePropertyManager provides and manages QSize properties.
QSize value(const QtProperty *property) const
Returns the given property's value.
void uninitializeProperty(QtProperty *property) override
\reimp
void setMaximum(QtProperty *property, QSize maxVal)
Sets the maximum size value for the given property to maxVal.
void setRange(QtProperty *property, QSize minVal, QSize maxVal)
Sets the range of valid values.
void initializeProperty(QtProperty *property) override
\reimp
QSize maximum(const QtProperty *property) const
Returns the given property's maximum size value.
void setMinimum(QtProperty *property, QSize minVal)
Sets the minimum size value for the given property to minVal.
QString valueText(const QtProperty *property) const override
\reimp
QSize minimum(const QtProperty *property) const
Returns the given property's minimum size value.
~QtSizePropertyManager()
Destroys this manager, and all the properties it has created.
QtIntPropertyManager * subIntPropertyManager() const
Returns the manager that creates the nested width and height subproperties.
QHash< const QtProperty *, Data > m_values
The QtStringPropertyManager provides and manages QString properties.
QString value(const QtProperty *property) const
Returns the given property's value.
QRegularExpression regExp(const QtProperty *property) const
Returns the given property's currently set regular expression.
void setRegExp(QtProperty *property, const QRegularExpression ®Exp)
Sets the regular expression of the given property to regExp.
~QtStringPropertyManager()
Destroys this manager, and all the properties it has created.
void initializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
void uninitializeProperty(QtProperty *property) override
\reimp
QHash< const QtProperty *, QTime > m_values
The QtTimePropertyManager provides and manages QTime properties.
void initializeProperty(QtProperty *property) override
\reimp
~QtTimePropertyManager()
Destroys this manager, and all the properties it has created.
QTime value(const QtProperty *property) const
Returns the given property's value.
void uninitializeProperty(QtProperty *property) override
\reimp
QString valueText(const QtProperty *property) const override
\reimp
static void setValueInRange(PropertyManager *manager, PropertyManagerPrivate *managerPrivate, void(PropertyManager::*propertyChangedSignal)(QtProperty *), void(PropertyManager::*valueChangedSignal)(QtProperty *, ValueChangeParameter), QtProperty *property, const Value &val, void(PropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, ValueChangeParameter))
static Value getValue(const QHash< const QtProperty *, PrivateData > &propertyMap, const QtProperty *property, const Value &defaultValue=Value())
static QStringList fontWeightNames()
static const QFont::Weight weightValues[]
static SizeValue qBoundSize(const SizeValue &minVal, const SizeValue &val, const SizeValue &maxVal)
QSize qBound(QSize minVal, QSize val, QSize maxVal)
static Value getData(const QHash< const QtProperty *, PrivateData > &propertyMap, Value PrivateData::*data, const QtProperty *property, const Value &defaultValue=Value())
static int indexOfFontWeight(QFont::Weight w)
static QIcon drawCheckBox(bool value)
static Value getMinimum(const QHash< const QtProperty *, PrivateData > &propertyMap, const QtProperty *property, const Value &defaultValue=Value())
static void setSimpleMaximumData(PrivateData *data, const Value &maxVal)
static void setMinimumValue(PropertyManager *manager, PropertyManagerPrivate *managerPrivate, void(PropertyManager::*propertyChangedSignal)(QtProperty *), void(PropertyManager::*valueChangedSignal)(QtProperty *, ValueChangeParameter), void(PropertyManager::*rangeChangedSignal)(QtProperty *, ValueChangeParameter, ValueChangeParameter), QtProperty *property, const Value &minVal)
static void setBorderValue(PropertyManager *manager, PropertyManagerPrivate *managerPrivate, void(PropertyManager::*propertyChangedSignal)(QtProperty *), void(PropertyManager::*valueChangedSignal)(QtProperty *, ValueChangeParameter), void(PropertyManager::*rangeChangedSignal)(QtProperty *, ValueChangeParameter, ValueChangeParameter), QtProperty *property, Value(PrivateData::*getRangeVal)() const, void(PrivateData::*setRangeVal)(ValueChangeParameter), const Value &borderVal, void(PropertyManagerPrivate::*setSubPropertyRange)(QtProperty *, ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
static void setSimpleValue(QHash< const QtProperty *, Value > &propertyMap, PropertyManager *manager, void(PropertyManager::*propertyChangedSignal)(QtProperty *), void(PropertyManager::*valueChangedSignal)(QtProperty *, ValueChangeParameter), QtProperty *property, const Value &val)
static void setBorderValues(PropertyManager *manager, PropertyManagerPrivate *managerPrivate, void(PropertyManager::*propertyChangedSignal)(QtProperty *), void(PropertyManager::*valueChangedSignal)(QtProperty *, ValueChangeParameter), void(PropertyManager::*rangeChangedSignal)(QtProperty *, ValueChangeParameter, ValueChangeParameter), QtProperty *property, ValueChangeParameter minVal, ValueChangeParameter maxVal, void(PropertyManagerPrivate::*setSubPropertyRange)(QtProperty *, ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
static void setSizeMinimumData(PrivateData *data, const Value &newMinVal)
static QList< QLocale::Territory > sortedTerritories(const QList< QLocale > &locales)
static void setSimpleMinimumData(PrivateData *data, const Value &minVal)
static Value getMaximum(const QHash< const QtProperty *, PrivateData > &propertyMap, const QtProperty *property, const Value &defaultValue=Value())
static void setSizeMaximumData(PrivateData *data, const Value &newMaxVal)
static QFont::Weight weightFromIndex(int i)
static void setMaximumValue(PropertyManager *manager, PropertyManagerPrivate *managerPrivate, void(PropertyManager::*propertyChangedSignal)(QtProperty *), void(PropertyManager::*valueChangedSignal)(QtProperty *, ValueChangeParameter), void(PropertyManager::*rangeChangedSignal)(QtProperty *, ValueChangeParameter, ValueChangeParameter), QtProperty *property, const Value &maxVal)
void setMaximumValue(QDate newMaxVal)
QDate minimumValue() const
void setMinimumValue(QDate newMinVal)
QDate maximumValue() const
void setMinimumValue(QSizeF newMinVal)
QSizeF minimumValue() const
QSizeF maximumValue() const
void setMaximumValue(QSizeF newMaxVal)
QSize maximumValue() const
void setMaximumValue(QSize newMaxVal)
void setMinimumValue(QSize newMinVal)
QSize minimumValue() const