[PATCH] Avoid double margins in KDialog

Olivier Goffart ogoffart at kde.org
Mon Dec 10 08:17:30 GMT 2007


Le mercredi 5 décembre 2007, AurélienGâteau a écrit :

> Ok, will do. Unfortunately it won't fix all dialogs. I have been running
> with the patch yesterday and noticed some dialogs still had double margins.
> Looking a the code, I discover they create their dialog content this way:
>
> Ui_Config ui;
> ui.setupUi(dialog->mainWidget());
>
> The trick here is that if there is no main widget set, mainWidget() will
> create one and set it before returning. So mainWidget() calls
> setMainWidget(), and at the time of the call, the newly created widget does
> not have any layout yet.


Maybe
QTimer::singleShot(0,this,SLOT(slotFixLayout())
inside of KDialog::mainWidget()

Notice that this behaviour should be documented


> I personnally find it strange to have an accessor creating a widget instead
> of returning a null pointer, even if I can see how it can be convenient.
> Unfortunately it's probably too late to fix this. Or is it not?

This is realy convinient.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071210/14e9c8fb/attachment.sig>


More information about the kde-core-devel mailing list