Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/svgviewadapter.h
Show All 36 Lines | |||||
37 | namespace Gwenview | 37 | namespace Gwenview | ||
38 | { | 38 | { | ||
39 | 39 | | |||
40 | class SvgImageView : public AbstractImageView | 40 | class SvgImageView : public AbstractImageView | ||
41 | { | 41 | { | ||
42 | Q_OBJECT | 42 | Q_OBJECT | ||
43 | public: | 43 | public: | ||
44 | SvgImageView(QGraphicsItem* parent = 0); | 44 | SvgImageView(QGraphicsItem* parent = 0); | ||
45 | void setAlphaBackgroundMode(AlphaBackgroundMode mode) Q_DECL_OVERRIDE; | ||||
46 | void setAlphaBackgroundColor(const QColor& color) Q_DECL_OVERRIDE; | ||||
45 | 47 | | |||
46 | protected: | 48 | protected: | ||
47 | void loadFromDocument() Q_DECL_OVERRIDE; | 49 | void loadFromDocument() Q_DECL_OVERRIDE; | ||
48 | void onZoomChanged() Q_DECL_OVERRIDE; | 50 | void onZoomChanged() Q_DECL_OVERRIDE; | ||
49 | void onImageOffsetChanged() Q_DECL_OVERRIDE; | 51 | void onImageOffsetChanged() Q_DECL_OVERRIDE; | ||
50 | void onScrollPosChanged(const QPointF& oldPos) Q_DECL_OVERRIDE; | 52 | void onScrollPosChanged(const QPointF& oldPos) Q_DECL_OVERRIDE; | ||
51 | 53 | | |||
52 | private Q_SLOTS: | 54 | private Q_SLOTS: | ||
rkflx: I would make both functions `private`. | |||||
53 | void finishLoadFromDocument(); | 55 | void finishLoadFromDocument(); | ||
54 | 56 | | |||
55 | private: | 57 | private: | ||
56 | QGraphicsSvgItem* mSvgItem; | 58 | QGraphicsSvgItem* mSvgItem; | ||
59 | AbstractImageView::AlphaBackgroundMode mAlphaBackgroundMode; | ||||
rkflx: `int` → `AbstractImageView::AlphaBackgroundMode` | |||||
60 | QColor mAlphaBackgroundColor; | ||||
61 | bool mImageFullyLoaded; | ||||
62 | | ||||
57 | void adjustItemPos(); | 63 | void adjustItemPos(); | ||
64 | void drawAlphaBackground(QPainter* painter); | ||||
65 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; | ||||
58 | }; | 66 | }; | ||
59 | 67 | | |||
60 | struct SvgViewAdapterPrivate; | 68 | struct SvgViewAdapterPrivate; | ||
61 | class GWENVIEWLIB_EXPORT SvgViewAdapter : public AbstractDocumentViewAdapter | 69 | class GWENVIEWLIB_EXPORT SvgViewAdapter : public AbstractDocumentViewAdapter | ||
62 | { | 70 | { | ||
63 | Q_OBJECT | 71 | Q_OBJECT | ||
64 | public: | 72 | public: | ||
65 | SvgViewAdapter(); | 73 | SvgViewAdapter(); | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
I would make both functions private.