diff --git a/plugins/gui/src/searchbar/searchcolumndialog.cpp b/plugins/gui/src/searchbar/searchcolumndialog.cpp index fd4539cfce0..d2938b3cd16 100644 --- a/plugins/gui/src/searchbar/searchcolumndialog.cpp +++ b/plugins/gui/src/searchbar/searchcolumndialog.cpp @@ -8,6 +8,7 @@ namespace hal { SearchColumnDialog::SearchColumnDialog(const QStringList& colNames, const QList &selected) : mDisableHandler(false) { + //TODO FIX check logic setWindowTitle("Search in:"); QVBoxLayout* layout = new QVBoxLayout(this); mCheckAllColumns = new QCheckBox("All columns", this); diff --git a/plugins/gui/src/selection_details_widget/selection_details_widget.cpp b/plugins/gui/src/selection_details_widget/selection_details_widget.cpp index 97af128ce51..c2c7474c7d4 100644 --- a/plugins/gui/src/selection_details_widget/selection_details_widget.cpp +++ b/plugins/gui/src/selection_details_widget/selection_details_widget.cpp @@ -94,6 +94,7 @@ namespace hal mSearchbar = new Searchbar(treeViewContainer); mSearchbar->hide(); + mSearchbar->setColumnNames(mSelectionTreeProxyModel->getColumnNames()); containerLayout->addWidget(mSelectionTreeView); containerLayout->addWidget(mSearchbar); @@ -328,7 +329,7 @@ namespace hal { return; } - + SelectionTreeProxyModel* proxy = static_cast(mSelectionTreeView->model()); mSelectionTreeView->setModel(mSelectionTreeProxyModel); if (proxy->isGraphicsBusy()) return; diff --git a/plugins/gui/src/selection_details_widget/tree_navigation/selection_tree_proxy.cpp b/plugins/gui/src/selection_details_widget/tree_navigation/selection_tree_proxy.cpp index 55a21b0aba4..ffc379039fb 100644 --- a/plugins/gui/src/selection_details_widget/tree_navigation/selection_tree_proxy.cpp +++ b/plugins/gui/src/selection_details_widget/tree_navigation/selection_tree_proxy.cpp @@ -14,11 +14,27 @@ namespace hal bool SelectionTreeProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const { - //index to element in source mdoel - const QModelIndex& itemIndex = sourceModel()->index(source_row, 0, source_parent); - - const SelectionTreeItem* sti = static_cast(itemIndex.internalPointer()); - return sti->match(mFilterExpression); + QList columns = mSearchOptions.getColumns(); + if(columns.empty()){ + //iterate over each column + for(int index = 0; index < 3; index++){ + QString entry = sourceModel()->index(source_row, index, source_parent).data().toString(); + if(isMatching(mSearchString, entry)) + { + return true; + } + } + return false; + }else + { + for(int index : columns) + { + QString entry = sourceModel()->index(source_row, index, source_parent).data().toString(); + if(isMatching(mSearchString, entry)) + return true; + } + return false; + } } bool SelectionTreeProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const