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. Creation of custom menubar.
Forum Updated to NodeBB v4.3 + New Features

Creation of custom menubar.

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 1.1k 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.
  • A Offline
    A Offline
    Asimo
    wrote on last edited by
    #1

    Hello dear forum members,

    there is a standard menubar (I can see it in Qt in design mode), but I need to customize it - add another element to the rightmost part. By default, only the buttons on the left can be inserted into the menubar one after the other.

    What is the best way to do: create my own component with an imitation of menubar, or can I upgrade the standard component? And how can I do it?

    Thank you in advance!

    Happy New Year!)

    JonBJ 1 Reply Last reply
    0
    • A Asimo

      @JonB I use Qt designer to construct my layout. And first UI element that I want to create is a menubar. QMenuBar let me include QMenu's, and they appear on the left side of QMenuBar line. But I want to add some additional info (kind of status info) in the right side of QMenuBar.
      Here is what I mean:
      86ed461a-f44b-495d-8703-f60374873fc0-image.png

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

      @Asimo
      Fair enough, I have never done that. Looks like you want to add an arbitrary widget, and have it placed over at the right-hand side. I don't know how easy it is to do that. I think https://stackoverflow.com/questions/8726677/aligning-qmenubar-items-add-some-on-left-and-some-on-right-side shows how to have some items at left and some at right (the accepted solution does it by two separate menu bars!). There is also https://stackoverflow.com/questions/14645596/stacking-qpushbuttons-on-the-other-side-of-a-qmenubar. Or Google for something like qmenubar widget at right --- I imagine you may not be the only person who wants this.

      A 1 Reply Last reply
      0
      • A Asimo

        Hello dear forum members,

        there is a standard menubar (I can see it in Qt in design mode), but I need to customize it - add another element to the rightmost part. By default, only the buttons on the left can be inserted into the menubar one after the other.

        What is the best way to do: create my own component with an imitation of menubar, or can I upgrade the standard component? And how can I do it?

        Thank you in advance!

        Happy New Year!)

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

        @Asimo
        I do not understand what you are saying cannot be added to the "rightmost" part yet can be inserted into the "leftmost" part? Given a QMenuBar items can be inserted anywhere. What exactly would you like to do which you say cannot be done?

        A 1 Reply Last reply
        1
        • JonBJ JonB

          @Asimo
          I do not understand what you are saying cannot be added to the "rightmost" part yet can be inserted into the "leftmost" part? Given a QMenuBar items can be inserted anywhere. What exactly would you like to do which you say cannot be done?

          A Offline
          A Offline
          Asimo
          wrote on last edited by
          #3

          @JonB I use Qt designer to construct my layout. And first UI element that I want to create is a menubar. QMenuBar let me include QMenu's, and they appear on the left side of QMenuBar line. But I want to add some additional info (kind of status info) in the right side of QMenuBar.
          Here is what I mean:
          86ed461a-f44b-495d-8703-f60374873fc0-image.png

          JonBJ 1 Reply Last reply
          0
          • A Asimo

            @JonB I use Qt designer to construct my layout. And first UI element that I want to create is a menubar. QMenuBar let me include QMenu's, and they appear on the left side of QMenuBar line. But I want to add some additional info (kind of status info) in the right side of QMenuBar.
            Here is what I mean:
            86ed461a-f44b-495d-8703-f60374873fc0-image.png

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

            @Asimo
            Fair enough, I have never done that. Looks like you want to add an arbitrary widget, and have it placed over at the right-hand side. I don't know how easy it is to do that. I think https://stackoverflow.com/questions/8726677/aligning-qmenubar-items-add-some-on-left-and-some-on-right-side shows how to have some items at left and some at right (the accepted solution does it by two separate menu bars!). There is also https://stackoverflow.com/questions/14645596/stacking-qpushbuttons-on-the-other-side-of-a-qmenubar. Or Google for something like qmenubar widget at right --- I imagine you may not be the only person who wants this.

            A 1 Reply Last reply
            0
            • JonBJ JonB

              @Asimo
              Fair enough, I have never done that. Looks like you want to add an arbitrary widget, and have it placed over at the right-hand side. I don't know how easy it is to do that. I think https://stackoverflow.com/questions/8726677/aligning-qmenubar-items-add-some-on-left-and-some-on-right-side shows how to have some items at left and some at right (the accepted solution does it by two separate menu bars!). There is also https://stackoverflow.com/questions/14645596/stacking-qpushbuttons-on-the-other-side-of-a-qmenubar. Or Google for something like qmenubar widget at right --- I imagine you may not be the only person who wants this.

              A Offline
              A Offline
              Asimo
              wrote on last edited by
              #5

              @JonB Thank you! I just want to understand the principles of creating GUIs using Qt. I am a newbie in Qt and c++. And this first task made me stuck. I used Qt Designer and now I'm not sure that it is the right tool for my task. I will keep searching.

              JonBJ 1 Reply Last reply
              0
              • A Asimo

                @JonB Thank you! I just want to understand the principles of creating GUIs using Qt. I am a newbie in Qt and c++. And this first task made me stuck. I used Qt Designer and now I'm not sure that it is the right tool for my task. I will keep searching.

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

                @Asimo
                Well, for your first task you decided you wanted to place some arbitrary widget (at the right) on a QMenuBar, which is simply not one of the features it offers; so one has to do some work to achieve that. I don't see why that in itself should reflect upon, or put you off, Qt Designer.

                Let's be clear: everything you can do in Designer you can do in code, just it's nicer to design/maintain visually. But not everything you can do in code can be done in Designer. You can mix & match bits of code produced from Designer with your own code to alter or augment it.

                A 1 Reply Last reply
                0
                • JonBJ JonB

                  @Asimo
                  Well, for your first task you decided you wanted to place some arbitrary widget (at the right) on a QMenuBar, which is simply not one of the features it offers; so one has to do some work to achieve that. I don't see why that in itself should reflect upon, or put you off, Qt Designer.

                  Let's be clear: everything you can do in Designer you can do in code, just it's nicer to design/maintain visually. But not everything you can do in code can be done in Designer. You can mix & match bits of code produced from Designer with your own code to alter or augment it.

                  A Offline
                  A Offline
                  Asimo
                  wrote on last edited by
                  #7

                  @JonB You are right. I will try.

                  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