Hi, it's me again.
Today's problem has to do with a KListView I have in my app. I would like it to support dnd, but I can't get it to work.
First I did:
MyList->setAcceptDrops( TRUE );
connect( MyList, SIGNAL( dropped( QDropEvent*, QListViewItem* ) ), this, SLOT( slotDropped( QDropEvent*, QListViewItem* ) ) );
Then I made the slotDropped function
MyApp::slotDropped( QDropEvent* event, QListViewItem* after)
{
kdDebug << "slotDropped called" << endl;
}
Only to find out it never gets called! Not surprisingly, if I drag something over my KListView, it shows a cross as if it doesn't accept the drop.
After investigating, I found a lot of messages saying that acceptDrag(QDropEvent*) has to be overridden.
Does that mean I have to subclass KListView?
and if so:
How do I get Qt Designer to use the subclass instead of the normal KListView?
And what does the acceptDrag function have to do? Does it have to check if what is dropped is valid and return true if that's so?
These are probably stupid questions, but I've been searching for the answers all morning and I can't seem to find them. Almost all examples use subclassed KListViews, but I don't see how I can do that while using Qt Designer.
Thanks