X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fruler.cpp;h=712244a9df8cc9a4399d80217ac413467abd0f5d;hb=4c7a19d3d7049bcc9fb3185ce2bc91333a7ca9e1;hp=31ec121d074aa724bd4a67b83c2c4272d233099c;hpb=2ad82c2e40b6865481733913a2c32735602f63c4;p=pulseview.git diff --git a/pv/view/ruler.cpp b/pv/view/ruler.cpp index 31ec121..712244a 100644 --- a/pv/view/ruler.cpp +++ b/pv/view/ruler.cpp @@ -14,8 +14,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ #include @@ -29,11 +28,13 @@ using namespace Qt; +using std::function; using std::shared_ptr; using std::vector; namespace pv { -namespace view { +namespace views { +namespace TraceView { const float Ruler::RulerHeight = 2.5f; // x Text Height const int Ruler::MinorTickSubdivision = 4; @@ -70,7 +71,7 @@ QSize Ruler::sizeHint() const QSize Ruler::extended_size_hint() const { QRectF max_rect; - std::vector< std::shared_ptr > items(view_.time_items()); + vector< shared_ptr > items(view_.time_items()); for (auto &i : items) max_rect = max_rect.united(i->label_rect(QRect())); return QSize(0, sizeHint().height() - max_rect.top() / 2 + @@ -193,7 +194,7 @@ Ruler::TickPositions Ruler::calculate_tick_positions( const pv::util::Timestamp& offset, const double scale, const int width, - std::function format_function) + function format_function) { TickPositions tp; @@ -225,9 +226,9 @@ Ruler::TickPositions Ruler::calculate_tick_positions( return tp; } -void Ruler::mouseDoubleClickEvent(QMouseEvent *e) +void Ruler::mouseDoubleClickEvent(QMouseEvent *event) { - view_.add_flag(view_.offset() + ((double)e->x() + 0.5) * view_.scale()); + view_.add_flag(view_.offset() + ((double)event->x() + 0.5) * view_.scale()); } void Ruler::draw_hover_mark(QPainter &p, int text_height) @@ -271,5 +272,6 @@ void Ruler::resizeEvent(QResizeEvent*) invalidate_tick_position_cache(); } -} // namespace view +} // namespace TraceView +} // namespace views } // namespace pv