TemplateParser::TemplatesCommandMenu Class
The TemplatesCommandMenu class Author: Laurent Montel <montel@kde.org>. More...
| Header: | #include <TemplateParser/TemplatesCommandMenu> |
| CMake: | find_package(KPim6TemplateParser REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::TemplateParser) |
| Inherits: | QObject |
Public Functions
| TemplatesCommandMenu(QObject *parent = nullptr) | |
| virtual | ~TemplatesCommandMenu() override |
| void | fillMenu() |
| void | fillSubMenus() |
| QMenu * | menu() const |
| void | setType(TemplateParser::TemplatesCommandMenu::MenuTypes type) |
| TemplateParser::TemplatesCommandMenu::MenuTypes | type() const |
Public Slots
| void | slotInsertCommand(TemplateParser::TemplatesCommandMenu::Command cmd) |
Signals
| void | insertCommand(TemplateParser::TemplatesCommandMenu::Command cmd) |
| void | insertCommand(const QString &cmd, int adjustCursor = 0) |
Detailed Description
Member Function Documentation
[explicit] TemplatesCommandMenu::TemplatesCommandMenu(QObject *parent = nullptr)
Constructor parent parent object
[override virtual noexcept] TemplatesCommandMenu::~TemplatesCommandMenu()
Destructor
void TemplatesCommandMenu::fillMenu()
Fills the menu with commands
void TemplatesCommandMenu::fillSubMenus()
Fills the submenus
[signal] void TemplatesCommandMenu::insertCommand(TemplateParser::TemplatesCommandMenu::Command cmd)
Emitted when a command is inserted cmd command enumeration
Note: This signal is overloaded. To connect to this signal:
// Connect using qOverload:
connect(templatesCommandMenu, qOverload(&TemplatesCommandMenu::insertCommand),
receiver, &ReceiverClass::slot);
// Or using a lambda:
connect(templatesCommandMenu, qOverload(&TemplatesCommandMenu::insertCommand),
this, [](TemplateParser::TemplatesCommandMenu::Command cmd) { /* handle insertCommand */ });
For more examples and approaches, see connecting to overloaded signals.
[signal] void TemplatesCommandMenu::insertCommand(const QString &cmd, int adjustCursor = 0)
Emitted when a command string is inserted cmd command string adjustCursor cursor adjustment value
Note: This signal is overloaded. To connect to this signal:
// Connect using qOverload:
connect(templatesCommandMenu, qOverload(&TemplatesCommandMenu::insertCommand),
receiver, &ReceiverClass::slot);
// Or using a lambda:
connect(templatesCommandMenu, qOverload(&TemplatesCommandMenu::insertCommand),
this, [](const QString &cmd, int adjustCursor) { /* handle insertCommand */ });
For more examples and approaches, see connecting to overloaded signals.
QMenu *TemplatesCommandMenu::menu() const
Returns the menu Returns QMenu pointer
void TemplatesCommandMenu::setType(TemplateParser::TemplatesCommandMenu::MenuTypes type)
Sets the menu types type menu types flags
See also type().
[slot] void TemplatesCommandMenu::slotInsertCommand(TemplateParser::TemplatesCommandMenu::Command cmd)
Slot to insert a command cmd command enumeration
TemplateParser::TemplatesCommandMenu::MenuTypes TemplatesCommandMenu::type() const
Returns the menu types Returns menu types flags
See also setType().