-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcombo_channelorder.cpp
More file actions
43 lines (38 loc) · 1.37 KB
/
combo_channelorder.cpp
File metadata and controls
43 lines (38 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "combo_channelorder.h"
ChannelOrderComboBox::ChannelOrderComboBox(QWidget *parent) : QComboBox(parent), _priorChannel()
{
// If either the text or index has changed, emit our custom signal
connect(this, &ChannelOrderComboBox::editTextChanged, this, &ChannelOrderComboBox::channelNumberChangedSlot);
//connect(this, &ChannelOrderComboBox::currentIndexChanged, this, &ChannelOrderComboBox::channelNumberChangedSlot);
}
void ChannelOrderComboBox::channelNumberChangedSlot(const QString &newChannel)
{
// Send out a signal with the old value, the new value, and a pointer to this box
emit channelNumberChanged(_priorChannel, newChannel, this);
// Overload currentIndexChanged too, and pass a reference to the combo box with it
emit currentIndexChanged(this->currentIndex(), this);
// Now save the new channel as our old channel for next time
_priorChannel = newChannel;
}
void ChannelOrderComboBox::setup(boolean isAux)
{
// Aux channels get "N/A" in index 0.
if (isAux)
{
this->insertItem(0, "N/A");
_isAux = true;
}
else
{
_isAux = false;
}
// Otherwise all channels gets 1-MAX_NUM_CHANNELS in the remaining positions
for(int i = 1; i <= COUNT_OP_CHANNELS; i++)
{
this->insertItem(i, QString::number(i));
}
}
boolean ChannelOrderComboBox::isAux(void)
{
return _isAux;
}