As @luke_carter already said, this is possible by calling one of the QFrame functions associated with its size, for example QFrame :: frameGeometry () . It gets the size of the window , including the title. So all you need is to resize the QML window. I think the best way to do this is with a singlet with suitable functions, for example:
QRect MySingleton::frameSize(QObject *window) { QQuickWindow *qw = qobject_cast<QQuickWindow *>(window); if(qw) return qw->frameGeometry(); return QRect(); }
In QML:
Window { id: wnd visible: true width: 300 height: 300 Component.onCompleted: { var rect = MySingleton.frameSize(wnd); console.log(rect.width + "," + rect.height); } }
source share