There is a QTableView connected to a QSqlTableModel , this table also has delegates and a proxy model. Is it possible to print this table while preserving all this formatting?

enter image description here enter image description here

    1 answer 1

    For example:

     QString saveFileName = "table.pdf"; QPrinter printer; printer.setOutputFileName( saveFileName ); tableView.render( &printer ); 
    • Strange, but it uploads a cropped image to pdf. Apparently, customizes for A4, cutting - sm4ll_3gg
    • Plus are drawn skrolbary. Is it possible to export the entire table completely, and not just what is visible on the screen? - sm4ll_3gg
    • @ sm4ll_3gg, then I suggest this solution . There, a html is generated from a QTableView that is placed in a QTextDocument and it prints itself. It should print all pages without scrollbars :) - gil9red
    • Thank! I decided using this topic stackoverflow.com/questions/9769680/… - sm4ll_3gg