Results 1 to 2 of 2

Thread: dragMoveEvent never "on" an item

  1. #1
    Join Date
    Oct 2010
    Posts
    6
    Qt products
    Qt4

    Default dragMoveEvent never "on" an item

    I am writing an app with a custom model and QTreeView. I am trying to disallow
    drops on items with two children. (In other words I am trying to create a binary tree).
    I have overridden dragMoveEvent to do this. The problem is that if I put in a test
    to for inserting between items as well, the dropIndicatorPosition is always above or
    below an item. Never on it.This is messing me up royally since I can only drag onto
    the root node, and never onto the children.

    I realize this is a tall order without posting source code, but can anyone suggest a
    reason why the framework might, for dropIndicatorPosition, have "hysteresis" and
    return "on" on the root node, but only "above" and "below" for children.

    FWIW, in my dragMoveEvent code I am using to prevent the drop:

    event->setDropAction(Qt::IgnoreAction)
    event->accept()
    return

    thanks,
    Danny

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

    Default Re: dragMoveEvent never "on" an item

    How did you implement flags() for your model? Do you allow drop on items there?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 7th April 2010, 21:46
  2. Replies: 5
    Last Post: 2nd April 2010, 21:26
  3. Replies: 3
    Last Post: 15th February 2010, 17:27
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

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.