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. Position widgets by pixel
Qt 6.11 is out! See what's new in the release blog

Position widgets by pixel

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 521 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.
  • N Offline
    N Offline
    nnzz
    wrote on last edited by
    #1

    Hi, I need to position my app views (widgets) using absolute coordinates.
    I have been reading about problems using absolute coordinates, and I would like to use a grid layout, I'm not sure how. My app will run on different sized monitors but the main window cannot be resized.
    I have a configuration file that gives exact position coordinates for views in a given size screen. For example, we want a couple of 250x250 rectangles at the right upper corner and the right bottom corner:
    screenwidth = 1920
    screenheight = 1080

    [Layout]
    views = [ "A", "B"]

    [A]
    left = 1670
    top = 0
    width = 250
    height = 250

    [B]
    left = 1670
    top = 830
    width = 250
    height = 250

    How can I tell a grid layout to keep spaces between the widgets? How can I translate absolute coordinates to grid coordinates?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Positioning widgets pixel-exact and using layouts contradicts each other.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2

      • Login

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