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. What should I do to fix the background black color?
Forum Updated to NodeBB v4.3 + New Features

What should I do to fix the background black color?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 198 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.
  • nicker playerN Offline
    nicker playerN Offline
    nicker player
    wrote last edited by
    #1

    37f3e5ca-b187-41e2-9f0f-babfb3ca1c0a-image.png
    When I use the code to create a widget which set the round corner border but failed.cause the widget border part is not transparent.
    even though I had just setted the atrribute of the transparent.but the background of the qwidget was not setted to the transparent. so how to fix it.
    setAttribute(Qt::WA_TranslucentBackground);
    setAutoFillBackground(false);

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by
      #2

      Hi,

      Please provide a minimal buildable code sample that shows your issue.
      Also, version of Qt and OS.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • nicker playerN Offline
        nicker playerN Offline
        nicker player
        wrote last edited by
        #3

        QT 5.14.1 and windows 7 and windows 11
        I found the error code line.
        if I used the code like this:

        showNormal();//the qwidget slot function
        setAttribute(Qt::WA_TranslucentBackground);
        

        the dark part will appear.
        and if remove the showNormal() function ,then the tranlucent would work.so is it a bug or something else?

        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