Skip to content

Commit

Permalink
Adjust parameter order in MixerChannelView's constructor
Browse files Browse the repository at this point in the history
Make the parent `QWidget` the first parameter as it is a Qt convention. The default parameter had to be removed due to this.
  • Loading branch information
michaelgregorius committed Dec 29, 2023
1 parent f32d9ce commit 6950998
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/MixerChannelView.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace lmms::gui
None, SendToThis, ReceiveFromThis
};

MixerChannelView(int channelIndex, MixerView* mixerView, QWidget* parent = nullptr);
MixerChannelView(QWidget* parent, MixerView* mixerView, int channelIndex);
void paintEvent(QPaintEvent* event) override;
void contextMenuEvent(QContextMenuEvent*) override;
void mousePressEvent(QMouseEvent*) override;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/MixerChannelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

namespace lmms::gui
{
MixerChannelView::MixerChannelView(int channelIndex, MixerView* mixerView, QWidget* parent) :
MixerChannelView::MixerChannelView(QWidget* parent, MixerView* mixerView, int channelIndex) :
QWidget(parent),
m_mixerView(mixerView),
m_channelIndex(channelIndex)
Expand Down
8 changes: 4 additions & 4 deletions src/gui/MixerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ MixerView::MixerView() :

// add master channel
m_mixerChannelViews.resize(m->numChannels());
m_mixerChannelViews[0] = new MixerChannelView(0, this, this);
m_mixerChannelViews[0] = new MixerChannelView(this, this, 0);

m_racksLayout->addWidget(m_mixerChannelViews[0]->m_effectRackView);

Expand All @@ -114,7 +114,7 @@ MixerView::MixerView() :
// add mixer channels
for (int i = 1; i < m_mixerChannelViews.size(); ++i)
{
m_mixerChannelViews[i] = new MixerChannelView(i, this, m_channelAreaWidget);
m_mixerChannelViews[i] = new MixerChannelView(m_channelAreaWidget, this, i);
chLayout->addWidget(m_mixerChannelViews[i]);
}

Expand Down Expand Up @@ -187,7 +187,7 @@ int MixerView::addNewChannel()
Mixer * mix = Engine::mixer();

int newChannelIndex = mix->createChannel();
m_mixerChannelViews.push_back(new MixerChannelView(newChannelIndex, this, m_channelAreaWidget));
m_mixerChannelViews.push_back(new MixerChannelView(m_channelAreaWidget, this, newChannelIndex));
chLayout->addWidget(m_mixerChannelViews[newChannelIndex]);
m_racksLayout->addWidget(m_mixerChannelViews[newChannelIndex]->m_effectRackView);

Expand All @@ -213,7 +213,7 @@ void MixerView::refreshDisplay()
m_mixerChannelViews.resize(Engine::mixer()->numChannels());
for (int i = 1; i < m_mixerChannelViews.size(); ++i)
{
m_mixerChannelViews[i] = new MixerChannelView(i, this, m_channelAreaWidget);
m_mixerChannelViews[i] = new MixerChannelView(m_channelAreaWidget, this, i);
chLayout->addWidget(m_mixerChannelViews[i]);
m_racksLayout->addWidget(m_mixerChannelViews[i]->m_effectRackView);
}
Expand Down

0 comments on commit 6950998

Please sign in to comment.