Results 1 to 3 of 3

Thread: Disabling drop over some controls

  1. #1
    Join Date
    Dec 2014
    Posts
    11
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Disabling drop over some controls

    Hi!!

    I have a QListWidget, that should have only a simple static function in my application, but is accepting drops and I'm not being able to disable it. I have been trying to change some parameters like DragEnabled, DragDropMode and others without success.

    I want to control precisely where the object can be dropped. Is it really possible to be done?

    Thank-you,
    Renato A. Ferreira

  2. #2
    Join Date
    Dec 2014
    Posts
    11
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Disabling drop over some controls

    Well... I managed to solve the problem.

    How:

    * Promoting the widget to a local class (right click over the element in form editor and then clicking in "Promote to...");
    * Overriding the dragEnterEvent method to avoid it from accepting the action. An empty implementation did the job.

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Disabling drop over some controls

    Or you could have used QWidget::setAcceptDrops

Similar Threads

  1. Drag & Drop disabling in QTreeWidget!
    By sanujas in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 5th September 2013, 07:56
  2. Disabling Modules
    By Atomic_Sheep in forum Newbie
    Replies: 3
    Last Post: 21st September 2012, 15:40
  3. Replies: 2
    Last Post: 13th October 2010, 21:51
  4. Hiding controls changes spacing of other controls
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2007, 20:47
  5. Disabling Mouse in Qt?
    By ashukla in forum Qt Programming
    Replies: 12
    Last Post: 4th December 2007, 18:18

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.