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. QTabWidget background not transparent
Forum Updated to NodeBB v4.3 + New Features

QTabWidget background not transparent

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 6.1k Views 2 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.
  • S Offline
    S Offline
    sharethl
    wrote on last edited by sharethl
    #1

    Does anyone know why qTab is not transparent?
    I have a control on the back, but still covered by QTab. Right side is a button stackedWidget(didn't set stylesheet for StackedWidget) .

    ui->tabWidget->setAttribute(Qt::WA_TranslucentBackground);
    ui->tabWidget->setStyleSheet("background-color: transparent");
    ui->tab->setAttribute(Qt::WA_TranslucentBackground);
    ui->tab->setStyleSheet("background-color: transparent");
    ui->tab_2->setAttribute(Qt::WA_TranslucentBackground);
    ui->tab_2->setStyleSheet("background-color: transparent");
    

    alt text

    Thanks

    1 Reply Last reply
    0
    • T3STYT Offline
      T3STYT Offline
      T3STY
      wrote on last edited by
      #2

      Try using:

      QWidget::setAttribute(Qt::WA_TranslucentBackground);
      
      S 1 Reply Last reply
      0
      • T3STYT T3STY

        Try using:

        QWidget::setAttribute(Qt::WA_TranslucentBackground);
        
        S Offline
        S Offline
        sharethl
        wrote on last edited by
        #3

        @T3STY
        Still looks the same.

        ui->tabWidget->setAttribute(Qt::WA_TranslucentBackground);
        ui->tabWidget->setStyleSheet("QTabWidget{ background-color: transparent}");

        1 Reply Last reply
        0
        • T3STYT Offline
          T3STYT Offline
          T3STY
          wrote on last edited by T3STY
          #4

          the ui->tabWidget widget is the main tabs container, right? It might be that you need to set translucent background and transparent background color on all the child widgets of it. Or viceversa.

          S 1 Reply Last reply
          0
          • T3STYT T3STY

            the ui->tabWidget widget is the main tabs container, right? It might be that you need to set translucent background and transparent background color on all the child widgets of it. Or viceversa.

            S Offline
            S Offline
            sharethl
            wrote on last edited by
            #5

            @T3STY

            I have updated the question, with latest image, seems set all child tabs doesn't work either.

            1 Reply Last reply
            0
            • T3STYT Offline
              T3STYT Offline
              T3STY
              wrote on last edited by
              #6

              While looking for similar problems on google I found this:
              http://www.qtforum.org/post/96233/qtabwidget-background-color-problem.html#post96233

              I can see from your screenshot that you're not on Windows, but maybe the trick still does the job. Other than that, I found other issues with background transparency related to Qt 4, but nothing else.

              S 1 Reply Last reply
              0
              • T3STYT T3STY

                While looking for similar problems on google I found this:
                http://www.qtforum.org/post/96233/qtabwidget-background-color-problem.html#post96233

                I can see from your screenshot that you're not on Windows, but maybe the trick still does the job. Other than that, I found other issues with background transparency related to Qt 4, but nothing else.

                S Offline
                S Offline
                sharethl
                wrote on last edited by
                #7

                @T3STY

                Yes, T3STY, If I deploy it to embedded linux, it could show transparent background.

                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