Declare the QTimer as a member in you class. h file: class Ball: public QObject, public QGraphicsRectItem{ { Q_OBJECT public: // constructor ...
確定! 回上一頁