50 #include <QFontDatabase>
51 #include <QStyleOption>
53 #include <QApplication>
62 #if defined(Q_CC_MSVC)
63 # pragma warning(disable: 4786)
68 template <
class PrivateData,
class Value>
69 static void setSimpleMinimumData(PrivateData*
data,
const Value& minVal)
71 data->minVal = minVal;
84 template <
class PrivateData,
class Value>
85 static void setSimpleMaximumData(PrivateData*
data,
const Value& maxVal)
87 data->maxVal = maxVal;
100 template <
class PrivateData,
class Value>
101 static void setSizeMinimumData(PrivateData*
data,
const Value& newMinVal)
103 data->minVal = newMinVal;
105 if (
data->maxVal.width() <
data->minVal.width())
107 data->maxVal.setWidth(
data->minVal.width());
110 if (
data->maxVal.height() <
data->minVal.height())
112 data->maxVal.setHeight(
data->minVal.height());
115 if (
data->val.width() <
data->minVal.width())
117 data->val.setWidth(
data->minVal.width());
120 if (
data->val.height() <
data->minVal.height())
122 data->val.setHeight(
data->minVal.height());
126 template <
class PrivateData,
class Value>
127 static void setSizeMaximumData(PrivateData*
data,
const Value& newMaxVal)
129 data->maxVal = newMaxVal;
131 if (
data->minVal.width() >
data->maxVal.width())
133 data->minVal.setWidth(
data->maxVal.width());
136 if (
data->minVal.height() >
data->maxVal.height())
138 data->minVal.setHeight(
data->maxVal.height());
141 if (
data->val.width() >
data->maxVal.width())
143 data->val.setWidth(
data->maxVal.width());
146 if (
data->val.height() >
data->maxVal.height())
148 data->val.setHeight(
data->maxVal.height());
152 template <
class SizeValue>
153 static SizeValue qBoundSize(
const SizeValue& minVal,
const SizeValue& val,
const SizeValue& maxVal)
155 SizeValue croppedVal = val;
157 if (minVal.width() > val.width())
159 croppedVal.setWidth(minVal.width());
161 else if (maxVal.width() < val.width())
163 croppedVal.setWidth(maxVal.width());
166 if (minVal.height() > val.height())
168 croppedVal.setHeight(minVal.height());
170 else if (maxVal.height() < val.height())
172 croppedVal.setHeight(maxVal.height());
179 QSize
qBound(QSize minVal, QSize val, QSize maxVal)
181 return qBoundSize(minVal, val, maxVal);
184 QSizeF
qBound(QSizeF minVal, QSizeF val, QSizeF maxVal)
186 return qBoundSize(minVal, val, maxVal);
191 template <
class Value>
192 void orderBorders(
Value& minVal,
Value& maxVal)
196 qSwap(minVal, maxVal);
200 template <
class Value>
201 static void orderSizeBorders(
Value& minVal,
Value& maxVal)
203 Value fromSize = minVal;
204 Value toSize = maxVal;
206 if (fromSize.width() > toSize.width())
208 fromSize.setWidth(maxVal.width());
209 toSize.setWidth(minVal.width());
212 if (fromSize.height() > toSize.height())
214 fromSize.setHeight(maxVal.height());
215 toSize.setHeight(minVal.height());
222 void orderBorders(QSize& minVal, QSize& maxVal)
224 orderSizeBorders(minVal, maxVal);
227 void orderBorders(QSizeF& minVal, QSizeF& maxVal)
229 orderSizeBorders(minVal, maxVal);
236 template <
class Value,
class PrivateData>
237 static Value getData(
const QMap<const QtProperty*, PrivateData>& propertyMap,
241 using PropertyToData = QMap<const QtProperty*, PrivateData>;
242 using PropertyToDataConstIterator =
typename PropertyToData::const_iterator;
243 const PropertyToDataConstIterator it = propertyMap.constFind(property);
245 if (it == propertyMap.constEnd())
250 return it.value().*
data;
253 template <
class Value,
class PrivateData>
254 static Value getValue(
const QMap<const QtProperty*, PrivateData>& propertyMap,
257 return getData<Value>(propertyMap, &PrivateData::val, property, defaultValue);
260 template <
class Value,
class PrivateData>
261 static Value getMinimum(
const QMap<const QtProperty*, PrivateData>& propertyMap,
264 return getData<Value>(propertyMap, &PrivateData::minVal, property, defaultValue);
267 template <
class Value,
class PrivateData>
268 static Value getMaximum(
const QMap<const QtProperty*, PrivateData>& propertyMap,
271 return getData<Value>(propertyMap, &PrivateData::maxVal, property, defaultValue);
274 template <
class ValueChangeParameter,
class Value,
class PropertyManager>
275 static void setSimpleValue(QMap<const QtProperty*, Value>& propertyMap,
276 PropertyManager* manager,
277 void (PropertyManager::*propertyChangedSignal)(
QtProperty*),
278 void (PropertyManager::*valueChangedSignal)(
QtProperty*, ValueChangeParameter),
281 using PropertyToData = QMap<const QtProperty*, Value>;
282 using PropertyToDataIterator =
typename PropertyToData::iterator;
283 const PropertyToDataIterator it = propertyMap.find(property);
285 if (it == propertyMap.end())
290 if (it.value() == val)
297 emit(manager->*propertyChangedSignal)(property);
298 emit(manager->*valueChangedSignal)(property, val);
301 template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value>
302 static void setValueInRange(PropertyManager* manager, PropertyManagerPrivate* managerPrivate,
303 void (PropertyManager::*propertyChangedSignal)(
QtProperty*),
304 void (PropertyManager::*valueChangedSignal)(
QtProperty*, ValueChangeParameter),
306 void (PropertyManagerPrivate::*setSubPropertyValue)(
QtProperty*, ValueChangeParameter))
308 using PrivateData =
typename PropertyManagerPrivate::Data;
309 using PropertyToData = QMap<const QtProperty*, PrivateData>;
310 using PropertyToDataIterator =
typename PropertyToData::iterator;
311 const PropertyToDataIterator it = managerPrivate->m_values.find(property);
313 if (it == managerPrivate->m_values.end())
318 PrivateData&
data = it.value();
329 if (
data.val == oldVal)
334 if (setSubPropertyValue)
336 (managerPrivate->*setSubPropertyValue)(property,
data.val);
339 emit(manager->*propertyChangedSignal)(property);
340 emit(manager->*valueChangedSignal)(property,
data.val);
343 template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value>
344 static void setBorderValues(PropertyManager* manager, PropertyManagerPrivate* managerPrivate,
345 void (PropertyManager::*propertyChangedSignal)(
QtProperty*),
346 void (PropertyManager::*valueChangedSignal)(
QtProperty*, ValueChangeParameter),
347 void (PropertyManager::*rangeChangedSignal)(
QtProperty*, ValueChangeParameter, ValueChangeParameter),
349 void (PropertyManagerPrivate::*setSubPropertyRange)(
QtProperty*,
350 ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
352 using PrivateData =
typename PropertyManagerPrivate::Data;
353 using PropertyToData = QMap<const QtProperty*, PrivateData>;
354 using PropertyToDataIterator =
typename PropertyToData::iterator;
355 const PropertyToDataIterator it = managerPrivate->m_values.find(property);
357 if (it == managerPrivate->m_values.end())
362 Value fromVal = minVal;
363 Value toVal = maxVal;
364 orderBorders(fromVal, toVal);
366 PrivateData&
data = it.value();
368 if (
data.minVal == fromVal &&
data.maxVal == toVal)
375 data.setMinimumValue(fromVal);
376 data.setMaximumValue(toVal);
378 emit(manager->*rangeChangedSignal)(property,
data.minVal,
data.maxVal);
380 if (setSubPropertyRange)
382 (managerPrivate->*setSubPropertyRange)(property,
data.minVal,
data.maxVal,
data.val);
385 if (
data.val == oldVal)
390 emit(manager->*propertyChangedSignal)(property);
391 emit(manager->*valueChangedSignal)(property,
data.val);
394 template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value,
class PrivateData>
395 static void setBorderValue(PropertyManager* manager, PropertyManagerPrivate* managerPrivate,
396 void (PropertyManager::*propertyChangedSignal)(
QtProperty*),
397 void (PropertyManager::*valueChangedSignal)(
QtProperty*, ValueChangeParameter),
398 void (PropertyManager::*rangeChangedSignal)(
QtProperty*, ValueChangeParameter, ValueChangeParameter),
400 Value(PrivateData::*getRangeVal)()
const,
401 void (PrivateData::*setRangeVal)(ValueChangeParameter),
const Value& borderVal,
402 void (PropertyManagerPrivate::*setSubPropertyRange)(
QtProperty*,
403 ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
405 using PropertyToData = QMap<const QtProperty*, PrivateData>;
406 using PropertyToDataIterator =
typename PropertyToData::iterator;
407 const PropertyToDataIterator it = managerPrivate->m_values.find(property);
409 if (it == managerPrivate->m_values.end())
414 PrivateData&
data = it.value();
416 if ((
data.*getRangeVal)() == borderVal)
423 (
data.*setRangeVal)(borderVal);
425 emit(manager->*rangeChangedSignal)(property,
data.minVal,
data.maxVal);
427 if (setSubPropertyRange)
429 (managerPrivate->*setSubPropertyRange)(property,
data.minVal,
data.maxVal,
data.val);
432 if (
data.val == oldVal)
437 emit(manager->*propertyChangedSignal)(property);
438 emit(manager->*valueChangedSignal)(property,
data.val);
441 template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value,
class PrivateData>
442 static void setMinimumValue(PropertyManager* manager, PropertyManagerPrivate* managerPrivate,
443 void (PropertyManager::*propertyChangedSignal)(
QtProperty*),
444 void (PropertyManager::*valueChangedSignal)(
QtProperty*, ValueChangeParameter),
445 void (PropertyManager::*rangeChangedSignal)(
QtProperty*, ValueChangeParameter, ValueChangeParameter),
448 void (PropertyManagerPrivate::*setSubPropertyRange)(
QtProperty*,
449 ValueChangeParameter, ValueChangeParameter, ValueChangeParameter) = 0;
450 setBorderValue<ValueChangeParameter, PropertyManagerPrivate, PropertyManager, Value, PrivateData>(manager, managerPrivate,
451 propertyChangedSignal, valueChangedSignal, rangeChangedSignal,
452 property, &PropertyManagerPrivate::Data::minimumValue, &PropertyManagerPrivate::Data::setMinimumValue, minVal, setSubPropertyRange);
455 template <
class ValueChangeParameter,
class PropertyManagerPrivate,
class PropertyManager,
class Value,
class PrivateData>
456 static void setMaximumValue(PropertyManager* manager, PropertyManagerPrivate* managerPrivate,
457 void (PropertyManager::*propertyChangedSignal)(
QtProperty*),
458 void (PropertyManager::*valueChangedSignal)(
QtProperty*, ValueChangeParameter),
459 void (PropertyManager::*rangeChangedSignal)(
QtProperty*, ValueChangeParameter, ValueChangeParameter),
462 void (PropertyManagerPrivate::*setSubPropertyRange)(
QtProperty*,
463 ValueChangeParameter, ValueChangeParameter, ValueChangeParameter) = 0;
464 setBorderValue<ValueChangeParameter, PropertyManagerPrivate, PropertyManager, Value, PrivateData>(manager, managerPrivate,
465 propertyChangedSignal, valueChangedSignal, rangeChangedSignal,
466 property, &PropertyManagerPrivate::Data::maximumValue, &PropertyManagerPrivate::Data::setMaximumValue, maxVal, setSubPropertyRange);
476 return QSizePolicy::Ignored;
489 return m_policyEnumNames;
493 return m_languageEnumNames;
497 return m_countryEnumNames.value(language);
503 void indexToLocale(
int languageIndex,
int countryIndex, QLocale::Language* language, QLocale::Country* country)
const;
504 void localeToIndex(QLocale::Language language, QLocale::Country country,
int* languageIndex,
int* countryIndex)
const;
509 QStringList m_policyEnumNames;
510 QStringList m_languageEnumNames;
511 QMap<QLocale::Language, QStringList> m_countryEnumNames;
512 QMap<int, QLocale::Language> m_indexToLanguage;
513 QMap<QLocale::Language, int> m_languageToIndex;
514 QMap<int, QMap<int, QLocale::Country> > m_indexToCountry;
515 QMap<QLocale::Language, QMap<QLocale::Country, int> > m_countryToIndex;
516 QMetaEnum m_policyEnum;
519 static QList<QLocale::Country> sortCountries(
const QList<QLocale::Country>& countries)
521 QMultiMap<QString, QLocale::Country> nameToCountry;
522 QListIterator<QLocale::Country> itCountry(countries);
524 while (itCountry.hasNext())
526 QLocale::Country country = itCountry.next();
527 nameToCountry.insert(QLocale::countryToString(country), country);
530 return nameToCountry.values();
533 void QtMetaEnumProvider::initLocale()
535 QMultiMap<QString, QLocale::Language> nameToLanguage;
536 QLocale::Language language = QLocale::C;
538 while (language <= QLocale::LastLanguage)
540 QLocale locale(language);
542 if (locale.language() == language)
544 nameToLanguage.insert(QLocale::languageToString(language), language);
547 language = (QLocale::Language)((uint)language + 1);
550 const QLocale system = QLocale::system();
552 if (!nameToLanguage.contains(QLocale::languageToString(system.language())))
554 nameToLanguage.insert(QLocale::languageToString(system.language()), system.language());
557 QList<QLocale::Language> languages = nameToLanguage.values();
558 QListIterator<QLocale::Language> itLang(languages);
560 while (itLang.hasNext())
562 QLocale::Language language = itLang.next();
563 QList<QLocale::Country> countries;
564 countries = QLocale::countriesForLanguage(language);
566 if (countries.isEmpty() && language == system.language())
568 countries << system.country();
571 if (!countries.isEmpty() && !m_languageToIndex.contains(language))
573 countries = sortCountries(countries);
574 int langIdx = m_languageEnumNames.count();
575 m_indexToLanguage[langIdx] = language;
576 m_languageToIndex[language] = langIdx;
577 QStringList countryNames;
578 QListIterator<QLocale::Country> it(countries);
583 QLocale::Country country = it.next();
584 countryNames << QLocale::countryToString(country);
585 m_indexToCountry[langIdx][countryIdx] = country;
586 m_countryToIndex[language][country] = countryIdx;
590 m_languageEnumNames << QLocale::languageToString(language);
591 m_countryEnumNames[language] = countryNames;
600 p = QtMetaEnumWrapper::staticMetaObject.property(
601 QtMetaEnumWrapper::staticMetaObject.propertyOffset() + 0);
602 m_policyEnum = p.enumerator();
603 const int keyCount = m_policyEnum.keyCount();
605 for (
int i = 0; i < keyCount; i++)
607 m_policyEnumNames << QLatin1String(m_policyEnum.key(i));
615 return static_cast<QSizePolicy::Policy
>(m_policyEnum.value(
index));
620 const int keyCount = m_policyEnum.keyCount();
622 for (
int i = 0; i < keyCount; i++)
633 QLocale::Language l = QLocale::C;
634 QLocale::Country
c = QLocale::AnyCountry;
636 if (m_indexToLanguage.contains(languageIndex))
638 l = m_indexToLanguage[languageIndex];
640 if (m_indexToCountry.contains(languageIndex) && m_indexToCountry[languageIndex].contains(countryIndex))
642 c = m_indexToCountry[languageIndex][countryIndex];
662 if (m_languageToIndex.contains(language))
664 l = m_languageToIndex[language];
666 if (m_countryToIndex.contains(language) && m_countryToIndex[language].contains(country))
668 c = m_countryToIndex[language][country];
765 setSimpleMinimumData(
this, newMinVal);
769 setSimpleMaximumData(
this, newMaxVal);
858 return getValue<int>(d_ptr->
m_values, property, 0);
868 return getMinimum<int>(d_ptr->
m_values, property, 0);
878 return getMaximum<int>(d_ptr->
m_values, property, 0);
910 const QtIntPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
912 if (it == d_ptr->
m_values.constEnd())
917 return QString::number(it.value().val);
934 setValueInRange<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int>(
this, d_ptr,
937 property, val, setSubPropertyValue);
951 setMinimumValue<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int, QtIntPropertyManagerPrivate::Data>(
this, d_ptr,
969 setMaximumValue<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int, QtIntPropertyManagerPrivate::Data>(
this, d_ptr,
993 setBorderValues<int, QtIntPropertyManagerPrivate, QtIntPropertyManager, int>(
this, d_ptr,
997 property, minVal, maxVal, setSubPropertyRange);
1009 const QtIntPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1023 if (
data.singleStep == step)
1028 data.singleStep = step;
1042 const QtIntPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1051 if (
data.readOnly == readOnly)
1056 data.readOnly = readOnly;
1106 setSimpleMinimumData(
this, newMinVal);
1110 setSimpleMaximumData(
this, newMaxVal);
1188 d_ptr->q_ptr =
this;
1210 return getValue<double>(d_ptr->
m_values, property, 0.0);
1220 return getMinimum<double>(d_ptr->
m_values, property, 0.0);
1230 return getMaximum<double>(d_ptr->
m_values, property, 0.0);
1272 const QtDoublePropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
1274 if (it == d_ptr->
m_values.constEnd())
1279 return QLocale::system().toString(it.value().val,
'f', it.value().decimals);
1296 setValueInRange<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double>(
this, d_ptr,
1299 property, val, setSubPropertyValue);
1311 const QtDoublePropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1325 if (
data.singleStep == step)
1330 data.singleStep = step;
1344 const QtDoublePropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1353 if (
data.readOnly == readOnly)
1358 data.readOnly = readOnly;
1376 const QtDoublePropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1394 if (
data.decimals == prec)
1399 data.decimals = prec;
1417 setMinimumValue<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double, QtDoublePropertyManagerPrivate::Data>(
this, d_ptr,
1435 setMaximumValue<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double, QtDoublePropertyManagerPrivate::Data>(
this, d_ptr,
1459 setBorderValues<double, QtDoublePropertyManagerPrivate, QtDoublePropertyManager, double>(
this, d_ptr,
1463 property, minVal, maxVal, setSubPropertyRange);
1492 Data() :
regExp(QString(QLatin1Char(
'*')), Qt::CaseSensitive, QRegExp::Wildcard),
1553 d_ptr->q_ptr =
this;
1575 return getValue<QString>(d_ptr->
m_values, property);
1616 const QtStringPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
1618 if (it == d_ptr->
m_values.constEnd())
1623 return it.value().val;
1631 const QtStringPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
1633 if (it == d_ptr->
m_values.constEnd())
1639 edit.setEchoMode((
EchoMode)it.value().echoMode);
1640 edit.setText(it.value().val);
1641 return edit.displayText();
1656 const QtStringPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1665 if (
data.val == val)
1670 if (
data.regExp.isValid() && !
data.regExp.exactMatch(val))
1690 const QtStringPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1714 const QtStringPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1742 const QtStringPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1751 if (
data.readOnly == readOnly)
1756 data.readOnly = readOnly;
1781 static QIcon drawCheckBox(
bool value)
1783 QStyleOptionButton opt;
1784 opt.state |=
value ? QStyle::State_On : QStyle::State_Off;
1785 opt.state |= QStyle::State_Enabled;
1786 const QStyle* style = QApplication::style();
1790 const int indicatorWidth = style->pixelMetric(QStyle::PM_IndicatorWidth, &opt);
1791 const int indicatorHeight = style->pixelMetric(QStyle::PM_IndicatorHeight, &opt);
1792 const int listViewIconSize = indicatorWidth;
1793 const int pixmapWidth = indicatorWidth;
1794 const int pixmapHeight = qMax(indicatorHeight, listViewIconSize);
1796 opt.rect = QRect(0, 0, indicatorWidth, indicatorHeight);
1797 QPixmap pixmap = QPixmap(pixmapWidth, pixmapHeight);
1801 const int xoff = (pixmapWidth > indicatorWidth) ? (pixmapWidth - indicatorWidth) / 2 : 0;
1802 const int yoff = (pixmapHeight > indicatorHeight) ? (pixmapHeight - indicatorHeight) / 2 : 0;
1803 QPainter painter(&pixmap);
1804 painter.translate(xoff, yoff);
1805 style->drawPrimitive(QStyle::PE_IndicatorCheckBox, &opt, &painter);
1807 return QIcon(pixmap);
1832 m_checkedIcon(drawCheckBox(true)),
1833 m_uncheckedIcon(drawCheckBox(false))
1867 d_ptr->q_ptr =
this;
1889 return getValue<bool>(d_ptr->
m_values, property,
false);
1902 const QtBoolPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
1904 if (it == d_ptr->
m_values.constEnd())
1911 if (!
data.textVisible)
1916 static const QString trueText = tr(
"True");
1917 static const QString falseText = tr(
"False");
1918 return data.val ? trueText : falseText;
1926 const QtBoolPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
1928 if (it == d_ptr->
m_values.constEnd())
1945 const QtBoolPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
1954 if (
data.val == val)
1968 const QtBoolPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
2016 maxVal(QDate(7999, 12, 31)) {}
2030 setSimpleMinimumData(
this, newMinVal);
2034 setSimpleMaximumData(
this, newMaxVal);
2093 d_ptr->q_ptr =
this;
2096 d_ptr->
m_format = loc.dateFormat(QLocale::ShortFormat);
2118 return getValue<QDate>(d_ptr->
m_values, property);
2128 return getMinimum<QDate>(d_ptr->
m_values, property);
2138 return getMaximum<QDate>(d_ptr->
m_values, property);
2146 const QtDatePropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
2148 if (it == d_ptr->
m_values.constEnd())
2153 return it.value().val.toString(d_ptr->
m_format);
2170 setValueInRange<const QDate&, QtDatePropertyManagerPrivate, QtDatePropertyManager, const QDate>(
this, d_ptr,
2173 property, val, setSubPropertyValue);
2187 setMinimumValue<const QDate&, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate, QtDatePropertyManagerPrivate::Data>(
this, d_ptr,
2205 setMaximumValue<const QDate&, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate, QtDatePropertyManagerPrivate::Data>(
this, d_ptr,
2229 const QDate&,
const QDate&) = 0;
2230 setBorderValues<const QDate&, QtDatePropertyManagerPrivate, QtDatePropertyManager, QDate>(
this, d_ptr,
2234 property, minVal, maxVal, setSubPropertyRange);
2299 d_ptr->q_ptr =
this;
2302 d_ptr->
m_format = loc.timeFormat(QLocale::ShortFormat);
2324 return d_ptr->
m_values.value(property, QTime());
2332 const QtTimePropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
2334 if (it == d_ptr->
m_values.constEnd())
2339 return it.value().toString(d_ptr->
m_format);
2351 setSimpleValue<const QTime&, QTime, QtTimePropertyManager>(d_ptr->
m_values,
this,
2362 d_ptr->
m_values[property] = QTime::currentTime();
2415 d_ptr->q_ptr =
this;
2418 d_ptr->
m_format = loc.dateFormat(QLocale::ShortFormat);
2419 d_ptr->
m_format += QLatin1Char(
' ');
2420 d_ptr->
m_format += loc.timeFormat(QLocale::ShortFormat);
2442 return d_ptr->
m_values.value(property, QDateTime());
2450 const QtDateTimePropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
2452 if (it == d_ptr->
m_values.constEnd())
2457 return it.value().toString(d_ptr->
m_format);
2469 setSimpleValue<const QDateTime&, QDateTime, QtDateTimePropertyManager>(d_ptr->
m_values,
this,
2534 d_ptr->q_ptr =
this;
2556 return d_ptr->
m_values.value(property, QKeySequence());
2564 const QtKeySequencePropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
2566 if (it == d_ptr->
m_values.constEnd())
2571 return it.value().toString(QKeySequence::NativeText);
2583 setSimpleValue<const QKeySequence&, QKeySequence, QtKeySequencePropertyManager>(d_ptr->
m_values,
this,
2594 d_ptr->
m_values[property] = QKeySequence();
2646 d_ptr->q_ptr =
this;
2668 return d_ptr->
m_values.value(property, QChar());
2676 const QtCharPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
2678 if (it == d_ptr->
m_values.constEnd())
2683 const QChar
c = it.value();
2684 return c.isNull() ? QString() : QString(
c);
2696 setSimpleValue<const QChar&, QChar, QtCharPropertyManager>(d_ptr->
m_values,
this,
2707 d_ptr->
m_values[property] = QChar();
2751 const QLocale loc =
m_values[prop];
2752 QLocale::Language newLanguage = loc.language();
2753 QLocale::Country newCountry = loc.country();
2754 metaEnumProvider()->indexToLocale(
value, 0, &newLanguage, 0);
2755 QLocale newLoc(newLanguage, newCountry);
2760 const QLocale loc =
m_values[prop];
2761 QLocale::Language newLanguage = loc.language();
2762 QLocale::Country newCountry = loc.country();
2764 QLocale newLoc(newLanguage, newCountry);
2821 d_ptr->q_ptr =
this;
2825 this, SLOT(slotEnumChanged(
QtProperty*,
int)));
2828 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
2865 return d_ptr->
m_values.value(property, QLocale());
2873 const QtLocalePropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
2875 if (it == d_ptr->
m_values.constEnd())
2880 QLocale loc = it.value();
2884 metaEnumProvider()->localeToIndex(loc.language(), loc.country(), &langIdx, &countryIdx);
2885 QString
str = tr(
"%1, %2")
2886 .arg(metaEnumProvider()->languageEnumNames().at(langIdx))
2887 .arg(metaEnumProvider()->countryEnumNames(loc.language()).at(countryIdx));
2901 const QtLocalePropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
2908 const QLocale loc = it.value();
2919 metaEnumProvider()->localeToIndex(val.language(), val.country(), &langIdx, &countryIdx);
2921 if (loc.language() != val.language())
2925 metaEnumProvider()->countryEnumNames(val.language()));
2944 metaEnumProvider()->localeToIndex(val.language(), val.country(), &langIdx, &countryIdx);
2973 delete languageProp;
3081 d_ptr->q_ptr =
this;
3085 this, SLOT(slotIntChanged(
QtProperty*,
int)));
3087 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
3124 return d_ptr->
m_values.value(property, QPoint());
3132 const QtPointPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
3134 if (it == d_ptr->
m_values.constEnd())
3139 const QPoint
v = it.value();
3140 return QString(tr(
"(%1, %2)").arg(QString::number(
v.x()))
3141 .arg(QString::number(
v.y())));
3154 const QtPointPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
3161 if (it.value() == val)
3179 d_ptr->
m_values[property] = QPoint(0, 0);
3331 d_ptr->q_ptr =
this;
3335 this, SLOT(slotDoubleChanged(
QtProperty*,
double)));
3337 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
3374 return getValue<QPointF>(d_ptr->
m_values, property);
3392 const QtPointFPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
3394 if (it == d_ptr->
m_values.constEnd())
3399 const QPointF
v = it.value().val;
3400 const int dec = it.value().decimals;
3401 return QString(tr(
"(%1, %2)").arg(QString::number(
v.x(),
'f', dec))
3402 .arg(QString::number(
v.y(),
'f', dec)));
3415 const QtPointFPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
3422 if (it.value().val == val)
3427 it.value().val = val;
3446 const QtPointFPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
3464 if (
data.decimals == prec)
3469 data.decimals = prec;
3542 const QSize& minVal,
const QSize& maxVal,
const QSize& val);
3560 setSizeMinimumData(
this, newMinVal);
3564 setSizeMaximumData(
this, newMaxVal);
3617 const QSize& minVal,
const QSize& maxVal,
const QSize& val)
3683 d_ptr->q_ptr =
this;
3687 this, SLOT(slotIntChanged(
QtProperty*,
int)));
3689 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
3726 return getValue<QSize>(d_ptr->
m_values, property);
3736 return getMinimum<QSize>(d_ptr->
m_values, property);
3746 return getMaximum<QSize>(d_ptr->
m_values, property);
3754 const QtSizePropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
3756 if (it == d_ptr->
m_values.constEnd())
3761 const QSize
v = it.value().val;
3762 return QString(tr(
"%1 x %2").arg(QString::number(
v.width()))
3763 .arg(QString::number(
v.height())));
3779 setValueInRange<const QSize&, QtSizePropertyManagerPrivate, QtSizePropertyManager, const QSize>(
this, d_ptr,
3796 setBorderValue<const QSize&, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize, QtSizePropertyManagerPrivate::Data>(
this, d_ptr,
3817 setBorderValue<const QSize&, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize, QtSizePropertyManagerPrivate::Data>(
this, d_ptr,
3843 setBorderValues<const QSize&, QtSizePropertyManagerPrivate, QtSizePropertyManager, QSize>(
this, d_ptr,
3914 const QSizeF& minVal,
const QSizeF& maxVal,
const QSizeF& val);
3933 setSizeMinimumData(
this, newMinVal);
3937 setSizeMaximumData(
this, newMaxVal);
3990 const QSizeF& minVal,
const QSizeF& maxVal,
const QSizeF& val)
4064 d_ptr->q_ptr =
this;
4068 this, SLOT(slotDoubleChanged(
QtProperty*,
double)));
4070 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
4107 return getValue<QSizeF>(d_ptr->
m_values, property);
4127 return getMinimum<QSizeF>(d_ptr->
m_values, property);
4137 return getMaximum<QSizeF>(d_ptr->
m_values, property);
4145 const QtSizeFPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
4147 if (it == d_ptr->
m_values.constEnd())
4152 const QSizeF
v = it.value().val;
4153 const int dec = it.value().decimals;
4154 return QString(tr(
"%1 x %2").arg(QString::number(
v.width(),
'f', dec))
4155 .arg(QString::number(
v.height(),
'f', dec)));
4171 setValueInRange<const QSizeF&, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF>(
this, d_ptr,
4188 const QtSizeFPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
4206 if (
data.decimals == prec)
4211 data.decimals = prec;
4231 setBorderValue<const QSizeF&, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF, QtSizeFPropertyManagerPrivate::Data>(
this, d_ptr,
4252 setBorderValue<const QSizeF&, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF, QtSizeFPropertyManagerPrivate::Data>(
this, d_ptr,
4278 setBorderValues<const QSizeF&, QtSizeFPropertyManagerPrivate, QtSizeFPropertyManager, QSizeF>(
this, d_ptr,
4394 if (!
data.constraint.isNull() &&
data.constraint.x() +
data.constraint.width() < r.x() + r.width())
4396 r.moveLeft(
data.constraint.left() +
data.constraint.width() - r.width());
4407 if (!
data.constraint.isNull() &&
data.constraint.y() +
data.constraint.height() < r.y() + r.height())
4409 r.moveTop(
data.constraint.top() +
data.constraint.height() - r.height());
4441 const QRect& constraint,
const QRect& val)
4443 const bool isNull = constraint.isNull();
4444 const int left = isNull ? INT_MIN : constraint.left();
4445 const int right = isNull ? INT_MAX : constraint.left() + constraint.width();
4446 const int top = isNull ? INT_MIN : constraint.top();
4447 const int bottom = isNull ? INT_MAX : constraint.top() + constraint.height();
4448 const int width = isNull ? INT_MAX : constraint.width();
4449 const int height = isNull ? INT_MAX : constraint.height();
4516 d_ptr->q_ptr =
this;
4520 this, SLOT(slotIntChanged(
QtProperty*,
int)));
4522 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
4559 return getValue<QRect>(d_ptr->
m_values, property);
4577 const QtRectPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
4579 if (it == d_ptr->
m_values.constEnd())
4584 const QRect
v = it.value().val;
4585 return QString(tr(
"[(%1, %2), %3 x %4]").arg(QString::number(
v.x()))
4586 .arg(QString::number(
v.y()))
4587 .arg(QString::number(
v.width()))
4588 .arg(QString::number(
v.height())));
4605 const QtRectPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
4614 QRect newRect = val.normalized();
4616 if (!
data.constraint.isNull() && !
data.constraint.contains(newRect))
4618 const QRect r1 =
data.constraint;
4619 const QRect r2 = newRect;
4620 newRect.setLeft(qMax(r1.left(), r2.left()));
4621 newRect.setRight(qMin(r1.right(), r2.right()));
4622 newRect.setTop(qMax(r1.top(), r2.top()));
4623 newRect.setBottom(qMin(r1.bottom(), r2.bottom()));
4625 if (newRect.width() < 0 || newRect.height() < 0)
4631 if (
data.val == newRect)
4660 const QtRectPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
4669 QRect newConstraint =
constraint.normalized();
4671 if (
data.constraint == newConstraint)
4676 const QRect oldVal =
data.val;
4678 data.constraint = newConstraint;
4680 if (!
data.constraint.isNull() && !
data.constraint.contains(oldVal))
4682 QRect r1 =
data.constraint;
4683 QRect r2 =
data.val;
4685 if (r2.width() > r1.width())
4687 r2.setWidth(r1.width());
4690 if (r2.height() > r1.height())
4692 r2.setHeight(r1.height());
4695 if (r2.left() < r1.left())
4697 r2.moveLeft(r1.left());
4699 else if (r2.right() > r1.right())
4701 r2.moveRight(r1.right());
4704 if (r2.top() < r1.top())
4706 r2.moveTop(r1.top());
4708 else if (r2.bottom() > r1.bottom())
4710 r2.moveBottom(r1.bottom());
4722 if (
data.val == oldVal)
4870 QRectF r =
data.val;
4873 if (!
data.constraint.isNull() &&
data.constraint.x() +
data.constraint.width() < r.x() + r.width())
4875 r.moveLeft(
data.constraint.left() +
data.constraint.width() - r.width());
4883 QRectF r =
data.val;
4886 if (!
data.constraint.isNull() &&
data.constraint.y() +
data.constraint.height() < r.y() + r.height())
4888 r.moveTop(
data.constraint.top() +
data.constraint.height() - r.height());
4920 const QRectF& constraint,
const QRectF& val)
4922 const bool isNull = constraint.isNull();
4923 const float left = isNull ? FLT_MIN : constraint.left();
4924 const float right = isNull ? FLT_MAX : constraint.left() + constraint.width();
4925 const float top = isNull ? FLT_MIN : constraint.top();
4926 const float bottom = isNull ? FLT_MAX : constraint.top() + constraint.height();
4927 const float width = isNull ? FLT_MAX : constraint.width();
4928 const float height = isNull ? FLT_MAX : constraint.height();
5005 d_ptr->q_ptr =
this;
5009 this, SLOT(slotDoubleChanged(
QtProperty*,
double)));
5011 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
5048 return getValue<QRectF>(d_ptr->
m_values, property);
5076 const QtRectFPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
5078 if (it == d_ptr->
m_values.constEnd())
5083 const QRectF
v = it.value().val;
5084 const int dec = it.value().decimals;
5085 return QString(tr(
"[(%1, %2), %3 x %4]").arg(QString::number(
v.x(),
'f', dec))
5086 .arg(QString::number(
v.y(),
'f', dec))
5087 .arg(QString::number(
v.width(),
'f', dec))
5088 .arg(QString::number(
v.height(),
'f', dec)));
5105 const QtRectFPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
5114 QRectF newRect = val.normalized();
5116 if (!
data.constraint.isNull() && !
data.constraint.contains(newRect))
5118 const QRectF r1 =
data.constraint;
5119 const QRectF r2 = newRect;
5120 newRect.setLeft(qMax(r1.left(), r2.left()));
5121 newRect.setRight(qMin(r1.right(), r2.right()));
5122 newRect.setTop(qMax(r1.top(), r2.top()));
5123 newRect.setBottom(qMin(r1.bottom(), r2.bottom()));
5125 if (newRect.width() < 0 || newRect.height() < 0)
5131 if (
data.val == newRect)
5160 const QtRectFPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
5169 QRectF newConstraint =
constraint.normalized();
5171 if (
data.constraint == newConstraint)
5176 const QRectF oldVal =
data.val;
5178 data.constraint = newConstraint;
5180 if (!
data.constraint.isNull() && !
data.constraint.contains(oldVal))
5182 QRectF r1 =
data.constraint;
5183 QRectF r2 =
data.val;
5185 if (r2.width() > r1.width())
5187 r2.setWidth(r1.width());
5190 if (r2.height() > r1.height())
5192 r2.setHeight(r1.height());
5195 if (r2.left() < r1.left())
5197 r2.moveLeft(r1.left());
5199 else if (r2.right() > r1.right())
5201 r2.moveRight(r1.right());
5204 if (r2.top() < r1.top())
5206 r2.moveTop(r1.top());
5208 else if (r2.bottom() > r1.bottom())
5210 r2.moveBottom(r1.bottom());
5222 if (
data.val == oldVal)
5242 const QtRectFPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
5260 if (
data.decimals == prec)
5265 data.decimals = prec;
5446 d_ptr->q_ptr =
this;
5469 return getValue<int>(d_ptr->
m_values, property, -1);
5497 const QtEnumPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
5499 if (it == d_ptr->
m_values.constEnd())
5506 const int v =
data.val;
5508 if (
v >= 0 &&
v <
data.enumNames.count())
5510 return data.enumNames.at(
v);
5521 const QtEnumPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
5523 if (it == d_ptr->
m_values.constEnd())
5530 const int v =
data.val;
5531 return data.enumIcons.value(
v);
5546 const QtEnumPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
5555 if (val >=
data.enumNames.count())
5560 if (val < 0 &&
data.enumNames.count() > 0)
5570 if (
data.val == val)
5595 const QtEnumPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
5636 const QtEnumPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
5706 while (itProp.hasNext())
5735 if (flagProperty == 0)
5802 d_ptr->q_ptr =
this;
5806 this, SLOT(slotBoolChanged(
QtProperty*,
bool)));
5808 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
5845 return getValue<int>(d_ptr->
m_values, property, 0);
5863 const QtFlagPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
5865 if (it == d_ptr->
m_values.constEnd())
5874 const QChar bar = QLatin1Char(
'|');
5875 const QStringList::const_iterator fncend =
data.flagNames.constEnd();
5877 for (QStringList::const_iterator it =
data.flagNames.constBegin(); it != fncend; ++it)
5879 if (
data.val & (1 << level))
5910 const QtFlagPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
5919 if (
data.val == val)
5924 if (val > (1 <<
data.flagNames.count()) - 1)
5941 while (itProp.hasNext())
5966 const QtFlagPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
5987 while (itProp.hasNext())
6002 while (itFlag.hasNext())
6004 const QString flagName = itFlag.next();
6007 property->addSubProperty(prop);
6035 while (itProp.hasNext())
6091 sp.setHorizontalStretch(
value);
6097 sp.setVerticalStretch(
value);
6107 sp.setHorizontalPolicy(metaEnumProvider()->indexToSizePolicy(
value));
6113 sp.setVerticalPolicy(metaEnumProvider()->indexToSizePolicy(
value));
6182 d_ptr->q_ptr =
this;
6186 this, SLOT(slotIntChanged(
QtProperty*,
int)));
6189 this, SLOT(slotEnumChanged(
QtProperty*,
int)));
6192 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
6194 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
6246 return d_ptr->
m_values.value(property, QSizePolicy());
6254 const QtSizePolicyPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
6256 if (it == d_ptr->
m_values.constEnd())
6261 const QSizePolicy sp = it.value();
6266 const QString hPolicy = hIndex != -1 ? mep->
policyEnumNames().at(hIndex) : tr(
"<Invalid>");
6267 const QString vPolicy = vIndex != -1 ? mep->
policyEnumNames().at(vIndex) : tr(
"<Invalid>");
6268 const QString
str = tr(
"[%1, %2, %3, %4]").arg(hPolicy, vPolicy).arg(sp.horizontalStretch()).arg(sp.verticalStretch());
6282 const QtSizePolicyPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
6289 if (it.value() == val)
6297 metaEnumProvider()->sizePolicyToIndex(val.horizontalPolicy()));
6299 metaEnumProvider()->sizePolicyToIndex(val.verticalPolicy()));
6301 val.horizontalStretch());
6303 val.verticalStretch());
6321 metaEnumProvider()->sizePolicyToIndex(val.horizontalPolicy()));
6330 metaEnumProvider()->sizePolicyToIndex(val.verticalPolicy()));
6383 delete hStretchProp;
6393 delete vStretchProp;
6409 Q_GLOBAL_STATIC(QFontDatabase, fontDatabase)
6422 void slotPropertyDestroyed(
QtProperty* property);
6423 void slotFontDatabaseChanged();
6424 void slotFontDatabaseDelayedChange();
6456 m_settingValue(false),
6457 m_fontDatabaseChangeTimer(0)
6471 f.setPointSize(
value);
6513 f.setUnderline(
value);
6519 f.setStrikeOut(
value);
6525 f.setKerning(
value);
6587 using PropertyPropertyMap = QMap<const QtProperty*, QtProperty*>;
6597 for (PropertyPropertyMap::const_iterator it =
m_propertyToFamily.constBegin(); it != cend; ++it)
6655 d_ptr->q_ptr =
this;
6656 QObject::connect(qApp, SIGNAL(fontDatabaseChanged()),
this, SLOT(slotFontDatabaseChanged()));
6660 this, SLOT(slotIntChanged(
QtProperty*,
int)));
6663 this, SLOT(slotEnumChanged(
QtProperty*,
int)));
6666 this, SLOT(slotBoolChanged(
QtProperty*,
bool)));
6669 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
6671 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
6673 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
6739 return d_ptr->
m_values.value(property, QFont());
6747 const QtFontPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
6749 if (it == d_ptr->
m_values.constEnd())
6762 const QtFontPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
6764 if (it == d_ptr->
m_values.constEnd())
6782 const QtFontPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
6789 const QFont oldVal = it.value();
6791 if (oldVal == val && oldVal.resolve() == val.resolve())
6913 delete pointSizeProp;
6943 delete underlineProp;
6953 delete strikeOutProp;
7089 d_ptr->q_ptr =
this;
7093 this, SLOT(slotIntChanged(
QtProperty*,
int)));
7096 this, SLOT(slotPropertyDestroyed(
QtProperty*)));
7133 return d_ptr->
m_values.value(property, QColor());
7142 const QtColorPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
7144 if (it == d_ptr->
m_values.constEnd())
7158 const QtColorPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
7160 if (it == d_ptr->
m_values.constEnd())
7178 const QtColorPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
7185 if (it.value() == val)
7294 static void clearCursorDatabase();
7301 qAddPostRoutine(clearCursorDatabase);
7307 static void clearCursorDatabase()
7309 cursorDatabase2()->clear();
7352 d_ptr->q_ptr =
this;
7372 #ifndef QT_NO_CURSOR
7375 return d_ptr->
m_values.value(property, QCursor());
7384 const QtCursorPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
7386 if (it == d_ptr->
m_values.constEnd())
7391 return cursorDatabase2()->cursorToShapeName(it.value());
7399 const QtCursorPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->
m_values.constFind(property);
7401 if (it == d_ptr->
m_values.constEnd())
7406 return cursorDatabase2()->cursorToShapeIcon(it.value());
7418 #ifndef QT_NO_CURSOR
7419 const QtCursorPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->
m_values.find(property);
7426 if (it.value().shape() ==
value.shape() &&
value.shape() != Qt::BitmapCursor)
7443 #ifndef QT_NO_CURSOR
7444 d_ptr->
m_values[property] = QCursor();
7458 #include "moc_qtpropertymanager.cpp"
7459 #include "qtpropertymanager.moc"