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

Eric Wilhelm ewilhelm at scratchcomputing.com
Sun Jun 14 03:51:01 CEST 2009


# from Adam Bar
# on Friday 12 June 2009 15:37:

>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.

Hi Adam,

Where did you get this Qt.pm?  I think you must be running the non-smoke 
QtCore+QtGUI distros.

  http://search.cpan.org/~vadiml/QtCore-4.004/

I haven't looked at that much except to determine that the API was 
fabricated from generated XS code and seems to require that every 
string be constructed using a QString() function -- which is not very 
perlish.  The developer also does not seem to respond to any of my 
mail.

On the other hand:

  http://code.google.com/p/perlqt4/

This intends to be a successor to the old PerlQt (3) and will work much 
like it.  Plus, the maintainers of this code *are* on this list.  
However, it isn't on the CPAN yet.

--Eric
-- 
If the above message is encrypted and you have lost your pgp key, please
send a self-addressed, stamped lead box to the address below.
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------


More information about the Kde-perl mailing list