Merge remote-tracking branch 'origin/5.13.0' into 5.13
Conflicts: src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmintegration.h Change-Id: Idf4c7936513fb1f21daa8f6105b8545f13447bb8
This commit is contained in:
commit
3c662bf13c
301
dist/changes-5.13.0
vendored
301
dist/changes-5.13.0
vendored
@ -1,3 +1,20 @@
|
||||
Qt 5.13 introduces many new features and improvements as well as bugfixes
|
||||
over the 5.12.x series. For more details, refer to the online documentation
|
||||
included in this distribution. The documentation is also available online:
|
||||
|
||||
https://doc.qt.io/qt-5/index.html
|
||||
|
||||
The Qt version 5.13 series is binary compatible with the 5.12.x series.
|
||||
Applications compiled for 5.12 will continue to run with 5.13.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
https://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* Important Source Incompatible Changes *
|
||||
****************************************************************************
|
||||
@ -5,3 +22,287 @@
|
||||
- Moc generated files include the standard <memory> header file now.
|
||||
A side effect of this is that code including the Moc output from within
|
||||
a namespace will fail to compile.
|
||||
|
||||
****************************************************************************
|
||||
* Important Behavior Changes *
|
||||
****************************************************************************
|
||||
|
||||
- The Qt resource system now supports compressing content using the
|
||||
Zstandard (https://zstd.net) algorithm. Compared to zlib, it compresses
|
||||
better for the same CPU time, so this algorithm is the default.
|
||||
QResource::isCompressed() returns true for either compression algorithm.
|
||||
Use QResource::compressionAlgorithm() to find out which algorithm to
|
||||
decompress. QFile will automatically decompress using the correct
|
||||
algorithm.
|
||||
|
||||
- QDataStream version bumped up to 19 to account for changes in the
|
||||
serialization of QFont.
|
||||
|
||||
- [QTBUG-73048] Qt now enables by default warnings when using APIs
|
||||
marked as deprecated. It is possible to disable such warnings by
|
||||
defining the QT_NO_DEPRECATED_WARNINGS macro. The old
|
||||
QT_DEPRECATED_WARNINGS macro which was used to enable this warning
|
||||
now has no effect (warnings are automatically enabled).
|
||||
|
||||
****************************************************************************
|
||||
* Third-Party Code *
|
||||
****************************************************************************
|
||||
|
||||
- Updated bundled SQLite to version 3.28.0.
|
||||
- [QTBUG-72623] Updated DNS public suffix list
|
||||
- [QTBUG-73883] libjpeg-turbo was updated to version 2.0.2
|
||||
- Bundled libpng was updated to version 1.6.37
|
||||
|
||||
****************************************************************************
|
||||
* Platform-Specific Changes *
|
||||
****************************************************************************
|
||||
|
||||
- X11 / XCB:
|
||||
* [QTBUG-45375] QTabletEvent coordinates now come from AbsX/AbsY
|
||||
valuators in the X11 event, in more precise 32.32 fixed-point format,
|
||||
scaled to fit the virtual desktop. It's possible to revert to using
|
||||
the legacy 16.16-format event_x/event_y coordinates as in previous
|
||||
releases by setting the QT_XCB_TABLET_LEGACY_COORDINATES environment
|
||||
variable.
|
||||
* [plugins] platforminputcontexts now use libxkbcommon-compose APIs for
|
||||
compose key input, instead of Qt's own implementation.
|
||||
|
||||
- Android
|
||||
* Increased the minimum supported Android version to Android 5.0
|
||||
(API level 21).
|
||||
|
||||
- Windows
|
||||
* [QTBUG-47247][QTBUG-71855] Add a default setting for
|
||||
hasBorderInFullScreen in QtPlatformHeaders, QWindowsWindowFunctions
|
||||
* [QTBUG-57180] Removed confusing DirectWrite warning when loading
|
||||
bitmap fonts.
|
||||
|
||||
- macOS
|
||||
* Accessibility: VoiceOver now reads all lines in multiline text
|
||||
components when navigating by lines.
|
||||
|
||||
****************************************************************************
|
||||
* Tools *
|
||||
****************************************************************************
|
||||
|
||||
- configure & build system:
|
||||
* Added --linker=[bfg,lld,gold] configure flag.
|
||||
* The default OpenGL configuration changed from ANGLE to dynamic OpenGL.
|
||||
* Added -schannel option to enable Schannel support on Desktop Windows.
|
||||
* Added -coverage option for recording coverage data during execution
|
||||
|
||||
- CMake
|
||||
* Added support for automatic linking of transitive dependencies in
|
||||
static builds
|
||||
|
||||
- qmake
|
||||
* [QTBUG-53654] Introduced the variables WINDOWS_TARGET_PLATFORM_VERSION
|
||||
and WINDOWS_TARGET_PLATFORM_MIN_VERSION for overriding the default
|
||||
values of WindowsTargetPlatformVersion and
|
||||
WindowsTargetPlatformMinVersion in Visual Studio project files.
|
||||
|
||||
- RCC now supports compressing content using the Zstandard
|
||||
(https://zstd.net) algorithm. Compared to zlib, it compresses better for
|
||||
the same CPU time, so this algorithm is the default. To go back to the
|
||||
previous algorithm, pass command-line option --compress-algo=zlib.
|
||||
Compression levels range from 1 (fastest, least compression) to 19
|
||||
(slowest, best compression). Level 0 tells the library to choose an
|
||||
implementation-defined default. The default compression level is
|
||||
"heuristic" (level -1): under this mode, RCC will attempt a very fast
|
||||
compression (level 1) and check if the file was sufficiently compressed.
|
||||
If it was, then RCC will compress again using an implementation-defined
|
||||
level.
|
||||
|
||||
****************************************************************************
|
||||
* QtCore *
|
||||
****************************************************************************
|
||||
|
||||
- New class QConcatenateTablesProxyModel, to concatenate the rows from
|
||||
multiple source models.
|
||||
- New class QTransposeProxyModel to swap rows and columns of the source
|
||||
model.
|
||||
- Added macros Q_DISABLE_MOVE and Q_DISABLE_COPY_MOVE complementing
|
||||
Q_DISABLE_COPY.
|
||||
- Qt Containers and meta type system now use C++11 type traits
|
||||
(std::is_trivial, std::is_trivially_copyable and
|
||||
std::is_trivially_destructible) to detect the class of a type not
|
||||
explicitly set by Q_DECLARE_TYPEINFO. (Q_DECLARE_TYPEINFO is still
|
||||
needed for QList.)
|
||||
|
||||
- QCommandLineParser:
|
||||
* [QTBUG-58490] The application name (if set in QCoreApplication) is now
|
||||
shown in error messages.
|
||||
|
||||
- QDateTime:
|
||||
* [QTBUG-71030] Fixed race conditions in getting the local time zone. Qt now
|
||||
has a mutex lock around all calls to tzset() and mktime(). Application
|
||||
code should avoid calling those functions directly.
|
||||
|
||||
- QFile:
|
||||
* Made QFile::copy() issue a filesystem-synchronization system call,
|
||||
which would make it less likely to result in incomplete or corrupt
|
||||
files if the system reboots or uncleanly shuts down soon after the
|
||||
function returns. New code is advised to use QSaveFile instead, which
|
||||
also allows display of a progress report while copying.
|
||||
|
||||
- QFileInfo:
|
||||
* [QTBUG-63970][QTBUG-30401][QTBUG-20791] Fixed resolving of symbolic
|
||||
links to UNC shares on NTFS file systems.
|
||||
|
||||
- QJsonArray:
|
||||
* [QTBUG-32793] Added cbegin() and cend() methods for compatibility with
|
||||
the Standard Library container concepts.
|
||||
|
||||
- QJsonDocument:
|
||||
* [QTBUG-71445] Added the ability to stream QJsonDocument into and from
|
||||
QDataStream if it is contained in a QVariant.
|
||||
|
||||
- QLocale:
|
||||
* Added support for Western Balochi, Ido, Lojban, Sicilian and
|
||||
Southern Kurdish.
|
||||
* [QTBUG-71445] Added a const overload for formattedDataSize().
|
||||
* [QTBUG-782] Added toLong() and toULong().
|
||||
|
||||
- QMetaObject:
|
||||
* Non-copyable lambdas can now be used with invokeMethod(). For
|
||||
consistency reasons, the functor object is now always moved.
|
||||
|
||||
- QMimeDatabase:
|
||||
* Added configure option -no-mimetype-database that tells Qt not to
|
||||
bundle its own copy of the XDG MIME database. If this option is
|
||||
passed, QMimeDatabase will only work if there's a system copy in
|
||||
$XDG_DATA_DIRS/mime. This option is useful for Linux distributions
|
||||
that ensure the data is always present.
|
||||
|
||||
- QSettings:
|
||||
* Added QSettings(Scope...) constructor to avoid using #ifdef in Qt
|
||||
applications.
|
||||
|
||||
- QStringListModel:
|
||||
* [QTBUG-69807] Implemented moveRows
|
||||
|
||||
- QUrlQuery:
|
||||
* QUrlQuery now provides an initializer list constructor. It can be
|
||||
created using a list of key/value pairs.
|
||||
|
||||
- QVector:
|
||||
* QVector no longer requires a default constructor for its template
|
||||
argument.
|
||||
|
||||
****************************************************************************
|
||||
* QtDBus *
|
||||
****************************************************************************
|
||||
|
||||
- Matching namespace prefixes using QDBusServiceWatcher (instead of full
|
||||
service names) is now possible. For example, "com.example.backend1*"
|
||||
will match "com.example.backend1", "com.example.backend1.foo" and
|
||||
"com.example.backend1.foo.bar", but not "com.example.backend12".
|
||||
|
||||
****************************************************************************
|
||||
* QtGui *
|
||||
****************************************************************************
|
||||
|
||||
- CSS:
|
||||
* Added support for HSL/HSLA colors.
|
||||
* Fix the range of the hue parameter when parsing a color given in HSL
|
||||
or HSV.
|
||||
|
||||
- QFont:
|
||||
* Add setFamilies()/families() to support use of font families with
|
||||
commas and quotes in their name.
|
||||
|
||||
- QImage:
|
||||
* [QTBUG-41176] Added support for 16-bit grayscale format.
|
||||
* A new method convertTo has been added to change the format of a QImage
|
||||
in place.
|
||||
|
||||
- QPainterPath:
|
||||
* Added clear(), reserve(), capacity(). clear() removes allocated
|
||||
QPainterPath elements but preserves allocated memory, which can be
|
||||
useful for application with complex paths that are often recreated.
|
||||
reserve() and capacity() follow QVector semantics.
|
||||
|
||||
- QWindow:
|
||||
* [QTBUG-67903][QTBUG-52944] QWindow::transientParent is now a property.
|
||||
|
||||
- Text:
|
||||
* [QTBUG-60813] Deprecated QFont::lastResortFamily() and
|
||||
QFont::lastResortFont() which are not in use in Qt 5 and did not
|
||||
provide any useful information.
|
||||
* [QTBUG-22813] Added support for setting the font's style name in
|
||||
QTextCharFormat.
|
||||
|
||||
****************************************************************************
|
||||
* QtNetwork *
|
||||
****************************************************************************
|
||||
|
||||
- TLS (SSL):
|
||||
* Support for SSLv2 and SSLv3 sockets has been dropped, as per RFC 6176
|
||||
(2011) and RFC 7568 (2015).
|
||||
* The Schannel backend now supports ALPN and thus HTTP/2.
|
||||
* [QTBUG-62637] Added support for Schannel on Desktop Windows. To build
|
||||
Qt with Schannel support use '-schannel' during configure.
|
||||
* Added class QOcspResponse as a part of OCSP stapling support.
|
||||
* [QTBUG-12812][QTBUG-17158] Added OCSP-stapling support for OpenSSL
|
||||
backend
|
||||
* [QTBUG-71828][QTBUG-73289] Fixed SSL verification when connecting to IP
|
||||
address (no host name) if that IP address is listed in the certificate.
|
||||
|
||||
****************************************************************************
|
||||
* QtTestLib *
|
||||
****************************************************************************
|
||||
|
||||
- Added QTest::toString(const QModelIndex &idx)
|
||||
|
||||
- Removed support for GPU_BLACKLIST files. Reimplementations or
|
||||
equivalents of QTEST_MAIN() should remove their uses of
|
||||
QTEST_ADD_GPU_BLACKLIST_SUPPORT and its _DEFS; they are still vacuously
|
||||
defined, but serve no remaining purpose and shall be undefined in due
|
||||
course.
|
||||
|
||||
****************************************************************************
|
||||
* QtWidgets *
|
||||
****************************************************************************
|
||||
|
||||
- QAbstractScrollArea:
|
||||
* [QTBUG-69120] QTableView/QTreeView, when reporting their
|
||||
viewportSizeHint(), now correctly take into account their scroll
|
||||
bars' visibility and visibilityPolicy.
|
||||
|
||||
- QHeaderView:
|
||||
* dataChanged now respects the given roles to avoid useless
|
||||
recomputations.
|
||||
|
||||
- QLabel:
|
||||
* Minor performance improvement when painting a label with an image.
|
||||
|
||||
- QListWidget:
|
||||
* [QTBUG-69807] Implemented moveRows in model
|
||||
* [QTBUG-68977] Sped up handling of hidden items when working with large
|
||||
data sets.
|
||||
|
||||
- QPlainTextEdit:
|
||||
* Added QRegularExpression find() method overload.
|
||||
|
||||
- QTextEdit:
|
||||
* Added QRegularExpression find() method overload.
|
||||
|
||||
- QTreeView:
|
||||
* Added expandRecursively() to expand all items below a given index.
|
||||
|
||||
- QWidgetTextControlPrivate:
|
||||
* [QTBUG-69735] Moved cursor selection to start.
|
||||
|
||||
****************************************************************************
|
||||
* QtSql *
|
||||
****************************************************************************
|
||||
|
||||
- SQLite:
|
||||
* [QTBUG-63498] The json1-extension for the SQLite3 plugin is now enabled
|
||||
by default.
|
||||
|
||||
- PostgreSQL:
|
||||
* QSqlDatabase is now stricter about table names when used with record()
|
||||
and primaryIndex(). If the tablename was not quoted when it was
|
||||
created, then the table name passed to record() and primaryIndex()
|
||||
needs to be in lower case so that PostgreSQL is able to find it.
|
||||
|
@ -59,6 +59,7 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
|
||||
file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS[ \\t]*=\")
|
||||
string(REGEX REPLACE \"QMAKE_PRL_LIBS[ \\t]*=[ \\t]*([^\\n]*)\" \"\\\\1\" _static_depends ${_prl_strings})
|
||||
string(REGEX REPLACE \"[ \\t]+\" \";\" _static_depends ${_static_depends})
|
||||
string(REGEX REPLACE \"[ \\t]+\" \";\" _standard_libraries ${CMAKE_CXX_STANDARD_LIBRARIES})
|
||||
set(_search_paths)
|
||||
string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\")
|
||||
foreach(_flag ${_static_depends})
|
||||
@ -66,7 +67,15 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
|
||||
if(_flag MATCHES \"^-l(.*)$\")
|
||||
# Handle normal libraries passed as -lfoo
|
||||
set(_lib \"${CMAKE_MATCH_1}\")
|
||||
if(_lib MATCHES \"^pthread$\")
|
||||
foreach(_standard_library ${_standard_libraries})
|
||||
if(_standard_library MATCHES \"^${_lib}(\\.lib)?$\")
|
||||
set(_lib_is_default_linked TRUE)
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
if (_lib_is_default_linked)
|
||||
unset(_lib_is_default_linked)
|
||||
elseif(_lib MATCHES \"^pthread$\")
|
||||
find_package(Threads REQUIRED)
|
||||
list(APPEND _lib_deps Threads::Threads)
|
||||
else()
|
||||
|
@ -51,6 +51,12 @@ contains(TEMPLATE, .*lib) {
|
||||
}
|
||||
lib_replace.CONFIG = path
|
||||
QMAKE_PRL_INSTALL_REPLACE += lib_replace
|
||||
!equals(qt_libdir, $$rplbase/lib) {
|
||||
qtlibdir_replace.match = $$qt_libdir
|
||||
qtlibdir_replace.replace = $$qqt_libdir
|
||||
qtlibdir_replace.CONFIG = path
|
||||
QMAKE_PRL_INSTALL_REPLACE += qtlibdir_replace
|
||||
}
|
||||
}
|
||||
|
||||
# The remainder of this file must not apply to host tools/libraries,
|
||||
|
@ -94,6 +94,12 @@ QMAKE_PREFIX_STATICLIB = lib
|
||||
QMAKE_EXTENSION_STATICLIB = a # llvm bitcode
|
||||
|
||||
QMAKE_AR = emar cqs
|
||||
equals(QMAKE_HOST.os, Windows) {
|
||||
QMAKE_AR_CMD = \
|
||||
"$(file >$(OBJECTS_DIR)/$(TARGET).rsp, $(subst \\,/,$(OBJECTS)))$$escape_expand(\\n\\t)" \
|
||||
"$(AR) $(DESTDIR)$(TARGET) @$(OBJECTS_DIR)/$(TARGET).rsp"
|
||||
}
|
||||
|
||||
QMAKE_DISTCLEAN += *.html *.js *.wasm
|
||||
|
||||
load(qt_config)
|
||||
|
@ -172,6 +172,16 @@ static QString rfc1034Identifier(const QString &str)
|
||||
return s;
|
||||
}
|
||||
|
||||
static QString escapeDir(const QString &dir)
|
||||
{
|
||||
// When building on non-MSys MinGW, the path ends with a backslash, which
|
||||
// GNU make will interpret that as a line continuation. Doubling the backslash
|
||||
// avoids the problem, at the cost of the variable containing *both* backslashes.
|
||||
if (dir.endsWith('\\'))
|
||||
return dir + '\\';
|
||||
return dir;
|
||||
}
|
||||
|
||||
void
|
||||
UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
{
|
||||
@ -234,7 +244,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << "####### Output directory\n\n";
|
||||
// This is used in commands by some .prf files.
|
||||
if (! project->values("OBJECTS_DIR").isEmpty())
|
||||
t << "OBJECTS_DIR = " << fileVar("OBJECTS_DIR") << endl;
|
||||
t << "OBJECTS_DIR = " << escapeDir(fileVar("OBJECTS_DIR")) << endl;
|
||||
else
|
||||
t << "OBJECTS_DIR = ./\n";
|
||||
t << endl;
|
||||
@ -280,13 +290,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
|
||||
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
|
||||
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
|
||||
QString destd = fileVar("DESTDIR");
|
||||
// When building on non-MSys MinGW, the path ends with a backslash, which
|
||||
// GNU make will interpret that as a line continuation. Doubling the backslash
|
||||
// avoids the problem, at the cost of the variable containing *both* backslashes.
|
||||
if (destd.endsWith('\\'))
|
||||
destd += '\\';
|
||||
t << "DESTDIR = " << destd << endl;
|
||||
t << "DESTDIR = " << escapeDir(fileVar("DESTDIR")) << endl;
|
||||
t << "TARGET = " << fileVar("TARGET") << endl;
|
||||
if(project->isActiveConfig("plugin")) {
|
||||
t << "TARGETD = " << fileVar("TARGET") << endl;
|
||||
|
4
src/3rdparty/sqlite/qt_attribution.json
vendored
4
src/3rdparty/sqlite/qt_attribution.json
vendored
@ -6,8 +6,8 @@
|
||||
|
||||
"Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
|
||||
"Homepage": "https://www.sqlite.org/",
|
||||
"Version": "3.27.1",
|
||||
"DownloadLocation": "https://www.sqlite.org/2018/sqlite-amalgamation-3270100.zip",
|
||||
"Version": "3.28.0",
|
||||
"DownloadLocation": "https://www.sqlite.org/2019/sqlite-amalgamation-3280000.zip",
|
||||
"License": "Public Domain",
|
||||
"Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
|
||||
}
|
||||
|
8745
src/3rdparty/sqlite/sqlite3.c
vendored
8745
src/3rdparty/sqlite/sqlite3.c
vendored
File diff suppressed because it is too large
Load Diff
61
src/3rdparty/sqlite/sqlite3.h
vendored
61
src/3rdparty/sqlite/sqlite3.h
vendored
@ -123,9 +123,9 @@ extern "C" {
|
||||
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
||||
** [sqlite_version()] and [sqlite_source_id()].
|
||||
*/
|
||||
#define SQLITE_VERSION "3.27.1"
|
||||
#define SQLITE_VERSION_NUMBER 3027001
|
||||
#define SQLITE_SOURCE_ID "2019-02-08 13:17:39 0eca3dd3d38b31c92b49ca2d311128b74584714d9e7de895b1a6286ef959a1dd"
|
||||
#define SQLITE_VERSION "3.28.0"
|
||||
#define SQLITE_VERSION_NUMBER 3028000
|
||||
#define SQLITE_SOURCE_ID "2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50"
|
||||
|
||||
/*
|
||||
** CAPI3REF: Run-Time Library Version Numbers
|
||||
@ -189,6 +189,9 @@ SQLITE_API int sqlite3_libversion_number(void);
|
||||
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
|
||||
SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
|
||||
SQLITE_API const char *sqlite3_compileoption_get(int N);
|
||||
#else
|
||||
# define sqlite3_compileoption_used(X) 0
|
||||
# define sqlite3_compileoption_get(X) ((void*)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -2086,8 +2089,8 @@ struct sqlite3_mem_methods {
|
||||
**
|
||||
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
|
||||
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
|
||||
** <dd> ^This option is used to enable or disable the two-argument
|
||||
** version of the [fts3_tokenizer()] function which is part of the
|
||||
** <dd> ^This option is used to enable or disable the
|
||||
** [fts3_tokenizer()] function which is part of the
|
||||
** [FTS3] full-text search engine extension.
|
||||
** There should be two additional arguments.
|
||||
** The first argument is an integer which is 0 to disable fts3_tokenizer() or
|
||||
@ -2199,6 +2202,17 @@ struct sqlite3_mem_methods {
|
||||
** <li> Direct writes to [shadow tables].
|
||||
** </ul>
|
||||
** </dd>
|
||||
**
|
||||
** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]] <dt>SQLITE_DBCONFIG_WRITABLE_SCHEMA</dt>
|
||||
** <dd>The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the
|
||||
** "writable_schema" flag. This has the same effect and is logically equivalent
|
||||
** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF].
|
||||
** The first argument to this setting is an integer which is 0 to disable
|
||||
** the writable_schema, positive to enable writable_schema, or negative to
|
||||
** leave the setting unchanged. The second parameter is a pointer to an
|
||||
** integer into which is written 0 or 1 to indicate whether the writable_schema
|
||||
** is enabled or disabled following this call.
|
||||
** </dd>
|
||||
** </dl>
|
||||
*/
|
||||
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
|
||||
@ -2212,7 +2226,8 @@ struct sqlite3_mem_methods {
|
||||
#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */
|
||||
#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */
|
||||
#define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */
|
||||
#define SQLITE_DBCONFIG_MAX 1010 /* Largest DBCONFIG */
|
||||
#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */
|
||||
#define SQLITE_DBCONFIG_MAX 1011 /* Largest DBCONFIG */
|
||||
|
||||
/*
|
||||
** CAPI3REF: Enable Or Disable Extended Result Codes
|
||||
@ -2369,7 +2384,7 @@ SQLITE_API int sqlite3_changes(sqlite3*);
|
||||
** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
|
||||
** are not counted.
|
||||
**
|
||||
** This the [sqlite3_total_changes(D)] interface only reports the number
|
||||
** The [sqlite3_total_changes(D)] interface only reports the number
|
||||
** of rows that changed due to SQL statement run against database
|
||||
** connection D. Any changes by other database connections are ignored.
|
||||
** To detect changes against a database file from other database
|
||||
@ -3894,6 +3909,18 @@ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt);
|
||||
*/
|
||||
SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
|
||||
|
||||
/*
|
||||
** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement
|
||||
** METHOD: sqlite3_stmt
|
||||
**
|
||||
** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the
|
||||
** prepared statement S is an EXPLAIN statement, or 2 if the
|
||||
** statement S is an EXPLAIN QUERY PLAN.
|
||||
** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is
|
||||
** an ordinary statement or a NULL pointer.
|
||||
*/
|
||||
SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt);
|
||||
|
||||
/*
|
||||
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
|
||||
** METHOD: sqlite3_stmt
|
||||
@ -4033,7 +4060,9 @@ typedef struct sqlite3_context sqlite3_context;
|
||||
** ^The fifth argument to the BLOB and string binding interfaces
|
||||
** is a destructor used to dispose of the BLOB or
|
||||
** string after SQLite has finished with it. ^The destructor is called
|
||||
** to dispose of the BLOB or string even if the call to bind API fails.
|
||||
** to dispose of the BLOB or string even if the call to the bind API fails,
|
||||
** except the destructor is not called if the third parameter is a NULL
|
||||
** pointer or the fourth parameter is negative.
|
||||
** ^If the fifth argument is
|
||||
** the special value [SQLITE_STATIC], then SQLite assumes that the
|
||||
** information is in static, unmanaged space and does not need to be freed.
|
||||
@ -4950,6 +4979,8 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
|
||||
** <tr><td><b>sqlite3_value_nochange </b>
|
||||
** <td>→ <td>True if the column is unchanged in an UPDATE
|
||||
** against a virtual table.
|
||||
** <tr><td><b>sqlite3_value_frombind </b>
|
||||
** <td>→ <td>True if value originated from a [bound parameter]
|
||||
** </table></blockquote>
|
||||
**
|
||||
** <b>Details:</b>
|
||||
@ -5011,6 +5042,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
|
||||
** than within an [xUpdate] method call for an UPDATE statement, then
|
||||
** the return value is arbitrary and meaningless.
|
||||
**
|
||||
** ^The sqlite3_value_frombind(X) interface returns non-zero if the
|
||||
** value X originated from one of the [sqlite3_bind_int|sqlite3_bind()]
|
||||
** interfaces. ^If X comes from an SQL literal value, or a table column,
|
||||
** and expression, then sqlite3_value_frombind(X) returns zero.
|
||||
**
|
||||
** Please pay particular attention to the fact that the pointer returned
|
||||
** from [sqlite3_value_blob()], [sqlite3_value_text()], or
|
||||
** [sqlite3_value_text16()] can be invalidated by a subsequent call to
|
||||
@ -5056,6 +5092,7 @@ SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
|
||||
SQLITE_API int sqlite3_value_type(sqlite3_value*);
|
||||
SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
|
||||
SQLITE_API int sqlite3_value_nochange(sqlite3_value*);
|
||||
SQLITE_API int sqlite3_value_frombind(sqlite3_value*);
|
||||
|
||||
/*
|
||||
** CAPI3REF: Finding The Subtype Of SQL Values
|
||||
@ -5791,7 +5828,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
|
||||
** associated with database N of connection D. ^The main database file
|
||||
** has the name "main". If there is no attached database N on the database
|
||||
** connection D, or if database N is a temporary or in-memory database, then
|
||||
** a NULL pointer is returned.
|
||||
** this function will return either a NULL pointer or an empty string.
|
||||
**
|
||||
** ^The filename returned by this function is the output of the
|
||||
** xFullPathname method of the [VFS]. ^In other words, the filename
|
||||
@ -10892,7 +10929,7 @@ SQLITE_API int sqlite3rebaser_configure(
|
||||
** in size. This function allocates and populates a buffer with a copy
|
||||
** of the changeset rebased rebased according to the configuration of the
|
||||
** rebaser object passed as the first argument. If successful, (*ppOut)
|
||||
** is set to point to the new buffer containing the rebased changset and
|
||||
** is set to point to the new buffer containing the rebased changeset and
|
||||
** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the
|
||||
** responsibility of the caller to eventually free the new buffer using
|
||||
** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut)
|
||||
@ -11301,7 +11338,7 @@ struct Fts5PhraseIter {
|
||||
** Save the pointer passed as the second argument as the extension functions
|
||||
** "auxiliary data". The pointer may then be retrieved by the current or any
|
||||
** future invocation of the same fts5 extension function made as part of
|
||||
** of the same MATCH query using the xGetAuxdata() API.
|
||||
** the same MATCH query using the xGetAuxdata() API.
|
||||
**
|
||||
** Each extension function is allocated a single auxiliary data slot for
|
||||
** each FTS query (MATCH expression). If the extension function is invoked
|
||||
@ -11316,7 +11353,7 @@ struct Fts5PhraseIter {
|
||||
** The xDelete callback, if one is specified, is also invoked on the
|
||||
** auxiliary data pointer after the FTS5 query has finished.
|
||||
**
|
||||
** If an error (e.g. an OOM condition) occurs within this function, an
|
||||
** If an error (e.g. an OOM condition) occurs within this function,
|
||||
** the auxiliary data is set to NULL and an error code returned. If the
|
||||
** xDelete parameter was not NULL, it is invoked on the auxiliary data
|
||||
** pointer before returning.
|
||||
|
@ -1552,6 +1552,13 @@ bool qSharedBuild() Q_DECL_NOTHROW
|
||||
Defined on Any UNIX BSD/SYSV system.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_OS_WASM
|
||||
\relates <QtGlobal>
|
||||
|
||||
Defined on Web Assembly.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro Q_CC_SYM
|
||||
\relates <QtGlobal>
|
||||
|
@ -120,6 +120,7 @@
|
||||
|
||||
#ifdef Q_OS_WASM
|
||||
#include <emscripten.h>
|
||||
#include <emscripten/val.h>
|
||||
#endif
|
||||
|
||||
#ifdef QT_BOOTSTRAPPED
|
||||
@ -801,6 +802,10 @@ void QCoreApplicationPrivate::init()
|
||||
Module.print(err);
|
||||
});
|
||||
);
|
||||
|
||||
#if QT_CONFIG(thread)
|
||||
QThreadPrivate::idealThreadCount = emscripten::val::global("navigator")["hardwareConcurrency"].as<int>();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Store app name/version (so they're still available after QCoreApplication is destroyed)
|
||||
|
@ -195,6 +195,9 @@ public:
|
||||
int waiters;
|
||||
bool terminationEnabled, terminatePending;
|
||||
#endif // Q_OS_WIN
|
||||
#ifdef Q_OS_WASM
|
||||
static int idealThreadCount;
|
||||
#endif
|
||||
QThreadData *data;
|
||||
|
||||
static QAbstractEventDispatcher *createEventDispatcher(QThreadData *data);
|
||||
|
@ -100,10 +100,6 @@
|
||||
#include <sys/neutrino.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_WASM)
|
||||
#include <emscripten/val.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if QT_CONFIG(thread)
|
||||
@ -454,6 +450,10 @@ Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
|
||||
# define _SC_NPROCESSORS_ONLN 84
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WASM
|
||||
int QThreadPrivate::idealThreadCount = 1;
|
||||
#endif
|
||||
|
||||
int QThread::idealThreadCount() Q_DECL_NOTHROW
|
||||
{
|
||||
int cores = 1;
|
||||
@ -503,7 +503,7 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
|
||||
cores = 1;
|
||||
# endif
|
||||
#elif defined(Q_OS_WASM)
|
||||
cores = emscripten::val::global("navigator")["hardwareConcurrency"].as<int>();
|
||||
cores = QThreadPrivate::idealThreadCount;
|
||||
#else
|
||||
// the rest: Linux, Solaris, AIX, Tru64
|
||||
cores = (int)sysconf(_SC_NPROCESSORS_ONLN);
|
||||
|
@ -440,7 +440,7 @@ void QOpenGLWindow::makeCurrent()
|
||||
d->context->makeCurrent(this);
|
||||
} else {
|
||||
if (!d->offscreenSurface) {
|
||||
d->offscreenSurface.reset(new QOffscreenSurface);
|
||||
d->offscreenSurface.reset(new QOffscreenSurface(screen()));
|
||||
d->offscreenSurface->setFormat(d->context->format());
|
||||
d->offscreenSurface->create();
|
||||
}
|
||||
|
@ -695,7 +695,8 @@ static QStringList familyList(const QFontDef &req)
|
||||
if ((str.startsWith(QLatin1Char('"')) && str.endsWith(QLatin1Char('"')))
|
||||
|| (str.startsWith(QLatin1Char('\'')) && str.endsWith(QLatin1Char('\''))))
|
||||
str = str.mid(1, str.length() - 2);
|
||||
family_list << str.toString();
|
||||
if (!family_list.contains(str))
|
||||
family_list << str.toString();
|
||||
}
|
||||
}
|
||||
// append the substitute list for each family in family_list
|
||||
|
@ -77,11 +77,12 @@
|
||||
|
||||
\section1 Import and Export Restrictions
|
||||
|
||||
Due to import and export restrictions in some parts of the world, we
|
||||
are unable to supply the OpenSSL Toolkit with Qt packages. Developers wishing
|
||||
to use SSL communication in their deployed applications should either ensure
|
||||
that their users have the appropriate libraries installed, or they should
|
||||
consult a suitably qualified legal professional to ensure that applications
|
||||
using code from the OpenSSL project are correctly certified for import
|
||||
and export in relevant regions of the world.
|
||||
Qt binary installers include the OpenSSL libraries used by QtNetwork. However,
|
||||
those are not automatically deployed with applications that are built with Qt.
|
||||
Import and export restrictions apply for some types of software, and for
|
||||
some parts of the world. Developers wishing to use SSL communication in their
|
||||
deployed applications should either ensure that their users have the appropriate
|
||||
libraries installed, or they should consult a suitably qualified legal
|
||||
professional to ensure that applications using code from the OpenSSL project
|
||||
are correctly certified for import and export in relevant regions of the world.
|
||||
*/
|
||||
|
@ -55,6 +55,12 @@ QWasmBackingStore::~QWasmBackingStore()
|
||||
{
|
||||
}
|
||||
|
||||
void QWasmBackingStore::destroy()
|
||||
{
|
||||
if (m_texture->isCreated())
|
||||
m_texture->destroy();
|
||||
}
|
||||
|
||||
QPaintDevice *QWasmBackingStore::paintDevice()
|
||||
{
|
||||
return &m_image;
|
||||
|
@ -44,6 +44,7 @@ class QWasmBackingStore : public QPlatformBackingStore
|
||||
public:
|
||||
QWasmBackingStore(QWasmCompositor *compositor, QWindow *window);
|
||||
~QWasmBackingStore();
|
||||
void destroy();
|
||||
|
||||
QPaintDevice *paintDevice() override;
|
||||
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <QtGui/qopenglcontext.h>
|
||||
#include <QtGui/qopenglfunctions.h>
|
||||
#include <QtGui/qopengltextureblitter.h>
|
||||
#include <QtGui/qoffscreensurface.h>
|
||||
#include <QtGui/qpainter.h>
|
||||
#include <private/qpixmapcache_p.h>
|
||||
|
||||
@ -71,6 +72,28 @@ QWasmCompositor::QWasmCompositor(QWasmScreen *screen)
|
||||
QWasmCompositor::~QWasmCompositor()
|
||||
{
|
||||
delete m_frameBuffer;
|
||||
destroy();
|
||||
}
|
||||
|
||||
void QWasmCompositor::destroy()
|
||||
{
|
||||
// Destroy OpenGL resources. This is done here in a separate function
|
||||
// which can be called while screen() still returns a valid screen
|
||||
// (which it might not, during destruction). A valid QScreen is
|
||||
// a requirement for QOffscreenSurface on Wasm since the native
|
||||
// context is tied to a single canvas.
|
||||
if (m_context) {
|
||||
QOffscreenSurface offScreenSurface(screen()->screen());
|
||||
offScreenSurface.setFormat(m_context->format());
|
||||
offScreenSurface.create();
|
||||
m_context->makeCurrent(&offScreenSurface);
|
||||
for (QWasmWindow *window : m_windowStack)
|
||||
window->destroy();
|
||||
m_blitter.reset(nullptr);
|
||||
m_context.reset(nullptr);
|
||||
}
|
||||
|
||||
m_isEnabled = false; // prevent frame() from creating a new m_context
|
||||
}
|
||||
|
||||
void QWasmCompositor::setEnabled(bool enabled)
|
||||
@ -251,10 +274,13 @@ void QWasmCompositor::blit(QOpenGLTextureBlitter *blitter, QWasmScreen *screen,
|
||||
void QWasmCompositor::drawWindowContent(QOpenGLTextureBlitter *blitter, QWasmScreen *screen, QWasmWindow *window)
|
||||
{
|
||||
QWasmBackingStore *backingStore = window->backingStore();
|
||||
if (!backingStore)
|
||||
return;
|
||||
|
||||
QOpenGLTexture const *texture = backingStore->getUpdatedTexture();
|
||||
|
||||
blit(blitter, screen, texture, window->geometry());
|
||||
QPoint windowCanvasPosition = window->geometry().topLeft() - screen->geometry().topLeft();
|
||||
QRect windowCanvasGeometry = QRect(windowCanvasPosition, window->geometry().size());
|
||||
blit(blitter, screen, texture, windowCanvasGeometry);
|
||||
}
|
||||
|
||||
QPalette QWasmCompositor::makeWindowPalette()
|
||||
@ -650,7 +676,7 @@ void QWasmCompositor::frame()
|
||||
|
||||
m_needComposit = false;
|
||||
|
||||
if (m_windowStack.empty() || !screen())
|
||||
if (!m_isEnabled || m_windowStack.empty() || !screen())
|
||||
return;
|
||||
|
||||
QWasmWindow *someWindow = nullptr;
|
||||
@ -673,7 +699,9 @@ void QWasmCompositor::frame()
|
||||
m_context->create();
|
||||
}
|
||||
|
||||
m_context->makeCurrent(someWindow->window());
|
||||
bool ok = m_context->makeCurrent(someWindow->window());
|
||||
if (!ok)
|
||||
return;
|
||||
|
||||
if (!m_blitter->isCreated())
|
||||
m_blitter->create();
|
||||
|
@ -64,6 +64,7 @@ class QWasmCompositor : public QObject
|
||||
public:
|
||||
QWasmCompositor(QWasmScreen *screen);
|
||||
~QWasmCompositor();
|
||||
void destroy();
|
||||
|
||||
enum QWasmSubControl {
|
||||
SC_None = 0x00000000,
|
||||
|
@ -337,8 +337,6 @@ QWasmEventTranslator::QWasmEventTranslator(QWasmScreen *screen)
|
||||
|
||||
void QWasmEventTranslator::initEventHandlers()
|
||||
{
|
||||
qDebug() << "QWasmEventTranslator::initEventHandlers";
|
||||
|
||||
QByteArray _canvasId = screen()->canvasId().toUtf8();
|
||||
const char *canvasId = _canvasId.constData();
|
||||
|
||||
@ -377,9 +375,6 @@ void QWasmEventTranslator::initEventHandlers()
|
||||
emscripten_set_touchend_callback(canvasId, (void *)this, 1, &touchCallback);
|
||||
emscripten_set_touchmove_callback(canvasId, (void *)this, 1, &touchCallback);
|
||||
emscripten_set_touchcancel_callback(canvasId, (void *)this, 1, &touchCallback);
|
||||
|
||||
emscripten_set_resize_callback(nullptr, (void *)this, 1, uiEvent_cb); // Note: handles browser window resize
|
||||
|
||||
}
|
||||
|
||||
template <typename Event>
|
||||
@ -911,19 +906,4 @@ bool QWasmEventTranslator::processKeyboard(int eventType, const EmscriptenKeyboa
|
||||
return accepted;
|
||||
}
|
||||
|
||||
int QWasmEventTranslator::uiEvent_cb(int eventType, const EmscriptenUiEvent *e, void *userData)
|
||||
{
|
||||
Q_UNUSED(e)
|
||||
QWasmEventTranslator *eventTranslator = static_cast<QWasmEventTranslator *>(userData);
|
||||
|
||||
if (eventType == EMSCRIPTEN_EVENT_RESIZE) {
|
||||
// This resize event is called when the HTML window is resized. Depending
|
||||
// on the page layout the the canvas might also have been resized, so we
|
||||
// update the Qt screen size (and canvas render size).
|
||||
eventTranslator->screen()->updateQScreenAndCanvasRenderSize();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -57,8 +57,6 @@ public:
|
||||
|
||||
static int touchCallback(int eventType, const EmscriptenTouchEvent *ev, void *userData);
|
||||
|
||||
static int uiEvent_cb(int eventType, const EmscriptenUiEvent *e, void *userData);
|
||||
|
||||
void processEvents();
|
||||
void initEventHandlers();
|
||||
int handleTouch(int eventType, const EmscriptenTouchEvent *touchEvent);
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "qwasmtheme.h"
|
||||
#include "qwasmclipboard.h"
|
||||
#include "qwasmservices.h"
|
||||
#include "qwasmoffscreensurface.h"
|
||||
|
||||
#include "qwasmwindow.h"
|
||||
#ifndef QT_NO_OPENGL
|
||||
@ -123,6 +124,21 @@ QWasmIntegration::QWasmIntegration()
|
||||
}
|
||||
|
||||
emscripten::val::global("window").set("onbeforeunload", val::module_property("qtBrowserBeforeUnload"));
|
||||
|
||||
// install browser window resize handler
|
||||
auto onWindowResize = [](int eventType, const EmscriptenUiEvent *e, void *userData) -> int {
|
||||
Q_UNUSED(eventType);
|
||||
Q_UNUSED(e);
|
||||
Q_UNUSED(userData);
|
||||
|
||||
// This resize event is called when the HTML window is resized. Depending
|
||||
// on the page layout the the canvas(es) might also have been resized, so we
|
||||
// update the Qt screen sizes (and canvas render sizes).
|
||||
if (QWasmIntegration *integration = QWasmIntegration::get())
|
||||
integration->resizeAllScreens();
|
||||
return 0;
|
||||
};
|
||||
emscripten_set_resize_callback(nullptr, nullptr, 1, onWindowResize);
|
||||
}
|
||||
|
||||
QWasmIntegration::~QWasmIntegration()
|
||||
@ -193,6 +209,11 @@ QPlatformInputContext *QWasmIntegration::inputContext() const
|
||||
return m_inputContext.data();
|
||||
}
|
||||
|
||||
QPlatformOffscreenSurface *QWasmIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
|
||||
{
|
||||
return new QWasmOffscrenSurface(surface);
|
||||
}
|
||||
|
||||
QPlatformFontDatabase *QWasmIntegration::fontDatabase() const
|
||||
{
|
||||
if (m_fontDb == nullptr)
|
||||
@ -257,7 +278,9 @@ void QWasmIntegration::addScreen(const QString &canvasId)
|
||||
|
||||
void QWasmIntegration::removeScreen(const QString &canvasId)
|
||||
{
|
||||
QWindowSystemInterface::handleScreenRemoved(m_screens.take(canvasId));
|
||||
QWasmScreen *exScreen = m_screens.take(canvasId);
|
||||
exScreen->destroy(); // clean up before deleting the screen
|
||||
QWindowSystemInterface::handleScreenRemoved(exScreen);
|
||||
}
|
||||
|
||||
void QWasmIntegration::resizeScreen(const QString &canvasId)
|
||||
@ -275,4 +298,11 @@ void QWasmIntegration::updateDpi()
|
||||
QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen->screen(), dpiValue, dpiValue);
|
||||
}
|
||||
|
||||
void QWasmIntegration::resizeAllScreens()
|
||||
{
|
||||
qDebug() << "resizeAllScreens";
|
||||
for (QWasmScreen *screen : m_screens)
|
||||
screen->updateQScreenAndCanvasRenderSize();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -66,6 +66,7 @@ public:
|
||||
#ifndef QT_NO_OPENGL
|
||||
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
|
||||
#endif
|
||||
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
|
||||
QPlatformFontDatabase *fontDatabase() const override;
|
||||
QAbstractEventDispatcher *createEventDispatcher() const override;
|
||||
QVariant styleHint(QPlatformIntegration::StyleHint hint) const override;
|
||||
@ -85,6 +86,7 @@ public:
|
||||
void addScreen(const QString &canvasId);
|
||||
void removeScreen(const QString &canvasId);
|
||||
void resizeScreen(const QString &canvasId);
|
||||
void resizeAllScreens();
|
||||
void updateDpi();
|
||||
|
||||
private:
|
||||
|
41
src/plugins/platforms/wasm/qwasmoffscreensurface.cpp
Normal file
41
src/plugins/platforms/wasm/qwasmoffscreensurface.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:GPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 or (at your option) any later version
|
||||
** approved by the KDE Free Qt Foundation. The licenses are as published by
|
||||
** the Free Software Foundation and appearing in the file LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qwasmoffscreensurface.h"
|
||||
|
||||
QWasmOffscrenSurface::QWasmOffscrenSurface(QOffscreenSurface *offscreenSurface)
|
||||
:QPlatformOffscreenSurface(offscreenSurface)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QWasmOffscrenSurface::~QWasmOffscrenSurface()
|
||||
{
|
||||
|
||||
}
|
49
src/plugins/platforms/wasm/qwasmoffscreensurface.h
Normal file
49
src/plugins/platforms/wasm/qwasmoffscreensurface.h
Normal file
@ -0,0 +1,49 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:GPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 or (at your option) any later version
|
||||
** approved by the KDE Free Qt Foundation. The licenses are as published by
|
||||
** the Free Software Foundation and appearing in the file LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QWASMOFFSCREENSURFACE_H
|
||||
#define QWASMOFFSCREENSURFACE_H
|
||||
|
||||
#include <qpa/qplatformoffscreensurface.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QOffscreenSurface;
|
||||
class QWasmOffscrenSurface : public QPlatformOffscreenSurface
|
||||
{
|
||||
public:
|
||||
explicit QWasmOffscrenSurface(QOffscreenSurface *offscreenSurface);
|
||||
~QWasmOffscrenSurface();
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
@ -49,40 +49,31 @@ QWasmOpenGLContext::QWasmOpenGLContext(const QSurfaceFormat &format)
|
||||
|
||||
QWasmOpenGLContext::~QWasmOpenGLContext()
|
||||
{
|
||||
if (m_context)
|
||||
if (m_context) {
|
||||
emscripten_webgl_destroy_context(m_context);
|
||||
m_context = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void QWasmOpenGLContext::maybeRecreateEmscriptenContext(QPlatformSurface *surface)
|
||||
bool QWasmOpenGLContext::maybeCreateEmscriptenContext(QPlatformSurface *surface)
|
||||
{
|
||||
// Native emscripten contexts are tied to a single surface. Recreate
|
||||
// the context if the surface is changed.
|
||||
if (surface != m_surface) {
|
||||
m_surface = surface;
|
||||
// Native emscripten/WebGL contexts are tied to a single screen/canvas. The first
|
||||
// call to this function creates a native canvas for the given screen, subsequent
|
||||
// calls verify that the surface is on/off the same screen.
|
||||
QPlatformScreen *screen = surface->screen();
|
||||
if (m_context && !screen)
|
||||
return false; // Alternative: return true to support makeCurrent on QOffScreenSurface with
|
||||
// no screen. However, Qt likes to substitute QGuiApplication::primaryScreen()
|
||||
// for null screens, which foils this plan.
|
||||
if (!screen)
|
||||
return false;
|
||||
if (m_context)
|
||||
return m_screen == screen;
|
||||
|
||||
// Destroy existing context
|
||||
if (m_context)
|
||||
emscripten_webgl_destroy_context(m_context);
|
||||
|
||||
// Create new context
|
||||
const QString canvasId = QWasmScreen::get(surface->screen())->canvasId();
|
||||
m_context = createEmscriptenContext(canvasId, m_requestedFormat);
|
||||
|
||||
// Register context-lost callback.
|
||||
auto callback = [](int eventType, const void *reserved, void *userData) -> EM_BOOL
|
||||
{
|
||||
Q_UNUSED(eventType);
|
||||
Q_UNUSED(reserved);
|
||||
// The application may get contex-lost if e.g. moved to the background. Set
|
||||
// m_contextLost which will make isValid() return false. Application code will
|
||||
// then detect this and recrate the the context, resulting in a new QWasmOpenGLContext
|
||||
// instance.
|
||||
reinterpret_cast<QWasmOpenGLContext *>(userData)->m_contextLost = true;
|
||||
return true;
|
||||
};
|
||||
bool capture = true;
|
||||
emscripten_set_webglcontextlost_callback(canvasId.toLocal8Bit().constData(), this, capture, callback);
|
||||
}
|
||||
QString canvasId = QWasmScreen::get(screen)->canvasId();
|
||||
m_context = createEmscriptenContext(canvasId, m_requestedFormat);
|
||||
m_screen = screen;
|
||||
return true;
|
||||
}
|
||||
|
||||
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE QWasmOpenGLContext::createEmscriptenContext(const QString &canvasId, QSurfaceFormat format)
|
||||
@ -125,7 +116,9 @@ GLuint QWasmOpenGLContext::defaultFramebufferObject(QPlatformSurface *surface) c
|
||||
|
||||
bool QWasmOpenGLContext::makeCurrent(QPlatformSurface *surface)
|
||||
{
|
||||
maybeRecreateEmscriptenContext(surface);
|
||||
bool ok = maybeCreateEmscriptenContext(surface);
|
||||
if (!ok)
|
||||
return false;
|
||||
|
||||
return emscripten_webgl_make_context_current(m_context) == EMSCRIPTEN_RESULT_SUCCESS;
|
||||
}
|
||||
@ -148,7 +141,9 @@ bool QWasmOpenGLContext::isSharing() const
|
||||
|
||||
bool QWasmOpenGLContext::isValid() const
|
||||
{
|
||||
return (m_contextLost == false);
|
||||
// Note: we get isValid() calls before we see the surface and can
|
||||
// create a native context, so no context is also a valid state.
|
||||
return !m_context || !emscripten_is_webgl_context_lost(m_context);
|
||||
}
|
||||
|
||||
QFunctionPointer QWasmOpenGLContext::getProcAddress(const char *procName)
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QPlatformScreen;
|
||||
class QWasmOpenGLContext : public QPlatformOpenGLContext
|
||||
{
|
||||
public:
|
||||
@ -50,12 +51,11 @@ public:
|
||||
QFunctionPointer getProcAddress(const char *procName) override;
|
||||
|
||||
private:
|
||||
void maybeRecreateEmscriptenContext(QPlatformSurface *surface);
|
||||
bool maybeCreateEmscriptenContext(QPlatformSurface *surface);
|
||||
static EMSCRIPTEN_WEBGL_CONTEXT_HANDLE createEmscriptenContext(const QString &canvasId, QSurfaceFormat format);
|
||||
|
||||
bool m_contextLost = false;
|
||||
QSurfaceFormat m_requestedFormat;
|
||||
QPlatformSurface *m_surface = nullptr;
|
||||
QPlatformScreen *m_screen = nullptr;
|
||||
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE m_context = 0;
|
||||
};
|
||||
|
||||
|
@ -58,7 +58,12 @@ QWasmScreen::QWasmScreen(const QString &canvasId)
|
||||
|
||||
QWasmScreen::~QWasmScreen()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
void QWasmScreen::destroy()
|
||||
{
|
||||
m_compositor->destroy();
|
||||
}
|
||||
|
||||
QWasmScreen *QWasmScreen::get(QPlatformScreen *screen)
|
||||
|
@ -52,6 +52,7 @@ class QWasmScreen : public QObject, public QPlatformScreen
|
||||
public:
|
||||
QWasmScreen(const QString &canvasId);
|
||||
~QWasmScreen();
|
||||
void destroy();
|
||||
|
||||
static QWasmScreen *get(QPlatformScreen *screen);
|
||||
static QWasmScreen *get(QScreen *screen);
|
||||
|
@ -65,6 +65,12 @@ QWasmWindow::~QWasmWindow()
|
||||
m_compositor->removeWindow(this);
|
||||
}
|
||||
|
||||
void QWasmWindow::destroy()
|
||||
{
|
||||
if (m_backingStore)
|
||||
m_backingStore->destroy();
|
||||
}
|
||||
|
||||
void QWasmWindow::initialize()
|
||||
{
|
||||
QRect rect = windowGeometry();
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
|
||||
QWasmWindow(QWindow *w, QWasmCompositor *compositor, QWasmBackingStore *backingStore);
|
||||
~QWasmWindow();
|
||||
void destroy();
|
||||
|
||||
void initialize() override;
|
||||
|
||||
|
@ -20,7 +20,8 @@ SOURCES = \
|
||||
qwasmopenglcontext.cpp \
|
||||
qwasmtheme.cpp \
|
||||
qwasmclipboard.cpp \
|
||||
qwasmservices.cpp
|
||||
qwasmservices.cpp \
|
||||
qwasmoffscreensurface.cpp
|
||||
|
||||
HEADERS = \
|
||||
qwasmintegration.h \
|
||||
@ -35,7 +36,8 @@ HEADERS = \
|
||||
qwasmopenglcontext.h \
|
||||
qwasmtheme.h \
|
||||
qwasmclipboard.h \
|
||||
qwasmservices.h
|
||||
qwasmservices.h \
|
||||
qwasmoffscreensurface.h
|
||||
|
||||
wasmfonts.files = \
|
||||
../../../3rdparty/wasm/Vera.ttf \
|
||||
|
@ -1509,7 +1509,7 @@ int QComboBox::maxCount() const
|
||||
/*!
|
||||
\obsolete
|
||||
|
||||
Use setCompleter() instead.
|
||||
Use completer() instead.
|
||||
*/
|
||||
bool QComboBox::autoCompletion() const
|
||||
{
|
||||
|
@ -96,10 +96,13 @@ public:
|
||||
|
||||
#if QT_CONFIG(completer)
|
||||
#if QT_DEPRECATED_SINCE(5, 13)
|
||||
QT_DEPRECATED_X("Use completer() instead.")
|
||||
bool autoCompletion() const;
|
||||
QT_DEPRECATED_X("Use setCompleter() instead.")
|
||||
void setAutoCompletion(bool enable);
|
||||
|
||||
QT_DEPRECATED_X("Use completer()->caseSensitivity() instead.")
|
||||
Qt::CaseSensitivity autoCompletionCaseSensitivity() const;
|
||||
QT_DEPRECATED_X("Use completer()->setCaseSensitivity() instead.")
|
||||
void setAutoCompletionCaseSensitivity(Qt::CaseSensitivity sensitivity);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -852,8 +852,8 @@ void tst_QComboBox::autoCompletionCaseSensitivity()
|
||||
// case insensitive
|
||||
testWidget->clearEditText();
|
||||
QSignalSpy spyReturn(testWidget, SIGNAL(activated(int)));
|
||||
testWidget->setAutoCompletionCaseSensitivity(Qt::CaseInsensitive);
|
||||
QCOMPARE(testWidget->autoCompletionCaseSensitivity(), Qt::CaseInsensitive);
|
||||
testWidget->completer()->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
QCOMPARE(testWidget->completer()->caseSensitivity(), Qt::CaseInsensitive);
|
||||
|
||||
QTest::keyClick(testWidget->lineEdit(), Qt::Key_A);
|
||||
qApp->processEvents();
|
||||
@ -886,8 +886,8 @@ void tst_QComboBox::autoCompletionCaseSensitivity()
|
||||
|
||||
// case sensitive
|
||||
testWidget->clearEditText();
|
||||
testWidget->setAutoCompletionCaseSensitivity(Qt::CaseSensitive);
|
||||
QCOMPARE(testWidget->autoCompletionCaseSensitivity(), Qt::CaseSensitive);
|
||||
testWidget->completer()->setCaseSensitivity(Qt::CaseSensitive);
|
||||
QCOMPARE(testWidget->completer()->caseSensitivity(), Qt::CaseSensitive);
|
||||
QTest::keyClick(testWidget->lineEdit(), Qt::Key_A);
|
||||
qApp->processEvents();
|
||||
QCOMPARE(testWidget->currentText(), QString("aww"));
|
||||
|
Loading…
Reference in New Issue
Block a user