What if we also gave a means to our user to export the comic script as a PDF to preserve the nice formatting?
It turns out that this can be done fairly easily with Qt's printsupport module. To enable this functionality, we will need to add the printsupport module to ccscripter.pro:
# ccscripter.proQT += core guiQT += printsupport
Once this is done, we can add a new QAction to the File QMenu in mainwindow.ui, change the action's name object name to actionExportPdf, and point to it in main.cpp:
// ccscripter/main.cpp...auto actionExportPdf = w.ui->actionExportPdf;...
Performing the PDF export can be done via the following steps:
- Choose a destination file path with a QFileDialog, as we have done for the text ...