1 Star 0 Fork 2

xrogzu/Message_Center

forked from GreateCoder/Message_Center 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
lookonemsg.cpp 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
GreateCoder 提交于 2015-10-23 17:45 . 第一次提交
#include "lookonemsg.h"
#include "ui_lookonemsg.h"
#include <QDesktopWidget>
#include <QPoint>
LookOneMsg::LookOneMsg(QWidget *parent) :
QWidget(parent),
ui(new Ui::LookOneMsg)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint | Qt::Tool);
setWindowTitle(tr ("Message"));
initUI();
initConn();
QDesktopWidget desk;
QPoint point = QPoint((desk.width() - width()) / 2, (desk.height() - height()) / 2);
move(point);
}
LookOneMsg::~LookOneMsg()
{
delete ui;
}
void LookOneMsg::setTitle(const QString &title)
{
ui->titleLabel->setText(title);
}
void LookOneMsg::setBrowseText(const QString &text)
{
ui->textBrowser->setText(text);
}
void LookOneMsg::initUI()
{
ui->closeBtn->getIconPath(":/close");
}
void LookOneMsg::initConn()
{
connect(ui->closeBtn, SIGNAL(clicked()), this, SLOT(hide()));
}
void LookOneMsg::mousePressEvent(QMouseEvent *event)
{
m_dPos = event->globalPos() - this->pos ();
}
void LookOneMsg::mouseMoveEvent(QMouseEvent *event)
{
move(event->globalPos() - m_dPos);
}
void LookOneMsg::paintEvent(QPaintEvent *)
{
QPainter painter(this);
QPen pen;
pen.setColor(QColor("#E0E0E0"));
painter.setPen(pen);
painter.setFont(QFont("Arial", 50));
painter.drawRect(QRect(0, 0, this->width() - 1, this->height() - 1));
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xrogzu/Message_Center.git
git@gitee.com:xrogzu/Message_Center.git
xrogzu
Message_Center
Message_Center
master

搜索帮助