Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [solved]how to use "buttonClicked" in Qt Quick Symbian Component, CommonDialog
Forum Updated to NodeBB v4.3 + New Features

[solved]how to use "buttonClicked" in Qt Quick Symbian Component, CommonDialog

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 2.5k Views 1 Watching
  • 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.
  • O Offline
    O Offline
    owenzhao
    wrote on 11 Feb 2012, 10:24 last edited by
    #1

    In Qt Quick Symbian Component, QML CommonDialog Element, it says
    Signal Handler Documentation

    CommonDialog::buttonClicked ( int index )

    This signal is emitted when one of the buttons is clicked. The index parameter holds the index of the clicked button. The index is the same as the index of the button text in the buttonTexts property.
    "doc.qt.nokia.com/qtquick-components-symbian-1.1/qml-commondialog.html":http://doc.qt.nokia.com/qtquick-components-symbian-1.1/qml-commondialog.html

    However, I do not know how to use it. In my code

    @CommonDialog {
    id: interruptDialog
    buttonTexts:["Interrupt"]
    titleText: "Notice"
    titleIcon: "alarm.svg"
    content: Column {
    anchors.horizontalCenter: parent.horizontalCenter
    spacing: 4
    Text {
    id: textInterruptDialog
    anchors.horizontalCenter: parent.horizontalCenter
    color: "deepskyblue"
    }
    Text {
    anchors.horizontalCenter: parent.horizontalCenter
    color: "deepskyblue"
    font.family: platformStyle.fontFamilyRegular
    font.pointSize: 14
    text: alarmClockTimer.countDownClockString
    }
    }
    buttonClicked: { interruptDialogButtonClicked() } //doesn't work
    buttonClicked(0): { interruptDialogButtonClicked() } //doesn't work too
    }@

    Anyone can help?

    Thank you.

    1 Reply Last reply
    0
    • O Offline
      O Offline
      owenzhao
      wrote on 11 Feb 2012, 12:22 last edited by
      #2

      I sovle this myselft. It shoulb be
      @onButtonClick: { interruptDialogButtonClicked() }@

      I think I should file a bug on this?

      1 Reply Last reply
      0
      • O Offline
        O Offline
        owenzhao
        wrote on 21 Apr 2012, 03:26 last edited by
        #3

        I know more about this, hope someone will benefit from this.
        @CommonDialog {
        id: pomotimeSettingCommonDialog
        buttonTexts : [qsTr("OK"), qsTr("Cancel")]
        titleIcon : "time.svg"
        titleText : qsTr("test dialog")
        content: Column {
        Text {
        color:"white"
        text: "This is a test dialog"
        }
        }
        onButtonClicked: {
        //CommonDialog::buttonClicked ( int index ) means index is a viariable you can use
        if(!index) { //OK button is for index = 0, so !index means true
        console.log("you press the OK button")
        }
        else {
        console.log("you press the Cancel button")
        }
        }
        }@

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Traxx
          wrote on 2 Dec 2013, 13:52 last edited by
          #4

          Great job.I definitely benefited from your last post code exam ple

          1 Reply Last reply
          0
          • O Offline
            O Offline
            owenzhao
            wrote on 2 Dec 2013, 14:03 last edited by
            #5

            Glad it helps you. lol

            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