!377 fix(Qt6): FTBFS with Qt 6

Merge pull request !377 from BLumia/qt6
This commit is contained in:
2026-01-15 10:27:36 +00:00
committed by Gitee
3 changed files with 7 additions and 4 deletions

View File

@@ -73,8 +73,9 @@ void AppIntoPage::openUrl(const QUrl &url)
iconRequest.setUrl(QUrl(pkgUrlBase + "/icon.png"));
iconRequest.setHeader(QNetworkRequest::UserAgentHeader, m_userAgent);
iconRequest.setHeader(QNetworkRequest::ContentTypeHeader, "charset='utf-8'");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
iconRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
iconManager->get(iconRequest);
QObject::connect(iconManager, &QNetworkAccessManager::finished, [=](QNetworkReply *reply)
@@ -97,7 +98,9 @@ void AppIntoPage::openUrl(const QUrl &url)
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
request.setUrl(QUrl(imgUrl));
request.setHeader(QNetworkRequest::UserAgentHeader, m_userAgent);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
request.setHeader(QNetworkRequest::ContentTypeHeader, "charset='utf-8'");
manager->get(request);
QObject::connect(manager, &QNetworkAccessManager::finished, [=](QNetworkReply *reply)

View File

@@ -31,7 +31,8 @@ DEFINES += APP_BRANCH=\\\"'$$system(git symbolic-ref --short -q HEAD)'\\\"
# We want to capture all logs (INFO, DEBUG, WARNING, ERROR) for export to /tmp/spark-store
CONFIG += c++11 link_pkgconfig
PKGCONFIG += dtkcore dtkgui dtkwidget
equals(QT_MAJOR_VERSION, 6): PKGCONFIG += dtk6core dtk6gui dtk6widget
equals(QT_MAJOR_VERSION, 5): PKGCONFIG += dtkcore dtkgui dtkwidget
SOURCES += \
backend/DataCollectorAndUploader.cpp \

View File

@@ -10,8 +10,7 @@ CustomLabel::CustomLabel(QWidget *parent,
QPixmap CustomLabel::pixmap() const
{
const QPixmap* p = QLabel::pixmap();
return p ? *p : QPixmap();
return QLabel::pixmap();
}
void CustomLabel::setPixmap(const QPixmap &pixmap)