Skip to content
Snippets Groups Projects
Commit 6d887741 authored by andreas's avatar andreas
Browse files

fix for missing output from PyQt slots in python shell

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2581 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent c4f4373f
Branches
Tags
No related merge requests found
......@@ -22,6 +22,7 @@
Author: Andreas Schenk
*/
#include <QTimer>
#include "output_redirector.hh"
......@@ -49,11 +50,15 @@ void OutputRedirector::Write( String const& str )
}else{
buffer_+=QString::fromStdString(str);
timer_.start();
QTimer::singleShot(0, this, SLOT(Flush()));
}
}
void OutputRedirector::Flush()
{
if(! timer_.isValid()){
return;
}
timer_=QTime();
QString output = buffer_;
buffer_="";
......
......@@ -39,6 +39,7 @@ Q_OBJECT
public:
OutputRedirector();
void Write(const String& str);
public slots:
void Flush();
signals:
void OnOutput(const QString& output);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment