Qt5 build fixes

--HG--
branch : qt5
hg/feature/qt5
kaetemi 11 years ago
parent ef81ffc4d9
commit 0cd6da40bf

@ -22,7 +22,7 @@ SET(QT_USE_QTGUI TRUE)
IF(WITH_QT5)
SET(CMAKE_AUTOMOC ON)
QT5_ADD_RESOURCES(QT_PROPERTY_EDITOR_RC_SRCS ${QT_PROPERTY_EDITOR_RCS})
#QT5_WRAP_CPP(QT_PROPERTY_EDITOR_MOC_SRC ${QT_PROPERTY_EDITOR_HDR})
QT5_WRAP_CPP(QT_PROPERTY_EDITOR_MOC_SRC ${QT_PROPERTY_EDITOR_HDR})
ELSE(WITH_QT5)
QT4_ADD_RESOURCES(QT_PROPERTY_EDITOR_RC_SRCS ${QT_PROPERTY_EDITOR_RCS})
QT4_WRAP_CPP(QT_PROPERTY_EDITOR_MOC_SRC ${QT_PROPERTY_EDITOR_HDR})
@ -32,13 +32,18 @@ SOURCE_GROUP(QtResources FILES ${QT_PROPERTY_EDITOR_RCS})
SOURCE_GROUP(QtGeneratedMocSrc FILES ${QT_PROPERTY_EDITOR_MOC_SRC})
SOURCE_GROUP("Qt Property Editor Source" FILES ${SRC})
IF(WITH_QT)
IF(WITH_QT5)
qt5_generate_moc(qtpropertymanager.cpp ${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc)
qt5_generate_moc(qteditorfactory.cpp ${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc)
qt5_generate_moc(qttreepropertybrowser.cpp ${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc)
ELSE(WITH_QT5)
qt4_generate_moc(qtpropertymanager.cpp ${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc)
qt4_generate_moc(qteditorfactory.cpp ${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc)
qt4_generate_moc(qttreepropertybrowser.cpp ${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc)
# Need to remove these so that they are not linked as they are inline included.
LIST(REMOVE_ITEM QT_PROPERTY_EDITOR_MOC_SRC ${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cxx
LIST(REMOVE_ITEM QT_PROPERTY_EDITOR_MOC_SRC
${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qteditorfactory.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qtgroupboxpropertybrowser.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowser.cxx
@ -54,7 +59,7 @@ IF(WITH_QT)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtpropertymanager.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertymanager.cxx)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qttreepropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qttreepropertybrowser.cxx)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtvariantproperty.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtvariantproperty.cxx)
ENDIF(WITH_QT)
ENDIF(WITH_QT5)
#set(
# qtpropertyeditor_HEADERS_ONLY_MOC

@ -98,57 +98,6 @@
QT_BEGIN_NAMESPACE
#endif
class QtButtonPropertyBrowserPrivate
{
QtButtonPropertyBrowser *q_ptr;
Q_DECLARE_PUBLIC(QtButtonPropertyBrowser)
public:
void init(QWidget *parent);
void propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex);
void propertyRemoved(QtBrowserItem *index);
void propertyChanged(QtBrowserItem *index);
QWidget *createEditor(QtProperty *property, QWidget *parent) const
{ return q_ptr->createEditor(property, parent); }
void slotEditorDestroyed();
void slotUpdate();
void slotToggled(bool checked);
struct WidgetItem
{
WidgetItem() : widget(0), label(0), widgetLabel(0),
button(0), container(0), layout(0), /*line(0), */parent(0), expanded(false) { }
QWidget *widget; // can be null
QLabel *label; // main label with property name
QLabel *widgetLabel; // label substitute showing the current value if there is no widget
QToolButton *button; // expandable button for items with children
QWidget *container; // container which is expanded when the button is clicked
QGridLayout *layout; // layout in container
WidgetItem *parent;
QList<WidgetItem *> children;
bool expanded;
};
private:
void updateLater();
void updateItem(WidgetItem *item);
void insertRow(QGridLayout *layout, int row) const;
void removeRow(QGridLayout *layout, int row) const;
int gridRow(WidgetItem *item) const;
int gridSpan(WidgetItem *item) const;
void setExpanded(WidgetItem *item, bool expanded);
QToolButton *createButton(QWidget *panret = 0) const;
QMap<QtBrowserItem *, WidgetItem *> m_indexToItem;
QMap<WidgetItem *, QtBrowserItem *> m_itemToIndex;
QMap<QWidget *, WidgetItem *> m_widgetToItem;
QMap<QObject *, WidgetItem *> m_buttonToItem;
QGridLayout *m_mainLayout;
QList<WidgetItem *> m_children;
QList<WidgetItem *> m_recreateQueue;
};
QToolButton *QtButtonPropertyBrowserPrivate::createButton(QWidget *parent) const
{
QToolButton *button = new QToolButton(parent);
@ -673,4 +622,4 @@ bool QtButtonPropertyBrowser::isExpanded(QtBrowserItem *item) const
QT_END_NAMESPACE
#endif
#include "moc_qtbuttonpropertybrowser.cxx"
//#include "moc_qtbuttonpropertybrowser.cxx"

@ -128,6 +128,57 @@ private:
};
class QtButtonPropertyBrowserPrivate
{
QtButtonPropertyBrowser *q_ptr;
Q_DECLARE_PUBLIC(QtButtonPropertyBrowser)
public:
void init(QWidget *parent);
void propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex);
void propertyRemoved(QtBrowserItem *index);
void propertyChanged(QtBrowserItem *index);
QWidget *createEditor(QtProperty *property, QWidget *parent) const
{ return q_ptr->createEditor(property, parent); }
void slotEditorDestroyed();
void slotUpdate();
void slotToggled(bool checked);
struct WidgetItem
{
WidgetItem() : widget(0), label(0), widgetLabel(0),
button(0), container(0), layout(0), /*line(0), */parent(0), expanded(false) { }
QWidget *widget; // can be null
QLabel *label; // main label with property name
QLabel *widgetLabel; // label substitute showing the current value if there is no widget
QToolButton *button; // expandable button for items with children
QWidget *container; // container which is expanded when the button is clicked
QGridLayout *layout; // layout in container
WidgetItem *parent;
QList<WidgetItem *> children;
bool expanded;
};
private:
void updateLater();
void updateItem(WidgetItem *item);
void insertRow(QGridLayout *layout, int row) const;
void removeRow(QGridLayout *layout, int row) const;
int gridRow(WidgetItem *item) const;
int gridSpan(WidgetItem *item) const;
void setExpanded(WidgetItem *item, bool expanded);
QToolButton *createButton(QWidget *panret = 0) const;
QMap<QtBrowserItem *, WidgetItem *> m_indexToItem;
QMap<WidgetItem *, QtBrowserItem *> m_itemToIndex;
QMap<QWidget *, WidgetItem *> m_widgetToItem;
QMap<QObject *, WidgetItem *> m_buttonToItem;
QGridLayout *m_mainLayout;
QList<WidgetItem *> m_children;
QList<WidgetItem *> m_recreateQueue;
};
#if QT_VERSION >= 0x040400
QT_END_NAMESPACE
#endif

@ -134,75 +134,8 @@ static inline void setupTreeViewEditorMargin(QLayout *lt)
// ---------- EditorFactoryPrivate :
// Base class for editor factory private classes. Manages mapping of properties to editors and vice versa.
template <class Editor>
class EditorFactoryPrivate
{
public:
typedef QList<Editor *> EditorList;
typedef QMap<QtProperty *, EditorList> PropertyToEditorListMap;
typedef QMap<Editor *, QtProperty *> EditorToPropertyMap;
Editor *createEditor(QtProperty *property, QWidget *parent);
void initializeEditor(QtProperty *property, Editor *e);
void slotEditorDestroyed(QObject *object);
PropertyToEditorListMap m_createdEditors;
EditorToPropertyMap m_editorToProperty;
};
template <class Editor>
Editor *EditorFactoryPrivate<Editor>::createEditor(QtProperty *property, QWidget *parent)
{
Editor *editor = new Editor(parent);
initializeEditor(property, editor);
return editor;
}
template <class Editor>
void EditorFactoryPrivate<Editor>::initializeEditor(QtProperty *property, Editor *editor)
{
Q_TYPENAME PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
if (it == m_createdEditors.end())
it = m_createdEditors.insert(property, EditorList());
it.value().append(editor);
m_editorToProperty.insert(editor, property);
}
template <class Editor>
void EditorFactoryPrivate<Editor>::slotEditorDestroyed(QObject *object)
{
const Q_TYPENAME EditorToPropertyMap::iterator ecend = m_editorToProperty.end();
for (Q_TYPENAME EditorToPropertyMap::iterator itEditor = m_editorToProperty.begin(); itEditor != ecend; ++itEditor) {
if (itEditor.key() == object) {
Editor *editor = itEditor.key();
QtProperty *property = itEditor.value();
const Q_TYPENAME PropertyToEditorListMap::iterator pit = m_createdEditors.find(property);
if (pit != m_createdEditors.end()) {
pit.value().removeAll(editor);
if (pit.value().empty())
m_createdEditors.erase(pit);
}
m_editorToProperty.erase(itEditor);
return;
}
}
}
// ------------ QtSpinBoxFactory
class QtSpinBoxFactoryPrivate : public EditorFactoryPrivate<QSpinBox>
{
QtSpinBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtSpinBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotSetValue(int value);
};
void QtSpinBoxFactoryPrivate::slotPropertyChanged(QtProperty *property, int value)
{
if (!m_createdEditors.contains(property))
@ -347,17 +280,6 @@ void QtSpinBoxFactory::disconnectPropertyManager(QtIntPropertyManager *manager)
// QtSliderFactory
class QtSliderFactoryPrivate : public EditorFactoryPrivate<QSlider>
{
QtSliderFactory *q_ptr;
Q_DECLARE_PUBLIC(QtSliderFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotSetValue(int value);
};
void QtSliderFactoryPrivate::slotPropertyChanged(QtProperty *property, int value)
{
if (!m_createdEditors.contains(property))
@ -500,17 +422,6 @@ void QtSliderFactory::disconnectPropertyManager(QtIntPropertyManager *manager)
// QtSliderFactory
class QtScrollBarFactoryPrivate : public EditorFactoryPrivate<QScrollBar>
{
QtScrollBarFactory *q_ptr;
Q_DECLARE_PUBLIC(QtScrollBarFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotSetValue(int value);
};
void QtScrollBarFactoryPrivate::slotPropertyChanged(QtProperty *property, int value)
{
if (!m_createdEditors.contains(property))
@ -652,16 +563,6 @@ void QtScrollBarFactory::disconnectPropertyManager(QtIntPropertyManager *manager
// QtCheckBoxFactory
class QtCheckBoxFactoryPrivate : public EditorFactoryPrivate<QtBoolEdit>
{
QtCheckBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCheckBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, bool value);
void slotSetValue(bool value);
void slotResetProperty();
};
void QtCheckBoxFactoryPrivate::slotPropertyChanged(QtProperty *property, bool value)
{
if (!m_createdEditors.contains(property))
@ -781,19 +682,6 @@ void QtCheckBoxFactory::disconnectPropertyManager(QtBoolPropertyManager *manager
// QtDoubleSpinBoxFactory
class QtDoubleSpinBoxFactoryPrivate : public EditorFactoryPrivate<QDoubleSpinBox>
{
QtDoubleSpinBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, double value);
void slotRangeChanged(QtProperty *property, double min, double max);
void slotSingleStepChanged(QtProperty *property, double step);
void slotDecimalsChanged(QtProperty *property, int prec);
void slotSetValue(double value);
};
void QtDoubleSpinBoxFactoryPrivate::slotPropertyChanged(QtProperty *property, double value)
{
QList<QDoubleSpinBox *> editors = m_createdEditors[property];
@ -969,18 +857,6 @@ void QtDoubleSpinBoxFactory::disconnectPropertyManager(QtDoublePropertyManager *
// QtLineEditFactory
class QtLineEditFactoryPrivate : public EditorFactoryPrivate<QLineEdit>
{
QtLineEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtLineEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QString &value);
void slotRegExpChanged(QtProperty *property, const QRegExp &regExp);
void slotSetValue(const QString &value);
void slotEditingFinished();
};
void QtLineEditFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QString &value)
{
@ -1133,17 +1009,6 @@ void QtLineEditFactory::disconnectPropertyManager(QtStringPropertyManager *manag
// QtDateEditFactory
class QtDateEditFactoryPrivate : public EditorFactoryPrivate<QDateEdit>
{
QtDateEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDateEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QDate &value);
void slotRangeChanged(QtProperty *property, const QDate &min, const QDate &max);
void slotSetValue(const QDate &value);
};
void QtDateEditFactoryPrivate::slotPropertyChanged(QtProperty *property, const QDate &value)
{
if (!m_createdEditors.contains(property))
@ -1269,16 +1134,6 @@ void QtDateEditFactory::disconnectPropertyManager(QtDatePropertyManager *manager
// QtTimeEditFactory
class QtTimeEditFactoryPrivate : public EditorFactoryPrivate<QTimeEdit>
{
QtTimeEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtTimeEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QTime &value);
void slotSetValue(const QTime &value);
};
void QtTimeEditFactoryPrivate::slotPropertyChanged(QtProperty *property, const QTime &value)
{
if (!m_createdEditors.contains(property))
@ -1378,17 +1233,6 @@ void QtTimeEditFactory::disconnectPropertyManager(QtTimePropertyManager *manager
// QtDateTimeEditFactory
class QtDateTimeEditFactoryPrivate : public EditorFactoryPrivate<QDateTimeEdit>
{
QtDateTimeEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QDateTime &value);
void slotSetValue(const QDateTime &value);
};
void QtDateTimeEditFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QDateTime &value)
{
@ -1490,16 +1334,6 @@ void QtDateTimeEditFactory::disconnectPropertyManager(QtDateTimePropertyManager
// QtKeySequenceEditorFactory
class QtKeySequenceEditorFactoryPrivate : public EditorFactoryPrivate<QtKeySequenceEdit>
{
QtKeySequenceEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QKeySequence &value);
void slotSetValue(const QKeySequence &value);
};
void QtKeySequenceEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QKeySequence &value)
{
@ -1601,32 +1435,7 @@ void QtKeySequenceEditorFactory::disconnectPropertyManager(QtKeySequenceProperty
// QtCharEdit
class QtCharEdit : public QWidget
{
Q_OBJECT
public:
QtCharEdit(QWidget *parent = 0);
QChar value() const;
bool eventFilter(QObject *o, QEvent *e);
public Q_SLOTS:
void setValue(const QChar &value);
Q_SIGNALS:
void valueChanged(const QChar &value);
protected:
void focusInEvent(QFocusEvent *e);
void focusOutEvent(QFocusEvent *e);
void keyPressEvent(QKeyEvent *e);
void keyReleaseEvent(QKeyEvent *e);
bool event(QEvent *e);
private slots:
void slotClearChar();
private:
void handleKeyEvent(QKeyEvent *e);
QChar m_value;
QLineEdit *m_lineEdit;
};
QtCharEdit::QtCharEdit(QWidget *parent)
: QWidget(parent), m_lineEdit(new QLineEdit(this))
@ -1770,17 +1579,6 @@ bool QtCharEdit::event(QEvent *e)
// QtCharEditorFactory
class QtCharEditorFactoryPrivate : public EditorFactoryPrivate<QtCharEdit>
{
QtCharEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCharEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QChar &value);
void slotSetValue(const QChar &value);
};
void QtCharEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QChar &value)
{
@ -1881,29 +1679,6 @@ void QtCharEditorFactory::disconnectPropertyManager(QtCharPropertyManager *manag
}
class QtEnumEditWidget : public QWidget {
Q_OBJECT
public:
QtEnumEditWidget(QWidget *parent);
bool blockComboBoxSignals(bool block);
void addItems(const QStringList &texts);
void clearComboBox();
void setItemIcon(int index, const QIcon &icon);
public Q_SLOTS:
void setValue(int value);
void setStateResetButton(bool enabled);
Q_SIGNALS:
void valueChanged(int value);
void resetProperty();
private:
QComboBox *m_comboBox;
QToolButton *m_defaultButton;
};
QtEnumEditWidget::QtEnumEditWidget(QWidget *parent) :
QWidget(parent),
@ -1960,19 +1735,6 @@ void QtEnumEditWidget::setItemIcon(int index, const QIcon &icon)
// QtEnumEditorFactory
class QtEnumEditorFactoryPrivate : public EditorFactoryPrivate<QtEnumEditWidget>
{
QtEnumEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtEnumEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotEnumNamesChanged(QtProperty *property, const QStringList &);
void slotEnumIconsChanged(QtProperty *property, const QMap<int, QIcon> &);
void slotSetValue(int value);
void slotResetProperty();
};
void QtEnumEditorFactoryPrivate::slotResetProperty()
{
QObject *object = q_ptr->sender();
@ -2152,27 +1914,6 @@ void QtEnumEditorFactory::disconnectPropertyManager(QtEnumPropertyManager *manag
Q_GLOBAL_STATIC(QtCursorDatabase, cursorDatabase)
class QtCursorEditorFactoryPrivate
{
QtCursorEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCursorEditorFactory)
public:
QtCursorEditorFactoryPrivate();
void slotPropertyChanged(QtProperty *property, const QCursor &cursor);
void slotEnumChanged(QtProperty *property, int value);
void slotEditorDestroyed(QObject *object);
QtEnumEditorFactory *m_enumEditorFactory;
QtEnumPropertyManager *m_enumPropertyManager;
QMap<QtProperty *, QtProperty *> m_propertyToEnum;
QMap<QtProperty *, QtProperty *> m_enumToProperty;
QMap<QtProperty *, QList<QWidget *> > m_enumToEditors;
QMap<QWidget *, QtProperty *> m_editorToEnum;
bool m_updatingEnum;
};
QtCursorEditorFactoryPrivate::QtCursorEditorFactoryPrivate()
: m_updatingEnum(false)
{
@ -2317,30 +2058,6 @@ void QtCursorEditorFactory::disconnectPropertyManager(QtCursorPropertyManager *m
// QtColorEditWidget
class QtColorEditWidget : public QWidget {
Q_OBJECT
public:
QtColorEditWidget(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *ev);
public Q_SLOTS:
void setValue(const QColor &value);
private Q_SLOTS:
void buttonClicked();
Q_SIGNALS:
void valueChanged(const QColor &value);
private:
QColor m_color;
QLabel *m_pixmapLabel;
QLabel *m_label;
QToolButton *m_button;
};
QtColorEditWidget::QtColorEditWidget(QWidget *parent) :
QWidget(parent),
m_pixmapLabel(new QLabel),
@ -2412,16 +2129,6 @@ bool QtColorEditWidget::eventFilter(QObject *obj, QEvent *ev)
// QtColorEditorFactoryPrivate
class QtColorEditorFactoryPrivate : public EditorFactoryPrivate<QtColorEditWidget>
{
QtColorEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtColorEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QColor &value);
void slotSetValue(const QColor &value);
};
void QtColorEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QColor &value)
{
@ -2515,30 +2222,6 @@ void QtColorEditorFactory::disconnectPropertyManager(QtColorPropertyManager *man
// QtFontEditWidget
class QtFontEditWidget : public QWidget {
Q_OBJECT
public:
QtFontEditWidget(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *ev);
public Q_SLOTS:
void setValue(const QFont &value);
private Q_SLOTS:
void buttonClicked();
Q_SIGNALS:
void valueChanged(const QFont &value);
private:
QFont m_font;
QLabel *m_pixmapLabel;
QLabel *m_label;
QToolButton *m_button;
};
QtFontEditWidget::QtFontEditWidget(QWidget *parent) :
QWidget(parent),
m_pixmapLabel(new QLabel),
@ -2623,16 +2306,6 @@ bool QtFontEditWidget::eventFilter(QObject *obj, QEvent *ev)
// QtFontEditorFactoryPrivate
class QtFontEditorFactoryPrivate : public EditorFactoryPrivate<QtFontEditWidget>
{
QtFontEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtFontEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QFont &value);
void slotSetValue(const QFont &value);
};
void QtFontEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QFont &value)
{
@ -2724,31 +2397,6 @@ void QtFontEditorFactory::disconnectPropertyManager(QtFontPropertyManager *manag
disconnect(manager, SIGNAL(valueChanged(QtProperty*,QFont)), this, SLOT(slotPropertyChanged(QtProperty*,QFont)));
}
class QtTextEditWidget : public QWidget {
Q_OBJECT
public:
QtTextEditWidget(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *ev);
public Q_SLOTS:
void setValue(const QString &value);
void setStateResetButton(bool enabled);
private Q_SLOTS:
void buttonClicked();
Q_SIGNALS:
void valueChanged(const QString &value);
void resetProperty();
private:
QLineEdit *m_lineEdit;
QToolButton *m_defaultButton;
QToolButton *m_button;
};
QtTextEditWidget::QtTextEditWidget(QWidget *parent) :
QWidget(parent),
m_lineEdit(new QLineEdit),
@ -2857,17 +2505,6 @@ bool QtTextEditWidget::eventFilter(QObject *obj, QEvent *ev)
// QtLineEditFactory
class QtTextEditorFactoryPrivate : public EditorFactoryPrivate<QtTextEditWidget>
{
QtTextEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtTextEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QString &value);
void slotSetValue(const QString &value);
void slotResetProperty();
};
void QtTextEditorFactoryPrivate::slotPropertyChanged(QtProperty *property,
const QString &value)
{
@ -2989,5 +2626,5 @@ void QtTextEditorFactory::disconnectPropertyManager(QtTextPropertyManager *manag
QT_END_NAMESPACE
#endif
#include "moc_qteditorfactory.cxx"
//#include "moc_qteditorfactory.cxx"
#include "qteditorfactory.moc"

@ -89,6 +89,7 @@
#define QTEDITORFACTORY_H
#include "qtpropertymanager.h"
#include "qtpropertybrowserutils_p.h"
#if QT_VERSION >= 0x040400
QT_BEGIN_NAMESPACE
@ -466,6 +467,374 @@ private:
Q_PRIVATE_SLOT(d_func(), void slotResetProperty())
};
template <class Editor>
class EditorFactoryPrivate
{
public:
typedef QList<Editor *> EditorList;
typedef QMap<QtProperty *, EditorList> PropertyToEditorListMap;
typedef QMap<Editor *, QtProperty *> EditorToPropertyMap;
Editor *createEditor(QtProperty *property, QWidget *parent);
void initializeEditor(QtProperty *property, Editor *e);
void slotEditorDestroyed(QObject *object);
PropertyToEditorListMap m_createdEditors;
EditorToPropertyMap m_editorToProperty;
};
template <class Editor>
Editor *EditorFactoryPrivate<Editor>::createEditor(QtProperty *property, QWidget *parent)
{
Editor *editor = new Editor(parent);
initializeEditor(property, editor);
return editor;
}
template <class Editor>
void EditorFactoryPrivate<Editor>::initializeEditor(QtProperty *property, Editor *editor)
{
typename PropertyToEditorListMap::iterator it = m_createdEditors.find(property);
if (it == m_createdEditors.end())
it = m_createdEditors.insert(property, EditorList());
it.value().append(editor);
m_editorToProperty.insert(editor, property);
}
template <class Editor>
void EditorFactoryPrivate<Editor>::slotEditorDestroyed(QObject *object)
{
const typename EditorToPropertyMap::iterator ecend = m_editorToProperty.end();
for (typename EditorToPropertyMap::iterator itEditor = m_editorToProperty.begin(); itEditor != ecend; ++itEditor) {
if (itEditor.key() == object) {
Editor *editor = itEditor.key();
QtProperty *property = itEditor.value();
const typename PropertyToEditorListMap::iterator pit = m_createdEditors.find(property);
if (pit != m_createdEditors.end()) {
pit.value().removeAll(editor);
if (pit.value().empty())
m_createdEditors.erase(pit);
}
m_editorToProperty.erase(itEditor);
return;
}
}
}
class QtSpinBoxFactoryPrivate : public EditorFactoryPrivate<QSpinBox>
{
QtSpinBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtSpinBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotSetValue(int value);
};
class QtSliderFactoryPrivate : public EditorFactoryPrivate<QSlider>
{
QtSliderFactory *q_ptr;
Q_DECLARE_PUBLIC(QtSliderFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotSetValue(int value);
};
class QtScrollBarFactoryPrivate : public EditorFactoryPrivate<QScrollBar>
{
QtScrollBarFactory *q_ptr;
Q_DECLARE_PUBLIC(QtScrollBarFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotSetValue(int value);
};
class QtCheckBoxFactoryPrivate : public EditorFactoryPrivate<QtBoolEdit>
{
QtCheckBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCheckBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, bool value);
void slotSetValue(bool value);
void slotResetProperty();
};
class QtDoubleSpinBoxFactoryPrivate : public EditorFactoryPrivate<QDoubleSpinBox>
{
QtDoubleSpinBoxFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDoubleSpinBoxFactory)
public:
void slotPropertyChanged(QtProperty *property, double value);
void slotRangeChanged(QtProperty *property, double min, double max);
void slotSingleStepChanged(QtProperty *property, double step);
void slotDecimalsChanged(QtProperty *property, int prec);
void slotSetValue(double value);
};
class QtLineEditFactoryPrivate : public EditorFactoryPrivate<QLineEdit>
{
QtLineEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtLineEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QString &value);
void slotRegExpChanged(QtProperty *property, const QRegExp &regExp);
void slotSetValue(const QString &value);
void slotEditingFinished();
};
class QtDateEditFactoryPrivate : public EditorFactoryPrivate<QDateEdit>
{
QtDateEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDateEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QDate &value);
void slotRangeChanged(QtProperty *property, const QDate &min, const QDate &max);
void slotSetValue(const QDate &value);
};
class QtTimeEditFactoryPrivate : public EditorFactoryPrivate<QTimeEdit>
{
QtTimeEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtTimeEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QTime &value);
void slotSetValue(const QTime &value);
};
class QtDateTimeEditFactoryPrivate : public EditorFactoryPrivate<QDateTimeEdit>
{
QtDateTimeEditFactory *q_ptr;
Q_DECLARE_PUBLIC(QtDateTimeEditFactory)
public:
void slotPropertyChanged(QtProperty *property, const QDateTime &value);
void slotSetValue(const QDateTime &value);
};
class QtKeySequenceEditorFactoryPrivate : public EditorFactoryPrivate<QtKeySequenceEdit>
{
QtKeySequenceEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtKeySequenceEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QKeySequence &value);
void slotSetValue(const QKeySequence &value);
};
class QtCharEdit : public QWidget
{
Q_OBJECT
public:
QtCharEdit(QWidget *parent = 0);
QChar value() const;
bool eventFilter(QObject *o, QEvent *e);
public Q_SLOTS:
void setValue(const QChar &value);
Q_SIGNALS:
void valueChanged(const QChar &value);
protected:
void focusInEvent(QFocusEvent *e);
void focusOutEvent(QFocusEvent *e);
void keyPressEvent(QKeyEvent *e);
void keyReleaseEvent(QKeyEvent *e);
bool event(QEvent *e);
private slots:
void slotClearChar();
private:
void handleKeyEvent(QKeyEvent *e);
QChar m_value;
QLineEdit *m_lineEdit;
};
class QtCharEditorFactoryPrivate : public EditorFactoryPrivate<QtCharEdit>
{
QtCharEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCharEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QChar &value);
void slotSetValue(const QChar &value);
};
class QtEnumEditWidget : public QWidget {
Q_OBJECT
public:
QtEnumEditWidget(QWidget *parent);
bool blockComboBoxSignals(bool block);
void addItems(const QStringList &texts);
void clearComboBox();
void setItemIcon(int index, const QIcon &icon);
public Q_SLOTS:
void setValue(int value);
void setStateResetButton(bool enabled);
Q_SIGNALS:
void valueChanged(int value);
void resetProperty();
private:
QComboBox *m_comboBox;
QToolButton *m_defaultButton;
};
class QtEnumEditorFactoryPrivate : public EditorFactoryPrivate<QtEnumEditWidget>
{
QtEnumEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtEnumEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, int value);
void slotEnumNamesChanged(QtProperty *property, const QStringList &);
void slotEnumIconsChanged(QtProperty *property, const QMap<int, QIcon> &);
void slotSetValue(int value);
void slotResetProperty();
};
class QtCursorEditorFactoryPrivate
{
QtCursorEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtCursorEditorFactory)
public:
QtCursorEditorFactoryPrivate();
void slotPropertyChanged(QtProperty *property, const QCursor &cursor);
void slotEnumChanged(QtProperty *property, int value);
void slotEditorDestroyed(QObject *object);
QtEnumEditorFactory *m_enumEditorFactory;
QtEnumPropertyManager *m_enumPropertyManager;
QMap<QtProperty *, QtProperty *> m_propertyToEnum;
QMap<QtProperty *, QtProperty *> m_enumToProperty;
QMap<QtProperty *, QList<QWidget *> > m_enumToEditors;
QMap<QWidget *, QtProperty *> m_editorToEnum;
bool m_updatingEnum;
};
class QtColorEditWidget : public QWidget {
Q_OBJECT
public:
QtColorEditWidget(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *ev);
public Q_SLOTS:
void setValue(const QColor &value);
private Q_SLOTS:
void buttonClicked();
Q_SIGNALS:
void valueChanged(const QColor &value);
private:
QColor m_color;
QLabel *m_pixmapLabel;
QLabel *m_label;
QToolButton *m_button;
};
class QtColorEditorFactoryPrivate : public EditorFactoryPrivate<QtColorEditWidget>
{
QtColorEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtColorEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QColor &value);
void slotSetValue(const QColor &value);
};
class QtFontEditWidget : public QWidget {
Q_OBJECT
public:
QtFontEditWidget(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *ev);
public Q_SLOTS:
void setValue(const QFont &value);
private Q_SLOTS:
void buttonClicked();
Q_SIGNALS:
void valueChanged(const QFont &value);
private:
QFont m_font;
QLabel *m_pixmapLabel;
QLabel *m_label;
QToolButton *m_button;
};
class QtFontEditorFactoryPrivate : public EditorFactoryPrivate<QtFontEditWidget>
{
QtFontEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtFontEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QFont &value);
void slotSetValue(const QFont &value);
};
class QtTextEditWidget : public QWidget {
Q_OBJECT
public:
QtTextEditWidget(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *ev);
public Q_SLOTS:
void setValue(const QString &value);
void setStateResetButton(bool enabled);
private Q_SLOTS:
void buttonClicked();
Q_SIGNALS:
void valueChanged(const QString &value);
void resetProperty();
private:
QLineEdit *m_lineEdit;
QToolButton *m_defaultButton;
QToolButton *m_button;
};
class QtTextEditorFactoryPrivate : public EditorFactoryPrivate<QtTextEditWidget>
{
QtTextEditorFactory *q_ptr;
Q_DECLARE_PUBLIC(QtTextEditorFactory)
public:
void slotPropertyChanged(QtProperty *property, const QString &value);
void slotSetValue(const QString &value);
void slotResetProperty();
};
#if QT_VERSION >= 0x040400
QT_END_NAMESPACE
#endif

@ -97,52 +97,6 @@
QT_BEGIN_NAMESPACE
#endif
class QtGroupBoxPropertyBrowserPrivate
{
QtGroupBoxPropertyBrowser *q_ptr;
Q_DECLARE_PUBLIC(QtGroupBoxPropertyBrowser)
public:
void init(QWidget *parent);
void propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex);
void propertyRemoved(QtBrowserItem *index);
void propertyChanged(QtBrowserItem *index);
QWidget *createEditor(QtProperty *property, QWidget *parent) const
{ return q_ptr->createEditor(property, parent); }
void slotEditorDestroyed();
void slotUpdate();
struct WidgetItem
{
WidgetItem() : widget(0), label(0), widgetLabel(0),
groupBox(0), layout(0), line(0), parent(0) { }
QWidget *widget; // can be null
QLabel *label;
QLabel *widgetLabel;
QGroupBox *groupBox;
QGridLayout *layout;
QFrame *line;
WidgetItem *parent;
QList<WidgetItem *> children;
};
private:
void updateLater();
void updateItem(WidgetItem *item);
void insertRow(QGridLayout *layout, int row) const;
void removeRow(QGridLayout *layout, int row) const;
bool hasHeader(WidgetItem *item) const;
QMap<QtBrowserItem *, WidgetItem *> m_indexToItem;
QMap<WidgetItem *, QtBrowserItem *> m_itemToIndex;
QMap<QWidget *, WidgetItem *> m_widgetToItem;
QGridLayout *m_mainLayout;
QList<WidgetItem *> m_children;
QList<WidgetItem *> m_recreateQueue;
};
void QtGroupBoxPropertyBrowserPrivate::init(QWidget *parent)
{
m_mainLayout = new QGridLayout();
@ -575,4 +529,4 @@ void QtGroupBoxPropertyBrowser::itemChanged(QtBrowserItem *item)
QT_END_NAMESPACE
#endif
#include "moc_qtgroupboxpropertybrowser.cxx"
#include "moc_qtgroupboxpropertybrowser.cpp"

@ -119,6 +119,52 @@ private:
};
class QtGroupBoxPropertyBrowserPrivate
{
QtGroupBoxPropertyBrowser *q_ptr;
Q_DECLARE_PUBLIC(QtGroupBoxPropertyBrowser)
public:
void init(QWidget *parent);
void propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex);
void propertyRemoved(QtBrowserItem *index);
void propertyChanged(QtBrowserItem *index);
QWidget *createEditor(QtProperty *property, QWidget *parent) const
{ return q_ptr->createEditor(property, parent); }
void slotEditorDestroyed();
void slotUpdate();
struct WidgetItem
{
WidgetItem() : widget(0), label(0), widgetLabel(0),
groupBox(0), layout(0), line(0), parent(0) { }
QWidget *widget; // can be null
QLabel *label;
QLabel *widgetLabel;
QGroupBox *groupBox;
QGridLayout *layout;
QFrame *line;
WidgetItem *parent;
QList<WidgetItem *> children;
};
private:
void updateLater();
void updateItem(WidgetItem *item);
void insertRow(QGridLayout *layout, int row) const;
void removeRow(QGridLayout *layout, int row) const;
bool hasHeader(WidgetItem *item) const;
QMap<QtBrowserItem *, WidgetItem *> m_indexToItem;
QMap<WidgetItem *, QtBrowserItem *> m_itemToIndex;
QMap<QWidget *, WidgetItem *> m_widgetToItem;
QGridLayout *m_mainLayout;
QList<WidgetItem *> m_children;
QList<WidgetItem *> m_recreateQueue;
};
#if QT_VERSION >= 0x040400
QT_END_NAMESPACE
#endif

@ -1258,40 +1258,6 @@ typedef QMap<QtAbstractPropertyManager *, QMap<QtAbstractEditorFactoryBase *,
Q_GLOBAL_STATIC(Map1, m_viewToManagerToFactory)
Q_GLOBAL_STATIC(Map2, m_managerToFactoryToViews)
class QtAbstractPropertyBrowserPrivate
{
QtAbstractPropertyBrowser *q_ptr;
Q_DECLARE_PUBLIC(QtAbstractPropertyBrowser)
public:
QtAbstractPropertyBrowserPrivate();
void insertSubTree(QtProperty *property,
QtProperty *parentProperty);
void removeSubTree(QtProperty *property,
QtProperty *parentProperty);
void createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty);
void removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty);
QtBrowserItem *createBrowserIndex(QtProperty *property, QtBrowserItem *parentIndex, QtBrowserItem *afterIndex);
void removeBrowserIndex(QtBrowserItem *index);
void clearIndex(QtBrowserItem *index);
void slotPropertyInserted(QtProperty *property,
QtProperty *parentProperty, QtProperty *afterProperty);
void slotPropertyRemoved(QtProperty *property, QtProperty *parentProperty);
void slotPropertyDestroyed(QtProperty *property);
void slotPropertyDataChanged(QtProperty *property);
QList<QtProperty *> m_subItems;
QMap<QtAbstractPropertyManager *, QList<QtProperty *> > m_managerToProperties;
QMap<QtProperty *, QList<QtProperty *> > m_propertyToParents;
QMap<QtProperty *, QtBrowserItem *> m_topLevelPropertyToIndex;
QList<QtBrowserItem *> m_topLevelIndexes;
QMap<QtProperty *, QList<QtBrowserItem *> > m_propertyToIndexes;
QtBrowserItem *m_currentItem;
};
QtAbstractPropertyBrowserPrivate::QtAbstractPropertyBrowserPrivate() :
m_currentItem(0)
{
@ -2055,4 +2021,4 @@ void QtAbstractPropertyBrowser::setCurrentItem(QtBrowserItem *item)
QT_END_NAMESPACE
#endif
#include "moc_qtpropertybrowser.cxx"
#include "moc_qtpropertybrowser.cpp"

@ -90,6 +90,19 @@
#include <QWidget>
#include <QSet>
#include <QLabel>
#include <QGroupBox>
#include <QGridLayout>
#include <QFrame>
#include <QMap>
#include <QToolButton>
#include <QSpinBox>
#include <QSlider>
#include <QScrollBar>
#include <QDateEdit>
#include <QTimeEdit>
#include <QComboBox>
#include <QLineEdit>
#if QT_VERSION >= 0x040400
QT_BEGIN_NAMESPACE
@ -374,6 +387,40 @@ private:
};
class QtAbstractPropertyBrowserPrivate
{
QtAbstractPropertyBrowser *q_ptr;
Q_DECLARE_PUBLIC(QtAbstractPropertyBrowser)
public:
QtAbstractPropertyBrowserPrivate();
void insertSubTree(QtProperty *property,
QtProperty *parentProperty);
void removeSubTree(QtProperty *property,
QtProperty *parentProperty);
void createBrowserIndexes(QtProperty *property, QtProperty *parentProperty, QtProperty *afterProperty);
void removeBrowserIndexes(QtProperty *property, QtProperty *parentProperty);
QtBrowserItem *createBrowserIndex(QtProperty *property, QtBrowserItem *parentIndex, QtBrowserItem *afterIndex);
void removeBrowserIndex(QtBrowserItem *index);
void clearIndex(QtBrowserItem *index);
void slotPropertyInserted(QtProperty *property,
QtProperty *parentProperty, QtProperty *afterProperty);
void slotPropertyRemoved(QtProperty *property, QtProperty *parentProperty);
void slotPropertyDestroyed(QtProperty *property);
void slotPropertyDataChanged(QtProperty *property);
QList<QtProperty *> m_subItems;
QMap<QtAbstractPropertyManager *, QList<QtProperty *> > m_managerToProperties;
QMap<QtProperty *, QList<QtProperty *> > m_propertyToParents;
QMap<QtProperty *, QtBrowserItem *> m_topLevelPropertyToIndex;
QList<QtBrowserItem *> m_topLevelIndexes;
QMap<QtProperty *, QList<QtBrowserItem *> > m_propertyToIndexes;
QtBrowserItem *m_currentItem;
};
#if QT_VERSION >= 0x040400
QT_END_NAMESPACE
#endif

@ -134,36 +134,6 @@ static void setSimpleMaximumData(PrivateData *data, const Value &maxVal)
data->val = data->maxVal;
}
template <class PrivateData, class Value>
static void setSizeMinimumData(PrivateData *data, const Value &newMinVal)
{
data->minVal = newMinVal;
if (data->maxVal.width() < data->minVal.width())
data->maxVal.setWidth(data->minVal.width());
if (data->maxVal.height() < data->minVal.height())
data->maxVal.setHeight(data->minVal.height());
if (data->val.width() < data->minVal.width())
data->val.setWidth(data->minVal.width());
if (data->val.height() < data->minVal.height())
data->val.setHeight(data->minVal.height());
}
template <class PrivateData, class Value>
static void setSizeMaximumData(PrivateData *data, const Value &newMaxVal)
{
data->maxVal = newMaxVal;
if (data->minVal.width() > data->maxVal.width())
data->minVal.setWidth(data->maxVal.width());
if (data->minVal.height() > data->maxVal.height())
data->minVal.setHeight(data->maxVal.height());
if (data->val.width() > data->maxVal.width())
data->val.setWidth(data->maxVal.width());
if (data->val.height() > data->maxVal.height())
data->val.setHeight(data->maxVal.height());
}
template <class SizeValue>
static SizeValue qBoundSize(const SizeValue &minVal, const SizeValue &val, const SizeValue &maxVal)
{
@ -239,7 +209,7 @@ static Value getData(const QMap<const QtProperty *, PrivateData> &propertyMap,
const QtProperty *property, const Value &defaultValue = Value())
{
typedef QMap<const QtProperty *, PrivateData> PropertyToData;
typedef Q_TYPENAME PropertyToData::const_iterator PropertyToDataConstIterator;
typedef typename PropertyToData::const_iterator PropertyToDataConstIterator;
const PropertyToDataConstIterator it = propertyMap.constFind(property);
if (it == propertyMap.constEnd())
return defaultValue;
@ -275,7 +245,7 @@ static void setSimpleValue(QMap<const QtProperty *, Value> &propertyMap,
QtProperty *property, const Value &val)
{
typedef QMap<const QtProperty *, Value> PropertyToData;
typedef Q_TYPENAME PropertyToData::iterator PropertyToDataIterator;
typedef typename PropertyToData::iterator PropertyToDataIterator;
const PropertyToDataIterator it = propertyMap.find(property);
if (it == propertyMap.end())
return;
@ -296,9 +266,9 @@ static void setValueInRange(PropertyManager *manager, PropertyManagerPrivate *ma
QtProperty *property, const Value &val,
void (PropertyManagerPrivate::*setSubPropertyValue)(QtProperty *, ValueChangeParameter))
{
typedef Q_TYPENAME PropertyManagerPrivate::Data PrivateData;
typedef typename PropertyManagerPrivate::Data PrivateData;
typedef QMap<const QtProperty *, PrivateData> PropertyToData;
typedef Q_TYPENAME PropertyToData::iterator PropertyToDataIterator;
typedef typename PropertyToData::iterator PropertyToDataIterator;
const PropertyToDataIterator it = managerPrivate->m_values.find(property);
if (it == managerPrivate->m_values.end())
return;
@ -331,9 +301,9 @@ static void setBorderValues(PropertyManager *manager, PropertyManagerPrivate *ma
void (PropertyManagerPrivate::*setSubPropertyRange)(QtProperty *,
ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
{
typedef Q_TYPENAME PropertyManagerPrivate::Data PrivateData;
typedef typename PropertyManagerPrivate::Data PrivateData;
typedef QMap<const QtProperty *, PrivateData> PropertyToData;
typedef Q_TYPENAME PropertyToData::iterator PropertyToDataIterator;
typedef typename PropertyToData::iterator PropertyToDataIterator;
const PropertyToDataIterator it = managerPrivate->m_values.find(property);
if (it == managerPrivate->m_values.end())
return;
@ -376,7 +346,7 @@ static void setBorderValue(PropertyManager *manager, PropertyManagerPrivate *man
ValueChangeParameter, ValueChangeParameter, ValueChangeParameter))
{
typedef QMap<const QtProperty *, PrivateData> PropertyToData;
typedef Q_TYPENAME PropertyToData::iterator PropertyToDataIterator;
typedef typename PropertyToData::iterator PropertyToDataIterator;
const PropertyToDataIterator it = managerPrivate->m_values.find(property);
if (it == managerPrivate->m_values.end())
return;
@ -2287,29 +2257,6 @@ void QtCharPropertyManager::uninitializeProperty(QtProperty *property)
// QtLocalePropertyManager
class QtLocalePropertyManagerPrivate
{
QtLocalePropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtLocalePropertyManager)
public:
QtLocalePropertyManagerPrivate();
void slotEnumChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, QLocale> PropertyValueMap;
PropertyValueMap m_values;
QtEnumPropertyManager *m_enumPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToLanguage;
QMap<const QtProperty *, QtProperty *> m_propertyToCountry;
QMap<const QtProperty *, QtProperty *> m_languageToProperty;
QMap<const QtProperty *, QtProperty *> m_countryToProperty;
};
QtLocalePropertyManagerPrivate::QtLocalePropertyManagerPrivate()
{
}
@ -2536,27 +2483,6 @@ void QtLocalePropertyManager::uninitializeProperty(QtProperty *property)
// QtPointPropertyManager
class QtPointPropertyManagerPrivate
{
QtPointPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtPointPropertyManager)
public:
void slotIntChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, QPoint> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToX;
QMap<const QtProperty *, QtProperty *> m_propertyToY;
QMap<const QtProperty *, QtProperty *> m_xToProperty;
QMap<const QtProperty *, QtProperty *> m_yToProperty;
};
void QtPointPropertyManagerPrivate::slotIntChanged(QtProperty *property, int value)
{
if (QtProperty *xprop = m_xToProperty.value(property, 0)) {
@ -2748,34 +2674,6 @@ void QtPointPropertyManager::uninitializeProperty(QtProperty *property)
// QtPointFPropertyManager
class QtPointFPropertyManagerPrivate
{
QtPointFPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtPointFPropertyManager)
public:
struct Data
{
Data() : decimals(2) {}
QPointF val;
int decimals;
};
void slotDoubleChanged(QtProperty *property, double value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtDoublePropertyManager *m_doublePropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToX;
QMap<const QtProperty *, QtProperty *> m_propertyToY;
QMap<const QtProperty *, QtProperty *> m_xToProperty;
QMap<const QtProperty *, QtProperty *> m_yToProperty;
};
void QtPointFPropertyManagerPrivate::slotDoubleChanged(QtProperty *property, double value)
{
if (QtProperty *prop = m_xToProperty.value(property, 0)) {
@ -3024,42 +2922,6 @@ void QtPointFPropertyManager::uninitializeProperty(QtProperty *property)
// QtSizePropertyManager
class QtSizePropertyManagerPrivate
{
QtSizePropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtSizePropertyManager)
public:
void slotIntChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
void setValue(QtProperty *property, const QSize &val);
void setRange(QtProperty *property,
const QSize &minVal, const QSize &maxVal, const QSize &val);
struct Data
{
Data() : val(QSize(0, 0)), minVal(QSize(0, 0)), maxVal(QSize(INT_MAX, INT_MAX)) {}
QSize val;
QSize minVal;
QSize maxVal;
QSize minimumValue() const { return minVal; }
QSize maximumValue() const { return maxVal; }
void setMinimumValue(const QSize &newMinVal) { setSizeMinimumData(this, newMinVal); }
void setMaximumValue(const QSize &newMaxVal) { setSizeMaximumData(this, newMaxVal); }
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToW;
QMap<const QtProperty *, QtProperty *> m_propertyToH;
QMap<const QtProperty *, QtProperty *> m_wToProperty;
QMap<const QtProperty *, QtProperty *> m_hToProperty;
};
void QtSizePropertyManagerPrivate::slotIntChanged(QtProperty *property, int value)
{
if (QtProperty *prop = m_wToProperty.value(property, 0)) {
@ -3368,43 +3230,6 @@ void QtSizePropertyManager::uninitializeProperty(QtProperty *property)
// QtSizeFPropertyManager
class QtSizeFPropertyManagerPrivate
{
QtSizeFPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtSizeFPropertyManager)
public:
void slotDoubleChanged(QtProperty *property, double value);
void slotPropertyDestroyed(QtProperty *property);
void setValue(QtProperty *property, const QSizeF &val);
void setRange(QtProperty *property,
const QSizeF &minVal, const QSizeF &maxVal, const QSizeF &val);
struct Data
{
Data() : val(QSizeF(0, 0)), minVal(QSizeF(0, 0)), maxVal(QSizeF(INT_MAX, INT_MAX)), decimals(2) {}
QSizeF val;
QSizeF minVal;
QSizeF maxVal;
int decimals;
QSizeF minimumValue() const { return minVal; }
QSizeF maximumValue() const { return maxVal; }
void setMinimumValue(const QSizeF &newMinVal) { setSizeMinimumData(this, newMinVal); }
void setMaximumValue(const QSizeF &newMaxVal) { setSizeMaximumData(this, newMaxVal); }
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtDoublePropertyManager *m_doublePropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToW;
QMap<const QtProperty *, QtProperty *> m_propertyToH;
QMap<const QtProperty *, QtProperty *> m_wToProperty;
QMap<const QtProperty *, QtProperty *> m_hToProperty;
};
void QtSizeFPropertyManagerPrivate::slotDoubleChanged(QtProperty *property, double value)
{
if (QtProperty *prop = m_wToProperty.value(property, 0)) {
@ -3768,39 +3593,6 @@ void QtSizeFPropertyManager::uninitializeProperty(QtProperty *property)
// QtRectPropertyManager
class QtRectPropertyManagerPrivate
{
QtRectPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtRectPropertyManager)
public:
void slotIntChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
void setConstraint(QtProperty *property, const QRect &constraint, const QRect &val);
struct Data
{
Data() : val(0, 0, 0, 0) {}
QRect val;
QRect constraint;
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToX;
QMap<const QtProperty *, QtProperty *> m_propertyToY;
QMap<const QtProperty *, QtProperty *> m_propertyToW;
QMap<const QtProperty *, QtProperty *> m_propertyToH;
QMap<const QtProperty *, QtProperty *> m_xToProperty;
QMap<const QtProperty *, QtProperty *> m_yToProperty;
QMap<const QtProperty *, QtProperty *> m_wToProperty;
QMap<const QtProperty *, QtProperty *> m_hToProperty;
};
void QtRectPropertyManagerPrivate::slotIntChanged(QtProperty *property, int value)
{
if (QtProperty *prop = m_xToProperty.value(property, 0)) {
@ -4176,40 +3968,6 @@ void QtRectPropertyManager::uninitializeProperty(QtProperty *property)
// QtRectFPropertyManager
class QtRectFPropertyManagerPrivate
{
QtRectFPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtRectFPropertyManager)
public:
void slotDoubleChanged(QtProperty *property, double value);
void slotPropertyDestroyed(QtProperty *property);
void setConstraint(QtProperty *property, const QRectF &constraint, const QRectF &val);
struct Data
{
Data() : val(0, 0, 0, 0), decimals(2) {}
QRectF val;
QRectF constraint;
int decimals;
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtDoublePropertyManager *m_doublePropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToX;
QMap<const QtProperty *, QtProperty *> m_propertyToY;
QMap<const QtProperty *, QtProperty *> m_propertyToW;
QMap<const QtProperty *, QtProperty *> m_propertyToH;
QMap<const QtProperty *, QtProperty *> m_xToProperty;
QMap<const QtProperty *, QtProperty *> m_yToProperty;
QMap<const QtProperty *, QtProperty *> m_wToProperty;
QMap<const QtProperty *, QtProperty *> m_hToProperty;
};
void QtRectFPropertyManagerPrivate::slotDoubleChanged(QtProperty *property, double value)
{
if (QtProperty *prop = m_xToProperty.value(property, 0)) {
@ -4646,24 +4404,6 @@ void QtRectFPropertyManager::uninitializeProperty(QtProperty *property)
// QtEnumPropertyManager
class QtEnumPropertyManagerPrivate
{
QtEnumPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtEnumPropertyManager)
public:
struct Data
{
Data() : val(-1) {}
int val;
QStringList enumNames;
QMap<int, QIcon> enumIcons;
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
};
/*!
\class QtEnumPropertyManager
@ -4915,32 +4655,6 @@ void QtEnumPropertyManager::uninitializeProperty(QtProperty *property)
// QtFlagPropertyManager
class QtFlagPropertyManagerPrivate
{
QtFlagPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtFlagPropertyManager)
public:
void slotBoolChanged(QtProperty *property, bool value);
void slotPropertyDestroyed(QtProperty *property);
struct Data
{
Data() : val(-1) {}
int val;
QStringList flagNames;
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtBoolPropertyManager *m_boolPropertyManager;
QMap<const QtProperty *, QList<QtProperty *> > m_propertyToFlags;
QMap<const QtProperty *, QtProperty *> m_flagToProperty;
};
void QtFlagPropertyManagerPrivate::slotBoolChanged(QtProperty *property, bool value)
{
QtProperty *prop = m_flagToProperty.value(property, 0);
@ -5242,35 +4956,6 @@ void QtFlagPropertyManager::uninitializeProperty(QtProperty *property)
// QtSizePolicyPropertyManager
class QtSizePolicyPropertyManagerPrivate
{
QtSizePolicyPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtSizePolicyPropertyManager)
public:
QtSizePolicyPropertyManagerPrivate();
void slotIntChanged(QtProperty *property, int value);
void slotEnumChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, QSizePolicy> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QtEnumPropertyManager *m_enumPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToHPolicy;
QMap<const QtProperty *, QtProperty *> m_propertyToVPolicy;
QMap<const QtProperty *, QtProperty *> m_propertyToHStretch;
QMap<const QtProperty *, QtProperty *> m_propertyToVStretch;
QMap<const QtProperty *, QtProperty *> m_hPolicyToProperty;
QMap<const QtProperty *, QtProperty *> m_vPolicyToProperty;
QMap<const QtProperty *, QtProperty *> m_hStretchToProperty;
QMap<const QtProperty *, QtProperty *> m_vStretchToProperty;
};
QtSizePolicyPropertyManagerPrivate::QtSizePolicyPropertyManagerPrivate()
{
}
@ -5567,50 +5252,6 @@ void QtSizePolicyPropertyManager::uninitializeProperty(QtProperty *property)
Q_GLOBAL_STATIC(QFontDatabase, fontDatabase)
class QtFontPropertyManagerPrivate
{
QtFontPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtFontPropertyManager)
public:
QtFontPropertyManagerPrivate();
void slotIntChanged(QtProperty *property, int value);
void slotEnumChanged(QtProperty *property, int value);
void slotBoolChanged(QtProperty *property, bool value);
void slotPropertyDestroyed(QtProperty *property);
void slotFontDatabaseChanged();
void slotFontDatabaseDelayedChange();
QStringList m_familyNames;
typedef QMap<const QtProperty *, QFont> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QtEnumPropertyManager *m_enumPropertyManager;
QtBoolPropertyManager *m_boolPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToFamily;
QMap<const QtProperty *, QtProperty *> m_propertyToPointSize;
QMap<const QtProperty *, QtProperty *> m_propertyToBold;
QMap<const QtProperty *, QtProperty *> m_propertyToItalic;
QMap<const QtProperty *, QtProperty *> m_propertyToUnderline;
QMap<const QtProperty *, QtProperty *> m_propertyToStrikeOut;
QMap<const QtProperty *, QtProperty *> m_propertyToKerning;
QMap<const QtProperty *, QtProperty *> m_familyToProperty;
QMap<const QtProperty *, QtProperty *> m_pointSizeToProperty;
QMap<const QtProperty *, QtProperty *> m_boldToProperty;
QMap<const QtProperty *, QtProperty *> m_italicToProperty;
QMap<const QtProperty *, QtProperty *> m_underlineToProperty;
QMap<const QtProperty *, QtProperty *> m_strikeOutToProperty;
QMap<const QtProperty *, QtProperty *> m_kerningToProperty;
bool m_settingValue;
QTimer *m_fontDatabaseChangeTimer;
};
QtFontPropertyManagerPrivate::QtFontPropertyManagerPrivate() :
m_settingValue(false),
m_fontDatabaseChangeTimer(0)
@ -6042,31 +5683,6 @@ void QtFontPropertyManager::uninitializeProperty(QtProperty *property)
// QtColorPropertyManager
class QtColorPropertyManagerPrivate
{
QtColorPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtColorPropertyManager)
public:
void slotIntChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, QColor> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToR;
QMap<const QtProperty *, QtProperty *> m_propertyToG;
QMap<const QtProperty *, QtProperty *> m_propertyToB;
QMap<const QtProperty *, QtProperty *> m_propertyToA;
QMap<const QtProperty *, QtProperty *> m_rToProperty;
QMap<const QtProperty *, QtProperty *> m_gToProperty;
QMap<const QtProperty *, QtProperty *> m_bToProperty;
QMap<const QtProperty *, QtProperty *> m_aToProperty;
};
void QtColorPropertyManagerPrivate::slotIntChanged(QtProperty *property, int value)
{
if (QtProperty *prop = m_rToProperty.value(property, 0)) {
@ -6325,15 +5941,6 @@ void QtColorPropertyManager::uninitializeProperty(QtProperty *property)
Q_GLOBAL_STATIC(QtCursorDatabase, cursorDatabase)
class QtCursorPropertyManagerPrivate
{
QtCursorPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtCursorPropertyManager)
public:
typedef QMap<const QtProperty *, QCursor> PropertyValueMap;
PropertyValueMap m_values;
};
/*!
\class QtCursorPropertyManager
@ -6476,5 +6083,5 @@ QString QtTextPropertyManager::valueText(const QtProperty *property) const
QT_END_NAMESPACE
#endif
#include "moc_qtpropertymanager.cxx"
//#include "moc_qtpropertymanager.cxx"
#include "qtpropertymanager.moc"

@ -801,6 +801,399 @@ protected:
virtual QString valueText(const QtProperty *property) const;
};
class QtLocalePropertyManagerPrivate
{
QtLocalePropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtLocalePropertyManager)
public:
QtLocalePropertyManagerPrivate();
void slotEnumChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, QLocale> PropertyValueMap;
PropertyValueMap m_values;
QtEnumPropertyManager *m_enumPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToLanguage;
QMap<const QtProperty *, QtProperty *> m_propertyToCountry;
QMap<const QtProperty *, QtProperty *> m_languageToProperty;
QMap<const QtProperty *, QtProperty *> m_countryToProperty;
};
class QtPointPropertyManagerPrivate
{
QtPointPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtPointPropertyManager)
public:
void slotIntChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, QPoint> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToX;
QMap<const QtProperty *, QtProperty *> m_propertyToY;
QMap<const QtProperty *, QtProperty *> m_xToProperty;
QMap<const QtProperty *, QtProperty *> m_yToProperty;
};
class QtPointFPropertyManagerPrivate
{
QtPointFPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtPointFPropertyManager)
public:
struct Data
{
Data() : decimals(2) {}
QPointF val;
int decimals;
};
void slotDoubleChanged(QtProperty *property, double value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtDoublePropertyManager *m_doublePropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToX;
QMap<const QtProperty *, QtProperty *> m_propertyToY;
QMap<const QtProperty *, QtProperty *> m_xToProperty;
QMap<const QtProperty *, QtProperty *> m_yToProperty;
};
template <class PrivateData, class Value>
static void setSizeMinimumData(PrivateData *data, const Value &newMinVal)
{
data->minVal = newMinVal;
if (data->maxVal.width() < data->minVal.width())
data->maxVal.setWidth(data->minVal.width());
if (data->maxVal.height() < data->minVal.height())
data->maxVal.setHeight(data->minVal.height());
if (data->val.width() < data->minVal.width())
data->val.setWidth(data->minVal.width());
if (data->val.height() < data->minVal.height())
data->val.setHeight(data->minVal.height());
}
template <class PrivateData, class Value>
static void setSizeMaximumData(PrivateData *data, const Value &newMaxVal)
{
data->maxVal = newMaxVal;
if (data->minVal.width() > data->maxVal.width())
data->minVal.setWidth(data->maxVal.width());
if (data->minVal.height() > data->maxVal.height())
data->minVal.setHeight(data->maxVal.height());
if (data->val.width() > data->maxVal.width())
data->val.setWidth(data->maxVal.width());
if (data->val.height() > data->maxVal.height())
data->val.setHeight(data->maxVal.height());
}
class QtSizePropertyManagerPrivate
{
QtSizePropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtSizePropertyManager)
public:
void slotIntChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
void setValue(QtProperty *property, const QSize &val);
void setRange(QtProperty *property,
const QSize &minVal, const QSize &maxVal, const QSize &val);
struct Data
{
Data() : val(QSize(0, 0)), minVal(QSize(0, 0)), maxVal(QSize(INT_MAX, INT_MAX)) {}
QSize val;
QSize minVal;
QSize maxVal;
QSize minimumValue() const { return minVal; }
QSize maximumValue() const { return maxVal; }
void setMinimumValue(const QSize &newMinVal) { setSizeMinimumData(this, newMinVal); }
void setMaximumValue(const QSize &newMaxVal) { setSizeMaximumData(this, newMaxVal); }
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToW;
QMap<const QtProperty *, QtProperty *> m_propertyToH;
QMap<const QtProperty *, QtProperty *> m_wToProperty;
QMap<const QtProperty *, QtProperty *> m_hToProperty;
};
class QtSizeFPropertyManagerPrivate
{
QtSizeFPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtSizeFPropertyManager)
public:
void slotDoubleChanged(QtProperty *property, double value);
void slotPropertyDestroyed(QtProperty *property);
void setValue(QtProperty *property, const QSizeF &val);
void setRange(QtProperty *property,
const QSizeF &minVal, const QSizeF &maxVal, const QSizeF &val);
struct Data
{
Data() : val(QSizeF(0, 0)), minVal(QSizeF(0, 0)), maxVal(QSizeF(INT_MAX, INT_MAX)), decimals(2) {}
QSizeF val;
QSizeF minVal;
QSizeF maxVal;
int decimals;
QSizeF minimumValue() const { return minVal; }
QSizeF maximumValue() const { return maxVal; }
void setMinimumValue(const QSizeF &newMinVal) { setSizeMinimumData(this, newMinVal); }
void setMaximumValue(const QSizeF &newMaxVal) { setSizeMaximumData(this, newMaxVal); }
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtDoublePropertyManager *m_doublePropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToW;
QMap<const QtProperty *, QtProperty *> m_propertyToH;
QMap<const QtProperty *, QtProperty *> m_wToProperty;
QMap<const QtProperty *, QtProperty *> m_hToProperty;
};
class QtRectPropertyManagerPrivate
{
QtRectPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtRectPropertyManager)
public:
void slotIntChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
void setConstraint(QtProperty *property, const QRect &constraint, const QRect &val);
struct Data
{
Data() : val(0, 0, 0, 0) {}
QRect val;
QRect constraint;
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToX;
QMap<const QtProperty *, QtProperty *> m_propertyToY;
QMap<const QtProperty *, QtProperty *> m_propertyToW;
QMap<const QtProperty *, QtProperty *> m_propertyToH;
QMap<const QtProperty *, QtProperty *> m_xToProperty;
QMap<const QtProperty *, QtProperty *> m_yToProperty;
QMap<const QtProperty *, QtProperty *> m_wToProperty;
QMap<const QtProperty *, QtProperty *> m_hToProperty;
};
class QtRectFPropertyManagerPrivate
{
QtRectFPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtRectFPropertyManager)
public:
void slotDoubleChanged(QtProperty *property, double value);
void slotPropertyDestroyed(QtProperty *property);
void setConstraint(QtProperty *property, const QRectF &constraint, const QRectF &val);
struct Data
{
Data() : val(0, 0, 0, 0), decimals(2) {}
QRectF val;
QRectF constraint;
int decimals;
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtDoublePropertyManager *m_doublePropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToX;
QMap<const QtProperty *, QtProperty *> m_propertyToY;
QMap<const QtProperty *, QtProperty *> m_propertyToW;
QMap<const QtProperty *, QtProperty *> m_propertyToH;
QMap<const QtProperty *, QtProperty *> m_xToProperty;
QMap<const QtProperty *, QtProperty *> m_yToProperty;
QMap<const QtProperty *, QtProperty *> m_wToProperty;
QMap<const QtProperty *, QtProperty *> m_hToProperty;
};
class QtEnumPropertyManagerPrivate
{
QtEnumPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtEnumPropertyManager)
public:
struct Data
{
Data() : val(-1) {}
int val;
QStringList enumNames;
QMap<int, QIcon> enumIcons;
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
};
class QtFlagPropertyManagerPrivate
{
QtFlagPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtFlagPropertyManager)
public:
void slotBoolChanged(QtProperty *property, bool value);
void slotPropertyDestroyed(QtProperty *property);
struct Data
{
Data() : val(-1) {}
int val;
QStringList flagNames;
};
typedef QMap<const QtProperty *, Data> PropertyValueMap;
PropertyValueMap m_values;
QtBoolPropertyManager *m_boolPropertyManager;
QMap<const QtProperty *, QList<QtProperty *> > m_propertyToFlags;
QMap<const QtProperty *, QtProperty *> m_flagToProperty;
};
class QtSizePolicyPropertyManagerPrivate
{
QtSizePolicyPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtSizePolicyPropertyManager)
public:
QtSizePolicyPropertyManagerPrivate();
void slotIntChanged(QtProperty *property, int value);
void slotEnumChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, QSizePolicy> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QtEnumPropertyManager *m_enumPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToHPolicy;
QMap<const QtProperty *, QtProperty *> m_propertyToVPolicy;
QMap<const QtProperty *, QtProperty *> m_propertyToHStretch;
QMap<const QtProperty *, QtProperty *> m_propertyToVStretch;
QMap<const QtProperty *, QtProperty *> m_hPolicyToProperty;
QMap<const QtProperty *, QtProperty *> m_vPolicyToProperty;
QMap<const QtProperty *, QtProperty *> m_hStretchToProperty;
QMap<const QtProperty *, QtProperty *> m_vStretchToProperty;
};
class QtFontPropertyManagerPrivate
{
QtFontPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtFontPropertyManager)
public:
QtFontPropertyManagerPrivate();
void slotIntChanged(QtProperty *property, int value);
void slotEnumChanged(QtProperty *property, int value);
void slotBoolChanged(QtProperty *property, bool value);
void slotPropertyDestroyed(QtProperty *property);
void slotFontDatabaseChanged();
void slotFontDatabaseDelayedChange();
QStringList m_familyNames;
typedef QMap<const QtProperty *, QFont> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QtEnumPropertyManager *m_enumPropertyManager;
QtBoolPropertyManager *m_boolPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToFamily;
QMap<const QtProperty *, QtProperty *> m_propertyToPointSize;
QMap<const QtProperty *, QtProperty *> m_propertyToBold;
QMap<const QtProperty *, QtProperty *> m_propertyToItalic;
QMap<const QtProperty *, QtProperty *> m_propertyToUnderline;
QMap<const QtProperty *, QtProperty *> m_propertyToStrikeOut;
QMap<const QtProperty *, QtProperty *> m_propertyToKerning;
QMap<const QtProperty *, QtProperty *> m_familyToProperty;
QMap<const QtProperty *, QtProperty *> m_pointSizeToProperty;
QMap<const QtProperty *, QtProperty *> m_boldToProperty;
QMap<const QtProperty *, QtProperty *> m_italicToProperty;
QMap<const QtProperty *, QtProperty *> m_underlineToProperty;
QMap<const QtProperty *, QtProperty *> m_strikeOutToProperty;
QMap<const QtProperty *, QtProperty *> m_kerningToProperty;
bool m_settingValue;
QTimer *m_fontDatabaseChangeTimer;
};
class QtColorPropertyManagerPrivate
{
QtColorPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtColorPropertyManager)
public:
void slotIntChanged(QtProperty *property, int value);
void slotPropertyDestroyed(QtProperty *property);
typedef QMap<const QtProperty *, QColor> PropertyValueMap;
PropertyValueMap m_values;
QtIntPropertyManager *m_intPropertyManager;
QMap<const QtProperty *, QtProperty *> m_propertyToR;
QMap<const QtProperty *, QtProperty *> m_propertyToG;
QMap<const QtProperty *, QtProperty *> m_propertyToB;
QMap<const QtProperty *, QtProperty *> m_propertyToA;
QMap<const QtProperty *, QtProperty *> m_rToProperty;
QMap<const QtProperty *, QtProperty *> m_gToProperty;
QMap<const QtProperty *, QtProperty *> m_bToProperty;
QMap<const QtProperty *, QtProperty *> m_aToProperty;
};
class QtCursorPropertyManagerPrivate
{
QtCursorPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtCursorPropertyManager)
public:
typedef QMap<const QtProperty *, QCursor> PropertyValueMap;
PropertyValueMap m_values;
};
#if QT_VERSION >= 0x040400
QT_END_NAMESPACE
#endif

@ -104,63 +104,6 @@ QT_BEGIN_NAMESPACE
class QtPropertyEditorView;
class QtTreePropertyBrowserPrivate
{
QtTreePropertyBrowser *q_ptr;
Q_DECLARE_PUBLIC(QtTreePropertyBrowser)
public:
QtTreePropertyBrowserPrivate();
void init(QWidget *parent);
void propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex);
void propertyRemoved(QtBrowserItem *index);
void propertyChanged(QtBrowserItem *index);
QWidget *createEditor(QtProperty *property, QWidget *parent) const
{ return q_ptr->createEditor(property, parent); }
QtProperty *indexToProperty(const QModelIndex &index) const;
QTreeWidgetItem *indexToItem(const QModelIndex &index) const;
QtBrowserItem *indexToBrowserItem(const QModelIndex &index) const;
bool lastColumn(int column) const;
void disableItem(QTreeWidgetItem *item) const;
void enableItem(QTreeWidgetItem *item) const;
bool hasValue(QTreeWidgetItem *item) const;
void slotCollapsed(const QModelIndex &index);
void slotExpanded(const QModelIndex &index);
QColor calculatedBackgroundColor(QtBrowserItem *item) const;
QtPropertyEditorView *treeWidget() const { return m_treeWidget; }
bool markPropertiesWithoutValue() const { return m_markPropertiesWithoutValue; }
QtBrowserItem *currentItem() const;
void setCurrentItem(QtBrowserItem *browserItem, bool block);
void editItem(QtBrowserItem *browserItem);
void slotCurrentBrowserItemChanged(QtBrowserItem *item);
void slotCurrentTreeItemChanged(QTreeWidgetItem *newItem, QTreeWidgetItem *);
QTreeWidgetItem *editedItem() const;
private:
void updateItem(QTreeWidgetItem *item);
QMap<QtBrowserItem *, QTreeWidgetItem *> m_indexToItem;
QMap<QTreeWidgetItem *, QtBrowserItem *> m_itemToIndex;
QMap<QtBrowserItem *, QColor> m_indexToBackgroundColor;
QtPropertyEditorView *m_treeWidget;
bool m_headerVisible;
QtTreePropertyBrowser::ResizeMode m_resizeMode;
class QtPropertyEditorDelegate *m_delegate;
bool m_markPropertiesWithoutValue;
bool m_browserChangedBlocked;
QIcon m_expandIcon;
};
// ------------ QtPropertyEditorView
class QtPropertyEditorView : public QTreeWidget
{
@ -499,8 +442,8 @@ void QtTreePropertyBrowserPrivate::init(QWidget *parent)
m_delegate = new QtPropertyEditorDelegate(parent);
m_delegate->setEditorPrivate(this);
m_treeWidget->setItemDelegate(m_delegate);
m_treeWidget->header()->setMovable(false);
m_treeWidget->header()->setResizeMode(QHeaderView::Stretch);
//m_treeWidget->header()->setMovable(false);
//m_treeWidget->header()->setResizeMode(QHeaderView::Stretch);
m_expandIcon = drawIndicatorIcon(q_ptr->palette(), q_ptr->style());
@ -912,7 +855,7 @@ void QtTreePropertyBrowser::setResizeMode(QtTreePropertyBrowser::ResizeMode mode
case QtTreePropertyBrowser::Stretch:
default: m = QHeaderView::Stretch; break;
}
d_ptr->m_treeWidget->header()->setResizeMode(m);
//d_ptr->m_treeWidget->header()->setResizeMode(m);
}
/*!
@ -1091,5 +1034,5 @@ void QtTreePropertyBrowser::editItem(QtBrowserItem *item)
QT_END_NAMESPACE
#endif
#include "moc_qttreepropertybrowser.cxx"
//#include "moc_qttreepropertybrowser.cxx"
#include "qttreepropertybrowser.moc"

@ -96,6 +96,7 @@ QT_BEGIN_NAMESPACE
class QTreeWidgetItem;
class QtTreePropertyBrowserPrivate;
class QtPropertyEditorView;
class QT_QTPROPERTYBROWSER_EXPORT QtTreePropertyBrowser : public QtAbstractPropertyBrowser
{
@ -177,6 +178,63 @@ private:
};
class QtTreePropertyBrowserPrivate
{
QtTreePropertyBrowser *q_ptr;
Q_DECLARE_PUBLIC(QtTreePropertyBrowser)
public:
QtTreePropertyBrowserPrivate();
void init(QWidget *parent);
void propertyInserted(QtBrowserItem *index, QtBrowserItem *afterIndex);
void propertyRemoved(QtBrowserItem *index);
void propertyChanged(QtBrowserItem *index);
QWidget *createEditor(QtProperty *property, QWidget *parent) const
{ return q_ptr->createEditor(property, parent); }
QtProperty *indexToProperty(const QModelIndex &index) const;
QTreeWidgetItem *indexToItem(const QModelIndex &index) const;
QtBrowserItem *indexToBrowserItem(const QModelIndex &index) const;
bool lastColumn(int column) const;
void disableItem(QTreeWidgetItem *item) const;
void enableItem(QTreeWidgetItem *item) const;
bool hasValue(QTreeWidgetItem *item) const;
void slotCollapsed(const QModelIndex &index);
void slotExpanded(const QModelIndex &index);
QColor calculatedBackgroundColor(QtBrowserItem *item) const;
QtPropertyEditorView *treeWidget() const { return m_treeWidget; }
bool markPropertiesWithoutValue() const { return m_markPropertiesWithoutValue; }
QtBrowserItem *currentItem() const;
void setCurrentItem(QtBrowserItem *browserItem, bool block);
void editItem(QtBrowserItem *browserItem);
void slotCurrentBrowserItemChanged(QtBrowserItem *item);
void slotCurrentTreeItemChanged(QTreeWidgetItem *newItem, QTreeWidgetItem *);
QTreeWidgetItem *editedItem() const;
private:
void updateItem(QTreeWidgetItem *item);
QMap<QtBrowserItem *, QTreeWidgetItem *> m_indexToItem;
QMap<QTreeWidgetItem *, QtBrowserItem *> m_itemToIndex;
QMap<QtBrowserItem *, QColor> m_indexToBackgroundColor;
QtPropertyEditorView *m_treeWidget;
bool m_headerVisible;
QtTreePropertyBrowser::ResizeMode m_resizeMode;
class QtPropertyEditorDelegate *m_delegate;
bool m_markPropertiesWithoutValue;
bool m_browserChangedBlocked;
QIcon m_expandIcon;
};
#if QT_VERSION >= 0x040400
QT_END_NAMESPACE
#endif

@ -278,85 +278,6 @@ void QtVariantProperty::setAttribute(const QString &attribute, const QVariant &v
d_ptr->manager->setAttribute(this, attribute, value);
}
class QtVariantPropertyManagerPrivate
{
QtVariantPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtVariantPropertyManager)
public:
QtVariantPropertyManagerPrivate();
bool m_creatingProperty;
bool m_creatingSubProperties;
bool m_destroyingSubProperties;
int m_propertyType;
void slotValueChanged(QtProperty *property, int val);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotValueChanged(QtProperty *property, double val);
void slotRangeChanged(QtProperty *property, double min, double max);
void slotSingleStepChanged(QtProperty *property, double step);
void slotDecimalsChanged(QtProperty *property, int prec);
void slotValueChanged(QtProperty *property, bool val);
void slotValueChanged(QtProperty *property, const QString &val);
void slotRegExpChanged(QtProperty *property, const QRegExp &regExp);
void slotValueChanged(QtProperty *property, const QDate &val);
void slotRangeChanged(QtProperty *property, const QDate &min, const QDate &max);
void slotValueChanged(QtProperty *property, const QTime &val);
void slotValueChanged(QtProperty *property, const QDateTime &val);
void slotValueChanged(QtProperty *property, const QKeySequence &val);
void slotValueChanged(QtProperty *property, const QChar &val);
void slotValueChanged(QtProperty *property, const QLocale &val);
void slotValueChanged(QtProperty *property, const QPoint &val);
void slotValueChanged(QtProperty *property, const QPointF &val);
void slotValueChanged(QtProperty *property, const QSize &val);
void slotRangeChanged(QtProperty *property, const QSize &min, const QSize &max);
void slotValueChanged(QtProperty *property, const QSizeF &val);
void slotRangeChanged(QtProperty *property, const QSizeF &min, const QSizeF &max);
void slotValueChanged(QtProperty *property, const QRect &val);
void slotConstraintChanged(QtProperty *property, const QRect &val);
void slotValueChanged(QtProperty *property, const QRectF &val);
void slotConstraintChanged(QtProperty *property, const QRectF &val);
void slotValueChanged(QtProperty *property, const QColor &val);
void slotEnumChanged(QtProperty *property, int val);
void slotEnumNamesChanged(QtProperty *property, const QStringList &enumNames);
void slotEnumIconsChanged(QtProperty *property, const QMap<int, QIcon> &enumIcons);
void slotValueChanged(QtProperty *property, const QSizePolicy &val);
void slotValueChanged(QtProperty *property, const QFont &val);
void slotValueChanged(QtProperty *property, const QCursor &val);
void slotFlagChanged(QtProperty *property, int val);
void slotFlagNamesChanged(QtProperty *property, const QStringList &flagNames);
void slotPropertyInserted(QtProperty *property, QtProperty *parent, QtProperty *after);
void slotPropertyRemoved(QtProperty *property, QtProperty *parent);
void valueChanged(QtProperty *property, const QVariant &val);
int internalPropertyToType(QtProperty *property) const;
QtVariantProperty *createSubProperty(QtVariantProperty *parent, QtVariantProperty *after,
QtProperty *internal);
void removeSubProperty(QtVariantProperty *property);
QMap<int, QtAbstractPropertyManager *> m_typeToPropertyManager;
QMap<int, QMap<QString, int> > m_typeToAttributeToAttributeType;
QMap<const QtProperty *, QPair<QtVariantProperty *, int> > m_propertyToType;
QMap<int, int> m_typeToValueType;
QMap<QtProperty *, QtVariantProperty *> m_internalToProperty;
const QString m_constraintAttribute;
const QString m_singleStepAttribute;
const QString m_decimalsAttribute;
const QString m_enumIconsAttribute;
const QString m_enumNamesAttribute;
const QString m_flagNamesAttribute;
const QString m_maximumAttribute;
const QString m_minimumAttribute;
const QString m_regExpAttribute;
};
QtVariantPropertyManagerPrivate::QtVariantPropertyManagerPrivate() :
m_constraintAttribute(QLatin1String("constraint")),
m_singleStepAttribute(QLatin1String("singleStep")),

@ -170,6 +170,85 @@ private:
Q_DISABLE_COPY(QtVariantEditorFactory)
};
class QtVariantPropertyManagerPrivate
{
QtVariantPropertyManager *q_ptr;
Q_DECLARE_PUBLIC(QtVariantPropertyManager)
public:
QtVariantPropertyManagerPrivate();
bool m_creatingProperty;
bool m_creatingSubProperties;
bool m_destroyingSubProperties;
int m_propertyType;
void slotValueChanged(QtProperty *property, int val);
void slotRangeChanged(QtProperty *property, int min, int max);
void slotSingleStepChanged(QtProperty *property, int step);
void slotValueChanged(QtProperty *property, double val);
void slotRangeChanged(QtProperty *property, double min, double max);
void slotSingleStepChanged(QtProperty *property, double step);
void slotDecimalsChanged(QtProperty *property, int prec);
void slotValueChanged(QtProperty *property, bool val);
void slotValueChanged(QtProperty *property, const QString &val);
void slotRegExpChanged(QtProperty *property, const QRegExp &regExp);
void slotValueChanged(QtProperty *property, const QDate &val);
void slotRangeChanged(QtProperty *property, const QDate &min, const QDate &max);
void slotValueChanged(QtProperty *property, const QTime &val);
void slotValueChanged(QtProperty *property, const QDateTime &val);
void slotValueChanged(QtProperty *property, const QKeySequence &val);
void slotValueChanged(QtProperty *property, const QChar &val);
void slotValueChanged(QtProperty *property, const QLocale &val);
void slotValueChanged(QtProperty *property, const QPoint &val);
void slotValueChanged(QtProperty *property, const QPointF &val);
void slotValueChanged(QtProperty *property, const QSize &val);
void slotRangeChanged(QtProperty *property, const QSize &min, const QSize &max);
void slotValueChanged(QtProperty *property, const QSizeF &val);
void slotRangeChanged(QtProperty *property, const QSizeF &min, const QSizeF &max);
void slotValueChanged(QtProperty *property, const QRect &val);
void slotConstraintChanged(QtProperty *property, const QRect &val);
void slotValueChanged(QtProperty *property, const QRectF &val);
void slotConstraintChanged(QtProperty *property, const QRectF &val);
void slotValueChanged(QtProperty *property, const QColor &val);
void slotEnumChanged(QtProperty *property, int val);
void slotEnumNamesChanged(QtProperty *property, const QStringList &enumNames);
void slotEnumIconsChanged(QtProperty *property, const QMap<int, QIcon> &enumIcons);
void slotValueChanged(QtProperty *property, const QSizePolicy &val);
void slotValueChanged(QtProperty *property, const QFont &val);
void slotValueChanged(QtProperty *property, const QCursor &val);
void slotFlagChanged(QtProperty *property, int val);
void slotFlagNamesChanged(QtProperty *property, const QStringList &flagNames);
void slotPropertyInserted(QtProperty *property, QtProperty *parent, QtProperty *after);
void slotPropertyRemoved(QtProperty *property, QtProperty *parent);
void valueChanged(QtProperty *property, const QVariant &val);
int internalPropertyToType(QtProperty *property) const;
QtVariantProperty *createSubProperty(QtVariantProperty *parent, QtVariantProperty *after,
QtProperty *internal);
void removeSubProperty(QtVariantProperty *property);
QMap<int, QtAbstractPropertyManager *> m_typeToPropertyManager;
QMap<int, QMap<QString, int> > m_typeToAttributeToAttributeType;
QMap<const QtProperty *, QPair<QtVariantProperty *, int> > m_propertyToType;
QMap<int, int> m_typeToValueType;
QMap<QtProperty *, QtVariantProperty *> m_internalToProperty;
const QString m_constraintAttribute;
const QString m_singleStepAttribute;
const QString m_decimalsAttribute;
const QString m_enumIconsAttribute;
const QString m_enumNamesAttribute;
const QString m_flagNamesAttribute;
const QString m_maximumAttribute;
const QString m_minimumAttribute;
const QString m_regExpAttribute;
};
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QIcon)

Loading…
Cancel
Save