Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions

QScreen, QGraphicsScene, QGraphicsView size



  • Hi there! Maybe somebody could help me, I have 2 questions:

    1. I'm trying to check the resolution of my device to prevent going outside the scene. I do it like this:

    QScreen *screen = QApplication::primaryScreen();
    QRect screenGeometry = screen->geometry();
    this->screenWidth = screenGeometry.width();
    this->screenHeight = screenGeometry.height();

    As a result I receive values 360 and 720, but my device has actually 720x1440 (twice larger).

    So, the first question is, why Qt by default use this resolution instead of original and how I can change it?

    1. Does anybody has any links to examples where QGraphicsScene/QGraphicsView classes are used to create a scalable application?

Log in to reply