[Qt-interest] QString from char* [] ?

Aaron Lewis the.warl0ck.1989 at gmail.com
Sun Oct 3 01:50:00 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, Constantin
> Does anything change if you replace
> ui->comboBox->addItems ( planets [i] );
It's actually addItem , not addItems , also i tried to grab a
QStringList firstly , same problem.
> with
> ui->comboBox->addItem(QString::fromLatin1(planets[i]));
> ?

No luck , still got segment fault as before. Arrays attached at end ,
see it's all lower cases.

>
> P.S.:
> Moon is neither a planet nor a star. It's a satellite. ;)

Oh , right , it's really hard to group all of my elements , maybe i
should just call them as purely
`objects'

Here comes definition of my .. objects

const char* planets[] = {
    "sun",
    "moon",
    "mercury",
    "venus",
    "mars",
    "jupiter",
    "saturn",
    "uranus",
    "neptune",
    "pluto",
    "ascendant",
    "decendant",
    "midheaven",
    "source node",
    "north node"
};

I don't know why QString fails to construct here ..


>
> On Saturday 02 October 2010 15:00:08 Aaron Lewis wrote:
>>
>> Hi, Thiago
>>>
>>> Can you post the backtrace of the crash and the valgrind log of it?
>> QString is
>>> crashing because some pointer is invalid, but we don't know which.
>>
>> 0 QString::fromLatin1_helper(char const*, int)
>> /usr/lib/qt4/libQtCore.so.4 0 0xb72784a0
>> 1 QString::fromAscii_helper(char const*, int)
>> /usr/lib/qt4/libQtCore.so.4 0 0xb727e754
>> 2 QString::QString(char const*) 0 0x0804b813
>> 3 Astrolog32ToolHelper::initPlanets() 0 0x0804b466
>> 4 Astrolog32ToolHelper::AsToolHelper(QWidget*) 0
>> 0x0804b3e1
>> 5 main 0 0x0804b1d5
>>
>> I tried to use loops dumping arrays , no problem with `cout' at all.
>>
>> What do you think this problem could be ? should i post all of code of
>> that function ( initPlanets ) ?
>>
>>>
>>> PS: neither the sun nor the moon are planets...
>> Oops , i was supposed to use a array called star instead , oh , thanks
>> for it ;-)
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest


- -- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E
Key Server: http://keyserver.veridis.com
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJMp8UoAAoJECSSp9Df5sKewFkQAMP5fQXU080kZ3/+Q3skIWIS
ucnf5l055HzGpmFDJ1huy8Qq8Mq4wv5QPHM3NwCcY0HO/u0w7x0ATk0Y1RSSRpB5
BwwZ8LUt1t3KqdvYHzN7P18TUuOx5z8w/x5tpC8qf8tBoszsK8gLkdynAJYuIwcU
NaIDQTPAJWS3gap6rkFKF7RuD49ea09NfUpmt1G0fZRrpwZnN0F1k4GkmqgyiFhO
0DRWrs8uPJm447JlYgO0omhHZonej2m2MjUehsfXZUCtSFLwtIioIMkdod6hgSA3
QUyujqSnLBCYZd9+sIk4KSki7VK2kTpiN3j9d8DbxOdkrsHPqWl0mCX5GZRIh+zn
irsbsAmCwcVikQlTQ/IebUAH8b7R8wg8uEsXfvEMlJ1NnHFfcwQsNqk/AGzVSMlJ
nmLf++jgldNNuOFv1UceKUin/wo2ig5RR2WBoaOa/PyT0KQhcU639tdAxK2/RQx9
EuaWTcZaMqiZSJrEoVH6x3RYDMtC50GDq1slaBOHLoEJiGuEhTeag79PgXn7bWcH
A+vBJTYg/RHl2jglm+/K/TelM0mu+El0Mtwq9wr5fqGegs0nd7jbluCTBwPzlYzv
CvLxE2c3BpRKd21mF8tqwsOmhZaWzRwdhMyNChJD32Kse7383SE9mTG5M3OYkSxn
5IlUS9SuTXZ64QYrvJmk
=n7b3
-----END PGP SIGNATURE-----




More information about the Qt-interest-old mailing list