mostlabs

16/1

May 30th, 2020
323
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "widget.h"
  2. #include "ui_widget.h"
  3.  
  4. Widget::Widget(QWidget *parent)
  5.     : QWidget(parent)
  6.     , ui(new Ui::Widget)
  7. {
  8.     ui->setupUi(this);
  9. }
  10.  
  11. Widget::~Widget()
  12. {
  13.     delete ui;
  14. }
  15.  
  16. void Widget::paintEvent(QPaintEvent *event){
  17.     QPainter paint(this);
  18.   paint.setBrush(QBrush(Qt::yellow,Qt::SolidPattern));
  19.     paint.setPen(QPen(Qt::black, 2));
  20.     paint.drawRect(200,200,300,225);
  21.     paint.setPen(QPen(Qt::black, 2));
  22.     paint.setBrush(QBrush(QColor(20 , 146, 23,181),Qt::SolidPattern));
  23.     QPointF *points = new QPointF[3];
  24.     points[0] = QPointF(350,100);
  25.     points[1] = QPointF(195,200);
  26.     points[2] = QPointF(505,200);
  27.     paint.drawPolygon(points,3);
  28.     paint.setBrush(QBrush(QColor(72 , 164, 255,240),Qt::SolidPattern));
  29.     paint.setPen(QPen(Qt::black, 2));
  30.      paint.drawEllipse(325,130,40,40);
  31.      paint.setBrush(QBrush(QColor(72 , 164, 255,240),Qt::SolidPattern));
  32.        paint.setPen(QPen(Qt::black, 3));
  33.        for(int i=250;i <290 ; i+=20){
  34.        paint.drawRect(i,250,20,20);
  35. }
  36.        paint.setBrush(QBrush(QColor(72 , 164, 255,240),Qt::SolidPattern));
  37.          paint.setPen(QPen(Qt::black, 3));
  38.  for(int i=250;i <290 ; i+=20){
  39.     paint.drawRect(i,270,20,20);
  40. }
  41.     paint.setBrush(QBrush(QColor(72 , 164, 255,240),Qt::SolidPattern));
  42.     paint.setPen(QPen(Qt::black, 3));
  43. for(int i=425;i <450 ; i+=20){
  44.      paint.drawRect(i,250,20,20);
  45.    }
  46. paint.setBrush(QBrush(QColor(72 , 164, 255,240),Qt::SolidPattern));
  47. paint.setPen(QPen(Qt::black, 3));
  48. for(int i=425;i <450 ; i+=20){
  49.  paint.drawRect(i,270,20,20);
  50. }
  51. int a=0;
  52. paint.setBrush(QBrush(QColor(149 , 149, 149,250),Qt::SolidPattern));
  53. paint.setPen(QPen(Qt::black, 3));
  54. for(int i = 0 ; i < 45 ; i+=15){
  55.  
  56.  paint.drawRect(305+a,410-i,100-i,15);
  57.  a+=6;
  58.  
  59. }
  60.  
  61. paint.setBrush(QBrush(QColor(132 , 66, 0,240),Qt::SolidPattern));
  62. paint.setPen(QPen(Qt::black, 3));
  63.  
  64.  
  65.  paint.drawRect(335,310,40,70);
  66.  
  67.  
  68. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×