mirror of
http://code.qt.io/yocto/meta-qt6.git
synced 2026-01-01 13:58:07 +00:00
Fix example build
This commit is contained in:
parent
8d1532aac7
commit
e2b421a5b6
|
|
@ -0,0 +1,113 @@
|
|||
From 8be22a883cc9af0c7198fd298a790c7630290d39 Mon Sep 17 00:00:00 2001
|
||||
From: Simon Hausmann <simon.hausmann@qt.io>
|
||||
Date: Fri, 24 Jan 2020 13:13:15 +0100
|
||||
Subject: [PATCH] Fix compilation after string data changes in qtbase
|
||||
|
||||
Adjust the moc copied code to generate the same byte arrays for string
|
||||
literals and simplified the unicode string tables to just store offsets
|
||||
and size so that we can use QString::fromRawData (just like in
|
||||
qtdeclarative).
|
||||
|
||||
Change-Id: Id19c165454451192e0764b5d889a1275e92417ac
|
||||
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
||||
---
|
||||
tools/qscxmlc/data.t | 10 ++++------
|
||||
tools/qscxmlc/generator.cpp | 13 +++++--------
|
||||
tools/qscxmlc/scxmlcppdumper.cpp | 4 ++--
|
||||
3 files changed, 11 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/tools/qscxmlc/data.t b/tools/qscxmlc/data.t
|
||||
index 3926507..4bcb76b 100644
|
||||
--- a/tools/qscxmlc/data.t
|
||||
+++ b/tools/qscxmlc/data.t
|
||||
@@ -33,7 +33,9 @@ struct ${classname}::Data: private QScxmlTableData {
|
||||
{
|
||||
Q_ASSERT(id >= QScxmlExecutableContent::NoString); Q_ASSERT(id < ${stringCount});
|
||||
if (id == QScxmlExecutableContent::NoString) return QString();
|
||||
- return QString({static_cast<QStringData*>(strings.data + id)});
|
||||
+ const auto dataOffset = strings.offsetsAndSize[id * 2];
|
||||
+ const auto dataSize = strings.offsetsAndSize[id * 2 + 1];
|
||||
+ return QString::fromRawData(reinterpret_cast<const QChar*>(&strings.stringdata[dataOffset]), dataSize);
|
||||
}
|
||||
|
||||
const qint32 *stateMachineTable() const override final
|
||||
@@ -82,7 +84,7 @@ struct ${classname}::Data: private QScxmlTableData {
|
||||
static QScxmlExecutableContent::ForeachInfo foreaches[];
|
||||
static const qint32 theStateMachineTable[];
|
||||
static struct Strings {
|
||||
- QArrayData data[${stringCount}];
|
||||
+ const uint offsetsAndSize[${stringCount} * 2];
|
||||
qunicodechar stringdata[${stringdataSize}];
|
||||
} strings;
|
||||
};
|
||||
@@ -120,10 +122,6 @@ QScxmlExecutableContent::ForeachInfo ${classname}::Data::foreaches[] = {
|
||||
${foreaches}
|
||||
};
|
||||
|
||||
-#define STR_LIT(idx, ofs, len) \
|
||||
- Q_STATIC_STRING_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
||||
- qptrdiff(offsetof(Strings, stringdata) + ofs * sizeof(qunicodechar) - idx * sizeof(QArrayData)) \
|
||||
- )
|
||||
${classname}::Data::Strings ${classname}::Data::strings = {{
|
||||
${strLits}
|
||||
},{
|
||||
diff --git a/tools/qscxmlc/generator.cpp b/tools/qscxmlc/generator.cpp
|
||||
index 59047cf..220170a 100644
|
||||
--- a/tools/qscxmlc/generator.cpp
|
||||
+++ b/tools/qscxmlc/generator.cpp
|
||||
@@ -249,7 +249,7 @@ void Generator::generateCode()
|
||||
//
|
||||
const int constCharArraySizeLimit = 65535;
|
||||
fprintf(out, "struct qt_meta_stringdata_%s_t {\n", qualifiedClassNameIdentifier.constData());
|
||||
- fprintf(out, " QByteArrayData data[%d];\n", strings.size());
|
||||
+ fprintf(out, " const uint offsetsAndSize[%d];\n", strings.size()*2);
|
||||
{
|
||||
int stringDataLength = 0;
|
||||
int stringDataCounter = 0;
|
||||
@@ -273,11 +273,8 @@ void Generator::generateCode()
|
||||
// stringdata.stringdata member, and 2) the stringdata.data index of the
|
||||
// QByteArrayData being defined. This calculation relies on the
|
||||
// QByteArrayData::data() implementation returning simply "this + offset".
|
||||
- fprintf(out, "#define QT_MOC_LITERAL(idx, ofs, len) \\\n"
|
||||
- " Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \\\n"
|
||||
- " qptrdiff(offsetof(qt_meta_stringdata_%s_t, stringdata0) + ofs \\\n"
|
||||
- " - idx * sizeof(QByteArrayData)) \\\n"
|
||||
- " )\n",
|
||||
+ fprintf(out, "#define QT_MOC_LITERAL(ofs, len) \\\n"
|
||||
+ " uint(offsetof(qt_meta_stringdata_%s_t, stringdata0) + ofs), len \n",
|
||||
qualifiedClassNameIdentifier.constData());
|
||||
|
||||
fprintf(out, "static const qt_meta_stringdata_%s_t qt_meta_stringdata_%s = {\n",
|
||||
@@ -287,7 +284,7 @@ void Generator::generateCode()
|
||||
int idx = 0;
|
||||
for (int i = 0; i < strings.size(); ++i) {
|
||||
const QByteArray &str = strings.at(i);
|
||||
- fprintf(out, "QT_MOC_LITERAL(%d, %d, %d)", i, idx, str.length());
|
||||
+ fprintf(out, "QT_MOC_LITERAL(%d, %d)", idx, str.length());
|
||||
if (i != strings.size() - 1)
|
||||
fputc(',', out);
|
||||
const QByteArray comment = str.length() > 32 ? str.left(29) + "..." : str;
|
||||
@@ -519,7 +516,7 @@ void Generator::generateCode()
|
||||
fprintf(out, " { &%s::staticMetaObject, ", purestSuperClass.constData());
|
||||
else
|
||||
fprintf(out, " { nullptr, ");
|
||||
- fprintf(out, "qt_meta_stringdata_%s.data,\n"
|
||||
+ fprintf(out, "qt_meta_stringdata_%s.offsetsAndSize,\n"
|
||||
" qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(),
|
||||
qualifiedClassNameIdentifier.constData());
|
||||
if (hasStaticMetaCall)
|
||||
diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp
|
||||
index 1aca09e..fa6359e 100644
|
||||
--- a/tools/qscxmlc/scxmlcppdumper.cpp
|
||||
+++ b/tools/qscxmlc/scxmlcppdumper.cpp
|
||||
@@ -267,8 +267,8 @@ void generateTables(const GeneratedTableData &td, Replacements &replacements)
|
||||
return QString();
|
||||
|
||||
const int length = strings.at(idx).size();
|
||||
- const QString str = QStringLiteral("STR_LIT(%1, %2, %3)").arg(
|
||||
- QString::number(idx), QString::number(ucharCount), QString::number(length));
|
||||
+ const QString str = QStringLiteral("%1, %2").arg(
|
||||
+ QString::number(ucharCount), QString::number(length));
|
||||
ucharCount += length + 1;
|
||||
return str;
|
||||
});
|
||||
|
|
@ -10,6 +10,10 @@ inherit qt6-cmake
|
|||
include recipes-qt/qt6/qt6-git.inc
|
||||
include recipes-qt/qt6/qt6.inc
|
||||
|
||||
SRC_URI += "\
|
||||
file://0001-Fix-compilation-after-string-data-changes-in-qtbase.patch \
|
||||
"
|
||||
|
||||
DEPENDS += "qtbase qtdeclarative qtscxml-native"
|
||||
|
||||
BBCLASSEXTEND += "native nativesdk"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
From e3d919e215d987ec8f912c7cec05ba502d4c3f0b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= <marten.nordheim@qt.io>
|
||||
Date: Thu, 16 Jan 2020 15:25:46 +0100
|
||||
Subject: [PATCH] Stop forcing deprecated ssl protocol version
|
||||
|
||||
Change-Id: I422a2498bb940f801484d3f2e6e5d59edd637514
|
||||
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
||||
---
|
||||
examples/websockets/sslechoserver/sslechoserver.cpp | 1 -
|
||||
tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp | 1 -
|
||||
2 files changed, 2 deletions(-)
|
||||
|
||||
diff --git a/examples/websockets/sslechoserver/sslechoserver.cpp b/examples/websockets/sslechoserver/sslechoserver.cpp
|
||||
index 00bc6c1..5dc41e0 100644
|
||||
--- a/examples/websockets/sslechoserver/sslechoserver.cpp
|
||||
+++ b/examples/websockets/sslechoserver/sslechoserver.cpp
|
||||
@@ -77,7 +77,6 @@ SslEchoServer::SslEchoServer(quint16 port, QObject *parent) :
|
||||
sslConfiguration.setPeerVerifyMode(QSslSocket::VerifyNone);
|
||||
sslConfiguration.setLocalCertificate(certificate);
|
||||
sslConfiguration.setPrivateKey(sslKey);
|
||||
- sslConfiguration.setProtocol(QSsl::TlsV1SslV3);
|
||||
m_pWebSocketServer->setSslConfiguration(sslConfiguration);
|
||||
|
||||
if (m_pWebSocketServer->listen(QHostAddress::Any, port))
|
||||
diff --git a/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp
|
||||
index c40bb01..a56594c 100644
|
||||
--- a/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp
|
||||
+++ b/tests/auto/websockets/qwebsocketserver/tst_qwebsocketserver.cpp
|
||||
@@ -604,7 +604,6 @@ static void setupSecureServer(QWebSocketServer *secureServer)
|
||||
sslConfiguration.setPeerVerifyMode(QSslSocket::VerifyNone);
|
||||
sslConfiguration.setLocalCertificate(certificate);
|
||||
sslConfiguration.setPrivateKey(sslKey);
|
||||
- sslConfiguration.setProtocol(QSsl::TlsV1SslV3);
|
||||
secureServer->setSslConfiguration(sslConfiguration);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -11,6 +11,10 @@ inherit qt6-cmake
|
|||
include recipes-qt/qt6/qt6-git.inc
|
||||
include recipes-qt/qt6/qt6.inc
|
||||
|
||||
SRC_URI += "\
|
||||
file://0001-Stop-forcing-deprecated-ssl-protocol-version.patch \
|
||||
"
|
||||
|
||||
PACKAGECONFIG ?= "translations"
|
||||
|
||||
DEPENDS += "qtbase qtdeclarative"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user