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

Method PathMappingsWidget

kdevplatform/debugger/util/pathmappings.cpp:199–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197
198
199PathMappingsWidget::PathMappingsWidget(QWidget* parent): QWidget(parent)
200{
201 auto *verticalLayout = new QVBoxLayout(this);
202
203 m_pathMappingTable = new QTableView(this);
204 m_pathMappingTable->setSelectionBehavior(QAbstractItemView::SelectRows);
205 m_pathMappingTable->horizontalHeader()->setDefaultSectionSize(150);
206 m_pathMappingTable->horizontalHeader()->setStretchLastSection(true);
207
208 verticalLayout->addWidget(m_pathMappingTable);
209
210 m_pathMappingTable->setModel(new PathMappingModel());
211 connect(m_pathMappingTable->model(), &QAbstractItemModel::dataChanged, this, &PathMappingsWidget::changed);
212 connect(m_pathMappingTable->model(), &QAbstractItemModel::rowsRemoved, this, &PathMappingsWidget::changed);
213 connect(m_pathMappingTable->model(), &QAbstractItemModel::rowsInserted, this, &PathMappingsWidget::changed);
214
215 auto* deletePath = new QAction(
216 QIcon::fromTheme(QStringLiteral("edit-delete")),
217 i18n( "Delete" ),
218 this
219 );
220 connect(deletePath, &QAction::triggered, this, &PathMappingsWidget::deletePath);
221 deletePath->setShortcut(Qt::Key_Delete);
222 deletePath->setShortcutContext(Qt::WidgetWithChildrenShortcut);
223 m_pathMappingTable->addAction(deletePath);
224
225}
226
227void PathMappingsWidget::deletePath()
228{

Callers

nothing calls this directly

Calls 4

addWidgetMethod · 0.45
setModelMethod · 0.45
modelMethod · 0.45
addActionMethod · 0.45

Tested by

no test coverage detected