Fix QWidget::enterEvent with Qt 6

This commit is contained in:
Jonas Kvinge
2020-09-05 19:20:43 +02:00
parent 31dd910289
commit 73692797dc
8 changed files with 49 additions and 10 deletions

View File

@@ -31,6 +31,7 @@
#include <QActionGroup>
#include <QEvent>
#include <QContextMenuEvent>
#include <QEnterEvent>
#include "playlistheader.h"
#include "playlistview.h"
@@ -138,7 +139,11 @@ void PlaylistHeader::ToggleVisible(int section) {
emit SectionVisibilityChanged(section, !isSectionHidden(section));
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void PlaylistHeader::enterEvent(QEnterEvent*) {
#else
void PlaylistHeader::enterEvent(QEvent*) {
#endif
emit MouseEntered();
}

View File

@@ -33,6 +33,7 @@ class QMenu;
class QAction;
class QEvent;
class QContextMenuEvent;
class QEnterEvent;
class PlaylistView;
@@ -44,7 +45,11 @@ class PlaylistHeader : public StretchHeaderView {
// QWidget
void contextMenuEvent(QContextMenuEvent *e) override;
void enterEvent(QEvent *) override;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void enterEvent(QEnterEvent*) override;
#else
void enterEvent(QEvent*) override;
#endif
signals:
void SectionVisibilityChanged(int logical, bool visible);