SIGSEGV tableitem->text()
I have to write a funktion which is matching the content between a QTreeWidget and the QTableWidget.
I’m pretty sure i got the same problem like here http://lists.trolltech.com/qt-interest/2006-02/thread01488-0.html
I try it with that if clause if(!tableitem) but the error appears anyway. The findItems functions works great and the text() function in the top works great too. I follow the behavior in the debugger a couple of times and all the time it is the tableitem which i used in the top too. The treeitem is not the problem. After the erros appears the debugger jump into qtablewidget.h.
Here is a picture of the data with the debugger
http://imageshack.us/photo/my-images/835/bildschirmfotoam2012011.png
- //qtablewidget.h line 107
- QList<QTreeWidgetItem*> treelist=ui->treeMux->findItems("PORT ",Qt::MatchContains| Qt::MatchRecursive,0);
- {
- if(!tableitem)
- {continue;}
- else
- {
- if(tableitem->row()==0)
- {
- muxmaker->set_vects1(tableitem->column(),tableitem->text()); // HERE IT WORKS!
- ts1--;
- }
- if(tableitem->row()==1)
- {
- muxmaker->set_vects2(tableitem->column(),tableitem->text()); // HERE IT WORKS TOO!
- ts2--;
- }
- {
- if(treeitem->text(0).contains(tableitem->text())) // HERE IS THE ERROR WITH tableitem->text()
- }
- }
- }
The problem have to be so simple that i couldnt see it …. please excuse me fo my foolery
1 reply
ops…..in the debugger picture you wil see a variable called strr , i add the variable to see if it is the treeitem or the tableitem…here is the code it will explain “everyting”
- if(strr.contains(tableitem->text()))
if i try this it crashs
if i try this it works
- cout<<tableitem->text().toStdString()<<endl;
What is the problem?? Maybe it is the Display Role?? or something like else?
You must log in to post a reply. Not a member yet? Register here!
