diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 33b09952..51051f72 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include @@ -262,6 +263,8 @@ void RPCConsole::on_lineEdit_returnPressed() history.removeFirst(); // Set pointer to end of history historyPtr = history.size(); + // Scroll console view to end + scrollToEnd(); } } @@ -315,3 +318,9 @@ void RPCConsole::on_openDebugLogfileButton_clicked() { GUIUtil::openDebugLogfile(); } + +void RPCConsole::scrollToEnd() +{ + QScrollBar *scrollbar = ui->messagesWidget->verticalScrollBar(); + scrollbar->setValue(scrollbar->maximum()); +} diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 9c4fab49..0a7b10f4 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -44,7 +44,8 @@ public slots: void setNumBlocks(int count); /** Go forward or back in history */ void browseHistory(int offset); - + /** Scroll console view to end */ + void scrollToEnd(); signals: // For RPC command executor void stopExecutor();