Important: Please read the Qt Code of Conduct -

[SOLVED] QPrinter help

  • can you show me how to print directly to a printer? just a simple data and print.

    i have no idea how to go using the QPrinter.


  • ready code available in Qt Sdk -> Demo -> Paint -> Font Sampler

  • First of all, printing is not trivial, especially deviding your content over multiple pages in a sane way is not aways easy. QPrinter is a QPaintDevice subclass. You can use all of QPainter's methods to paint on it. One simple way of printing some stuff, is to combine that with QTextDocument. That class features a print() method that takes care of most of the dirty stuff (including paginating) for you.

  • thanx... Font Sampler will do...

Log in to reply