const int CursorPair::DeltaPadding = 8;
CursorPair::CursorPair(View &view) :
+ TimeItem(view),
first_(new Cursor(view, 0.0)),
- second_(new Cursor(view, 1.0)),
- view_(view)
+ second_(new Cursor(view, 1.0))
{
}
+bool CursorPair::enabled() const
+{
+ return view_.cursors_shown();
+}
+
shared_ptr<Cursor> CursorPair::first() const
{
return first_;
return second_;
}
+QPoint CursorPair::point() const
+{
+ return first_->point();
+}
+
+pv::widgets::Popup* CursorPair::create_popup(QWidget *parent)
+{
+ (void)parent;
+ return nullptr;
+}
+
QRectF CursorPair::get_label_rect(const QRect &rect) const
{
const QSizeF label_size(
namespace pv {
namespace view {
-class CursorPair
+class CursorPair : public TimeItem
{
private:
static const int DeltaPadding;
*/
CursorPair(View &view);
+public:
+ /**
+ * Returns true if the item is visible and enabled.
+ */
+ bool enabled() const;
+
/**
* Returns a pointer to the first cursor.
*/
*/
std::shared_ptr<Cursor> second() const;
+ QPoint point() const;
+
+ pv::widgets::Popup* create_popup(QWidget *parent);
+
public:
QRectF get_label_rect(const QRect &rect) const;
private:
std::shared_ptr<Cursor> first_, second_;
- const View &view_;
QSizeF text_size_;
};