Changeset View
Changeset View
Standalone View
Standalone View
lib/documentview/rasterimageview.h
Show All 35 Lines | |||||
36 | 36 | | |||
37 | class AbstractRasterImageViewTool; | 37 | class AbstractRasterImageViewTool; | ||
38 | 38 | | |||
39 | struct RasterImageViewPrivate; | 39 | struct RasterImageViewPrivate; | ||
40 | class GWENVIEWLIB_EXPORT RasterImageView : public AbstractImageView | 40 | class GWENVIEWLIB_EXPORT RasterImageView : public AbstractImageView | ||
41 | { | 41 | { | ||
42 | Q_OBJECT | 42 | Q_OBJECT | ||
43 | public: | 43 | public: | ||
44 | enum AlphaBackgroundMode { | | |||
45 | AlphaBackgroundCheckBoard, | | |||
46 | AlphaBackgroundSolid | | |||
47 | }; | | |||
48 | | ||||
49 | RasterImageView(QGraphicsItem* parent = 0); | 44 | RasterImageView(QGraphicsItem* parent = 0); | ||
50 | ~RasterImageView(); | 45 | ~RasterImageView(); | ||
51 | 46 | | |||
52 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) Q_DECL_OVERRIDE; | 47 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) Q_DECL_OVERRIDE; | ||
53 | 48 | | |||
54 | void setCurrentTool(AbstractRasterImageViewTool* tool); | 49 | void setCurrentTool(AbstractRasterImageViewTool* tool); | ||
55 | AbstractRasterImageViewTool* currentTool() const; | 50 | AbstractRasterImageViewTool* currentTool() const; | ||
56 | 51 | | |||
57 | void setAlphaBackgroundMode(AlphaBackgroundMode mode); | 52 | void setAlphaBackgroundMode(AlphaBackgroundMode mode) override; | ||
58 | void setAlphaBackgroundColor(const QColor& color); | 53 | void setAlphaBackgroundColor(const QColor& color) override; | ||
rkflx: AFAIK we can now assume usage of a C++11 compiler, so you could directly use `override` in new… | |||||
TIL, thanks. huoni: TIL, thanks.
In these situations, is it beneficial to submit a patch changing all the old code? | |||||
At some point we could run tools like Clazy and clang-tidy over the whole code base and apply their automated fix-ups (and replace Q_DECL_OVERRIDE manually as well). Of course this makes git blame harder to use, which is also the reason to prefer the new style for new code righ away or when a line of code is touched anyway. rkflx: At some point we could run tools like Clazy and clang-tidy over the whole code base and apply… | |||||
59 | void setRenderingIntent(const RenderingIntent::Enum& renderingIntent); | 54 | void setRenderingIntent(const RenderingIntent::Enum& renderingIntent); | ||
60 | 55 | | |||
61 | Q_SIGNALS: | 56 | Q_SIGNALS: | ||
62 | void currentToolChanged(AbstractRasterImageViewTool*); | 57 | void currentToolChanged(AbstractRasterImageViewTool*); | ||
63 | void imageRectUpdated(); | 58 | void imageRectUpdated(); | ||
64 | 59 | | |||
65 | protected: | 60 | protected: | ||
66 | void loadFromDocument() Q_DECL_OVERRIDE; | 61 | void loadFromDocument() Q_DECL_OVERRIDE; | ||
Show All 27 Lines |
AFAIK we can now assume usage of a C++11 compiler, so you could directly use override in new code.