MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / ~T_TableView

Method ~T_TableView

ElaWidgetToolsExample/ExamplePage/T_TableView.cpp:59–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 resultText->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
58 connect(searchEdit, &ElaLineEdit::textChanged, filterModel, &QSortFilterProxyModel::setFilterFixedString);
59 connect(alternatingCheckBox, &ElaCheckBox::toggled, _tableView, &ElaTableView::setAlternatingRowColors);
60 connect(_tableView->selectionModel(), &QItemSelectionModel::currentRowChanged, this, [resultText](const QModelIndex& current) {
61 resultText->setText(current.isValid() ? QString("当前选择:%1 · %2").arg(current.sibling(current.row(), 1).data().toString(), current.sibling(current.row(), 2).data().toString()) : "点击一行查看选择结果");
62 });
63 section->addLayout(optionsLayout);
64 section->addWidget(_tableView);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected