Results 1 to 9 of 9

Thread: QToolButton and Style sheet

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Posts
    37
    Qt products
    Qt3 Qt4
    Platforms
    Windows
    Thanks
    6

    Default Re: QToolButton and Style sheet

    Ok , could you just post a little piece of code about that

    Thanks

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

    Default Re: QToolButton and Style sheet

    Qt Code:
    1. void X::paintEvent(QPaintEvent *pe){
    2. QPixmap px;
    3. if(...){
    4. px = QPixmap("p1.png");
    5. } else if(...){
    6. px = QPixmap("p2.png");
    7. } else ...
    8. QPainter p(this);
    9. p.drawPixmap(rect(), px);
    10. }
    To copy to clipboard, switch view to plain text mode 

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.