morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::qt_quick::InspectorWindow Class Reference

A window that shows the focused screen's mounted nodes with their evaluated properties, its queries and mutations with a refetch button each, its command log and the reactive counters. More...

#include <inspector.hpp>

Public Member Functions

 InspectorWindow (InspectFocused focused)
 A hidden inspector window.
 InspectorWindow (InspectorWindow const &)=delete
InspectorWindow & operator= (InspectorWindow const &)=delete
 InspectorWindow (InspectorWindow &&)=delete
InspectorWindow & operator= (InspectorWindow &&)=delete
void attachTo (QQuickWindow &window)
 Makes Ctrl+Shift+I in window show or hide this inspector, whichever item has focus.
void toggle ()
 Shows the window if it is hidden, hides it otherwise.
void hide ()
 Hides the window and stops refreshing it.
bool isVisible () const
 Whether the window is shown.
void refresh ()
 Reads the focused screen again and redraws.
std::string text () const
 What the window shows, as plain text, section by section: what a test reads.
void refetch (std::string const &query)
 What the refetch button of a query does: runs {"refetch": "<query>"} on the focused screen.

Detailed Description

A window that shows the focused screen's mounted nodes with their evaluated properties, its queries and mutations with a refetch button each, its command log and the reactive counters.

It reads the screen through ui::Inspector each time it refreshes, twice a second while it is shown, and keeps nothing of it in between, so a screen that closes or is remounted leaves nothing behind. Its refetch button runs the document's refetch command, as a user's event would. Use it on the GUI thread.

Definition at line 30 of file inspector.hpp.

Constructor & Destructor Documentation

◆ InspectorWindow()

morph::qt_quick::InspectorWindow::InspectorWindow ( InspectFocused focused)
explicit

A hidden inspector window.

Parameters
focusedWhere it finds the focused screen's inspector.

Member Function Documentation

◆ attachTo()

void morph::qt_quick::InspectorWindow::attachTo ( QQuickWindow & window)

Makes Ctrl+Shift+I in window show or hide this inspector, whichever item has focus.

Parameters
windowThe application's window; it outlives the inspector.

◆ isVisible()

bool morph::qt_quick::InspectorWindow::isVisible ( ) const
nodiscard

Whether the window is shown.

Returns
It.

◆ text()

std::string morph::qt_quick::InspectorWindow::text ( ) const
nodiscard

What the window shows, as plain text, section by section: what a test reads.

Returns
The text.

◆ refetch()

void morph::qt_quick::InspectorWindow::refetch ( std::string const & query)

What the refetch button of a query does: runs {"refetch": "<query>"} on the focused screen.

Parameters
queryThe query's name.

The documentation for this class was generated from the following file: