mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-08 02:17:43 +08:00
6.5.3 clean
This commit is contained in:
@ -56,6 +56,10 @@ set(tst_qicon_resource_files
|
||||
"./icons/themeparent/index.theme"
|
||||
"./icons/themeparent/scalable/actions/address-book-new.svg"
|
||||
"./icons/themeparent/scalable/actions/appointment-new.svg"
|
||||
"./icons/fallbacktheme/index.theme"
|
||||
"./icons/fallbacktheme/16x16/edit-cut.png"
|
||||
"./icons/hicolor/index.theme"
|
||||
"./icons/hicolor/16x16/hicolor-icon.png"
|
||||
"./second_icons/testtheme/32x32/actions/appointment-new.png"
|
||||
"./styles/commonstyle/images/standardbutton-open-128.png"
|
||||
"./styles/commonstyle/images/standardbutton-open-16.png"
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 267 B |
@ -0,0 +1,8 @@
|
||||
[Icon Theme]
|
||||
Name=fallbacktheme
|
||||
|
||||
Directories=16x16
|
||||
|
||||
[16x16]
|
||||
Size=16
|
||||
Type=Fixed
|
BIN
tests/auto/gui/image/qicon/icons/hicolor/16x16/hicolor-icon.png
Normal file
BIN
tests/auto/gui/image/qicon/icons/hicolor/16x16/hicolor-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 267 B |
11
tests/auto/gui/image/qicon/icons/hicolor/index.theme
Normal file
11
tests/auto/gui/image/qicon/icons/hicolor/index.theme
Normal file
@ -0,0 +1,11 @@
|
||||
[Icon Theme]
|
||||
Name=hicolor
|
||||
|
||||
# Provide a minimal hicolor theme, so that our hicolor fallback
|
||||
# lookup during testing will find that theme on all systems.
|
||||
|
||||
Directories=16x16
|
||||
|
||||
[16x16]
|
||||
Size=16
|
||||
Type=Fixed
|
@ -1,7 +1,7 @@
|
||||
[Icon Theme]
|
||||
_Name=Test
|
||||
_Comment=Test Theme
|
||||
Inherits=crystalsvg, themeparent
|
||||
Inherits=themeparent
|
||||
Example=x-directory-normal
|
||||
|
||||
# KDE Specific Stuff
|
||||
|
@ -1,7 +1,6 @@
|
||||
[Icon Theme]
|
||||
_Name=Test
|
||||
_Comment=Test Theme
|
||||
Inherits=gnome,crystalsvg
|
||||
Example=x-directory-normal
|
||||
|
||||
# KDE Specific Stuff
|
||||
|
@ -717,14 +717,38 @@ void tst_QIcon::fromTheme()
|
||||
QCOMPARE(i.availableSizes(), abIcon.availableSizes());
|
||||
}
|
||||
|
||||
// Check that setting a fallback theme invalidates earlier lookups
|
||||
QVERIFY(QIcon::fromTheme("edit-cut").isNull());
|
||||
QIcon::setFallbackThemeName("fallbacktheme");
|
||||
QVERIFY(!QIcon::fromTheme("edit-cut").isNull());
|
||||
|
||||
// Make sure setting the theme name clears the state
|
||||
QIcon::setThemeName("");
|
||||
abIcon = QIcon::fromTheme("address-book-new");
|
||||
QVERIFY(abIcon.isNull());
|
||||
|
||||
// Test fallback icon behavior for empty theme names.
|
||||
// Can only reliably test this on systems that don't have a
|
||||
// named system icon theme.
|
||||
QIcon::setThemeName(""); // Reset user-theme
|
||||
if (QIcon::themeName().isEmpty()) {
|
||||
// Test icon from fallback theme even when theme name is empty
|
||||
QIcon::setFallbackThemeName("fallbacktheme");
|
||||
QVERIFY(!QIcon::fromTheme("edit-cut").isNull());
|
||||
|
||||
// Test icon from fallback path even when theme name is empty
|
||||
fallbackIcon = QIcon::fromTheme("red");
|
||||
QVERIFY(!fallbackIcon.isNull());
|
||||
QVERIFY(QIcon::hasThemeIcon("red"));
|
||||
QCOMPARE(fallbackIcon.availableSizes().size(), 1);
|
||||
}
|
||||
|
||||
// Passing a full path to fromTheme is not very useful, but should work anyway
|
||||
QIcon fullPathIcon = QIcon::fromTheme(m_pngImageFileName);
|
||||
QVERIFY(!fullPathIcon.isNull());
|
||||
|
||||
// Restore to system fallback theme
|
||||
QIcon::setFallbackThemeName("");
|
||||
}
|
||||
|
||||
static inline QString findGtkUpdateIconCache()
|
||||
|
Reference in New Issue
Block a user