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

Transparent background

Scheduled Pinned Locked Moved General and Desktop
7 Posts 5 Posters 45.1k 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.
  • M Offline
    M Offline
    Massinissa
    wrote on last edited by
    #1

    Hi
    Is there possible to set QTabWidget background transparent (same as the form background)?
    I tried this in the main.cpp but nothing has changed, I got a white background:
    @
    QPalette q= form.widget.tab->palette();
    form.widget.tab->setPalette(q);
    form.widget.tab->setStyleSheet("background-color: rgba( 255, 255, 255, 0% );" );
    @
    What I'm doing wrong?
    Is there possible to write it in the qss file?

    Thank you for your help!!!!

    Massi

    [Edit: Please be sure and wrap your code in @ blocks; mlong]

    Massinissa Bandou Ing.jr

    1 Reply Last reply
    0
    • S Offline
      S Offline
      soundar
      wrote on last edited by
      #2

      Hai,Massinissa.
      Try to use this command.It gives the solution for your problem.

      @
      QPalette palette = view->palette();
      palette.setBrush(QPalette::Base, Qt::transparent);
      view->page()->setPalette(palette);
      view->setAttribute(Qt::WA_OpaquePaintEvent, false);
      @

      Don't Follow Anyone but You Must Learn From Everyone.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        soroush
        wrote on last edited by
        #3

        Hi

        Try replacing this:
        @
        "background-color: rgba( 255, 255, 255, 0% );"
        @
        with this one:
        @
        "background: transparent;"
        @

        J 1 Reply Last reply
        2
        • M Offline
          M Offline
          Massinissa
          wrote on last edited by
          #4

          I did it but still getting a white background instead of transparent

          Massinissa Bandou Ing.jr

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Massinissa
            wrote on last edited by
            #5

            you need to declare view??

            Massinissa Bandou Ing.jr

            1 Reply Last reply
            0
            • K Offline
              K Offline
              KA51O
              wrote on last edited by
              #6

              Have a look at at "this link":http://qt-project.org/forums/viewthread/1107. There are plenty of threads related to the topic of "transparent background":http://qt-project.org/search?search=transparent+background.

              1 Reply Last reply
              0
              • S soroush

                Hi

                Try replacing this:
                @
                "background-color: rgba( 255, 255, 255, 0% );"
                @
                with this one:
                @
                "background: transparent;"
                @

                J Offline
                J Offline
                jawad_soft
                wrote on last edited by
                #7

                @soroush work for me ! thanks !

                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