246 |
246 |
247 Reimplemented from the QtAbstractEditorFactory class. |
247 Reimplemented from the QtAbstractEditorFactory class. |
248 */ |
248 */ |
249 void QtSpinBoxFactory::connectPropertyManager(QtIntPropertyManager *manager) |
249 void QtSpinBoxFactory::connectPropertyManager(QtIntPropertyManager *manager) |
250 { |
250 { |
251 connect(manager, SIGNAL(valueChanged(QtProperty *, int)), |
251 connect(manager, SIGNAL(valueChanged(QtProperty*,int)), |
252 this, SLOT(slotPropertyChanged(QtProperty *, int))); |
252 this, SLOT(slotPropertyChanged(QtProperty*,int))); |
253 connect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)), |
253 connect(manager, SIGNAL(rangeChanged(QtProperty*,int,int)), |
254 this, SLOT(slotRangeChanged(QtProperty *, int, int))); |
254 this, SLOT(slotRangeChanged(QtProperty*,int,int))); |
255 connect(manager, SIGNAL(singleStepChanged(QtProperty *, int)), |
255 connect(manager, SIGNAL(singleStepChanged(QtProperty*,int)), |
256 this, SLOT(slotSingleStepChanged(QtProperty *, int))); |
256 this, SLOT(slotSingleStepChanged(QtProperty*,int))); |
257 } |
257 } |
258 |
258 |
259 /*! |
259 /*! |
260 \internal |
260 \internal |
261 |
261 |
269 editor->setRange(manager->minimum(property), manager->maximum(property)); |
269 editor->setRange(manager->minimum(property), manager->maximum(property)); |
270 editor->setValue(manager->value(property)); |
270 editor->setValue(manager->value(property)); |
271 editor->setKeyboardTracking(false); |
271 editor->setKeyboardTracking(false); |
272 |
272 |
273 connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int))); |
273 connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int))); |
274 connect(editor, SIGNAL(destroyed(QObject *)), |
274 connect(editor, SIGNAL(destroyed(QObject*)), |
275 this, SLOT(slotEditorDestroyed(QObject *))); |
275 this, SLOT(slotEditorDestroyed(QObject*))); |
276 return editor; |
276 return editor; |
277 } |
277 } |
278 |
278 |
279 /*! |
279 /*! |
280 \internal |
280 \internal |
281 |
281 |
282 Reimplemented from the QtAbstractEditorFactory class. |
282 Reimplemented from the QtAbstractEditorFactory class. |
283 */ |
283 */ |
284 void QtSpinBoxFactory::disconnectPropertyManager(QtIntPropertyManager *manager) |
284 void QtSpinBoxFactory::disconnectPropertyManager(QtIntPropertyManager *manager) |
285 { |
285 { |
286 disconnect(manager, SIGNAL(valueChanged(QtProperty *, int)), |
286 disconnect(manager, SIGNAL(valueChanged(QtProperty*,int)), |
287 this, SLOT(slotPropertyChanged(QtProperty *, int))); |
287 this, SLOT(slotPropertyChanged(QtProperty*,int))); |
288 disconnect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)), |
288 disconnect(manager, SIGNAL(rangeChanged(QtProperty*,int,int)), |
289 this, SLOT(slotRangeChanged(QtProperty *, int, int))); |
289 this, SLOT(slotRangeChanged(QtProperty*,int,int))); |
290 disconnect(manager, SIGNAL(singleStepChanged(QtProperty *, int)), |
290 disconnect(manager, SIGNAL(singleStepChanged(QtProperty*,int)), |
291 this, SLOT(slotSingleStepChanged(QtProperty *, int))); |
291 this, SLOT(slotSingleStepChanged(QtProperty*,int))); |
292 } |
292 } |
293 |
293 |
294 // QtSliderFactory |
294 // QtSliderFactory |
295 |
295 |
296 class QtSliderFactoryPrivate : public EditorFactoryPrivate<QSlider> |
296 class QtSliderFactoryPrivate : public EditorFactoryPrivate<QSlider> |
400 |
400 |
401 Reimplemented from the QtAbstractEditorFactory class. |
401 Reimplemented from the QtAbstractEditorFactory class. |
402 */ |
402 */ |
403 void QtSliderFactory::connectPropertyManager(QtIntPropertyManager *manager) |
403 void QtSliderFactory::connectPropertyManager(QtIntPropertyManager *manager) |
404 { |
404 { |
405 connect(manager, SIGNAL(valueChanged(QtProperty *, int)), |
405 connect(manager, SIGNAL(valueChanged(QtProperty*,int)), |
406 this, SLOT(slotPropertyChanged(QtProperty *, int))); |
406 this, SLOT(slotPropertyChanged(QtProperty*,int))); |
407 connect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)), |
407 connect(manager, SIGNAL(rangeChanged(QtProperty*,int,int)), |
408 this, SLOT(slotRangeChanged(QtProperty *, int, int))); |
408 this, SLOT(slotRangeChanged(QtProperty*,int,int))); |
409 connect(manager, SIGNAL(singleStepChanged(QtProperty *, int)), |
409 connect(manager, SIGNAL(singleStepChanged(QtProperty*,int)), |
410 this, SLOT(slotSingleStepChanged(QtProperty *, int))); |
410 this, SLOT(slotSingleStepChanged(QtProperty*,int))); |
411 } |
411 } |
412 |
412 |
413 /*! |
413 /*! |
414 \internal |
414 \internal |
415 |
415 |
423 editor->setSingleStep(manager->singleStep(property)); |
423 editor->setSingleStep(manager->singleStep(property)); |
424 editor->setRange(manager->minimum(property), manager->maximum(property)); |
424 editor->setRange(manager->minimum(property), manager->maximum(property)); |
425 editor->setValue(manager->value(property)); |
425 editor->setValue(manager->value(property)); |
426 |
426 |
427 connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int))); |
427 connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int))); |
428 connect(editor, SIGNAL(destroyed(QObject *)), |
428 connect(editor, SIGNAL(destroyed(QObject*)), |
429 this, SLOT(slotEditorDestroyed(QObject *))); |
429 this, SLOT(slotEditorDestroyed(QObject*))); |
430 return editor; |
430 return editor; |
431 } |
431 } |
432 |
432 |
433 /*! |
433 /*! |
434 \internal |
434 \internal |
435 |
435 |
436 Reimplemented from the QtAbstractEditorFactory class. |
436 Reimplemented from the QtAbstractEditorFactory class. |
437 */ |
437 */ |
438 void QtSliderFactory::disconnectPropertyManager(QtIntPropertyManager *manager) |
438 void QtSliderFactory::disconnectPropertyManager(QtIntPropertyManager *manager) |
439 { |
439 { |
440 disconnect(manager, SIGNAL(valueChanged(QtProperty *, int)), |
440 disconnect(manager, SIGNAL(valueChanged(QtProperty*,int)), |
441 this, SLOT(slotPropertyChanged(QtProperty *, int))); |
441 this, SLOT(slotPropertyChanged(QtProperty*,int))); |
442 disconnect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)), |
442 disconnect(manager, SIGNAL(rangeChanged(QtProperty*,int,int)), |
443 this, SLOT(slotRangeChanged(QtProperty *, int, int))); |
443 this, SLOT(slotRangeChanged(QtProperty*,int,int))); |
444 disconnect(manager, SIGNAL(singleStepChanged(QtProperty *, int)), |
444 disconnect(manager, SIGNAL(singleStepChanged(QtProperty*,int)), |
445 this, SLOT(slotSingleStepChanged(QtProperty *, int))); |
445 this, SLOT(slotSingleStepChanged(QtProperty*,int))); |
446 } |
446 } |
447 |
447 |
448 // QtSliderFactory |
448 // QtSliderFactory |
449 |
449 |
450 class QtScrollBarFactoryPrivate : public EditorFactoryPrivate<QScrollBar> |
450 class QtScrollBarFactoryPrivate : public EditorFactoryPrivate<QScrollBar> |
554 |
554 |
555 Reimplemented from the QtAbstractEditorFactory class. |
555 Reimplemented from the QtAbstractEditorFactory class. |
556 */ |
556 */ |
557 void QtScrollBarFactory::connectPropertyManager(QtIntPropertyManager *manager) |
557 void QtScrollBarFactory::connectPropertyManager(QtIntPropertyManager *manager) |
558 { |
558 { |
559 connect(manager, SIGNAL(valueChanged(QtProperty *, int)), |
559 connect(manager, SIGNAL(valueChanged(QtProperty*,int)), |
560 this, SLOT(slotPropertyChanged(QtProperty *, int))); |
560 this, SLOT(slotPropertyChanged(QtProperty*,int))); |
561 connect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)), |
561 connect(manager, SIGNAL(rangeChanged(QtProperty*,int,int)), |
562 this, SLOT(slotRangeChanged(QtProperty *, int, int))); |
562 this, SLOT(slotRangeChanged(QtProperty*,int,int))); |
563 connect(manager, SIGNAL(singleStepChanged(QtProperty *, int)), |
563 connect(manager, SIGNAL(singleStepChanged(QtProperty*,int)), |
564 this, SLOT(slotSingleStepChanged(QtProperty *, int))); |
564 this, SLOT(slotSingleStepChanged(QtProperty*,int))); |
565 } |
565 } |
566 |
566 |
567 /*! |
567 /*! |
568 \internal |
568 \internal |
569 |
569 |
576 d_ptr->initializeEditor(property, editor); |
576 d_ptr->initializeEditor(property, editor); |
577 editor->setSingleStep(manager->singleStep(property)); |
577 editor->setSingleStep(manager->singleStep(property)); |
578 editor->setRange(manager->minimum(property), manager->maximum(property)); |
578 editor->setRange(manager->minimum(property), manager->maximum(property)); |
579 editor->setValue(manager->value(property)); |
579 editor->setValue(manager->value(property)); |
580 connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int))); |
580 connect(editor, SIGNAL(valueChanged(int)), this, SLOT(slotSetValue(int))); |
581 connect(editor, SIGNAL(destroyed(QObject *)), |
581 connect(editor, SIGNAL(destroyed(QObject*)), |
582 this, SLOT(slotEditorDestroyed(QObject *))); |
582 this, SLOT(slotEditorDestroyed(QObject*))); |
583 return editor; |
583 return editor; |
584 } |
584 } |
585 |
585 |
586 /*! |
586 /*! |
587 \internal |
587 \internal |
588 |
588 |
589 Reimplemented from the QtAbstractEditorFactory class. |
589 Reimplemented from the QtAbstractEditorFactory class. |
590 */ |
590 */ |
591 void QtScrollBarFactory::disconnectPropertyManager(QtIntPropertyManager *manager) |
591 void QtScrollBarFactory::disconnectPropertyManager(QtIntPropertyManager *manager) |
592 { |
592 { |
593 disconnect(manager, SIGNAL(valueChanged(QtProperty *, int)), |
593 disconnect(manager, SIGNAL(valueChanged(QtProperty*,int)), |
594 this, SLOT(slotPropertyChanged(QtProperty *, int))); |
594 this, SLOT(slotPropertyChanged(QtProperty*,int))); |
595 disconnect(manager, SIGNAL(rangeChanged(QtProperty *, int, int)), |
595 disconnect(manager, SIGNAL(rangeChanged(QtProperty*,int,int)), |
596 this, SLOT(slotRangeChanged(QtProperty *, int, int))); |
596 this, SLOT(slotRangeChanged(QtProperty*,int,int))); |
597 disconnect(manager, SIGNAL(singleStepChanged(QtProperty *, int)), |
597 disconnect(manager, SIGNAL(singleStepChanged(QtProperty*,int)), |
598 this, SLOT(slotSingleStepChanged(QtProperty *, int))); |
598 this, SLOT(slotSingleStepChanged(QtProperty*,int))); |
599 } |
599 } |
600 |
600 |
601 // QtCheckBoxFactory |
601 // QtCheckBoxFactory |
602 |
602 |
603 class QtCheckBoxFactoryPrivate : public EditorFactoryPrivate<QtBoolEdit> |
603 class QtCheckBoxFactoryPrivate : public EditorFactoryPrivate<QtBoolEdit> |
674 |
674 |
675 Reimplemented from the QtAbstractEditorFactory class. |
675 Reimplemented from the QtAbstractEditorFactory class. |
676 */ |
676 */ |
677 void QtCheckBoxFactory::connectPropertyManager(QtBoolPropertyManager *manager) |
677 void QtCheckBoxFactory::connectPropertyManager(QtBoolPropertyManager *manager) |
678 { |
678 { |
679 connect(manager, SIGNAL(valueChanged(QtProperty *, bool)), |
679 connect(manager, SIGNAL(valueChanged(QtProperty*,bool)), |
680 this, SLOT(slotPropertyChanged(QtProperty *, bool))); |
680 this, SLOT(slotPropertyChanged(QtProperty*,bool))); |
681 } |
681 } |
682 |
682 |
683 /*! |
683 /*! |
684 \internal |
684 \internal |
685 |
685 |
690 { |
690 { |
691 QtBoolEdit *editor = d_ptr->createEditor(property, parent); |
691 QtBoolEdit *editor = d_ptr->createEditor(property, parent); |
692 editor->setChecked(manager->value(property)); |
692 editor->setChecked(manager->value(property)); |
693 |
693 |
694 connect(editor, SIGNAL(toggled(bool)), this, SLOT(slotSetValue(bool))); |
694 connect(editor, SIGNAL(toggled(bool)), this, SLOT(slotSetValue(bool))); |
695 connect(editor, SIGNAL(destroyed(QObject *)), |
695 connect(editor, SIGNAL(destroyed(QObject*)), |
696 this, SLOT(slotEditorDestroyed(QObject *))); |
696 this, SLOT(slotEditorDestroyed(QObject*))); |
697 return editor; |
697 return editor; |
698 } |
698 } |
699 |
699 |
700 /*! |
700 /*! |
701 \internal |
701 \internal |
702 |
702 |
703 Reimplemented from the QtAbstractEditorFactory class. |
703 Reimplemented from the QtAbstractEditorFactory class. |
704 */ |
704 */ |
705 void QtCheckBoxFactory::disconnectPropertyManager(QtBoolPropertyManager *manager) |
705 void QtCheckBoxFactory::disconnectPropertyManager(QtBoolPropertyManager *manager) |
706 { |
706 { |
707 disconnect(manager, SIGNAL(valueChanged(QtProperty *, bool)), |
707 disconnect(manager, SIGNAL(valueChanged(QtProperty*,bool)), |
708 this, SLOT(slotPropertyChanged(QtProperty *, bool))); |
708 this, SLOT(slotPropertyChanged(QtProperty*,bool))); |
709 } |
709 } |
710 |
710 |
711 // QtDoubleSpinBoxFactory |
711 // QtDoubleSpinBoxFactory |
712 |
712 |
713 class QtDoubleSpinBoxFactoryPrivate : public EditorFactoryPrivate<QDoubleSpinBox> |
713 class QtDoubleSpinBoxFactoryPrivate : public EditorFactoryPrivate<QDoubleSpinBox> |
847 |
847 |
848 Reimplemented from the QtAbstractEditorFactory class. |
848 Reimplemented from the QtAbstractEditorFactory class. |
849 */ |
849 */ |
850 void QtDoubleSpinBoxFactory::connectPropertyManager(QtDoublePropertyManager *manager) |
850 void QtDoubleSpinBoxFactory::connectPropertyManager(QtDoublePropertyManager *manager) |
851 { |
851 { |
852 connect(manager, SIGNAL(valueChanged(QtProperty *, double)), |
852 connect(manager, SIGNAL(valueChanged(QtProperty*,double)), |
853 this, SLOT(slotPropertyChanged(QtProperty *, double))); |
853 this, SLOT(slotPropertyChanged(QtProperty*,double))); |
854 connect(manager, SIGNAL(rangeChanged(QtProperty *, double, double)), |
854 connect(manager, SIGNAL(rangeChanged(QtProperty*,double,double)), |
855 this, SLOT(slotRangeChanged(QtProperty *, double, double))); |
855 this, SLOT(slotRangeChanged(QtProperty*,double,double))); |
856 connect(manager, SIGNAL(singleStepChanged(QtProperty *, double)), |
856 connect(manager, SIGNAL(singleStepChanged(QtProperty*,double)), |
857 this, SLOT(slotSingleStepChanged(QtProperty *, double))); |
857 this, SLOT(slotSingleStepChanged(QtProperty*,double))); |
858 connect(manager, SIGNAL(decimalsChanged(QtProperty *, int)), |
858 connect(manager, SIGNAL(decimalsChanged(QtProperty*,int)), |
859 this, SLOT(slotDecimalsChanged(QtProperty *, int))); |
859 this, SLOT(slotDecimalsChanged(QtProperty*,int))); |
860 } |
860 } |
861 |
861 |
862 /*! |
862 /*! |
863 \internal |
863 \internal |
864 |
864 |
873 editor->setRange(manager->minimum(property), manager->maximum(property)); |
873 editor->setRange(manager->minimum(property), manager->maximum(property)); |
874 editor->setValue(manager->value(property)); |
874 editor->setValue(manager->value(property)); |
875 editor->setKeyboardTracking(false); |
875 editor->setKeyboardTracking(false); |
876 |
876 |
877 connect(editor, SIGNAL(valueChanged(double)), this, SLOT(slotSetValue(double))); |
877 connect(editor, SIGNAL(valueChanged(double)), this, SLOT(slotSetValue(double))); |
878 connect(editor, SIGNAL(destroyed(QObject *)), |
878 connect(editor, SIGNAL(destroyed(QObject*)), |
879 this, SLOT(slotEditorDestroyed(QObject *))); |
879 this, SLOT(slotEditorDestroyed(QObject*))); |
880 return editor; |
880 return editor; |
881 } |
881 } |
882 |
882 |
883 /*! |
883 /*! |
884 \internal |
884 \internal |
885 |
885 |
886 Reimplemented from the QtAbstractEditorFactory class. |
886 Reimplemented from the QtAbstractEditorFactory class. |
887 */ |
887 */ |
888 void QtDoubleSpinBoxFactory::disconnectPropertyManager(QtDoublePropertyManager *manager) |
888 void QtDoubleSpinBoxFactory::disconnectPropertyManager(QtDoublePropertyManager *manager) |
889 { |
889 { |
890 disconnect(manager, SIGNAL(valueChanged(QtProperty *, double)), |
890 disconnect(manager, SIGNAL(valueChanged(QtProperty*,double)), |
891 this, SLOT(slotPropertyChanged(QtProperty *, double))); |
891 this, SLOT(slotPropertyChanged(QtProperty*,double))); |
892 disconnect(manager, SIGNAL(rangeChanged(QtProperty *, double, double)), |
892 disconnect(manager, SIGNAL(rangeChanged(QtProperty*,double,double)), |
893 this, SLOT(slotRangeChanged(QtProperty *, double, double))); |
893 this, SLOT(slotRangeChanged(QtProperty*,double,double))); |
894 disconnect(manager, SIGNAL(singleStepChanged(QtProperty *, double)), |
894 disconnect(manager, SIGNAL(singleStepChanged(QtProperty*,double)), |
895 this, SLOT(slotSingleStepChanged(QtProperty *, double))); |
895 this, SLOT(slotSingleStepChanged(QtProperty*,double))); |
896 disconnect(manager, SIGNAL(decimalsChanged(QtProperty *, int)), |
896 disconnect(manager, SIGNAL(decimalsChanged(QtProperty*,int)), |
897 this, SLOT(slotDecimalsChanged(QtProperty *, int))); |
897 this, SLOT(slotDecimalsChanged(QtProperty*,int))); |
898 } |
898 } |
899 |
899 |
900 // QtLineEditFactory |
900 // QtLineEditFactory |
901 |
901 |
902 class QtLineEditFactoryPrivate : public EditorFactoryPrivate<QLineEdit> |
902 class QtLineEditFactoryPrivate : public EditorFactoryPrivate<QLineEdit> |
1000 |
1000 |
1001 Reimplemented from the QtAbstractEditorFactory class. |
1001 Reimplemented from the QtAbstractEditorFactory class. |
1002 */ |
1002 */ |
1003 void QtLineEditFactory::connectPropertyManager(QtStringPropertyManager *manager) |
1003 void QtLineEditFactory::connectPropertyManager(QtStringPropertyManager *manager) |
1004 { |
1004 { |
1005 connect(manager, SIGNAL(valueChanged(QtProperty *, const QString &)), |
1005 connect(manager, SIGNAL(valueChanged(QtProperty*,QString)), |
1006 this, SLOT(slotPropertyChanged(QtProperty *, const QString &))); |
1006 this, SLOT(slotPropertyChanged(QtProperty*,QString))); |
1007 connect(manager, SIGNAL(regExpChanged(QtProperty *, const QRegExp &)), |
1007 connect(manager, SIGNAL(regExpChanged(QtProperty*,QRegExp)), |
1008 this, SLOT(slotRegExpChanged(QtProperty *, const QRegExp &))); |
1008 this, SLOT(slotRegExpChanged(QtProperty*,QRegExp))); |
1009 } |
1009 } |
1010 |
1010 |
1011 /*! |
1011 /*! |
1012 \internal |
1012 \internal |
1013 |
1013 |
1023 QValidator *validator = new QRegExpValidator(regExp, editor); |
1023 QValidator *validator = new QRegExpValidator(regExp, editor); |
1024 editor->setValidator(validator); |
1024 editor->setValidator(validator); |
1025 } |
1025 } |
1026 editor->setText(manager->value(property)); |
1026 editor->setText(manager->value(property)); |
1027 |
1027 |
1028 connect(editor, SIGNAL(textEdited(const QString &)), |
1028 connect(editor, SIGNAL(textEdited(QString)), |
1029 this, SLOT(slotSetValue(const QString &))); |
1029 this, SLOT(slotSetValue(QString))); |
1030 connect(editor, SIGNAL(destroyed(QObject *)), |
1030 connect(editor, SIGNAL(destroyed(QObject*)), |
1031 this, SLOT(slotEditorDestroyed(QObject *))); |
1031 this, SLOT(slotEditorDestroyed(QObject*))); |
1032 return editor; |
1032 return editor; |
1033 } |
1033 } |
1034 |
1034 |
1035 /*! |
1035 /*! |
1036 \internal |
1036 \internal |
1037 |
1037 |
1038 Reimplemented from the QtAbstractEditorFactory class. |
1038 Reimplemented from the QtAbstractEditorFactory class. |
1039 */ |
1039 */ |
1040 void QtLineEditFactory::disconnectPropertyManager(QtStringPropertyManager *manager) |
1040 void QtLineEditFactory::disconnectPropertyManager(QtStringPropertyManager *manager) |
1041 { |
1041 { |
1042 disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QString &)), |
1042 disconnect(manager, SIGNAL(valueChanged(QtProperty*,QString)), |
1043 this, SLOT(slotPropertyChanged(QtProperty *, const QString &))); |
1043 this, SLOT(slotPropertyChanged(QtProperty*,QString))); |
1044 disconnect(manager, SIGNAL(regExpChanged(QtProperty *, const QRegExp &)), |
1044 disconnect(manager, SIGNAL(regExpChanged(QtProperty*,QRegExp)), |
1045 this, SLOT(slotRegExpChanged(QtProperty *, const QRegExp &))); |
1045 this, SLOT(slotRegExpChanged(QtProperty*,QRegExp))); |
1046 } |
1046 } |
1047 |
1047 |
1048 // QtDateEditFactory |
1048 // QtDateEditFactory |
1049 |
1049 |
1050 class QtDateEditFactoryPrivate : public EditorFactoryPrivate<QDateEdit> |
1050 class QtDateEditFactoryPrivate : public EditorFactoryPrivate<QDateEdit> |
1141 |
1141 |
1142 Reimplemented from the QtAbstractEditorFactory class. |
1142 Reimplemented from the QtAbstractEditorFactory class. |
1143 */ |
1143 */ |
1144 void QtDateEditFactory::connectPropertyManager(QtDatePropertyManager *manager) |
1144 void QtDateEditFactory::connectPropertyManager(QtDatePropertyManager *manager) |
1145 { |
1145 { |
1146 connect(manager, SIGNAL(valueChanged(QtProperty *, const QDate &)), |
1146 connect(manager, SIGNAL(valueChanged(QtProperty*,QDate)), |
1147 this, SLOT(slotPropertyChanged(QtProperty *, const QDate &))); |
1147 this, SLOT(slotPropertyChanged(QtProperty*,QDate))); |
1148 connect(manager, SIGNAL(rangeChanged(QtProperty *, const QDate &, const QDate &)), |
1148 connect(manager, SIGNAL(rangeChanged(QtProperty*,QDate,QDate)), |
1149 this, SLOT(slotRangeChanged(QtProperty *, const QDate &, const QDate &))); |
1149 this, SLOT(slotRangeChanged(QtProperty*,QDate,QDate))); |
1150 } |
1150 } |
1151 |
1151 |
1152 /*! |
1152 /*! |
1153 \internal |
1153 \internal |
1154 |
1154 |
1160 QDateEdit *editor = d_ptr->createEditor(property, parent); |
1160 QDateEdit *editor = d_ptr->createEditor(property, parent); |
1161 editor->setCalendarPopup(true); |
1161 editor->setCalendarPopup(true); |
1162 editor->setDateRange(manager->minimum(property), manager->maximum(property)); |
1162 editor->setDateRange(manager->minimum(property), manager->maximum(property)); |
1163 editor->setDate(manager->value(property)); |
1163 editor->setDate(manager->value(property)); |
1164 |
1164 |
1165 connect(editor, SIGNAL(dateChanged(const QDate &)), |
1165 connect(editor, SIGNAL(dateChanged(QDate)), |
1166 this, SLOT(slotSetValue(const QDate &))); |
1166 this, SLOT(slotSetValue(QDate))); |
1167 connect(editor, SIGNAL(destroyed(QObject *)), |
1167 connect(editor, SIGNAL(destroyed(QObject*)), |
1168 this, SLOT(slotEditorDestroyed(QObject *))); |
1168 this, SLOT(slotEditorDestroyed(QObject*))); |
1169 return editor; |
1169 return editor; |
1170 } |
1170 } |
1171 |
1171 |
1172 /*! |
1172 /*! |
1173 \internal |
1173 \internal |
1174 |
1174 |
1175 Reimplemented from the QtAbstractEditorFactory class. |
1175 Reimplemented from the QtAbstractEditorFactory class. |
1176 */ |
1176 */ |
1177 void QtDateEditFactory::disconnectPropertyManager(QtDatePropertyManager *manager) |
1177 void QtDateEditFactory::disconnectPropertyManager(QtDatePropertyManager *manager) |
1178 { |
1178 { |
1179 disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QDate &)), |
1179 disconnect(manager, SIGNAL(valueChanged(QtProperty*,QDate)), |
1180 this, SLOT(slotPropertyChanged(QtProperty *, const QDate &))); |
1180 this, SLOT(slotPropertyChanged(QtProperty*,QDate))); |
1181 disconnect(manager, SIGNAL(rangeChanged(QtProperty *, const QDate &, const QDate &)), |
1181 disconnect(manager, SIGNAL(rangeChanged(QtProperty*,QDate,QDate)), |
1182 this, SLOT(slotRangeChanged(QtProperty *, const QDate &, const QDate &))); |
1182 this, SLOT(slotRangeChanged(QtProperty*,QDate,QDate))); |
1183 } |
1183 } |
1184 |
1184 |
1185 // QtTimeEditFactory |
1185 // QtTimeEditFactory |
1186 |
1186 |
1187 class QtTimeEditFactoryPrivate : public EditorFactoryPrivate<QTimeEdit> |
1187 class QtTimeEditFactoryPrivate : public EditorFactoryPrivate<QTimeEdit> |
1272 QWidget *parent) |
1272 QWidget *parent) |
1273 { |
1273 { |
1274 QTimeEdit *editor = d_ptr->createEditor(property, parent); |
1274 QTimeEdit *editor = d_ptr->createEditor(property, parent); |
1275 editor->setTime(manager->value(property)); |
1275 editor->setTime(manager->value(property)); |
1276 |
1276 |
1277 connect(editor, SIGNAL(timeChanged(const QTime &)), |
1277 connect(editor, SIGNAL(timeChanged(QTime)), |
1278 this, SLOT(slotSetValue(const QTime &))); |
1278 this, SLOT(slotSetValue(QTime))); |
1279 connect(editor, SIGNAL(destroyed(QObject *)), |
1279 connect(editor, SIGNAL(destroyed(QObject*)), |
1280 this, SLOT(slotEditorDestroyed(QObject *))); |
1280 this, SLOT(slotEditorDestroyed(QObject*))); |
1281 return editor; |
1281 return editor; |
1282 } |
1282 } |
1283 |
1283 |
1284 /*! |
1284 /*! |
1285 \internal |
1285 \internal |
1286 |
1286 |
1287 Reimplemented from the QtAbstractEditorFactory class. |
1287 Reimplemented from the QtAbstractEditorFactory class. |
1288 */ |
1288 */ |
1289 void QtTimeEditFactory::disconnectPropertyManager(QtTimePropertyManager *manager) |
1289 void QtTimeEditFactory::disconnectPropertyManager(QtTimePropertyManager *manager) |
1290 { |
1290 { |
1291 disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QTime &)), |
1291 disconnect(manager, SIGNAL(valueChanged(QtProperty*,QTime)), |
1292 this, SLOT(slotPropertyChanged(QtProperty *, const QTime &))); |
1292 this, SLOT(slotPropertyChanged(QtProperty*,QTime))); |
1293 } |
1293 } |
1294 |
1294 |
1295 // QtDateTimeEditFactory |
1295 // QtDateTimeEditFactory |
1296 |
1296 |
1297 class QtDateTimeEditFactoryPrivate : public EditorFactoryPrivate<QDateTimeEdit> |
1297 class QtDateTimeEditFactoryPrivate : public EditorFactoryPrivate<QDateTimeEdit> |
1370 |
1370 |
1371 Reimplemented from the QtAbstractEditorFactory class. |
1371 Reimplemented from the QtAbstractEditorFactory class. |
1372 */ |
1372 */ |
1373 void QtDateTimeEditFactory::connectPropertyManager(QtDateTimePropertyManager *manager) |
1373 void QtDateTimeEditFactory::connectPropertyManager(QtDateTimePropertyManager *manager) |
1374 { |
1374 { |
1375 connect(manager, SIGNAL(valueChanged(QtProperty *, const QDateTime &)), |
1375 connect(manager, SIGNAL(valueChanged(QtProperty*,QDateTime)), |
1376 this, SLOT(slotPropertyChanged(QtProperty *, const QDateTime &))); |
1376 this, SLOT(slotPropertyChanged(QtProperty*,QDateTime))); |
1377 } |
1377 } |
1378 |
1378 |
1379 /*! |
1379 /*! |
1380 \internal |
1380 \internal |
1381 |
1381 |
1385 QtProperty *property, QWidget *parent) |
1385 QtProperty *property, QWidget *parent) |
1386 { |
1386 { |
1387 QDateTimeEdit *editor = d_ptr->createEditor(property, parent); |
1387 QDateTimeEdit *editor = d_ptr->createEditor(property, parent); |
1388 editor->setDateTime(manager->value(property)); |
1388 editor->setDateTime(manager->value(property)); |
1389 |
1389 |
1390 connect(editor, SIGNAL(dateTimeChanged(const QDateTime &)), |
1390 connect(editor, SIGNAL(dateTimeChanged(QDateTime)), |
1391 this, SLOT(slotSetValue(const QDateTime &))); |
1391 this, SLOT(slotSetValue(QDateTime))); |
1392 connect(editor, SIGNAL(destroyed(QObject *)), |
1392 connect(editor, SIGNAL(destroyed(QObject*)), |
1393 this, SLOT(slotEditorDestroyed(QObject *))); |
1393 this, SLOT(slotEditorDestroyed(QObject*))); |
1394 return editor; |
1394 return editor; |
1395 } |
1395 } |
1396 |
1396 |
1397 /*! |
1397 /*! |
1398 \internal |
1398 \internal |
1399 |
1399 |
1400 Reimplemented from the QtAbstractEditorFactory class. |
1400 Reimplemented from the QtAbstractEditorFactory class. |
1401 */ |
1401 */ |
1402 void QtDateTimeEditFactory::disconnectPropertyManager(QtDateTimePropertyManager *manager) |
1402 void QtDateTimeEditFactory::disconnectPropertyManager(QtDateTimePropertyManager *manager) |
1403 { |
1403 { |
1404 disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QDateTime &)), |
1404 disconnect(manager, SIGNAL(valueChanged(QtProperty*,QDateTime)), |
1405 this, SLOT(slotPropertyChanged(QtProperty *, const QDateTime &))); |
1405 this, SLOT(slotPropertyChanged(QtProperty*,QDateTime))); |
1406 } |
1406 } |
1407 |
1407 |
1408 // QtKeySequenceEditorFactory |
1408 // QtKeySequenceEditorFactory |
1409 |
1409 |
1410 class QtKeySequenceEditorFactoryPrivate : public EditorFactoryPrivate<QtKeySequenceEdit> |
1410 class QtKeySequenceEditorFactoryPrivate : public EditorFactoryPrivate<QtKeySequenceEdit> |
1482 |
1482 |
1483 Reimplemented from the QtAbstractEditorFactory class. |
1483 Reimplemented from the QtAbstractEditorFactory class. |
1484 */ |
1484 */ |
1485 void QtKeySequenceEditorFactory::connectPropertyManager(QtKeySequencePropertyManager *manager) |
1485 void QtKeySequenceEditorFactory::connectPropertyManager(QtKeySequencePropertyManager *manager) |
1486 { |
1486 { |
1487 connect(manager, SIGNAL(valueChanged(QtProperty *, const QKeySequence &)), |
1487 connect(manager, SIGNAL(valueChanged(QtProperty*,QKeySequence)), |
1488 this, SLOT(slotPropertyChanged(QtProperty *, const QKeySequence &))); |
1488 this, SLOT(slotPropertyChanged(QtProperty*,QKeySequence))); |
1489 } |
1489 } |
1490 |
1490 |
1491 /*! |
1491 /*! |
1492 \internal |
1492 \internal |
1493 |
1493 |
1497 QtProperty *property, QWidget *parent) |
1497 QtProperty *property, QWidget *parent) |
1498 { |
1498 { |
1499 QtKeySequenceEdit *editor = d_ptr->createEditor(property, parent); |
1499 QtKeySequenceEdit *editor = d_ptr->createEditor(property, parent); |
1500 editor->setKeySequence(manager->value(property)); |
1500 editor->setKeySequence(manager->value(property)); |
1501 |
1501 |
1502 connect(editor, SIGNAL(keySequenceChanged(const QKeySequence &)), |
1502 connect(editor, SIGNAL(keySequenceChanged(QKeySequence)), |
1503 this, SLOT(slotSetValue(const QKeySequence &))); |
1503 this, SLOT(slotSetValue(QKeySequence))); |
1504 connect(editor, SIGNAL(destroyed(QObject *)), |
1504 connect(editor, SIGNAL(destroyed(QObject*)), |
1505 this, SLOT(slotEditorDestroyed(QObject *))); |
1505 this, SLOT(slotEditorDestroyed(QObject*))); |
1506 return editor; |
1506 return editor; |
1507 } |
1507 } |
1508 |
1508 |
1509 /*! |
1509 /*! |
1510 \internal |
1510 \internal |
1511 |
1511 |
1512 Reimplemented from the QtAbstractEditorFactory class. |
1512 Reimplemented from the QtAbstractEditorFactory class. |
1513 */ |
1513 */ |
1514 void QtKeySequenceEditorFactory::disconnectPropertyManager(QtKeySequencePropertyManager *manager) |
1514 void QtKeySequenceEditorFactory::disconnectPropertyManager(QtKeySequencePropertyManager *manager) |
1515 { |
1515 { |
1516 disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QKeySequence &)), |
1516 disconnect(manager, SIGNAL(valueChanged(QtProperty*,QKeySequence)), |
1517 this, SLOT(slotPropertyChanged(QtProperty *, const QKeySequence &))); |
1517 this, SLOT(slotPropertyChanged(QtProperty*,QKeySequence))); |
1518 } |
1518 } |
1519 |
1519 |
1520 // QtCharEdit |
1520 // QtCharEdit |
1521 |
1521 |
1522 class QtCharEdit : public QWidget |
1522 class QtCharEdit : public QWidget |
1779 QtProperty *property, QWidget *parent) |
1779 QtProperty *property, QWidget *parent) |
1780 { |
1780 { |
1781 QtCharEdit *editor = d_ptr->createEditor(property, parent); |
1781 QtCharEdit *editor = d_ptr->createEditor(property, parent); |
1782 editor->setValue(manager->value(property)); |
1782 editor->setValue(manager->value(property)); |
1783 |
1783 |
1784 connect(editor, SIGNAL(valueChanged(const QChar &)), |
1784 connect(editor, SIGNAL(valueChanged(QChar)), |
1785 this, SLOT(slotSetValue(const QChar &))); |
1785 this, SLOT(slotSetValue(QChar))); |
1786 connect(editor, SIGNAL(destroyed(QObject *)), |
1786 connect(editor, SIGNAL(destroyed(QObject*)), |
1787 this, SLOT(slotEditorDestroyed(QObject *))); |
1787 this, SLOT(slotEditorDestroyed(QObject*))); |
1788 return editor; |
1788 return editor; |
1789 } |
1789 } |
1790 |
1790 |
1791 /*! |
1791 /*! |
1792 \internal |
1792 \internal |
1793 |
1793 |
1794 Reimplemented from the QtAbstractEditorFactory class. |
1794 Reimplemented from the QtAbstractEditorFactory class. |
1795 */ |
1795 */ |
1796 void QtCharEditorFactory::disconnectPropertyManager(QtCharPropertyManager *manager) |
1796 void QtCharEditorFactory::disconnectPropertyManager(QtCharPropertyManager *manager) |
1797 { |
1797 { |
1798 disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QChar &)), |
1798 disconnect(manager, SIGNAL(valueChanged(QtProperty*,QChar)), |
1799 this, SLOT(slotPropertyChanged(QtProperty *, const QChar &))); |
1799 this, SLOT(slotPropertyChanged(QtProperty*,QChar))); |
1800 } |
1800 } |
1801 |
1801 |
1802 // QtEnumEditorFactory |
1802 // QtEnumEditorFactory |
1803 |
1803 |
1804 class QtEnumEditorFactoryPrivate : public EditorFactoryPrivate<QComboBox> |
1804 class QtEnumEditorFactoryPrivate : public EditorFactoryPrivate<QComboBox> |
1926 |
1926 |
1927 Reimplemented from the QtAbstractEditorFactory class. |
1927 Reimplemented from the QtAbstractEditorFactory class. |
1928 */ |
1928 */ |
1929 void QtEnumEditorFactory::connectPropertyManager(QtEnumPropertyManager *manager) |
1929 void QtEnumEditorFactory::connectPropertyManager(QtEnumPropertyManager *manager) |
1930 { |
1930 { |
1931 connect(manager, SIGNAL(valueChanged(QtProperty *, int)), |
1931 connect(manager, SIGNAL(valueChanged(QtProperty*,int)), |
1932 this, SLOT(slotPropertyChanged(QtProperty *, int))); |
1932 this, SLOT(slotPropertyChanged(QtProperty*,int))); |
1933 connect(manager, SIGNAL(enumNamesChanged(QtProperty *, const QStringList &)), |
1933 connect(manager, SIGNAL(enumNamesChanged(QtProperty*,QStringList)), |
1934 this, SLOT(slotEnumNamesChanged(QtProperty *, const QStringList &))); |
1934 this, SLOT(slotEnumNamesChanged(QtProperty*,QStringList))); |
1935 } |
1935 } |
1936 |
1936 |
1937 /*! |
1937 /*! |
1938 \internal |
1938 \internal |
1939 |
1939 |
1952 for (int i = 0; i < enumNamesCount; i++) |
1952 for (int i = 0; i < enumNamesCount; i++) |
1953 editor->setItemIcon(i, enumIcons.value(i)); |
1953 editor->setItemIcon(i, enumIcons.value(i)); |
1954 editor->setCurrentIndex(manager->value(property)); |
1954 editor->setCurrentIndex(manager->value(property)); |
1955 |
1955 |
1956 connect(editor, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSetValue(int))); |
1956 connect(editor, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSetValue(int))); |
1957 connect(editor, SIGNAL(destroyed(QObject *)), |
1957 connect(editor, SIGNAL(destroyed(QObject*)), |
1958 this, SLOT(slotEditorDestroyed(QObject *))); |
1958 this, SLOT(slotEditorDestroyed(QObject*))); |
1959 return editor; |
1959 return editor; |
1960 } |
1960 } |
1961 |
1961 |
1962 /*! |
1962 /*! |
1963 \internal |
1963 \internal |
1964 |
1964 |
1965 Reimplemented from the QtAbstractEditorFactory class. |
1965 Reimplemented from the QtAbstractEditorFactory class. |
1966 */ |
1966 */ |
1967 void QtEnumEditorFactory::disconnectPropertyManager(QtEnumPropertyManager *manager) |
1967 void QtEnumEditorFactory::disconnectPropertyManager(QtEnumPropertyManager *manager) |
1968 { |
1968 { |
1969 disconnect(manager, SIGNAL(valueChanged(QtProperty *, int)), |
1969 disconnect(manager, SIGNAL(valueChanged(QtProperty*,int)), |
1970 this, SLOT(slotPropertyChanged(QtProperty *, int))); |
1970 this, SLOT(slotPropertyChanged(QtProperty*,int))); |
1971 disconnect(manager, SIGNAL(enumNamesChanged(QtProperty *, const QStringList &)), |
1971 disconnect(manager, SIGNAL(enumNamesChanged(QtProperty*,QStringList)), |
1972 this, SLOT(slotEnumNamesChanged(QtProperty *, const QStringList &))); |
1972 this, SLOT(slotEnumNamesChanged(QtProperty*,QStringList))); |
1973 } |
1973 } |
1974 |
1974 |
1975 // QtCursorEditorFactory |
1975 // QtCursorEditorFactory |
1976 |
1976 |
1977 Q_GLOBAL_STATIC(QtCursorDatabase, cursorDatabase) |
1977 Q_GLOBAL_STATIC(QtCursorDatabase, cursorDatabase) |
2074 { |
2074 { |
2075 d_ptr->q_ptr = this; |
2075 d_ptr->q_ptr = this; |
2076 |
2076 |
2077 d_ptr->m_enumEditorFactory = new QtEnumEditorFactory(this); |
2077 d_ptr->m_enumEditorFactory = new QtEnumEditorFactory(this); |
2078 d_ptr->m_enumPropertyManager = new QtEnumPropertyManager(this); |
2078 d_ptr->m_enumPropertyManager = new QtEnumPropertyManager(this); |
2079 connect(d_ptr->m_enumPropertyManager, SIGNAL(valueChanged(QtProperty *, int)), |
2079 connect(d_ptr->m_enumPropertyManager, SIGNAL(valueChanged(QtProperty*,int)), |
2080 this, SLOT(slotEnumChanged(QtProperty *, int))); |
2080 this, SLOT(slotEnumChanged(QtProperty*,int))); |
2081 d_ptr->m_enumEditorFactory->addPropertyManager(d_ptr->m_enumPropertyManager); |
2081 d_ptr->m_enumEditorFactory->addPropertyManager(d_ptr->m_enumPropertyManager); |
2082 } |
2082 } |
2083 |
2083 |
2084 /*! |
2084 /*! |
2085 Destroys this factory, and all the widgets it has created. |
2085 Destroys this factory, and all the widgets it has created. |
2122 } |
2122 } |
2123 QtAbstractEditorFactoryBase *af = d_ptr->m_enumEditorFactory; |
2123 QtAbstractEditorFactoryBase *af = d_ptr->m_enumEditorFactory; |
2124 QWidget *editor = af->createEditor(enumProp, parent); |
2124 QWidget *editor = af->createEditor(enumProp, parent); |
2125 d_ptr->m_enumToEditors[enumProp].append(editor); |
2125 d_ptr->m_enumToEditors[enumProp].append(editor); |
2126 d_ptr->m_editorToEnum[editor] = enumProp; |
2126 d_ptr->m_editorToEnum[editor] = enumProp; |
2127 connect(editor, SIGNAL(destroyed(QObject *)), |
2127 connect(editor, SIGNAL(destroyed(QObject*)), |
2128 this, SLOT(slotEditorDestroyed(QObject *))); |
2128 this, SLOT(slotEditorDestroyed(QObject*))); |
2129 return editor; |
2129 return editor; |
2130 } |
2130 } |
2131 |
2131 |
2132 /*! |
2132 /*! |
2133 \internal |
2133 \internal |
2134 |
2134 |
2135 Reimplemented from the QtAbstractEditorFactory class. |
2135 Reimplemented from the QtAbstractEditorFactory class. |
2136 */ |
2136 */ |
2137 void QtCursorEditorFactory::disconnectPropertyManager(QtCursorPropertyManager *manager) |
2137 void QtCursorEditorFactory::disconnectPropertyManager(QtCursorPropertyManager *manager) |
2138 { |
2138 { |
2139 disconnect(manager, SIGNAL(valueChanged(QtProperty *, const QCursor &)), |
2139 disconnect(manager, SIGNAL(valueChanged(QtProperty*,QCursor)), |
2140 this, SLOT(slotPropertyChanged(QtProperty *, const QCursor &))); |
2140 this, SLOT(slotPropertyChanged(QtProperty*,QCursor))); |
2141 } |
2141 } |
2142 |
2142 |
2143 // QtColorEditWidget |
2143 // QtColorEditWidget |
2144 |
2144 |
2145 class QtColorEditWidget : public QWidget { |
2145 class QtColorEditWidget : public QWidget { |
2322 QtProperty *property, QWidget *parent) |
2322 QtProperty *property, QWidget *parent) |
2323 { |
2323 { |
2324 QtColorEditWidget *editor = d_ptr->createEditor(property, parent); |
2324 QtColorEditWidget *editor = d_ptr->createEditor(property, parent); |
2325 editor->setValue(manager->value(property)); |
2325 editor->setValue(manager->value(property)); |
2326 connect(editor, SIGNAL(valueChanged(QColor)), this, SLOT(slotSetValue(QColor))); |
2326 connect(editor, SIGNAL(valueChanged(QColor)), this, SLOT(slotSetValue(QColor))); |
2327 connect(editor, SIGNAL(destroyed(QObject *)), this, SLOT(slotEditorDestroyed(QObject *))); |
2327 connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*))); |
2328 return editor; |
2328 return editor; |
2329 } |
2329 } |
2330 |
2330 |
2331 /*! |
2331 /*! |
2332 \internal |
2332 \internal |
2535 QtProperty *property, QWidget *parent) |
2535 QtProperty *property, QWidget *parent) |
2536 { |
2536 { |
2537 QtFontEditWidget *editor = d_ptr->createEditor(property, parent); |
2537 QtFontEditWidget *editor = d_ptr->createEditor(property, parent); |
2538 editor->setValue(manager->value(property)); |
2538 editor->setValue(manager->value(property)); |
2539 connect(editor, SIGNAL(valueChanged(QFont)), this, SLOT(slotSetValue(QFont))); |
2539 connect(editor, SIGNAL(valueChanged(QFont)), this, SLOT(slotSetValue(QFont))); |
2540 connect(editor, SIGNAL(destroyed(QObject *)), this, SLOT(slotEditorDestroyed(QObject *))); |
2540 connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(slotEditorDestroyed(QObject*))); |
2541 return editor; |
2541 return editor; |
2542 } |
2542 } |
2543 |
2543 |
2544 /*! |
2544 /*! |
2545 \internal |
2545 \internal |