MCPcopy Create free account
hub / github.com/KDE/kdevelop / selectionChanged

Method selectionChanged

plugins/projectmanagerview/projectbuildsetwidget.cpp:72–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void ProjectBuildSetWidget::selectionChanged()
73{
74 QModelIndexList selectedRows = m_ui->itemView->selectionModel()->selectedRows();
75 qCDebug(PLUGIN_PROJECTMANAGERVIEW) << "checking selectionmodel:" << selectedRows;
76 m_ui->removeItemButton->setEnabled( !selectedRows.isEmpty() );
77 m_ui->addItemButton->setEnabled( !m_view->selectedItems().isEmpty() );
78
79 bool enableUp = selectedRows.count() > 0 && selectedRows.first().row() != 0;
80 bool enableDown = selectedRows.count() > 0 && selectedRows.last().row() != m_ui->itemView->model()->rowCount() - 1;
81 m_ui->upButton->setEnabled( enableUp );
82 m_ui->downButton->setEnabled( enableDown );
83 m_ui->bottomButton->setEnabled( enableDown );
84 m_ui->topButton->setEnabled( enableUp );
85}
86
87ProjectBuildSetWidget::~ProjectBuildSetWidget()
88{

Callers

nothing calls this directly

Calls 9

selectedItemsMethod · 0.80
setEnabledMethod · 0.45
isEmptyMethod · 0.45
countMethod · 0.45
rowMethod · 0.45
firstMethod · 0.45
lastMethod · 0.45
rowCountMethod · 0.45
modelMethod · 0.45

Tested by

no test coverage detected