qwt_plot_svgitem.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
  2. * Qwt Widget Library
  3. * Copyright (C) 1997 Josef Wilgen
  4. * Copyright (C) 2002 Uwe Rathmann
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the Qwt License, Version 1.0
  8. *****************************************************************************/
  9. #ifndef QWT_PLOT_SVGITEM_H
  10. #define QWT_PLOT_SVGITEM_H
  11. #include "qwt_global.h"
  12. #include "qwt_plot_item.h"
  13. #include <qstring.h>
  14. class QSvgRenderer;
  15. class QByteArray;
  16. /*!
  17. \brief A plot item, which displays
  18. data in Scalable Vector Graphics (SVG) format.
  19. SVG images are often used to display maps
  20. */
  21. class QWT_EXPORT QwtPlotSvgItem: public QwtPlotItem
  22. {
  23. public:
  24. explicit QwtPlotSvgItem( const QString& title = QString() );
  25. explicit QwtPlotSvgItem( const QwtText& title );
  26. virtual ~QwtPlotSvgItem();
  27. bool loadFile( const QRectF&, const QString &fileName );
  28. bool loadData( const QRectF&, const QByteArray & );
  29. virtual QRectF boundingRect() const;
  30. virtual void draw( QPainter *,
  31. const QwtScaleMap &xMap, const QwtScaleMap &yMap,
  32. const QRectF &canvasRect ) const;
  33. virtual int rtti() const;
  34. protected:
  35. const QSvgRenderer &renderer() const;
  36. QSvgRenderer &renderer();
  37. void render( QPainter *,
  38. const QRectF &viewBox, const QRectF &rect ) const;
  39. QRectF viewBox( const QRectF &rect ) const;
  40. private:
  41. void init();
  42. class PrivateData;
  43. PrivateData *d_data;
  44. };
  45. #endif