From c42b04831136b33c123b907b12df9daa810d3eed Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 17 Jan 2023 22:57:40 +0900 Subject: [PATCH 1/6] Add to PluginFactory.h --- include/PluginFactory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/PluginFactory.h b/include/PluginFactory.h index 8b8b88b6e8f..15c8882ac44 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include From 6ac2dea014204c5a69d400006e1c24d771e402aa Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 17 Jan 2023 22:58:10 +0900 Subject: [PATCH 2/6] Handle one more deprecated QTextStream::endl --- src/core/Song.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 82388268f7b..06ac15633de 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -1043,7 +1043,12 @@ void Song::loadProject( const QString & fileName ) else { QTextStream(stderr) << tr("Can't load project: " - "Project file contains local paths to plugins.") << endl; + "Project file contains local paths to plugins.") +#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) + << Qt::endl; +#else + << endl; +#endif } } } From 0ae67e20d76c0244a37ec5f9b474848acff23d19 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 17 Jan 2023 23:04:07 +0900 Subject: [PATCH 3/6] Replace QLayout::setMargin with setContentsMargins --- plugins/LadspaBrowser/LadspaBrowser.cpp | 4 ++-- plugins/LadspaBrowser/LadspaDescription.cpp | 6 +++--- plugins/LadspaBrowser/LadspaPortDialog.cpp | 2 +- .../LadspaEffect/LadspaSubPluginFeatures.cpp | 4 ++-- plugins/VstBase/VstPlugin.cpp | 2 +- src/core/lv2/Lv2SubPluginFeatures.cpp | 4 ++-- src/gui/EffectRackView.cpp | 2 +- src/gui/FileBrowser.cpp | 4 ++-- src/gui/LadspaControlView.cpp | 2 +- src/gui/MainWindow.cpp | 6 +++--- src/gui/MixerView.cpp | 2 +- src/gui/PluginBrowser.cpp | 2 +- src/gui/SampleTrackWindow.cpp | 2 +- src/gui/SideBarWidget.cpp | 2 +- src/gui/editors/SongEditor.cpp | 2 +- src/gui/editors/TrackContainerView.cpp | 4 ++-- .../instrument/InstrumentFunctionViews.cpp | 4 ++-- src/gui/instrument/InstrumentMidiIOView.cpp | 2 +- src/gui/instrument/InstrumentMiscView.cpp | 2 +- src/gui/instrument/InstrumentTrackWindow.cpp | 4 ++-- src/gui/instrument/PianoView.cpp | 2 +- src/gui/modals/ControllerConnectionDialog.cpp | 2 +- src/gui/modals/EffectSelectDialog.cpp | 4 ++-- src/gui/modals/SetupDialog.cpp | 20 +++++++++---------- src/gui/tracks/TrackView.cpp | 2 +- src/gui/widgets/MeterDialog.cpp | 6 +++--- src/gui/widgets/TabBar.cpp | 2 +- src/gui/widgets/TimeDisplayWidget.cpp | 2 +- 28 files changed, 51 insertions(+), 51 deletions(-) diff --git a/plugins/LadspaBrowser/LadspaBrowser.cpp b/plugins/LadspaBrowser/LadspaBrowser.cpp index 714b3887caa..09f83ab4e5f 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.cpp +++ b/plugins/LadspaBrowser/LadspaBrowser.cpp @@ -98,7 +98,7 @@ LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) : { auto hlayout = new QHBoxLayout(this); hlayout->setSpacing( 0 ); - hlayout->setMargin( 0 ); + hlayout->setContentsMargins(0, 0, 0, 0); m_tabBar = new TabBar( this, QBoxLayout::TopToBottom ); m_tabBar->setExclusive( true ); @@ -166,7 +166,7 @@ QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt, tab->setFixedSize( 500, 400 ); auto layout = new QVBoxLayout(tab); layout->setSpacing( 0 ); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); const QString type = "" + tr( "Type:" ) + " "; auto title = new QLabel(type + _txt, tab); diff --git a/plugins/LadspaBrowser/LadspaDescription.cpp b/plugins/LadspaBrowser/LadspaDescription.cpp index ff4d7486713..004505d6639 100644 --- a/plugins/LadspaBrowser/LadspaDescription.cpp +++ b/plugins/LadspaBrowser/LadspaDescription.cpp @@ -94,7 +94,7 @@ LadspaDescription::LadspaDescription( QWidget * _parent, auto descriptionBox = new QGroupBox(tr("Description"), this); auto descriptionLayout = new QVBoxLayout(descriptionBox); descriptionLayout->setSpacing( 0 ); - descriptionLayout->setMargin( 0 ); + descriptionLayout->setContentsMargins(0, 0, 0, 0); m_scrollArea = new QScrollArea( descriptionBox ); descriptionLayout->addWidget( m_scrollArea ); @@ -130,7 +130,7 @@ void LadspaDescription::update( const ladspa_key_t & _key ) auto maker = new QWidget(description); auto makerLayout = new QHBoxLayout(maker); - makerLayout->setMargin( 0 ); + makerLayout->setContentsMargins(0, 0, 0, 0); makerLayout->setSpacing( 0 ); layout->addWidget( maker ); @@ -145,7 +145,7 @@ void LadspaDescription::update( const ladspa_key_t & _key ) auto copyright = new QWidget(description); auto copyrightLayout = new QHBoxLayout(copyright); - copyrightLayout->setMargin( 0 ); + copyrightLayout->setContentsMargins(0, 0, 0, 0); copyrightLayout->setSpacing( 0 ); layout->addWidget( copyright ); diff --git a/plugins/LadspaBrowser/LadspaPortDialog.cpp b/plugins/LadspaBrowser/LadspaPortDialog.cpp index 3c0dbabd5f4..e256795114c 100644 --- a/plugins/LadspaBrowser/LadspaPortDialog.cpp +++ b/plugins/LadspaBrowser/LadspaPortDialog.cpp @@ -47,7 +47,7 @@ LadspaPortDialog::LadspaPortDialog( const ladspa_key_t & _key ) auto vlayout = new QVBoxLayout(this); vlayout->setSpacing( 0 ); - vlayout->setMargin( 0 ); + vlayout->setContentsMargins(0, 0, 0, 0); int pc = manager->getPortCount( _key ); diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp index 8ab50858a2a..1522d7187e2 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp @@ -71,7 +71,7 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, auto maker = new QWidget(_parent); auto l = new QHBoxLayout(maker); - l->setMargin( 0 ); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing( 0 ); auto maker_label = new QLabel(maker); @@ -85,7 +85,7 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, auto copyright = new QWidget(_parent); l = new QHBoxLayout( copyright ); - l->setMargin( 0 ); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing( 0 ); copyright->setMinimumWidth( _parent->minimumWidth() ); diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index 700a14ac755..c3fe17d7206 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -751,7 +751,7 @@ void VstPlugin::createUI( QWidget * parent ) QHBoxLayout * l = new QHBoxLayout( helper ); QWidget * target = new QWidget( helper ); l->setSpacing( 0 ); - l->setMargin( 0 ); + l->setContentsMargins(0, 0, 0, 0); l->addWidget( target ); // we've to call that for making sure, Qt created the windows diff --git a/src/core/lv2/Lv2SubPluginFeatures.cpp b/src/core/lv2/Lv2SubPluginFeatures.cpp index 4fb377b1cdf..8c3c9871102 100644 --- a/src/core/lv2/Lv2SubPluginFeatures.cpp +++ b/src/core/lv2/Lv2SubPluginFeatures.cpp @@ -81,7 +81,7 @@ void Lv2SubPluginFeatures::fillDescriptionWidget(QWidget *parent, auto maker = new QWidget(parent); auto l = new QHBoxLayout(maker); - l->setMargin(0); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing(0); auto maker_label = new QLabel(maker); @@ -98,7 +98,7 @@ void Lv2SubPluginFeatures::fillDescriptionWidget(QWidget *parent, auto copyright = new QWidget(parent); l = new QHBoxLayout(copyright); - l->setMargin(0); + l->setContentsMargins(0, 0, 0, 0); l->setSpacing(0); copyright->setMinimumWidth(parent->minimumWidth()); diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index 75cac67dc54..aa790d74dfc 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -42,7 +42,7 @@ EffectRackView::EffectRackView( EffectChain* model, QWidget* parent ) : ModelView( nullptr, this ) { auto mainLayout = new QVBoxLayout(this); - mainLayout->setMargin( 5 ); + mainLayout->setContentsMargins(5, 5, 5, 5); m_effectsGroupBox = new GroupBox( tr( "EFFECTS CHAIN" ) ); mainLayout->addWidget( m_effectsGroupBox ); diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 4ef41217db7..a104d326590 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -76,7 +76,7 @@ void FileBrowser::addContentCheckBox() auto filterWidget = new QWidget(contentParent()); filterWidget->setFixedHeight(15); auto filterWidgetLayout = new QHBoxLayout(filterWidget); - filterWidgetLayout->setMargin(0); + filterWidgetLayout->setContentsMargins(0, 0, 0, 0); filterWidgetLayout->setSpacing(0); auto configCheckBox = [this, &filterWidgetLayout](QCheckBox* box) @@ -119,7 +119,7 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, searchWidget->setFixedHeight( 24 ); auto searchWidgetLayout = new QHBoxLayout(searchWidget); - searchWidgetLayout->setMargin( 0 ); + searchWidgetLayout->setContentsMargins(0, 0, 0, 0); searchWidgetLayout->setSpacing( 0 ); m_filterEdit = new QLineEdit( searchWidget ); diff --git a/src/gui/LadspaControlView.cpp b/src/gui/LadspaControlView.cpp index 38ad4a146ff..46e208d2e0b 100644 --- a/src/gui/LadspaControlView.cpp +++ b/src/gui/LadspaControlView.cpp @@ -43,7 +43,7 @@ LadspaControlView::LadspaControlView( QWidget * _parent, m_ctl( _ctl ) { auto layout = new QHBoxLayout(this); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing( 0 ); LedCheckBox * link = nullptr; diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index b53ce629eac..40c8334bab1 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -91,12 +91,12 @@ MainWindow::MainWindow() : auto main_widget = new QWidget(this); auto vbox = new QVBoxLayout(main_widget); vbox->setSpacing( 0 ); - vbox->setMargin( 0 ); + vbox->setContentsMargins(0, 0, 0, 0); auto w = new QWidget(main_widget); auto hbox = new QHBoxLayout(w); hbox->setSpacing( 0 ); - hbox->setMargin( 0 ); + hbox->setContentsMargins(0, 0, 0, 0); auto sideBar = new SideBar(Qt::Vertical, w); @@ -206,7 +206,7 @@ MainWindow::MainWindow() : // add layout for organizing quite complex toolbar-layouting m_toolBarLayout = new QGridLayout( m_toolBar/*, 2, 1*/ ); - m_toolBarLayout->setMargin( 0 ); + m_toolBarLayout->setContentsMargins(0, 0, 0, 0); m_toolBarLayout->setSpacing( 0 ); vbox->addWidget( m_toolBar ); diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 62d4cb7ce05..ad9748c151f 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -79,7 +79,7 @@ MixerView::MixerView() : chLayout = new QHBoxLayout( m_channelAreaWidget ); chLayout->setSizeConstraint( QLayout::SetMinimumSize ); chLayout->setSpacing( 0 ); - chLayout->setMargin( 0 ); + chLayout->setContentsMargins(0, 0, 0, 0); m_channelAreaWidget->setLayout(chLayout); // create rack layout before creating the first channel diff --git a/src/gui/PluginBrowser.cpp b/src/gui/PluginBrowser.cpp index a19c80df0dc..afb74dcd3b2 100644 --- a/src/gui/PluginBrowser.cpp +++ b/src/gui/PluginBrowser.cpp @@ -52,7 +52,7 @@ PluginBrowser::PluginBrowser( QWidget * _parent ) : addContentWidget( m_view ); auto view_layout = new QVBoxLayout(m_view); - view_layout->setMargin( 5 ); + view_layout->setContentsMargins(5, 5, 5, 5); view_layout->setSpacing( 5 ); diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index 78b899a0939..6fe70bf4128 100644 --- a/src/gui/SampleTrackWindow.cpp +++ b/src/gui/SampleTrackWindow.cpp @@ -57,7 +57,7 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : // init own layout + widgets setFocusPolicy(Qt::StrongFocus); auto vlayout = new QVBoxLayout(this); - vlayout->setMargin(0); + vlayout->setContentsMargins(0, 0, 0, 0); vlayout->setSpacing(0); auto generalSettingsWidget = new TabWidget(tr("GENERAL SETTINGS"), this); diff --git a/src/gui/SideBarWidget.cpp b/src/gui/SideBarWidget.cpp index cf0233af110..60760ba5904 100644 --- a/src/gui/SideBarWidget.cpp +++ b/src/gui/SideBarWidget.cpp @@ -44,7 +44,7 @@ SideBarWidget::SideBarWidget( const QString & _title, const QPixmap & _icon, m_contents = new QWidget( this ); m_layout = new QVBoxLayout( m_contents ); m_layout->setSpacing( 5 ); - m_layout->setMargin( 0 ); + m_layout->setContentsMargins(0, 0, 0, 0); m_closeBtn = new QPushButton(embed::getIconPixmap("close"), QString(), this); m_closeBtn->resize(m_buttonSize); m_closeBtn->setToolTip(tr("Close")); diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 40be523193e..3e62cc23863 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -213,7 +213,7 @@ SongEditor::SongEditor( Song * song ) : // create widget for oscilloscope- and cpu-load-widget auto vc_w = new QWidget(tb); auto vcw_layout = new QVBoxLayout(vc_w); - vcw_layout->setMargin( 0 ); + vcw_layout->setContentsMargins(0, 0, 0, 0); vcw_layout->setSpacing( 0 ); vcw_layout->addStretch(); diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 351fe8295ca..38a6a36d5b2 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -90,13 +90,13 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : //keeps the direction of the widget, undepended on the locale setLayoutDirection( Qt::LeftToRight ); auto layout = new QVBoxLayout(this); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing( 0 ); layout->addWidget( m_scrollArea ); auto scrollContent = new QWidget; m_scrollLayout = new QVBoxLayout( scrollContent ); - m_scrollLayout->setMargin( 0 ); + m_scrollLayout->setContentsMargins(0, 0, 0, 0); m_scrollLayout->setSpacing( 0 ); m_scrollLayout->setSizeConstraint( QLayout::SetMinAndMaxSize ); diff --git a/src/gui/instrument/InstrumentFunctionViews.cpp b/src/gui/instrument/InstrumentFunctionViews.cpp index 99c68a5ed41..a4f0e670ab1 100644 --- a/src/gui/instrument/InstrumentFunctionViews.cpp +++ b/src/gui/instrument/InstrumentFunctionViews.cpp @@ -47,7 +47,7 @@ InstrumentFunctionNoteStackingView::InstrumentFunctionNoteStackingView( Instrume m_chordRangeKnob( new Knob( knobBright_26 ) ) { auto topLayout = new QHBoxLayout(this); - topLayout->setMargin( 0 ); + topLayout->setContentsMargins(0, 0, 0, 0); topLayout->addWidget( m_chordsGroupBox ); auto mainLayout = new QGridLayout(m_chordsGroupBox); @@ -109,7 +109,7 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti m_arpModeComboBox( new ComboBox() ) { auto topLayout = new QHBoxLayout(this); - topLayout->setMargin( 0 ); + topLayout->setContentsMargins(0, 0, 0, 0); topLayout->addWidget( m_arpGroupBox ); auto mainLayout = new QGridLayout(m_arpGroupBox); diff --git a/src/gui/instrument/InstrumentMidiIOView.cpp b/src/gui/instrument/InstrumentMidiIOView.cpp index 8d7cf9dda60..fd9d6fc54b1 100644 --- a/src/gui/instrument/InstrumentMidiIOView.cpp +++ b/src/gui/instrument/InstrumentMidiIOView.cpp @@ -48,7 +48,7 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : m_wpBtn( nullptr ) { auto layout = new QVBoxLayout(this); - layout->setMargin( 5 ); + layout->setContentsMargins(5, 5, 5, 5); m_midiInputGroupBox = new GroupBox( tr( "ENABLE MIDI INPUT" ) ); layout->addWidget( m_midiInputGroupBox ); diff --git a/src/gui/instrument/InstrumentMiscView.cpp b/src/gui/instrument/InstrumentMiscView.cpp index 1b4f823331a..514db579cb6 100644 --- a/src/gui/instrument/InstrumentMiscView.cpp +++ b/src/gui/instrument/InstrumentMiscView.cpp @@ -44,7 +44,7 @@ InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : QWidget(parent) { auto layout = new QVBoxLayout(this); - layout->setMargin(5); + layout->setContentsMargins(5, 5, 5, 5); // Master pitch toggle m_pitchGroupBox = new GroupBox(tr("GLOBAL TRANSPOSITION")); diff --git a/src/gui/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp index 70c11976a24..1d26dd9dc8e 100644 --- a/src/gui/instrument/InstrumentTrackWindow.cpp +++ b/src/gui/instrument/InstrumentTrackWindow.cpp @@ -90,7 +90,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : // init own layout + widgets setFocusPolicy( Qt::StrongFocus ); auto vlayout = new QVBoxLayout(this); - vlayout->setMargin( 0 ); + vlayout->setContentsMargins(0, 0, 0, 0); vlayout->setSpacing( 0 ); auto generalSettingsWidget = new TabWidget(tr("GENERAL SETTINGS"), this); @@ -246,7 +246,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : // FUNC tab auto instrumentFunctions = new QWidget(m_tabWidget); auto instrumentFunctionsLayout = new QVBoxLayout(instrumentFunctions); - instrumentFunctionsLayout->setMargin( 5 ); + instrumentFunctionsLayout->setContentsMargins(5, 5, 5, 5); m_noteStackingView = new InstrumentFunctionNoteStackingView( &m_track->m_noteStacking ); m_arpeggioView = new InstrumentFunctionArpeggioView( &m_track->m_arpeggio ); diff --git a/src/gui/instrument/PianoView.cpp b/src/gui/instrument/PianoView.cpp index 7478c82049a..a2df50e4702 100644 --- a/src/gui/instrument/PianoView.cpp +++ b/src/gui/instrument/PianoView.cpp @@ -147,7 +147,7 @@ PianoView::PianoView(QWidget *parent) : // create a layout for ourselves auto layout = new QVBoxLayout(this); layout->setSpacing( 0 ); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); layout->addSpacing( PIANO_BASE+PW_WHITE_KEY_HEIGHT ); layout->addWidget( m_pianoScroll ); diff --git a/src/gui/modals/ControllerConnectionDialog.cpp b/src/gui/modals/ControllerConnectionDialog.cpp index 149303da8aa..06f6a5708da 100644 --- a/src/gui/modals/ControllerConnectionDialog.cpp +++ b/src/gui/modals/ControllerConnectionDialog.cpp @@ -215,7 +215,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, auto btn_layout = new QHBoxLayout(buttons); btn_layout->setSpacing( 0 ); - btn_layout->setMargin( 0 ); + btn_layout->setContentsMargins(0, 0, 0, 0); auto select_btn = new QPushButton(embed::getIconPixmap("add"), tr("OK"), buttons); connect( select_btn, SIGNAL(clicked()), diff --git a/src/gui/modals/EffectSelectDialog.cpp b/src/gui/modals/EffectSelectDialog.cpp index 9ce3f90b6d5..eac5a3783fd 100644 --- a/src/gui/modals/EffectSelectDialog.cpp +++ b/src/gui/modals/EffectSelectDialog.cpp @@ -213,14 +213,14 @@ void EffectSelectDialog::rowChanged( const QModelIndex & _idx, hbox->addWidget(textualInfoWidget); auto textWidgetLayout = new QVBoxLayout(textualInfoWidget); - textWidgetLayout->setMargin( 4 ); + textWidgetLayout->setContentsMargins(4, 4, 4, 4); textWidgetLayout->setSpacing( 0 ); if ( m_currentSelection.desc->subPluginFeatures ) { auto subWidget = new QWidget(textualInfoWidget); auto subLayout = new QVBoxLayout(subWidget); - subLayout->setMargin( 4 ); + subLayout->setContentsMargins(4, 4, 4, 4); subLayout->setSpacing( 0 ); m_currentSelection.desc->subPluginFeatures-> fillDescriptionWidget( subWidget, &m_currentSelection ); diff --git a/src/gui/modals/SetupDialog.cpp b/src/gui/modals/SetupDialog.cpp index 5140a63b56a..44eaf87b0c8 100644 --- a/src/gui/modals/SetupDialog.cpp +++ b/src/gui/modals/SetupDialog.cpp @@ -175,12 +175,12 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Vertical layout. auto vlayout = new QVBoxLayout(this); vlayout->setSpacing(0); - vlayout->setMargin(0); + vlayout->setContentsMargins(0, 0, 0, 0); // Horizontal layout. auto hlayout = new QHBoxLayout(main_w); hlayout->setSpacing(0); - hlayout->setMargin(0); + hlayout->setContentsMargins(0, 0, 0, 0); // Tab bar for the main tabs. m_tabBar = new TabBar(main_w, QBoxLayout::TopToBottom); @@ -195,7 +195,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto general_w = new QWidget(settings_w); auto general_layout = new QVBoxLayout(general_w); general_layout->setSpacing(10); - general_layout->setMargin(0); + general_layout->setContentsMargins(0, 0, 0, 0); labelWidget(general_w, tr("General")); auto addLedCheckBox = [&XDelta, &YDelta, this](const QString& ledText, TabWidget* tw, int& counter, @@ -324,7 +324,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto performance_w = new QWidget(settings_w); auto performance_layout = new QVBoxLayout(performance_w); performance_layout->setSpacing(10); - performance_layout->setMargin(0); + performance_layout->setContentsMargins(0, 0, 0, 0); labelWidget(performance_w, tr("Performance")); @@ -442,7 +442,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto audio_w = new QWidget(settings_w); auto audio_layout = new QVBoxLayout(audio_w); audio_layout->setSpacing(10); - audio_layout->setMargin(0); + audio_layout->setContentsMargins(0, 0, 0, 0); labelWidget(audio_w, tr("Audio")); @@ -460,7 +460,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto as_w_layout = new QHBoxLayout(as_w); as_w_layout->setSpacing(0); - as_w_layout->setMargin(0); + as_w_layout->setContentsMargins(0, 0, 0, 0); #ifdef LMMS_HAVE_JACK m_audioIfaceSetupWidgets[AudioJack::name()] = @@ -592,7 +592,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto midi_w = new QWidget(settings_w); auto midi_layout = new QVBoxLayout(midi_w); midi_layout->setSpacing(10); - midi_layout->setMargin(0); + midi_layout->setContentsMargins(0, 0, 0, 0); labelWidget(midi_w, tr("MIDI")); @@ -609,7 +609,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto ms_w_layout = new QHBoxLayout(ms_w); ms_w_layout->setSpacing(0); - ms_w_layout->setMargin(0); + ms_w_layout->setContentsMargins(0, 0, 0, 0); #ifdef LMMS_HAVE_ALSA m_midiIfaceSetupWidgets[MidiAlsaSeq::name()] = @@ -709,7 +709,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto paths_layout = new QVBoxLayout(paths_w); paths_layout->setSpacing(10); - paths_layout->setMargin(0); + paths_layout->setContentsMargins(0, 0, 0, 0); labelWidget(paths_w, tr("Paths")); @@ -823,7 +823,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : auto extras_w = new QWidget(this); auto extras_layout = new QHBoxLayout(extras_w); extras_layout->setSpacing(0); - extras_layout->setMargin(0); + extras_layout->setContentsMargins(0, 0, 0, 0); // Restart warning label. restartWarningLbl = new QLabel( diff --git a/src/gui/tracks/TrackView.cpp b/src/gui/tracks/TrackView.cpp index 0aabc705d12..3e9257a0d81 100644 --- a/src/gui/tracks/TrackView.cpp +++ b/src/gui/tracks/TrackView.cpp @@ -75,7 +75,7 @@ TrackView::TrackView( Track * track, TrackContainerView * tcv ) : m_trackSettingsWidget.setAutoFillBackground( true ); auto layout = new QHBoxLayout(this); - layout->setMargin( 0 ); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing( 0 ); layout->addWidget( &m_trackOperationsWidget ); layout->addWidget( &m_trackSettingsWidget ); diff --git a/src/gui/widgets/MeterDialog.cpp b/src/gui/widgets/MeterDialog.cpp index 938177dce6e..ced08382ef1 100644 --- a/src/gui/widgets/MeterDialog.cpp +++ b/src/gui/widgets/MeterDialog.cpp @@ -43,12 +43,12 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : { auto vlayout = new QVBoxLayout(this); vlayout->setSpacing( 0 ); - vlayout->setMargin( 0 ); + vlayout->setContentsMargins(0, 0, 0, 0); auto num = new QWidget(this); auto num_layout = new QHBoxLayout(num); num_layout->setSpacing( 0 ); - num_layout->setMargin( 0 ); + num_layout->setContentsMargins(0, 0, 0, 0); m_numerator = new LcdSpinBox( 2, num, tr( "Meter Numerator" ) ); @@ -69,7 +69,7 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : auto den = new QWidget(this); auto den_layout = new QHBoxLayout(den); den_layout->setSpacing( 0 ); - den_layout->setMargin( 0 ); + den_layout->setContentsMargins(0, 0, 0, 0); m_denominator = new LcdSpinBox( 2, den, tr( "Meter Denominator" ) ); m_denominator->setToolTip(tr("Meter denominator")); diff --git a/src/gui/widgets/TabBar.cpp b/src/gui/widgets/TabBar.cpp index d3c1fa0c5df..806a932528c 100644 --- a/src/gui/widgets/TabBar.cpp +++ b/src/gui/widgets/TabBar.cpp @@ -37,7 +37,7 @@ TabBar::TabBar( QWidget * _parent, QBoxLayout::Direction _dir ) : m_layout( new QBoxLayout( _dir, this ) ), m_exclusive( false ) { - m_layout->setMargin( 8 ); + m_layout->setContentsMargins(8, 8, 8, 8); m_layout->setSpacing( 0 ); setLayout( m_layout ); diff --git a/src/gui/widgets/TimeDisplayWidget.cpp b/src/gui/widgets/TimeDisplayWidget.cpp index cefa0fa8f4e..cf139d4a8b1 100644 --- a/src/gui/widgets/TimeDisplayWidget.cpp +++ b/src/gui/widgets/TimeDisplayWidget.cpp @@ -43,7 +43,7 @@ TimeDisplayWidget::TimeDisplayWidget() : m_milliSecondsLCD( 3, this ) { m_spinBoxesLayout.setSpacing( 0 ); - m_spinBoxesLayout.setMargin( 0 ); + m_spinBoxesLayout.setContentsMargins(0, 0, 0, 0); m_spinBoxesLayout.addWidget( &m_majorLCD ); m_spinBoxesLayout.addWidget( &m_minorLCD ); m_spinBoxesLayout.addWidget( &m_milliSecondsLCD ); From 171a2117d5e4b6227731cfdac8d07d3753e3d636 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 17 Jan 2023 23:08:02 +0900 Subject: [PATCH 4/6] Replace Qt::MidButton with Qt::MiddleButton --- src/gui/AutomatableModelView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 52ee1ed7e56..0e364993f06 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -176,7 +176,7 @@ void AutomatableModelView::mousePressEvent( QMouseEvent* event ) new gui::StringPairDrag( "automatable_model", QString::number( modelUntyped()->id() ), QPixmap(), widget() ); event->accept(); } - else if( event->button() == Qt::MidButton ) + else if( event->button() == Qt::MiddleButton ) { modelUntyped()->reset(); } From 945a87c46f7f9d209d7954d29173825396610f93 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 17 Jan 2023 23:09:54 +0900 Subject: [PATCH 5/6] Replace QPalette::Background with QPalette::Window --- src/gui/LmmsPalette.cpp | 2 +- src/gui/LmmsStyle.cpp | 2 +- src/gui/MixerView.cpp | 2 +- src/gui/tracks/SampleTrackView.cpp | 2 +- src/gui/widgets/TabWidget.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/LmmsPalette.cpp b/src/gui/LmmsPalette.cpp index 48d6de0dfb3..0d135f52c9a 100644 --- a/src/gui/LmmsPalette.cpp +++ b/src/gui/LmmsPalette.cpp @@ -75,7 +75,7 @@ QPalette LmmsPalette::palette() const { QPalette pal = QApplication::style()->standardPalette(); - pal.setColor( QPalette::Background, background() ); + pal.setColor( QPalette::Window, background() ); pal.setColor( QPalette::WindowText, windowText() ); pal.setColor( QPalette::Base, base() ); pal.setColor( QPalette::ButtonText, buttonText() ); diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index 060a97811b5..50a2a9de4ec 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -189,7 +189,7 @@ void LmmsStyle::drawComplexControl( ComplexControl control, /* else if( control == CC_ScrollBar ) { painter->fillRect( option->rect, QApplication::palette().color( QPalette::Active, - QPalette::Background ) ); + QPalette::Window ) ); }*/ QProxyStyle::drawComplexControl( control, option, painter, widget ); diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index ad9748c151f..a9b7bf99206 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -59,7 +59,7 @@ MixerView::MixerView() : m->setHook( this ); //QPalette pal = palette(); - //pal.setColor( QPalette::Background, QColor( 72, 76, 88 ) ); + //pal.setColor( QPalette::Window, QColor( 72, 76, 88 ) ); //setPalette( pal ); setAutoFillBackground( true ); diff --git a/src/gui/tracks/SampleTrackView.cpp b/src/gui/tracks/SampleTrackView.cpp index 08ddee863fb..fbdd41ded06 100644 --- a/src/gui/tracks/SampleTrackView.cpp +++ b/src/gui/tracks/SampleTrackView.cpp @@ -82,7 +82,7 @@ SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) : m_panningKnob->show(); m_activityIndicator = new FadeButton( - QApplication::palette().color(QPalette::Active, QPalette::Background), + QApplication::palette().color(QPalette::Active, QPalette::Window), QApplication::palette().color(QPalette::Active, QPalette::BrightText), QApplication::palette().color(QPalette::Active, QPalette::BrightText).darker(), getTrackSettingsWidget() diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index 106387e422a..5ab56fee71c 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -60,9 +60,9 @@ TabWidget::TabWidget(const QString & caption, QWidget * parent, bool usePixmap, setFont( pointSize<8>( font() ) ); setAutoFillBackground( true ); - QColor bg_color = QApplication::palette().color( QPalette::Active, QPalette::Background ). darker( 132 ); + QColor bg_color = QApplication::palette().color( QPalette::Active, QPalette::Window ). darker( 132 ); QPalette pal = palette(); - pal.setColor( QPalette::Background, bg_color ); + pal.setColor( QPalette::Window, bg_color ); setPalette( pal ); } From 81b3d7de74d60b1d99347365d6b70b76704e71cf Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 17 Jan 2023 23:17:18 +0900 Subject: [PATCH 6/6] Fix deprecation warnings in LcdFloatSpinBox --- src/gui/widgets/LcdFloatSpinBox.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/widgets/LcdFloatSpinBox.cpp b/src/gui/widgets/LcdFloatSpinBox.cpp index e57012e1093..6391f314ad9 100644 --- a/src/gui/widgets/LcdFloatSpinBox.cpp +++ b/src/gui/widgets/LcdFloatSpinBox.cpp @@ -38,6 +38,7 @@ #include #include "CaptionMenu.h" +#include "DeprecationHelper.h" #include "embed.h" #include "GuiApplication.h" #include "gui_templates.h" @@ -179,7 +180,7 @@ void LcdFloatSpinBox::mouseReleaseEvent(QMouseEvent*) void LcdFloatSpinBox::wheelEvent(QWheelEvent *event) { // switch between integer and fractional step based on cursor position - if (event->x() < m_wholeDisplay.width()) { m_intStep = true; } + if (position(event).x() < m_wholeDisplay.width()) { m_intStep = true; } else { m_intStep = false; } event->accept(); @@ -239,9 +240,9 @@ void LcdFloatSpinBox::paintEvent(QPaintEvent*) { p.setFont(pointSizeF(p.font(), 6.5)); p.setPen(m_wholeDisplay.textShadowColor()); - p.drawText(width() / 2 - p.fontMetrics().width(m_label) / 2 + 1, height(), m_label); + p.drawText(width() / 2 - horizontalAdvance(p.fontMetrics(), m_label) / 2 + 1, height(), m_label); p.setPen(m_wholeDisplay.textColor()); - p.drawText(width() / 2 - p.fontMetrics().width(m_label) / 2, height() - 1, m_label); + p.drawText(width() / 2 - horizontalAdvance(p.fontMetrics(), m_label) / 2, height() - 1, m_label); } }