Hi all, I'm trying to set the inner area of a QMdiSubArea to a specific size, but the the resize(..) member of QMdiSubArea includes the frame. As stated in the documentation ( http://qt-project.org/doc/qt-5.0/qtwidgets/application-windows.html#window-geometry) resize(..) (belonging to size()) should exclude the frame and set the size of the inner area, but it sets the size of the complete sub window. Matching that, size() returns the same frame-including-value as frameSize() does. I know that there are (non-beautiful/simple) ways to do that, by determining the border width of a sub window, but I'm just curious why we have such an inconsitency here. I add a minimal example, where you can see the normal behavior and the one of the sub window. In addition there is a commented resize command, which produces (uncommented) on my machines another strange behavior: the window is moved to the top left corner of the screen, so that the header bar of the window lies outside of it.
#include <QApplication> #include <QtWidgets/QtWidgets> #include <QDebug> int main(int argc, char *argv[]) { QApplication a(argc, argv); QPushButton * button = new QPushButton("button"); QMdiArea area; QMdiSubWindow * sub = area.addSubWindow(button); area.show(); qDebug() << "strange: "<< sub->size() << sub->frameSize(); qDebug() << "expected: " << area.size() << area.frameSize(); // area.resize(500, 500); return a.exec(); } (all on Win7 x64 with a Qt 5.0.1/.2 x86 MSVC release) Any ideas on that? Greetings Immanuel
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest