diff --git a/src/app/application.cpp b/src/app/application.cpp index 80b0dd61d..e02205995 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -141,7 +141,9 @@ Application::Application(int &argc, char **argv) setOrganizationDomain("qbittorrent.org"); #if !defined(DISABLE_GUI) setDesktopFileName("org.qbittorrent.qBittorrent"); +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) setAttribute(Qt::AA_UseHighDpiPixmaps, true); // opt-in to the high DPI pixmap support +#endif setQuitOnLastWindowClosed(false); QPixmapCache::setCacheLimit(PIXMAP_CACHE_SIZE); #endif diff --git a/src/app/main.cpp b/src/app/main.cpp index 270c4e421..7406545b4 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) // We must save it here because QApplication constructor may change it bool isOneArg = (argc == 2); -#if !defined(DISABLE_GUI) +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && !defined(DISABLE_GUI) // Attribute Qt::AA_EnableHighDpiScaling must be set before QCoreApplication is created if (qgetenv("QT_ENABLE_HIGHDPI_SCALING").isEmpty() && qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR").isEmpty()) Application::setAttribute(Qt::AA_EnableHighDpiScaling, true); diff --git a/src/base/bittorrent/bencoderesumedatastorage.cpp b/src/base/bittorrent/bencoderesumedatastorage.cpp index 0c6835882..668556427 100644 --- a/src/base/bittorrent/bencoderesumedatastorage.cpp +++ b/src/base/bittorrent/bencoderesumedatastorage.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -113,7 +114,7 @@ BitTorrent::BencodeResumeDataStorage::BencodeResumeDataStorage(const QString &pa loadQueue(m_resumeDataDir.absoluteFilePath(QLatin1String("queue"))); - qDebug("Registered torrents count: %d", m_registeredTorrents.size()); + qDebug() << "Registered torrents count: " << m_registeredTorrents.size(); m_asyncWorker->moveToThread(m_ioThread); connect(m_ioThread, &QThread::finished, m_asyncWorker, &QObject::deleteLater); diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 98599d0a0..7bbf3c6af 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -2523,7 +2523,7 @@ QStringList Session::getListeningIPs() const } const QList addresses = networkIFace.addressEntries(); - qDebug("This network interface has %d IP addresses", addresses.size()); + qDebug() << "This network interface has " << addresses.size() << " IP addresses"; for (const QNetworkAddressEntry &entry : addresses) checkAndAddIP(entry.ip(), configuredAddr); diff --git a/src/gui/addnewtorrentdialog.ui b/src/gui/addnewtorrentdialog.ui index 3d5a66e8b..992109abc 100644 --- a/src/gui/addnewtorrentdialog.ui +++ b/src/gui/addnewtorrentdialog.ui @@ -326,9 +326,6 @@ - - Qt::PlainText - Qt::TextSelectableByMouse @@ -350,8 +347,8 @@ - - + + Qt::TextSelectableByMouse diff --git a/src/gui/properties/piecesbar.cpp b/src/gui/properties/piecesbar.cpp index f1f042b92..fda9c8113 100644 --- a/src/gui/properties/piecesbar.cpp +++ b/src/gui/properties/piecesbar.cpp @@ -186,7 +186,7 @@ void PiecesBar::paintEvent(QPaintEvent *) if (!m_highlightedRegion.isNull()) { QColor highlightColor {this->palette().color(QPalette::Active, QPalette::Highlight)}; - highlightColor.setAlphaF(0.35); + highlightColor.setAlphaF(0.35f); QRect targetHighlightRect {m_highlightedRegion.adjusted(borderWidth, borderWidth, borderWidth, height() - 2 * borderWidth)}; painter.fillRect(targetHighlightRect, highlightColor); } diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index 0987ca141..531447fc8 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -412,7 +412,7 @@ void PropertiesWidget::saveSettings() sizes = hSplitter->sizes(); else sizes = m_slideSizes; - qDebug("Sizes: %d", sizes.size()); + if (sizes.size() == 2) pref->setPropSplitterSizes(QString::number(sizes.first()) + ',' + QString::number(sizes.last())); pref->setPropFileListState(m_ui->filesList->header()->saveState()); @@ -752,21 +752,31 @@ void PropertiesWidget::configure() // Speed widget if (Preferences::instance()->isSpeedWidgetEnabled()) { - if (!m_speedWidget || !qobject_cast(m_speedWidget)) + if (!qobject_cast(m_speedWidget)) { - m_ui->speedLayout->removeWidget(m_speedWidget); - delete m_speedWidget; - m_speedWidget = new SpeedWidget {this}; + if (m_speedWidget) + { + m_ui->speedLayout->removeWidget(m_speedWidget); + delete m_speedWidget; + } + + m_speedWidget = new SpeedWidget(this); m_ui->speedLayout->addWidget(m_speedWidget); } } else { - if (!m_speedWidget || !qobject_cast(m_speedWidget)) + if (!qobject_cast(m_speedWidget)) { - m_ui->speedLayout->removeWidget(m_speedWidget); - delete m_speedWidget; - auto *label = new QLabel(tr("
Speed graphs are disabled

You may change this setting in Advanced Options

"), this); + if (m_speedWidget) + { + m_ui->speedLayout->removeWidget(m_speedWidget); + delete m_speedWidget; + } + + const auto displayText = QString::fromLatin1("
%1

%2

") + .arg(tr("Speed graphs are disabled"), tr("You can enable it in Advanced Options")); + auto *label = new QLabel(displayText, this); label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); m_speedWidget = label; m_ui->speedLayout->addWidget(m_speedWidget); diff --git a/src/src.pro b/src/src.pro index 1ba2f49fc..2728e6d5f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -23,7 +23,7 @@ nogui { DEFINES += QBT_STATIC_QT QTPLUGIN += qico } - win32: lessThan(QT_VERSION_MAJOR, 6) { + win32: lessThan(QT_MAJOR_VERSION, 6) { QT += winextras } macx {