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

Constantin Makshin cmakshin at gmail.com
Sat Oct 2 17:40:46 CEST 2010


Does anything change if you replace
ui->comboBox->addItems ( planets [i] );
with
ui->comboBox->addItem(QString::fromLatin1(planets[i]));
?

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

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 ;-)



More information about the Qt-interest-old mailing list