[Kde-perl] Perl-Qt4?

Joe Claborn joe at claborn.net
Thu Jun 1 15:37:11 CEST 2006


I'm not sure about a memory leak - but adding 

sub Qt::Table::takeItem {
 }

to the puic generated .pm stopped the crashing.

Thanks for all the help.

Joe


On Thursday 01 June 2006 1:39 am, Agbaria, Rasheed wrote:
> Hi,
> Regarding memory leakage, I am not sure ?
> Even though this is the best WA I found until new version is
> released(looks like no one is working on it :( ).
> Please look at the folloing link :
>
> http://sourceforge.net/tracker/index.php?func=detail&aid=924345&group_id
> =29255&atid=395685
>
> -----Original Message-----
> From: Ole Christensen [mailto:Ole.Christensen at web.de]
> Sent: Wednesday, May 31, 2006 6:06 PM
> To: kde-perl at kde.org
> Subject: Re: [Kde-perl] Perl-Qt4?
>
> Rasheed,
>
> doesn't that lead to a memory leakage? And does it work in each case
> (when
> removing cells)? I doubt.
>
> Cheers,
> Ole.
>
> Agbaria, Rasheed wrote:
> > There is already reported WA,
> >
> > Define your own table :
> >
> > package MyTable;
> > use strict;
> > use Qt;
> > use Qt::isa qw(Qt::Table);
> >
> > sub NEW {
> >     shift->SUPER::NEW(@_);
> > }
> >
> > sub Qt::Table::takeItem {
> > }
> >
> > 1;
> >
> >
> > ===============================
> > Inside your code use MyTable instead of table:
> > package main;
> > use MyTable;
> > use strict;
> > use Qt;
> >
> > my $a = Qt::Application(\@ARGV);
> >
> > my $table = MyTable();
> > $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;
> >
> >
> > this code worked fine.
> >
> >
> > -----Original Message-----
> > From: Joe Claborn [mailto:joe at claborn.net]
> > Sent: Wednesday, May 31, 2006 4:24 PM
> > To: kde-perl at kde.org
> > Subject: Re: [Kde-perl] Perl-Qt4?
> >
> > 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?
>
> _______________________________________________
> Kde-perl mailing list
> Kde-perl at kde.org
> https://mail.kde.org/mailman/listinfo/kde-perl
> _______________________________________________
> Kde-perl mailing list
> Kde-perl at kde.org
> https://mail.kde.org/mailman/listinfo/kde-perl

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


More information about the Kde-perl mailing list