Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Transulcent widget ignore click
Qt 6.11 is out! See what's new in the release blog

Transulcent widget ignore click

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.3k 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.
  • R Offline
    R Offline
    rfringuello89
    wrote on last edited by
    #1

    Hi, using QT 4.8 I have 2 windows (2 different QT applications). They are overlapped and the application on top is a QWidget with the attribute @Qt::WA_TranslucentBackground @
    I want to make the background of this widget (NOT the children like QPushButtons) transparent to click because I need to interact with the other window which is behind this.

    Any suggestion?

    Thanks guys ;)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ankursaxena
      wrote on last edited by
      #2

      set widget background color using rgba code (255,255,255,0);
      where a should be 0 if u want that there should be clicked behind the widget.

      otherwise a put 1 to 10 any value.
      a represents here opacity

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rfringuello89
        wrote on last edited by
        #3

        I solved the problem splitting my main widget in several widgets.. in this way I don't need the widget to be transparent in the middle.
        Anyway if I try the following in the widget's constructor:

        @this->setStyleSheet("QWidget{background:rgba(0,0,0,0);}");@

        I only obtain a full black widget and not a transparent widget

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ankursaxena
          wrote on last edited by
          #4

          I think following properties should be set for making a widget transparent:

          setWindowFlags (Qt::FramelessWindowHint);
          this->setAttribute(Qt::WA_TranslucentBackground, true);

          and one more thing:

          • It works on windows platform. I m not sure about other platform that it will work or not.
          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