Limited log window size

This commit is contained in:
mandlm 2015-11-16 17:49:40 +01:00
parent c5fbe764a6
commit 6a23b6a4ae
2 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,11 @@ void NeuroUI::on_runButton_clicked()
void NeuroUI::logMessage(const QString &logMessage)
{
if (ui->logView->count() == static_cast<int>(m_logSize))
{
delete ui->logView->item(0);
}
ui->logView->addItem(logMessage);
ui->logView->scrollToBottom();
}

View File

@ -17,6 +17,7 @@ class NeuroUI : public QMainWindow
private:
std::unique_ptr<NetLearner> m_netLearner;
size_t m_logSize = 128;
public:
explicit NeuroUI(QWidget *parent = 0);