myStudyMutex(theStudyMutex),
myListener(theListener)
{
- QThread::postEvent(myListener, new QCustomEvent(QAD_PyEditor::SET_WAIT_CURSOR));
+ // san - commented as inefficient: sometimes event is processed significant period of time after this moment
+ //QThread::postEvent(myListener, new QCustomEvent(QAD_PyEditor::SET_WAIT_CURSOR));
}
virtual ~TInitEditorThread(){}
myListener(theListener),
myCommand("")
{
- QThread::postEvent(myListener, new QCustomEvent(QAD_PyEditor::SET_WAIT_CURSOR));
+ //QThread::postEvent(myListener, new QCustomEvent(QAD_PyEditor::SET_WAIT_CURSOR));
}
virtual ~TExecCommandThread() {}
protected:
virtual void run(){
- QThread::postEvent(myListener, new QCustomEvent(QAD_PyEditor::SET_WAIT_CURSOR));
+ //QThread::postEvent(myListener, new QCustomEvent(QAD_PyEditor::SET_WAIT_CURSOR));
int anId = QAD_PyEditor::PYTHON_OK;
if(myCommand != ""){
ThreadLock anEditorLock(myMutex,"TExecCommandThread::anEditorLock");
setFont(myFont);
setTextFormat(QTextEdit::PlainText);
+ // san - This is necessary for troubleless initialization
+ setReadOnly( true );
+ viewport()->setCursor( waitCursor );
+
myInitEditorThread = new TInitEditorThread(myInterp,myStudyMutex,myInitEditorMutex,this);
myExecCommandThread = new TExecCommandThread(myInterp,myStudyMutex,myExecCommandMutex,this);
_buf.append(text(para).remove(0,SIZEPR));
_buf.truncate( _buf.length() - 1 );
setReadOnly( true );
+ viewport()->setCursor( waitCursor );
myExecCommandThread->exec(_buf.latin1());
}
{
setText(myInterp->getbanner().c_str());
_buf.truncate(0);
+ QApplication::restoreOverrideCursor();
break;
}
case SET_WAIT_CURSOR: