summaryrefslogtreecommitdiffstats
path: root/src/library/previewbuttondelegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/previewbuttondelegate.cpp')
-rw-r--r--src/library/previewbuttondelegate.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/library/previewbuttondelegate.cpp b/src/library/previewbuttondelegate.cpp
index 753d9037e1..500759f4b0 100644
--- a/src/library/previewbuttondelegate.cpp
+++ b/src/library/previewbuttondelegate.cpp
@@ -2,14 +2,15 @@
#include <QPushButton>
#include <QTableView>
+#include "control/controlproxy.h"
#include "library/previewbuttondelegate.h"
#include "library/trackmodel.h"
#include "mixer/playerinfo.h"
#include "mixer/playermanager.h"
#include "track/track.h"
-#include "control/controlproxy.h"
+#include "widget/wlibrarytableview.h"
-PreviewButtonDelegate::PreviewButtonDelegate(QTableView* parent, int column)
+PreviewButtonDelegate::PreviewButtonDelegate(WLibraryTableView* parent, int column)
: TableItemDelegate(parent),
m_pTableView(parent),
m_isOneCellInEditMode(false),
@@ -22,8 +23,10 @@ PreviewButtonDelegate::PreviewButtonDelegate(QTableView* parent, int column)
PlayerManager::groupForPreviewDeck(0), "cue_gotoandplay", this);
// This assumes that the parent is wtracktableview
- connect(this, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)),
- parent, SIGNAL(loadTrackToPlayer(TrackPointer, QString, bool)));
+ connect(this,
+ &PreviewButtonDelegate::loadTrackToPlayer,
+ parent,
+ &WLibraryTableView::loadTrackToPlayer);
// The button needs to be parented to receive the parent styles.
m_pButton = make_parented<LibraryPreviewButton>(m_pTableView);
@@ -33,8 +36,7 @@ PreviewButtonDelegate::PreviewButtonDelegate(QTableView* parent, int column)
// We need to hide the button that it is not painted by the QObject tree
m_pButton->hide();
- connect(m_pTableView, SIGNAL(entered(QModelIndex)),
- this, SLOT(cellEntered(QModelIndex)));
+ connect(m_pTableView, &QTableView::entered, this, &PreviewButtonDelegate::cellEntered);
}
PreviewButtonDelegate::~PreviewButtonDelegate() {
@@ -55,10 +57,14 @@ QWidget* PreviewButtonDelegate::createEditor(QWidget* parent,
// Check-state is whether the track is loaded (index.data()) and whether
// it's playing.
btn->setChecked(index.data().toBool() && playing);
- connect(btn, SIGNAL(clicked()),
- this, SLOT(buttonClicked()));
- connect(this, SIGNAL(buttonSetChecked(bool)),
- btn, SLOT(setChecked(bool)));
+ connect(btn,
+ &QPushButton::clicked,
+ this,
+ &PreviewButtonDelegate::buttonClicked);
+ connect(this,
+ &PreviewButtonDelegate::buttonSetChecked,
+ btn,
+ &QPushButton::setChecked);
return btn;
}