Messagelib

templatesinsertcommandaction.cpp
1 /*
2  SPDX-FileCopyrightText: 2018-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "templatesinsertcommandaction.h"
8 using namespace TemplateParser;
9 
10 TemplatesInsertCommandAction::TemplatesInsertCommandAction(QObject *parent)
11  : QWidgetAction(parent)
12  , mMenuCommand(new TemplatesCommandMenu(this))
13 {
14  mMenuCommand->fillMenu();
15  mMenuCommand->fillSubMenus();
16  mMenuCommand->setObjectName(QStringLiteral("templatescommandmenu"));
17  connect(mMenuCommand, qOverload<const QString &, int>(&TemplatesCommandMenu::insertCommand), this, &TemplatesInsertCommandAction::insertCommand);
18  setMenu(mMenuCommand->menu());
19 }
20 
21 TemplatesInsertCommandAction::~TemplatesInsertCommandAction() = default;
22 
23 TemplatesCommandMenu::MenuTypes TemplatesInsertCommandAction::type() const
24 {
25  return mMenuCommand->type();
26 }
27 
28 void TemplatesInsertCommandAction::setType(TemplatesCommandMenu::MenuTypes type)
29 {
30  mMenuCommand->setType(type);
31  setMenu(mMenuCommand->menu());
32 }
void setObjectName(const QString &name)
The TemplatesCommandMenu class.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.