Changeset View
Changeset View
Standalone View
Standalone View
sidepanel.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 36 | { | |||
---|---|---|---|---|---|
44 | m_proxyModel->setSourceModel(m_model); | 44 | m_proxyModel->setSourceModel(m_model); | ||
45 | 45 | | |||
46 | createMenuActions(); | 46 | createMenuActions(); | ||
47 | 47 | | |||
48 | setMouseTracking(true); | 48 | setMouseTracking(true); | ||
49 | setModel(m_proxyModel); | 49 | setModel(m_proxyModel); | ||
50 | // Mind that activated does not include clicked when the system is in | 50 | // Mind that activated does not include clicked when the system is in | ||
51 | // double-click mode https://bugs.kde.org/show_bug.cgi?id=405373 | 51 | // double-click mode https://bugs.kde.org/show_bug.cgi?id=405373 | ||
52 | connect(this,&QAbstractItemView::clicked,this,&SidePanel::clickedSlot); | 52 | connect(this, &QAbstractItemView::clicked, this, &SidePanel::clickedSlot); | ||
53 | connect(this,&QAbstractItemView::activated,this,&SidePanel::clickedSlot); | 53 | connect(this, &QAbstractItemView::activated, this, &SidePanel::clickedSlot); | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | SidePanel::~SidePanel() | 56 | SidePanel::~SidePanel() | ||
57 | { | 57 | { | ||
58 | disconnect(this,&QAbstractItemView::activated,this,&SidePanel::clickedSlot); | | |||
59 | disconnect(this,&QAbstractItemView::clicked,this,&SidePanel::clickedSlot); | | |||
60 | | ||||
61 | delete m_proxyModel; | 58 | delete m_proxyModel; | ||
62 | delete m_model; | 59 | delete m_model; | ||
63 | } | 60 | } | ||
64 | 61 | | |||
65 | void SidePanel::clickedSlot(const QModelIndex &index) | 62 | void SidePanel::clickedSlot(const QModelIndex &index) | ||
66 | { | 63 | { | ||
67 | if(index.isValid() == false) { | 64 | if(index.isValid() == false) { | ||
68 | return; | 65 | return; | ||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |