×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    93

    MeeGo Dialog problem

    Hi!

    I use MeeGo QtQuick Dialog in my app. Dialog is closed when I click outside of buttons area. How I can do that dialog has closed only after clicking on one of dialog buttons and clicking on outside of buttons area is ignored?

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: MeeGo Dialog problem

    Hi,
    I took a brief look at the dialog qml source code http://qt.gitorious.org/qt-component...ego/Dialog.qml
    and I've seen that when an user click on the dialog, privateClicked signal is emitted and reject() function is called.
    That reject function actually closes the dialog. To prevent that take a look at the code below.

    Dialog {
    id: myDialog
    title: Rectangle {
    id: titleField
    height: 2
    width: parent.width
    color: "red"
    }

    content:
    Rectangle {
    //x: 0
    //y: 0
    width: screen.displayWidth
    height: screen.displayHeight

    color: "yellow"

    Text {
    id: text
    font.pixelSize: 22
    anchors.centerIn: parent
    color: "white"
    text: "Hello Dialog"
    }
    }

    onRejected: { console.log("SENT REJECTED"); }

    function reject() {
    console.log("REJ BLOCKED")
    }

    function rejectButtonPressed() {
    close();
    rejected();
    }

    onPrivateClicked: console.log("PRIVATE CLICK")

    buttons: ButtonRow {
    style: ButtonStyle { }
    anchors.horizontalCenter: parent.horizontalCenter
    Button {text: "OK";
    onClicked: myDialog.accept()}
    Button {text: "REJ";
    onClicked: myDialog.rejectButtonPressed()}
    }
    }

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    93

    Re: MeeGo Dialog problem

    Thank you very much! I also overwrite method reject and it's ok.

Similar Threads

  1. Orientation problem in MeeGo Device
    By narendar_discover in forum Nokia N9
    Replies: 15
    Last Post: 2011-12-21, 12:42
  2. Problem registrating at the MeeGo site
    By Klen in forum Nokia N9
    Replies: 6
    Last Post: 2011-11-15, 17:36
  3. QtComponents with MeeGo Harmattan problem - InfoBanner
    By molbal in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2011-08-02, 19:41
  4. Replies: 2
    Last Post: 2010-10-22, 23:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×