diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-11-18 12:42:13 +0100 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-11-18 12:51:54 +0100 |
commit | ba245bd071fb84241690bbffe4f4a690f8ddcb13 (patch) | |
tree | 9512c3e580a848f702c4dfbefb0bf39d0501ef42 /src/widget/wlibrarysidebar.cpp | |
parent | 69cd48e0882e87cf0a719f57668649d759d7cfce (diff) |
Replace dynamic_cast with qobject_cast
Diffstat (limited to 'src/widget/wlibrarysidebar.cpp')
-rw-r--r-- | src/widget/wlibrarysidebar.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widget/wlibrarysidebar.cpp b/src/widget/wlibrarysidebar.cpp index 72626e0faa..93fe776e23 100644 --- a/src/widget/wlibrarysidebar.cpp +++ b/src/widget/wlibrarysidebar.cpp @@ -77,7 +77,7 @@ void WLibrarySidebar::dragMoveEvent(QDragMoveEvent * event) { // Do nothing. event->ignore(); } else { - SidebarModel* sidebarModel = dynamic_cast<SidebarModel*>(model()); + SidebarModel* sidebarModel = qobject_cast<SidebarModel*>(model()); bool accepted = true; if (sidebarModel) { accepted = false; @@ -134,7 +134,7 @@ void WLibrarySidebar::dropEvent(QDropEvent * event) { //this->selectionModel()->clear(); //Drag-and-drop from an external application or the track table widget //eg. dragging a track from Windows Explorer onto the sidebar - SidebarModel* sidebarModel = dynamic_cast<SidebarModel*>(model()); + SidebarModel* sidebarModel = qobject_cast<SidebarModel*>(model()); if (sidebarModel) { QModelIndex destIndex = indexAt(event->pos()); // event->source() will return NULL if something is dropped from @@ -173,7 +173,7 @@ bool WLibrarySidebar::isLeafNodeSelected() { if(!index.model()->hasChildren(index)) { return true; } - const SidebarModel* sidebarModel = dynamic_cast<const SidebarModel*>(index.model()); + const SidebarModel* sidebarModel = qobject_cast<const SidebarModel*>(index.model()); if (sidebarModel) { return sidebarModel->hasTrackTable(index); } |