Skip to content
Snippets Groups Projects
Commit 48de21c5 authored by Tobias Nätterlund's avatar Tobias Nätterlund Committed by Tobias Hunger
Browse files

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: default avatarMehdi Fekari <mfekari@rim.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 75f1e8a6
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,8 @@ QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionVi ...@@ -64,6 +64,8 @@ QWidget *PathChooserDelegate::createEditor(QWidget *parent, const QStyleOptionVi
editor->setAutoFillBackground(true); // To hide the text beneath the editor widget editor->setAutoFillBackground(true); // To hide the text beneath the editor widget
editor->lineEdit()->setMinimumWidth(0); editor->lineEdit()->setMinimumWidth(0);
connect(editor, SIGNAL(browsingFinished()), this, SLOT(emitCommitData()));
return editor; return editor;
} }
...@@ -95,3 +97,8 @@ void PathChooserDelegate::updateEditorGeometry(QWidget *editor, const QStyleOpti ...@@ -95,3 +97,8 @@ void PathChooserDelegate::updateEditorGeometry(QWidget *editor, const QStyleOpti
editor->setGeometry(option.rect); editor->setGeometry(option.rect);
} }
void PathChooserDelegate::emitCommitData()
{
emit commitData(qobject_cast<QWidget*>(sender()));
}
...@@ -60,6 +60,9 @@ public: ...@@ -60,6 +60,9 @@ public:
void updateEditorGeometry(QWidget *editor, void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option, const QModelIndex &index) const; const QStyleOptionViewItem &option, const QModelIndex &index) const;
private slots:
void emitCommitData();
private: private:
Utils::PathChooser::Kind m_kind; Utils::PathChooser::Kind m_kind;
QString m_filter; QString m_filter;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment