QMdiSubWindow does not go to position used in setGeometry()



  • Hello,

    I am trying to set a subwindow (which I have a widget placed in) in my mdiarea to a fixed position using setGeometry(). The code is as follows:

    @ programSubWindow = new QMdiSubWindow;
    programWidget = new programDisplayWidget;
    programSubWindow->setWidget(programWidget);
    programSubWindow->setWindowFlags(Qt::FramelessWindowHint);
    /Adjust size of subwindow to fit to its portion of the mdi area/
    QSize currentWindowSize;
    currentWindowSize = ui->mdiMdiArea->size();
    width = round_num(currentWindowSize.width() * .33);
    height = round_num(currentWindowSize.height() * 0.67);
    programWidget->setFixedSize(width, height);
    programSubWindow->setGeometry(200, 200, width, height);
    /Add subwindow to mdi area and show it/
    ui->mdiMdiArea->addSubWindow(programSubWindow);
    programSubWindow->show();@

    It does not seem to be taking my setGeometry() command and always places my window in the upper left hand corner of my mdiarea. Does anyone know what the problem might be?



  • I'm surprised nobody has run into the same problem. I still can't figure it out. Any help?


Log in to reply
 

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