yhkylin-backup-tools/kybackup/leftsiderbarwidget.h

61 lines
1.4 KiB
C
Raw Permalink Normal View History

2021-09-16 16:05:46 +08:00
#ifndef LEFTSIDERBARWIDGET_H
#define LEFTSIDERBARWIDGET_H
#include <QWidget>
#include <QObject>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QButtonGroup>
2022-02-15 16:51:03 +08:00
#include <QGSettings>
2021-09-16 16:05:46 +08:00
#include "functypeconverter.h"
2021-10-13 16:31:58 +08:00
#include "component/mylabel.h"
2022-03-02 11:24:54 +08:00
#include "component/pixmaplabel.h"
2022-05-06 17:58:37 +08:00
#include "knavigationbar.h"
using namespace kdk;
2021-09-16 16:05:46 +08:00
class LeftsiderbarWidget : public QWidget
{
Q_OBJECT
public:
// 启动模式,不同模式启动时展示的功能模块不同
enum StartMode {
normal,
2023-03-17 17:59:26 +08:00
casper,
stdUser
2021-09-16 16:05:46 +08:00
};
LeftsiderbarWidget(QWidget *parent = nullptr, StartMode mode = StartMode::normal);
~LeftsiderbarWidget();
2022-02-22 15:49:57 +08:00
2022-04-12 11:27:37 +08:00
void initUi();
2023-03-18 20:28:52 +08:00
public slots:
void setBusy(bool isBusy);
void setCheckedFunc(int funcType);
2021-11-17 13:23:38 +08:00
2023-03-18 20:28:52 +08:00
protected:
void paintEvent(QPaintEvent *event);
2022-02-22 15:49:57 +08:00
2021-11-17 13:23:38 +08:00
signals:
2023-03-18 20:28:52 +08:00
void selected(int funcType);
void doubleClicked();
2021-09-16 16:05:46 +08:00
private:
2022-02-15 16:51:03 +08:00
QGSettings *m_personalQgsettings;
qreal m_transparency = 0.8;
2022-02-16 17:47:06 +08:00
QWidget *m_parent;
2022-04-12 11:27:37 +08:00
StartMode m_mode;
2021-09-16 16:05:46 +08:00
QVBoxLayout *m_leftSideBarVLayout = nullptr;
2022-03-02 11:24:54 +08:00
PixmapLabel *m_mTitleIcon = nullptr;
2021-10-13 16:31:58 +08:00
MyLabel *m_titleLabel = nullptr;
2021-09-16 16:05:46 +08:00
QButtonGroup *m_funcGroup = nullptr;
2021-11-17 13:23:38 +08:00
2023-03-18 20:28:52 +08:00
QList<int> m_deplayFuncs;
2022-05-06 17:58:37 +08:00
QMap<int, int> m_idxToFunctype;
QMap<int, int> m_functypeToIdx;
KNavigationBar * m_navigationBar;
2021-09-16 16:05:46 +08:00
};
#endif // LEFTSIDERBARWIDGET_H