[PATCH] Avoid double margins in KDialog

John Tapsell johnflux at gmail.com
Sun Apr 6 14:07:01 BST 2008


Hi,
  For those of us who are slow, could someone please give an update of
the situation.

  Are we supposed to set the margin to 0 for the top most layout of
widgets that we create in qt designer, if we are going to put them in
a KDialog?  Or is there no need?

JohnFlux

On 10/12/2007, Olivier Goffart <ogoffart at kde.org> wrote:
> 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.
>
>




More information about the kde-core-devel mailing list