![]() Registered Member ![]()
|
I want to add a bookmarks feature to my application so I searched the api (api.kde.org) and the techbase (techbase.kde.org). I only found some stuff in the former but I still do not understand.
First, there is this set of classes: KBookmarkMenu, KBookmarkActionMenu, KBookmarkOwner, KBookmarkManager, and KActionMenu. But I do not know how to stich these to my KXmlGuiWindow. There even seems to be inaccurate documentation in KBookmarkMenu:
But KActionMenu does not fit anywhere I can see. So I ask for a quickstart, little hint on how to handle these classes. Thanks for reading so far.
Last edited by YeahReally on Sun Jan 11, 2009 1:56 am, edited 1 time in total.
|
![]() KDE Developer ![]()
|
You can get the associated KMenu by calling the action's menu() method. I think it basically works like this: get a bookmark manager instance using KBookmarkManager::userBookmarksManager() Get (from the XmlGuiWindow) or create a bookmark menu/action. Pass the manager and the menu to the KBookmarkMenu constructor. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
Thanks, I get it now. I added the KActionMenu to a menu from my xml file, passed it as paremeter for the KBookmarkMenu and it appears, but as a submenu. So, how do I get a top-level menu to pass to the KBookmarkMenu constructor?
It seems I will have to implement KBookmarkOwner too, but that is another topic I think I can handle. |
![]() KDE Developer ![]()
|
I think the KXmlGuiClient or KXmlGuiFactory API allows you to get the menu from the xml file, basically avoiding the additional menu in between.
Something with containers IIRC. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell