[IOS] undefine qt_no_printer on IOS
-
Hi,
Do you mean you want to build Qt for iOS with printing support ?
-
We are building an application that needs printing support. The application compiles on windows/linux/macos/android. We are now trying to compile the application on iOS. When we choose iOS toolkit to compile the application, file qprinterinfo.h (for example) has a #ifndef QT_NO_PRINTER block and everything inside is grayed out (on Qt creator) because the QT_NO_PRINTER is defined.
Since our application needs some form of printing (create pdf, AirPrint), the idea was to create a plugin for iOS based on the cocoa print plugin.
-
@sftpck said in [IOS] undefine qt_no_printer on IOS:
Since our application needs some form of printing (create pdf, AirPrint), the idea was to create a plugin for iOS based on the cocoa print plugin.
IIRC QPdfWriter works on all platforms.
-
@J.Hilk said in [IOS] undefine qt_no_printer on IOS:
IIRC QPdfWriter works on all platforms.
But that means we would need to change our code in order to replace everything print related to support a specific iOS case.
Is it possible to compile Qt framework for iOS with printing support?
-
Wait, the fact that Qt Creator shows something grayed out doesn't mean it is necessary disabled when you build it. Qt Creator doesn't necessarily find everything that allows it to do the highlighting propel.
After a quick check of the
printsupport
module, I haven't seen anything disabling it for iOS (I may have missed something though). If you want to check whether your modifications are building, put some blatant error in the code or are an#error
statement in it and compile Qt. -
It doesn't build. I don't have the machine with me right now, but with a new project and this sample code https://doc.qt.io/qt-5/qprinter.html#isValid I can compile without any problems with macos kit, but changing to iOS kit, I get compile errors. (and inspecting the header https://github.com/qt/qtbase/blob/5.12/src/printsupport/kernel/qprinter.h, everything inside #ifndef QT_NO_PRINTER block is grayed out with iOS kit, but not with macOS kit)
-
@sftpck said in [IOS] undefine qt_no_printer on IOS:
QT_NO_PRINTER
You have to modify
qtbase/src/printsupport/configure.json
so that the tests are run for iOS and maybe pass without other modifications.