| 1 |
/* |
| 2 |
* libkysdk-qtwidgets's Library |
| 3 |
* |
| 4 |
* Copyright (C) 2023, KylinSoft Co., Ltd. |
| 5 |
* |
| 6 |
* This library is free software; you can redistribute it and/or |
| 7 |
* modify it under the terms of the GNU Lesser General Public |
| 8 |
* License as published by the Free Software Foundation; either |
| 9 |
* version 3 of the License, or (at your option) any later version. |
| 10 |
* |
| 11 |
* This library is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
* Lesser General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with this library. If not, see <https://www.gnu.org/licenses/>. |
| 18 |
* |
| 19 |
* Authors: Zhenyu Wang <[email protected]> |
| 20 |
* |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef KLOOPPLAYPAGE_H |
| 24 |
#define KLOOPPLAYPAGE_H |
| 25 |
|
| 26 |
#include "gui_g.h" |
| 27 |
#include <QWidget> |
| 28 |
|
| 29 |
namespace kdk |
| 30 |
{ |
| 31 |
|
| 32 |
class KLoopPlayPagePrivate; |
| 33 |
|
| 34 |
/** |
| 35 |
* @defgroup FrameModule |
| 36 |
* @brief 轮播图片控件 |
| 37 |
* @since 2.5.2.0 |
| 38 |
* { |
| 39 |
*/ |
| 40 |
|
| 41 |
class GUI_EXPORT KLoopPlayPage : public QWidget |
| 42 |
{ |
| 43 |
Q_OBJECT |
| 44 |
public: |
| 45 |
KLoopPlayPage(QWidget *parent = nullptr); |
| 46 |
|
| 47 |
/** |
| 48 |
* @brief 添加widget |
| 49 |
* @param widget |
| 50 |
*/ |
| 51 |
void addWidget(QWidget *widget); |
| 52 |
|
| 53 |
/** |
| 54 |
* @brief 删除widget |
| 55 |
* @param widget |
| 56 |
*/ |
| 57 |
void removeWidget(QWidget *widget); |
| 58 |
|
| 59 |
/** |
| 60 |
* @brief 设置当前中心界面 |
| 61 |
* @param i |
| 62 |
*/ |
| 63 |
void setCurrentWidget(int i); |
| 64 |
|
| 65 |
/** |
| 66 |
* @brief 获取当前中心界面index |
| 67 |
* @return |
| 68 |
*/ |
| 69 |
int currentWidget(); |
| 70 |
|
| 71 |
/** |
| 72 |
* @brief 设置窗体间距 |
| 73 |
* @param spacing |
| 74 |
*/ |
| 75 |
void setWidgetSpacing(int spacing); |
| 76 |
|
| 77 |
/** |
| 78 |
* @brief 设置轮播时长 |
| 79 |
* @param time |
| 80 |
*/ |
| 81 |
void setLoopTime(int time); |
| 82 |
|
| 83 |
Q_SIGNALS: |
| 84 |
void leftClick(); |
| 85 |
void centerClick(); |
| 86 |
void rightClick(); |
| 87 |
|
| 88 |
protected: |
| 89 |
void resizeEvent(QResizeEvent *event); |
| 90 |
void paintEvent(QPaintEvent *event); |
| 91 |
void showEvent(QShowEvent *event) override; |
| 92 |
|
| 93 |
private: |
| 94 |
KLoopPlayPagePrivate *const d_ptr; |
| 95 |
Q_DECLARE_PRIVATE(KLoopPlayPage) |
| 96 |
}; |
| 97 |
|
| 98 |
} |
| 99 |
|
| 100 |
#endif // KLOOPPLAYPAGE_H |