Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include "board.h"
  2. #include "ui_board.h"
  3. #include <QPainter>
  4. #include <QBrush>
  5.  
  6. board::board(QWidget *parent) :
  7.     QWidget(parent),
  8.     ui(new Ui::board)
  9. {
  10.     ui->setupUi(this);
  11. }
  12.  
  13. board::~board()
  14. {
  15.     delete ui;
  16. }
  17.  
  18. void board::drawBoard()
  19. {
  20.     QPainter boardPainter(this);
  21.     QBrush boardBrush;
  22.  
  23.     int boardWidth = this->width();
  24.     int boardHeight = this->height();
  25.    
  26.     b.setStyle(Qt::SolidPattern);
  27.         b.setColor(Qt::yellow);
  28.         p.setBrush(b);
  29.         p.drawRect(0,0,w-1,h-1);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement