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. Dialog window close when opening another dialog inside
Forum Updated to NodeBB v4.3 + New Features

Dialog window close when opening another dialog inside

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 415 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.
  • B Offline
    B Offline
    Babs
    wrote on last edited by
    #1

    Hello,
    I'm working on a QML application. My problem is that when i open another dialog in a dialog window, my window close automatically. I'm using qml Dialog component.
    Can anyone help?

    J.HilkJ 1 Reply Last reply
    0
    • B Babs

      Hello,
      I'm working on a QML application. My problem is that when i open another dialog in a dialog window, my window close automatically. I'm using qml Dialog component.
      Can anyone help?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      Hi @Babs

      do you have a minimal reproducible example at hand ?


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      B 1 Reply Last reply
      0
      • J.HilkJ J.Hilk

        Hi @Babs

        do you have a minimal reproducible example at hand ?

        B Offline
        B Offline
        Babs
        wrote on last edited by
        #3

        @J-Hilk here is my code i create a first dialog to a toolBar button.

                        Loader{
                            id:dlgLoader
                            sourceComponent: diaComp
                            active: false
                        }
                        Component{
                            id:diaComp
                            Dialog{
                                id:dialogplan
                                width: paneldev.implicitWidth
                                height: paneldev.implicitHeight
        
                                title:"Planning"
                                standardButtons: Dialog.Ok | Dialog.Cancel
        
                                onAccepted:{
                                    plan.addToDatabase();
                                    dialogplan.close()
                                }
                                onRejected: {
                                }
                                PanelContainer{
                                    id:paneldev
                                    anchors.fill: parent
                                    resizable: false
                                    detachable: false
                                    collapsable: false
                                    size: Style.realPixels(640)
        
                                    TabView{
                                        id:tabView
                                        anchors.fill: parent
                                        anchors.margins: 2
                                        tabPosition: Qt.TopEdge
        
                                        Layout.minimumWidth: 360
                                        Layout.minimumHeight: 360
                                        Layout.preferredWidth: 480
                                        Layout.preferredHeight: 640
        
        
                                        Tab{
                                            title: "Parameters setting"
        
                                            PagePlannification{
        
                                            }
                                        }
        
                                        Tab{
                                            title: "Equipement"
                                        }
        
                                        Tab{
                                            title: "Planning"
                                            Planning{
        
                                            }
        
                                        }
        
                                        style: TabViewStyle {
                                            frameOverlap: 1
                                            tab: Rectangle {
                                                color: styleData.selected ? "gray" :"white"
                                                border.color:  "black"
                                                implicitWidth: Math.max(text.width + 4, 80)
                                                implicitHeight: 20
                                                radius: 2
                                                Text {
                                                    id: text
                                                    anchors.centerIn: parent
                                                    text: styleData.title
                                                    color: styleData.selected ? "white" : "black"
                                                }
                                            }
                                            frame: Rectangle { color: "white" }
                                        }
                                    }
                                }
                            }
                        }
        

        And inside that dialog i create the following one. The problem is when i open it, my first dialog window close automatically.

                        Dialog{
                            id:dialogPaliers
                            width: 640
                            height: 480
        
                            title:qsTr("Sélectionner les paliers")
        
                            standardButtons: Dialog.Ok | Dialog.Cancel
                            onAccepted: dialogPaliers.close()
                            PanelContainer{
                                anchors.fill: parent
                                id:paneldev
                                size: Style.realPixels(300)
                                resizable: false
                                detachable: false
                                collapsable: false
        
                                Rectangle{
                                    anchors.fill: parent
                                    color: "#ffffff"
        
                                    ScrollView{
                                        anchors.fill:parent
                                        StretchColumnContainer{
                                            id:container
                                            spacing: 20
                                            anchors.top: parent.top
                                            anchors.topMargin: spacing
                                            Repeater{
                                                id:rep
                                                model:spinNumSteps.value
                                                StretchRowContainer{
                                                    spacing: 200
                                                    TextLabel {
        
                                                        text: qsTr("Saisr la valeur du  palier " + (index+1))
                                                    }
                                                    SpinBox{
                                                        id:spinPal
                                                        minimumValue: 0
                                                        maximumValue: 10000
                                                        decimals: 2
                                                        onEditingFinished:  {
                                                            plan.addValue(spinPal.value,index)
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
        
        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