Skip to content

Commit

Permalink
Shows tooltip on vertical span borders too
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Jeandet <[email protected]>
  • Loading branch information
jeandet committed Dec 28, 2023
1 parent be1d6eb commit 0ae904a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions include/SciQLopPlots/SciQLopVerticalSpan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
#include <iostream>
#include <qcustomplot.h>

class VerticalSpanBorder : public SciQLopPlotItem<QCPItemStraightLine>
class VerticalSpanBorder : public SciQLopPlotItem<QCPItemStraightLine>,
public SciQlopItemWithToolTip
{
Q_OBJECT

Expand Down Expand Up @@ -242,6 +243,11 @@ class VerticalSpan : public SciQLopPlotItem<QCPItemRect>, public SciQlopItemWith
}
}

inline void set_borders_tool_tip(const QString& tool_tip)
{
this->_border1->setToolTip(tool_tip);
this->_border2->setToolTip(tool_tip);
}

inline void set_borders_color(const QColor& color)
{
Expand Down Expand Up @@ -311,6 +317,10 @@ class SciQLopVerticalSpan : public QObject
inline void set_read_only(bool read_only) { this->_impl->setMovable(!read_only); }
[[nodiscard]] inline bool read_only() const noexcept { return !this->_impl->movable(); }

inline void set_tool_tip(const QString& tool_tip) { this->_impl->setToolTip(tool_tip); }
inline void set_tool_tip(const QString& tool_tip)
{
this->_impl->setToolTip(tool_tip);
this->_impl->set_borders_tool_tip(tool_tip);
}
[[nodiscard]] inline QString tool_tip() const noexcept { return this->_impl->tooltip(); }
};

0 comments on commit 0ae904a

Please sign in to comment.