Re: Drag And Drop Woooees
Hi, instead of ignoring the event, you could try to use
Code:
{
event->acceptProposedAction ();
}
Arghargh
Re: Drag And Drop Woooees
If you use the model based approach, then you should implement drag&drop in the model instead of messing with the view's events.
Re: Drag And Drop Woooees
other helpful stuff (sometimes)
* put a qDebug() << __PRETTY_FUNCTION__ inside those events, so you know they happen
* have you enabled drag / drop on the view (in designer, if you're using it)?
* QAbstractItemView (and subclasses) handle drag and drop; it is not necessary anymore for you to work on the level of these events. Instead read up on QAbstractItemModel::mimeData() etc.
HTH
Re: Drag And Drop Woooees
* put a qDebug() << __PRETTY_FUNCTION__ inside those events, so you know they happen
>> yes, all dragNDrop Functions get hit except dragMoveEvent(QDragMoveEvent * event)
* have you enabled drag / drop on the view (in designer, if you're using it)?
>> yes, I am using designer, adn have enabled all drag options
* QAbstractItemView (and subclasses) handle drag and drop; it is not necessary anymore for you to work on the level of these events. Instead read up on QAbstractItemModel::mimeData() etc.
ok, but I can't understand why only dragMoveEvent(QDragMoveEvent * event) won't work. this is the same code that is located in 2 other places in the app,the difference being the other classes are based on QTableView and the dragmove event works???. Do these routines work differently when located in different view types??.
thanks
Johnny
Re: Drag And Drop Woooees
Quote:
Originally Posted by
sticcino
ok, but I can't understand why only dragMoveEvent(QDragMoveEvent * event) won't work.
Because you ignore the drag enter event instead of accepting the proposed action.