classic fourtf commit
This commit is contained in:
+27
-10
@@ -2,25 +2,42 @@
|
||||
#include "QPainter"
|
||||
#include "QFont"
|
||||
#include "QFontDatabase"
|
||||
#include "QVBoxLayout"
|
||||
#include "colorscheme.h"
|
||||
|
||||
ChatWidget::ChatWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
: QWidget(parent),
|
||||
vbox(this)
|
||||
{
|
||||
QFont font("Segoe UI", 15, QFont::Normal, false);
|
||||
this->font = font;
|
||||
vbox.setSpacing(0);
|
||||
vbox.setMargin(1);
|
||||
|
||||
vbox.addWidget(&header);
|
||||
vbox.addWidget(&view);
|
||||
vbox.addWidget(&input);
|
||||
|
||||
// QFont font("Segoe UI", 15, QFont::Normal, false);
|
||||
// this->font = font;
|
||||
}
|
||||
|
||||
ChatWidget::~ChatWidget()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ChatWidget::paintEvent(QPaintEvent *)
|
||||
{
|
||||
QPainter painter (this);
|
||||
QColor color (255, 0, 0);
|
||||
|
||||
painter.setBrush(color);
|
||||
painter.setPen(color);
|
||||
painter.fillRect(rect(), ColorScheme::getInstance().ChatBackground);
|
||||
|
||||
painter.setFont(this->font);
|
||||
painter.drawRect(5, 10, 10, 5);
|
||||
// QColor color (255, 0, 0);
|
||||
|
||||
QString text = "test text";
|
||||
painter.drawText(20, 20, text);
|
||||
// painter.setPen(color);
|
||||
|
||||
// painter.setFont(this->font);
|
||||
// painter.drawRect(0, 0, width() - 1, height() - 1);
|
||||
|
||||
// QString text = "test text";
|
||||
// painter.drawText(20, 20, text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user