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. Selecting a specific QScreen based on a configuration and the screen's name

Selecting a specific QScreen based on a configuration and the screen's name

Scheduled Pinned Locked Moved Solved General and Desktop
screengui
3 Posts 2 Posters 413 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.
  • D Offline
    D Offline
    dv__
    wrote on last edited by
    #1

    The QScreen documentation states that the name property should not be used for uniquely identifying a screen. However, I have an application which reads a configuration file. I want to be able to specify in that configuration file what particular QScreen my application shall run in. The only usable value I found is the name. For example, if the name is "DisplayPort-1", I'd specify that in the configuration.

    Does "uniquely identifying" refer to attempts to uniquely identify the screen across hosts etc.? Is it okay to use the name to identify the screen within the same machine, especially if no screens are ever added or removed? Or is there a different property that is better suited for this purpose?

    jsulmJ 1 Reply Last reply
    0
    • D dv__

      The QScreen documentation states that the name property should not be used for uniquely identifying a screen. However, I have an application which reads a configuration file. I want to be able to specify in that configuration file what particular QScreen my application shall run in. The only usable value I found is the name. For example, if the name is "DisplayPort-1", I'd specify that in the configuration.

      Does "uniquely identifying" refer to attempts to uniquely identify the screen across hosts etc.? Is it okay to use the name to identify the screen within the same machine, especially if no screens are ever added or removed? Or is there a different property that is better suited for this purpose?

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @dv__ You could also use https://doc.qt.io/qt-6/qscreen.html#serialNumber-prop

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      1
      • jsulmJ jsulm

        @dv__ You could also use https://doc.qt.io/qt-6/qscreen.html#serialNumber-prop

        D Offline
        D Offline
        dv__
        wrote on last edited by
        #3

        @jsulm Okay, I'll try that.

        On Linux though, are the screen names typically the connectors? If so, they'd be unique enough for me, since this application is Linux only.

        1 Reply Last reply
        0
        • D dv__ has marked this topic as solved on

        • Login

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