33 if (d->currentStrategy) {
34 d->currentStrategy->paint(painter, converter);
38 if (
factory->paintOnHover(painter, converter))
break;
46 if (d->currentStrategy) {
51 if (d->currentStrategy == 0)
58 d->lastPoint =
event->point;
60 if (d->currentStrategy) {
61 d->currentStrategy->handleMouseMove(d->lastPoint, event->
modifiers());
65 if (
factory->hoverEvent(event))
return;
75 if (d->currentStrategy) {
76 d->currentStrategy->finishInteraction(event->
modifiers());
79 d->canvas->addCommand(command);
80 delete d->currentStrategy;
81 d->currentStrategy = 0;
91 if (d->currentStrategy &&
92 (event->key() == Qt::Key_Control ||
93 event->key() == Qt::Key_Alt || event->key() == Qt::Key_Shift ||
94 event->key() == Qt::Key_Meta)) {
95 d->currentStrategy->handleMouseMove(d->lastPoint, event->modifiers());
104 if (!d->currentStrategy) {
109 if (event->key() == Qt::Key_Escape) {
112 }
else if (event->key() == Qt::Key_Control ||
113 event->key() == Qt::Key_Alt || event->key() == Qt::Key_Shift ||
114 event->key() == Qt::Key_Meta) {
115 d->currentStrategy->handleMouseMove(d->lastPoint, event->modifiers());
122 return d->currentStrategy;
128 if (d->currentStrategy) {
129 d->currentStrategy->cancelInteraction();
130 delete d->currentStrategy;
131 d->currentStrategy = 0;
153 Q_FOREACH (
auto f, d->interactionFactories) {
158 std::sort(d->interactionFactories.begin(),
159 d->interactionFactories.end(),
167 d->interactionFactories.begin();
169 while (it != d->interactionFactories.end()) {
170 if ((*it)->id() ==
id) {
171 it = d->interactionFactories.erase(it);
182 Q_FOREACH (
auto f, d->interactionFactories) {
195 Q_FOREACH (
auto f, d->interactionFactories) {
196 if (f->tryUseCustomCursor()) {
static bool compareLess(KoInteractionStrategyFactorySP f1, KoInteractionStrategyFactorySP f2)
Qt::KeyboardModifiers modifiers() const
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
QSharedPointer< T > toQShared(T *ptr)