PDA

View Full Version : Passing QTableWidget values to another QWizard page



slava
29th June 2010, 02:28
Hello! I have checked some answers on that subject but still can't quite figure that out. Here is the question:

in a QWizard i have QTableWidget on one of the pages. I need take values of that QTableWidget, let's say item(1,1), get text ouf of it (->text) and publish it on the final page on a lineEdit. If that would be not a tableWidget but a lineEdit I would do: registerField("text", lineEdit) and then use this field("text") on the next page but it doesn't work with tableWidget.

Do I need to play around with setDefaultProperty or I need just extend my registerField line?

Please help!

slava
29th June 2010, 22:48
Okay, so I do:


ClassWizard::ClassWizard(QWidget *parent)
...

setDefaultproperty("QTabWidget", "item", SIGNAL(cellChanged(int, int)));

Then...


IntoPage::IntroPage(QWidget *parent)
...

registerField("myItem", tableWidget);

and then...


void SummaryPage::finalCalc()
{
...
QTableWidgetItem *finalItem = field("myItem".value<QTableWidgetItem *>();
...

}

That gives me buch of errors and doesn't work and that was my only idea on how to go about that.

slava
1st July 2010, 13:42
i Have better Idea)) Since I need to dump all the fields in the text file at the end, I crreated a textEdit on the page with tableWidget, made it unvisible and dumped everything from the tableWidget to the textEdit right on that page and then registered textEdit as a field to have an access to that from the last page. That worked for me, thanks.