PdQmlWidgets  2.0.0
LiveSvg.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 **
4 ****************************************************************************/
5 
6 #ifndef PD_LIVESVG_H
7 #define PD_LIVESVG_H
8 
9 #include <QScopedPointer>
10 #include <QString>
11 #include <QSize>
12 #include <QPixmap>
13 #include <QSizeF>
14 #include <QPointF>
15 #include <QPainter>
16 #include <QtQuick/QQuickPaintedItem>
17 
18 namespace PdQmlWidgets {
19 class LiveSvgPrivate;
20 
21 class Q_DECL_EXPORT LiveSvg: public QQuickPaintedItem
22 {
23  Q_OBJECT
24 
25  Q_PROPERTY(QRectF viewBox READ getViewBox NOTIFY viewBoxChanged)
26  Q_PROPERTY(QString source READ getSource WRITE setSource NOTIFY
27  sourceChanged) // Image
28  Q_PROPERTY(
29  bool invert READ getInvert WRITE setInvert NOTIFY invertedChanged)
30  public:
31  LiveSvg(QQuickItem *parent = 0);
32  ~LiveSvg();
33 
34  void paint(QPainter *painter);
35  Q_INVOKABLE QVariant getOverlayElements() const;
36  Q_INVOKABLE QString getSource() const;
37 
38  Q_INVOKABLE void changeAttribute(QString, QString, QString);
39  bool getInvert() const;
40  void setInvert(bool);
41  void setSource(const QString &s);
42  void clearSource();
43 
44  QRectF getViewBox() const;
45  // public slots:
46 
47  signals:
48  void scaleChanged(QSizeF scale);
49  void viewBoxChanged();
50  void sourceChanged();
51  void invertedChanged();
52 
53  private:
54  void updateBackgroundPixmap();
55  Q_DECLARE_PRIVATE(LiveSvg);
56 
57  QScopedPointer<LiveSvgPrivate> const d_ptr;
58 
59  Q_DISABLE_COPY(LiveSvg)
60 };
61 
62 /****************************************************************************/
63 
64 } // namespace PdQmlWidgets
65 
66 #endif
Definition: LiveSvg.h:21
Definition: LiveSvg.h:18