excelqtqtableviewqt4.7qpushbutton

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..


Solution

  • 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.