How to get data from QTableWidget?

I created a QTableWidget that contains the file name and its size. Now I need to get the file name from the TableWidget and save it in a file. Can someone help me how to do this ?, is there any function to extract text from a column?

+6
source share
1 answer

Try using the method

 QTableWidgetItem* item(int row, int column) const 

Used as follows:

 int row = 1; int col = 1; QTableWidgetItem* theItem = theTableWidget->item(row, col); 

and extract the text using the QTableWidgetItem method

 QString text () const 

Used as follows:

 QString theText = theItem->text(); 
+14
source

Source: https://habr.com/ru/post/905690/


All Articles