Drop support of Qt 5

Also remove usage of some deprecated stuff.

PR #19338.
This commit is contained in:
Vladimir Golovnev
2023-07-20 11:17:27 +03:00
committed by GitHub
parent 5e610cfdcf
commit dbe79484d2
55 changed files with 48 additions and 462 deletions

View File

@@ -74,17 +74,10 @@ bool operator==(const PeerEndpoint &left, const PeerEndpoint &right)
return (left.address == right.address) && (left.connectionType == right.connectionType);
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
std::size_t qHash(const PeerEndpoint &peerEndpoint, const std::size_t seed = 0)
{
return qHashMulti(seed, peerEndpoint.address, peerEndpoint.connectionType);
}
#else
uint qHash(const PeerEndpoint &peerEndpoint, const uint seed = 0)
{
return (qHash(peerEndpoint.address, seed) ^ ::qHash(peerEndpoint.connectionType));
}
#endif
namespace
{

View File

@@ -144,11 +144,7 @@ bool PiecesBar::event(QEvent *e)
return base::event(e);
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
void PiecesBar::enterEvent(QEnterEvent *e)
#else
void PiecesBar::enterEvent(QEvent *e)
#endif
{
m_hovered = true;
base::enterEvent(e);

View File

@@ -59,11 +59,7 @@ public:
protected:
// QWidget interface
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
void enterEvent(QEnterEvent *e) override;
#else
void enterEvent(QEvent *e) override;
#endif
void leaveEvent(QEvent *e) override;
void mouseMoveEvent(QMouseEvent *e) override;

View File

@@ -48,7 +48,7 @@ PropTabBar::PropTabBar(QWidget *parent)
UIThemeManager::instance()->getIcon(u"help-about"_s, u"document-properties"_s),
#endif
tr("General"), parent);
mainInfosButton->setShortcut(Qt::ALT + Qt::Key_G);
mainInfosButton->setShortcut(Qt::ALT | Qt::Key_G);
addWidget(mainInfosButton);
m_btnGroup->addButton(mainInfosButton, MainTab);
// Trackers tab
@@ -57,7 +57,7 @@ PropTabBar::PropTabBar(QWidget *parent)
UIThemeManager::instance()->getIcon(u"trackers"_s, u"network-server"_s),
#endif
tr("Trackers"), parent);
trackersButton->setShortcut(Qt::ALT + Qt::Key_C);
trackersButton->setShortcut(Qt::ALT | Qt::Key_C);
addWidget(trackersButton);
m_btnGroup->addButton(trackersButton, TrackersTab);
// Peers tab
@@ -66,7 +66,7 @@ PropTabBar::PropTabBar(QWidget *parent)
UIThemeManager::instance()->getIcon(u"peers"_s),
#endif
tr("Peers"), parent);
peersButton->setShortcut(Qt::ALT + Qt::Key_R);
peersButton->setShortcut(Qt::ALT | Qt::Key_R);
addWidget(peersButton);
m_btnGroup->addButton(peersButton, PeersTab);
// URL seeds tab
@@ -75,7 +75,7 @@ PropTabBar::PropTabBar(QWidget *parent)
UIThemeManager::instance()->getIcon(u"network-server"_s),
#endif
tr("HTTP Sources"), parent);
URLSeedsButton->setShortcut(Qt::ALT + Qt::Key_B);
URLSeedsButton->setShortcut(Qt::ALT | Qt::Key_B);
addWidget(URLSeedsButton);
m_btnGroup->addButton(URLSeedsButton, URLSeedsTab);
// Files tab
@@ -84,7 +84,7 @@ PropTabBar::PropTabBar(QWidget *parent)
UIThemeManager::instance()->getIcon(u"directory"_s),
#endif
tr("Content"), parent);
filesButton->setShortcut(Qt::ALT + Qt::Key_Z);
filesButton->setShortcut(Qt::ALT | Qt::Key_Z);
addWidget(filesButton);
m_btnGroup->addButton(filesButton, FilesTab);
// Spacer
@@ -95,7 +95,7 @@ PropTabBar::PropTabBar(QWidget *parent)
UIThemeManager::instance()->getIcon(u"chart-line"_s),
#endif
tr("Speed"), parent);
speedButton->setShortcut(Qt::ALT + Qt::Key_D);
speedButton->setShortcut(Qt::ALT | Qt::Key_D);
addWidget(speedButton);
m_btnGroup->addButton(speedButton, SpeedTab);
// SIGNAL/SLOT