I made a simple main file to test some things :
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include <QtGui/QMainWindow>
  3. #include <QtGui/QPushButton>
  4. #include <QtCore/QObject>
  5.  
  6. class application;
  7.  
  8.  
  9. class UI {
  10.  
  11. public:
  12. UI( application* a) {
  13. app=a;
  14. frame = new QMainWindow;
  15. button = new QPushButton( frame );
  16. connect( button, SIGNAL( clicked() ), this, SLOT( exit()) );
  17. frame -> show();
  18. }
  19. public slots:
  20. void exit() {
  21. app -> exit();
  22. }
  23. private:
  24. application* app;
  25. QMainWindow* frame;
  26. QPushButton* button;
  27. };
  28.  
  29.  
  30. class application {
  31. public:
  32. application( int argc, char** argv) {
  33. qapp = new QApplication( argc, argv);
  34. ui = new UI( this);
  35. qapp -> exec();
  36. }
  37.  
  38. void exit( int code = 0 ){
  39. qapp -> exit( code );
  40. exit( code );
  41. }
  42. private:
  43. QApplication* qapp;
  44. UI* ui;
  45. };
  46.  
  47.  
  48. int main( int argc, char** argv ){
  49. application( argc, argv );
  50. return 0;
  51. }
To copy to clipboard, switch view to plain text mode 

And this are the compile errors i get:
Qt Code:
  1. main.cpp: In constructor ‘UI::UI(application*)’:
  2. main.cpp:16: error: ‘connect’ was not declared in this scope
  3. main.cpp: In member function ‘void UI::exit()’:
  4. main.cpp:21: error: invalid use of incomplete type ‘struct application’
  5. main.cpp:6: error: forward declaration of ‘struct application’
To copy to clipboard, switch view to plain text mode 

I'm really confused about what the problem could be.

hannesvdc