This adds a new method ViewItem::is_draggable(), which returns
true iff the view item is supposed to be draggable/movable.
Also, ViewItem::drag() is turned into a nop if the item is
not draggable.
selected_ = select;
}
+bool ViewItem::is_draggable() const
+{
+ return true;
+}
+
bool ViewItem::dragging() const
{
return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN;
void ViewItem::drag()
{
- drag_point_ = point(QRect());
+ if (is_draggable())
+ drag_point_ = point(QRect());
}
void ViewItem::drag_release()
*/
virtual void select(bool select = true);
+ /**
+ Returns true if the item may be dragged/moved.
+ */
+ virtual bool is_draggable() const;
+
/**
* Returns true if the item is being dragged.
*/