MNE-CPP  beta 1.0
projectorwidget.cpp
Go to the documentation of this file.
1 //=============================================================================================================
36 //*************************************************************************************************************
37 //=============================================================================================================
38 // INCLUDES
39 //=============================================================================================================
40 
41 #include "projectorwidget.h"
42 
43 
44 //*************************************************************************************************************
45 //=============================================================================================================
46 // Qt INCLUDES
47 //=============================================================================================================
48 
49 #include <QGridLayout>
50 
51 #include <QDebug>
52 
53 
54 //*************************************************************************************************************
55 //=============================================================================================================
56 // USED NAMESPACES
57 //=============================================================================================================
58 
59 using namespace XDISPLIB;
60 
61 
62 //*************************************************************************************************************
63 //=============================================================================================================
64 // DEFINE MEMBER METHODS
65 //=============================================================================================================
66 
67 ProjectorWidget::ProjectorWidget(QWidget *parent, Qt::WindowFlags f)
68 : QWidget(parent, f)
69 {
70 }
71 
72 
73 //*************************************************************************************************************
74 
76 {
77  if(m_pFiffInfo)
78  {
79  m_qListCheckBox.clear();
80  // Projection Selection
81  QGridLayout *topLayout = new QGridLayout;
82  for(qint32 i = 0; i < m_pFiffInfo->projs.size(); ++i)
83  {
84  QCheckBox* checkBox = new QCheckBox(m_pFiffInfo->projs[i].desc);
85  checkBox->setChecked(m_pFiffInfo->projs[i].active);
86 
87  m_qListCheckBox.append(checkBox);
88 
89  connect(checkBox, static_cast<void (QCheckBox::*)(int)>(&QCheckBox::stateChanged), this, &ProjectorWidget::checkStatusChanged);
90  topLayout->addWidget(checkBox, i, 1);
91  }
92 
93  setLayout(topLayout);
94  }
95 }
96 
97 
98 //*************************************************************************************************************
99 
100 void ProjectorWidget::checkStatusChanged(int status)
101 {
102  Q_UNUSED(status)
103 
104  for(qint32 i = 0; i < m_qListCheckBox.size(); ++i)
105  this->m_pFiffInfo->projs[i].active = m_qListCheckBox[i]->isChecked();
106 
107  emit projSelectionChanged();
108 }
109 
110 
111 //*************************************************************************************************************
112 
113 void ProjectorWidget::setFiffInfo(FIFFLIB::FiffInfo::SPtr& p_pFiffInfo)
114 {
115  this->m_pFiffInfo = p_pFiffInfo;
116  createUI();
117 }
FIFF measurement file information.
Definition: fiff_info.h:96
ProjectorWidget(QWidget *parent=0, Qt::WindowFlags f=0)
void setFiffInfo(FiffInfo::SPtr &p_pFiffInfo)
Definition: fiff.h:98
Declaration of the ProjectorWidget Class.
The ProjectorWidget class provides the sensor selection widget.