GUI framework in kde4

Andras Mantia amantia at kde.org
Mon Jul 3 08:51:05 BST 2006


On Monday 03 July 2006 10:35, Hamish Rodda wrote:
> You define the actions either in your code at runtime, or in designer
> at creation time, and then you can open a file at runtime which
> describes where to put that element, and this will be taken care of
> by the framework.  The file's format may be similar or the same to
> .ui files, but it will work at runtime.
>
> Does that answer your question?

I'm not sure. What I need to know is that if the toolbar and actions are 
created in the code can they be saved and restored from the .ui file 
without needing a mainwindow in the .ui for them? As I understand if 
you work in designer, you must have a mainwindow to create actions and 
toolbars. What I need is something like this in the current code:
- load an XML file describing the toolbar
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="quanta" version="2">
  <ToolBar tabname="CSS" noMerge="1" name="css" >
    <text>CSS</text>
    <Action name="insert_css" />
    <Action name="tag_color" />
  </ToolBar>
</kpartgui>
- create a KXMLGUIClient from the above XML file
- create the actions from there in the code and insert them to the 
actionCollection of the created KXMLGUIClient 
- add the KXMLGUIClient to the user interface itself (show the toolbar) 
with guiFactory()->addClient(toolbarGUI);

And the other way around (remove from the UI, save the XML and get the 
information of what actions were on the toolbar itself).

Andras
-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060703/f14c91be/attachment.sig>


More information about the kde-core-devel mailing list