Debian Codegraph @

kysdk-qtwidgets/src/knavigationtrail.h

raw
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 KNAVIGATIONTRAIL_H
24 #define KNAVIGATIONTRAIL_H
25
26 #include "kcrumb.h"
27 #include <QWidget>
28
29 namespace kdk
30 {
31
32 enum ButtonPosition {
33 LeftPosition,
34 LeftOrRight,
35 RightPosition
36 };
37
38 /**
39 * @defgroup BarModule
40 * @since 2.5.2.0
41 */
42 class KNavigationTrailPrivate;
43
44 class KNavigationTrail : public QWidget
45 {
46 Q_OBJECT
47 public:
48 KNavigationTrail(QWidget *parent = nullptr);
49
50 /**
51 * @brief 获取kcrumb
52 * @return
53 */
54 KCrumb *crumb();
55
56 /**
57 * @brief 设置箭头位置
58 * @param type
59 */
60 void setPosition(ButtonPosition type);
61
62 Q_SIGNALS:
63 /**
64 * @brief 点击会发出信号
65 */
66 void sizeChange();
67
68 protected:
69 void resizeEvent(QResizeEvent *event);
70
71 private:
72 Q_DECLARE_PRIVATE(KNavigationTrail)
73 KNavigationTrailPrivate *const d_ptr;
74 };
75
76 }
77
78 #endif // KNAVIGATIONTRAIL_H