Discussion:
QML Menu
(too old to reply)
Igor Mironchik
2018-02-28 09:42:13 UTC
Permalink
Hello,

    Menu {
        id: menu
        x: menuButton.x - width + menuButton.width - 2
        y: toolBar.y + toolBar.height

        MenuItem {
            text: qsTr( "Change Password" )
            implicitHeight: minimumCtrlHeight
            onTriggered: {
                qmlCppSignals.disconnectRequest()
            }
        }
    }

On Android the result is a shorten text of menu item whereas there is
enough space to show full text. How can I fix it?

Menu

Thanks.
Jérôme Godbout
2018-02-28 14:33:50 UTC
Permalink
you probbaly can bind the width with the menu width. You could do so with

Component.onCompleted:

{
// Fix android bad layout
if(Qt.application.platform == 'Android')
width = Qt.binding(function(){ return menu.width; });
}

You could wrap this into MenuItem.qml that is import after the QtQuick MenuItem this fix would now be transparent and when Qt fix it you just need to remove the import 😉

________________________________
From: Interest <interest-bounces+godboutj=***@qt-project.org> on behalf of Igor Mironchik <***@gmail.com>
Sent: Wednesday, February 28, 2018 4:42 AM
To: Qt Project
Subject: [Interest] QML Menu


Hello,

Menu {
id: menu
x: menuButton.x - width + menuButton.width - 2
y: toolBar.y + toolBar.height

MenuItem {
text: qsTr( "Change Password" )
implicitHeight: minimumCtrlHeight
onTriggered: {
qmlCppSignals.disconnectRequest()
}
}
}

On Android the result is a shorten text of menu item whereas there is enough space to show full text. How can I fix it?

[Menu]

Thanks.

Loading...