日志
Mac osx下调用打印窗口
2014-02-14 10:09
今日群中,有人提到mac下面打印对话框无法使用的问题,遂查阅资料,几经周折,终得正果,于是再此分享一二,以便后续者不在受此困扰
一般mac下报错为:QPrintDialog: Cannot be used on non-native printers 查阅http://stackoverflow.com/questions/8296021/how-to-print-pdf-file-in-qt 另外还找到qt bug系统中有解决办法https://bugreports.qt-project.org/browse/QTBUG-28822 斟酌再三,得解: The issue resolved finally. 1. The Output format for QPrinter object should be set to Native format before creating instance for QPrintDialog. It can avoid to show the message as above. 2. The Print Support plugin should be set in the .pro file and also imported with Q_IMPORT_PLUGIN() function if it is static build. 示例代码如下:
|
下一篇: 基于Qwt的Qt客户端
上一篇: Qt只运行一个实例