[Qt-interest] Custom Widgets and UI File Organisation

Kenneth Beck nekkceb at comcast.net
Fri May 8 02:43:03 CEST 2009


Karol Krizka wrote:
> Kenneth Beck wrote:
>> Windows XP SP 3, Qt 4.5.0. Visual Studio 2003 with the Qt Visual 
>> Studio Integration 1.4.3
>> I have a project that uses a custom plugin derived from QWidget 
>> (XYPlot0). That part has gone smoothly, I created the plugin using 
>> procedure outlined in documentation, and i can use it in the designer 
>> to design forms. XYPlot0 is a simple graphical widget, displays data 
>> from real-time data acquisition system, but I dont really use it 
>> directly, only use classes derived from it.
>> My question is, when I use widgets that are derived from XYPlot0, what 
>> are the expected entries in the .ui file? The hierarchy is as follows:
>> QWidget->XYPlot0->BIPSPlot0->BIPSRawVolPlot
>> When I want to add a BIPSRawVolPlot to a form, should I tell designer 
>> that it is derived from XYPlot0 or BIPSPlot0? I dont seem to have the 
>> BIPSPlot0 choice in designer. BIPSPlot0 is kind of an "abstract" 
>> class, not really used except as being derived from, so should there 
>> be an entry in the .ui file to mention it? How should that appear in 
>> the designer?
>>
>>   
> I think for every widget that you want to appear in designer, you need 
> to declare it as a plugin.
> 
> But if you don't want to do that, take a look at "Promoting Widgets":
> http://doc.qtsoftware.com/4.5/designer-using-custom-widgets.html
> 
> -- 
> Cheers,
> Karol Krizka
> http://www.krizka.net
Thanks, I guess that's what I need to know. I'll play around a bit more.



More information about the Qt-interest-old mailing list