история из цикла сам дурак, не досмотрел =)
сделал
C++ (Qt)
void MainWindow::on_actionTileVertically_triggered()
{
QList<QMdiSubWindow *> subwindowlist = ui->mdiArea->subWindowList();
if (subwindowlist.count() < 2) {
ui->mdiArea->tileSubWindows();
return;
}
int wWidth = width() / subwindowlist.count();
int x = 0;
foreach (QMdiSubWindow *pSubWindow, subwindowlist)
{
pSubWindow->resize(wWidth, height());
pSubWindow->move(x, 0);
x += wWidth;
}
}
void MainWindow::on_actionTileHorizontally_triggered()
{
QList<QMdiSubWindow *> subwindowlist = ui->mdiArea->subWindowList();
if (subwindowlist.count() < 2) {
ui->mdiArea->tileSubWindows();
return;
}
int wHeight = height() / subwindowlist.count();
int y = 0;
foreach (QMdiSubWindow *pSubWindow, subwindowlist)
{
pSubWindow->resize(width(), wHeight);
pSubWindow->move(0, y);
y += wHeight;
}
}