Hi

I'm trying to implement an OpenGL application with Qt. As a starting point I used an example I found on the web (http://blog.lugru.com/2009/03/qtdesigner-and-qglwidget/)

But always when I try to extend the functions by adding a new class my application crashs before startup. It crashes always somewhere in the Events part of the Qt libraries

here the code how i coneted my class with the existing parts.

Thanks in advance for any help

mainwindow constructor
Qt Code:
  1. MainWindow::MainWindow(QWidget *parent)
  2. : QMainWindow(parent), m_ui(new Ui::MainWindowClass)
  3. {
  4. ...
  5. // get an instance of the globalManager
  6. m_Manager = GlobalManager::GetInstance();
  7. ...
  8. }
To copy to clipboard, switch view to plain text mode 


definition of m_Manager
Qt Code:
  1. class MainWindow : public QMainWindow
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. MainWindow(QWidget *parent = 0);
  7. ~MainWindow();
  8.  
  9. private:
  10. /// \brief our GlobalManager which controls the rendering - we pass all data to it
  11. GlobalManager *m_Manager;
  12.  
  13. };
To copy to clipboard, switch view to plain text mode 


The header of the GlobalManager Class

Qt Code:
  1. class GlobalManager{
  2. private:
  3. static GlobalManager* m_Instance;
  4.  
  5. int m_Testvar;
  6.  
  7. /// \brief private constructor for our manager
  8. GlobalManager();
  9. /// \brief make asssigment operator private
  10. GlobalManager& operator=(GlobalManager&);
  11. /// \brief make copy constructor private
  12. GlobalManager(const GlobalManager&);
  13.  
  14. public:
  15. static GlobalManager* GetInstance();
  16. void GetRTImage();
  17.  
  18. };
To copy to clipboard, switch view to plain text mode 
and the according cpp
Qt Code:
  1. /// Static memeber initialisation
  2. GlobalManager* GlobalManager::m_Instance = 0;
  3.  
  4. /// \brief constructor implementation
  5. GlobalManager ::GlobalManager()
  6. {
  7. int m_Testvar = 10;
  8. }
  9.  
  10. /// \brief function return the only instance of the object
  11. GlobalManager* GlobalManager::GetInstance()
  12. {
  13. if(m_Instance==0)
  14. {
  15. m_Instance=new GlobalManager();
  16. }
  17. return m_Instance;
  18. }
To copy to clipboard, switch view to plain text mode