Hello all, I am undertaking a game using a combination of c++ in visual studios 2010 and Qt 4.7 (both windows). I have created my gui how i want it to look, but now i would like to integrate it into the game files. The game is a clone of battleship and is console input based. I will keep with this, but I used an update mapboard class to redraw the game board after a player fires, which keeps storing over the char array.

On the Qt side in Qt designer, my gui consists of a grid layout 10x10, using labels to hold pixmaps of game cells. I can manually choose what pixmap I would like to display using the properties editor, but I would something dynamic. I have painstakingly named each label to represent its position in the 2d array (ie. fleet map => F_00 => F[0,0] => F[i],[j])

using this, I would like to update my pixmaps for each, using a generic getupdatearray type function. As we traverse the array it will update the pixmap currently associated with individual labels to match their cousins from the array. say F[5][6] = 'X' for hit, then when the loops got to that position in the array it would update the grid of pixmaps at F_56 to equal a hit.png, replacing the empty.png.

I have an idea how to make the loop that would accomplish this, but unsure how i would go about getting the pixmap for each label to be more along the lines of a runtime feature versus the now compile time (static) feature.

I have read about Qtpainter and another Qt class that deals with images, but still having a hard go at it.

Question to any of you, how do I update these pixmaps based on a 2d array?
1.) loop structure - i can figure out
2.) condition statements - i can figure out
3.) qt specific syntax dealing with labels- newbie so no idea atm.

Thanks in Advance