本文整理汇总了C++中QTextDocumentFragment::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextDocumentFragment::isEmpty方法的具体用法?C++ QTextDocumentFragment::isEmpty怎么用?C++ QTextDocumentFragment::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextDocumentFragment
的用法示例。
在下文中一共展示了QTextDocumentFragment::isEmpty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copyPlainText
/*! Copy text without images, but textual representations of the smileys. */
void InputTextWidget::copyPlainText()
{
QTextDocumentFragment selection = textCursor().selection();
if (!selection.isEmpty()) {
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(Smileypack::desmilify(selection.toHtml()));
}
}
示例2: cutPlainText
/*! Cut text without images, but textual representations of the smileys. */
void InputTextWidget::cutPlainText()
{
QTextDocumentFragment selection = textCursor().selection();
if(!selection.isEmpty()) {
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(EmoticonMenu::desmile(selection.toHtml()));
textCursor().removeSelectedText();
}
}
示例3: insertTextFragment
void EditWidget::insertTextFragment(const QTextDocumentFragment &AFragment)
{
if (!AFragment.isEmpty())
{
if (isRichTextEnabled())
ui.medEditor->textCursor().insertFragment(prepareTextFragment(AFragment));
else
ui.medEditor->textCursor().insertText(prepareTextFragment(AFragment).toPlainText());
}
}
示例4: PyBool_FromLong
static PyObject *meth_QTextDocumentFragment_isEmpty(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
{
QTextDocumentFragment *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextDocumentFragment, &sipCpp))
{
bool sipRes;
Py_BEGIN_ALLOW_THREADS
sipRes = sipCpp->isEmpty();
Py_END_ALLOW_THREADS
return PyBool_FromLong(sipRes);
}
}
示例5: prepareTextFragment
QTextDocumentFragment EditWidget::prepareTextFragment(const QTextDocumentFragment &AFragment)
{
QTextDocumentFragment fragment;
if (!AFragment.isEmpty())
{
QMimeData data;
data.setHtml(AFragment.toHtml());
QTextDocument doc;
QMap<int,IMessageEditContentsHandler *> handlers = FMessageWidgets->editContentsHandlers();
for (QMap<int,IMessageEditContentsHandler *>::const_iterator it = handlers.constBegin(); it!=handlers.constEnd(); ++it)
if (it.value()->messageEditContentsInsert(it.key(),this,&data,&doc))
break;
if (isRichTextEnabled())
fragment = QTextDocumentFragment::fromHtml(doc.toHtml());
else
fragment = QTextDocumentFragment::fromPlainText(doc.toPlainText());
}
return fragment;
}