Skip to content

Commit

Permalink
Do not call QPixmap copy constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
sakertooth committed Oct 21, 2023
1 parent b4a67fa commit 932ebe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions plugins/Eq/EqControlsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) :
setBand( 6, &controls->m_highShelfActiveModel, &controls->m_highShelfFreqModel, &controls->m_highShelfResModel, &controls->m_highShelfGainModel, QColor(255 ,255, 255), tr( "High-shelf" ), &controls->m_highShelfPeakL, &controls->m_highShelfPeakR,0,0,0,0,0,0 );
setBand( 7, &controls->m_lpActiveModel, &controls->m_lpFreqModel, &controls->m_lpResModel, 0, QColor(255 ,255, 255), tr( "LP" ) ,0,0,0,0,0, &controls->m_lp12Model, &controls->m_lp24Model, &controls->m_lp48Model);

static auto s_faderBg = QPixmap(PLUGIN_NAME::getIconPixmap("faderback"));
static auto s_faderLeds = QPixmap(PLUGIN_NAME::getIconPixmap("faderleds"));
static auto s_faderKnob = QPixmap(PLUGIN_NAME::getIconPixmap("faderknob"));
static auto s_faderBg = PLUGIN_NAME::getIconPixmap("faderback");
static auto s_faderLeds = PLUGIN_NAME::getIconPixmap("faderleds");
static auto s_faderKnob = PLUGIN_NAME::getIconPixmap("faderknob");

auto GainFaderIn = new EqFader(&controls->m_inGainModel, tr("Input gain"), this, &s_faderBg, &s_faderLeds, &s_faderKnob,
&controls->m_inPeakL, &controls->m_inPeakR);
Expand Down Expand Up @@ -242,4 +242,4 @@ EqBand* EqControlsDialog::setBand(int index, BoolModel* active, FloatModel* freq
}


} // namespace lmms::gui
} // namespace lmms::gui
12 changes: 6 additions & 6 deletions plugins/SpectrumAnalyzer/SaControlsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)

// FFT: block size: icon and selector
auto blockSizeLabel = new QLabel("", this);
static auto s_blockSizeIcon = QPixmap(PLUGIN_NAME::getIconPixmap("block_size"));
static auto s_blockSizeIcon = PLUGIN_NAME::getIconPixmap("block_size");
s_blockSizeIcon.setDevicePixelRatio(devicePixelRatio());
blockSizeLabel->setPixmap(s_blockSizeIcon.scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
config_layout->addWidget(blockSizeLabel, 0, 4, 2, 1, Qt::AlignRight);
Expand All @@ -206,7 +206,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)

// FFT: window type: icon and selector
auto windowLabel = new QLabel("", this);
static auto s_windowIcon = QPixmap(PLUGIN_NAME::getIconPixmap("window"));
static auto s_windowIcon = PLUGIN_NAME::getIconPixmap("window");
s_windowIcon.setDevicePixelRatio(devicePixelRatio());
windowLabel->setPixmap(s_windowIcon.scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
config_layout->addWidget(windowLabel, 2, 4, 2, 1, Qt::AlignRight);
Expand Down Expand Up @@ -307,10 +307,10 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor)
// Advanced settings button
auto advancedButton = new PixmapButton(this, tr("Advanced settings"));
advancedButton->setToolTip(tr("Access advanced settings"));
static auto s_advancedOnPixmap = QPixmap(PLUGIN_NAME::getIconPixmap("advanced_on")
.scaled(advButtonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
static auto s_advancedOffPixmap = QPixmap(PLUGIN_NAME::getIconPixmap("advanced_off")
.scaled(advButtonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
static auto s_advancedOnPixmap = PLUGIN_NAME::getIconPixmap("advanced_on")
.scaled(advButtonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
static auto s_advancedOffPixmap = PLUGIN_NAME::getIconPixmap("advanced_off")
.scaled(advButtonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
s_advancedOnPixmap.setDevicePixelRatio(devicePixelRatio());
s_advancedOffPixmap.setDevicePixelRatio(devicePixelRatio());
advancedButton->setActiveGraphic(s_advancedOnPixmap);
Expand Down

0 comments on commit 932ebe9

Please sign in to comment.