|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
The top-level window – a QMainWindow hosting the QML UI in a QQuickWidget. More...
#include <mainwindow.h>
Public Member Functions | |
| MainWindow (QWidget *parent=nullptr) | |
| < The live save controller. | |
| virtual | ~MainWindow () |
| bool | saveShot (const QString &path) |
| DEBUG: render the live QML view to an image file (focus/occlusion-independent). | |
| bool | debugOpenPartyDetails (int index) |
DEBUG: open the details editor for party mon index (drives the QML AppWindow.debugOpenPartyDetails). | |
| QObject * | qmlRootObject () |
| DEBUG: the root QML object of the hosted view (for the debug control server's object lookups). | |
| void | reloadQml () |
| DEBUG (–hot): clear the QML cache and reload the view from the source files on disk (live QML refresh). | |
| protected::void | fileChanged () |
| The live save was replaced. | |
Static Public Member Functions | |
| static MainWindow * | getInstance () |
| The single MainWindow instance. | |
Public Attributes | |
| FileManagement * | file = nullptr |
| QShortcut * | recentFileShortcuts [5] |
| Ctrl+1..5 open-recent shortcuts. | |
| QHash< QString, QShortcut * > | otherShortcuts |
| Other global keyboard shortcuts by name. | |
Static Public Attributes | |
| static Bridge * | bridge = nullptr |
| The brg aggregate (created here, injected into QML). | |
| static QQmlEngine * | engine = nullptr |
| The QML engine behind the hosted QQuickWidget. | |
The top-level window – a QMainWindow hosting the QML UI in a QQuickWidget.
Created last in the boot sequence (createApp()), it is where C++ meets QML at runtime: it constructs the bridge, registers the image providers, and injects brg into the QML engine (injectIntoQML()). It also owns the live file (FileManagement), wires global keyboard otherShortcuts and the recent-file shortcuts, and persists window state across runs.
Definition at line 51 of file mainwindow.h.
| MainWindow::MainWindow | ( | QWidget * | parent = nullptr | ) |
< The live save controller.
Definition at line 87 of file mainwindow.cpp.
References file.
Referenced by fileChanged(), and getInstance().
|
virtual |
Definition at line 152 of file mainwindow.cpp.
References file, MAX_RECENT_FILES, otherShortcuts, and recentFileShortcuts.
| bool MainWindow::debugOpenPartyDetails | ( | int | index | ) |
DEBUG: open the details editor for party mon index (drives the QML AppWindow.debugOpenPartyDetails).
Backs –screen pokemonDetails.
Definition at line 184 of file mainwindow.cpp.
Referenced by reloadQml().
| protected::void MainWindow::fileChanged | ( | ) |
The live save was replaced.
References MainWindow().
|
static |
The single MainWindow instance.
Definition at line 167 of file mainwindow.cpp.
References MainWindow().
| QObject * MainWindow::qmlRootObject | ( | ) |
DEBUG: the root QML object of the hosted view (for the debug control server's object lookups).
Definition at line 199 of file mainwindow.cpp.
| void MainWindow::reloadQml | ( | ) |
DEBUG (–hot): clear the QML cache and reload the view from the source files on disk (live QML refresh).
C++ state (the Bridge/save) survives; QML re-instantiates. Restores the screen you were on afterwards (full-tree reload otherwise dumps you at Home + the New File modal) – see the implementation for why partial reload is deliberately not attempted.
Definition at line 236 of file mainwindow.cpp.
References bridge, Router::changeScreen(), Router::closeScreen(), debugOpenPartyDetails(), engine, Bridge::router, Router::screens, and Router::stack.
| bool MainWindow::saveShot | ( | const QString & | path | ) |
DEBUG: render the live QML view to an image file (focus/occlusion-independent).
Backs the –shot debug launch flag.
Definition at line 176 of file mainwindow.cpp.
|
static |
The brg aggregate (created here, injected into QML).
Definition at line 62 of file mainwindow.h.
Referenced by reloadQml().
|
static |
The QML engine behind the hosted QQuickWidget.
Definition at line 63 of file mainwindow.h.
Referenced by reloadQml().
| FileManagement* MainWindow::file = nullptr |
Definition at line 85 of file mainwindow.h.
Referenced by MainWindow(), and ~MainWindow().
| QHash<QString, QShortcut*> MainWindow::otherShortcuts |
Other global keyboard shortcuts by name.
Definition at line 89 of file mainwindow.h.
Referenced by ~MainWindow().
| QShortcut* MainWindow::recentFileShortcuts[5] |
Ctrl+1..5 open-recent shortcuts.
Definition at line 88 of file mainwindow.h.
Referenced by ~MainWindow().