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. QFrame: want no background
Forum Updated to NodeBB v4.3 + New Features

QFrame: want no background

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 9.5k 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.
  • B Offline
    B Offline
    babazaroni
    wrote on last edited by
    #1

    Hello,

    I've set my central widget to a QWidget and set the background to .png file. No problem.
    But, whenever I add a QFrame to the central widget, the QFrame inherits the .png and uses it as it's background. So one sees a smaller version of the .png file on top of the larger version.

    I don't want the QFrames to have any background, as I will be placing widgets into the QFrame and positioning them in relation to the central widget's background.

    I've tried each of the following alone and in various combinations with no effect:

    frame->setAttribute(Qt::WA_NoSystemBackground);
    frame->setAttribute(Qt::WA_OpaquePaintEvent);
    frame->setStyleSheet("background-color: transparent");
    frame->setStyleSheet("opacity: 0");

    How do I get a QFrame to not have any background and use what lies beneath it?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      babazaroni
      wrote on last edited by
      #2

      I've tried "opacity: 1.0" as well.

      1 Reply Last reply
      0
      • EddyE Offline
        EddyE Offline
        Eddy
        wrote on last edited by
        #3

        I've done this in the past using style sheets with background color Qt::transparent, if i recall well

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • B Offline
          B Offline
          babazaroni
          wrote on last edited by
          #4

          Solved: I was using the attribute "border-image" instead of "background".

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DenisKormalev
            wrote on last edited by
            #5

            Don't forget to mark thread as [solved] then.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              babazaroni
              wrote on last edited by
              #6

              My final solution was to use stylesheet attribute "border-image:none;"

              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