Hi

I'm trying to make a version of minesweeper in Qt4. In order to do this i have subclassed QPushButton to make a new class, MinesveiperButton. This seems to work fine, however when i try to make a new grid, using a 2-dimentional array and fill it with MinesveiperButtons i get this error:
C:/C++ Qt/Minesveiper/v3/minesveiper.cpp:52: error: no match for 'operator=' in '*((*(((Minesveiper*)this)->Minesveiper::mask + ((unsigned int)(((unsigned int)i) * 4u)))) + ((unsigned int)(((unsigned int)j) * 28u))) = (operator new(28u), (<statement>, ((MinesveiperButton*)<anonymous>)))'
This is Minesveiper.h:
Qt Code:
  1. #ifndef MINESVEIPER_H
  2. #define MINESVEIPER_H
  3.  
  4. #include <QMainWindow>
  5. #include <QGridLayout>
  6. #include "MinesveiperButton.h"
  7.  
  8. namespace Ui {
  9. class Minesveiper;
  10. }
  11.  
  12. class Minesveiper : public QMainWindow {
  13. Q_OBJECT
  14. public:
  15. Minesveiper(QWidget *parent = 0);
  16. ~Minesveiper();
  17.  
  18. void makeBoard();
  19. void startSpill(int h, int w, int m);
  20.  
  21. public slots:
  22. void startEnkeltSpill();
  23.  
  24. protected:
  25. void changeEvent(QEvent *e);
  26.  
  27. private:
  28. Ui::Minesveiper *ui;
  29.  
  30. int mHeight;
  31. int mWidth;
  32. int mines;
  33. int antOpen;
  34. int **board;
  35. MinesveiperButton **mask;
  36. };
  37.  
  38. #endif // MINESVEIPER_H
To copy to clipboard, switch view to plain text mode 

and this is MinesveiperButton.h:
Qt Code:
  1. #ifndef MINESVEIPERBUTTON_H
  2. #define MINESVEIPERBUTTON_H
  3.  
  4. #include <QtGui/qpushbutton.h>
  5. #include "minesveiper.h"
  6.  
  7. class MinesveiperButton : public QPushButton {
  8. Q_OBJECT
  9. public:
  10.  
  11. MinesveiperButton(int x, int y);
  12. MinesveiperButton();
  13. ~MinesveiperButton();
  14.  
  15. void open();
  16. void flag();
  17. void setIcon();
  18.  
  19. //MinesveiperButton & operator=(const MinesveiperButton &rhs);
  20.  
  21. private:
  22. int xpos;
  23. int ypos;
  24.  
  25. };
  26.  
  27. #endif // MINESVEIPERBUTTON_H
To copy to clipboard, switch view to plain text mode 

and finally implementation of Minesveiper::makeBoard() from Minesveiper.cpp, which is where i get the error:
Qt Code:
  1. void Minesveiper::makeBoard() {
  2. /*
  3.   Deletes board and mask, and makes new arrays.
  4.   Empties grid and adds new MinesveiperButtons to grid.
  5. */
  6. delete [] board;
  7. delete [] mask;
  8.  
  9. // Empty grid
  10. int ant = grid.count();
  11. for(int i = 0; i < ant; i++) {
  12. delete grid.itemAt(i);
  13. }
  14.  
  15. // Make new arrays
  16. board = new int *[mHeight];
  17. mask = new MinesveiperButton *[mHeight];
  18. for(int i = 0; i < mHeight; i++) {
  19. board[i] = new int[mWidth];
  20. mask[i] = new MinesveiperButton[mWidth];
  21. for(int j = 0; j < mWidth; j++) {
  22. board[i][j] = 0;
  23. mask[i][j] = new MinesveiperButton(j, i);
  24. grid.addWidget(&mask[i][j], i, j);
  25. }
  26. }
  27. }
To copy to clipboard, switch view to plain text mode 

line 52 is numbered 23 here..

Can someone help me with this? I thought =operator didn't need overloading. Does it?
Just tell me if you want to view more of the code..