Details
-
Suggestion
-
Resolution: Out of scope
-
P2: Important
-
4.3.0
-
None
Description
It would be nice if the undocked dockwidget would work with the setGeometry() function.
Currently it seems that the frame size is included when getting/setting the size of the undocked QDockWidget.
This makes it difficult to layout and resize widget on the screen because the size of the frame of the QDockWidget must be compensated for.
Reproducible with the following example:
#include <QtGui>
#include <QDebug>
// Shows two windows that are not the same size
// Expected two windows that were in the same position and size
// The dockwidget is smaller thant the QWidget.
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QMainWindow w;
w.setCentralWidget(new QTextEdit(0));
QDockWidget dw(&w);
dw.setWidget(new QWidget);
dw.setFloating(true);
dw.setGeometry ( 60, 60, 150, 150 );
qDebug() << dw.frameGeometry().height();
qDebug() << dw.frameGeometry().width();
QWidget w2;
w2.show();
w2.setGeometry ( 60, 60, 150, 150 );
qDebug() << dw.frameGeometry().height();
qDebug() << dw.frameGeometry().width();
w.show();
dw.show();
return app.exec();
}