Limited log window size
This commit is contained in:
parent
c5fbe764a6
commit
6a23b6a4ae
@ -46,6 +46,11 @@ void NeuroUI::on_runButton_clicked()
|
|||||||
|
|
||||||
void NeuroUI::logMessage(const QString &logMessage)
|
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->addItem(logMessage);
|
||||||
ui->logView->scrollToBottom();
|
ui->logView->scrollToBottom();
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ class NeuroUI : public QMainWindow
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<NetLearner> m_netLearner;
|
std::unique_ptr<NetLearner> m_netLearner;
|
||||||
|
size_t m_logSize = 128;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NeuroUI(QWidget *parent = 0);
|
explicit NeuroUI(QWidget *parent = 0);
|
||||||
|
Reference in New Issue
Block a user