Results 1 to 20 of 25

Thread: How do draw a frame in QListView?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Dec 2006
    Posts
    31
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How do draw a frame in QListView?

    It I did already.
    now I need to draw on a background QListView.
    How?
    if i do
    Qt Code:
    1. myView::myView(QWidget *parent)
    2. : QListView(parent)
    3. {
    4. }
    5.  
    6. void myView::paintEvent(QPaintEvent *event)
    7. {
    8.  
    9. QPainter painter(viewport());
    10.  
    11. QPen pen(Qt::green, 10, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
    12. painter.drawText(rect(),Qt::AlignLeft,"Test DRive this List");
    13.  
    14. QListView::paintEvent(event);
    15. }
    To copy to clipboard, switch view to plain text mode 
    i get painter from QAbstractItemView and my text scroll with item.
    it follows from this that it is needed to draw on painter from QFrame or QWidget
    Last edited by someralex; 19th December 2006 at 18:18.

Similar Threads

  1. Replies: 0
    Last Post: 10th November 2006, 13:46
  2. Using QGLWidget paint engine to draw regular widgtes?
    By high_flyer in forum Qt Programming
    Replies: 11
    Last Post: 9th October 2006, 12:06
  3. Replies: 16
    Last Post: 7th March 2006, 15:57
  4. Multi frame management ... is it possible ?
    By yellowmat in forum Newbie
    Replies: 8
    Last Post: 25th January 2006, 10:41
  5. Keeping focus at bottom of QListView
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 14:45

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.