mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: activate dragging of tooltipitem
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a527415ac9
commit
4c227aba42
6 changed files with 32 additions and 3 deletions
|
|
@ -41,6 +41,10 @@ void ChartItem::setPos(QPointF)
|
|||
{
|
||||
}
|
||||
|
||||
void ChartItem::stopDrag(QPointF pos)
|
||||
{
|
||||
}
|
||||
|
||||
static int round_up(double f)
|
||||
{
|
||||
return static_cast<int>(ceil(f));
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ public:
|
|||
virtual ~ChartItem(); // Attention: must only be called by render thread.
|
||||
QRectF getRect() const;
|
||||
virtual void setPos(QPointF pos); // Called when dragging the item
|
||||
virtual void stopDrag(QPointF pos); // Called when dragging the item finished
|
||||
protected:
|
||||
ChartItem(ChartView &v, size_t z, bool dragable = false);
|
||||
QSizeF sceneSize() const;
|
||||
|
|
|
|||
|
|
@ -282,6 +282,8 @@ void ChartView::mousePressEvent(QMouseEvent *event)
|
|||
void ChartView::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
if (draggedItem) {
|
||||
QPointF pos = event->localPos();
|
||||
draggedItem->stopDrag(pos);
|
||||
draggedItem.reset();
|
||||
ungrabMouse();
|
||||
event->accept();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue