-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcarousel3dview.hpp
More file actions
43 lines (34 loc) · 1.15 KB
/
carousel3dview.hpp
File metadata and controls
43 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include <QGraphicsView>
class Carousel3DView : public QGraphicsView
{
Q_OBJECT
Q_PROPERTY(int animationDuration READ animationDuration WRITE setAnimationDuration)
Q_PROPERTY(int autoRotationInterval READ autoRotationInterval WRITE setAutoRotationInterval)
Q_PROPERTY(bool autoRotationEnabled READ isAutoRotationEnabled WRITE setAutoRotationEnabled)
public:
explicit Carousel3DView(QWidget *parent = nullptr);
~Carousel3DView();
// 动画设置
void setAnimationDuration(int duration);
int animationDuration() const;
// 自动轮播设置
void setAutoRotationInterval(int interval);
int autoRotationInterval() const;
void setAutoRotationEnabled(bool enabled);
bool isAutoRotationEnabled() const;
public slots:
void rotateToNext();
void rotateToPrevious();
void startAutoRotation();
void stopAutoRotation();
void toggleAutoRotation();
private slots:
void onItemClicked();
protected:
void resizeEvent(QResizeEvent *event) override;
void showEvent(QShowEvent *event) override;
private:
class Carousel3DViewPrivate;
QScopedPointer<Carousel3DViewPrivate> d_ptr;
};