Thank you very much for your help.
Even if it's a very silly question, I have to ask it (sorry 'bout that):
Whats the "correct" way to implement the dragEnterEvent and dragMoveEvent functions - is this the way?
{
// always call base class implementation
if ( isDragEnterPossible(e) )
{
e->accept();
}
else
{
e->ignore();
}
}
{
// always call base class implementation
if ( isDragMovePossible(e) )
{
e->accept();
}
else
{
e->ignore();
}
}
void myQTTreeWidget::dragEnterEvent(QDragEnterEvent *e)
{
// always call base class implementation
QTreeWidget::dragEnterEvent(e);
if ( isDragEnterPossible(e) )
{
e->accept();
}
else
{
e->ignore();
}
}
void myQTTreeWidget::dragMoveEvent(QDragMoveEvent *e)
{
// always call base class implementation
QTreeWidget::dragMoveEvent(e);
if ( isDragMovePossible(e) )
{
e->accept();
}
else
{
e->ignore();
}
}
To copy to clipboard, switch view to plain text mode
isDragMovePossible and isDragEnterPossible are member functions, returning a bool value and telling us if dropping is possible.
Bookmarks