On Tuesday, 2012-12-11, Alan Alpert wrote:

> Action type:
> QtObject {
>     property string text
>     property url imageSource
>     property string shortcut
>     property bool checkable: false
>     property bool checked: false
>     signal triggered(bool checked)
> }
> 
> Note that it has no-where near as many properties as QAction. toolTip
> and whatsThis for example are very desktop centric so not needed
> anymore. Because it's not actually doing the rendering it doesn't need
> enabled, visible or font.

QAction doesn't do any rendering either but still has visble and enabled.

I've always used this to set the respective state on only one object (the 
action) and have all UI delegates (menu entry, toolbar buttons, etc) follow 
that automatically.

Obviously it is easier in QML where you can bind the enabled property of the 
menu entry, the toolbar button and the shortcut to the same custom property.

Do you have a specific use case in mind that would require to disable some 
trigger sources but not all?

Cheers,
Kevin
-- 
** Qt Developer Conference: http://qtconference.kdab.com/ **

Kevin Krammer | [email protected] | 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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to