OBS源码阅读笔记--无边框
2016-11-02 11:53
411 查看
void OBSBasic::mousePressEvent(QMouseEvent * event)
{
this->windowPos = this->pos();
this->mousePos = event->globalPos();
this->dPos = mousePos - windowPos;
}
void OBSBasic::mouseMoveEvent(QMouseEvent* event)
{
this->move(event->globalPos() - this->dPos);
}
void OBSBasic::slottimedone()
{
QSize wndSize;
wndSize.setWidth(this->width() + 1);
wndSize.setHeight(this->height() + 1);
this->resize(wndSize);
}
QTimer::singleShot(1500, this, SLOT(slottimedone()));//时间要大于1500
void OBSBasic::resizeEvent(QResizeEvent * event)
{
QPainterPath path;//jiang
QRectF rect = QRectF(0, 0, this->width(), this->height());
path.addRoundedRect(rect, 5, 5);
QPolygon polygon = path.toFillPolygon().toPolygon();//获得这个路径上的所有的点
QRegion region(polygon);//根据这些点构造这个区域
setMask(region);
}
{
this->windowPos = this->pos();
this->mousePos = event->globalPos();
this->dPos = mousePos - windowPos;
}
void OBSBasic::mouseMoveEvent(QMouseEvent* event)
{
this->move(event->globalPos() - this->dPos);
}
void OBSBasic::slottimedone()
{
QSize wndSize;
wndSize.setWidth(this->width() + 1);
wndSize.setHeight(this->height() + 1);
this->resize(wndSize);
}
QTimer::singleShot(1500, this, SLOT(slottimedone()));//时间要大于1500
void OBSBasic::resizeEvent(QResizeEvent * event)
{
QPainterPath path;//jiang
QRectF rect = QRectF(0, 0, this->width(), this->height());
path.addRoundedRect(rect, 5, 5);
QPolygon polygon = path.toFillPolygon().toPolygon();//获得这个路径上的所有的点
QRegion region(polygon);//根据这些点构造这个区域
setMask(region);
}
相关文章推荐
- OBS源码阅读笔记(六)--推流地址设置
- OBS源码阅读笔记--去掉顶部menubar
- OBS源码阅读笔记(七)--如何往工程中添加自己的界面
- OBS源码阅读笔记--绿化配置文件路径
- OBS源码阅读笔记--如何给source添加展示画面的地方呢?
- OBS源码阅读笔记---32位编译
- OBS源码阅读笔记(四)--视频采集显示
- OBS源码阅读笔记--如何修改录播文件路径到exe所在目录
- OBS源码阅读笔记--32位的无法检测摄像头问题
- OBS源码阅读笔记--如何去掉工作模式下中间的多余按钮
- OBS源码阅读笔记--取出licence和update
- OBS源码阅读笔记--将声音设置和场景挂钩
- OBS源码阅读笔记--如何在外部修改推流分辨率
- OBS源码阅读笔记(五)--媒体源处理
- OBS源码阅读笔记(三)--RTMP
- obs-studio源码阅读笔记:学习obs流程的第一步,test程序
- 基于mfc的pc客户端源码阅读笔记
- gtk学习笔记 - vim + ctags 阅读源码
- FastDFS源码阅读笔记(二)
- Boa 源码阅读笔记