Drag+Drop with Perl-Qt and QT Designer
Hi there, i recently started to use perl-qt for building guis. I looks like a prety nice way.
At the moment I face the problem, that I want to enable Drag+Drop of files into a QTable, that is located into a QMainWindow. I am prety sure it is a quite stupid beginners question, but i just can't find a solution.
http://doc.trolltech.com/3.3/dnd.html says that:
"To be able to receive media dropped on a widget, call setAcceptDrops(TRUE) for the widget (e.g. in its constructor), and override the event handler methods dragEnterEvent() and dropEvent()."
The first part setAcceptDrops(TRUE) can easily done using the designer, but I don't understand how i can overrite the methods of my table.
I tried putting the following into the header file of my project krenameit.ui.h:
void FileTable::dragEnterEvent(QDragEnterEvent* event)
{
my $event = shift;
if (Qt::TextDrag::canDecode($event)) {
$event->accept(1);
}
else {
$event->accept(0);
}
}
But converting this into a module by using puic the .pm shows:
sub dragEnterEvent
{
my $event = shift;
if (Qt::TextDrag::canDecode($event)) {
$event->accept(1);
}
else {
$event->accept(0);
}
}
Now dropping onto the QMainWindow works, but that is not what i want :-(
Thanks in advance
Torben
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066_______________________________________________
Kde-perl mailing list
Kde-perl@...
https://mail.kde.org/mailman/listinfo/kde-perl