qt:mainwindow-buildicon
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
qt:mainwindow-buildicon [2011/05/12 15:04] – mithat | qt:mainwindow-buildicon [2011/05/13 12:32] (current) – mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <code cpp-qt> | + | Something like this: |
+ | |||
+ | <code cpp-qt | ||
/** | /** | ||
- | * Append a regularly defined set of differently | + | |
- | | + | * |
- | | + | |
- | | + | |
- | | + | * that we want to bundle them together into exitIcon. |
- | | + | * |
- | | + | * \code |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * | ||
+ | * Does NOT check whether the referenced resources actually exist. | ||
+ | * | ||
+ | * @param theIcon Pointer to the icon that will be built/ | ||
+ | * @param iconRscTemplate A tag-based template string for the icon resource. | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * @param sizeList A list of single-dimension sizes to be added to the icon. | ||
* | * | ||
- | * @param theIcon pointer to the icon that will be built/ | ||
- | * @param iconRscTemplate a tag-based template string for the icon resource. Two tags are recognized in iconRscTemplate: | ||
- | * @param sizeList contains a list of single-dimension sizes to be added to the icon. | ||
* @return void | * @return void | ||
*/ | */ | ||
- | void MainWindow:: | + | void MainWindow:: |
- | { | + | QString const & |
- | foreach (const int iconSize in sizeList) | + | |
- | { | + | |
- | QString theResource = iconRscTemplate; | + | |
- | theResource.replace(QString(" | + | |
- | theResource.replace(QString(" | + | |
- | + | ||
- | theIcon-> | + | |
- | } | + | |
- | }</ | + | |
- | + | ||
- | <code cpp-qt> | + | |
- | /** | + | |
- | * Append a regularly defined set of differently sized icon images to a QIcon. | + | |
- | * Example: | + | |
- | * Assumes the resources ": | + | |
- | * | + | |
- | | + | |
- | | + | |
- | * buildIcon() does NOT check whether the referenced resources actually exist. | + | |
- | */ | + | |
- | void MainWindow:: | + | |
- | QString const & | + | |
- | QList const & | + | |
{ | { | ||
- | foreach (const int iconSize | + | foreach (const int iconSize, sizeList) |
{ | { | ||
QString theResource = iconRscTemplate; | QString theResource = iconRscTemplate; | ||
- | theResource.replace(QString(" | + | |
- | theResource.replace(QString(" | + | |
+ | theResource.replace(QString(" | ||
- | theIcon-> | + | theIcon-> |
} | } | ||
}</ | }</ |
qt/mainwindow-buildicon.1305212693.txt.gz · Last modified: 2011/05/12 15:04 by mithat