qt-interest@trolltech.com
[Top] [All Lists]

[Qt-interest] [Qt-Interest] How can I print QGraphicsTextItem in MFC app

Subject: [Qt-interest] [Qt-Interest] How can I print QGraphicsTextItem in MFC application?
From: Long Cheng
Date: Wed, 23 Jun 2010 19:32:06 +0800
I have used QGraphicsTextItem in my MFC applications for text editing,
then converted the results to a bitmap to show in the view (screen).
But it has issues when printing. For example, if I print to a PDF
file, the text is not scalable since it is a bitmap and the file size
is also big.

How can I print the QGraphicsTextItem in the MFC printing framework?
The ideal solution is that we can hook QPrinter into the MFC printing
framework or I can initialize QPrinter with Win32 DC. MFC printing
framework has prepared printer and DC for me, so I don't need
QPrintDialog to do that task again. The code may something like this:

      QPrinter printer;
      printer.paintEngine()->setDC(myHDC); //**Note: this line is
imagined by me.
      QPainter painter(&printer);

Is that possible? Do I have to reimplement my own QPrinter? Scanning
QPrinter's source code, I found it very complex. I hope there is an
easy way to get my goal. If I have to implement my own QPrinter, what
should I need to notice? Can anyone give me some advices?

Thanks,
Long
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>