Results 1 to 7 of 7

Thread: Q_OBJECT and CSS background-image

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_OBJECT and CSS background-image

    Done.

    if you put in comment Q_OBJECT macro, it works.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Q_OBJECT and CSS background-image

    If you want custom QWidget subclasses to support stylesheets, you need to provide the following code:
    Qt Code:
    1. void myclass::paintEvent(QPaintEvent *pe) {
    2. o.initFrom(this);
    3. QPainter p(this);
    4. style()->drawPrimitive(QStyle::PE_Widget, &o, &p, this);
    5. };
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following 4 users say thank you to wysota for this useful post:

    danipga (3rd July 2013), marwyn (19th August 2011), nelbok (20th January 2011), Tottish (18th June 2011)

  4. #3
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_OBJECT and CSS background-image

    Thanks a lot, it works perfectly now.

Similar Threads

  1. Image as a background
    By Tomasz in forum Newbie
    Replies: 5
    Last Post: 6th December 2010, 14:37
  2. Replies: 1
    Last Post: 25th June 2010, 18:31
  3. No Background image showed
    By jiveaxe in forum Installation and Deployment
    Replies: 2
    Last Post: 30th December 2007, 13:25
  4. No Background Image on Example
    By igor in forum Qt Programming
    Replies: 3
    Last Post: 19th January 2007, 12:41
  5. [QT4.1.1 XP] background image
    By incapacitant in forum Newbie
    Replies: 3
    Last Post: 1st March 2006, 13:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.