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. make a transparent Rectangle
QtWS25 Last Chance

make a transparent Rectangle

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
12 Posts 4 Posters 2.1k Views
  • 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.
  • C Offline
    C Offline
    cosmoff
    wrote on 4 Dec 2018, 13:40 last edited by
    #1

    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

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MAthias_Va
      wrote on 4 Dec 2018, 14:03 last edited by
      #2

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

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dheerendra
        Qt Champions 2022
        wrote on 4 Dec 2018, 14:44 last edited by
        #3

        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.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cosmoff
          wrote on 4 Dec 2018, 14:46 last edited by
          #4

          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

          M 1 Reply Last reply 4 Dec 2018, 15:07
          0
          • C Offline
            C Offline
            cosmoff
            wrote on 4 Dec 2018, 14:56 last edited by cosmoff 12 Apr 2018, 14:58
            #5

            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

            C 1 Reply Last reply 4 Dec 2018, 16:12
            0
            • D Offline
              D Offline
              dheerendra
              Qt Champions 2022
              wrote on 4 Dec 2018, 15:03 last edited by
              #6

              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 ?

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              1 Reply Last reply
              0
              • C cosmoff
                4 Dec 2018, 14:46

                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

                M Offline
                M Offline
                MAthias_Va
                wrote on 4 Dec 2018, 15:07 last edited by
                #7

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

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  cosmoff
                  wrote on 4 Dec 2018, 15:42 last edited by
                  #8

                  @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

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    dheerendra
                    Qt Champions 2022
                    wrote on 4 Dec 2018, 16:05 last edited by
                    #9

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

                    Dheerendra
                    @Community Service
                    Certified Qt Specialist
                    http://www.pthinks.com

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      cosmoff
                      wrote on 4 Dec 2018, 16:05 last edited by
                      #10

                      Yes I use a QProcess

                      1 Reply Last reply
                      0
                      • C cosmoff
                        4 Dec 2018, 14:56

                        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

                        C Offline
                        C Offline
                        CKurdu
                        wrote on 4 Dec 2018, 16:12 last edited by CKurdu 12 Apr 2018, 16:12
                        #11

                        @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.

                        You reap what you sow it

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          dheerendra
                          Qt Champions 2022
                          wrote on 4 Dec 2018, 16:26 last edited by
                          #12

                          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.

                          Dheerendra
                          @Community Service
                          Certified Qt Specialist
                          http://www.pthinks.com

                          1 Reply Last reply
                          0

                          8/12

                          4 Dec 2018, 15:42

                          • Login

                          • Login or register to search.
                          8 out of 12
                          • First post
                            8/12
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved