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. OS specific default button dimensions ?
Forum Update on Monday, May 27th 2025

OS specific default button dimensions ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 319 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.
  • S Offline
    S Offline
    SPlatten
    wrote on 9 Feb 2021, 06:44 last edited by
    #1

    Is there a way to get the default Operating System specific default button dimensions? What I mean is for example when an OS specific dialog is displayed, is there a way to get the default button size width and height that is used so when I add a button to a dialog or form I can set it to appear to the same size as buttons appearing elsewhere?

    Also to go with this, is there any hints / offsets or information on where the buttons are to appear?

    Thank you

    Kind Regards,
    Sy

    J 1 Reply Last reply 9 Feb 2021, 07:09
    0
    • S SPlatten
      9 Feb 2021, 06:44

      Is there a way to get the default Operating System specific default button dimensions? What I mean is for example when an OS specific dialog is displayed, is there a way to get the default button size width and height that is used so when I add a button to a dialog or form I can set it to appear to the same size as buttons appearing elsewhere?

      Also to go with this, is there any hints / offsets or information on where the buttons are to appear?

      Thank you

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 9 Feb 2021, 07:09 last edited by
      #2

      @SPlatten said in OS specific default button dimensions ?:

      I can set it to appear to the same size as buttons appearing elsewhere?

      Actually you should not set the sizes manually, but use layouts

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply 9 Feb 2021, 07:13
      0
      • J jsulm
        9 Feb 2021, 07:09

        @SPlatten said in OS specific default button dimensions ?:

        I can set it to appear to the same size as buttons appearing elsewhere?

        Actually you should not set the sizes manually, but use layouts

        S Offline
        S Offline
        SPlatten
        wrote on 9 Feb 2021, 07:13 last edited by
        #3

        @jsulm , thank you, I am using layouts but the the example I added to the layout is by default filling the cell.

        Kind Regards,
        Sy

        J 1 Reply Last reply 9 Feb 2021, 07:15
        0
        • S SPlatten
          9 Feb 2021, 07:13

          @jsulm , thank you, I am using layouts but the the example I added to the layout is by default filling the cell.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 9 Feb 2021, 07:15 last edited by
          #4

          @SPlatten Can you explain a bit better? What cell do you mean? Buttons usually do not fill whole available space.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SPlatten
            wrote on 9 Feb 2021, 07:26 last edited by
            #5

            @jsulm , Presently, I have a QGridLayout in the form, when I add widgets to the layout I use:

            pobjGridLO->addWidget(pobjNode->pobjGetWidget(), intRow, intCol, intColSpan, intRowSpan, eCellAlign);
            

            The defaults for intColSpan and intRowSpan are 1, for a button if no height and width is supplied the button fills the available area in the grid location.

            Kind Regards,
            Sy

            1 Reply Last reply
            0

            1/5

            9 Feb 2021, 06:44

            • Login

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