aboutsummaryrefslogtreecommitdiffhomepage
path: root/qt
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2026-03-02 10:36:18 +1100
committerNeil <nyamatongwe@gmail.com>2026-03-02 10:36:18 +1100
commit2a0dd1586414f83b55cb20d11042fb49efc88419 (patch)
tree43e47963593ebd0a6d5e39bedb7776a42bdcfc71 /qt
parent7621fda67d13735836c6f050d1eec8c691a68292 (diff)
downloadscintilla-mirror-2a0dd1586414f83b55cb20d11042fb49efc88419.tar.gz
Update deprecated methods for Qt 6+.
QDropEvent::pos -> position for Qt6. QMessageBox constructor updated to variant with single buttons argument.
Diffstat (limited to 'qt')
-rw-r--r--qt/ScintillaEditBase/PlatQt.cpp5
-rw-r--r--qt/ScintillaEditBase/PlatQt.h5
-rw-r--r--qt/ScintillaEditBase/ScintillaEditBase.cpp16
3 files changed, 23 insertions, 3 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp
index 38aec01a0..96e7f2865 100644
--- a/qt/ScintillaEditBase/PlatQt.cpp
+++ b/qt/ScintillaEditBase/PlatQt.cpp
@@ -1378,8 +1378,13 @@ void Platform::Assert(const char *c, const char *file, int line) noexcept
char buffer[2000];
snprintf(buffer, std::size(buffer), "Assertion [%s] failed at %s %d", c, file, line);
if (Platform::ShowAssertionPopUps(false)) {
+#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
+ QMessageBox mb(QMessageBox::Icon::NoIcon, "Assertion Failure", buffer,
+ QMessageBox::StandardButton::Ok);
+#else
QMessageBox mb("Assertion Failure", buffer, QMessageBox::NoIcon,
QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton);
+#endif
mb.exec();
} else {
strcat(buffer, "\n");
diff --git a/qt/ScintillaEditBase/PlatQt.h b/qt/ScintillaEditBase/PlatQt.h
index 08cda9dc4..56fa8bb06 100644
--- a/qt/ScintillaEditBase/PlatQt.h
+++ b/qt/ScintillaEditBase/PlatQt.h
@@ -61,6 +61,11 @@ inline Point PointFromQPoint(QPoint qp)
return Point(qp.x(), qp.y());
}
+inline Point PointFromQPointF(QPointF qp)
+{
+ return Point(qp.x(), qp.y());
+}
+
inline QPointF QPointFFromPoint(Point qp)
{
return QPointF(qp.x, qp.y);
diff --git a/qt/ScintillaEditBase/ScintillaEditBase.cpp b/qt/ScintillaEditBase/ScintillaEditBase.cpp
index 187da9dbe..477dd44cf 100644
--- a/qt/ScintillaEditBase/ScintillaEditBase.cpp
+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp
@@ -304,6 +304,16 @@ unsigned int TimeOfEvent(const QElapsedTimer &timer)
return static_cast<unsigned int>(timer.elapsed() % maxTime);
}
+Point PointOfEvent(const QDropEvent *event)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ PLATFORM_ASSERT(false);
+ return PointFromQPointF(event->position());
+#else
+ return PointFromQPoint(event->pos());
+#endif
+}
+
}
void ScintillaEditBase::mousePressEvent(QMouseEvent *event)
@@ -396,7 +406,7 @@ void ScintillaEditBase::dragEnterEvent(QDragEnterEvent *event)
} else if (event->mimeData()->hasText()) {
event->acceptProposedAction();
- const Point point = PointFromQPoint(event->pos());
+ const Point point = PointOfEvent(event);
sqt->DragEnter(point);
} else {
event->ignore();
@@ -415,7 +425,7 @@ void ScintillaEditBase::dragMoveEvent(QDragMoveEvent *event)
} else if (event->mimeData()->hasText()) {
event->acceptProposedAction();
- const Point point = PointFromQPoint(event->pos());
+ const Point point = PointOfEvent(event);
sqt->DragMove(point);
} else {
event->ignore();
@@ -430,7 +440,7 @@ void ScintillaEditBase::dropEvent(QDropEvent *event)
} else if (event->mimeData()->hasText()) {
event->acceptProposedAction();
- const Point point = PointFromQPoint(event->pos());
+ const Point point = PointOfEvent(event);
const bool move = (event->source() == this &&
event->proposedAction() == Qt::MoveAction);
sqt->Drop(point, event->mimeData(), move);