Results 1 to 14 of 14

Thread: ListView and CurrentChanged

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ListView and CurrentChanged

    Quote Originally Posted by kroenecker View Post
    The labels have pointers to the modelindexes that they display.
    Well... I should have asked it in the first place, but what do you need those labels for?

  2. #2
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ListView and CurrentChanged

    Jacek,

    Well I wanted to be able to populate a listview with information that is rendered as rich-text.

    I guess I just don't understand how all these different parts intersect.

    Like I said above, if I don't use labels, I can simply populate each item in the view with text using painter->setText(*params*) and, in that case, selecting works just fine. I just don't understand why the label event handler shows that an item is selected (it's in the event handler that I use the selection model to select items in the view), but in the
    Qt Code:
    1. void MyDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
    To copy to clipboard, switch view to plain text mode 

    call none of the items show up as being selected. In both instances I'm using what I would assume is the same pointer to the same selectionModel. I guess that somewhere along the line the selectionModel's values are being changed. Oh well, I just don't get it.

    If I can get the text to wrap in the paint call, then I guess I don't need to use a label.

  3. #3
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ListView and CurrentChanged

    To answer my own question it looks like I can set that sort of thing with the text displayed by paint... Silly me

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.