Variable has incomplete type 'QPrinter'
-
12-06-2021 - |
Question
I am trying to use QT in iOS.
#include <QtGui/qprinter.h>
QPrinter print;
Above code gives "Variable has incomplete type 'QPrinter'" error. Though QtGui/qprinter.h has complete definition for QPrinter. Any ideas how to resolve this problem?
Solution
The qprinter.h
file has this preprocessor condition before the definition of QPrinter
:
#ifndef QT_NO_PRINTER
// class QPrinter {
// ...
// }
#endif
Maybe on iOS QT_NO_PRINTER
is defined, perhaps because it is not supported? I can't find any official documentation that says as much, but it would be easy enough to test if that macro is defined in your build.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow