Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Why cannot set screenGeometry on imx8 wayland backend



  • code:
    widget1::widget1(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::widget1)
    {
    ui->setupUi(this);
    m_desktopWidget = QApplication::desktop();
    QRect rect = m_desktopWidget->screenGeometry(1);
    this->setGeometry(0,0,800,480);
    }

    I can not set the screen by screenGeometry .
    I cant not set coordinate system by setGeometry.
    How to fix it on wayland? It is works fine on X11


  • Lifetime Qt Champion

    @Aplix said in Why cannot set screenGeometry on imx8 wayland backend:

    I can not set the screen by screenGeometry .

    You are not setting the geometry based on screen geometry at all! You set it fixed to 0,0,800,480.
    Should be:

    QRect rect = m_desktopWidget->screenGeometry(1);
    this->setGeometry(rect);
    

Log in to reply