Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to choose monitor main window appears on?
QtWS25 Last Chance

How to choose monitor main window appears on?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 207 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kitfox
    wrote on last edited by
    #1

    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?

    J.HilkJ 1 Reply Last reply
    0
    • K kitfox

      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?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by J.Hilk
      #2

      @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 ;-)


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      4

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved