Mainwindow deactivate



  • Hello..
    Am creating a login window, on entering the username and password I display some parameters on the right of the screen. THe main screen is still visible and active. I need to make the mainwindow inactive when the parameters are displayed. Could somebody help me with this.

    Thanks you very much.



  • Can you post some code how you do this?
    for clarity.



  • You seem to be looking for a "modal dialog":http://qt-project.org/doc/qt-4.8/QDialog.html.



  • NO am looking for this in pure qml. I found something similar but there is no proper solution for the same.



  • @Rectangle {
    id:mainwindow
    width: 400
    height:400

    Rectangle {
        id: rectangle1
        x: 29
        y: 28
        width: 62
        height: 58
        color: "green"
    
        MouseArea{
    
        anchors.fill: parent
        onClicked:text_edit1.text=rectangle1.color}
    }
    
    Rectangle {
        id: rectangle2
        x: 29
        y: 107
        width: 62
        height: 58
        color: "blue"
        MouseArea{
    
        anchors.fill: parent
        onClicked:text_edit1.text=rectangle2.color}
    
    }
    
    Rectangle {
        id: rectangle3
        x: 29
        y: 194
        width: 62
        height: 58
        color: "black"
    
        MouseArea{
    
        anchors.fill: parent
        onClicked:text_edit1.text=rectangle3.color}
    }
    
    TextEdit {
        id: text_edit1
        x: 264
        y: 115
        width: 80
        height: 20
        text: ""
        font.pixelSize: 12
    }
    

    }
    @

    This is just an example, when i click on first rectangle the value in the textedit field changes, NOW i want the mainwindow to be inactive and no mouseevent should be triggered unless i close the textedit.

    PS assume there is a close button to close edit field.


Log in to reply
 

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