#include <graphic_view.h>
Collaboration diagram for GraphicView:
Public Types | |
Invalid = 0 | |
Arrow | |
Move | |
Zoom | |
Text | |
Image | |
Line | |
Polygon | |
Rectangle | |
Ellipse | |
enum | ToolBtn { Invalid = 0, Arrow, Move, Zoom, Text, Image, Line, Polygon, Rectangle, Ellipse } |
Public Slots | |
void | addGraphic (QGraphicsItem *) |
void | setSize (const QSize &) |
void | addScene (const QString &title=tr("untitled scene"), double time=0) |
void | deleteScene () |
void | renameScene () |
void | setSceneTime () |
void | paintNextScene () |
void | paint () |
void | setTool (QAction *) |
void | zoomIn () |
void | zoomOut () |
void | clear () |
void | save () |
void | saveAs () |
void | load () |
void | selectScene (int) |
void | updateScene (const QList< QRectF > &) |
void | remove () |
void | copy () |
void | cut () |
void | paste () |
Signals | |
void | updateSceneTime (double) |
void | updateProperty (ModuleInterface *) |
void | fileStatusChanged (const QString &) |
void | sendPasteStatus (bool) |
void | sendEditStatus (bool) |
Public Member Functions | |
GraphicView (QWidget *parent=0) | |
~GraphicView () | |
QTabBar * | sceneBar () |
Protected Member Functions | |
void | mouseMoveEvent (QMouseEvent *) |
void | mousePressEvent (QMouseEvent *) |
void | dragMoveEvent (QDragMoveEvent *) |
void | dropEvent (QDropEvent *) |
void | drawBackground (QPainter *, const QRectF &) |
Private Attributes | |
QMenu | m_editMenu |
QTabBar | m_sceneBar |
QString | m_filename |
QList< GraphicScene * > | m_scenes |
int | m_paintSceneIndex |
int | m_toolBtn |
QGraphicsItem * | m_tmpGraphic |
QList< QGraphicsItem * > | m_pasteContainer |
LCDPaintDevice | m_lcdDev |
enum GraphicView::ToolBtn |
GraphicView::GraphicView | ( | QWidget * | parent = 0 |
) |
GraphicView::~GraphicView | ( | ) |
void GraphicView::addGraphic | ( | QGraphicsItem * | item | ) | [slot] |
add a graphic item to the current scene
item | is the element that will be added |
void GraphicView::addScene | ( | const QString & | title = tr("untitled scene") , |
|
double | time = 0 | |||
) | [slot] |
add a new scene
title | is the title of the scene; displayed on the scene bar |
void GraphicView::clear | ( | ) | [slot] |
clears *all* scenes with his contents
void GraphicView::copy | ( | ) | [slot] |
copy and stores all currently selected items on the scene
void GraphicView::cut | ( | ) | [slot] |
void GraphicView::deleteScene | ( | ) | [slot] |
delete the current scene that is selected via the scene bar
void GraphicView::dragMoveEvent | ( | QDragMoveEvent * | event | ) | [protected] |
checks if a drag object have the correct mime data
void GraphicView::drawBackground | ( | QPainter * | painter, | |
const QRectF & | rect | |||
) | [protected] |
draws the background of the scene and the graphic view
void GraphicView::dropEvent | ( | QDropEvent * | event | ) | [protected] |
loads and adds the dropped plugin into the current scene
void GraphicView::fileStatusChanged | ( | const QString & | ) | [signal] |
emits every time when a file was loaded or saved
void GraphicView::load | ( | ) | [slot] |
load a project xml file into the program
void GraphicView::mouseMoveEvent | ( | QMouseEvent * | mouseEvent | ) | [protected] |
updates the position while creating a line, rectangle or ellipse
void GraphicView::mousePressEvent | ( | QMouseEvent * | mouseEvent | ) | [protected] |
creates a graphic item that depends on which tool button was pressed
void GraphicView::paint | ( | ) | [slot] |
paint all graphic items on the scene that is selected by paintNextScene(). Invoked also by TimerThread::updateItem() to update every graphic item PluginInterface::timer() method.
void GraphicView::paintNextScene | ( | ) | [slot] |
paint the next scene updated invoked by TimerThread::updateScene()
void GraphicView::paste | ( | ) | [slot] |
paste all stored items on the scene
void GraphicView::remove | ( | ) | [slot] |
removes all currently selected items on the scene
void GraphicView::renameScene | ( | ) | [slot] |
rename with a popup input dialog the current scene that is selected via the scene bar
void GraphicView::save | ( | ) | [slot] |
save all scenes and additional information of this project to a xml file
void GraphicView::saveAs | ( | ) | [slot] |
popup a file dialog where the user can choices the save location of the project xml file
QTabBar * GraphicView::sceneBar | ( | ) |
void GraphicView::selectScene | ( | int | nr | ) | [slot] |
set a scene via the scene bar
nr | is the scene that will be selected |
void GraphicView::sendEditStatus | ( | bool | ) | [signal] |
void GraphicView::sendPasteStatus | ( | bool | ) | [signal] |
void GraphicView::setSceneTime | ( | ) | [slot] |
change scene time to the next scene in minutes
void GraphicView::setSize | ( | const QSize & | size | ) | [slot] |
set the scene size for each available scene
size | is the new size of the scene |
void GraphicView::setTool | ( | QAction * | toolBtn | ) | [slot] |
set the selected tool button
toolBtn | is the selected button |
void GraphicView::updateProperty | ( | ModuleInterface * | ) | [signal] |
emits every time if a item was changed
void GraphicView::updateScene | ( | const QList< QRectF > & | rects | ) | [slot] |
overloaded scene event to clear the device and update visual property information
rects | is a list of areas that are modified therefore they have to be updated |
void GraphicView::updateSceneTime | ( | double | ) | [signal] |
emits every time when the paint scene was changed
void GraphicView::zoomIn | ( | ) | [slot] |
void GraphicView::zoomOut | ( | ) | [slot] |
QMenu GraphicView::m_editMenu [private] |
QString GraphicView::m_filename [private] |
filename of the current xml file
LCDPaintDevice GraphicView::m_lcdDev [private] |
give access to a lcd device for painting the scene content
int GraphicView::m_paintSceneIndex [private] |
current paint scene index that will be paint on the device
QList<QGraphicsItem *> GraphicView::m_pasteContainer [private] |
stores temporary slected items for cut, copy and paste actions
QTabBar GraphicView::m_sceneBar [private] |
with a scene bar you can add, remove or rename a scene
QList<GraphicScene*> GraphicView::m_scenes [private] |
contains all created scenes
QGraphicsItem* GraphicView::m_tmpGraphic [private] |
int GraphicView::m_toolBtn [private] |
stores the tool button id that is currently selected