It's an app that I made through an online course in which I learned the basics of the Qt framework and GUI building. https://git.thepra.dev/thepra/QtCurvesCpp
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
606 B

4 years ago
#include "renderarea.h"
#include <QPainter>
RenderArea::RenderArea(QWidget *parent) :
QWidget{parent},
mBackgroundColour{36,35,35},
mShapeColour{251,250,250}
{
}
QSize RenderArea::minimumSizeHint() const
{
return QSize(100,100);
}
QSize RenderArea::sizeHint() const
{
return QSize(400,200);
}
void RenderArea::paintEvent(QPaintEvent* event)
{
QPainter painter{this};
painter.setBrush(mBackgroundColour);
painter.setRenderHint(QPainter::Antialiasing,true);
painter.setPen(mShapeColour);
painter.drawRect(this->rect());
painter.drawLine(this->rect().topLeft(),this->rect().bottomRight());
}