pineapple-notepad/editorviewhelper.h

32 lines
749 B
C++

#pragma once
#include <KActionMenu>
#include <QMenu>
class LexerGroupActionMenu : public KActionMenu
{
Q_OBJECT
public:
LexerGroupActionMenu(const QString &text, QChar grp, QObject *parent)
: KActionMenu(text, parent)
{
m_group = nullptr;
m_languageGroup = grp.toLower();
connect(menu(), &QMenu::aboutToShow, this, &LexerGroupActionMenu::slotAboutToShow);
setPopupMode(QToolButton::InstantPopup);
}
static std::list<QChar> groups();
static QString displayName(const QString & lexerName);
signals:
void lexerSelected(const QString lexerName);
private:
QActionGroup *m_group;
QChar m_languageGroup;
public:
void slotAboutToShow();
};