Hi!

I have a strange crash in my program build with QtCreator , last version x86_64 Linux OS.
It crashes when is called the funcion setBackgroundColor:

Obj = ui->Box->item(i);

if(Obj == NULL)
{
cout << "[%%]" << "NULL OBJECT GET FROM QListn";
return 0;
}

Obj -> setBackgroundColor(Qt::green); <---CRASH

The Oby variabe is a QListWidgetItem. Null pointer check is done so it's not a pointer problem.
The Box variable is a QListWidget that contains the QListWidgetItem allocated in this manner:

for(i = 0 ; i < NUM ;i++)
{
ui->Box->addItem( (new QListWidgetItem((ui->Box) , 0)) );
}

in costructor of the class. Other problem is that if i comment the setBackgroundColor function then the program crash in function append of QString class:

MyString = new QString(tstring -> c_str());
ui->TextEdit->append(*MyString);

Other strange stuff it's that if i run the program with the integrated debugger or valgrind the program run WITHOUT crash.

Any help is appreciated

_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to