Important: Please read the Qt Code of Conduct -

Resizing MDI subwindow?

  • Hi guys.

    Here is my code:
    @gameWindow = new GameWindow();
    gameWindow->resize(gameWindow->videoWidth, gameWindow->videoHeight);@

    It worked, but size of the subwindow is incorrect. It's very small. But I can resize it manually.

    UPDATE: For my problem, this works well, but I don't know why:
    @gameWindow->parentWidget()->resize(gameWindow->videoWidth, gameWindow->videoHeight);@

  • mdiArea->addSubWindow returns a QMdiSubwindow instance, so that's why you need to call resize on the parent (which is the sub window itself). You can keep the returned pointer and call resize on it directly.

Log in to reply