Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

When a QMdiSubwindow is minimized, the restore icon becomes unreachable



  • On Windows, when I click the minimize icon on a QMdiSubWindow, it is reduced to a fraction of its title bar, and placed in the lower left corner of the QMdiArea. The maximize and close icons are still reachable, but the restore button is not. It's still possible to restore the widow by the pop up menu on right mous click.

    Is there a way to increase the width in minimized mode to show all decorations?



  • Ok, I worked my way around this with the following slot on windowStateChanged:

    void MainWindow::resizeOnMinimize(Qt::WindowStates, Qt::WindowStates newState)
    {
      if((newState & Qt::WindowMinimized) == false) return;
    
      QPoint position(0, 0);
      bool minimizedWindowFound = false;
    
      foreach (QMdiSubWindow *window, mdiArea->subWindowList())
      {
        if (window->isMinimized())
        {
          QRect rect = window->geometry();
          rect.setWidth(window->minimumSizeHint().width() + 200);
          window->setGeometry(rect);
          if(minimizedWindowFound == false)
          {
            minimizedWindowFound = true;
            position = window->pos();
          }
          else window->move(position);
    
          position.setX(position.x() + window->width());
        }
      }
    }
    

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What version of Qt are you using ?
    What OS are you running ?



  • Hi SGaist! I'm using 5.7.0 on Windows 8.1


  • Lifetime Qt Champion

    Can you test that with a more recent version of Qt ? The current LTS is 5.12.5 and release is 5.13.1.


Log in to reply