Master Load,
I implemented a window today with maximizing capabilities with the borderless-flag set (so from scratch). What you have to do is retriving the availableGeometry rect from the QDesktopWidget class.
QRect availableGeometry
= qApp
->desktop
()->availableGeometry
(mainWindow
);
QRect availableGeometry = qApp->desktop()->availableGeometry(mainWindow);
To copy to clipboard, switch view to plain text mode
This will give you the geometry of the available screen area (minus the taskbar).
Then you could do something like this to maximize and move the window to the correct location:
mainWindow->setMaximumSize(availableGeometry.width(), availableGeometry.height());
mainWindow->showMaximized();
mainWindow->move(availableGeometry.x(), availableGeometry.y());
mainWindow->showMaximized();
mainWindow->setMaximumSize(availableGeometry.width(), availableGeometry.height());
mainWindow->showMaximized();
mainWindow->move(availableGeometry.x(), availableGeometry.y());
mainWindow->showMaximized();
To copy to clipboard, switch view to plain text mode
On top of that I used QSettings to remember the nonmaximized state so that I could recover it later when the window is minimized.
Hope this helps
Bookmarks