mirror-chatterino2/chatwidgetview.cpp
2017-01-05 16:07:20 +01:00

35 lines
644 B
C++

#include "chatwidgetview.h"
#include "QScroller"
#include "QPainter"
ChatWidgetView::ChatWidgetView()
: QWidget(),
scrollbar(this),
m_channel(NULL)
{
auto scroll = QScroller::scroller(this);
scroll->scrollTo(QPointF(0, 100));
m_channel = Channel::getChannel("ian678");
}
void ChatWidgetView::resizeEvent(QResizeEvent *)
{
scrollbar.resize(scrollbar.width(), height());
scrollbar.move(width() - scrollbar.width(), 0);
}
void ChatWidgetView::paintEvent(QPaintEvent *)
{
QPainter painter(this);
auto c = channel();
if (c == NULL) return;
auto M = c->getMessagesClone();
delete M;
}