Registered Member
|
Hi,
I have a QDockWidget I want to hide/show with an action in the menu bar. My code :
My apps.rc :
When I compile and execute, there is no action in my menu and I have the following warning :
But this action is available in the toolbar actions collection, I can add it in the main toolbar. Where is my error?
Last edited by Spomky on Sat Aug 01, 2009 3:00 pm, edited 1 time in total.
|
Administrator
|
You need to use the KAction class in KDE applications, as QActions should not be used. This is because QActions cannot be used in the shortcut dialog.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thanks but how can I convert a QAction* to KAction*? There is no constructor or function for that.
When I write:
I have the same problem. |
Administrator
|
You will need to manually construct a KAction which has the appropriate icon, text, and slot connections and that to the collection manually.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thank you, it works correctly.
I hoped to use toggleViewAction but it does not matter. Final code is:
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]