Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
actiontools.cpp File Reference

The action_list tool: the application's commands (QAction, Qt Quick Controls Action). More...

#include <sonde/guiintegration.h>
#include <sonde/guitools.h>
#include <sonde/objecttree.h>
#include <sonde/schema.h>
#include <QtCore/QJsonArray>
#include <QtCore/QSet>
#include <QtGui/QAction>
#include <QtGui/QKeySequence>
#include <QtGui/QWindow>

Classes

struct  Sonde::anonymous_namespace{actiontools.cpp}::Entry
 One action_list entry: a text line and its JSON. More...

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Functions

QString Sonde::anonymous_namespace{actiontools.cpp}::withoutMnemonic (QString text)
 text without mnemonic markers: "&Save" -> "Save", "R&&D" -> "R&D".
QString Sonde::anonymous_namespace{actiontools.cpp}::stringProperty (const QObject *o, const char *name)
 A property of o as a string ("" if it has none).
bool Sonde::anonymous_namespace{actiontools.cpp}::boolProperty (const QObject *o, const char *name, bool fallback)
 A boolean property of o, or fallback if it has none.
bool Sonde::anonymous_namespace{actiontools.cpp}::isAction (const QObject *o)
 Whether o is an action this tool lists: a QAction (not a separator) or a Qt Quick Controls Action (found by class name, so Quick needn't be linked).
QObjectList Sonde::anonymous_namespace{actiontools.cpp}::allObjects ()
 Every object reachable from the roots, hidden ones included, in breadth-first order.
QString Sonde::anonymous_namespace{actiontools.cpp}::location (const QAction *action)
 Where action is shown: "File > Recent" for menus (from the menus' titles), "toolbar mainToolBar" for tool bars, comma-separated if more than one.
bool Sonde::anonymous_namespace{actiontools.cpp}::isMenuEntry (const QAction *action)
 Whether action is a menu's own entry (QMenu::menuAction(), which opens the menu): QMenu creates it as its own child, with its title as the text.
QWindow * Sonde::anonymous_namespace{actiontools.cpp}::windowOf (QObject *o)
 The window o belongs to: the first of its parents that is, or is shown in, a window (a closed menu isn't, but its menu bar is), or nullptr.
Entry Sonde::anonymous_namespace{actiontools.cpp}::describeAction (QObject *o)
 The entry for o.
bool Sonde::anonymous_namespace{actiontools.cpp}::matches (QObject *o, const QWindow *window, const QString &text)
 Whether o passes the "window" and "text" filters.
ToolResult Sonde::anonymous_namespace{actiontools.cpp}::listActions (const QJsonObject &args)
 The action_list tool.
void Sonde::installActionTools (Server &server)
 Registers action_list: the application's QActions (and Qt Quick Controls Actions) with their menu paths, shortcuts and state.

Variables

constexpr int Sonde::anonymous_namespace{actiontools.cpp}::kMaxVisited = 50000
 Most objects action_list visits (a guard against huge trees).
constexpr qsizetype Sonde::anonymous_namespace{actiontools.cpp}::kMaxListed = 500
 Most actions listed.

Detailed Description

The action_list tool: the application's commands (QAction, Qt Quick Controls Action).