Results 1 to 3 of 3

Thread: Retrieving exact info on target(s) of drop indicator in a subclassed QTreeWidget

  1. #1
    Join Date
    Feb 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Retrieving exact info on target(s) of drop indicator in a subclassed QTreeWidget

    Hi,

    I'm implementing drag and drop in a subclassed QTreeWidget. The drop indicator shows either a rectangle if the mouse cursor is on an item and a horizontal line if the mouse cursor is exactly between two items (or at the start or end of a list of items).

    How can i extract this information in my dropEvent(QDropEvent *p_Event)? At the moment i'm using itemAt(p_Event->pos()) to get the target item, but that isn't enough for above mentioned.

    Any ideas?

    Kind Regards,
    Daniel Dekkers

  2. #2
    Join Date
    Nov 2008
    Posts
    21
    Thanked 1 Time in 1 Post

    Default Re: Retrieving exact info on target(s) of drop indicator in a subclassed QTreeWidget

    Hi,

    I have exactly the same problem.

    It is not possible to find out where the horizontal line was when using "itemAt(event->pos())".

    Is there another way to find out where the horizontal line has been?

  3. #3
    Join Date
    Nov 2008
    Posts
    21
    Thanked 1 Time in 1 Post

    Default Re: Retrieving exact info on target(s) of drop indicator in a subclassed QTreeWidget

    I found a solution.

    QAbstractItemView::dropIndicatorPosition() shows the indicator position:

    QAbstractItemView::OnItem
    QAbstractItemView::AboveItem
    QAbstractItemView::BelowItem
    QAbstractItemView::OnViewport

Similar Threads

  1. Segfault when retrieving info from QSettings
    By codeslicer in forum Qt Programming
    Replies: 21
    Last Post: 21st March 2008, 09:42
  2. Drop indicator not displaying with QTreeView. Need help
    By bigchiller in forum Qt Programming
    Replies: 12
    Last Post: 12th March 2008, 12:38
  3. Getting DragEvent target info
    By MrGarbage in forum Qt Programming
    Replies: 4
    Last Post: 22nd September 2007, 10:23
  4. Drag and drop indicator
    By iswm in forum Qt Programming
    Replies: 2
    Last Post: 19th April 2007, 19:58
  5. Drop Indicator
    By guilugi in forum Qt Programming
    Replies: 2
    Last Post: 18th January 2006, 11:49

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.