diff options
Diffstat (limited to 'tools/designer')
-rw-r--r-- | tools/designer/src/components/propertyeditor/designerpropertymanager.cpp | 7 | ||||
-rw-r--r-- | tools/designer/src/designer/Info_mac.plist | 2 | ||||
-rw-r--r-- | tools/designer/src/designer/designer.pro | 3 | ||||
-rw-r--r-- | tools/designer/src/designer/uifile.icns | bin | 0 -> 123696 bytes | |||
-rw-r--r-- | tools/designer/src/lib/shared/qdesigner_propertysheet.cpp | 28 | ||||
-rw-r--r-- | tools/designer/src/lib/shared/widgetfactory.cpp | 6 |
6 files changed, 37 insertions, 9 deletions
diff --git a/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp b/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp index fb1a5bb34..ca55b1577 100644 --- a/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp +++ b/tools/designer/src/components/propertyeditor/designerpropertymanager.cpp @@ -254,8 +254,11 @@ void TextEditor::resourceActionActivated() { QString oldPath = m_editor->text(); if (oldPath.startsWith(QLatin1String("qrc:"))) - oldPath = oldPath.mid(4); - const QString newPath = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), oldPath, this); + oldPath.remove(0, 4); + // returns ':/file' + QString newPath = IconSelector::choosePixmapResource(m_core, m_core->resourceModel(), oldPath, this); + if (newPath.startsWith(QLatin1Char(':'))) + newPath.remove(0, 1); if (newPath.isEmpty() || newPath == oldPath) return; const QString newText = QLatin1String("qrc:") + newPath; diff --git a/tools/designer/src/designer/Info_mac.plist b/tools/designer/src/designer/Info_mac.plist index 8632a6df3..f19176fa7 100644 --- a/tools/designer/src/designer/Info_mac.plist +++ b/tools/designer/src/designer/Info_mac.plist @@ -22,7 +22,7 @@ <string>ui</string> </array> <key>CFBundleTypeIconFile</key> - <string>@ICON@</string> + <string>uifile.icns</string> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSIsAppleDefaultForType</key> diff --git a/tools/designer/src/designer/designer.pro b/tools/designer/src/designer/designer.pro index e7fa03874..aa6850c3b 100644 --- a/tools/designer/src/designer/designer.pro +++ b/tools/designer/src/designer/designer.pro @@ -78,6 +78,9 @@ mac { ICON = designer.icns QMAKE_INFO_PLIST = Info_mac.plist TARGET = Designer + FILETYPES.files = uifile.icns + FILETYPES.path = Contents/Resources + QMAKE_BUNDLE_DATA += FILETYPES } target.path=$$[QT_INSTALL_BINS] diff --git a/tools/designer/src/designer/uifile.icns b/tools/designer/src/designer/uifile.icns Binary files differnew file mode 100644 index 000000000..2473ea4dc --- /dev/null +++ b/tools/designer/src/designer/uifile.icns diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp index f43b52714..5b22a868e 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 diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp index 6c45daf12..7080ed315 100644 --- a/tools/designer/src/lib/shared/widgetfactory.cpp +++ b/tools/designer/src/lib/shared/widgetfactory.cpp @@ -834,9 +834,11 @@ bool WidgetFactory::isPassiveInteractor(QWidget *widget) if (isTabBarInteractor(tabBar)) m_lastWasAPassiveInteractor = true; return m_lastWasAPassiveInteractor; - } else if (qobject_cast<QSizeGrip*>(widget)) +#ifndef QT_NO_SIZEGRIP + } else if (qobject_cast<QSizeGrip*>(widget)) { return (m_lastWasAPassiveInteractor = true); - else if (qobject_cast<QMdiSubWindow*>(widget)) +#endif + } else if (qobject_cast<QMdiSubWindow*>(widget)) return (m_lastWasAPassiveInteractor = true); else if (qobject_cast<QAbstractButton*>(widget) && (qobject_cast<QTabBar*>(widget->parent()) || qobject_cast<QToolBox*>(widget->parent()))) return (m_lastWasAPassiveInteractor = true); |