added words and message

This commit is contained in:
fourtf
2017-01-05 16:07:20 +01:00
parent 7a7b714e78
commit b7de109335
31 changed files with 679 additions and 31 deletions
+21 -1
View File
@@ -1,10 +1,17 @@
#include "chatwidgetview.h"
#include "QScroller"
#include "QPainter"
ChatWidgetView::ChatWidgetView()
: QWidget(),
scrollbar(this)
scrollbar(this),
m_channel(NULL)
{
auto scroll = QScroller::scroller(this);
scroll->scrollTo(QPointF(0, 100));
m_channel = Channel::getChannel("ian678");
}
void ChatWidgetView::resizeEvent(QResizeEvent *)
@@ -12,3 +19,16 @@ 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;
}