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. Strange behavior with QToolBar
QtWS25 Last Chance

Strange behavior with QToolBar

Scheduled Pinned Locked Moved Solved General and Desktop
qtoolbarqdesginersizepolicy
5 Posts 2 Posters 517 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
    Saviz
    wrote on 19 Dec 2022, 04:43 last edited by
    #1

    Greetings. I hope you are doing well.

    What I want to achieve:

    I am trying to place an empty QToolBar to left side of my top QToolBar in my application. In the design view, it shows that the QToolBar is placed to left hand side of the other QToolBar. This is exactly what I am looking for.

    Image:

    Designer.png

    Issue:

    As soon as I run the application, my tool bar is positioned at the right side.

    Image:

    Runing app.png

    As I am not sure why this behavior is occurring, I wanted to ask for help.

    Thank you for taking the time to read my question and help me.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 19 Dec 2022, 20:11 last edited by
      #2

      Hi,

      Are you doing anything in code with regard to these tool bars ?

      Are you loading and saving their geometry or something similar ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply 20 Dec 2022, 02:23
      0
      • S SGaist
        19 Dec 2022, 20:11

        Hi,

        Are you doing anything in code with regard to these tool bars ?

        Are you loading and saving their geometry or something similar ?

        S Offline
        S Offline
        Saviz
        wrote on 20 Dec 2022, 02:23 last edited by
        #3

        @SGaist

        Are you doing anything in code with regard to these tool bars ?

        No. I am currently just experimenting with the UI by using the Qt Designer, and some inline styles sheets. I have not touched the code since I began the project.

        Are you loading and saving their geometry or something similar ?

        No. I have no knowledge about how to accomplish this type of behavior.

        Maybe this will help:

        When I first started the project, as I dragged and dropped the other Widgets (QToolBars), they were all positioning themselves where I specified them to be. (Where I dropped them). However, for some reason the last QToolBar is behaving strange. Even tough I drop it to the left side of the QToolBar containing the "Copy", "Paste", and "Cut" actions, it refuses to stay there. In the designer tab it shows that it is in the correct place. However, as soon as I start the application it jumps to the right side. Can this behavior arise from it being empty and containing no actions?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 20 Dec 2022, 20:25 last edited by
          #4

          AFAIK, the fact that it's empty should have no role with regard to the position.

          Can you provide a minimal compilable example that shows this behaviour ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Saviz
            wrote on 21 Dec 2022, 23:44 last edited by
            #5

            Hello again,

            I managed to fix the issue. I simply moved all my QAction objects to the other QToolBar since the designer did not allow me to reposition the tool bars.

            Thank you again.

            1 Reply Last reply
            0

            5/5

            21 Dec 2022, 23:44

            • Login

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