Important: Please read the Qt Code of Conduct -

Top right align QToolBar

  • Hi,

    I want to add a movable toolbar on the top right of my screen. The only tricks I saw use an empty widget with an extensive policy. The problem of that is the grab action.

    The expected result is a grab widget just on the left of my toolbar.

    Is there a good solution for that?


  • @Robinsondesbois Hi,friend. Welcome.

    You can use a QWidget to add some QTollButtons as QToolBar. But this way cann't let the bar move by mouse in QMainWindow.

    Becuase in different OS, Win and Mac, we should use QToolBar in Win and QMacToolBar in Mac.

    So, I used QWidget to add some QToolButton. In QWidget we can set any layout.

  • Hi!
    Thank you for the reply !

    Put a QWidget with a correct layout into the Qtoolbar don't correct my problem because the grab item still show on the left of the toolbar (not just near the first QToolButton).


Log in to reply