Re: QListViewItem
Arnaud DUPUIS <[email protected]> Fri, 27 Oct 2006 12:14:54 +0200
| Newsgroups | gmane.comp.kde.devel.perl |
|---|---|
| Organization | [ Infinity Perl ] |
| Message-ID | <[email protected]> |
--===============1120485846==
Content-Type: multipart/signed;
boundary="nextPart1181585.mNvKegfTBy";
protocol="application/pgp-signature";
micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
--nextPart1181585.mNvKegfTBy
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Try this :
my $item =3D Qt::ListViewItem(listView1, undef);
$item->setText(0, trUtf8( join('',@array) ));
Your loop replace the text content each time you go through the loop, if yo=
u=20
absolutly want to use your loop modify it this way :
foreach loop. The code looks like this:
my $item =3D Qt::ListViewItem(listView1, undef);
foreach $line (@array) {
$item->setText(0, trUtf8($item->text(0)."$line"));
}
Good day.
Le vendredi 27 octobre 2006 11:24, crazyroot a =E9crit=A0:
> Hi,
>
> I have listView on form , and I want to add data from array trough
> foreach loop. The code looks like this:
>
> my $item =3D Qt::ListViewItem(listView1, undef);
> foreach $line (@array) {
>
> $item->setText(0, trUtf8("$line"));
> }
>
> but, this add's only last record from array.
>
> Help please.
>
> _______________________________________________
> Kde-perl mailing list
> [email protected]
> https://mail.kde.org/mailman/listinfo/kde-perl
=2D-=20
DUPUIS Arnaud
[ Infinity Perl ]
http://slackget.infinityperl.org
"Slackware : because it works"
slack-get : because it rocks !
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
gpg id : 0xAC37E1B0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--nextPart1181585.mNvKegfTBy
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQBFQdwsv5cIo6w34bARAiVkAJ4uMfiEsw/dGm5hbuTEJklcWiCpWwCdEfiF
P1fd6s69BkvzHagQpSRr90E=
=iMF6
-----END PGP SIGNATURE-----
--nextPart1181585.mNvKegfTBy--
--===============1120485846==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Kde-perl mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-perl
--===============1120485846==--