PDA

View Full Version : QT crashes when trying to insert data into QTableWidgets



jonh
8th November 2012, 22:49
I have noticed a particularly weird feature when using QTableWidgets and I'm hoping there is an easy work-around or that I am missing something easy. Often times after creating new tables, QT will crash when you try to run a build where you insert information into the Table. One way to fix this is to double click on the table, go the "items" tab, click "properties" at the lower right, and make sure that each cell has a property where the word "text" is BOLD. If the word text is not bold, that cell will not accept data and it will cause a crash. So say you have a table that is 5 X5, that means you have to make sure that 25 cells have the word "text" bold before it will work properly. To make this "text" turn bold you must double click into each cell. It turns from regular to bold right then and the next time you run it will work properly (assuming you got all 25 cells, if you only get 24, crash). Is this a bug? Or is there a setting I am missing?

I have a table that has 10 rows and 1000 columns, I don't think I want to click 20,000 (10,000 cells each double clicked) times in order for my table to accept data....any ideas?


attached is a pic to help any confusion, its a hard issue to describe. Notice in the right section at the top how the word "text" is bold, and nothing else is. This is achieved by double clicking into the cell, prior it would have been regular and not bold. If I do not do this for each cell my build will crash. Even if I have to update only 1 cell, if ALL cells aren't fixed it will crash. 8399


HIGGZ BOSON
the quantum mechanic

norobro
9th November 2012, 00:23
When you add columns or rows to a QTableWidget in designer the cells are empty. I assume your program is crashing where you are doing some processing. If that is the case check to see if the cell has an item in it:
if( QTableWidget::item(row, column) != 0 )
//do something