{
// Draw Tic Tac Toe Board
painter.
setRenderHint(QPainter::Antialiasing,
true);
painter.
setPen(QPen(Qt
::black,
10, Qt
::SolidLine, Qt
::RoundCap,
Qt::MiterJoin));
painter.drawLine(80, 20, 80, 250);
painter.
setRenderHint(QPainter::Antialiasing,
true);
painter.
setPen(QPen(Qt
::black,
10, Qt
::SolidLine, Qt
::RoundCap,
Qt::MiterJoin));
painter.drawLine(170, 20, 170, 250);
painter.
setRenderHint(QPainter::Antialiasing,
true);
painter.
setPen(QPen(Qt
::black,
10, Qt
::SolidLine, Qt
::RoundCap,
Qt::MiterJoin));
painter.drawLine(10, 90, 250, 90);
painter.
setRenderHint(QPainter::Antialiasing,
true);
painter.
setPen(QPen(Qt
::black,
10, Qt
::SolidLine, Qt
::RoundCap,
Qt::MiterJoin));
painter.drawLine(10, 180, 250, 180);
}
void MainWindow::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
// Draw Tic Tac Toe Board
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(Qt::black, 10, Qt::SolidLine, Qt::RoundCap,
Qt::MiterJoin));
painter.drawLine(80, 20, 80, 250);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(Qt::black, 10, Qt::SolidLine, Qt::RoundCap,
Qt::MiterJoin));
painter.drawLine(170, 20, 170, 250);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(Qt::black, 10, Qt::SolidLine, Qt::RoundCap,
Qt::MiterJoin));
painter.drawLine(10, 90, 250, 90);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(QPen(Qt::black, 10, Qt::SolidLine, Qt::RoundCap,
Qt::MiterJoin));
painter.drawLine(10, 180, 250, 180);
}
To copy to clipboard, switch view to plain text mode
Bookmarks