Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to always fix the button to the right side using QtDesigner?
Forum Updated to NodeBB v4.3 + New Features

How to always fix the button to the right side using QtDesigner?

Scheduled Pinned Locked Moved Unsolved Qt for Python
18 Posts 3 Posters 2.7k 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.
  • _ _jao_victor_

    Hello. I have a GUI where a button always needs to be fixed to the right side of the screen, but when I change the window size the button does not follow the right edge of the screen. I am a beginner, it seems to me a simple problem for those who are already veterans, how can I solve this problem?

    bom.png

    ruim.png

    the button should not be in the middle of the bar, but pasted on the right edge of the GUI.

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by
    #2

    @_jao_victor_
    Assuming you are saying you are designing this in Creator/Designer, are you using layouts?

    _ 1 Reply Last reply
    0
    • JonBJ JonB

      @_jao_victor_
      Assuming you are saying you are designing this in Creator/Designer, are you using layouts?

      _ Offline
      _ Offline
      _jao_victor_
      wrote on last edited by
      #3

      @JonB The main screen has a layout in lines, only has 2 lines: the text editor and the bottom bar. Only this line layout is set in this GUI

      JonBJ M 2 Replies Last reply
      0
      • _ _jao_victor_

        @JonB The main screen has a layout in lines, only has 2 lines: the text editor and the bottom bar. Only this line layout is set in this GUI

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #4

        @_jao_victor_
        So what have you done in the designer to tell it where you want the button?

        Also you say

        where a button always needs to be fixed to the right side of the screen,
        the button does not follow the right edge of the screen.

        and also

        fix the button to the left side using QtDesigner
        the button should not be in the middle of the bar but pasted to the left edge of the GUI

        so I don't know which you want.

        _ 1 Reply Last reply
        0
        • _ _jao_victor_

          @JonB The main screen has a layout in lines, only has 2 lines: the text editor and the bottom bar. Only this line layout is set in this GUI

          M Offline
          M Offline
          mpergand
          wrote on last edited by
          #5

          @_jao_victor_
          Put the bottom bar and the button in a horizontal layout.

          JonBJ 1 Reply Last reply
          0
          • JonBJ JonB

            @_jao_victor_
            So what have you done in the designer to tell it where you want the button?

            Also you say

            where a button always needs to be fixed to the right side of the screen,
            the button does not follow the right edge of the screen.

            and also

            fix the button to the left side using QtDesigner
            the button should not be in the middle of the bar but pasted to the left edge of the GUI

            so I don't know which you want.

            _ Offline
            _ Offline
            _jao_victor_
            wrote on last edited by
            #6

            @JonB sorry, it was a dgitation error. I edited my question.

            JonBJ 1 Reply Last reply
            0
            • _ _jao_victor_

              @JonB sorry, it was a dgitation error. I edited my question.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #7

              @_jao_victor_
              Your title and first line read:

              How to always fix the button to the left side using QtDesigner?

              GUI where a button always needs to be fixed to the right side of the screen

              Those do not seem consistent to me. As per @mpergand, are your "bottom bar and the button in a horizontal layout"?

              _ 2 Replies Last reply
              0
              • JonBJ JonB

                @_jao_victor_
                Your title and first line read:

                How to always fix the button to the left side using QtDesigner?

                GUI where a button always needs to be fixed to the right side of the screen

                Those do not seem consistent to me. As per @mpergand, are your "bottom bar and the button in a horizontal layout"?

                _ Offline
                _ Offline
                _jao_victor_
                wrote on last edited by
                #8

                @JonB maybe, this will help you understand my layout.

                essevai.png

                1 Reply Last reply
                0
                • JonBJ JonB

                  @_jao_victor_
                  Your title and first line read:

                  How to always fix the button to the left side using QtDesigner?

                  GUI where a button always needs to be fixed to the right side of the screen

                  Those do not seem consistent to me. As per @mpergand, are your "bottom bar and the button in a horizontal layout"?

                  _ Offline
                  _ Offline
                  _jao_victor_
                  wrote on last edited by
                  #9

                  @JonB in the frame of the bottom bar has no vertical or horizontal layout

                  JonBJ 1 Reply Last reply
                  0
                  • _ _jao_victor_

                    @JonB in the frame of the bottom bar has no vertical or horizontal layout

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #10

                    @_jao_victor_
                    And the "red no entry" symbol Designer shows on the QFrame warns you that it needs a layout.

                    _ 1 Reply Last reply
                    1
                    • JonBJ JonB

                      @_jao_victor_
                      And the "red no entry" symbol Designer shows on the QFrame warns you that it needs a layout.

                      _ Offline
                      _ Offline
                      _jao_victor_
                      wrote on last edited by
                      #11

                      @JonB what layout do you need to use in which it is possible to achieve my goal?

                      1 Reply Last reply
                      0
                      • M mpergand

                        @_jao_victor_
                        Put the bottom bar and the button in a horizontal layout.

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by JonB
                        #12

                        @mpergand said in How to always fix the button to the right side using QtDesigner?:

                        @_jao_victor_
                        Put the bottom bar and the button in a horizontal layout.

                        Then if you want the button on the right, I can't remember whether the layout allows you to right align, or put a stretch to the left if not.

                        M 1 Reply Last reply
                        0
                        • JonBJ JonB

                          @mpergand said in How to always fix the button to the right side using QtDesigner?:

                          @_jao_victor_
                          Put the bottom bar and the button in a horizontal layout.

                          Then if you want the button on the right, I can't remember whether the layout allows you to right align, or put a stretch to the left if not.

                          M Offline
                          M Offline
                          mpergand
                          wrote on last edited by
                          #13

                          @JonB said in How to always fix the button to the right side using QtDesigner?:

                          I can't remember whether the layout allows you to right align,

                          Yes you can.

                          Now, this bottom bar ressembles very much to a QStatusBar in a QMainWindow and you can add any widget to it with:
                          addPermanentWidget(QWidget *widget, int stretch = 0)

                          _ 1 Reply Last reply
                          0
                          • M mpergand

                            @JonB said in How to always fix the button to the right side using QtDesigner?:

                            I can't remember whether the layout allows you to right align,

                            Yes you can.

                            Now, this bottom bar ressembles very much to a QStatusBar in a QMainWindow and you can add any widget to it with:
                            addPermanentWidget(QWidget *widget, int stretch = 0)

                            _ Offline
                            _ Offline
                            _jao_victor_
                            wrote on last edited by
                            #14

                            @mpergand @JonB

                            and how do I do this using qtdesigner? I added a column ed layout to my bottom bar.

                            certo.png

                            _ 1 Reply Last reply
                            0
                            • _ _jao_victor_

                              @mpergand @JonB

                              and how do I do this using qtdesigner? I added a column ed layout to my bottom bar.

                              certo.png

                              _ Offline
                              _ Offline
                              _jao_victor_
                              wrote on last edited by
                              #15

                              now the button is central

                              M 1 Reply Last reply
                              0
                              • _ _jao_victor_

                                now the button is central

                                M Offline
                                M Offline
                                mpergand
                                wrote on last edited by
                                #16

                                @_jao_victor_
                                Right-click on the button and choose :
                                Layout Alignment->Right

                                _ 2 Replies Last reply
                                0
                                • M mpergand

                                  @_jao_victor_
                                  Right-click on the button and choose :
                                  Layout Alignment->Right

                                  _ Offline
                                  _ Offline
                                  _jao_victor_
                                  wrote on last edited by
                                  #17
                                  This post is deleted!
                                  1 Reply Last reply
                                  0
                                  • M mpergand

                                    @_jao_victor_
                                    Right-click on the button and choose :
                                    Layout Alignment->Right

                                    _ Offline
                                    _ Offline
                                    _jao_victor_
                                    wrote on last edited by
                                    #18

                                    @mpergand the alignment layout is not selectable, what will be the reason?

                                    quasela.png

                                    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