added words and message
This commit is contained in:
+21
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user