#ifndef CUSTOMMESSAGEBOX_H
#define CUSTOMMESSAGEBOX_H
#include <QDialog>
#include <QMessageBox>
#include <QShowEvent>
#include <QMouseEvent>
#include <QPoint>
#include <QLabel>
#include <QToolButton>
#include <QHBoxLayout>
#include <QResizeEvent>
#include <QPushButton>
class CCustomMessageBox : public QDialog
{
Q_OBJECT
public:
CCustomMessageBox(QString msg, int type = 0,QWidget *parent = 0);
~CCustomMessageBox();
private:
QPoint m_movePoint;
bool m_bmousePress;
private:
QHBoxLayout* m_titlelayout;
QLabel* m_titleLbl;
QWidget* m_titleWgt;
QToolButton* m_closeBtn;
QMessageBox* m_msgBox;
public:
void initButton(void);
void setMessage(QString msg, int type);
void initTitle();
void showMessage(QString msg, int type);
protected:
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
void pa
嵌入QMessageBox的无边框消息提示框
最新推荐文章于 2024-08-14 16:24:16 发布
本文介绍了如何在嵌入QMessageBox时创建一个无边框的消息提示框,尽管QMessageBox本身不支持直接调整大小,但可以通过QSS进行样式美化,提升界面视觉效果。
摘要由CSDN通过智能技术生成