55 explicit QmlBridge(
const Configuration::SimulationConfig& config,
56 QObject* parent =
nullptr);
67 QWidget* displayContainer()
const;
73 QString aboutText()
const;
Bridge class to expose C++ functionality to QML.
QmlBridge(const Configuration::SimulationConfig &config, QObject *parent=nullptr)
Constructs the QML bridge.
Q_INVOKABLE void startSimulation()
Starts the simulation after the window is shown.
std::optional< QString > loadAboutText()
Loads the "About" page content from resources.
QString aboutText_
The cached about text.
QWidget * container_
The widget container for the 3D display.
void aboutTextChanged()
Emitted when the about text changes.
std::unique_ptr< Display > display_
The 3D display view for the simulation.
void displayContainerChanged()
Emitted when the display container is created.
Q_INVOKABLE void cleanup()
Triggers cleanup of child components (stops threads, prints reports).
void showAboutQt()
Slot to display the "About Qt" dialogue.
void releaseDisplayDeferred(QWidget *container_for_deferred_delete)
Releases the Display using deferred destruction.
~QmlBridge() override
Destructor.
void quit()
Slot to quit the application.
void simulationFinished()
Emitted when the simulation finishes.
void showAbout()
Slot to display the "About" dialogue.
void releaseDisplay()
Releases the Display (destroys it manually). This must be called before the container is destroyed to...
Displaying spherical moving bodies.