Messagelib

templatesinsertcommandaction.cpp
1/*
2 SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "templatesinsertcommandaction.h"
8
9#include <QMenu>
10
11using namespace TemplateParser;
12
13TemplatesInsertCommandAction::TemplatesInsertCommandAction(QObject *parent)
14 : QWidgetAction(parent)
15 , mMenuCommand(new TemplatesCommandMenu(this))
16{
17 mMenuCommand->fillMenu();
18 mMenuCommand->fillSubMenus();
19 mMenuCommand->setObjectName(QLatin1StringView("templatescommandmenu"));
20 connect(mMenuCommand, qOverload<const QString &, int>(&TemplatesCommandMenu::insertCommand), this, &TemplatesInsertCommandAction::insertCommand);
21 setMenu(mMenuCommand->menu());
22}
23
24TemplatesInsertCommandAction::~TemplatesInsertCommandAction() = default;
25
26TemplatesCommandMenu::MenuTypes TemplatesInsertCommandAction::type() const
27{
28 return mMenuCommand->type();
29}
30
31void TemplatesInsertCommandAction::setType(TemplatesCommandMenu::MenuTypes type)
32{
33 mMenuCommand->setType(type);
34 setMenu(mMenuCommand->menu());
35}
36
37#include "moc_templatesinsertcommandaction.cpp"
The TemplatesCommandMenu class.
void setMenu(QMenu *menu)
void setObjectName(QAnyStringView name)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.