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