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
Forum Updated to NodeBB v4.3 + New Features

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 522 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
    dv__
    wrote on 12 Sept 2023, 11:16 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?

    J 1 Reply Last reply 12 Sept 2023, 11:19
    0
    • D dv__
      12 Sept 2023, 11:16

      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?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 12 Sept 2023, 11:19 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 12 Sept 2023, 11:36
      1
      • J jsulm
        12 Sept 2023, 11:19

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

        D Offline
        D Offline
        dv__
        wrote on 12 Sept 2023, 11:36 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 13 Sept 2023, 11:44

        1/3

        12 Sept 2023, 11:16

        • Login

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