qteditorfactory.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 "qteditorfactory.h"
43 
44 #include <QAbstractItemView>
45 #include <QApplication>
46 #include <QColorDialog>
47 #include <QComboBox>
48 #include <QDateTimeEdit>
49 #include <QFontDialog>
50 #include <QHBoxLayout>
51 #include <QKeyEvent>
52 #include <QLabel>
53 #include <QLineEdit>
54 #include <QMap>
55 #include <QMenu>
56 #include <QPainter>
57 #include <QScrollBar>
58 #include <QSpacerItem>
59 #include <QSpinBox>
60 #include <QStyleOption>
61 #include <QToolButton>
62 
64 
65 #if defined(Q_CC_MSVC)
66 #pragma warning(disable : 4786) /* MS VS 6: truncating debug info after 255 characters */
67 #endif
68 
69 QT_BEGIN_NAMESPACE
70 
71 // Set a hard coded left margin to account for the indentation
72 // of the tree view icon when switching to an editor
73 
74 static inline void
75 setupTreeViewEditorMargin(QLayout* lt)
76 {
77  enum
78  {
79  DecorationMargin = 4
80  };
81 
82  if (QApplication::layoutDirection() == Qt::LeftToRight)
83  {
84  lt->setContentsMargins(DecorationMargin, 0, 0, 0);
85  }
86  else
87  {
88  lt->setContentsMargins(0, 0, DecorationMargin, 0);
89  }
90 }
91 
92 // ---------- EditorFactoryPrivate :
93 // Base class for editor factory private classes. Manages mapping of properties to editors and vice versa.
94 
95 template <class Editor>
97 {
98 public:
99  using EditorList = QList<Editor*>;
100  using PropertyToEditorListMap = QMap<QtProperty*, EditorList>;
101  using EditorToPropertyMap = QMap<Editor*, QtProperty*>;
102 
103  Editor* createEditor(QtProperty* property, QWidget* parent);
104  void initializeEditor(QtProperty* property, Editor* e);
105  void slotEditorDestroyed(QObject* object);
106 
109 };
110 
111 template <class Editor>
112 Editor*
114 {
115  Editor* editor = new Editor(parent);
116  initializeEditor(property, editor);
117  return editor;
118 }
119 
120 template <class Editor>
121 void
123 {
124  typename PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
125 
126  if (it == m_createdEditors.end())
127  {
128  it = m_createdEditors.insert(property, EditorList());
129  }
130 
131  it.value().append(editor);
132  m_editorToProperty.insert(editor, property);
133 }
134 
135 template <class Editor>
136 void
138 {
139  const typename EditorToPropertyMap::iterator ecend = m_editorToProperty.end();
140 
141  for (typename EditorToPropertyMap::iterator itEditor = m_editorToProperty.begin();
142  itEditor != ecend;
143  ++itEditor)
144  {
145  if (itEditor.key() == object)
146  {
147  Editor* editor = itEditor.key();
148  QtProperty* property = itEditor.value();
149  const typename PropertyToEditorListMap::iterator pit = m_createdEditors.find(property);
150 
151  if (pit != m_createdEditors.end())
152  {
153  pit.value().removeAll(editor);
154 
155  if (pit.value().empty())
156  {
157  m_createdEditors.erase(pit);
158  }
159  }
160 
161  m_editorToProperty.erase(itEditor);
162  return;
163  }
164  }
165 }
166 
167 // ------------ QtSpinBoxFactory
168 
170 {
171  QtSpinBoxFactory* q_ptr;
172  Q_DECLARE_PUBLIC(QtSpinBoxFactory)
173 public:
174  void slotPropertyChanged(QtProperty* property, int value);
175  void slotRangeChanged(QtProperty* property, int min, int max);
176  void slotSingleStepChanged(QtProperty* property, int step);
177  void slotReadOnlyChanged(QtProperty* property, bool readOnly);
178  void slotSetValue(int value);
179 };
180 
181 void
183 {
184  if (!m_createdEditors.contains(property))
185  {
186  return;
187  }
188 
189  QListIterator<QSpinBox*> itEditor(m_createdEditors[property]);
190 
191  while (itEditor.hasNext())
192  {
193  QSpinBox* editor = itEditor.next();
194 
195  if (editor->value() != value)
196  {
197  editor->blockSignals(true);
198  editor->setValue(value);
199  editor->blockSignals(false);
200  }
201  }
202 }
203 
204 void
206 {
207  if (!m_createdEditors.contains(property))
208  {
209  return;
210  }
211 
212  QtIntPropertyManager* manager = q_ptr->propertyManager(property);
213 
214  if (!manager)
215  {
216  return;
217  }
218 
219  QListIterator<QSpinBox*> itEditor(m_createdEditors[property]);
220 
221  while (itEditor.hasNext())
222  {
223  QSpinBox* editor = itEditor.next();
224  editor->blockSignals(true);
225  editor->setRange(min, max);
226  editor->setValue(manager->value(property));
227  editor->blockSignals(false);
228  }
229 }
230 
231 void
233 {
234  if (!m_createdEditors.contains(property))
235  {
236  return;
237  }
238 
239  QListIterator<QSpinBox*> itEditor(m_createdEditors[property]);
240 
241  while (itEditor.hasNext())
242  {
243  QSpinBox* editor = itEditor.next();
244  editor->blockSignals(true);
245  editor->setSingleStep(step);
246  editor->blockSignals(false);
247  }
248 }
249 
250 void
252 {
253  if (!m_createdEditors.contains(property))
254  {
255  return;
256  }
257 
258  QtIntPropertyManager* manager = q_ptr->propertyManager(property);
259 
260  if (!manager)
261  {
262  return;
263  }
264 
265  QListIterator<QSpinBox*> itEditor(m_createdEditors[property]);
266 
267  while (itEditor.hasNext())
268  {
269  QSpinBox* editor = itEditor.next();
270  editor->blockSignals(true);
271  editor->setReadOnly(readOnly);
272  editor->blockSignals(false);
273  }
274 }
275 
276 void
278 {
279  QObject* object = q_ptr->sender();
280  const QMap<QSpinBox*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
281 
282  for (QMap<QSpinBox*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
283  itEditor != ecend;
284  ++itEditor)
285  {
286  if (itEditor.key() == object)
287  {
288  QtProperty* property = itEditor.value();
289  QtIntPropertyManager* manager = q_ptr->propertyManager(property);
290 
291  if (!manager)
292  {
293  return;
294  }
295 
296  manager->setValue(property, value);
297  return;
298  }
299  }
300 }
301 
302 /*!
303  \class QtSpinBoxFactory
304 
305  \brief The QtSpinBoxFactory class provides QSpinBox widgets for
306  properties created by QtIntPropertyManager objects.
307 
308  \sa QtAbstractEditorFactory, QtIntPropertyManager
309 */
310 
311 /*!
312  Creates a factory with the given \a parent.
313 */
316 {
317  d_ptr = new QtSpinBoxFactoryPrivate();
318  d_ptr->q_ptr = this;
319 }
320 
321 /*!
322  Destroys this factory, and all the widgets it has created.
323 */
325 {
326  qDeleteAll(d_ptr->m_editorToProperty.keys());
327  delete d_ptr;
328 }
329 
330 /*!
331  \internal
332 
333  Reimplemented from the QtAbstractEditorFactory class.
334 */
335 void
337 {
338  connect(manager,
339  SIGNAL(valueChanged(QtProperty*, int)),
340  this,
341  SLOT(slotPropertyChanged(QtProperty*, int)));
342  connect(manager,
343  SIGNAL(rangeChanged(QtProperty*, int, int)),
344  this,
345  SLOT(slotRangeChanged(QtProperty*, int, int)));
346  connect(manager,
347  SIGNAL(singleStepChanged(QtProperty*, int)),
348  this,
349  SLOT(slotSingleStepChanged(QtProperty*, int)));
350  connect(manager,
351  SIGNAL(readOnlyChanged(QtProperty*, bool)),
352  this,
353  SLOT(slotReadOnlyChanged(QtProperty*, bool)));
354 }
355 
356 /*!
357  \internal
358 
359  Reimplemented from the QtAbstractEditorFactory class.
360 */
361 QWidget*
363 {
364  QSpinBox* editor = d_ptr->createEditor(property, parent);
365  editor->setSingleStep(manager->singleStep(property));
366  editor->setRange(manager->minimum(property), manager->maximum(property));
367  editor->setValue(manager->value(property));
368  editor->setKeyboardTracking(false);
369  editor->setReadOnly(manager->isReadOnly(property));
370 
371  connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int)));
372  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
373  return editor;
374 }
375 
376 /*!
377  \internal
378 
379  Reimplemented from the QtAbstractEditorFactory class.
380 */
381 void
383 {
384  disconnect(manager,
385  SIGNAL(valueChanged(QtProperty*, int)),
386  this,
387  SLOT(slotPropertyChanged(QtProperty*, int)));
388  disconnect(manager,
389  SIGNAL(rangeChanged(QtProperty*, int, int)),
390  this,
391  SLOT(slotRangeChanged(QtProperty*, int, int)));
392  disconnect(manager,
393  SIGNAL(singleStepChanged(QtProperty*, int)),
394  this,
395  SLOT(slotSingleStepChanged(QtProperty*, int)));
396  disconnect(manager,
397  SIGNAL(readOnlyChanged(QtProperty*, bool)),
398  this,
399  SLOT(slotReadOnlyChanged(QtProperty*, bool)));
400 }
401 
402 // QtSliderFactory
403 
405 {
406  QtSliderFactory* q_ptr;
407  Q_DECLARE_PUBLIC(QtSliderFactory)
408 public:
409  void slotPropertyChanged(QtProperty* property, int value);
410  void slotRangeChanged(QtProperty* property, int min, int max);
411  void slotSingleStepChanged(QtProperty* property, int step);
412  void slotSetValue(int value);
413 };
414 
415 void
417 {
418  if (!m_createdEditors.contains(property))
419  {
420  return;
421  }
422 
423  QListIterator<QSlider*> itEditor(m_createdEditors[property]);
424 
425  while (itEditor.hasNext())
426  {
427  QSlider* editor = itEditor.next();
428  editor->blockSignals(true);
429  editor->setValue(value);
430  editor->blockSignals(false);
431  }
432 }
433 
434 void
436 {
437  if (!m_createdEditors.contains(property))
438  {
439  return;
440  }
441 
442  QtIntPropertyManager* manager = q_ptr->propertyManager(property);
443 
444  if (!manager)
445  {
446  return;
447  }
448 
449  QListIterator<QSlider*> itEditor(m_createdEditors[property]);
450 
451  while (itEditor.hasNext())
452  {
453  QSlider* editor = itEditor.next();
454  editor->blockSignals(true);
455  editor->setRange(min, max);
456  editor->setValue(manager->value(property));
457  editor->blockSignals(false);
458  }
459 }
460 
461 void
463 {
464  if (!m_createdEditors.contains(property))
465  {
466  return;
467  }
468 
469  QListIterator<QSlider*> itEditor(m_createdEditors[property]);
470 
471  while (itEditor.hasNext())
472  {
473  QSlider* editor = itEditor.next();
474  editor->blockSignals(true);
475  editor->setSingleStep(step);
476  editor->blockSignals(false);
477  }
478 }
479 
480 void
482 {
483  QObject* object = q_ptr->sender();
484  const QMap<QSlider*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
485 
486  for (QMap<QSlider*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
487  itEditor != ecend;
488  ++itEditor)
489  {
490  if (itEditor.key() == object)
491  {
492  QtProperty* property = itEditor.value();
493  QtIntPropertyManager* manager = q_ptr->propertyManager(property);
494 
495  if (!manager)
496  {
497  return;
498  }
499 
500  manager->setValue(property, value);
501  return;
502  }
503  }
504 }
505 
506 /*!
507  \class QtSliderFactory
508 
509  \brief The QtSliderFactory class provides QSlider widgets for
510  properties created by QtIntPropertyManager objects.
511 
512  \sa QtAbstractEditorFactory, QtIntPropertyManager
513 */
514 
515 /*!
516  Creates a factory with the given \a parent.
517 */
520 {
521  d_ptr = new QtSliderFactoryPrivate();
522  d_ptr->q_ptr = this;
523 }
524 
525 /*!
526  Destroys this factory, and all the widgets it has created.
527 */
529 {
530  qDeleteAll(d_ptr->m_editorToProperty.keys());
531  delete d_ptr;
532 }
533 
534 /*!
535  \internal
536 
537  Reimplemented from the QtAbstractEditorFactory class.
538 */
539 void
541 {
542  connect(manager,
543  SIGNAL(valueChanged(QtProperty*, int)),
544  this,
545  SLOT(slotPropertyChanged(QtProperty*, int)));
546  connect(manager,
547  SIGNAL(rangeChanged(QtProperty*, int, int)),
548  this,
549  SLOT(slotRangeChanged(QtProperty*, int, int)));
550  connect(manager,
551  SIGNAL(singleStepChanged(QtProperty*, int)),
552  this,
553  SLOT(slotSingleStepChanged(QtProperty*, int)));
554 }
555 
556 /*!
557  \internal
558 
559  Reimplemented from the QtAbstractEditorFactory class.
560 */
561 QWidget*
562 QtSliderFactory::createEditor(QtIntPropertyManager* manager, QtProperty* property, QWidget* parent)
563 {
564  QSlider* editor = new QSlider(Qt::Horizontal, parent);
565  d_ptr->initializeEditor(property, editor);
566  editor->setSingleStep(manager->singleStep(property));
567  editor->setRange(manager->minimum(property), manager->maximum(property));
568  editor->setValue(manager->value(property));
569 
570  connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int)));
571  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
572  return editor;
573 }
574 
575 /*!
576  \internal
577 
578  Reimplemented from the QtAbstractEditorFactory class.
579 */
580 void
582 {
583  disconnect(manager,
584  SIGNAL(valueChanged(QtProperty*, int)),
585  this,
586  SLOT(slotPropertyChanged(QtProperty*, int)));
587  disconnect(manager,
588  SIGNAL(rangeChanged(QtProperty*, int, int)),
589  this,
590  SLOT(slotRangeChanged(QtProperty*, int, int)));
591  disconnect(manager,
592  SIGNAL(singleStepChanged(QtProperty*, int)),
593  this,
594  SLOT(slotSingleStepChanged(QtProperty*, int)));
595 }
596 
597 // QtSliderFactory
598 
600 {
601  QtScrollBarFactory* q_ptr;
602  Q_DECLARE_PUBLIC(QtScrollBarFactory)
603 public:
604  void slotPropertyChanged(QtProperty* property, int value);
605  void slotRangeChanged(QtProperty* property, int min, int max);
606  void slotSingleStepChanged(QtProperty* property, int step);
607  void slotSetValue(int value);
608 };
609 
610 void
612 {
613  if (!m_createdEditors.contains(property))
614  {
615  return;
616  }
617 
618  QListIterator<QScrollBar*> itEditor(m_createdEditors[property]);
619 
620  while (itEditor.hasNext())
621  {
622  QScrollBar* editor = itEditor.next();
623  editor->blockSignals(true);
624  editor->setValue(value);
625  editor->blockSignals(false);
626  }
627 }
628 
629 void
631 {
632  if (!m_createdEditors.contains(property))
633  {
634  return;
635  }
636 
637  QtIntPropertyManager* manager = q_ptr->propertyManager(property);
638 
639  if (!manager)
640  {
641  return;
642  }
643 
644  QListIterator<QScrollBar*> itEditor(m_createdEditors[property]);
645 
646  while (itEditor.hasNext())
647  {
648  QScrollBar* editor = itEditor.next();
649  editor->blockSignals(true);
650  editor->setRange(min, max);
651  editor->setValue(manager->value(property));
652  editor->blockSignals(false);
653  }
654 }
655 
656 void
658 {
659  if (!m_createdEditors.contains(property))
660  {
661  return;
662  }
663 
664  QListIterator<QScrollBar*> itEditor(m_createdEditors[property]);
665 
666  while (itEditor.hasNext())
667  {
668  QScrollBar* editor = itEditor.next();
669  editor->blockSignals(true);
670  editor->setSingleStep(step);
671  editor->blockSignals(false);
672  }
673 }
674 
675 void
677 {
678  QObject* object = q_ptr->sender();
679  const QMap<QScrollBar*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
680 
681  for (QMap<QScrollBar*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
682  itEditor != ecend;
683  ++itEditor)
684  if (itEditor.key() == object)
685  {
686  QtProperty* property = itEditor.value();
687  QtIntPropertyManager* manager = q_ptr->propertyManager(property);
688 
689  if (!manager)
690  {
691  return;
692  }
693 
694  manager->setValue(property, value);
695  return;
696  }
697 }
698 
699 /*!
700  \class QtScrollBarFactory
701 
702  \brief The QtScrollBarFactory class provides QScrollBar widgets for
703  properties created by QtIntPropertyManager objects.
704 
705  \sa QtAbstractEditorFactory, QtIntPropertyManager
706 */
707 
708 /*!
709  Creates a factory with the given \a parent.
710 */
713 {
714  d_ptr = new QtScrollBarFactoryPrivate();
715  d_ptr->q_ptr = this;
716 }
717 
718 /*!
719  Destroys this factory, and all the widgets it has created.
720 */
722 {
723  qDeleteAll(d_ptr->m_editorToProperty.keys());
724  delete d_ptr;
725 }
726 
727 /*!
728  \internal
729 
730  Reimplemented from the QtAbstractEditorFactory class.
731 */
732 void
734 {
735  connect(manager,
736  SIGNAL(valueChanged(QtProperty*, int)),
737  this,
738  SLOT(slotPropertyChanged(QtProperty*, int)));
739  connect(manager,
740  SIGNAL(rangeChanged(QtProperty*, int, int)),
741  this,
742  SLOT(slotRangeChanged(QtProperty*, int, int)));
743  connect(manager,
744  SIGNAL(singleStepChanged(QtProperty*, int)),
745  this,
746  SLOT(slotSingleStepChanged(QtProperty*, int)));
747 }
748 
749 /*!
750  \internal
751 
752  Reimplemented from the QtAbstractEditorFactory class.
753 */
754 QWidget*
756  QtProperty* property,
757  QWidget* parent)
758 {
759  QScrollBar* editor = new QScrollBar(Qt::Horizontal, parent);
760  d_ptr->initializeEditor(property, editor);
761  editor->setSingleStep(manager->singleStep(property));
762  editor->setRange(manager->minimum(property), manager->maximum(property));
763  editor->setValue(manager->value(property));
764  connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int)));
765  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
766  return editor;
767 }
768 
769 /*!
770  \internal
771 
772  Reimplemented from the QtAbstractEditorFactory class.
773 */
774 void
776 {
777  disconnect(manager,
778  SIGNAL(valueChanged(QtProperty*, int)),
779  this,
780  SLOT(slotPropertyChanged(QtProperty*, int)));
781  disconnect(manager,
782  SIGNAL(rangeChanged(QtProperty*, int, int)),
783  this,
784  SLOT(slotRangeChanged(QtProperty*, int, int)));
785  disconnect(manager,
786  SIGNAL(singleStepChanged(QtProperty*, int)),
787  this,
788  SLOT(slotSingleStepChanged(QtProperty*, int)));
789 }
790 
791 // QtCheckBoxFactory
792 
794 {
795  QtCheckBoxFactory* q_ptr;
796  Q_DECLARE_PUBLIC(QtCheckBoxFactory)
797 public:
798  void slotPropertyChanged(QtProperty* property, bool value);
799  void slotTextVisibleChanged(QtProperty* property, bool textVisible);
800  void slotSetValue(bool value);
801 };
802 
803 void
805 {
806  if (!m_createdEditors.contains(property))
807  {
808  return;
809  }
810 
811  QListIterator<QtBoolEdit*> itEditor(m_createdEditors[property]);
812 
813  while (itEditor.hasNext())
814  {
815  QtBoolEdit* editor = itEditor.next();
816  editor->blockCheckBoxSignals(true);
817  editor->setChecked(value);
818  editor->blockCheckBoxSignals(false);
819  }
820 }
821 
822 void
824 {
825  if (!m_createdEditors.contains(property))
826  {
827  return;
828  }
829 
830  QtBoolPropertyManager* manager = q_ptr->propertyManager(property);
831 
832  if (!manager)
833  {
834  return;
835  }
836 
837  QListIterator<QtBoolEdit*> itEditor(m_createdEditors[property]);
838 
839  while (itEditor.hasNext())
840  {
841  QtBoolEdit* editor = itEditor.next();
842  editor->setTextVisible(textVisible);
843  }
844 }
845 
846 void
848 {
849  QObject* object = q_ptr->sender();
850 
851  const QMap<QtBoolEdit*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
852 
853  for (QMap<QtBoolEdit*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
854  itEditor != ecend;
855  ++itEditor)
856  if (itEditor.key() == object)
857  {
858  QtProperty* property = itEditor.value();
859  QtBoolPropertyManager* manager = q_ptr->propertyManager(property);
860 
861  if (!manager)
862  {
863  return;
864  }
865 
866  manager->setValue(property, value);
867  return;
868  }
869 }
870 
871 /*!
872  \class QtCheckBoxFactory
873 
874  \brief The QtCheckBoxFactory class provides QCheckBox widgets for
875  properties created by QtBoolPropertyManager objects.
876 
877  \sa QtAbstractEditorFactory, QtBoolPropertyManager
878 */
879 
880 /*!
881  Creates a factory with the given \a parent.
882 */
885 {
886  d_ptr = new QtCheckBoxFactoryPrivate();
887  d_ptr->q_ptr = this;
888 }
889 
890 /*!
891  Destroys this factory, and all the widgets it has created.
892 */
894 {
895  qDeleteAll(d_ptr->m_editorToProperty.keys());
896  delete d_ptr;
897 }
898 
899 /*!
900  \internal
901 
902  Reimplemented from the QtAbstractEditorFactory class.
903 */
904 void
906 {
907  connect(manager,
908  SIGNAL(valueChanged(QtProperty*, bool)),
909  this,
910  SLOT(slotPropertyChanged(QtProperty*, bool)));
911  connect(manager,
912  SIGNAL(textVisibleChanged(QtProperty*, bool)),
913  this,
914  SLOT(slotTextVisibleChanged(QtProperty*, bool)));
915 }
916 
917 /*!
918  \internal
919 
920  Reimplemented from the QtAbstractEditorFactory class.
921 */
922 QWidget*
924  QtProperty* property,
925  QWidget* parent)
926 {
927  QtBoolEdit* editor = d_ptr->createEditor(property, parent);
928  editor->setChecked(manager->value(property));
929  editor->setTextVisible(manager->textVisible(property));
930 
931  connect(editor, SIGNAL(toggled(bool)), this, SLOT(slotSetValue(bool)));
932  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
933  return editor;
934 }
935 
936 /*!
937  \internal
938 
939  Reimplemented from the QtAbstractEditorFactory class.
940 */
941 void
943 {
944  disconnect(manager,
945  SIGNAL(valueChanged(QtProperty*, bool)),
946  this,
947  SLOT(slotPropertyChanged(QtProperty*, bool)));
948  disconnect(manager,
949  SIGNAL(textVisibleChanged(QtProperty*, bool)),
950  this,
951  SLOT(slotTextVisibleChanged(QtProperty*, bool)));
952 }
953 
954 // QtDoubleSpinBoxFactory
955 
957 {
958  QtDoubleSpinBoxFactory* q_ptr;
959  Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
960 public:
961  void slotPropertyChanged(QtProperty* property, double value);
962  void slotRangeChanged(QtProperty* property, double min, double max);
963  void slotSingleStepChanged(QtProperty* property, double step);
964  void slotDecimalsChanged(QtProperty* property, int prec);
965  void slotReadOnlyChanged(QtProperty* property, bool readOnly);
966  void slotSetValue(double value);
967 };
968 
969 void
971 {
972  QList<QDoubleSpinBox*> editors = m_createdEditors[property];
973  QListIterator<QDoubleSpinBox*> itEditor(m_createdEditors[property]);
974 
975  while (itEditor.hasNext())
976  {
977  QDoubleSpinBox* editor = itEditor.next();
978 
979  if (editor->value() != value)
980  {
981  editor->blockSignals(true);
982  editor->setValue(value);
983  editor->blockSignals(false);
984  }
985  }
986 }
987 
988 void
990 {
991  if (!m_createdEditors.contains(property))
992  {
993  return;
994  }
995 
996  QtDoublePropertyManager* manager = q_ptr->propertyManager(property);
997 
998  if (!manager)
999  {
1000  return;
1001  }
1002 
1003  QList<QDoubleSpinBox*> editors = m_createdEditors[property];
1004  QListIterator<QDoubleSpinBox*> itEditor(editors);
1005 
1006  while (itEditor.hasNext())
1007  {
1008  QDoubleSpinBox* editor = itEditor.next();
1009  editor->blockSignals(true);
1010  editor->setRange(min, max);
1011  editor->setValue(manager->value(property));
1012  editor->blockSignals(false);
1013  }
1014 }
1015 
1016 void
1018 {
1019  if (!m_createdEditors.contains(property))
1020  {
1021  return;
1022  }
1023 
1024  QtDoublePropertyManager* manager = q_ptr->propertyManager(property);
1025 
1026  if (!manager)
1027  {
1028  return;
1029  }
1030 
1031  QList<QDoubleSpinBox*> editors = m_createdEditors[property];
1032  QListIterator<QDoubleSpinBox*> itEditor(editors);
1033 
1034  while (itEditor.hasNext())
1035  {
1036  QDoubleSpinBox* editor = itEditor.next();
1037  editor->blockSignals(true);
1038  editor->setSingleStep(step);
1039  editor->blockSignals(false);
1040  }
1041 }
1042 
1043 void
1045 {
1046  if (!m_createdEditors.contains(property))
1047  {
1048  return;
1049  }
1050 
1051  QtDoublePropertyManager* manager = q_ptr->propertyManager(property);
1052 
1053  if (!manager)
1054  {
1055  return;
1056  }
1057 
1058  QListIterator<QDoubleSpinBox*> itEditor(m_createdEditors[property]);
1059 
1060  while (itEditor.hasNext())
1061  {
1062  QDoubleSpinBox* editor = itEditor.next();
1063  editor->blockSignals(true);
1064  editor->setReadOnly(readOnly);
1065  editor->blockSignals(false);
1066  }
1067 }
1068 
1069 void
1071 {
1072  if (!m_createdEditors.contains(property))
1073  {
1074  return;
1075  }
1076 
1077  QtDoublePropertyManager* manager = q_ptr->propertyManager(property);
1078 
1079  if (!manager)
1080  {
1081  return;
1082  }
1083 
1084  QList<QDoubleSpinBox*> editors = m_createdEditors[property];
1085  QListIterator<QDoubleSpinBox*> itEditor(editors);
1086 
1087  while (itEditor.hasNext())
1088  {
1089  QDoubleSpinBox* editor = itEditor.next();
1090  editor->blockSignals(true);
1091  editor->setDecimals(prec);
1092  editor->setValue(manager->value(property));
1093  editor->blockSignals(false);
1094  }
1095 }
1096 
1097 void
1099 {
1100  QObject* object = q_ptr->sender();
1101  const QMap<QDoubleSpinBox*, QtProperty*>::ConstIterator itcend = m_editorToProperty.constEnd();
1102 
1103  for (QMap<QDoubleSpinBox*, QtProperty*>::ConstIterator itEditor =
1104  m_editorToProperty.constBegin();
1105  itEditor != itcend;
1106  ++itEditor)
1107  {
1108  if (itEditor.key() == object)
1109  {
1110  QtProperty* property = itEditor.value();
1111  QtDoublePropertyManager* manager = q_ptr->propertyManager(property);
1112 
1113  if (!manager)
1114  {
1115  return;
1116  }
1117 
1118  manager->setValue(property, value);
1119  return;
1120  }
1121  }
1122 }
1123 
1124 /*! \class QtDoubleSpinBoxFactory
1125 
1126  \brief The QtDoubleSpinBoxFactory class provides QDoubleSpinBox
1127  widgets for properties created by QtDoublePropertyManager objects.
1128 
1129  \sa QtAbstractEditorFactory, QtDoublePropertyManager
1130 */
1131 
1132 /*!
1133  Creates a factory with the given \a parent.
1134 */
1137 {
1138  d_ptr = new QtDoubleSpinBoxFactoryPrivate();
1139  d_ptr->q_ptr = this;
1140 }
1141 
1142 /*!
1143  Destroys this factory, and all the widgets it has created.
1144 */
1146 {
1147  qDeleteAll(d_ptr->m_editorToProperty.keys());
1148  delete d_ptr;
1149 }
1150 
1151 /*!
1152  \internal
1153 
1154  Reimplemented from the QtAbstractEditorFactory class.
1155 */
1156 void
1158 {
1159  connect(manager,
1160  SIGNAL(valueChanged(QtProperty*, double)),
1161  this,
1162  SLOT(slotPropertyChanged(QtProperty*, double)));
1163  connect(manager,
1164  SIGNAL(rangeChanged(QtProperty*, double, double)),
1165  this,
1166  SLOT(slotRangeChanged(QtProperty*, double, double)));
1167  connect(manager,
1168  SIGNAL(singleStepChanged(QtProperty*, double)),
1169  this,
1170  SLOT(slotSingleStepChanged(QtProperty*, double)));
1171  connect(manager,
1172  SIGNAL(decimalsChanged(QtProperty*, int)),
1173  this,
1174  SLOT(slotDecimalsChanged(QtProperty*, int)));
1175  connect(manager,
1176  SIGNAL(readOnlyChanged(QtProperty*, bool)),
1177  this,
1178  SLOT(slotReadOnlyChanged(QtProperty*, bool)));
1179 }
1180 
1181 /*!
1182  \internal
1183 
1184  Reimplemented from the QtAbstractEditorFactory class.
1185 */
1186 QWidget*
1188  QtProperty* property,
1189  QWidget* parent)
1190 {
1191  QDoubleSpinBox* editor = d_ptr->createEditor(property, parent);
1192  editor->setSingleStep(manager->singleStep(property));
1193  editor->setDecimals(manager->decimals(property));
1194  editor->setRange(manager->minimum(property), manager->maximum(property));
1195  editor->setValue(manager->value(property));
1196  editor->setKeyboardTracking(false);
1197  editor->setReadOnly(manager->isReadOnly(property));
1198 
1199  connect(editor, SIGNAL(valueChanged(double)), this, SLOT(slotSetValue(double)));
1200  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
1201  return editor;
1202 }
1203 
1204 /*!
1205  \internal
1206 
1207  Reimplemented from the QtAbstractEditorFactory class.
1208 */
1209 void
1211 {
1212  disconnect(manager,
1213  SIGNAL(valueChanged(QtProperty*, double)),
1214  this,
1215  SLOT(slotPropertyChanged(QtProperty*, double)));
1216  disconnect(manager,
1217  SIGNAL(rangeChanged(QtProperty*, double, double)),
1218  this,
1219  SLOT(slotRangeChanged(QtProperty*, double, double)));
1220  disconnect(manager,
1221  SIGNAL(singleStepChanged(QtProperty*, double)),
1222  this,
1223  SLOT(slotSingleStepChanged(QtProperty*, double)));
1224  disconnect(manager,
1225  SIGNAL(decimalsChanged(QtProperty*, int)),
1226  this,
1227  SLOT(slotDecimalsChanged(QtProperty*, int)));
1228  disconnect(manager,
1229  SIGNAL(readOnlyChanged(QtProperty*, bool)),
1230  this,
1231  SLOT(slotReadOnlyChanged(QtProperty*, bool)));
1232 }
1233 
1234 // QtLineEditFactory
1235 
1237 {
1238  QtLineEditFactory* q_ptr;
1239  Q_DECLARE_PUBLIC(QtLineEditFactory)
1240 public:
1241  void slotPropertyChanged(QtProperty* property, const QString& value);
1242  void slotRegExpChanged(QtProperty* property, const QRegExp& regExp);
1243  void slotSetValue(const QString& value);
1244  void slotEchoModeChanged(QtProperty*, int);
1245  void slotReadOnlyChanged(QtProperty*, bool);
1246 };
1247 
1248 void
1250 {
1251  if (!m_createdEditors.contains(property))
1252  {
1253  return;
1254  }
1255 
1256  QListIterator<QLineEdit*> itEditor(m_createdEditors[property]);
1257 
1258  while (itEditor.hasNext())
1259  {
1260  QLineEdit* editor = itEditor.next();
1261 
1262  if (editor->text() != value)
1263  {
1264  editor->blockSignals(true);
1265  editor->setText(value);
1266  editor->blockSignals(false);
1267  }
1268  }
1269 }
1270 
1271 void
1273 {
1274  if (!m_createdEditors.contains(property))
1275  {
1276  return;
1277  }
1278 
1279  QtStringPropertyManager* manager = q_ptr->propertyManager(property);
1280 
1281  if (!manager)
1282  {
1283  return;
1284  }
1285 
1286  QListIterator<QLineEdit*> itEditor(m_createdEditors[property]);
1287 
1288  while (itEditor.hasNext())
1289  {
1290  QLineEdit* editor = itEditor.next();
1291  editor->blockSignals(true);
1292  const QValidator* oldValidator = editor->validator();
1293  QValidator* newValidator = 0;
1294 
1295  if (regExp.isValid())
1296  {
1297  newValidator = new QRegExpValidator(regExp, editor);
1298  }
1299 
1300  editor->setValidator(newValidator);
1301 
1302  if (oldValidator)
1303  {
1304  delete oldValidator;
1305  }
1306 
1307  editor->blockSignals(false);
1308  }
1309 }
1310 
1311 void
1313 {
1314  if (!m_createdEditors.contains(property))
1315  {
1316  return;
1317  }
1318 
1319  QtStringPropertyManager* manager = q_ptr->propertyManager(property);
1320 
1321  if (!manager)
1322  {
1323  return;
1324  }
1325 
1326  QListIterator<QLineEdit*> itEditor(m_createdEditors[property]);
1327 
1328  while (itEditor.hasNext())
1329  {
1330  QLineEdit* editor = itEditor.next();
1331  editor->blockSignals(true);
1332  editor->setEchoMode((EchoMode)echoMode);
1333  editor->blockSignals(false);
1334  }
1335 }
1336 
1337 void
1339 {
1340  if (!m_createdEditors.contains(property))
1341  {
1342  return;
1343  }
1344 
1345  QtStringPropertyManager* manager = q_ptr->propertyManager(property);
1346 
1347  if (!manager)
1348  {
1349  return;
1350  }
1351 
1352  QListIterator<QLineEdit*> itEditor(m_createdEditors[property]);
1353 
1354  while (itEditor.hasNext())
1355  {
1356  QLineEdit* editor = itEditor.next();
1357  editor->blockSignals(true);
1358  editor->setReadOnly(readOnly);
1359  editor->blockSignals(false);
1360  }
1361 }
1362 
1363 void
1365 {
1366  QObject* object = q_ptr->sender();
1367  const QMap<QLineEdit*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
1368 
1369  for (QMap<QLineEdit*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
1370  itEditor != ecend;
1371  ++itEditor)
1372  if (itEditor.key() == object)
1373  {
1374  QtProperty* property = itEditor.value();
1375  QtStringPropertyManager* manager = q_ptr->propertyManager(property);
1376 
1377  if (!manager)
1378  {
1379  return;
1380  }
1381 
1382  manager->setValue(property, value);
1383  return;
1384  }
1385 }
1386 
1387 /*!
1388  \class QtLineEditFactory
1389 
1390  \brief The QtLineEditFactory class provides QLineEdit widgets for
1391  properties created by QtStringPropertyManager objects.
1392 
1393  \sa QtAbstractEditorFactory, QtStringPropertyManager
1394 */
1395 
1396 /*!
1397  Creates a factory with the given \a parent.
1398 */
1401 {
1402  d_ptr = new QtLineEditFactoryPrivate();
1403  d_ptr->q_ptr = this;
1404 }
1405 
1406 /*!
1407  Destroys this factory, and all the widgets it has created.
1408 */
1410 {
1411  qDeleteAll(d_ptr->m_editorToProperty.keys());
1412  delete d_ptr;
1413 }
1414 
1415 /*!
1416  \internal
1417 
1418  Reimplemented from the QtAbstractEditorFactory class.
1419 */
1420 void
1422 {
1423  connect(manager,
1424  SIGNAL(valueChanged(QtProperty*, const QString&)),
1425  this,
1426  SLOT(slotPropertyChanged(QtProperty*, const QString&)));
1427  connect(manager,
1428  SIGNAL(regExpChanged(QtProperty*, const QRegExp&)),
1429  this,
1430  SLOT(slotRegExpChanged(QtProperty*, const QRegExp&)));
1431  connect(manager,
1432  SIGNAL(echoModeChanged(QtProperty*, int)),
1433  this,
1434  SLOT(slotEchoModeChanged(QtProperty*, int)));
1435  connect(manager,
1436  SIGNAL(readOnlyChanged(QtProperty*, bool)),
1437  this,
1438  SLOT(slotReadOnlyChanged(QtProperty*, bool)));
1439 }
1440 
1441 /*!
1442  \internal
1443 
1444  Reimplemented from the QtAbstractEditorFactory class.
1445 */
1446 QWidget*
1448  QtProperty* property,
1449  QWidget* parent)
1450 {
1451 
1452  QLineEdit* editor = d_ptr->createEditor(property, parent);
1453  editor->setEchoMode((EchoMode)manager->echoMode(property));
1454  editor->setReadOnly(manager->isReadOnly(property));
1455  QRegExp regExp = manager->regExp(property);
1456 
1457  if (regExp.isValid())
1458  {
1459  QValidator* validator = new QRegExpValidator(regExp, editor);
1460  editor->setValidator(validator);
1461  }
1462 
1463  editor->setText(manager->value(property));
1464 
1465  connect(editor, SIGNAL(textChanged(const QString&)), this, SLOT(slotSetValue(const QString&)));
1466  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
1467  return editor;
1468 }
1469 
1470 /*!
1471  \internal
1472 
1473  Reimplemented from the QtAbstractEditorFactory class.
1474 */
1475 void
1477 {
1478  disconnect(manager,
1479  SIGNAL(valueChanged(QtProperty*, const QString&)),
1480  this,
1481  SLOT(slotPropertyChanged(QtProperty*, const QString&)));
1482  disconnect(manager,
1483  SIGNAL(regExpChanged(QtProperty*, const QRegExp&)),
1484  this,
1485  SLOT(slotRegExpChanged(QtProperty*, const QRegExp&)));
1486  disconnect(manager,
1487  SIGNAL(echoModeChanged(QtProperty*, int)),
1488  this,
1489  SLOT(slotEchoModeChanged(QtProperty*, int)));
1490  disconnect(manager,
1491  SIGNAL(readOnlyChanged(QtProperty*, bool)),
1492  this,
1493  SLOT(slotReadOnlyChanged(QtProperty*, bool)));
1494 }
1495 
1496 // QtDateEditFactory
1497 
1499 {
1500  QtDateEditFactory* q_ptr;
1501  Q_DECLARE_PUBLIC(QtDateEditFactory)
1502 public:
1503  void slotPropertyChanged(QtProperty* property, const QDate& value);
1504  void slotRangeChanged(QtProperty* property, const QDate& min, const QDate& max);
1505  void slotSetValue(const QDate& value);
1506 };
1507 
1508 void
1510 {
1511  if (!m_createdEditors.contains(property))
1512  {
1513  return;
1514  }
1515 
1516  QListIterator<QDateEdit*> itEditor(m_createdEditors[property]);
1517 
1518  while (itEditor.hasNext())
1519  {
1520  QDateEdit* editor = itEditor.next();
1521  editor->blockSignals(true);
1522  editor->setDate(value);
1523  editor->blockSignals(false);
1524  }
1525 }
1526 
1527 void
1528 QtDateEditFactoryPrivate::slotRangeChanged(QtProperty* property, const QDate& min, const QDate& max)
1529 {
1530  if (!m_createdEditors.contains(property))
1531  {
1532  return;
1533  }
1534 
1535  QtDatePropertyManager* manager = q_ptr->propertyManager(property);
1536 
1537  if (!manager)
1538  {
1539  return;
1540  }
1541 
1542  QListIterator<QDateEdit*> itEditor(m_createdEditors[property]);
1543 
1544  while (itEditor.hasNext())
1545  {
1546  QDateEdit* editor = itEditor.next();
1547  editor->blockSignals(true);
1548  editor->setDateRange(min, max);
1549  editor->setDate(manager->value(property));
1550  editor->blockSignals(false);
1551  }
1552 }
1553 
1554 void
1556 {
1557  QObject* object = q_ptr->sender();
1558  const QMap<QDateEdit*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
1559 
1560  for (QMap<QDateEdit*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
1561  itEditor != ecend;
1562  ++itEditor)
1563  if (itEditor.key() == object)
1564  {
1565  QtProperty* property = itEditor.value();
1566  QtDatePropertyManager* manager = q_ptr->propertyManager(property);
1567 
1568  if (!manager)
1569  {
1570  return;
1571  }
1572 
1573  manager->setValue(property, value);
1574  return;
1575  }
1576 }
1577 
1578 /*!
1579  \class QtDateEditFactory
1580 
1581  \brief The QtDateEditFactory class provides QDateEdit widgets for
1582  properties created by QtDatePropertyManager objects.
1583 
1584  \sa QtAbstractEditorFactory, QtDatePropertyManager
1585 */
1586 
1587 /*!
1588  Creates a factory with the given \a parent.
1589 */
1592 {
1593  d_ptr = new QtDateEditFactoryPrivate();
1594  d_ptr->q_ptr = this;
1595 }
1596 
1597 /*!
1598  Destroys this factory, and all the widgets it has created.
1599 */
1601 {
1602  qDeleteAll(d_ptr->m_editorToProperty.keys());
1603  delete d_ptr;
1604 }
1605 
1606 /*!
1607  \internal
1608 
1609  Reimplemented from the QtAbstractEditorFactory class.
1610 */
1611 void
1613 {
1614  connect(manager,
1615  SIGNAL(valueChanged(QtProperty*, const QDate&)),
1616  this,
1617  SLOT(slotPropertyChanged(QtProperty*, const QDate&)));
1618  connect(manager,
1619  SIGNAL(rangeChanged(QtProperty*, const QDate&, const QDate&)),
1620  this,
1621  SLOT(slotRangeChanged(QtProperty*, const QDate&, const QDate&)));
1622 }
1623 
1624 /*!
1625  \internal
1626 
1627  Reimplemented from the QtAbstractEditorFactory class.
1628 */
1629 QWidget*
1631  QtProperty* property,
1632  QWidget* parent)
1633 {
1634  QDateEdit* editor = d_ptr->createEditor(property, parent);
1635  editor->setCalendarPopup(true);
1636  editor->setDateRange(manager->minimum(property), manager->maximum(property));
1637  editor->setDate(manager->value(property));
1638 
1639  connect(editor, SIGNAL(dateChanged(const QDate&)), this, SLOT(slotSetValue(const QDate&)));
1640  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
1641  return editor;
1642 }
1643 
1644 /*!
1645  \internal
1646 
1647  Reimplemented from the QtAbstractEditorFactory class.
1648 */
1649 void
1651 {
1652  disconnect(manager,
1653  SIGNAL(valueChanged(QtProperty*, const QDate&)),
1654  this,
1655  SLOT(slotPropertyChanged(QtProperty*, const QDate&)));
1656  disconnect(manager,
1657  SIGNAL(rangeChanged(QtProperty*, const QDate&, const QDate&)),
1658  this,
1659  SLOT(slotRangeChanged(QtProperty*, const QDate&, const QDate&)));
1660 }
1661 
1662 // QtTimeEditFactory
1663 
1665 {
1666  QtTimeEditFactory* q_ptr;
1667  Q_DECLARE_PUBLIC(QtTimeEditFactory)
1668 public:
1669  void slotPropertyChanged(QtProperty* property, const QTime& value);
1670  void slotSetValue(const QTime& value);
1671 };
1672 
1673 void
1675 {
1676  if (!m_createdEditors.contains(property))
1677  {
1678  return;
1679  }
1680 
1681  QListIterator<QTimeEdit*> itEditor(m_createdEditors[property]);
1682 
1683  while (itEditor.hasNext())
1684  {
1685  QTimeEdit* editor = itEditor.next();
1686  editor->blockSignals(true);
1687  editor->setTime(value);
1688  editor->blockSignals(false);
1689  }
1690 }
1691 
1692 void
1694 {
1695  QObject* object = q_ptr->sender();
1696  const QMap<QTimeEdit*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
1697 
1698  for (QMap<QTimeEdit*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
1699  itEditor != ecend;
1700  ++itEditor)
1701  if (itEditor.key() == object)
1702  {
1703  QtProperty* property = itEditor.value();
1704  QtTimePropertyManager* manager = q_ptr->propertyManager(property);
1705 
1706  if (!manager)
1707  {
1708  return;
1709  }
1710 
1711  manager->setValue(property, value);
1712  return;
1713  }
1714 }
1715 
1716 /*!
1717  \class QtTimeEditFactory
1718 
1719  \brief The QtTimeEditFactory class provides QTimeEdit widgets for
1720  properties created by QtTimePropertyManager objects.
1721 
1722  \sa QtAbstractEditorFactory, QtTimePropertyManager
1723 */
1724 
1725 /*!
1726  Creates a factory with the given \a parent.
1727 */
1730 {
1731  d_ptr = new QtTimeEditFactoryPrivate();
1732  d_ptr->q_ptr = this;
1733 }
1734 
1735 /*!
1736  Destroys this factory, and all the widgets it has created.
1737 */
1739 {
1740  qDeleteAll(d_ptr->m_editorToProperty.keys());
1741  delete d_ptr;
1742 }
1743 
1744 /*!
1745  \internal
1746 
1747  Reimplemented from the QtAbstractEditorFactory class.
1748 */
1749 void
1751 {
1752  connect(manager,
1753  SIGNAL(valueChanged(QtProperty*, const QTime&)),
1754  this,
1755  SLOT(slotPropertyChanged(QtProperty*, const QTime&)));
1756 }
1757 
1758 /*!
1759  \internal
1760 
1761  Reimplemented from the QtAbstractEditorFactory class.
1762 */
1763 QWidget*
1765  QtProperty* property,
1766  QWidget* parent)
1767 {
1768  QTimeEdit* editor = d_ptr->createEditor(property, parent);
1769  editor->setTime(manager->value(property));
1770 
1771  connect(editor, SIGNAL(timeChanged(const QTime&)), this, SLOT(slotSetValue(const QTime&)));
1772  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
1773  return editor;
1774 }
1775 
1776 /*!
1777  \internal
1778 
1779  Reimplemented from the QtAbstractEditorFactory class.
1780 */
1781 void
1783 {
1784  disconnect(manager,
1785  SIGNAL(valueChanged(QtProperty*, const QTime&)),
1786  this,
1787  SLOT(slotPropertyChanged(QtProperty*, const QTime&)));
1788 }
1789 
1790 // QtDateTimeEditFactory
1791 
1793 {
1794  QtDateTimeEditFactory* q_ptr;
1795  Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
1796 public:
1797  void slotPropertyChanged(QtProperty* property, const QDateTime& value);
1798  void slotSetValue(const QDateTime& value);
1799 };
1800 
1801 void
1803 {
1804  if (!m_createdEditors.contains(property))
1805  {
1806  return;
1807  }
1808 
1809  QListIterator<QDateTimeEdit*> itEditor(m_createdEditors[property]);
1810 
1811  while (itEditor.hasNext())
1812  {
1813  QDateTimeEdit* editor = itEditor.next();
1814  editor->blockSignals(true);
1815  editor->setDateTime(value);
1816  editor->blockSignals(false);
1817  }
1818 }
1819 
1820 void
1822 {
1823  QObject* object = q_ptr->sender();
1824  const QMap<QDateTimeEdit*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
1825 
1826  for (QMap<QDateTimeEdit*, QtProperty*>::ConstIterator itEditor =
1827  m_editorToProperty.constBegin();
1828  itEditor != ecend;
1829  ++itEditor)
1830  if (itEditor.key() == object)
1831  {
1832  QtProperty* property = itEditor.value();
1833  QtDateTimePropertyManager* manager = q_ptr->propertyManager(property);
1834 
1835  if (!manager)
1836  {
1837  return;
1838  }
1839 
1840  manager->setValue(property, value);
1841  return;
1842  }
1843 }
1844 
1845 /*!
1846  \class QtDateTimeEditFactory
1847 
1848  \brief The QtDateTimeEditFactory class provides QDateTimeEdit
1849  widgets for properties created by QtDateTimePropertyManager objects.
1850 
1851  \sa QtAbstractEditorFactory, QtDateTimePropertyManager
1852 */
1853 
1854 /*!
1855  Creates a factory with the given \a parent.
1856 */
1859 {
1860  d_ptr = new QtDateTimeEditFactoryPrivate();
1861  d_ptr->q_ptr = this;
1862 }
1863 
1864 /*!
1865  Destroys this factory, and all the widgets it has created.
1866 */
1868 {
1869  qDeleteAll(d_ptr->m_editorToProperty.keys());
1870  delete d_ptr;
1871 }
1872 
1873 /*!
1874  \internal
1875 
1876  Reimplemented from the QtAbstractEditorFactory class.
1877 */
1878 void
1880 {
1881  connect(manager,
1882  SIGNAL(valueChanged(QtProperty*, const QDateTime&)),
1883  this,
1884  SLOT(slotPropertyChanged(QtProperty*, const QDateTime&)));
1885 }
1886 
1887 /*!
1888  \internal
1889 
1890  Reimplemented from the QtAbstractEditorFactory class.
1891 */
1892 QWidget*
1894  QtProperty* property,
1895  QWidget* parent)
1896 {
1897  QDateTimeEdit* editor = d_ptr->createEditor(property, parent);
1898  editor->setDateTime(manager->value(property));
1899 
1900  connect(editor,
1901  SIGNAL(dateTimeChanged(const QDateTime&)),
1902  this,
1903  SLOT(slotSetValue(const QDateTime&)));
1904  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
1905  return editor;
1906 }
1907 
1908 /*!
1909  \internal
1910 
1911  Reimplemented from the QtAbstractEditorFactory class.
1912 */
1913 void
1915 {
1916  disconnect(manager,
1917  SIGNAL(valueChanged(QtProperty*, const QDateTime&)),
1918  this,
1919  SLOT(slotPropertyChanged(QtProperty*, const QDateTime&)));
1920 }
1921 
1922 // QtKeySequenceEditorFactory
1923 
1925 {
1927  Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
1928 public:
1929  void slotPropertyChanged(QtProperty* property, const QKeySequence& value);
1930  void slotSetValue(const QKeySequence& value);
1931 };
1932 
1933 void
1935  const QKeySequence& value)
1936 {
1937  if (!m_createdEditors.contains(property))
1938  {
1939  return;
1940  }
1941 
1942  QListIterator<QtKeySequenceEdit*> itEditor(m_createdEditors[property]);
1943 
1944  while (itEditor.hasNext())
1945  {
1946  QtKeySequenceEdit* editor = itEditor.next();
1947  editor->blockSignals(true);
1948  editor->setKeySequence(value);
1949  editor->blockSignals(false);
1950  }
1951 }
1952 
1953 void
1955 {
1956  QObject* object = q_ptr->sender();
1957  const QMap<QtKeySequenceEdit*, QtProperty*>::ConstIterator ecend =
1958  m_editorToProperty.constEnd();
1959 
1960  for (QMap<QtKeySequenceEdit*, QtProperty*>::ConstIterator itEditor =
1961  m_editorToProperty.constBegin();
1962  itEditor != ecend;
1963  ++itEditor)
1964  if (itEditor.key() == object)
1965  {
1966  QtProperty* property = itEditor.value();
1967  QtKeySequencePropertyManager* manager = q_ptr->propertyManager(property);
1968 
1969  if (!manager)
1970  {
1971  return;
1972  }
1973 
1974  manager->setValue(property, value);
1975  return;
1976  }
1977 }
1978 
1979 /*!
1980  \class QtKeySequenceEditorFactory
1981 
1982  \brief The QtKeySequenceEditorFactory class provides editor
1983  widgets for properties created by QtKeySequencePropertyManager objects.
1984 
1985  \sa QtAbstractEditorFactory
1986 */
1987 
1988 /*!
1989  Creates a factory with the given \a parent.
1990 */
1993 {
1994  d_ptr = new QtKeySequenceEditorFactoryPrivate();
1995  d_ptr->q_ptr = this;
1996 }
1997 
1998 /*!
1999  Destroys this factory, and all the widgets it has created.
2000 */
2002 {
2003  qDeleteAll(d_ptr->m_editorToProperty.keys());
2004  delete d_ptr;
2005 }
2006 
2007 /*!
2008  \internal
2009 
2010  Reimplemented from the QtAbstractEditorFactory class.
2011 */
2012 void
2014 {
2015  connect(manager,
2016  SIGNAL(valueChanged(QtProperty*, const QKeySequence&)),
2017  this,
2018  SLOT(slotPropertyChanged(QtProperty*, const QKeySequence&)));
2019 }
2020 
2021 /*!
2022  \internal
2023 
2024  Reimplemented from the QtAbstractEditorFactory class.
2025 */
2026 QWidget*
2028  QtProperty* property,
2029  QWidget* parent)
2030 {
2031  QtKeySequenceEdit* editor = d_ptr->createEditor(property, parent);
2032  editor->setKeySequence(manager->value(property));
2033 
2034  connect(editor,
2035  SIGNAL(keySequenceChanged(const QKeySequence&)),
2036  this,
2037  SLOT(slotSetValue(const QKeySequence&)));
2038  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
2039  return editor;
2040 }
2041 
2042 /*!
2043  \internal
2044 
2045  Reimplemented from the QtAbstractEditorFactory class.
2046 */
2047 void
2049 {
2050  disconnect(manager,
2051  SIGNAL(valueChanged(QtProperty*, const QKeySequence&)),
2052  this,
2053  SLOT(slotPropertyChanged(QtProperty*, const QKeySequence&)));
2054 }
2055 
2056 // QtCharEdit
2057 
2058 class QtCharEdit : public QWidget
2059 {
2060  Q_OBJECT
2061 public:
2062  QtCharEdit(QWidget* parent = 0);
2063 
2064  QChar value() const;
2065  bool eventFilter(QObject* o, QEvent* e) override;
2066 public Q_SLOTS:
2067  void setValue(const QChar& value);
2068 Q_SIGNALS:
2069  void valueChanged(const QChar& value);
2070 
2071 protected:
2072  void focusInEvent(QFocusEvent* e) override;
2073  void focusOutEvent(QFocusEvent* e) override;
2074  void keyPressEvent(QKeyEvent* e) override;
2075  void keyReleaseEvent(QKeyEvent* e) override;
2076  void paintEvent(QPaintEvent*) override;
2077  bool event(QEvent* e) override;
2078 private slots:
2079  void slotClearChar();
2080 
2081 private:
2082  void handleKeyEvent(QKeyEvent* e);
2083 
2084  QChar m_value;
2085  QLineEdit* m_lineEdit;
2086 };
2087 
2088 QtCharEdit::QtCharEdit(QWidget* parent) : QWidget(parent), m_lineEdit(new QLineEdit(this))
2089 {
2090  QHBoxLayout* layout = new QHBoxLayout(this);
2091  layout->addWidget(m_lineEdit);
2092  layout->setMargin(0);
2093  m_lineEdit->installEventFilter(this);
2094  m_lineEdit->setReadOnly(true);
2095  m_lineEdit->setFocusProxy(this);
2096  setFocusPolicy(m_lineEdit->focusPolicy());
2097  setAttribute(Qt::WA_InputMethodEnabled);
2098 }
2099 
2100 bool
2101 QtCharEdit::eventFilter(QObject* o, QEvent* e)
2102 {
2103  if (o == m_lineEdit && e->type() == QEvent::ContextMenu)
2104  {
2105  QContextMenuEvent* c = static_cast<QContextMenuEvent*>(e);
2106  QMenu* menu = m_lineEdit->createStandardContextMenu();
2107  QList<QAction*> actions = menu->actions();
2108  QListIterator<QAction*> itAction(actions);
2109 
2110  while (itAction.hasNext())
2111  {
2112  QAction* action = itAction.next();
2113  action->setShortcut(QKeySequence());
2114  QString actionString = action->text();
2115  const int pos = actionString.lastIndexOf(QLatin1Char('\t'));
2116 
2117  if (pos > 0)
2118  {
2119  actionString = actionString.remove(pos, actionString.length() - pos);
2120  }
2121 
2122  action->setText(actionString);
2123  }
2124 
2125  QAction* actionBefore = 0;
2126 
2127  if (actions.count() > 0)
2128  {
2129  actionBefore = actions[0];
2130  }
2131 
2132  QAction* clearAction = new QAction(tr("Clear Char"), menu);
2133  menu->insertAction(actionBefore, clearAction);
2134  menu->insertSeparator(actionBefore);
2135  clearAction->setEnabled(!m_value.isNull());
2136  connect(clearAction, SIGNAL(triggered()), this, SLOT(slotClearChar()));
2137  menu->exec(c->globalPos());
2138  delete menu;
2139  e->accept();
2140  return true;
2141  }
2142 
2143  return QWidget::eventFilter(o, e);
2144 }
2145 
2146 void
2147 QtCharEdit::slotClearChar()
2148 {
2149  if (m_value.isNull())
2150  {
2151  return;
2152  }
2153 
2154  setValue(QChar());
2155  emit valueChanged(m_value);
2156 }
2157 
2158 void
2159 QtCharEdit::handleKeyEvent(QKeyEvent* e)
2160 {
2161  const int key = e->key();
2162 
2163  switch (key)
2164  {
2165  case Qt::Key_Control:
2166  case Qt::Key_Shift:
2167  case Qt::Key_Meta:
2168  case Qt::Key_Alt:
2169  case Qt::Key_Super_L:
2170  case Qt::Key_Return:
2171  return;
2172 
2173  default:
2174  break;
2175  }
2176 
2177  const QString text = e->text();
2178 
2179  if (text.count() != 1)
2180  {
2181  return;
2182  }
2183 
2184  const QChar c = text.at(0);
2185 
2186  if (!c.isPrint())
2187  {
2188  return;
2189  }
2190 
2191  if (m_value == c)
2192  {
2193  return;
2194  }
2195 
2196  m_value = c;
2197  const QString str = m_value.isNull() ? QString() : QString(m_value);
2198  m_lineEdit->setText(str);
2199  e->accept();
2200  emit valueChanged(m_value);
2201 }
2202 
2203 void
2205 {
2206  if (value == m_value)
2207  {
2208  return;
2209  }
2210 
2211  m_value = value;
2212  QString str = value.isNull() ? QString() : QString(value);
2213  m_lineEdit->setText(str);
2214 }
2215 
2216 QChar
2218 {
2219  return m_value;
2220 }
2221 
2222 void
2224 {
2225  m_lineEdit->event(e);
2226  m_lineEdit->selectAll();
2227  QWidget::focusInEvent(e);
2228 }
2229 
2230 void
2232 {
2233  m_lineEdit->event(e);
2234  QWidget::focusOutEvent(e);
2235 }
2236 
2237 void
2239 {
2240  handleKeyEvent(e);
2241  e->accept();
2242 }
2243 
2244 void
2246 {
2247  m_lineEdit->event(e);
2248 }
2249 
2250 void
2252 {
2253  QStyleOption opt;
2254  opt.init(this);
2255  QPainter p(this);
2256  style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
2257 }
2258 
2259 bool
2261 {
2262  switch (e->type())
2263  {
2264  case QEvent::Shortcut:
2265  case QEvent::ShortcutOverride:
2266  case QEvent::KeyRelease:
2267  e->accept();
2268  return true;
2269 
2270  default:
2271  break;
2272  }
2273 
2274  return QWidget::event(e);
2275 }
2276 
2277 // QtCharEditorFactory
2278 
2280 {
2281  QtCharEditorFactory* q_ptr;
2282  Q_DECLARE_PUBLIC(QtCharEditorFactory)
2283 public:
2284  void slotPropertyChanged(QtProperty* property, const QChar& value);
2285  void slotSetValue(const QChar& value);
2286 };
2287 
2288 void
2290 {
2291  if (!m_createdEditors.contains(property))
2292  {
2293  return;
2294  }
2295 
2296  QListIterator<QtCharEdit*> itEditor(m_createdEditors[property]);
2297 
2298  while (itEditor.hasNext())
2299  {
2300  QtCharEdit* editor = itEditor.next();
2301  editor->blockSignals(true);
2302  editor->setValue(value);
2303  editor->blockSignals(false);
2304  }
2305 }
2306 
2307 void
2309 {
2310  QObject* object = q_ptr->sender();
2311  const QMap<QtCharEdit*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
2312 
2313  for (QMap<QtCharEdit*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
2314  itEditor != ecend;
2315  ++itEditor)
2316  if (itEditor.key() == object)
2317  {
2318  QtProperty* property = itEditor.value();
2319  QtCharPropertyManager* manager = q_ptr->propertyManager(property);
2320 
2321  if (!manager)
2322  {
2323  return;
2324  }
2325 
2326  manager->setValue(property, value);
2327  return;
2328  }
2329 }
2330 
2331 /*!
2332  \class QtCharEditorFactory
2333 
2334  \brief The QtCharEditorFactory class provides editor
2335  widgets for properties created by QtCharPropertyManager objects.
2336 
2337  \sa QtAbstractEditorFactory
2338 */
2339 
2340 /*!
2341  Creates a factory with the given \a parent.
2342 */
2345 {
2346  d_ptr = new QtCharEditorFactoryPrivate();
2347  d_ptr->q_ptr = this;
2348 }
2349 
2350 /*!
2351  Destroys this factory, and all the widgets it has created.
2352 */
2354 {
2355  qDeleteAll(d_ptr->m_editorToProperty.keys());
2356  delete d_ptr;
2357 }
2358 
2359 /*!
2360  \internal
2361 
2362  Reimplemented from the QtAbstractEditorFactory class.
2363 */
2364 void
2366 {
2367  connect(manager,
2368  SIGNAL(valueChanged(QtProperty*, const QChar&)),
2369  this,
2370  SLOT(slotPropertyChanged(QtProperty*, const QChar&)));
2371 }
2372 
2373 /*!
2374  \internal
2375 
2376  Reimplemented from the QtAbstractEditorFactory class.
2377 */
2378 QWidget*
2380  QtProperty* property,
2381  QWidget* parent)
2382 {
2383  QtCharEdit* editor = d_ptr->createEditor(property, parent);
2384  editor->setValue(manager->value(property));
2385 
2386  connect(editor, SIGNAL(valueChanged(const QChar&)), this, SLOT(slotSetValue(const QChar&)));
2387  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
2388  return editor;
2389 }
2390 
2391 /*!
2392  \internal
2393 
2394  Reimplemented from the QtAbstractEditorFactory class.
2395 */
2396 void
2398 {
2399  disconnect(manager,
2400  SIGNAL(valueChanged(QtProperty*, const QChar&)),
2401  this,
2402  SLOT(slotPropertyChanged(QtProperty*, const QChar&)));
2403 }
2404 
2405 // QtEnumEditorFactory
2406 
2408 {
2409  QtEnumEditorFactory* q_ptr;
2410  Q_DECLARE_PUBLIC(QtEnumEditorFactory)
2411 public:
2412  void slotPropertyChanged(QtProperty* property, int value);
2413  void slotEnumNamesChanged(QtProperty* property, const QStringList&);
2414  void slotEnumIconsChanged(QtProperty* property, const QMap<int, QIcon>&);
2415  void slotSetValue(int value);
2416 };
2417 
2418 void
2420 {
2421  if (!m_createdEditors.contains(property))
2422  {
2423  return;
2424  }
2425 
2426  QListIterator<QComboBox*> itEditor(m_createdEditors[property]);
2427 
2428  while (itEditor.hasNext())
2429  {
2430  QComboBox* editor = itEditor.next();
2431  editor->blockSignals(true);
2432  editor->setCurrentIndex(value);
2433  editor->blockSignals(false);
2434  }
2435 }
2436 
2437 void
2438 QtEnumEditorFactoryPrivate::slotEnumNamesChanged(QtProperty* property, const QStringList& enumNames)
2439 {
2440  if (!m_createdEditors.contains(property))
2441  {
2442  return;
2443  }
2444 
2445  QtEnumPropertyManager* manager = q_ptr->propertyManager(property);
2446 
2447  if (!manager)
2448  {
2449  return;
2450  }
2451 
2452  QMap<int, QIcon> enumIcons = manager->enumIcons(property);
2453 
2454  QListIterator<QComboBox*> itEditor(m_createdEditors[property]);
2455 
2456  while (itEditor.hasNext())
2457  {
2458  QComboBox* editor = itEditor.next();
2459  editor->blockSignals(true);
2460  editor->clear();
2461  editor->addItems(enumNames);
2462  const int nameCount = enumNames.count();
2463 
2464  for (int i = 0; i < nameCount; i++)
2465  {
2466  editor->setItemIcon(i, enumIcons.value(i));
2467  }
2468 
2469  editor->setCurrentIndex(manager->value(property));
2470  editor->blockSignals(false);
2471  }
2472 }
2473 
2474 void
2476  const QMap<int, QIcon>& enumIcons)
2477 {
2478  if (!m_createdEditors.contains(property))
2479  {
2480  return;
2481  }
2482 
2483  QtEnumPropertyManager* manager = q_ptr->propertyManager(property);
2484 
2485  if (!manager)
2486  {
2487  return;
2488  }
2489 
2490  const QStringList enumNames = manager->enumNames(property);
2491  QListIterator<QComboBox*> itEditor(m_createdEditors[property]);
2492 
2493  while (itEditor.hasNext())
2494  {
2495  QComboBox* editor = itEditor.next();
2496  editor->blockSignals(true);
2497  const int nameCount = enumNames.count();
2498 
2499  for (int i = 0; i < nameCount; i++)
2500  {
2501  editor->setItemIcon(i, enumIcons.value(i));
2502  }
2503 
2504  editor->setCurrentIndex(manager->value(property));
2505  editor->blockSignals(false);
2506  }
2507 }
2508 
2509 void
2511 {
2512  QObject* object = q_ptr->sender();
2513  const QMap<QComboBox*, QtProperty*>::ConstIterator ecend = m_editorToProperty.constEnd();
2514 
2515  for (QMap<QComboBox*, QtProperty*>::ConstIterator itEditor = m_editorToProperty.constBegin();
2516  itEditor != ecend;
2517  ++itEditor)
2518  if (itEditor.key() == object)
2519  {
2520  QtProperty* property = itEditor.value();
2521  QtEnumPropertyManager* manager = q_ptr->propertyManager(property);
2522 
2523  if (!manager)
2524  {
2525  return;
2526  }
2527 
2528  manager->setValue(property, value);
2529  return;
2530  }
2531 }
2532 
2533 /*!
2534  \class QtEnumEditorFactory
2535 
2536  \brief The QtEnumEditorFactory class provides QComboBox widgets for
2537  properties created by QtEnumPropertyManager objects.
2538 
2539  \sa QtAbstractEditorFactory, QtEnumPropertyManager
2540 */
2541 
2542 /*!
2543  Creates a factory with the given \a parent.
2544 */
2547 {
2548  d_ptr = new QtEnumEditorFactoryPrivate();
2549  d_ptr->q_ptr = this;
2550 }
2551 
2552 /*!
2553  Destroys this factory, and all the widgets it has created.
2554 */
2556 {
2557  qDeleteAll(d_ptr->m_editorToProperty.keys());
2558  delete d_ptr;
2559 }
2560 
2561 /*!
2562  \internal
2563 
2564  Reimplemented from the QtAbstractEditorFactory class.
2565 */
2566 void
2568 {
2569  connect(manager,
2570  SIGNAL(valueChanged(QtProperty*, int)),
2571  this,
2572  SLOT(slotPropertyChanged(QtProperty*, int)));
2573  connect(manager,
2574  SIGNAL(enumNamesChanged(QtProperty*, const QStringList&)),
2575  this,
2576  SLOT(slotEnumNamesChanged(QtProperty*, const QStringList&)));
2577 }
2578 
2579 /*!
2580  \internal
2581 
2582  Reimplemented from the QtAbstractEditorFactory class.
2583 */
2584 QWidget*
2586  QtProperty* property,
2587  QWidget* parent)
2588 {
2589  QComboBox* editor = d_ptr->createEditor(property, parent);
2590  editor->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLengthWithIcon);
2591  editor->setMinimumContentsLength(1);
2592  editor->view()->setTextElideMode(Qt::ElideRight);
2593  QStringList enumNames = manager->enumNames(property);
2594  editor->addItems(enumNames);
2595  QMap<int, QIcon> enumIcons = manager->enumIcons(property);
2596  const int enumNamesCount = enumNames.count();
2597 
2598  for (int i = 0; i < enumNamesCount; i++)
2599  {
2600  editor->setItemIcon(i, enumIcons.value(i));
2601  }
2602 
2603  editor->setCurrentIndex(manager->value(property));
2604 
2605  connect(editor, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSetValue(int)));
2606  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
2607  return editor;
2608 }
2609 
2610 /*!
2611  \internal
2612 
2613  Reimplemented from the QtAbstractEditorFactory class.
2614 */
2615 void
2617 {
2618  disconnect(manager,
2619  SIGNAL(valueChanged(QtProperty*, int)),
2620  this,
2621  SLOT(slotPropertyChanged(QtProperty*, int)));
2622  disconnect(manager,
2623  SIGNAL(enumNamesChanged(QtProperty*, const QStringList&)),
2624  this,
2625  SLOT(slotEnumNamesChanged(QtProperty*, const QStringList&)));
2626 }
2627 
2628 // QtCursorEditorFactory
2629 
2630 Q_GLOBAL_STATIC(QtCursorDatabase, cursorDatabase)
2631 
2633 {
2634  QtCursorEditorFactory* q_ptr;
2635  Q_DECLARE_PUBLIC(QtCursorEditorFactory)
2636 public:
2638 
2639  void slotPropertyChanged(QtProperty* property, const QCursor& cursor);
2640  void slotEnumChanged(QtProperty* property, int value);
2641  void slotEditorDestroyed(QObject* object);
2642 
2645 
2646  QMap<QtProperty*, QtProperty*> m_propertyToEnum;
2647  QMap<QtProperty*, QtProperty*> m_enumToProperty;
2648  QMap<QtProperty*, QList<QWidget*>> m_enumToEditors;
2649  QMap<QWidget*, QtProperty*> m_editorToEnum;
2651 };
2652 
2654 {
2655 }
2656 
2657 void
2659 {
2660  // update enum property
2661  QtProperty* enumProp = m_propertyToEnum.value(property);
2662 
2663  if (!enumProp)
2664  {
2665  return;
2666  }
2667 
2668  m_updatingEnum = true;
2669  m_enumPropertyManager->setValue(enumProp, cursorDatabase()->cursorToValue(cursor));
2670  m_updatingEnum = false;
2671 }
2672 
2673 void
2675 {
2676  if (m_updatingEnum)
2677  {
2678  return;
2679  }
2680 
2681  // update cursor property
2682  QtProperty* prop = m_enumToProperty.value(property);
2683 
2684  if (!prop)
2685  {
2686  return;
2687  }
2688 
2689  QtCursorPropertyManager* cursorManager = q_ptr->propertyManager(prop);
2690 
2691  if (!cursorManager)
2692  {
2693  return;
2694  }
2695 
2696 #ifndef QT_NO_CURSOR
2697  cursorManager->setValue(prop, QCursor(cursorDatabase()->valueToCursor(value)));
2698 #endif
2699 }
2700 
2701 void
2703 {
2704  // remove from m_editorToEnum map;
2705  // remove from m_enumToEditors map;
2706  // if m_enumToEditors doesn't contains more editors delete enum property;
2707  const QMap<QWidget*, QtProperty*>::ConstIterator ecend = m_editorToEnum.constEnd();
2708 
2709  for (QMap<QWidget*, QtProperty*>::ConstIterator itEditor = m_editorToEnum.constBegin();
2710  itEditor != ecend;
2711  ++itEditor)
2712  if (itEditor.key() == object)
2713  {
2714  QWidget* editor = itEditor.key();
2715  QtProperty* enumProp = itEditor.value();
2716  m_editorToEnum.remove(editor);
2717  m_enumToEditors[enumProp].removeAll(editor);
2718 
2719  if (m_enumToEditors[enumProp].isEmpty())
2720  {
2721  m_enumToEditors.remove(enumProp);
2722  QtProperty* property = m_enumToProperty.value(enumProp);
2723  m_enumToProperty.remove(enumProp);
2724  m_propertyToEnum.remove(property);
2725  delete enumProp;
2726  }
2727 
2728  return;
2729  }
2730 }
2731 
2732 /*!
2733  \class QtCursorEditorFactory
2734 
2735  \brief The QtCursorEditorFactory class provides QComboBox widgets for
2736  properties created by QtCursorPropertyManager objects.
2737 
2738  \sa QtAbstractEditorFactory, QtCursorPropertyManager
2739 */
2740 
2741 /*!
2742  Creates a factory with the given \a parent.
2743 */
2746 {
2747  d_ptr = new QtCursorEditorFactoryPrivate();
2748  d_ptr->q_ptr = this;
2749 
2750  d_ptr->m_enumEditorFactory = new QtEnumEditorFactory(this);
2751  d_ptr->m_enumPropertyManager = new QtEnumPropertyManager(this);
2752  connect(d_ptr->m_enumPropertyManager,
2753  SIGNAL(valueChanged(QtProperty*, int)),
2754  this,
2755  SLOT(slotEnumChanged(QtProperty*, int)));
2757 }
2758 
2759 /*!
2760  Destroys this factory, and all the widgets it has created.
2761 */
2763 {
2764  delete d_ptr;
2765 }
2766 
2767 /*!
2768  \internal
2769 
2770  Reimplemented from the QtAbstractEditorFactory class.
2771 */
2772 void
2774 {
2775  connect(manager,
2776  SIGNAL(valueChanged(QtProperty*, const QCursor&)),
2777  this,
2778  SLOT(slotPropertyChanged(QtProperty*, const QCursor&)));
2779 }
2780 
2781 /*!
2782  \internal
2783 
2784  Reimplemented from the QtAbstractEditorFactory class.
2785 */
2786 QWidget*
2788  QtProperty* property,
2789  QWidget* parent)
2790 {
2791  QtProperty* enumProp = 0;
2792 
2793  if (d_ptr->m_propertyToEnum.contains(property))
2794  {
2795  enumProp = d_ptr->m_propertyToEnum[property];
2796  }
2797  else
2798  {
2799  enumProp = d_ptr->m_enumPropertyManager->addProperty(property->propertyName());
2800  d_ptr->m_enumPropertyManager->setEnumNames(enumProp, cursorDatabase()->cursorShapeNames());
2801  d_ptr->m_enumPropertyManager->setEnumIcons(enumProp, cursorDatabase()->cursorShapeIcons());
2802 #ifndef QT_NO_CURSOR
2804  enumProp, cursorDatabase()->cursorToValue(manager->value(property)));
2805 #endif
2806  d_ptr->m_propertyToEnum[property] = enumProp;
2807  d_ptr->m_enumToProperty[enumProp] = property;
2808  }
2809 
2811  QWidget* editor = af->createEditor(enumProp, parent);
2812  d_ptr->m_enumToEditors[enumProp].append(editor);
2813  d_ptr->m_editorToEnum[editor] = enumProp;
2814  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
2815  return editor;
2816 }
2817 
2818 /*!
2819  \internal
2820 
2821  Reimplemented from the QtAbstractEditorFactory class.
2822 */
2823 void
2825 {
2826  disconnect(manager,
2827  SIGNAL(valueChanged(QtProperty*, const QCursor&)),
2828  this,
2829  SLOT(slotPropertyChanged(QtProperty*, const QCursor&)));
2830 }
2831 
2832 // QtColorEditWidget
2833 
2834 class QtColorEditWidget : public QWidget
2835 {
2836  Q_OBJECT
2837 
2838 public:
2839  QtColorEditWidget(QWidget* parent);
2840 
2841  bool eventFilter(QObject* obj, QEvent* ev) override;
2842 
2843 public Q_SLOTS:
2844  void setValue(const QColor& value);
2845 
2846 Q_SIGNALS:
2847  void valueChanged(const QColor& value);
2848 
2849 protected:
2850  void paintEvent(QPaintEvent*) override;
2851 
2852 private Q_SLOTS:
2853  void buttonClicked();
2854 
2855 private:
2856  QColor m_color;
2857  QLabel* m_pixmapLabel;
2858  QLabel* m_label;
2859  QToolButton* m_button;
2860 };
2861 
2863  QWidget(parent), m_pixmapLabel(new QLabel), m_label(new QLabel), m_button(new QToolButton)
2864 {
2865  QHBoxLayout* lt = new QHBoxLayout(this);
2866  setupTreeViewEditorMargin(lt);
2867  lt->setSpacing(0);
2868  lt->addWidget(m_pixmapLabel);
2869  lt->addWidget(m_label);
2870  lt->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
2871 
2872  m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
2873  m_button->setFixedWidth(20);
2874  setFocusProxy(m_button);
2875  setFocusPolicy(m_button->focusPolicy());
2876  m_button->setText(tr("..."));
2877  m_button->installEventFilter(this);
2878  connect(m_button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
2879  lt->addWidget(m_button);
2880  m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::brushValuePixmap(QBrush(m_color)));
2881  m_label->setText(QtPropertyBrowserUtils::colorValueText(m_color));
2882 }
2883 
2884 void
2886 {
2887  if (m_color != c)
2888  {
2889  m_color = c;
2890  m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::brushValuePixmap(QBrush(c)));
2891  m_label->setText(QtPropertyBrowserUtils::colorValueText(c));
2892  }
2893 }
2894 
2895 void
2896 QtColorEditWidget::buttonClicked()
2897 {
2898  bool ok = false;
2899  QRgb oldRgba = m_color.rgba();
2900  QRgb newRgba = QColorDialog::getRgba(oldRgba, &ok, this);
2901 
2902  if (ok && newRgba != oldRgba)
2903  {
2904  setValue(QColor::fromRgba(newRgba));
2905  emit valueChanged(m_color);
2906  }
2907 }
2908 
2909 bool
2910 QtColorEditWidget::eventFilter(QObject* obj, QEvent* ev)
2911 {
2912  if (obj == m_button)
2913  {
2914  switch (ev->type())
2915  {
2916  case QEvent::KeyPress:
2917  case QEvent::
2918  KeyRelease: // Prevent the QToolButton from handling Enter/Escape meant control the delegate
2919  {
2920  switch (static_cast<const QKeyEvent*>(ev)->key())
2921  {
2922  case Qt::Key_Escape:
2923  case Qt::Key_Enter:
2924  case Qt::Key_Return:
2925  ev->ignore();
2926  return true;
2927 
2928  default:
2929  break;
2930  }
2931  }
2932  break;
2933 
2934  default:
2935  break;
2936  }
2937  }
2938 
2939  return QWidget::eventFilter(obj, ev);
2940 }
2941 
2942 void
2944 {
2945  QStyleOption opt;
2946  opt.init(this);
2947  QPainter p(this);
2948  style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
2949 }
2950 
2951 // QtColorEditorFactoryPrivate
2952 
2953 class QtColorEditorFactoryPrivate : public EditorFactoryPrivate<QtColorEditWidget>
2954 {
2955  QtColorEditorFactory* q_ptr;
2956  Q_DECLARE_PUBLIC(QtColorEditorFactory)
2957 public:
2958  void slotPropertyChanged(QtProperty* property, const QColor& value);
2959  void slotSetValue(const QColor& value);
2960 };
2961 
2962 void
2964 {
2965  const PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
2966 
2967  if (it == m_createdEditors.end())
2968  {
2969  return;
2970  }
2971 
2972  QListIterator<QtColorEditWidget*> itEditor(it.value());
2973 
2974  while (itEditor.hasNext())
2975  {
2976  itEditor.next()->setValue(value);
2977  }
2978 }
2979 
2980 void
2982 {
2983  QObject* object = q_ptr->sender();
2984  const EditorToPropertyMap::ConstIterator ecend = m_editorToProperty.constEnd();
2985 
2986  for (EditorToPropertyMap::ConstIterator itEditor = m_editorToProperty.constBegin();
2987  itEditor != ecend;
2988  ++itEditor)
2989  if (itEditor.key() == object)
2990  {
2991  QtProperty* property = itEditor.value();
2992  QtColorPropertyManager* manager = q_ptr->propertyManager(property);
2993 
2994  if (!manager)
2995  {
2996  return;
2997  }
2998 
2999  manager->setValue(property, value);
3000  return;
3001  }
3002 }
3003 
3004 /*!
3005  \class QtColorEditorFactory
3006 
3007  \brief The QtColorEditorFactory class provides color editing for
3008  properties created by QtColorPropertyManager objects.
3009 
3010  \sa QtAbstractEditorFactory, QtColorPropertyManager
3011 */
3012 
3013 /*!
3014  Creates a factory with the given \a parent.
3015 */
3018  d_ptr(new QtColorEditorFactoryPrivate())
3019 {
3020  d_ptr->q_ptr = this;
3021 }
3022 
3023 /*!
3024  Destroys this factory, and all the widgets it has created.
3025 */
3027 {
3028  qDeleteAll(d_ptr->m_editorToProperty.keys());
3029  delete d_ptr;
3030 }
3031 
3032 /*!
3033  \internal
3034 
3035  Reimplemented from the QtAbstractEditorFactory class.
3036 */
3037 void
3039 {
3040  connect(manager,
3041  SIGNAL(valueChanged(QtProperty*, QColor)),
3042  this,
3043  SLOT(slotPropertyChanged(QtProperty*, QColor)));
3044 }
3045 
3046 /*!
3047  \internal
3048 
3049  Reimplemented from the QtAbstractEditorFactory class.
3050 */
3051 QWidget*
3053  QtProperty* property,
3054  QWidget* parent)
3055 {
3056  QtColorEditWidget* editor = d_ptr->createEditor(property, parent);
3057  editor->setValue(manager->value(property));
3058  connect(editor, SIGNAL(valueChanged(QColor)), this, SLOT(slotSetValue(QColor)));
3059  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
3060  return editor;
3061 }
3062 
3063 /*!
3064  \internal
3065 
3066  Reimplemented from the QtAbstractEditorFactory class.
3067 */
3068 void
3070 {
3071  disconnect(manager,
3072  SIGNAL(valueChanged(QtProperty*, QColor)),
3073  this,
3074  SLOT(slotPropertyChanged(QtProperty*, QColor)));
3075 }
3076 
3077 // QtFontEditWidget
3078 
3079 class QtFontEditWidget : public QWidget
3080 {
3081  Q_OBJECT
3082 
3083 public:
3084  QtFontEditWidget(QWidget* parent);
3085 
3086  bool eventFilter(QObject* obj, QEvent* ev) override;
3087 
3088 public Q_SLOTS:
3089  void setValue(const QFont& value);
3090 
3091 Q_SIGNALS:
3092  void valueChanged(const QFont& value);
3093 
3094 protected:
3095  void paintEvent(QPaintEvent*) override;
3096 
3097 private Q_SLOTS:
3098  void buttonClicked();
3099 
3100 private:
3101  QFont m_font;
3102  QLabel* m_pixmapLabel;
3103  QLabel* m_label;
3104  QToolButton* m_button;
3105 };
3106 
3108  QWidget(parent), m_pixmapLabel(new QLabel), m_label(new QLabel), m_button(new QToolButton)
3109 {
3110  QHBoxLayout* lt = new QHBoxLayout(this);
3111  setupTreeViewEditorMargin(lt);
3112  lt->setSpacing(0);
3113  lt->addWidget(m_pixmapLabel);
3114  lt->addWidget(m_label);
3115  lt->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
3116 
3117  m_button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored);
3118  m_button->setFixedWidth(20);
3119  setFocusProxy(m_button);
3120  setFocusPolicy(m_button->focusPolicy());
3121  m_button->setText(tr("..."));
3122  m_button->installEventFilter(this);
3123  connect(m_button, SIGNAL(clicked()), this, SLOT(buttonClicked()));
3124  lt->addWidget(m_button);
3125  m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::fontValuePixmap(m_font));
3126  m_label->setText(QtPropertyBrowserUtils::fontValueText(m_font));
3127 }
3128 
3129 void
3131 {
3132  if (m_font != f)
3133  {
3134  m_font = f;
3135  m_pixmapLabel->setPixmap(QtPropertyBrowserUtils::fontValuePixmap(f));
3136  m_label->setText(QtPropertyBrowserUtils::fontValueText(f));
3137  }
3138 }
3139 
3140 void
3141 QtFontEditWidget::buttonClicked()
3142 {
3143  bool ok = false;
3144  QFont newFont = QFontDialog::getFont(&ok, m_font, this, tr("Select Font"));
3145 
3146  if (ok && newFont != m_font)
3147  {
3148  QFont f = m_font;
3149 
3150  // prevent mask for unchanged attributes, don't change other attributes (like kerning, etc...)
3151  if (m_font.family() != newFont.family())
3152  {
3153  f.setFamily(newFont.family());
3154  }
3155 
3156  if (m_font.pointSize() != newFont.pointSize())
3157  {
3158  f.setPointSize(newFont.pointSize());
3159  }
3160 
3161  if (m_font.bold() != newFont.bold())
3162  {
3163  f.setBold(newFont.bold());
3164  }
3165 
3166  if (m_font.italic() != newFont.italic())
3167  {
3168  f.setItalic(newFont.italic());
3169  }
3170 
3171  if (m_font.underline() != newFont.underline())
3172  {
3173  f.setUnderline(newFont.underline());
3174  }
3175 
3176  if (m_font.strikeOut() != newFont.strikeOut())
3177  {
3178  f.setStrikeOut(newFont.strikeOut());
3179  }
3180 
3181  setValue(f);
3182  emit valueChanged(m_font);
3183  }
3184 }
3185 
3186 bool
3187 QtFontEditWidget::eventFilter(QObject* obj, QEvent* ev)
3188 {
3189  if (obj == m_button)
3190  {
3191  switch (ev->type())
3192  {
3193  case QEvent::KeyPress:
3194  case QEvent::
3195  KeyRelease: // Prevent the QToolButton from handling Enter/Escape meant control the delegate
3196  {
3197  switch (static_cast<const QKeyEvent*>(ev)->key())
3198  {
3199  case Qt::Key_Escape:
3200  case Qt::Key_Enter:
3201  case Qt::Key_Return:
3202  ev->ignore();
3203  return true;
3204 
3205  default:
3206  break;
3207  }
3208  }
3209  break;
3210 
3211  default:
3212  break;
3213  }
3214  }
3215 
3216  return QWidget::eventFilter(obj, ev);
3217 }
3218 
3219 void
3221 {
3222  QStyleOption opt;
3223  opt.init(this);
3224  QPainter p(this);
3225  style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
3226 }
3227 
3228 // QtFontEditorFactoryPrivate
3229 
3230 class QtFontEditorFactoryPrivate : public EditorFactoryPrivate<QtFontEditWidget>
3231 {
3232  QtFontEditorFactory* q_ptr;
3233  Q_DECLARE_PUBLIC(QtFontEditorFactory)
3234 public:
3235  void slotPropertyChanged(QtProperty* property, const QFont& value);
3236  void slotSetValue(const QFont& value);
3237 };
3238 
3239 void
3241 {
3242  const PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
3243 
3244  if (it == m_createdEditors.end())
3245  {
3246  return;
3247  }
3248 
3249  QListIterator<QtFontEditWidget*> itEditor(it.value());
3250 
3251  while (itEditor.hasNext())
3252  {
3253  itEditor.next()->setValue(value);
3254  }
3255 }
3256 
3257 void
3259 {
3260  QObject* object = q_ptr->sender();
3261  const EditorToPropertyMap::ConstIterator ecend = m_editorToProperty.constEnd();
3262 
3263  for (EditorToPropertyMap::ConstIterator itEditor = m_editorToProperty.constBegin();
3264  itEditor != ecend;
3265  ++itEditor)
3266  if (itEditor.key() == object)
3267  {
3268  QtProperty* property = itEditor.value();
3269  QtFontPropertyManager* manager = q_ptr->propertyManager(property);
3270 
3271  if (!manager)
3272  {
3273  return;
3274  }
3275 
3276  manager->setValue(property, value);
3277  return;
3278  }
3279 }
3280 
3281 /*!
3282  \class QtFontEditorFactory
3283 
3284  \brief The QtFontEditorFactory class provides font editing for
3285  properties created by QtFontPropertyManager objects.
3286 
3287  \sa QtAbstractEditorFactory, QtFontPropertyManager
3288 */
3289 
3290 /*!
3291  Creates a factory with the given \a parent.
3292 */
3295 {
3296  d_ptr->q_ptr = this;
3297 }
3298 
3299 /*!
3300  Destroys this factory, and all the widgets it has created.
3301 */
3303 {
3304  qDeleteAll(d_ptr->m_editorToProperty.keys());
3305  delete d_ptr;
3306 }
3307 
3308 /*!
3309  \internal
3310 
3311  Reimplemented from the QtAbstractEditorFactory class.
3312 */
3313 void
3315 {
3316  connect(manager,
3317  SIGNAL(valueChanged(QtProperty*, QFont)),
3318  this,
3319  SLOT(slotPropertyChanged(QtProperty*, QFont)));
3320 }
3321 
3322 /*!
3323  \internal
3324 
3325  Reimplemented from the QtAbstractEditorFactory class.
3326 */
3327 QWidget*
3329  QtProperty* property,
3330  QWidget* parent)
3331 {
3332  QtFontEditWidget* editor = d_ptr->createEditor(property, parent);
3333  editor->setValue(manager->value(property));
3334  connect(editor, SIGNAL(valueChanged(QFont)), this, SLOT(slotSetValue(QFont)));
3335  connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*)));
3336  return editor;
3337 }
3338 
3339 /*!
3340  \internal
3341 
3342  Reimplemented from the QtAbstractEditorFactory class.
3343 */
3344 void
3346 {
3347  disconnect(manager,
3348  SIGNAL(valueChanged(QtProperty*, QFont)),
3349  this,
3350  SLOT(slotPropertyChanged(QtProperty*, QFont)));
3351 }
3352 
3353 QT_END_NAMESPACE
3354 
3355 #include "moc_qteditorfactory.cpp"
3356 #include "qteditorfactory.moc"
QtSliderFactory::QtSliderFactory
QtSliderFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:518
QtCharPropertyManager::value
QChar value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2991
QtKeySequenceEditorFactoryPrivate
Definition: qteditorfactory.cpp:1924
QtCheckBoxFactory::disconnectPropertyManager
void disconnectPropertyManager(QtBoolPropertyManager *manager) override
Definition: qteditorfactory.cpp:942
QtCharEdit::event
bool event(QEvent *e) override
Definition: qteditorfactory.cpp:2260
QtColorEditorFactory::connectPropertyManager
void connectPropertyManager(QtColorPropertyManager *manager) override
Definition: qteditorfactory.cpp:3038
QtSpinBoxFactoryPrivate::slotSingleStepChanged
void slotSingleStepChanged(QtProperty *property, int step)
Definition: qteditorfactory.cpp:232
QtCursorEditorFactoryPrivate
Definition: qteditorfactory.cpp:2632
QtSpinBoxFactoryPrivate
Definition: qteditorfactory.cpp:169
QtEnumPropertyManager::enumIcons
QMap< int, QIcon > enumIcons(const QtProperty *property) const
Definition: qtpropertymanager.cpp:6041
QtFontEditWidget::valueChanged
void valueChanged(const QFont &value)
str
std::string str(const T &t)
Definition: UserAssistedSegmenterGuiWidgetController.cpp:43
QtDoubleSpinBoxFactoryPrivate
Definition: qteditorfactory.cpp:956
QtColorEditWidget::setValue
void setValue(const QColor &value)
Definition: qteditorfactory.cpp:2885
QtBoolEdit
Definition: qtpropertybrowserutils_p.h:99
QtDateTimeEditFactoryPrivate::slotSetValue
void slotSetValue(const QDateTime &value)
Definition: qteditorfactory.cpp:1821
QtLineEditFactory::~QtLineEditFactory
~QtLineEditFactory() override
Definition: qteditorfactory.cpp:1409
QtAbstractPropertyManager::addProperty
QtProperty * addProperty(const QString &name=QString())
Definition: qtpropertybrowser.cpp:860
QtIntPropertyManager::value
int value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:986
QtIntPropertyManager
The QtIntPropertyManager provides and manages int properties.
Definition: qtpropertymanager.h:71
EditorFactoryPrivate::slotEditorDestroyed
void slotEditorDestroyed(QObject *object)
Definition: qteditorfactory.cpp:137
EditorFactoryPrivate::createEditor
Editor * createEditor(QtProperty *property, QWidget *parent)
Definition: qteditorfactory.cpp:113
QtSpinBoxFactory::disconnectPropertyManager
void disconnectPropertyManager(QtIntPropertyManager *manager) override
Definition: qteditorfactory.cpp:382
QtSliderFactoryPrivate::slotRangeChanged
void slotRangeChanged(QtProperty *property, int min, int max)
Definition: qteditorfactory.cpp:435
QtScrollBarFactory::disconnectPropertyManager
void disconnectPropertyManager(QtIntPropertyManager *manager) override
Definition: qteditorfactory.cpp:775
qtpropertybrowserutils_p.h
QtColorEditWidget::eventFilter
bool eventFilter(QObject *obj, QEvent *ev) override
Definition: qteditorfactory.cpp:2910
QtBoolPropertyManager::textVisible
bool textVisible(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2144
QtIntPropertyManager::isReadOnly
bool isReadOnly(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1035
QtDateTimeEditFactory::disconnectPropertyManager
void disconnectPropertyManager(QtDateTimePropertyManager *manager) override
Definition: qteditorfactory.cpp:1914
QtColorEditorFactory
The QtColorEditorFactory class provides color editing for properties created by QtColorPropertyManage...
Definition: qteditorfactory.h:395
QtDoublePropertyManager::isReadOnly
bool isReadOnly(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1450
QtIntPropertyManager::singleStep
int singleStep(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1021
QtLineEditFactoryPrivate
Definition: qteditorfactory.cpp:1236
QtIntPropertyManager::setValue
void setValue(QtProperty *property, int val)
Definition: qtpropertymanager.cpp:1070
QtCharEdit::keyReleaseEvent
void keyReleaseEvent(QKeyEvent *e) override
Definition: qteditorfactory.cpp:2245
QtBoolPropertyManager::value
bool value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2138
EditorFactoryPrivate< QDateTimeEdit >::EditorList
QList< QDateTimeEdit * > EditorList
Definition: qteditorfactory.cpp:99
EditorFactoryPrivate::m_editorToProperty
EditorToPropertyMap m_editorToProperty
Definition: qteditorfactory.cpp:108
QtScrollBarFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, int value)
Definition: qteditorfactory.cpp:611
QtDoubleSpinBoxFactoryPrivate::slotSetValue
void slotSetValue(double value)
Definition: qteditorfactory.cpp:1098
QtDateTimeEditFactory
The QtDateTimeEditFactory class provides QDateTimeEdit widgets for properties created by QtDateTimePr...
Definition: qteditorfactory.h:266
QtScrollBarFactory::createEditor
QWidget * createEditor(QtIntPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:755
QtCharEdit::focusOutEvent
void focusOutEvent(QFocusEvent *e) override
Definition: qteditorfactory.cpp:2231
QtCharEditorFactory
The QtCharEditorFactory class provides editor widgets for properties created by QtCharPropertyManager...
Definition: qteditorfactory.h:318
QtFontPropertyManager::setValue
void setValue(QtProperty *property, const QFont &val)
Definition: qtpropertymanager.cpp:7419
QtIntPropertyManager::maximum
int maximum(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1008
QtPropertyBrowserUtils::brushValuePixmap
static QPixmap brushValuePixmap(const QBrush &b)
Definition: qtpropertybrowserutils.cpp:215
EditorFactoryPrivate
Definition: qteditorfactory.cpp:96
QtKeySequenceEditorFactory::connectPropertyManager
void connectPropertyManager(QtKeySequencePropertyManager *manager) override
Definition: qteditorfactory.cpp:2013
QtTimeEditFactory::~QtTimeEditFactory
~QtTimeEditFactory() override
Definition: qteditorfactory.cpp:1738
qteditorfactory.h
QtEnumPropertyManager::setEnumIcons
void setEnumIcons(QtProperty *property, const QMap< int, QIcon > &icons)
Definition: qtpropertymanager.cpp:6200
EditorFactoryPrivate< QDateTimeEdit >::PropertyToEditorListMap
QMap< QtProperty *, EditorList > PropertyToEditorListMap
Definition: qteditorfactory.cpp:100
QtPropertyBrowserUtils::colorValueText
static QString colorValueText(const QColor &c)
Definition: qtpropertybrowserutils.cpp:245
QtDateTimePropertyManager::value
QDateTime value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2750
QtDateEditFactoryPrivate
Definition: qteditorfactory.cpp:1498
QtBoolEdit::blockCheckBoxSignals
bool blockCheckBoxSignals(bool block)
Definition: qtpropertybrowserutils.cpp:358
QtKeySequenceEdit
Definition: qtpropertybrowserutils_p.h:133
QtDateEditFactory::createEditor
QWidget * createEditor(QtDatePropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:1630
QtEnumEditorFactory::~QtEnumEditorFactory
~QtEnumEditorFactory() override
Definition: qteditorfactory.cpp:2555
QtSliderFactoryPrivate
Definition: qteditorfactory.cpp:404
QtDateEditFactory::~QtDateEditFactory
~QtDateEditFactory() override
Definition: qteditorfactory.cpp:1600
QtCursorEditorFactory
The QtCursorEditorFactory class provides QComboBox widgets for properties created by QtCursorProperty...
Definition: qteditorfactory.h:370
QtDoubleSpinBoxFactoryPrivate::slotDecimalsChanged
void slotDecimalsChanged(QtProperty *property, int prec)
Definition: qteditorfactory.cpp:1070
QtFontEditorFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QFont &value)
Definition: qteditorfactory.cpp:3240
QtStringPropertyManager
The QtStringPropertyManager provides and manages QString properties.
Definition: qtpropertymanager.h:183
QtCharEdit::valueChanged
void valueChanged(const QChar &value)
QtFontEditorFactory::disconnectPropertyManager
void disconnectPropertyManager(QtFontPropertyManager *manager) override
Definition: qteditorfactory.cpp:3345
QtCursorEditorFactoryPrivate::m_propertyToEnum
QMap< QtProperty *, QtProperty * > m_propertyToEnum
Definition: qteditorfactory.cpp:2646
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
QtDoubleSpinBoxFactory::connectPropertyManager
void connectPropertyManager(QtDoublePropertyManager *manager) override
Definition: qteditorfactory.cpp:1157
QtDoubleSpinBoxFactory
The QtDoubleSpinBoxFactory class provides QDoubleSpinBox widgets for properties created by QtDoublePr...
Definition: qteditorfactory.h:158
QtTimeEditFactory::connectPropertyManager
void connectPropertyManager(QtTimePropertyManager *manager) override
Definition: qteditorfactory.cpp:1750
QtCheckBoxFactoryPrivate::slotTextVisibleChanged
void slotTextVisibleChanged(QtProperty *property, bool textVisible)
Definition: qteditorfactory.cpp:823
QtDoublePropertyManager::setValue
void setValue(QtProperty *property, double val)
Definition: qtpropertymanager.cpp:1485
QtCheckBoxFactory::QtCheckBoxFactory
QtCheckBoxFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:883
QtCharPropertyManager::setValue
void setValue(QtProperty *property, const QChar &val)
Definition: qtpropertymanager.cpp:3022
QtCursorEditorFactory::createEditor
QWidget * createEditor(QtCursorPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:2787
QtScrollBarFactoryPrivate
Definition: qteditorfactory.cpp:599
QtProperty
The QtProperty class encapsulates an instance of a property.
Definition: qtpropertybrowser.h:71
QtSliderFactoryPrivate::slotSetValue
void slotSetValue(int value)
Definition: qteditorfactory.cpp:481
QtTimePropertyManager
The QtTimePropertyManager provides and manages QTime properties.
Definition: qtpropertymanager.h:254
QtTimeEditFactoryPrivate::slotSetValue
void slotSetValue(const QTime &value)
Definition: qteditorfactory.cpp:1693
QtCursorPropertyManager::value
QCursor value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:8032
QtEnumEditorFactoryPrivate::slotSetValue
void slotSetValue(int value)
Definition: qteditorfactory.cpp:2510
QtColorEditorFactory::~QtColorEditorFactory
~QtColorEditorFactory() override
Definition: qteditorfactory.cpp:3026
QtColorEditWidget::paintEvent
void paintEvent(QPaintEvent *) override
Definition: qteditorfactory.cpp:2943
QtLineEditFactory::createEditor
QWidget * createEditor(QtStringPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:1447
QtKeySequenceEditorFactory::createEditor
QWidget * createEditor(QtKeySequencePropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:2027
QtCursorEditorFactoryPrivate::slotEditorDestroyed
void slotEditorDestroyed(QObject *object)
Definition: qteditorfactory.cpp:2702
QtColorEditorFactoryPrivate
Definition: qteditorfactory.cpp:2953
QtDateEditFactory::disconnectPropertyManager
void disconnectPropertyManager(QtDatePropertyManager *manager) override
Definition: qteditorfactory.cpp:1650
QtEnumPropertyManager::setEnumNames
void setEnumNames(QtProperty *property, const QStringList &names)
Definition: qtpropertymanager.cpp:6157
QtEnumEditorFactory::createEditor
QWidget * createEditor(QtEnumPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:2585
visionx::imrecman::ok
@ ok
Definition: ImageRecordingManagerInterface.ice:45
QtSpinBoxFactoryPrivate::slotSetValue
void slotSetValue(int value)
Definition: qteditorfactory.cpp:277
QtColorEditWidget::QtColorEditWidget
QtColorEditWidget(QWidget *parent)
Definition: qteditorfactory.cpp:2862
QtTimeEditFactory::QtTimeEditFactory
QtTimeEditFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:1728
QtLineEditFactory::QtLineEditFactory
QtLineEditFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:1399
QtEnumEditorFactoryPrivate
Definition: qteditorfactory.cpp:2407
QtScrollBarFactory::connectPropertyManager
void connectPropertyManager(QtIntPropertyManager *manager) override
Definition: qteditorfactory.cpp:733
QtEnumPropertyManager::setValue
void setValue(QtProperty *property, int val)
Definition: qtpropertymanager.cpp:6106
QtFontPropertyManager
The QtFontPropertyManager provides and manages QFont properties.
Definition: qtpropertymanager.h:708
QtKeySequenceEdit::setKeySequence
void setKeySequence(const QKeySequence &sequence)
Definition: qtpropertybrowserutils.cpp:516
QtCursorEditorFactoryPrivate::m_updatingEnum
bool m_updatingEnum
Definition: qteditorfactory.cpp:2650
QtEnumEditorFactoryPrivate::slotEnumNamesChanged
void slotEnumNamesChanged(QtProperty *property, const QStringList &)
Definition: qteditorfactory.cpp:2438
QtStringPropertyManager::echoMode
EchoMode echoMode(const QtProperty *property) const override
Definition: qtpropertymanager.cpp:1825
QtFontEditWidget::eventFilter
bool eventFilter(QObject *obj, QEvent *ev) override
Definition: qteditorfactory.cpp:3187
QtFontEditorFactoryPrivate::slotSetValue
void slotSetValue(const QFont &value)
Definition: qteditorfactory.cpp:3258
QtDoublePropertyManager::singleStep
double singleStep(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1424
QtDoubleSpinBoxFactory::QtDoubleSpinBoxFactory
QtDoubleSpinBoxFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:1135
QtDateTimePropertyManager::setValue
void setValue(QtProperty *property, const QDateTime &val)
Definition: qtpropertymanager.cpp:2780
QtDatePropertyManager
The QtDatePropertyManager provides and manages QDate properties.
Definition: qtpropertymanager.h:221
QtScrollBarFactoryPrivate::slotSetValue
void slotSetValue(int value)
Definition: qteditorfactory.cpp:676
QtDateTimeEditFactory::~QtDateTimeEditFactory
~QtDateTimeEditFactory() override
Definition: qteditorfactory.cpp:1867
QtPropertyBrowserUtils::fontValuePixmap
static QPixmap fontValuePixmap(const QFont &f)
Definition: qtpropertybrowserutils.cpp:255
QtFontEditWidget::QtFontEditWidget
QtFontEditWidget(QWidget *parent)
Definition: qteditorfactory.cpp:3107
EditorFactoryPrivate< QDateTimeEdit >::EditorToPropertyMap
QMap< QDateTimeEdit *, QtProperty * > EditorToPropertyMap
Definition: qteditorfactory.cpp:101
QtCursorEditorFactoryPrivate::QtCursorEditorFactoryPrivate
QtCursorEditorFactoryPrivate()
Definition: qteditorfactory.cpp:2653
QtCharEdit::eventFilter
bool eventFilter(QObject *o, QEvent *e) override
Definition: qteditorfactory.cpp:2101
QtStringPropertyManager::isReadOnly
bool isReadOnly(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1839
QtKeySequenceEditorFactory::~QtKeySequenceEditorFactory
~QtKeySequenceEditorFactory() override
Definition: qteditorfactory.cpp:2001
QtCharPropertyManager
The QtCharPropertyManager provides and manages QChar properties.
Definition: qtpropertymanager.h:335
QtScrollBarFactory
The QtScrollBarFactory class provides QScrollBar widgets for properties created by QtIntPropertyManag...
Definition: qteditorfactory.h:105
QtAbstractEditorFactoryBase
The QtAbstractEditorFactoryBase provides an interface for editor factories.
Definition: qtpropertybrowser.h:149
QtCursorDatabase
Definition: qtpropertybrowserutils_p.h:66
QtLineEditFactoryPrivate::slotSetValue
void slotSetValue(const QString &value)
Definition: qteditorfactory.cpp:1364
QtProperty::propertyName
QString propertyName() const
Definition: qtpropertybrowser.cpp:255
QtFontEditorFactory::connectPropertyManager
void connectPropertyManager(QtFontPropertyManager *manager) override
Definition: qteditorfactory.cpp:3314
QtFontEditorFactory
The QtFontEditorFactory class provides font editing for properties created by QtFontPropertyManager o...
Definition: qteditorfactory.h:420
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:855
QtAbstractEditorFactoryBase::createEditor
virtual QWidget * createEditor(QtProperty *property, QWidget *parent)=0
QtDateEditFactory::QtDateEditFactory
QtDateEditFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:1590
QtCheckBoxFactoryPrivate::slotSetValue
void slotSetValue(bool value)
Definition: qteditorfactory.cpp:847
QtSpinBoxFactory
The QtSpinBoxFactory class provides QSpinBox widgets for properties created by QtIntPropertyManager o...
Definition: qteditorfactory.h:50
QtDoubleSpinBoxFactoryPrivate::slotSingleStepChanged
void slotSingleStepChanged(QtProperty *property, double step)
Definition: qteditorfactory.cpp:1017
QtDateEditFactory
The QtDateEditFactory class provides QDateEdit widgets for properties created by QtDatePropertyManage...
Definition: qteditorfactory.h:215
QtScrollBarFactory::~QtScrollBarFactory
~QtScrollBarFactory() override
Definition: qteditorfactory.cpp:721
QtBoolEdit::setChecked
void setChecked(bool c)
Definition: qtpropertybrowserutils.cpp:345
QtKeySequenceEditorFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QKeySequence &value)
Definition: qteditorfactory.cpp:1934
QtCursorEditorFactoryPrivate::m_enumPropertyManager
QtEnumPropertyManager * m_enumPropertyManager
Definition: qteditorfactory.cpp:2644
QtCursorEditorFactory::connectPropertyManager
void connectPropertyManager(QtCursorPropertyManager *manager) override
Definition: qteditorfactory.cpp:2773
QtCharEdit::value
QChar value() const
Definition: qteditorfactory.cpp:2217
QtEnumPropertyManager::enumNames
QStringList enumNames(const QtProperty *property) const
Definition: qtpropertymanager.cpp:6029
QtStringPropertyManager::regExp
QRegExp regExp(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1815
QtDatePropertyManager::maximum
QDate maximum(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2410
QtSliderFactory::connectPropertyManager
void connectPropertyManager(QtIntPropertyManager *manager) override
Definition: qteditorfactory.cpp:540
QtSpinBoxFactory::~QtSpinBoxFactory
~QtSpinBoxFactory() override
Definition: qteditorfactory.cpp:324
QtSliderFactory::~QtSliderFactory
~QtSliderFactory() override
Definition: qteditorfactory.cpp:528
QtCheckBoxFactory::connectPropertyManager
void connectPropertyManager(QtBoolPropertyManager *manager) override
Definition: qteditorfactory.cpp:905
QtDoubleSpinBoxFactory::createEditor
QWidget * createEditor(QtDoublePropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:1187
QtCharEditorFactory::createEditor
QWidget * createEditor(QtCharPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:2379
QtCursorEditorFactoryPrivate::m_enumToProperty
QMap< QtProperty *, QtProperty * > m_enumToProperty
Definition: qteditorfactory.cpp:2647
QtTimePropertyManager::setValue
void setValue(QtProperty *property, const QTime &val)
Definition: qtpropertymanager.cpp:2654
QtFontEditorFactory::QtFontEditorFactory
QtFontEditorFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:3293
QtDateTimeEditFactory::connectPropertyManager
void connectPropertyManager(QtDateTimePropertyManager *manager) override
Definition: qteditorfactory.cpp:1879
QtCharEditorFactoryPrivate::slotSetValue
void slotSetValue(const QChar &value)
Definition: qteditorfactory.cpp:2308
QtDoublePropertyManager
The QtDoublePropertyManager provides and manages double properties.
Definition: qtpropertymanager.h:141
QtCheckBoxFactory::createEditor
QWidget * createEditor(QtBoolPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:923
QtDateTimeEditFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QDateTime &value)
Definition: qteditorfactory.cpp:1802
QtFontEditorFactory::createEditor
QWidget * createEditor(QtFontPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:3328
QtCharEditorFactory::QtCharEditorFactory
QtCharEditorFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:2343
QtColorEditorFactory::disconnectPropertyManager
void disconnectPropertyManager(QtColorPropertyManager *manager) override
Definition: qteditorfactory.cpp:3069
QtAbstractEditorFactory
The QtAbstractEditorFactory is the base template class for editor factories.
Definition: qtpropertybrowser.h:168
QtBoolEdit::setTextVisible
void setTextVisible(bool textVisible)
Definition: qtpropertybrowserutils.cpp:307
QtBoolPropertyManager
The QtBoolPropertyManager class provides and manages boolean properties.
Definition: qtpropertymanager.h:110
QtScrollBarFactoryPrivate::slotSingleStepChanged
void slotSingleStepChanged(QtProperty *property, int step)
Definition: qteditorfactory.cpp:657
QtCharEditorFactory::connectPropertyManager
void connectPropertyManager(QtCharPropertyManager *manager) override
Definition: qteditorfactory.cpp:2365
QtPropertyBrowserUtils::fontValueText
static QString fontValueText(const QFont &f)
Definition: qtpropertybrowserutils.cpp:278
QtDateTimeEditFactory::QtDateTimeEditFactory
QtDateTimeEditFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:1857
QtDateEditFactoryPrivate::slotRangeChanged
void slotRangeChanged(QtProperty *property, const QDate &min, const QDate &max)
Definition: qteditorfactory.cpp:1528
QtBoolPropertyManager::setValue
void setValue(QtProperty *property, bool val)
Definition: qtpropertymanager.cpp:2201
QtEnumPropertyManager::value
int value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:6018
max
T max(T t1, T t2)
Definition: gdiam.h:51
QtTimeEditFactoryPrivate
Definition: qteditorfactory.cpp:1664
QtSliderFactory::createEditor
QWidget * createEditor(QtIntPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:562
QtLineEditFactory
The QtLineEditFactory class provides QLineEdit widgets for properties created by QtStringPropertyMana...
Definition: qteditorfactory.h:187
QtCursorEditorFactory::QtCursorEditorFactory
QtCursorEditorFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:2744
QtScrollBarFactory::QtScrollBarFactory
QtScrollBarFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:711
QtFontEditorFactoryPrivate
Definition: qteditorfactory.cpp:3230
QtDoubleSpinBoxFactoryPrivate::slotRangeChanged
void slotRangeChanged(QtProperty *property, double min, double max)
Definition: qteditorfactory.cpp:989
QtCursorEditorFactory::disconnectPropertyManager
void disconnectPropertyManager(QtCursorPropertyManager *manager) override
Definition: qteditorfactory.cpp:2824
QtSpinBoxFactory::connectPropertyManager
void connectPropertyManager(QtIntPropertyManager *manager) override
Definition: qteditorfactory.cpp:336
QtDoubleSpinBoxFactoryPrivate::slotReadOnlyChanged
void slotReadOnlyChanged(QtProperty *property, bool readOnly)
Definition: qteditorfactory.cpp:1044
QtSpinBoxFactoryPrivate::slotReadOnlyChanged
void slotReadOnlyChanged(QtProperty *property, bool readOnly)
Definition: qteditorfactory.cpp:251
QtCharEdit::keyPressEvent
void keyPressEvent(QKeyEvent *e) override
Definition: qteditorfactory.cpp:2238
QtKeySequencePropertyManager::setValue
void setValue(QtProperty *property, const QKeySequence &val)
Definition: qtpropertymanager.cpp:2902
QtEnumEditorFactory::QtEnumEditorFactory
QtEnumEditorFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:2545
QtIntPropertyManager::minimum
int minimum(const QtProperty *property) const
Definition: qtpropertymanager.cpp:997
QtCharEditorFactory::~QtCharEditorFactory
~QtCharEditorFactory() override
Definition: qteditorfactory.cpp:2353
QtColorPropertyManager::setValue
void setValue(QtProperty *property, const QColor &val)
Definition: qtpropertymanager.cpp:7829
QtColorEditorFactoryPrivate::slotSetValue
void slotSetValue(const QColor &value)
Definition: qteditorfactory.cpp:2981
QtCursorEditorFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QCursor &cursor)
Definition: qteditorfactory.cpp:2658
QtDoubleSpinBoxFactory::disconnectPropertyManager
void disconnectPropertyManager(QtDoublePropertyManager *manager) override
Definition: qteditorfactory.cpp:1210
QtKeySequencePropertyManager::value
QKeySequence value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2872
QtDateTimePropertyManager
The QtDateTimePropertyManager provides and manages QDateTime properties.
Definition: qtpropertymanager.h:281
QtLineEditFactory::connectPropertyManager
void connectPropertyManager(QtStringPropertyManager *manager) override
Definition: qteditorfactory.cpp:1421
QtLineEditFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QString &value)
Definition: qteditorfactory.cpp:1249
QtLineEditFactory::disconnectPropertyManager
void disconnectPropertyManager(QtStringPropertyManager *manager) override
Definition: qteditorfactory.cpp:1476
QtDoublePropertyManager::value
double value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1389
QtFontEditWidget::setValue
void setValue(const QFont &value)
Definition: qteditorfactory.cpp:3130
QtCharEdit
Definition: qteditorfactory.cpp:2058
QtKeySequenceEditorFactory
The QtKeySequenceEditorFactory class provides editor widgets for properties created by QtKeySequenceP...
Definition: qteditorfactory.h:292
QtAbstractEditorFactory::propertyManager
PropertyManager * propertyManager(QtProperty *property) const
Definition: qtpropertybrowser.h:226
QtFontEditorFactory::~QtFontEditorFactory
~QtFontEditorFactory() override
Definition: qteditorfactory.cpp:3302
QtEnumEditorFactoryPrivate::slotEnumIconsChanged
void slotEnumIconsChanged(QtProperty *property, const QMap< int, QIcon > &)
Definition: qteditorfactory.cpp:2475
QtEnumEditorFactory::disconnectPropertyManager
void disconnectPropertyManager(QtEnumPropertyManager *manager) override
Definition: qteditorfactory.cpp:2616
QtStringPropertyManager::value
QString value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1801
QtCursorEditorFactoryPrivate::m_enumToEditors
QMap< QtProperty *, QList< QWidget * > > m_enumToEditors
Definition: qteditorfactory.cpp:2648
QtCursorEditorFactoryPrivate::m_enumEditorFactory
QtEnumEditorFactory * m_enumEditorFactory
Definition: qteditorfactory.cpp:2643
QtSpinBoxFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, int value)
Definition: qteditorfactory.cpp:182
QtAbstractEditorFactory::addPropertyManager
void addPropertyManager(PropertyManager *manager)
Definition: qtpropertybrowser.h:194
QtDoubleSpinBoxFactory::~QtDoubleSpinBoxFactory
~QtDoubleSpinBoxFactory() override
Definition: qteditorfactory.cpp:1145
QtEnumEditorFactory::connectPropertyManager
void connectPropertyManager(QtEnumPropertyManager *manager) override
Definition: qteditorfactory.cpp:2567
QtCursorEditorFactoryPrivate::m_editorToEnum
QMap< QWidget *, QtProperty * > m_editorToEnum
Definition: qteditorfactory.cpp:2649
QtSpinBoxFactory::createEditor
QWidget * createEditor(QtIntPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:362
QtCursorPropertyManager
The QtCursorPropertyManager provides and manages QCursor properties.
Definition: qtpropertymanager.h:778
EchoMode
QLineEdit::EchoMode EchoMode
Definition: qtpropertybrowser.h:66
QtTimeEditFactory::createEditor
QWidget * createEditor(QtTimePropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:1764
QtDateTimeEditFactory::createEditor
QWidget * createEditor(QtDateTimePropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:1893
QtColorEditorFactory::QtColorEditorFactory
QtColorEditorFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:3016
QtLineEditFactoryPrivate::slotReadOnlyChanged
void slotReadOnlyChanged(QtProperty *, bool)
Definition: qteditorfactory.cpp:1338
QtCheckBoxFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, bool value)
Definition: qteditorfactory.cpp:804
QtKeySequenceEditorFactory::disconnectPropertyManager
void disconnectPropertyManager(QtKeySequencePropertyManager *manager) override
Definition: qteditorfactory.cpp:2048
QtEnumPropertyManager
The QtEnumPropertyManager provides and manages enum properties.
Definition: qtpropertymanager.h:607
QtSliderFactory::disconnectPropertyManager
void disconnectPropertyManager(QtIntPropertyManager *manager) override
Definition: qteditorfactory.cpp:581
QtCursorPropertyManager::setValue
void setValue(QtProperty *property, const QCursor &val)
Definition: qtpropertymanager.cpp:8080
QtKeySequenceEditorFactoryPrivate::slotSetValue
void slotSetValue(const QKeySequence &value)
Definition: qteditorfactory.cpp:1954
QtCharEditorFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QChar &value)
Definition: qteditorfactory.cpp:2289
QtStringPropertyManager::setValue
void setValue(QtProperty *property, const QString &val)
Definition: qtpropertymanager.cpp:1893
QtSpinBoxFactoryPrivate::slotRangeChanged
void slotRangeChanged(QtProperty *property, int min, int max)
Definition: qteditorfactory.cpp:205
QtCheckBoxFactory
The QtCheckBoxFactory class provides QCheckBox widgets for properties created by QtBoolPropertyManage...
Definition: qteditorfactory.h:132
QtDoubleSpinBoxFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, double value)
Definition: qteditorfactory.cpp:970
QtKeySequencePropertyManager
The QtKeySequencePropertyManager provides and manages QKeySequence properties.
Definition: qtpropertymanager.h:308
QtCharEdit::setValue
void setValue(const QChar &value)
Definition: qteditorfactory.cpp:2204
QtTimeEditFactory
The QtTimeEditFactory class provides QTimeEdit widgets for properties created by QtTimePropertyManage...
Definition: qteditorfactory.h:241
QtDatePropertyManager::minimum
QDate minimum(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2399
QtCharEdit::QtCharEdit
QtCharEdit(QWidget *parent=0)
Definition: qteditorfactory.cpp:2088
QtLineEditFactoryPrivate::slotRegExpChanged
void slotRegExpChanged(QtProperty *property, const QRegExp &regExp)
Definition: qteditorfactory.cpp:1272
QtTimeEditFactory::disconnectPropertyManager
void disconnectPropertyManager(QtTimePropertyManager *manager) override
Definition: qteditorfactory.cpp:1782
QtFontEditWidget
Definition: qteditorfactory.cpp:3079
QtColorPropertyManager::value
QColor value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:7779
QtKeySequenceEditorFactory::QtKeySequenceEditorFactory
QtKeySequenceEditorFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:1991
QtDatePropertyManager::value
QDate value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2388
QtDateEditFactoryPrivate::slotSetValue
void slotSetValue(const QDate &value)
Definition: qteditorfactory.cpp:1555
QtCharEdit::paintEvent
void paintEvent(QPaintEvent *) override
Definition: qteditorfactory.cpp:2251
QtDateTimeEditFactoryPrivate
Definition: qteditorfactory.cpp:1792
QtColorEditWidget::valueChanged
void valueChanged(const QColor &value)
QtDateEditFactory::connectPropertyManager
void connectPropertyManager(QtDatePropertyManager *manager) override
Definition: qteditorfactory.cpp:1612
min
T min(T t1, T t2)
Definition: gdiam.h:44
QtFontPropertyManager::value
QFont value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:7371
QtDoublePropertyManager::decimals
int decimals(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1436
QtDoublePropertyManager::maximum
double maximum(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1411
QtSpinBoxFactory::QtSpinBoxFactory
QtSpinBoxFactory(QObject *parent=0)
Definition: qteditorfactory.cpp:314
QtSliderFactoryPrivate::slotSingleStepChanged
void slotSingleStepChanged(QtProperty *property, int step)
Definition: qteditorfactory.cpp:462
QtColorEditWidget
Definition: qteditorfactory.cpp:2834
QtCheckBoxFactory::~QtCheckBoxFactory
~QtCheckBoxFactory() override
Definition: qteditorfactory.cpp:893
QtSliderFactory
The QtSliderFactory class provides QSlider widgets for properties created by QtIntPropertyManager obj...
Definition: qteditorfactory.h:78
QtCheckBoxFactoryPrivate
Definition: qteditorfactory.cpp:793
EditorFactoryPrivate::initializeEditor
void initializeEditor(QtProperty *property, Editor *e)
Definition: qteditorfactory.cpp:122
QtDatePropertyManager::setValue
void setValue(QtProperty *property, const QDate &val)
Definition: qtpropertymanager.cpp:2444
QtColorEditorFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QColor &value)
Definition: qteditorfactory.cpp:2963
QtCursorEditorFactoryPrivate::slotEnumChanged
void slotEnumChanged(QtProperty *property, int value)
Definition: qteditorfactory.cpp:2674
QtEnumEditorFactory
The QtEnumEditorFactory class provides QComboBox widgets for properties created by QtEnumPropertyMana...
Definition: qteditorfactory.h:343
QtSliderFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, int value)
Definition: qteditorfactory.cpp:416
QtCharEditorFactory::disconnectPropertyManager
void disconnectPropertyManager(QtCharPropertyManager *manager) override
Definition: qteditorfactory.cpp:2397
QtLineEditFactoryPrivate::slotEchoModeChanged
void slotEchoModeChanged(QtProperty *, int)
Definition: qteditorfactory.cpp:1312
QtFontEditWidget::paintEvent
void paintEvent(QPaintEvent *) override
Definition: qteditorfactory.cpp:3220
QtDateEditFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QDate &value)
Definition: qteditorfactory.cpp:1509
QtScrollBarFactoryPrivate::slotRangeChanged
void slotRangeChanged(QtProperty *property, int min, int max)
Definition: qteditorfactory.cpp:630
QtColorEditorFactory::createEditor
QWidget * createEditor(QtColorPropertyManager *manager, QtProperty *property, QWidget *parent) override
Definition: qteditorfactory.cpp:3052
QtCharEditorFactoryPrivate
Definition: qteditorfactory.cpp:2279
QtCharEdit::focusInEvent
void focusInEvent(QFocusEvent *e) override
Definition: qteditorfactory.cpp:2223
QtTimePropertyManager::value
QTime value(const QtProperty *property) const
Definition: qtpropertymanager.cpp:2624
EditorFactoryPrivate::m_createdEditors
PropertyToEditorListMap m_createdEditors
Definition: qteditorfactory.cpp:107
QtTimeEditFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, const QTime &value)
Definition: qteditorfactory.cpp:1674
QtDoublePropertyManager::minimum
double minimum(const QtProperty *property) const
Definition: qtpropertymanager.cpp:1400
QtCursorEditorFactory::~QtCursorEditorFactory
~QtCursorEditorFactory() override
Definition: qteditorfactory.cpp:2762
QtEnumEditorFactoryPrivate::slotPropertyChanged
void slotPropertyChanged(QtProperty *property, int value)
Definition: qteditorfactory.cpp:2419
QtColorPropertyManager
The QtColorPropertyManager provides and manages QColor properties.
Definition: qtpropertymanager.h:746