Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QApplication.screens() with two laptops connected to the same monitor
Forum Updated to NodeBB v4.3 + New Features

QApplication.screens() with two laptops connected to the same monitor

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 91 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    daddydave
    wrote last edited by
    #1

    I am listing all monitors being used and adding them to my widget. Here is the relevant part:

    from PySide6 import QtWidgets as qtw
    .
    .
    .
    .
            screens = qtw.QApplication.screens()
                for screen in screens:
                geo = screen.geometry()
                self.cb_Screen.addItem(f"{screen.name()}")
    

    It works fine, but I have a monitor that switches between two different laptops (the laptop built-in screens being primary). The thing is, both laptops are always connected, and the switch is in the monitor itself. Even if the other laptop is using that monitor, and even if it is black due to the other laptop being on the lock screen, it gets picked up in qtw.QApplication.screens(). I assume this is by design, but could there be a way to filter out the screen that is being used by the other laptop? Not a big deal if not, but I am curious about it.

    I am using PySide6 6.9.1 on Windows 11 in case that is relevant.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by
      #2

      Hi,

      I don't think there is since the screen is likely seen as present and active even if switched to the other screen.

      How is it seen by the system settings ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • D daddydave has marked this topic as solved
      • D Offline
        D Offline
        daddydave
        wrote last edited by
        #3

        It shows both monitors in Windows Display settings as well.

        1 Reply Last reply
        0

        • Login

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