See here for more information about window geometry.
This code
void MyMainWindow::on_actionAction_1_triggered()
{
text.append (tr ("Frame Geometry (%1 x %2)\n")
.arg(frameGeometry ().width ()).arg (frameGeometry ().height ()));
text.append (tr ("Client Geometry (%1 x %2)\n")
.arg(width ()).arg (height ()));
text.append (tr ("CentralWidget Geometry (%1 x %2)\n")
.arg(centralWidget ()->width ()).arg (centralWidget ()->height ()));
QMessageBox::information (this, tr
("Information"), text
);
}
void MyMainWindow::on_actionAction_1_triggered()
{
QString text;
text.append (tr ("Frame Geometry (%1 x %2)\n")
.arg(frameGeometry ().width ()).arg (frameGeometry ().height ()));
text.append (tr ("Client Geometry (%1 x %2)\n")
.arg(width ()).arg (height ()));
text.append (tr ("CentralWidget Geometry (%1 x %2)\n")
.arg(centralWidget ()->width ()).arg (centralWidget ()->height ()));
QMessageBox::information (this, tr ("Information"), text);
}
To copy to clipboard, switch view to plain text mode
shows this result
window_geometry.png
Bookmarks