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. How to call Dialog with openfunction properly?
Forum Updated to NodeBB v4.3 + New Features

How to call Dialog with openfunction properly?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 117 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
    OpenCoder
    wrote on last edited by
    #1

    I am trying to call a dialog with open function, but I've got an error message: "Property 'open' of object C2opedi_TestComponent_QMLTYPE_48(0x141907af3f0) is not a function".
    Do you have any idea how to solve it? Thanks.

    import QtQuick 2.12
    import QtQuick.Controls 2.12
    import QtQuick.Dialogs 1.2
    import QtQuick.Layouts 1.12
    import "qrc:/qml/public"
    import "../public"
    
    Item
    {
        id: root
        implicitWidth: 300
        implicitHeight: 100
        SystemPalette { id: palette }
        clip: true
    
        property string confirmationDialogMessage: "Do you confirm?"
        property string buttonGroupTextYes: "Yes"
        property string buttonGroupTextNo: "No"
    
    
    
        Rectangle
        {
            id: bottomBar
            anchors
            {
                left: parent.left
                right: parent.right
                bottom: parent.bottom
            }
            height: confirmationDialogButton.height * 1.2
            color: Qt.darker(palette.window, 1.1)
            border.color: Qt.darker(palette.window, 1.3)
            Row
            {
                id: confirmationDialogButton
                spacing: 6
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 12
                width: parent.width
                Button
                {
                    text: "Confirmation dialog"
                    anchors.verticalCenter: parent.verticalCenter
                    onClicked: confirmationDialog.open()
                }
            }
        }
        C2opedi_TestComponent
        {
            id: confirmationDialog
            confirmationMessage: confirmationDialogMessage
            buttonTextYes: buttonGroupTextYes
            buttonTextNo: buttonGroupTextNo
    
        }
    
    }
    
    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