projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9a37749
)
MarginWidget: Moved in dragging_, mouse_point_, and mouse_down_point_
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Tue, 9 Dec 2014 00:13:50 +0000
(
00:13
+0000)
committer
Uwe Hermann
<uwe@hermann-uwe.de>
Wed, 10 Dec 2014 17:06:16 +0000
(18:06 +0100)
pv/view/cursorheader.cpp
patch
|
blob
|
history
pv/view/cursorheader.hpp
patch
|
blob
|
history
pv/view/header.cpp
patch
|
blob
|
history
pv/view/header.hpp
patch
|
blob
|
history
pv/view/marginwidget.cpp
patch
|
blob
|
history
pv/view/marginwidget.hpp
patch
|
blob
|
history
diff --git
a/pv/view/cursorheader.cpp
b/pv/view/cursorheader.cpp
index e308867cfd9f0335850a83b309ae563ce9b810a8..f79a5785d558f56b54a60b37605614d08f9b16c9 100644
(file)
--- a/
pv/view/cursorheader.cpp
+++ b/
pv/view/cursorheader.cpp
@@
-47,7
+47,6
@@
int CursorHeader::calculateTextHeight()
CursorHeader::CursorHeader(View &parent) :
MarginWidget(parent),
CursorHeader::CursorHeader(View &parent) :
MarginWidget(parent),
- dragging_(false),
textHeight_(calculateTextHeight())
{
setMouseTracking(true);
textHeight_(calculateTextHeight())
{
setMouseTracking(true);
@@
-84,6
+83,8
@@
void CursorHeader::paintEvent(QPaintEvent*)
void CursorHeader::mouseMoveEvent(QMouseEvent *e)
{
void CursorHeader::mouseMoveEvent(QMouseEvent *e)
{
+ mouse_point_ = e->pos();
+
if (!(e->buttons() & Qt::LeftButton))
return;
if (!(e->buttons() & Qt::LeftButton))
return;
@@
-149,5
+150,11
@@
void CursorHeader::mouseReleaseEvent(QMouseEvent *)
i->drag_release();
}
i->drag_release();
}
+void CursorHeader::leaveEvent(QEvent*)
+{
+ mouse_point_ = QPoint(-1, -1);
+ update();
+}
+
} // namespace view
} // namespace pv
} // namespace view
} // namespace pv
diff --git
a/pv/view/cursorheader.hpp
b/pv/view/cursorheader.hpp
index f37112ec755aa57ab2d4df3434c514f631a3d332..5ae2a253fc6afcf0d556bd64d65eb5c8c37ea4c9 100644
(file)
--- a/
pv/view/cursorheader.hpp
+++ b/
pv/view/cursorheader.hpp
@@
-58,12
+58,11
@@
private:
void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *e);
void mousePressEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *);
+ void leaveEvent(QEvent*);
int calculateTextHeight();
int calculateTextHeight();
- QPoint mouse_down_point_;
std::shared_ptr<TimeItem> mouse_down_item_;
std::shared_ptr<TimeItem> mouse_down_item_;
- bool dragging_;
const int textHeight_;
};
const int textHeight_;
};
diff --git
a/pv/view/header.cpp
b/pv/view/header.cpp
index 4da188af70d916564d43b59264e490f81a67bbcb..837d1916c72a69f10e8e460cbc2296c2cc88408d 100644
(file)
--- a/
pv/view/header.cpp
+++ b/
pv/view/header.cpp
@@
-60,8
+60,7
@@
static bool item_selected(shared_ptr<RowItem> r)
}
Header::Header(View &parent) :
}
Header::Header(View &parent) :
- MarginWidget(parent),
- dragging_(false)
+ MarginWidget(parent)
{
setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true);
{
setFocusPolicy(Qt::ClickFocus);
setMouseTracking(true);
diff --git
a/pv/view/header.hpp
b/pv/view/header.hpp
index 662e19f2ed5027d773d55a1badc9ff7a81a0c48e..ae39bc847490357877ed380ec99456073f849a1f 100644
(file)
--- a/
pv/view/header.hpp
+++ b/
pv/view/header.hpp
@@
-88,10
+88,7
@@
Q_SIGNALS:
void signals_moved();
private:
void signals_moved();
private:
- QPoint mouse_point_;
- QPoint mouse_down_point_;
std::shared_ptr<RowItem> mouse_down_item_;
std::shared_ptr<RowItem> mouse_down_item_;
- bool dragging_;
};
} // namespace view
};
} // namespace view
diff --git
a/pv/view/marginwidget.cpp
b/pv/view/marginwidget.cpp
index f3abe361feedae833531f7d54529f9e902c4a3bd..e44233c80291c8a1cb1bdd2a5078ef9d505d6211 100644
(file)
--- a/
pv/view/marginwidget.cpp
+++ b/
pv/view/marginwidget.cpp
@@
-27,7
+27,8
@@
namespace view {
MarginWidget::MarginWidget(View &parent) :
QWidget(&parent),
MarginWidget::MarginWidget(View &parent) :
QWidget(&parent),
- view_(parent)
+ view_(parent),
+ dragging_(false)
{
setAttribute(Qt::WA_NoSystemBackground, true);
}
{
setAttribute(Qt::WA_NoSystemBackground, true);
}
diff --git
a/pv/view/marginwidget.hpp
b/pv/view/marginwidget.hpp
index 9ff4276b0dd6dc173400d171d811624198381c49..b4f0eb72c45e84abc4703a5b3e46f8031aca7e0a 100644
(file)
--- a/
pv/view/marginwidget.hpp
+++ b/
pv/view/marginwidget.hpp
@@
-21,6
+21,7
@@
#ifndef PULSEVIEW_PV_MARGINWIDGET_H
#define PULSEVIEW_PV_MARGINWIDGET_H
#ifndef PULSEVIEW_PV_MARGINWIDGET_H
#define PULSEVIEW_PV_MARGINWIDGET_H
+#include <QPoint>
#include <QWidget>
namespace pv {
#include <QWidget>
namespace pv {
@@
-43,6
+44,9
@@
Q_SIGNALS:
protected:
pv::view::View &view_;
protected:
pv::view::View &view_;
+ QPoint mouse_point_;
+ QPoint mouse_down_point_;
+ bool dragging_;
};
} // namespace view
};
} // namespace view