[Kde-perl] Converting Qt4 QString to ordinary Perl string

Gary Greene greeneg at tolharadys.net
Thu Jun 18 17:34:05 CEST 2009


On Wednesday 17 June 2009 05:22:20 am Richard Dale wrote:
> On Tuesday 16 June 2009 09:46:27 pm Chris Burel wrote:
> > As I recall from when I looked at that version of the binding from a
> > year ago, you have to go through a roundabout method to get the data
> > out of the QString object.
> >
> > my $i = 0;
> > my $perlStr = '';
> > while( $i < $string->count() ) {
> >     $perlStr .= chr( $string->at($i)->cell() );
> >     $i++
> > }
> > print $perlStr;
> > Hi there
> >
> > Very difficult.  This was one of the reasons the smoke-based PerlQt4
> > project was started.  The link has already been posted.
>
> One related point is that in PerlQt Qt3, a QByteArray was mapped onto a
> Perl string. But I found that was more trouble than it's worth in QtRuby,
> and so Qt::ByteArray is now a class, and not a string anymore.
>
> -- Richard
> _______________________________________________
> Kde-perl mailing list
> Kde-perl at kde.org
> https://mail.kde.org/mailman/listinfo/kde-perl

As long as there is a way to convert TO a string for QByteArrays that 
shouldn't be too much of a problem. (Yes, I've run into code that needs 
that.)

-- 
Gary L. Greene, Jr.
Sent from: peorth.tolharadys.net
 08:33:06 up 45 days, 59 min,  3 users,  load average: 0.39, 0.58, 0.61
==========================================================================
Developer and Project Lead for the AltimatOS open source project
Volunteer Developer for the KDE open source project
See http://www.altimatos.com/ and http://www.kde.org/ for more information
==========================================================================

Please avoid sending me Word or PowerPoint attachments.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-perl/attachments/20090618/e4ffec2c/attachment.sig 


More information about the Kde-perl mailing list