Inherited by ClipsViewPort, MeterWidget, SheetPanelViewPort, TimeLineViewPort, and TrackPanelViewPort.
Public Member Functions | |
| ViewPort (QWidget *parent) | |
| ViewPort (QGraphicsScene *scene, QWidget *parent) | |
| virtual void | get_pointed_context_items (QList< ContextItem * > &list)=0 |
| void | set_holdcursor (const QString &cursorName) |
| void | set_holdcursor_text (const QString &text) |
| void | set_holdcursor_pos (QPoint pos) |
| void | set_current_mode (int mode) |
| void | reset_cursor () |
| void | set_jogging (bool jog) |
| int | get_current_mode () const |
Protected Member Functions | |
| virtual bool | event (QEvent *event) |
| virtual void | leaveEvent (QEvent *event) |
| virtual void | enterEvent (QEvent *) |
| virtual void | paintEvent (QPaintEvent *e) |
| virtual void | mouseMoveEvent (QMouseEvent *e) |
| virtual void | mousePressEvent (QMouseEvent *e) |
| virtual void | mouseReleaseEvent (QMouseEvent *e) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
| virtual void | wheelEvent (QWheelEvent *e) |
| virtual void | keyPressEvent (QKeyEvent *e) |
| virtual void | keyReleaseEvent (QKeyEvent *e) |
| void | tabletEvent (QTabletEvent *event) |
Friends | |
| class | Interface |
The ViewPort class inherits QGraphicsView, and thus is a true Canvas type of Widget.
Reimplement ViewPort to create a 'Soft Selection' enabled widget. You have to create
a QGraphicsScene object yourself, and set it as the scene the ViewPort visualizes.
ViewPort should be used to visualize 'core' data objects. This is done by creating a
ViewItem object for each core class that has to be visualized. The naming convention
for classes that inherit ViewItem is: core class name + View.
E.g. the ViewItem class that represents an AudioClip should be named AudioClipView.
All keyboard and mouse events by default are propagated to the InputEngine, which in
turn will parse the events. In case the event sequence was recognized by the InputEngine
it will ask a list of (pointed) ContextItem's from ContextPointer, which in turns
call's the pure virtual function get_pointed_context_items(), which you have to reimplement.
In the reimplemented function, you have to fill the supplied list with ViewItems that are
under the mouse cursor, and if needed, ViewItem's that _always_ have to be taken into account.
One can use the convenience functions of QGraphicsView for getting ViewItem's under the mouse cursor!
Since there can be a certain delay before a key sequence has been verified, the ContextPointer
stores the position of the first event of a new key fact. This improves the pointed ViewItem
detection a lot in case the mouse is moved during a key sequence.
You should use these x/y coordinates in the get_pointed_context_items() function, see:
ContextPointer::on_first_input_event_x(), ContextPointer::on_first_input_event_y()
1.5.5