Results 1 to 2 of 2

Thread: costum QWidget with border-image in style sheet

  1. #1

    Default costum QWidget with border-image in style sheet

    hello,

    i have a simple class that derives from QWidget.
    the paint event looks like this:
    Qt Code:
    1. void ssbgtest::paintEvent(QPaintEvent *)
    2. {
    3. opt.init(this);
    4. QPainter p(this);
    5. style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
    6. }
    To copy to clipboard, switch view to plain text mode 
    well, this paintevent lets me use background-image in the style sheet.

    but i need a border-image, because it will then resize the image when you resize the window. background-image tiles the image.

    what i need is the code to provide this feature for my simple class. i guess its only about the primitiv element, but which is the right to draw?

    greetz qt fan
    Last edited by jpn; 24th January 2009 at 22:19. Reason: changed [qtclass] to [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Boston, MA
    Posts
    40
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: costum QWidget with border-image in style sheet

    Check border-image on Qt Style Sheets Reference.

    http://doc.trolltech.com/4.4/stylesh...l#border-image

Similar Threads

  1. Qt 4.3 Style sheet, new features
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2007, 15:22

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.