summaryrefslogtreecommitdiffstats
path: root/tests/auto/uic
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-09-08 08:51:31 (GMT)
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2010-09-08 08:51:31 (GMT)
commit6bcdb38b5bdf8f0176db3f372d4b8c8b14ba459f (patch)
tree0705d016f6b5b5d506aff73d2c966b7b3682ff32 /tests/auto/uic
parent0901337e0c23910f265f0991b9fc6875efafedaf (diff)
downloadQt-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 'tests/auto/uic')
-rw-r--r--tests/auto/uic/baseline/icontheme.ui55
-rw-r--r--tests/auto/uic/baseline/icontheme.ui.h95
2 files changed, 150 insertions, 0 deletions
diff --git a/tests/auto/uic/baseline/icontheme.ui b/tests/auto/uic/baseline/icontheme.ui
new file mode 100644
index 0000000..a214635
--- /dev/null
+++ b/tests/auto/uic/baseline/icontheme.ui
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>122</width>
+ <height>117</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QPushButton" name="fileicon">
+ <property name="text">
+ <string>fileicon</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>image1.png</normaloff>image1.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="fileandthemeicon">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ <property name="icon">
+ <iconset theme="edit-copy">
+ <normaloff>image7.png</normaloff>image7.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="themeicon">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ <property name="icon">
+ <iconset theme="edit-copy">
+ <normaloff/>
+ </iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/auto/uic/baseline/icontheme.ui.h b/tests/auto/uic/baseline/icontheme.ui.h
new file mode 100644
index 0000000..946fff9
--- /dev/null
+++ b/tests/auto/uic/baseline/icontheme.ui.h
@@ -0,0 +1,95 @@
+/********************************************************************************
+** Form generated from reading UI file 'icontheme.ui'
+**
+** Created: Thu Sep 2 10:28:19 2010
+** by: Qt User Interface Compiler version 4.8.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef ICONTHEME_H
+#define ICONTHEME_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QHeaderView>
+#include <QtGui/QPushButton>
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Form
+{
+public:
+ QVBoxLayout *verticalLayout;
+ QPushButton *fileicon;
+ QPushButton *fileandthemeicon;
+ QPushButton *themeicon;
+
+ void setupUi(QWidget *Form)
+ {
+ if (Form->objectName().isEmpty())
+ Form->setObjectName(QString::fromUtf8("Form"));
+ Form->resize(122, 117);
+ verticalLayout = new QVBoxLayout(Form);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+ fileicon = new QPushButton(Form);
+ fileicon->setObjectName(QString::fromUtf8("fileicon"));
+ QIcon icon;
+ icon.addFile(QString::fromUtf8("image1.png"), QSize(), QIcon::Normal, QIcon::Off);
+ fileicon->setIcon(icon);
+
+ verticalLayout->addWidget(fileicon);
+
+ fileandthemeicon = new QPushButton(Form);
+ fileandthemeicon->setObjectName(QString::fromUtf8("fileandthemeicon"));
+ QIcon icon1;
+ QString iconThemeName = QString::fromUtf8("edit-copy");
+ if (QIcon::hasThemeIcon(iconThemeName)) {
+ icon1 = QIcon::fromTheme(iconThemeName);
+ } else {
+ icon1.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Normal, QIcon::Off);
+ }
+ fileandthemeicon->setIcon(icon1);
+
+ verticalLayout->addWidget(fileandthemeicon);
+
+ themeicon = new QPushButton(Form);
+ themeicon->setObjectName(QString::fromUtf8("themeicon"));
+ QIcon icon2;
+ iconThemeName = QString::fromUtf8("edit-copy");
+ if (QIcon::hasThemeIcon(iconThemeName)) {
+ icon2 = QIcon::fromTheme(iconThemeName);
+ } else {
+ icon2.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon::Off);
+ }
+ themeicon->setIcon(icon2);
+
+ verticalLayout->addWidget(themeicon);
+
+
+ retranslateUi(Form);
+
+ QMetaObject::connectSlotsByName(Form);
+ } // setupUi
+
+ void retranslateUi(QWidget *Form)
+ {
+ Form->setWindowTitle(QApplication::translate("Form", "Form", 0, QApplication::UnicodeUTF8));
+ fileicon->setText(QApplication::translate("Form", "fileicon", 0, QApplication::UnicodeUTF8));
+ fileandthemeicon->setText(QApplication::translate("Form", "PushButton", 0, QApplication::UnicodeUTF8));
+ themeicon->setText(QApplication::translate("Form", "PushButton", 0, QApplication::UnicodeUTF8));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class Form: public Ui_Form {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // ICONTHEME_H