46 lines
1006 B
C++
46 lines
1006 B
C++
#ifndef TOTALTITLEBAR_H
|
|
#define TOTALTITLEBAR_H
|
|
|
|
#include <QSize>
|
|
#include <QDockWidget>
|
|
#include <QMouseEvent>
|
|
#include <QWidget>
|
|
#include <QPainter>
|
|
#include <QPaintEvent>
|
|
#include <QDebug>
|
|
#include <QStyle>
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
class TotalTitleBar : public
|
|
QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
TotalTitleBar(QWidget *parent = 0);
|
|
QColor backgroudColor = QColor(0, 102, 204, 100); // 标题栏默认背景颜色
|
|
int fontSize = 10; // 默认标题栏文本字号
|
|
QString titleBarText = ""; // 默认标题栏文本
|
|
QColor fontColor = QColor(220, 220, 220); // 默认标题栏文本颜色
|
|
void setAttr(QColor _backgroudColor, int _fontSize, QString _titleBarText, QColor _fontColor);
|
|
QSize sizeHint() const
|
|
{
|
|
return minimumSizeHint();
|
|
}
|
|
|
|
QSize minimumSizeHint() const;
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event);
|
|
void mousePressEvent(QMouseEvent *event);
|
|
|
|
public slots:
|
|
void updateMask();
|
|
|
|
private:
|
|
QPixmap minPix, closePix, floatPix;
|
|
|
|
};
|
|
|
|
#endif // TOTALTITLEBAR_H
|