diff options
author | Ferran Pujol Camins <ferranpujolcamins@gmail.com> | 2019-09-22 19:49:54 +0200 |
---|---|---|
committer | Ferran Pujol Camins <ferranpujolcamins@gmail.com> | 2019-09-22 19:49:54 +0200 |
commit | 3b438887b52d758bed0ad05de65a0aa0a8c1db6e (patch) | |
tree | 2e295e6ec4f1f6960612d80834512530f1fa7a71 /src/library/dlganalysis.cpp | |
parent | a7ae01df752b557ddcff261b3500a5189143927b (diff) |
Use new signals and slots syntax
Diffstat (limited to 'src/library/dlganalysis.cpp')
-rw-r--r-- | src/library/dlganalysis.cpp | 66 |
1 files changed, 43 insertions, 23 deletions
diff --git a/src/library/dlganalysis.cpp b/src/library/dlganalysis.cpp index c3c123c6da..a1484ede50 100644 --- a/src/library/dlganalysis.cpp +++ b/src/library/dlganalysis.cpp @@ -22,13 +22,19 @@ DlgAnalysis::DlgAnalysis(QWidget* parent, m_songsButtonGroup.addButton(radioButtonAllSongs); m_pAnalysisLibraryTableView = new WAnalysisLibraryTableView(this, pConfig, m_pTrackCollection); - connect(m_pAnalysisLibraryTableView, SIGNAL(loadTrack(TrackPointer)), - this, SIGNAL(loadTrack(TrackPointer))); - connect(m_pAnalysisLibraryTableView, SIGNAL(loadTrackToPlayer(TrackPointer, QString)), - this, SIGNAL(loadTrackToPlayer(TrackPointer, QString))); + connect(m_pAnalysisLibraryTableView, + &WAnalysisLibraryTableView::loadTrack, + this, + &DlgAnalysis::loadTrack); + connect(m_pAnalysisLibraryTableView, + &WAnalysisLibraryTableView::loadTrackToPlayer, + this, + &DlgAnalysis::loadTrackToPlayer); - connect(m_pAnalysisLibraryTableView, SIGNAL(trackSelected(TrackPointer)), - this, SIGNAL(trackSelected(TrackPointer))); + connect(m_pAnalysisLibraryTableView, + &WAnalysisLibraryTableView::trackSelected, + this, + &DlgAnalysis::trackSelected); QBoxLayout* box = dynamic_cast<QBoxLayout*>(layout()); VERIFY_OR_DEBUG_ASSERT(box) { // Assumes the form layout is a QVBox/QHBoxLayout! @@ -41,32 +47,46 @@ DlgAnalysis::DlgAnalysis(QWidget* parent, m_pAnalysisLibraryTableModel = new AnalysisLibraryTableModel(this, m_pTrackCollection); m_pAnalysisLibraryTableView->loadTrackModel(m_pAnalysisLibraryTableModel); - connect(radioButtonRecentlyAdded, SIGNAL(clicked()), - this, SLOT(showRecentSongs())); - connect(radioButtonAllSongs, SIGNAL(clicked()), - this, SLOT(showAllSongs())); + connect(radioButtonRecentlyAdded, + &QRadioButton::clicked, + this, + &DlgAnalysis::showRecentSongs); + connect(radioButtonAllSongs, + &QRadioButton::clicked, + this, + &DlgAnalysis::showAllSongs); // TODO(rryan): This triggers a library search before the UI has even // started up. Accounts for 0.2% of skin creation time. Get rid of this! radioButtonRecentlyAdded->click(); - connect(pushButtonAnalyze, SIGNAL(clicked()), - this, SLOT(analyze())); + connect(pushButtonAnalyze, + &QPushButton::clicked, + this, + &DlgAnalysis::analyze); - connect(pushButtonSelectAll, SIGNAL(clicked()), - this, SLOT(selectAll())); + connect(pushButtonSelectAll, + &QPushButton::clicked, + this, + &DlgAnalysis::selectAll); connect(m_pAnalysisLibraryTableView->selectionModel(), - SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection&)), + &QItemSelectionModel::selectionChanged, this, - SLOT(tableSelectionChanged(const QItemSelection &, const QItemSelection&))); - - connect(pLibrary, SIGNAL(setTrackTableFont(QFont)), - m_pAnalysisLibraryTableView, SLOT(setTrackTableFont(QFont))); - connect(pLibrary, SIGNAL(setTrackTableRowHeight(int)), - m_pAnalysisLibraryTableView, SLOT(setTrackTableRowHeight(int))); - connect(pLibrary, SIGNAL(setSelectedClick(bool)), - m_pAnalysisLibraryTableView, SLOT(setSelectedClick(bool))); + &DlgAnalysis::tableSelectionChanged); + + connect(pLibrary, + &Library::setTrackTableFont, + m_pAnalysisLibraryTableView, + &WAnalysisLibraryTableView::setTrackTableFont); + connect(pLibrary, + &Library::setTrackTableRowHeight, + m_pAnalysisLibraryTableView, + &WAnalysisLibraryTableView::setTrackTableRowHeight); + connect(pLibrary, + &Library::setSelectedClick, + m_pAnalysisLibraryTableView, + &WAnalysisLibraryTableView::setSelectedClick); slotAnalysisActive(m_bAnalysisActive); } |