Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add missing setValue and fix valueChanged error
  • Loading branch information
Levi-Armstrong committed Aug 17, 2015
commit 6646933e1b428877d2edf176174ad56865c2a211
15 changes: 13 additions & 2 deletions qtpropertybrowser/src/qtvariantproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ class QtVariantPropertyManagerPrivate
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 QVector3D &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);
Expand Down Expand Up @@ -616,6 +617,11 @@ void QtVariantPropertyManagerPrivate::slotValueChanged(QtProperty *property, con
valueChanged(property, QVariant(val));
}

void QtVariantPropertyManagerPrivate::slotValueChanged(QtProperty *property, const QVector3D &val)
{
valueChanged(property, QVariant(val));
}

void QtVariantPropertyManagerPrivate::slotValueChanged(QtProperty *property, const QSize &val)
{
valueChanged(property, QVariant(val));
Expand Down Expand Up @@ -1115,8 +1121,8 @@ QtVariantPropertyManager::QtVariantPropertyManager(QObject *parent)
d_ptr->m_typeToValueType[QVariant::Vector3D] = QVariant::Vector3D;
d_ptr->m_typeToAttributeToAttributeType[QVariant::Vector3D][d_ptr->m_decimalsAttribute] =
QVariant::Int;
connect(vector3dPropertyManager, SIGNAL(valueChanged(QtProperty *, const Vector3D &)),
this, SLOT(slotValueChanged(QtProperty *, const Vector3D &)));
connect(vector3dPropertyManager, SIGNAL(valueChanged(QtProperty *, const QVector3D &)),
this, SLOT(slotValueChanged(QtProperty *, const QVector3D &)));
connect(vector3dPropertyManager, SIGNAL(decimalsChanged(QtProperty *, int)),
this, SLOT(slotDecimalsChanged(QtProperty *, int)));
connect(vector3dPropertyManager->subDoublePropertyManager(), SIGNAL(valueChanged(QtProperty *, double)),
Expand Down Expand Up @@ -1419,6 +1425,8 @@ QVariant QtVariantPropertyManager::value(const QtProperty *property) const
return pointManager->value(internProp);
} else if (QtPointFPropertyManager *pointFManager = qobject_cast<QtPointFPropertyManager *>(manager)) {
return pointFManager->value(internProp);
} else if (QtVector3dPropertyManager *vector3dManager = qobject_cast<QtVector3dPropertyManager *>(manager)) {
return vector3dManager->value(internProp);
} else if (QtSizePropertyManager *sizeManager = qobject_cast<QtSizePropertyManager *>(manager)) {
return sizeManager->value(internProp);
} else if (QtSizeFPropertyManager *sizeFManager = qobject_cast<QtSizeFPropertyManager *>(manager)) {
Expand Down Expand Up @@ -1705,6 +1713,9 @@ void QtVariantPropertyManager::setValue(QtProperty *property, const QVariant &va
} else if (QtPointFPropertyManager *pointFManager = qobject_cast<QtPointFPropertyManager *>(manager)) {
pointFManager->setValue(internProp, qVariantValue<QPointF>(val));
return;
} else if (QtVector3dPropertyManager *vector3dManager = qobject_cast<QtVector3dPropertyManager *>(manager)) {
vector3dManager->setValue(internProp, qVariantValue<QVector3D>(val));
return;
} else if (QtSizePropertyManager *sizeManager = qobject_cast<QtSizePropertyManager *>(manager)) {
sizeManager->setValue(internProp, qVariantValue<QSize>(val));
return;
Expand Down
1 change: 1 addition & 0 deletions qtpropertybrowser/src/qtvariantproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public Q_SLOTS:
Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, const QLocale &))
Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, const QPoint &))
Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, const QPointF &))
Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, const QVector3D &))
Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, const QSize &))
Q_PRIVATE_SLOT(d_func(), void slotRangeChanged(QtProperty *, const QSize &, const QSize &))
Q_PRIVATE_SLOT(d_func(), void slotValueChanged(QtProperty *, const QSizeF &))
Expand Down