diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-02-07 15:52:38 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-04-10 21:01:07 +0200 |
commit | b79cb3dd659c71560dd0324893cbdfe41a42f9dc (patch) | |
tree | b3ed0fb2f0331948f0f1f58f7310f48789ef185c /tests/auto/tools/uic/baseline | |
parent | 73948d782a17d291c8095c45dfd4c1f4228a4e6d (diff) |
uic: Write QIcon theme enums
Split out some helpers to write the theme code with path fallback
checking for the enum case (identified by a fully qualified icon) or
the old XDG/filename case.
Task-number: QTBUG-121823
Pick-to: 6.7
Change-Id: If2755483ab899f04e372cf95443f7e03970f6e7f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'tests/auto/tools/uic/baseline')
-rw-r--r-- | tests/auto/tools/uic/baseline/icontheme.ui | 29 | ||||
-rw-r--r-- | tests/auto/tools/uic/baseline/icontheme.ui.h | 33 |
2 files changed, 49 insertions, 13 deletions
diff --git a/tests/auto/tools/uic/baseline/icontheme.ui b/tests/auto/tools/uic/baseline/icontheme.ui index a21463561b..328e86602b 100644 --- a/tests/auto/tools/uic/baseline/icontheme.ui +++ b/tests/auto/tools/uic/baseline/icontheme.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>122</width> - <height>117</height> + <width>343</width> + <height>478</height> </rect> </property> <property name="windowTitle"> @@ -42,9 +42,28 @@ <string>PushButton</string> </property> <property name="icon"> - <iconset theme="edit-copy"> - <normaloff/> - </iconset> + <iconset theme="edit-copy"/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="themeenum"> + <property name="text"> + <string>PushButton</string> + </property> + <property name="icon"> + <iconset theme="QIcon::ThemeIcon::EditCopy"/> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="fileandthemeenum"> + <property name="text"> + <string>PushButton</string> + </property> + <property name="icon"> + <iconset theme="QIcon::ThemeIcon::EditCopy"> + <normaloff>image7.png</normaloff>image7.png</iconset> </property> </widget> </item> diff --git a/tests/auto/tools/uic/baseline/icontheme.ui.h b/tests/auto/tools/uic/baseline/icontheme.ui.h index e73326c4c7..633ba81d37 100644 --- a/tests/auto/tools/uic/baseline/icontheme.ui.h +++ b/tests/auto/tools/uic/baseline/icontheme.ui.h @@ -25,12 +25,14 @@ public: QPushButton *fileicon; QPushButton *fileandthemeicon; QPushButton *themeicon; + QPushButton *themeenum; + QPushButton *fileandthemeenum; void setupUi(QWidget *Form) { if (Form->objectName().isEmpty()) Form->setObjectName("Form"); - Form->resize(122, 117); + Form->resize(343, 478); verticalLayout = new QVBoxLayout(Form); verticalLayout->setObjectName("verticalLayout"); fileicon = new QPushButton(Form); @@ -56,17 +58,30 @@ public: themeicon = new QPushButton(Form); themeicon->setObjectName("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); - } + QIcon icon2(QIcon::fromTheme(QString::fromUtf8("edit-copy"))); themeicon->setIcon(icon2); verticalLayout->addWidget(themeicon); + themeenum = new QPushButton(Form); + themeenum->setObjectName("themeenum"); + QIcon icon3(QIcon::fromTheme(QIcon::ThemeIcon::EditCopy)); + themeenum->setIcon(icon3); + + verticalLayout->addWidget(themeenum); + + fileandthemeenum = new QPushButton(Form); + fileandthemeenum->setObjectName("fileandthemeenum"); + QIcon icon4; + if (QIcon::hasThemeIcon(QIcon::ThemeIcon::EditCopy)) { + icon4 = QIcon::fromTheme(QIcon::ThemeIcon::EditCopy); + } else { + icon4.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Normal, QIcon::Off); + } + fileandthemeenum->setIcon(icon4); + + verticalLayout->addWidget(fileandthemeenum); + retranslateUi(Form); @@ -79,6 +94,8 @@ public: fileicon->setText(QCoreApplication::translate("Form", "fileicon", nullptr)); fileandthemeicon->setText(QCoreApplication::translate("Form", "PushButton", nullptr)); themeicon->setText(QCoreApplication::translate("Form", "PushButton", nullptr)); + themeenum->setText(QCoreApplication::translate("Form", "PushButton", nullptr)); + fileandthemeenum->setText(QCoreApplication::translate("Form", "PushButton", nullptr)); } // retranslateUi }; |