|
pure-cpp 1.0.0
A C++ physics simulation benchmark comparing performance with Python implementations
|
Bridge class to expose C++ functionality to QML. More...
#include <qml_bridge.hpp>


Public Slots | |
| void | showAbout () |
| Slot to display the "About" dialogue. More... | |
| void | showAboutQt () |
| Slot to display the "About Qt" dialogue. More... | |
| void | quit () |
| Slot to quit the application. More... | |
Public Member Functions | |
| QmlBridge (const Configuration::SimulationConfig &config, QObject *parent=nullptr) | |
| Constructs the QML bridge. More... | |
| ~QmlBridge () override | |
| Destructor. More... | |
| QWidget * | displayContainer () const |
| Gets the widget container for the 3D display. More... | |
| QString | aboutText () const |
| Gets the "About" page text. More... | |
| Q_INVOKABLE void | startSimulation () |
| Starts the simulation after the window is shown. More... | |
| Q_INVOKABLE void | cleanup () |
| Triggers cleanup of child components (stops threads, prints reports). More... | |
| void | releaseDisplay () |
| Releases the Display (destroys it manually). This must be called before the container is destroyed to avoid segfaults when the container tries to access the Display during destruction. More... | |
| void | releaseDisplayDeferred (QWidget *container_for_deferred_delete) |
| Releases the Display using deferred destruction. More... | |
Properties | |
| QWidget * | displayContainer |
| QString | aboutText |
Private Member Functions | |
| std::optional< QString > | loadAboutText () |
| Loads the "About" page content from resources. More... | |
Private Attributes | |
| std::unique_ptr< Display > | display_ |
| The 3D display view for the simulation. More... | |
| QWidget * | container_ |
| The widget container for the 3D display. More... | |
| QString | aboutText_ |
| The cached about text. More... | |
Bridge class to expose C++ functionality to QML.
This class acts as an interface between QML and the C++ backend, exposing the Display widget and application actions (About, Quit).
Definition at line 44 of file qml_bridge.hpp.
|
explicit |
Constructs the QML bridge.
| config | The simulation configuration object. |
| parent | The parent QObject. |
Definition at line 33 of file qml_bridge.cpp.

|
override |
Destructor.
Definition at line 66 of file qml_bridge.cpp.
| QString Window::QmlBridge::aboutText | ( | ) | const |
Gets the "About" page text.
Definition at line 75 of file qml_bridge.cpp.
| void Window::QmlBridge::cleanup | ( | ) |
Triggers cleanup of child components (stops threads, prints reports).
Definition at line 83 of file qml_bridge.cpp.
| QWidget * Window::QmlBridge::displayContainer | ( | ) | const |
Gets the widget container for the 3D display.
Definition at line 73 of file qml_bridge.cpp.
|
private |
Loads the "About" page content from resources.
std::nullopt if loading fails. Definition at line 131 of file qml_bridge.cpp.

|
slot |
Slot to quit the application.
Definition at line 129 of file qml_bridge.cpp.

| void Window::QmlBridge::releaseDisplay | ( | ) |
Releases the Display (destroys it manually). This must be called before the container is destroyed to avoid segfaults when the container tries to access the Display during destruction.
Definition at line 91 of file qml_bridge.cpp.
| void Window::QmlBridge::releaseDisplayDeferred | ( | QWidget * | container_for_deferred_delete | ) |
Releases the Display using deferred destruction.
This schedules destruction with deleteLater() to avoid blocking the caller during heavy Qt3D teardown. If a container is provided, its deletion is chained to Display destruction, guaranteeing that Display is destroyed first.
Definition at line 100 of file qml_bridge.cpp.
|
slot |
Slot to display the "About" dialogue.
Definition at line 119 of file qml_bridge.cpp.

|
slot |
Slot to display the "About Qt" dialogue.
Definition at line 125 of file qml_bridge.cpp.

| void Window::QmlBridge::startSimulation | ( | ) |
Starts the simulation after the window is shown.
Definition at line 77 of file qml_bridge.cpp.
|
private |
The cached about text.
Definition at line 149 of file qml_bridge.hpp.
|
private |
The widget container for the 3D display.
Definition at line 146 of file qml_bridge.hpp.
|
private |
The 3D display view for the simulation.
Definition at line 143 of file qml_bridge.hpp.
|
read |
Definition at line 1 of file qml_bridge.hpp.
|
read |
Definition at line 1 of file qml_bridge.hpp.