User Tools

Site Tools


qt:mainwindow-buildicon

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
qt:mainwindow-buildicon [2011/05/13 11:29] mithatqt:mainwindow-buildicon [2011/05/13 12:24] mithat
Line 3: Line 3:
 <code cpp-qt MainWindow::buildIcon> <code cpp-qt MainWindow::buildIcon>
 /** /**
- * Append a regularly defined set of different sized icon images to a QIcon.+ @brief Append a regularly defined set of sized icon images to a QIcon.
  *  *
  * The following usage example assumes the resources ":myIcons/16x16/exit.png",  * The following usage example assumes the resources ":myIcons/16x16/exit.png",
Line 27: Line 27:
     {     {
         QString theResource = iconRscTemplate;         QString theResource = iconRscTemplate;
-        theResource.replace(QString("%size%"), iconSize+"x"+iconSize);  // does this work? +        QString dim; dim.setNum(iconSize); 
-        theResource.replace(QString("%dim%"), iconSize+"");             // does this work?+        theResource.replace(QString("%dim%"), dim); 
 +        theResource.replace(QString("%size%"), dim +"x"+dim);
  
         theIcon->addFile(theResource, QSize(iconSize, iconSize));         theIcon->addFile(theResource, QSize(iconSize, iconSize));
     }     }
 }</code> }</code>
qt/mainwindow-buildicon.txt · Last modified: 2011/05/13 12:32 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki