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. QDesktopWidget::.screenGeometry() from a Thread
Forum Updated to NodeBB v4.3 + New Features

QDesktopWidget::.screenGeometry() from a Thread

Scheduled Pinned Locked Moved Solved General and Desktop
qscreenqdesktopwidgetthreadgeometry
3 Posts 2 Posters 2.0k 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.
  • E Offline
    E Offline
    eKKiM
    wrote on 30 Jun 2016, 22:35 last edited by
    #1

    Hi,

    I am trying to get the exact geometry of every screen in a thread (ran by QThread).
    It seems that QScreen has not the functionality i want. QScreen::availableGeometry() excludes the taskbar from the geometry.

    The alternative is QDesktopWidget::.screenGeometry(screenIndex). However i cannot initiate a QDesktopWidget in my thread.
    ASSERT failure in QWidget: "Widgets must be created in the GUI thread."

    What is the alternative for this to get the info in a thread?

    Kind Regards
    eKKiM

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Jun 2016, 22:43 last edited by
      #2

      Hi and welcome to devnet,

      Did you create a QApplication in your main.cpp ?

      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
      1
      • E Offline
        E Offline
        eKKiM
        wrote on 30 Jun 2016, 22:52 last edited by
        #3

        Yes i did.

        And with that clue i figured it out! QApplication::desktop()->screenGeometry(screenIndex); works like a charm.
        Tyvm!

        1 Reply Last reply
        0

        1/3

        30 Jun 2016, 22:35

        • 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