A problem with a ToolButton in Qt Quick Symbian Component, QML CommonDialog Element, it doesn't respond on first click but on second click!



  • Hi every one,
    in the code shown bellow, i really can't see what's wrong with it, it's simply checks the password and shows hint messages when the password is incorrect when the button is clicked, the problem that it doesn't do any thing when the button is clicked for the first time but works fine when it's clicked for the second time!!
    @CommonDialog {
    id: root
    privateCloseIcon: true // show close button in the right corner of dialogs title
    titleText: qsTr( "Confirm password to continue" )

    property bool showClearPassword:     false
    property string msgPasswordIncorrect: qsTr( "Password incorrect!" )
    property bool exFlag: false
    titleIcon: ""
    
    function launch(exitFlag) {
        paswd.text=""
        exFlag=exitFlag
        hintArea.forceClose()
        open()
      }
    //to use only one button with own onClicked handler
    buttons: Item {
        id: buttonContainer
    
        LayoutMirroring.enabled: false
        LayoutMirroring.childrenInherit: true
    
        width: parent.width
        height: privateStyle.toolBarHeightLandscape + platformStyle.paddingSmall * 2
    
        Row {
            id: buttonRow
            objectName: "buttonRow"
            anchors.centerIn: parent
            spacing: platformStyle.paddingMedium
    
            ToolButton {
                id: btOk
                text: qsTr( "Ok" )
                onClicked: {
                    // check  password
                    hintArea.forceClose()
                    if( paswd.text!== settingsFile.password ){
                        hintArea.show( msgPasswordIncorrect )
                        console.log("dialog entery1")
                    }else {
                        if(exFlag){
                            pageStack.push(Qt.resolvedUrl("Settings.qml"))
                            accept();
                            console.log("dialog entery2")
                        }else{
                            Qt.quit()
                        }
                    }
                }
            }
        }
    

    }@

    Please Note that this issue doesn't show on simulator but when i deploy and test on the device, I'm testing this using Nokia700 device.


Log in to reply
 

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