MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / initUi

Method initUi

src/plugins/debugger/interface/attachinfodialog.cpp:27–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void AttachInfoDialog::initUi()
28{
29 setFixedSize(500, 500);
30 DComboBox *cbBox = new DComboBox(this);
31 cbBox->addItem("gdb");
32 DLineEdit *edit = new DLineEdit(this);
33
34 auto widget = new DWidget(this);
35 auto fLayout = new QFormLayout(widget);
36 fLayout->addRow(new QLabel(tr("debugger:"), this), cbBox);
37 fLayout->addRow(new QLabel(tr("filter:"), this), edit);
38
39 view = new DTableView(this);
40 view->setShowGrid(false);
41 view->setAlternatingRowColors(true);
42 model = new QStandardItemModel(this);
43 model->setHorizontalHeaderLabels({tr("Process Id"), tr("Process Path")});
44 proxy = new QSortFilterProxyModel(this);
45 proxy->setSourceModel(model);
46 proxy->setFilterKeyColumn(1);
47 proxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
48 view->setModel(proxy);
49
50 view->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
51 view->verticalHeader()->hide();
52 view->setEditTriggers(QAbstractItemView::NoEditTriggers);
53 view->setSelectionBehavior(QAbstractItemView::SelectRows);
54 setIcon(QIcon::fromTheme("ide"));
55 insertContent(0, widget);
56 insertContent(1, view);
57
58 connect(edit, &DLineEdit::textChanged, this, [=](const QString &text){
59 proxy->setFilterRegExp(QString(".*%1.*").arg(text));
60 });
61
62 updateProcess();
63}
64
65void AttachInfoDialog::initButton()
66{

Callers

nothing calls this directly

Calls 6

connectFunction · 0.85
addRowMethod · 0.80
QStringClass · 0.50
addItemMethod · 0.45
setModelMethod · 0.45
hideMethod · 0.45

Tested by

no test coverage detected