0000826: reading from the python console for using pdb -- code cleanup

This commit is contained in:
wmayer
2013-05-14 15:20:00 +02:00
parent 3f23dbb671
commit e3d0ccba33
4 changed files with 0 additions and 100 deletions

View File

@@ -1417,70 +1417,4 @@ void ConsoleHistory::doScratch( void )
// -----------------------------------------------------
/* TRANSLATOR Gui::PythonInputField */
PythonInputField::PythonInputField(QWidget* parent)
: QWidget(parent)
{
QGridLayout* gridLayout = new QGridLayout(this);
gridLayout->setSpacing(6);
gridLayout->setMargin(9);
editField = new PythonEditor(this);
gridLayout->addWidget(editField, 0, 0, 1, 1);
setFocusProxy(editField);
QHBoxLayout* hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(6);
hboxLayout->setMargin(0);
QSpacerItem* spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
okButton = new QPushButton(this);
hboxLayout->addWidget(okButton);
clearButton = new QPushButton(this);
hboxLayout->addWidget(clearButton);
gridLayout->addLayout(hboxLayout, 1, 0, 1, 1);
this->setWindowTitle(Gui::PythonConsole::tr("Python Input Dialog"));
okButton->setText(tr("OK"));
clearButton->setText(tr("Clear"));
QObject::connect(okButton, SIGNAL(clicked()), this, SIGNAL(textEntered()));
QObject::connect(clearButton, SIGNAL(clicked()), editField, SLOT(clear()));
}
PythonInputField::~PythonInputField()
{
}
QString PythonInputField::getText() const
{
return editField->toPlainText();
}
void PythonInputField::clear()
{
return editField->clear();
}
void PythonInputField::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
this->setWindowTitle(Gui::PythonConsole::tr("Python Input Dialog"));
okButton->setText(tr("OK"));
clearButton->setText(tr("Clear"));
}
else {
QWidget::changeEvent(e);
}
}
void PythonInputField::showEvent(QShowEvent* e)
{
editField->setFocus();
}
#include "moc_PythonConsole.cpp"