#pragma once #include "Cevo/FormBase.h" #include #include class QObject; QT_BEGIN_NAMESPACE namespace Ui { class FormKeyShortcuts; } QT_END_NAMESPACE namespace Cevo { // Equivalent of FormKeyShortcuts.pas's TFormKeyShortcuts: lists every // QAction found (recursively) under a set of source objects, with its // shortcut, double-click/Enter to trigger it. Column sorting uses // QTreeWidget's native header-click sorting - no ListViewSort port needed. class FormKeyShortcuts : public FormBase { Q_OBJECT public: explicit FormKeyShortcuts(QWidget *parent = nullptr); ~FormKeyShortcuts() override; // Equivalent of LoadFromComponent: objects whose QAction children (found // recursively) should be listed. void setSourceObjects(const QList &objects) { m_sourceObjects = objects; } void setMainWindow(QWidget *window) { m_mainWindow = window; } protected: void showEvent(QShowEvent *event) override; private slots: void onExecuteSelected(); private: void reload(); Ui::FormKeyShortcuts *ui; QList m_sourceObjects; QPointer m_mainWindow; }; } // namespace Cevo