|
Krita Source Code Documentation
|
#include <KoCanvasControllerWidget.h>
Inheritance diagram for KoCanvasControllerWidget:Public Member Functions | |
| virtual void | activate () |
| Reimplemented from KoCanvasController. | |
| void | activate () |
| KoCanvasBase * | canvas () const override |
| virtual KisCanvasState | canvasState () const =0 |
| virtual void | changeCanvasWidget (QWidget *widget) |
| KoCanvasControllerWidget (KisKActionCollection *actionCollection, KoCanvasSupervisor *observerProvider, QWidget *parent=0) | |
| void | pan (const QPoint &distance) override |
| virtual void | panDown () override |
| virtual void | panLeft () override |
| virtual void | panRight () override |
| virtual void | panUp () override |
| KoCanvasControllerWidget::Private * | priv () |
| Private (KoCanvasControllerWidget *qq, KoCanvasSupervisor *observerProvider) | |
| QPoint | scrollBarValue () const override |
| void | scrollContentsBy (int dx, int dy) override |
| void | setCanvas (KoCanvasBase *canvas) override |
| void | setScrollBarValue (const QPoint &value) override |
| void | setToolOptionWidgets (const QList< QPointer< QWidget > > &widgets) |
| void | setZoom (KoZoomMode::Mode mode, qreal zoom) override |
| void | setZoom (KoZoomMode::Mode mode, qreal zoom, const KoViewTransformStillPoint &stillPoint) |
| void | setZoom (KoZoomMode::Mode mode, qreal zoom, qreal resolutionX, qreal resolutionY) |
| void | setZoom (KoZoomMode::Mode mode, qreal zoom, qreal resolutionX, qreal resolutionY, const std::optional< KoViewTransformStillPoint > &docStillPoint) |
| void | unsetCanvas () |
| void | zoomTo (const QRect &rect) override |
| zoom so that rect is exactly visible (as close as possible) | |
| ~KoCanvasControllerWidget () override | |
Public Member Functions inherited from KoCanvasController | |
| KisKActionCollection * | actionCollection () const |
| virtual QPointF | currentCursorPosition () const =0 |
| virtual void | ensureVisibleDoc (const QRectF &docRect, bool smooth)=0 |
| Scrolls the content of the canvas so that the given rect is visible. | |
| KoCanvasController (KisKActionCollection *actionCollection) | |
| virtual QPointF | preferredCenter () const =0 |
| Returns the currently set preferred center point in view coordinates (pixels) | |
| Private () | |
| virtual void | resetScrollBars ()=0 |
| virtual void | setPreferredCenter (const QPointF &viewPoint)=0 |
| virtual void | zoomIn ()=0 |
| virtual void | zoomIn (const KoViewTransformStillPoint &stillPoint)=0 |
zooms in keeping stillPoint not moved. | |
| virtual void | zoomOut ()=0 |
| virtual void | zoomOut (const KoViewTransformStillPoint &stillPoint)=0 |
zooms out keeping stillPoint not moved. | |
| virtual KoZoomState | zoomState () const =0 |
| virtual | ~KoCanvasController () |
Public Attributes | |
| QPointer< KoCanvasBase > | canvas |
| bool | ignoreScrollSignals |
| KoCanvasSupervisor * | observerProvider |
| KoCanvasControllerWidget * | q |
| Viewport * | viewportWidget |
Public Attributes inherited from KoCanvasController | |
| KisKActionCollection * | actionCollection |
| QPoint | documentOffset |
| QSizeF | documentSize |
| qreal | preferredCenterFractionX |
| qreal | preferredCenterFractionY |
| QPointer< KoCanvasControllerProxyObject > | proxyObject |
Protected Member Functions | |
| void | dragEnterEvent (QDragEnterEvent *event) override |
| reimplemented from QWidget | |
| void | dragLeaveEvent (QDragLeaveEvent *event) override |
| reimplemented from QWidget | |
| void | dragMoveEvent (QDragMoveEvent *event) override |
| reimplemented from QWidget | |
| void | dropEvent (QDropEvent *event) override |
| reimplemented from QWidget | |
| void | emitSignals (const KisCanvasState &oldState, const KisCanvasState &newState) |
| bool | focusNextPrevChild (bool next) override |
| reimplemented from QWidget | |
| void | paintEvent (QPaintEvent *event) override |
| reimplemented from QWidget | |
| void | resizeEvent (QResizeEvent *resizeEvent) override |
| reimplemented from QWidget | |
| virtual void | updateCanvasOffsetInternal (const QPointF &newOffset)=0 |
| virtual void | updateCanvasWidgetSizeInternal (const QSize &newSize)=0 |
| virtual void | updateCanvasZoomInternal (KoZoomMode::Mode mode, qreal zoom, qreal resolutionX, qreal resolutionY, const std::optional< KoViewTransformStillPoint > &docStillPoint)=0 |
| bool | viewportEvent (QEvent *event) override |
| reimplemented from QAbstractScrollArea | |
| virtual void | zoomToInternal (const QRect &viewRect)=0 |
Protected Member Functions inherited from KoCanvasController | |
| void | setDocumentOffset (const QPoint &offset) |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Friends | |
| class | KisZoomAndPanTest |
Additional Inherited Members | |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
KoCanvasController implementation for QWidget based canvases
Definition at line 31 of file KoCanvasControllerWidget.h.
|
explicit |
Constructor.
| actionCollection | the action collection for this widget |
| parent | the parent this widget will belong to |
Definition at line 69 of file KoCanvasControllerWidget.cpp.
References d.
|
override |
|
virtual |
Reimplemented from KoCanvasController.
Activate this canvascontroller
Reimplemented in KisCanvasController.
Definition at line 102 of file KoCanvasControllerWidget.cpp.
References d.
| void KoCanvasControllerWidget::activate | ( | ) |
|
overridevirtual |
Return the currently set canvas. The default implementation will return Null
Reimplemented from KoCanvasController.
|
pure virtual |
Implemented in KisCanvasController.
|
virtual |
Change the actual canvas widget used by the current canvas. This allows the canvas widget to be changed while keeping the current KoCanvasBase canvas and its associated resources as they are. This might be used, for example, to switch from a QWidget to a QOpenGLWidget canvas.
| widget | the new canvas widget. |
Definition at line 164 of file KoCanvasControllerWidget.cpp.
References Private::canvas, KisCanvas2::canvasWidget, and d.
|
overrideprotected |
reimplemented from QWidget
Definition at line 267 of file KoCanvasControllerWidget.cpp.
References d.
|
overrideprotected |
reimplemented from QWidget
Definition at line 282 of file KoCanvasControllerWidget.cpp.
References d.
|
overrideprotected |
reimplemented from QWidget
Definition at line 277 of file KoCanvasControllerWidget.cpp.
References d.
|
overrideprotected |
reimplemented from QWidget
Definition at line 272 of file KoCanvasControllerWidget.cpp.
References d.
|
protected |
Definition at line 175 of file KoCanvasControllerWidget.cpp.
References KisCanvasState::canvasSize, KisCanvasState::documentOffset, KisCanvasState::documentOffsetF, KisCanvasState::effectiveZoom, KisCanvasState::imageRectInWidgetPixels, KisCanvasState::maximumOffset, KisCanvasState::minimumOffset, KisCanvasState::mirrorHorizontally, KisCanvasState::mirrorVertically, KoCanvasController::proxyObject, qFuzzyCompare(), KoCanvasController::resetScrollBars(), KisCanvasState::rotation, and KisCanvasState::zoomState().
|
overrideprotected |
reimplemented from QWidget
Definition at line 315 of file KoCanvasControllerWidget.cpp.
|
overrideprotected |
reimplemented from QWidget
Definition at line 261 of file KoCanvasControllerWidget.cpp.
References d.
|
overridevirtual |
Move the canvas over the x and y distance of the parameter distance
| distance | the distance in view coordinates (pixels). A positive distance means moving the canvas up/left. |
Implements KoCanvasController.
Definition at line 235 of file KoCanvasControllerWidget.cpp.
References distance(), scrollBarValue(), and setScrollBarValue().
|
overridevirtual |
Move the canvas down. This behaves the same as
Implements KoCanvasController.
Definition at line 246 of file KoCanvasControllerWidget.cpp.
References pan().
|
overridevirtual |
Move the canvas to the left. This behaves the same as
Implements KoCanvasController.
Definition at line 251 of file KoCanvasControllerWidget.cpp.
References pan().
|
overridevirtual |
Move the canvas to the right. This behaves the same as
Implements KoCanvasController.
Definition at line 256 of file KoCanvasControllerWidget.cpp.
References pan().
|
overridevirtual |
Move the canvas up. This behaves the same as
Implements KoCanvasController.
Definition at line 241 of file KoCanvasControllerWidget.cpp.
References pan().
| KoCanvasControllerWidget::Private * KoCanvasControllerWidget::priv | ( | ) |
|
inline |
Definition at line 30 of file KoCanvasControllerWidget_p.h.
|
overrideprotected |
reimplemented from QWidget
Definition at line 124 of file KoCanvasControllerWidget.cpp.
References canvasState(), d, emitSignals(), and updateCanvasWidgetSizeInternal().
|
overridevirtual |
Get the position of the scrollbar
Implements KoCanvasController.
Definition at line 332 of file KoCanvasControllerWidget.cpp.
|
override |
Reimplemented from QAbstractScrollArea.
Definition at line 107 of file KoCanvasControllerWidget.cpp.
References canvasState(), KisCanvasState::documentOffset, emitSignals(), updateCanvasOffsetInternal(), and value().
|
overridevirtual |
Set the new canvas to be shown as a child Calling this will Q_EMIT canvasRemoved() if there was a canvas before, and will emit canvasSet() with the new canvas.
| canvas | the new canvas. The KoCanvasBase::canvas() will be called to retrieve the actual widget which will then be added as child of this one. |
Implements KoCanvasController.
Definition at line 138 of file KoCanvasControllerWidget.cpp.
References activate(), Private::canvas, canvas, KisCanvas2::canvasWidget, changeCanvasWidget(), d, KoCanvasController::proxyObject, and KoCanvasBase::setCanvasController().
|
overridevirtual |
Used by KisCanvasController to correct the scrollbars position after the rotation.
Implements KoCanvasController.
Definition at line 340 of file KoCanvasControllerWidget.cpp.
References value().
will cause the toolOptionWidgetsChanged to be emitted and all listeners to be updated to the new widget.
FIXME: This doesn't belong her and it does an inherits("KoView") so it too much tied to komain
| widgets | the map of widgets |
|
overridevirtual |
Implements KoCanvasController.
Definition at line 287 of file KoCanvasControllerWidget.cpp.
References Private::canvas, d, KIS_SAFE_ASSERT_RECOVER_RETURN, KoZoomHandler::resolutionX(), KoZoomHandler::resolutionY(), setZoom(), and KisCanvas2::viewConverter().
| void KoCanvasControllerWidget::setZoom | ( | KoZoomMode::Mode | mode, |
| qreal | zoom, | ||
| const KoViewTransformStillPoint & | stillPoint ) |
Definition at line 294 of file KoCanvasControllerWidget.cpp.
References Private::canvas, d, KIS_SAFE_ASSERT_RECOVER_RETURN, KoZoomHandler::resolutionX(), KoZoomHandler::resolutionY(), setZoom(), and KisCanvas2::viewConverter().
| void KoCanvasControllerWidget::setZoom | ( | KoZoomMode::Mode | mode, |
| qreal | zoom, | ||
| qreal | resolutionX, | ||
| qreal | resolutionY ) |
Definition at line 301 of file KoCanvasControllerWidget.cpp.
References setZoom().
| void KoCanvasControllerWidget::setZoom | ( | KoZoomMode::Mode | mode, |
| qreal | zoom, | ||
| qreal | resolutionX, | ||
| qreal | resolutionY, | ||
| const std::optional< KoViewTransformStillPoint > & | docStillPoint ) |
Definition at line 306 of file KoCanvasControllerWidget.cpp.
References canvasState(), emitSignals(), and updateCanvasZoomInternal().
| void KoCanvasControllerWidget::unsetCanvas | ( | ) |
|
protectedpure virtual |
Implemented in KisCanvasController.
|
protectedpure virtual |
Implemented in KisCanvasController.
|
protectedpure virtual |
Implemented in KisCanvasController.
|
overrideprotected |
reimplemented from QAbstractScrollArea
Definition at line 321 of file KoCanvasControllerWidget.cpp.
|
overridevirtual |
zoom so that rect is exactly visible (as close as possible)
The rect must be specified in widget coordinates. The scrollbar positions are changed so that the center of the rect becomes center if possible.
| rect | the rect in widget coordinates that should fit the view afterwards |
Implements KoCanvasController.
Definition at line 224 of file KoCanvasControllerWidget.cpp.
References canvasState(), emitSignals(), and zoomToInternal().
|
protectedpure virtual |
Implemented in KisCanvasController.
|
friend |
Definition at line 112 of file KoCanvasControllerWidget.h.
| KoCanvasBase * KoCanvasControllerWidget::canvas |
Definition at line 44 of file KoCanvasControllerWidget_p.h.
|
private |
Definition at line 141 of file KoCanvasControllerWidget.h.
| bool KoCanvasControllerWidget::ignoreScrollSignals |
Definition at line 46 of file KoCanvasControllerWidget_p.h.
| KoCanvasSupervisor* KoCanvasControllerWidget::observerProvider |
Definition at line 43 of file KoCanvasControllerWidget_p.h.
| KoCanvasControllerWidget* KoCanvasControllerWidget::q |
Definition at line 42 of file KoCanvasControllerWidget_p.h.
| Viewport* KoCanvasControllerWidget::viewportWidget |
Definition at line 45 of file KoCanvasControllerWidget_p.h.