Scribus
Open source desktop publishing at your fingertips
|
#include <canvasgesture_table.h>
Protected Member Functions | |
TableGesture (CanvasMode *parent) | |
TableGesture (ScribusView *view) | |
PageItem_Table * | table () const |
Returns the currently edited table. | |
void | setTable (PageItem_Table *table) |
Sets the currently edited table to table. | |
QPointF | globalToTableGrid (const QPoint point, bool snap=true) |
void | paintTableOutline (const QList< double > &rowHeights, const QList< double > &rowPositions, const QList< double > &columnWidths, const QList< double > &columnPositions, QPainter *p) |
void | paintCellSelection (QPainter *p) |
Protected Member Functions inherited from CanvasGesture | |
CanvasGesture (CanvasMode *parent) | |
CanvasGesture (ScribusView *view) | |
Protected Member Functions inherited from CanvasMode | |
CanvasMode (ScribusView *view) | |
void | setResizeCursor (int how, double rot=0.0) |
bool | commonMouseMove (QMouseEvent *m) |
void | commonDrawControls (QPainter *p, bool drawHandles) |
void | commonDrawTextCursor (QPainter *p, PageItem_TextFrame *textframe, const QPointF &offset) |
Draws the text cursor for textframe, offset by offset. | |
void | commonkeyPressEvent_NormalNodeEdit (QKeyEvent *e) |
void | commonkeyReleaseEvent (QKeyEvent *e) |
Additional Inherited Members | |
Public Member Functions inherited from CanvasGesture | |
virtual void | enterEvent (QEvent *e) |
virtual void | leaveEvent (QEvent *e) |
virtual void | dragEnterEvent (QDragEnterEvent *e) |
virtual void | dragMoveEvent (QDragMoveEvent *e) |
virtual void | dragLeaveEvent (QDragLeaveEvent *e) |
virtual void | dropEvent (QDropEvent *e) |
virtual void | mouseDoubleClickEvent (QMouseEvent *m) |
virtual void | mouseReleaseEvent (QMouseEvent *m) |
virtual void | mouseMoveEvent (QMouseEvent *m) |
virtual void | mousePressEvent (QMouseEvent *m) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | keyReleaseEvent (QKeyEvent *e) |
virtual void | inputMethodEvent (QInputMethodEvent *e) |
CanvasMode * | delegate () |
void | setDelegate (CanvasMode *delegate) |
Public Member Functions inherited from CanvasMode | |
virtual void | activate (bool fromGesture) |
virtual void | deactivate (bool forGesture) |
virtual bool | handleKeyEvents () |
virtual void | updateViewMode (CanvasViewMode *viewmode) |
virtual void | drawControls (QPainter *p) |
void | drawSelectionHandles (QPainter *psx, QRectF selectionRect, bool background, bool insideGroup=false, double sx=1.0, double sy=1.0) |
void | drawSelection (QPainter *psx, bool drawHandles) |
void | drawSnapLine (QPainter *psx) |
void | drawOutline (QPainter *p, double scalex=1.0, double scaley=1.0, double deltax=0.0, double deltay=0.0) |
QCursor | modeCursor () |
void | setModeCursor () |
ScribusView * | view () const |
Static Public Member Functions inherited from CanvasMode | |
static CanvasMode * | createForAppMode (ScribusView *view, int appMode) |
Protected Attributes inherited from CanvasGesture | |
CanvasMode * | m_delegate |
Protected Attributes inherited from CanvasMode | |
ScribusView *const | m_view |
Canvas *const | m_canvas |
ScribusDoc *const | m_doc |
PanGesture * | m_panGesture |
UndoManager * | undoManager |
double | xSnap |
double | ySnap |
Base class for table editing canvas gestures.
TableGesture is a base class for the gestures for table editing gestures used by the table editing canvas mode. It simply holds the currently edited table and provides some functions common to the table editing gestures. Apart from that it leaves everything else up to the subclasses.
|
protected |
Returns a copy of point, which is in global coordinates, mapped to coordinates on the table grid of the currently edited table. If snap is true
, point is first snapped to the page grid and guides, in that order.
|
protected |
Paints the selection of the currently edited table.
|
protected |
Paints the outline of the currently edited table.
Instead of using row and column geometries of the table, they are taken from the parameters rowHeights, rowPositions, columnWidths and columnPositions. The size of these vectors must match the dimensions of the currently edited table, or the result of this function is undefined.
cellAt() and cellRect() are fast, stroking is not. So we paint the left and top edges of the cells in two passes as this allows us to greatly minimize the number of strokes.