chore: bump deprecated cutoff to Qt 6.4.3 (#6169)

This commit is contained in:
nerix
2025-04-26 13:36:09 +02:00
committed by GitHub
parent 6fe6843cbd
commit 01e7050ffc
15 changed files with 134 additions and 118 deletions
+1
View File
@@ -30,6 +30,7 @@
- Dev: Fixed `<build-tool> clean` not working correctly with generated sources. (#6154)
- Dev: Removed authenticated PubSub implementation. (#6158)
- Dev: Save settings in `aboutToQuit`. (#6159)
- Dev: Bumped deprecation cutoff to Qt 6.4.3. (#6169)
- Dev: Simplified string literals to be a re-export of Qt functions. (#6175)
## 2.5.3
+2 -2
View File
@@ -1,8 +1,8 @@
set(LIBRARY_PROJECT "${PROJECT_NAME}-lib")
set(VERSION_PROJECT "${LIBRARY_PROJECT}-version")
set(EXECUTABLE_PROJECT "${PROJECT_NAME}")
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00)
add_compile_definitions(QT_WARN_DEPRECATED_UP_TO=0x050F00)
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060403)
add_compile_definitions(QT_WARN_DEPRECATED_UP_TO=0x060403)
add_compile_definitions(QT_NO_KEYWORDS)
# registers the native messageing host
+5 -4
View File
@@ -594,9 +594,9 @@ void BaseWindow::mousePressEvent(QMouseEvent *event)
#ifndef Q_OS_WIN
if (this->flags_.has(FramelessDraggable))
{
this->movingRelativePos = event->localPos();
if (auto *widget =
this->childAt(event->localPos().x(), event->localPos().y()))
this->movingRelativePos = event->position();
auto pos = event->position().toPoint();
if (auto *widget = this->childAt(pos.x(), pos.y()))
{
std::function<bool(QWidget *)> recursiveCheckMouseTracking;
recursiveCheckMouseTracking = [&](QWidget *widget) {
@@ -646,7 +646,8 @@ void BaseWindow::mouseMoveEvent(QMouseEvent *event)
{
if (this->moving)
{
const auto &newPos = event->screenPos() - this->movingRelativePos;
auto newPos =
(event->globalPosition() - this->movingRelativePos).toPoint();
this->move(newPos.x(), newPos.y());
}
}
+2 -2
View File
@@ -78,7 +78,7 @@ void DraggablePopup::mousePressEvent(QMouseEvent *event)
{
this->dragTimer_.start(std::chrono::milliseconds(17));
this->startPosDrag_ = event->pos();
this->movingRelativePos = event->localPos();
this->movingRelativePos = event->position();
}
}
@@ -98,7 +98,7 @@ void DraggablePopup::mouseMoveEvent(QMouseEvent *event)
if (this->isMoving_ || movePos.manhattanLength() > 10.0)
{
this->requestedDragPos_ =
(event->screenPos() - this->movingRelativePos).toPoint();
(event->globalPosition() - this->movingRelativePos).toPoint();
this->isMoving_ = true;
}
}
+2 -1
View File
@@ -1165,7 +1165,8 @@ void Notebook::mousePressEvent(QMouseEvent *event)
this->menu_ = new QMenu(this);
this->addNotebookActionsToMenu(this->menu_);
}
this->menu_->popup(event->globalPos() + QPoint(0, 8));
this->menu_->popup(event->globalPosition().toPoint() +
QPoint(0, 8));
}
break;
default:;
+4 -3
View File
@@ -232,7 +232,7 @@ bool OverlayWindow::eventFilter(QObject * /*object*/, QEvent *event)
case QEvent::MouseButtonPress: {
auto *evt = dynamic_cast<QMouseEvent *>(event);
this->moving_ = true;
this->moveOrigin_ = evt->globalPos();
this->moveOrigin_ = evt->globalPosition().toPoint();
return true;
}
break;
@@ -249,9 +249,10 @@ bool OverlayWindow::eventFilter(QObject * /*object*/, QEvent *event)
auto *evt = dynamic_cast<QMouseEvent *>(event);
if (this->moving_)
{
auto newPos = evt->globalPos() - this->moveOrigin_;
auto newPos =
(evt->globalPosition() - this->moveOrigin_).toPoint();
this->move(newPos + this->pos());
this->moveOrigin_ = evt->globalPos();
this->moveOrigin_ = evt->globalPosition().toPoint();
return true;
}
if (this->interaction_.isInteracting())
+5 -6
View File
@@ -197,12 +197,11 @@ void EditHotkeyDialog::afterEdit()
}
auto firstKeyInt = this->ui_->keyComboEdit->keySequence()[0];
bool hasModifier = ((firstKeyInt & Qt::CTRL) == Qt::CTRL) ||
((firstKeyInt & Qt::ALT) == Qt::ALT) ||
((firstKeyInt & Qt::META) == Qt::META);
bool isKeyExcempt = ((firstKeyInt & Qt::Key_Escape) == Qt::Key_Escape) ||
((firstKeyInt & Qt::Key_Enter) == Qt::Key_Enter) ||
((firstKeyInt & Qt::Key_Return) == Qt::Key_Return);
bool hasModifier = firstKeyInt.keyboardModifiers().testAnyFlags(
Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier);
bool isKeyExcempt = firstKeyInt.key() == Qt::Key_Escape ||
firstKeyInt.key() == Qt::Key_Enter ||
firstKeyInt.key() == Qt::Key_Return;
if (!isKeyExcempt && !hasModifier && !this->shownSingleKeyWarning)
{
+15 -13
View File
@@ -1956,7 +1956,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
if (this->isScrolling_)
{
this->currentMousePosition_ = event->screenPos();
this->currentMousePosition_ = event->globalPosition();
}
// check for word underneath cursor
@@ -2114,8 +2114,9 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
}
}
this->tooltipWidget_->moveTo(event->globalPos() + QPoint(16, 16),
widgets::BoundsChecking::CursorPosition);
this->tooltipWidget_->moveTo(
event->globalPosition().toPoint() + QPoint(16, 16),
widgets::BoundsChecking::CursorPosition);
this->tooltipWidget_->setWordWrap(isLinkValid);
this->tooltipWidget_->show();
}
@@ -2170,7 +2171,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
this->disableScrolling();
}
this->lastLeftPressPosition_ = event->screenPos();
this->lastLeftPressPosition_ = event->globalPosition();
this->isLeftMouseDown_ = true;
if (layout->flags.has(MessageLayoutFlag::Collapsed))
@@ -2195,7 +2196,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
this->disableScrolling();
}
this->lastRightPressPosition_ = event->screenPos();
this->lastRightPressPosition_ = event->globalPosition();
this->isRightMouseDown_ = true;
}
break;
@@ -2224,7 +2225,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
}
else if (this->scrollBar_->isVisible())
{
this->enableScrolling(event->screenPos());
this->enableScrolling(event->globalPosition());
}
}
}
@@ -2256,7 +2257,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
this->isDoubleClick_ = false;
// Was actually not a wanted triple-click
if (std::abs(distanceBetweenPoints(this->lastDoubleClickPosition_,
event->screenPos())) > 10.F)
event->globalPosition())) > 10.F)
{
this->clickTimer_.stop();
return;
@@ -2267,7 +2268,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
this->isLeftMouseDown_ = false;
if (std::abs(distanceBetweenPoints(this->lastLeftPressPosition_,
event->screenPos())) > 15.F)
event->globalPosition())) > 15.F)
{
return;
}
@@ -2275,7 +2276,8 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
// Triple-clicking a message selects the whole message
if (foundElement && this->clickTimer_.isActive() &&
(std::abs(distanceBetweenPoints(this->lastDoubleClickPosition_,
event->screenPos())) < 10.F))
event->globalPosition())) <
10.F))
{
this->selectWholeMessage(layout.get(), messageIndex);
return;
@@ -2293,7 +2295,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
this->isRightMouseDown_ = false;
if (std::abs(distanceBetweenPoints(this->lastRightPressPosition_,
event->screenPos())) > 15.F)
event->globalPosition())) > 15.F)
{
return;
}
@@ -2307,9 +2309,9 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
{
if (this->isScrolling_ && this->scrollBar_->isVisible())
{
if (event->screenPos() == this->lastMiddlePressPosition_)
if (event->globalPosition() == this->lastMiddlePressPosition_)
{
this->enableScrolling(event->screenPos());
this->enableScrolling(event->globalPosition());
}
else
{
@@ -2807,7 +2809,7 @@ void ChannelView::mouseDoubleClickEvent(QMouseEvent *event)
}
this->isDoubleClick_ = true;
this->lastDoubleClickPosition_ = event->screenPos();
this->lastDoubleClickPosition_ = event->globalPosition();
this->clickTimer_.start();
// message under cursor is collapsed
+1 -1
View File
@@ -19,7 +19,7 @@ QWidget *ComboBoxItemDelegate::createEditor(QWidget *parent,
{
QVariant data = index.data(Qt::UserRole + 1);
if (data.type() != QVariant::StringList)
if (data.metaType() != QMetaType::fromType<QStringList>())
{
return QStyledItemDelegate::createEditor(parent, option, index);
}
+1 -1
View File
@@ -15,7 +15,7 @@ void IconDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
{
auto data = index.data(Qt::DecorationRole);
if (data.type() != QVariant::Pixmap)
if (data.metaType() != QMetaType::fromType<QPixmap>())
{
return QStyledItemDelegate::paint(painter, option, index);
}
+8 -6
View File
@@ -162,9 +162,10 @@ void NotebookButton::dragEnterEvent(QDragEnterEvent *event)
event->acceptProposedAction();
auto *e = new QMouseEvent(QMouseEvent::MouseButtonPress,
QPointF(this->width() / 2, this->height() / 2),
Qt::LeftButton, Qt::LeftButton, {});
auto *e =
new QMouseEvent(QMouseEvent::MouseButtonPress,
QPointF(this->width() / 2, this->height() / 2),
QCursor::pos(), Qt::LeftButton, Qt::LeftButton, {});
Button::mousePressEvent(e);
delete e;
}
@@ -174,9 +175,10 @@ void NotebookButton::dragLeaveEvent(QDragLeaveEvent *)
this->mouseDown_ = true;
this->update();
auto *e = new QMouseEvent(QMouseEvent::MouseButtonRelease,
QPointF(this->width() / 2, this->height() / 2),
Qt::LeftButton, Qt::LeftButton, {});
auto *e =
new QMouseEvent(QMouseEvent::MouseButtonRelease,
QPointF(this->width() / 2, this->height() / 2),
QCursor::pos(), Qt::LeftButton, Qt::LeftButton, {});
Button::mouseReleaseEvent(e);
delete e;
}
+11 -11
View File
@@ -116,24 +116,23 @@ NotebookTab::NotebookTab(Notebook *notebook)
// XXX: this doesn't update after changing hotkeys
this->menu_.addAction(
"Close Tab",
[this]() {
this->notebook_->removePage(this->page);
},
getApp()->getHotkeys()->getDisplaySequence(HotkeyCategory::Window,
"removeTab"));
this->menu_.addAction("Close Tab",
getApp()->getHotkeys()->getDisplaySequence(
HotkeyCategory::Window, "removeTab"),
[this]() {
this->notebook_->removePage(this->page);
});
this->menu_.addAction(
"Popup Tab",
getApp()->getHotkeys()->getDisplaySequence(HotkeyCategory::Window,
"popup", {{"window"}}),
[this]() {
if (auto *container = dynamic_cast<SplitContainer *>(this->page))
{
container->popup();
}
},
getApp()->getHotkeys()->getDisplaySequence(HotkeyCategory::Window,
"popup", {{"window"}}));
});
this->menu_.addAction("Duplicate Tab", [this]() {
this->notebook_->duplicatePage(this->page);
@@ -908,7 +907,8 @@ void NotebookTab::mousePressEvent(QMouseEvent *event)
switch (event->button())
{
case Qt::RightButton: {
this->menu_.popup(event->globalPos() + QPoint(0, 8));
this->menu_.popup(event->globalPosition().toPoint() +
QPoint(0, 8));
}
break;
default:;
+6 -6
View File
@@ -138,23 +138,23 @@ void TitleBarButton::ncLeave()
void TitleBarButton::ncMove(QPoint at)
{
QMouseEvent evt(QMouseEvent::MouseMove, at, Qt::NoButton, Qt::NoButton,
Qt::NoModifier);
QMouseEvent evt(QMouseEvent::MouseMove, at, QCursor::pos(), Qt::NoButton,
Qt::NoButton, Qt::NoModifier);
this->mouseMoveEvent(&evt);
}
void TitleBarButton::ncMousePress(QPoint at)
{
QMouseEvent evt(QMouseEvent::MouseButtonPress, at, Qt::LeftButton,
Qt::NoButton, Qt::NoModifier);
QMouseEvent evt(QMouseEvent::MouseButtonPress, at, QCursor::pos(),
Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
this->mousePressEvent(&evt);
this->update();
}
void TitleBarButton::ncMouseRelease(QPoint at)
{
QMouseEvent evt(QMouseEvent::MouseButtonRelease, at, Qt::LeftButton,
Qt::NoButton, Qt::NoModifier);
QMouseEvent evt(QMouseEvent::MouseButtonRelease, at, QCursor::pos(),
Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
this->mouseReleaseEvent(&evt);
this->update();
}
+8 -7
View File
@@ -1551,7 +1551,7 @@ void SplitContainer::DropOverlay::dragMoveEvent(QDragMoveEvent *event)
{
event->acceptProposedAction();
this->mouseOverPoint_ = event->pos();
this->mouseOverPoint_ = event->position().toPoint();
this->update();
}
@@ -1673,14 +1673,15 @@ void SplitContainer::ResizeHandle::mouseMoveEvent(QMouseEvent *event)
QPoint bottomRight = this->parent->mapToGlobal(
this->node->geometry_.bottomRight().toPoint());
int globalX = topLeft.x() > event->globalX()
auto globalPos = event->globalPosition().toPoint();
int globalX = topLeft.x() > globalPos.x()
? topLeft.x()
: (bottomRight.x() < event->globalX() ? bottomRight.x()
: event->globalX());
int globalY = topLeft.y() > event->globalY()
: (bottomRight.x() < globalPos.x() ? bottomRight.x()
: globalPos.x());
int globalY = topLeft.y() > globalPos.y()
? topLeft.y()
: (bottomRight.y() < event->globalY() ? bottomRight.y()
: event->globalY());
: (bottomRight.y() < globalPos.y() ? bottomRight.y()
: globalPos.y());
QPoint mousePoint(globalX, globalY);
+63 -55
View File
@@ -382,26 +382,29 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
const auto &h = getApp()->getHotkeys();
auto menu = std::make_unique<QMenu>();
menu->addAction(
"Change channel", this->split_, &Split::changeChannel,
h->getDisplaySequence(HotkeyCategory::Split, "changeChannel"));
menu->addAction("Close", this->split_, &Split::deleteFromContainer,
h->getDisplaySequence(HotkeyCategory::Split, "delete"));
"Change channel",
h->getDisplaySequence(HotkeyCategory::Split, "changeChannel"),
this->split_, &Split::changeChannel);
menu->addAction("Close",
h->getDisplaySequence(HotkeyCategory::Split, "delete"),
this->split_, &Split::deleteFromContainer);
menu->addSeparator();
menu->addAction(
"Popup", this->split_, &Split::popup,
h->getDisplaySequence(HotkeyCategory::Window, "popup", {{"split"}}));
"Popup",
h->getDisplaySequence(HotkeyCategory::Window, "popup", {{"split"}}),
this->split_, &Split::popup);
menu->addAction(
"Popup overlay", this->split_, &Split::showOverlayWindow,
h->getDisplaySequence(HotkeyCategory::Split, "popupOverlay"));
menu->addAction(
"Search", this->split_,
[this] {
this->split_->showSearch(true);
},
h->getDisplaySequence(HotkeyCategory::Split, "showSearch"));
menu->addAction(
"Set filters", this->split_, &Split::setFiltersDialog,
h->getDisplaySequence(HotkeyCategory::Split, "pickFilters"));
"Popup overlay",
h->getDisplaySequence(HotkeyCategory::Split, "popupOverlay"),
this->split_, &Split::showOverlayWindow);
menu->addAction("Search",
h->getDisplaySequence(HotkeyCategory::Split, "showSearch"),
this->split_, [this] {
this->split_->showSearch(true);
});
menu->addAction("Set filters",
h->getDisplaySequence(HotkeyCategory::Split, "pickFilters"),
this->split_, &Split::setFiltersDialog);
menu->addSeparator();
auto *twitchChannel =
@@ -410,38 +413,41 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (twitchChannel)
{
menu->addAction(
OPEN_IN_BROWSER, this->split_, &Split::openInBrowser,
h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser"));
menu->addAction(OPEN_PLAYER_IN_BROWSER, this->split_,
&Split::openBrowserPlayer,
h->getDisplaySequence(HotkeyCategory::Split,
"openPlayerInBrowser"));
OPEN_IN_BROWSER,
h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser"),
this->split_, &Split::openInBrowser);
menu->addAction(
OPEN_IN_STREAMLINK, this->split_, &Split::openInStreamlink,
h->getDisplaySequence(HotkeyCategory::Split, "openInStreamlink"));
OPEN_PLAYER_IN_BROWSER,
h->getDisplaySequence(HotkeyCategory::Split, "openPlayerInBrowser"),
this->split_, &Split::openBrowserPlayer);
menu->addAction(
OPEN_IN_STREAMLINK,
h->getDisplaySequence(HotkeyCategory::Split, "openInStreamlink"),
this->split_, &Split::openInStreamlink);
if (!getSettings()->customURIScheme.getValue().isEmpty())
{
menu->addAction("Open in custom player", this->split_,
&Split::openWithCustomScheme,
menu->addAction("Open in custom player",
h->getDisplaySequence(HotkeyCategory::Split,
"openInCustomPlayer"));
"openInCustomPlayer"),
this->split_, &Split::openWithCustomScheme);
}
if (this->split_->getChannel()->hasModRights())
{
menu->addAction(
OPEN_MOD_VIEW_IN_BROWSER, this->split_,
&Split::openModViewInBrowser,
h->getDisplaySequence(HotkeyCategory::Split, "openModView"));
OPEN_MOD_VIEW_IN_BROWSER,
h->getDisplaySequence(HotkeyCategory::Split, "openModView"),
this->split_, &Split::openModViewInBrowser);
}
menu->addAction(
"Create a clip", this->split_,
"Create a clip",
h->getDisplaySequence(HotkeyCategory::Split, "createClip"),
this->split_,
[twitchChannel] {
twitchChannel->createClip();
},
h->getDisplaySequence(HotkeyCategory::Split, "createClip"))
})
->setVisible(twitchChannel->isLive());
menu->addSeparator();
@@ -450,9 +456,9 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (this->split_->getChannel()->getType() == Channel::Type::TwitchWhispers)
{
menu->addAction(
OPEN_WHISPERS_IN_BROWSER, this->split_,
&Split::openWhispersInBrowser,
h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser"));
OPEN_WHISPERS_IN_BROWSER,
h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser"),
this->split_, &Split::openWhispersInBrowser);
menu->addSeparator();
}
@@ -460,8 +466,9 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (this->split_->getChannel()->canReconnect())
{
menu->addAction(
"Reconnect", this, SLOT(reconnect()),
h->getDisplaySequence(HotkeyCategory::Split, "reconnect"));
"Reconnect",
h->getDisplaySequence(HotkeyCategory::Split, "reconnect"), this,
&SplitHeader::reconnect);
}
if (twitchChannel)
@@ -472,12 +479,12 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
"reloadEmotes", {{"channel"}});
auto subSeq = h->getDisplaySequence(HotkeyCategory::Split,
"reloadEmotes", {{"subscriber"}});
menu->addAction("Reload channel emotes", this,
SLOT(reloadChannelEmotes()),
channelSeq.isEmpty() ? bothSeq : channelSeq);
menu->addAction("Reload subscriber emotes", this,
SLOT(reloadSubscriberEmotes()),
subSeq.isEmpty() ? bothSeq : subSeq);
menu->addAction("Reload channel emotes",
channelSeq.isEmpty() ? bothSeq : channelSeq, this,
&SplitHeader::reloadChannelEmotes);
menu->addAction("Reload subscriber emotes",
subSeq.isEmpty() ? bothSeq : subSeq, this,
&SplitHeader::reloadSubscriberEmotes);
}
menu->addSeparator();
@@ -505,11 +512,9 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
// this makes a full std::optional<> with an empty vector inside
}
moreMenu->addAction(
"Toggle moderation mode", this->split_,
[this]() {
"Toggle moderation mode", modModeSeq, this->split_, [this]() {
this->split_->setModerationMode(!this->split_->getModerationMode());
},
modModeSeq);
});
if (this->split_->getChannel()->getType() == Channel::Type::TwitchMentions)
{
@@ -533,13 +538,15 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (twitchChannel->hasModRights())
{
moreMenu->addAction(
"Show chatter list", this->split_, &Split::showChatterList,
h->getDisplaySequence(HotkeyCategory::Split, "openViewerList"));
"Show chatter list",
h->getDisplaySequence(HotkeyCategory::Split, "openViewerList"),
this->split_, &Split::showChatterList);
}
moreMenu->addAction("Subscribe", this->split_, &Split::openSubPage,
moreMenu->addAction("Subscribe",
h->getDisplaySequence(HotkeyCategory::Split,
"openSubscriptionPage"));
"openSubscriptionPage"),
this->split_, &Split::openSubPage);
{
auto *action = new QAction(this);
@@ -603,8 +610,9 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
moreMenu->addSeparator();
moreMenu->addAction(
"Clear messages", this->split_, &Split::clear,
h->getDisplaySequence(HotkeyCategory::Split, "clearMessages"));
"Clear messages",
h->getDisplaySequence(HotkeyCategory::Split, "clearMessages"),
this->split_, &Split::clear);
// moreMenu->addSeparator();
// moreMenu->addAction("Show changelog", this,
// SLOT(moreMenuShowChangelog()));