opencv_mv/QMainPro/QMacVisual/headwidget.h

53 lines
1.2 KiB
C
Raw Normal View History

2023-05-22 09:27:46 +00:00
#pragma once
#pragma execution_character_set("utf-8")
#include <QWidget>
#include <QPushButton>
class QLabel;
class HeadWidget : public QWidget
{
Q_OBJECT
public:
explicit HeadWidget(QWidget *parent = nullptr);
void setLogo(const QString &imgFile = "", const QString &name = "");
void setTitle(const QString &info = "");
void setBgColor(const QString &color);
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¡<EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>(<28><>mouseMoveEvent<6E><74><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>)
void setEnabelMove(bool can_move = true)
{
m_bEnabelMove = can_move;
}
signals:
void sigMinimized();
void sigToggleMaximized();
void sigClose();
void sigColor(const QPoint &pos);
protected:
void mousePressEvent(QMouseEvent *e);
void mouseMoveEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
private:
bool m_bEnabelMove = true; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>
bool m_bMouseIsMove = false; //<2F>Ƿ<EFBFBD><C7B7>ƶ<EFBFBD>
bool m_bPressed = false; //<2F><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
QPoint m_pressedMousePos;
QPoint m_pressedWidgetPos;
QLabel *m_pLogo = nullptr;
QLabel *m_pName = nullptr;
QLabel *m_pInfo = nullptr;
QPushButton* pBtnMax = nullptr;
public slots:
void min_maxState();
void shot_Quit();
};