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

How to choose monitor main window appears on?



  • I have an app I'm developing in QtCreator. My computer has a 3 monitor setup and I've noticed that the app will at different times appear on any of the monitors. Which monitor it appears on seems to be determined by which other monitor I've been working in most recently. So, if I launch my program and then click on a web browser in monitor 3, the main window of my app will appear on monitor 3. Same for the other monitors.

    I'd like to explicitly tell my app to appear on a particular monitor every time. Is there a way to do this?


  • Moderators

    @kitfox
    the app appears in the monitor where your mouse curser was during launch, that's the default behavior.

    After startup, you can use move(), to move your main window over the desktop and you can use the QScreen class to query for information about your desktop.

    The rest is up to you ;-)


Log in to reply