|
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 | shutdownSimulation () |
| Stops the physics thread and prints profiling reports. More... | |
| void | releaseDisplayDeferred (QWidget *container_for_deferred_delete) |
| Schedules deferred destruction of Display and its container. More... | |
| void | releaseDisplayStrict (QWidget *container) |
| Synchronously destroys the display container and its window. More... | |
Properties | |
| QWidget * | displayContainer |
| QString | aboutText |
Private Member Functions | |
| std::optional< QString > | loadAboutText () |
| Loads the "About" page content from resources. More... | |
Private Attributes | |
| QPointer< Display > | display_ |
| The 3D display view for the simulation. More... | |
| QPointer< QWidget > | container_ |
| The widget container for the 3D display. More... | |
| QString | aboutText_ |
| The cached about text. More... | |
| bool | uiReleased_ = false |
| True after UI resources have been released. 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 |
| QString Window::QmlBridge::aboutText | ( | ) | const |
Gets the "About" page text.
Definition at line 76 of file qml_bridge.cpp.
| QWidget * Window::QmlBridge::displayContainer | ( | ) | const |
Gets the widget container for the 3D display.
Definition at line 74 of file qml_bridge.cpp.
|
private |
Loads the "About" page content from resources.
std::nullopt if loading fails. Definition at line 139 of file qml_bridge.cpp.

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

| void Window::QmlBridge::releaseDisplayDeferred | ( | QWidget * | container_for_deferred_delete | ) |
Schedules deferred destruction of Display and its container.
Used in fast cleanup mode (benchmark-friendly, similar to async Python GC). Display is destroyed first; the container follows via a queued connection.
Definition at line 90 of file qml_bridge.cpp.
| void Window::QmlBridge::releaseDisplayStrict | ( | QWidget * | container | ) |
Synchronously destroys the display container and its window.
Used in strict cleanup mode (Valgrind and conservative teardown).
Definition at line 116 of file qml_bridge.cpp.

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

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

| void Window::QmlBridge::shutdownSimulation | ( | ) |
Stops the physics thread and prints profiling reports.
UI teardown is handled separately by releaseDisplayDeferred() or releaseDisplayStrict(), depending on –cleanup-mode.
Definition at line 84 of file qml_bridge.cpp.

| void Window::QmlBridge::startSimulation | ( | ) |
Starts the simulation after the window is shown.
Definition at line 78 of file qml_bridge.cpp.
|
private |
The cached about text.
Definition at line 152 of file qml_bridge.hpp.
|
private |
The widget container for the 3D display.
Definition at line 149 of file qml_bridge.hpp.
|
private |
The 3D display view for the simulation.
Definition at line 146 of file qml_bridge.hpp.
|
private |
True after UI resources have been released.
Definition at line 155 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.