diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2010-09-08 08:51:31 (GMT) |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2010-09-08 08:51:31 (GMT) |
commit | 6bcdb38b5bdf8f0176db3f372d4b8c8b14ba459f (patch) | |
tree | 0705d016f6b5b5d506aff73d2c966b7b3682ff32 /tools/designer/src/components/formeditor | |
parent | 0901337e0c23910f265f0991b9fc6875efafedaf (diff) | |
download | Qt-6bcdb38b5bdf8f0176db3f372d4b8c8b14ba459f.zip Qt-6bcdb38b5bdf8f0176db3f372d4b8c8b14ba459f.tar.gz Qt-6bcdb38b5bdf8f0176db3f372d4b8c8b14ba459f.tar.bz2 |
Designer/uic: Start on support for QIcon::fromTheme().
Schemas: Add "theme" attribute to <iconset> element of the UI format.
uic: Extend it to generate the code for icons with themes and/or resource
paths, add auto-test for it.
Designer: Add 'theme'-member to PropertySheetIconValue + convenience
functions including subproperty mask handling and simplify the existing
code. Add new class IconThemeEditor to be used in action editor dialog and
property editor. Theme names can now be specified in the action editor
dialog.
Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com>
Task-number: QTBUG-7777
Diffstat (limited to 'tools/designer/src/components/formeditor')
-rw-r--r-- | tools/designer/src/components/formeditor/qdesigner_resource.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp index 6c458f3..a29bc1f 100644 --- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp @@ -171,7 +171,7 @@ QDesignerResourceBuilder::QDesignerResourceBuilder(QDesignerFormEditorInterface { } -static inline void setIconPixmap(QIcon::Mode m, QIcon::State s, const QDir &workingDirectory, +static inline void setIconPixmap(QIcon::Mode m, QIcon::State s, const QDir &workingDirectory, QString path, PropertySheetIconValue &icon, const QDesignerLanguageExtension *lang = 0) { @@ -203,6 +203,7 @@ QVariant QDesignerResourceBuilder::loadResource(const QDir &workingDirectory, co case DomProperty::IconSet: { PropertySheetIconValue icon; DomResourceIcon *di = property->elementIconSet(); + icon.setTheme(di->attributeTheme()); if (const int flags = iconStateFlags(di)) { // new, post 4.4 format if (flags & NormalOff) setIconPixmap(QIcon::Normal, QIcon::Off, workingDirectory, di->elementNormalOff()->text(), icon, m_lang); @@ -278,8 +279,11 @@ DomProperty *QDesignerResourceBuilder::saveResource(const QDir &workingDirectory } else if (value.canConvert<PropertySheetIconValue>()) { const PropertySheetIconValue icon = qvariant_cast<PropertySheetIconValue>(value); const QMap<QPair<QIcon::Mode, QIcon::State>, PropertySheetPixmapValue> pixmaps = icon.paths(); - if (!pixmaps.isEmpty()) { + const QString theme = icon.theme(); + if (!pixmaps.isEmpty() || !theme.isEmpty()) { DomResourceIcon *ri = new DomResourceIcon; + if (!theme.isEmpty()) + ri->setAttributeTheme(theme); QMapIterator<QPair<QIcon::Mode, QIcon::State>, PropertySheetPixmapValue> itPix(pixmaps); while (itPix.hasNext()) { const QIcon::Mode mode = itPix.next().key().first; |