forked from qt-creator/qt-creator
Expose markdown in TextEdit
Change-Id: Ic0bae0bacfced74eb4977b74a6bb4b59c95f99dd Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -879,6 +879,11 @@ TextEdit::TextEdit(std::initializer_list<I> ps)
|
|||||||
apply(this, ps);
|
apply(this, ps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString TextEdit::markdown() const
|
||||||
|
{
|
||||||
|
return access(this)->toMarkdown();
|
||||||
|
}
|
||||||
|
|
||||||
void TextEdit::setText(const QString &text)
|
void TextEdit::setText(const QString &text)
|
||||||
{
|
{
|
||||||
access(this)->setText(text);
|
access(this)->setText(text);
|
||||||
|
@@ -316,6 +316,7 @@ public:
|
|||||||
|
|
||||||
TextEdit(std::initializer_list<I> ps);
|
TextEdit(std::initializer_list<I> ps);
|
||||||
|
|
||||||
|
QString markdown() const;
|
||||||
void setText(const QString &);
|
void setText(const QString &);
|
||||||
void setMarkdown(const QString &);
|
void setMarkdown(const QString &);
|
||||||
void setReadOnly(bool);
|
void setReadOnly(bool);
|
||||||
|
@@ -462,6 +462,8 @@ void setupGuiModule()
|
|||||||
sol::factories([guard](const sol::table &children) {
|
sol::factories([guard](const sol::table &children) {
|
||||||
return constructWidgetType<TextEdit>(children, guard);
|
return constructWidgetType<TextEdit>(children, guard);
|
||||||
}),
|
}),
|
||||||
|
"markdown",
|
||||||
|
sol::property(&TextEdit::markdown),
|
||||||
sol::base_classes,
|
sol::base_classes,
|
||||||
sol::bases<Widget, Object, Thing>());
|
sol::bases<Widget, Object, Thing>());
|
||||||
|
|
||||||
|
@@ -130,6 +130,9 @@ function gui.Tab(options) end
|
|||||||
---@class TextEdit : Widget
|
---@class TextEdit : Widget
|
||||||
local textEdit = {}
|
local textEdit = {}
|
||||||
|
|
||||||
|
---@return string markdown Returns the content of the TextEdit as markdown
|
||||||
|
function textEdit:markdown() end
|
||||||
|
|
||||||
---@param options WidgetOptions
|
---@param options WidgetOptions
|
||||||
---@return TextEdit
|
---@return TextEdit
|
||||||
function gui.TextEdit(options) end
|
function gui.TextEdit(options) end
|
||||||
|
Reference in New Issue
Block a user