80 typedef QSharedPointer<TextDecoration> Ptr;
83 TextDecoration(
const QTextCursor &cursor,
int startPos = -1,
int endPos = -1, \
84 int startLine = -1,
int endLine =-1,
int drawOrder = 0,
const QString &tooltip =
"", \
85 bool fullWidth =
false);
86 TextDecoration(QTextDocument *document,
int startPos = -1,
int endPos = -1, \
87 int startLine = -1,
int endLine =-1,
int drawOrder = 0,
const QString &tooltip =
"", \
88 bool fullWidth =
false);
93 int drawOrder()
const {
return m_drawOrder; }
94 void setDrawOrder(
int order) { m_drawOrder = order; }
96 QVariantMap &properties() {
return m_properties; }
99 void setForeground(
const QColor &color);
100 void setBackground(
const QBrush &brush);
101 void setOutline(
const QColor &color);
103 void setFullWidth(
bool flag =
true,
bool clear =
true);
105 void setAsUnderlined(
const QColor &color = QColor(
"blue"));
106 void setAsSpellCheck(
const QColor &color = QColor(
"blue"));
107 void setAsError(
const QColor &color = QColor(
"red"));
108 void setAsWarning(
const QColor &color = QColor(
"orange"));
110 bool containsCursor(
const QTextCursor &cursor)
const;
112 void emitClicked(TextDecoration::Ptr selection)
const;
114 QString tooltip()
const {
return m_tooltip; }
115 void setTooltip(
const QString &tooltip)
120 bool isValid()
const {
return m_drawOrder >= 0; }
122 QTextBlock block()
const {
return m_block; }
123 void setBlock(
const QTextBlock &block) { m_block = block; }
125 QMetaObject::Connection connect(
const char* signal, QObject *receiver,
const char *slot);
128 QSharedPointer<TextDecorationsSignals> m_signals;
131 QVariantMap m_properties;
Definition textDecoration.h:151
Definition textDecoration.h:77