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 6082981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:20:58+00:00 2026-05-23T11:20:58+00:00

My Desktop Qt app has a large stylesheet applied. It’s applied for the QApplication

  • 0

My Desktop Qt app has a large stylesheet applied. It’s applied for the QApplication derived class I am using:

this->ApplyStyleSheet(":/qss/default.qss");

It works well for all QWidget objects I define and use. (using *.ui files).

My problem begins when i promote one of my QWidgets in the *.ui file I’m using to one of my own QWidget derived classes.

When my widget was QWidget, the following worked and changed the background image:

QWidget#myWidget {
    background: transparent;
    background-image: url(:/images/bg_img.png);
    background-repeat: repeat-x;
}

When I promoted the element to my custom QWidget derived class and changed to:

QMyDerivedClass#myWidget {
    background: transparent;
    background-image: url(:/images/bg_img.png);
    background-repeat: repeat-x;
}

I no longer see my background image. Obviously I am missing something. What is it… I hope one of you knows.

  • 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-23T11:20:59+00:00Added an answer on May 23, 2026 at 11:20 am

    My bad. Posting this so that people with similar problem can find a solution:

    I did not add “paintEvent” to my custom class. (which in this case draws nothing but it enables the stylesheet adherence).

    void CustomWidget::paintEvent (QPaintEvent *)
    {
        QStyleOption opt;
        opt.init (this);
        QPainter p (this);
        style ()->drawPrimitive (QStyle::PE_Widget, &opt, &p, this);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather large (80k loc) java desktop app that talks to a
My company has a desktop app originally developed for Windows XP. The original programmer
Cloud App has this neat feature wherein it automatically uploads new screenshots as they
I am using Eclipse RCP to build desktop app. When the user invokes a
I finally wrote me little app. It's desktop app but it has embedded web
I have a desktop app (.net 3.5) which communicates with the server using classic
I'll be writing a small desktop app for a client that has WinXP machines
We recently started to develop a Java desktop app and management has requested that
I'm writing a Java Desktop App using NetBeans 6.5 and a Swing Patterns that
My application built with Google App Engine has this page that displays search results

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.