Segmentation Fault in Qtablewidget
-
hi Every one Iam new to Qt
I am facing a problem of Segmentation due to which My application is stopingIn my application Iam having a QtableWidget
with 4 columns per Row and iam Adding Rows DynamicallyWhat my problem is Iam saving the data of Qtablewidget(i.e) Data in the cells of Qtablewidget
Some of my cells may have empty data
if No data in any columns it stoping the application
how to over come this problem
can any one helps in this?
Thanks in Advance -
Hi!
How do you write and read data from cells? Can you give some code?
And did you look at documentation?
"QTableWidget":http://qt-project.org/doc/qt-4.8/qtablewidget.html
"How to Use QTableWidget":http://qt-project.org/wiki/How_to_Use_QTableWidget -
Hi qxoz,
Thanks for replyI am directly writing the Data in the cell i.e(through keyboard)
and i am Reading the Data By Using Code:
QString Text =ui->tableWidget->item(row,4)->text();and I am Checking Whether Text is empty or not
if(!Text.isEmpty()) -
It seems row variable is at one point out of range, probably higher than row count, you should check why is this happening and add something like
@
if(table->rowCount()<=row)return;//or break if its loop
@
I am not sure if there is such function, if not just save row count as you create table in some int var.