-
Notifications
You must be signed in to change notification settings - Fork 3
/
RibbonGallery.h
73 lines (44 loc) · 1.36 KB
/
RibbonGallery.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// Created by weiwu on 21-4-30.
//
#ifndef RIBBON_RIBBONGALLERY_H
#define RIBBON_RIBBONGALLERY_H
#include <QtWidgets/QFrame>
#include "RibbonGalleryGroup.h"
class QVBoxLayout;
class RibbonGalleryPrivate;
class RibbonGalleryViewport;
class RibbonGalleryViewport : public QWidget {
Q_OBJECT
public:
RibbonGalleryViewport(QWidget *parent);
void addWidget(QWidget *w);
private:
QVBoxLayout *m_layout;
};
class RibbonGallery : public QFrame {
Q_OBJECT
public:
RibbonGallery(QWidget *parent = 0);
virtual ~RibbonGallery();
virtual QSize sizeHint() const Q_DECL_OVERRIDE;
virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
RibbonGalleryGroup *addGalleryGroup();
RibbonGalleryGroup *addCategoryActions(const QString &title, QList<QAction *> actions);
void setCurrentViewGroup(RibbonGalleryGroup *group);
RibbonGalleryGroup *currentViewGroup() const;
protected slots:
virtual void onPageDown();
virtual void onPageUp();
virtual void onShowMoreDetail();
void onItemClicked(const QModelIndex &index);
private:
RibbonGalleryViewport *ensureGetPopupViewPort();
protected:
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
friend class RibbonGalleryPrivate;
RibbonGalleryPrivate *m_d;
};
#endif //RIBBON_RIBBONGALLERY_H