[Konsole-devel] Re: [Issue N23563] [PATCH] Qt adds extra space to layouts when it shouldn't.

Waldo Bastian bastian at kde.org
Thu Jun 5 11:27:03 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 05 June 2003 11:49, qt-bugs at trolltech.com wrote:
> On Tuesday, 03. Jun 2003 14:11 Waldo Bastian wrote:
> > Qt assigns space to empty layouts leading to extra pixels that are
> > undesired.
> >
> > This problem becomes very clear with a QMainWindow in full-screen
> > mode. Without any toolbar, statusbar or menubar the central widget
> > should cover the full screen. However, topDock and bottomDock still
> > get inserted in a QBoxLayout in that case and get space allocated,
> > even though they have nothing to show. This makes that the central
> > widget becomes 2 pixels less high than the screen.
>
> Hi Waldo,
>
> Thank you for the bug report. It is always a pleasure to get a bug
> report with a patch. The diff for QDockAreaLayout is obviously correct.
>
> However, I am not convinced that it is necessary to change
> qabstractlayout.cpp. Note that Qt does not allow visible widgets to
> have zero height or width. If the widget is hidden, isEmpty() will be
> true, so the result will be 0 anyway. If this change makes a
> difference, it is probably because of a bug somewhere else. From your
> description, however, it seems like the QDockAreaLayout change is
> enough to fix the problem.
>
> For now, I have just applied the QDockAreaLayout part of the patch.
> Please let me know if this is not sufficient to fix the problem.

No, that is not enough. In QMainWindow you have d->topDock and d->bottomDock. 
These get inserted in d->tll in QMainWindow::setUpLayout(). After the 
QDockAreaLayout fix, these docks now return 0 as height because all the 
widgets in them are hidden. This then gets adjusted to 1 in 
QWidgetItem::heightForWidth( int w ). The only way to circumvent that is if 
QWidgetItem::isEmpty() returns true, and that can only be achieved by hiding 
QDockArea.

So the problem seems to be that a widget that only contains hidden widgets 
still takes up space.

Cheers,
Waldo
- -- 
bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+3ykHN4pvrENfboIRAgCxAJ4ufmJStty9PJ/kdavRqpluByfH6QCgoDYT
YfjI3+iGsoS0Qk2l9VxB01c=
=0iZ+
-----END PGP SIGNATURE-----



More information about the konsole-devel mailing list