Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "widgetOfSecondScreen.hpp"
- WidgetOfSecondScreen::WidgetOfSecondScreen(QWidget* pwgt, WidgetOfSecondScreen* pointer) :QWidget(pointer) {
- /**
- * Install the fixed size for one of details of second screen
- */
- this->setFixedSize(pwgt->width(), pwgt->height()/5);
- QPalette plt;
- plt.setColor(this->backgroundRole(), gray);
- this->setPalette(plt);
- this->setAutoFillBackground(true);
- }
- /**
- * Create the event of press of mouse
- */
- void WidgetOfSecondScreen::mousePressEvent(QMouseEvent *pe) {
- Q_UNUSED(pe);
- }
- /**
- * Create the event of paint event
- */
- void WidgetOfSecondScreen::paintEvent(QPaintEvent *pp) {
- Q_UNUSED(pp);
- QPainter painter(this);
- painter.setRenderHint(QPainter::Antialiasing, true);
- painter.setPen(QPen(black, 4, SolidLine));
- painter.setBrush(QBrush(red, SolidPattern));
- painter.drawEllipse(this->width()/10*9/10, this->height()/10*23/10, this->height()/10*55/10, this->height()/10*55/10);
- }
- /*
- * Create the deconstructor
- */
- WidgetOfSecondScreen::~WidgetOfSecondScreen() {
- delete this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement