VirtualBox

Ignore:
Timestamp:
May 23, 2013 3:16:35 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
85971
Message:

FE/Qt: Animation framework rework.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIAnimationFramework.h

    r46195 r46242  
    2020#define __UIAnimationFramework_h__
    2121
     22/* Qt includes: */
     23#include <QObject>
     24
    2225/* Forward declaration: */
    2326class QStateMachine;
     27class QPropertyAnimation;
    2428
    25 /* UIAnimationFramework namespace: */
    26 namespace UIAnimationFramework
     29/* UIAnimation factory: */
     30class UIAnimation : public QObject
    2731{
    28     /* API: Animation stuff: */
    29     QStateMachine* installPropertyAnimation(QWidget *pTarget, const char *pszPropertyName,
    30                                             const char *pszValuePropertyNameStart, const char *pszValuePropertyNameFinal,
    31                                             const char *pSignalForward, const char *pSignalBackward,
    32                                             bool fReversive = false, int iAnimationDuration = 300);
    33 }
     32    Q_OBJECT;
     33
     34public:
     35
     36    /* API: Factory stuff: */
     37    static UIAnimation* installPropertyAnimation(QWidget *pTarget, const char *pszPropertyName,
     38                                                 const char *pszValuePropertyNameStart, const char *pszValuePropertyNameFinal,
     39                                                 const char *pszSignalForward, const char *pszSignalReverse,
     40                                                 bool fReverse = false, int iAnimationDuration = 300);
     41
     42    /* API: Update stuff: */
     43    void update();
     44
     45protected:
     46
     47    /* Constructor: */
     48    UIAnimation(QWidget *pParent, const char *pszPropertyName,
     49                const char *pszValuePropertyNameStart, const char *pszValuePropertyNameFinal,
     50                const char *pszSignalForward, const char *pszSignalReverse,
     51                bool fReverse, int iAnimationDuration);
     52
     53private:
     54
     55    /* Helper: Prepare stuff: */
     56    void prepare();
     57
     58    /* Variables: General stuff: */
     59    const char *m_pszPropertyName;
     60    const char *m_pszValuePropertyNameStart;
     61    const char *m_pszValuePropertyNameFinal;
     62    const char *m_pszSignalForward;
     63    const char *m_pszSignalReverse;
     64    bool m_fReverse;
     65    int m_iAnimationDuration;
     66
     67    /* Variables: Animation-machine stuff: */
     68    QStateMachine *m_pAnimationMachine;
     69    QPropertyAnimation *m_pForwardAnimation;
     70    QPropertyAnimation *m_pReverseAnimation;
     71};
    3472
    3573#endif /* __UIAnimationFramework_h__ */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette