[Qt-interest] Very simple question regarding QUiLoader

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Thu Jun 4 08:40:03 CEST 2009


Patric wrote:

Hello, 
my question is simple. When to use QUiLoader. 
I think that the only difference is that at compile time, there'll not be
the need of constructing the ui class (the class with the setupUi method).
This is delayed for runtime. 
I saw the examples for QUiLoader, I think they can be done without it also.
If I have two forms and I want to change them in a UI, instead of loading
them into widgets at runtime I always can just call "widget2.show()" instead
of widget1.show(). 
But I may be wrong. Sorry if my question is too simple or something, I'm
just wondering. 
 
Regards,
Patric 

Hi Patric, 
 
I don't think you need to worry about UILoader, if you are going to use
plugins to provide the tabs for each device.  The plugin interface would
include something like: 
 
    void populateTabs(QTabWidget *parent);
 
So the plugin just creates the widget for each tab and adds them.  
 
Think of how printer setup dialogs are done on windows - each company
provides two dlls one for the printer driver, and the second is effectively
a plugin for the setup.  The user doesn't need to alter the setup screen
itself, just use it.  
 
When you issue a plugin for a new or updated device, it will know how to
create its own widgets.  
 
Hope that helps, 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090604/27da9889/attachment.html 


More information about the Qt-interest-old mailing list