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. Qt::WA_TranslucentBackground
QtWS25 Last Chance

Qt::WA_TranslucentBackground

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 12.4k 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.
  • E Offline
    E Offline
    ExtraLeonard
    wrote on last edited by
    #1

    I have change window attribute and look with

    @setAttribute(Qt::WA_TranslucentBackground, true);
    setWindowFlags(Qt::FramelessWindowHint);@

    and add some stylesheet code.

    later I want to change back to normal style with

    @this->setWindowFlags(Qt::Window);@

    and this change back titlebar but this code

    @setAttribute(Qt::WA_TranslucentBackground, false);@

    didn't change and I have transparent some widgets and ugly paint on them.

    How to get back with code?

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      what happens if you call repaint() on your main widget?

      --- 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
      • E Offline
        E Offline
        ExtraLeonard
        wrote on last edited by
        #3

        nothing...

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          hmm...seems you have to hide and show it again:
          @
          this->setWindowFlags(Qt::Window);
          this->setAttribute(Qt::WA_TranslucentBackground, false);
          this->hide();
          this->show();
          @

          --- 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
          • E Offline
            E Offline
            ExtraLeonard
            wrote on last edited by
            #5

            Not working, same issue...

            1 Reply Last reply
            0
            • E Offline
              E Offline
              ExtraLeonard
              wrote on last edited by
              #6

              What is 'normal' attribute for widgets? maybe it doesn't have any or it has buffered some

              1 Reply Last reply
              0
              • raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #7

                [quote author="ExtraLeonard" date="1366992858"]Not working, same issue...[/quote]
                strange ... this worked for me.

                --- 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
                • E Offline
                  E Offline
                  ExtraLeonard
                  wrote on last edited by
                  #8

                  still not working

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    john_god
                    wrote on last edited by
                    #9

                    What happens if don't use setWindowFlags(Qt::FramelessWindowHint) in the first place ?
                    Will it recover from the background tansparency to normal ?

                    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