From: Joel Holdsworth Date: Sat, 13 Dec 2014 11:25:50 +0000 (+0000) Subject: ViewItem: Moved in paint_fore, paint_mid and paint_back X-Git-Tag: pulseview-0.3.0~353 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d4e39570ee6021766c375654801dddba45b9198a;p=pulseview.git ViewItem: Moved in paint_fore, paint_mid and paint_back --- diff --git a/pv/view/rowitem.cpp b/pv/view/rowitem.cpp index 185e03ab..5666168e 100644 --- a/pv/view/rowitem.cpp +++ b/pv/view/rowitem.cpp @@ -120,24 +120,6 @@ QPoint RowItem::point() const return QPoint(0, visual_v_offset()); } -void RowItem::paint_back(QPainter &p, const ViewItemPaintParams &pp) -{ - (void)p; - (void)pp; -} - -void RowItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp) -{ - (void)p; - (void)pp; -} - -void RowItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp) -{ - (void)p; - (void)pp; -} - void RowItem::hover_point_changed() { } diff --git a/pv/view/rowitem.hpp b/pv/view/rowitem.hpp index 6688bc5c..cf521ff0 100644 --- a/pv/view/rowitem.hpp +++ b/pv/view/rowitem.hpp @@ -25,7 +25,6 @@ #include -#include "viewitempaintparams.hpp" #include "viewitem.hpp" namespace pv { @@ -105,27 +104,6 @@ public: */ virtual std::pair v_extents() const = 0; - /** - * Paints the background layer of the trace with a QPainter - * @param p the QPainter to paint into. - * @param pp the painting parameters object to paint with. - **/ - virtual void paint_back(QPainter &p, const ViewItemPaintParams &pp); - - /** - * Paints the mid-layer of the trace with a QPainter - * @param p the QPainter to paint into. - * @param pp the painting parameters object to paint with. - **/ - virtual void paint_mid(QPainter &p, const ViewItemPaintParams &pp); - - /** - * Paints the foreground layer of the trace with a QPainter - * @param p the QPainter to paint into. - * @param pp the painting parameters object to paint with. - **/ - virtual void paint_fore(QPainter &p, const ViewItemPaintParams &pp); - /** * Paints the signal label. * @param p the QPainter to paint into. diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp index 0d83ee84..b3498ac1 100644 --- a/pv/view/viewitem.cpp +++ b/pv/view/viewitem.cpp @@ -85,6 +85,24 @@ QPen ViewItem::highlight_pen() Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); } +void ViewItem::paint_back(QPainter &p, const ViewItemPaintParams &pp) +{ + (void)p; + (void)pp; +} + +void ViewItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp) +{ + (void)p; + (void)pp; +} + +void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp) +{ + (void)p; + (void)pp; +} + QColor ViewItem::select_text_colour(QColor background) { return (background.lightness() > 64) ? Qt::black : Qt::white; diff --git a/pv/view/viewitem.hpp b/pv/view/viewitem.hpp index 6a78b1af..4c3df154 100644 --- a/pv/view/viewitem.hpp +++ b/pv/view/viewitem.hpp @@ -25,6 +25,8 @@ #include +#include "viewitempaintparams.hpp" + class QAction; class QMenu; class QWidget; @@ -95,6 +97,27 @@ public: */ virtual QRectF label_rect(const QRectF &rect) const = 0; + /** + * Paints the background layer of the item with a QPainter + * @param p the QPainter to paint into. + * @param pp the painting parameters object to paint with. + **/ + virtual void paint_back(QPainter &p, const ViewItemPaintParams &pp); + + /** + * Paints the mid-layer of the item with a QPainter + * @param p the QPainter to paint into. + * @param pp the painting parameters object to paint with. + **/ + virtual void paint_mid(QPainter &p, const ViewItemPaintParams &pp); + + /** + * Paints the foreground layer of the item with a QPainter + * @param p the QPainter to paint into. + * @param pp the painting parameters object to paint with. + **/ + virtual void paint_fore(QPainter &p, const ViewItemPaintParams &pp); + public: /** * Gets the text colour.