Here is my code

The .cpp
Qt Code:
  1. #include "soundconfigurator.h"
  2. #include <qlayout.h>
  3. #include <qlabel.h>
  4. #include <qcombobox.h>
  5.  
  6. CSoundConfigurator::CSoundConfigurator(QWidget* parent, const char* name)
  7. :QWidget(parent, name)
  8. {
  9. // ... for main layout
  10. QVBoxLayout* mainLayout = new QVBoxLayout(this);
  11.  
  12.  
  13. // ... for the widget title
  14. widgetTitleLabel = new QLabel("SOUND PARAM", this, "widgetTitleLabel");
  15. mainLayout->addWidget(widgetTitleLabel);
  16.  
  17.  
  18. // ... for play mode
  19. QHBoxLayout* layoutPlayMode = new QHBoxLayout(mainLayout);
  20. soundPlayModeLabel = new QLabel("PLAY MODE", this, "soundPlayModeLabel");
  21. soundPlayModeComboBox = new QComboBox(this, "soundPlayModeComboBox");
  22. soundPlayModeComboBox->insertItem(QString("Single"), PlayMode::SingleShot);
  23. soundPlayModeComboBox->insertItem(QString("Loop"), PlayMode::Loop);
  24. layoutPlayMode->addWidget(soundPlayModeLabel);
  25. layoutPlayMode->addWidget(soundPlayModeComboBox);
  26.  
  27.  
  28. // ... for restitution mode
  29. QHBoxLayout* layoutRestitutionMode = new QHBoxLayout(mainLayout);
  30. soundRestitutionModeLabel = new QLabel("Sound Restitution", this, "soundRestitutionModeLabel");
  31. soundRestitutionModeComboBox = new QComboBox(this, "soundRestitutionModeComboBox");
  32. soundRestitutionModeComboBox->insertItem(QString("All"), RestitutionMode::AllHp);
  33. soundRestitutionModeComboBox->insertItem(QString("None"), RestitutionMode::NoHp);
  34. layoutRestitutionMode->addWidget(soundRestitutionModeLabel);
  35. layoutRestitutionMode->addWidget(soundRestitutionModeComboBox);
  36.  
  37.  
  38. // ... signal to slot management
  39. connect(soundPlayModeComboBox,SIGNAL(activated (int)),this, SLOT(processSoundPlayModeChange(PlayMode)));
  40. connect(soundRestitutionModeComboBox,SIGNAL(activated(int)),this, SLOT(processSoundRestitutionModeChange(RestitutionMode)));
  41. }
  42.  
  43. // Slots
  44. void CSoundConfigurator::processSoundPlayModeChange(PlayMode value)
  45. {
  46. // Process something specific ... eventually
  47. // TO DO
  48.  
  49. // Emit the signal
  50. emit soundPlayModeChanged(value);
  51. }
  52.  
  53.  
  54. void CSoundConfigurator::processSoundRestitutionModeChange(RestitutionMode value)
  55. {
  56. // Process something specific ... eventually
  57. // TO DO
  58.  
  59. // Emit the signal
  60. emit soundRestitutionModeChanged(value);
  61. }
  62.  
  63.  
  64. void CSoundConfigurator::setSoundPlayModeTitle(const QString& value)
  65. {
  66. soundPlayModeLabel->setText(value);
  67. }
  68.  
  69.  
  70. void CSoundConfigurator::setSoundPlayModeValue(PlayMode value)
  71. {
  72. soundPlayModeComboBox->setCurrentItem(value);
  73. }
  74.  
  75.  
  76. void CSoundConfigurator::setSoundRestitutionModeTitle(const QString& value)
  77. {
  78. soundRestitutionModeLabel->setText(value);
  79. }
  80.  
  81.  
  82. void CSoundConfigurator::setSoundRestitutionModeValue(RestitutionMode value)
  83. {
  84. soundRestitutionModeComboBox->setCurrentItem(value);
  85. }
  86.  
  87.  
  88. // Functions
  89.  
  90.  
  91. QString CSoundConfigurator::getSoundPlayModeTitle() const
  92. {
  93. return soundPlayModeLabel->text();
  94. }
  95.  
  96.  
  97. PlayMode CSoundConfigurator::getSoundPlayModeValue() const
  98. {
  99. return soundPlayModeComboBox->currentItem();
  100. }
  101.  
  102.  
  103. QString CSoundConfigurator::getSounfRestitutionTitle() const
  104. {
  105. return soundRestitutionModeLabel->text();
  106. }
  107.  
  108.  
  109. RestitutionMode CSoundConfigurator::getSoundResitutionValue() const
  110. {
  111. return soundRestitutionModeComboBox->currentItem();
  112. }
To copy to clipboard, switch view to plain text mode 

The .h
Qt Code:
  1. #ifndef _SOUND_CONFIGURATOR_H
  2. #define _SOUND_CONFIGURATOR_H
  3.  
  4. #include <qwidget.h>
  5.  
  6. class QLabel;
  7. class QComboBox;
  8.  
  9. class CSoundConfigurator : public QWidget
  10. {
  11. Q_OBJECT
  12.  
  13. public:
  14. enum PlayMode {Single=0, Loop=1};
  15. enum RestitutionMode {AllHp=0, NoHp=1};
  16.  
  17. // Constructor / Destructor
  18. public:
  19. CSoundConfigurator(QWidget* parent=0, const char* name=0);
  20.  
  21. // Slots
  22. private slots:
  23. void processSoundPlayModeChange (PlayMode);
  24. void processSoundRestitutionModeChange (RestitutionMode);
  25.  
  26. public slots:
  27. void setSoundPlayModeTitle (const QString&);
  28. void setSoundPlayModeValue (PlayMode);
  29.  
  30. void setSoundRestitutionModeTitle (const QString&);
  31. void setSoundRestitutionModeValue (RestitutionMode);
  32.  
  33. // Signals
  34. signals:
  35. void soundPlayModeChanged (PlayMode);
  36. void soundRestitutionModeChanged (RestitutionMode);
  37.  
  38. // Functions
  39. public:
  40. QString getSoundPlayModeTitle () const;
  41. PlayMode getSoundPlayModeValue () const;
  42.  
  43. QString getSounfRestitutionTitle () const;
  44. RestitutionMode getSoundResitutionValue () const;
  45.  
  46.  
  47. // Members
  48. private:
  49. QLabel* soundPlayModeLabel;
  50. QComboBox* soundPlayModeComboBox;
  51.  
  52. QLabel* soundRestitutionModeLabel;
  53. QComboBox* soundRestitutionModeComboBox;
  54. };
  55.  
  56. #endif
To copy to clipboard, switch view to plain text mode 

The main.cpp
Qt Code:
  1. #include <qapplication.h>
  2. #include "soundconfigurator.h"
  3.  
  4. int main(int argc, char** argv)
  5. {
  6. QApplication a(argc, argv);
  7.  
  8. CSoundConfigurator* sc = new CSoundConfigurator();
  9. a.setMainWidget(sc);
  10. sc->show();
  11.  
  12. return a.exec();
  13. }
To copy to clipboard, switch view to plain text mode 

My errors are the following
Qt Code:
  1. error C2143: syntax error: missing ';' before 'tag::id"
To copy to clipboard, switch view to plain text mode 
This error occurs in the function
Qt Code:
  1. PlayMode CSoundConfigurator::getSoundPlayModeValue() const
  2. {
  3. return soundPlayModeComboBox->currentItem();
  4. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. error C2501: 'PlayMode' : missing storage class or type specifiers
To copy to clipboard, switch view to plain text mode 
This error occurs in the same line as the previous one

Qt Code:
  1. fatal error C1004: unexpected end of file found
To copy to clipboard, switch view to plain text mode 
... still the same line