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 13:19] – mithat | qt:mainwindow-buildicon [2011/05/13 12:32] (current) – mithat | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Something like this: | ||
- | Append a regularly defined set of differently | + | <code cpp-qt MainWindow:: |
- | + | /** | |
- | theIcon is a pointer to the icon that will be built/ | + | * @brief |
- | iconRscTemplate is a string that provides a template for the icon resource. | + | * |
- | sizeList contains a list of single-dimension sizes to be added to the icon. | + | * The following usage example assumes |
- | + | * ": | |
- | Example: | + | * that we want to bundle them together into exitIcon. |
- | Assuming | + | * |
- | <code cpp-qt> | + | * \code |
- | QList< | + | * QList< |
- | + | * QIcon exitIcon; | |
- | QIcon exitIcon; | + | * buildIcon(& |
- | buildIcon(& | + | * \endcode |
- | + | * | |
- | </ | + | * Does NOT check whether the referenced resources actually exist. |
- | buildIcon() does NOT check whether the referenced resources actually exist. | + | * |
- | + | * @param theIcon Pointer to the icon that will be built/ | |
- | <code cpp-qt> | + | * @param iconRscTemplate A tag-based template string for the icon resource. |
- | void MainWindow:: | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | * @param sizeList A list of single-dimension sizes to be added to the icon. | ||
+ | * | ||
+ | * @return void | ||
+ | */ | ||
+ | void MainWindow:: | ||
+ | QString const & | ||
+ | QList< | ||
{ | { | ||
- | foreach (const int iconSize | + | foreach (const int iconSize, sizeList) |
{ | { | ||
QString theResource = iconRscTemplate; | QString theResource = iconRscTemplate; | ||
- | theResource.replace(QString(" | + | |
+ | theResource.replace(QString(" | ||
+ | | ||
- | theIcon-> | + | theIcon-> |
} | } | ||
}</ | }</ |
qt/mainwindow-buildicon.txt · Last modified: 2011/05/13 12:32 by mithat