Advertisement
PlotnikovPhilipp

Untitled

Mar 28th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include "widgetOfSecondScreen.hpp"
  2.  
  3. WidgetOfSecondScreen::WidgetOfSecondScreen(QWidget* pwgt, WidgetOfSecondScreen* pointer) :QWidget(pointer) {
  4.  
  5. /**
  6. * Install the fixed size for one of details of second screen
  7. */
  8.  
  9. this->setFixedSize(pwgt->width(), pwgt->height()/5);
  10. QPalette plt;
  11. plt.setColor(this->backgroundRole(), gray);
  12. this->setPalette(plt);
  13. this->setAutoFillBackground(true);
  14. }
  15.  
  16. /**
  17. * Create the event of press of mouse
  18. */
  19.  
  20. void WidgetOfSecondScreen::mousePressEvent(QMouseEvent *pe) {
  21. Q_UNUSED(pe);
  22.  
  23. }
  24.  
  25. /**
  26. * Create the event of paint event
  27. */
  28.  
  29. void WidgetOfSecondScreen::paintEvent(QPaintEvent *pp) {
  30. Q_UNUSED(pp);
  31. QPainter painter(this);
  32. painter.setRenderHint(QPainter::Antialiasing, true);
  33. painter.setPen(QPen(black, 4, SolidLine));
  34. painter.setBrush(QBrush(red, SolidPattern));
  35. painter.drawEllipse(this->width()/10*9/10, this->height()/10*23/10, this->height()/10*55/10, this->height()/10*55/10);
  36. }
  37.  
  38. /*
  39. * Create the deconstructor
  40. */
  41.  
  42. WidgetOfSecondScreen::~WidgetOfSecondScreen() {
  43. delete this;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement