PDA

View Full Version : Jambi QListWidget Drag & Drop



ronnyf
4th February 2009, 22:58
Hi,

i want to be able to drag a file onto my QListWidget. Therefore I subclassed it into my QFileListWidget. In the designer I set the following:

[QWidget]
acceptDrops = true

[QAbstactItemView]

dragEnabled = true
dragDropMode = DragDrop


package org.rfs.qttestpackage;
import com.trolltech.qt.gui.*;

public class QFileListWidget extends QListWidget{

public QFileListWidget(QWidget parent){
super(parent);
setAcceptDrops(true);
}

protected void dropEvent(QDropEvent event) {
System.out.println("DROPPED: " + event.toString());
}
}


Now, nothing happens when I drag ANYTHING onto this control. Could you please help with pointing out what I am doing wrong?

thanks
Ronny