How to handle deprecated constructors

Olivier Goffart ogoffart at kde.org
Fri Feb 24 18:11:10 GMT 2006


Le Vendredi 24 Février 2006 18:38, Christian Ehrlicher a écrit :
> Hi,
>
> I get a lot of warnings about deprecated constructors like this:
>
> KShortcutDialogAdvanced::KShortcutDialogAdvanced(QWidget* parent, const
> char* name, Qt::WFlags fl)
>
>     : QWidget(parent, name, fl)
>
> {
> ...
> }
>
> QWidget(QWidget* parent, const char *name, Qt::WFlags f = 0) is
> deprected. I could simply remove 'name' from the constructor but this
> wouldn't solve the real problem.

call setObjectName(name)

> I think also a new 
> KShortcutDialogAdvanced::KShortcutDialogAdvanced(QWidget* parent,
> Qt::WFlags fl) is needed and the old one should declared deprecated.

Yes. in KDE4/Qt4 we should remove all 'name' from contructors

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060224/c6b81034/attachment.sig>


More information about the kde-core-devel mailing list