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
+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();
}