Advertisement
PlotnikovPhilipp

Untitled

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