Results 1 to 2 of 2

Thread: QTreeWidget drag/drop

  1. #1
    Join Date
    Jun 2006
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeWidget drag/drop

    Hi,

    Currently I have a QTreeWidget with drag/drag enabled, successfully copying/moving items.

    However, this is not fully correct. My QTreeWidgetItems are subclassed (type being indicated in UserRole) and I only want to allows keys of certain types to drop in keys of certain other types.

    I've subclassed QTreeWidget and overridden mimeData and dropMimeData to allow me to encode/decode custom information. However with my custom mime format I now get a you cannot do that icon (circle with line through it) when I go to drop it in the desired location.

    Where does QTreeWidget decide if a drop can be made on a given it? I did try to override event, looking for QEvent:ropMove but it does not seem to come in there.

    Help appreciated,
    Simon

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeWidget drag/drop

    Try reimplementing QWidget::dragMoveEvent().
    J-P Nurmi

Similar Threads

  1. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  2. Replies: 1
    Last Post: 21st September 2006, 10:37
  3. QTreeWidget & QListWidget different selection
    By munna in forum Qt Programming
    Replies: 9
    Last Post: 21st July 2006, 06:50
  4. How to capture resizing of QTreeWidget columns?
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 06:10
  5. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32

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.