CursorHeader::CursorHeader(View &parent) :
MarginWidget(parent),
- dragging_(false),
textHeight_(calculateTextHeight())
{
setMouseTracking(true);
void CursorHeader::mouseMoveEvent(QMouseEvent *e)
{
+ mouse_point_ = e->pos();
+
if (!(e->buttons() & Qt::LeftButton))
return;
i->drag_release();
}
+void CursorHeader::leaveEvent(QEvent*)
+{
+ mouse_point_ = QPoint(-1, -1);
+ update();
+}
+
} // namespace view
} // namespace pv
void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *);
+ void leaveEvent(QEvent*);
int calculateTextHeight();
- QPoint mouse_down_point_;
std::shared_ptr<TimeItem> mouse_down_item_;
- bool dragging_;
const int textHeight_;
};
}
Header::Header(View &parent) :
- MarginWidget(parent),
- dragging_(false)
+ MarginWidget(parent)
{
setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true);
void signals_moved();
private:
- QPoint mouse_point_;
- QPoint mouse_down_point_;
std::shared_ptr<RowItem> mouse_down_item_;
- bool dragging_;
};
} // namespace view
MarginWidget::MarginWidget(View &parent) :
QWidget(&parent),
- view_(parent)
+ view_(parent),
+ dragging_(false)
{
setAttribute(Qt::WA_NoSystemBackground, true);
}
#ifndef PULSEVIEW_PV_MARGINWIDGET_H
#define PULSEVIEW_PV_MARGINWIDGET_H
+#include <QPoint>
#include <QWidget>
namespace pv {
protected:
pv::view::View &view_;
+ QPoint mouse_point_;
+ QPoint mouse_down_point_;
+ bool dragging_;
};
} // namespace view