Hi all,
I'am writing an application that takes data from a sqlite database and show it thanks to a qtableview. I would like now to add a button export which export the data displayed in this view to a PDF file.
Here is the slot I wrote:

Qt Code:
  1. //Exporter la liste des utilisateurs
  2. void PageUser::genPdfUser()
  3. {
  4. QString filename="users.pdf";
  5. //Paramètres d'impression
  6. QPrinter printer(QPrinter::HighResolution);
  7. printer.setOutputFileName(filename);
  8. printer.setPaperSize(QPrinter::A4);
  9. printer.setOutputFormat(QPrinter::PdfFormat);
  10.  
  11. QPainter painter(&printer);
  12. painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
  13. m_userView->render( &painter );
  14. painter.end();
  15. }
To copy to clipboard, switch view to plain text mode 

It doesn't work because when I click the button, I have no reaction. Hindly help me to corect it.

thanks