SingleApplication icon indicating copy to clipboard operation
SingleApplication copied to clipboard

No primaryScreen property

Open andr1972 opened this issue 3 years ago • 1 comments

Before change to SingleApplication I have

int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    QScreen *screen = QGuiApplication::primaryScreen();
    QRect  screenGeometry = screen->geometry();

    MainWindow mainWindow;
    mainWindow.resize(int(screenGeometry.width()*0.8), int(screenGeometry.height()*0.8));
    mainWindow.show();
    return app.exec();
}

After change QApplication to SingleApplication, screen is NULL. How can this be a workaround?

andr1972 avatar Aug 13 '22 18:08 andr1972

Did you set the QAPPLICATION_CLASS macro to QGuiApplication?

On Sat, 13 Aug 2022, 21:18 Andrzej Borucki, @.***> wrote:

Before change to SingleApplication I have

int main(int argc, char **argv) { QApplication app(argc, argv);

QScreen *screen = QGuiApplication::primaryScreen();
QRect  screenGeometry = screen->geometry();

MainWindow mainWindow;
mainWindow.resize(int(screenGeometry.width()*0.8), int(screenGeometry.height()*0.8));
mainWindow.show();
return app.exec();

}

After change QApplication to SingleApplication, screen is NULL. How can this be a workaround?

— Reply to this email directly, view it on GitHub https://github.com/itay-grudev/SingleApplication/issues/164, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQGP53H4NOZJP46ENV2GDLVY7RGPANCNFSM56OQESAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

itay-grudev avatar Aug 13 '22 23:08 itay-grudev