]> sigrok.org Git - pulseview.git/blobdiff - pv/view/cursorpair.cpp
Put the time format function into a separate file.
[pulseview.git] / pv / view / cursorpair.cpp
index 70c7bac9235b41d203b74054036c36dbcd8f8fa9..f73567e3bf750e08e384c2864ee9fadf0db2ad13 100644 (file)
 
 #include "cursorpair.h"
 
-#include "ruler.h"
 #include "view.h"
+#include "pv/util.h"
 
 #include <algorithm>
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::max;
+using std::make_pair;
+using std::min;
+using std::pair;
 
 namespace pv {
 namespace view {
 
 const int CursorPair::DeltaPadding = 8;
 
-CursorPair::CursorPair(const View &view) :
+CursorPair::CursorPair(View &view) :
        _first(new Cursor(view, 0.0)),
        _second(new Cursor(view, 1.0)),
        _view(view)
@@ -96,7 +99,7 @@ void CursorPair::draw_markers(QPainter &p,
 
                p.setPen(Cursor::TextColour);
                p.drawText(text_rect, Qt::AlignCenter | Qt::AlignVCenter,
-                       Ruler::format_time(_second->time() - _first->time(), prefix, 2));
+                       pv::util::format_time(_second->time() - _first->time(), prefix, 2));
        }
 
        // Paint the cursor markers
@@ -134,7 +137,7 @@ void CursorPair::compute_text_size(QPainter &p, unsigned int prefix)
        assert(_first);
        assert(_second);
 
-       _text_size = p.boundingRect(QRectF(), 0, Ruler::format_time(
+       _text_size = p.boundingRect(QRectF(), 0, pv::util::format_time(
                _second->time() - _first->time(), prefix, 2)).size();
 }