Project

General

Profile

Converting a QT graphing library to a wtCharting Widget

Added by takashi yamamoto over 14 years ago

I have a QT charting library, which I would like to use in my web pages. I would like to do all the work at the backend (i.e. the actual drawing etc), - but I want to be able to respond to certain events (like a right hand mouse click - to display a dynamic menu) at the client end.

I am completely new to wt, and I would be very grateful if someone could tell me the steps needed to convert/use my charting library as wt Charting widget.


Replies (4)

RE: Converting a QT graphing library to a wtCharting Widget - Added by Koen Deforche over 14 years ago

Hey,

As to the graphics output, you have a number of options:

1) convert your graphing library to use Wt's WPainter and WPaintDevices instead of Qt's QPainter and QPaintDevices. Wt supports a very similar API for these classes. The benefit here is that you will be able to render in high resolution with high efficiency because this uses a vector graphics format.

2) use the Qt library and the current Qt charting library implementation to render to a PNG/GIF file, and serve this is as an image.

As to reacting to certain events, you can catch mouse clicks on a WPaintedWidget (option 1) or a WImage (option 2), and react to those events in any way you like, including showing a WPopupMenu.

Regards,

koen

RE: Converting a QT graphing library to a wtCharting Widget - Added by takashi yamamoto over 14 years ago

Koen,

Thanks very much. This is all I needed to know. Thanks for a fantastic library!

RE: Converting a QT graphing library to a wtCharting Widget - Added by takashi yamamoto over 14 years ago

Koen,

Regarding option 2 in your response above:

Is there a way to serve the QT PNG/GIF image from memory directly (rather than save to disk file/read from disk) ?

Thanks

RE: Converting a QT graphing library to a wtCharting Widget - Added by Koen Deforche over 14 years ago

Hey Takashi,

Yes you can serve it from memory, and you can even compute it on the fly. The best approach to do both is to specialize WResource, following the template of http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WResource.html

Regards,

koen

    (1-4/4)