Results 1 to 7 of 7

Thread: How to prevent QListWidget from itemdragging

  1. #1
    Join Date
    Jan 2006
    Location
    Leiden, the Netherlands
    Posts
    43
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default How to prevent QListWidget from itemdragging

    Hello,

    In the designer I set 'dragenabled' to false.
    The help says:
    "This property holds whether the view supports dragging of its own items."

    Unfortunately I can still drag items...(target platform is Win32) how can I prevent my QListWidget from doing this?

    Regards,
    Arthur

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

    Default Re: How to prevent QListWidget from itemdragging

    Could you provide a minimal compilable example which reproduces the problem?

  3. #3
    Join Date
    Jan 2006
    Location
    Leiden, the Netherlands
    Posts
    43
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to prevent QListWidget from itemdragging

    Here it is.
    Attached Files Attached Files

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

    Default Re: How to prevent QListWidget from itemdragging

    This example is far from being minimal

    You can drag items because movement property of your listwidget is set to Snap. Try changing it to QListView::Static.

  5. The following user says thank you to wysota for this useful post:

    Arthur (14th April 2006)

  6. #5
    Join Date
    Jan 2006
    Location
    Leiden, the Netherlands
    Posts
    43
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to prevent QListWidget from itemdragging

    Sorry I couldn't 'isolate' the problem otherwise than just inserting my GUI file

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

    Default Re: How to prevent QListWidget from itemdragging

    Quote Originally Posted by Arthur
    Sorry I couldn't 'isolate' the problem otherwise than just inserting my GUI file
    The point of making a minimal example is that the author often finds and resolves the problem while trying to reproduce it. Another point is that it's easier for others to do anything with that example (modify it or whatever) and they don't have to read a bunch of code to understand it.

  8. #7
    Join Date
    Jan 2006
    Location
    Leiden, the Netherlands
    Posts
    43
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to prevent QListWidget from itemdragging

    Ok, next time I'll behave ;-)

    Changing it to QListView::Static worked by the way, thanks.

Similar Threads

  1. Replies: 13
    Last Post: 15th December 2006, 11:52

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.