You can also convert an image into a PDF using the QPdfWriter class provided by Qt. Essentially, you paint the selected image to the layout of a newly-created PDF document and set its resolution accordingly.
For more information about the QPdfWriter class, visit http://doc.qt.io/qt-5/qpdfwriter.html.