rantanplan
10th February 2011, 15:34
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)}"));
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>
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
setStyleSheet(QString("QSplitter::handle {image: url(:/images/zoom-in.png)} \
QSplitter::handle:pressed {image: url(:/images/star.png)}"));
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>
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