summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nätterlund <tobias.naetterlund.qnx@kdab.com>2013-01-18 14:39:38 +0100
committerTobias Hunger <tobias.hunger@digia.com>2013-01-23 14:37:26 +0100
commit48de21c525fd244503ab42ce24f62311905d9c69 (patch)
treed8799a74287674c39d06fd36b599ab0d16b0377a
parent75f1e8a66ff6f8ab5df294de98803de697808a12 (diff)
downloadqt-creator-48de21c525fd244503ab42ce24f62311905d9c69.tar.gz
QNX: Write data to model when browse is finished
Without this patch, the user was forced to press Enter after browsing for a file, to commit the data to the model. Now, the writing of the data is done immediately after browsing is completed. Change-Id: I3d0966b83c4496145c37b80c9e0b93b513b38ace Reviewed-by: Mehdi Fekari <mfekari@rim.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
-rw-r--r--src/plugins/qnx/pathchooserdelegate.cpp7
-rw-r--r--src/plugins/qnx/pathchooserdelegate.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/qnx/pathchooserdelegate.cpp b/src/plugins/qnx/pathchooserdelegate.cpp
index 248a8dc20d..391e621698 100644
--- a/src/plugins/qnx/pathchooserdelegate.cpp
+++ b/src/plugins/qnx/pathchooserdelegate.cpp
@@ -64,6 +64,8 @@ QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionVi
editor->setAutoFillBackground(true); // To hide the text beneath the editor widget
editor->lineEdit()->setMinimumWidth(0);
+ connect(editor, SIGNAL(browsingFinished()), this, SLOT(emitCommitData()));
+
return editor;
}
@@ -95,3 +97,8 @@ void PathChooserDelegate::updateEditorGeometry(QWidget *editor, const QStyleOpti
editor->setGeometry(option.rect);
}
+
+void PathChooserDelegate::emitCommitData()
+{
+ emit commitData(qobject_cast<QWidget*>(sender()));
+}
diff --git a/src/plugins/qnx/pathchooserdelegate.h b/src/plugins/qnx/pathchooserdelegate.h
index 6db5ce2b03..9ac4ee598b 100644
--- a/src/plugins/qnx/pathchooserdelegate.h
+++ b/src/plugins/qnx/pathchooserdelegate.h
@@ -60,6 +60,9 @@ public:
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &index) const;
+private slots:
+ void emitCommitData();
+
private:
Utils::PathChooser::Kind m_kind;
QString m_filter;