Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt - how to save my QTableView as a Excel File?

Can anyone plz help me, how to save my QtableView as a Excel File. I have a QTableView and a QPushButton (Save Button). If i enter the values in my QtableView and if i click the Save Buttton the QTableView items should be saved as Excel File. Plz Help me. Thanks..

like image 902
New Moon Avatar asked Sep 27 '12 05:09

New Moon


1 Answers

Have a look at this thread My-approach-to-export-QTableView-data-to-a-Microsoft-Excel-file. I got this link by asking Google for: QTableView save. For the solution there you need a Qt with ODBC enabled which is not the default.

You can also study the fine documentation that contains e.g. an Address Book Example that includes a writeToFile function. You can start from there and search e.g. for information about the CSV format.

like image 88
hmuelner Avatar answered Oct 11 '22 14:10

hmuelner