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



  • 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



  • try to double click?



  • 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.



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



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



  • 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>
    @



  • 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.



  • 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" ?!?!



  • 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) );
    @



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.