15 #include <ctkAbstractPythonManager.h> 16 #include <QDragEnterEvent> 25 struct QmitkCtkPythonShellData
32 : ctkPythonConsole(parent), d( new QmitkCtkPythonShellData )
34 this->setWelcomeTextColor(Qt::green);
35 this->setPromptColor(Qt::gray);
36 this->setStdinTextColor(Qt::white);
37 this->setCommandTextColor(Qt::white);
38 this->setOutputTextColor(Qt::white);
40 MITK_DEBUG(
"QmitkCtkPythonShell") <<
"retrieving IPythonService";
45 MITK_DEBUG(
"QmitkCtkPythonShell") <<
"checking IPythonService";
46 Q_ASSERT( d->m_PythonService );
48 MITK_DEBUG(
"QmitkCtkPythonShell") <<
"initialize m_PythonService";
49 this->initialize( d->m_PythonService->GetPythonManager() );
51 MITK_DEBUG(
"QmitkCtkPythonShell") <<
"m_PythonService initialized";
58 context->UngetService( d->m_PythonServiceRef );
68 QList<QUrl> urls =
event->mimeData()->urls();
69 for(
int i = 0; i < urls.size(); i++)
82 MITK_DEBUG(
"QmitkCtkPythonShell") <<
"executing command " << command.toStdString();
84 d->m_PythonService->NotifyObserver(command.toStdString());
89 if( this->isVisible() )
91 this->exec( command );
~QmitkCtkPythonShell() override
void dropEvent(QDropEvent *event) override
static const int MULTI_LINE_COMMAND
void dragEnterEvent(QDragEnterEvent *event) override
void executeCommand(const QString &command) override
static const int SINGLE_LINE_COMMAND
QmitkCtkPythonShell(QWidget *parent=nullptr)
bool canInsertFromMimeData(const QMimeData *source) const
static std::string ForceLoadModule()
void Paste(const QString &command)
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.