mirror-chatterino2/chatwidget.cpp
2016-12-29 17:31:07 +01:00

27 lines
533 B
C++

#include "chatwidget.h"
#include "QPainter"
#include "QFont"
#include "QFontDatabase"
ChatWidget::ChatWidget(QWidget *parent)
: QWidget(parent)
{
QFont font("Segoe UI", 15, QFont::Normal, false);
this->font = font;
}
void ChatWidget::paintEvent(QPaintEvent *)
{
QPainter painter (this);
QColor color (255, 0, 0);
painter.setBrush(color);
painter.setPen(color);
painter.setFont(this->font);
painter.drawRect(5, 10, 10, 5);
QString text = "test text";
painter.drawText(20, 20, text);
}