X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fviewitem.cpp;h=7213f96d28657b5c9c19475048484d66052d9938;hb=8ce8ebb9796488bd2211591806ed00854ad64bb3;hp=6ad6f6b64fbb515eb3426e13d3806754e8f862cc;hpb=3cd51b5034d4d3086f1ffe829fa59772fd124152;p=pulseview.git
diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp
index 6ad6f6b..7213f96 100644
--- a/pv/view/viewitem.cpp
+++ b/pv/view/viewitem.cpp
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#include "viewitem.hpp"
@@ -27,7 +26,8 @@
#include
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QSizeF ViewItem::LabelPadding(4, 0);
const int ViewItem::HighlightRadius = 3;
@@ -49,6 +49,11 @@ void ViewItem::select(bool select)
selected_ = select;
}
+bool ViewItem::is_draggable() const
+{
+ return true;
+}
+
bool ViewItem::dragging() const
{
return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN;
@@ -56,7 +61,8 @@ bool ViewItem::dragging() const
void ViewItem::drag()
{
- drag_point_ = point(QRect());
+ if (is_draggable())
+ drag_point_ = point(QRect());
}
void ViewItem::drag_release()
@@ -70,9 +76,9 @@ QRectF ViewItem::label_rect(const QRectF &rect) const
return QRectF();
}
-QRectF ViewItem::hit_box_rect(const QRectF &rect) const
+QRectF ViewItem::hit_box_rect(const ViewItemPaintParams &pp) const
{
- (void)rect;
+ (void)pp;
return QRectF();
}
@@ -106,19 +112,19 @@ void ViewItem::paint_label(QPainter &p, const QRect &rect, bool hover)
(void)hover;
}
-void ViewItem::paint_back(QPainter &p, const ViewItemPaintParams &pp)
+void ViewItem::paint_back(QPainter &p, ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
}
-void ViewItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
+void ViewItem::paint_mid(QPainter &p, ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
}
-void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
+void ViewItem::paint_fore(QPainter &p, ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
@@ -129,5 +135,6 @@ QColor ViewItem::select_text_colour(QColor background)
return (background.lightness() > 110) ? Qt::black : Qt::white;
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv