make a transparent Rectangle



  • Hello everyone,

    I create a window with 2 Rectangles. In the second, this is my application main, but for the fist Rectangle I need to acces behind the window. In fact I have a program which run my window with 2 rectangles and I need to acces to the first app in through my first Rectangle. Is it possible ?

    this my code :

    Column{

    Rectangle{
    	width: 500
    	height: 250
    	color: "transparent"
    	//must be transparent 
    }
    
    App{
    	width: 500
    	height: 250
    
    }
    

    }

    thanks for your help



  • there is a nice option you can use, visible: true/false, I hope it is helpful


  • Qt Champions 2017

    Can you help with more details on your requirement ? Your question and description confused me. If possible give us your complete qml and tell us what you would like to achieve.



  • thanks for your answer, unfortunately it does not work.

    Rectangle{
    width: 500
    height: 250
    color: "transparent"
    visible: false
    }

    App{
    width: 500
    height: 250

    }

    the first Rectangle does not exist anymore in my display and the second rectangle which is the App take all the place of my window



  • Ok, I use a first program in qml which call another program (with the 2 rectangles). The problem is that to shutdown the second program I have to click just on a button which is in the first program. So in the second application I have to make a kind of hole to acces at the firt program. The hole is the first Rectangle.

    I hope it is more clear


  • Qt Champions 2017

    When you say first program & second program, Are you running two different applications as two different processes ? Is this the case ?

    OR

    You have two qml files. First.qml & Second.qml. When you click on the first.qml object you are launching the Second.qml object.

    Which is your scenario ?



  • @cosmoff the idea is to make it visible or not according to your need (onClicked: rectangleID.visible=true)



  • @dheerendra said in make a transparent Rectangle:

    running two different applications as two different processes

    yes I am running two different applications as two different processes


  • Qt Champions 2017

    How are you launching the second program first program ? Are you using QProcess to launch the second program ?



  • Yes I use a QProcess



  • @cosmoff said in make a transparent Rectangle:

    I have to make a kind of hole to acces at the firt program. The hole is the first Rectangle.

    I think you can't create a hole for two separate GUI applications. Also, you can't create a hole making a rectangle transparent.
    You can use QProcess to close the second application.
    Are you programming also the first program?
    If you are programming the second program, Why do you need the first program to close the second program?

    Really complicated.


  • Qt Champions 2017

    In addition to what @CKurdu said, you can't do much from one process to another process. At the most you can monitor the second program from first program using the QProcess finished() signal and do something in the first program. Not very clear about your objective as well.


Log in to reply
 

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