Whats up with KDialog?

Olivier Goffart ogoffart at kde.org
Wed Aug 1 16:39:05 BST 2007


Le mercredi 1 août 2007, Andreas Pakulat a écrit :
> Hi,
>
> I'd like to know why KDialog differs so much from QDialog? Its currently
> impossible to use KDialog with Qt Designer, even though it is included
> in the custom widgets plugin.
>
> If one replaces QDialog with KDialog in the template for a dialog and
> creates a dialog you'll get a form with ok+cancel button on the right in
> the vertical middle. You can't set a layout on the dialog and you also
> can't properly add any widgets to it. This seems wrong, or it is
> actually wanted and the example in the KDialog apidox is the only way to
> use it (i.e. using its setMainWidget function. If the latter is the case
> IMHO it shouldn't be part of the custom widget plugin and it shouldn't
> be possible to use it as base class for a form.
>
> In the case that KDialog is not supposed to be subclassed like and used
> as direct replacement of QDialog, the krazy check for s/QFoo/KFoo should
> also be changed to not require to use KDialog when QDialog is used in
> sources. IMHO.

No, KDialog is not 100% source compatible with QDialog. 
So no, you can't simply do s/QDialog/KDialog/ 
But still, we should use KDialog instead of QDialog, since it's more 
respectfull of KDE standards 

Indeed you cannot add a layout directly to the KDialog since it has already 
his own layout. You must make use of the mainWidget()


Regarding designer integration, it seems to be completely wrong and broken.
You are right, it should not be a part of the custom widget plugins. I don't 
know if it's possible to integrate it with designer.

I think the best way to integrate dialog using designer is to use simple 
widget as base, and use KDialog::mainWidget() as parameter of setupUi instead 
of the KDisalog itself,  as the documentation suggest.
 
-- 
Olivier
-------------- 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/20070801/30dbdc21/attachment.sig>


More information about the kde-core-devel mailing list