#include "cursor.h"
+#include <memory>
+
#include <QPainter>
class QPainter;
* Constructor.
* @param view A reference to the view that owns this cursor pair.
*/
- CursorPair(const View &view);
-
- /**
- * Returns a reference to the first cursor.
- */
- Cursor& first();
-
- /**
- * Returns a reference to the first cursor.
- */
- const Cursor& first() const;
+ CursorPair(View &view);
/**
- * Returns a reference to the second cursor.
+ * Returns a pointer to the first cursor.
*/
- Cursor& second();
+ std::shared_ptr<Cursor> first() const;
/**
- * Returns a reference to the second cursor.
+ * Returns a pointer to the second cursor.
*/
- const Cursor& second() const;
+ std::shared_ptr<Cursor> second() const;
public:
QRectF get_label_rect(const QRect &rect) const;
std::pair<float, float> get_cursor_offsets() const;
private:
- Cursor _first, _second;
+ std::shared_ptr<Cursor> _first, _second;
const View &_view;
QSizeF _text_size;