PDA

View Full Version : this->frameGeometry().height is equal to this->size() ????



tonnot
7th July 2011, 11:59
I'd want to know the 'client' area for my main window, but I can't,
I Have the same value for both this->frameGeometry().height and this->size() ?
I'm using XP + QT4.7.2 + mingw
Any idea ?

mcosta
7th July 2011, 12:21
See here for more information about window geometry.

This code



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);
}


shows this result

6640

tonnot
7th July 2011, 13:04
I suspect than Mywindow has to be visible to I can know the framegeometry values ?

mcosta
7th July 2011, 13:07
of course.

Qt uses Window System information to know frameGeometry()