diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-05-12 15:18:32 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2010-05-12 15:35:12 +0200 |
commit | 51bfaa4c831bf018cad832dfd1b05c6b9418cf78 (patch) | |
tree | a791c2278a95403644e96cc9c5de7fd97b6fd124 /src/shared/qrceditor | |
parent | 9ab420d1d72dff54dfd210616aa7af0aed0df158 (diff) | |
download | qt-creator-51bfaa4c831bf018cad832dfd1b05c6b9418cf78.tar.gz |
Fixed handling of selection dragging in resource editor
When dragging the mouse to select an item that is not currently visible,
the ResourceView was not making the selected item visible. This was due
to an unnecessary reimplementation the protected currentChanged slot.
Reviewed-by: owolff
Diffstat (limited to 'src/shared/qrceditor')
-rw-r--r-- | src/shared/qrceditor/qrceditor.cpp | 3 | ||||
-rw-r--r-- | src/shared/qrceditor/resourceview.cpp | 7 | ||||
-rw-r--r-- | src/shared/qrceditor/resourceview.h | 4 |
3 files changed, 2 insertions, 12 deletions
diff --git a/src/shared/qrceditor/qrceditor.cpp b/src/shared/qrceditor/qrceditor.cpp index ecb0efde45..693faf54c6 100644 --- a/src/shared/qrceditor/qrceditor.cpp +++ b/src/shared/qrceditor/qrceditor.cpp @@ -61,7 +61,8 @@ QrcEditor::QrcEditor(QWidget *parent) connect(m_treeview, SIGNAL(addPrefixTriggered()), this, SLOT(onAddPrefix())); connect(m_treeview, SIGNAL(addFilesTriggered(QString)), this, SLOT(onAddFiles())); connect(m_treeview, SIGNAL(removeItem()), this, SLOT(onRemove())); - connect(m_treeview, SIGNAL(currentIndexChanged()), this, SLOT(updateCurrent())); + connect(m_treeview->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(updateCurrent())); connect(m_treeview, SIGNAL(dirtyChanged(bool)), this, SIGNAL(dirtyChanged(bool))); m_treeview->setFocus(); diff --git a/src/shared/qrceditor/resourceview.cpp b/src/shared/qrceditor/resourceview.cpp index d0b077cc92..814d044c9b 100644 --- a/src/shared/qrceditor/resourceview.cpp +++ b/src/shared/qrceditor/resourceview.cpp @@ -203,13 +203,6 @@ ResourceView::~ResourceView() { } -void ResourceView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) -{ - Q_UNUSED(current) - Q_UNUSED(previous) - emit currentIndexChanged(); -} - bool ResourceView::isDirty() const { return m_qrcModel->dirty(); diff --git a/src/shared/qrceditor/resourceview.h b/src/shared/qrceditor/resourceview.h index a0da7df597..2e44da25a7 100644 --- a/src/shared/qrceditor/resourceview.h +++ b/src/shared/qrceditor/resourceview.h @@ -139,14 +139,10 @@ protected: signals: void removeItem(); void dirtyChanged(bool b); - void currentIndexChanged(); void addFilesTriggered(const QString &prefix); void addPrefixTriggered(); -protected slots: - void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); - private slots: void onEditAlias(); void onEditPrefix(); |