46 Q_PROPERTY(QWidget* displayContainer READ displayContainer NOTIFY
56 explicit QmlBridge(
const Configuration::SimulationConfig& config,
57 QObject* parent =
nullptr);
68 QWidget* displayContainer()
const;
74 QString aboutText()
const;
Bridge class to expose C++ functionality to QML.
void releaseDisplayStrict(QWidget *container)
Synchronously destroys the display container and its window.
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.
void aboutTextChanged()
Emitted when the about text changes.
QPointer< Display > display_
The 3D display view for the simulation.
void displayContainerChanged()
Emitted when the display container is created.
bool uiReleased_
True after UI resources have been released.
Q_INVOKABLE void shutdownSimulation()
Stops the physics thread and prints profiling reports.
void showAboutQt()
Slot to display the "About Qt" dialogue.
void releaseDisplayDeferred(QWidget *container_for_deferred_delete)
Schedules deferred destruction of Display and its container.
~QmlBridge() override
Destructor.
QPointer< QWidget > container_
The widget container for the 3D display.
void quit()
Slot to quit the application.
void simulationFinished()
Emitted when the simulation finishes.
void showAbout()
Slot to display the "About" dialogue.
Displaying spherical moving bodies.