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. QDialogButtonBox - push buttons' size bug
Forum Updated to NodeBB v4.3 + New Features

QDialogButtonBox - push buttons' size bug

Scheduled Pinned Locked Moved Unsolved General and Desktop
17 Posts 5 Posters 6.5k Views 2 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.
  • marko.lainovicM marko.lainovic

    @koahnig

    I haven't changed anything regarding the QDialogButtonBox' objects. There's a code in these dialogs' classes, for sure, but nothing related to those button boxes, and I haven't been changing settings is the Qt Designer Mode; I just used it for inserting widgets.

    Putting button boxes in/out of layouts doesn't help.

    Also, usage of QMessageBox::question has the same issue, and in this case, there's no Qt Designer Mode usage, of course.

    Thanks!

    J.HilkJ Offline
    J.HilkJ Offline
    J.Hilk
    Moderators
    wrote on last edited by
    #8

    @marko.lainovic seems like normal layout behaviour for me. Do you specify the size of your DialogButtonBox? To be, for example, as small as possible.

    Try to make the box bigger by using your mouse and 'dragging' the border further appart, the buttons should become bigger than.


    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


    Q: What's that?
    A: It's blue light.
    Q: What does it do?
    A: It turns blue.

    marko.lainovicM 1 Reply Last reply
    0
    • J.HilkJ J.Hilk

      @marko.lainovic seems like normal layout behaviour for me. Do you specify the size of your DialogButtonBox? To be, for example, as small as possible.

      Try to make the box bigger by using your mouse and 'dragging' the border further appart, the buttons should become bigger than.

      marko.lainovicM Offline
      marko.lainovicM Offline
      marko.lainovic
      wrote on last edited by marko.lainovic
      #9

      @J.Hilk

      Thanks very much, but I'm not getting it...

      I haven't specified anything. This is what Qt designer shows for the QDialogButtonBox object (image below):

      alt text

      As you can see, I made it on purpose to be like this; I dragged it out, there is no layout for the QDialogButtonBox object, etc...

      However, the "bug" is still there (image below):

      alt text

      J.HilkJ 1 Reply Last reply
      0
      • marko.lainovicM marko.lainovic

        @J.Hilk

        Thanks very much, but I'm not getting it...

        I haven't specified anything. This is what Qt designer shows for the QDialogButtonBox object (image below):

        alt text

        As you can see, I made it on purpose to be like this; I dragged it out, there is no layout for the QDialogButtonBox object, etc...

        However, the "bug" is still there (image below):

        alt text

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #10

        @marko.lainovic
        ah, now we're a bit closer :-)
        The DialogButtonBox is bigger than what is drawn in your widget.

        HOwever, try to give your central widget pointDialog a Layout maybe that will give it a change!?.


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        marko.lainovicM 1 Reply Last reply
        0
        • J.HilkJ J.Hilk

          @marko.lainovic
          ah, now we're a bit closer :-)
          The DialogButtonBox is bigger than what is drawn in your widget.

          HOwever, try to give your central widget pointDialog a Layout maybe that will give it a change!?.

          marko.lainovicM Offline
          marko.lainovicM Offline
          marko.lainovic
          wrote on last edited by marko.lainovic
          #11

          @J.Hilk

          Unfortunately, it doesn't :)

          This is the actual look of the PointDialog object:

          alt text

          Vertical layout is applied to the QDialog object. I've tried other layouts, too.

          The end result:

          alt text

          K 1 Reply Last reply
          0
          • marko.lainovicM marko.lainovic

            @J.Hilk

            Unfortunately, it doesn't :)

            This is the actual look of the PointDialog object:

            alt text

            Vertical layout is applied to the QDialog object. I've tried other layouts, too.

            The end result:

            alt text

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #12

            @marko.lainovic

            Can you create a small app showing this?
            I would suggest a simple application created by creator and add a dialog and check, if it is showing the problem on your machine.
            Others can cross-check the source on their machine with their installations.

            Vote the answer(s) that helped you to solve your issue(s)

            marko.lainovicM 1 Reply Last reply
            0
            • K koahnig

              @marko.lainovic

              Can you create a small app showing this?
              I would suggest a simple application created by creator and add a dialog and check, if it is showing the problem on your machine.
              Others can cross-check the source on their machine with their installations.

              marko.lainovicM Offline
              marko.lainovicM Offline
              marko.lainovic
              wrote on last edited by
              #13

              @koahnig

              Unfortunately, it's not easy to replicate :D

              I will try though and post it here!

              K 1 Reply Last reply
              0
              • marko.lainovicM marko.lainovic

                @koahnig

                Unfortunately, it's not easy to replicate :D

                I will try though and post it here!

                K Offline
                K Offline
                koahnig
                wrote on last edited by
                #14

                @marko.lainovic

                When you cannot replicate in another, it is obviously nothing with your installation of Qt.

                Since you nothing special in design mode of Qt creator and you observe the same behaviour in Qt standard dialogs such as QMessage, the problem is with your application.

                Did you play around with stylesheets in your application?

                Vote the answer(s) that helped you to solve your issue(s)

                marko.lainovicM 1 Reply Last reply
                0
                • K koahnig

                  @marko.lainovic

                  When you cannot replicate in another, it is obviously nothing with your installation of Qt.

                  Since you nothing special in design mode of Qt creator and you observe the same behaviour in Qt standard dialogs such as QMessage, the problem is with your application.

                  Did you play around with stylesheets in your application?

                  marko.lainovicM Offline
                  marko.lainovicM Offline
                  marko.lainovic
                  wrote on last edited by marko.lainovic
                  #15

                  @koahnig

                  Hi!

                  I tend to agree with you that something is amiss in the application, but I cannot figure out why...

                  I solved this problem by:

                  • Replacing QMessageBox::question call with QMessageBox object on stack..
                  • Setting minumum size for the buttons in the QDialogButtonBox object in the code.

                  I've been setting stylesheets just a couple of times in the code, but it has nothing to do with QPushButton or QDialogButtonBox objects... mainly background colors for QMenu objects and similar...

                  If I figure out what was the issue, I'll be sure to post it here!

                  R 1 Reply Last reply
                  1
                  • marko.lainovicM marko.lainovic

                    @koahnig

                    Hi!

                    I tend to agree with you that something is amiss in the application, but I cannot figure out why...

                    I solved this problem by:

                    • Replacing QMessageBox::question call with QMessageBox object on stack..
                    • Setting minumum size for the buttons in the QDialogButtonBox object in the code.

                    I've been setting stylesheets just a couple of times in the code, but it has nothing to do with QPushButton or QDialogButtonBox objects... mainly background colors for QMenu objects and similar...

                    If I figure out what was the issue, I'll be sure to post it here!

                    R Offline
                    R Offline
                    robertjjoynt
                    wrote on last edited by
                    #16

                    @marko.lainovic

                    Hi,

                    I have a suggestion for this issue. Perhaps the QDialogButtonBox has the following properties set (not at default values) which is causing the bad display: sizePolicy ( 4 properties), minimumSize (2 properties) and maximumSize (2 properties).

                    These properties will affect the expanding/shrinking of the buttonbox which may be causing the small buttons. These properties can be adjusted in QtDesigner. If they are set (marked in bold) then you could try unsetting them to see if it solves the problem.

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      theworldlock
                      wrote on last edited by
                      #17

                      try using CSS, change attributes according to your need

                      QDialogButtonBox QPushButton{
                        color:rgb(0,0,0);
                        height:80px;
                        font-size:20px;
                        padding:10px;
                        width:100px;
                        font-weight:bold;
                        background-color: rgb(237, 212, 0);
                        border-radius: 8px;
                      }
                      
                      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