Results 1 to 4 of 4

Thread: How to enable copy-paste & click for QListView item?

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default How to enable copy-paste & click for QListView item?

    Hello everyone,

    I need an urgent help regarding my QListView behavior. I have a chat program which uses MVC - that is it has a QListView, QAbstractItemModel and QItemDelegate classes for displaying messaging UI.

    Everything seems working but I had no luck to interact with my messages by mouse. I couldn't copy-paste the text in the listview. Also couldn't click links in the listview as well.

    I reimplemented flags function to make items selectable and editable but still not able to do copy-paste etc.

    Any ideas?

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

    Default Re: How to enable copy-paste & click for QListView item?

    If you want all these in a list view then you will have to implement all those features yourself in the delegate. Making an item "editable" means that you can trigger creating an editor widget for an item. Making an item "selectable" means that it can be marked as selected in the item selection model. It does't mean you will be able to interact with any part of the item (like selecting part of its text).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: How to enable copy-paste & click for QListView item?

    I see your points regarding ItemIsSelectable & ItemIsEditable flags. That's in the pocket. Thanks.

    In addition, I have my own delegate already but couldn't figured it out how to make , for example, the links clickable in the listview. Any specific suggestions?

    Regards

  4. #4
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: How to enable copy-paste & click for QListView item?

    Nobody yet?

Similar Threads

  1. Replies: 3
    Last Post: 25th May 2011, 17:03
  2. Replies: 2
    Last Post: 22nd November 2010, 21:49
  3. copy and paste
    By hubipet in forum Qt Tools
    Replies: 1
    Last Post: 17th July 2009, 06:19
  4. using cut(), copy(), paste()
    By systemz89 in forum Newbie
    Replies: 5
    Last Post: 18th December 2007, 14:47
  5. Copy/Paste in TableView
    By bronte in forum Qt Programming
    Replies: 2
    Last Post: 10th September 2006, 21:36

Tags for this Thread

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.