Hello, i'm a total noob to QT, but i'm really into learning it.
Been trying to solve this by myself for some time now, and i think i'm close now, but still, i'm at a complete loss here.
If someone could help me out, the idea is making a 'guess the number' kind of program, i managed to get the layout done and all, i'm now trying to add some functionality. The first thing i'm trying to implement is that the NewGame button make the infoLabel change it's value.
By now, i managed to understand how to do it, and implemented a function to do so, but when i compile, the compiler won't recognize the class i created to store the function calls.

I'll post here the code, followed by the compiler's output:

Qt Code:
  1. #include <QtGui>
  2. #include <QtCore>
  3. #include <QHBoxLayout>
  4. #include <QVBoxLayout>
  5. #include <QString>
  6.  
  7. QString infotext = "";
  8. int randgen(int);
  9. int randgen(int x){
  10. x = rand() % 100 + 1;
  11. return x;};
  12.  
  13. class MyWidget : public QWidget
  14. {
  15.  
  16. public:
  17. MyWidget(QWidget *parent = 0);
  18.  
  19.  
  20.  
  21. };
  22. class MyFunctions : public QWidget
  23. {
  24. Q_OBJECT
  25. public:
  26.  
  27. void newClicked();
  28.  
  29. public slots:
  30.  
  31. ;};
  32.  
  33. void MyFunctions::newClicked()
  34. {
  35. QString infotext = "NewGame_Text";
  36. };
  37.  
  38. MyWidget::MyWidget(QWidget *parent)
  39. : QWidget(parent)
  40. {
  41. QWidget *window = new QWidget;
  42. window->setWindowTitle("Guess the number");
  43.  
  44. QLabel *choose = new QLabel("Choose a number");
  45. QSpinBox *spin = new QSpinBox;
  46. spin->setRange(0, 100);
  47. spin->setValue(0);
  48. QLabel *info = new QLabel;
  49. info->setAutoFillBackground(true);
  50. info->setText(infotext);
  51. QPushButton *newGame = new QPushButton("New Game");
  52. QPushButton *guess = new QPushButton("Guess");
  53.  
  54. QHBoxLayout *input = new QHBoxLayout;
  55. input->addWidget(choose);
  56. input->addWidget(spin);
  57. QVBoxLayout *leftLayout = new QVBoxLayout;
  58. leftLayout->addLayout(input);
  59. leftLayout->addWidget(info);
  60. QVBoxLayout *rightLayout = new QVBoxLayout;
  61. rightLayout->addWidget(newGame);
  62. rightLayout->addWidget(guess);
  63. QHBoxLayout *layout = new QHBoxLayout;
  64. layout->addLayout(leftLayout);
  65. layout->addLayout(rightLayout);
  66. window->setLayout(layout);
  67.  
  68.  
  69.  
  70. // info->setText("info here");
  71.  
  72. connect(newGame, SIGNAL(clicked()), MyFunctions, SLOT(newClicked()));
  73.  
  74. window->show();
  75. };
  76.  
  77.  
  78. /*void MyWidget::newClicked()
  79. {
  80. QString infotext = "NewGameText";
  81. };*/
  82.  
  83.  
  84.  
  85. int main(int argc, char *argv[])
  86. {
  87. QApplication app(argc, argv);
  88. MyWidget widget;
  89.  
  90. return app.exec();
  91. }
To copy to clipboard, switch view to plain text mode 

Compiler's Output:

Qt Code:
  1. guess.cpp: In constructor ‘MyWidget::MyWidget(QWidget*):
  2. guess.cpp:72: error: expected primary-expression before ‘,’ token
  3. make: *** [guess.o] Error 1
To copy to clipboard, switch view to plain text mode 

Don't know what's wrong.
Thanks in advance.