《QDebug 2025年5月》

一、Qt Widgets 问题交流

1.开启PassThrough缩放后,QLabel在非百分百DPI缩放时显示图像模糊
cpp 复制代码
// QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); // 没影响
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // Qt5
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);

图片需要比Label尺寸大的,这样才能明显看到非百分百DPI缩放更模糊。

将QPixmap和QLabel的devicePixelRatioF同步后看起来就清晰了。

cpp 复制代码
qreal ratio = devicePixelRatioF();
QImage image = QImage(filepath).scaled(ui->label->size() * ratio, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QPixmap pixmap = QPixmap::fromImage(image);
pixmap.setDevicePixelRatio(ratio);
ui->label->setPixmap(pixmap);

QLabel使用grab保存图像,对比QPixmap设置devicePixelRatioF前后,可以看到设置前会有一些大的色块:

二、Qt Quick 问题交流

1.

三、其他

1.Inno Setup安装判断系统是32位还是64位

参考:https://developer.aliyun.com/article/258368

Setup

;先开启64位模式

ArchitecturesInstallIn64BitMode=x64

Run

;根据是否是64位进行不同的操作

Filename: "..."; Check: Is64BitInstallMode

Filename: "..."; Check: not Is64BitInstallMode

相关推荐
Quz13 小时前
QML Hello World 入门示例
qt
xcyxiner4 天前
DicomViewer (dcmtk读取dcm文件)5
qt
xcyxiner4 天前
DicomViewer (后台线程处理文件)4
qt
xcyxiner5 天前
DicomViewer (添加模型类)3
qt
xcyxiner5 天前
DicomViewer (目录调整) 2
qt
xcyxiner5 天前
dcmtk vtk vtk-dicom(gdcm) 编译(debug) v2
qt
桥田智能7 天前
桥田智能 QT-650S:面向白车身焊装的 800kg 重载快换解决方案
开发语言·qt·系统架构
森G7 天前
75、服务器源码解析---------云视频服务项目
linux·服务器·网络·c++·qt
森G7 天前
77、线程池原理和实现------服务器源码解析----云视频服务项目
服务器·c++·qt
森G7 天前
71、打包发布---------打包发布
c++·qt