Skip to content

Commit be58c26

Browse files
author
wonder
committedMay 23, 2008

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed
 

‎src/app/qgspythondialog.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "qgspythondialog.h"
1818
#include "qgspythonutils.h"
1919

20+
#include <QCloseEvent>
21+
2022
QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)
2123
: QDialog(parent)
2224
{
@@ -28,7 +30,6 @@ QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)
2830

2931
QgsPythonDialog::~QgsPythonDialog()
3032
{
31-
QgsPythonUtils::uninstallConsoleHooks();
3233
}
3334

3435
QString QgsPythonDialog::escapeHtml(QString text)
@@ -72,3 +73,10 @@ void QgsPythonDialog::on_edtCmdLine_returnPressed()
7273
txtHistory->moveCursor(QTextCursor::End);
7374
txtHistory->ensureCursorVisible();
7475
}
76+
77+
void QgsPythonDialog::closeEvent(QCloseEvent* event)
78+
{
79+
QgsPythonUtils::uninstallConsoleHooks();
80+
81+
QDialog::closeEvent(event);
82+
}

‎src/app/qgspythondialog.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "ui_qgspythondialog.h"
2121

2222
class QgisInterface;
23+
class QCloseEvent;
2324

2425
class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog
2526
{
@@ -36,6 +37,10 @@ class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog
3637

3738
void on_edtCmdLine_returnPressed();
3839

40+
protected:
41+
42+
void closeEvent(QCloseEvent* event);
43+
3944
private:
4045

4146
QgisInterface* mIface;

‎src/app/qgspythonutils.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ void QgsPythonUtils::uninstallConsoleHooks()
150150
{
151151
runString("sys.displayhook = sys.__displayhook__");
152152
runString("sys.stdout = _old_stdout");
153-
154-
// TODO: uninstalling stdout redirection doesn't work
155-
156-
//installErrorHook();
157153
}
158154

159155

0 commit comments

Comments
 (0)
Please sign in to comment.