Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: src/corelib/tools/tools.pri Change-Id: I705630f9cecbf0ce51a22fc6116b8c49611259e9
This commit is contained in:
commit
942ab49072
@ -76,8 +76,8 @@ sub normalizePath {
|
||||
# set output basedir to be where ever syncqt is run from
|
||||
our $out_basedir = getcwd();
|
||||
normalizePath(\$out_basedir);
|
||||
our $build_basedir = $out_basedir;
|
||||
our $basedir;
|
||||
our $quoted_basedir;
|
||||
|
||||
# Make sure we use Windows line endings for chomp and friends on Windows.
|
||||
$INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys");
|
||||
@ -129,6 +129,7 @@ sub showUsage
|
||||
print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n";
|
||||
print " -minimal Do not create CamelCase headers (default: " . ($minimal ? "yes" : "no") . ")\n";
|
||||
print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n";
|
||||
print " -builddir <PATH> Specify build directory for sync (default: $build_basedir)\n";
|
||||
print " -version <VERSION> Specify the module's version (default: detect from qglobal.h)\n";
|
||||
print " -quiet Only report problems, not activity (same as -verbose 0)\n";
|
||||
print " -v, -verbose <level> Sets the verbosity level (max. 4) (default: $verbose_level)\n";
|
||||
@ -648,17 +649,16 @@ sub listSubdirs {
|
||||
######################################################################
|
||||
# Syntax: loadSyncProfile()
|
||||
#
|
||||
# Purpose: Locates the sync.profile.
|
||||
# Returns: Hashmap of module name -> directory.
|
||||
# Purpose: Loads the sync.profile.
|
||||
######################################################################
|
||||
sub loadSyncProfile {
|
||||
my ($srcbase, $outbase) = @_;
|
||||
if ($verbose_level) {
|
||||
print("<srcbase> = $$srcbase \n");
|
||||
print("<outbase> = $$outbase \n");
|
||||
print("<srcbase> = $basedir \n");
|
||||
print("<bldbase> = $build_basedir \n");
|
||||
print("<outbase> = $out_basedir \n");
|
||||
}
|
||||
|
||||
my $syncprofile = "$$srcbase/sync.profile";
|
||||
my $syncprofile = "$basedir/sync.profile";
|
||||
my $result;
|
||||
unless ($result = do "$syncprofile") {
|
||||
die "syncqt couldn't parse $syncprofile: $@" if $@;
|
||||
@ -670,13 +670,12 @@ sub loadSyncProfile {
|
||||
$reverse_classnames{$cn} = $fn;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
sub basePrettify {
|
||||
my ($arg) = @_;
|
||||
$$arg =~ s,^\Q$basedir\E,<srcbase>,;
|
||||
$$arg =~ s,^\Q$build_basedir\E,<bldbase>,;
|
||||
$$arg =~ s,^\Q$out_basedir\E,<outbase>,;
|
||||
}
|
||||
|
||||
@ -686,6 +685,11 @@ sub cleanPath {
|
||||
return $arg;
|
||||
}
|
||||
|
||||
######################################################################
|
||||
# Syntax: locateSyncProfile()
|
||||
#
|
||||
# Purpose: Locates the sync.profile.
|
||||
######################################################################
|
||||
sub locateSyncProfile
|
||||
{
|
||||
my ($directory) = @_;
|
||||
@ -724,11 +728,10 @@ sub globosort($$) {
|
||||
}
|
||||
|
||||
# check if this is an in-source build, and if so use that as the basedir too
|
||||
$basedir = locateSyncProfile($out_basedir);
|
||||
$basedir = locateSyncProfile($build_basedir);
|
||||
if ($basedir) {
|
||||
$basedir = dirname($basedir) ;
|
||||
normalizePath(\$basedir);
|
||||
$quoted_basedir = "\Q$basedir";
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
@ -750,6 +753,9 @@ while ( @ARGV ) {
|
||||
} elsif($arg eq "-o" || $arg eq "-outdir") {
|
||||
$var = "output";
|
||||
$val = shift @ARGV;
|
||||
} elsif($arg eq "-builddir") {
|
||||
$var = "build";
|
||||
$val = shift @ARGV;
|
||||
} elsif($arg eq "-showonly" || $arg eq "-remove-stale" || $arg eq "-windows" ||
|
||||
$arg eq "-relative" || $arg eq "-check-includes") {
|
||||
$var = substr($arg, 1);
|
||||
@ -796,7 +802,6 @@ while ( @ARGV ) {
|
||||
die "Could not find a sync.profile for '$arg'\n" if (!$basedir);
|
||||
$basedir = dirname($basedir);
|
||||
normalizePath(\$basedir);
|
||||
$quoted_basedir = "\Q$basedir";
|
||||
$var = "ignore";
|
||||
}
|
||||
|
||||
@ -877,6 +882,16 @@ while ( @ARGV ) {
|
||||
$out_basedir = $outdir;
|
||||
}
|
||||
normalizePath(\$out_basedir);
|
||||
} elsif ($var eq "build") {
|
||||
my $outdir = $val;
|
||||
if (checkRelative($outdir)) {
|
||||
$build_basedir = getcwd();
|
||||
chomp $build_basedir;
|
||||
$build_basedir .= "/" . $outdir;
|
||||
} else {
|
||||
$build_basedir = $outdir;
|
||||
}
|
||||
normalizePath(\$build_basedir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -892,7 +907,7 @@ our @ignore_for_qt_module_check = ();
|
||||
our %inject_headers = ();
|
||||
|
||||
# load the module's sync.profile here, before we can
|
||||
loadSyncProfile(\$basedir, \$out_basedir);
|
||||
loadSyncProfile();
|
||||
|
||||
@modules_to_sync = keys(%modules) if($#modules_to_sync == -1);
|
||||
|
||||
@ -941,7 +956,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
for my $p (keys %inject_headers) {
|
||||
next unless ($p =~ /^\Q$dir\E(\/|$)/);
|
||||
my $sp = $p;
|
||||
$sp =~ s,^\Q$basedir\E/,$out_basedir/,;
|
||||
$sp =~ s,^\Q$basedir\E/,$build_basedir/,;
|
||||
for my $n (@{$inject_headers{$p}}) {
|
||||
$injections{$sp."/".$n} = 1;
|
||||
}
|
||||
@ -1039,7 +1054,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
my $requires;
|
||||
my $iheader_src = $subdir . "/" . $header;
|
||||
my $iheader = $iheader_src;
|
||||
$iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
|
||||
$iheader =~ s/^\Q$basedir\E/$build_basedir/ if ($shadow);
|
||||
if ($check_includes) {
|
||||
# We need both $public_header and $private_header because QPA headers count as neither
|
||||
my $private_header = !$public_header && !$qpa_header
|
||||
|
@ -1,47 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the config.tests of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** 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 Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or 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.GPL2 and 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-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <D3D11.h>
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
D3D11_QUERY_DATA_TIMESTAMP_DISJOINT qdtd;
|
||||
(void)qdtd;
|
||||
return 0;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
SOURCES = angle_d3d11_qdtd.cpp
|
||||
CONFIG -= qt
|
||||
CONFIG += console
|
@ -126,6 +126,9 @@ Build options:
|
||||
|
||||
-sanitize {address|thread|memory|undefined}
|
||||
Instrument with the specified compiler sanitizer.
|
||||
Note that some sanitizers cannot be combined;
|
||||
for example, -sanitize address cannot be combined with
|
||||
-sanitize thread.
|
||||
|
||||
-c++std <edition> .... Select C++ standard <edition> [c++1z/c++14/c++11]
|
||||
(Not supported with MSVC)
|
||||
|
6
dist/changes-5.9.4
vendored
6
dist/changes-5.9.4
vendored
@ -65,6 +65,12 @@ QtCore
|
||||
QtNetwork
|
||||
---------
|
||||
|
||||
- Bearer Management:
|
||||
* [QTBUG-40332] The nativewifi (Windows) bearer plugin was determined
|
||||
to be causing network interference in the form of system-wide higher
|
||||
latency and has been disabled. The CoreWlan (macOS) plugin has also
|
||||
been disabled.
|
||||
|
||||
- QUdpSocket:
|
||||
* [QTBUG-64718] Fixed a regression from Qt 5.9.3 caused by an apparent
|
||||
Win32 API quirk we triggered when using readDatagram(), resulting in
|
||||
|
@ -18,6 +18,7 @@ macro.QA = "\\e{Qt Assistant}"
|
||||
macro.QD = "\\e{Qt Designer}"
|
||||
macro.QL = "\\e{Qt Linguist}"
|
||||
macro.QQV = "\\e{Qt QML Viewer}"
|
||||
macro.QtVersion = "$QT_VERSION"
|
||||
macro.param = "\\e"
|
||||
macro.raisedaster.HTML = "<sup>*</sup>"
|
||||
macro.rarrow.HTML = "→"
|
||||
|
@ -3,4 +3,8 @@ requires(qtHaveModule(widgets))
|
||||
TEMPLATE = subdirs
|
||||
|
||||
qtConfig(sharedmemory): SUBDIRS = sharedmemory
|
||||
qtHaveModule(network): SUBDIRS += localfortuneserver localfortuneclient
|
||||
qtHaveModule(network) {
|
||||
QT_FOR_CONFIG += network
|
||||
|
||||
qtConfig(localserver): SUBDIRS += localfortuneserver localfortuneclient
|
||||
}
|
||||
|
@ -111,6 +111,7 @@ void RasterWindow::renderNow()
|
||||
|
||||
painter.fillRect(0, 0, width(), height(), Qt::white);
|
||||
render(&painter);
|
||||
painter.end();
|
||||
|
||||
m_backingStore->endPaint();
|
||||
m_backingStore->flush(rect);
|
||||
|
@ -64,6 +64,8 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
QSurfaceFormat fmt;
|
||||
fmt.setDepthBufferSize(24);
|
||||
|
||||
@ -79,8 +81,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
QSurfaceFormat::setDefaultFormat(fmt);
|
||||
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
GLWindow glWindow;
|
||||
glWindow.showMaximized();
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
/*!
|
||||
\example widgets/validators
|
||||
\title Validators Example
|
||||
\ingroup examples-widgets
|
||||
\brief The Validators example shows the signal emission behavior of input
|
||||
validators.
|
||||
|
||||
|
@ -52,8 +52,15 @@
|
||||
#include <QFileDialog>
|
||||
#include <QTextStream>
|
||||
#include <QMessageBox>
|
||||
#if defined(QT_PRINTSUPPORT_LIB)
|
||||
#include <QtPrintSupport/qtprintsupportglobal.h>
|
||||
#if QT_CONFIG(printer)
|
||||
#if QT_CONFIG(printdialog)
|
||||
#include <QPrintDialog>
|
||||
#endif // QT_CONFIG(printdialog)
|
||||
#include <QPrinter>
|
||||
#endif // QT_CONFIG(printer)
|
||||
#endif // QT_PRINTSUPPORT_LIB
|
||||
#include <QFont>
|
||||
#include <QFontDialog>
|
||||
|
||||
@ -136,11 +143,15 @@ void Notepad::on_actionSave_as_triggered()
|
||||
|
||||
void Notepad::on_actionPrint_triggered()
|
||||
{
|
||||
#if QT_CONFIG(printer)
|
||||
QPrinter printDev;
|
||||
#if QT_CONFIG(printdialog)
|
||||
QPrintDialog dialog(&printDev, this);
|
||||
if (dialog.exec() == QDialog::Rejected)
|
||||
return;
|
||||
#endif // QT_CONFIG(printdialog)
|
||||
ui->textEdit->print(&printDev);
|
||||
#endif // QT_CONFIG(printer)
|
||||
}
|
||||
|
||||
void Notepad::on_actionExit_triggered()
|
||||
|
@ -1,7 +1,7 @@
|
||||
TEMPLATE = app
|
||||
TARGET = notepad
|
||||
|
||||
QT += printsupport
|
||||
qtHaveModule(printsupport): QT += printsupport
|
||||
requires(qtConfig(fontdialog))
|
||||
|
||||
SOURCES += \
|
||||
|
@ -15,7 +15,7 @@
|
||||
MAKEFILE_GENERATOR = MSVC.NET
|
||||
QMAKE_PLATFORM = win32
|
||||
QMAKE_COMPILER = msvc
|
||||
CONFIG += incremental flat debug_and_release debug_and_release_target precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe
|
||||
CONFIG += flat debug_and_release debug_and_release_target precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe
|
||||
DEFINES += UNICODE _UNICODE WIN32
|
||||
QMAKE_COMPILER_DEFINES += _WIN32
|
||||
contains(QMAKE_TARGET.arch, x86_64) {
|
||||
@ -23,6 +23,7 @@ contains(QMAKE_TARGET.arch, x86_64) {
|
||||
QMAKE_COMPILER_DEFINES += _WIN64
|
||||
}
|
||||
|
||||
QMAKE_CFLAGS_OPTIMIZE_DEBUG = -Od
|
||||
QMAKE_CFLAGS_OPTIMIZE = -O2
|
||||
QMAKE_CFLAGS_OPTIMIZE_SIZE = -O1
|
||||
|
||||
@ -94,7 +95,8 @@ QMAKE_EXTENSION_SHLIB = dll
|
||||
QMAKE_PREFIX_STATICLIB =
|
||||
QMAKE_EXTENSION_STATICLIB = lib
|
||||
|
||||
QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib
|
||||
QMAKE_LIBS =
|
||||
QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib uuid.lib user32.lib advapi32.lib
|
||||
QMAKE_LIBS_NETWORK = ws2_32.lib
|
||||
QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib
|
||||
QMAKE_LIBS_OPENGL_ES2 = gdi32.lib user32.lib
|
||||
|
@ -100,6 +100,11 @@ greaterThan(QMAKE_MSC_VER, 1909) {
|
||||
# API is used in direct2d, but also in multimedia, positioning and sensors.
|
||||
# We can try again with a later version of Visual Studio.
|
||||
# QMAKE_CXXFLAGS_STRICTCXX = -permissive-
|
||||
# MSVC partially supports the following, but '__cplusplus' definition is set
|
||||
# as for C++98 until MSVC fully conforms with C++14, see
|
||||
# https://developercommunity.visualstudio.com/content/problem/139261/msvc-incorrectly-defines-cplusplus.html
|
||||
# QMAKE_CXXFLAGS_CXX14 = -std:c++14
|
||||
# QMAKE_CXXFLAGS_CXX1Z = -std:c++latest
|
||||
}
|
||||
|
||||
greaterThan(QMAKE_MSC_VER, 1910) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
contains(TEMPLATE, ".*app"):!build_pass: {
|
||||
contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
|
||||
|
||||
defineReplace(emitString) {
|
||||
return("\"$$replace(1, \\\\, \\\\)\"")
|
||||
|
@ -58,3 +58,10 @@ QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX
|
||||
xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP
|
||||
xcode_copy_phase_strip_setting.value = NO
|
||||
QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting
|
||||
|
||||
xcode_product_bundle_identifier_setting.name = PRODUCT_BUNDLE_IDENTIFIER
|
||||
xcode_product_bundle_identifier_setting.value = $$QMAKE_TARGET_BUNDLE_PREFIX
|
||||
isEmpty(xcode_product_bundle_identifier_setting.value): \
|
||||
xcode_product_bundle_identifier_setting.value = "com.yourcompany"
|
||||
xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.${PRODUCT_NAME:rfc1034identifier}"
|
||||
QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
|
||||
|
@ -44,19 +44,25 @@ contains(TEMPLATE, .*app): \
|
||||
for(ex, EXAMPLE_FILES): \
|
||||
sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_))
|
||||
for(res, RESOURCES) {
|
||||
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
|
||||
for(rline, rfile) {
|
||||
!contains(res, \\.qrc$): \
|
||||
next()
|
||||
rfile = $$absolute_path($$res, $$_PRO_FILE_PWD_)
|
||||
rpath = $$dirname(rfile)
|
||||
rcont = $$cat($$rfile, lines)
|
||||
for (rline, rcont) {
|
||||
resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
|
||||
!equals(resrc, $$rline): \
|
||||
sourcefiles += $$resrc
|
||||
sourcefiles += $$absolute_path($$resrc, $$rpath)
|
||||
}
|
||||
}
|
||||
for(res, RC_FILE) {
|
||||
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
|
||||
for(rline, rfile) {
|
||||
rfile = $$absolute_path($$res, $$_PRO_FILE_PWD_)
|
||||
rpath = $$dirname(rfile)
|
||||
rcont = $$cat($$rfile, lines)
|
||||
for (rline, rcont) {
|
||||
resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
|
||||
!equals(resrc, $$rline): \
|
||||
sourcefiles += $$resrc
|
||||
sourcefiles += $$absolute_path($$resrc, $$rpath)
|
||||
}
|
||||
}
|
||||
sourcefiles += \
|
||||
|
@ -274,7 +274,7 @@ load(qt_targets)
|
||||
else: \
|
||||
QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS/raw]
|
||||
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
|
||||
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
|
||||
QMAKE_PKGCONFIG_CFLAGS = -D$$MODULE_DEFINE -I${includedir}/$$MODULE_INCNAME
|
||||
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ")
|
||||
QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)
|
||||
for(i, MODULE_DEPENDS): \
|
||||
|
@ -22,7 +22,8 @@ load(qt_build_paths)
|
||||
for(mod, MODULE_INCNAME): \
|
||||
QMAKE_SYNCQT += -module $$mod
|
||||
QMAKE_SYNCQT += \
|
||||
-version $$VERSION -outdir $$system_quote($$MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR
|
||||
-version $$VERSION -outdir $$system_quote($$MODULE_BASE_OUTDIR) \
|
||||
-builddir $$system_quote($$shadowed($$MODULE_BASE_INDIR)) $$MODULE_SYNCQT_DIR
|
||||
!silent: message($$QMAKE_SYNCQT)
|
||||
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")
|
||||
|
||||
|
@ -44,7 +44,7 @@ unix {
|
||||
$${type}.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET)
|
||||
} else {
|
||||
# Windows
|
||||
!isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = $${TEST_TARGET_DIR}$${QMAKE_DIR_SEP}
|
||||
!isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = $$shell_path($$TEST_TARGET_DIR)$${QMAKE_DIR_SEP}
|
||||
$${type}.commands += $${TEST_TARGET_DIR}$(TARGET)
|
||||
}
|
||||
|
||||
|
@ -10,14 +10,19 @@
|
||||
load(device_config)
|
||||
include(../common/gcc-base.conf)
|
||||
include(../common/g++-base.conf)
|
||||
include(../common/angle.conf)
|
||||
include(../common/windows-vulkan.conf)
|
||||
|
||||
# modifications to gcc-base.conf and g++-base.conf
|
||||
|
||||
MAKEFILE_GENERATOR = MINGW
|
||||
QMAKE_PLATFORM = win32 mingw
|
||||
CONFIG += debug_and_release debug_and_release_target precompile_header
|
||||
DEFINES += UNICODE _UNICODE
|
||||
QMAKE_COMPILER_DEFINES += __GNUC__ WIN32
|
||||
DEFINES += UNICODE _UNICODE WIN32
|
||||
QMAKE_COMPILER_DEFINES += __GNUC__ _WIN32
|
||||
# can't add 'DEFINES += WIN64' and 'QMAKE_COMPILER_DEFINES += _WIN64' defines for
|
||||
# x86_64 platform similar to 'msvc-desktop.conf' toolchain, because, unlike for MSVC,
|
||||
# 'QMAKE_TARGET.arch' is inherently unavailable.
|
||||
|
||||
QMAKE_CC = $${CROSS_COMPILE}gcc
|
||||
QMAKE_LEX = flex
|
||||
@ -28,10 +33,10 @@ QMAKE_CFLAGS += -fno-keep-inline-dllexport
|
||||
QMAKE_CFLAGS_WARN_ON += -Wextra
|
||||
|
||||
QMAKE_CFLAGS_SSE2 += -mstackrealign
|
||||
QMAKE_CFLAGS_AESNI = -maes
|
||||
QMAKE_CFLAGS_SHANI = -msha
|
||||
|
||||
QMAKE_CXX = $${CROSS_COMPILE}g++
|
||||
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
|
||||
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
|
||||
QMAKE_CXXFLAGS_RTTI_ON = -frtti
|
||||
QMAKE_CXXFLAGS_RTTI_OFF = -fno-rtti
|
||||
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads
|
||||
@ -81,8 +86,4 @@ QMAKE_STRIPFLAGS_LIB += --strip-unneeded
|
||||
QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
|
||||
QMAKE_NM = $${CROSS_COMPILE}nm -P
|
||||
|
||||
include(../common/angle.conf)
|
||||
include(../common/windows-vulkan.conf)
|
||||
include(../common/gcc-base.conf)
|
||||
|
||||
load(qt_config)
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Written for Intel C++ Compiler on Windows / icl 16.0 or higher
|
||||
#
|
||||
|
||||
# Use the Microsoft (R) C/C++ Optimizing Compiler configuration,
|
||||
# Use the Microsoft C/C++ Optimizing Compiler configuration,
|
||||
# since ICC on Windows pretends to be MSVC
|
||||
|
||||
include(../common/msvc-desktop.conf)
|
||||
@ -13,11 +13,14 @@ include(../common/msvc-desktop.conf)
|
||||
|
||||
QMAKE_COMPILER += intel_icl
|
||||
|
||||
QMAKE_CFLAGS_OPTIMIZE_FULL = -O3
|
||||
|
||||
QMAKE_CC = icl
|
||||
QMAKE_CFLAGS = -nologo -Zm200 /Qprec /Qwd1744,1738,809,3373
|
||||
QMAKE_CFLAGS_WARN_ON = -W3 /Qwd673
|
||||
QMAKE_CFLAGS_WARN_OFF = -W0 /Qwd673
|
||||
QMAKE_CFLAGS_DEBUG = -Od -Zi -MDd
|
||||
QMAKE_CFLAGS = -nologo -Zc:wchar_t -Qprec -Zm200 -Qdiag-disable:1744,1738,809,3373
|
||||
QMAKE_CFLAGS_WARN_ON = -W3 -Qdiag-disable:673
|
||||
QMAKE_CFLAGS_WARN_OFF = -W0 -Qdiag-disable:673
|
||||
QMAKE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_OPTIMIZE_DEBUG -Zi -MDd
|
||||
QMAKE_CFLAGS_UTF8_SOURCE = -Qoption,cpp,--unicode_source_kind,UTF-8
|
||||
QMAKE_CFLAGS_LTCG = -Qipo
|
||||
QMAKE_CFLAGS_DISABLE_LTCG = -Qno-ipo
|
||||
|
||||
@ -46,7 +49,7 @@ QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
|
||||
QMAKE_CXXFLAGS_CXX11 = -Qstd=c++11
|
||||
# ICC supports the following but Qt won't compile
|
||||
#QMAKE_CXXFLAGS_CXX14 = -Qstd=c++14
|
||||
#QMAKE_CXXFLAGS_CXX1Z = -Qstd=c++1z
|
||||
#QMAKE_CXXFLAGS_CXX1Z = -Qstd=c++17
|
||||
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
|
||||
QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG
|
||||
|
||||
@ -55,7 +58,4 @@ QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
|
||||
|
||||
QMAKE_LIB = xilib /NOLOGO
|
||||
|
||||
include(../common/angle.conf)
|
||||
include(../common/windows-vulkan.conf)
|
||||
|
||||
load(qt_config)
|
||||
|
@ -2359,6 +2359,9 @@
|
||||
Specifies the \l{All Modules}{Qt modules} that are used by your project. For
|
||||
the value to add for each module, see the module documentation.
|
||||
|
||||
At the C++ implementation level, using a Qt module makes its headers
|
||||
available for inclusion and causes it to be linked to the binary.
|
||||
|
||||
By default, \c QT contains \c core and \c gui, ensuring that standard
|
||||
GUI applications can be built without further configuration.
|
||||
|
||||
|
@ -66,21 +66,22 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName)
|
||||
|
||||
bool IoUtils::isRelativePath(const QString &path)
|
||||
{
|
||||
if (path.startsWith(QLatin1Char('/')))
|
||||
return false;
|
||||
#ifdef QMAKE_BUILTIN_PRFS
|
||||
if (path.startsWith(QLatin1String(":/")))
|
||||
return false;
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
if (path.startsWith(QLatin1Char('\\')))
|
||||
return false;
|
||||
// Unlike QFileInfo, this won't accept a relative path with a drive letter.
|
||||
// Such paths result in a royal mess anyway ...
|
||||
// Unlike QFileInfo, this considers only paths with both a drive prefix and
|
||||
// a subsequent (back-)slash absolute:
|
||||
if (path.length() >= 3 && path.at(1) == QLatin1Char(':') && path.at(0).isLetter()
|
||||
&& (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\')))
|
||||
&& (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) {
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
// (... unless, of course, they're UNC, which qmake fails on anyway)
|
||||
#else
|
||||
if (path.startsWith(QLatin1Char('/')))
|
||||
return false;
|
||||
#endif // Q_OS_WIN
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -100,6 +101,12 @@ QString IoUtils::resolvePath(const QString &baseDir, const QString &fileName)
|
||||
return QString();
|
||||
if (isAbsolutePath(fileName))
|
||||
return QDir::cleanPath(fileName);
|
||||
#ifdef Q_OS_WIN // Add drive to otherwise-absolute path:
|
||||
if (fileName.at(0).unicode() == '/' || fileName.at(0).unicode() == '\\') {
|
||||
Q_ASSERT(isAbsolutePath(baseDir));
|
||||
return QDir::cleanPath(baseDir.left(2) + fileName);
|
||||
}
|
||||
#endif // Q_OS_WIN
|
||||
return QDir::cleanPath(baseDir + QLatin1Char('/') + fileName);
|
||||
}
|
||||
|
||||
|
@ -1177,9 +1177,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
||||
if (args.count() > 2) {
|
||||
evalError(fL1S("absolute_path(path[, base]) requires one or two arguments."));
|
||||
} else {
|
||||
QString rstr = QDir::cleanPath(
|
||||
QDir(args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory())
|
||||
.absoluteFilePath(args.at(0).toQString(m_tmp1)));
|
||||
QString arg = args.at(0).toQString(m_tmp1);
|
||||
QString baseDir = args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory();
|
||||
QString rstr = arg.isEmpty() ? baseDir : IoUtils::resolvePath(baseDir, arg);
|
||||
ret << (rstr.isSharedWith(m_tmp1)
|
||||
? args.at(0)
|
||||
: args.count() > 1 && rstr.isSharedWith(m_tmp2)
|
||||
@ -1191,9 +1191,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
||||
if (args.count() > 2) {
|
||||
evalError(fL1S("relative_path(path[, base]) requires one or two arguments."));
|
||||
} else {
|
||||
QDir baseDir(args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory());
|
||||
QString rstr = baseDir.relativeFilePath(baseDir.absoluteFilePath(
|
||||
args.at(0).toQString(m_tmp1)));
|
||||
QString arg = args.at(0).toQString(m_tmp1);
|
||||
QString baseDir = args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory();
|
||||
QString absArg = arg.isEmpty() ? baseDir : IoUtils::resolvePath(baseDir, arg);
|
||||
QString rstr = QDir(baseDir).relativeFilePath(absArg);
|
||||
ret << (rstr.isSharedWith(m_tmp1) ? args.at(0) : ProString(rstr).setSource(args.at(0)));
|
||||
}
|
||||
break;
|
||||
|
@ -68,6 +68,7 @@
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
using namespace QMakeInternal; // for IoUtils
|
||||
|
||||
#define fL1S(s) QString::fromLatin1(s)
|
||||
|
||||
@ -96,9 +97,9 @@ QString QMakeGlobals::cleanSpec(QMakeCmdLineParserState &state, const QString &s
|
||||
{
|
||||
QString ret = QDir::cleanPath(spec);
|
||||
if (ret.contains(QLatin1Char('/'))) {
|
||||
QString absRet = QDir(state.pwd).absoluteFilePath(ret);
|
||||
QString absRet = IoUtils::resolvePath(state.pwd, ret);
|
||||
if (QFile::exists(absRet))
|
||||
ret = QDir::cleanPath(absRet);
|
||||
ret = absRet;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -126,10 +127,10 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments(
|
||||
user_template_prefix = arg;
|
||||
break;
|
||||
case ArgCache:
|
||||
cachefile = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg));
|
||||
cachefile = args[*pos] = IoUtils::resolvePath(state.pwd, arg);
|
||||
break;
|
||||
case ArgQtConf:
|
||||
qtconf = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg));
|
||||
qtconf = args[*pos] = IoUtils::resolvePath(state.pwd, arg);
|
||||
break;
|
||||
default:
|
||||
if (arg.startsWith(QLatin1Char('-'))) {
|
||||
@ -259,11 +260,11 @@ QStringList QMakeGlobals::splitPathList(const QString &val) const
|
||||
{
|
||||
QStringList ret;
|
||||
if (!val.isEmpty()) {
|
||||
QDir bdir;
|
||||
QString cwd(QDir::currentPath());
|
||||
const QStringList vals = val.split(dirlist_sep);
|
||||
ret.reserve(vals.length());
|
||||
for (const QString &it : vals)
|
||||
ret << QDir::cleanPath(bdir.absoluteFilePath(it));
|
||||
ret << IoUtils::resolvePath(cwd, it);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -318,7 +319,7 @@ bool QMakeGlobals::initProperties()
|
||||
return false;
|
||||
data = proc.readAll();
|
||||
#else
|
||||
if (FILE *proc = QT_POPEN(QString(QMakeInternal::IoUtils::shellQuote(qmake_abslocation)
|
||||
if (FILE *proc = QT_POPEN(QString(IoUtils::shellQuote(qmake_abslocation)
|
||||
+ QLatin1String(" -query")).toLocal8Bit(), QT_POPEN_READ)) {
|
||||
char buff[1024];
|
||||
while (!feof(proc))
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "option.h"
|
||||
#include "cachekeys.h"
|
||||
#include <ioutils.h>
|
||||
#include <qdir.h>
|
||||
#include <qregexp.h>
|
||||
#include <qhash.h>
|
||||
@ -38,6 +39,8 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
using namespace QMakeInternal;
|
||||
|
||||
EvalHandler Option::evalHandler;
|
||||
QMakeGlobals *Option::globals;
|
||||
ProFileCache *Option::proFileCache;
|
||||
@ -325,7 +328,7 @@ Option::init(int argc, char **argv)
|
||||
#endif
|
||||
if(Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING)
|
||||
Option::qmake_mode = default_mode(argv0);
|
||||
if(!argv0.isEmpty() && !QFileInfo(argv0).isRelative()) {
|
||||
if (!argv0.isEmpty() && IoUtils::isAbsolutePath(argv0)) {
|
||||
globals->qmake_abslocation = argv0;
|
||||
} else if (argv0.contains(QLatin1Char('/'))
|
||||
#ifdef Q_OS_WIN
|
||||
|
303
src/3rdparty/angle/src/libANGLE/Debug2.cpp
vendored
303
src/3rdparty/angle/src/libANGLE/Debug2.cpp
vendored
@ -1,303 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
|
||||
// Debug.cpp: Defines debug state used for GL_KHR_debug
|
||||
|
||||
#include "libANGLE/Debug.h"
|
||||
|
||||
#include "common/debug.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <tuple>
|
||||
|
||||
namespace gl
|
||||
{
|
||||
|
||||
Debug::Debug()
|
||||
: mOutputEnabled(false),
|
||||
mCallbackFunction(nullptr),
|
||||
mCallbackUserParam(nullptr),
|
||||
mMessages(),
|
||||
mMaxLoggedMessages(0),
|
||||
mOutputSynchronous(false),
|
||||
mGroups()
|
||||
{
|
||||
pushDefaultGroup();
|
||||
}
|
||||
|
||||
void Debug::setMaxLoggedMessages(GLuint maxLoggedMessages)
|
||||
{
|
||||
mMaxLoggedMessages = maxLoggedMessages;
|
||||
}
|
||||
|
||||
void Debug::setOutputEnabled(bool enabled)
|
||||
{
|
||||
mOutputEnabled = enabled;
|
||||
}
|
||||
|
||||
bool Debug::isOutputEnabled() const
|
||||
{
|
||||
return mOutputEnabled;
|
||||
}
|
||||
|
||||
void Debug::setOutputSynchronous(bool synchronous)
|
||||
{
|
||||
mOutputSynchronous = synchronous;
|
||||
}
|
||||
|
||||
bool Debug::isOutputSynchronous() const
|
||||
{
|
||||
return mOutputSynchronous;
|
||||
}
|
||||
|
||||
void Debug::setCallback(GLDEBUGPROCKHR callback, const void *userParam)
|
||||
{
|
||||
mCallbackFunction = callback;
|
||||
mCallbackUserParam = userParam;
|
||||
}
|
||||
|
||||
GLDEBUGPROCKHR Debug::getCallback() const
|
||||
{
|
||||
return mCallbackFunction;
|
||||
}
|
||||
|
||||
const void *Debug::getUserParam() const
|
||||
{
|
||||
return mCallbackUserParam;
|
||||
}
|
||||
|
||||
void Debug::insertMessage(GLenum source,
|
||||
GLenum type,
|
||||
GLuint id,
|
||||
GLenum severity,
|
||||
const std::string &message)
|
||||
{
|
||||
std::string messageCopy(message);
|
||||
insertMessage(source, type, id, severity, std::move(messageCopy));
|
||||
}
|
||||
|
||||
void Debug::insertMessage(GLenum source,
|
||||
GLenum type,
|
||||
GLuint id,
|
||||
GLenum severity,
|
||||
std::string &&message)
|
||||
{
|
||||
if (!isMessageEnabled(source, type, id, severity))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mCallbackFunction != nullptr)
|
||||
{
|
||||
// TODO(geofflang) Check the synchronous flag and potentially flush messages from another
|
||||
// thread.
|
||||
mCallbackFunction(source, type, id, severity, static_cast<GLsizei>(message.length()),
|
||||
message.c_str(), mCallbackUserParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mMessages.size() >= mMaxLoggedMessages)
|
||||
{
|
||||
// Drop messages over the limit
|
||||
return;
|
||||
}
|
||||
|
||||
Message m;
|
||||
m.source = source;
|
||||
m.type = type;
|
||||
m.id = id;
|
||||
m.severity = severity;
|
||||
m.message = std::move(message);
|
||||
|
||||
mMessages.push_back(std::move(m));
|
||||
}
|
||||
}
|
||||
|
||||
size_t Debug::getMessages(GLuint count,
|
||||
GLsizei bufSize,
|
||||
GLenum *sources,
|
||||
GLenum *types,
|
||||
GLuint *ids,
|
||||
GLenum *severities,
|
||||
GLsizei *lengths,
|
||||
GLchar *messageLog)
|
||||
{
|
||||
size_t messageCount = 0;
|
||||
size_t messageStringIndex = 0;
|
||||
while (messageCount <= count && !mMessages.empty())
|
||||
{
|
||||
const Message &m = mMessages.front();
|
||||
|
||||
if (messageLog != nullptr)
|
||||
{
|
||||
// Check that this message can fit in the message buffer
|
||||
if (messageStringIndex + m.message.length() + 1 > static_cast<size_t>(bufSize))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
std::copy(m.message.begin(), m.message.end(), messageLog + messageStringIndex);
|
||||
messageStringIndex += m.message.length();
|
||||
|
||||
messageLog[messageStringIndex] = '\0';
|
||||
messageStringIndex += 1;
|
||||
}
|
||||
|
||||
if (sources != nullptr)
|
||||
{
|
||||
sources[messageCount] = m.source;
|
||||
}
|
||||
|
||||
if (types != nullptr)
|
||||
{
|
||||
types[messageCount] = m.type;
|
||||
}
|
||||
|
||||
if (ids != nullptr)
|
||||
{
|
||||
ids[messageCount] = m.id;
|
||||
}
|
||||
|
||||
if (severities != nullptr)
|
||||
{
|
||||
severities[messageCount] = m.severity;
|
||||
}
|
||||
|
||||
if (lengths != nullptr)
|
||||
{
|
||||
lengths[messageCount] = static_cast<GLsizei>(m.message.length());
|
||||
}
|
||||
|
||||
mMessages.pop_front();
|
||||
|
||||
messageCount++;
|
||||
}
|
||||
|
||||
return messageCount;
|
||||
}
|
||||
|
||||
size_t Debug::getNextMessageLength() const
|
||||
{
|
||||
return mMessages.empty() ? 0 : mMessages.front().message.length();
|
||||
}
|
||||
|
||||
size_t Debug::getMessageCount() const
|
||||
{
|
||||
return mMessages.size();
|
||||
}
|
||||
|
||||
void Debug::setMessageControl(GLenum source,
|
||||
GLenum type,
|
||||
GLenum severity,
|
||||
std::vector<GLuint> &&ids,
|
||||
bool enabled)
|
||||
{
|
||||
Control c;
|
||||
c.source = source;
|
||||
c.type = type;
|
||||
c.severity = severity;
|
||||
c.ids = std::move(ids);
|
||||
c.enabled = enabled;
|
||||
|
||||
auto &controls = mGroups.back().controls;
|
||||
controls.push_back(std::move(c));
|
||||
}
|
||||
|
||||
void Debug::pushGroup(GLenum source, GLuint id, std::string &&message)
|
||||
{
|
||||
insertMessage(source, GL_DEBUG_TYPE_PUSH_GROUP, id, GL_DEBUG_SEVERITY_NOTIFICATION,
|
||||
std::string(message));
|
||||
|
||||
Group g;
|
||||
g.source = source;
|
||||
g.id = id;
|
||||
g.message = std::move(message);
|
||||
mGroups.push_back(std::move(g));
|
||||
}
|
||||
|
||||
void Debug::popGroup()
|
||||
{
|
||||
// Make sure the default group is not about to be popped
|
||||
ASSERT(mGroups.size() > 1);
|
||||
|
||||
Group g = mGroups.back();
|
||||
mGroups.pop_back();
|
||||
|
||||
insertMessage(g.source, GL_DEBUG_TYPE_POP_GROUP, g.id, GL_DEBUG_SEVERITY_NOTIFICATION,
|
||||
g.message);
|
||||
}
|
||||
|
||||
size_t Debug::getGroupStackDepth() const
|
||||
{
|
||||
return mGroups.size();
|
||||
}
|
||||
|
||||
bool Debug::isMessageEnabled(GLenum source, GLenum type, GLuint id, GLenum severity) const
|
||||
{
|
||||
if (!mOutputEnabled)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto groupIter = mGroups.rbegin(); groupIter != mGroups.rend(); groupIter++)
|
||||
{
|
||||
const auto &controls = groupIter->controls;
|
||||
for (auto controlIter = controls.rbegin(); controlIter != controls.rend(); controlIter++)
|
||||
{
|
||||
const auto &control = *controlIter;
|
||||
|
||||
if (control.source != GL_DONT_CARE && control.source != source)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (control.type != GL_DONT_CARE && control.type != type)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (control.severity != GL_DONT_CARE && control.severity != severity)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!control.ids.empty() &&
|
||||
std::find(control.ids.begin(), control.ids.end(), id) == control.ids.end())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return control.enabled;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Debug::pushDefaultGroup()
|
||||
{
|
||||
Group g;
|
||||
g.source = GL_NONE;
|
||||
g.id = 0;
|
||||
g.message = "";
|
||||
|
||||
Control c0;
|
||||
c0.source = GL_DONT_CARE;
|
||||
c0.type = GL_DONT_CARE;
|
||||
c0.severity = GL_DONT_CARE;
|
||||
c0.enabled = true;
|
||||
g.controls.push_back(std::move(c0));
|
||||
|
||||
Control c1;
|
||||
c1.source = GL_DONT_CARE;
|
||||
c1.type = GL_DONT_CARE;
|
||||
c1.severity = GL_DEBUG_SEVERITY_LOW;
|
||||
c1.enabled = false;
|
||||
g.controls.push_back(std::move(c1));
|
||||
|
||||
mGroups.push_back(std::move(g));
|
||||
}
|
||||
} // namespace gl
|
120
src/3rdparty/angle/src/libANGLE/Debug2.h
vendored
120
src/3rdparty/angle/src/libANGLE/Debug2.h
vendored
@ -1,120 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
|
||||
// Debug.h: Defines debug state used for GL_KHR_debug
|
||||
|
||||
#ifndef LIBANGLE_DEBUG_H_
|
||||
#define LIBANGLE_DEBUG_H_
|
||||
|
||||
#include "angle_gl.h"
|
||||
#include "common/angleutils.h"
|
||||
|
||||
#include <deque>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace gl
|
||||
{
|
||||
|
||||
class LabeledObject
|
||||
{
|
||||
public:
|
||||
virtual ~LabeledObject() {}
|
||||
virtual void setLabel(const std::string &label) = 0;
|
||||
virtual const std::string &getLabel() const = 0;
|
||||
};
|
||||
|
||||
class Debug : angle::NonCopyable
|
||||
{
|
||||
public:
|
||||
Debug();
|
||||
|
||||
void setMaxLoggedMessages(GLuint maxLoggedMessages);
|
||||
|
||||
void setOutputEnabled(bool enabled);
|
||||
bool isOutputEnabled() const;
|
||||
|
||||
void setOutputSynchronous(bool synchronous);
|
||||
bool isOutputSynchronous() const;
|
||||
|
||||
void setCallback(GLDEBUGPROCKHR callback, const void *userParam);
|
||||
GLDEBUGPROCKHR getCallback() const;
|
||||
const void *getUserParam() const;
|
||||
|
||||
void insertMessage(GLenum source,
|
||||
GLenum type,
|
||||
GLuint id,
|
||||
GLenum severity,
|
||||
const std::string &message);
|
||||
void insertMessage(GLenum source,
|
||||
GLenum type,
|
||||
GLuint id,
|
||||
GLenum severity,
|
||||
std::string &&message);
|
||||
|
||||
void setMessageControl(GLenum source,
|
||||
GLenum type,
|
||||
GLenum severity,
|
||||
std::vector<GLuint> &&ids,
|
||||
bool enabled);
|
||||
size_t getMessages(GLuint count,
|
||||
GLsizei bufSize,
|
||||
GLenum *sources,
|
||||
GLenum *types,
|
||||
GLuint *ids,
|
||||
GLenum *severities,
|
||||
GLsizei *lengths,
|
||||
GLchar *messageLog);
|
||||
size_t getNextMessageLength() const;
|
||||
size_t getMessageCount() const;
|
||||
|
||||
void pushGroup(GLenum source, GLuint id, std::string &&message);
|
||||
void popGroup();
|
||||
size_t getGroupStackDepth() const;
|
||||
|
||||
private:
|
||||
bool isMessageEnabled(GLenum source, GLenum type, GLuint id, GLenum severity) const;
|
||||
|
||||
void pushDefaultGroup();
|
||||
|
||||
struct Message
|
||||
{
|
||||
GLenum source;
|
||||
GLenum type;
|
||||
GLuint id;
|
||||
GLenum severity;
|
||||
std::string message;
|
||||
};
|
||||
|
||||
struct Control
|
||||
{
|
||||
GLenum source;
|
||||
GLenum type;
|
||||
GLenum severity;
|
||||
std::vector<GLuint> ids;
|
||||
bool enabled;
|
||||
};
|
||||
|
||||
struct Group
|
||||
{
|
||||
GLenum source;
|
||||
GLuint id;
|
||||
std::string message;
|
||||
|
||||
std::vector<Control> controls;
|
||||
};
|
||||
|
||||
bool mOutputEnabled;
|
||||
GLDEBUGPROCKHR mCallbackFunction;
|
||||
const void *mCallbackUserParam;
|
||||
std::deque<Message> mMessages;
|
||||
GLuint mMaxLoggedMessages;
|
||||
bool mOutputSynchronous;
|
||||
std::vector<Group> mGroups;
|
||||
};
|
||||
} // namespace gl
|
||||
|
||||
#endif // LIBANGLE_DEBUG_H_
|
2
src/3rdparty/libjpeg/qt_attribution.json
vendored
2
src/3rdparty/libjpeg/qt_attribution.json
vendored
@ -6,7 +6,7 @@
|
||||
|
||||
"Description": "The Independent JPEG Group's JPEG software",
|
||||
"Homepage": "http://libjpeg-turbo.virtualgl.org/",
|
||||
"Version": "1.5.2",
|
||||
"Version": "1.5.3",
|
||||
"License": "Independent JPEG Group License",
|
||||
"LicenseId": "IJG",
|
||||
"LicenseFile": "LICENSE",
|
||||
|
44
src/3rdparty/libjpeg/src/ChangeLog.md
vendored
44
src/3rdparty/libjpeg/src/ChangeLog.md
vendored
@ -1,3 +1,47 @@
|
||||
1.5.3
|
||||
=====
|
||||
|
||||
### Significant changes relative to 1.5.2:
|
||||
|
||||
1. Fixed a NullPointerException in the TurboJPEG Java wrapper that occurred
|
||||
when using the YUVImage constructor that creates an instance backed by separate
|
||||
image planes and allocates memory for the image planes.
|
||||
|
||||
2. Fixed an issue whereby the Java version of TJUnitTest would fail when
|
||||
testing BufferedImage encoding/decoding on big endian systems.
|
||||
|
||||
3. Fixed a segfault in djpeg that would occur if an output format other than
|
||||
PPM/PGM was selected along with the `-crop` option. The `-crop` option now
|
||||
works with the GIF and Targa formats as well (unfortunately, it cannot be made
|
||||
to work with the BMP and RLE formats due to the fact that those output engines
|
||||
write scanlines in bottom-up order.) djpeg will now exit gracefully if an
|
||||
output format other than PPM/PGM, GIF, or Targa is selected along with the
|
||||
`-crop` option.
|
||||
|
||||
4. Fixed an issue whereby `jpeg_skip_scanlines()` would segfault if color
|
||||
quantization was enabled.
|
||||
|
||||
5. TJBench (both C and Java versions) will now display usage information if any
|
||||
command-line argument is unrecognized. This prevents the program from silently
|
||||
ignoring typos.
|
||||
|
||||
6. Fixed an access violation in tjbench.exe (Windows) that occurred when the
|
||||
program was used to decompress an existing JPEG image.
|
||||
|
||||
7. Fixed an ArrayIndexOutOfBoundsException in the TJExample Java program that
|
||||
occurred when attempting to decompress a JPEG image that had been compressed
|
||||
with 4:1:1 chrominance subsampling.
|
||||
|
||||
8. Fixed an issue whereby, when using `jpeg_skip_scanlines()` to skip to the
|
||||
end of a single-scan (non-progressive) image, subsequent calls to
|
||||
`jpeg_consume_input()` would return `JPEG_SUSPENDED` rather than
|
||||
`JPEG_REACHED_EOI`.
|
||||
|
||||
9. `jpeg_crop_scanlines()` now works correctly when decompressing grayscale
|
||||
JPEG images that were compressed with a sampling factor other than 1 (for
|
||||
instance, with `cjpeg -grayscale -sample 2x2`).
|
||||
|
||||
|
||||
1.5.2
|
||||
=====
|
||||
|
||||
|
2
src/3rdparty/libjpeg/src/jcdctmgr.c
vendored
2
src/3rdparty/libjpeg/src/jcdctmgr.c
vendored
@ -216,7 +216,7 @@ compute_reciprocal (UINT16 divisor, DCTELEM *dtbl)
|
||||
#endif
|
||||
dtbl[DCTSIZE2 * 3] = (DCTELEM) r - sizeof(DCTELEM)*8; /* shift */
|
||||
|
||||
if(r <= 16) return 0;
|
||||
if (r <= 16) return 0;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
|
33
src/3rdparty/libjpeg/src/jdapistd.c
vendored
33
src/3rdparty/libjpeg/src/jdapistd.c
vendored
@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2015-2016, D. R. Commander.
|
||||
* Copyright (C) 2010, 2015-2017, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@ -190,7 +190,10 @@ jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,
|
||||
* single-pass decompression case, allowing us to use the same MCU column
|
||||
* width for all of the components.
|
||||
*/
|
||||
align = cinfo->_min_DCT_scaled_size * cinfo->max_h_samp_factor;
|
||||
if (cinfo->comps_in_scan == 1 && cinfo->num_components == 1)
|
||||
align = cinfo->_min_DCT_scaled_size;
|
||||
else
|
||||
align = cinfo->_min_DCT_scaled_size * cinfo->max_h_samp_factor;
|
||||
|
||||
/* Adjust xoffset to the nearest iMCU boundary <= the requested value */
|
||||
input_xoffset = *xoffset;
|
||||
@ -215,6 +218,9 @@ jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
int hsf = (cinfo->comps_in_scan == 1 && cinfo->num_components == 1) ?
|
||||
1 : compptr->h_samp_factor;
|
||||
|
||||
/* Set downsampled_width to the new output width. */
|
||||
orig_downsampled_width = compptr->downsampled_width;
|
||||
compptr->downsampled_width =
|
||||
@ -228,11 +234,10 @@ jpeg_crop_scanline (j_decompress_ptr cinfo, JDIMENSION *xoffset,
|
||||
* values will be used in multi-scan decompressions.
|
||||
*/
|
||||
cinfo->master->first_MCU_col[ci] =
|
||||
(JDIMENSION) (long) (*xoffset * compptr->h_samp_factor) /
|
||||
(long) align;
|
||||
(JDIMENSION) (long) (*xoffset * hsf) / (long) align;
|
||||
cinfo->master->last_MCU_col[ci] =
|
||||
(JDIMENSION) jdiv_round_up((long) ((*xoffset + cinfo->output_width) *
|
||||
compptr->h_samp_factor),
|
||||
hsf),
|
||||
(long) align) - 1;
|
||||
}
|
||||
|
||||
@ -293,6 +298,14 @@ noop_convert (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
}
|
||||
|
||||
|
||||
/* Dummy quantize function used by jpeg_skip_scanlines() */
|
||||
LOCAL(void)
|
||||
noop_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* In some cases, it is best to call jpeg_read_scanlines() and discard the
|
||||
* output, rather than skipping the scanlines, because this allows us to
|
||||
@ -308,14 +321,22 @@ read_and_discard_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows);
|
||||
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPARRAY output_buf, int num_rows) = NULL;
|
||||
|
||||
color_convert = cinfo->cconvert->color_convert;
|
||||
cinfo->cconvert->color_convert = noop_convert;
|
||||
if (cinfo->cquantize && cinfo->cquantize->color_quantize) {
|
||||
color_quantize = cinfo->cquantize->color_quantize;
|
||||
cinfo->cquantize->color_quantize = noop_quantize;
|
||||
}
|
||||
|
||||
for (n = 0; n < num_lines; n++)
|
||||
jpeg_read_scanlines(cinfo, NULL, 1);
|
||||
|
||||
cinfo->cconvert->color_convert = color_convert;
|
||||
if (color_quantize)
|
||||
cinfo->cquantize->color_quantize = color_quantize;
|
||||
}
|
||||
|
||||
|
||||
@ -370,6 +391,8 @@ jpeg_skip_scanlines (j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
/* Do not skip past the bottom of the image. */
|
||||
if (cinfo->output_scanline + num_lines >= cinfo->output_height) {
|
||||
cinfo->output_scanline = cinfo->output_height;
|
||||
(*cinfo->inputctl->finish_input_pass) (cinfo);
|
||||
cinfo->inputctl->eoi_reached = TRUE;
|
||||
return cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
|
||||
|
2
src/3rdparty/libjpeg/src/jdcolor.c
vendored
2
src/3rdparty/libjpeg/src/jdcolor.c
vendored
@ -616,7 +616,7 @@ static const JLONG dither_matrix[4] = {
|
||||
static INLINE boolean is_big_endian(void)
|
||||
{
|
||||
int test_value = 1;
|
||||
if(*(char *)&test_value != 1)
|
||||
if (*(char *)&test_value != 1)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
2
src/3rdparty/libjpeg/src/jdmerge.c
vendored
2
src/3rdparty/libjpeg/src/jdmerge.c
vendored
@ -503,7 +503,7 @@ static const JLONG dither_matrix[4] = {
|
||||
static INLINE boolean is_big_endian(void)
|
||||
{
|
||||
int test_value = 1;
|
||||
if(*(char *)&test_value != 1)
|
||||
if (*(char *)&test_value != 1)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
2
src/3rdparty/pcre2/pcre2.pro
vendored
2
src/3rdparty/pcre2/pcre2.pro
vendored
@ -16,6 +16,8 @@ DEFINES += HAVE_CONFIG_H
|
||||
|
||||
# platform/compiler specific definitions
|
||||
uikit|qnx|winrt: DEFINES += PCRE2_DISABLE_JIT
|
||||
win32:contains(QT_ARCH, "arm"): DEFINES += PCRE2_DISABLE_JIT
|
||||
win32:contains(QT_ARCH, "arm64"): DEFINES += PCRE2_DISABLE_JIT
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/src/pcre2_auto_possess.c \
|
||||
|
2
src/3rdparty/sqlite/qt_attribution.json
vendored
2
src/3rdparty/sqlite/qt_attribution.json
vendored
@ -6,7 +6,7 @@
|
||||
|
||||
"Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
|
||||
"Homepage": "http://www.sqlite.org/",
|
||||
"Version": "3.20.1",
|
||||
"Version": "3.22.0",
|
||||
"License": "Public Domain",
|
||||
"Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ import android.graphics.drawable.Drawable;
|
||||
import android.view.MotionEvent;
|
||||
import android.widget.PopupWindow;
|
||||
import android.app.Activity;
|
||||
import android.util.TypedValue;
|
||||
import android.view.ViewTreeObserver;
|
||||
|
||||
/* This view represents one of the handle (selection or cursor handle) */
|
||||
@ -58,8 +59,9 @@ class CursorView extends ImageView
|
||||
{
|
||||
private CursorHandle mHandle;
|
||||
// The coordinare which where clicked
|
||||
private int m_offsetX;
|
||||
private int m_offsetY;
|
||||
private float m_offsetX;
|
||||
private float m_offsetY;
|
||||
private boolean m_pressed = false;
|
||||
|
||||
CursorView (Context context, CursorHandle handle) {
|
||||
super(context);
|
||||
@ -76,21 +78,23 @@ class CursorView extends ImageView
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
switch (ev.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN: {
|
||||
m_offsetX = Math.round(ev.getRawX());
|
||||
m_offsetY = Math.round(ev.getRawY());
|
||||
m_offsetX = ev.getRawX();
|
||||
m_offsetY = ev.getRawY() + getHeight() / 2;
|
||||
m_pressed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case MotionEvent.ACTION_MOVE: {
|
||||
mHandle.updatePosition(Math.round(ev.getRawX()) - m_offsetX,
|
||||
Math.round(ev.getRawY()) - m_offsetY);
|
||||
if (!m_pressed)
|
||||
return false;
|
||||
mHandle.updatePosition(Math.round(ev.getRawX() - m_offsetX),
|
||||
Math.round(ev.getRawY() - m_offsetY));
|
||||
break;
|
||||
}
|
||||
|
||||
case MotionEvent.ACTION_UP:
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
m_pressed = false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
@ -113,6 +117,7 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener
|
||||
private int m_lastY;
|
||||
int tolerance;
|
||||
private boolean m_rtl;
|
||||
int m_yShift;
|
||||
|
||||
public CursorHandle(Activity activity, View layout, int id, int attr, boolean rtl) {
|
||||
m_activity = activity;
|
||||
@ -121,7 +126,8 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener
|
||||
m_layout = layout;
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
tolerance = Math.round(2 * metrics.density);
|
||||
m_yShift = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_MM, 1f, metrics);
|
||||
tolerance = Math.min(1, (int)(m_yShift / 2f));
|
||||
m_lastX = m_lastY = -1 - tolerance;
|
||||
m_rtl = rtl;
|
||||
}
|
||||
@ -158,7 +164,7 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener
|
||||
m_layout.getLocationOnScreen(location);
|
||||
|
||||
int x2 = x + location[0];
|
||||
int y2 = y + location[1];
|
||||
int y2 = y + location[1] + m_yShift;
|
||||
|
||||
if (m_id == QtNative.IdCursorHandle) {
|
||||
x2 -= m_cursorView.getWidth() / 2 ;
|
||||
@ -187,6 +193,7 @@ public class CursorHandle implements ViewTreeObserver.OnPreDrawListener
|
||||
|
||||
// The handle was dragged by a given relative position
|
||||
public void updatePosition(int x, int y) {
|
||||
y -= m_yShift;
|
||||
if (Math.abs(m_lastX - x) > tolerance || Math.abs(m_lastY - y) > tolerance) {
|
||||
QtNative.handleLocationChanged(m_id, x + m_posX, y + m_posY);
|
||||
m_lastX = x;
|
||||
|
@ -1,4 +1,4 @@
|
||||
CONFIG += simd no_batch
|
||||
CONFIG += simd no_batch object_parallel_to_source
|
||||
include(common.pri)
|
||||
|
||||
INCLUDEPATH += $$OUT_PWD/.. $$ANGLE_DIR/src/libANGLE
|
||||
@ -48,6 +48,7 @@ HEADERS += \
|
||||
$$ANGLE_DIR/src/libANGLE/Constants.h \
|
||||
$$ANGLE_DIR/src/libANGLE/Context.h \
|
||||
$$ANGLE_DIR/src/libANGLE/Data.h \
|
||||
$$ANGLE_DIR/src/libANGLE/Debug.h \
|
||||
$$ANGLE_DIR/src/libANGLE/Device.h \
|
||||
$$ANGLE_DIR/src/libANGLE/Display.h \
|
||||
$$ANGLE_DIR/src/libANGLE/Error.h \
|
||||
@ -169,6 +170,7 @@ SOURCES += \
|
||||
$$ANGLE_DIR/src/libANGLE/Config.cpp \
|
||||
$$ANGLE_DIR/src/libANGLE/Context.cpp \
|
||||
$$ANGLE_DIR/src/libANGLE/Data.cpp \
|
||||
$$ANGLE_DIR/src/libANGLE/Debug.cpp \
|
||||
$$ANGLE_DIR/src/libANGLE/Device.cpp \
|
||||
$$ANGLE_DIR/src/libANGLE/Display.cpp \
|
||||
$$ANGLE_DIR/src/libANGLE/Error.cpp \
|
||||
@ -241,14 +243,6 @@ SOURCES += \
|
||||
|
||||
SSE2_SOURCES += $$ANGLE_DIR/src/libANGLE/renderer/d3d/loadimageSSE2.cpp
|
||||
|
||||
DEBUG_SOURCE = $$ANGLE_DIR/src/libANGLE/Debug.cpp
|
||||
debug_copy.input = DEBUG_SOURCE
|
||||
debug_copy.output = $$ANGLE_DIR/src/libANGLE/Debug2.cpp
|
||||
debug_copy.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
|
||||
debug_copy.variable_out = GENERATED_SOURCES
|
||||
debug_copy.CONFIG = target_predeps
|
||||
QMAKE_EXTRA_COMPILERS += debug_copy
|
||||
|
||||
angle_d3d11 {
|
||||
HEADERS += \
|
||||
$$ANGLE_DIR/src/libANGLE/renderer/d3d/d3d11/Blit11.h \
|
||||
|
@ -4,7 +4,7 @@ CONFIG += exceptions
|
||||
|
||||
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
|
||||
|
||||
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000
|
||||
msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x66000000
|
||||
|
||||
QMAKE_DOCS = $$PWD/doc/qtconcurrent.qdocconf
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
@ -133,4 +133,13 @@
|
||||
copy of the container when called. If you are using STL containers this copy operation
|
||||
might take some time, in this case we recommend specifying the begin and end iterators
|
||||
for the container instead.
|
||||
|
||||
\section1 Licenses
|
||||
|
||||
The Qt Concurrent module is available under commercial licenses from \l{The Qt Company}.
|
||||
In addition, it is available under free software licenses. Since Qt 5.4,
|
||||
these free software licenses are
|
||||
\l{GNU Lesser General Public License, version 3}, or
|
||||
the \l{GNU General Public License, version 2}.
|
||||
See \l{Qt Licensing} for further details.
|
||||
*/
|
||||
|
@ -12,7 +12,7 @@ CONFIG += qt_tracepoints
|
||||
CONFIG += $$MODULE_CONFIG
|
||||
DEFINES += $$MODULE_DEFINES
|
||||
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
|
||||
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x67000000
|
||||
msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x67000000
|
||||
|
||||
CONFIG += simd optimize_full
|
||||
|
||||
|
@ -55,7 +55,7 @@ class HelloWorldTask : public QRunnable
|
||||
{
|
||||
qDebug() << "Hello world from thread" << QThread::currentThread();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
HelloWorldTask *hello = new HelloWorldTask();
|
||||
// QThreadPool takes ownership and deletes 'hello' automatically
|
||||
|
@ -104,17 +104,18 @@
|
||||
\section1 Licenses and Attributions
|
||||
|
||||
Qt Core is available under commercial licenses from \l{The Qt Company}.
|
||||
In addition, it is available under the
|
||||
In addition, it is available under free software licenses. Since Qt 5.4,
|
||||
these free software licenses are
|
||||
\l{GNU Lesser General Public License, version 3}, or
|
||||
the \l{GNU General Public License, version 2}.
|
||||
See \l{Qt Licensing} for further details.
|
||||
|
||||
Executables on Windows potentially link
|
||||
against \l{The qtmain Library}. This library is available
|
||||
under commercial licenses, and in addition under the
|
||||
under commercial licenses and also under the
|
||||
\l{BSD 3-clause "New" or "Revised" License}.
|
||||
|
||||
Furthermore Qt Core potentially contains third party
|
||||
Furthermore, Qt Core in Qt \QtVersion may contain third party
|
||||
modules under following permissive licenses:
|
||||
|
||||
\generatelist{groupsbymodule attributions-qtcore}
|
||||
|
@ -57,6 +57,7 @@ QT_FUNCTION_TARGET(F16C)
|
||||
void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOTHROW
|
||||
{
|
||||
qsizetype i = 0;
|
||||
int epilog_i;
|
||||
for (; i < len - 7; i += 8)
|
||||
_mm_storeu_si128((__m128i *)(out + i), _mm256_cvtps_ph(_mm256_loadu_ps(in + i), 0));
|
||||
if (i < len - 3) {
|
||||
@ -64,7 +65,7 @@ void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_N
|
||||
i += 4;
|
||||
}
|
||||
// Inlining "qfloat16::qfloat16(float f)":
|
||||
SIMD_EPILOGUE(i, len, 3)
|
||||
for (epilog_i = 0; i < len && epilog_i < 3; ++i, ++epilog_i)
|
||||
out[i] = _mm_extract_epi16(_mm_cvtps_ph(_mm_set_ss(in[i]), 0), 0);
|
||||
}
|
||||
|
||||
@ -72,6 +73,7 @@ QT_FUNCTION_TARGET(F16C)
|
||||
void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOTHROW
|
||||
{
|
||||
qsizetype i = 0;
|
||||
int epilog_i;
|
||||
for (; i < len - 7; i += 8)
|
||||
_mm256_storeu_ps(out + i, _mm256_cvtph_ps(_mm_loadu_si128((const __m128i *)(in + i))));
|
||||
if (i < len - 3) {
|
||||
@ -79,7 +81,7 @@ void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL
|
||||
i += 4;
|
||||
}
|
||||
// Inlining "qfloat16::operator float()":
|
||||
SIMD_EPILOGUE(i, len, 3)
|
||||
for (epilog_i = 0; i < len && epilog_i < 3; ++i, ++epilog_i)
|
||||
out[i] = _mm_cvtss_f32(_mm_cvtph_ps(_mm_cvtsi32_si128(in[i])));
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@
|
||||
# include <envLib.h>
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
#include <private/qjni_p.h>
|
||||
#endif
|
||||
|
||||
@ -2298,7 +2298,7 @@ static bool findUnixOsVersion(QUnixOSVersion &v)
|
||||
# endif // USE_ETC_OS_RELEASE
|
||||
#endif // Q_OS_UNIX
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
static const char *osVer_helper(QOperatingSystemVersion)
|
||||
{
|
||||
/* Data:
|
||||
@ -2779,7 +2779,7 @@ QString QSysInfo::productVersion()
|
||||
*/
|
||||
QString QSysInfo::prettyProductName()
|
||||
{
|
||||
#if defined(Q_OS_ANDROID) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN)
|
||||
#if (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN)
|
||||
const auto version = QOperatingSystemVersion::current();
|
||||
const char *name = osVer_helper(version);
|
||||
if (name)
|
||||
|
@ -1597,7 +1597,7 @@ static bool syslog_default_message_handler(QtMsgType type, const QMessageLogCont
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
static bool android_default_message_handler(QtMsgType type,
|
||||
const QMessageLogContext &context,
|
||||
const QString &message)
|
||||
@ -1678,7 +1678,7 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
|
||||
handledStderr |= systemd_default_message_handler(type, context, message);
|
||||
# elif QT_CONFIG(syslog)
|
||||
handledStderr |= syslog_default_message_handler(type, context, message);
|
||||
# elif defined(Q_OS_ANDROID)
|
||||
# elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
handledStderr |= android_default_message_handler(type, context, message);
|
||||
# elif defined(QT_USE_APPLE_UNIFIED_LOGGING)
|
||||
if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *))
|
||||
|
@ -168,7 +168,7 @@ namespace {
|
||||
// size_t. Implementations for 8- and 16-bit types will work but may not be as
|
||||
// efficient. Implementations for 64-bit may be missing on 32-bit platforms.
|
||||
|
||||
#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || defined(Q_CC_INTEL)) || QT_HAS_BUILTIN(__builtin_add_overflowx)
|
||||
#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || (defined(Q_CC_INTEL) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflowx)
|
||||
// GCC 5, ICC 18, and Clang 3.8 have builtins to detect overflows
|
||||
|
||||
template <typename T> inline
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <qversionnumber.h>
|
||||
#include <qdebug.h>
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
#include <private/qjni_p.h>
|
||||
#endif
|
||||
|
||||
@ -163,7 +163,7 @@ QOperatingSystemVersion QOperatingSystemVersion::current()
|
||||
{
|
||||
QOperatingSystemVersion version;
|
||||
version.m_os = currentType();
|
||||
#if defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
const QVersionNumber v = QVersionNumber::fromString(QJNIObjectPrivate::getStaticObjectField(
|
||||
"android/os/Build$VERSION", "RELEASE", "Ljava/lang/String;").toString());
|
||||
|
@ -74,7 +74,7 @@ DECLSPEC_IMPORT BOOLEAN WINAPI SystemFunction036(PVOID RandomBuffer, ULONG Rando
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
# include <private/qjni_p.h>
|
||||
#endif
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
Copyright (c) 1987, 1993
|
||||
The Regents of the University of California. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
@ -159,7 +159,7 @@ win32 {
|
||||
} else {
|
||||
LIBS += -framework MobileCoreServices
|
||||
}
|
||||
} else:android {
|
||||
} else:android:!android-embedded {
|
||||
SOURCES += \
|
||||
io/qstandardpaths_android.cpp \
|
||||
io/qstorageinfo_unix.cpp
|
||||
|
@ -185,10 +185,11 @@ bool QFSFileEnginePrivate::nativeFlush()
|
||||
bool QFSFileEnginePrivate::nativeSyncToDisk()
|
||||
{
|
||||
Q_Q(QFSFileEngine);
|
||||
int ret;
|
||||
#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
|
||||
const int ret = fdatasync(nativeHandle());
|
||||
EINTR_LOOP(ret, fdatasync(nativeHandle()));
|
||||
#else
|
||||
const int ret = fsync(nativeHandle());
|
||||
EINTR_LOOP(ret, fsync(nativeHandle()));
|
||||
#endif
|
||||
if (ret != 0)
|
||||
q->setError(QFile::WriteError, qt_error_string(errno));
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include <QtCore/qstandardpaths.h>
|
||||
#include <QtCore/qtextstream.h>
|
||||
#include <QtCore/qdir.h>
|
||||
#include <QtCore/qcoreapplication.h>
|
||||
|
||||
// We can't use the default macros because this would lead to recursion.
|
||||
// Instead let's define our own one that unconditionally logs...
|
||||
@ -255,6 +256,15 @@ void QLoggingSettingsParser::parseNextLine(QStringRef line)
|
||||
QLoggingRegistry::QLoggingRegistry()
|
||||
: categoryFilter(defaultCategoryFilter)
|
||||
{
|
||||
#if defined(Q_OS_ANDROID)
|
||||
// Unless QCoreApplication has been constructed we can't be sure that
|
||||
// we are on Qt's main thread. If we did allow logging here, we would
|
||||
// potentially set Qt's main thread to Android's thread 0, which would
|
||||
// confuse Qt later when running main().
|
||||
if (!qApp)
|
||||
return;
|
||||
#endif
|
||||
|
||||
initializeRules(); // Init on first use
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,8 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe)
|
||||
unsigned int attempts = 1000;
|
||||
forever {
|
||||
_snwprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]),
|
||||
L"\\\\.\\pipe\\qt-%X", QRandomGenerator::global()->generate());
|
||||
L"\\\\.\\pipe\\qt-%lX-%X", long(QCoreApplication::applicationPid()),
|
||||
QRandomGenerator::global()->generate());
|
||||
|
||||
DWORD dwOpenMode = FILE_FLAG_OVERLAPPED;
|
||||
DWORD dwOutputBufferSize = 0;
|
||||
|
@ -264,7 +264,7 @@ bool QSaveFile::open(OpenMode mode)
|
||||
}
|
||||
#endif
|
||||
|
||||
d->fileEngine = new QTemporaryFileEngine(&d->finalFileName);
|
||||
d->fileEngine = new QTemporaryFileEngine(&d->finalFileName, QTemporaryFileEngine::Win32NonShared);
|
||||
// if the target file exists, we'll copy its permissions below,
|
||||
// but until then, let's ensure the temporary file is not accessible
|
||||
// to a third party
|
||||
|
@ -2366,6 +2366,11 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
|
||||
limitations is to store the settings using the IniFormat
|
||||
instead of the NativeFormat.
|
||||
|
||||
\li On Windows, when the Windows system registry is used, QSettings
|
||||
does not preserve the original type of the value. Therefore,
|
||||
the type of the value might change when a new value is set. For
|
||||
example, a value with type \c REG_EXPAND_SZ will change to \c REG_SZ.
|
||||
|
||||
\li On \macos and iOS, allKeys() will return some extra keys for global
|
||||
settings that apply to all applications. These keys can be
|
||||
read using value() but cannot be changed, only shadowed.
|
||||
|
@ -217,7 +217,16 @@ static QString getFilesDir()
|
||||
if (!path.isEmpty())
|
||||
return path;
|
||||
|
||||
return (path = QDir::homePath());
|
||||
QJNIObjectPrivate appCtx = applicationContext();
|
||||
if (!appCtx.isValid())
|
||||
return QString();
|
||||
|
||||
QJNIObjectPrivate file = appCtx.callObjectMethod("getFilesDir",
|
||||
"()Ljava/io/File;");
|
||||
if (!file.isValid())
|
||||
return QString();
|
||||
|
||||
return (path = getAbsolutePath(file));
|
||||
}
|
||||
|
||||
QString QStandardPaths::writableLocation(StandardLocation type)
|
||||
@ -319,7 +328,9 @@ QStringList QStandardPaths::standardLocations(StandardLocation type)
|
||||
if (!ba.isEmpty())
|
||||
return QStringList((fontLocation = QDir::cleanPath(QString::fromLocal8Bit(ba))));
|
||||
|
||||
return QStringList((fontLocation = QLatin1String("/system/fonts")));
|
||||
// Don't cache the fallback, as we might just have been called before
|
||||
// QT_ANDROID_FONT_LOCATION has been set.
|
||||
return QStringList(QLatin1String("/system/fonts"));
|
||||
}
|
||||
|
||||
return QStringList(writableLocation(type));
|
||||
|
@ -1,17 +1,3 @@
|
||||
[
|
||||
{
|
||||
"Id": "qtemporaryfile",
|
||||
"Name": "Parts of QTemporaryFile",
|
||||
"QDocModule": "qtcore",
|
||||
"QtUsage": "Used in Qt Core. Disable the qtemporaryfile feature to avoid.",
|
||||
"Path": "qtemporaryfile.cpp",
|
||||
|
||||
"Description": "Generates a unique file path and returns a native handle to the open file.",
|
||||
"License": "BSD 3-clause \"New\" or \"Revised\" License",
|
||||
"LicenseId": "BSD-3-Clause",
|
||||
"LicenseFile": "QTEMPORARYFILE_LICENSE.txt",
|
||||
"Copyright": "Copyright (c) 1987, 1993 The Regents of the University of California."
|
||||
},
|
||||
{
|
||||
"Id": "psl",
|
||||
"Name": "The Public Suffix List",
|
||||
@ -39,4 +25,3 @@ supported by Qt (by the QNetworkCookieJar class).",
|
||||
"Copyright": "The list was originally provided by Jo Hermans <jo.hermans@gmail.com>.
|
||||
It is now maintained on github (https://github.com/publicsuffix/list)."
|
||||
}
|
||||
]
|
||||
|
@ -207,7 +207,7 @@ QFileSystemEntry::NativePath QTemporaryFileName::generateNext()
|
||||
changed and contain the generated path name.
|
||||
*/
|
||||
static bool createFileFromTemplate(NativeFileHandle &file, QTemporaryFileName &templ,
|
||||
quint32 mode, QSystemError &error)
|
||||
quint32 mode, int flags, QSystemError &error)
|
||||
{
|
||||
const int maxAttempts = 16;
|
||||
for (int attempt = 0; attempt < maxAttempts; ++attempt) {
|
||||
@ -216,16 +216,18 @@ static bool createFileFromTemplate(NativeFileHandle &file, QTemporaryFileName &t
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
Q_UNUSED(mode);
|
||||
const DWORD shareMode = (flags & QTemporaryFileEngine::Win32NonShared)
|
||||
? 0u : (FILE_SHARE_READ | FILE_SHARE_WRITE);
|
||||
|
||||
# ifndef Q_OS_WINRT
|
||||
file = CreateFile((const wchar_t *)path.constData(),
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_NEW,
|
||||
shareMode, NULL, CREATE_NEW,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
# else // !Q_OS_WINRT
|
||||
file = CreateFile2((const wchar_t *)path.constData(),
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, CREATE_NEW,
|
||||
shareMode, CREATE_NEW,
|
||||
NULL);
|
||||
# endif // Q_OS_WINRT
|
||||
|
||||
@ -247,6 +249,7 @@ static bool createFileFromTemplate(NativeFileHandle &file, QTemporaryFileName &t
|
||||
return false;
|
||||
}
|
||||
#else // POSIX
|
||||
Q_UNUSED(flags)
|
||||
file = QT_OPEN(path.constData(),
|
||||
QT_OPEN_CREAT | QT_OPEN_EXCL | QT_OPEN_RDWR | QT_OPEN_LARGEFILE,
|
||||
static_cast<mode_t>(mode));
|
||||
@ -366,7 +369,7 @@ bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode)
|
||||
unnamedFile = true;
|
||||
d->fileEntry.clear();
|
||||
} else if (st == CreateUnnamedFileStatus::NotSupported &&
|
||||
createFileFromTemplate(file, tfn, fileMode, error)) {
|
||||
createFileFromTemplate(file, tfn, fileMode, flags, error)) {
|
||||
filePathIsTemplate = false;
|
||||
unnamedFile = false;
|
||||
d->fileEntry = QFileSystemEntry(tfn.path, QFileSystemEntry::FromNativePath());
|
||||
|
@ -108,8 +108,10 @@ class QTemporaryFileEngine : public QFSFileEngine
|
||||
{
|
||||
Q_DECLARE_PRIVATE(QFSFileEngine)
|
||||
public:
|
||||
QTemporaryFileEngine(const QString *templateName)
|
||||
: templateName(*templateName)
|
||||
enum Flags { Win32NonShared = 0x1 };
|
||||
|
||||
explicit QTemporaryFileEngine(const QString *_templateName, int _flags = 0)
|
||||
: templateName(*_templateName), flags(_flags)
|
||||
{}
|
||||
|
||||
void initialize(const QString &file, quint32 mode, bool nameIsTemplate = true)
|
||||
@ -144,6 +146,7 @@ public:
|
||||
|
||||
const QString &templateName;
|
||||
quint32 fileMode;
|
||||
int flags = 0;
|
||||
bool filePathIsTemplate;
|
||||
bool filePathWasTemplate;
|
||||
bool unnamedFile = false;
|
||||
|
@ -511,7 +511,7 @@ static int decode(QString &appendTo, const ushort *begin, const ushort *end)
|
||||
if (Q_UNLIKELY(end - input < 3 || !isHex(input[1]) || !isHex(input[2]))) {
|
||||
// badly-encoded data
|
||||
appendTo.resize(origSize + (end - begin));
|
||||
memcpy(appendTo.begin() + origSize, begin, (end - begin) * sizeof(ushort));
|
||||
memcpy(static_cast<void *>(appendTo.begin() + origSize), static_cast<const void *>(begin), (end - begin) * sizeof(ushort));
|
||||
return end - begin;
|
||||
}
|
||||
|
||||
@ -519,7 +519,7 @@ static int decode(QString &appendTo, const ushort *begin, const ushort *end)
|
||||
// detach
|
||||
appendTo.resize(origSize + (end - begin));
|
||||
output = reinterpret_cast<ushort *>(appendTo.begin()) + origSize;
|
||||
memcpy(output, begin, (input - begin) * sizeof(ushort));
|
||||
memcpy(static_cast<void *>(output), static_cast<const void *>(begin), (input - begin) * sizeof(ushort));
|
||||
output += input - begin;
|
||||
}
|
||||
|
||||
|
1238
src/corelib/json/qjsonarray.cpp
Normal file
1238
src/corelib/json/qjsonarray.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -200,7 +200,7 @@ qnx:qtConfig(qqnx_pps) {
|
||||
kernel/qppsobjectprivate_p.h
|
||||
}
|
||||
|
||||
android {
|
||||
android:!android-embedded {
|
||||
SOURCES += \
|
||||
kernel/qjnionload.cpp \
|
||||
kernel/qjnihelpers.cpp \
|
||||
|
@ -95,7 +95,7 @@
|
||||
#endif
|
||||
#endif // QT_NO_QOBJECT
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
# include <private/qjni_p.h>
|
||||
# include <private/qjnihelpers_p.h>
|
||||
#endif
|
||||
@ -186,7 +186,7 @@ QString QCoreApplicationPrivate::appVersion() const
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
# ifdef Q_OS_DARWIN
|
||||
applicationVersion = infoDictionaryStringProperty(QStringLiteral("CFBundleVersion"));
|
||||
# elif defined(Q_OS_ANDROID)
|
||||
# elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
QJNIObjectPrivate context(QtAndroidPrivate::context());
|
||||
if (context.isValid()) {
|
||||
QJNIObjectPrivate pm = context.callObjectMethod(
|
||||
@ -538,29 +538,10 @@ void QCoreApplicationPrivate::cleanupThreadData()
|
||||
void QCoreApplicationPrivate::createEventDispatcher()
|
||||
{
|
||||
Q_Q(QCoreApplication);
|
||||
#if defined(Q_OS_UNIX)
|
||||
# if defined(Q_OS_DARWIN)
|
||||
bool ok = false;
|
||||
int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok);
|
||||
if (ok && value > 0)
|
||||
eventDispatcher = new QEventDispatcherCoreFoundation(q);
|
||||
else
|
||||
eventDispatcher = new QEventDispatcherUNIX(q);
|
||||
# elif !defined(QT_NO_GLIB)
|
||||
if (qEnvironmentVariableIsEmpty("QT_NO_GLIB") && QEventDispatcherGlib::versionSupported())
|
||||
eventDispatcher = new QEventDispatcherGlib(q);
|
||||
else
|
||||
eventDispatcher = new QEventDispatcherUNIX(q);
|
||||
# else
|
||||
eventDispatcher = new QEventDispatcherUNIX(q);
|
||||
# endif
|
||||
#elif defined(Q_OS_WINRT)
|
||||
eventDispatcher = new QEventDispatcherWinRT(q);
|
||||
#elif defined(Q_OS_WIN)
|
||||
eventDispatcher = new QEventDispatcherWin32(q);
|
||||
#else
|
||||
# error "QEventDispatcher not yet ported to this platform"
|
||||
#endif
|
||||
QThreadData *data = QThreadData::current();
|
||||
Q_ASSERT(!data->hasEventDispatcher());
|
||||
eventDispatcher = QThreadPrivate::createEventDispatcher(data);
|
||||
eventDispatcher->setParent(q);
|
||||
}
|
||||
|
||||
void QCoreApplicationPrivate::eventDispatcherReady()
|
||||
@ -816,6 +797,14 @@ void QCoreApplicationPrivate::init()
|
||||
if (!coreappdata()->applicationVersionSet)
|
||||
coreappdata()->applicationVersion = appVersion();
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
// We've deferred initializing the logging registry due to not being
|
||||
// able to guarantee that logging happened on the same thread as the
|
||||
// Qt main thread, but now that the Qt main thread is set up, we can
|
||||
// enable categorized logging.
|
||||
QLoggingRegistry::instance()->initializeRules();
|
||||
#endif
|
||||
|
||||
#if QT_CONFIG(library)
|
||||
// Reset the lib paths, so that they will be recomputed, taking the availability of argv[0]
|
||||
// into account. If necessary, recompute right away and replay the manual changes on top of the
|
||||
@ -848,8 +837,9 @@ void QCoreApplicationPrivate::init()
|
||||
|
||||
#ifndef QT_NO_QOBJECT
|
||||
// use the event dispatcher created by the app programmer (if any)
|
||||
if (!eventDispatcher)
|
||||
eventDispatcher = threadData->eventDispatcher.load();
|
||||
Q_ASSERT(!eventDispatcher);
|
||||
eventDispatcher = threadData->eventDispatcher.load();
|
||||
|
||||
// otherwise we create one
|
||||
if (!eventDispatcher)
|
||||
createEventDispatcher();
|
||||
@ -2266,7 +2256,7 @@ QString QCoreApplication::applicationFilePath()
|
||||
}
|
||||
#endif
|
||||
#if defined( Q_OS_UNIX )
|
||||
# if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
|
||||
# if defined(Q_OS_LINUX) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_EMBEDDED))
|
||||
// Try looking for a /proc/<pid>/exe symlink first which points to
|
||||
// the absolute path of the executable
|
||||
QFileInfo pfi(QString::fromLatin1("/proc/%1/exe").arg(getpid()));
|
||||
|
@ -905,6 +905,7 @@ bool QEventDispatcherWin32::registerEventNotifier(QWinEventNotifier *notifier)
|
||||
return true;
|
||||
|
||||
d->winEventNotifierList.append(notifier);
|
||||
d->winEventNotifierListModified = true;
|
||||
|
||||
if (!d->winEventNotifierActivatedEvent)
|
||||
d->winEventNotifierActivatedEvent = CreateEvent(0, TRUE, FALSE, nullptr);
|
||||
@ -928,6 +929,7 @@ void QEventDispatcherWin32::unregisterEventNotifier(QWinEventNotifier *notifier)
|
||||
if (i == -1)
|
||||
return;
|
||||
d->winEventNotifierList.takeAt(i);
|
||||
d->winEventNotifierListModified = true;
|
||||
QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
|
||||
if (nd->waitHandle)
|
||||
nd->unregisterWaitObject();
|
||||
@ -938,16 +940,19 @@ void QEventDispatcherWin32::activateEventNotifiers()
|
||||
Q_D(QEventDispatcherWin32);
|
||||
ResetEvent(d->winEventNotifierActivatedEvent);
|
||||
|
||||
// Iterate backwards, because the notifier might remove itself on activate().
|
||||
for (int i = d->winEventNotifierList.count(); --i >= 0;) {
|
||||
QWinEventNotifier *notifier = d->winEventNotifierList.at(i);
|
||||
QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
|
||||
if (nd->signaledCount.load() != 0) {
|
||||
--nd->signaledCount;
|
||||
nd->unregisterWaitObject();
|
||||
d->activateEventNotifier(notifier);
|
||||
// Activate signaled notifiers. Our winEventNotifierList can be modified in activation slots.
|
||||
do {
|
||||
d->winEventNotifierListModified = false;
|
||||
for (int i = 0; i < d->winEventNotifierList.count(); ++i) {
|
||||
QWinEventNotifier *notifier = d->winEventNotifierList.at(i);
|
||||
QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
|
||||
if (nd->signaledCount.load() != 0) {
|
||||
--nd->signaledCount;
|
||||
nd->unregisterWaitObject();
|
||||
d->activateEventNotifier(notifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (d->winEventNotifierListModified);
|
||||
|
||||
// Re-register the remaining activated notifiers.
|
||||
for (int i = 0; i < d->winEventNotifierList.count(); ++i) {
|
||||
|
@ -195,6 +195,7 @@ public:
|
||||
|
||||
HANDLE winEventNotifierActivatedEvent;
|
||||
QList<QWinEventNotifier *> winEventNotifierList;
|
||||
bool winEventNotifierListModified = false;
|
||||
void activateEventNotifier(QWinEventNotifier * wen);
|
||||
|
||||
QList<MSG> queuedUserInputEvents;
|
||||
|
@ -101,8 +101,10 @@ QEventLoop::QEventLoop(QObject *parent)
|
||||
Q_D(QEventLoop);
|
||||
if (!QCoreApplication::instance() && QCoreApplicationPrivate::threadRequiresCoreApplication()) {
|
||||
qWarning("QEventLoop: Cannot be used without QApplication");
|
||||
} else if (!d->threadData->eventDispatcher.load()) {
|
||||
QThreadPrivate::createEventDispatcher(d->threadData);
|
||||
} else if (!d->threadData->hasEventDispatcher()) {
|
||||
QAbstractEventDispatcher *eventDispatcher = QThreadPrivate::createEventDispatcher(d->threadData);
|
||||
d->threadData->eventDispatcher.storeRelease(eventDispatcher);
|
||||
eventDispatcher->startingUp();
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,7 +131,7 @@ QEventLoop::~QEventLoop()
|
||||
bool QEventLoop::processEvents(ProcessEventsFlags flags)
|
||||
{
|
||||
Q_D(QEventLoop);
|
||||
if (!d->threadData->eventDispatcher.load())
|
||||
if (!d->threadData->hasEventDispatcher())
|
||||
return false;
|
||||
return d->threadData->eventDispatcher.load()->processEvents(flags);
|
||||
}
|
||||
@ -234,7 +236,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
|
||||
void QEventLoop::processEvents(ProcessEventsFlags flags, int maxTime)
|
||||
{
|
||||
Q_D(QEventLoop);
|
||||
if (!d->threadData->eventDispatcher.load())
|
||||
if (!d->threadData->hasEventDispatcher())
|
||||
return;
|
||||
|
||||
QElapsedTimer start;
|
||||
@ -263,7 +265,7 @@ void QEventLoop::processEvents(ProcessEventsFlags flags, int maxTime)
|
||||
void QEventLoop::exit(int returnCode)
|
||||
{
|
||||
Q_D(QEventLoop);
|
||||
if (!d->threadData->eventDispatcher.load())
|
||||
if (!d->threadData->hasEventDispatcher())
|
||||
return;
|
||||
|
||||
d->returnCode.store(returnCode);
|
||||
@ -292,7 +294,7 @@ bool QEventLoop::isRunning() const
|
||||
void QEventLoop::wakeUp()
|
||||
{
|
||||
Q_D(QEventLoop);
|
||||
if (!d->threadData->eventDispatcher.load())
|
||||
if (!d->threadData->hasEventDispatcher())
|
||||
return;
|
||||
d->threadData->eventDispatcher.load()->wakeUp();
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ QObjectPrivate::~QObjectPrivate()
|
||||
if (extraData && !extraData->runningTimers.isEmpty()) {
|
||||
if (Q_LIKELY(threadData->thread == QThread::currentThread())) {
|
||||
// unregister pending timers
|
||||
if (threadData->eventDispatcher.load())
|
||||
if (threadData->hasEventDispatcher())
|
||||
threadData->eventDispatcher.load()->unregisterTimers(q_ptr);
|
||||
|
||||
// release the timer ids back to the pool
|
||||
@ -1538,7 +1538,7 @@ void QObjectPrivate::setThreadData_helper(QThreadData *currentData, QThreadData
|
||||
++eventsMoved;
|
||||
}
|
||||
}
|
||||
if (eventsMoved > 0 && targetData->eventDispatcher.load()) {
|
||||
if (eventsMoved > 0 && targetData->hasEventDispatcher()) {
|
||||
targetData->canWait = false;
|
||||
targetData->eventDispatcher.load()->wakeUp();
|
||||
}
|
||||
@ -1621,7 +1621,7 @@ int QObject::startTimer(int interval, Qt::TimerType timerType)
|
||||
qWarning("QObject::startTimer: Timers cannot have negative intervals");
|
||||
return 0;
|
||||
}
|
||||
if (Q_UNLIKELY(!d->threadData->eventDispatcher.load())) {
|
||||
if (Q_UNLIKELY(!d->threadData->hasEventDispatcher())) {
|
||||
qWarning("QObject::startTimer: Timers can only be used with threads started with QThread");
|
||||
return 0;
|
||||
}
|
||||
@ -1703,7 +1703,7 @@ void QObject::killTimer(int id)
|
||||
return;
|
||||
}
|
||||
|
||||
if (d->threadData->eventDispatcher.load())
|
||||
if (d->threadData->hasEventDispatcher())
|
||||
d->threadData->eventDispatcher.load()->unregisterTimer(id);
|
||||
|
||||
d->extraData->runningTimers.remove(at);
|
||||
|
@ -149,7 +149,7 @@ QSocketNotifier::QSocketNotifier(qintptr socket, Type type, QObject *parent)
|
||||
|
||||
if (socket < 0)
|
||||
qWarning("QSocketNotifier: Invalid socket specified");
|
||||
else if (!d->threadData->eventDispatcher.load())
|
||||
else if (!d->threadData->hasEventDispatcher())
|
||||
qWarning("QSocketNotifier: Can only be used with threads started with QThread");
|
||||
else
|
||||
d->threadData->eventDispatcher.load()->registerSocketNotifier(this);
|
||||
@ -234,7 +234,7 @@ void QSocketNotifier::setEnabled(bool enable)
|
||||
return;
|
||||
d->snenabled = enable;
|
||||
|
||||
if (!d->threadData->eventDispatcher.load()) // perhaps application/thread is shutting down
|
||||
if (!d->threadData->hasEventDispatcher()) // perhaps application/thread is shutting down
|
||||
return;
|
||||
if (Q_UNLIKELY(thread() != QThread::currentThread())) {
|
||||
qWarning("QSocketNotifier: Socket notifiers cannot be enabled or disabled from another thread");
|
||||
|
@ -239,21 +239,34 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)
|
||||
if (lib)
|
||||
lib->errorString = file.errorString();
|
||||
if (qt_debug_component()) {
|
||||
qWarning("%s: %s", (const char*) QFile::encodeName(library),
|
||||
qWarning("%s: %s", QFile::encodeName(library).constData(),
|
||||
qPrintable(QSystemError::stdString()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QByteArray data;
|
||||
const char *filedata = 0;
|
||||
ulong fdlen = file.size();
|
||||
filedata = (char *) file.map(0, fdlen);
|
||||
const char *filedata = reinterpret_cast<char *>(file.map(0, fdlen));
|
||||
|
||||
if (filedata == 0) {
|
||||
// try reading the data into memory instead
|
||||
data = file.readAll();
|
||||
filedata = data.constData();
|
||||
fdlen = data.size();
|
||||
if (uchar *mapdata = file.map(0, 1)) {
|
||||
file.unmap(mapdata);
|
||||
// Mapping is supported, but failed for the entire file, likely due to OOM.
|
||||
// Return false, as readAll() would cause a bad_alloc and terminate the process.
|
||||
if (lib)
|
||||
lib->errorString = QLibrary::tr("Out of memory while loading plugin '%1'.").arg(library);
|
||||
if (qt_debug_component()) {
|
||||
qWarning("%s: %s", QFile::encodeName(library).constData(),
|
||||
qPrintable(QSystemError::stdString(ENOMEM)));
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
// Try reading the data into memory instead.
|
||||
data = file.readAll();
|
||||
filedata = data.constData();
|
||||
fdlen = data.size();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -751,7 +764,7 @@ void QLibraryPrivate::updatePluginState()
|
||||
if (qt_debug_component()) {
|
||||
qWarning("In %s:\n"
|
||||
" Plugin uses incompatible Qt library (%d.%d.%d) [%s]",
|
||||
(const char*) QFile::encodeName(fileName),
|
||||
QFile::encodeName(fileName).constData(),
|
||||
(qt_version&0xff0000) >> 16, (qt_version&0xff00) >> 8, qt_version&0xff,
|
||||
debug ? "debug" : "release");
|
||||
}
|
||||
|
@ -44,25 +44,17 @@
|
||||
#include <qcoreapplication.h>
|
||||
#include <private/qfilesystementry_p.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
# include <private/qcore_mac_p.h>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if !defined(QT_HPUX_LD)
|
||||
QT_BEGIN_INCLUDE_NAMESPACE
|
||||
#include <dlfcn.h>
|
||||
QT_END_INCLUDE_NAMESPACE
|
||||
#endif
|
||||
|
||||
static QString qdlerror()
|
||||
{
|
||||
#if !defined(QT_HPUX_LD)
|
||||
const char *err = dlerror();
|
||||
#else
|
||||
const char *err = strerror(errno);
|
||||
#endif
|
||||
return err ? QLatin1Char('(') + QString::fromLocal8Bit(err) + QLatin1Char(')'): QString();
|
||||
}
|
||||
|
||||
@ -139,14 +131,6 @@ bool QLibraryPrivate::load_sys()
|
||||
suffixes = suffixes_sys(fullVersion);
|
||||
}
|
||||
int dlFlags = 0;
|
||||
#if defined(QT_HPUX_LD)
|
||||
dlFlags = DYNAMIC_PATH | BIND_NONFATAL;
|
||||
if (loadHints & QLibrary::ResolveAllSymbolsHint) {
|
||||
dlFlags |= BIND_IMMEDIATE;
|
||||
} else {
|
||||
dlFlags |= BIND_DEFERRED;
|
||||
}
|
||||
#else
|
||||
int loadHints = this->loadHints();
|
||||
if (loadHints & QLibrary::ResolveAllSymbolsHint) {
|
||||
dlFlags |= RTLD_NOW;
|
||||
@ -182,7 +166,6 @@ bool QLibraryPrivate::load_sys()
|
||||
dlFlags |= RTLD_MEMBER;
|
||||
}
|
||||
#endif
|
||||
#endif // QT_HPUX_LD
|
||||
|
||||
// If the filename is an absolute path then we want to try that first as it is most likely
|
||||
// what the callee wants. If we have been given a non-absolute path then lets try the
|
||||
@ -211,11 +194,7 @@ bool QLibraryPrivate::load_sys()
|
||||
} else {
|
||||
attempt = path + prefixes.at(prefix) + name + suffixes.at(suffix);
|
||||
}
|
||||
#if defined(QT_HPUX_LD)
|
||||
pHnd = (void*)shl_load(QFile::encodeName(attempt), dlFlags, 0);
|
||||
#else
|
||||
pHnd = dlopen(QFile::encodeName(attempt), dlFlags);
|
||||
#endif
|
||||
|
||||
if (!pHnd && fileName.startsWith(QLatin1Char('/')) && QFile::exists(attempt)) {
|
||||
// We only want to continue if dlopen failed due to that the shared library did not exist.
|
||||
@ -253,11 +232,7 @@ bool QLibraryPrivate::load_sys()
|
||||
|
||||
bool QLibraryPrivate::unload_sys()
|
||||
{
|
||||
#if defined(QT_HPUX_LD)
|
||||
if (shl_unload((shl_t)pHnd)) {
|
||||
#else
|
||||
if (dlclose(pHnd)) {
|
||||
#endif
|
||||
#if defined (Q_OS_QNX) // Workaround until fixed in QNX; fixes crash in
|
||||
char *error = dlerror(); // QtDeclarative auto test "qqmlenginecleanup" for instance
|
||||
if (!qstrcmp(error, "Shared objects still referenced")) // On QNX that's only "informative"
|
||||
@ -289,13 +264,7 @@ Q_CORE_EXPORT QFunctionPointer qt_mac_resolve_sys(void *handle, const char *symb
|
||||
|
||||
QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
|
||||
{
|
||||
#if defined(QT_HPUX_LD)
|
||||
QFunctionPointer address = 0;
|
||||
if (shl_findsym((shl_t*)&pHnd, symbol, TYPE_UNDEFINED, &address) < 0)
|
||||
address = 0;
|
||||
#else
|
||||
QFunctionPointer address = QFunctionPointer(dlsym(pHnd, symbol));
|
||||
#endif
|
||||
if (!address) {
|
||||
errorString = QLibrary::tr("Cannot resolve symbol \"%1\" in %2: %3").arg(
|
||||
QString::fromLatin1(symbol), fileName, qdlerror());
|
||||
|
@ -195,7 +195,7 @@ public:
|
||||
#endif // Q_OS_WIN
|
||||
QThreadData *data;
|
||||
|
||||
static void createEventDispatcher(QThreadData *data);
|
||||
static QAbstractEventDispatcher *createEventDispatcher(QThreadData *data);
|
||||
|
||||
void ref()
|
||||
{
|
||||
@ -222,7 +222,7 @@ public:
|
||||
|
||||
static void setCurrentThread(QThread*) {}
|
||||
static QThread *threadForId(int) { return QThread::currentThread(); }
|
||||
static void createEventDispatcher(QThreadData *data);
|
||||
static QAbstractEventDispatcher *createEventDispatcher(QThreadData *data);
|
||||
|
||||
void ref() {}
|
||||
void deref() {}
|
||||
|
@ -285,27 +285,27 @@ typedef void*(*QtThreadCallback)(void*);
|
||||
|
||||
#endif // QT_NO_THREAD
|
||||
|
||||
void QThreadPrivate::createEventDispatcher(QThreadData *data)
|
||||
QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *data)
|
||||
{
|
||||
Q_UNUSED(data);
|
||||
#if defined(Q_OS_DARWIN)
|
||||
bool ok = false;
|
||||
int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok);
|
||||
if (ok && value > 0)
|
||||
data->eventDispatcher.storeRelease(new QEventDispatcherCoreFoundation);
|
||||
return new QEventDispatcherCoreFoundation;
|
||||
else
|
||||
data->eventDispatcher.storeRelease(new QEventDispatcherUNIX);
|
||||
return new QEventDispatcherUNIX;
|
||||
#elif !defined(QT_NO_GLIB)
|
||||
const bool isQtMainThread = data->thread == QCoreApplicationPrivate::mainThread();
|
||||
if (qEnvironmentVariableIsEmpty("QT_NO_GLIB")
|
||||
&& qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB")
|
||||
&& (isQtMainThread || qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB"))
|
||||
&& QEventDispatcherGlib::versionSupported())
|
||||
data->eventDispatcher.storeRelease(new QEventDispatcherGlib);
|
||||
return new QEventDispatcherGlib;
|
||||
else
|
||||
data->eventDispatcher.storeRelease(new QEventDispatcherUNIX);
|
||||
return new QEventDispatcherUNIX;
|
||||
#else
|
||||
data->eventDispatcher.storeRelease(new QEventDispatcherUNIX);
|
||||
return new QEventDispatcherUNIX;
|
||||
#endif
|
||||
|
||||
data->eventDispatcher.load()->startingUp();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_THREAD
|
||||
@ -352,10 +352,13 @@ void *QThreadPrivate::start(void *arg)
|
||||
data->quitNow = thr->d_func()->exited;
|
||||
}
|
||||
|
||||
if (data->eventDispatcher.load()) // custom event dispatcher set?
|
||||
data->eventDispatcher.load()->startingUp();
|
||||
else
|
||||
createEventDispatcher(data);
|
||||
QAbstractEventDispatcher *eventDispatcher = data->eventDispatcher.load();
|
||||
if (!eventDispatcher) {
|
||||
eventDispatcher = createEventDispatcher(data);
|
||||
data->eventDispatcher.storeRelease(eventDispatcher);
|
||||
}
|
||||
|
||||
eventDispatcher->startingUp();
|
||||
|
||||
#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX))
|
||||
{
|
||||
|
@ -331,15 +331,14 @@ void qt_set_thread_name(HANDLE threadId, LPCSTR threadName)
|
||||
|
||||
#endif // QT_NO_THREAD
|
||||
|
||||
void QThreadPrivate::createEventDispatcher(QThreadData *data)
|
||||
QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *data)
|
||||
{
|
||||
Q_UNUSED(data);
|
||||
#ifndef Q_OS_WINRT
|
||||
QEventDispatcherWin32 *theEventDispatcher = new QEventDispatcherWin32;
|
||||
return new QEventDispatcherWin32;
|
||||
#else
|
||||
QEventDispatcherWinRT *theEventDispatcher = new QEventDispatcherWinRT;
|
||||
return new QEventDispatcherWinRT;
|
||||
#endif
|
||||
data->eventDispatcher.storeRelease(theEventDispatcher);
|
||||
theEventDispatcher->startingUp();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_THREAD
|
||||
@ -360,10 +359,13 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
|
||||
data->quitNow = thr->d_func()->exited;
|
||||
}
|
||||
|
||||
if (data->eventDispatcher.load()) // custom event dispatcher set?
|
||||
data->eventDispatcher.load()->startingUp();
|
||||
else
|
||||
createEventDispatcher(data);
|
||||
QAbstractEventDispatcher *eventDispatcher = data->eventDispatcher.load();
|
||||
if (!eventDispatcher) {
|
||||
eventDispatcher = createEventDispatcher(data);
|
||||
data->eventDispatcher.storeRelease(eventDispatcher);
|
||||
}
|
||||
|
||||
eventDispatcher->startingUp();
|
||||
|
||||
#if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) && !defined(Q_OS_WINRT)
|
||||
// sets the name of the current thread.
|
||||
|
@ -1,4 +1,4 @@
|
||||
Copyright © 1991-2016 Unicode, Inc. All rights reserved.
|
||||
Copyright © 1991-2018 Unicode, Inc. All rights reserved.
|
||||
Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
@ -76,7 +76,8 @@ struct QPodArrayOps
|
||||
Q_ASSERT(b < e);
|
||||
Q_ASSERT(size_t(e - b) <= this->alloc - uint(this->size));
|
||||
|
||||
::memcpy(this->end(), b, (e - b) * sizeof(T));
|
||||
::memcpy(static_cast<void *>(this->end()), static_cast<const void *>(b),
|
||||
(e - b) * sizeof(T));
|
||||
this->size += e - b;
|
||||
}
|
||||
|
||||
|
@ -3855,14 +3855,14 @@ QString& QString::replace(const QRegExp &rx, const QString &after)
|
||||
while (i < pos) {
|
||||
int copyend = replacements[i].pos;
|
||||
int size = copyend - copystart;
|
||||
memcpy(uc, d->data() + copystart, size * sizeof(QChar));
|
||||
memcpy(static_cast<void*>(uc), static_cast<const void *>(d->data() + copystart), size * sizeof(QChar));
|
||||
uc += size;
|
||||
memcpy(uc, after.d->data(), al * sizeof(QChar));
|
||||
memcpy(static_cast<void *>(uc), static_cast<const void *>(after.d->data()), al * sizeof(QChar));
|
||||
uc += al;
|
||||
copystart = copyend + replacements[i].length;
|
||||
i++;
|
||||
}
|
||||
memcpy(uc, d->data() + copystart, (d->size - copystart) * sizeof(QChar));
|
||||
memcpy(static_cast<void *>(uc), static_cast<const void *>(d->data() + copystart), (d->size - copystart) * sizeof(QChar));
|
||||
newstring.resize(newlen);
|
||||
*this = newstring;
|
||||
caretMode = QRegExp::CaretWontMatch;
|
||||
@ -6353,7 +6353,7 @@ QString QString::rightJustified(int width, QChar fill, bool truncate) const
|
||||
while (padlen--)
|
||||
* uc++ = fill;
|
||||
if (len)
|
||||
memcpy(uc, d->data(), sizeof(QChar)*len);
|
||||
memcpy(static_cast<void *>(uc), static_cast<const void *>(d->data()), sizeof(QChar)*len);
|
||||
} else {
|
||||
if (truncate)
|
||||
result = left(width);
|
||||
@ -6931,6 +6931,8 @@ QString QString::vasprintf(const char *cformat, va_list ap)
|
||||
|
||||
\snippet qstring/main.cpp 74
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), toULongLong(), toInt(), QLocale::toLongLong()
|
||||
*/
|
||||
|
||||
@ -6971,6 +6973,8 @@ qlonglong QString::toIntegral_helper(const QChar *data, int len, bool *ok, int b
|
||||
|
||||
\snippet qstring/main.cpp 79
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), toLongLong(), QLocale::toULongLong()
|
||||
*/
|
||||
|
||||
@ -7013,6 +7017,8 @@ qulonglong QString::toIntegral_helper(const QChar *data, uint len, bool *ok, int
|
||||
|
||||
\snippet qstring/main.cpp 73
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), toULong(), toInt(), QLocale::toInt()
|
||||
*/
|
||||
|
||||
@ -7042,6 +7048,8 @@ long QString::toLong(bool *ok, int base) const
|
||||
|
||||
\snippet qstring/main.cpp 78
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), QLocale::toUInt()
|
||||
*/
|
||||
|
||||
@ -7070,6 +7078,8 @@ ulong QString::toULong(bool *ok, int base) const
|
||||
|
||||
\snippet qstring/main.cpp 72
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), toUInt(), toDouble(), QLocale::toInt()
|
||||
*/
|
||||
|
||||
@ -7097,6 +7107,8 @@ int QString::toInt(bool *ok, int base) const
|
||||
|
||||
\snippet qstring/main.cpp 77
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), toInt(), QLocale::toUInt()
|
||||
*/
|
||||
|
||||
@ -7124,6 +7136,8 @@ uint QString::toUInt(bool *ok, int base) const
|
||||
|
||||
\snippet qstring/main.cpp 76
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), toUShort(), toInt(), QLocale::toShort()
|
||||
*/
|
||||
|
||||
@ -7151,6 +7165,8 @@ short QString::toShort(bool *ok, int base) const
|
||||
|
||||
\snippet qstring/main.cpp 80
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), toShort(), QLocale::toUShort()
|
||||
*/
|
||||
|
||||
@ -7170,7 +7186,10 @@ ushort QString::toUShort(bool *ok, int base) const
|
||||
|
||||
\snippet qstring/main.cpp 66
|
||||
|
||||
\warning The QString content may only contain valid numerical characters which includes the plus/minus sign, the characters g and e used in scientific notation, and the decimal point. Including the unit or additional characters leads to a conversion error.
|
||||
\warning The QString content may only contain valid numerical characters
|
||||
which includes the plus/minus sign, the characters g and e used in scientific
|
||||
notation, and the decimal point. Including the unit or additional characters
|
||||
leads to a conversion error.
|
||||
|
||||
\snippet qstring/main.cpp 67
|
||||
|
||||
@ -7185,6 +7204,8 @@ ushort QString::toUShort(bool *ok, int base) const
|
||||
|
||||
\snippet qstring/main.cpp 69
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), QLocale::setDefault(), QLocale::toDouble(), trimmed()
|
||||
*/
|
||||
|
||||
@ -7199,6 +7220,8 @@ double QString::toDouble(bool *ok) const
|
||||
If a conversion error occurs, *\a{ok} is set to \c false; otherwise
|
||||
*\a{ok} is set to \c true. Returns 0.0 if the conversion fails.
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
The string conversion will always happen in the 'C' locale. For locale
|
||||
dependent conversion use QLocale::toFloat()
|
||||
|
||||
@ -7206,6 +7229,8 @@ double QString::toDouble(bool *ok) const
|
||||
|
||||
\snippet qstring/main.cpp 71
|
||||
|
||||
This function ignores leading and trailing whitespace.
|
||||
|
||||
\sa number(), toDouble(), toInt(), QLocale::toFloat()
|
||||
*/
|
||||
|
||||
@ -11878,7 +11903,7 @@ QString QString::toHtmlEscaped() const
|
||||
This cost can be avoided by using QStringLiteral instead:
|
||||
|
||||
\code
|
||||
if (node.hasAttribute(QStringLiteral("http-contents-length"))) //...
|
||||
if (node.hasAttribute(QStringLiteral(u"http-contents-length"))) //...
|
||||
\endcode
|
||||
|
||||
In this case, QString's internal data will be generated at compile time; no
|
||||
@ -11898,6 +11923,10 @@ QString QString::toHtmlEscaped() const
|
||||
if (attribute.name() == QLatin1String("http-contents-length")) //...
|
||||
\endcode
|
||||
|
||||
\note Some compilers have bugs encoding strings containing characters outside
|
||||
the US-ASCII character set. Make sure you prefix your string with \c{u} in
|
||||
those cases. It is optional otherwise.
|
||||
|
||||
\sa QByteArrayLiteral
|
||||
*/
|
||||
|
||||
|
@ -1,13 +1,35 @@
|
||||
[
|
||||
{
|
||||
"Id": "cldr-data",
|
||||
"Name": "Unicode CLDR (Unicode Common Locale Data Repository)",
|
||||
"Id": "unicode-character-database",
|
||||
"Name": "Unicode Character Database (UCD)",
|
||||
"QDocModule": "qtcore",
|
||||
"QtUsage": "Used in Qt Core (QTimeZone). Disable the timezone feature to avoid.",
|
||||
"Files": "qlocale_data_p.h",
|
||||
"QtUsage": "Qt Core uses data obtained from UCD files for working with characters and strings.",
|
||||
"Files": "qunicodetables_p.h qunicodetables.cpp",
|
||||
|
||||
"Description": "QTimeZone includes data obtained from the CLDR data files.",
|
||||
"License": "Unicode Data Files and Software License",
|
||||
"LicenseId": "Unicode-TOU",
|
||||
"LicenseFile": "CLDR_LICENSE.txt",
|
||||
"Copyright": "Copyright (C) 1991-2016 Unicode, Inc."
|
||||
"Description": "The Unicode Character Database (UCD) is a set of files that
|
||||
define the Unicode character properties and internal mappings.",
|
||||
"Homepage": "https://www.unicode.org/ucd/",
|
||||
"Version": "10.0.0",
|
||||
"License": "Unicode License Agreement - Data Files and Software (2016)",
|
||||
"LicenseId": "Unicode-DFS-2016",
|
||||
"LicenseFile": "UNICODE_LICENSE.txt",
|
||||
"Copyright": "Copyright (C) 1991-2018 Unicode, Inc."
|
||||
},
|
||||
{
|
||||
"Id": "unicode-cldr",
|
||||
"Name": "Unicode Common Locale Data Repository (CLDR)",
|
||||
"QDocModule": "qtcore",
|
||||
"QtUsage": "Used in Qt Core (QTimeZone, QLocale).",
|
||||
"Files": "qlocale_data_p.h qtimezoneprivate_data_p.h",
|
||||
|
||||
"Description": "The Unicode CLDR provides key building blocks for software to support the
|
||||
world's languages, with the largest and most extensive standard repository of locale data
|
||||
available.",
|
||||
"Homepage": "http://cldr.unicode.org/",
|
||||
"Version": "v31.0.1",
|
||||
"License": "Unicode License Agreement - Data Files and Software (2016)",
|
||||
"LicenseId": "Unicode-DFS-2016",
|
||||
"LicenseFile": "UNICODE_LICENSE.txt",
|
||||
"Copyright": "Copyright (C) 1991-2017 Unicode, Inc."
|
||||
}
|
||||
]
|
||||
|
@ -62,9 +62,9 @@ static QTimeZonePrivate *newBackendTimeZone()
|
||||
#else
|
||||
#if defined Q_OS_MAC
|
||||
return new QMacTimeZonePrivate();
|
||||
#elif defined Q_OS_ANDROID
|
||||
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
return new QAndroidTimeZonePrivate();
|
||||
#elif defined Q_OS_UNIX
|
||||
#elif defined(Q_OS_UNIX) || defined(Q_OS_ANDROID_EMBEDDED)
|
||||
return new QTzTimeZonePrivate();
|
||||
#elif QT_CONFIG(icu)
|
||||
return new QIcuTimeZonePrivate();
|
||||
@ -88,9 +88,9 @@ static QTimeZonePrivate *newBackendTimeZone(const QByteArray &ianaId)
|
||||
#else
|
||||
#if defined Q_OS_MAC
|
||||
return new QMacTimeZonePrivate(ianaId);
|
||||
#elif defined Q_OS_ANDROID
|
||||
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
return new QAndroidTimeZonePrivate(ianaId);
|
||||
#elif defined Q_OS_UNIX
|
||||
#elif defined(Q_OS_UNIX) || defined(Q_OS_ANDROID_EMBEDDED)
|
||||
return new QTzTimeZonePrivate(ianaId);
|
||||
#elif QT_CONFIG(icu)
|
||||
return new QIcuTimeZonePrivate(ianaId);
|
||||
|
@ -68,7 +68,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSTimeZone);
|
||||
#include <qt_windows.h>
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
#include <QtCore/private/qjni_p.h>
|
||||
#endif
|
||||
|
||||
@ -266,7 +266,7 @@ private:
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC && !defined Q_OS_ANDROID
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_EMBEDDED))
|
||||
struct QTzTransitionTime
|
||||
{
|
||||
qint64 atMSecsSinceEpoch;
|
||||
@ -442,7 +442,7 @@ private:
|
||||
};
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
class QAndroidTimeZonePrivate final : public QTimeZonePrivate
|
||||
{
|
||||
public:
|
||||
|
@ -344,7 +344,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::append(const T *abuf, in
|
||||
while (s < asize)
|
||||
new (ptr+(s++)) T(*abuf++);
|
||||
} else {
|
||||
memcpy(&ptr[s], abuf, increment * sizeof(T));
|
||||
memcpy(static_cast<void *>(&ptr[s]), static_cast<const void *>(abuf), increment * sizeof(T));
|
||||
s = asize;
|
||||
}
|
||||
}
|
||||
@ -392,7 +392,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
|
||||
QT_RETHROW;
|
||||
}
|
||||
} else {
|
||||
memcpy(ptr, oldPtr, copySize * sizeof(T));
|
||||
memcpy(static_cast<void *>(ptr), static_cast<const void *>(oldPtr), copySize * sizeof(T));
|
||||
}
|
||||
}
|
||||
s = copySize;
|
||||
|
@ -747,7 +747,7 @@ typename QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, c
|
||||
} else {
|
||||
T *b = d->begin() + offset;
|
||||
T *i = b + n;
|
||||
memmove(i, b, (d->size - offset) * sizeof(T));
|
||||
memmove(static_cast<void *>(i), static_cast<const void *>(b), (d->size - offset) * sizeof(T));
|
||||
while (i != b)
|
||||
new (--i) T(copy);
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ qtConfig(timezone) {
|
||||
tools/qtimezoneprivate.cpp
|
||||
!nacl:darwin: {
|
||||
SOURCES += tools/qtimezoneprivate_mac.mm
|
||||
} else: android: {
|
||||
} else: android:!android-embedded: {
|
||||
SOURCES += tools/qtimezoneprivate_android.cpp
|
||||
} else: unix: {
|
||||
SOURCES += tools/qtimezoneprivate_tz.cpp
|
||||
|
1966
src/corelib/xml/qxmlstream_p.h
Normal file
1966
src/corelib/xml/qxmlstream_p.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
@ -200,6 +200,15 @@
|
||||
Information about the messages will be written to the console the application
|
||||
was launched from.
|
||||
|
||||
\section1 Licenses
|
||||
|
||||
The Qt D-Bus module is available under commercial licenses from \l{The Qt Company}.
|
||||
In addition, it is available under free software licenses. Since Qt 5.4,
|
||||
these free software licenses are
|
||||
\l{GNU Lesser General Public License, version 3}, or
|
||||
the \l{GNU General Public License, version 2}.
|
||||
See \l{Qt Licensing} for further details.
|
||||
|
||||
\section1 Further Reading
|
||||
|
||||
The following documents contain information about Qt's D-Bus integration
|
||||
|
@ -167,25 +167,20 @@
|
||||
"label": "Fontconfig",
|
||||
"test": {
|
||||
"head": [
|
||||
"#include <ft2build.h>",
|
||||
"#include FT_FREETYPE_H",
|
||||
"#include <fontconfig/fontconfig.h>",
|
||||
"#ifndef FC_RGBA_UNKNOWN",
|
||||
"# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define",
|
||||
"#endif",
|
||||
"#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20110)",
|
||||
"# error This version of freetype is too old.",
|
||||
"#endif"
|
||||
],
|
||||
"main": [
|
||||
"FT_Face face = 0;",
|
||||
"FcPattern *pattern = 0;"
|
||||
]
|
||||
},
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "fontconfig freetype2" },
|
||||
{ "type": "freetype", "libs": "-lfontconfig -lfreetype" }
|
||||
]
|
||||
{ "type": "pkgConfig", "args": "fontconfig" },
|
||||
{ "type": "freetype", "libs": "-lfontconfig" }
|
||||
],
|
||||
"use": "freetype"
|
||||
},
|
||||
"gbm": {
|
||||
"label": "GBM",
|
||||
@ -637,7 +632,13 @@
|
||||
"angle_d3d11_qdtd": {
|
||||
"label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT",
|
||||
"type": "compile",
|
||||
"test": "win/angle_d3d11_qdtd"
|
||||
"test": {
|
||||
"include": "d3d11.h",
|
||||
"main": [
|
||||
"D3D11_QUERY_DATA_TIMESTAMP_DISJOINT qdtd;",
|
||||
"(void) qdtd;"
|
||||
]
|
||||
}
|
||||
},
|
||||
"directwrite2": {
|
||||
"label": "DirectWrite 2",
|
||||
|
@ -215,12 +215,13 @@
|
||||
\section1 Licenses and Attributions
|
||||
|
||||
Qt GUI is available under commercial licenses from \l{The Qt Company}.
|
||||
In addition, it is available under the
|
||||
In addition, it is available under free software licenses. Since Qt 5.4,
|
||||
these free software licenses are
|
||||
\l{GNU Lesser General Public License, version 3}, or
|
||||
the \l{GNU General Public License, version 2}.
|
||||
See \l{Qt Licensing} for further details.
|
||||
|
||||
Furthermore Qt GUI potentially contains third party
|
||||
Furthermore, Qt GUI in Qt \QtVersion may contain third-party
|
||||
modules under following permissive licenses:
|
||||
|
||||
\generatelist{groupsbymodule attributions-qtgui}
|
||||
|
@ -470,6 +470,10 @@ bool QMoviePrivate::next()
|
||||
currentPixmap = QPixmap::fromImage( info.pixmap.toImage().scaled(scaledSize) );
|
||||
else
|
||||
currentPixmap = info.pixmap;
|
||||
|
||||
if (!speed)
|
||||
return true;
|
||||
|
||||
nextDelay = speedAdjustedDelay(info.delay);
|
||||
// Adjust delay according to the time it took to read the frame
|
||||
int processingTime = time.elapsed();
|
||||
@ -504,7 +508,7 @@ void QMoviePrivate::_q_loadNextFrame(bool starting)
|
||||
emit q->updated(frameRect);
|
||||
emit q->frameChanged(currentFrameNumber);
|
||||
|
||||
if (movieState == QMovie::Running)
|
||||
if (speed && movieState == QMovie::Running)
|
||||
nextImageTimer.start(nextDelay);
|
||||
} else {
|
||||
// Could not read another frame
|
||||
@ -926,6 +930,8 @@ void QMovie::setPaused(bool paused)
|
||||
void QMovie::setSpeed(int percentSpeed)
|
||||
{
|
||||
Q_D(QMovie);
|
||||
if (!d->speed && d->movieState == Running)
|
||||
d->nextImageTimer.start(nextFrameDelay());
|
||||
d->speed = percentSpeed;
|
||||
}
|
||||
|
||||
|
@ -2122,7 +2122,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
|
||||
QWindow *window = e->window.data();
|
||||
modifier_buttons = e->modifiers;
|
||||
if (e->nullWindow()
|
||||
#if defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
|| e->key == Qt::Key_Back || e->key == Qt::Key_Menu
|
||||
#endif
|
||||
) {
|
||||
@ -2158,7 +2158,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
|
||||
|
||||
if (window && !window->d_func()->blockedByModalWindow)
|
||||
QGuiApplication::sendSpontaneousEvent(window, &ev);
|
||||
#if defined(Q_OS_ANDROID)
|
||||
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
|
||||
else
|
||||
ev.setAccepted(false);
|
||||
|
||||
|
@ -1002,6 +1002,7 @@ bool QOpenGLContext::makeCurrent(QSurface *surface)
|
||||
if (rendererString)
|
||||
needsWorkaround =
|
||||
qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450
|
||||
|| qstrcmp(rendererString, "Mali-T880") == 0
|
||||
|| qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205
|
||||
|| qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)'
|
||||
|| qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305
|
||||
|
@ -287,6 +287,8 @@ void QPlatformInputContext::setSelectionOnFocusObject(const QPointF &anchorPos,
|
||||
if (success) {
|
||||
int cursor = QInputMethod::queryFocusObject(Qt::ImCursorPosition, cursorPos * mapToLocal).toInt(&success);
|
||||
if (success) {
|
||||
if (anchor == cursor && anchorPos != cursorPos)
|
||||
return;
|
||||
QList<QInputMethodEvent::Attribute> imAttributes;
|
||||
imAttributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, anchor, cursor - anchor, QVariant()));
|
||||
QInputMethodEvent event(QString(), imAttributes);
|
||||
|
@ -58,6 +58,7 @@
|
||||
|
||||
#include <QtCore/QEventLoop>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QLoggingCategory>
|
||||
|
||||
#include <private/qguiapplication_p.h>
|
||||
#include <private/qdnd_p.h>
|
||||
@ -69,6 +70,8 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
|
||||
Q_LOGGING_CATEGORY(lcDnd, "qt.gui.dnd")
|
||||
|
||||
static QWindow* topLevelAt(const QPoint &pos)
|
||||
{
|
||||
QWindowList list = QGuiApplication::topLevelWindows();
|
||||
@ -94,9 +97,9 @@ static QWindow* topLevelAt(const QPoint &pos)
|
||||
*/
|
||||
|
||||
QBasicDrag::QBasicDrag() :
|
||||
m_restoreCursor(false), m_eventLoop(0),
|
||||
m_current_window(nullptr), m_restoreCursor(false), m_eventLoop(nullptr),
|
||||
m_executed_drop_action(Qt::IgnoreAction), m_can_drop(false),
|
||||
m_drag(0), m_drag_icon_window(0), m_useCompositing(true),
|
||||
m_drag(nullptr), m_drag_icon_window(nullptr), m_useCompositing(true),
|
||||
m_screen(nullptr)
|
||||
{
|
||||
}
|
||||
@ -161,6 +164,7 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
|
||||
return true; // Eat all mouse move events
|
||||
}
|
||||
case QEvent::MouseButtonRelease:
|
||||
{
|
||||
disableEventFilter();
|
||||
if (canDrop()) {
|
||||
QPoint nativePosition = getNativeMousePos(e, m_drag_icon_window);
|
||||
@ -169,8 +173,25 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e)
|
||||
cancel();
|
||||
}
|
||||
exitDndEventLoop();
|
||||
QCoreApplication::postEvent(o, new QMouseEvent(*static_cast<QMouseEvent *>(e)));
|
||||
|
||||
// If a QShapedPixmapWindow (drag feedback) is being dragged along, the
|
||||
// mouse event's localPos() will be relative to that, which is useless.
|
||||
// We want a position relative to the window where the drag ends, if possible (?).
|
||||
// If there is no such window (belonging to this Qt application),
|
||||
// make the event relative to the window where the drag started. (QTBUG-66103)
|
||||
const QMouseEvent *release = static_cast<QMouseEvent *>(e);
|
||||
const QWindow *releaseWindow = topLevelAt(release->globalPos());
|
||||
qCDebug(lcDnd) << "mouse released over" << releaseWindow << "after drag from" << m_current_window << "globalPos" << release->globalPos();
|
||||
if (!releaseWindow)
|
||||
releaseWindow = m_current_window;
|
||||
QPoint releaseWindowPos = (releaseWindow ? releaseWindow->mapFromGlobal(release->globalPos()) : release->globalPos());
|
||||
QMouseEvent *newRelease = new QMouseEvent(release->type(),
|
||||
releaseWindowPos, releaseWindowPos, release->screenPos(),
|
||||
release->button(), release->buttons(),
|
||||
release->modifiers(), release->source());
|
||||
QCoreApplication::postEvent(o, newRelease);
|
||||
return true; // defer mouse release events until drag event loop has returned
|
||||
}
|
||||
case QEvent::MouseButtonDblClick:
|
||||
case QEvent::Wheel:
|
||||
return true;
|
||||
@ -349,7 +370,7 @@ static inline QPoint fromNativeGlobalPixels(const QPoint &point)
|
||||
into account.
|
||||
*/
|
||||
|
||||
QSimpleDrag::QSimpleDrag() : m_current_window(0)
|
||||
QSimpleDrag::QSimpleDrag()
|
||||
{
|
||||
}
|
||||
|
||||
@ -366,6 +387,7 @@ void QSimpleDrag::startDrag()
|
||||
updateCursor(Qt::IgnoreAction);
|
||||
}
|
||||
setExecutedDropAction(Qt::IgnoreAction);
|
||||
qCDebug(lcDnd) << "drag began from" << m_current_window<< "cursor pos" << QCursor::pos() << "can drop?" << canDrop();
|
||||
}
|
||||
|
||||
void QSimpleDrag::cancel()
|
||||
|
@ -105,6 +105,9 @@ protected:
|
||||
|
||||
QDrag *drag() const { return m_drag; }
|
||||
|
||||
protected:
|
||||
QWindow *m_current_window;
|
||||
|
||||
private:
|
||||
void enableEventFilter();
|
||||
void disableEventFilter();
|
||||
@ -131,9 +134,6 @@ protected:
|
||||
virtual void cancel() override;
|
||||
virtual void move(const QPoint &globalPos) override;
|
||||
virtual void drop(const QPoint &globalPos) override;
|
||||
|
||||
private:
|
||||
QWindow *m_current_window;
|
||||
};
|
||||
|
||||
#endif // QT_NO_DRAGANDDROP
|
||||
|
@ -283,9 +283,10 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleApplicationStateChanged, Qt::Application
|
||||
QWindowSystemInterfacePrivate::GeometryChangeEvent::GeometryChangeEvent(QWindow *window, const QRect &newGeometry)
|
||||
: WindowSystemEvent(GeometryChange)
|
||||
, window(window)
|
||||
, requestedGeometry(window->handle() ? window->handle()->QPlatformWindow::geometry() : QRect())
|
||||
, newGeometry(newGeometry)
|
||||
{
|
||||
if (const QPlatformWindow *pw = window->handle())
|
||||
requestedGeometry = QHighDpi::fromNativePixels(pw->QPlatformWindow::geometry(), window);
|
||||
}
|
||||
|
||||
QT_DEFINE_QPA_EVENT_HANDLER(void, handleGeometryChange, QWindow *window, const QRect &newRect)
|
||||
|
@ -778,6 +778,8 @@ static QOpenGLTexture::PixelFormat pixelFormatCompatibleWithInternalFormat(QOpen
|
||||
return QOpenGLTexture::Alpha;
|
||||
|
||||
case QOpenGLTexture::RGBFormat:
|
||||
return QOpenGLTexture::RGB;
|
||||
|
||||
case QOpenGLTexture::RGBAFormat:
|
||||
return QOpenGLTexture::RGBA;
|
||||
|
||||
|
@ -127,7 +127,7 @@ AVX2_SOURCES += painting/qdrawhelper_avx2.cpp
|
||||
NEON_SOURCES += painting/qdrawhelper_neon.cpp painting/qimagescale_neon.cpp
|
||||
NEON_HEADERS += painting/qdrawhelper_neon_p.h
|
||||
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
|
||||
!uikit:contains(QT_ARCH, "arm"): CONFIG += no_clang_integrated_as
|
||||
!uikit:!win32:contains(QT_ARCH, "arm"): CONFIG += no_clang_integrated_as
|
||||
!uikit:!win32:!contains(QT_ARCH, "arm64"): DEFINES += ENABLE_PIXMAN_DRAWHELPERS
|
||||
|
||||
MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
|
||||
|
@ -65,10 +65,10 @@ public:
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
// ### Qt 6: remove; the compiler-generated ones are fine!
|
||||
QMatrix &operator=(QMatrix &&other) Q_DECL_NOTHROW // = default
|
||||
{ memcpy(this, &other, sizeof(QMatrix)); return *this; }
|
||||
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QMatrix)); return *this; }
|
||||
QMatrix &operator=(const QMatrix &) Q_DECL_NOTHROW; // = default
|
||||
QMatrix(QMatrix &&other) Q_DECL_NOTHROW // = default
|
||||
{ memcpy(this, &other, sizeof(QMatrix)); }
|
||||
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QMatrix)); }
|
||||
QMatrix(const QMatrix &other) Q_DECL_NOTHROW; // = default
|
||||
#endif
|
||||
|
||||
|
@ -78,14 +78,14 @@ public:
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
// ### Qt 6: remove; the compiler-generated ones are fine!
|
||||
QTransform &operator=(QTransform &&other) Q_DECL_NOTHROW // = default
|
||||
{ memcpy(this, &other, sizeof(QTransform)); return *this; }
|
||||
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QTransform)); return *this; }
|
||||
QTransform &operator=(const QTransform &) Q_DECL_NOTHROW; // = default
|
||||
QTransform(QTransform &&other) Q_DECL_NOTHROW // = default
|
||||
: affine(Qt::Uninitialized)
|
||||
{ memcpy(this, &other, sizeof(QTransform)); }
|
||||
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QTransform)); }
|
||||
QTransform(const QTransform &other) Q_DECL_NOTHROW // = default
|
||||
: affine(Qt::Uninitialized)
|
||||
{ memcpy(this, &other, sizeof(QTransform)); }
|
||||
{ memcpy(static_cast<void *>(this), static_cast<const void *>(&other), sizeof(QTransform)); }
|
||||
#endif
|
||||
|
||||
bool isAffine() const;
|
||||
|
@ -237,13 +237,13 @@ struct QGlyphLayout
|
||||
last = numGlyphs;
|
||||
if (first == 0 && last == numGlyphs
|
||||
&& reinterpret_cast<char *>(offsets + numGlyphs) == reinterpret_cast<char *>(glyphs)) {
|
||||
memset(offsets, 0, (numGlyphs * SpaceNeeded));
|
||||
memset(static_cast<void *>(offsets), 0, (numGlyphs * SpaceNeeded));
|
||||
} else {
|
||||
const int num = last - first;
|
||||
memset(offsets + first, 0, num * sizeof(QFixedPoint));
|
||||
memset(static_cast<void *>(offsets + first), 0, num * sizeof(QFixedPoint));
|
||||
memset(glyphs + first, 0, num * sizeof(glyph_t));
|
||||
memset(advances + first, 0, num * sizeof(QFixed));
|
||||
memset(justifications + first, 0, num * sizeof(QGlyphJustification));
|
||||
memset(static_cast<void *>(advances + first), 0, num * sizeof(QFixed));
|
||||
memset(static_cast<void *>(justifications + first), 0, num * sizeof(QGlyphJustification));
|
||||
memset(attributes + first, 0, num * sizeof(QGlyphAttributes));
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user