QDockWidget moves out of screen
Hi!
I have an application with some dockwidgets that are floating, i.e they cannot be docked.
Every dock has a widget with some buttons and other things in it that is attached to the dock.
Example:
Code:
{
infoDock->setFloating (true);
infoDock->setAllowedAreas(false);
infoDock->setMinimumHeight(150);
infoDock->setMaximumHeight(170);
infoDock->setMinimumWidth(250);
infoDock->setMaximumWidth(300);
infoDockWidget = new InfoDockWidget(infoDock);
infoDock->setWidget( infoDockWidget );
}
Now, what happends is that if I want to move the dock and by accident press the mouse on the boarder of the dock so it resizes it can suddenly move very fast out of the screen.
This is really annoying since I can't get it back without recompiling the program with a ->move(int x, int y) command.
Is there some way that i can disable the resize function so this can't happen?
//Nils
Re: QDockWidget moves out of screen
Yes, I've noticed this too with tool windows.
You can make it not resizable with setFixedSize( sizeHint ), or if you have a top layout in it the use QLayout::setSizeConstraint( QLayout::SetFixedSize ).
The latter is preferred.
Regards
Re: QDockWidget moves out of screen
Quote:
Originally Posted by
marcel
Yes, I've noticed this too with tool windows.
You can make it not resizable with setFixedSize( sizeHint ), or if you have a top layout in it the use QLayout::setSizeConstraint( QLayout::SetFixedSize ).
The latter is preferred.
Regards
Yes, I have tried with setFixedSize(sizeHint) and it didnt work.
Will try the other.
Thanks
Re: QDockWidget moves out of screen
Try setting the flags Qt::Tool if you want to use setFixedSize.
Regards