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 specify which screen a app "opens" on
Forum Updated to NodeBB v4.3 + New Features

How to specify which screen a app "opens" on

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 208 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.
  • bigguinessB Offline
    bigguinessB Offline
    bigguiness
    wrote on last edited by
    #1

    My desktop setup has 3 monitors. When I run an app from Qt Creator on monitor 2 and move my mouse to another monitor the app will open on the monitor my mouse is on.

    I'm not sure if this is a side effect of running an app from Qt Creator or if this is just how Qt works.

    Is it possible to specify in the code which monitor the app opens on? For instance I always want it to open on monitor 1.

    Thanks

    W 1 Reply Last reply
    0
    • bigguinessB bigguiness

      My desktop setup has 3 monitors. When I run an app from Qt Creator on monitor 2 and move my mouse to another monitor the app will open on the monitor my mouse is on.

      I'm not sure if this is a side effect of running an app from Qt Creator or if this is just how Qt works.

      Is it possible to specify in the code which monitor the app opens on? For instance I always want it to open on monitor 1.

      Thanks

      W Offline
      W Offline
      wrosecrans
      wrote on last edited by
      #2

      @bigguiness Basically, get a QScreen, and then call setScreen on the widget you want moved to that screen: https://doc.qt.io/qt-6/qwidget.html#setScreen

      You probably want to do it before the widget is shown.

      1 Reply Last reply
      1

      • Login

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