MCPcopy Create free account
hub / github.com/Vector35/debugger / ProcessListWidget

Method ProcessListWidget

ui/attachprocess.cpp:258–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256
257
258ProcessListWidget::ProcessListWidget(QWidget* parent, DbgRef<DebuggerController> controller) :
259 QTableView(parent), m_controller(controller)
260{
261 m_model = new ProcessListModel(this);
262 m_delegate = new ProcessItemDelegate(this);
263 m_filter = new ProcessListFilterProxyModel(this);
264
265 m_filter->setSourceModel(m_model);
266 setModel(m_filter);
267 setItemDelegate(m_delegate);
268
269 setShowGrid(false);
270 setSortingEnabled(true);
271
272 horizontalHeader()->setStretchLastSection(true);
273 horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
274 horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
275
276 verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
277 verticalHeader()->setVisible(false);
278
279 setEditTriggers(QAbstractItemView::NoEditTriggers);
280 setSelectionBehavior(QAbstractItemView::SelectRows);
281 setSelectionMode(QAbstractItemView::SingleSelection);
282
283 setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
284 setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
285 setAutoScroll(false);
286
287 resizeColumnsToContents();
288 resizeRowsToContents();
289
290 m_actionHandler.setupActionHandler(this);
291 m_contextMenuManager = new ContextMenuManager(this);
292 m_menu = new Menu();
293
294 QString actionName = QString::fromStdString("Refresh");
295 UIAction::registerAction(actionName);
296 m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST);
297 m_actionHandler.bindAction(actionName, UIAction([=]() { updateContent(); }));
298
299 // TODO: context menu copy
300
301 updateContent();
302}
303
304
305ProcessListWidget::~ProcessListWidget(){}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected