From bf8e7c4fc830352bbd0c47ddb4a3b76b267e7cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 26 Oct 2012 09:46:03 +0200 Subject: [PATCH] Add QProperties to MouseClick Effect Allows to read out all settings at runtime through supportInformation. --- effects/mouseclick/mouseclick.h | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/effects/mouseclick/mouseclick.h b/effects/mouseclick/mouseclick.h index 8695d3735f..563554026d 100644 --- a/effects/mouseclick/mouseclick.h +++ b/effects/mouseclick/mouseclick.h @@ -88,6 +88,16 @@ class MouseClickEffect : public Effect { Q_OBJECT + Q_PROPERTY(QColor color1 READ color1) + Q_PROPERTY(QColor color2 READ color2) + Q_PROPERTY(QColor color3 READ color3) + Q_PROPERTY(qreal lineWidth READ lineWidth) + Q_PROPERTY(int ringLife READ ringLife) + Q_PROPERTY(int ringSize READ ringSize) + Q_PROPERTY(int ringCount READ ringCount) + Q_PROPERTY(bool showText READ isShowText) + Q_PROPERTY(QFont font READ font) + Q_PROPERTY(bool enabled READ isEnabled) public: MouseClickEffect(); ~MouseClickEffect(); @@ -97,6 +107,38 @@ public: virtual void postPaintScreen(); virtual bool isActive() const; + // for properties + QColor color1() const { + return m_colors[0]; + } + QColor color2() const { + return m_colors[1]; + } + QColor color3() const { + return m_colors[2]; + } + qreal lineWidth() const { + return m_lineWidth; + } + int ringLife() const { + return m_ringLife; + } + int ringSize() const { + return m_ringMaxSize; + } + int ringCount() const { + return m_ringCount; + } + bool isShowText() const { + return m_showText; + } + QFont font() const { + return m_font; + } + bool isEnabled() const { + return m_enabled; + } + static bool supported(); private slots: void toggleEnabled();