[Development] QAction-like API for QML
Kevin Krammer
kevin.krammer at kdab.com
Mon Dec 17 12:44:43 CET 2012
On Sunday, 2012-12-16, Shawn Rutledge wrote:
> It doesn't bother me to put icon names in the C++ code, either. The
> widget way of using resources works great, because you don't have to
> think about the path to the image on disk. If you don't want to use
> resources then some kind of image provider should be another way to
> abstract away the details of loading, so that when creating an action
> in C++ you only need to give the name of the icon. If you have a
> naming convention, maybe even that can have an automatic default: you
> just name the action itself, and the matching icon will be found by
> that name without having to set up the mapping anywhere.
While it is theoretically possible to create icons during runtime e.g. using
QPainter, I think that icon-by-name is by far the more often used approach.
When was the last time anyone so icons not being loaded by name (from theme,
resource or file)?
Cheers,
Kevin
--
Kevin Krammer | kevin.krammer at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4712 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121217/f2eefed8/attachment.bin>
More information about the Development
mailing list