Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kitemlistcontroller.cpp
Context not available. | |||||
1389 | } | 1389 | } | ||
---|---|---|---|---|---|
1390 | 1390 | | |||
1391 | if (button & Qt::LeftButton) { | 1391 | if (button & Qt::LeftButton) { | ||
1392 | bool emitItemActivated = true; | | |||
1393 | if (m_view->isAboveExpansionToggle(index, pos)) { | 1392 | if (m_view->isAboveExpansionToggle(index, pos)) { | ||
1394 | const bool expanded = m_model->isExpanded(index); | 1393 | const bool expanded = m_model->isExpanded(index); | ||
1395 | m_model->setExpanded(index, !expanded); | 1394 | m_model->setExpanded(index, !expanded); | ||
1396 | 1395 | | |||
1397 | emit itemExpansionToggleClicked(index); | 1396 | emit itemExpansionToggleClicked(index); | ||
1398 | emitItemActivated = false; | 1397 | } else if ( | ||
1399 | } else if (shiftOrControlPressed) { | 1398 | !shiftOrControlPressed && ( | ||
1400 | // The mouse click should only update the selection, not trigger the item | 1399 | m_view->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) || | ||
1401 | emitItemActivated = false; | 1400 | m_singleClickActivationEnforced | ||
1402 | } else if (!(m_view->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) || m_singleClickActivationEnforced)) { | 1401 | ) | ||
1403 | emitItemActivated = false; | 1402 | ) { | ||
1404 | } | | |||
1405 | if (emitItemActivated) { | | |||
1406 | emit itemActivated(index); | 1403 | emit itemActivated(index); | ||
1407 | } | 1404 | } | ||
1408 | } else if (button & Qt::MidButton) { | 1405 | } else if (button & Qt::MidButton) { | ||
Context not available. |