Do not use QWidget::showFullScreen() etc. (was Re: KDE)

Matthias Kretz kretz at kde.org
Thu Mar 13 08:14:55 GMT 2008


On Tuesday 11 March 2008, Lubos Lunak wrote:
> > Remove usage of QWidget::show[FullScreen|Maximized|Minimized|Normal](),
> > they do more then just change the state of the window and all these usage
> > cases were wrong (that is, all their usage).
> > For changing the state, use something like
> > window->setWindowState( window->windowState() | Qt::WindowFullScreen );
> > // set
> > window->setWindowState( window->windowState() & ~Qt::WindowFullScreen );
> > // reset
> > or simply use the new KToggleFullScreenAction::setFullScreen()  helper.
>
>  People, please do not use QWidget::showFullScreen(),
> QWidget::showMaximized(), QWidget::showMinimized() or
> QWidget::showNormal(), unless you know what they actually do and you really
> want that. Which is probably never. For example, QWidget::showNormal() is
> not an inverse of QWidget:showFullScreen(), and QWidget::showFullScreen()
> also doesn't just set the window to fullscreen (#157941). I personally
> consider these to be broken API, although TT apparently doesn't share my
> opinion.
>
>  Use QWidget::setWindowState() as noted above, or some of the helper
> functions.

I guess the best way to "enforce" this is to add a krazy check for those 
functions and adding an explanation to techbase which the krazy checker can 
link to in its output.

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- 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/20080313/e961aa5d/attachment.sig>


More information about the kde-core-devel mailing list