QMdiArea::tileSubWindows() always places widgets in ActivationHistoryOrder in SubWindowView mode

  • found in Qt 4.8 ( not sure about 5.*)

    check is simple and can be demonstrated on mdi example :

    • create 2 subwindows
    • click Tile menu command
    • click inactive subwindow to activate it
    • click Tile menu command
      result unexpected: subwindows switch positions

    I created my own example to doublecheck with following lines

    1. @ ui.mdiArea->setViewMode( QMdiArea::SubWindowView);
      ui.mdiArea->setActivationOrder( QMdiArea::CreationOrder );

    result is the same.

    Work around which also demonstrates the problem:
    instead of ui.mdiArea->tileSubWindows()
    call custom slot with code below:

    @ QMdiSubWindow *a = ui.mdiArea->activeSubWindow();
    QList<QMdiSubWindow *> list = ui.mdiArea->subWindowList( ui.mdiArea->activationOrder( ) );
    for( int i=0; i< list.count(); i++ )
    ui.mdiArea->setActiveSubWindow( list[i] );

    ui.mdiArea->setActiveSubWindow( a );
    result - subwindows are tiled in activationOrder( )

    Alex Malyushytsky

  • I installed Qt 5. The same bug is present.
    Guess I will have to report the bug.


Log in to reply