[Kde-perl] Perl-Qt4?

Joe Claborn joe at claborn.net
Wed May 31 15:23:59 CEST 2006


Ole,
Thanks for the reply. I think the problem is more fundamental than your 
solution suggests. Here is the code that crashes.

use strict;
use Qt;

my $a = Qt::Application(\@ARGV);

my $table = Qt::Table();
$table->setNumRows( int(1) );
$table->setNumCols( int(1) );
$table->setText(0,0,'Hello');

$a->setMainWidget($table);
$table->show;
# Uncomment out either of the next to lines to reproduce the problem
$table->setNumRows(0);
#$table->removeRow(0);

exit $a->exec;

gives
*** glibc detected *** double free or corruption (fasttop): 0x085b1c10 ***
Aborted

So if I can not add text to a table and then reduce the size of the table, I'm 
not show that it is usable.

Thanks again,

Joe



On Wednesday 31 May 2006 12:27 am, Ole Christensen wrote:
> Joe,
>
> sorry for responding late.
>
> Your problem can probably be solved by holding references to all table
> items in a "shadow table". I once used that approach for some other issue
> with table items. Works without any problem for me. Sorry, I am in a hurry.
> So, very brief:
>
> Put a copy (the reference) of each item you create in the Qt table into a
> raw Perl table (array of refs to arrays). When you have deleted the item,
> you can finally remove the item's copy.
>
> Let me know, if this is too short to understand.
>
> Cheers,
> Ole.
>
> Joe Claborn wrote:
> > On Tuesday 30 May 2006 4:30 pm,
> >
> >> You;re not getting the point, I've over 20,000 lines of code written in
> >> Perl-Qt for PhoeNUX's GUI tools and DO NOT want to port to yet another
> >> language. Please Ashley, say that there is a port planned :)
> >
> > We too have a substantial number of lines written in Perl-Qt.  And as we
> > have not been able to solve the setNumRows(0) crashes, I'm looking at
> > Ruby or C++. I like what I've read about Ruby, but I worried about
> > getting into another situation where I'm not writting in the 'base'
> > language of the tool. If we port to Ruby, and then in a couple of years
> > Ruby-Qt fades away as it appears that Perl-Qt is, then I'm going to wish
> > I'd ported to C++.
> >
> > Any ideas?  Is there a way to keep Perl-Qt alive?

-- 
Joe Claborn
joe at claborn.net
254-829-2448


More information about the Kde-perl mailing list