Q_OBJECT
public:
- AbstractScopeWidget(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
+ AbstractScopeWidget(Monitor *projMonitor, Monitor *clipMonitor, bool trackMouse = false, QWidget *parent = 0);
virtual ~AbstractScopeWidget(); // Must be virtual because of inheritance, to avoid memory leaks
QPalette m_scopePalette;
Has to be called in the implementing object. */
void init();
+ /** Does this scope have auto-refresh enabled */
+ bool autoRefreshEnabled();
+
///// Unimplemented /////
virtual QString widgetName() const = 0;
+ ///// Variables /////
+ static const QPen penThick;
+ static const QPen penThin;
+ static const QPen penLight;
+ static const QPen penDark;
+
protected:
///// Variables /////
how many times faster the scope should be calculated. */
QAction *m_aRealtime;
+ /** The mouse position; Updated when the mouse enters the widget
+ AND mouse tracking has been enabled. */
+ QPoint m_mousePos;
+ /** Knows whether the mouse currently lies within the widget or not.
+ Can e.g. be used for drawing a HUD only when the mouse is in the widget. */
+ bool m_mouseWithinWidget;
/** Offset from the widget's borders */
const uchar offset;
///// Reimplemented /////
+ void mouseMoveEvent(QMouseEvent *);
+ void leaveEvent(QEvent *);
void mouseReleaseEvent(QMouseEvent *);
void paintEvent(QPaintEvent *);
- void raise();
void resizeEvent(QResizeEvent *);
- void showEvent(QShowEvent *);
+ void showEvent(QShowEvent *); // Called when the widget is activated via the Menu entry
+ // void raise(); // Called only when manually calling the event -> useless
+
protected slots:
/** Forces an update of all layers. */
- void forceUpdate();
+ void forceUpdate(bool doUpdate = true);
void forceUpdateHUD();
void forceUpdateScope();
void forceUpdateBackground();
void signalScopeRenderingFinished(uint mseconds, uint accelerationFactor);
void signalBackgroundRenderingFinished(uint mseconds, uint accelerationFactor);
+ /** For the mouse position itself see m_mousePos.
+ To check whether the mouse has leaved the widget, see m_mouseWithinWidget. */
+ void signalMousePositionChanged();
+
+ /** Do we need the renderer to send its frames to us? */
+ void requestAutoRefresh(bool);
+
private:
/** Counts the number of frames that have been rendered in the active monitor.