Hi, I'm new to Qt (and GUI in general) and I'm trying to make a board game with 19x19 squares. They way I'm trying to do this is with 19x19 = 361 QLabel widgets, each with an empty square picture. Then when I want to place a stone at a square, I emit a signal to a slot that changes the PixMap of the QLabel at that square:

Qt Code:
  1. void MainWidget::placeStone(int y,int x, char colour){
  2.  
  3. if (colour == 'D'){
  4. board[y][x]->setPixmap(QPixmap("black.png"));
  5. } else {
  6. board[y][x]->setPixmap(QPixmap("white.png"));
  7. }
  8. return;
  9. }
To copy to clipboard, switch view to plain text mode 

My Class:

Qt Code:
  1. class MainWidget : public QWidget
  2. {
  3. Q_OBJECT
  4. public:
  5. MainWidget(QWidget *parent = 0);
  6.  
  7. public slots:
  8. void placeStone(int y,int x, char colour);
  9. void moveNotMade(){}
  10. void invalidPort();
  11.  
  12.  
  13.  
  14. private:
  15. QLabel* board [19][19];
  16. };
To copy to clipboard, switch view to plain text mode 

The constructor:

Qt Code:
  1. MainWidget::MainWidget(QWidget *parent) : QWidget(parent)
  2. {
  3. QPushButton *quit = new QPushButton(tr("Quit"));
  4. connect(quit, SIGNAL(clicked()), qApp, SLOT(quit()));
  5. myProg* program1 = new myProg();
  6.  
  7. /// PORT INPUT
  8. QLabel *portInputLabel = new QLabel();
  9. portInputLabel->setText("Port (ex: /dev/ttyS0):");
  10. portInputLabel->setAlignment(Qt::AlignRight);
  11. QLineEdit* portInput = new QLineEdit();
  12. connect(portInput,SIGNAL(textChanged(QString)),program1,SLOT(getPort(QString)));
  13.  
  14. /// COLOUR INPUT
  15. QLabel *colourInputLabel = new QLabel();
  16. colourInputLabel->setText("Software AI Colour (dark or light):");
  17. colourInputLabel->setAlignment(Qt::AlignRight);
  18. QLineEdit* colourInput = new QLineEdit();
  19. connect(colourInput,SIGNAL(textChanged(QString)),program1,SLOT(getColour(QString)));
  20.  
  21. QGridLayout *grid = new QGridLayout;
  22. grid->addWidget(portInputLabel,1,1);
  23. grid->addWidget(portInput,1,2);
  24. grid->addWidget(colourInputLabel,2,1);
  25. grid->addWidget(colourInput,2,2);
  26.  
  27. setUpdatesEnabled(true);
  28.  
  29. QPushButton *startButton = new QPushButton(tr("Start"));
  30. connect(startButton, SIGNAL(clicked()),program1,SLOT(startProgram()));
  31.  
  32.  
  33. QGridLayout *grid1 = new QGridLayout;
  34. for (int row = 0; row < 19; ++row) {
  35. for (int column = 0; column < 19; ++column) {
  36. board[row][column] = new QLabel();
  37. board[row][column]->setPixmap(QPixmap("empty.png"));
  38. board[row][column]->adjustSize();
  39. grid1->addWidget(board[row][column], row, column);
  40. }
  41. }
  42. grid1->setHorizontalSpacing(0);
  43. grid1->setVerticalSpacing(0);
  44.  
  45. connect(program1,SIGNAL(placeStone(int,int,char)),this,SLOT(placeStone(int,int,char)),Qt::DirectConnection);
  46. connect(program1,SIGNAL(refreshScreen()),this,SLOT(update()),Qt::DirectConnection);
  47.  
  48. QVBoxLayout *layout = new QVBoxLayout;
  49. layout->addLayout(grid);
  50. layout->addWidget(quit);
  51. layout->addWidget(startButton);
  52. layout->addLayout(grid1);
  53. setLayout(layout);
  54. }
To copy to clipboard, switch view to plain text mode 

My Issue is that the placeStone slot only seems to take place AFTER the function that emits the signal returns. I've tried changing the connection type to Qt:irectConnection, but that did not change anything. I've also tried calling the update() function to force it to update the screen, but that didn't help

Thanks in advance!