-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #568 from emsec/feature/migrate_selectionmodel_to_…
…modulemodel Feature/migrate selectionmodel to modulemodel
- Loading branch information
Showing
30 changed files
with
414 additions
and
2,755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
.../include/gui/selection_details_widget/module_details_widget/filter_elements_proxy_model.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#pragma once | ||
|
||
#include "gui/gui_utils/sort.h" | ||
|
||
#include <QSortFilterProxyModel> | ||
|
||
namespace hal | ||
{ | ||
/** | ||
* @ingroup gui | ||
* @brief Enables filtering of nets or gates in the ModuleModel. | ||
* | ||
*/ | ||
class FilterElementsProxyModel : public QSortFilterProxyModel | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
/** | ||
* Constructor. | ||
* | ||
* @param parent - The parent widget | ||
*/ | ||
FilterElementsProxyModel(QObject* parent = nullptr); | ||
|
||
/** | ||
* Sets whether or not nets are filtered out by the filter. | ||
* @returns <b>true</b> if nets are filtered out now. <b>false</b> if not. | ||
* @param filterNets if <b>true</b>, then nets are filtered out. | ||
*/ | ||
void setFilterNets(bool filterNets); | ||
|
||
/** | ||
* Sets whether or not gates are filtered out by the filter. | ||
* @returns <b>true</b> if gates are filtered out now. <b>false</b> if not. | ||
* @param filterNets if <b>true</b>, then gates are filtered out. | ||
*/ | ||
void setFilterGates(bool filterGates); | ||
|
||
/** | ||
* Returns whether or not nets are filtered out by the filter. | ||
*/ | ||
bool areNetsFiltered(); | ||
|
||
/** | ||
* Returns whether or not gates are filtered out by the filter. | ||
*/ | ||
bool areGatesFiltered(); | ||
|
||
protected: | ||
/** | ||
* Overrides QSortFilterProxyModel::filterAcceptsRow to implement the filter logic. | ||
* | ||
* @param sourceRow - The row in the source model | ||
* @param sourceParent - The source parent | ||
* @returns <b>true</b> if the row should be included in the model. | ||
*/ | ||
bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override; | ||
|
||
private: | ||
bool mFilterNets; | ||
bool mFilterGates; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.