• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • krita API Reference
  • KDE Home
  • Contact Us
 

KritaBasicFlakes

  • sources
  • kfour-appscomplete
  • krita
  • libs
  • basicflakes
  • tools
KoCreatePathTool.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  *
3  * SPDX-FileCopyrightText: 2006 Thorsten Zachmann <[email protected]>
4  * SPDX-FileCopyrightText: 2008-2010 Jan Hambrecht <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.0-or-later
7  */
8 
9 #include "KoCreatePathTool.h"
10 #include "KoCreatePathTool_p.h"
11 
12 #include <KoUnit.h>
13 #include "KoPointerEvent.h"
14 #include "KoPathShape.h"
15 #include "KoSelection.h"
16 #include "KoDocumentResourceManager.h"
17 #include "KoShapePaintingContext.h"
18 #include "KoShapeStroke.h"
19 #include "KoCanvasBase.h"
20 #include "kis_int_parse_spin_box.h"
21 #include <KoColor.h>
22 #include "kis_canvas_resource_provider.h"
23 #include <KisHandlePainterHelper.h>
24 #include "KoPathPointTypeCommand.h"
25 #include <KisAngleSelector.h>
26 
27 #include <klocalizedstring.h>
28 
29 #include <QSpinBox>
30 #include <QPainter>
31 #include <QLabel>
32 #include <QGridLayout>
33 #include <QCheckBox>
34 
35 
36 KoCreatePathTool::KoCreatePathTool(KoCanvasBase *canvas)
37  : KoToolBase(*(new KoCreatePathToolPrivate(this, canvas)))
38 {
39 }
40 
41 KoCreatePathTool::~KoCreatePathTool()
42 {
43 }
44 
45 QRectF KoCreatePathTool::decorationsRect() const
46 {
47  Q_D(const KoCreatePathTool);
48 
49  QRectF dirtyRect;
50 
51  if (pathStarted()) {
52  dirtyRect |= kisGrowRect(d->shape->boundingRect(), handleDocRadius());
53  }
54 
55  if (d->hoveredPoint) {
56  dirtyRect |= kisGrowRect(d->hoveredPoint->boundingRect(false), handleDocRadius());
57  }
58 
59  if (d->activePoint) {
60  dirtyRect |= kisGrowRect(d->activePoint->boundingRect(false), handleDocRadius());
61 
62  if (d->pointIsDragged) {
63  // the path is not closed, therefore the point is not marked as
64  // active inside the path itself
65  dirtyRect |= handlePaintRect(
66  d->activePoint->parent()->shapeToDocument(
67  d->activePoint->controlPoint2()));
68  }
69 
70  }
71 
72  if (canvas()->snapGuide()->isSnapping()) {
73  dirtyRect |= canvas()->snapGuide()->boundingRect();
74  }
75 
76  return dirtyRect;
77 }
78 
79 void KoCreatePathTool::paint(QPainter &painter, const KoViewConverter &converter)
80 {
81  Q_D(KoCreatePathTool);
82 
83  if (pathStarted()) {
84 
85  painter.save();
86  paintPath(*(d->shape), painter, converter);
87  painter.restore();
88 
89  KisHandlePainterHelper helper =
90  KoShape::createHandlePainterHelperView(&painter, d->shape, converter, d->handleRadius);
91 
92  const bool firstPointActive = d->firstPoint == d->activePoint;
93 
94  if (d->pointIsDragged || firstPointActive) {
95  const bool onlyPaintActivePoints = false;
96  KoPathPoint::PointTypes paintFlags = KoPathPoint::ControlPoint2;
97 
98  if (d->activePoint->activeControlPoint1()) {
99  paintFlags |= KoPathPoint::ControlPoint1;
100  }
101 
102  helper.setHandleStyle(KisHandleStyle::highlightedPrimaryHandles());
103  d->activePoint->paint(helper, paintFlags, onlyPaintActivePoints);
104  }
105 
106  if (!firstPointActive) {
107  helper.setHandleStyle(d->mouseOverFirstPoint ?
108  KisHandleStyle::highlightedPrimaryHandles() :
109  KisHandleStyle::primarySelection());
110  d->firstPoint->paint(helper, KoPathPoint::Node);
111  }
112  }
113 
114  if (d->hoveredPoint) {
115  KisHandlePainterHelper helper = KoShape::createHandlePainterHelperView(&painter, d->hoveredPoint->parent(), converter, d->handleRadius);
116  helper.setHandleStyle(KisHandleStyle::highlightedPrimaryHandles());
117  d->hoveredPoint->paint(helper, KoPathPoint::Node);
118  }
119 
120  painter.save();
121  painter.setTransform(converter.documentToView(), true);
122  canvas()->snapGuide()->paint(painter, converter);
123  painter.restore();
124 }
125 
126 void KoCreatePathTool::paintPath(KoPathShape& pathShape, QPainter &painter, const KoViewConverter &converter)
127 {
128  Q_D(KoCreatePathTool);
129  painter.setTransform(pathShape.absoluteTransformation() *
130  converter.documentToView() *
131  painter.transform());
132  painter.save();
133 
134  KoShapePaintingContext paintContext; //FIXME
135  pathShape.paint(painter, paintContext);
136  painter.restore();
137 
138  if (pathShape.stroke()) {
139  painter.save();
140  pathShape.stroke()->paint(d->shape, painter);
141  painter.restore();
142  }
143 }
144 
145 void KoCreatePathTool::mousePressEvent(KoPointerEvent *event)
146 {
147  Q_D(KoCreatePathTool);
148 
149  //Right click removes last point
150  if (event->button() == Qt::RightButton) {
151  removeLastPoint();
152  return;
153  }
154 
155  const bool isOverFirstPoint = d->shape &&
156  handleGrabRect(d->firstPoint->point()).contains(event->point);
157 
158  const bool haveCloseModifier = d->enableClosePathShortcut
159  && d->shape
160  && d->shape->pointCount() > 2
161  && (event->modifiers() & Qt::ShiftModifier);
162 
163  if ((event->button() == Qt::LeftButton) && haveCloseModifier && !isOverFirstPoint) {
164  endPathWithoutLastPoint();
165  return;
166  }
167 
168  d->finishAfterThisPoint = false;
169 
170  if (d->shape && pathStarted()) {
171  if (isOverFirstPoint) {
172  d->activePoint->setPoint(d->firstPoint->point());
173  canvas()->updateCanvas(d->shape->boundingRect());
174  canvas()->updateCanvas(canvas()->snapGuide()->boundingRect());
175 
176  if (haveCloseModifier) {
177  d->shape->closeMerge();
178  // we are closing the path, so reset the existing start path point
179  d->existingStartPoint = 0;
180  // finish path
181  endPath();
182  } else {
183  // the path shape will get closed when the user releases
184  // the mouse button
185  d->finishAfterThisPoint = true;
186  repaintDecorations();
187  }
188  } else {
189  QPointF point = canvas()->snapGuide()->snap(event->point, event->modifiers());
190 
191  // check whether we hit an start/end node of an existing path
192  d->existingEndPoint = d->endPointAtPosition(point);
193  if (d->existingEndPoint.isValid() && d->existingEndPoint != d->existingStartPoint) {
194  point = d->existingEndPoint.path->shapeToDocument(d->existingEndPoint.point->point());
195  d->activePoint->setPoint(point);
196  // finish path
197  endPath();
198  } else {
199  d->activePoint->setPoint(point);
200  repaintDecorations();
201  }
202  }
203  } else {
204  KoPathShape *pathShape = new KoPathShape();
205  d->shape = pathShape;
206  pathShape->setShapeId(KoPathShapeId);
207 
208  KoShapeStrokeSP stroke(new KoShapeStroke());
209  const qreal size = canvas()->resourceManager()->resource(KoCanvasResource::Size).toReal();
210 
211  stroke->setLineWidth(canvas()->unit().fromUserValue(size));
212  stroke->setColor(canvas()->resourceManager()->foregroundColor().toQColor());
213 
214  pathShape->setStroke(stroke);
215  QPointF point = canvas()->snapGuide()->snap(event->point, event->modifiers());
216 
217  // check whether we hit an start/end node of an existing path
218  d->existingStartPoint = d->endPointAtPosition(point);
219 
220  if (d->existingStartPoint.isValid()) {
221  point = d->existingStartPoint.path->shapeToDocument(d->existingStartPoint.point->point());
222  }
223 
224  d->activePoint = pathShape->moveTo(point);
225  d->firstPoint = d->activePoint;
226 
227  canvas()->snapGuide()->setAdditionalEditedShape(pathShape);
228 
229  d->angleSnapStrategy = new AngleSnapStrategy(d->angleSnappingDelta, d->angleSnapStatus);
230  canvas()->snapGuide()->addCustomSnapStrategy(d->angleSnapStrategy);
231 
232  repaintDecorations();
233  }
234 
235  d->dragStartPoint = event->point;
236 
237  if (d->angleSnapStrategy)
238  d->angleSnapStrategy->setStartPoint(d->activePoint->point());
239 }
240 
241 bool KoCreatePathTool::pathStarted() const
242 {
243  Q_D(const KoCreatePathTool);
244  return ((bool) d->shape);
245 }
246 
247 bool KoCreatePathTool::tryMergeInPathShape(KoPathShape *pathShape)
248 {
249  return addPathShapeImpl(pathShape, true);
250 }
251 
252 void KoCreatePathTool::setEnableClosePathShortcut(bool value)
253 {
254  Q_D(KoCreatePathTool);
255  d->enableClosePathShortcut = value;
256 }
257 
258 void KoCreatePathTool::mouseDoubleClickEvent(KoPointerEvent *event)
259 {
260  //remove handle
261  canvas()->updateCanvas(handlePaintRect(event->point));
262 
263  endPathWithoutLastPoint();
264 }
265 
266 void KoCreatePathTool::mouseMoveEvent(KoPointerEvent *event)
267 {
268  Q_D(KoCreatePathTool);
269 
270  d->hoveredPoint = d->endPointAtPosition(event->point);
271 
272  if (!pathStarted()) {
273  canvas()->snapGuide()->snap(event->point, event->modifiers());
274  repaintDecorations();
275 
276  d->mouseOverFirstPoint = false;
277  return;
278  }
279 
280  d->mouseOverFirstPoint = handleGrabRect(d->firstPoint->point()).contains(event->point);
281 
282  QPointF snappedPosition = canvas()->snapGuide()->snap(event->point, event->modifiers());
283 
284  if (event->buttons() & Qt::LeftButton) {
285  if (d->pointIsDragged ||
286  !handleGrabRect(d->dragStartPoint).contains(event->point)) {
287 
288  d->pointIsDragged = true;
289  QPointF offset = snappedPosition - d->activePoint->point();
290  d->activePoint->setControlPoint2(d->activePoint->point() + offset);
291  // pressing <alt> stops controls points moving symmetrically
292  if ((event->modifiers() & Qt::AltModifier) == 0) {
293  d->activePoint->setControlPoint1(d->activePoint->point() - offset);
294  }
295  }
296  } else {
297  d->activePoint->setPoint(snappedPosition);
298 
299  if (!d->prevPointWasDragged && d->autoSmoothCurves) {
300  KoPathPointIndex index = d->shape->pathPointIndex(d->activePoint);
301  if (index.second > 0) {
302 
303  KoPathPointIndex prevIndex(index.first, index.second - 1);
304  KoPathPoint *prevPoint = d->shape->pointByIndex(prevIndex);
305 
306  if (prevPoint) {
307  KoPathPoint *prevPrevPoint = 0;
308 
309  if (index.second > 1) {
310  KoPathPointIndex prevPrevIndex(index.first, index.second - 2);
311  prevPrevPoint = d->shape->pointByIndex(prevPrevIndex);
312  }
313 
314  if (prevPrevPoint) {
315  const QPointF control1 = prevPoint->point() + 0.3 * (prevPrevPoint->point() - prevPoint->point());
316  prevPoint->setControlPoint1(control1);
317  }
318 
319  const QPointF control2 = prevPoint->point() + 0.3 * (d->activePoint->point() - prevPoint->point());
320  prevPoint->setControlPoint2(control2);
321 
322  const QPointF activeControl = d->activePoint->point() + 0.3 * (prevPoint->point() - d->activePoint->point());
323  d->activePoint->setControlPoint1(activeControl);
324 
325  KoPathPointTypeCommand::makeCubicPointSmooth(prevPoint);
326  }
327  }
328  }
329 
330  }
331 
332  repaintDecorations();
333 }
334 
335 void KoCreatePathTool::mouseReleaseEvent(KoPointerEvent *event)
336 {
337  Q_D(KoCreatePathTool);
338 
339  if (! d->shape || (event->buttons() & Qt::RightButton)) return;
340 
341  d->prevPointWasDragged = d->pointIsDragged;
342  d->pointIsDragged = false;
343  KoPathPoint *lastActivePoint = d->activePoint;
344 
345  if (!d->finishAfterThisPoint) {
346  d->activePoint = d->shape->lineTo(event->point);
347  canvas()->snapGuide()->setIgnoredPathPoints((QList<KoPathPoint*>() << d->activePoint));
348  }
349 
350  // apply symmetric point property if applicable
351  if (lastActivePoint->activeControlPoint1() && lastActivePoint->activeControlPoint2()) {
352  QPointF diff1 = lastActivePoint->point() - lastActivePoint->controlPoint1();
353  QPointF diff2 = lastActivePoint->controlPoint2() - lastActivePoint->point();
354  if (qFuzzyCompare(diff1.x(), diff2.x()) && qFuzzyCompare(diff1.y(), diff2.y()))
355  lastActivePoint->setProperty(KoPathPoint::IsSymmetric);
356  }
357 
358  if (d->finishAfterThisPoint) {
359 
360  d->firstPoint->setControlPoint1(d->activePoint->controlPoint1());
361  delete d->shape->removePoint(d->shape->pathPointIndex(d->activePoint));
362  d->activePoint = d->firstPoint;
363 
364  if (!d->prevPointWasDragged && d->autoSmoothCurves) {
365  KoPathPointTypeCommand::makeCubicPointSmooth(d->activePoint);
366  }
367 
368  d->shape->closeMerge();
369 
370  // we are closing the path, so reset the existing start path point
371  d->existingStartPoint = 0;
372  // finish path
373  endPath();
374  }
375 
376  if (d->angleSnapStrategy && lastActivePoint->activeControlPoint2()) {
377  d->angleSnapStrategy->deactivate();
378  }
379 
380  repaintDecorations();
381 }
382 
383 void KoCreatePathTool::keyPressEvent(QKeyEvent *event)
384 {
385  if (event->key() == Qt::Key_Escape) {
386  emit done();
387  } else {
388  event->ignore();
389  }
390 }
391 
392 void KoCreatePathTool::endPath()
393 {
394  Q_D(KoCreatePathTool);
395 
396  d->addPathShape();
397  repaintDecorations();
398 }
399 
400 void KoCreatePathTool::endPathWithoutLastPoint()
401 {
402  Q_D(KoCreatePathTool);
403 
404  if (d->shape) {
405  delete d->shape->removePoint(d->shape->pathPointIndex(d->activePoint));
406  d->addPathShape();
407 
408  repaintDecorations();
409  }
410 }
411 
412 void KoCreatePathTool::cancelPath()
413 {
414  Q_D(KoCreatePathTool);
415 
416  if (d->shape) {
417  d->firstPoint = 0;
418  d->activePoint = 0;
419  }
420  d->cleanUp();
421  repaintDecorations();
422 }
423 
424 void KoCreatePathTool::removeLastPoint()
425 {
426  Q_D(KoCreatePathTool);
427 
428  if ((d->shape)) {
429  KoPathPointIndex lastPointIndex = d->shape->pathPointIndex(d->activePoint);
430 
431  if (lastPointIndex.second > 1) {
432  lastPointIndex.second--;
433  delete d->shape->removePoint(lastPointIndex);
434 
435  d->hoveredPoint = 0;
436 
437  repaintDecorations();
438  }
439  }
440 }
441 
442 void KoCreatePathTool::activate(ToolActivation activation, const QSet<KoShape*> &shapes)
443 {
444  KoToolBase::activate(activation, shapes);
445 
446  Q_D(KoCreatePathTool);
447  useCursor(Qt::ArrowCursor);
448 
449  // retrieve the actual global handle radius
450  d->handleRadius = handleRadius();
451  d->loadAutoSmoothValueFromConfig();
452 
453  // reset snap guide
454  canvas()->snapGuide()->reset();
455  repaintDecorations();
456 }
457 
458 void KoCreatePathTool::deactivate()
459 {
460  cancelPath();
461  KoToolBase::deactivate();
462 }
463 
464 void KoCreatePathTool::documentResourceChanged(int key, const QVariant & res)
465 {
466  Q_D(KoCreatePathTool);
467 
468  switch (key) {
469  case KoDocumentResourceManager::HandleRadius: {
470  d->handleRadius = res.toUInt();
471  }
472  break;
473  default:
474  return;
475  }
476 }
477 
478 bool KoCreatePathTool::addPathShapeImpl(KoPathShape *pathShape, bool tryMergeOnly)
479 {
480  Q_D(KoCreatePathTool);
481 
482  KoPathShape *startShape = 0;
483  KoPathShape *endShape = 0;
484  pathShape->normalize();
485 
486  // check if existing start/end points are still valid
487  d->existingStartPoint.validate(canvas());
488  d->existingEndPoint.validate(canvas());
489 
490  if (d->connectPaths(pathShape, d->existingStartPoint, d->existingEndPoint)) {
491  if (d->existingStartPoint.isValid()) {
492  startShape = d->existingStartPoint.path;
493  }
494  if (d->existingEndPoint.isValid() && d->existingEndPoint != d->existingStartPoint) {
495  endShape = d->existingEndPoint.path;
496  }
497  }
498 
499  if (tryMergeOnly && !startShape && !endShape) {
500  return false;
501  }
502 
503  KUndo2Command *cmd = canvas()->shapeController()->addShape(pathShape, 0);
504  KIS_SAFE_ASSERT_RECOVER(cmd) {
505  canvas()->updateCanvas(pathShape->boundingRect());
506  delete pathShape;
507  return true;
508  }
509 
510  KoSelection *selection = canvas()->shapeManager()->selection();
511  selection->deselectAll();
512  selection->select(pathShape);
513 
514  if (startShape) {
515  pathShape->setBackground(startShape->background());
516  pathShape->setStroke(startShape->stroke());
517  } else if (endShape) {
518  pathShape->setBackground(endShape->background());
519  pathShape->setStroke(endShape->stroke());
520  }
521 
522 
523  if (startShape) {
524  canvas()->shapeController()->removeShape(startShape, cmd);
525  }
526  if (endShape && startShape != endShape) {
527  canvas()->shapeController()->removeShape(endShape, cmd);
528  }
529  canvas()->addCommand(cmd);
530 
531  return true;
532 }
533 
534 
535 void KoCreatePathTool::addPathShape(KoPathShape *pathShape)
536 {
537  addPathShapeImpl(pathShape, false);
538 }
539 
540 QList<QPointer<QWidget> > KoCreatePathTool::createOptionWidgets()
541 {
542  Q_D(KoCreatePathTool);
543 
544  QList<QPointer<QWidget> > list;
545 
546  QCheckBox *smoothCurves = new QCheckBox(i18n("Autosmooth curve"));
547  smoothCurves->setObjectName("smooth-curves-widget");
548  smoothCurves->setChecked(d->autoSmoothCurves);
549  connect(smoothCurves, SIGNAL(toggled(bool)), this, SLOT(autoSmoothCurvesChanged(bool)));
550  connect(this, SIGNAL(sigUpdateAutoSmoothCurvesGUI(bool)), smoothCurves, SLOT(setChecked(bool)));
551 
552  list.append(smoothCurves);
553 
554  QWidget *angleWidget = new QWidget();
555  angleWidget->setObjectName("Angle Constraints");
556  QGridLayout *layout = new QGridLayout(angleWidget);
557  layout->addWidget(new QLabel(i18n("Angle snapping delta:"), angleWidget), 0, 0);
558  KisAngleSelector *angleEdit = new KisAngleSelector(angleWidget);
559  angleEdit->setAngle(d->angleSnappingDelta);
560  angleEdit->setRange(1, 360);
561  angleEdit->setDecimals(0);
562  angleEdit->setFlipOptionsMode(KisAngleSelector::FlipOptionsMode_MenuButton);
563  layout->addWidget(angleEdit, 0, 1);
564  layout->addWidget(new QLabel(i18n("Activate angle snap:"), angleWidget), 1, 0);
565  QCheckBox *angleSnap = new QCheckBox(angleWidget);
566  angleSnap->setChecked(false);
567  angleSnap->setCheckable(true);
568  layout->addWidget(angleSnap, 1, 1);
569  QWidget *specialSpacer = new QWidget();
570  specialSpacer->setObjectName("SpecialSpacer");
571  layout->addWidget(specialSpacer, 2, 1);
572  angleWidget->setWindowTitle(i18n("Angle Constraints"));
573  list.append(angleWidget);
574 
575  connect(angleEdit, SIGNAL(angleChanged(qreal)), this, SLOT(angleDeltaChanged(qreal)));
576  connect(angleSnap, SIGNAL(stateChanged(int)), this, SLOT(angleSnapChanged(int)));
577 
578  return list;
579 }
580 
581 //have to include this because of Q_PRIVATE_SLOT
582 #include <moc_KoCreatePathTool.cpp>
QList::append
void append(const T &value)
QSet
QGridLayout
KoCreatePathTool::mousePressEvent
void mousePressEvent(KoPointerEvent *event) override
reimplemented
Definition: KoCreatePathTool.cpp:145
QAbstractButton::setCheckable
void setCheckable(bool)
KoCreatePathTool::endPath
void endPath()
Definition: KoCreatePathTool.cpp:392
KoCreatePathTool::sigUpdateAutoSmoothCurvesGUI
void sigUpdateAutoSmoothCurvesGUI(bool value)
QPainter::transform
const QTransform & transform() const
KoCreatePathTool::decorationsRect
QRectF decorationsRect() const
Definition: KoCreatePathTool.cpp:45
KoCreatePathTool::endPathWithoutLastPoint
void endPathWithoutLastPoint()
Definition: KoCreatePathTool.cpp:400
QGridLayout::addWidget
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
QWidget
KoCreatePathTool::KoCreatePathTool
KoCreatePathTool(KoCanvasBase *canvas)
Constructor for the tool that allows you to create new paths by hand.
Definition: KoCreatePathTool.cpp:36
KoCreatePathTool::removeLastPoint
void removeLastPoint()
Definition: KoCreatePathTool.cpp:424
KoCreatePathTool::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
reimplemented
Definition: KoCreatePathTool.cpp:383
QAbstractButton::setChecked
void setChecked(bool)
QList
QPainter
QPointF
KoCreatePathTool::mouseMoveEvent
void mouseMoveEvent(KoPointerEvent *event) override
reimplemented
Definition: KoCreatePathTool.cpp:266
KoCreatePathTool::mouseReleaseEvent
void mouseReleaseEvent(KoPointerEvent *event) override
reimplemented
Definition: KoCreatePathTool.cpp:335
QLabel
QPainter::setTransform
void setTransform(const QTransform &transform, bool combine)
KoCreatePathTool::setEnableClosePathShortcut
void setEnableClosePathShortcut(bool value)
Definition: KoCreatePathTool.cpp:252
KoCreatePathTool::pathStarted
bool pathStarted() const
Returns true if path has been started.
Definition: KoCreatePathTool.cpp:241
KoCreatePathTool
Tool for creating path shapes.
Definition: KoCreatePathTool.h:28
QCheckBox
QWidget::setWindowTitle
void setWindowTitle(const QString &)
KoCreatePathTool::~KoCreatePathTool
~KoCreatePathTool() override
Definition: KoCreatePathTool.cpp:41
KoCreatePathTool::paint
void paint(QPainter &painter, const KoViewConverter &converter) override
reimplemented
Definition: KoCreatePathTool.cpp:79
QVariant::toUInt
uint toUInt(bool *ok) const
KoCreatePathTool::createOptionWidgets
QList< QPointer< QWidget > > createOptionWidgets() override
reimplemented
Definition: KoCreatePathTool.cpp:540
KoCreatePathTool.h
KoCreatePathToolPrivate
Definition: KoCreatePathTool_p.h:165
AngleSnapStrategy
Definition: KoCreatePathTool_p.h:98
KoCreatePathTool::mouseDoubleClickEvent
void mouseDoubleClickEvent(KoPointerEvent *event) override
reimplemented
Definition: KoCreatePathTool.cpp:258
KoCreatePathTool::deactivate
void deactivate() override
reimplemented
Definition: KoCreatePathTool.cpp:458
KoCreatePathTool::addPathShape
virtual void addPathShape(KoPathShape *pathShape)
Add path shape to document.
Definition: KoCreatePathTool.cpp:535
QPointF::x
qreal x() const
QPointF::y
qreal y() const
QKeyEvent::key
int key() const
QObject::setObjectName
void setObjectName(const QString &name)
KoCreatePathTool_p.h
QRectF
QPainter::restore
void restore()
QPainter::save
void save()
QKeyEvent
QVariant
KoCreatePathTool::paintPath
virtual void paintPath(KoPathShape &pathShape, QPainter &painter, const KoViewConverter &converter)
This method is called to paint the path.
Definition: KoCreatePathTool.cpp:126
KoCreatePathTool::cancelPath
void cancelPath()
Definition: KoCreatePathTool.cpp:412
KoCreatePathTool::documentResourceChanged
void documentResourceChanged(int key, const QVariant &res) override
reimplemented
Definition: KoCreatePathTool.cpp:464
KoToolBase
KoCreatePathTool::addPathShapeImpl
bool addPathShapeImpl(KoPathShape *pathShape, bool tryMergeOnly)
Definition: KoCreatePathTool.cpp:478
KoCreatePathTool::activate
void activate(ToolActivation activation, const QSet< KoShape * > &shapes) override
reimplemented
Definition: KoCreatePathTool.cpp:442
KoCreatePathTool::tryMergeInPathShape
bool tryMergeInPathShape(KoPathShape *pathShape)
Definition: KoCreatePathTool.cpp:247
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 23:43:13 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KritaBasicFlakes

Skip menu "KritaBasicFlakes"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

krita API Reference

Skip menu "krita API Reference"
  • libs
  •   KritaBasicFlakes
  •   brush
  •   KritaUndo2
  •   KritaFlake
  •   image
  •   KritaPlugin
  •   Krita
  •   KritaPigment
  •   KritaResources
  •   KritaStore
  •   ui
  •   KritaWidgets
  •   KritaWidgetUtils
  • plugins
  •   Assitants
  •   Extensions
  •   Filters
  •   Generators
  •   Formats
  •           src
  •   PaintOps
  •     libpaintop

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal