QtGui: mark some more types as movable/primitive

These are already held in QVectors.

Public API types need to wait until Qt 6, for BC reasons. Even
though Q_RELOCATABLE_TYPE deals with most of them, we lack a way
to mark a type as primitive, but still isStatic - for QList.

Change-Id: I91392b01ae6f94cc847007636e12d4e64c43b2bc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
bb10
Marc Mutz 2015-07-05 22:37:40 +02:00
parent e2a7d18564
commit 53abb8267b
14 changed files with 24 additions and 0 deletions

View File

@ -96,6 +96,7 @@ struct QPixmapIconEngineEntry
QIcon::State state;
bool isNull() const {return (fileName.isEmpty() && pixmap.isNull()); }
};
Q_DECLARE_TYPEINFO(QPixmapIconEngineEntry, Q_MOVABLE_TYPE);
inline QPixmapIconEngineEntry::QPixmapIconEngineEntry(const QString &file, const QImage &image, QIcon::Mode m, QIcon::State s)
: fileName(file), size(image.size()), mode(m), state(s)

View File

@ -72,6 +72,7 @@ public:
QVariant value;
inline bool operator==(const QStandardItemData &other) const { return role == other.role && value == other.value; }
};
Q_DECLARE_TYPEINFO(QStandardItemData, Q_MOVABLE_TYPE);
#ifndef QT_NO_DATASTREAM

View File

@ -575,8 +575,10 @@ private:
Qt::InputMethodQuery query;
QVariant value;
};
friend QTypeInfo<QueryPair>;
QVector<QueryPair> m_values;
};
Q_DECLARE_TYPEINFO(QInputMethodQueryEvent::QueryPair, Q_MOVABLE_TYPE);
#endif // QT_NO_INPUTMETHOD

View File

@ -1761,6 +1761,7 @@ struct QCrossingEdge
return x < edge.x;
}
};
Q_DECLARE_TYPEINFO(QCrossingEdge, Q_PRIMITIVE_TYPE);
static bool bool_op(bool a, bool b, QPathClipper::Operation op)
{

View File

@ -1976,6 +1976,7 @@ struct QGradientBound {
int function;
bool reverse;
};
Q_DECLARE_TYPEINFO(QGradientBound, Q_PRIMITIVE_TYPE);
int QPdfEnginePrivate::createShadingFunction(const QGradient *gradient, int from, int to, bool reflect, bool alpha)
{

View File

@ -128,6 +128,8 @@ private:
Q_PRIVATE_SLOT(d_func(), int _q_dynamicPageCountSlot())
Q_PRIVATE_SLOT(d_func(), QSizeF _q_dynamicDocumentSizeSlot())
};
Q_DECLARE_TYPEINFO(QAbstractTextDocumentLayout::Selection, Q_RELOCATABLE_TYPE);
Q_DECLARE_TYPEINFO(QAbstractTextDocumentLayout::PaintContext, Q_RELOCATABLE_TYPE);
class Q_GUI_EXPORT QTextObjectInterface
{

View File

@ -499,6 +499,7 @@ public:
void invalidate();
};
Q_DECLARE_TYPEINFO(QFontDatabasePrivate::ApplicationFont, Q_MOVABLE_TYPE);
void QFontDatabasePrivate::invalidate()
{

View File

@ -334,6 +334,7 @@ private:
mutable qreal m_minRightBearing;
};
Q_DECLARE_TYPEINFO(QFontEngine::KernPair, Q_PRIMITIVE_TYPE);
Q_DECLARE_OPERATORS_FOR_FLAGS(QFontEngine::ShaperFlags)

View File

@ -119,6 +119,7 @@ private: // private to avoid abuse
// ================
// 43 bytes per item
};
Q_DECLARE_TYPEINFO(QStaticTextItem, Q_MOVABLE_TYPE);
class QStaticText;
class Q_AUTOTEST_EXPORT QStaticTextPrivate

View File

@ -148,6 +148,7 @@ private:
int listNode;
QPointer<QTextList> list;
};
friend class QTypeInfo<List>;
QVector<List> lists;
int indent;
@ -187,6 +188,7 @@ private:
int row;
int column;
};
friend class QTypeInfo<TableCellIterator>;
friend struct Table;
struct Table
@ -200,6 +202,7 @@ private:
TableCellIterator currentCell;
int lastIndent;
};
friend class QTypeInfo<Table>;
QVector<Table> tables;
struct RowColSpanInfo
@ -207,6 +210,7 @@ private:
int row, col;
int rowSpan, colSpan;
};
friend class QTypeInfo<RowColSpanInfo>;
enum WhiteSpace
{
@ -227,6 +231,10 @@ private:
int currentNodeIdx;
const QTextHtmlParserNode *currentNode;
};
Q_DECLARE_TYPEINFO(QTextHtmlImporter::List, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QTextHtmlImporter::TableCellIterator, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QTextHtmlImporter::Table, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QTextHtmlImporter::RowColSpanInfo, Q_PRIMITIVE_TYPE);
QT_END_NAMESPACE
#endif // QT_NO_TEXTHTMLPARSER

View File

@ -263,6 +263,7 @@ private:
friend QDataStream &operator<<(QDataStream &, const QTextFormat &);
friend QDataStream &operator>>(QDataStream &, QTextFormat &);
};
Q_DECLARE_TYPEINFO(QTextFormatPrivate::Property, Q_MOVABLE_TYPE);
static inline uint hash(const QColor &color)
{

View File

@ -116,6 +116,7 @@ private:
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextLength &);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextLength &);
};
Q_DECLARE_TYPEINFO(QTextLength, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_PRIMITIVE_TYPE : Q_RELOCATABLE_TYPE);
inline QTextLength::QTextLength(Type atype, qreal avalue)
: lengthType(atype), fixedValueOrPercentage(avalue) {}

View File

@ -328,12 +328,14 @@ protected:
QString url;
QCss::StyleSheet sheet;
};
friend class QTypeInfo<ExternalStyleSheet>;
QVector<ExternalStyleSheet> externalStyleSheets;
QVector<QCss::StyleSheet> inlineStyleSheets;
#endif
const QTextDocument *resourceProvider;
};
Q_DECLARE_TYPEINFO(QTextHtmlParser::ExternalStyleSheet, Q_MOVABLE_TYPE);
QT_END_NAMESPACE

View File

@ -203,6 +203,7 @@ private:
QPainter *painter);
QTextEngine *d;
};
Q_DECLARE_TYPEINFO(QTextLayout::FormatRange, Q_RELOCATABLE_TYPE);
class Q_GUI_EXPORT QTextLine