![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Qt窗口
听停挺停
这个作者很懒,什么都没留下…
展开
-
获取窗口所在屏幕DPI
qt原创 2022-12-01 15:58:51 · 190 阅读 · 1 评论 -
Qt 窗口在显示屏的坐标
QPoint bb = thi->mapToGlobal(QPoint(0,0));原创 2021-12-07 17:46:32 · 350 阅读 · 0 评论 -
QT 将pixmap绘制成圆形
QPixmap PixmapToRound(const QPixmap& src, int diameter/*直径*/){ if (src.isNull()) { return QPixmap(); } QSize size(diameter, diameter); QBitmap mask(size); QPainter painter(&mask); painter.setRenderHint(QPainter.原创 2021-07-21 10:30:28 · 995 阅读 · 0 评论 -
Qt:窗口失去焦点退出
bool event(QEvent* event){ if (event->type() == QEvent::ActivationChange) { if (QApplication::activeWindow() != this) { this->close(); } } return QWidget::event(event);}原创 2021-05-28 15:11:20 · 992 阅读 · 0 评论 -
Qt:自定义拖动窗口
// 鼠标按下事件void OFUserPayWnd::mousePressEvent(QMouseEvent* event){ m_startMovePos = event->globalPos(); if (event->pos().x() <= 0) return; if (event->pos().x() >= PAY_WND_WIDTH) return; if (event->pos().y.原创 2021-05-28 15:03:21 · 267 阅读 · 1 评论 -
Qt 自绘制窗口阴影带圆角
void OFUserPayWnd::DrawShadow(){ QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing, true); painter.fillRect(QRect(SHADOW_WIDTH, SHADOW_WIDTH, this->width() - 2 * SHADOW_WIDTH, this->height() - 2 * SHADOW_WIDTH), QBrush...原创 2021-05-28 14:27:09 · 273 阅读 · 0 评论