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)


  • Qt Champions 2016

    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.


  • Qt Champions 2016

    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)."



  • This post is deleted!

  • Qt Champions 2016

    @Psy_Duck
    well that message seems to be from maximizing it
    look the the numbers
    1680x987+0+23



  • @mrjj if used setgeometry - no problem
    "look the the numbers
    1680x987+0+23"
    eeem, what you mean?


  • Qt Champions 2016

    @Psy_Duck
    yes
    seems to be full screen/max ?



  • @mrjj said:

    seems to be full screen/max ?
    seems.
    Well, if not used setgeometry, window open in left high angle.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.