Skip to content

Commit

Permalink
Merge pull request #4444 from Be-ing/stareditor_input_event
Browse files Browse the repository at this point in the history
StarEditor: fix deprecation warning for QMouseEvent::x
  • Loading branch information
Holzhaus authored Oct 17, 2021
2 parents 02a3769 + e35d047 commit 0a9ec5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/library/stareditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0a9ec5e

Please sign in to comment.