summaryrefslogtreecommitdiffstats
path: root/tools/designer
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2009-07-24 08:52:29 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2009-07-24 08:52:29 (GMT)
commitd32922a417f20fed56f6f4837d8bfdf2899e3d3c (patch)
tree07aa5662fc96454a3ec0d0c2d85a2d061010675e /tools/designer
parentb4f2e138422076ed5d615181fc336dbb90279935 (diff)
parent9dadc219814cd9baaa4be4cee6ee2b3cf7df4a19 (diff)
downloadQt-d32922a417f20fed56f6f4837d8bfdf2899e3d3c.zip
Qt-d32922a417f20fed56f6f4837d8bfdf2899e3d3c.tar.gz
Qt-d32922a417f20fed56f6f4837d8bfdf2899e3d3c.tar.bz2
Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt
Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.h src/3rdparty/webkit/WebCore/page/DragController.cpp src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp src/3rdparty/webkit/WebKit/qt/ChangeLog src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp src/gui/painting/qpaintengineex_p.h tools/linguist/lupdate/main.cpp
Diffstat (limited to 'tools/designer')
-rw-r--r--tools/designer/src/lib/shared/qdesigner_propertysheet.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp
index f43b527..5b22a86 100644
--- a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp
@@ -1381,6 +1381,24 @@ bool QDesignerPropertySheet::isFakeLayoutProperty(int index) const
return false;
}
+// Determine the "designable" state of a property. Properties, which have
+// a per-object boolean test function that returns false are shown in
+// disabled state ("checked" depending on "checkable", etc.)
+// Properties, which are generally not designable independent
+// of the object are not shown at all.
+enum DesignableState { PropertyIsDesignable,
+ // Object has a Designable test function that returns false.
+ PropertyOfObjectNotDesignable,
+ PropertyNotDesignable };
+
+static inline DesignableState designableState(const QDesignerMetaPropertyInterface *p, const QObject *object)
+{
+ if (p->attributes(object) & QDesignerMetaPropertyInterface::DesignableAttribute)
+ return PropertyIsDesignable;
+ return (p->attributes() & QDesignerMetaPropertyInterface::DesignableAttribute) ?
+ PropertyOfObjectNotDesignable : PropertyNotDesignable;
+}
+
bool QDesignerPropertySheet::isVisible(int index) const
{
if (d->invalidIndex(Q_FUNC_INFO, index))
@@ -1450,9 +1468,8 @@ bool QDesignerPropertySheet::isVisible(int index) const
if (!(p->accessFlags() & QDesignerMetaPropertyInterface::WriteAccess))
return false;
- // Enabled handling
- return (p->attributes(d->m_object) & QDesignerMetaPropertyInterface::DesignableAttribute) ||
- (p->attributes() & QDesignerMetaPropertyInterface::DesignableAttribute);
+ // Enabled handling: Hide only statically not designable properties
+ return designableState(p, d->m_object) != PropertyNotDesignable;
}
void QDesignerPropertySheet::setVisible(int index, bool visible)
@@ -1482,9 +1499,12 @@ bool QDesignerPropertySheet::isEnabled(int index) const
if (d->m_info.value(index).visible == true) // Sun CC 5.5 oddity, wants true
return true;
+ // Enable setting of properties for statically non-designable properties
+ // as this might be done via TaskMenu/Cursor::setProperty. Note that those
+ // properties are not visible.
const QDesignerMetaPropertyInterface *p = d->m_meta->property(index);
return (p->accessFlags() & QDesignerMetaPropertyInterface::WriteAccess) &&
- (p->attributes(d->m_object) & QDesignerMetaPropertyInterface::DesignableAttribute);
+ designableState(p, d->m_object) != PropertyOfObjectNotDesignable;
}
bool QDesignerPropertySheet::isAttribute(int index) const