Results 1 to 3 of 3

Thread: QListWidget Mouse Drag Select Multiple items

  1. #1
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default QListWidget Mouse Drag Select Multiple items

    I want to be able to select multiple items in a QListWidget by dragging the mouse down or up.
    The docs say QAbstractItemView::ExtendedSelection "Multiple items can be selected by dragging the mouse over them."
    No luck with that. Any suggestions?

  2. #2
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QListWidget Mouse Drag Select Multiple items

    I know it does work on a QTableView, but only when drag&drop is disabled

  3. The following user says thank you to StrikeByte for this useful post:

    Henry Blue Heeler (10th November 2014)

  4. #3
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Thanks
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: QListWidget Mouse Drag Select Multiple items

    Yes, you can select multiple items with
    Qt Code:
    1. setDragDropMode(QAbstractItemView::NoDragDrop) // or
    2. setDragDropMode(QAbstractItemView::DropOnly)
    To copy to clipboard, switch view to plain text mode 
    But then you lose drag capability. Thanks for the reply.

Similar Threads

  1. Replies: 1
    Last Post: 10th March 2013, 18:40
  2. Select multiple items in a combobox
    By sousadaniel7 in forum Qt Programming
    Replies: 11
    Last Post: 3rd May 2012, 14:57
  3. Drag and Drop items in QListWidget
    By tommynator128 in forum Qt Programming
    Replies: 4
    Last Post: 10th March 2011, 12:09
  4. QListWidget on Mac Intel 64 Can't select top two items
    By jpbaugh in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2009, 18:52
  5. Replies: 1
    Last Post: 6th September 2008, 00:54

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.