PDA

View Full Version : QTableWidget crashing



therealjag
19th April 2006, 14:47
hey there i have set up a QTableWidget called demands and is set up with a signal and slot of the type below



connect(demands, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(obtain_values(QTableWidgetItem*)));


but when i try to add a item to the table from a seperate slot that i have using a button - the program crashes. when i take the line above out it adds the item no problem, but i need that line to get the data from the table....is there any way to get around this so that i can get data from the table and add items outside the constructor?

jacek
19th April 2006, 14:50
Maybe obtain_values() triggers the itemChanged() signal?

therealjag
19th April 2006, 15:07
yeah ur rite it actaully does, but i need that method to record the values in the table ..is there a way around it?

jacek
19th April 2006, 15:12
Why it must be connected to the itemChanged() signal?

therealjag
19th April 2006, 15:27
i need it because otherwise there is no way that the values get recorded. am i better of having a seperate button or something to record the values?

jacek
19th April 2006, 16:30
What does the obtain_values() method do? Does it read data into the QTableWidgetItem or store data from the QTableWidgetItem somewhere?