PDA

View Full Version : Combining QPainter and WinAPI drawing



kkk777kkk
6th July 2011, 09:20
I need to print some document which constist of table (in html) and pdf.
I have realization which worked in qt3 but some problems in qt4:
Table draws by QPainter and QTextDocument.
And then i receive HDC from QPainter "painter->paintEngine()->getDC()" and draw other stuff by WinAPI functions: some needed lines by MoveToEx and LineTo; converting pdf to eps and sending it data using ExtEscape function.
If i QPainter.begin() before drawing table and end() it after drawing table that tables draws OK and sent to Printer but WinAPI drawing falls.
And if i end() it after drawing WinAPI lines and pdf i can't see table which QPainter should draw. First time i think that postscript routine block other drawing at all but MoveToEx and LineTo drawn before "Initial" and "End" blocks of postsript sent to printer and i see resulting lines of this functions.

Help me please solve this trouble :confused:

mcosta
6th July 2011, 12:00
Why you mix QPainter and WinAPI?

With QPainter you ca draw lines (QPainter::drawLine) and print on PDF and PS files using QPrinter::OutputFormat-enum

kkk777kkk
6th July 2011, 14:16
If you mean that i need to use QPrinter to print my html table in PS file and then use it with my PS file (that i receive from PDF converting). I do it but it needs good PS language knowledge to solve problems and combine two finilized PS documents.



Why you mix QPainter and WinAPI?

I use QPainter because it is very convenient to draw HTML with it and i use WinAPI because only it can send my EPS file to printer