Results 1 to 2 of 2

Thread: costum QWidget with border-image in style sheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  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

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
  •  
Qt is a trademark of The Qt Company.