[KDE-India] Printing a Widget

Prashanth Udupa prashanth.udupa at gmail.com
Sun Dec 24 07:51:35 CET 2006


Hi,

You can take a look at QPixmap::grabWidget() for this. This function helps
capture a snapshot of the widget into a pixmap which you can print
on to a QPrinter object using a QPainter.

If you want to print a graphics scene. You can use the QGraphicsScene::render()
function. The documentation for this function has a printing example.

Regards,
Prashanth

On 12/24/06, Tejas Dinkar <tejasdinkar at gmail.com> wrote:
> I'm designing an app where I want to draw some shapes on a widget, and
> then be able to either
> 1) Print out what that widget looks like
> 2) Export that widget to an image file.
>
> Any ideas what widget I may be able to use? QGraphicsView doesn't have
> any export options that I can see.
>
> Any ideas where I should be looking?
>
> Or is there some other way which I should be doing this?
> --
> Tejas Dinkar
> http://gja.in
> _______________________________________________
> KDE-india mailing list
> KDE-india at kde.org
> https://mail.kde.org/mailman/listinfo/kde-india
>


-- 
Thanks and Warm Regards,
Prashanth N Udupa
     EMail:      prashanth.udupa at gmail.com
     Website: http://www.prashanthudupa.com
     LJ: http://prashanthudupa.livejournal.com/


More information about the KDE-india mailing list