I have an application with QMainWindow in which I insert my own widget, inherited from QGraphicsView. As viewport I use QGLWidget. Everything works fine but with Hidh DPI there is a problem: my widget(inherited from QGraphicsView) is very small.
Before creation of QApplication I enable High DPI support by
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
and in my widget I do following (from signal that comes from QMainWindow deep in the code):
void MyWidget::onNeedResize(QRect newGeom)
{
// some logic, that not interact with GUI stuff
setGeometry(newGeom);
setSceneRect(QRect(QPoint(0, 0), newGeom.size()));
// more logic, that not interact with GUI stuff
}
What did I missed? Where is a problem?
UPD1: I replaced QGLWidget by QOpenGLWidget and everything started work just as expected! Without any modifications/calculations/additional stuff. Setting of the flag is enough. But the problem is I can't use QOpenGLWidget instead of QGLWidget for now.