[Development] QAction-like API for QML

Olivier Goffart olivier at woboq.com
Tue Dec 18 14:11:30 CET 2012


On Tuesday 18 December 2012 13:33:59 Robin Burchell wrote:
> On Tue, Dec 18, 2012 at 12:55 PM, Stephen Kelly <stephen.kelly at kdab.com> 
wrote:
> >> The details of the split
> >> was just following Andre's suggestion. text/secondaryText might fit
> >> into CoreAction, icon will not.
> > 
> > Why not? Because QML doesn't do QIcons? The reason for that is not clear
> > either to me.
> 
> I don't think there's any reason it couldn't. A QIcon is a QPixmap,
> after all, and QIcon lives in QtGui, so there's no dependency issue
> either.

QIcon is more than a QPixmap:
QIcon is scalable (it can use different pixmap for different sizes)
QIcon has the notion of state (Enabled/Disabled/Selected/Toggled)

In summary. QIcon is perfect for this use case. (It was designed for that)

-- 
Olivier

Woboq - Qt services and support - http://woboq.com



More information about the Development mailing list