He minimized dialog can not change the geometry?



  • Below are the steps that create the bug:
    1 create a dialog ;
    2 minimize the dialog;
    3 resize the dialog ;
    4 show the dialog ;
    the dialog's size still unchanged .
    Below are the code :
    m_pDialog = new QDialog();
    m_pDialog->resize(100,100);
    m_pDialog->showMinimized();
    QRect rect = m_pDialog->geometry() ;
    m_pDialog->setGeometry(rect.x(),rect.y(),rect.width()*6,rect.height());
    m_pDialog->showNormal();
    so you can see the the dialog the size unchanged .



  • Hi and welcome to devnet..

    [quote author="wearilybird" date="1411453998"]Below are the steps that create the bug:
    1 create a dialog ;
    2 minimize the dialog;
    3 resize the dialog ;
    4 show the dialog ;
    the dialog's size still unchanged .
    Below are the code :
    @
    m_pDialog = new QDialog();
    m_pDialog->resize(100,100);
    m_pDialog->showMinimized();
    QRect rect = m_pDialog->geometry() ;
    m_pDialog->setGeometry(rect.x(),rect.y(),rect.width()*6,rect.height());
    m_pDialog->showNormal();@
    so you can see the the dialog the size unchanged .[/quote]
    i checked your code ..

    The problem is b/w minimize and resizing the dialog; the calculation is changed (b/w step 2 and 3).
    means
    when you call showMinimized() then your dialog goes to status bar.
    then the geometry of m_dialog gets changed instead of (100,100);
    it becomes (116,100)
    so,the calculation will be (1166,100) instead of (1006,100);

    Dialog size is changed but not as expected calculation .

    hope it helps.


Log in to reply
 

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