#include <ui4_p.h>
#include <QtCore/qdebug.h>
+#include <QtCore/QDataStream>
#include <QtWidgets/QAction>
#include <QtWidgets/QActionGroup>
#include <QtWidgets/QApplication>
class QUiLoader;
class QUiLoaderPrivate;
+#ifndef QT_NO_DATASTREAM
+// QUiTranslatableStringValue must be streamable since they become part of the QVariant-based
+// mime data when dragging items in views with QAbstractItemView::InternalMove.
+QDataStream &operator<<(QDataStream &out, const QUiTranslatableStringValue &s)
+{
+ out << s.comment() << s.value();
+ return out;
+}
+
+QDataStream &operator>>(QDataStream &in, QUiTranslatableStringValue &s)
+{
+ in >> s.m_comment >> s.m_value;
+ return in;
+}
+#endif // QT_NO_DATASTREAM
+
#ifdef QFORMINTERNAL_NAMESPACE
namespace QFormInternal
{
{
Q_D(QUiLoader);
+#ifndef QT_NO_DATASTREAM
+ static int metaTypeId = 0;
+ if (!metaTypeId) {
+ metaTypeId = qRegisterMetaType<QUiTranslatableStringValue>("QUiTranslatableStringValue");
+ qRegisterMetaTypeStreamOperators<QUiTranslatableStringValue>("QUiTranslatableStringValue");
+ }
+#endif // QT_NO_DATASTREAM
d->builder.loader = this;
QStringList paths;
#include <QtCore/QByteArray>
#include <QtCore/QMetaType>
+QT_FORWARD_DECLARE_CLASS(QDataStream)
+
// This file is here for use by the form preview in Linguist. If you change anything
// here or in the code which uses it, remember to adapt Linguist accordingly.
void setComment(const QByteArray &comment) { m_comment = comment; }
private:
+ friend QDataStream &operator>>(QDataStream &in, QUiTranslatableStringValue &s);
+
QByteArray m_value;
QByteArray m_comment;
};