qtvariantproperty.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the Qt Solutions component.
7 **
8 ** $QT_BEGIN_LICENSE:BSD$
9 ** You may use this file under the terms of the BSD license as follows:
10 **
11 ** "Redistribution and use in source and binary forms, with or without
12 ** modification, are permitted provided that the following conditions are
13 ** met:
14 ** * Redistributions of source code must retain the above copyright
15 ** notice, this list of conditions and the following disclaimer.
16 ** * Redistributions in binary form must reproduce the above copyright
17 ** notice, this list of conditions and the following disclaimer in
18 ** the documentation and/or other materials provided with the
19 ** distribution.
20 ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
21 ** of its contributors may be used to endorse or promote products derived
22 ** from this software without specific prior written permission.
23 **
24 **
25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
36 **
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40 
41 
42 #include "qtvariantproperty.h"
43 #include "qtpropertymanager.h"
44 #include "qteditorfactory.h"
45 #include <QVariant>
46 #include <QIcon>
47 #include <QDate>
48 #include <QLocale>
49 
50 #if defined(Q_CC_MSVC)
51 # pragma warning(disable: 4786) /* MS VS 6: truncating debug info after 255 characters */
52 #endif
53 
54 QT_BEGIN_NAMESPACE
55 
57 {
58 };
59 
60 
62 {
63 };
64 
65 
67 {
68 };
69 
70 QT_END_NAMESPACE
71 
72 Q_DECLARE_METATYPE(QtEnumPropertyType)
73 Q_DECLARE_METATYPE(QtFlagPropertyType)
74 Q_DECLARE_METATYPE(QtGroupPropertyType)
75 
76 QT_BEGIN_NAMESPACE
77 
78 /*!
79  Returns the type id for an enum property.
80 
81  Note that the property's value type can be retrieved using the
82  valueType() function (which is QVariant::Int for the enum property
83  type).
84 
85  \sa propertyType(), valueType()
86 */
88 {
89  return qMetaTypeId<QtEnumPropertyType>();
90 }
91 
92 /*!
93  Returns the type id for a flag property.
94 
95  Note that the property's value type can be retrieved using the
96  valueType() function (which is QVariant::Int for the flag property
97  type).
98 
99  \sa propertyType(), valueType()
100 */
102 {
103  return qMetaTypeId<QtFlagPropertyType>();
104 }
105 
106 /*!
107  Returns the type id for a group property.
108 
109  Note that the property's value type can be retrieved using the
110  valueType() function (which is QVariant::Invalid for the group
111  property type, since it doesn't provide any value).
112 
113  \sa propertyType(), valueType()
114 */
116 {
117  return qMetaTypeId<QtGroupPropertyType>();
118 }
119 
120 /*!
121  Returns the type id for a icon map attribute.
122 
123  Note that the property's attribute type can be retrieved using the
124  attributeType() function.
125 
126  \sa attributeType(), QtEnumPropertyManager::enumIcons()
127 */
129 {
130  return qMetaTypeId<QtIconMap>();
131 }
132 
133 using PropertyMap = QMap<const QtProperty*, QtProperty*>;
134 Q_GLOBAL_STATIC(PropertyMap, propertyToWrappedProperty)
135 
136 static QtProperty* wrappedProperty(QtProperty* property)
137 {
138  return propertyToWrappedProperty()->value(property, 0);
139 }
140 
142 {
143  QtVariantProperty* q_ptr;
144 public:
146 
148 };
149 
150 /*!
151  \class QtVariantProperty
152 
153  \brief The QtVariantProperty class is a convenience class handling
154  QVariant based properties.
155 
156  QtVariantProperty provides additional API: A property's type,
157  value type, attribute values and current value can easily be
158  retrieved using the propertyType(), valueType(), attributeValue()
159  and value() functions respectively. In addition, the attribute
160  values and the current value can be set using the corresponding
161  setValue() and setAttribute() functions.
162 
163  For example, instead of writing:
164 
165  \code
166  QtVariantPropertyManager *variantPropertyManager;
167  QtProperty *property;
168 
169  variantPropertyManager->setValue(property, 10);
170  \endcode
171 
172  you can write:
173 
174  \code
175  QtVariantPropertyManager *variantPropertyManager;
176  QtVariantProperty *property;
177 
178  property->setValue(10);
179  \endcode
180 
181  QtVariantProperty instances can only be created by the
182  QtVariantPropertyManager class.
183 
184  \sa QtProperty, QtVariantPropertyManager, QtVariantEditorFactory
185 */
186 
187 /*!
188  Creates a variant property using the given \a manager.
189 
190  Do not use this constructor to create variant property instances;
191  use the QtVariantPropertyManager::addProperty() function
192  instead. This constructor is used internally by the
193  QtVariantPropertyManager::createProperty() function.
194 
195  \sa QtVariantPropertyManager
196 */
198  : QtProperty(manager), d_ptr(new QtVariantPropertyPrivate(manager))
199 {
200 
201 }
202 
203 /*!
204  Destroys this property.
205 
206  \sa QtProperty::~QtProperty()
207 */
209 {
210  delete d_ptr;
211 }
212 
213 /*!
214  Returns the property's current value.
215 
216  \sa valueType(), setValue()
217 */
218 QVariant QtVariantProperty::value() const
219 {
220  return d_ptr->manager->value(this);
221 }
222 
223 /*!
224  Returns this property's value for the specified \a attribute.
225 
226  QtVariantPropertyManager provides a couple of related functions:
227  \l{QtVariantPropertyManager::attributes()}{attributes()} and
228  \l{QtVariantPropertyManager::attributeType()}{attributeType()}.
229 
230  \sa setAttribute()
231 */
232 QVariant QtVariantProperty::attributeValue(const QString& attribute) const
233 {
234  return d_ptr->manager->attributeValue(this, attribute);
235 }
236 
237 /*!
238  Returns the type of this property's value.
239 
240  \sa propertyType()
241 */
243 {
244  return d_ptr->manager->valueType(this);
245 }
246 
247 /*!
248  Returns this property's type.
249 
250  QtVariantPropertyManager provides several related functions:
251  \l{QtVariantPropertyManager::enumTypeId()}{enumTypeId()},
252  \l{QtVariantPropertyManager::flagTypeId()}{flagTypeId()} and
253  \l{QtVariantPropertyManager::groupTypeId()}{groupTypeId()}.
254 
255  \sa valueType()
256 */
258 {
259  return d_ptr->manager->propertyType(this);
260 }
261 
262 /*!
263  Sets the value of this property to \a value.
264 
265  The specified \a value must be of the type returned by
266  valueType(), or of a type that can be converted to valueType()
267  using the QVariant::canConvert() function; otherwise this function
268  does nothing.
269 
270  \sa value()
271 */
272 void QtVariantProperty::setValue(const QVariant& value)
273 {
274  d_ptr->manager->setValue(this, value);
275 }
276 
277 /*!
278  Sets the \a attribute of property to \a value.
279 
280  QtVariantPropertyManager provides the related
281  \l{QtVariantPropertyManager::setAttribute()}{setAttribute()}
282  function.
283 
284  \sa attributeValue()
285 */
286 void QtVariantProperty::setAttribute(const QString& attribute, const QVariant& value)
287 {
288  d_ptr->manager->setAttribute(this, attribute, value);
289 }
290 
292 {
294  Q_DECLARE_PUBLIC(QtVariantPropertyManager)
295 public:
297 
302 
303  void slotValueChanged(QtProperty* property, int val);
304  void slotRangeChanged(QtProperty* property, int min, int max);
305  void slotSingleStepChanged(QtProperty* property, int step);
306  void slotValueChanged(QtProperty* property, double val);
307  void slotRangeChanged(QtProperty* property, double min, double max);
308  void slotSingleStepChanged(QtProperty* property, double step);
309  void slotDecimalsChanged(QtProperty* property, int prec);
310  void slotValueChanged(QtProperty* property, bool val);
311  void slotValueChanged(QtProperty* property, const QString& val);
312  void slotRegExpChanged(QtProperty* property, const QRegExp& regExp);
313  void slotEchoModeChanged(QtProperty* property, int);
314  void slotValueChanged(QtProperty* property, const QDate& val);
315  void slotRangeChanged(QtProperty* property, const QDate& min, const QDate& max);
316  void slotValueChanged(QtProperty* property, const QTime& val);
317  void slotValueChanged(QtProperty* property, const QDateTime& val);
318  void slotValueChanged(QtProperty* property, const QKeySequence& val);
319  void slotValueChanged(QtProperty* property, const QChar& val);
320  void slotValueChanged(QtProperty* property, const QLocale& val);
321  void slotValueChanged(QtProperty* property, const QPoint& val);
322  void slotValueChanged(QtProperty* property, const QPointF& val);
323  void slotValueChanged(QtProperty* property, const QSize& val);
324  void slotRangeChanged(QtProperty* property, const QSize& min, const QSize& max);
325  void slotValueChanged(QtProperty* property, const QSizeF& val);
326  void slotRangeChanged(QtProperty* property, const QSizeF& min, const QSizeF& max);
327  void slotValueChanged(QtProperty* property, const QRect& val);
328  void slotConstraintChanged(QtProperty* property, const QRect& val);
329  void slotValueChanged(QtProperty* property, const QRectF& val);
330  void slotConstraintChanged(QtProperty* property, const QRectF& val);
331  void slotValueChanged(QtProperty* property, const QColor& val);
332  void slotEnumChanged(QtProperty* property, int val);
333  void slotEnumNamesChanged(QtProperty* property, const QStringList& enumNames);
334  void slotEnumIconsChanged(QtProperty* property, const QMap<int, QIcon>& enumIcons);
335  void slotValueChanged(QtProperty* property, const QSizePolicy& val);
336  void slotValueChanged(QtProperty* property, const QFont& val);
337  void slotValueChanged(QtProperty* property, const QCursor& val);
338  void slotFlagChanged(QtProperty* property, int val);
339  void slotFlagNamesChanged(QtProperty* property, const QStringList& flagNames);
340  void slotReadOnlyChanged(QtProperty* property, bool readOnly);
341  void slotTextVisibleChanged(QtProperty* property, bool textVisible);
342  void slotPropertyInserted(QtProperty* property, QtProperty* parent, QtProperty* after);
343  void slotPropertyRemoved(QtProperty* property, QtProperty* parent);
344 
345  void valueChanged(QtProperty* property, const QVariant& val);
346 
347  int internalPropertyToType(QtProperty* property) const;
349  QtProperty* internal);
350  void removeSubProperty(QtVariantProperty* property);
351 
352  QMap<int, QtAbstractPropertyManager*> m_typeToPropertyManager;
353  QMap<int, QMap<QString, int> > m_typeToAttributeToAttributeType;
354 
355  QMap<const QtProperty*, QPair<QtVariantProperty*, int> > m_propertyToType;
356 
357  QMap<int, int> m_typeToValueType;
358 
359 
360  QMap<QtProperty*, QtVariantProperty*> m_internalToProperty;
361 
362  const QString m_constraintAttribute;
363  const QString m_singleStepAttribute;
364  const QString m_decimalsAttribute;
365  const QString m_enumIconsAttribute;
366  const QString m_enumNamesAttribute;
367  const QString m_flagNamesAttribute;
368  const QString m_maximumAttribute;
369  const QString m_minimumAttribute;
370  const QString m_regExpAttribute;
371  const QString m_echoModeAttribute;
372  const QString m_readOnlyAttribute;
373  const QString m_textVisibleAttribute;
374 };
375 
377  m_constraintAttribute(QLatin1String("constraint")),
378  m_singleStepAttribute(QLatin1String("singleStep")),
379  m_decimalsAttribute(QLatin1String("decimals")),
380  m_enumIconsAttribute(QLatin1String("enumIcons")),
381  m_enumNamesAttribute(QLatin1String("enumNames")),
382  m_flagNamesAttribute(QLatin1String("flagNames")),
383  m_maximumAttribute(QLatin1String("maximum")),
384  m_minimumAttribute(QLatin1String("minimum")),
385  m_regExpAttribute(QLatin1String("regExp")),
386  m_echoModeAttribute(QLatin1String("echoMode")),
387  m_readOnlyAttribute(QLatin1String("readOnly")),
388  m_textVisibleAttribute(QLatin1String("textVisible"))
389 {
390 }
391 
393 {
394  int type = 0;
395  QtAbstractPropertyManager* internPropertyManager = property->propertyManager();
396 
397  if (qobject_cast<QtIntPropertyManager*>(internPropertyManager))
398  {
399  type = QVariant::Int;
400  }
401  else if (qobject_cast<QtEnumPropertyManager*>(internPropertyManager))
402  {
404  }
405  else if (qobject_cast<QtBoolPropertyManager*>(internPropertyManager))
406  {
407  type = QVariant::Bool;
408  }
409  else if (qobject_cast<QtDoublePropertyManager*>(internPropertyManager))
410  {
411  type = QVariant::Double;
412  }
413 
414  return type;
415 }
416 
418  QtVariantProperty* after, QtProperty* internal)
419 {
420  int type = internalPropertyToType(internal);
421 
422  if (!type)
423  {
424  return 0;
425  }
426 
427  bool wasCreatingSubProperties = m_creatingSubProperties;
429 
430  QtVariantProperty* varChild = q_ptr->addProperty(type, internal->propertyName());
431 
432  m_creatingSubProperties = wasCreatingSubProperties;
433 
434  varChild->setPropertyName(internal->propertyName());
435  varChild->setToolTip(internal->toolTip());
436  varChild->setStatusTip(internal->statusTip());
437  varChild->setWhatsThis(internal->whatsThis());
438 
439  parent->insertSubProperty(varChild, after);
440 
441  m_internalToProperty[internal] = varChild;
442  propertyToWrappedProperty()->insert(varChild, internal);
443  return varChild;
444 }
445 
447 {
448  QtProperty* internChild = wrappedProperty(property);
449  bool wasDestroyingSubProperties = m_destroyingSubProperties;
451  delete property;
452  m_destroyingSubProperties = wasDestroyingSubProperties;
453  m_internalToProperty.remove(internChild);
454  propertyToWrappedProperty()->remove(property);
455 }
456 
458  QtProperty* parent, QtProperty* after)
459 {
460  if (m_creatingProperty)
461  {
462  return;
463  }
464 
465  QtVariantProperty* varParent = m_internalToProperty.value(parent, 0);
466 
467  if (!varParent)
468  {
469  return;
470  }
471 
472  QtVariantProperty* varAfter = 0;
473 
474  if (after)
475  {
476  varAfter = m_internalToProperty.value(after, 0);
477 
478  if (!varAfter)
479  {
480  return;
481  }
482  }
483 
484  createSubProperty(varParent, varAfter, property);
485 }
486 
488 {
489  Q_UNUSED(parent)
490 
491  QtVariantProperty* varProperty = m_internalToProperty.value(property, 0);
492 
493  if (!varProperty)
494  {
495  return;
496  }
497 
498  removeSubProperty(varProperty);
499 }
500 
501 void QtVariantPropertyManagerPrivate::valueChanged(QtProperty* property, const QVariant& val)
502 {
503  QtVariantProperty* varProp = m_internalToProperty.value(property, 0);
504 
505  if (!varProp)
506  {
507  return;
508  }
509 
510  emit q_ptr->valueChanged(varProp, val);
511  emit q_ptr->propertyChanged(varProp);
512 }
513 
515 {
516  valueChanged(property, QVariant(val));
517 }
518 
520 {
521  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
522  {
523  emit q_ptr->attributeChanged(varProp, m_minimumAttribute, QVariant(min));
524  emit q_ptr->attributeChanged(varProp, m_maximumAttribute, QVariant(max));
525  }
526 }
527 
529 {
530  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
531  {
532  emit q_ptr->attributeChanged(varProp, m_singleStepAttribute, QVariant(step));
533  }
534 }
535 
537 {
538  valueChanged(property, QVariant(val));
539 }
540 
542 {
543  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
544  {
545  emit q_ptr->attributeChanged(varProp, m_minimumAttribute, QVariant(min));
546  emit q_ptr->attributeChanged(varProp, m_maximumAttribute, QVariant(max));
547  }
548 }
549 
551 {
552  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
553  {
554  emit q_ptr->attributeChanged(varProp, m_singleStepAttribute, QVariant(step));
555  }
556 }
557 
559 {
560  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
561  {
562  emit q_ptr->attributeChanged(varProp, m_decimalsAttribute, QVariant(prec));
563  }
564 }
565 
567 {
568  valueChanged(property, QVariant(val));
569 }
570 
572 {
573  valueChanged(property, QVariant(val));
574 }
575 
577 {
578  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
579  {
580  emit q_ptr->attributeChanged(varProp, m_regExpAttribute, QVariant(regExp));
581  }
582 }
583 
585 {
586  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
587  {
588  emit q_ptr->attributeChanged(varProp, m_echoModeAttribute, QVariant(mode));
589  }
590 }
591 
593 {
594  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
595  {
596  emit q_ptr->attributeChanged(varProp, m_readOnlyAttribute, QVariant(readOnly));
597  }
598 }
599 
601 {
602  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
603  {
604  emit q_ptr->attributeChanged(varProp, m_textVisibleAttribute, QVariant(textVisible));
605  }
606 }
607 
609 {
610  valueChanged(property, QVariant(val));
611 }
612 
613 void QtVariantPropertyManagerPrivate::slotRangeChanged(QtProperty* property, const QDate& min, const QDate& max)
614 {
615  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
616  {
617  emit q_ptr->attributeChanged(varProp, m_minimumAttribute, QVariant(min));
618  emit q_ptr->attributeChanged(varProp, m_maximumAttribute, QVariant(max));
619  }
620 }
621 
623 {
624  valueChanged(property, QVariant(val));
625 }
626 
628 {
629  valueChanged(property, QVariant(val));
630 }
631 
632 void QtVariantPropertyManagerPrivate::slotValueChanged(QtProperty* property, const QKeySequence& val)
633 {
634  QVariant v;
635  qVariantSetValue(v, val);
636  valueChanged(property, v);
637 }
638 
640 {
641  valueChanged(property, QVariant(val));
642 }
643 
645 {
646  valueChanged(property, QVariant(val));
647 }
648 
650 {
651  valueChanged(property, QVariant(val));
652 }
653 
655 {
656  valueChanged(property, QVariant(val));
657 }
658 
660 {
661  valueChanged(property, QVariant(val));
662 }
663 
664 void QtVariantPropertyManagerPrivate::slotRangeChanged(QtProperty* property, const QSize& min, const QSize& max)
665 {
666  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
667  {
668  emit q_ptr->attributeChanged(varProp, m_minimumAttribute, QVariant(min));
669  emit q_ptr->attributeChanged(varProp, m_maximumAttribute, QVariant(max));
670  }
671 }
672 
674 {
675  valueChanged(property, QVariant(val));
676 }
677 
678 void QtVariantPropertyManagerPrivate::slotRangeChanged(QtProperty* property, const QSizeF& min, const QSizeF& max)
679 {
680  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
681  {
682  emit q_ptr->attributeChanged(varProp, m_minimumAttribute, QVariant(min));
683  emit q_ptr->attributeChanged(varProp, m_maximumAttribute, QVariant(max));
684  }
685 }
686 
688 {
689  valueChanged(property, QVariant(val));
690 }
691 
693 {
694  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
695  {
696  emit q_ptr->attributeChanged(varProp, m_constraintAttribute, QVariant(constraint));
697  }
698 }
699 
701 {
702  valueChanged(property, QVariant(val));
703 }
704 
706 {
707  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
708  {
709  emit q_ptr->attributeChanged(varProp, m_constraintAttribute, QVariant(constraint));
710  }
711 }
712 
714 {
715  valueChanged(property, QVariant(val));
716 }
717 
718 void QtVariantPropertyManagerPrivate::slotEnumNamesChanged(QtProperty* property, const QStringList& enumNames)
719 {
720  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
721  {
722  emit q_ptr->attributeChanged(varProp, m_enumNamesAttribute, QVariant(enumNames));
723  }
724 }
725 
726 void QtVariantPropertyManagerPrivate::slotEnumIconsChanged(QtProperty* property, const QMap<int, QIcon>& enumIcons)
727 {
728  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
729  {
730  QVariant v;
731  qVariantSetValue(v, enumIcons);
732  emit q_ptr->attributeChanged(varProp, m_enumIconsAttribute, v);
733  }
734 }
735 
736 void QtVariantPropertyManagerPrivate::slotValueChanged(QtProperty* property, const QSizePolicy& val)
737 {
738  valueChanged(property, QVariant(val));
739 }
740 
742 {
743  valueChanged(property, QVariant(val));
744 }
745 
747 {
748 #ifndef QT_NO_CURSOR
749  valueChanged(property, QVariant(val));
750 #endif
751 }
752 
753 void QtVariantPropertyManagerPrivate::slotFlagNamesChanged(QtProperty* property, const QStringList& flagNames)
754 {
755  if (QtVariantProperty* varProp = m_internalToProperty.value(property, 0))
756  {
757  emit q_ptr->attributeChanged(varProp, m_flagNamesAttribute, QVariant(flagNames));
758  }
759 }
760 
761 /*!
762  \class QtVariantPropertyManager
763 
764  \brief The QtVariantPropertyManager class provides and manages QVariant based properties.
765 
766  QtVariantPropertyManager provides the addProperty() function which
767  creates QtVariantProperty objects. The QtVariantProperty class is
768  a convenience class handling QVariant based properties inheriting
769  QtProperty. A QtProperty object created by a
770  QtVariantPropertyManager instance can be converted into a
771  QtVariantProperty object using the variantProperty() function.
772 
773  The property's value can be retrieved using the value(), and set
774  using the setValue() slot. In addition the property's type, and
775  the type of its value, can be retrieved using the propertyType()
776  and valueType() functions respectively.
777 
778  A property's type is a QVariant::Type enumerator value, and
779  usually a property's type is the same as its value type. But for
780  some properties the types differ, for example for enums, flags and
781  group types in which case QtVariantPropertyManager provides the
782  enumTypeId(), flagTypeId() and groupTypeId() functions,
783  respectively, to identify their property type (the value types are
784  QVariant::Int for the enum and flag types, and QVariant::Invalid
785  for the group type).
786 
787  Use the isPropertyTypeSupported() function to check if a particular
788  property type is supported. The currently supported property types
789  are:
790 
791  \table
792  \header
793  \o Property Type
794  \o Property Type Id
795  \row
796  \o int
797  \o QVariant::Int
798  \row
799  \o double
800  \o QVariant::Double
801  \row
802  \o bool
803  \o QVariant::Bool
804  \row
805  \o QString
806  \o QVariant::String
807  \row
808  \o QDate
809  \o QVariant::Date
810  \row
811  \o QTime
812  \o QVariant::Time
813  \row
814  \o QDateTime
815  \o QVariant::DateTime
816  \row
817  \o QKeySequence
818  \o QVariant::KeySequence
819  \row
820  \o QChar
821  \o QVariant::Char
822  \row
823  \o QLocale
824  \o QVariant::Locale
825  \row
826  \o QPoint
827  \o QVariant::Point
828  \row
829  \o QPointF
830  \o QVariant::PointF
831  \row
832  \o QSize
833  \o QVariant::Size
834  \row
835  \o QSizeF
836  \o QVariant::SizeF
837  \row
838  \o QRect
839  \o QVariant::Rect
840  \row
841  \o QRectF
842  \o QVariant::RectF
843  \row
844  \o QColor
845  \o QVariant::Color
846  \row
847  \o QSizePolicy
848  \o QVariant::SizePolicy
849  \row
850  \o QFont
851  \o QVariant::Font
852  \row
853  \o QCursor
854  \o QVariant::Cursor
855  \row
856  \o enum
857  \o enumTypeId()
858  \row
859  \o flag
860  \o flagTypeId()
861  \row
862  \o group
863  \o groupTypeId()
864  \endtable
865 
866  Each property type can provide additional attributes,
867  e.g. QVariant::Int and QVariant::Double provides minimum and
868  maximum values. The currently supported attributes are:
869 
870  \table
871  \header
872  \o Property Type
873  \o Attribute Name
874  \o Attribute Type
875  \row
876  \o \c int
877  \o minimum
878  \o QVariant::Int
879  \row
880  \o
881  \o maximum
882  \o QVariant::Int
883  \row
884  \o
885  \o singleStep
886  \o QVariant::Int
887  \row
888  \o \c double
889  \o minimum
890  \o QVariant::Double
891  \row
892  \o
893  \o maximum
894  \o QVariant::Double
895  \row
896  \o
897  \o singleStep
898  \o QVariant::Double
899  \row
900  \o
901  \o decimals
902  \o QVariant::Int
903  \row
904  \o \c bool
905  \o textVisible
906  \o QVariant::Bool
907  \row
908  \o QString
909  \o regExp
910  \o QVariant::RegExp
911  \row
912  \o
913  \o echoMode
914  \o QVariant::Int
915  \row
916  \o QDate
917  \o minimum
918  \o QVariant::Date
919  \row
920  \o
921  \o maximum
922  \o QVariant::Date
923  \row
924  \o QPointF
925  \o decimals
926  \o QVariant::Int
927  \row
928  \o QSize
929  \o minimum
930  \o QVariant::Size
931  \row
932  \o
933  \o maximum
934  \o QVariant::Size
935  \row
936  \o QSizeF
937  \o minimum
938  \o QVariant::SizeF
939  \row
940  \o
941  \o maximum
942  \o QVariant::SizeF
943  \row
944  \o
945  \o decimals
946  \o QVariant::Int
947  \row
948  \o QRect
949  \o constraint
950  \o QVariant::Rect
951  \row
952  \o QRectF
953  \o constraint
954  \o QVariant::RectF
955  \row
956  \o
957  \o decimals
958  \o QVariant::Int
959  \row
960  \o \c enum
961  \o enumNames
962  \o QVariant::StringList
963  \row
964  \o
965  \o enumIcons
966  \o iconMapTypeId()
967  \row
968  \o \c flag
969  \o flagNames
970  \o QVariant::StringList
971  \endtable
972 
973  The attributes for a given property type can be retrieved using
974  the attributes() function. Each attribute has a value type which
975  can be retrieved using the attributeType() function, and a value
976  accessible through the attributeValue() function. In addition, the
977  value can be set using the setAttribute() slot.
978 
979  QtVariantManager also provides the valueChanged() signal which is
980  emitted whenever a property created by this manager change, and
981  the attributeChanged() signal which is emitted whenever an
982  attribute of such a property changes.
983 
984  \sa QtVariantProperty, QtVariantEditorFactory
985 */
986 
987 /*!
988  \fn void QtVariantPropertyManager::valueChanged(QtProperty *property, const QVariant &value)
989 
990  This signal is emitted whenever a property created by this manager
991  changes its value, passing a pointer to the \a property and the
992  new \a value as parameters.
993 
994  \sa setValue()
995 */
996 
997 /*!
998  \fn void QtVariantPropertyManager::attributeChanged(QtProperty *property,
999  const QString &attribute, const QVariant &value)
1000 
1001  This signal is emitted whenever an attribute of a property created
1002  by this manager changes its value, passing a pointer to the \a
1003  property, the \a attribute and the new \a value as parameters.
1004 
1005  \sa setAttribute()
1006 */
1007 
1008 /*!
1009  Creates a manager with the given \a parent.
1010 */
1012  : QtAbstractPropertyManager(parent)
1013 {
1014  d_ptr = new QtVariantPropertyManagerPrivate;
1015  d_ptr->q_ptr = this;
1016 
1017  d_ptr->m_creatingProperty = false;
1018  d_ptr->m_creatingSubProperties = false;
1019  d_ptr->m_destroyingSubProperties = false;
1020  d_ptr->m_propertyType = 0;
1021 
1022  // IntPropertyManager
1023  QtIntPropertyManager* intPropertyManager = new QtIntPropertyManager(this);
1024  d_ptr->m_typeToPropertyManager[QVariant::Int] = intPropertyManager;
1030  connect(intPropertyManager, SIGNAL(valueChanged(QtProperty*, int)),
1031  this, SLOT(slotValueChanged(QtProperty*, int)));
1032  connect(intPropertyManager, SIGNAL(rangeChanged(QtProperty*, int, int)),
1033  this, SLOT(slotRangeChanged(QtProperty*, int, int)));
1034  connect(intPropertyManager, SIGNAL(singleStepChanged(QtProperty*, int)),
1035  this, SLOT(slotSingleStepChanged(QtProperty*, int)));
1036  // DoublePropertyManager
1037  QtDoublePropertyManager* doublePropertyManager = new QtDoublePropertyManager(this);
1038  d_ptr->m_typeToPropertyManager[QVariant::Double] = doublePropertyManager;
1046  QVariant::Int;
1050  connect(doublePropertyManager, SIGNAL(valueChanged(QtProperty*, double)),
1051  this, SLOT(slotValueChanged(QtProperty*, double)));
1052  connect(doublePropertyManager, SIGNAL(rangeChanged(QtProperty*, double, double)),
1053  this, SLOT(slotRangeChanged(QtProperty*, double, double)));
1054  connect(doublePropertyManager, SIGNAL(singleStepChanged(QtProperty*, double)),
1055  this, SLOT(slotSingleStepChanged(QtProperty*, double)));
1056  connect(doublePropertyManager, SIGNAL(decimalsChanged(QtProperty*, int)),
1057  this, SLOT(slotDecimalsChanged(QtProperty*, int)));
1058  // BoolPropertyManager
1059  QtBoolPropertyManager* boolPropertyManager = new QtBoolPropertyManager(this);
1060  d_ptr->m_typeToPropertyManager[QVariant::Bool] = boolPropertyManager;
1063  connect(boolPropertyManager, SIGNAL(valueChanged(QtProperty*, bool)),
1064  this, SLOT(slotValueChanged(QtProperty*, bool)));
1065  connect(boolPropertyManager, SIGNAL(textVisibleChanged(QtProperty*, bool)),
1066  this, SLOT(slotTextVisibleChanged(QtProperty*, bool)));
1067  // StringPropertyManager
1068  QtStringPropertyManager* stringPropertyManager = new QtStringPropertyManager(this);
1069  d_ptr->m_typeToPropertyManager[QVariant::String] = stringPropertyManager;
1072  QVariant::RegExp;
1074  QVariant::Int;
1077 
1078  connect(stringPropertyManager, SIGNAL(valueChanged(QtProperty*, const QString&)),
1079  this, SLOT(slotValueChanged(QtProperty*, const QString&)));
1080  connect(stringPropertyManager, SIGNAL(regExpChanged(QtProperty*, const QRegExp&)),
1081  this, SLOT(slotRegExpChanged(QtProperty*, const QRegExp&)));
1082  connect(stringPropertyManager, SIGNAL(echoModeChanged(QtProperty*, int)),
1083  this, SLOT(slotEchoModeChanged(QtProperty*, int)));
1084  connect(stringPropertyManager, SIGNAL(readOnlyChanged(QtProperty*, bool)),
1085  this, SLOT(slotReadOnlyChanged(QtProperty*, bool)));
1086 
1087  // DatePropertyManager
1088  QtDatePropertyManager* datePropertyManager = new QtDatePropertyManager(this);
1089  d_ptr->m_typeToPropertyManager[QVariant::Date] = datePropertyManager;
1090  d_ptr->m_typeToValueType[QVariant::Date] = QVariant::Date;
1091  d_ptr->m_typeToAttributeToAttributeType[QVariant::Date][d_ptr->m_minimumAttribute] =
1092  QVariant::Date;
1093  d_ptr->m_typeToAttributeToAttributeType[QVariant::Date][d_ptr->m_maximumAttribute] =
1094  QVariant::Date;
1095  connect(datePropertyManager, SIGNAL(valueChanged(QtProperty*, const QDate&)),
1096  this, SLOT(slotValueChanged(QtProperty*, const QDate&)));
1097  connect(datePropertyManager, SIGNAL(rangeChanged(QtProperty*, const QDate&, const QDate&)),
1098  this, SLOT(slotRangeChanged(QtProperty*, const QDate&, const QDate&)));
1099  // TimePropertyManager
1100  QtTimePropertyManager* timePropertyManager = new QtTimePropertyManager(this);
1101  d_ptr->m_typeToPropertyManager[QVariant::Time] = timePropertyManager;
1103  connect(timePropertyManager, SIGNAL(valueChanged(QtProperty*, const QTime&)),
1104  this, SLOT(slotValueChanged(QtProperty*, const QTime&)));
1105  // DateTimePropertyManager
1106  QtDateTimePropertyManager* dateTimePropertyManager = new QtDateTimePropertyManager(this);
1107  d_ptr->m_typeToPropertyManager[QVariant::DateTime] = dateTimePropertyManager;
1108  d_ptr->m_typeToValueType[QVariant::DateTime] = QVariant::DateTime;
1109  connect(dateTimePropertyManager, SIGNAL(valueChanged(QtProperty*, const QDateTime&)),
1110  this, SLOT(slotValueChanged(QtProperty*, const QDateTime&)));
1111  // KeySequencePropertyManager
1112  QtKeySequencePropertyManager* keySequencePropertyManager = new QtKeySequencePropertyManager(this);
1113  d_ptr->m_typeToPropertyManager[QVariant::KeySequence] = keySequencePropertyManager;
1114  d_ptr->m_typeToValueType[QVariant::KeySequence] = QVariant::KeySequence;
1115  connect(keySequencePropertyManager, SIGNAL(valueChanged(QtProperty*, const QKeySequence&)),
1116  this, SLOT(slotValueChanged(QtProperty*, const QKeySequence&)));
1117  // CharPropertyManager
1118  QtCharPropertyManager* charPropertyManager = new QtCharPropertyManager(this);
1119  d_ptr->m_typeToPropertyManager[QVariant::Char] = charPropertyManager;
1120  d_ptr->m_typeToValueType[QVariant::Char] = QVariant::Char;
1121  connect(charPropertyManager, SIGNAL(valueChanged(QtProperty*, const QChar&)),
1122  this, SLOT(slotValueChanged(QtProperty*, const QChar&)));
1123  // LocalePropertyManager
1124  QtLocalePropertyManager* localePropertyManager = new QtLocalePropertyManager(this);
1125  d_ptr->m_typeToPropertyManager[QVariant::Locale] = localePropertyManager;
1126  d_ptr->m_typeToValueType[QVariant::Locale] = QVariant::Locale;
1127  connect(localePropertyManager, SIGNAL(valueChanged(QtProperty*, const QLocale&)),
1128  this, SLOT(slotValueChanged(QtProperty*, const QLocale&)));
1129  connect(localePropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1130  this, SLOT(slotValueChanged(QtProperty*, int)));
1131  connect(localePropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1132  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1133  connect(localePropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1134  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1135  // PointPropertyManager
1136  QtPointPropertyManager* pointPropertyManager = new QtPointPropertyManager(this);
1137  d_ptr->m_typeToPropertyManager[QVariant::Point] = pointPropertyManager;
1139  connect(pointPropertyManager, SIGNAL(valueChanged(QtProperty*, const QPoint&)),
1140  this, SLOT(slotValueChanged(QtProperty*, const QPoint&)));
1141  connect(pointPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1142  this, SLOT(slotValueChanged(QtProperty*, int)));
1143  connect(pointPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1144  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1145  connect(pointPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1146  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1147  // PointFPropertyManager
1148  QtPointFPropertyManager* pointFPropertyManager = new QtPointFPropertyManager(this);
1149  d_ptr->m_typeToPropertyManager[QVariant::PointF] = pointFPropertyManager;
1150  d_ptr->m_typeToValueType[QVariant::PointF] = QVariant::PointF;
1151  d_ptr->m_typeToAttributeToAttributeType[QVariant::PointF][d_ptr->m_decimalsAttribute] =
1152  QVariant::Int;
1153  connect(pointFPropertyManager, SIGNAL(valueChanged(QtProperty*, const QPointF&)),
1154  this, SLOT(slotValueChanged(QtProperty*, const QPointF&)));
1155  connect(pointFPropertyManager, SIGNAL(decimalsChanged(QtProperty*, int)),
1156  this, SLOT(slotDecimalsChanged(QtProperty*, int)));
1157  connect(pointFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty*, double)),
1158  this, SLOT(slotValueChanged(QtProperty*, double)));
1159  connect(pointFPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1160  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1161  connect(pointFPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1162  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1163  // SizePropertyManager
1164  QtSizePropertyManager* sizePropertyManager = new QtSizePropertyManager(this);
1165  d_ptr->m_typeToPropertyManager[QVariant::Size] = sizePropertyManager;
1166  d_ptr->m_typeToValueType[QVariant::Size] = QVariant::Size;
1167  d_ptr->m_typeToAttributeToAttributeType[QVariant::Size][d_ptr->m_minimumAttribute] =
1168  QVariant::Size;
1169  d_ptr->m_typeToAttributeToAttributeType[QVariant::Size][d_ptr->m_maximumAttribute] =
1170  QVariant::Size;
1171  connect(sizePropertyManager, SIGNAL(valueChanged(QtProperty*, const QSize&)),
1172  this, SLOT(slotValueChanged(QtProperty*, const QSize&)));
1173  connect(sizePropertyManager, SIGNAL(rangeChanged(QtProperty*, const QSize&, const QSize&)),
1174  this, SLOT(slotRangeChanged(QtProperty*, const QSize&, const QSize&)));
1175  connect(sizePropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1176  this, SLOT(slotValueChanged(QtProperty*, int)));
1177  connect(sizePropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty*, int, int)),
1178  this, SLOT(slotRangeChanged(QtProperty*, int, int)));
1179  connect(sizePropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1180  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1181  connect(sizePropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1182  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1183  // SizeFPropertyManager
1184  QtSizeFPropertyManager* sizeFPropertyManager = new QtSizeFPropertyManager(this);
1185  d_ptr->m_typeToPropertyManager[QVariant::SizeF] = sizeFPropertyManager;
1186  d_ptr->m_typeToValueType[QVariant::SizeF] = QVariant::SizeF;
1187  d_ptr->m_typeToAttributeToAttributeType[QVariant::SizeF][d_ptr->m_minimumAttribute] =
1188  QVariant::SizeF;
1189  d_ptr->m_typeToAttributeToAttributeType[QVariant::SizeF][d_ptr->m_maximumAttribute] =
1190  QVariant::SizeF;
1191  d_ptr->m_typeToAttributeToAttributeType[QVariant::SizeF][d_ptr->m_decimalsAttribute] =
1192  QVariant::Int;
1193  connect(sizeFPropertyManager, SIGNAL(valueChanged(QtProperty*, const QSizeF&)),
1194  this, SLOT(slotValueChanged(QtProperty*, const QSizeF&)));
1195  connect(sizeFPropertyManager, SIGNAL(rangeChanged(QtProperty*, const QSizeF&, const QSizeF&)),
1196  this, SLOT(slotRangeChanged(QtProperty*, const QSizeF&, const QSizeF&)));
1197  connect(sizeFPropertyManager, SIGNAL(decimalsChanged(QtProperty*, int)),
1198  this, SLOT(slotDecimalsChanged(QtProperty*, int)));
1199  connect(sizeFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty*, double)),
1200  this, SLOT(slotValueChanged(QtProperty*, double)));
1201  connect(sizeFPropertyManager->subDoublePropertyManager(), SIGNAL(rangeChanged(QtProperty*, double, double)),
1202  this, SLOT(slotRangeChanged(QtProperty*, double, double)));
1203  connect(sizeFPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1204  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1205  connect(sizeFPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1206  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1207  // RectPropertyManager
1208  QtRectPropertyManager* rectPropertyManager = new QtRectPropertyManager(this);
1209  d_ptr->m_typeToPropertyManager[QVariant::Rect] = rectPropertyManager;
1210  d_ptr->m_typeToValueType[QVariant::Rect] = QVariant::Rect;
1211  d_ptr->m_typeToAttributeToAttributeType[QVariant::Rect][d_ptr->m_constraintAttribute] =
1212  QVariant::Rect;
1213  connect(rectPropertyManager, SIGNAL(valueChanged(QtProperty*, const QRect&)),
1214  this, SLOT(slotValueChanged(QtProperty*, const QRect&)));
1215  connect(rectPropertyManager, SIGNAL(constraintChanged(QtProperty*, const QRect&)),
1216  this, SLOT(slotConstraintChanged(QtProperty*, const QRect&)));
1217  connect(rectPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1218  this, SLOT(slotValueChanged(QtProperty*, int)));
1219  connect(rectPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty*, int, int)),
1220  this, SLOT(slotRangeChanged(QtProperty*, int, int)));
1221  connect(rectPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1222  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1223  connect(rectPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1224  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1225  // RectFPropertyManager
1226  QtRectFPropertyManager* rectFPropertyManager = new QtRectFPropertyManager(this);
1227  d_ptr->m_typeToPropertyManager[QVariant::RectF] = rectFPropertyManager;
1228  d_ptr->m_typeToValueType[QVariant::RectF] = QVariant::RectF;
1229  d_ptr->m_typeToAttributeToAttributeType[QVariant::RectF][d_ptr->m_constraintAttribute] =
1230  QVariant::RectF;
1231  d_ptr->m_typeToAttributeToAttributeType[QVariant::RectF][d_ptr->m_decimalsAttribute] =
1232  QVariant::Int;
1233  connect(rectFPropertyManager, SIGNAL(valueChanged(QtProperty*, const QRectF&)),
1234  this, SLOT(slotValueChanged(QtProperty*, const QRectF&)));
1235  connect(rectFPropertyManager, SIGNAL(constraintChanged(QtProperty*, const QRectF&)),
1236  this, SLOT(slotConstraintChanged(QtProperty*, const QRectF&)));
1237  connect(rectFPropertyManager, SIGNAL(decimalsChanged(QtProperty*, int)),
1238  this, SLOT(slotDecimalsChanged(QtProperty*, int)));
1239  connect(rectFPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty*, double)),
1240  this, SLOT(slotValueChanged(QtProperty*, double)));
1241  connect(rectFPropertyManager->subDoublePropertyManager(), SIGNAL(rangeChanged(QtProperty*, double, double)),
1242  this, SLOT(slotRangeChanged(QtProperty*, double, double)));
1243  connect(rectFPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1244  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1245  connect(rectFPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1246  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1247  // ColorPropertyManager
1248  QtColorPropertyManager* colorPropertyManager = new QtColorPropertyManager(this);
1249  d_ptr->m_typeToPropertyManager[QVariant::Color] = colorPropertyManager;
1251  connect(colorPropertyManager, SIGNAL(valueChanged(QtProperty*, const QColor&)),
1252  this, SLOT(slotValueChanged(QtProperty*, const QColor&)));
1253  connect(colorPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1254  this, SLOT(slotValueChanged(QtProperty*, int)));
1255  connect(colorPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1256  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1257  connect(colorPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1258  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1259  // EnumPropertyManager
1260  int enumId = enumTypeId();
1261  QtEnumPropertyManager* enumPropertyManager = new QtEnumPropertyManager(this);
1262  d_ptr->m_typeToPropertyManager[enumId] = enumPropertyManager;
1263  d_ptr->m_typeToValueType[enumId] = QVariant::Int;
1267  iconMapTypeId();
1268  connect(enumPropertyManager, SIGNAL(valueChanged(QtProperty*, int)),
1269  this, SLOT(slotValueChanged(QtProperty*, int)));
1270  connect(enumPropertyManager, SIGNAL(enumNamesChanged(QtProperty*, const QStringList&)),
1271  this, SLOT(slotEnumNamesChanged(QtProperty*, const QStringList&)));
1272  connect(enumPropertyManager, SIGNAL(enumIconsChanged(QtProperty*, const QMap<int, QIcon>&)),
1273  this, SLOT(slotEnumIconsChanged(QtProperty*, const QMap<int, QIcon>&)));
1274  // SizePolicyPropertyManager
1275  QtSizePolicyPropertyManager* sizePolicyPropertyManager = new QtSizePolicyPropertyManager(this);
1276  d_ptr->m_typeToPropertyManager[QVariant::SizePolicy] = sizePolicyPropertyManager;
1277  d_ptr->m_typeToValueType[QVariant::SizePolicy] = QVariant::SizePolicy;
1278  connect(sizePolicyPropertyManager, SIGNAL(valueChanged(QtProperty*, const QSizePolicy&)),
1279  this, SLOT(slotValueChanged(QtProperty*, const QSizePolicy&)));
1280  connect(sizePolicyPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1281  this, SLOT(slotValueChanged(QtProperty*, int)));
1282  connect(sizePolicyPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty*, int, int)),
1283  this, SLOT(slotRangeChanged(QtProperty*, int, int)));
1284  connect(sizePolicyPropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1285  this, SLOT(slotValueChanged(QtProperty*, int)));
1286  connect(sizePolicyPropertyManager->subEnumPropertyManager(),
1287  SIGNAL(enumNamesChanged(QtProperty*, const QStringList&)),
1288  this, SLOT(slotEnumNamesChanged(QtProperty*, const QStringList&)));
1289  connect(sizePolicyPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1290  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1291  connect(sizePolicyPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1292  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1293  // FontPropertyManager
1294  QtFontPropertyManager* fontPropertyManager = new QtFontPropertyManager(this);
1295  d_ptr->m_typeToPropertyManager[QVariant::Font] = fontPropertyManager;
1296  d_ptr->m_typeToValueType[QVariant::Font] = QVariant::Font;
1297  connect(fontPropertyManager, SIGNAL(valueChanged(QtProperty*, const QFont&)),
1298  this, SLOT(slotValueChanged(QtProperty*, const QFont&)));
1299  connect(fontPropertyManager->subIntPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1300  this, SLOT(slotValueChanged(QtProperty*, int)));
1301  connect(fontPropertyManager->subIntPropertyManager(), SIGNAL(rangeChanged(QtProperty*, int, int)),
1302  this, SLOT(slotRangeChanged(QtProperty*, int, int)));
1303  connect(fontPropertyManager->subEnumPropertyManager(), SIGNAL(valueChanged(QtProperty*, int)),
1304  this, SLOT(slotValueChanged(QtProperty*, int)));
1305  connect(fontPropertyManager->subEnumPropertyManager(),
1306  SIGNAL(enumNamesChanged(QtProperty*, const QStringList&)),
1307  this, SLOT(slotEnumNamesChanged(QtProperty*, const QStringList&)));
1308  connect(fontPropertyManager->subBoolPropertyManager(), SIGNAL(valueChanged(QtProperty*, bool)),
1309  this, SLOT(slotValueChanged(QtProperty*, bool)));
1310  connect(fontPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1311  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1312  connect(fontPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1313  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1314  // CursorPropertyManager
1315  QtCursorPropertyManager* cursorPropertyManager = new QtCursorPropertyManager(this);
1316  d_ptr->m_typeToPropertyManager[QVariant::Cursor] = cursorPropertyManager;
1317  d_ptr->m_typeToValueType[QVariant::Cursor] = QVariant::Cursor;
1318  connect(cursorPropertyManager, SIGNAL(valueChanged(QtProperty*, const QCursor&)),
1319  this, SLOT(slotValueChanged(QtProperty*, const QCursor&)));
1320  // FlagPropertyManager
1321  int flagId = flagTypeId();
1322  QtFlagPropertyManager* flagPropertyManager = new QtFlagPropertyManager(this);
1323  d_ptr->m_typeToPropertyManager[flagId] = flagPropertyManager;
1324  d_ptr->m_typeToValueType[flagId] = QVariant::Int;
1327  connect(flagPropertyManager, SIGNAL(valueChanged(QtProperty*, int)),
1328  this, SLOT(slotValueChanged(QtProperty*, int)));
1329  connect(flagPropertyManager, SIGNAL(flagNamesChanged(QtProperty*, const QStringList&)),
1330  this, SLOT(slotFlagNamesChanged(QtProperty*, const QStringList&)));
1331  connect(flagPropertyManager->subBoolPropertyManager(), SIGNAL(valueChanged(QtProperty*, bool)),
1332  this, SLOT(slotValueChanged(QtProperty*, bool)));
1333  connect(flagPropertyManager, SIGNAL(propertyInserted(QtProperty*, QtProperty*, QtProperty*)),
1334  this, SLOT(slotPropertyInserted(QtProperty*, QtProperty*, QtProperty*)));
1335  connect(flagPropertyManager, SIGNAL(propertyRemoved(QtProperty*, QtProperty*)),
1336  this, SLOT(slotPropertyRemoved(QtProperty*, QtProperty*)));
1337  // FlagPropertyManager
1338  int groupId = groupTypeId();
1339  QtGroupPropertyManager* groupPropertyManager = new QtGroupPropertyManager(this);
1340  d_ptr->m_typeToPropertyManager[groupId] = groupPropertyManager;
1341  d_ptr->m_typeToValueType[groupId] = QVariant::Invalid;
1342 }
1343 
1344 /*!
1345  Destroys this manager, and all the properties it has created.
1346 */
1348 {
1349  clear();
1350  delete d_ptr;
1351 }
1352 
1353 /*!
1354  Returns the given \a property converted into a QtVariantProperty.
1355 
1356  If the \a property was not created by this variant manager, the
1357  function returns 0.
1358 
1359  \sa createProperty()
1360 */
1362 {
1363  const QMap<const QtProperty*, QPair<QtVariantProperty*, int> >::const_iterator it = d_ptr->m_propertyToType.constFind(property);
1364 
1365  if (it == d_ptr->m_propertyToType.constEnd())
1366  {
1367  return 0;
1368  }
1369 
1370  return it.value().first;
1371 }
1372 
1373 /*!
1374  Returns true if the given \a propertyType is supported by this
1375  variant manager; otherwise false.
1376 
1377  \sa propertyType()
1378 */
1380 {
1381  if (d_ptr->m_typeToValueType.contains(propertyType))
1382  {
1383  return true;
1384  }
1385 
1386  return false;
1387 }
1388 
1389 /*!
1390  Creates and returns a variant property of the given \a propertyType
1391  with the given \a name.
1392 
1393  If the specified \a propertyType is not supported by this variant
1394  manager, this function returns 0.
1395 
1396  Do not use the inherited
1397  QtAbstractPropertyManager::addProperty() function to create a
1398  variant property (that function will always return 0 since it will
1399  not be clear what type the property should have).
1400 
1401  \sa isPropertyTypeSupported()
1402 */
1403 QtVariantProperty* QtVariantPropertyManager::addProperty(int propertyType, const QString& name)
1404 {
1406  {
1407  return 0;
1408  }
1409 
1410  bool wasCreating = d_ptr->m_creatingProperty;
1411  d_ptr->m_creatingProperty = true;
1412  d_ptr->m_propertyType = propertyType;
1414  d_ptr->m_creatingProperty = wasCreating;
1415  d_ptr->m_propertyType = 0;
1416 
1417  if (!property)
1418  {
1419  return 0;
1420  }
1421 
1422  return variantProperty(property);
1423 }
1424 
1425 /*!
1426  Returns the given \a property's value.
1427 
1428  If the given \a property is not managed by this manager, this
1429  function returns an invalid variant.
1430 
1431  \sa setValue()
1432 */
1433 QVariant QtVariantPropertyManager::value(const QtProperty* property) const
1434 {
1435  QtProperty* internProp = propertyToWrappedProperty()->value(property, 0);
1436 
1437  if (internProp == 0)
1438  {
1439  return QVariant();
1440  }
1441 
1442  QtAbstractPropertyManager* manager = internProp->propertyManager();
1443 
1444  if (QtIntPropertyManager* intManager = qobject_cast<QtIntPropertyManager*>(manager))
1445  {
1446  return intManager->value(internProp);
1447  }
1448  else if (QtDoublePropertyManager* doubleManager = qobject_cast<QtDoublePropertyManager*>(manager))
1449  {
1450  return doubleManager->value(internProp);
1451  }
1452  else if (QtBoolPropertyManager* boolManager = qobject_cast<QtBoolPropertyManager*>(manager))
1453  {
1454  return boolManager->value(internProp);
1455  }
1456  else if (QtStringPropertyManager* stringManager = qobject_cast<QtStringPropertyManager*>(manager))
1457  {
1458  return stringManager->value(internProp);
1459  }
1460  else if (QtDatePropertyManager* dateManager = qobject_cast<QtDatePropertyManager*>(manager))
1461  {
1462  return dateManager->value(internProp);
1463  }
1464  else if (QtTimePropertyManager* timeManager = qobject_cast<QtTimePropertyManager*>(manager))
1465  {
1466  return timeManager->value(internProp);
1467  }
1468  else if (QtDateTimePropertyManager* dateTimeManager = qobject_cast<QtDateTimePropertyManager*>(manager))
1469  {
1470  return dateTimeManager->value(internProp);
1471  }
1472  else if (QtKeySequencePropertyManager* keySequenceManager = qobject_cast<QtKeySequencePropertyManager*>(manager))
1473  {
1474  return QVariant::fromValue(keySequenceManager->value(internProp));
1475  }
1476  else if (QtCharPropertyManager* charManager = qobject_cast<QtCharPropertyManager*>(manager))
1477  {
1478  return charManager->value(internProp);
1479  }
1480  else if (QtLocalePropertyManager* localeManager = qobject_cast<QtLocalePropertyManager*>(manager))
1481  {
1482  return localeManager->value(internProp);
1483  }
1484  else if (QtPointPropertyManager* pointManager = qobject_cast<QtPointPropertyManager*>(manager))
1485  {
1486  return pointManager->value(internProp);
1487  }
1488  else if (QtPointFPropertyManager* pointFManager = qobject_cast<QtPointFPropertyManager*>(manager))
1489  {
1490  return pointFManager->value(internProp);
1491  }
1492  else if (QtSizePropertyManager* sizeManager = qobject_cast<QtSizePropertyManager*>(manager))
1493  {
1494  return sizeManager->value(internProp);
1495  }
1496  else if (QtSizeFPropertyManager* sizeFManager = qobject_cast<QtSizeFPropertyManager*>(manager))
1497  {
1498  return sizeFManager->value(internProp);
1499  }
1500  else if (QtRectPropertyManager* rectManager = qobject_cast<QtRectPropertyManager*>(manager))
1501  {
1502  return rectManager->value(internProp);
1503  }
1504  else if (QtRectFPropertyManager* rectFManager = qobject_cast<QtRectFPropertyManager*>(manager))
1505  {
1506  return rectFManager->value(internProp);
1507  }
1508  else if (QtColorPropertyManager* colorManager = qobject_cast<QtColorPropertyManager*>(manager))
1509  {
1510  return colorManager->value(internProp);
1511  }
1512  else if (QtEnumPropertyManager* enumManager = qobject_cast<QtEnumPropertyManager*>(manager))
1513  {
1514  return enumManager->value(internProp);
1515  }
1516  else if (QtSizePolicyPropertyManager* sizePolicyManager =
1517  qobject_cast<QtSizePolicyPropertyManager*>(manager))
1518  {
1519  return sizePolicyManager->value(internProp);
1520  }
1521  else if (QtFontPropertyManager* fontManager = qobject_cast<QtFontPropertyManager*>(manager))
1522  {
1523  return fontManager->value(internProp);
1524 #ifndef QT_NO_CURSOR
1525  }
1526  else if (QtCursorPropertyManager* cursorManager = qobject_cast<QtCursorPropertyManager*>(manager))
1527  {
1528  return cursorManager->value(internProp);
1529 #endif
1530  }
1531  else if (QtFlagPropertyManager* flagManager = qobject_cast<QtFlagPropertyManager*>(manager))
1532  {
1533  return flagManager->value(internProp);
1534  }
1535 
1536  return QVariant();
1537 }
1538 
1539 /*!
1540  Returns the given \a property's value type.
1541 
1542  \sa propertyType()
1543 */
1545 {
1546  int propType = propertyType(property);
1547  return valueType(propType);
1548 }
1549 
1550 /*!
1551  \overload
1552 
1553  Returns the value type associated with the given \a propertyType.
1554 */
1555 int QtVariantPropertyManager::valueType(int propertyType) const
1556 {
1557  if (d_ptr->m_typeToValueType.contains(propertyType))
1558  {
1559  return d_ptr->m_typeToValueType[propertyType];
1560  }
1561 
1562  return 0;
1563 }
1564 
1565 /*!
1566  Returns the given \a property's type.
1567 
1568  \sa valueType()
1569 */
1571 {
1572  const QMap<const QtProperty*, QPair<QtVariantProperty*, int> >::const_iterator it = d_ptr->m_propertyToType.constFind(property);
1573 
1574  if (it == d_ptr->m_propertyToType.constEnd())
1575  {
1576  return 0;
1577  }
1578 
1579  return it.value().second;
1580 }
1581 
1582 /*!
1583  Returns the given \a property's value for the specified \a
1584  attribute
1585 
1586  If the given \a property was not created by \e this manager, or if
1587  the specified \a attribute does not exist, this function returns
1588  an invalid variant.
1589 
1590  \sa attributes(), attributeType(), setAttribute()
1591 */
1592 QVariant QtVariantPropertyManager::attributeValue(const QtProperty* property, const QString& attribute) const
1593 {
1594  int propType = propertyType(property);
1595 
1596  if (!propType)
1597  {
1598  return QVariant();
1599  }
1600 
1601  QMap<int, QMap<QString, int> >::ConstIterator it =
1602  d_ptr->m_typeToAttributeToAttributeType.find(propType);
1603 
1604  if (it == d_ptr->m_typeToAttributeToAttributeType.constEnd())
1605  {
1606  return QVariant();
1607  }
1608 
1609  QMap<QString, int> attributes = it.value();
1610  QMap<QString, int>::ConstIterator itAttr = attributes.find(attribute);
1611 
1612  if (itAttr == attributes.constEnd())
1613  {
1614  return QVariant();
1615  }
1616 
1617  QtProperty* internProp = propertyToWrappedProperty()->value(property, 0);
1618 
1619  if (internProp == 0)
1620  {
1621  return QVariant();
1622  }
1623 
1624  QtAbstractPropertyManager* manager = internProp->propertyManager();
1625 
1626  if (QtIntPropertyManager* intManager = qobject_cast<QtIntPropertyManager*>(manager))
1627  {
1628  if (attribute == d_ptr->m_maximumAttribute)
1629  {
1630  return intManager->maximum(internProp);
1631  }
1632 
1633  if (attribute == d_ptr->m_minimumAttribute)
1634  {
1635  return intManager->minimum(internProp);
1636  }
1637 
1638  if (attribute == d_ptr->m_singleStepAttribute)
1639  {
1640  return intManager->singleStep(internProp);
1641  }
1642 
1643  if (attribute == d_ptr->m_readOnlyAttribute)
1644  {
1645  return intManager->isReadOnly(internProp);
1646  }
1647 
1648  return QVariant();
1649  }
1650  else if (QtDoublePropertyManager* doubleManager = qobject_cast<QtDoublePropertyManager*>(manager))
1651  {
1652  if (attribute == d_ptr->m_maximumAttribute)
1653  {
1654  return doubleManager->maximum(internProp);
1655  }
1656 
1657  if (attribute == d_ptr->m_minimumAttribute)
1658  {
1659  return doubleManager->minimum(internProp);
1660  }
1661 
1662  if (attribute == d_ptr->m_singleStepAttribute)
1663  {
1664  return doubleManager->singleStep(internProp);
1665  }
1666 
1667  if (attribute == d_ptr->m_decimalsAttribute)
1668  {
1669  return doubleManager->decimals(internProp);
1670  }
1671 
1672  if (attribute == d_ptr->m_readOnlyAttribute)
1673  {
1674  return doubleManager->isReadOnly(internProp);
1675  }
1676 
1677  return QVariant();
1678  }
1679  else if (QtBoolPropertyManager* boolManager = qobject_cast<QtBoolPropertyManager*>(manager))
1680  {
1681  if (attribute == d_ptr->m_textVisibleAttribute)
1682  {
1683  return boolManager->textVisible(internProp);
1684  }
1685 
1686  return QVariant();
1687  }
1688  else if (QtStringPropertyManager* stringManager = qobject_cast<QtStringPropertyManager*>(manager))
1689  {
1690  if (attribute == d_ptr->m_regExpAttribute)
1691  {
1692  return stringManager->regExp(internProp);
1693  }
1694 
1695  if (attribute == d_ptr->m_echoModeAttribute)
1696  {
1697  return stringManager->echoMode(internProp);
1698  }
1699 
1700  if (attribute == d_ptr->m_readOnlyAttribute)
1701  {
1702  return stringManager->isReadOnly(internProp);
1703  }
1704 
1705  return QVariant();
1706  }
1707  else if (QtDatePropertyManager* dateManager = qobject_cast<QtDatePropertyManager*>(manager))
1708  {
1709  if (attribute == d_ptr->m_maximumAttribute)
1710  {
1711  return dateManager->maximum(internProp);
1712  }
1713 
1714  if (attribute == d_ptr->m_minimumAttribute)
1715  {
1716  return dateManager->minimum(internProp);
1717  }
1718 
1719  return QVariant();
1720  }
1721  else if (QtPointFPropertyManager* pointFManager = qobject_cast<QtPointFPropertyManager*>(manager))
1722  {
1723  if (attribute == d_ptr->m_decimalsAttribute)
1724  {
1725  return pointFManager->decimals(internProp);
1726  }
1727 
1728  return QVariant();
1729  }
1730  else if (QtSizePropertyManager* sizeManager = qobject_cast<QtSizePropertyManager*>(manager))
1731  {
1732  if (attribute == d_ptr->m_maximumAttribute)
1733  {
1734  return sizeManager->maximum(internProp);
1735  }
1736 
1737  if (attribute == d_ptr->m_minimumAttribute)
1738  {
1739  return sizeManager->minimum(internProp);
1740  }
1741 
1742  return QVariant();
1743  }
1744  else if (QtSizeFPropertyManager* sizeFManager = qobject_cast<QtSizeFPropertyManager*>(manager))
1745  {
1746  if (attribute == d_ptr->m_maximumAttribute)
1747  {
1748  return sizeFManager->maximum(internProp);
1749  }
1750 
1751  if (attribute == d_ptr->m_minimumAttribute)
1752  {
1753  return sizeFManager->minimum(internProp);
1754  }
1755 
1756  if (attribute == d_ptr->m_decimalsAttribute)
1757  {
1758  return sizeFManager->decimals(internProp);
1759  }
1760 
1761  return QVariant();
1762  }
1763  else if (QtRectPropertyManager* rectManager = qobject_cast<QtRectPropertyManager*>(manager))
1764  {
1765  if (attribute == d_ptr->m_constraintAttribute)
1766  {
1767  return rectManager->constraint(internProp);
1768  }
1769 
1770  return QVariant();
1771  }
1772  else if (QtRectFPropertyManager* rectFManager = qobject_cast<QtRectFPropertyManager*>(manager))
1773  {
1774  if (attribute == d_ptr->m_constraintAttribute)
1775  {
1776  return rectFManager->constraint(internProp);
1777  }
1778 
1779  if (attribute == d_ptr->m_decimalsAttribute)
1780  {
1781  return rectFManager->decimals(internProp);
1782  }
1783 
1784  return QVariant();
1785  }
1786  else if (QtEnumPropertyManager* enumManager = qobject_cast<QtEnumPropertyManager*>(manager))
1787  {
1788  if (attribute == d_ptr->m_enumNamesAttribute)
1789  {
1790  return enumManager->enumNames(internProp);
1791  }
1792 
1793  if (attribute == d_ptr->m_enumIconsAttribute)
1794  {
1795  QVariant v;
1796  qVariantSetValue(v, enumManager->enumIcons(internProp));
1797  return v;
1798  }
1799 
1800  return QVariant();
1801  }
1802  else if (QtFlagPropertyManager* flagManager = qobject_cast<QtFlagPropertyManager*>(manager))
1803  {
1804  if (attribute == d_ptr->m_flagNamesAttribute)
1805  {
1806  return flagManager->flagNames(internProp);
1807  }
1808 
1809  return QVariant();
1810  }
1811 
1812  return QVariant();
1813 }
1814 
1815 /*!
1816  Returns a list of the given \a propertyType 's attributes.
1817 
1818  \sa attributeValue(), attributeType()
1819 */
1820 QStringList QtVariantPropertyManager::attributes(int propertyType) const
1821 {
1822  QMap<int, QMap<QString, int> >::ConstIterator it =
1824 
1825  if (it == d_ptr->m_typeToAttributeToAttributeType.constEnd())
1826  {
1827  return QStringList();
1828  }
1829 
1830  return it.value().keys();
1831 }
1832 
1833 /*!
1834  Returns the type of the specified \a attribute of the given \a
1835  propertyType.
1836 
1837  If the given \a propertyType is not supported by \e this manager,
1838  or if the given \a propertyType does not possess the specified \a
1839  attribute, this function returns QVariant::Invalid.
1840 
1841  \sa attributes(), valueType()
1842 */
1843 int QtVariantPropertyManager::attributeType(int propertyType, const QString& attribute) const
1844 {
1845  QMap<int, QMap<QString, int> >::ConstIterator it =
1847 
1848  if (it == d_ptr->m_typeToAttributeToAttributeType.constEnd())
1849  {
1850  return 0;
1851  }
1852 
1853  QMap<QString, int> attributes = it.value();
1854  QMap<QString, int>::ConstIterator itAttr = attributes.find(attribute);
1855 
1856  if (itAttr == attributes.constEnd())
1857  {
1858  return 0;
1859  }
1860 
1861  return itAttr.value();
1862 }
1863 
1864 /*!
1865  \fn void QtVariantPropertyManager::setValue(QtProperty *property, const QVariant &value)
1866 
1867  Sets the value of the given \a property to \a value.
1868 
1869  The specified \a value must be of a type returned by valueType(),
1870  or of type that can be converted to valueType() using the
1871  QVariant::canConvert() function, otherwise this function does
1872  nothing.
1873 
1874  \sa value(), QtVariantProperty::setValue(), valueChanged()
1875 */
1876 void QtVariantPropertyManager::setValue(QtProperty* property, const QVariant& val)
1877 {
1878  int propType = val.userType();
1879 
1880  if (!propType)
1881  {
1882  return;
1883  }
1884 
1885  int valType = valueType(property);
1886 
1887  if (propType != valType && !val.canConvert(static_cast<QVariant::Type>(valType)))
1888  {
1889  return;
1890  }
1891 
1892  QtProperty* internProp = propertyToWrappedProperty()->value(property, 0);
1893 
1894  if (internProp == 0)
1895  {
1896  return;
1897  }
1898 
1899 
1900  QtAbstractPropertyManager* manager = internProp->propertyManager();
1901 
1902  if (QtIntPropertyManager* intManager = qobject_cast<QtIntPropertyManager*>(manager))
1903  {
1904  intManager->setValue(internProp, val.value<int>());
1905  return;
1906  }
1907  else if (QtDoublePropertyManager* doubleManager = qobject_cast<QtDoublePropertyManager*>(manager))
1908  {
1909  doubleManager->setValue(internProp, val.value<double>());
1910  return;
1911  }
1912  else if (QtBoolPropertyManager* boolManager = qobject_cast<QtBoolPropertyManager*>(manager))
1913  {
1914  boolManager->setValue(internProp, val.value<bool>());
1915  return;
1916  }
1917  else if (QtStringPropertyManager* stringManager = qobject_cast<QtStringPropertyManager*>(manager))
1918  {
1919  stringManager->setValue(internProp, val.value<QString>());
1920  return;
1921  }
1922  else if (QtDatePropertyManager* dateManager = qobject_cast<QtDatePropertyManager*>(manager))
1923  {
1924  dateManager->setValue(internProp, val.value<QDate>());
1925  return;
1926  }
1927  else if (QtTimePropertyManager* timeManager = qobject_cast<QtTimePropertyManager*>(manager))
1928  {
1929  timeManager->setValue(internProp, val.value<QTime>());
1930  return;
1931  }
1932  else if (QtDateTimePropertyManager* dateTimeManager = qobject_cast<QtDateTimePropertyManager*>(manager))
1933  {
1934  dateTimeManager->setValue(internProp, val.value<QDateTime>());
1935  return;
1936  }
1937  else if (QtKeySequencePropertyManager* keySequenceManager = qobject_cast<QtKeySequencePropertyManager*>(manager))
1938  {
1939  keySequenceManager->setValue(internProp, val.value<QKeySequence>());
1940  return;
1941  }
1942  else if (QtCharPropertyManager* charManager = qobject_cast<QtCharPropertyManager*>(manager))
1943  {
1944  charManager->setValue(internProp, val.value<QChar>());
1945  return;
1946  }
1947  else if (QtLocalePropertyManager* localeManager = qobject_cast<QtLocalePropertyManager*>(manager))
1948  {
1949  localeManager->setValue(internProp, val.value<QLocale>());
1950  return;
1951  }
1952  else if (QtPointPropertyManager* pointManager = qobject_cast<QtPointPropertyManager*>(manager))
1953  {
1954  pointManager->setValue(internProp, val.value<QPoint>());
1955  return;
1956  }
1957  else if (QtPointFPropertyManager* pointFManager = qobject_cast<QtPointFPropertyManager*>(manager))
1958  {
1959  pointFManager->setValue(internProp, val.value<QPointF>());
1960  return;
1961  }
1962  else if (QtSizePropertyManager* sizeManager = qobject_cast<QtSizePropertyManager*>(manager))
1963  {
1964  sizeManager->setValue(internProp, val.value<QSize>());
1965  return;
1966  }
1967  else if (QtSizeFPropertyManager* sizeFManager = qobject_cast<QtSizeFPropertyManager*>(manager))
1968  {
1969  sizeFManager->setValue(internProp, val.value<QSizeF>());
1970  return;
1971  }
1972  else if (QtRectPropertyManager* rectManager = qobject_cast<QtRectPropertyManager*>(manager))
1973  {
1974  rectManager->setValue(internProp, val.value<QRect>());
1975  return;
1976  }
1977  else if (QtRectFPropertyManager* rectFManager = qobject_cast<QtRectFPropertyManager*>(manager))
1978  {
1979  rectFManager->setValue(internProp, val.value<QRectF>());
1980  return;
1981  }
1982  else if (QtColorPropertyManager* colorManager = qobject_cast<QtColorPropertyManager*>(manager))
1983  {
1984  colorManager->setValue(internProp, val.value<QColor>());
1985  return;
1986  }
1987  else if (QtEnumPropertyManager* enumManager = qobject_cast<QtEnumPropertyManager*>(manager))
1988  {
1989  enumManager->setValue(internProp, val.value<int>());
1990  return;
1991  }
1992  else if (QtSizePolicyPropertyManager* sizePolicyManager =
1993  qobject_cast<QtSizePolicyPropertyManager*>(manager))
1994  {
1995  sizePolicyManager->setValue(internProp, val.value<QSizePolicy>());
1996  return;
1997  }
1998  else if (QtFontPropertyManager* fontManager = qobject_cast<QtFontPropertyManager*>(manager))
1999  {
2000  fontManager->setValue(internProp, val.value<QFont>());
2001  return;
2002 #ifndef QT_NO_CURSOR
2003  }
2004  else if (QtCursorPropertyManager* cursorManager = qobject_cast<QtCursorPropertyManager*>(manager))
2005  {
2006  cursorManager->setValue(internProp, val.value<QCursor>());
2007  return;
2008 #endif
2009  }
2010  else if (QtFlagPropertyManager* flagManager = qobject_cast<QtFlagPropertyManager*>(manager))
2011  {
2012  flagManager->setValue(internProp, val.value<int>());
2013  return;
2014  }
2015 }
2016 
2017 /*!
2018  Sets the value of the specified \a attribute of the given \a
2019  property, to \a value.
2020 
2021  The new \a value's type must be of the type returned by
2022  attributeType(), or of a type that can be converted to
2023  attributeType() using the QVariant::canConvert() function,
2024  otherwise this function does nothing.
2025 
2026  \sa attributeValue(), QtVariantProperty::setAttribute(), attributeChanged()
2027 */
2029  const QString& attribute, const QVariant& value)
2030 {
2031  QVariant oldAttr = attributeValue(property, attribute);
2032 
2033  if (!oldAttr.isValid())
2034  {
2035  return;
2036  }
2037 
2038  int attrType = value.userType();
2039 
2040  if (!attrType)
2041  {
2042  return;
2043  }
2044 
2045  if (attrType != attributeType(propertyType(property), attribute) &&
2046  !value.canConvert((QVariant::Type)attrType))
2047  {
2048  return;
2049  }
2050 
2051  QtProperty* internProp = propertyToWrappedProperty()->value(property, 0);
2052 
2053  if (internProp == 0)
2054  {
2055  return;
2056  }
2057 
2058  QtAbstractPropertyManager* manager = internProp->propertyManager();
2059 
2060  if (QtIntPropertyManager* intManager = qobject_cast<QtIntPropertyManager*>(manager))
2061  {
2062  if (attribute == d_ptr->m_maximumAttribute)
2063  {
2064  intManager->setMaximum(internProp, value.value<int>());
2065  }
2066  else if (attribute == d_ptr->m_minimumAttribute)
2067  {
2068  intManager->setMinimum(internProp, value.value<int>());
2069  }
2070  else if (attribute == d_ptr->m_singleStepAttribute)
2071  {
2072  intManager->setSingleStep(internProp, value.value<int>());
2073  }
2074  else if (attribute == d_ptr->m_readOnlyAttribute)
2075  {
2076  intManager->setReadOnly(internProp, value.value<bool>());
2077  }
2078 
2079  return;
2080  }
2081  else if (QtDoublePropertyManager* doubleManager = qobject_cast<QtDoublePropertyManager*>(manager))
2082  {
2083  if (attribute == d_ptr->m_maximumAttribute)
2084  {
2085  doubleManager->setMaximum(internProp, value.value<double>());
2086  }
2087 
2088  if (attribute == d_ptr->m_minimumAttribute)
2089  {
2090  doubleManager->setMinimum(internProp, value.value<double>());
2091  }
2092 
2093  if (attribute == d_ptr->m_singleStepAttribute)
2094  {
2095  doubleManager->setSingleStep(internProp, value.value<double>());
2096  }
2097 
2098  if (attribute == d_ptr->m_decimalsAttribute)
2099  {
2100  doubleManager->setDecimals(internProp, value.value<int>());
2101  }
2102 
2103  if (attribute == d_ptr->m_readOnlyAttribute)
2104  {
2105  doubleManager->setReadOnly(internProp, value.value<bool>());
2106  }
2107 
2108  return;
2109  }
2110  else if (QtBoolPropertyManager* boolManager = qobject_cast<QtBoolPropertyManager*>(manager))
2111  {
2112  if (attribute == d_ptr->m_textVisibleAttribute)
2113  {
2114  boolManager->setTextVisible(internProp, value.value<bool>());
2115  }
2116 
2117  return;
2118  }
2119  else if (QtStringPropertyManager* stringManager = qobject_cast<QtStringPropertyManager*>(manager))
2120  {
2121  if (attribute == d_ptr->m_regExpAttribute)
2122  {
2123  stringManager->setRegExp(internProp, value.value<QRegExp>());
2124  }
2125 
2126  if (attribute == d_ptr->m_echoModeAttribute)
2127  {
2128  stringManager->setEchoMode(internProp, (EchoMode)value.value<int>());
2129  }
2130 
2131  if (attribute == d_ptr->m_readOnlyAttribute)
2132  {
2133  stringManager->setReadOnly(internProp, (EchoMode)value.value<bool>());
2134  }
2135 
2136  return;
2137  }
2138  else if (QtDatePropertyManager* dateManager = qobject_cast<QtDatePropertyManager*>(manager))
2139  {
2140  if (attribute == d_ptr->m_maximumAttribute)
2141  {
2142  dateManager->setMaximum(internProp, value.value<QDate>());
2143  }
2144 
2145  if (attribute == d_ptr->m_minimumAttribute)
2146  {
2147  dateManager->setMinimum(internProp, value.value<QDate>());
2148  }
2149 
2150  return;
2151  }
2152  else if (QtPointFPropertyManager* pointFManager = qobject_cast<QtPointFPropertyManager*>(manager))
2153  {
2154  if (attribute == d_ptr->m_decimalsAttribute)
2155  {
2156  pointFManager->setDecimals(internProp, value.value<int>());
2157  }
2158 
2159  return;
2160  }
2161  else if (QtSizePropertyManager* sizeManager = qobject_cast<QtSizePropertyManager*>(manager))
2162  {
2163  if (attribute == d_ptr->m_maximumAttribute)
2164  {
2165  sizeManager->setMaximum(internProp, value.value<QSize>());
2166  }
2167 
2168  if (attribute == d_ptr->m_minimumAttribute)
2169  {
2170  sizeManager->setMinimum(internProp, value.value<QSize>());
2171  }
2172 
2173  return;
2174  }
2175  else if (QtSizeFPropertyManager* sizeFManager = qobject_cast<QtSizeFPropertyManager*>(manager))
2176  {
2177  if (attribute == d_ptr->m_maximumAttribute)
2178  {
2179  sizeFManager->setMaximum(internProp, value.value<QSizeF>());
2180  }
2181 
2182  if (attribute == d_ptr->m_minimumAttribute)
2183  {
2184  sizeFManager->setMinimum(internProp, value.value<QSizeF>());
2185  }
2186 
2187  if (attribute == d_ptr->m_decimalsAttribute)
2188  {
2189  sizeFManager->setDecimals(internProp, value.value<int>());
2190  }
2191 
2192  return;
2193  }
2194  else if (QtRectPropertyManager* rectManager = qobject_cast<QtRectPropertyManager*>(manager))
2195  {
2196  if (attribute == d_ptr->m_constraintAttribute)
2197  {
2198  rectManager->setConstraint(internProp, value.value<QRect>());
2199  }
2200 
2201  return;
2202  }
2203  else if (QtRectFPropertyManager* rectFManager = qobject_cast<QtRectFPropertyManager*>(manager))
2204  {
2205  if (attribute == d_ptr->m_constraintAttribute)
2206  {
2207  rectFManager->setConstraint(internProp, value.value<QRectF>());
2208  }
2209 
2210  if (attribute == d_ptr->m_decimalsAttribute)
2211  {
2212  rectFManager->setDecimals(internProp, value.value<int>());
2213  }
2214 
2215  return;
2216  }
2217  else if (QtEnumPropertyManager* enumManager = qobject_cast<QtEnumPropertyManager*>(manager))
2218  {
2219  if (attribute == d_ptr->m_enumNamesAttribute)
2220  {
2221  enumManager->setEnumNames(internProp, value.value<QStringList>());
2222  }
2223 
2224  if (attribute == d_ptr->m_enumIconsAttribute)
2225  {
2226  enumManager->setEnumIcons(internProp, value.value<QtIconMap>());
2227  }
2228 
2229  return;
2230  }
2231  else if (QtFlagPropertyManager* flagManager = qobject_cast<QtFlagPropertyManager*>(manager))
2232  {
2233  if (attribute == d_ptr->m_flagNamesAttribute)
2234  {
2235  flagManager->setFlagNames(internProp, value.value<QStringList>());
2236  }
2237 
2238  return;
2239  }
2240 }
2241 
2242 /*!
2243  \reimp
2244 */
2246 {
2247  if (propertyType(property) == groupTypeId())
2248  {
2249  return false;
2250  }
2251 
2252  return true;
2253 }
2254 
2255 /*!
2256  \reimp
2257 */
2258 QString QtVariantPropertyManager::valueText(const QtProperty* property) const
2259 {
2260  const QtProperty* internProp = propertyToWrappedProperty()->value(property, 0);
2261  return internProp ? !internProp->displayText().isEmpty() ? internProp->displayText() : internProp->valueText() : QString();
2262 }
2263 
2264 /*!
2265  \reimp
2266 */
2268 {
2269  const QtProperty* internProp = propertyToWrappedProperty()->value(property, 0);
2270  return internProp ? internProp->valueIcon() : QIcon();
2271 }
2272 
2273 /*!
2274  \reimp
2275 */
2277 {
2278  QtVariantProperty* varProp = variantProperty(property);
2279 
2280  if (!varProp)
2281  {
2282  return;
2283  }
2284 
2285  QMap<int, QtAbstractPropertyManager*>::ConstIterator it =
2286  d_ptr->m_typeToPropertyManager.find(d_ptr->m_propertyType);
2287 
2288  if (it != d_ptr->m_typeToPropertyManager.constEnd())
2289  {
2290  QtProperty* internProp = 0;
2291 
2292  if (!d_ptr->m_creatingSubProperties)
2293  {
2294  QtAbstractPropertyManager* manager = it.value();
2295  internProp = manager->addProperty();
2296  d_ptr->m_internalToProperty[internProp] = varProp;
2297  }
2298 
2299  propertyToWrappedProperty()->insert(varProp, internProp);
2300 
2301  if (internProp)
2302  {
2303  QList<QtProperty*> children = internProp->subProperties();
2304  QListIterator<QtProperty*> itChild(children);
2305  QtVariantProperty* lastProperty = 0;
2306 
2307  while (itChild.hasNext())
2308  {
2309  QtVariantProperty* prop = d_ptr->createSubProperty(varProp, lastProperty, itChild.next());
2310  lastProperty = prop ? prop : lastProperty;
2311  }
2312  }
2313  }
2314 }
2315 
2316 /*!
2317  \reimp
2318 */
2320 {
2321  const QMap<const QtProperty*, QPair<QtVariantProperty*, int> >::iterator type_it = d_ptr->m_propertyToType.find(property);
2322 
2323  if (type_it == d_ptr->m_propertyToType.end())
2324  {
2325  return;
2326  }
2327 
2328  PropertyMap::iterator it = propertyToWrappedProperty()->find(property);
2329 
2330  if (it != propertyToWrappedProperty()->end())
2331  {
2332  QtProperty* internProp = it.value();
2333 
2334  if (internProp)
2335  {
2336  d_ptr->m_internalToProperty.remove(internProp);
2337 
2338  if (!d_ptr->m_destroyingSubProperties)
2339  {
2340  delete internProp;
2341  }
2342  }
2343 
2344  propertyToWrappedProperty()->erase(it);
2345  }
2346 
2347  d_ptr->m_propertyToType.erase(type_it);
2348 }
2349 
2350 /*!
2351  \reimp
2352 */
2354 {
2355  if (!d_ptr->m_creatingProperty)
2356  {
2357  return 0;
2358  }
2359 
2360  QtVariantProperty* property = new QtVariantProperty(this);
2361  d_ptr->m_propertyToType.insert(property, qMakePair(property, d_ptr->m_propertyType));
2362 
2363  return property;
2364 }
2365 
2366 /////////////////////////////
2367 
2369 {
2370  QtVariantEditorFactory* q_ptr;
2371  Q_DECLARE_PUBLIC(QtVariantEditorFactory)
2372 public:
2373 
2387 
2388  QMap<QtAbstractEditorFactoryBase*, int> m_factoryToType;
2389  QMap<int, QtAbstractEditorFactoryBase*> m_typeToFactory;
2390 };
2391 
2392 /*!
2393  \class QtVariantEditorFactory
2394 
2395  \brief The QtVariantEditorFactory class provides widgets for properties
2396  created by QtVariantPropertyManager objects.
2397 
2398  The variant factory provides the following widgets for the
2399  specified property types:
2400 
2401  \table
2402  \header
2403  \o Property Type
2404  \o Widget
2405  \row
2406  \o \c int
2407  \o QSpinBox
2408  \row
2409  \o \c double
2410  \o QDoubleSpinBox
2411  \row
2412  \o \c bool
2413  \o QCheckBox
2414  \row
2415  \o QString
2416  \o QLineEdit
2417  \row
2418  \o QDate
2419  \o QDateEdit
2420  \row
2421  \o QTime
2422  \o QTimeEdit
2423  \row
2424  \o QDateTime
2425  \o QDateTimeEdit
2426  \row
2427  \o QKeySequence
2428  \o customized editor
2429  \row
2430  \o QChar
2431  \o customized editor
2432  \row
2433  \o \c enum
2434  \o QComboBox
2435  \row
2436  \o QCursor
2437  \o QComboBox
2438  \endtable
2439 
2440  Note that QtVariantPropertyManager supports several additional property
2441  types for which the QtVariantEditorFactory class does not provide
2442  editing widgets, e.g. QPoint and QSize. To provide widgets for other
2443  types using the variant approach, derive from the QtVariantEditorFactory
2444  class.
2445 
2446  \sa QtAbstractEditorFactory, QtVariantPropertyManager
2447 */
2448 
2449 /*!
2450  Creates a factory with the given \a parent.
2451 */
2454 {
2455  d_ptr = new QtVariantEditorFactoryPrivate();
2456  d_ptr->q_ptr = this;
2457 
2458  d_ptr->m_spinBoxFactory = new QtSpinBoxFactory(this);
2461 
2465 
2466  d_ptr->m_checkBoxFactory = new QtCheckBoxFactory(this);
2469 
2470  d_ptr->m_lineEditFactory = new QtLineEditFactory(this);
2473 
2474  d_ptr->m_dateEditFactory = new QtDateEditFactory(this);
2475  d_ptr->m_factoryToType[d_ptr->m_dateEditFactory] = QVariant::Date;
2476  d_ptr->m_typeToFactory[QVariant::Date] = d_ptr->m_dateEditFactory;
2477 
2478  d_ptr->m_timeEditFactory = new QtTimeEditFactory(this);
2481 
2482  d_ptr->m_dateTimeEditFactory = new QtDateTimeEditFactory(this);
2483  d_ptr->m_factoryToType[d_ptr->m_dateTimeEditFactory] = QVariant::DateTime;
2484  d_ptr->m_typeToFactory[QVariant::DateTime] = d_ptr->m_dateTimeEditFactory;
2485 
2487  d_ptr->m_factoryToType[d_ptr->m_keySequenceEditorFactory] = QVariant::KeySequence;
2488  d_ptr->m_typeToFactory[QVariant::KeySequence] = d_ptr->m_keySequenceEditorFactory;
2489 
2490  d_ptr->m_charEditorFactory = new QtCharEditorFactory(this);
2491  d_ptr->m_factoryToType[d_ptr->m_charEditorFactory] = QVariant::Char;
2492  d_ptr->m_typeToFactory[QVariant::Char] = d_ptr->m_charEditorFactory;
2493 
2494  d_ptr->m_cursorEditorFactory = new QtCursorEditorFactory(this);
2495  d_ptr->m_factoryToType[d_ptr->m_cursorEditorFactory] = QVariant::Cursor;
2496  d_ptr->m_typeToFactory[QVariant::Cursor] = d_ptr->m_cursorEditorFactory;
2497 
2498  d_ptr->m_colorEditorFactory = new QtColorEditorFactory(this);
2501 
2502  d_ptr->m_fontEditorFactory = new QtFontEditorFactory(this);
2503  d_ptr->m_factoryToType[d_ptr->m_fontEditorFactory] = QVariant::Font;
2504  d_ptr->m_typeToFactory[QVariant::Font] = d_ptr->m_fontEditorFactory;
2505 
2506  d_ptr->m_comboBoxFactory = new QtEnumEditorFactory(this);
2507  const int enumId = QtVariantPropertyManager::enumTypeId();
2508  d_ptr->m_factoryToType[d_ptr->m_comboBoxFactory] = enumId;
2509  d_ptr->m_typeToFactory[enumId] = d_ptr->m_comboBoxFactory;
2510 }
2511 
2512 /*!
2513  Destroys this factory, and all the widgets it has created.
2514 */
2516 {
2517  delete d_ptr;
2518 }
2519 
2520 /*!
2521  \internal
2522 
2523  Reimplemented from the QtAbstractEditorFactory class.
2524 */
2526 {
2527  QList<QtIntPropertyManager*> intPropertyManagers = manager->findChildren<QtIntPropertyManager*>();
2528  QListIterator<QtIntPropertyManager*> itInt(intPropertyManagers);
2529 
2530  while (itInt.hasNext())
2531  {
2532  d_ptr->m_spinBoxFactory->addPropertyManager(itInt.next());
2533  }
2534 
2535  QList<QtDoublePropertyManager*> doublePropertyManagers = manager->findChildren<QtDoublePropertyManager*>();
2536  QListIterator<QtDoublePropertyManager*> itDouble(doublePropertyManagers);
2537 
2538  while (itDouble.hasNext())
2539  {
2540  d_ptr->m_doubleSpinBoxFactory->addPropertyManager(itDouble.next());
2541  }
2542 
2543  QList<QtBoolPropertyManager*> boolPropertyManagers = manager->findChildren<QtBoolPropertyManager*>();
2544  QListIterator<QtBoolPropertyManager*> itBool(boolPropertyManagers);
2545 
2546  while (itBool.hasNext())
2547  {
2548  d_ptr->m_checkBoxFactory->addPropertyManager(itBool.next());
2549  }
2550 
2551  QList<QtStringPropertyManager*> stringPropertyManagers = manager->findChildren<QtStringPropertyManager*>();
2552  QListIterator<QtStringPropertyManager*> itString(stringPropertyManagers);
2553 
2554  while (itString.hasNext())
2555  {
2556  d_ptr->m_lineEditFactory->addPropertyManager(itString.next());
2557  }
2558 
2559  QList<QtDatePropertyManager*> datePropertyManagers = manager->findChildren<QtDatePropertyManager*>();
2560  QListIterator<QtDatePropertyManager*> itDate(datePropertyManagers);
2561 
2562  while (itDate.hasNext())
2563  {
2564  d_ptr->m_dateEditFactory->addPropertyManager(itDate.next());
2565  }
2566 
2567  QList<QtTimePropertyManager*> timePropertyManagers = manager->findChildren<QtTimePropertyManager*>();
2568  QListIterator<QtTimePropertyManager*> itTime(timePropertyManagers);
2569 
2570  while (itTime.hasNext())
2571  {
2572  d_ptr->m_timeEditFactory->addPropertyManager(itTime.next());
2573  }
2574 
2575  QList<QtDateTimePropertyManager*> dateTimePropertyManagers = manager->findChildren<QtDateTimePropertyManager*>();
2576  QListIterator<QtDateTimePropertyManager*> itDateTime(dateTimePropertyManagers);
2577 
2578  while (itDateTime.hasNext())
2579  {
2580  d_ptr->m_dateTimeEditFactory->addPropertyManager(itDateTime.next());
2581  }
2582 
2583  QList<QtKeySequencePropertyManager*> keySequencePropertyManagers = manager->findChildren<QtKeySequencePropertyManager*>();
2584  QListIterator<QtKeySequencePropertyManager*> itKeySequence(keySequencePropertyManagers);
2585 
2586  while (itKeySequence.hasNext())
2587  {
2588  d_ptr->m_keySequenceEditorFactory->addPropertyManager(itKeySequence.next());
2589  }
2590 
2591  QList<QtCharPropertyManager*> charPropertyManagers = manager->findChildren<QtCharPropertyManager*>();
2592  QListIterator<QtCharPropertyManager*> itChar(charPropertyManagers);
2593 
2594  while (itChar.hasNext())
2595  {
2596  d_ptr->m_charEditorFactory->addPropertyManager(itChar.next());
2597  }
2598 
2599  QList<QtLocalePropertyManager*> localePropertyManagers = manager->findChildren<QtLocalePropertyManager*>();
2600  QListIterator<QtLocalePropertyManager*> itLocale(localePropertyManagers);
2601 
2602  while (itLocale.hasNext())
2603  {
2604  d_ptr->m_comboBoxFactory->addPropertyManager(itLocale.next()->subEnumPropertyManager());
2605  }
2606 
2607  QList<QtPointPropertyManager*> pointPropertyManagers = manager->findChildren<QtPointPropertyManager*>();
2608  QListIterator<QtPointPropertyManager*> itPoint(pointPropertyManagers);
2609 
2610  while (itPoint.hasNext())
2611  {
2612  d_ptr->m_spinBoxFactory->addPropertyManager(itPoint.next()->subIntPropertyManager());
2613  }
2614 
2615  QList<QtPointFPropertyManager*> pointFPropertyManagers = manager->findChildren<QtPointFPropertyManager*>();
2616  QListIterator<QtPointFPropertyManager*> itPointF(pointFPropertyManagers);
2617 
2618  while (itPointF.hasNext())
2619  {
2620  d_ptr->m_doubleSpinBoxFactory->addPropertyManager(itPointF.next()->subDoublePropertyManager());
2621  }
2622 
2623  QList<QtSizePropertyManager*> sizePropertyManagers = manager->findChildren<QtSizePropertyManager*>();
2624  QListIterator<QtSizePropertyManager*> itSize(sizePropertyManagers);
2625 
2626  while (itSize.hasNext())
2627  {
2628  d_ptr->m_spinBoxFactory->addPropertyManager(itSize.next()->subIntPropertyManager());
2629  }
2630 
2631  QList<QtSizeFPropertyManager*> sizeFPropertyManagers = manager->findChildren<QtSizeFPropertyManager*>();
2632  QListIterator<QtSizeFPropertyManager*> itSizeF(sizeFPropertyManagers);
2633 
2634  while (itSizeF.hasNext())
2635  {
2636  d_ptr->m_doubleSpinBoxFactory->addPropertyManager(itSizeF.next()->subDoublePropertyManager());
2637  }
2638 
2639  QList<QtRectPropertyManager*> rectPropertyManagers = manager->findChildren<QtRectPropertyManager*>();
2640  QListIterator<QtRectPropertyManager*> itRect(rectPropertyManagers);
2641 
2642  while (itRect.hasNext())
2643  {
2644  d_ptr->m_spinBoxFactory->addPropertyManager(itRect.next()->subIntPropertyManager());
2645  }
2646 
2647  QList<QtRectFPropertyManager*> rectFPropertyManagers = manager->findChildren<QtRectFPropertyManager*>();
2648  QListIterator<QtRectFPropertyManager*> itRectF(rectFPropertyManagers);
2649 
2650  while (itRectF.hasNext())
2651  {
2652  d_ptr->m_doubleSpinBoxFactory->addPropertyManager(itRectF.next()->subDoublePropertyManager());
2653  }
2654 
2655  QList<QtColorPropertyManager*> colorPropertyManagers = manager->findChildren<QtColorPropertyManager*>();
2656  QListIterator<QtColorPropertyManager*> itColor(colorPropertyManagers);
2657 
2658  while (itColor.hasNext())
2659  {
2660  QtColorPropertyManager* manager = itColor.next();
2661  d_ptr->m_colorEditorFactory->addPropertyManager(manager);
2663  }
2664 
2665  QList<QtEnumPropertyManager*> enumPropertyManagers = manager->findChildren<QtEnumPropertyManager*>();
2666  QListIterator<QtEnumPropertyManager*> itEnum(enumPropertyManagers);
2667 
2668  while (itEnum.hasNext())
2669  {
2670  d_ptr->m_comboBoxFactory->addPropertyManager(itEnum.next());
2671  }
2672 
2673  QList<QtSizePolicyPropertyManager*> sizePolicyPropertyManagers = manager->findChildren<QtSizePolicyPropertyManager*>();
2674  QListIterator<QtSizePolicyPropertyManager*> itSizePolicy(sizePolicyPropertyManagers);
2675 
2676  while (itSizePolicy.hasNext())
2677  {
2678  QtSizePolicyPropertyManager* manager = itSizePolicy.next();
2681  }
2682 
2683  QList<QtFontPropertyManager*> fontPropertyManagers = manager->findChildren<QtFontPropertyManager*>();
2684  QListIterator<QtFontPropertyManager*> itFont(fontPropertyManagers);
2685 
2686  while (itFont.hasNext())
2687  {
2688  QtFontPropertyManager* manager = itFont.next();
2689  d_ptr->m_fontEditorFactory->addPropertyManager(manager);
2693  }
2694 
2695  QList<QtCursorPropertyManager*> cursorPropertyManagers = manager->findChildren<QtCursorPropertyManager*>();
2696  QListIterator<QtCursorPropertyManager*> itCursor(cursorPropertyManagers);
2697 
2698  while (itCursor.hasNext())
2699  {
2700  d_ptr->m_cursorEditorFactory->addPropertyManager(itCursor.next());
2701  }
2702 
2703  QList<QtFlagPropertyManager*> flagPropertyManagers = manager->findChildren<QtFlagPropertyManager*>();
2704  QListIterator<QtFlagPropertyManager*> itFlag(flagPropertyManagers);
2705 
2706  while (itFlag.hasNext())
2707  {
2708  d_ptr->m_checkBoxFactory->addPropertyManager(itFlag.next()->subBoolPropertyManager());
2709  }
2710 }
2711 
2712 /*!
2713  \internal
2714 
2715  Reimplemented from the QtAbstractEditorFactory class.
2716 */
2718  QWidget* parent)
2719 {
2720  const int propType = manager->propertyType(property);
2721  QtAbstractEditorFactoryBase* factory = d_ptr->m_typeToFactory.value(propType, 0);
2722 
2723  if (!factory)
2724  {
2725  return 0;
2726  }
2727 
2728  return factory->createEditor(wrappedProperty(property), parent);
2729 }
2730 
2731 /*!
2732  \internal
2733 
2734  Reimplemented from the QtAbstractEditorFactory class.
2735 */
2737 {
2738  QList<QtIntPropertyManager*> intPropertyManagers = manager->findChildren<QtIntPropertyManager*>();
2739  QListIterator<QtIntPropertyManager*> itInt(intPropertyManagers);
2740 
2741  while (itInt.hasNext())
2742  {
2743  d_ptr->m_spinBoxFactory->removePropertyManager(itInt.next());
2744  }
2745 
2746  QList<QtDoublePropertyManager*> doublePropertyManagers = manager->findChildren<QtDoublePropertyManager*>();
2747  QListIterator<QtDoublePropertyManager*> itDouble(doublePropertyManagers);
2748 
2749  while (itDouble.hasNext())
2750  {
2751  d_ptr->m_doubleSpinBoxFactory->removePropertyManager(itDouble.next());
2752  }
2753 
2754  QList<QtBoolPropertyManager*> boolPropertyManagers = manager->findChildren<QtBoolPropertyManager*>();
2755  QListIterator<QtBoolPropertyManager*> itBool(boolPropertyManagers);
2756 
2757  while (itBool.hasNext())
2758  {
2759  d_ptr->m_checkBoxFactory->removePropertyManager(itBool.next());
2760  }
2761 
2762  QList<QtStringPropertyManager*> stringPropertyManagers = manager->findChildren<QtStringPropertyManager*>();
2763  QListIterator<QtStringPropertyManager*> itString(stringPropertyManagers);
2764 
2765  while (itString.hasNext())
2766  {
2767  d_ptr->m_lineEditFactory->removePropertyManager(itString.next());
2768  }
2769 
2770  QList<QtDatePropertyManager*> datePropertyManagers = manager->findChildren<QtDatePropertyManager*>();
2771  QListIterator<QtDatePropertyManager*> itDate(datePropertyManagers);
2772 
2773  while (itDate.hasNext())
2774  {
2775  d_ptr->m_dateEditFactory->removePropertyManager(itDate.next());
2776  }
2777 
2778  QList<QtTimePropertyManager*> timePropertyManagers = manager->findChildren<QtTimePropertyManager*>();
2779  QListIterator<QtTimePropertyManager*> itTime(timePropertyManagers);
2780 
2781  while (itTime.hasNext())
2782  {
2783  d_ptr->m_timeEditFactory->removePropertyManager(itTime.next());
2784  }
2785 
2786  QList<QtDateTimePropertyManager*> dateTimePropertyManagers = manager->findChildren<QtDateTimePropertyManager*>();
2787  QListIterator<QtDateTimePropertyManager*> itDateTime(dateTimePropertyManagers);
2788 
2789  while (itDateTime.hasNext())
2790  {
2791  d_ptr->m_dateTimeEditFactory->removePropertyManager(itDateTime.next());
2792  }
2793 
2794  QList<QtKeySequencePropertyManager*> keySequencePropertyManagers = manager->findChildren<QtKeySequencePropertyManager*>();
2795  QListIterator<QtKeySequencePropertyManager*> itKeySequence(keySequencePropertyManagers);
2796 
2797  while (itKeySequence.hasNext())
2798  {
2799  d_ptr->m_keySequenceEditorFactory->removePropertyManager(itKeySequence.next());
2800  }
2801 
2802  QList<QtCharPropertyManager*> charPropertyManagers = manager->findChildren<QtCharPropertyManager*>();
2803  QListIterator<QtCharPropertyManager*> itChar(charPropertyManagers);
2804 
2805  while (itChar.hasNext())
2806  {
2807  d_ptr->m_charEditorFactory->removePropertyManager(itChar.next());
2808  }
2809 
2810  QList<QtLocalePropertyManager*> localePropertyManagers = manager->findChildren<QtLocalePropertyManager*>();
2811  QListIterator<QtLocalePropertyManager*> itLocale(localePropertyManagers);
2812 
2813  while (itLocale.hasNext())
2814  {
2815  d_ptr->m_comboBoxFactory->removePropertyManager(itLocale.next()->subEnumPropertyManager());
2816  }
2817 
2818  QList<QtPointPropertyManager*> pointPropertyManagers = manager->findChildren<QtPointPropertyManager*>();
2819  QListIterator<QtPointPropertyManager*> itPoint(pointPropertyManagers);
2820 
2821  while (itPoint.hasNext())
2822  {
2823  d_ptr->m_spinBoxFactory->removePropertyManager(itPoint.next()->subIntPropertyManager());
2824  }
2825 
2826  QList<QtPointFPropertyManager*> pointFPropertyManagers = manager->findChildren<QtPointFPropertyManager*>();
2827  QListIterator<QtPointFPropertyManager*> itPointF(pointFPropertyManagers);
2828 
2829  while (itPointF.hasNext())
2830  {
2831  d_ptr->m_doubleSpinBoxFactory->removePropertyManager(itPointF.next()->subDoublePropertyManager());
2832  }
2833 
2834  QList<QtSizePropertyManager*> sizePropertyManagers = manager->findChildren<QtSizePropertyManager*>();
2835  QListIterator<QtSizePropertyManager*> itSize(sizePropertyManagers);
2836 
2837  while (itSize.hasNext())
2838  {
2839  d_ptr->m_spinBoxFactory->removePropertyManager(itSize.next()->subIntPropertyManager());
2840  }
2841 
2842  QList<QtSizeFPropertyManager*> sizeFPropertyManagers = manager->findChildren<QtSizeFPropertyManager*>();
2843  QListIterator<QtSizeFPropertyManager*> itSizeF(sizeFPropertyManagers);
2844 
2845  while (itSizeF.hasNext())
2846  {
2847  d_ptr->m_doubleSpinBoxFactory->removePropertyManager(itSizeF.next()->subDoublePropertyManager());
2848  }
2849 
2850  QList<QtRectPropertyManager*> rectPropertyManagers = manager->findChildren<QtRectPropertyManager*>();
2851  QListIterator<QtRectPropertyManager*> itRect(rectPropertyManagers);
2852 
2853  while (itRect.hasNext())
2854  {
2855  d_ptr->m_spinBoxFactory->removePropertyManager(itRect.next()->subIntPropertyManager());
2856  }
2857 
2858  QList<QtRectFPropertyManager*> rectFPropertyManagers = manager->findChildren<QtRectFPropertyManager*>();
2859  QListIterator<QtRectFPropertyManager*> itRectF(rectFPropertyManagers);
2860 
2861  while (itRectF.hasNext())
2862  {
2863  d_ptr->m_doubleSpinBoxFactory->removePropertyManager(itRectF.next()->subDoublePropertyManager());
2864  }
2865 
2866  QList<QtColorPropertyManager*> colorPropertyManagers = manager->findChildren<QtColorPropertyManager*>();
2867  QListIterator<QtColorPropertyManager*> itColor(colorPropertyManagers);
2868 
2869  while (itColor.hasNext())
2870  {
2871  QtColorPropertyManager* manager = itColor.next();
2874  }
2875 
2876  QList<QtEnumPropertyManager*> enumPropertyManagers = manager->findChildren<QtEnumPropertyManager*>();
2877  QListIterator<QtEnumPropertyManager*> itEnum(enumPropertyManagers);
2878 
2879  while (itEnum.hasNext())
2880  {
2881  d_ptr->m_comboBoxFactory->removePropertyManager(itEnum.next());
2882  }
2883 
2884  QList<QtSizePolicyPropertyManager*> sizePolicyPropertyManagers = manager->findChildren<QtSizePolicyPropertyManager*>();
2885  QListIterator<QtSizePolicyPropertyManager*> itSizePolicy(sizePolicyPropertyManagers);
2886 
2887  while (itSizePolicy.hasNext())
2888  {
2889  QtSizePolicyPropertyManager* manager = itSizePolicy.next();
2892  }
2893 
2894  QList<QtFontPropertyManager*> fontPropertyManagers = manager->findChildren<QtFontPropertyManager*>();
2895  QListIterator<QtFontPropertyManager*> itFont(fontPropertyManagers);
2896 
2897  while (itFont.hasNext())
2898  {
2899  QtFontPropertyManager* manager = itFont.next();
2900  d_ptr->m_fontEditorFactory->removePropertyManager(manager);
2904  }
2905 
2906  QList<QtCursorPropertyManager*> cursorPropertyManagers = manager->findChildren<QtCursorPropertyManager*>();
2907  QListIterator<QtCursorPropertyManager*> itCursor(cursorPropertyManagers);
2908 
2909  while (itCursor.hasNext())
2910  {
2911  d_ptr->m_cursorEditorFactory->removePropertyManager(itCursor.next());
2912  }
2913 
2914  QList<QtFlagPropertyManager*> flagPropertyManagers = manager->findChildren<QtFlagPropertyManager*>();
2915  QListIterator<QtFlagPropertyManager*> itFlag(flagPropertyManagers);
2916 
2917  while (itFlag.hasNext())
2918  {
2919  d_ptr->m_checkBoxFactory->removePropertyManager(itFlag.next()->subBoolPropertyManager());
2920  }
2921 }
2922 
2923 QT_END_NAMESPACE
2924 
2925 #include "moc_qtvariantproperty.cpp"
QtVariantPropertyManagerPrivate::m_textVisibleAttribute
const QString m_textVisibleAttribute
Definition: qtvariantproperty.cpp:373
QtRectPropertyManager
The QtRectPropertyManager provides and manages QRect properties.
Definition: qtpropertymanager.h:508
QtVariantPropertyManager::addProperty
virtual QtVariantProperty * addProperty(int propertyType, const QString &name=QString())
Definition: qtvariantproperty.cpp:1403
QtVariantPropertyManager::uninitializeProperty
void uninitializeProperty(QtProperty *property) override
Definition: qtvariantproperty.cpp:2319
QtVariantPropertyManagerPrivate::slotRangeChanged
void slotRangeChanged(QtProperty *property, int min, int max)
Definition: qtvariantproperty.cpp:519
QtVariantEditorFactoryPrivate::m_cursorEditorFactory
QtCursorEditorFactory * m_cursorEditorFactory
Definition: qtvariantproperty.cpp:2384
QtColorPropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:7118
QtVariantPropertyManager::initializeProperty
void initializeProperty(QtProperty *property) override
Definition: qtvariantproperty.cpp:2276
QtVariantEditorFactory::createEditor
QWidget * createEditor(QtVariantPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qtvariantproperty.cpp:2717
QtVariantPropertyManagerPrivate::slotConstraintChanged
void slotConstraintChanged(QtProperty *property, const QRect &val)
Definition: qtvariantproperty.cpp:692
QtPointPropertyManager
The QtPointPropertyManager provides and manages QPoint properties.
Definition: qtpropertymanager.h:374
QtVariantEditorFactoryPrivate::m_doubleSpinBoxFactory
QtDoubleSpinBoxFactory * m_doubleSpinBoxFactory
Definition: qtvariantproperty.cpp:2375
QtFontPropertyManager::subBoolPropertyManager
QtBoolPropertyManager * subBoolPropertyManager() const
Definition: qtpropertymanager.cpp:6723
QtSizePolicyPropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:6216
QtVariantPropertyManagerPrivate::m_destroyingSubProperties
bool m_destroyingSubProperties
Definition: qtvariantproperty.cpp:300
QtVariantEditorFactoryPrivate::m_dateTimeEditFactory
QtDateTimeEditFactory * m_dateTimeEditFactory
Definition: qtvariantproperty.cpp:2380
QtFlagPropertyType
Definition: qtvariantproperty.cpp:61
QtAbstractPropertyManager::addProperty
QtProperty * addProperty(const QString &name=QString())
Definition: qtpropertybrowser.cpp:826
QtIntPropertyManager
The QtIntPropertyManager provides and manages int properties.
Definition: qtpropertymanager.h:70
QtVariantEditorFactoryPrivate::m_timeEditFactory
QtTimeEditFactory * m_timeEditFactory
Definition: qtvariantproperty.cpp:2379
QtVariantPropertyManager::setAttribute
virtual void setAttribute(QtProperty *property, const QString &attribute, const QVariant &value)
Definition: qtvariantproperty.cpp:2028
QtProperty::setWhatsThis
void setWhatsThis(const QString &text)
Definition: qtpropertybrowser.cpp:358
QtColorEditorFactory
The QtColorEditorFactory class provides color editing for properties created by QtColorPropertyManage...
Definition: qteditorfactory.h:357
QtSizeFPropertyManager
The QtSizeFPropertyManager provides and manages QSizeF properties.
Definition: qtpropertymanager.h:470
QtVariantPropertyManagerPrivate::slotFlagNamesChanged
void slotFlagNamesChanged(QtProperty *property, const QStringList &flagNames)
Definition: qtvariantproperty.cpp:753
QtGroupPropertyType
Definition: qtvariantproperty.cpp:66
QtProperty::setStatusTip
void setStatusTip(const QString &text)
Definition: qtpropertybrowser.cpp:342
QtVariantPropertyManagerPrivate::m_typeToValueType
QMap< int, int > m_typeToValueType
Definition: qtvariantproperty.cpp:357
QtVariantPropertyManagerPrivate::m_typeToPropertyManager
QMap< int, QtAbstractPropertyManager * > m_typeToPropertyManager
Definition: qtvariantproperty.cpp:352
QtDateTimeEditFactory
The QtDateTimeEditFactory class provides QDateTimeEdit widgets for properties created by QtDateTimePr...
Definition: qteditorfactory.h:243
QtSizePropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:3711
QtVariantPropertyManager::valueChanged
void valueChanged(QtProperty *property, const QVariant &val)
QtCharEditorFactory
The QtCharEditorFactory class provides editor widgets for properties created by QtCharPropertyManager...
Definition: qteditorfactory.h:287
qteditorfactory.h
QtVariantPropertyManagerPrivate::m_readOnlyAttribute
const QString m_readOnlyAttribute
Definition: qtvariantproperty.cpp:372
QtVariantPropertyManagerPrivate::slotEnumChanged
void slotEnumChanged(QtProperty *property, int val)
QtCursorEditorFactory
The QtCursorEditorFactory class provides QComboBox widgets for properties created by QtCursorProperty...
Definition: qteditorfactory.h:335
QtVariantPropertyManagerPrivate::m_propertyType
int m_propertyType
Definition: qtvariantproperty.cpp:301
QtStringPropertyManager
The QtStringPropertyManager provides and manages QString properties.
Definition: qtpropertymanager.h:176
QtFlagPropertyManager
The QtFlagPropertyManager provides and manages flag properties.
Definition: qtpropertymanager.h:607
QtVariantEditorFactoryPrivate::m_typeToFactory
QMap< int, QtAbstractEditorFactoryBase * > m_typeToFactory
Definition: qtvariantproperty.cpp:2389
armarx::VariantType::Bool
const VariantTypeId Bool
Definition: Variant.h:915
QtVariantPropertyManager
The QtVariantPropertyManager class provides and manages QVariant based properties.
Definition: qtvariantproperty.h:75
QtVariantPropertyPrivate
Definition: qtvariantproperty.cpp:141
QtDoubleSpinBoxFactory
The QtDoubleSpinBoxFactory class provides QDoubleSpinBox widgets for properties created by QtDoublePr...
Definition: qteditorfactory.h:146
QtVariantPropertyManagerPrivate::m_flagNamesAttribute
const QString m_flagNamesAttribute
Definition: qtvariantproperty.cpp:367
QtProperty::valueText
QString valueText() const
Definition: qtpropertybrowser.cpp:303
QtProperty
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:71
QtVariantEditorFactoryPrivate::m_spinBoxFactory
QtSpinBoxFactory * m_spinBoxFactory
Definition: qtvariantproperty.cpp:2374
QtTimePropertyManager
The QtTimePropertyManager provides and manages QTime properties.
Definition: qtpropertymanager.h:244
QtFlagPropertyManager::subBoolPropertyManager
QtBoolPropertyManager * subBoolPropertyManager() const
Definition: qtpropertymanager.cpp:5830
QtVariantEditorFactoryPrivate::m_dateEditFactory
QtDateEditFactory * m_dateEditFactory
Definition: qtvariantproperty.cpp:2378
QtVariantPropertyManager::createProperty
QtProperty * createProperty() override
Definition: qtvariantproperty.cpp:2353
QtVariantPropertyManagerPrivate::slotReadOnlyChanged
void slotReadOnlyChanged(QtProperty *property, bool readOnly)
Definition: qtvariantproperty.cpp:592
QtGroupPropertyManager
The QtGroupPropertyManager provides and manages group properties.
Definition: qtpropertymanager.h:54
QtProperty::insertSubProperty
void insertSubProperty(QtProperty *property, QtProperty *afterProperty)
Definition: qtpropertybrowser.cpp:452
QtVariantPropertyManagerPrivate::m_creatingProperty
bool m_creatingProperty
Definition: qtvariantproperty.cpp:298
QtVariantPropertyManagerPrivate::slotTextVisibleChanged
void slotTextVisibleChanged(QtProperty *property, bool textVisible)
Definition: qtvariantproperty.cpp:600
QtVariantPropertyManagerPrivate::slotEchoModeChanged
void slotEchoModeChanged(QtProperty *property, int)
Definition: qtvariantproperty.cpp:584
QtVariantEditorFactoryPrivate
Definition: qtvariantproperty.cpp:2368
QtProperty::setPropertyName
void setPropertyName(const QString &text)
Definition: qtpropertybrowser.cpp:376
QtVariantPropertyManager::setValue
virtual void setValue(QtProperty *property, const QVariant &val)
Definition: qtvariantproperty.cpp:1876
QtFontPropertyManager
The QtFontPropertyManager provides and manages QFont properties.
Definition: qtpropertymanager.h:670
QtVariantPropertyManager::attributes
virtual QStringList attributes(int propertyType) const
Definition: qtvariantproperty.cpp:1820
QtVariantPropertyManagerPrivate::createSubProperty
QtVariantProperty * createSubProperty(QtVariantProperty *parent, QtVariantProperty *after, QtProperty *internal)
Definition: qtvariantproperty.cpp:417
QtVariantPropertyManagerPrivate::slotPropertyInserted
void slotPropertyInserted(QtProperty *property, QtProperty *parent, QtProperty *after)
Definition: qtvariantproperty.cpp:457
QtSizePropertyManager
The QtSizePropertyManager provides and manages QSize properties.
Definition: qtpropertymanager.h:435
QtVariantPropertyManager::hasValue
bool hasValue(const QtProperty *property) const override
Definition: qtvariantproperty.cpp:2245
QtVariantPropertyManagerPrivate::m_echoModeAttribute
const QString m_echoModeAttribute
Definition: qtvariantproperty.cpp:371
armarx::VariantType::Double
const VariantTypeId Double
Definition: Variant.h:919
QtEnumPropertyType
Definition: qtvariantproperty.cpp:56
QtDatePropertyManager
The QtDatePropertyManager provides and manages QDate properties.
Definition: qtpropertymanager.h:213
QtVariantEditorFactoryPrivate::m_factoryToType
QMap< QtAbstractEditorFactoryBase *, int > m_factoryToType
Definition: qtvariantproperty.cpp:2388
QtVariantProperty::QtVariantProperty
QtVariantProperty(QtVariantPropertyManager *manager)
Definition: qtvariantproperty.cpp:197
QtVariantProperty
The QtVariantProperty class is a convenience class handling QVariant based properties.
Definition: qtvariantproperty.h:55
QtCharPropertyManager
The QtCharPropertyManager provides and manages QChar properties.
Definition: qtpropertymanager.h:319
QtAbstractEditorFactoryBase
The QtAbstractEditorFactoryBase provides an interface for editor factories.
Definition: qtpropertybrowser.h:147
QtPointFPropertyManager::subDoublePropertyManager
QtDoublePropertyManager * subDoublePropertyManager() const
Definition: qtpropertymanager.cpp:3359
QtVariantProperty::valueType
int valueType() const
Definition: qtvariantproperty.cpp:242
QtVariantPropertyManagerPrivate::removeSubProperty
void removeSubProperty(QtVariantProperty *property)
Definition: qtvariantproperty.cpp:446
Color
uint32_t Color
RGBA color.
Definition: color.h:8
QtFontEditorFactory
The QtFontEditorFactory class provides font editing for properties created by QtFontPropertyManager o...
Definition: qteditorfactory.h:379
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
QtAbstractEditorFactoryBase::createEditor
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)=0
QtSpinBoxFactory
The QtSpinBoxFactory class provides QSpinBox widgets for properties created by QtIntPropertyManager o...
Definition: qteditorfactory.h:50
QtVariantPropertyManager::attributeChanged
void attributeChanged(QtProperty *property, const QString &attribute, const QVariant &val)
QtDateEditFactory
The QtDateEditFactory class provides QDateEdit widgets for properties created by QtDatePropertyManage...
Definition: qteditorfactory.h:197
QtVariantPropertyManagerPrivate::m_propertyToType
QMap< const QtProperty *, QPair< QtVariantProperty *, int > > m_propertyToType
Definition: qtvariantproperty.cpp:355
QtVariantPropertyManager::value
virtual QVariant value(const QtProperty *property) const
Definition: qtvariantproperty.cpp:1433
QtVariantPropertyManager::variantProperty
QtVariantProperty * variantProperty(const QtProperty *property) const
Definition: qtvariantproperty.cpp:1361
QtVariantPropertyPrivate::manager
QtVariantPropertyManager * manager
Definition: qtvariantproperty.cpp:147
QtVariantPropertyManager::isPropertyTypeSupported
virtual bool isPropertyTypeSupported(int propertyType) const
Definition: qtvariantproperty.cpp:1379
QtVariantPropertyManagerPrivate::internalPropertyToType
int internalPropertyToType(QtProperty *property) const
Definition: qtvariantproperty.cpp:392
QtVariantPropertyManagerPrivate::m_singleStepAttribute
const QString m_singleStepAttribute
Definition: qtvariantproperty.cpp:363
QtRectFPropertyManager
The QtRectFPropertyManager provides and manages QRectF properties.
Definition: qtpropertymanager.h:540
armarx::VariantType::Invalid
const VariantTypeId Invalid
Definition: Variant.h:914
QtDoublePropertyManager
The QtDoublePropertyManager provides and manages double properties.
Definition: qtpropertymanager.h:136
QtVariantPropertyManagerPrivate::m_minimumAttribute
const QString m_minimumAttribute
Definition: qtvariantproperty.cpp:369
QtPointPropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:3109
QtVariantEditorFactoryPrivate::m_checkBoxFactory
QtCheckBoxFactory * m_checkBoxFactory
Definition: qtvariantproperty.cpp:2376
qtvariantproperty.h
QtProperty::propertyManager
QtAbstractPropertyManager * propertyManager() const
Definition: qtpropertybrowser.cpp:207
QtVariantPropertyManagerPrivate::m_decimalsAttribute
const QString m_decimalsAttribute
Definition: qtvariantproperty.cpp:364
QtAbstractEditorFactory
The QtAbstractEditorFactory is the base template class for editor factories.
Definition: qtpropertybrowser.h:164
QtVariantProperty::value
QVariant value() const
Definition: qtvariantproperty.cpp:218
QtVariantPropertyManager::valueText
QString valueText(const QtProperty *property) const override
Definition: qtvariantproperty.cpp:2258
QtBoolPropertyManager
The QtBoolPropertyManager class provides and manages boolean properties.
Definition: qtpropertymanager.h:107
QtVariantProperty::attributeValue
QVariant attributeValue(const QString &attribute) const
Definition: qtvariantproperty.cpp:232
visionx::Point
Eigen::Vector3f Point
Definition: ObjectShapeClassification.h:69
QtVariantPropertyManager::QtVariantPropertyManager
QtVariantPropertyManager(QObject *parent=0)
Definition: qtvariantproperty.cpp:1011
QtVariantPropertyManagerPrivate::m_creatingSubProperties
bool m_creatingSubProperties
Definition: qtvariantproperty.cpp:299
QtVariantPropertyManager::groupTypeId
static int groupTypeId()
Definition: qtvariantproperty.cpp:115
max
T max(T t1, T t2)
Definition: gdiam.h:48
armarx::aron::similarity::FloatSimilarity::Type
Type
The Type enum.
Definition: FloatSimilarity.h:8
QtLineEditFactory
The QtLineEditFactory class provides QLineEdit widgets for properties created by QtStringPropertyMana...
Definition: qteditorfactory.h:172
QtVariantPropertyManagerPrivate::m_constraintAttribute
const QString m_constraintAttribute
Definition: qtvariantproperty.cpp:362
QtAbstractPropertyManager::propertyRemoved
void propertyRemoved(QtProperty *property, QtProperty *parent)
QtVariantPropertyManagerPrivate
Definition: qtvariantproperty.cpp:291
QtVariantEditorFactory
The QtVariantEditorFactory class provides widgets for properties created by QtVariantPropertyManager ...
Definition: qtvariantproperty.h:162
QtVariantProperty::setValue
void setValue(const QVariant &value)
Definition: qtvariantproperty.cpp:272
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
QtVariantPropertyManagerPrivate::slotFlagChanged
void slotFlagChanged(QtProperty *property, int val)
QtVariantEditorFactory::QtVariantEditorFactory
QtVariantEditorFactory(QObject *parent=0)
Definition: qtvariantproperty.cpp:2452
QtLocalePropertyManager::subEnumPropertyManager
QtEnumPropertyManager * subEnumPropertyManager() const
Definition: qtpropertymanager.cpp:2850
QtVariantPropertyManagerPrivate::slotEnumIconsChanged
void slotEnumIconsChanged(QtProperty *property, const QMap< int, QIcon > &enumIcons)
Definition: qtvariantproperty.cpp:726
QtProperty::setToolTip
void setToolTip(const QString &text)
Definition: qtpropertybrowser.cpp:326
QtDateTimePropertyManager
The QtDateTimePropertyManager provides and manages QDateTime properties.
Definition: qtpropertymanager.h:269
QtVariantEditorFactoryPrivate::m_lineEditFactory
QtLineEditFactory * m_lineEditFactory
Definition: qtvariantproperty.cpp:2377
QtProperty::subProperties
QList< QtProperty * > subProperties() const
Definition: qtpropertybrowser.cpp:199
QtVariantPropertyManager::attributeValue
virtual QVariant attributeValue(const QtProperty *property, const QString &attribute) const
Definition: qtvariantproperty.cpp:1592
QtAbstractPropertyManager::propertyInserted
void propertyInserted(QtProperty *property, QtProperty *parent, QtProperty *after)
QtKeySequenceEditorFactory
The QtKeySequenceEditorFactory class provides editor widgets for properties created by QtKeySequenceP...
Definition: qteditorfactory.h:265
QtVariantPropertyManagerPrivate::m_enumIconsAttribute
const QString m_enumIconsAttribute
Definition: qtvariantproperty.cpp:365
QtFontPropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:6694
QtAbstractEditorFactory::removePropertyManager
void removePropertyManager(PropertyManager *manager)
Definition: qtpropertybrowser.h:196
QtSizePolicyPropertyManager
The QtSizePolicyPropertyManager provides and manages QSizePolicy properties.
Definition: qtpropertymanager.h:639
QtVariantPropertyManager::iconMapTypeId
static int iconMapTypeId()
Definition: qtvariantproperty.cpp:128
QtVariantPropertyManagerPrivate::m_internalToProperty
QMap< QtProperty *, QtVariantProperty * > m_internalToProperty
Definition: qtvariantproperty.cpp:360
QtAbstractPropertyManager
The QtAbstractPropertyManager provides an interface for property managers.
Definition: qtpropertybrowser.h:112
QtVariantPropertyManagerPrivate::m_regExpAttribute
const QString m_regExpAttribute
Definition: qtvariantproperty.cpp:370
QtAbstractEditorFactory::addPropertyManager
void addPropertyManager(PropertyManager *manager)
Definition: qtpropertybrowser.h:184
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
QtVariantPropertyManager::propertyType
int propertyType(const QtProperty *property) const
Definition: qtvariantproperty.cpp:1570
QtCursorPropertyManager
The QtCursorPropertyManager provides and manages QCursor properties.
Definition: qtpropertymanager.h:736
EchoMode
QLineEdit::EchoMode EchoMode
Definition: qtpropertybrowser.h:66
QtVariantEditorFactoryPrivate::m_fontEditorFactory
QtFontEditorFactory * m_fontEditorFactory
Definition: qtvariantproperty.cpp:2386
QtVariantPropertyManagerPrivate::slotValueChanged
void slotValueChanged(QtProperty *property, int val)
Definition: qtvariantproperty.cpp:514
QtVariantProperty::~QtVariantProperty
~QtVariantProperty() override
Definition: qtvariantproperty.cpp:208
QtVariantPropertyManagerPrivate::slotPropertyRemoved
void slotPropertyRemoved(QtProperty *property, QtProperty *parent)
Definition: qtvariantproperty.cpp:487
QtIconMap
QMap< int, QIcon > QtIconMap
Definition: qtvariantproperty.h:50
QtVariantEditorFactory::connectPropertyManager
void connectPropertyManager(QtVariantPropertyManager *manager) override
Definition: qtvariantproperty.cpp:2525
QtEnumPropertyManager
The QtEnumPropertyManager provides and manages enum properties.
Definition: qtpropertymanager.h:575
QtVariantPropertyManagerPrivate::QtVariantPropertyManagerPrivate
QtVariantPropertyManagerPrivate()
Definition: qtvariantproperty.cpp:376
QtVariantPropertyManagerPrivate::slotSingleStepChanged
void slotSingleStepChanged(QtProperty *property, int step)
Definition: qtvariantproperty.cpp:528
QtVariantEditorFactoryPrivate::m_comboBoxFactory
QtEnumEditorFactory * m_comboBoxFactory
Definition: qtvariantproperty.cpp:2383
QtVariantEditorFactory::~QtVariantEditorFactory
~QtVariantEditorFactory() override
Definition: qtvariantproperty.cpp:2515
QtVariantPropertyManager::attributeType
virtual int attributeType(int propertyType, const QString &attribute) const
Definition: qtvariantproperty.cpp:1843
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
QtVariantPropertyPrivate::QtVariantPropertyPrivate
QtVariantPropertyPrivate(QtVariantPropertyManager *m)
Definition: qtvariantproperty.cpp:145
QtAbstractPropertyManager::propertyChanged
void propertyChanged(QtProperty *property)
QtCheckBoxFactory
The QtCheckBoxFactory class provides QCheckBox widgets for properties created by QtBoolPropertyManage...
Definition: qteditorfactory.h:123
QtSizeFPropertyManager::subDoublePropertyManager
QtDoublePropertyManager * subDoublePropertyManager() const
Definition: qtpropertymanager.cpp:4092
QtVariantPropertyManagerPrivate::slotRegExpChanged
void slotRegExpChanged(QtProperty *property, const QRegExp &regExp)
Definition: qtvariantproperty.cpp:576
QtKeySequencePropertyManager
The QtKeySequencePropertyManager provides and manages QKeySequence properties.
Definition: qtpropertymanager.h:294
QtTimeEditFactory
The QtTimeEditFactory class provides QTimeEdit widgets for properties created by QtTimePropertyManage...
Definition: qteditorfactory.h:221
QtRectPropertyManager::subIntPropertyManager
QtIntPropertyManager * subIntPropertyManager() const
Definition: qtpropertymanager.cpp:4544
QtVariantPropertyManager::valueType
int valueType(const QtProperty *property) const
Definition: qtvariantproperty.cpp:1544
QtVariantPropertyManagerPrivate::m_typeToAttributeToAttributeType
QMap< int, QMap< QString, int > > m_typeToAttributeToAttributeType
Definition: qtvariantproperty.cpp:353
QtFontPropertyManager::subEnumPropertyManager
QtEnumPropertyManager * subEnumPropertyManager() const
Definition: qtpropertymanager.cpp:6708
cxxopts::String
std::string String
Definition: cxxopts.hpp:209
QtVariantPropertyManager::flagTypeId
static int flagTypeId()
Definition: qtvariantproperty.cpp:101
min
T min(T t1, T t2)
Definition: gdiam.h:42
QtVariantEditorFactory::disconnectPropertyManager
void disconnectPropertyManager(QtVariantPropertyManager *manager) override
Definition: qtvariantproperty.cpp:2736
QtVariantPropertyManager::valueIcon
QIcon valueIcon(const QtProperty *property) const override
Definition: qtvariantproperty.cpp:2267
QtSizePolicyPropertyManager::subEnumPropertyManager
QtEnumPropertyManager * subEnumPropertyManager() const
Definition: qtpropertymanager.cpp:6231
QtVariantPropertyManagerPrivate::valueChanged
void valueChanged(QtProperty *property, const QVariant &val)
Definition: qtvariantproperty.cpp:501
QtVariantEditorFactoryPrivate::m_charEditorFactory
QtCharEditorFactory * m_charEditorFactory
Definition: qtvariantproperty.cpp:2382
QtVariantProperty::setAttribute
void setAttribute(const QString &attribute, const QVariant &value)
Definition: qtvariantproperty.cpp:286
QtVariantPropertyManagerPrivate::m_maximumAttribute
const QString m_maximumAttribute
Definition: qtvariantproperty.cpp:368
QtProperty::displayText
QString displayText() const
Definition: qtpropertybrowser.cpp:316
QtVariantPropertyManager::enumTypeId
static int enumTypeId()
Definition: qtvariantproperty.cpp:87
QtVariantProperty::propertyType
int propertyType() const
Definition: qtvariantproperty.cpp:257
QtVariantPropertyManagerPrivate::slotEnumNamesChanged
void slotEnumNamesChanged(QtProperty *property, const QStringList &enumNames)
Definition: qtvariantproperty.cpp:718
QtVariantPropertyManager::~QtVariantPropertyManager
~QtVariantPropertyManager() override
Definition: qtvariantproperty.cpp:1347
QtVariantEditorFactoryPrivate::m_colorEditorFactory
QtColorEditorFactory * m_colorEditorFactory
Definition: qtvariantproperty.cpp:2385
QtEnumEditorFactory
The QtEnumEditorFactory class provides QComboBox widgets for properties created by QtEnumPropertyMana...
Definition: qteditorfactory.h:309
QtAbstractPropertyManager::clear
void clear() const
Definition: qtpropertybrowser.cpp:726
PropertyMap
QMap< const QtProperty *, QtProperty * > PropertyMap
Definition: qtvariantproperty.cpp:133
QtPointFPropertyManager
The QtPointFPropertyManager provides and manages QPointF properties.
Definition: qtpropertymanager.h:403
QtVariantPropertyManagerPrivate::m_enumNamesAttribute
const QString m_enumNamesAttribute
Definition: qtvariantproperty.cpp:366
QtVariantPropertyManagerPrivate::slotDecimalsChanged
void slotDecimalsChanged(QtProperty *property, int prec)
Definition: qtvariantproperty.cpp:558
QtLocalePropertyManager
The QtLocalePropertyManager provides and manages QLocale properties.
Definition: qtpropertymanager.h:345
ScenarioManager::Parser::StringList
std::vector< std::string > StringList
Definition: PackageBuilder.h:34
QtRectFPropertyManager::subDoublePropertyManager
QtDoublePropertyManager * subDoublePropertyManager() const
Definition: qtpropertymanager.cpp:5033
qtpropertymanager.h
QtVariantEditorFactoryPrivate::m_keySequenceEditorFactory
QtKeySequenceEditorFactory * m_keySequenceEditorFactory
Definition: qtvariantproperty.cpp:2381
QtColorPropertyManager
The QtColorPropertyManager provides and manages QColor properties.
Definition: qtpropertymanager.h:706
QtProperty::valueIcon
QIcon valueIcon() const
Definition: qtpropertybrowser.cpp:290