summaryrefslogtreecommitdiffstats
path: root/src/library
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2021-10-17 03:44:37 +0200
committerGitHub <noreply@github.com>2021-10-17 03:44:37 +0200
commit0a9ec5e6705a3ecf71ef43bd1e6e0a837a819060 (patch)
tree9481c394284119069ee192cb7dc848064045d14f /src/library
parent02a37699380c25903b862949c7d54a39f832de25 (diff)
parente35d04717e76ad6e183396efd50794dea5eb60d7 (diff)
Merge pull request #4444 from Be-ing/stareditor_input_event
StarEditor: fix deprecation warning for QMouseEvent::x
Diffstat (limited to 'src/library')
-rw-r--r--src/library/stareditor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/library/stareditor.cpp b/src/library/stareditor.cpp
index 4d5dc07960..8c38f9d8d5 100644
--- a/src/library/stareditor.cpp
+++ b/src/library/stareditor.cpp
@@ -82,7 +82,12 @@ void StarEditor::paintEvent(QPaintEvent*) {
}
void StarEditor::mouseMoveEvent(QMouseEvent *event) {
- int star = starAtPosition(event->x());
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ const int eventPosition = static_cast<int>(event->position().x());
+#else
+ const int eventPosition = event->x();
+#endif
+ int star = starAtPosition(eventPosition);
if (star != m_starRating.starCount() && star != -1) {
m_starRating.setStarCount(star);