Engauge Digitizer 2
Loading...
Searching...
No Matches
GuidelineStateHandleAbstract.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2019 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include "EngaugeAssert.h"
8#include "GraphicsScene.h"
9#include "GuidelineAbstract.h"
10#include "GuidelineState.h"
13#include "Logger.h"
14#include <QPen>
15#include "ZValues.h"
16
21
25
27{
30 // ItemIsSelectable is overkill, and in special cases adds ugly selected dashes
31 context().guideline().setGraphicsItemFlags (QGraphicsItem::ItemIsFocusable |
32 QGraphicsItem::ItemIsMovable);
34 context().guideline().setGraphicsItemPen (QColor (Qt::transparent),
35 context().modelGuideline ().lineWidthInactive ());
36}
37
39{
40 return true;
41}
42
44{
45 // Noop
46}
47
49 bool /* locked */)
50{
51 // Noop
52}
53
55{
56 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleAbstract::handleHoverEnterEvent";
57
58 // Noop
59}
60
62{
63 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleAbstract::handleHoverEnterEvent";
64
65 // Noop
66}
67
68void GuidelineStateHandleAbstract::handleMousePress (const QPointF & /* posScene */)
69{
70 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleAbstract::handleMousePress";
71
72 // Noop
73}
74
76{
77 LOG4CPP_DEBUG_S ((*mainCat)) << "GuidelineStateHandleAbstract::handleTimeout";
78
79 // Noop
80}
81
log4cpp::Category * mainCat
Definition Logger.cpp:14
const int Z_VALUE_GUIDELINE_HANDLE
Definition ZValues.cpp:14
virtual void setGraphicsItemVisible(bool visible)=0
Wrapper for QGraphicsItem::setVisible.
virtual void setGraphicsItemAcceptHoverEvents(bool accept)=0
Wrapper for QGraphicsItem::setAcceptHoverEvents.
virtual void setGraphicsItemZValue(double z)=0
Wrapper for QGraphicsItem::setZValue.
virtual void setGraphicsItemPen(const QColor &color, double lineWidth)=0
Wrapper for QGraphicsItem::setPen.
virtual void setGraphicsItemFlags(QGraphicsItem::GraphicsItemFlags flags)=0
Wrapper for QGraphicsItem::setFlags.
GuidelineStateContext & context() const
Context in charge of the state classes.
GuidelineStateAbstractBase(GuidelineStateContext &context)
Single constructor.
Context class for state machine that belongs to the Guideline class.
GuidelineAbstract & guideline()
Guideline that owns this context class.
virtual void updateWithLatestTransformation()
Update given Transformation in GuidelineStateContext.
virtual void handleHoverEnterEvent()
If transparent then make visible when hover starts.
virtual void handleTimeout()
Handle timeout from Appearing state.
virtual void handleHoverLeaveEvent()
If previously transparent before hover enter then make transparent again.
GuidelineStateHandleAbstract(GuidelineStateContext &context)
Single constructor.
virtual void handleGuidelineMode(bool visible, bool locked)
User toggled Guideline visibility and/or locked mode.
virtual void handleActiveChange(bool active)
DigitizeState change so active status may (or may not) be toggled.
virtual bool doPaint() const
Allow/skip painting of the owner Guideline.
virtual void handleMousePress(const QPointF &posScene)
At the start of dragging, convert the Guideline into an invisible handle and visible slaved deployed ...
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20