Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6561153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:33:08+00:00 2026-05-25T13:33:08+00:00

I have set the following CSS to the QWidget Stylesheet: QWidget { background-color: qlineargradient(x1:

  • 0

I have set the following CSS to the QWidget Stylesheet:

QWidget { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #00b7ea, stop: 1 #009ec3); /* Chrome10+,Safari5.1+ */ }

It works fine, but when I put a button or any other control on the canvas, I get the same background colour included in the elements.

enter image description here

Can someone help me fix this.

I’ve tried using a QFrame but I always get a border around the Frame like this:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:33:08+00:00Added an answer on May 25, 2026 at 1:33 pm

    When you set a style sheet for a QWidget, the style sheet is applied to that QWidget and the entire child hierarchy of that widget. Since you are using QWidget as a selector, the style will be applied to any QWidget or QWidget subclass. A QPushButton is a subclass of QWidget, so the style rule is applied to it.

    There are many ways you could single out just the main QWidget with a selector. In this case, it might be easiest just to use .QWidget which will target only QWidgets and not QWidget subclasses.

    If you end up having other QWidgets in the child hierarchy, you can be more selective by identifying the class and objectName property using Classname#objectName.

    You should read this section of the Qt docs for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a background image set on a web page with the following CSS:
I have a <div> with the following css properties set via its class :
I have the following css settings: .dropdown dt { background:#e4dfcb !important; } .dropdown-disabled {
Anyone seen this before? Simple textarea that I have set to the following CSS:
I have the following css set up for my page. When the page loads
I have the following CSS which isn't working in IE7. input:focus{border-width: 2px;border-color: Blue; border-style:
I have a div box with box-shadow set around it with the following CSS:
I'm trying to map a Dictionary containing Lists. I have the following set of
I'm using log4Net for my logging. I also have the following set... <log4net debug=true>
I have implemented the following set up (after being requested): slideshow of images changing,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.