MNE-CPP  beta 1.0
frequencyspectrumsettingswidget.cpp
Go to the documentation of this file.
1 //=============================================================================================================
36 //*************************************************************************************************************
37 //=============================================================================================================
38 // INCLUDES
39 //=============================================================================================================
40 
42 #include "../frequencyspectrumwidget.h"
43 
44 
45 //*************************************************************************************************************
46 //=============================================================================================================
47 // Qt INCLUDES
48 //=============================================================================================================
49 
50 #include <QLabel>
51 #include <QGridLayout>
52 #include <QDoubleValidator>
53 
54 #include <QDebug>
55 
56 
57 //*************************************************************************************************************
58 //=============================================================================================================
59 // USED NAMESPACES
60 //=============================================================================================================
61 
62 using namespace XDISPLIB;
63 
64 
65 //*************************************************************************************************************
66 //=============================================================================================================
67 // DEFINE MEMBER METHODS
68 //=============================================================================================================
69 
71 : m_pFrequencySpectrumWidget(parent)
72 {
73  this->setWindowTitle("Frequency Spectrum Settings");
74  this->setMinimumWidth(330);
75  this->setMaximumWidth(330);
76 
77  QGridLayout* t_pGridLayout = new QGridLayout;
78 
79  QLabel *t_pLabelLower = new QLabel;
80  t_pLabelLower->setText("Lower Frequency");
81  m_pSliderLowerBound = new QSlider(Qt::Horizontal);
82  QLabel *t_pLabelUpper = new QLabel;
83  t_pLabelUpper->setText("Upper Frequency");
84  m_pSliderUpperBound = new QSlider(Qt::Horizontal);
85 
86  m_pSliderUpperBound->setMinimum(0);
87  m_pSliderUpperBound->setMaximum(100);
88 
89  connect(m_pSliderLowerBound, &QSlider::valueChanged, this, &FrequencySpectrumSettingsWidget::updateValue);
90  connect(m_pSliderUpperBound, &QSlider::valueChanged, this, &FrequencySpectrumSettingsWidget::updateValue);
91 
92  t_pGridLayout->addWidget(t_pLabelLower,0,0);
93  t_pGridLayout->addWidget(m_pSliderLowerBound,0,1);
94  t_pGridLayout->addWidget(t_pLabelUpper,1,0);
95  t_pGridLayout->addWidget(m_pSliderUpperBound,1,1);
96 
97  this->setLayout(t_pGridLayout);
98 
99 }
100 
101 
102 //*************************************************************************************************************
103 
105 {
106  Q_UNUSED(value)
107 
108  if(m_pSliderLowerBound->value() > m_pSliderUpperBound->value())
109  m_pSliderLowerBound->setValue(m_pSliderUpperBound->value());
110  else if(m_pSliderUpperBound->value() < m_pSliderLowerBound->value())
111  m_pSliderUpperBound->setValue(m_pSliderLowerBound->value());
112 
113  emit settingsChanged();
114 }
Declaration of the FrequencySpectrumSettingsWidget Class.
FrequencySpectrumSettingsWidget(FrequencySpectrumWidget *toolbox)
The FrequencySpectrumWidget class provides a equalizer display.