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. Size of a dialog box
Forum Updated to NodeBB v4.3 + New Features

Size of a dialog box

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

    Greetings.

    Implement a dialog box for an application and it works pretty well. I work with a laptop, and run my program on another computer the dialog box looks considerably larger (but still works well).

    The other machine monitor is larger and possibly has a different screen resolution (I have insurance).

    My question is: is it possible to make the dialog box always looks the same (ie proportionally occupy the same screen space) regardless of size and resolution of the screen?

    Thanks in advance for any help and/or suggestions.

    Isaac Pérez
    Programming is understanding.

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi,
      I think the easiest way to do this is to read out the height/width of your mainwindow (or the window the dialog is placed on) and then convert this to a dialog height/width and set the size accordingly. This is still platform independent. You could also request the screen size from the OS, but then for iOS/Android/Win32 the interface is all different.

      Greetz, Jeroen

      1 Reply Last reply
      0
      • I Offline
        I Offline
        isaacEnrique
        wrote on last edited by
        #3

        Thanks Greetz Jeroen.

        Initially had thought of that, ie give to the dialog box a size that is a percentage of the parent widget's size. I had to ask to know if there was another alternative.

        Greetings.

        Isaac Pérez
        Programming is understanding.

        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