Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Howto change the text "Exit" and "Options" in the menubar
Qt 6.11 is out! See what's new in the release blog

Howto change the text "Exit" and "Options" in the menubar

Scheduled Pinned Locked Moved Mobile and Embedded
10 Posts 3 Posters 6.5k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello,

    now I open the window with showMaximized instead of showFullscreen, so that there is the menubar at the bottom (Options / Exit) and the system's bar at the top.

    How to change the captions "Exit" and "Options" ???

    Btw; I know that I can add child elements to them with signals, too; but I want to change these main things to German.

    Thank you

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      try to double click?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        I think you misunderstood me.
        I know that the titles of the menu items can be changed by double clicking.
        But "Options" and "Exit" are main captions and "Options" has children called abc,xyz,... in my example.

        This is how they are changed when starting on my phone
        !http://z19.img-up.net/Screenshote732.png(how menubar is transformed really)!

        How to change the main captions "Options" and "Exit", I think they even don't belong to QMenuBar, especially "Exit" does not because it is seperated from Options' menu.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          you want to change the Subtitle of "Option" and "exit" right?
          but it's failing with double click?
          strange!

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Yes, and I don't know what to do.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              gmaro
              wrote on last edited by
              #6

              Don't know why it does not work for you but you always can modify the .ui file manually,

              I.e. in following example you have the something and something2 menus, you can modify their <string>something</string> values.
              @
              <widget class="QMenuBar" name="menuBar">
              <property name="geometry">
              <rect>
              <x>0</x>
              <y>0</y>
              <width>400</width>
              <height>20</height>
              </rect>
              </property>
              <widget class="QMenu" name="menuSomething">
              <property name="title">
              <string>something</string>
              </property>
              </widget>
              <widget class="QMenu" name="menuSomething2">
              <property name="title">
              <string>something2</string>
              </property>
              <addaction name="actionAsd"/>
              </widget>
              <addaction name="menuSomething"/>
              <addaction name="menuSomething2"/>
              </widget>
              @

              Modifying action names is similar, change the "asd" to other:
              @
              <action name="actionAsd">
              <property name="text">
              <string>asd</string>
              </property>
              </action>
              @

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                I think you misunderstood me.
                I can modify the texts of the menu items but not of those called "Options" and "Exit" which are always on the bottom, this is what I tried to illustrate "here":http://qt-project.org/forums/viewreply/83489/ .

                The string "Options" and "Exit" aren't even in the source code.

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  Screenshots might depict the situation more clearly.

                  !http://s80.img-up.net/Screenshotjmcv.png(you need to see this screenshot!)!

                  And how to change this "Actions" ?!?!

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    gmaro
                    wrote on last edited by
                    #9

                    I'm sorry for not getting that this is mobile app.

                    Have you tried setting the locale for your main app window?

                    Something like:
                    @
                    mainWindow.setLocale( QLocale(QLocale::German, QLocale::Germany) );
                    @

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #10

                      I already have this in the designer.

                      mainwindow.ui:
                      !http://i91.img-up.net/Screenshot8l3k.png(locale: German, Germany)!

                      The MainWindow as well as the QMenuBar has this in their local property each.

                      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