第一阶段初稿+修复部分内容
This commit is contained in:
41
OfficeAssistant_msvc/switchbutton.h
Normal file
41
OfficeAssistant_msvc/switchbutton.h
Normal file
@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
#include "ui_switchbutton.h"
|
||||
|
||||
class SwitchButton : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SwitchButton(int action, QWidget * parent);
|
||||
~SwitchButton();
|
||||
|
||||
private:
|
||||
int action;
|
||||
Ui::SwitchButton ui;
|
||||
bool checked;
|
||||
QColor bgColorOff;
|
||||
QColor bgColorOn;
|
||||
QColor sliderColorOff;
|
||||
QColor sliderColorOn;
|
||||
int space;
|
||||
int rectRadius;
|
||||
int step;
|
||||
int startX;
|
||||
int endX;
|
||||
QTimer *timer;
|
||||
|
||||
void updateValue();
|
||||
void drawBg(QPainter * painter);
|
||||
void drawSlider(QPainter * painter);
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *);
|
||||
void resizeEvent(QResizeEvent *);
|
||||
void mousePressEvent(QMouseEvent *);
|
||||
|
||||
|
||||
|
||||
};
|
Reference in New Issue
Block a user