Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ScribbleArea Class Reference
+ Inheritance diagram for ScribbleArea:
Inheritance graph
[legend]
+ Collaboration diagram for ScribbleArea:
Collaboration graph
[legend]

Public Slots

void clearImage ()
 
void setCurveSmoothing (int)
 
void toggleThinLines ()
 
void increaseLayerVisibilityIndex ()
 
void decreaseLayerVisibilityIndex ()
 
void setLayerVisibility (LayerVisibility visibility)
 
void updateToolCursor ()
 
void paletteColorChanged (QColor)
 
void showLayerNotVisibleWarning ()
 
void onTileUpdated (TiledBuffer *tiledBuffer, Tile *tile)
 
void onTileCreated (TiledBuffer *tiledBuffer, Tile *tile)
 

Signals

void multiLayerOnionSkinChanged (bool)
 
void selectionUpdated ()
 

Public Member Functions

 ScribbleArea (QWidget *parent)
 
bool init ()
 
void setEditor (Editor *e)
 
Editor * editor () const
 
void deleteSelection ()
 
void applyTransformedSelection ()
 
void cancelTransformedSelection ()
 
void setEffect (SETTING e, bool isOn)
 
LayerVisibility getLayerVisibility () const
 
qreal getCurveSmoothing () const
 
bool makeInvisible () const
 
QPointF getCentralPoint ()
 
void updateFrame ()
 Update frame.
 
void onScrubbed (int frameNumber)
 Frame scrubbed, invalidate relevant cache.
 
void onFramesModified ()
 Multiple frames modified, invalidate cache for affected frames.
 
void onPlayStateChanged ()
 Playstate changed, invalidate relevant cache.
 
void onViewChanged ()
 View updated, invalidate relevant cache.
 
void onFrameModified (int frameNumber)
 Frame modified, invalidate cache for frame if any.
 
void onLayerChanged ()
 Layer changed, invalidate relevant cache.
 
void onSelectionChanged ()
 Selection was changed, keep cache.
 
void onOnionSkinTypeChanged ()
 Onion skin type changed, all frames will be affected.
 
void onObjectLoaded ()
 Object updated, invalidate all cache.
 
void onToolPropertyUpdated (ToolType, ToolPropertyType)
 Tool property updated, invalidate cache and frame if needed.
 
void onToolChanged (ToolType)
 Tool changed, invalidate cache and frame if needed.
 
void endStroke ()
 
void flipSelection (bool flipVertical)
 
BaseTool * currentTool () const
 
bool isMouseInUse () const
 
bool isTabletInUse () const
 
bool isPointerInUse () const
 
void keyEvent (QKeyEvent *event)
 
void keyEventForSelection (QKeyEvent *event)
 
void drawPolyline (QPainterPath path, QPen pen, bool useAA)
 
void drawPath (QPainterPath path, QPen pen, QBrush brush, QPainter::CompositionMode cm)
 
void drawPen (QPointF thePoint, qreal brushWidth, QColor fillColor, bool useAA=true)
 
void drawPencil (QPointF thePoint, qreal brushWidth, qreal fixedBrushFeather, QColor fillColor, qreal opacity)
 
void drawBrush (QPointF thePoint, qreal brushWidth, qreal offset, QColor fillColor, QPainter::CompositionMode compMode, qreal opacity, bool usingFeather=true, bool useAA=false)
 
void blurBrush (BitmapImage *bmiSource_, QPointF srcPoint_, QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_)
 
void liquifyBrush (BitmapImage *bmiSource_, QPointF srcPoint_, QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_)
 
void paintBitmapBuffer ()
 
void clearDrawingBuffer ()
 
void setGaussianGradient (QGradient &gradient, QColor color, qreal opacity, qreal offset)
 
void pointerPressEvent (PointerEvent *)
 
void pointerMoveEvent (PointerEvent *)
 
void pointerReleaseEvent (PointerEvent *)
 
void handleDrawingOnEmptyFrame ()
 Call this when starting to use a paint tool.
 
- Public Member Functions inherited from QWidget
 QWidget (QWidget *parent, Qt::WindowFlags f)
 
WId winId () const const
 
WId effectiveWinId () const const
 
QStyle * style () const const
 
void setStyle (QStyle *style)
 
bool isTopLevel () const const
 
bool isWindow () const const
 
bool isModal () const const
 
Qt::WindowModality windowModality () const const
 
void setWindowModality (Qt::WindowModality windowModality)
 
bool isEnabled () const const
 
bool isEnabledTo (const QWidget *ancestor) const const
 
bool isEnabledToTLW () const const
 
void setEnabled (bool)
 
void setDisabled (bool disable)
 
void setWindowModified (bool)
 
QRect frameGeometry () const const
 
const QRect & geometry () const const
 
QRect normalGeometry () const const
 
int x () const const
 
int y () const const
 
QPoint pos () const const
 
QSize frameSize () const const
 
QSize size () const const
 
int width () const const
 
int height () const const
 
QRect rect () const const
 
QRect childrenRect () const const
 
QRegion childrenRegion () const const
 
QSize minimumSize () const const
 
QSize maximumSize () const const
 
int minimumWidth () const const
 
int minimumHeight () const const
 
int maximumWidth () const const
 
int maximumHeight () const const
 
void setMinimumSize (const QSize &)
 
void setMinimumSize (int minw, int minh)
 
void setMaximumSize (const QSize &)
 
void setMaximumSize (int maxw, int maxh)
 
void setMinimumWidth (int minw)
 
void setMinimumHeight (int minh)
 
void setMaximumWidth (int maxw)
 
void setMaximumHeight (int maxh)
 
void setupUi (QWidget *widget)
 
QSize sizeIncrement () const const
 
void setSizeIncrement (const QSize &)
 
void setSizeIncrement (int w, int h)
 
QSize baseSize () const const
 
void setBaseSize (const QSize &)
 
void setBaseSize (int basew, int baseh)
 
void setFixedSize (const QSize &s)
 
void setFixedSize (int w, int h)
 
void setFixedWidth (int w)
 
void setFixedHeight (int h)
 
QPoint mapToGlobal (const QPoint &pos) const const
 
QPoint mapFromGlobal (const QPoint &pos) const const
 
QPoint mapToParent (const QPoint &pos) const const
 
QPoint mapFromParent (const QPoint &pos) const const
 
QPoint mapTo (const QWidget *parent, const QPoint &pos) const const
 
QPoint mapFrom (const QWidget *parent, const QPoint &pos) const const
 
QWidget * window () const const
 
QWidget * nativeParentWidget () const const
 
QWidget * topLevelWidget () const const
 
const QPalette & palette () const const
 
void setPalette (const QPalette &)
 
void setBackgroundRole (QPalette::ColorRole role)
 
QPalette::ColorRole backgroundRole () const const
 
void setForegroundRole (QPalette::ColorRole role)
 
QPalette::ColorRole foregroundRole () const const
 
const QFont & font () const const
 
void setFont (const QFont &)
 
QFontMetrics fontMetrics () const const
 
QFontInfo fontInfo () const const
 
QCursor cursor () const const
 
void setCursor (const QCursor &)
 
void unsetCursor ()
 
void setMouseTracking (bool enable)
 
bool hasMouseTracking () const const
 
bool underMouse () const const
 
void setTabletTracking (bool enable)
 
bool hasTabletTracking () const const
 
void setMask (const QBitmap &bitmap)
 
void setMask (const QRegion &region)
 
QRegion mask () const const
 
void clearMask ()
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void render (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
QPixmap grab (const QRect &rectangle)
 
QGraphicsEffect * graphicsEffect () const const
 
void setGraphicsEffect (QGraphicsEffect *effect)
 
void grabGesture (Qt::GestureType gesture, Qt::GestureFlags flags)
 
void ungrabGesture (Qt::GestureType gesture)
 
void setWindowTitle (const QString &)
 
void setStyleSheet (const QString &styleSheet)
 
QString styleSheet () const const
 
QString windowTitle () const const
 
void setWindowIcon (const QIcon &icon)
 
QIcon windowIcon () const const
 
void setWindowIconText (const QString &)
 
QString windowIconText () const const
 
void setWindowRole (const QString &role)
 
QString windowRole () const const
 
void setWindowFilePath (const QString &filePath)
 
QString windowFilePath () const const
 
void setWindowOpacity (qreal level)
 
qreal windowOpacity () const const
 
bool isWindowModified () const const
 
void setToolTip (const QString &)
 
QString toolTip () const const
 
void setToolTipDuration (int msec)
 
int toolTipDuration () const const
 
void setStatusTip (const QString &)
 
QString statusTip () const const
 
void setWhatsThis (const QString &)
 
QString whatsThis () const const
 
QString accessibleName () const const
 
void setAccessibleName (const QString &name)
 
QString accessibleDescription () const const
 
void setAccessibleDescription (const QString &description)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
Qt::LayoutDirection layoutDirection () const const
 
void unsetLayoutDirection ()
 
void setLocale (const QLocale &locale)
 
QLocale locale () const const
 
void unsetLocale ()
 
void setFocus ()
 
bool isActiveWindow () const const
 
void activateWindow ()
 
void clearFocus ()
 
void setFocus (Qt::FocusReason reason)
 
Qt::FocusPolicy focusPolicy () const const
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
bool hasFocus () const const
 
void setFocusProxy (QWidget *w)
 
QWidget * focusProxy () const const
 
Qt::ContextMenuPolicy contextMenuPolicy () const const
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void grabMouse ()
 
void grabMouse (const QCursor &cursor)
 
void releaseMouse ()
 
void grabKeyboard ()
 
void releaseKeyboard ()
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context)
 
void releaseShortcut (int id)
 
void setShortcutEnabled (int id, bool enable)
 
void setShortcutAutoRepeat (int id, bool enable)
 
bool updatesEnabled () const const
 
void setUpdatesEnabled (bool enable)
 
QGraphicsProxyWidget * graphicsProxyWidget () const const
 
void update ()
 
void repaint ()
 
void update (int x, int y, int w, int h)
 
void update (const QRect &rect)
 
void update (const QRegion &rgn)
 
void repaint (int x, int y, int w, int h)
 
void repaint (const QRect &rect)
 
void repaint (const QRegion &rgn)
 
virtual void setVisible (bool visible)
 
void setHidden (bool hidden)
 
void show ()
 
void hide ()
 
void showMinimized ()
 
void showMaximized ()
 
void showFullScreen ()
 
void showNormal ()
 
bool close ()
 
void raise ()
 
void lower ()
 
void stackUnder (QWidget *w)
 
void move (int x, int y)
 
void move (const QPoint &)
 
void resize (int w, int h)
 
void resize (const QSize &)
 
void setGeometry (int x, int y, int w, int h)
 
void setGeometry (const QRect &)
 
QByteArray saveGeometry () const const
 
bool restoreGeometry (const QByteArray &geometry)
 
void adjustSize ()
 
bool isVisible () const const
 
bool isVisibleTo (const QWidget *ancestor) const const
 
bool isHidden () const const
 
bool isMinimized () const const
 
bool isMaximized () const const
 
bool isFullScreen () const const
 
Qt::WindowStates windowState () const const
 
void setWindowState (Qt::WindowStates windowState)
 
virtual QSize sizeHint () const const
 
virtual QSize minimumSizeHint () const const
 
QSizePolicy sizePolicy () const const
 
void setSizePolicy (QSizePolicy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 
virtual int heightForWidth (int w) const const
 
virtual bool hasHeightForWidth () const const
 
QRegion visibleRegion () const const
 
void setContentsMargins (int left, int top, int right, int bottom)
 
void setContentsMargins (const QMargins &margins)
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const const
 
QMargins contentsMargins () const const
 
QRect contentsRect () const const
 
QLayout * layout () const const
 
void setLayout (QLayout *layout)
 
void updateGeometry ()
 
void setParent (QWidget *parent)
 
void setParent (QWidget *parent, Qt::WindowFlags f)
 
void scroll (int dx, int dy)
 
void scroll (int dx, int dy, const QRect &r)
 
QWidget * focusWidget () const const
 
QWidget * nextInFocusChain () const const
 
QWidget * previousInFocusChain () const const
 
bool acceptDrops () const const
 
void setAcceptDrops (bool on)
 
void addAction (QAction *action)
 
void addActions (QList< QAction * > actions)
 
void insertActions (QAction *before, QList< QAction * > actions)
 
void insertAction (QAction *before, QAction *action)
 
void removeAction (QAction *action)
 
QList< QAction * > actions () const const
 
QWidget * parentWidget () const const
 
void setWindowFlags (Qt::WindowFlags type)
 
Qt::WindowFlags windowFlags () const const
 
void setWindowFlag (Qt::WindowType flag, bool on)
 
void overrideWindowFlags (Qt::WindowFlags flags)
 
Qt::WindowType windowType () const const
 
QWidget * childAt (int x, int y) const const
 
QWidget * childAt (const QPoint &p) const const
 
void setAttribute (Qt::WidgetAttribute attribute, bool on)
 
bool testAttribute (Qt::WidgetAttribute attribute) const const
 
virtual QPaintEngine * paintEngine () const const override
 
void ensurePolished () const const
 
bool isAncestorOf (const QWidget *child) const const
 
bool hasEditFocus () const const
 
void setEditFocus (bool enable)
 
bool autoFillBackground () const const
 
void setAutoFillBackground (bool enabled)
 
QBackingStore * backingStore () const const
 
QWindow * windowHandle () const const
 
QScreen * screen () const const
 
void windowTitleChanged (const QString &title)
 
void windowIconChanged (const QIcon &icon)
 
void windowIconTextChanged (const QString &iconText)
 
void customContextMenuRequested (const QPoint &pos)
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const const
 
Qt::InputMethodHints inputMethodHints () const const
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
 QWIDGETSIZE_MAX QWIDGETSIZE_MAX
 
- Public Member Functions inherited from QObject
virtual const QMetaObject * metaObject () const const
 
 QObject (QObject *parent)
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
bool signalsBlocked () const const
 
bool blockSignals (bool block)
 
QThread * thread () const const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
void killTimer (int id)
 
T findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
const QObjectList & children () const const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectTree ()
 
void dumpObjectInfo ()
 
void dumpObjectTree () const const
 
void dumpObjectInfo () const const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const const
 
QList< QByteArray > dynamicPropertyNames () const const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObject * parent () const const
 
bool inherits (const char *className) const const
 
void deleteLater ()
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
T qobject_cast (QObject *object)
 
T qobject_cast (const QObject *object)
 
T qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
 Q_CLASSINFO (Name, Value)
 
 Q_INTERFACES (...)
 
 Q_PROPERTY (...)
 
 Q_ENUMS (...)
 
 Q_FLAGS (...)
 
 Q_ENUM (...)
 
 Q_FLAG (...)
 
 Q_ENUM_NS (...)
 
 Q_FLAG_NS (...)
 
 Q_OBJECT Q_OBJECT
 
 Q_GADGET Q_GADGET
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SLOTS Q_SLOTS
 
 Q_SLOT Q_SLOT
 
 Q_EMIT Q_EMIT
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
- Public Member Functions inherited from QPaintDevice
bool paintingActive () const const
 
virtual QPaintEngine * paintEngine () const const=0
 
int width () const const
 
int height () const const
 
int widthMM () const const
 
int heightMM () const const
 
int logicalDpiX () const const
 
int logicalDpiY () const const
 
int physicalDpiX () const const
 
int physicalDpiY () const const
 
int devicePixelRatio () const const
 
qreal devicePixelRatioF () const const
 
int colorCount () const const
 
int depth () const const
 

Public Attributes

TiledBuffer mTiledBuffer
 
- Public Attributes inherited from QWidget
typedef RenderFlags
 
 DrawWindowBackground
 
 DrawChildren
 
 IgnoreMask
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Public Attributes inherited from QPaintDevice
 PdmWidth
 
 PdmHeight
 
 PdmWidthMM
 
 PdmHeightMM
 
 PdmNumColors
 
 PdmDepth
 
 PdmDpiX
 
 PdmDpiY
 
 PdmPhysicalDpiX
 
 PdmPhysicalDpiY
 
 PdmDevicePixelRatio
 
 PdmDevicePixelRatioScaled
 

Protected Member Functions

bool event (QEvent *event) override
 
void tabletEvent (QTabletEvent *) override
 
void wheelEvent (QWheelEvent *) override
 
void mousePressEvent (QMouseEvent *) override
 
void mouseMoveEvent (QMouseEvent *) override
 
void mouseReleaseEvent (QMouseEvent *) override
 
void mouseDoubleClickEvent (QMouseEvent *) override
 
void keyPressEvent (QKeyEvent *) override
 
void keyReleaseEvent (QKeyEvent *) override
 
void paintEvent (QPaintEvent *) override
 
void resizeEvent (QResizeEvent *) override
 
- Protected Member Functions inherited from QWidget
virtual bool event (QEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void wheelEvent (QWheelEvent *event)
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void focusOutEvent (QFocusEvent *event)
 
virtual void enterEvent (QEvent *event)
 
virtual void leaveEvent (QEvent *event)
 
virtual void paintEvent (QPaintEvent *event)
 
virtual void moveEvent (QMoveEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void closeEvent (QCloseEvent *event)
 
virtual void contextMenuEvent (QContextMenuEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
virtual void actionEvent (QActionEvent *event)
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual void showEvent (QShowEvent *event)
 
virtual void hideEvent (QHideEvent *event)
 
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result)
 
virtual void changeEvent (QEvent *event)
 
virtual int metric (QPaintDevice::PaintDeviceMetric m) const const override
 
virtual void initPainter (QPainter *painter) const const override
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
void updateMicroFocus ()
 
void create (WId window, bool initializeWindow, bool destroyOldWindow)
 
void destroy (bool destroyWindow, bool destroySubWindows)
 
virtual bool focusNextPrevChild (bool next)
 
bool focusNextChild ()
 
bool focusPreviousChild ()
 
- Protected Member Functions inherited from QObject
QObject * sender () const const
 
int senderSignalIndex () const const
 
int receivers (const char *signal) const const
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
virtual int metric (QPaintDevice::PaintDeviceMetric metric) const const
 

Private Member Functions

void invalidatePainterCaches ()
 Invalidate the layer pixmap and camera painter caches.
 
void invalidateCacheForFrame (int frameNumber)
 Invalidate cache for the given frame.
 
void invalidateAllCache ()
 Invalidate all cache.
 
void invalidateCacheForDirtyFrames ()
 invalidate cache for dirty keyframes.
 
void invalidateOnionSkinsCacheAround (int frame)
 invalidate onion skin cache around frame
 
void prepOverlays (int frame)
 
void prepCameraPainter (int frame)
 
void prepCanvas (int frame)
 
void drawCanvas (int frame, QRect rect)
 
void settingUpdated (SETTING setting)
 
void paintSelectionVisuals (QPainter &painter)
 
BitmapImage * currentBitmapImage (Layer *layer) const
 
VectorImage * currentVectorImage (Layer *layer) const
 
void tabletReleaseEventFired ()
 
void handleDoubleClick ()
 

Private Attributes

Editor * mEditor = nullptr
 
LayerVisibility mLayerVisibility = LayerVisibility::ALL
 
bool mMakeInvisible = false
 
qreal mCurveSmoothingLevel = 0.0
 
int mDeltaFactor = 1
 
bool mMouseInUse = false
 
bool mTabletInUse = false
 
qreal mDevicePixelRatio = 1.
 
bool mIsFirstClick = true
 
int mDoubleClickMillis = 0
 
const int DOUBLE_CLICK_THRESHOLD = 500
 
QTimer * mDoubleClickTimer = nullptr
 
QPointF mTabletPressPos
 
int mTabletReleaseMillisAgo
 
const int MOUSE_FILTER_THRESHOLD = 200
 
QTimer * mMouseFilterTimer = nullptr
 
PreferenceManager * mPrefs = nullptr
 
QPixmap mCanvas
 
CanvasPainter mCanvasPainter
 
OverlayPainter mOverlayPainter
 
SelectionPainter mSelectionPainter
 
CameraPainter mCameraPainter
 
QPolygonF mOriginalPolygonF = QPolygonF()
 
QMap< unsigned int, QPixmapCache::Key > mPixmapCacheKeys
 
QLoggingCategory mLog { "ScribbleArea" }
 

Friends

class MoveTool
 
class SmudgeTool
 
class BucketTool
 

Additional Inherited Members

- Public Types inherited from QWidget
enum  RenderFlag
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric
 
- Static Public Member Functions inherited from QWidget
void setTabOrder (QWidget *first, QWidget *second)
 
QWidget * mouseGrabber ()
 
QWidget * keyboardGrabber ()
 
QWidget * find (WId id)
 
QWidget * createWindowContainer (QWindow *window, QWidget *parent, Qt::WindowFlags flags)
 
- Static Public Member Functions inherited from QObject
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
- Properties inherited from QWidget
 modal
 
 windowModality
 
 enabled
 
 geometry
 
 frameGeometry
 
 normalGeometry
 
 x
 
 y
 
 pos
 
 frameSize
 
 size
 
 width
 
 height
 
 rect
 
 childrenRect
 
 childrenRegion
 
 sizePolicy
 
 minimumSize
 
 maximumSize
 
 minimumWidth
 
 minimumHeight
 
 maximumWidth
 
 maximumHeight
 
 sizeIncrement
 
 baseSize
 
 palette
 
 font
 
 cursor
 
 mouseTracking
 
 tabletTracking
 
 isActiveWindow
 
 focusPolicy
 
 focus
 
 contextMenuPolicy
 
 updatesEnabled
 
 visible
 
 minimized
 
 maximized
 
 fullScreen
 
 sizeHint
 
 minimumSizeHint
 
 acceptDrops
 
 windowTitle
 
 windowIcon
 
 windowIconText
 
 windowOpacity
 
 windowModified
 
 toolTip
 
 toolTipDuration
 
 statusTip
 
 whatsThis
 
 accessibleName
 
 accessibleDescription
 
 layoutDirection
 
 windowFlags
 
 autoFillBackground
 
 styleSheet
 
 locale
 
 windowFilePath
 
 inputMethodHints
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Definition at line 50 of file scribblearea.h.

Constructor & Destructor Documentation

◆ ScribbleArea()

ScribbleArea::ScribbleArea ( QWidget *  parent)

Definition at line 48 of file scribblearea.cpp.

◆ ~ScribbleArea()

ScribbleArea::~ScribbleArea ( )
override

Definition at line 59 of file scribblearea.cpp.

Member Function Documentation

◆ applyTransformedSelection()

void ScribbleArea::applyTransformedSelection ( )

Definition at line 1344 of file scribblearea.cpp.

◆ blurBrush()

void ScribbleArea::blurBrush ( BitmapImage *  bmiSource_,
QPointF  srcPoint_,
QPointF  thePoint_,
qreal  brushWidth_,
qreal  offset_,
qreal  opacity_ 
)

Definition at line 1267 of file scribblearea.cpp.

◆ cancelTransformedSelection()

void ScribbleArea::cancelTransformedSelection ( )

Definition at line 1387 of file scribblearea.cpp.

◆ clearDrawingBuffer()

void ScribbleArea::clearDrawingBuffer ( )

Definition at line 822 of file scribblearea.cpp.

◆ clearImage

void ScribbleArea::clearImage ( )
slot

Definition at line 1483 of file scribblearea.cpp.

◆ currentBitmapImage()

BitmapImage * ScribbleArea::currentBitmapImage ( Layer *  layer) const
private

Definition at line 1055 of file scribblearea.cpp.

◆ currentTool()

BaseTool * ScribbleArea::currentTool ( ) const

Definition at line 1449 of file scribblearea.cpp.

◆ currentVectorImage()

VectorImage * ScribbleArea::currentVectorImage ( Layer *  layer) const
private

Definition at line 1062 of file scribblearea.cpp.

◆ decreaseLayerVisibilityIndex

void ScribbleArea::decreaseLayerVisibilityIndex ( )
slot

Definition at line 1438 of file scribblearea.cpp.

◆ deleteSelection()

void ScribbleArea::deleteSelection ( )

Definition at line 1454 of file scribblearea.cpp.

◆ drawBrush()

void ScribbleArea::drawBrush ( QPointF  thePoint,
qreal  brushWidth,
qreal  offset,
QColor  fillColor,
QPainter::CompositionMode  compMode,
qreal  opacity,
bool  usingFeather = true,
bool  useAA = false 
)

Definition at line 1181 of file scribblearea.cpp.

◆ drawCanvas()

void ScribbleArea::drawCanvas ( int  frame,
QRect  rect 
)
private

Definition at line 1136 of file scribblearea.cpp.

◆ drawPath()

void ScribbleArea::drawPath ( QPainterPath  path,
QPen  pen,
QBrush  brush,
QPainter::CompositionMode  cm 
)

Definition at line 1165 of file scribblearea.cpp.

◆ drawPen()

void ScribbleArea::drawPen ( QPointF  thePoint,
qreal  brushWidth,
QColor  fillColor,
bool  useAA = true 
)

Definition at line 1170 of file scribblearea.cpp.

◆ drawPencil()

void ScribbleArea::drawPencil ( QPointF  thePoint,
qreal  brushWidth,
qreal  fixedBrushFeather,
QColor  fillColor,
qreal  opacity 
)

Definition at line 1176 of file scribblearea.cpp.

◆ drawPolyline()

void ScribbleArea::drawPolyline ( QPainterPath  path,
QPen  pen,
bool  useAA 
)

Definition at line 1197 of file scribblearea.cpp.

◆ editor()

Editor * ScribbleArea::editor ( ) const
inline

Definition at line 64 of file scribblearea.h.

◆ endStroke()

void ScribbleArea::endStroke ( )

Definition at line 1216 of file scribblearea.cpp.

◆ event()

bool ScribbleArea::event ( QEvent *  event)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 379 of file scribblearea.cpp.

◆ flipSelection()

void ScribbleArea::flipSelection ( bool  flipVertical)

Definition at line 1225 of file scribblearea.cpp.

◆ getCentralPoint()

QPointF ScribbleArea::getCentralPoint ( )

Definition at line 1339 of file scribblearea.cpp.

◆ getCurveSmoothing()

qreal ScribbleArea::getCurveSmoothing ( ) const
inline

Definition at line 74 of file scribblearea.h.

◆ getLayerVisibility()

LayerVisibility ScribbleArea::getLayerVisibility ( ) const
inline

Definition at line 73 of file scribblearea.h.

◆ handleDoubleClick()

void ScribbleArea::handleDoubleClick ( )
private

Definition at line 687 of file scribblearea.cpp.

◆ handleDrawingOnEmptyFrame()

void ScribbleArea::handleDrawingOnEmptyFrame ( )

Call this when starting to use a paint tool.

Checks whether we are drawing on an empty frame, and if so, takes action according to use preference.

Definition at line 827 of file scribblearea.cpp.

◆ increaseLayerVisibilityIndex

void ScribbleArea::increaseLayerVisibilityIndex ( )
slot

Definition at line 1430 of file scribblearea.cpp.

◆ init()

bool ScribbleArea::init ( )

Definition at line 63 of file scribblearea.cpp.

◆ invalidateAllCache()

void ScribbleArea::invalidateAllCache ( )
private

Invalidate all cache.

call this if you're certain that the change you've made affects all frames

Definition at line 260 of file scribblearea.cpp.

◆ invalidateCacheForDirtyFrames()

void ScribbleArea::invalidateCacheForDirtyFrames ( )
private

invalidate cache for dirty keyframes.

Definition at line 208 of file scribblearea.cpp.

◆ invalidateCacheForFrame()

void ScribbleArea::invalidateCacheForFrame ( int  frameNumber)
private

Invalidate cache for the given frame.

Definition at line 272 of file scribblearea.cpp.

◆ invalidateOnionSkinsCacheAround()

void ScribbleArea::invalidateOnionSkinsCacheAround ( int  frame)
private

invalidate onion skin cache around frame

Definition at line 219 of file scribblearea.cpp.

◆ invalidatePainterCaches()

void ScribbleArea::invalidatePainterCaches ( )
private

Invalidate the layer pixmap and camera painter caches.

Call this in most situations where the layer rendering order is affected. Peviously known as setAllDirty.

Definition at line 283 of file scribblearea.cpp.

◆ isMouseInUse()

bool ScribbleArea::isMouseInUse ( ) const
inline

Definition at line 123 of file scribblearea.h.

◆ isPointerInUse()

bool ScribbleArea::isPointerInUse ( ) const
inline

Definition at line 125 of file scribblearea.h.

◆ isTabletInUse()

bool ScribbleArea::isTabletInUse ( ) const
inline

Definition at line 124 of file scribblearea.h.

◆ keyEvent()

void ScribbleArea::keyEvent ( QKeyEvent *  event)

Definition at line 483 of file scribblearea.cpp.

◆ keyEventForSelection()

void ScribbleArea::keyEventForSelection ( QKeyEvent *  event)

Definition at line 434 of file scribblearea.cpp.

◆ keyPressEvent()

void ScribbleArea::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 401 of file scribblearea.cpp.

◆ keyReleaseEvent()

void ScribbleArea::keyReleaseEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 511 of file scribblearea.cpp.

◆ liquifyBrush()

void ScribbleArea::liquifyBrush ( BitmapImage *  bmiSource_,
QPointF  srcPoint_,
QPointF  thePoint_,
qreal  brushWidth_,
qreal  offset_,
qreal  opacity_ 
)

Definition at line 1284 of file scribblearea.cpp.

◆ makeInvisible()

bool ScribbleArea::makeInvisible ( ) const
inline

Definition at line 75 of file scribblearea.h.

◆ mouseDoubleClickEvent()

void ScribbleArea::mouseDoubleClickEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 745 of file scribblearea.cpp.

◆ mouseMoveEvent()

void ScribbleArea::mouseMoveEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 728 of file scribblearea.cpp.

◆ mousePressEvent()

void ScribbleArea::mousePressEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 715 of file scribblearea.cpp.

◆ mouseReleaseEvent()

void ScribbleArea::mouseReleaseEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 736 of file scribblearea.cpp.

◆ onFrameModified()

void ScribbleArea::onFrameModified ( int  frameNumber)

Frame modified, invalidate cache for frame if any.

Definition at line 342 of file scribblearea.cpp.

◆ onFramesModified()

void ScribbleArea::onFramesModified ( )

Multiple frames modified, invalidate cache for affected frames.

Definition at line 333 of file scribblearea.cpp.

◆ onLayerChanged()

void ScribbleArea::onLayerChanged ( )

Layer changed, invalidate relevant cache.

Definition at line 357 of file scribblearea.cpp.

◆ onObjectLoaded()

void ScribbleArea::onObjectLoaded ( )

Object updated, invalidate all cache.

Definition at line 374 of file scribblearea.cpp.

◆ onOnionSkinTypeChanged()

void ScribbleArea::onOnionSkinTypeChanged ( )

Onion skin type changed, all frames will be affected.

All cache will be invalidated

Definition at line 369 of file scribblearea.cpp.

◆ onPlayStateChanged()

void ScribbleArea::onPlayStateChanged ( )

Playstate changed, invalidate relevant cache.

Definition at line 312 of file scribblearea.cpp.

◆ onScrubbed()

void ScribbleArea::onScrubbed ( int  frameNumber)

Frame scrubbed, invalidate relevant cache.

Definition at line 326 of file scribblearea.cpp.

◆ onSelectionChanged()

void ScribbleArea::onSelectionChanged ( )

Selection was changed, keep cache.

Definition at line 362 of file scribblearea.cpp.

◆ onTileCreated

void ScribbleArea::onTileCreated ( TiledBuffer *  tiledBuffer,
Tile *  tile 
)
slot

Definition at line 192 of file scribblearea.cpp.

◆ onTileUpdated

void ScribbleArea::onTileUpdated ( TiledBuffer *  tiledBuffer,
Tile *  tile 
)
slot

Definition at line 185 of file scribblearea.cpp.

◆ onToolChanged()

void ScribbleArea::onToolChanged ( ToolType  )

Tool changed, invalidate cache and frame if needed.

Definition at line 302 of file scribblearea.cpp.

◆ onToolPropertyUpdated()

void ScribbleArea::onToolPropertyUpdated ( ToolType  ,
ToolPropertyType  type 
)

Tool property updated, invalidate cache and frame if needed.

Definition at line 290 of file scribblearea.cpp.

◆ onViewChanged()

void ScribbleArea::onViewChanged ( )

View updated, invalidate relevant cache.

Definition at line 352 of file scribblearea.cpp.

◆ paintBitmapBuffer()

void ScribbleArea::paintBitmapBuffer ( )

Definition at line 775 of file scribblearea.cpp.

◆ paintEvent()

void ScribbleArea::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 880 of file scribblearea.cpp.

◆ paintSelectionVisuals()

void ScribbleArea::paintSelectionVisuals ( QPainter &  painter)
private

Definition at line 1040 of file scribblearea.cpp.

◆ paletteColorChanged

void ScribbleArea::paletteColorChanged ( QColor  color)
slot

Definition at line 1515 of file scribblearea.cpp.

◆ pointerMoveEvent()

void ScribbleArea::pointerMoveEvent ( PointerEvent *  event)

Definition at line 675 of file scribblearea.cpp.

◆ pointerPressEvent()

void ScribbleArea::pointerPressEvent ( PointerEvent *  event)

Definition at line 649 of file scribblearea.cpp.

◆ pointerReleaseEvent()

void ScribbleArea::pointerReleaseEvent ( PointerEvent *  event)

Definition at line 680 of file scribblearea.cpp.

◆ prepCameraPainter()

void ScribbleArea::prepCameraPainter ( int  frame)
private

Definition at line 1069 of file scribblearea.cpp.

◆ prepCanvas()

void ScribbleArea::prepCanvas ( int  frame)
private

Definition at line 1098 of file scribblearea.cpp.

◆ prepOverlays()

void ScribbleArea::prepOverlays ( int  frame)
private

Definition at line 1230 of file scribblearea.cpp.

◆ resizeEvent()

void ScribbleArea::resizeEvent ( QResizeEvent *  event)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 753 of file scribblearea.cpp.

◆ setCurveSmoothing

void ScribbleArea::setCurveSmoothing ( int  newSmoothingLevel)
slot

Definition at line 170 of file scribblearea.cpp.

◆ setEditor()

void ScribbleArea::setEditor ( Editor *  e)
inline

Definition at line 63 of file scribblearea.h.

◆ setEffect()

void ScribbleArea::setEffect ( SETTING  e,
bool  isOn 
)

Definition at line 176 of file scribblearea.cpp.

◆ setGaussianGradient()

void ScribbleArea::setGaussianGradient ( QGradient &  gradient,
QColor  color,
qreal  opacity,
qreal  offset 
)

Definition at line 1145 of file scribblearea.cpp.

◆ setLayerVisibility

void ScribbleArea::setLayerVisibility ( LayerVisibility  visibility)
slot

Definition at line 1422 of file scribblearea.cpp.

◆ settingUpdated()

void ScribbleArea::settingUpdated ( SETTING  setting)
private

Definition at line 107 of file scribblearea.cpp.

◆ showLayerNotVisibleWarning

void ScribbleArea::showLayerNotVisibleWarning ( )
slot

Definition at line 767 of file scribblearea.cpp.

◆ tabletEvent()

void ScribbleArea::tabletEvent ( QTabletEvent *  e)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 573 of file scribblearea.cpp.

◆ tabletReleaseEventFired()

void ScribbleArea::tabletReleaseEventFired ( )
private

Definition at line 699 of file scribblearea.cpp.

◆ toggleThinLines

void ScribbleArea::toggleThinLines ( )
slot

Definition at line 1416 of file scribblearea.cpp.

◆ updateFrame()

void ScribbleArea::updateFrame ( )

Update frame.

calls update() behind the scene and update cache if necessary

Definition at line 199 of file scribblearea.cpp.

◆ updateToolCursor

void ScribbleArea::updateToolCursor ( )
slot

Definition at line 165 of file scribblearea.cpp.

◆ wheelEvent()

void ScribbleArea::wheelEvent ( QWheelEvent *  event)
overrideprotectedvirtual

Reimplemented from QWidget.

Definition at line 539 of file scribblearea.cpp.

Friends And Related Function Documentation

◆ BucketTool

friend class BucketTool
friend

Definition at line 56 of file scribblearea.h.

◆ MoveTool

friend class MoveTool
friend

Definition at line 54 of file scribblearea.h.

◆ SmudgeTool

friend class SmudgeTool
friend

Definition at line 55 of file scribblearea.h.

Member Data Documentation

◆ DOUBLE_CLICK_THRESHOLD

const int ScribbleArea::DOUBLE_CLICK_THRESHOLD = 500
private

Definition at line 239 of file scribblearea.h.

◆ mCameraPainter

CameraPainter ScribbleArea::mCameraPainter
private

Definition at line 253 of file scribblearea.h.

◆ mCanvas

QPixmap ScribbleArea::mCanvas
private

Definition at line 249 of file scribblearea.h.

◆ mCanvasPainter

CanvasPainter ScribbleArea::mCanvasPainter
private

Definition at line 250 of file scribblearea.h.

◆ mCurveSmoothingLevel

qreal ScribbleArea::mCurveSmoothingLevel = 0.0
private

Definition at line 219 of file scribblearea.h.

◆ mDeltaFactor

int ScribbleArea::mDeltaFactor = 1
private

Definition at line 220 of file scribblearea.h.

◆ mDevicePixelRatio

qreal ScribbleArea::mDevicePixelRatio = 1.
private

Definition at line 232 of file scribblearea.h.

◆ mDoubleClickMillis

int ScribbleArea::mDoubleClickMillis = 0
private

Definition at line 237 of file scribblearea.h.

◆ mDoubleClickTimer

QTimer* ScribbleArea::mDoubleClickTimer = nullptr
private

Definition at line 240 of file scribblearea.h.

◆ mEditor

Editor* ScribbleArea::mEditor = nullptr
private

Definition at line 215 of file scribblearea.h.

◆ mIsFirstClick

bool ScribbleArea::mIsFirstClick = true
private

Definition at line 236 of file scribblearea.h.

◆ mLayerVisibility

LayerVisibility ScribbleArea::mLayerVisibility = LayerVisibility::ALL
private

Definition at line 217 of file scribblearea.h.

◆ mLog

QLoggingCategory ScribbleArea::mLog { "ScribbleArea" }
private

Definition at line 261 of file scribblearea.h.

◆ mMakeInvisible

bool ScribbleArea::mMakeInvisible = false
private

Definition at line 218 of file scribblearea.h.

◆ mMouseFilterTimer

QTimer* ScribbleArea::mMouseFilterTimer = nullptr
private

Definition at line 245 of file scribblearea.h.

◆ mMouseInUse

bool ScribbleArea::mMouseInUse = false
private

Definition at line 230 of file scribblearea.h.

◆ mOriginalPolygonF

QPolygonF ScribbleArea::mOriginalPolygonF = QPolygonF()
private

Definition at line 255 of file scribblearea.h.

◆ MOUSE_FILTER_THRESHOLD

const int ScribbleArea::MOUSE_FILTER_THRESHOLD = 200
private

Definition at line 243 of file scribblearea.h.

◆ mOverlayPainter

OverlayPainter ScribbleArea::mOverlayPainter
private

Definition at line 251 of file scribblearea.h.

◆ mPixmapCacheKeys

QMap<unsigned int, QPixmapCache::Key> ScribbleArea::mPixmapCacheKeys
private

Definition at line 258 of file scribblearea.h.

◆ mPrefs

PreferenceManager* ScribbleArea::mPrefs = nullptr
private

Definition at line 247 of file scribblearea.h.

◆ mSelectionPainter

SelectionPainter ScribbleArea::mSelectionPainter
private

Definition at line 252 of file scribblearea.h.

◆ mTabletInUse

bool ScribbleArea::mTabletInUse = false
private

Definition at line 231 of file scribblearea.h.

◆ mTabletPressPos

QPointF ScribbleArea::mTabletPressPos
private

Definition at line 241 of file scribblearea.h.

◆ mTabletReleaseMillisAgo

int ScribbleArea::mTabletReleaseMillisAgo
private

Definition at line 242 of file scribblearea.h.

◆ mTiledBuffer

TiledBuffer ScribbleArea::mTiledBuffer

Definition at line 183 of file scribblearea.h.


The documentation for this class was generated from the following files:
  • core_lib/src/interface/scribblearea.h
  • core_lib/src/interface/scribblearea.cpp
Generated on Thu May 8 2025 04:47:54 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39