| 62 | section->addLayout(searchLayout); |
| 63 | section->addWidget(_iconView); |
| 64 | section->addWidget(_emptyText); |
| 65 | section->addWidget(selectedText); |
| 66 | } |
| 67 | |
| 68 | T_Icon::~T_Icon() |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | void T_Icon::onSearchEditTextEdit(const QString& searchText) |
| 73 | { |
| 74 | const QString query = searchText.trimmed(); |
| 75 | QStringList names; |
| 76 | if (!query.isEmpty()) |
| 77 | { |
| 78 | for (int index = 1; index < _metaEnum.keyCount(); ++index) |
| 79 | { |
| 80 | const QString name = _metaEnum.key(index); |
| 81 | if (name.contains(query, Qt::CaseInsensitive)) |
| 82 | { |
| 83 | names.append(name); |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | _iconModel->setIsSearchMode(!query.isEmpty()); |
| 88 | _iconModel->setSearchKeyList(names); |
| 89 | _iconView->clearSelection(); |
| 90 | _iconView->scrollToTop(); |
| 91 | const int count = _iconModel->rowCount(); |
nothing calls this directly
no test coverage detected