mirror of https://gitee.com/cxasm/notepad--.git
plugin/template-plugin: 处理 Windows 中一些编译异常的问题
This commit is contained in:
parent
43fd6b0743
commit
9130083e8f
|
@ -1,4 +1,4 @@
|
|||
#include "ndd_plugin_implement.h"
|
||||
#include "ndd_plugin_implement.h"
|
||||
|
||||
#include <qsciscintilla.h>
|
||||
#include <QMenu>
|
||||
|
@ -17,19 +17,19 @@ NddPluginImplement::~NddPluginImplement()
|
|||
|
||||
void NddPluginImplement::setMenuActions(QMenu *menu)
|
||||
{
|
||||
QAction *action1 = menu->addAction("第一项打印");
|
||||
QAction *action1 = menu->addAction(u8"第一项打印");
|
||||
connect(action1, &QAction::triggered, this, [](){
|
||||
// 普通的菜单项
|
||||
qDebug() << "action1";
|
||||
});
|
||||
|
||||
QAction *action2 = menu->addAction("第二项打印");
|
||||
QAction *action2 = menu->addAction(u8"第二项打印");
|
||||
connect(action2, &QAction::triggered, this, [](){
|
||||
// 普通的菜单项
|
||||
qDebug() << "action2";
|
||||
});
|
||||
|
||||
QAction *action3 = menu->addAction("打印默认编辑器内容(源代码项注意)");
|
||||
QAction *action3 = menu->addAction(u8"打印默认编辑器内容(源代码项注意)");
|
||||
connect(action3, &QAction::triggered, this, [=](){
|
||||
// FAQ: 当第一次使用 currentEdit 时,使用时可能会引发错误。
|
||||
// 此时 currentEdit 可能是空的。
|
||||
|
@ -40,14 +40,14 @@ void NddPluginImplement::setMenuActions(QMenu *menu)
|
|||
qDebug() << currentEdit->text();
|
||||
});
|
||||
|
||||
QAction *action4 = menu->addAction("设置当前编辑器为默认");
|
||||
QAction *action4 = menu->addAction(u8"设置当前编辑器为默认");
|
||||
connect(action4, &QAction::triggered, this, [=](){
|
||||
// 获取当前编辑器,并作为当前默认编辑器
|
||||
currentEdit = getCurrentEditFunc();
|
||||
qDebug() << "设置完成";
|
||||
qDebug() << u8"设置完成";
|
||||
});
|
||||
|
||||
QAction *action5 = menu->addAction("打印当前编辑器内容");
|
||||
QAction *action5 = menu->addAction(u8"打印当前编辑器内容");
|
||||
connect(action5, &QAction::triggered, this, [=](){
|
||||
// 获取当前编辑器,并直接打印编辑器内容
|
||||
QsciScintilla *edit = getCurrentEditFunc();
|
||||
|
|
Loading…
Reference in New Issue