Messagelib

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

KDE's Doxygen guidelines are available online.