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. MessageDialog not working on Android Qt6.4.0

MessageDialog not working on Android Qt6.4.0

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 2 Posters 601 Views
  • 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.
  • T Offline
    T Offline
    track
    wrote on last edited by
    #1

    Good Greetings.

    I upgraded from Qt6.3 to Qt 6.4 and MessageDialog stopped working properly. When I click the Ok button after deploying to android device, it does not dismiss the the Message dialog. On desktop it works fine.

    The Code is :

    "import QtQuick
    import QtQuick.Controls

    import QtQuick.Dialogs

    ApplicationWindow{

    width: 600
    height: 200
    visible: true
    id:root
    color:"green"
    
    Button {
        id: fileButton
        text: "File"
        onClicked: menu.open()
    

    Menu {
    id: menu

    Action { text: qsTr("Tool Bar");
    

    onTriggered:{console.log("triggered")
    root.color="yellow"

    }

    }
    Action { text: qsTr("Side Bar");   }
    Action { text: qsTr("Status Bar");   }
    Action { text: qsTr("Tool Bar");  }
    Action { text: qsTr("Side Bar");   }
    Action { text: qsTr("Status Bar");   }
    
    MenuSeparator {
        contentItem: Rectangle {
            implicitWidth: 200
            implicitHeight: 1
            color: "#21be2b"
        }
    }
    
    Menu {
        title: qsTr("Advanced")
        // ...
    }
    
    topPadding: 2
    bottomPadding: 2
    
    delegate: MenuItem {
        id: menuItem
        implicitWidth: 200
        implicitHeight: 40
    
        arrow: Canvas {
            x: parent.width - width
            implicitWidth: 40
            implicitHeight: 40
            visible: menuItem.subMenu
            onPaint: {
                var ctx = getContext("2d")
                ctx.fillStyle = menuItem.highlighted ? "#ffffff" : "#21be2b"
                ctx.moveTo(15, 15)
                ctx.lineTo(width - 15, height / 2)
                ctx.lineTo(15, height - 15)
                ctx.closePath()
                ctx.fill()
            }
        }
    
        indicator: Item {
            implicitWidth: 40
            implicitHeight: 40
            Rectangle {
                width: 26
                height: 26
                anchors.centerIn: parent
                visible: menuItem.checkable
                border.color: "#21be2b"
                radius: 3
                Rectangle {
                    width: 14
                    height: 14
                    anchors.centerIn: parent
                    visible: menuItem.checked
                    color: "#21be2b"
                    radius: 2
                }
            }
        }
    
        contentItem: Text {
            leftPadding: menuItem.indicator.width
            rightPadding: menuItem.arrow.width
            text: menuItem.text
            font: menuItem.font
            opacity: enabled ? 1.0 : 0.3
            color: menuItem.highlighted ? "#ffffff" : "#21be2b"
            horizontalAlignment: Text.AlignLeft
            verticalAlignment: Text.AlignVCenter
            elide: Text.ElideRight
        }
    
        background: Rectangle {
            implicitWidth: 200
            implicitHeight: 40
            opacity: enabled ? 1 : 0.3
            color: menuItem.highlighted ? "#21be2b" : "transparent"
        }
    }
    
    background: Rectangle {
        implicitWidth: 200
        implicitHeight: 40
        color: "#ffffff"
        border.color: "#21be2b"
        radius: 2
    }
    

    }

    }

    MessageDialog {
    
        id:messB
        buttons: MessageDialog.Ok
        text: "The document has been modified."
    }
    
    
    Component.onCompleted: {
    
        messB.open()
    }
    

    }
    "

    May you please assist in getting the Dialog box to be dissmised.

    1 Reply Last reply
    1
    • T Offline
      T Offline
      track
      wrote on last edited by
      #2

      When I add " import Qt.labs.platform " and remove the Button it works fine on android but
      when the button is not removed i get this error "W libuntitled30_arm64-v8a.so: QQmlApplicationEngine failed to load component
      W libuntitled30_arm64-v8a.so: qrc:/untitled30/main.qml:116:5: Cannot assign to non-existent property "background"
      W libuntitled30_arm64-v8a.so: exit app 0"

      When i add 'QT += widgets' in .pro file (with the Button not removed) the error does not appear, but the Messagedialog does not respond to dismiss the dialog.

      It seem like Qt.labs.platform does not work with other import statements

      1 Reply Last reply
      0
      • T Offline
        T Offline
        track
        wrote on last edited by
        #3

        I finally did a custom MessageDialog

        Atr0p0sA 1 Reply Last reply
        1
        • T track

          I finally did a custom MessageDialog

          Atr0p0sA Offline
          Atr0p0sA Offline
          Atr0p0s
          wrote on last edited by
          #4

          @track Faced the same situation. Did you write your MessageDialog from scratch?

          T 1 Reply Last reply
          0
          • Atr0p0sA Atr0p0s

            @track Faced the same situation. Did you write your MessageDialog from scratch?

            T Offline
            T Offline
            track
            wrote on last edited by
            #5

            Yes.I created two qml components one that exits after displaying message and the other does not exit.

            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