diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-11-13 17:23:25 +0100 |
---|---|---|
committer | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-11-13 17:35:36 +0100 |
commit | d280399e55acb7e2ba0390801beb58accaefb471 (patch) | |
tree | 293b8181282efe2be466764ed5884db76300ea7a /src | |
parent | 8d6474085714c6db2e5e67b149de12d4e249356f (diff) |
widget: Replace old-style Qt connect() calls
Diffstat (limited to 'src')
-rw-r--r-- | src/widget/wbattery.cpp | 5 | ||||
-rw-r--r-- | src/widget/wbeatspinbox.cpp | 6 | ||||
-rw-r--r-- | src/widget/wcombobox.cpp | 6 | ||||
-rw-r--r-- | src/widget/wcoverart.cpp | 18 | ||||
-rw-r--r-- | src/widget/wcoverartmenu.cpp | 6 | ||||
-rw-r--r-- | src/widget/weffect.cpp | 3 | ||||
-rw-r--r-- | src/widget/weffectchain.cpp | 6 | ||||
-rw-r--r-- | src/widget/weffectparameterbase.cpp | 6 | ||||
-rw-r--r-- | src/widget/weffectparameterknob.cpp | 6 | ||||
-rw-r--r-- | src/widget/weffectparameterknobcomposed.cpp | 6 | ||||
-rw-r--r-- | src/widget/weffectpushbutton.cpp | 9 | ||||
-rw-r--r-- | src/widget/weffectselector.cpp | 18 | ||||
-rw-r--r-- | src/widget/wknob.cpp | 5 | ||||
-rw-r--r-- | src/widget/wknobcomposed.cpp | 5 | ||||
-rw-r--r-- | src/widget/wlibrarytableview.cpp | 6 | ||||
-rw-r--r-- | src/widget/wmainmenubar.cpp | 95 | ||||
-rw-r--r-- | src/widget/wmainmenubar.h | 4 | ||||
-rw-r--r-- | src/widget/wrecordingduration.cpp | 12 | ||||
-rw-r--r-- | src/widget/wslidercomposed.cpp | 5 | ||||
-rw-r--r-- | src/widget/wspinny.cpp | 30 | ||||
-rw-r--r-- | src/widget/wsplitter.cpp | 3 | ||||
-rw-r--r-- | src/widget/wstarrating.cpp | 7 | ||||
-rw-r--r-- | src/widget/wtime.cpp | 3 | ||||
-rw-r--r-- | src/widget/wwidgetstack.cpp | 3 |
24 files changed, 154 insertions, 119 deletions
diff --git a/src/widget/wbattery.cpp b/src/widget/wbattery.cpp index f8880e85ac..7a20dc2c6a 100644 --- a/src/widget/wbattery.cpp +++ b/src/widget/wbattery.cpp @@ -10,8 +10,9 @@ WBattery::WBattery(QWidget* parent) m_pBattery(Battery::getBattery(this)) { setVisible(false); if (m_pBattery) { - connect(m_pBattery.data(), SIGNAL(stateChanged()), - this, SLOT(update())); + connect(m_pBattery.data(), &Battery::stateChanged, this, [this]() { + update(); + }); } } diff --git a/src/widget/wbeatspinbox.cpp b/src/widget/wbeatspinbox.cpp index 2414ff5665..9373f56499 100644 --- a/src/widget/wbeatspinbox.cpp +++ b/src/widget/wbeatspinbox.cpp @@ -30,8 +30,10 @@ WBeatSpinBox::WBeatSpinBox(QWidget* parent, lineEdit()->setFocusPolicy(Qt::ClickFocus); setValue(m_valueControl.get()); - connect(this, SIGNAL(valueChanged(double)), - this, SLOT(slotSpinboxValueChanged(double))); + connect(this, + QOverload<double>::of(&QDoubleSpinBox::valueChanged), + this, + &WBeatSpinBox::slotSpinboxValueChanged); m_valueControl.connectValueChanged(this, &WBeatSpinBox::slotControlValueChanged); } diff --git a/src/widget/wcombobox.cpp b/src/widget/wcombobox.cpp index 5bf9314c8d..9e682c2be7 100644 --- a/src/widget/wcombobox.cpp +++ b/src/widget/wcombobox.cpp @@ -6,8 +6,10 @@ WComboBox::WComboBox(QWidget* pParent) : QComboBox(pParent), WBaseWidget(this) { - connect(this, SIGNAL(currentIndexChanged(int)), - this, SLOT(slotCurrentIndexChanged(int))); + connect(this, + QOverload<int>::of(&QComboBox::currentIndexChanged), + this, + &WComboBox::slotCurrentIndexChanged); } void WComboBox::setup(const QDomNode& node, const SkinContext& context) { diff --git a/src/widget/wcoverart.cpp b/src/widget/wcoverart.cpp index 36a22ee75b..7e25b28665 100644 --- a/src/widget/wcoverart.cpp +++ b/src/widget/wcoverart.cpp @@ -40,16 +40,12 @@ WCoverArt::WCoverArt(QWidget* parent, this, &WCoverArt::slotCoverFound); } - connect(m_pMenu, SIGNAL(coverInfoSelected(const CoverInfoRelative&)), - this, SLOT(slotCoverInfoSelected(const CoverInfoRelative&))); - connect(m_pMenu, SIGNAL(reloadCoverArt()), - this, SLOT(slotReloadCoverArt())); + connect(m_pMenu, &WCoverArtMenu::coverInfoSelected, this, &WCoverArt::slotCoverInfoSelected); + connect(m_pMenu, &WCoverArtMenu::reloadCoverArt, this, &WCoverArt::slotReloadCoverArt); if (m_pPlayer != nullptr) { - connect(m_pPlayer, SIGNAL(newTrackLoaded(TrackPointer)), - this, SLOT(slotLoadTrack(TrackPointer))); - connect(m_pPlayer, SIGNAL(loadingTrack(TrackPointer, TrackPointer)), - this, SLOT(slotLoadingTrack(TrackPointer, TrackPointer))); + connect(m_pPlayer, &BaseTrackPlayer::newTrackLoaded, this, &WCoverArt::slotLoadTrack); + connect(m_pPlayer, &BaseTrackPlayer::loadingTrack, this, &WCoverArt::slotLoadingTrack); // just in case a track is already loaded slotLoadTrack(m_pPlayer->getLoadedTrack()); @@ -174,8 +170,10 @@ void WCoverArt::slotCoverFound( void WCoverArt::slotLoadTrack(TrackPointer pTrack) { if (m_loadedTrack) { - disconnect(m_loadedTrack.get(), SIGNAL(coverArtUpdated()), - this, SLOT(slotTrackCoverArtUpdated())); + disconnect(m_loadedTrack.get(), + &Track::coverArtUpdated, + this, + &WCoverArt::slotTrackCoverArtUpdated); } m_lastRequestedCover = CoverInfo(); m_loadedCover = QPixmap(); diff --git a/src/widget/wcoverartmenu.cpp b/src/widget/wcoverartmenu.cpp index c77e93731c..437ab6d1b9 100644 --- a/src/widget/wcoverartmenu.cpp +++ b/src/widget/wcoverartmenu.cpp @@ -19,17 +19,17 @@ WCoverArtMenu::~WCoverArtMenu() { void WCoverArtMenu::createActions() { m_pChange = new QAction(tr("Choose new cover", "change cover art location"), this); - connect(m_pChange, SIGNAL(triggered()), this, SLOT(slotChange())); + connect(m_pChange, &QAction::triggered, this, &WCoverArtMenu::slotChange); addAction(m_pChange); m_pUnset = new QAction(tr("Clear cover", "clears the set cover art -- does not touch files on disk"), this); - connect(m_pUnset, SIGNAL(triggered()), this, SLOT(slotUnset())); + connect(m_pUnset, &QAction::triggered, this, &WCoverArtMenu::slotUnset); addAction(m_pUnset); m_pReload = new QAction(tr("Reload from file/folder", "reload cover art from file metadata or folder"), this); - connect(m_pReload, SIGNAL(triggered()), this, SIGNAL(reloadCoverArt())); + connect(m_pReload, &QAction::triggered, this, &WCoverArtMenu::reloadCoverArt); addAction(m_pReload); } diff --git a/src/widget/weffect.cpp b/src/widget/weffect.cpp index 8754a99987..e62fd529d9 100644 --- a/src/widget/weffect.cpp +++ b/src/widget/weffect.cpp @@ -31,8 +31,7 @@ void WEffect::setup(const QDomNode& node, const SkinContext& context) { void WEffect::setEffectSlot(EffectSlotPointer pEffectSlot) { if (pEffectSlot) { m_pEffectSlot = pEffectSlot; - connect(pEffectSlot.data(), SIGNAL(updated()), - this, SLOT(effectUpdated())); + connect(pEffectSlot.data(), &EffectSlot::updated, this, &WEffect::effectUpdated); effectUpdated(); } } diff --git a/src/widget/weffectchain.cpp b/src/widget/weffectchain.cpp index cf6ccda72a..9d2121ff24 100644 --- a/src/widget/weffectchain.cpp +++ b/src/widget/weffectchain.cpp @@ -28,8 +28,10 @@ void WEffectChain::setup(const QDomNode& node, const SkinContext& context) { void WEffectChain::setEffectChainSlot(EffectChainSlotPointer pEffectChainSlot) { if (pEffectChainSlot) { m_pEffectChainSlot = pEffectChainSlot; - connect(pEffectChainSlot.data(), SIGNAL(updated()), - this, SLOT(chainUpdated())); + connect(pEffectChainSlot.data(), + &EffectChainSlot::updated, + this, + &WEffectChain::chainUpdated); chainUpdated(); } } diff --git a/src/widget/weffectparameterbase.cpp b/src/widget/weffectparameterbase.cpp index f2b46be289..8fa10e93ad 100644 --- a/src/widget/weffectparameterbase.cpp +++ b/src/widget/weffectparameterbase.cpp @@ -13,8 +13,10 @@ void WEffectParameterBase::setEffectParameterSlot( EffectParameterSlotBasePointer pEffectParameterSlot) { m_pEffectParameterSlot = pEffectParameterSlot; if (m_pEffectParameterSlot) { - connect(m_pEffectParameterSlot.data(), SIGNAL(updated()), - this, SLOT(parameterUpdated())); + connect(m_pEffectParameterSlot.data(), + &EffectParameterSlotBase::updated, + this, + &WEffectParameterBase::parameterUpdated); } parameterUpdated(); } diff --git a/src/widget/weffectparameterknob.cpp b/src/widget/weffectparameterknob.cpp index 087f819115..6b07483b61 100644 --- a/src/widget/weffectparameterknob.cpp +++ b/src/widget/weffectparameterknob.cpp @@ -17,8 +17,10 @@ void WEffectParameterKnob::setEffectParameterSlot( EffectParameterSlotPointer pParameterSlot) { m_pEffectParameterSlot = pParameterSlot; if (m_pEffectParameterSlot) { - connect(m_pEffectParameterSlot.data(), SIGNAL(updated()), - this, SLOT(parameterUpdated())); + connect(m_pEffectParameterSlot.data(), + &EffectParameterSlot::updated, + this, + &WEffectParameterKnob::parameterUpdated); } parameterUpdated(); } diff --git a/src/widget/weffectparameterknobcomposed.cpp b/src/widget/weffectparameterknobcomposed.cpp index f4d03a6226..df10fc7544 100644 --- a/src/widget/weffectparameterknobcomposed.cpp +++ b/src/widget/weffectparameterknobcomposed.cpp @@ -22,8 +22,10 @@ void WEffectParameterKnobComposed::setEffectParameterSlot( EffectParameterSlotPointer pParameterSlot) { m_pEffectParameterSlot = pParameterSlot; if (m_pEffectParameterSlot) { - connect(m_pEffectParameterSlot.data(), SIGNAL(updated()), - this, SLOT(parameterUpdated())); + connect(m_pEffectParameterSlot.data(), + &EffectParameterSlot::updated, + this, + &WEffectParameterKnobComposed::parameterUpdated); } parameterUpdated(); } diff --git a/src/widget/weffectpushbutton.cpp b/src/widget/weffectpushbutton.cpp index 58fceb97de..1e21fd34ce 100644 --- a/src/widget/weffectpushbutton.cpp +++ b/src/widget/weffectpushbutton.cpp @@ -15,8 +15,7 @@ void WEffectPushButton::setup(const QDomNode& node, const SkinContext& context) WPushButton::setup(node, context); m_pButtonMenu = new QMenu(this); - connect(m_pButtonMenu, SIGNAL(triggered(QAction*)), - this, SLOT(slotActionChosen(QAction*))); + connect(m_pButtonMenu, &QMenu::triggered, this, &WEffectPushButton::slotActionChosen); setFocusPolicy(Qt::NoFocus); } @@ -35,8 +34,10 @@ void WEffectPushButton::setEffectParameterSlot( EffectButtonParameterSlotPointer pParameterSlot) { m_pEffectParameterSlot = pParameterSlot; if (m_pEffectParameterSlot) { - connect(m_pEffectParameterSlot.data(), SIGNAL(updated()), - this, SLOT(parameterUpdated())); + connect(m_pEffectParameterSlot.data(), + &EffectParameterSlot::updated, + this, + &WEffectPushButton::parameterUpdated); } parameterUpdated(); } diff --git a/src/widget/weffectselector.cpp b/src/widget/weffectselector.cpp index 2909336601..f6c567158f 100644 --- a/src/widget/weffectselector.cpp +++ b/src/widget/weffectselector.cpp @@ -27,12 +27,18 @@ void WEffectSelector::setup(const QDomNode& node, const SkinContext& context) { node, context, m_pChainSlot); if (m_pEffectSlot != nullptr) { - connect(m_pEffectsManager, SIGNAL(visibleEffectsUpdated()), - this, SLOT(populate())); - connect(m_pEffectSlot.data(), SIGNAL(updated()), - this, SLOT(slotEffectUpdated())); - connect(this, SIGNAL(currentIndexChanged(int)), - this, SLOT(slotEffectSelected(int))); + connect(m_pEffectsManager, + &EffectsManager::visibleEffectsUpdated, + this, + &WEffectSelector::populate); + connect(m_pEffectSlot.data(), + &EffectSlot::updated, + this, + &WEffectSelector::slotEffectUpdated); + connect(this, + QOverload<int>::of(&WEffectSelector::currentIndexChanged), + this, + &WEffectSelector::slotEffectSelected); } else { SKIN_WARNING(node, context) << "EffectSelector node could not attach to effect slot."; diff --git a/src/widget/wknob.cpp b/src/widget/wknob.cpp index 80395ab5c9..891134f62b 100644 --- a/src/widget/wknob.cpp +++ b/src/widget/wknob.cpp @@ -26,8 +26,9 @@ WKnob::WKnob(QWidget* pParent) : WDisplay(pParent), m_renderTimer(mixxx::Duration::fromMillis(20), mixxx::Duration::fromSeconds(1)) { - connect(&m_renderTimer, SIGNAL(update()), - this, SLOT(update())); + connect(&m_renderTimer, &WidgetRenderTimer::update, this, [this]() { + update(); + }); setFocusPolicy(Qt::NoFocus); } diff --git a/src/widget/wknobcomposed.cpp b/src/widget/wknobcomposed.cpp index 1d686e2da0..5e804ea939 100644 --- a/src/widget/wknobcomposed.cpp +++ b/src/widget/wknobcomposed.cpp @@ -21,8 +21,9 @@ WKnobComposed::WKnobComposed(QWidget* pParent) m_arcPenCap(Qt::FlatCap), m_renderTimer(mixxx::Duration::fromMillis(20), mixxx::Duration::fromSeconds(1)) { - connect(&m_renderTimer, SIGNAL(update()), - this, SLOT(update())); + connect(&m_renderTimer, &WidgetRenderTimer::update, this, [this]() { + update(); + }); } void WKnobComposed::setup(const QDomNode& node, const SkinContext& context) { diff --git a/src/widget/wlibrarytableview.cpp b/src/widget/wlibrarytableview.cpp index 06740d3bf9..0baabfc6bd 100644 --- a/src/widget/wlibrarytableview.cpp +++ b/src/widget/wlibrarytableview.cpp @@ -44,8 +44,10 @@ WLibraryTableView::WLibraryTableView(QWidget* parent, setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setAlternatingRowColors(true); - connect(verticalScrollBar(), SIGNAL(valueChanged(int)), - this, SIGNAL(scrollValueChanged(int))); + connect(verticalScrollBar(), + &QScrollBar::valueChanged, + this, + &WLibraryTableView::scrollValueChanged); setTabKeyNavigation(false); } diff --git a/src/widget/wmainmenubar.cpp b/src/widget/wmainmenubar.cpp index c5ee65edf0..f4d04078a1 100644 --- a/src/widget/wmainmenubar.cpp +++ b/src/widget/wmainmenubar.cpp @@ -103,7 +103,7 @@ void WMainMenuBar::initialize() { pFileQuit->setStatusTip(quitText); pFileQuit->setWhatsThis(buildWhatsThis(quitTitle, quitText)); pFileQuit->setMenuRole(QAction::QuitRole); - connect(pFileQuit, SIGNAL(triggered()), this, SIGNAL(quit())); + connect(pFileQuit, &QAction::triggered, this, &WMainMenuBar::quit); pFileMenu->addAction(pFileQuit); addMenu(pFileMenu); @@ -117,11 +117,9 @@ void WMainMenuBar::initialize() { pLibraryRescan->setStatusTip(rescanText); pLibraryRescan->setWhatsThis(buildWhatsThis(rescanTitle, rescanText)); pLibraryRescan->setCheckable(false); - connect(pLibraryRescan, SIGNAL(triggered()), - this, SIGNAL(rescanLibrary())); + connect(pLibraryRescan, &QAction::triggered, this, &WMainMenuBar::rescanLibrary); // Disable the action when a scan is active. - connect(this, SIGNAL(internalLibraryScanActive(bool)), - pLibraryRescan, SLOT(setDisabled(bool))); + connect(this, &WMainMenuBar::internalLibraryScanActive, pLibraryRescan, &QAction::setDisabled); pLibraryMenu->addAction(pLibraryRescan); pLibraryMenu->addSeparator(); @@ -136,8 +134,7 @@ void WMainMenuBar::initialize() { pLibraryCreatePlaylist->setShortcutContext(Qt::ApplicationShortcut); pLibraryCreatePlaylist->setStatusTip(createPlaylistText); pLibraryCreatePlaylist->setWhatsThis(buildWhatsThis(createPlaylistTitle, createPlaylistText)); - connect(pLibraryCreatePlaylist, SIGNAL(triggered()), - this, SIGNAL(createPlaylist())); + connect(pLibraryCreatePlaylist, &QAction::triggered, this, &WMainMenuBar::createPlaylist); pLibraryMenu->addAction(pLibraryCreatePlaylist); QString createCrateTitle = tr("Create New &Crate"); @@ -150,8 +147,7 @@ void WMainMenuBar::initialize() { pLibraryCreateCrate->setShortcutContext(Qt::ApplicationShortcut); pLibraryCreateCrate->setStatusTip(createCrateText); pLibraryCreateCrate->setWhatsThis(buildWhatsThis(createCrateTitle, createCrateText)); - connect(pLibraryCreateCrate, SIGNAL(triggered()), - this, SIGNAL(createCrate())); + connect(pLibraryCreateCrate, &QAction::triggered, this, &WMainMenuBar::createCrate); pLibraryMenu->addAction(pLibraryCreateCrate); addMenu(pLibraryMenu); @@ -289,10 +285,11 @@ void WMainMenuBar::initialize() { pViewFullScreen->setChecked(false); pViewFullScreen->setStatusTip(fullScreenText); pViewFullScreen->setWhatsThis(buildWhatsThis(fullScreenTitle, fullScreenText)); - connect(pViewFullScreen, SIGNAL(triggered(bool)), - this, SIGNAL(toggleFullScreen(bool))); - connect(this, SIGNAL(internalFullScreenStateChange(bool)), - pViewFullScreen, SLOT(setChecked(bool))); + connect(pViewFullScreen, &QAction::triggered, this, &WMainMenuBar::toggleFullScreen); + connect(this, + &WMainMenuBar::internalFullScreenStateChange, + pViewFullScreen, + &QAction::setChecked); pViewMenu->addAction(pViewFullScreen); addMenu(pViewMenu); @@ -348,10 +345,11 @@ void WMainMenuBar::initialize() { pOptionsRecord->setCheckable(true); pOptionsRecord->setStatusTip(recordText); pOptionsRecord->setWhatsThis(buildWhatsThis(recordTitle, recordText)); - connect(pOptionsRecord, SIGNAL(triggered(bool)), - this, SIGNAL(toggleRecording(bool))); - connect(this, SIGNAL(internalRecordingStateChange(bool)), - pOptionsRecord, SLOT(setChecked(bool))); + connect(pOptionsRecord, &QAction::triggered, this, &WMainMenuBar::toggleRecording); + connect(this, + &WMainMenuBar::internalRecordingStateChange, + pOptionsRecord, + &QAction::setChecked); pOptionsMenu->addAction(pOptionsRecord); #ifdef __BROADCAST__ @@ -368,10 +366,11 @@ void WMainMenuBar::initialize() { pOptionsBroadcasting->setStatusTip(broadcastingText); pOptionsBroadcasting->setWhatsThis(buildWhatsThis(broadcastingTitle, broadcastingText)); - connect(pOptionsBroadcasting, SIGNAL(triggered(bool)), - this, SIGNAL(toggleBroadcasting(bool))); - connect(this, SIGNAL(internalBroadcastingStateChange(bool)), - pOptionsBroadcasting, SLOT(setChecked(bool))); + connect(pOptionsBroadcasting, &QAction::triggered, this, &WMainMenuBar::toggleBroadcasting); + connect(this, + &WMainMenuBar::internalBroadcastingStateChange, + pOptionsBroadcasting, + &QAction::setChecked); pOptionsMenu->addAction(pOptionsBroadcasting); #endif @@ -391,8 +390,7 @@ void WMainMenuBar::initialize() { pOptionsKeyboard->setChecked(keyboardShortcutsEnabled); pOptionsKeyboard->setStatusTip(keyboardShortcutText); pOptionsKeyboard->setWhatsThis(buildWhatsThis(keyboardShortcutTitle, keyboardShortcutText)); - connect(pOptionsKeyboard, SIGNAL(triggered(bool)), - this, SIGNAL(toggleKeyboardShortcuts(bool))); + connect(pOptionsKeyboard, &QAction::triggered, this, &WMainMenuBar::toggleKeyboardShortcuts); pOptionsMenu->addAction(pOptionsKeyboard); @@ -409,8 +407,7 @@ void WMainMenuBar::initialize() { pOptionsPreferences->setStatusTip(preferencesText); pOptionsPreferences->setWhatsThis(buildWhatsThis(preferencesTitle, preferencesText)); pOptionsPreferences->setMenuRole(QAction::PreferencesRole); - connect(pOptionsPreferences, SIGNAL(triggered()), - this, SIGNAL(showPreferences())); + connect(pOptionsPreferences, &QAction::triggered, this, &WMainMenuBar::showPreferences); pOptionsMenu->addAction(pOptionsPreferences); addMenu(pOptionsMenu); @@ -429,8 +426,7 @@ void WMainMenuBar::initialize() { pDeveloperReloadSkin->setShortcutContext(Qt::ApplicationShortcut); pDeveloperReloadSkin->setStatusTip(reloadSkinText); pDeveloperReloadSkin->setWhatsThis(buildWhatsThis(reloadSkinTitle, reloadSkinText)); - connect(pDeveloperReloadSkin, SIGNAL(triggered()), - this, SIGNAL(reloadSkin())); + connect(pDeveloperReloadSkin, &QAction::triggered, this, &WMainMenuBar::reloadSkin); pDeveloperMenu->addAction(pDeveloperReloadSkin); QString developerToolsTitle = tr("Developer &Tools"); @@ -445,10 +441,11 @@ void WMainMenuBar::initialize() { pDeveloperTools->setChecked(false); pDeveloperTools->setStatusTip(developerToolsText); pDeveloperTools->setWhatsThis(buildWhatsThis(developerToolsTitle, developerToolsText)); - connect(pDeveloperTools, SIGNAL(triggered(bool)), - this, SIGNAL(toggleDeveloperTools(bool))); - connect(this, SIGNAL(internalDeveloperToolsStateChange(bool)), - pDeveloperTools, SLOT(setChecked(bool))); + connect(pDeveloperTools, &QAction::triggered, this, &WMainMenuBar::toggleDeveloperTools); + connect(this, + &WMainMenuBar::internalDeveloperToolsStateChange, + pDeveloperTools, + &QAction::setChecked); pDeveloperMenu->addAction(pDeveloperTools); QString enableExperimentTitle = tr("Stats: &Experiment Bucket"); @@ -465,8 +462,10 @@ void WMainMenuBar::initialize() { enableExperimentTitle, enableExperimentToolsText)); pDeveloperStatsExperiment->setCheckable(true); pDeveloperStatsExperiment->setChecked(Experiment::isExperiment()); - connect(pDeveloperStatsExperiment, SIGNAL(triggered(bool)), - this, SLOT(slotDeveloperStatsExperiment(bool))); + connect(pDeveloperStatsExperiment, + &QAction::triggered, + this, + &WMainMenuBar::slotDeveloperStatsExperiment); pDeveloperMenu->addAction(pDeveloperStatsExperiment); QString enableBaseTitle = tr("Stats: &Base Bucket"); @@ -483,8 +482,10 @@ void WMainMenuBar::initialize() { enableBaseTitle, enableBaseToolsText)); pDeveloperStatsBase->setCheckable(true); pDeveloperStatsBase->setChecked(Experiment::isBase()); - connect(pDeveloperStatsBase, SIGNAL(triggered(bool)), - this, SLOT(slotDeveloperStatsBase(bool))); + connect(pDeveloperStatsBase, + &QAction::triggered, + this, + &WMainMenuBar::slotDeveloperStatsBase); pDeveloperMenu->addAction(pDeveloperStatsBase); // "D" cannont be used with Alt here as it is already by the Developer menu @@ -502,8 +503,10 @@ void WMainMenuBar::initialize() { pDeveloperDebugger->setCheckable(true); pDeveloperDebugger->setStatusTip(scriptDebuggerText); pDeveloperDebugger->setChecked(scriptDebuggerEnabled); - connect(pDeveloperDebugger, SIGNAL(triggered(bool)), - this, SLOT(slotDeveloperDebugger(bool))); + connect(pDeveloperDebugger, + &QAction::triggered, + this, + &WMainMenuBar::slotDeveloperDebugger); pDeveloperMenu->addAction(pDeveloperDebugger); addMenu(pDeveloperMenu); @@ -592,8 +595,7 @@ void WMainMenuBar::initialize() { pHelpAboutApp->setStatusTip(aboutText); pHelpAboutApp->setWhatsThis(buildWhatsThis(aboutTitle, aboutText)); pHelpAboutApp->setMenuRole(QAction::AboutRole); - connect(pHelpAboutApp, SIGNAL(triggered()), - this, SIGNAL(showAbout())); + connect(pHelpAboutApp, &QAction::triggered, this, &WMainMenuBar::showAbout); pHelpMenu->addAction(pHelpAboutApp); addMenu(pHelpMenu); @@ -671,10 +673,14 @@ void WMainMenuBar::slotVisitUrl(const QString& url) { void WMainMenuBar::createVisibilityControl(QAction* pAction, const ConfigKey& key) { auto pConnection = new VisibilityControlConnection(this, pAction, key); - connect(this, SIGNAL(internalOnNewSkinLoaded()), - pConnection, SLOT(slotReconnectControl())); - connect(this, SIGNAL(internalOnNewSkinAboutToLoad()), - pConnection, SLOT(slotClearControl())); + connect(this, + &WMainMenuBar::internalOnNewSkinLoaded, + pConnection, + &VisibilityControlConnection::slotReconnectControl); + connect(this, + &WMainMenuBar::internalOnNewSkinAboutToLoad, + pConnection, + &VisibilityControlConnection::slotClearControl); } void WMainMenuBar::onNumberOfDecksChanged(int decks) { @@ -693,8 +699,7 @@ VisibilityControlConnection::VisibilityControlConnection( : QObject(pParent), m_key(key), m_pAction(pAction) { - connect(m_pAction, SIGNAL(triggered(bool)), - this, SLOT(slotActionToggled(bool))); + connect(m_pAction, &QAction::triggered, this, &VisibilityControlConnection::slotActionToggled); } void VisibilityControlConnection::slotClearControl() { diff --git a/src/widget/wmainmenubar.h b/src/widget/wmainmenubar.h index 643f386b21..7f305ac4b2 100644 --- a/src/widget/wmainmenubar.h +++ b/src/widget/wmainmenubar.h @@ -17,9 +17,11 @@ class VisibilityControlConnection : public QObject { VisibilityControlConnection(QObject* pParent, QAction* pAction, const ConfigKey& key); - private slots: + public slots: void slotClearControl(); void slotReconnectControl(); + + private slots: void slotControlChanged(); void slotActionToggled(bool toggle); diff --git a/src/widget/wrecordingduration.cpp b/src/widget/wrecordingduration.cpp index b7a62c5946..7d314408cd 100644 --- a/src/widget/wrecordingduration.cpp +++ b/src/widget/wrecordingduration.cpp @@ -11,10 +11,14 @@ WRecordingDuration::~WRecordingDuration() { void WRecordingDuration::setup(const QDomNode& node, const SkinContext& context) { WLabel::setup(node, context); - connect(m_pRecordingManager, SIGNAL(durationRecorded(QString)), - this, SLOT(refreshLabel(QString))); - connect(m_pRecordingManager, SIGNAL(isRecording(bool)), - this, SLOT(slotRecordingInactive(bool))); + connect(m_pRecordingManager, + &RecordingManager::durationRecorded, + this, + &WRecordingDuration::refreshLabel); + connect(m_pRecordingManager, + &RecordingManager::isRecording, + this, + &WRecordingDuration::slotRecordingInactive); // When we're recording show text from "InactiveText" node QString inactiveText; diff --git a/src/widget/wslidercomposed.cpp b/src/widget/wslidercomposed.cpp index a954dad852..a2c5aab587 100644 --- a/src/widget/wslidercomposed.cpp +++ b/src/widget/wslidercomposed.cpp @@ -49,8 +49,9 @@ WSliderComposed::WSliderComposed(QWidget * parent) m_pHandle(nullptr), m_renderTimer(mixxx::Duration::fromMillis(20), mixxx::Duration::fromSeconds(1)) { - connect(&m_renderTimer, SIGNAL(update()), - this, SLOT(update())); + connect(&m_renderTimer, &WidgetRenderTimer::update, this, [this]() { + update(); + }); } WSliderComposed::~WSliderComposed() { diff --git a/src/widget/wspinny.cpp b/src/widget/wspinny.cpp index 334c75fc31..406750c962 100644 --- a/src/widget/wspinny.cpp +++ b/src/widget/wspinny.cpp @@ -87,18 +87,14 @@ WSpinny::WSpinny( } if (m_pPlayer != nullptr) { - connect(m_pPlayer, SIGNAL(newTrackLoaded(TrackPointer)), - this, SLOT(slotLoadTrack(TrackPointer))); - connect(m_pPlayer, SIGNAL(loadingTrack(TrackPointer, TrackPointer)), - this, SLOT(slotLoadingTrack(TrackPointer, TrackPointer))); + connect(m_pPlayer, &BaseTrackPlayer::newTrackLoaded, this, &WSpinny::slotLoadTrack); + connect(m_pPlayer, &BaseTrackPlayer::loadingTrack, this, &WSpinny::slotLoadingTrack); // just in case a track is already loaded slotLoadTrack(m_pPlayer->getLoadedTrack()); } - connect(m_pCoverMenu, SIGNAL(coverInfoSelected(const CoverInfoRelative&)), - this, SLOT(slotCoverInfoSelected(const CoverInfoRelative&))); - connect(m_pCoverMenu, SIGNAL(reloadCoverArt()), - this, SLOT(slotReloadCoverArt())); + connect(m_pCoverMenu, &WCoverArtMenu::coverInfoSelected, this, &WSpinny::slotCoverInfoSelected); + connect(m_pCoverMenu, &WCoverArtMenu::reloadCoverArt, this, &WSpinny::slotReloadCoverArt); setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_OpaquePaintEvent); @@ -237,16 +233,20 @@ void WSpinny::setup(const QDomNode& node, const SkinContext& context) { void WSpinny::slotLoadTrack(TrackPointer pTrack) { if (m_loadedTrack) { - disconnect(m_loadedTrack.get(), SIGNAL(coverArtUpdated()), - this, SLOT(slotTrackCoverArtUpdated())); + disconnect(m_loadedTrack.get(), + &Track::coverArtUpdated, + this, + &WSpinny::slotTrackCoverArtUpdated); } m_lastRequestedCover = CoverInfo(); m_loadedCover = QPixmap(); m_loadedCoverScaled = QPixmap(); m_loadedTrack = pTrack; if (m_loadedTrack) { - connect(m_loadedTrack.get(), SIGNAL(coverArtUpdated()), - this, SLOT(slotTrackCoverArtUpdated())); + connect(m_loadedTrack.get(), + &Track::coverArtUpdated, + this, + &WSpinny::slotTrackCoverArtUpdated); } slotTrackCoverArtUpdated(); @@ -255,8 +255,10 @@ void WSpinny::slotLoadTrack(TrackPointer pTrack) { void WSpinny::slotLoadingTrack(TrackPointer pNewTrack, TrackPointer pOldTrack) { Q_UNUSED(pNewTrack); if (m_loadedTrack && pOldTrack == m_loadedTrack) { - disconnect(m_loadedTrack.get(), SIGNAL(coverArtUpdated()), - this, SLOT(slotTrackCoverArtUpdated())); + disconnect(m_loadedTrack.get(), + &Track::coverArtUpdated, + this, + &WSpinny::slotTrackCoverArtUpdated); } m_loadedTrack.reset(); m_lastRequestedCover = CoverInfo(); diff --git a/src/widget/wsplitter.cpp b/src/widget/wsplitter.cpp index 4372f9d9a9..1afbf4e119 100644 --- a/src/widget/wsplitter.cpp +++ b/src/widget/wsplitter.cpp @@ -6,8 +6,7 @@ WSplitter::WSplitter(QWidget* pParent, UserSettingsPointer pConfig) : QSplitter(pParent), WBaseWidget(this), m_pConfig(pConfig) { - connect(this, SIGNAL(splitterMoved(int,int)), - this, SLOT(slotSplitterMoved())); + connect(this, &WSplitter::splitterMoved, this, &WSplitter::slotSplitterMoved); } void WSplitter::setup(const QDomNode |