Qdialog trouble with change show size
-
Hello all!
I create QDialog for special window. Window hasn't fixed size and add button "WindowMaximizeButtonHint". in order to next time, the window will open in original size (not maximum size, when window was closed), i used next code:
window->resize(x,y);
window-show();
It's worked if i manual change size. After reuse window takes size(x,y), but when i changed size to maximum (by maximize button), closed window and call again window, I get the following result:
Ka-boom
Elements have resize, but not the window itself. Window have size like before closing.
and "window->adjustSize()" gives exactly the same result.
and return next error:
"setGeometryDp: Unable to set geometry 640x480+519+264 on QWidgetWindow/'briefWindow'. Resulting geometry: 1680x987+0+23 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 93x93, maximum size: 16777215x16777215).
setGeometryDp: Unable to set geometry 640x480+0+23 on QWidgetWindow/'briefWindow'. Resulting geometry: 1680x987+0+23 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 93x93, maximum size: 16777215x16777215)"
How to fix it?
(Option with the removal of the window every time and creating again I do not like) -
Hi
What about setGeometry ?You might need to call
http://doc.qt.io/qt-5/qwidget.html#showNormal
since it last was in maxi mode. -
@mrjj hi. Set geometry don't help, because trouble in Maximized mode, yep.
showNormal don't help too(
"setGeometryDp: Unable to set geometry 640x480+0+23 on QWidgetWindow/'briefWindow'. Resulting geometry: 1680x987+0+23 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 93x93, maximum size: 16777215x16777215)."
only showMinimized (and showmaxi) don't call it's message, but it's not cool -
@mrjj i can say more:
"instr->showMinimized();
instr->showNormal();"
Not maximize mode:
window creat minimized and expanded in the normal state
After maximize mode:
window creat minimized and expanded in the maximize state (like in picture), but without error message. -
but after
ShowNormal, it should allow you to set the size ? -
@mrjj if you mean
"instr->showNormal();
instr->resize(640, 480);"
it's worked, thank you.
But call this message again:
"setGeometryDp: Unable to set geometry 1680x987+8+31 on QWidgetWindow/'briefWindow'. Resulting geometry: 1680x987+0+23 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 240x240, maximum size: 16777215x16777215)."