mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-06 06:19:52 +08:00
30 lines
617 B
C++
30 lines
617 B
C++
#include "lineeditwithsnippet.h"
|
|
|
|
#include <snippet/snippetmgr.h>
|
|
|
|
using namespace vnotex;
|
|
|
|
LineEditWithSnippet::LineEditWithSnippet(QWidget *p_parent)
|
|
: LineEdit(p_parent)
|
|
{
|
|
setTips();
|
|
}
|
|
|
|
LineEditWithSnippet::LineEditWithSnippet(const QString &p_contents, QWidget *p_parent)
|
|
: LineEdit(p_contents, p_parent)
|
|
{
|
|
setTips();
|
|
}
|
|
|
|
void LineEditWithSnippet::setTips()
|
|
{
|
|
const auto tips = tr("Snippet is supported via \"%name%\"");
|
|
setToolTip(tips);
|
|
setPlaceholderText(tips);
|
|
}
|
|
|
|
QString LineEditWithSnippet::evaluatedText() const
|
|
{
|
|
return SnippetMgr::getInst().applySnippetBySymbol(text());
|
|
}
|