I wanted to make my application logging, so I added a "QStringList l" to my Mainwindow Class.
Because the Program has some sub-classes that also should be logging, I added Pointers to the mainwindow's QStringList into them.
The program executes the Pledge-Algorithm for a robot to leave a room full of blocks, so I created the Classes "CPledge", "CRob" and "CMap".

The problem: I get a SIGSEGV error when I reference the log-lists of CRob/CMap to the Mainwindow's logList.
CODE:
Mainwindow Class:
Qt Code:
  1. #include <QMainWindow>
  2.  
  3. namespace Ui {
  4. class MainWindow;
  5. }
  6.  
  7. class MainWindow : public QMainWindow
  8. {
  9. Q_OBJECT
  10.  
  11. public:
  12. explicit MainWindow(QWidget *parent = 0);
  13. ~MainWindow();
  14.  
  15. // !The Log Object!
  16.  
  17. void saveLog(QString file);
  18.  
  19. private:
  20. Ui::MainWindow *ui;
  21.  
  22.  
  23. QString i(int i);
  24. QString dt();
  25.  
  26. private slots:
  27. void on_btStartThread_clicked();
  28. // etc.
  29. };
  30.  
  31.  
  32. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

The CPledge Class (Gets the CRob out of a CMap):
Qt Code:
  1. class CPledge : public QObject
  2. {
  3. Q_OBJECT
  4. public:
  5. explicit CPledge(QObject *parent = 0);
  6.  
  7. CMap *map;
  8. CRob *rob;
  9. void setBot(int x, int y);
  10. // Log list reference
  11.  
  12. private:
  13. void followLeftWallTilTurnIsZero();
  14.  
  15. public slots:
  16. void solve(QString filePath);
  17.  
  18. signals:
  19. void finished();
  20. };
To copy to clipboard, switch view to plain text mode 

The CMap Class (The Labyrinth):
Qt Code:
  1. class CMap : public QObject
  2. {
  3. Q_OBJECT
  4. public:
  5. explicit CMap(QObject *parent = 0);
  6. // Log list reference
  7.  
  8. typedef QList<bool> StonesLine;
  9.  
  10. void loadFromFile(QString FilePath);
  11.  
  12. bool free(int x, int y);
  13. bool left(int x, int y, int turn);
  14. bool front(int x, int y, int turn);
  15. QPoint movedPos(int x, int y, int turn);
  16.  
  17. int cleanTurning(int turn);
  18.  
  19. QPoint *defaultRobPos;
  20.  
  21. private:
  22. // A 2D bool-list: 1->stone; 0-> No stone
  23. QList <StonesLine> stones;
  24. // The list of points where the rob is free
  25. QPoint freePoints[2];
  26.  
  27. void insertBlock(int x1, int y1, int x2, int y2);
  28. void initBlocks(int width, int height);
  29.  
  30. StonesLine horizontalStonesBorder(int width);
  31. StonesLine verticalStonesBorder(int width);
  32. };
To copy to clipboard, switch view to plain text mode 

The CRob Class (The Robot):
Qt Code:
  1. class CRob : public QObject
  2. {
  3. Q_OBJECT
  4. public:
  5. explicit CRob(QObject *parent = 0);
  6. // Log list reference
  7.  
  8. bool free();
  9.  
  10. bool left();
  11. bool front();
  12.  
  13. void turnR();
  14. void turnL();
  15.  
  16. void move();
  17.  
  18. void setPosition(int newx, int newy);
  19.  
  20. int turning();
  21.  
  22. private:
  23. int x, y;
  24. CMap *map;
  25.  
  26. int fturning;
  27. };
To copy to clipboard, switch view to plain text mode 


The Error comes here at Mainwindow.cpp:
Qt Code:
  1. // etc.
  2. void MainWindow::on_btStartThread_clicked()
  3. {
  4. CPledge *pledge = new CPledge();
  5. pledge->l = &l;
  6. // #########FATAL SIGSEGV ERROR################
  7. pledge->rob->l = &l;
  8. pledge->map->l = &l;
  9.  
  10.  
  11. pledge->solve(ui->edMapPath->text());
  12. }
  13. // etc.
To copy to clipboard, switch view to plain text mode