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 /src/tools/uic/ui4.cpp | |
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 'src/tools/uic/ui4.cpp')
-rw-r--r-- | src/tools/uic/ui4.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tools/uic/ui4.cpp b/src/tools/uic/ui4.cpp index e80523f..1988696 100644 --- a/src/tools/uic/ui4.cpp +++ b/src/tools/uic/ui4.cpp @@ -7745,6 +7745,7 @@ void DomResourceIcon::clear(bool clear_all) if (clear_all) { m_text = QLatin1String(""); + m_has_attr_theme = false; m_has_attr_resource = false; } @@ -7762,6 +7763,7 @@ void DomResourceIcon::clear(bool clear_all) DomResourceIcon::DomResourceIcon() { m_children = 0; + m_has_attr_theme = false; m_has_attr_resource = false; m_text = QLatin1String(""); m_normalOff = 0; @@ -7791,6 +7793,10 @@ void DomResourceIcon::read(QXmlStreamReader &reader) foreach (const QXmlStreamAttribute &attribute, reader.attributes()) { QStringRef name = attribute.name(); + if (name == QLatin1String("theme")) { + setAttributeTheme(attribute.value().toString()); + continue; + } if (name == QLatin1String("resource")) { setAttributeResource(attribute.value().toString()); continue; @@ -7869,6 +7875,8 @@ void DomResourceIcon::read(QXmlStreamReader &reader) #ifdef QUILOADER_QDOM_READ void DomResourceIcon::read(const QDomElement &node) { + if (node.hasAttribute(QLatin1String("theme"))) + setAttributeTheme(node.attribute(QLatin1String("theme"))); if (node.hasAttribute(QLatin1String("resource"))) setAttributeResource(node.attribute(QLatin1String("resource"))); @@ -7938,6 +7946,9 @@ void DomResourceIcon::write(QXmlStreamWriter &writer, const QString &tagName) co { writer.writeStartElement(tagName.isEmpty() ? QString::fromUtf8("resourceicon") : tagName.toLower()); + if (hasAttributeTheme()) + writer.writeAttribute(QLatin1String("theme"), attributeTheme()); + if (hasAttributeResource()) writer.writeAttribute(QLatin1String("resource"), attributeResource()); |