QTextLayout: deprecate QList API for additionalFormat
This is a separate commit to allow other modules to do the transition before this may vanish or cause a warning. Change-Id: I556837bf0d2c667f067f4e1fa7918bd1a3f55025 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>bb10
parent
9cb68cdea0
commit
861dca57d7
|
|
@ -485,16 +485,15 @@ QString QTextLayout::preeditAreaText() const
|
|||
return d->preeditAreaText();
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 6)
|
||||
/*!
|
||||
Sets the additional formats supported by the text layout to \a formatList.
|
||||
The formats are applied with preedit area text in place.
|
||||
|
||||
\sa additionalFormats(), clearAdditionalFormats()
|
||||
\obsolete Use setFormats() instead.
|
||||
*/
|
||||
void QTextLayout::setAdditionalFormats(const QList<FormatRange> &formatList)
|
||||
{
|
||||
setFormats(formatList.toVector());
|
||||
}
|
||||
#endif // deprecated since 5.6
|
||||
|
||||
/*!
|
||||
\since 5.6
|
||||
|
|
@ -512,8 +511,9 @@ void QTextLayout::setFormats(const QVector<FormatRange> &formats)
|
|||
d->block.docHandle()->documentChange(d->block.position(), d->block.length());
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 6)
|
||||
/*!
|
||||
Returns the list of additional formats supported by the text layout.
|
||||
\obsolete Use formats() instead.
|
||||
|
||||
\sa setAdditionalFormats(), clearAdditionalFormats()
|
||||
*/
|
||||
|
|
@ -521,6 +521,7 @@ QList<QTextLayout::FormatRange> QTextLayout::additionalFormats() const
|
|||
{
|
||||
return formats().toList();
|
||||
}
|
||||
#endif // deprecated since 5.6
|
||||
|
||||
/*!
|
||||
\since 5.6
|
||||
|
|
@ -534,15 +535,15 @@ QVector<QTextLayout::FormatRange> QTextLayout::formats() const
|
|||
return d->formats();
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 6)
|
||||
/*!
|
||||
Clears the list of additional formats supported by the text layout.
|
||||
|
||||
\sa additionalFormats(), setAdditionalFormats()
|
||||
\obsolete Use clearFormats() instead.
|
||||
*/
|
||||
void QTextLayout::clearAdditionalFormats()
|
||||
{
|
||||
clearFormats();
|
||||
}
|
||||
#endif // deprecated since 5.6
|
||||
|
||||
/*!
|
||||
\since 5.6
|
||||
|
|
|
|||
|
|
@ -131,9 +131,11 @@ public:
|
|||
friend bool operator!=(const FormatRange &lhs, const FormatRange &rhs)
|
||||
{ return !operator==(lhs, rhs); }
|
||||
};
|
||||
void setAdditionalFormats(const QList<FormatRange> &overrides);
|
||||
QList<FormatRange> additionalFormats() const;
|
||||
void clearAdditionalFormats();
|
||||
#if QT_DEPRECATED_SINCE(5, 6)
|
||||
QT_DEPRECATED_X("Use setFormats()") void setAdditionalFormats(const QList<FormatRange> &overrides);
|
||||
QT_DEPRECATED_X("Use formats()") QList<FormatRange> additionalFormats() const;
|
||||
QT_DEPRECATED_X("Use clearFormats()") void clearAdditionalFormats();
|
||||
#endif
|
||||
void setFormats(const QVector<FormatRange> &overrides);
|
||||
QVector<FormatRange> formats() const;
|
||||
void clearFormats();
|
||||
|
|
|
|||
Loading…
Reference in New Issue