projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3f4432
)
TimeMarker: Renamed get_label_rect, and made it take a const QRectF&
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sun, 7 Dec 2014 10:59:52 +0000
(10:59 +0000)
committer
Uwe Hermann
<uwe@hermann-uwe.de>
Wed, 10 Dec 2014 17:06:16 +0000
(18:06 +0100)
pv/view/cursor.cpp
patch
|
blob
|
history
pv/view/cursor.hpp
patch
|
blob
|
history
pv/view/cursorheader.cpp
patch
|
blob
|
history
pv/view/cursorpair.cpp
patch
|
blob
|
history
pv/view/cursorpair.hpp
patch
|
blob
|
history
pv/view/timemarker.cpp
patch
|
blob
|
history
pv/view/timemarker.hpp
patch
|
blob
|
history
diff --git
a/pv/view/cursor.cpp
b/pv/view/cursor.cpp
index 836d0e93d758fd911e371ef5383eda291ffa41c6..5f33416050d721b21af2b00835dc341259aeb391 100644
(file)
--- a/
pv/view/cursor.cpp
+++ b/
pv/view/cursor.cpp
@@
-55,7
+55,7
@@
QString Cursor::get_text() const
return pv::util::format_time(time_, view_.tick_prefix(), 2);
}
return pv::util::format_time(time_, view_.tick_prefix(), 2);
}
-QRectF Cursor::
get_label_rect(const QRect
&rect) const
+QRectF Cursor::
label_rect(const QRectF
&rect) const
{
const shared_ptr<Cursor> other(get_other_cursor());
assert(other);
{
const shared_ptr<Cursor> other(get_other_cursor());
assert(other);
diff --git
a/pv/view/cursor.hpp
b/pv/view/cursor.hpp
index b23bd642b47130446a21b8fcf7b67c812acb7dc5..03b97a17789e948e4062dc44f484274d238fdcc7 100644
(file)
--- a/
pv/view/cursor.hpp
+++ b/
pv/view/cursor.hpp
@@
-63,7
+63,7
@@
public:
* @param rect The rectangle of the ruler client area.
* @return Returns the label rectangle.
*/
* @param rect The rectangle of the ruler client area.
* @return Returns the label rectangle.
*/
- QRectF
get_label_rect(const QRect
&rect) const;
+ QRectF
label_rect(const QRectF
&rect) const;
private:
std::shared_ptr<Cursor> get_other_cursor() const;
private:
std::shared_ptr<Cursor> get_other_cursor() const;
diff --git
a/pv/view/cursorheader.cpp
b/pv/view/cursorheader.cpp
index 076b2a7fc2ecd677ea12b99e16d08f7f3f1c2910..2835750b9647bcd2a5fd41a490cb13dadbafb7db 100644
(file)
--- a/
pv/view/cursorheader.cpp
+++ b/
pv/view/cursorheader.cpp
@@
-108,10
+108,10
@@
void CursorHeader::mousePressEvent(QMouseEvent *e)
if (view_.cursors_shown()) {
shared_ptr<CursorPair> cursors(view_.cursors());
if (view_.cursors_shown()) {
shared_ptr<CursorPair> cursors(view_.cursors());
- if (cursors->first()->
get_
label_rect(
+ if (cursors->first()->label_rect(
rect()).contains(e->pos()))
grabbed_marker_ = cursors->first();
rect()).contains(e->pos()))
grabbed_marker_ = cursors->first();
- else if (cursors->second()->
get_
label_rect(
+ else if (cursors->second()->label_rect(
rect()).contains(e->pos()))
grabbed_marker_ = cursors->second();
}
rect()).contains(e->pos()))
grabbed_marker_ = cursors->second();
}
diff --git
a/pv/view/cursorpair.cpp
b/pv/view/cursorpair.cpp
index 0370793d0407b9a9d8db11dc55e592f50ef53732..8a0ecbf20b14c618ed587645f90b91a24cd69805 100644
(file)
--- a/
pv/view/cursorpair.cpp
+++ b/
pv/view/cursorpair.cpp
@@
-70,7
+70,7
@@
pv::widgets::Popup* CursorPair::create_popup(QWidget *parent)
return nullptr;
}
return nullptr;
}
-QRectF CursorPair::
get_label_rect(const QRect
&rect) const
+QRectF CursorPair::
label_rect(const QRectF
&rect) const
{
const QSizeF label_size(
text_size_.width() + View::LabelPadding.width() * 2,
{
const QSizeF label_size(
text_size_.width() + View::LabelPadding.width() * 2,
@@
-98,7
+98,7
@@
void CursorPair::draw_markers(QPainter &p, const QRect &rect)
const unsigned int prefix = view_.tick_prefix();
compute_text_size(p, prefix);
const unsigned int prefix = view_.tick_prefix();
compute_text_size(p, prefix);
- QRectF delta_rect(
get_
label_rect(rect));
+ QRectF delta_rect(label_rect(rect));
const int radius = delta_rect.height() / 2;
const QRectF text_rect(delta_rect.intersected(
const int radius = delta_rect.height() / 2;
const QRectF text_rect(delta_rect.intersected(
diff --git
a/pv/view/cursorpair.hpp
b/pv/view/cursorpair.hpp
index 12ed76af9ce18012a74a18456cb889c292163e54..78780916504cda37434c641b9c0da6c001745a46 100644
(file)
--- a/
pv/view/cursorpair.hpp
+++ b/
pv/view/cursorpair.hpp
@@
-65,7
+65,7
@@
public:
pv::widgets::Popup* create_popup(QWidget *parent);
public:
pv::widgets::Popup* create_popup(QWidget *parent);
public:
- QRectF
get_label_rect(const QRect
&rect) const;
+ QRectF
label_rect(const QRectF
&rect) const;
void draw_markers(QPainter &p, const QRect &rect);
void draw_markers(QPainter &p, const QRect &rect);
diff --git
a/pv/view/timemarker.cpp
b/pv/view/timemarker.cpp
index 34b2699bd6722fe9b5f3b169266f3341eb3eabad..eebac024cca0c81608d5452a560544e235081813 100644
(file)
--- a/
pv/view/timemarker.cpp
+++ b/
pv/view/timemarker.cpp
@@
-87,7
+87,7
@@
void TimeMarker::paint(QPainter &p, const QRect &rect)
p.drawLine(QPointF(x, rect.top()), QPointF(x, rect.bottom()));
}
p.drawLine(QPointF(x, rect.top()), QPointF(x, rect.bottom()));
}
-QRectF TimeMarker::
get_label_rect(const QRect
&rect) const
+QRectF TimeMarker::
label_rect(const QRectF
&rect) const
{
const float x = (time_ - view_.offset()) / view_.scale();
{
const float x = (time_ - view_.offset()) / view_.scale();
@@
-113,7
+113,7
@@
void TimeMarker::paint_label(QPainter &p, const QRect &rect)
return;
const qreal x = (time_ - view_.offset()) / view_.scale();
return;
const qreal x = (time_ - view_.offset()) / view_.scale();
- const QRectF r(
get_
label_rect(rect));
+ const QRectF r(label_rect(rect));
const QPointF points[] = {
r.topLeft(),
const QPointF points[] = {
r.topLeft(),
diff --git
a/pv/view/timemarker.hpp
b/pv/view/timemarker.hpp
index 24688ebc2e3d91a6ef319e932948026971668198..4e9d1fa2ebf5158842b6314e0b906da5c318c6d7 100644
(file)
--- a/
pv/view/timemarker.hpp
+++ b/
pv/view/timemarker.hpp
@@
-89,7
+89,7
@@
public:
* @param rect The rectangle of the ruler client area.
* @return Returns the label rectangle.
*/
* @param rect The rectangle of the ruler client area.
* @return Returns the label rectangle.
*/
- virtual QRectF
get_label_rect(const QRect
&rect) const;
+ virtual QRectF
label_rect(const QRectF
&rect) const;
/**
* Paints the marker's label to the ruler.
/**
* Paints the marker's label to the ruler.