Changeset View
Changeset View
Standalone View
Standalone View
src/context/applets/analyzer/plugin/BlockRenderer.h
Show All 37 Lines | |||||
38 | class BlockRenderer : public QQuickFramebufferObject::Renderer | 38 | class BlockRenderer : public QQuickFramebufferObject::Renderer | ||
39 | { | 39 | { | ||
40 | public: | 40 | public: | ||
41 | static const int BLOCK_HEIGHT = BlockAnalyzer::BLOCK_HEIGHT; | 41 | static const int BLOCK_HEIGHT = BlockAnalyzer::BLOCK_HEIGHT; | ||
42 | 42 | | |||
43 | BlockRenderer() {} | 43 | BlockRenderer() {} | ||
44 | 44 | | |||
45 | protected: | 45 | protected: | ||
46 | QOpenGLFramebufferObject* createFramebufferObject(const QSize &size) Q_DECL_OVERRIDE | 46 | QOpenGLFramebufferObject* createFramebufferObject(const QSize &size) override | ||
47 | { | 47 | { | ||
48 | QOpenGLFramebufferObject* fo = new QOpenGLFramebufferObject(size); | 48 | QOpenGLFramebufferObject* fo = new QOpenGLFramebufferObject(size); | ||
49 | fo->setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); | 49 | fo->setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); | ||
50 | return fo; | 50 | return fo; | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | void render() Q_DECL_OVERRIDE | 53 | void render() override | ||
54 | { | 54 | { | ||
55 | QOpenGLPaintDevice d; | 55 | QOpenGLPaintDevice d; | ||
56 | d.setSize(framebufferObject()->size()); | 56 | d.setSize(framebufferObject()->size()); | ||
57 | QPainter p(&d); | 57 | QPainter p(&d); | ||
58 | 58 | | |||
59 | // Draw the background | 59 | // Draw the background | ||
60 | p.drawPixmap(QRect(QPoint(0, 0), framebufferObject()->size()), m_backgroundPixmap); | 60 | p.drawPixmap(QRect(QPoint(0, 0), framebufferObject()->size()), m_backgroundPixmap); | ||
61 | 61 | | |||
Show All 19 Lines | 66 | { | |||
81 | if (height > 0) | 81 | if (height > 0) | ||
82 | p.drawPixmap(x * (m_columnWidth + 1), 0, m_barPixmap, 0, 0, m_columnWidth, height); | 82 | p.drawPixmap(x * (m_columnWidth + 1), 0, m_barPixmap, 0, 0, m_columnWidth, height); | ||
83 | 83 | | |||
84 | // Draw top bar | 84 | // Draw top bar | ||
85 | p.drawPixmap(x * (m_columnWidth + 1), height + BLOCK_HEIGHT - 1, m_topBarPixmap); | 85 | p.drawPixmap(x * (m_columnWidth + 1), height + BLOCK_HEIGHT - 1, m_topBarPixmap); | ||
86 | } | 86 | } | ||
87 | } | 87 | } | ||
88 | 88 | | |||
89 | void synchronize(QQuickFramebufferObject *item) Q_DECL_OVERRIDE | 89 | void synchronize(QQuickFramebufferObject *item) override | ||
90 | { | 90 | { | ||
91 | auto analyzer = qobject_cast<BlockAnalyzer*>(item); | 91 | auto analyzer = qobject_cast<BlockAnalyzer*>(item); | ||
92 | if (!analyzer) | 92 | if (!analyzer) | ||
93 | return; | 93 | return; | ||
94 | 94 | | |||
95 | m_rows = analyzer->m_rows; | 95 | m_rows = analyzer->m_rows; | ||
96 | m_columnWidth = analyzer->m_columnWidth; | 96 | m_columnWidth = analyzer->m_columnWidth; | ||
97 | 97 | | |||
Show All 33 Lines |