[Interest] MenuBar QML not usable on Yosemite OSX

mark diener rpzrpzrpz at gmail.com
Wed Apr 15 21:35:07 CEST 2015


Mr Li And Rest:

You are correct about the qsTr("Exit") . It now works.  Thank you for that
information.

What is someone interesting is the display of the application name next to
the Apple Icon in the menu bar.

I am not able to change the default application menu name from a lowercase
and no spaces to properly capitalized
application name.


Tried thinks like:

macx {

    QMAKE_INFO_PLIST = Info.plist

}


TARGET = RpzTestModel


But the OSX menu bar still has the lowercase with no space
version of the executable.

Anybody solve this problem already?

Thanks,

md

On Wed, Apr 15, 2015 at 12:11 AM, Daiwei Li <daiweili at gmail.com> wrote:

> I believe Qt special cases "Exit" as it already exists in the menubar. If
> you change the text of your menu item to anything else, it should work.
>
> On Tue, Apr 14, 2015 at 5:44 PM, rpzrpzrpz at gmail.com <rpzrpzrpz at gmail.com>
> wrote:
>
>> Mr Li:
>>
>> That was tried as well and did not work.
>>
>> A copy of your suggestion is below and it does not work on:
>>
>> Yosemite OSX 10.10.2
>> Xcode 6.1.1
>> Qt 5.4.1
>> Qt Creator 3.3.2
>>
>> Anyone else with some ideas?
>>
>> Thanks
>>
>> #################
>>
>> import QtQuick 2.4
>>
>> import QtQuick.Window 2.2
>>
>> import QtQuick.Controls 1.3
>>
>>
>>
>> ApplicationWindow {
>>
>>
>>      id: mainwindow
>>
>>
>>      visible: true
>>
>>
>>      width: Screen.width
>>
>>      height: Screen.height
>>
>>      color: "black"
>>
>>      title: "Mockup"
>>
>>
>>      menuBar: MenuBar
>>
>>      {
>>
>>          id: mainmenu
>>
>>          Menu
>>
>>          {
>>
>>              title: qsTr("Mockup")
>>
>>              MenuItem
>>
>>              {
>>
>>                  text: qsTr("Exit")
>>
>>                  onTriggered: Qt.quit() ;
>>
>>              }
>>
>>          }
>>
>>      }
>> }
>>
>>
>> On 4/14/2015 12:25 PM, Daiwei Li wrote:
>> > You have to use an ApplicationWindow as your top-level item and assign
>> > your MenuBar to the menuBar property of it:
>> >
>> http://doc.qt.io/qt-5/qml-qtquick-controls-applicationwindow.html#menuBar-prop
>> >
>> > On Tue, Apr 14, 2015 at 10:05 AM, mark diener <rpzrpzrpz at gmail.com
>> > <mailto:rpzrpzrpz at gmail.com>> wrote:
>> >
>> >     Hello:
>> >
>> >     Tried using a MenuBar QML component with a Window component on OSX
>> >     yosemite, but
>> >     the Menubar does not appear at all.
>> >
>> >     Anybody have a tip on menubar visibility or usage on OSX?   (Any
>> >     gotchas in windows?)
>> >
>> >     Thanks all,
>> >
>> >     md
>> >
>> >
>> >     import  QtQuick  2.4
>> >
>> >     import  QtQuick.Window  2.2
>> >
>> >     import  QtQuick.Controls  1.3
>> >
>> >
>> >     import  "main.js"  as  Gjs
>> >
>> >
>> >     Window  {
>> >
>> >
>> >          id:  mainwindow
>> >
>> >
>> >          visible:  true
>> >
>> >
>> >          width:  Screen.width
>> >
>> >          height:  Screen.height
>> >
>> >          color:  "black"
>> >
>> >          title:  "Mockup"
>> >
>> >
>> >          MenuBar
>> >
>> >          {
>> >
>> >              id:  mainmenu
>> >
>> >              Menu
>> >
>> >              {
>> >
>> >                  title:  qsTr("RpzMockup")
>> >
>> >                  MenuItem
>> >
>> >                  {
>> >
>> >                      text:  qsTr("Exit")
>> >
>> >                      onTriggered:  Qt.quit()  ;
>> >
>> >                  }
>> >
>> >              }
>> >
>> >          }
>> >
>> >     }
>> >
>> >
>> >
>> >     _______________________________________________
>> >     Interest mailing list
>> >     Interest at qt-project.org <mailto:Interest at qt-project.org>
>> >     http://lists.qt-project.org/mailman/listinfo/interest
>> >
>> >
>>
>>
>> --
>> No spell checkers were harmed during the creation of this message.
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150415/fbff874f/attachment.html>


More information about the Interest mailing list