#include <PainterGraphicsView.h>
|
| enum | DrawMode {
NONE = 0,
PAINT,
LINE,
RECT,
CIRCLE,
ELLIPSE,
POLYGON,
POLYLINE,
CURVE,
CLOSEDCURVE,
NUM_MODES
} |
| |
|
| void | onSelectionChanged () |
| | Call this Slot when the selected item in the scene changes.
|
| |
| void | changeBrush (QBrush brush) |
| | Call this Slot when the brush changes Updates the currently selected items.
|
| |
| void | changePen (QPen pen) |
| | Call this Slot when the pen changes Updates the currently selected items.
|
| |
| void | homeView () |
| | Resets the network graphics view's matrix.
|
| |
| void | frameAll () |
| | Changes the viewing transformation so that all items are visible at maximum zoom level.
|
| |
| void | frameSelected () |
| | Changes the viewing transformation so that the selected items are visible at maximum zoom level.
|
| |
| void | toggleScrollbars (bool visible) |
| | Toggles the visibility of scrollbars for the network graphics view.
|
| |
|
| void | triggerRedraw () |
| | This signal is emitted when the scene has changed.
|
| |
| void | sceneChanged (QGraphicsScene *scene) |
| | This signal is emitted when the scene has changed.
|
| |
| void | drawModeChanged (int mode) |
| | This signal is emitted when the drawmode has changed.
|
| |
| void | penChanged (QPen pen) |
| | This signal is emitted when the current pen has changed, e.g. by selection.
|
| |
| void | brushChanged (QBrush brush) |
| | This signal is emitted when the current brush has changed, e.g. by selection.
|
| |
| void | selectionChanged (QList< QGraphicsItem * > items) |
| | This signal is emitted when the scene selection changes.
|
| |
|
| virtual void | mouseMoveEvent (QMouseEvent *event) |
| | The overwritten event handler for the mouse move event.
|
| |
| virtual void | mousePressEvent (QMouseEvent *event) |
| | The overwritten event handler for the mouse press event.
|
| |
| virtual void | mouseReleaseEvent (QMouseEvent *event) |
| | The overwritten event handler for the mouse release event.
|
| |
| virtual void | keyPressEvent (QKeyEvent *event) |
| | The overwritten event handler for the key press event.
|
| |
| virtual void | keyReleaseEvent (QKeyEvent *event) |
| | Event handler for key release events.
|
| |
| virtual void | wheelEvent (QWheelEvent *event) |
| | Event handler for mouse wheel events.
|
| |
| void | zoomIn () |
| | Changes the scale of the graphics scene so that it appears bigger in the graphics view.
|
| |
| void | zoomOut () |
| | Changes the scale of the graphics scene so that it appears smaller in the graphics view.
|
| |
| void | setScale (qreal s) |
| | Sets the scale of the viewing transformation matrix that is used for displaying the graphics scene.
|
| |
| void | frame (const QRectF &rect) |
| | Sets the viewing transformation so that the given bounding rectangle is fully visible in the graphics view, and centers the bounding rectangle in the middle of the view.
|
| |
|
| bool | m_viewMode |
| | Flag that states whether the viewing mode is activated.
|
| |
| QPoint | m_lastPosition |
| | The last position of the mouse pointer over the viewport.
|
| |
- Enumerator:
| NONE |
|
| PAINT |
|
| LINE |
|
| RECT |
|
| CIRCLE |
|
| ELLIPSE |
|
| POLYGON |
|
| POLYLINE |
|
| CURVE |
|
| CLOSEDCURVE |
|
| NUM_MODES |
|
| PainterPanel::PainterGraphicsView::PainterGraphicsView |
( |
QWidget * |
parent = 0, |
|
|
Qt::WindowFlags |
flags = 0 |
|
) |
| |
Constructor of the PainterGraphicsView class.
Constructors and Destructors.
- Parameters
-
| parent | The parent widget the created instance will be a child of. |
| flags | Extra widget options. |
Constructor of the PainterGraphicsView class.
- Parameters
-
| parent | The parent widget the created instance will be a child of. |
| flags | Extra widget options. |
| PainterPanel::PainterGraphicsView::~PainterGraphicsView |
( |
| ) |
|
|
virtual |
Destructor of the PainterGraphicsView class.
Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.
| void PainterPanel::PainterGraphicsView::renderToImage |
( |
QImage & |
image | ) |
|
Render content of current scene to a QImage.
- Parameters
-
| image | The image to render to |
| void PainterPanel::PainterGraphicsView::setDrawMode |
( |
DrawMode |
drawmode | ) |
|
Set the current draw mode that defines which item is created on interaction with the graphics view.
- Parameters
-
| drawmode | The drawmode to be used |
Set the current scene painter graphics scene to the given scene and listen to changes of this scene.
- Parameters
-
| scene | The scene to be used |
| void PainterPanel::PainterGraphicsView::onSelectionChanged |
( |
| ) |
|
|
slot |
Call this Slot when the selected item in the scene changes.
Public Slots.
| void PainterPanel::PainterGraphicsView::changeBrush |
( |
QBrush |
brush | ) |
|
|
slot |
Call this Slot when the brush changes Updates the currently selected items.
- Parameters
-
| brush | The new brush to be applied to the selected items |
| void PainterPanel::PainterGraphicsView::changePen |
( |
QPen |
pen | ) |
|
|
slot |
Call this Slot when the pen changes Updates the currently selected items.
- Parameters
-
| pen | The new pen to be applied to the selected items |
| void PainterPanel::PainterGraphicsView::triggerRedraw |
( |
| ) |
|
|
signal |
This signal is emitted when the scene has changed.
| void PainterPanel::PainterGraphicsView::sceneChanged |
( |
QGraphicsScene * |
scene | ) |
|
|
signal |
This signal is emitted when the scene has changed.
| void PainterPanel::PainterGraphicsView::drawModeChanged |
( |
int |
mode | ) |
|
|
signal |
This signal is emitted when the drawmode has changed.
| void PainterPanel::PainterGraphicsView::penChanged |
( |
QPen |
pen | ) |
|
|
signal |
This signal is emitted when the current pen has changed, e.g. by selection.
| void PainterPanel::PainterGraphicsView::brushChanged |
( |
QBrush |
brush | ) |
|
|
signal |
This signal is emitted when the current brush has changed, e.g. by selection.
| void PainterPanel::PainterGraphicsView::selectionChanged |
( |
QList< QGraphicsItem * > |
items | ) |
|
|
signal |
This signal is emitted when the scene selection changes.
| void PainterPanel::PainterGraphicsView::mouseMoveEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
The overwritten event handler for the mouse move event.
- Parameters
-
| event | The description of the mouse move event. |
Reimplemented from Frapper::BaseGraphicsView.
| void PainterPanel::PainterGraphicsView::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
The overwritten event handler for the mouse press event.
The overwritten the event handler for the drag move event.
- Parameters
-
| event | The description of the mouse press event. |
| event | The description of the drag move event. |
Reimplemented from Frapper::BaseGraphicsView.
| void PainterPanel::PainterGraphicsView::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
The overwritten event handler for the mouse release event.
- Parameters
-
| event | The description of the mouse release event. |
Reimplemented from Frapper::BaseGraphicsView.
| void PainterPanel::PainterGraphicsView::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
protectedvirtual |
The overwritten event handler for the key press event.
- Parameters
-
| event | The description of the key press event. |
Reimplemented from Frapper::BaseGraphicsView.
| void PainterPanel::PainterGraphicsView::toggleDrawmode |
( |
| ) |
|
|
private |
Step through the different draw modes.
| void PainterPanel::PainterGraphicsView::clearScene |
( |
| ) |
|
|
private |
Clear the current and remove all items.
| BaseShapeItem * PainterPanel::PainterGraphicsView::createGraphicsItem |
( |
QPointF |
pos | ) |
|
|
private |
Create a new GraphicsItem at the given position according to the currently selected drawmode.
- Parameters
-
| pos | The initial position of the new graphics item |
The graphics item which is currently created.
| QBrush PainterPanel::PainterGraphicsView::m_brush |
|
private |
The current brush to apply to new graphics items.
| QPen PainterPanel::PainterGraphicsView::m_pen |
|
private |
The current pen to apply to new graphics items.
| DrawMode PainterPanel::PainterGraphicsView::m_drawMode |
|
private |
The documentation for this class was generated from the following files: