initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include "Cevo/FormBase.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QPointer>
|
||||
|
||||
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<QObject *> &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<QObject *> m_sourceObjects;
|
||||
QPointer<QWidget> m_mainWindow;
|
||||
};
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user