mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fixed uninstalling redirection from python console
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8498 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
05c7ae30b3
commit
be58c264cf
@ -17,6 +17,8 @@
|
||||
#include "qgspythondialog.h"
|
||||
#include "qgspythonutils.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
|
||||
QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
@ -28,7 +30,6 @@ QgsPythonDialog::QgsPythonDialog(QgisInterface* pIface, QWidget *parent)
|
||||
|
||||
QgsPythonDialog::~QgsPythonDialog()
|
||||
{
|
||||
QgsPythonUtils::uninstallConsoleHooks();
|
||||
}
|
||||
|
||||
QString QgsPythonDialog::escapeHtml(QString text)
|
||||
@ -72,3 +73,10 @@ void QgsPythonDialog::on_edtCmdLine_returnPressed()
|
||||
txtHistory->moveCursor(QTextCursor::End);
|
||||
txtHistory->ensureCursorVisible();
|
||||
}
|
||||
|
||||
void QgsPythonDialog::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
QgsPythonUtils::uninstallConsoleHooks();
|
||||
|
||||
QDialog::closeEvent(event);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "ui_qgspythondialog.h"
|
||||
|
||||
class QgisInterface;
|
||||
class QCloseEvent;
|
||||
|
||||
class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog
|
||||
{
|
||||
@ -36,6 +37,10 @@ class QgsPythonDialog : public QDialog, private Ui::QgsPythonDialog
|
||||
|
||||
void on_edtCmdLine_returnPressed();
|
||||
|
||||
protected:
|
||||
|
||||
void closeEvent(QCloseEvent* event);
|
||||
|
||||
private:
|
||||
|
||||
QgisInterface* mIface;
|
||||
|
@ -150,10 +150,6 @@ void QgsPythonUtils::uninstallConsoleHooks()
|
||||
{
|
||||
runString("sys.displayhook = sys.__displayhook__");
|
||||
runString("sys.stdout = _old_stdout");
|
||||
|
||||
// TODO: uninstalling stdout redirection doesn't work
|
||||
|
||||
//installErrorHook();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user