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. [Solved] How Can I make the QToolBox panel transparent?
Forum Updated to NodeBB v4.3 + New Features

[Solved] How Can I make the QToolBox panel transparent?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 5.6k 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.
  • Y Offline
    Y Offline
    yaoyulian
    wrote on 29 Oct 2010, 15:57 last edited by
    #1

    Is there a Sub-Controls like QToolBox::tab make the Qwidget in QToolBox transparent?
    I tryed:

    1. QWidget#page{background:rgb(12,34,56);}
      this work, but
      2)QWidget#page_2{background:transparent;}
      this one not work.
      I guess there maybe a Sub-Controls like QToolBox::tab.
      is it?
      How Can I reach my purpose?
    1 Reply Last reply
    0
    • T Offline
      T Offline
      tony
      wrote on 2 Nov 2010, 13:37 last edited by
      #2

      Hi,

      did you try "background: rgba(12,34,56,0);" ??

      T.

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yaoyulian
        wrote on 3 Nov 2010, 00:45 last edited by
        #3

        Thanks for Antonio Di Monaco's reply.
        "background: rgba(12,34,56,0)" can't work too.
        From the source code, I found out that QToolBox is made up by :
        @ QToolBoxButton *button;
        QScrollArea *sv;
        QWidget *widget;@
        I tryed :
        @QScrollArea{
        background-color:transparent;
        }
        QWidget#page_2{background:transparent;}@
        in toolbox's "change stylesheet" menu.
        this can change the toolbox transparent.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          ChanchoCiego
          wrote on 5 Apr 2013, 19:36 last edited by
          #4

          Hello,

          @QToolBox QWidget
          {
          background-color: background: rgba(12,34,56,0);
          }@

          but also makes transparent the sub-controls of the QWidget from QToolBox

          sorry for my bad (bing-translator) english

          greetings

          1 Reply Last reply
          0
          • R Offline
            R Offline
            raven-worx
            Moderators
            wrote on 9 Apr 2013, 10:36 last edited by
            #5

            try setting the following on the Toolbox window:
            @
            setAttribute(Qt::WA_TranslucentBackground);
            setWindowFlags(Qt::FramelessWindowHint);
            @
            (beside your stylesheet declaration)

            or another possibility: "QGraphicsOpacityEffect":http://qt-project.org/doc/qt-4.8/qgraphicsopacityeffect.html
            But this also applies for the child widgets.

            btw: This is no valid stylesheet declaration AFAIK.
            [quote author="ChanchoCiego" date="1365190604"]Hello,
            @QToolBox QWidget
            {
            background-color: background: rgba(12,34,56,0);
            }@
            [/quote]

            Also a nice trick i used to do was setting the background color not to fully transparent but to something like this: rgba(0,0,0,1)
            This almost has the same effect like transparency but it's not. Thus it's also treaded differently by the windowing system and may help you.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            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