#include <ruler.hpp>
Definition at line 44 of file ruler.hpp.
struct pv::view::Ruler::TickPositions |
Definition at line 136 of file ruler.hpp.
Class Members |
vector< pair< double, QString > > |
major |
|
vector< double > |
minor |
|
pv::view::Ruler::Ruler |
( |
View & |
parent | ) |
|
int pv::view::Ruler::calculate_text_height |
( |
| ) |
const |
|
private |
Calculates the major and minor tick positions.
- Parameters
-
major_period | The period between the major ticks. |
offset | The time at the left border of the ruler. |
scale | The scale in seconds per pixel. |
width | the Width of the ruler. |
format_function | A function used to format the major tick times. |
- Returns
- An object of type 'TickPositions' that contains the major tick positions together with the labels at that ticks, and the minor tick positions.
Definition at line 191 of file ruler.cpp.
void pv::view::Ruler::draw_hover_mark |
( |
QPainter & |
p, |
|
|
int |
text_height |
|
) |
| |
|
private |
Draw a hover arrow under the cursor position.
- Parameters
-
p | The painter to draw into. |
text_height | The height of a single text ascent. |
Definition at line 233 of file ruler.cpp.
QSize pv::view::Ruler::extended_size_hint |
( |
| ) |
const |
|
virtual |
Formats a timestamp depending on its distance to another timestamp.
Heuristic function, useful when multiple timestamps should be put side by side. The function procedes in the following order:
- Parameters
-
distance | The distance between the timestamp to format and an adjacent one. |
t | The value to format |
prefix | The SI prefix to use. |
unit | The representation of the timestamp value. |
precision | The number of digits after the decimal separator. |
sign | Whether or not to add a sign also for positive numbers. |
- Returns
- The formated value.
Definition at line 80 of file ruler.cpp.
shared_ptr< ViewItem > pv::view::Ruler::get_mouse_over_item |
( |
const QPoint & |
pt | ) |
|
|
privatevirtual |
Gets the first view item which has a label that contains pt
.
- Parameters
-
pt | the point to search with. |
- Returns
- the view item that has been found, or and empty
shared_ptr
if no item was found.
Implements pv::view::ViewWidget.
Definition at line 119 of file ruler.cpp.
void pv::view::Ruler::hover_point_changed |
( |
| ) |
|
|
privateslot |
void pv::view::Ruler::invalidate_tick_position_cache |
( |
| ) |
|
|
privateslot |
vector< shared_ptr< ViewItem > > pv::view::Ruler::items |
( |
| ) |
|
|
privatevirtual |
void pv::view::Ruler::mouseDoubleClickEvent |
( |
QMouseEvent * |
e | ) |
|
|
private |
void pv::view::Ruler::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
private |
void pv::view::Ruler::resizeEvent |
( |
QResizeEvent * |
| ) |
|
|
overrideprotected |
QSize pv::view::Ruler::sizeHint |
( |
| ) |
const |
friend class RulerTest::tick_position_test_0 |
|
friend |
friend class RulerTest::tick_position_test_1 |
|
friend |
friend class RulerTest::tick_position_test_2 |
|
friend |
const float pv::view::Ruler::HoverArrowSize = 0.5f |
|
staticprivate |
Height of the hover arrow in multiples of the text height.
Definition at line 60 of file ruler.hpp.
const int pv::view::Ruler::MinorTickSubdivision = 4 |
|
staticprivate |
const float pv::view::Ruler::RulerHeight = 2.5f |
|
staticprivate |
Height of the ruler in multipes of the text height.
Definition at line 55 of file ruler.hpp.
boost::optional<TickPositions> pv::view::Ruler::tick_position_cache_ |
|
private |
Holds the tick positions so that they don't have to be recalculated on every redraw. Set by 'paintEvent()' when needed.
Definition at line 146 of file ruler.hpp.
The documentation for this class was generated from the following files: