qt:icons
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
qt:icons [2011/05/13 16:47] – [System theme using QIcon::fromTheme()] mithat | qt:icons [2011/05/13 17:01] (current) – [Creating a Qt Resource for the theme] mithat | ||
---|---|---|---|
Line 109: | Line 109: | ||
===== QStyle' | ===== QStyle' | ||
- | An alternative to using icon resources is provided by the '' | + | An alternative to using icon resources is provided by the '' |
- | The enumerated icons should be available on all platforms, so testing for their existence isn't required. | + | The main issue with using '' |
Implementation requires only a bit of straight-forward hand-coding. | Implementation requires only a bit of straight-forward hand-coding. | ||
Line 199: | Line 199: | ||
==== Caveat ==== | ==== Caveat ==== | ||
- | QIcon' | + | QIcon' |
<code cpp-qt> | <code cpp-qt> | ||
QString iconTheme = My:: | QString iconTheme = My:: | ||
QIcon:: | QIcon:: | ||
+ | Until such '' | ||
===== Custom theme using QIcon:: | ===== Custom theme using QIcon:: | ||
- | The static function '' | + | The static function '' |
To describe the process, I will use an example of a custom theme that provides icons in a variety of sizes for our example application. The icons themselves are taken from the raucously popular, public domain Tango Project((http:// | To describe the process, I will use an example of a custom theme that provides icons in a variety of sizes for our example application. The icons themselves are taken from the raucously popular, public domain Tango Project((http:// | ||
Line 268: | Line 269: | ||
</ | </ | ||
- | Once you have created the '' | + | Once you have created the '' |
Note that in the set of icons I drew from, there were no 48x48 icons. To maintain best compatibility with Windows OSes, you ideally should include 48x48 icons as well((See http:// | Note that in the set of icons I drew from, there were no 48x48 icons. To maintain best compatibility with Windows OSes, you ideally should include 48x48 icons as well((See http:// | ||
- | The pros and cons associated with this approach are essentially identical to [[# | + | The pros and cons associated with this approach are essentially identical to [[# |
==== Code implementation ==== | ==== Code implementation ==== |
qt/icons.1305305263.txt.gz · Last modified: 2011/05/13 16:47 by mithat