Hello,

I want to get the text of a cell of a tablewidget on my form.

I have already filled the tablewidget with new tablewidgetitems using setItem(), and all text is showing fine in my first test program.

Now i try to write a 'getter' function using the QTablewidget text() function like this :

Qt Code:
  1. QString CMainDialog::getTableText( int nRow, int nCol )
  2. {
  3. QString sResult="-";
  4. QTableWidgetItem *pCell = ui->tblPorts->item( nRow, nCol );
  5.  
  6. if( pCell!=NULL )
  7. sResult = pCell->text();
  8.  
  9. return sResult;
  10. }
To copy to clipboard, switch view to plain text mode 


Compiling goes fine, but then I get a linker error saying

mainDialog.obj:: error: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QTableWidgetItem::text(void)const " (__imp_?text@QTableWidgetItem@@QBE?AVQString@@XZ)

I am working with QtCreator and have Qt 4.6.3 statically linked with the MS VC compiler.

Has anyone already encountered this ? Or better yet, has a solution for this ?

Best regards,
Marc