mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-02-04 09:51:37 +08:00
!378 fix: blurry icons and images when build with Qt 5
Merge pull request !378 from BLumia/fix-blurry
This commit is contained in:
@@ -180,6 +180,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
int fakeArgc = argc + 2; // QCoreApplication 的 argc 要用引用,避免 c++ 编译器优化
|
||||
Application a(fakeArgc, fakeArgs.data());
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
a.setAttribute(Qt::ApplicationAttribute::AA_UseHighDpiPixmaps);
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
// 设置版本和构建时间
|
||||
a.setBuildDateTime(buildDateTime);
|
||||
|
||||
|
||||
@@ -10,7 +10,11 @@ CustomLabel::CustomLabel(QWidget *parent,
|
||||
|
||||
QPixmap CustomLabel::pixmap() const
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
return *QLabel::pixmap();
|
||||
#else
|
||||
return QLabel::pixmap();
|
||||
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
}
|
||||
|
||||
void CustomLabel::setPixmap(const QPixmap &pixmap)
|
||||
|
||||
Reference in New Issue
Block a user