The title bar for my QQuickView
Qt application is too big when I move the window to my secondary monitor. It displays correctly on my primary monitor. The title bar is the correct size if I use QWidget
instead of QQuickView
.
Is it possible to make the title bar display correctly for a QQuickView
application? If so, how?
I am using PySide2 version 5.15.0 on Windows 10 version 1803. My primary monitor DPI is set to 125%, and my secondary monitor is set to 100%. The application is running as "per-monitor DPI aware". The Qt documentation on high DPI support didn't have anything helpful for resolving this. I played around with various DPI settings and environment variables.
test.py
from PySide2 import QtWidgets
from PySide2.QtCore import QUrl
from PySide2.QtQuick import QQuickView
if __name__ == '__main__':
app = QtWidgets.QApplication([])
view = QQuickView()
view.setResizeMode(QQuickView.SizeRootObjectToView)
view.setSource(QUrl('view.qml'))
view.show()
app.exec_()
view.qml
import QtQuick 2.0
Rectangle {
width: 300
height: 200
color: "green"
Text {
text: "Hello World"
anchors.centerIn: parent
}
}