[Qt-interest] QTableWidget segmentation fault
Bijay Panda
bijay at analytica-india.com
Wed May 27 10:36:02 CEST 2009
Hi All,
I am using a QTableWidget in my application.When i click a widget(which is a
QgisMap Canvas from another class) a signal emitted sending a integer.I am
trying to put tha data in to a call of the table .The problem is when I
click that canvas i m getting the proper data here inside the slot.But when
i m trying to put that data in the table inside the same slot, it's giving
segmentation fault.Here is my code
void hookWindow:: createTable()
{
_tableHookWindow = new QTableWidget(10,5,this);
_tableHookWindow->setGeometry(1,label_msg->y()+label_msg->height(),width,height-label_msg->height());
_tableHookWindow->setColumnWidth( 0,width/4.5);
_tableHookWindow->setColumnWidth( 1,width/5 );
_tableHookWindow->setColumnWidth( 2,width/5 );
_tableHookWindow->show();
_addLabel<<"Track No" <<"Speed"<<"Height"<<"Hdng"<<"Idty";
_tableHookWindow->setHorizontalHeaderLabels(_addLabel );
item_trackNo= new QTableWidgetItem(QTableWidgetItem::Type);
item_trackSpeed = new QTableWidgetItem(QTableWidgetItem::Type);
}
void hookWindow::slot_getHookWindowData(int obj_id)
{
trackId = QString::number(obj_id);
cout<<"obj_id::"<<trackId.toAscii().data() <<endl;
// Here i am getting proper data when i click the widget
item_trackNo->setText(trackId);
_tableHookWindow->setItem(0,0,item_trackNo);
}
I tried it by putting hard core value also giving segmentation fault
But if i am setting value inside create table() then it's not a problem
there.
I want to set values to table inside that slot which collect values from
anothe class.
Can anyone please help me out.
--
Thanks & Regards
Bijay .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090527/91f1c2b8/attachment.html
More information about the Qt-interest-old
mailing list