Qt-interest Archive, July 2007
Dock Widget won't re-dock.
Message 1 in thread
Hi, I am having continuing problems with the Dock Widget.
My application uses a MainWindow, a layout manager, a Dock Widget, and
some fixed size widgets in the Main Window. The widgets in the main
window are text displays, and the text is fixed format, so the width of
these widgets is also fixed. I have a tree view in the Dock Widget to
display information about the fixed format text.
The main difference here is that when I float the dock widget to the
topview, I resize the main window to remove the space that was formerly
occupied by the dock widget. This is the code I am using to do this:
void MainWindow :: dock_toplevel (bool toplevel) {
if (toplevel) {
setMaximumSize (32767, 32767);
setMinimumSize (0, 0);
resize (hw -> width (), height ()); // if I comment this line,
everything works
}
}
Basically, when the dock widget goes toplevel, it sends a signal to this
slot to indicate that it's toplevel. Then, this code resizes the window
to the width of the hw widget. The hw widget is a fixed size, always.
So, the problem that I am seeing is that when I drag the dock widget
over the main window to try to re-dock it, it won't dock on either the
left or the right side any more. It will only dock on the top or the
bottom. The isAnimated() setting doesn't change this behavior. As noted
in the code example, everything works as expected if I comment out the
line to resize the main window.
Has anybody seen anything like this before? Is this a bug in Qt?
Thanks, Patrick
--
[ signature omitted ]