Results 1 to 2 of 2

Thread: Strange behavior with Drag and Drop (not always drops)

  1. #1
    Join Date
    May 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Strange behavior with Drag and Drop (not always drops)

    Hi all

    I have a strange problem with Drag and drop items between widgets
    I use a widget extended from QTabWidget which includes some custom widgets
    The tab widget allows drops and also the widgets in the tabs
    and both DragEnterEvent and Drop event are handled in the tab widget and the also the tabs

    I implemented DragMoveEvent in the tab widget so as to acheive the following performance:
    while I am dragging some item ,and I move the mouse on the tab bar,the tab which the mouse is moving on should be activated to allow dropping in it.

    The problem is when I drop an item on the tab widget ,sometimes it succeeds but it fails on another time
    I tried to figure out how could this happen,
    it seemed to be that the event doesn't fire at all
    I remove my finger away from the mouse button but no drop event fires (even not mouse released) and the dragging cursor remains
    but when I move the mouse or deactivate the window the desired behavior happened(which means that the drop event fired)

    I discovered another strange issue which is that when the event doesn't fire and I pressed a mouse button before moving the mouse it continue dragging as if nothing happened

    I dont know is it sth related to the application or to the tab widget which make the event delayed in firing or what really happened

    I tried to describe the problem as much as I could

    any help will be greatly appreciated

    Best Regrads
    Mona

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Strange behavior with Drag and Drop (not always drops)

    Could you explain in more detail what the widget structure is?
    Your problem could be because another widget ( that you have created there ) is stealing the drop event from the tab widget.

    If I get it correctly you have reimplemented dragMoveEvent in the QTabWidget. Is that right ?
    And you did that to highlight the tabs in the tab widget.

    But the tabs are actually a QTabBar. Are you sure the QTabBar is not stealing this event from the tab widget?
    If so, you could try installing the tab widget as event filter in the tab bar, and accept it's drag move and drop events.

    If this doesn't solve the problem, then you can explain some more .

    Regards

Similar Threads

  1. Drag and Drop
    By allensr in forum Qt Programming
    Replies: 1
    Last Post: 11th December 2006, 20:50
  2. Replies: 7
    Last Post: 8th September 2006, 16:19
  3. Drag and drop outside the application
    By jpn in forum Newbie
    Replies: 7
    Last Post: 27th August 2006, 15:37
  4. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 16:41
  5. Drag 'n Drop problem
    By kiker99 in forum Qt Programming
    Replies: 4
    Last Post: 16th January 2006, 16:35

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.