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 do I check external monitor resolution?
Forum Updated to NodeBB v4.3 + New Features

How do I check external monitor resolution?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 542 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.
  • G Offline
    G Offline
    graniteDev
    wrote on last edited by
    #1

    I don't see any classes that allow me to check external monitor resolutions. I have an embedded project where I need to let the user know if they plug in an external monitor that can't support the resolution our application requires. Can I do this with Qt?

    1 Reply Last reply
    0
    • ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      Hi @graniteDev ,
      you can get screens list
      and use geometry() method to get height and width

      1 Reply Last reply
      3
      • G Offline
        G Offline
        graniteDev
        wrote on last edited by
        #3

        Thankyou, that worked well. You wouldn't happen to know how to get the screenAdded() and screenRemoved() signals to actually work would you? I've tried plugging in and unplugging the second monitor but the signal is never sent

        1 Reply Last reply
        0
        • ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by
          #4

          @graniteDev I have never did that yet, and can't try right now.
          Could you show your code please ?

          G 1 Reply Last reply
          0
          • ODБOïO ODБOï

            @graniteDev I have never did that yet, and can't try right now.
            Could you show your code please ?

            G Offline
            G Offline
            graniteDev
            wrote on last edited by
            #5

            @LeLev

            DesktopManager::DesktopManager(QGuiApplication *qga, QObject *parent)
                : QObject(parent),
            {
                m_guiApplication = qga;
                connect(m_guiApplication, &QGuiApplication::screenAdded, this, &DesktopManager::checkScreenCount);
                connect(m_guiApplication, &QGuiApplication::screenRemoved, this, &DesktopManager::checkScreenCount);
            
            }
            .
            .
            .
            .
            void DesktopManager::checkScreenCount()
            {
                qDebug() << "screen count changed";
            }
            
            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