QPainter painter = new QPainter(qImage);
painter.setPen(new QPen(QColor.black, lineWidth));
// Draw lines between tiles
for (int i = 0; i <= numCols; i++) {
painter.drawLine((i) * tileSize, tileSize, (i) * tileSize,
(numRows) * tileSize);
}
for (int j = 0; j <= numRows; j++) {
painter.drawLine(tileSize, (j) * tileSize, (numCols) * tileSize,