diff options
Diffstat (limited to 'tools/qmldebugger/expressionquerywidget.cpp')
-rw-r--r-- | tools/qmldebugger/expressionquerywidget.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/tools/qmldebugger/expressionquerywidget.cpp b/tools/qmldebugger/expressionquerywidget.cpp index 53ede3a..f8f5aef 100644 --- a/tools/qmldebugger/expressionquerywidget.cpp +++ b/tools/qmldebugger/expressionquerywidget.cpp @@ -17,28 +17,25 @@ ExpressionQueryWidget::ExpressionQueryWidget(QmlEngineDebug *client, QWidget *pa m_client(client), m_query(0), m_textEdit(new QTextEdit), - m_lineEdit(0), - m_button(0) + m_lineEdit(0) { m_prompt = QLatin1String(">> "); QVBoxLayout *layout = new QVBoxLayout(this); layout->setMargin(0); + layout->setSpacing(0); layout->addWidget(m_textEdit); updateTitle(); if (m_style == Compact) { - QHBoxLayout *hbox = new QHBoxLayout; - m_button = new QPushButton(tr("Query")); - m_button->setEnabled(false); - connect(m_button, SIGNAL(clicked()), SLOT(executeExpression())); m_lineEdit = new QLineEdit; connect(m_lineEdit, SIGNAL(returnPressed()), SLOT(executeExpression())); - connect(m_lineEdit, SIGNAL(textChanged(QString)), SLOT(lineEditTextChanged(QString))); + QHBoxLayout *hbox = new QHBoxLayout; + hbox->setMargin(5); + hbox->setSpacing(5); hbox->addWidget(new QLabel(tr("Expression:"))); hbox->addWidget(m_lineEdit); - hbox->addWidget(m_button); layout->addLayout(hbox); m_textEdit->setReadOnly(true); @@ -53,6 +50,12 @@ void ExpressionQueryWidget::setEngineDebug(QmlEngineDebug *client) m_client = client; } +void ExpressionQueryWidget::clear() +{ + m_textEdit->clear(); + m_lineEdit->clear(); +} + void ExpressionQueryWidget::updateTitle() { if (m_currObject.debugId() < 0) { @@ -153,12 +156,6 @@ void ExpressionQueryWidget::showResult() } } -void ExpressionQueryWidget::lineEditTextChanged(const QString &s) -{ - if (m_button) - m_button->setEnabled(!s.isEmpty()); -} - bool ExpressionQueryWidget::eventFilter(QObject *obj, QEvent *event) { if (obj == m_textEdit) { |