I'm modifying a splitter handle by assigning an image from a resource.
setStyleSheet
(QString("QSplitter::handle {image: url(:/images/zoom-in.png)} \ QSplitter::handle:pressed {image: url(:/images/star.png)}"));
setStyleSheet(QString("QSplitter::handle {image: url(:/images/zoom-in.png)} \
QSplitter::handle:pressed {image: url(:/images/star.png)}"));
To copy to clipboard, switch view to plain text mode
The resource file uses locale dependent aliases.
<RCC>
<qresource prefix="images">
<file>star.png</file>
<file>zoom-in.png</file>
</qresource>
<qresource prefix="images" lang="de">
<file alias="star.png">star_de.png</file>
<file alias="zoom-in.png">zoom-in_de.png</file>
</qresource>
<qresource prefix="images" lang="en">
<file alias="star.png">star_en.png</file>
<file alias="zoom-in.png">zoom-in_en.png</file>
</qresource>
</RCC>
<RCC>
<qresource prefix="images">
<file>star.png</file>
<file>zoom-in.png</file>
</qresource>
<qresource prefix="images" lang="de">
<file alias="star.png">star_de.png</file>
<file alias="zoom-in.png">zoom-in_de.png</file>
</qresource>
<qresource prefix="images" lang="en">
<file alias="star.png">star_en.png</file>
<file alias="zoom-in.png">zoom-in_en.png</file>
</qresource>
</RCC>
To copy to clipboard, switch view to plain text mode
This works fine as long as I do a QLocale::setDefault() at application launch (main).
Questions: Is it possible to make the style sheet consider the different images
when changing the language/locale at runtime ?
Joerg
Bookmarks