XML GUI question

David Faure david at mandrakesoft.com
Mon Oct 28 16:53:37 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 28 October 2002 17:41, Simon Hausmann wrote:
> You're right :) . But that shouldn't prevent the toolbar from
> appearing (under the condition that it is created before the dialog
> is shown) . loadState() doesn't create the toolbar after all, it
> just applies a couple of options (and calls show()/hide() , which
> however shouldn't be necessary in your code given the above
> mentioned constraint) .
> 
> But I guess you want to have full control of the toolbar creation,
> to place it wherever appropriate in your dialog. In that case just
> inherit from KXMLGUIBuilder, re-implement the createContainer method
> and create your toolbar if element.tagName().lower() is "toolbar" .

But can't we provide support for "toolbars in dialogs" from KXMLGUIBuilder itself? 
Something like
diff -u -p -r1.58 kxmlguibuilder.cpp
- --- kxmlguibuilder.cpp  2002/05/26 14:03:57     1.58
+++ kxmlguibuilder.cpp  2002/10/28 16:52:38
@@ -218,9 +218,11 @@ QWidget *KXMLGUIBuilder::createContainer
     {
         if ( d->m_client && !d->m_client->xmlFile().isEmpty() )
             bar->setXMLGUIClient( d->m_client );
+        bar->loadState( element );
     }
- -
- -    bar->loadState( element );
+    else {
+        // whatever code is necessary to add a toolbar to a non-KMainWindow, e.g. a QDialog?
+    }

     return bar;
   }

(well I don't know which code is necessary exactly, as you can see ;)

- -- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9vWuR72KcVAmwbhARAp2LAJ9JsMe+h4aPqEZqYKseYuu8MnGb/ACgiIfR
/CGwPEFUVfkwqR8yITDu3X8=
=OlBR
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list