[Kde-perl] Drag n Drop

ruuk ruuk at 2ndmind.net
Thu Jan 15 06:03:42 CET 2004


use strict;

package DTFileList;

use Qt;
use Qt::debug;
use Qt::isa qw(Qt::ListView);
use Qt::attributes qw(
	Temp
);

sub NEW{
	shift->SUPER::NEW(@_ [0..2]);
}

sub dragObject{
	print "test\n";
	my $do = Qt::TextDrag( 'text' , this );
	print "test\n";
	return $do ;
}

1;

Above i've started re-implementing the QListView class to enable drag and drop.
It works in my app otherwise, but when i go to make a drag, I get a Segmentation Fault.
It prints both tests shown above. If i remove the return $do, it does not S.F. but of course
no drag starts.
As in:

	sub dragObject{
		print "test\n";
		my $do = Qt::TextDrag( 'text' , this );
		print "test\n";
	}

If I continue and remove the second print:

	sub dragObject{
		print "test\n";
		my $do = Qt::TextDrag( 'text' , this );
	}

It again Segmentation faults.

Any ideas?

(I'm actually wanting to do a QUriDrag, which is behaving the same as this, but i was testing  
with QTextDrag because it's a little simpler)

Thanks,

ruuk




More information about the Kde-perl mailing list