Hmmm, for single-click we need to connec to QTreeView::activated

This commit is contained in:
craig
2011-12-22 00:29:42 +00:00
parent a631b2ab9a
commit 20bfa4ecea

View File

@@ -32,6 +32,9 @@
#include <QtGui/QPainter>
#include <QtGui/QAction>
#include <QtGui/QRadialGradient>
#ifdef ENABLE_KDE_SUPPORT
#include <KDE/KGlobalSettings>
#endif
static QPainterPath buildPath(const QRectF &r, double radius)
{
@@ -327,7 +330,11 @@ void ItemView::init(QAction *a1, QAction *a2)
connect(listSearch, SIGNAL(returnPressed()), this, SIGNAL(searchItems()));
connect(listSearch, SIGNAL(textChanged(const QString)), this, SIGNAL(searchItems()));
connect(treeView, SIGNAL(itemsSelected(bool)), this, SIGNAL(itemsSelected(bool)));
// connect(treeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &)));
#ifdef ENABLE_KDE_SUPPORT
if (KGlobalSettings::singleClick()) {
connect(treeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &)));
}
#endif
connect(treeView, SIGNAL(doubleClicked(const QModelIndex &)), this, SIGNAL(doubleClicked(const QModelIndex &)));
connect(treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(itemClicked(const QModelIndex &)));
connect(listView, SIGNAL(itemsSelected(bool)), this, SIGNAL(itemsSelected(bool)));