Sorry about the double post, felt like I could just re-use this thread instead.
So I have a custom button class and I've created buttons and added them inside a regular CustomButton array:
for(int x=0 ; x < size_x ; x++){
for(int y=0 ; y < size_y ; y++){
buttonGrid[x][y] = new OthelloButton();
centralGrid->addWidget(buttonGrid[x][y],x,y);
buttonGrid[x][y]->setObjectName("gridButton");
}
}
for(int x=0 ; x < size_x ; x++){
for(int y=0 ; y < size_y ; y++){
buttonGrid[x][y] = new OthelloButton();
centralGrid->addWidget(buttonGrid[x][y],x,y);
buttonGrid[x][y]->setObjectName("gridButton");
}
}
To copy to clipboard, switch view to plain text mode
For some reason, it's not listening to any styles sheet, for example the following code doesn't change anything while it should:
#gridButton{
background-color:orange;
color:white;
}
#gridButton{
background-color:orange;
color:white;
}
To copy to clipboard, switch view to plain text mode
I've been stuck on this for some time, couldn't find any answer.
Edit: Fixed, when I took some example code on the Qt doc's there was un-commented text between two declarations
Bookmarks