[Kde-imaging] Using kdevdesigner to create KDialog(Base) .ui files

Colin Guthrie kde at colin.guthr.ie
Wed Jan 17 10:14:13 CET 2007


Aurelien Gateau wrote:
> Le Dimanche 14 Janvier 2007 22:10, Colin Guthrie a écrit :
>> I've read a lot on here about using .ui files, but I just can't work it
>> out...
>>
>> How do I create a KDialogBase based .ui file?
>>
>> I would like to use .ui files to make life a lot easier but I also want
>> to keep the KDE icon sets and the general look and feel of a KDE app (as
>> opposed to a raw QT app).
>>
>> Can anyone offer any advice?
> 
> Took me a while to figure this one. In fact you do not create a KDialogBase 
> based .ui file. What you must do is create a QWidget based .ui file. In this 
> widget (let's call it DialogContent) you include all you need in your dialog, 
> except for the bottom button bar (Ok, Apply, Cancel...).
> Next in your code you create a class inheriting from KDialogBase and write 
> something like this in the constructor:
> 
> QVBox* page = makeVBoxMainWidget();
> DialogContent* dialogContent = new DialogContent(page);
> 
> And you are done.
> 
> Aurélien
> 
> PS: to avoid double margin effect, remember to set the margin of the 
> DialogContent layout to 0.

Interesting. /me will have a fiddle with this later....

Cheers

Col.

-- 

+------------------------+
|     Colin Guthrie      |
+------------------------+
| kde(at)colin.guthr.ie  |
| http://colin.guthr.ie/ |
+------------------------+


More information about the Kde-imaging mailing list