Commit fe1a2e47 authored by Mathieu Westphal's avatar Mathieu Westphal Committed by Kitware Robot
Browse files

Merge topic 'PythonTraceIncrmentalSrollBottom'

727cd9e5

 Scrolling to the bottom of the editor when adding incremental trace
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Acked-by: Nicolas Vuaille's avatarNicolas Vuaille <nicolas.vuaille@kitware.com>
Acked-by: Michael Migliore's avatarMichael Migliore <michael.migliore@kitware.com>
Merge-request: !2925
parents 15455c24 727cd9e5
Pipeline #126517 failed with stage
in 0 seconds
......@@ -174,6 +174,13 @@ void pqTraceReaction::editTrace(const QString& trace, bool incremental)
Q_ASSERT(this->Editor);
this->Editor->setText(trace);
this->Editor->show();
// Scroll to bottom of the editor when addding content in an incremental trace
if (!new_editor && incremental)
{
this->Editor->scrollToBottom();
}
if (new_editor ||
incremental == false) // don't raise the window if we are just updating the trace.
{
......
......@@ -48,6 +48,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QMenu>
#include <QMenuBar>
#include <QMessageBox>
#include <QScrollBar>
#include <QStatusBar>
#include <QTextEdit>
#include <QTextStream>
......@@ -380,3 +381,9 @@ QString pqPythonScriptEditor::strippedName(const QString& fullFileName)
{
return QFileInfo(fullFileName).fileName();
}
//-----------------------------------------------------------------------------
void pqPythonScriptEditor::scrollToBottom()
{
this->TextEdit->verticalScrollBar()->setValue(this->TextEdit->verticalScrollBar()->maximum());
}
......@@ -53,6 +53,11 @@ public:
void setSaveDialogDefaultDirectory(const QString& dir);
void setPythonManager(pqPythonManager* manager);
/*
* Scroll the editor to the bottom of the scroll area
*/
void scrollToBottom();
public slots:
void open(const QString& filename);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment