QTfrontend/chatwidget.cpp
changeset 1516 bb9fa5809c49
parent 1457 44cc464de8f3
child 1520 f72f538eba05
equal deleted inserted replaced
1515:0cf2edcfdd8f 1516:bb9fa5809c49
    61   chatEditLine->clear();
    61   chatEditLine->clear();
    62 }
    62 }
    63 
    63 
    64 void HWChatWidget::onChatString(const QString& str)
    64 void HWChatWidget::onChatString(const QString& str)
    65 {
    65 {
    66   QListWidget* w = chatText;
    66 	QListWidget* w = chatText;
    67   w->addItem(str);
    67 	
    68   w->scrollToBottom();
    68 	if (w->count() > 250)
    69   w->setSelectionMode(QAbstractItemView::NoSelection);
    69 		delete w->item(0);
       
    70 
       
    71 	w->addItem(str);
       
    72 	w->scrollToBottom();
       
    73 	w->setSelectionMode(QAbstractItemView::NoSelection);
    70 }
    74 }
    71 
    75 
    72 void HWChatWidget::nickAdded(const QString& nick)
    76 void HWChatWidget::nickAdded(const QString& nick)
    73 {
    77 {
    74 	QListWidgetItem * item = new QListWidgetItem(nick);
    78 	QListWidgetItem * item = new QListWidgetItem(nick);