Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Setting geometry to match embedded device in Qt Designer

Setting geometry to match embedded device in Qt Designer

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 4.1k 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.
  • K Offline
    K Offline
    kchandr7
    wrote on last edited by
    #1

    My Embedded device is a 7 inch display at 800 by 480 and my computer is at a different resolution. How do I change the dimensions of the geometry to match my 7 inch display?

    Even when I set my parent Widget to 800 by 480, it does not reflect the dimensions of the device itself. How do I change that in Qt Designer?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stukdev
      wrote on last edited by
      #2

      use fullscreen funtion can be a solution?

      otherwise use something like:

      @
      QApplication a(argc,argv);
      Menu b;
      b.resize(a.desktop()->width(), a.desktop()->height());
      b.show();
      return a.exec();
      @

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kchandr7
        wrote on last edited by
        #3

        Hmm, is line number 3 ok? Because I don't think desktop has the method width() or height().

        I've tried Full Screen, the problem is with QtDesigner. There should be a an option to set the canvas in terms of inches.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          stukdev
          wrote on last edited by
          #4

          Yes its correct desktop return a QDesktopWidget that inherit QWidget and have width and height method. Maybe you have to include the QDesktopWidget header to build correctly.
          For the inched in designer i don't know if there's an option.

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kchandr7
            wrote on last edited by
            #5

            Hi,

            I was able to resolve this using QPaintDevice and setting the Device profile to match the DPI of the device.

            @ qDebug()<<"Logical DPI "<<QPaintDevice::logicalDpiX()<<"x"<<QPaintDevice::logicalDpiY();
            qDebug()<<"Physical DPI"<<QPaintDevice::physicalDpiX()<<"x"<<QPaintDevice::physicalDpiY();@

            The device had 72 DPI and I set this in the device profile of Qt Designer (Tools>Options>Designer) .
            Required restarting Qt Creator before applying.

            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