| 1 |
/* |
| 2 |
* |
| 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: Sisheng He <[email protected]> |
| 20 |
* |
| 21 |
*/ |
| 22 |
#ifndef SLIDERWIDGET_H |
| 23 |
#define SLIDERWIDGET_H |
| 24 |
|
| 25 |
#include "kbaseframe.h" |
| 26 |
#include "klabel.h" |
| 27 |
#include "kslider.h" |
| 28 |
|
| 29 |
/** |
| 30 |
* @defgroup ContainerModules |
| 31 |
* @brief 创建一个带 KSlider 的 Frame |
| 32 |
* @since 3.0.1.0 |
| 33 |
* { |
| 34 |
*/ |
| 35 |
|
| 36 |
namespace kdk |
| 37 |
{ |
| 38 |
|
| 39 |
class KSliderFramePrivate; |
| 40 |
|
| 41 |
class KSliderFrame : public KBaseFrame |
| 42 |
{ |
| 43 |
Q_OBJECT |
| 44 |
|
| 45 |
public: |
| 46 |
/** |
| 47 |
* @brief 创建一个带 KSlider 的 Frame |
| 48 |
* |
| 49 |
* @param title: text of m_settingName |
| 50 |
* @param hasNode: 是否带节点 |
| 51 |
* @param style: 设置圆角(None:无圆角,Top:上圆角,Bottom:下圆角,Around:四圆角) |
| 52 |
* @param parent |
| 53 |
*/ |
| 54 |
explicit KSliderFrame(QString title, bool hasNode, QWidget *parent = nullptr, BorderRadiusStyle style = BorderRadiusStyle::None, Qt::Orientation orientation = Qt::Horizontal); |
| 55 |
~KSliderFrame(); |
| 56 |
|
| 57 |
/** |
| 58 |
* @brief 获取 m_slider |
| 59 |
* @return KSlider |
| 60 |
*/ |
| 61 |
KSlider *slider(); |
| 62 |
|
| 63 |
/** |
| 64 |
* @brief 获取滑动条左侧label |
| 65 |
* @return QLabel |
| 66 |
*/ |
| 67 |
QLabel *leftLabel(); |
| 68 |
|
| 69 |
/** |
| 70 |
* @brief 获取滑动条右侧label |
| 71 |
* @return QLabel |
| 72 |
*/ |
| 73 |
QLabel *rightLabel(); |
| 74 |
|
| 75 |
/** |
| 76 |
* @brief 获取label |
| 77 |
* |
| 78 |
* @return QLabel |
| 79 |
*/ |
| 80 |
KLabel *titleLabel(); |
| 81 |
|
| 82 |
/** |
| 83 |
* @brief 获取layout |
| 84 |
* |
| 85 |
* @return QHBoxLayout |
| 86 |
*/ |
| 87 |
QHBoxLayout *mainHLayout(); |
| 88 |
|
| 89 |
private: |
| 90 |
Q_DECLARE_PRIVATE(KSliderFrame) |
| 91 |
KSliderFramePrivate *const d_ptr; |
| 92 |
}; |
| 93 |
|
| 94 |
} |
| 95 |
#endif // SLIDERWIDGET_H |