#include <functional>
+class QCheckBox;
+class QLineEdit;
+class QLabel;
+class QPushButton;
+class QtxFoundActionTree;
+
+
+class QTX_EXPORT QtxFeatureSearchDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ QtxFeatureSearchDialog(QWidget* theParent);
+ QtxFeatureSearchDialog(const QtxFeatureSearchDialog&) = delete;
+ QtxFeatureSearchDialog& operator=(const QtxFeatureSearchDialog&) = delete;
+ virtual ~QtxFeatureSearchDialog() = default;
+
+ void setActiveModuleID(const QString& theModuleID = SUIT_ShortcutMgr::ROOT_MODULE_ID);
+
+private slots:
+ void onQueryChanged(const QString& theKeyword);
+ void onSearchOptionUnavailableActionsChanged(int);
+ void onSearchOptionInactiveModulesChanged(int);
+
+private:
+ void updateUI();
+
+ QLineEdit* myQueryLineEdit;
+ QCheckBox* myIncludeUnavailableActionsCB;
+ QCheckBox* myIncludeInactiveModulesCB;
+ QtxFoundActionTree* myFoundActionsTree;
+
+ QString myActiveModuleID;
+ SUIT_ActionSearcher myActionSearcher;
+};
+
+
class QtxFoundActionTreeItem;
class QtxFoundActionTreeFolder;
class QtxFoundActionTreeAction;;
ToolTip
};
- enum class SortOrder {
- Ascending,
- Descending
- };
-
QtxFoundActionTree();
QtxFoundActionTree(const QtxFoundActionTree&) = delete;
QtxFoundActionTree& operator=(const QtxFoundActionTree&) = delete;
virtual ~QtxFoundActionTree() = default;
- void sort(QtxFoundActionTree::SortKey theKey, QtxFoundActionTree::SortOrder theOrder);
+ void updateItems(const std::map<QString, std::map<QString, SUIT_ActionSearcher::AssetsAndSearchData>>& theAssets);
private:
- void updateItems();
std::pair<QtxFoundActionTreeFolder*, int> findModuleFolderItem(const QString& theModuleID) const;
- std::set<QtxFoundActionTreeItem*, std::function<bool(QtxFoundActionTreeItem*, QtxFoundActionTreeItem*)>> getSortedChildren(QtxFoundActionTreeFolder* theParentItem);
-
- void insertChild(
- QtxFoundActionTreeFolder* theParentItem,
- std::set<QtxFoundActionTreeItem*, std::function<bool(QtxFoundActionTreeItem*, QtxFoundActionTreeItem*)>>& theSortedChildren,
- QtxFoundActionTreeItem* theChildItem
- );
-
private slots:
void onItemDoubleClicked(QTreeWidgetItem* theWidgetItem, int theColIdx);
-
-public:
- static const QList<std::pair<QtxFoundActionTree::SortKey, QtxFoundActionTree::SortOrder>> DEFAULT_SORT_SCHEMA;
-
-private:
- QtxFoundActionTree::SortKey mySortKey;
- QtxFoundActionTree::SortOrder mySortOrder;
};
const QString myInModuleActionID;
};
-
-class QCheckBox;
-class QLineEdit;
-class QLabel;
-class QPushButton;
-
-
-class QTX_EXPORT QtxFeatureSearchDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- QtxFeatureSearchDialog(QWidget* theParent);
- QtxFeatureSearchDialog(const QtxFeatureSearchDialog&) = delete;
- QtxFeatureSearchDialog& operator=(const QtxFeatureSearchDialog&) = delete;
- virtual ~QtxFeatureSearchDialog() = default;
-
- void setActiveModuleID(const QString& theModuleID);
-
-private slots:
- void onQueryChanged(const QString& theKeyword);
- void onSearchOptionUnavailableActionsChanged(Qt::CheckState theState);
- void onSearchOptionInactiveModulesChanged(Qt::CheckState theState);
-
-private:
- void updateUI();
-
- QLineEdit* myQueryLineEdit;
- QCheckBox* myIncludeUnavailableActionsCB;
- QCheckBox* myIncludeInactiveModulesCB;
- QtxFoundActionTree* myFoundActionsTree;
-
- QString myActiveModuleID;
- SUIT_ActionSearcher myActionSearcher;
-};
-
#endif // QTXFEATURESEARCH_H