|
roviz
0.7
Code Documentation of roviz
|
The AbstractWindowItem class provides basic standard functionality for a typical item that uses a window. More...
#include <abstract_window_item.h>


Public Member Functions | |
| AbstractWindowItem (QString const &typeName) | |
| Constructs a AbstractWindowItem with the given name. More... | |
Public Member Functions inherited from AbstractItem | |
| AbstractItem (QString typeName) | |
| Constructs an AbstractItem with the name typeName. More... | |
| QString | typeName () const |
| QString | name () const |
| QString | description () const |
| void | setName (QString name) |
| Set this items name. More... | |
| QRectF | boundingRect () const override |
| Returns the bounding box of the item. More... | |
| QPainterPath | shape () const override |
| Returns the graphical shape of the item's image. More... | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) override |
| Paints the contents of the item. More... | |
| QList< ItemInput * > const | inputs () const |
| QList< ItemOutput * > const | outputs () const |
| QImage const | image () const |
| int | progress () const |
| virtual bool | load (class QDomElement &element) |
| Loads persistent settings for this item from given XML element. More... | |
| virtual bool | save (class QDomDocument &document, class QDomElement &element) const |
| Saves persistent settings for this item into the given XML element. More... | |
| SettingsScope * | settingsScope () const |
| Returns a pointer to the settings scope associated with this item. More... | |
Protected Slots | |
| virtual void | openWindow () |
| This is a default implementation of a slot which opens this items window, if any. If the item is not allocated yet, it uses allocateWindow to request one from the derived class. Override this function for custom behavior. | |
Protected Member Functions | |
| virtual QMainWindow * | allocateWindow ()=0 |
| This is a pure virtual function. The implementation has to construct and return a QMainWindow which this base class can then manage. More... | |
| QMainWindow * | window () const |
| void | setWindow (QMainWindow *window) |
| void | deleteWindow () |
| Deletes the window of this item. More... | |
| void | hideWindow () |
| Hides the window of this item. More... | |
| void | setOpenWindowContextActionEnabled (bool enabled) const |
| This function allows the derived class to enable or disable the context menu option to open this items window for the current context menu. It is typically called in contextMenuPrepare, if needed. The value is reset to its default (true) whenever the user opens a new context menu. More... | |
| QAction * | addContextMenuEntry (QString const &text, std::function< void()> f=nullptr) |
| This function adds a new context menu entry. More... | |
| virtual void | contextMenuPrepare (QMenu &menu) const |
| This method is called with an empty QMenu whenever a contextmenu on the current item is requested. Add Actions to Display them in the Menu. More... | |
| virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
| A simple default implementation of the mouseDoubleClickEvent. Override to do custom things (e.g. open window) More... | |
Protected Member Functions inherited from AbstractItem | |
| ItemInput * | addInput (int transportType, QString const &description="") |
| Adds an input to this item. More... | |
| ItemOutput * | addOutput (int transportType, QString const &description="") |
| Adds an output to this item. More... | |
| void | remove (ItemInput *input) |
| Removes an input from this item. More... | |
| void | remove (ItemOutput *output) |
| Removes an output from this item. More... | |
| void | clearInputs () |
| Remove all the inputs from this item. More... | |
| void | clearOutputs () |
| Remove all the outputs from this item. More... | |
| void | setDescription (QString const &description) |
| Set the description of the item. More... | |
| void | setImage (QImage const &image) |
| Set the image displayed in the item. More... | |
| void | setOutputData (ItemOutput *output, QObject *data) |
| Set the data of a given output. More... | |
| void | setProgress (int progress) |
| Set the current progress of the item. More... | |
| void | setProgressAutohide (int ms) |
| Sets the progress to -1 after a certain amount of time. More... | |
| virtual void | paintItemBox (QPainter *painter) |
| This Method paints the Item Rectangle, the Icon and the progress bar of the item. Override for custom behavior. More... | |
| void | timerEvent (QTimerEvent *t) override |
| QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
| void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) override |
Additional Inherited Members | |
Public Slots inherited from AbstractItem | |
| void | disconnectConnections () |
| Disconnects all connections from/to the item. | |
Signals inherited from AbstractItem | |
| void | changed () |
| This signal should be emitted by the derived class whenever the items state has changed and needs to be saved again. | |
| void | nameChanged () |
| This signal is emitted whenever the name has changed. | |
| void | descriptionChanged () |
| This signal is emitted whenever the description has changed. | |
| void | progressChanged () |
| This signal is emitted whenever the progress has changed. | |
Static Public Member Functions inherited from AbstractItem | |
| static int | connectorHeight () |
| static int | connectorWidth () |
| static bool | registerConnectorStyle (QColor const &color, int transportType) |
| Register a connector style for a transport type. More... | |
| static QPen | connectorStyle (int transportType) |
Properties inherited from AbstractItem | |
| SettingsScope | settingsScope |
The AbstractWindowItem class provides basic standard functionality for a typical item that uses a window.
It has a pure virtual function, allocateWindow. This function needs to be implemented by the derived class and is used by this base class to construct a window for this item.
|
explicit |
Constructs a AbstractWindowItem with the given name.
| typeName | The name of the item to construct |
|
protected |
This function adds a new context menu entry.
| text | The text to display for the context menu entry |
| f | The function to call when the user clicks the context menu entry |
|
protectedpure virtual |
This is a pure virtual function. The implementation has to construct and return a QMainWindow which this base class can then manage.

|
protectedvirtual |
This method is called with an empty QMenu whenever a contextmenu on the current item is requested. Add Actions to Display them in the Menu.
| menu | The menu to append your items to. |
Reimplemented from AbstractItem.

|
protected |
Deletes the window of this item.
|
protected |
Hides the window of this item.
|
protectedvirtual |
A simple default implementation of the mouseDoubleClickEvent. Override to do custom things (e.g. open window)
| event | Mouse event context information |
Reimplemented from AbstractItem.

|
protected |
This function allows the derived class to enable or disable the context menu option to open this items window for the current context menu. It is typically called in contextMenuPrepare, if needed. The value is reset to its default (true) whenever the user opens a new context menu.
| enabled | Whether or not to enable the context menu option to open the window |
|
protected |
| window | The window to couple this item to |

|
protected |

1.8.13