diff --git a/src/control/control.h b/src/control/control.h index 8c2332cefd9..69c6b6e10de 100644 --- a/src/control/control.h +++ b/src/control/control.h @@ -209,6 +209,7 @@ class ControlDoublePrivate : public QObject { /// The constant ControlDoublePrivate version is used as dummy for default /// constructed control objects class ControlDoublePrivateConst : public ControlDoublePrivate { + Q_OBJECT public: ~ControlDoublePrivateConst() override = default; diff --git a/src/controllers/bulk/bulkenumerator.h b/src/controllers/bulk/bulkenumerator.h index b1c2569f33c..05c55275c09 100644 --- a/src/controllers/bulk/bulkenumerator.h +++ b/src/controllers/bulk/bulkenumerator.h @@ -6,6 +6,7 @@ struct libusb_context; /// Locate supported USB bulk controllers class BulkEnumerator : public ControllerEnumerator { + Q_OBJECT public: explicit BulkEnumerator(UserSettingsPointer pConfig); virtual ~BulkEnumerator(); diff --git a/src/controllers/delegates/midibytedelegate.h b/src/controllers/delegates/midibytedelegate.h index 83700de56b3..e777966031b 100644 --- a/src/controllers/delegates/midibytedelegate.h +++ b/src/controllers/delegates/midibytedelegate.h @@ -3,6 +3,7 @@ #include class MidiByteDelegate : public QStyledItemDelegate { + Q_OBJECT public: MidiByteDelegate(QObject* pParent); virtual ~MidiByteDelegate(); diff --git a/src/controllers/delegates/midichanneldelegate.h b/src/controllers/delegates/midichanneldelegate.h index b6dd7c7e563..bd5300faae3 100644 --- a/src/controllers/delegates/midichanneldelegate.h +++ b/src/controllers/delegates/midichanneldelegate.h @@ -3,6 +3,7 @@ #include class MidiChannelDelegate : public QStyledItemDelegate { + Q_OBJECT public: MidiChannelDelegate(QObject* pParent); virtual ~MidiChannelDelegate(); diff --git a/src/controllers/delegates/midiopcodedelegate.h b/src/controllers/delegates/midiopcodedelegate.h index 0b9963bd5a0..166c50512bb 100644 --- a/src/controllers/delegates/midiopcodedelegate.h +++ b/src/controllers/delegates/midiopcodedelegate.h @@ -3,6 +3,7 @@ #include class MidiOpCodeDelegate : public QStyledItemDelegate { + Q_OBJECT public: MidiOpCodeDelegate(QObject* pParent); virtual ~MidiOpCodeDelegate(); diff --git a/src/controllers/hid/hidenumerator.h b/src/controllers/hid/hidenumerator.h index 6d35a22a2c5..8485b408a47 100644 --- a/src/controllers/hid/hidenumerator.h +++ b/src/controllers/hid/hidenumerator.h @@ -5,6 +5,7 @@ /// This class handles discovery and enumeration of DJ controllers that use the /// USB-HID protocol. class HidEnumerator : public ControllerEnumerator { + Q_OBJECT public: HidEnumerator() = default; ~HidEnumerator() override; diff --git a/src/effects/backends/effectmanifestparameter.h b/src/effects/backends/effectmanifestparameter.h index 9faed4a8f83..ed711957f9e 100644 --- a/src/effects/backends/effectmanifestparameter.h +++ b/src/effects/backends/effectmanifestparameter.h @@ -7,6 +7,7 @@ #include "effects/defs.h" #include "util/assert.h" +#include "util/compatibility/qhash.h" class EffectManifestParameter; typedef QSharedPointer EffectManifestParameterPointer; @@ -277,6 +278,6 @@ QDebug operator<<(QDebug dbg, const EffectManifestParameter& parameter); typedef EffectManifestParameter::ParameterType EffectParameterType; -inline uint qHash(const EffectParameterType& parameterType) { - return static_cast(parameterType); +inline qhash_seed_t qHash(const EffectParameterType& parameterType) { + return static_cast(parameterType); } diff --git a/src/effects/chains/equalizereffectchain.h b/src/effects/chains/equalizereffectchain.h index 153ca1b864f..98a15973838 100644 --- a/src/effects/chains/equalizereffectchain.h +++ b/src/effects/chains/equalizereffectchain.h @@ -9,6 +9,7 @@ /// EqualizerEffectChain is hardwired to one input channel, always /// enabled, and has the mix knob fully enabled. class EqualizerEffectChain : public PerGroupEffectChain { + Q_OBJECT public: EqualizerEffectChain(const QString& group, EffectsManager* pEffectsManager, diff --git a/src/effects/chains/outputeffectchain.h b/src/effects/chains/outputeffectchain.h index 195594b8bd6..93f41172297 100644 --- a/src/effects/chains/outputeffectchain.h +++ b/src/effects/chains/outputeffectchain.h @@ -5,6 +5,7 @@ /// OutputEffectChain is hardwired to only one of Mixxx's outputs. /// This is used for the main mix equalizer. class OutputEffectChain : public EffectChain { + Q_OBJECT public: OutputEffectChain(EffectsManager* pEffectsManager, EffectsMessengerPointer pEffectsMessenger); diff --git a/src/effects/chains/pergroupeffectchain.h b/src/effects/chains/pergroupeffectchain.h index 45174610528..acf10c3743c 100644 --- a/src/effects/chains/pergroupeffectchain.h +++ b/src/effects/chains/pergroupeffectchain.h @@ -5,6 +5,7 @@ /// PerGroupEffectChain is a base class hardwired for one input channel. /// The routing switches are not presented to the user. class PerGroupEffectChain : public EffectChain { + Q_OBJECT public: PerGroupEffectChain(const QString& group, const QString& chainSlotGroup, diff --git a/src/effects/chains/quickeffectchain.h b/src/effects/chains/quickeffectchain.h index 7f35486219d..34c747281f7 100644 --- a/src/effects/chains/quickeffectchain.h +++ b/src/effects/chains/quickeffectchain.h @@ -8,6 +8,7 @@ /// then load it into QuickEffectChain. QuickEffectChain is hardwired to one /// input channel with the mix knob fully enabled. class QuickEffectChain : public PerGroupEffectChain { + Q_OBJECT public: QuickEffectChain(const QString& group, EffectsManager* pEffectsManager, diff --git a/src/effects/chains/standardeffectchain.h b/src/effects/chains/standardeffectchain.h index 9a470e41f7c..fe0473e7413 100644 --- a/src/effects/chains/standardeffectchain.h +++ b/src/effects/chains/standardeffectchain.h @@ -8,6 +8,7 @@ /// linkings. However, the chain enable switch is hidden because it /// is redundant with the input routing switches and effect enable switches. class StandardEffectChain : public EffectChain { + Q_OBJECT public: StandardEffectChain(unsigned int iChainNumber, EffectsManager* pEffectsManager, diff --git a/src/effects/defs.h b/src/effects/defs.h index e6284a3e55c..d1ba49b8590 100644 --- a/src/effects/defs.h +++ b/src/effects/defs.h @@ -20,8 +20,8 @@ enum class EffectBackendType { Unknown }; -inline uint qHash(const EffectBackendType& backendType) { - return static_cast(backendType); +inline qhash_seed_t qHash(const EffectBackendType& backendType) { + return static_cast(backendType); } enum class SignalProcessingStage { diff --git a/src/engine/bufferscalers/enginebufferscalelinear.h b/src/engine/bufferscalers/enginebufferscalelinear.h index 4d7b989c295..5c7882ee1c0 100644 --- a/src/engine/bufferscalers/enginebufferscalelinear.h +++ b/src/engine/bufferscalers/enginebufferscalelinear.h @@ -8,6 +8,7 @@ constexpr int kiLinearScaleReadAheadLength = 10240; class EngineBufferScaleLinear : public EngineBufferScale { + Q_OBJECT public: explicit EngineBufferScaleLinear( ReadAheadManager *pReadAheadManager); diff --git a/src/engine/enginepregain.h b/src/engine/enginepregain.h index 2d5b1b50f8b..eb3dd3f6f9f 100644 --- a/src/engine/enginepregain.h +++ b/src/engine/enginepregain.h @@ -12,6 +12,7 @@ class ControlObject; // including user pregain adjustment, ReplayGain value, and vinyl-like // adjustments in volume relative to playback speed. class EnginePregain : public EngineObject { + Q_OBJECT public: EnginePregain(const QString& group); ~EnginePregain() override; diff --git a/src/engine/positionscratchcontroller.h b/src/engine/positionscratchcontroller.h index 9d5a8bd0695..3969048a2f8 100644 --- a/src/engine/positionscratchcontroller.h +++ b/src/engine/positionscratchcontroller.h @@ -10,6 +10,7 @@ class VelocityController; class RateIIFilter; class PositionScratchController : public QObject { + Q_OBJECT public: PositionScratchController(const QString& group); virtual ~PositionScratchController(); diff --git a/src/library/export/dlglibraryexport.cpp b/src/library/export/dlglibraryexport.cpp index 9b0e6eff5f6..26fbdf73ae6 100644 --- a/src/library/export/dlglibraryexport.cpp +++ b/src/library/export/dlglibraryexport.cpp @@ -203,8 +203,8 @@ void DlgLibraryExport::exportRequested() { // Construct a request to export the library/crates. auto pRequest = QSharedPointer::create(); - pRequest->engineLibraryDbDir = QDir{databaseDirectory}; - pRequest->musicFilesDir = QDir{musicDirectory}; + pRequest->engineLibraryDbDir.setPath(databaseDirectory); + pRequest->musicFilesDir.setPath(musicDirectory); pRequest->exportVersion = exportVersion; if (m_pCratesList->isEnabled()) { const auto selectedItems = m_pCratesList->selectedItems(); diff --git a/src/library/proxytrackmodel.h b/src/library/proxytrackmodel.h index b7ac388433d..d56ef77eeb5 100644 --- a/src/library/proxytrackmodel.h +++ b/src/library/proxytrackmodel.h @@ -13,6 +13,7 @@ // TrackModel search calls will not be delivered to the composed TrackModel // because filtering is handled by the QSortFilterProxyModel. class ProxyTrackModel : public QSortFilterProxyModel, public TrackModel { + Q_OBJECT public: // Construct a new ProxyTrackModel with pTrackModel as the TrackModel it // composes. If bHandleSearches is true, then search signals will not be diff --git a/src/library/rekordbox/rekordboxfeature.h b/src/library/rekordbox/rekordboxfeature.h index 0d3c607c076..68f9b3e467c 100644 --- a/src/library/rekordbox/rekordboxfeature.h +++ b/src/library/rekordbox/rekordboxfeature.h @@ -40,6 +40,7 @@ class TrackCollectionManager; class BaseExternalPlaylistModel; class RekordboxPlaylistModel : public BaseExternalPlaylistModel { + Q_OBJECT public: RekordboxPlaylistModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, diff --git a/src/library/serato/seratofeature.cpp b/src/library/serato/seratofeature.cpp index 0819189b6ed..379e5cbf08e 100644 --- a/src/library/serato/seratofeature.cpp +++ b/src/library/serato/seratofeature.cpp @@ -454,7 +454,7 @@ QString parseDatabase(mixxx::DbConnectionPoolPtr dbConnectionPool, TreeItem* dat // Serato does not exist on Linux, if it did, it would probably just mirror // the way paths are handled on OSX. if (databaseRootDir.canonicalPath().startsWith(QDir::homePath())) { - databaseRootDir = QDir::root(); + databaseRootDir.setPath(QDir::rootPath()); } #endif diff --git a/src/library/serato/seratoplaylistmodel.h b/src/library/serato/seratoplaylistmodel.h index 18a73b311f0..f2daa327bf4 100644 --- a/src/library/serato/seratoplaylistmodel.h +++ b/src/library/serato/seratoplaylistmodel.h @@ -7,6 +7,7 @@ class TrackCollectionManager; class BaseExternalPlaylistModel; class SeratoPlaylistModel : public BaseExternalPlaylistModel { + Q_OBJECT public: SeratoPlaylistModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, diff --git a/src/library/traktor/traktorfeature.h b/src/library/traktor/traktorfeature.h index fcb56b14320..6e3e1200896 100644 --- a/src/library/traktor/traktorfeature.h +++ b/src/library/traktor/traktorfeature.h @@ -13,6 +13,7 @@ #include "library/treeitemmodel.h" class TraktorTrackModel : public BaseExternalTrackModel { + Q_OBJECT public: TraktorTrackModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, @@ -21,6 +22,7 @@ class TraktorTrackModel : public BaseExternalTrackModel { }; class TraktorPlaylistModel : public BaseExternalPlaylistModel { + Q_OBJECT public: TraktorPlaylistModel(QObject* parent, TrackCollectionManager* pTrackCollectionManager, diff --git a/src/qml/asyncimageprovider.h b/src/qml/asyncimageprovider.h index 8544a42e69f..ed2ed83d9dd 100644 --- a/src/qml/asyncimageprovider.h +++ b/src/qml/asyncimageprovider.h @@ -11,6 +11,7 @@ namespace mixxx { namespace qml { class AsyncImageResponse : public QQuickImageResponse, public QRunnable { + Q_OBJECT public: AsyncImageResponse(const QString& id, const QSize& requestedSize); QQuickTextureFactory* textureFactory() const override; diff --git a/src/util/battery/batterylinux.h b/src/util/battery/batterylinux.h index eb1e5e059d9..55ef892e822 100644 --- a/src/util/battery/batterylinux.h +++ b/src/util/battery/batterylinux.h @@ -3,6 +3,7 @@ #include "util/battery/battery.h" class BatteryLinux : public Battery { + Q_OBJECT public: explicit BatteryLinux(QObject* pParent=nullptr); ~BatteryLinux() override; diff --git a/src/util/battery/batterymac.h b/src/util/battery/batterymac.h index 77656e06933..43a79c57814 100644 --- a/src/util/battery/batterymac.h +++ b/src/util/battery/batterymac.h @@ -3,6 +3,7 @@ #include "util/battery/battery.h" class BatteryMac : public Battery { + Q_OBJECT public: BatteryMac(QObject* pParent=nullptr); virtual ~BatteryMac(); diff --git a/src/util/battery/batterywindows.h b/src/util/battery/batterywindows.h index 4981d11ed68..6a36f880a8e 100644 --- a/src/util/battery/batterywindows.h +++ b/src/util/battery/batterywindows.h @@ -3,6 +3,7 @@ #include "util/battery/battery.h" class BatteryWindows : public Battery { + Q_OBJECT public: BatteryWindows(QObject* pParent=nullptr); ~BatteryWindows() override = default; diff --git a/src/util/desktophelper.cpp b/src/util/desktophelper.cpp index 06faae00cd7..8f9018507ee 100644 --- a/src/util/desktophelper.cpp +++ b/src/util/desktophelper.cpp @@ -159,7 +159,7 @@ void DesktopHelper::openInFileBrowser(const QStringList& paths) { // Otherwise nothing would happen... if (!dir.exists()) { // it ensures a valid dir for any OS (Windows) - dir = QDir::home(); + dir.setPath(QDir::homePath()); } // not open the same dir twice dirPath = dir.absolutePath(); diff --git a/src/util/workerthreadscheduler.h b/src/util/workerthreadscheduler.h index 0667ab5e794..676bba768d1 100644 --- a/src/util/workerthreadscheduler.h +++ b/src/util/workerthreadscheduler.h @@ -10,6 +10,7 @@ class WorkerThread; /// as a worker thread. The maximum number of worker threads is /// limited. class WorkerThreadScheduler : public WorkerThread { + Q_OBJECT public: explicit WorkerThreadScheduler( int maxWorkers, diff --git a/src/vinylcontrol/vinylcontrol.h b/src/vinylcontrol/vinylcontrol.h index c3ffd02a2ba..ced857a2f60 100644 --- a/src/vinylcontrol/vinylcontrol.h +++ b/src/vinylcontrol/vinylcontrol.h @@ -9,6 +9,7 @@ class ControlProxy; class VinylControl : public QObject { + Q_OBJECT public: VinylControl(UserSettingsPointer pConfig, const QString& group); virtual ~VinylControl(); diff --git a/src/vinylcontrol/vinylcontrolxwax.h b/src/vinylcontrol/vinylcontrolxwax.h index 1082a9ac7c6..c223108938f 100644 --- a/src/vinylcontrol/vinylcontrolxwax.h +++ b/src/vinylcontrol/vinylcontrolxwax.h @@ -21,6 +21,7 @@ extern "C" { #define QUALITY_RING_SIZE 32 class VinylControlXwax : public VinylControl { + Q_OBJECT public: VinylControlXwax(UserSettingsPointer pConfig, const QString& group); virtual ~VinylControlXwax(); diff --git a/src/widget/wanalysislibrarytableview.h b/src/widget/wanalysislibrarytableview.h index b732a0f54b2..32924655ab2 100644 --- a/src/widget/wanalysislibrarytableview.h +++ b/src/widget/wanalysislibrarytableview.h @@ -6,6 +6,7 @@ #include "widget/wtracktableview.h" class WAnalysisLibraryTableView : public WTrackTableView { + Q_OBJECT public: WAnalysisLibraryTableView( QWidget* parent, diff --git a/src/widget/woverviewhsv.h b/src/widget/woverviewhsv.h index 9876040adf2..3fa9bf7d153 100644 --- a/src/widget/woverviewhsv.h +++ b/src/widget/woverviewhsv.h @@ -3,6 +3,7 @@ #include "widget/woverview.h" class WOverviewHSV : public WOverview { + Q_OBJECT public: WOverviewHSV( const QString& group, diff --git a/src/widget/woverviewlmh.h b/src/widget/woverviewlmh.h index 3b1913c85bc..8bc05fb3c8a 100644 --- a/src/widget/woverviewlmh.h +++ b/src/widget/woverviewlmh.h @@ -3,6 +3,7 @@ #include "widget/woverview.h" class WOverviewLMH : public WOverview { + Q_OBJECT public: WOverviewLMH( const QString& group, diff --git a/src/widget/woverviewrgb.h b/src/widget/woverviewrgb.h index d249243998d..000b60be4f1 100644 --- a/src/widget/woverviewrgb.h +++ b/src/widget/woverviewrgb.h @@ -3,6 +3,7 @@ #include "widget/woverview.h" class WOverviewRGB : public WOverview { + Q_OBJECT public: WOverviewRGB( const QString& group, diff --git a/src/widget/wsizeawarestack.cpp b/src/widget/wsizeawarestack.cpp index 3032110624e..5de9102a9c1 100644 --- a/src/widget/wsizeawarestack.cpp +++ b/src/widget/wsizeawarestack.cpp @@ -6,71 +6,66 @@ #include "moc_wsizeawarestack.cpp" -class SizeAwareLayout : public QStackedLayout -{ - public: - QSize minimumSize() const override - { - QSize s(0, 0) ; - QWidget *w = widget(0); - if (w) { - // Minimum Widget is at index 0; - s = w->minimumSize(); - } - return s; +QSize SizeAwareLayout::minimumSize() const { + QSize s(0, 0); + QWidget* w = widget(0); + if (w) { + // Minimum Widget is at index 0; + s = w->minimumSize(); } + return s; +} - int setCurrentIndexForSize(const QSize& s) { - int n = count(); - if (n <= 0) { - return -1; - } +int SizeAwareLayout::setCurrentIndexForSize(const QSize& s) { + int n = count(); + if (n <= 0) { + return -1; + } - int i = currentIndex(); + int i = currentIndex(); - QWidget *wc = widget(i); - bool notFit = false; - if (i > 0) { - // Check minimum, but not for the smallest, it is the fallback - notFit = wc->minimumHeight() > s.height() || wc->minimumWidth() > s.width(); - } - if (i < n - 1 && !notFit) { - // Check maximum, but not for the biggest, it is the fallback - notFit = wc->maximumHeight() < s.height() || wc->maximumWidth() < s.width(); - } + QWidget* wc = widget(i); + bool notFit = false; + if (i > 0) { + // Check minimum, but not for the smallest, it is the fallback + notFit = wc->minimumHeight() > s.height() || wc->minimumWidth() > s.width(); + } + if (i < n - 1 && !notFit) { + // Check maximum, but not for the biggest, it is the fallback + notFit = wc->maximumHeight() < s.height() || wc->maximumWidth() < s.width(); + } - if (notFit) { - QWidget *w; - for (i = 0; i < n; ++i) { - w = widget(i); - if (w) { - if (w->maximumHeight() >= s.height() && w->maximumWidth() >= s.width() && - w->minimumHeight() <= s.height() && w->minimumWidth() <= s.width()) { - // perfectly fit - setCurrentIndex(i); - return i; - } + if (notFit) { + QWidget* w; + for (i = 0; i < n; ++i) { + w = widget(i); + if (w) { + if (w->maximumHeight() >= s.height() && w->maximumWidth() >= s.width() && + w->minimumHeight() <= s.height() && w->minimumWidth() <= s.width()) { + // perfectly fit + setCurrentIndex(i); + return i; } } - // no perfect fit, check minimum only to avoid chopping - for (i = n-1; i >= 0; --i) { - w = widget(i); - if (w) { - if (w->minimumHeight() <= s.height() && w->minimumWidth() <= s.width()) { - // fit with gap - setCurrentIndex(i); - return i; - } + } + // no perfect fit, check minimum only to avoid chopping + for (i = n - 1; i >= 0; --i) { + w = widget(i); + if (w) { + if (w->minimumHeight() <= s.height() && w->minimumWidth() <= s.width()) { + // fit with gap + setCurrentIndex(i); + return i; } } - // fallback: take smallest - setCurrentIndex(0); - return 0; } - - return i; + // fallback: take smallest + setCurrentIndex(0); + return 0; } -}; + + return i; +} WSizeAwareStack::WSizeAwareStack(QWidget* parent) : QWidget(parent), diff --git a/src/widget/wsizeawarestack.h b/src/widget/wsizeawarestack.h index 97032b89407..918c8d5d634 100644 --- a/src/widget/wsizeawarestack.h +++ b/src/widget/wsizeawarestack.h @@ -1,11 +1,18 @@ #pragma once -#include #include +#include +#include +#include #include "widget/wbasewidget.h" -class SizeAwareLayout; +class SizeAwareLayout : public QStackedLayout { + Q_OBJECT + public: + QSize minimumSize() const override; + int setCurrentIndexForSize(const QSize& s); +}; class WSizeAwareStack : public QWidget, public WBaseWidget { Q_OBJECT