Ignore:
Timestamp:
Aug 2, 2010, 5:05:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

vendor: Merged in qt-everywhere-opensource-src-4.6.3 from Nokia.

Location:
branches/vendor/nokia/qt/current/demos/composition
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/vendor/nokia/qt/current/demos/composition/composition.cpp

    r649 r767  
    4848#include <QMouseEvent>
    4949#include <qmath.h>
     50
     51
    5052
    5153CompositionWidget::CompositionWidget(QWidget *parent)
     
    237239{
    238240    m_animation_enabled = true;
     241
    239242#ifdef Q_WS_QWS
    240243    m_image = QPixmap(":res/composition/flower.jpg");
     
    263266    rect.translate(-size.width()/2, -size.height()/2);
    264267    return rect;
     268
     269
     270
     271
     272
     273
     274
     275
     276
     277
     278
     279
     280
     281
    265282}
    266283
     
    472489#endif
    473490    }
    474 
    475     if (m_animation_enabled && m_current_object == NoObject) {
    476         updateCirclePos();
    477     }
    478491}
    479492
     
    490503        m_current_object = NoObject;
    491504    }
     505
     506
     507
     508
    492509}
    493510
     
    501518    m_current_object = NoObject;
    502519
    503     if (m_animation_enabled)
     520    if (m_animation_enabled) {
     521        Q_ASSERT(!m_animationTimer);
     522        m_animationTimer = startTimer(animationInterval);
     523    }
     524}
     525
     526void CompositionRenderer::timerEvent(QTimerEvent *event)
     527{
     528    if (event->timerId() == m_animationTimer)
    504529        updateCirclePos();
    505530}
  • branches/vendor/nokia/qt/current/demos/composition/composition.h

    r649 r767  
    110110    void paint(QPainter *);
    111111
    112     void mousePressEvent(QMouseEvent *);
    113     void mouseMoveEvent(QMouseEvent *);
    114     void mouseReleaseEvent(QMouseEvent *);
    115 
    116112    void setCirclePos(const QPointF &pos);
    117113
     
    121117    int circleColor() const { return m_circle_hue; }
    122118    int circleAlpha() const { return m_circle_alpha; }
     119
     120
     121
     122
     123
     124
    123125
    124126public slots:
     
    151153    void setCircleAlpha(int alpha) { m_circle_alpha = alpha; update(); }
    152154    void setCircleColor(int hue) { m_circle_hue = hue; update(); }
    153     void setAnimationEnabled(bool enabled) { m_animation_enabled = enabled; update(); }
     155    void setAnimationEnabled(bool enabled)
    154156
    155157private:
     
    178180    ObjectType m_current_object;
    179181    bool m_animation_enabled;
     182
    180183
    181184#ifdef QT_OPENGL_SUPPORT
Note: See TracChangeset for help on using the changeset viewer.