]> sigrok.org Git - pulseview.git/blobdiff - pv/view/rowitem.hpp
ViewItem: Use drag_point() with drag_by()
[pulseview.git] / pv / view / rowitem.hpp
index aca4fa83ecbb24bc4f372f25311e643b9a14c13c..023e2c3807b2c2d4e61bc6dd78e96591d9607cec 100644 (file)
 
 #include <QPropertyAnimation>
 
-#include "rowitempaintparams.hpp"
-#include "selectableitem.hpp"
+#include "viewitem.hpp"
 
 namespace pv {
 namespace view {
 
 class RowItemOwner;
 
-class RowItem : public SelectableItem,
+class RowItem : public ViewItem,
        public std::enable_shared_from_this<pv::view::RowItem>
 {
        Q_OBJECT
@@ -95,51 +94,22 @@ public:
        int get_visual_y() const;
 
        /**
-        * Gets the drag point of the row item.
+        * Drags the item to a delta relative to the drag point.
+        * @param delta the offset from the drag point.
         */
-       QPoint point() const;
+       void drag_by(const QPoint &delta);
 
        /**
-        * Computes the vertical extents of the contents of this row item.
-        * @return A pair containing the minimum and maximum y-values.
-        */
-       virtual std::pair<int, int> 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 RowItemPaintParams &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 RowItemPaintParams &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 RowItemPaintParams &pp);
-
-       /**
-        * Paints the signal label.
-        * @param p the QPainter to paint into.
+        * Gets the arrow-tip point of the row item marker.
         * @param rect the rectangle of the header area.
-        * @param hover true if the label is being hovered over by the mouse.
         */
-       virtual void paint_label(QPainter &p, const QRect &rect, bool hover) = 0;
+       QPoint point(const QRect &rect) const;
 
        /**
-        * Computes the outline rectangle of a label.
-        * @param rect the rectangle of the header area.
-        * @return Returns the rectangle of the signal label.
+        * Computes the vertical extents of the contents of this row item.
+        * @return A pair containing the minimum and maximum y-values.
         */
-       virtual QRectF label_rect(const QRectF &rect) const = 0;
+       virtual std::pair<int, int> v_extents() const = 0;
 
 public:
        virtual void hover_point_changed();