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

Gary Greene greeneg at tolharadys.net
Sat Jun 13 09:14:43 CEST 2009


On Friday 12 June 2009 03:37:53 pm Adam Bar wrote:
> Hello everyone,
>
> My question is maybe stupid, but I am looking for few hours for the
> solution - how to get string value from variable blessed QString?
> my $str = 'string';
> my $obj = QString($str);
> # how to get 'string' from $obj ?
>
> Methods like latin1(), ascii() are not defined in my perl binding.
>
> I am using Perl Qt 4.004, Perl 5.8.8.
>
> Thanks in advance!
> Adam
> _______________________________________________
> Kde-perl mailing list
> Kde-perl at kde.org
> https://mail.kde.org/mailman/listinfo/kde-perl

Probably you'll have to marshal using some custom code in those bindings the 
data from Qt using std::string QString::toStdString into Perl's SVpv. See  
http://doc.trolltech.com/4.5/qstring.html#toStdString for info on that 
method.

-- 
Gary L. Greene, Jr.
Sent from: peorth.tolharadys.net
 00:02:57 up 39 days, 16:29,  3 users,  load average: 0.65, 0.66, 0.59
==========================================================================
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/20090613/70d4dc25/attachment.sig 


More information about the Kde-perl mailing list