Merge remote-tracking branch 'origin/5.9' into 5.11

Conflicts:
	.qmake.conf
	src/corelib/animation/qvariantanimation.cpp
	src/corelib/global/qglobal.cpp
	src/corelib/global/qlogging.cpp
	src/corelib/io/qprocess_win.cpp
	src/corelib/json/qjsonarray.cpp
	src/corelib/tools/qsimd_p.h
	src/corelib/tools/qtimezoneprivate_p.h
	src/corelib/xml/qxmlstream_p.h
	src/gui/kernel/qsimpledrag.cpp
	src/gui/kernel/qsimpledrag_p.h
	src/plugins/generic/generic.pro
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/widgets/styles/qmacstyle_mac.mm
	tests/auto/concurrent/qtconcurrentmap/BLACKLIST
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/widgets/dialogs/qmessagebox/BLACKLIST

Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
This commit is contained in:
Liang Qi 2018-02-14 11:27:58 +01:00
commit 305dd1b61f
166 changed files with 11518 additions and 1153 deletions

View File

@ -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;
}

View File

@ -1,3 +0,0 @@
SOURCES = angle_d3d11_qdtd.cpp
CONFIG -= qt
CONFIG += console

View File

@ -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
View File

@ -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

View File

@ -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 = "&rarr;"

View File

@ -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
}

View File

@ -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();

View File

@ -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

View File

@ -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) {

View File

@ -1,4 +1,4 @@
contains(TEMPLATE, ".*app"):!build_pass: {
contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
defineReplace(emitString) {
return("\"$$replace(1, \\\\, \\\\)\"")

View File

@ -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 += \

View File

@ -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)
}

View File

@ -16,8 +16,11 @@ include(../common/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
@ -32,6 +35,8 @@ 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

View File

@ -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

View File

@ -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.

View File

@ -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);
}

View File

@ -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;

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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;

View File

@ -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 \

View File

@ -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.
*/

View File

@ -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

View File

@ -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}

View File

@ -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)

View File

@ -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, *))

View File

@ -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());

View File

@ -159,7 +159,7 @@ win32 {
} else {
LIBS += -framework MobileCoreServices
}
} else:android {
} else:android:!android-embedded {
SOURCES += \
io/qstandardpaths_android.cpp \
io/qstorageinfo_unix.cpp

View File

@ -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
}

View File

@ -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;

View File

@ -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.

View File

@ -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));

View File

@ -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;
}

File diff suppressed because it is too large Load Diff

View File

@ -200,7 +200,7 @@ qnx:qtConfig(qqnx_pps) {
kernel/qppsobjectprivate_p.h
}
android {
android:!android-embedded {
SOURCES += \
kernel/qjnionload.cpp \
kernel/qjnihelpers.cpp \

View File

@ -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(
@ -816,6 +816,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
@ -2266,7 +2274,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()));

View File

@ -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");
}

View File

@ -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());

View File

@ -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;
}

View File

@ -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;
@ -6309,7 +6309,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);
@ -11834,7 +11834,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
@ -11854,6 +11854,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
*/

View File

@ -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();
// Registry based timezone backend not available on WinRT
#elif defined Q_OS_WIN
@ -89,9 +89,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);
// Registry based timezone backend not available on WinRT
#elif defined Q_OS_WIN

View File

@ -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:

View File

@ -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;

View File

@ -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);
}

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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",

View File

@ -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}

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -236,13 +236,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));
}
}

View File

@ -154,9 +154,9 @@ public:
iterator(const iterator &o) Q_DECL_NOTHROW; // = default
iterator &operator=(const iterator &o) Q_DECL_NOTHROW; // = default
iterator(iterator &&other) Q_DECL_NOTHROW // = default
{ memcpy(this, &other, sizeof(iterator)); }
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(iterator)); }
iterator &operator=(iterator &&other) Q_DECL_NOTHROW // = default
{ memcpy(this, &other, sizeof(iterator)); return *this; }
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(iterator)); return *this; }
#endif
QTextFrame *parentFrame() const { return f; }

View File

@ -541,12 +541,14 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
directories << ministroPath;
nameFilters << QLatin1String("*.der");
platformEncodingFormat = QSsl::Der;
# ifndef Q_OS_ANDROID_EMBEDDED
if (ministroPath.isEmpty()) {
QList<QByteArray> certificateData = fetchSslCertificateData();
for (int i = 0; i < certificateData.size(); ++i) {
systemCerts.append(QSslCertificate::fromData(certificateData.at(i), QSsl::Der));
}
} else
# endif //Q_OS_ANDROID_EMBEDDED
# endif //Q_OS_ANDROID
{
currentDir.setNameFilters(nameFilters);

View File

@ -210,7 +210,7 @@ public:
private:
static bool ensureLibraryLoaded();
static void ensureCiphersAndCertsLoaded();
#if defined(Q_OS_ANDROID)
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
static QList<QByteArray> fetchSslCertificateData();
#endif

View File

@ -82,7 +82,7 @@ qtConfig(ssl) {
darwin:SOURCES += ssl/qsslsocket_mac_shared.cpp
android: SOURCES += ssl/qsslsocket_openssl_android.cpp
android:!android-embedded: SOURCES += ssl/qsslsocket_openssl_android.cpp
# Add optional SSL libs
# Static linking of OpenSSL with msvc:

View File

@ -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.
@ -41,9 +41,6 @@
platform, Microsoft Foundation Classes (MFC) under Windows, or Qt
on both platforms.
\note OpenGL is a trademark of Silicon Graphics, Inc. in
the United States and other countries.
The Qt OpenGL module makes it easy to use OpenGL in Qt applications.
It provides an OpenGL widget class that can be used just like any
other Qt widget, except that it opens an OpenGL display buffer where
@ -68,4 +65,16 @@
The \l{Qt OpenGL C++ Classes} page gives an overview over the available classes
in this module.
\section1 Licenses and Trademarks
The Qt OpenGL 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.
OpenGL\reg is a trademark of Silicon Graphics, Inc. in
the United States and other countries.
*/

View File

@ -45,7 +45,7 @@
#include <QtPlatformHeaders/QEGLNativeContext>
#include <QDebug>
#ifdef Q_OS_ANDROID
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
#include <QtCore/private/qjnihelpers_p.h>
#endif
#ifndef Q_OS_WIN
@ -332,7 +332,7 @@ void QEGLPlatformContext::updateFormatFromGL()
QByteArray version = QByteArray(reinterpret_cast<const char *>(s));
int major, minor;
if (QPlatformOpenGLContext::parseOpenGLVersion(version, major, minor)) {
#ifdef Q_OS_ANDROID
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
// Some Android 4.2.2 devices report OpenGL ES 3.0 without the functions being available.
static int apiLevel = QtAndroidPrivate::androidSdkVersion();
if (apiLevel <= 17 && major >= 3) {

View File

@ -993,9 +993,7 @@ int QFontEngineFT::loadFlags(QGlyphSet *set, GlyphFormat format, int flags,
static inline bool areMetricsTooLarge(const QFontEngineFT::GlyphInfo &info)
{
// false if exceeds QFontEngineFT::Glyph metrics
return (short)(info.linearAdvance) != info.linearAdvance
|| (uchar)(info.width) != info.width
|| (uchar)(info.height) != info.height;
return info.width > 0xFF || info.height > 0xFF;
}
static inline void transformBoundingBox(int *left, int *top, int *right, int *bottom, FT_Matrix *matrix)

View File

@ -133,7 +133,7 @@ public:
/* we don't cache glyphs that are too large anyway, so we can make this struct rather small */
struct Glyph {
~Glyph();
short linearAdvance;
int linearAdvance : 22;
unsigned char width;
unsigned char height;
short x;

View File

@ -507,6 +507,23 @@ static QString familyNameFromPostScriptName(NSString *psName)
}
#endif
static void addExtraFallbacks(QStringList *fallbackList)
{
#if defined(Q_OS_MACOS)
// Since we are only returning a list of default fonts for the current language, we do not
// cover all unicode completely. This was especially an issue for some of the common script
// symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk
// of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most
// of Unicode 2.1.
if (!fallbackList->contains(QStringLiteral("Arial Unicode MS")))
fallbackList->append(QStringLiteral("Arial Unicode MS"));
// Since some symbols (specifically Braille) are not in Arial Unicode MS, we
// add Apple Symbols to cover those too.
if (!fallbackList->contains(QStringLiteral("Apple Symbols")))
fallbackList->append(QStringLiteral("Apple Symbols"));
#endif
}
QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
{
Q_UNUSED(style);
@ -534,16 +551,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
fallbackList.append(QString::fromCFString(fallbackFamilyName));
}
#if defined(Q_OS_OSX)
// Since we are only returning a list of default fonts for the current language, we do not
// cover all unicode completely. This was especially an issue for some of the common script
// symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk
// of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most
// of Unicode 2.1.
if (!fallbackList.contains(QStringLiteral("Arial Unicode MS")))
fallbackList.append(QStringLiteral("Arial Unicode MS"));
#endif
addExtraFallbacks(&fallbackList);
extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &);
fallbackList = qt_sort_families_by_writing_system(script, fallbackList);
@ -584,14 +592,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
fallbackList.append(QLatin1String("Apple Color Emoji"));
// Since we are only returning a list of default fonts for the current language, we do not
// cover all unicode completely. This was especially an issue for some of the common script
// symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk
// of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most
// of Unicode 2.1.
if (!fallbackList.contains(QStringLiteral("Arial Unicode MS")))
fallbackList.append(QStringLiteral("Arial Unicode MS"));
addExtraFallbacks(&fallbackList);
fallbackLists[styleLookupKey.arg(fallbackStyleHint)] = fallbackList;
}
#else

View File

@ -182,6 +182,14 @@ public:
: QCoreTextFontEngine(font, def)
, m_fontData(fontData)
{}
QFontEngine *cloneWithSize(qreal pixelSize) const
{
QFontDef newFontDef = fontDef;
newFontDef.pixelSize = pixelSize;
newFontDef.pointSize = pixelSize * 72.0 / qt_defaultDpi();
return new QCoreTextRawFontEngine(cgFont, newFontDef, m_fontData);
}
QByteArray m_fontData;
};

View File

@ -125,7 +125,7 @@ public:
static QFontEngine::GlyphFormat defaultGlyphFormat;
static QCoreTextFontEngine *create(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference);
private:
protected:
void init();
QImage imageForGlyph(glyph_t glyph, QFixed subPixelPosition, bool colorful, const QTransform &m);
CTFontRef ctfont;

View File

@ -6,6 +6,6 @@ QT_FOR_CONFIG += network-private
SUBDIRS += connman networkmanager
}
android:SUBDIRS += android
android:!android-embedded: SUBDIRS += android
isEmpty(SUBDIRS):SUBDIRS = generic

View File

@ -438,6 +438,16 @@ QAndroidInputContext::QAndroidInputContext()
QObject::connect(QGuiApplication::inputMethod(), &QInputMethod::cursorRectangleChanged,
this, &QAndroidInputContext::updateSelectionHandles);
QObject::connect(QGuiApplication::inputMethod(), &QInputMethod::anchorRectangleChanged,
this, &QAndroidInputContext::updateSelectionHandles);
QObject::connect(QGuiApplication::inputMethod(), &QInputMethod::inputItemClipRectangleChanged, this, [this]{
auto im = qGuiApp->inputMethod();
if (!im->inputItemClipRectangle().contains(im->anchorRectangle()) ||
!im->inputItemClipRectangle().contains(im->cursorRectangle())) {
m_cursorHandleShown = CursorHandleNotShown;
updateSelectionHandles();
}
});
}
QAndroidInputContext::~QAndroidInputContext()
@ -595,27 +605,63 @@ void QAndroidInputContext::handleLocationChanged(int handleId, int x, int y)
double pixelDensity = window
? QHighDpiScaling::factor(window)
: QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
QPoint point(x / pixelDensity, y / pixelDensity);
y -= leftRect.width() / 2;
QPointF point(x / pixelDensity, y / pixelDensity);
point.setY(point.y() - leftRect.width() / 2);
if (handleId == 1) {
setSelectionOnFocusObject(point, point);
return;
}
QInputMethodQueryEvent query(Qt::ImCursorPosition | Qt::ImAnchorPosition);
QInputMethodQueryEvent query(Qt::ImCursorPosition | Qt::ImAnchorPosition | Qt::ImCurrentSelection);
QCoreApplication::sendEvent(m_focusObject, &query);
int cpos = query.value(Qt::ImCursorPosition).toInt();
int anchor = query.value(Qt::ImAnchorPosition).toInt();
bool rtl = query.value(Qt::ImCurrentSelection).toString().isRightToLeft();
auto rightRect = im->anchorRectangle();
if (cpos > anchor)
std::swap(leftRect, rightRect);
auto checkLeftHandle = [&rightRect](QPointF &handlePos) {
if (handlePos.y() > rightRect.center().y())
handlePos.setY(rightRect.center().y()); // adjust Y handle pos
if (handlePos.y() >= rightRect.y() && handlePos.y() <= rightRect.bottom() && handlePos.x() >= rightRect.x())
return false; // same line and wrong X pos ?
return true;
};
auto checkRtlRightHandle = [&rightRect](QPointF &handlePos) {
if (handlePos.y() > rightRect.center().y())
handlePos.setY(rightRect.center().y()); // adjust Y handle pos
if (handlePos.y() >= rightRect.y() && handlePos.y() <= rightRect.bottom() && rightRect.x() >= handlePos.x())
return false; // same line and wrong X pos ?
return true;
};
auto checkRightHandle = [&leftRect](QPointF &handlePos) {
if (handlePos.y() < leftRect.center().y())
handlePos.setY(leftRect.center().y()); // adjust Y handle pos
if (handlePos.y() >= leftRect.y() && handlePos.y() <= leftRect.bottom() && leftRect.x() >= handlePos.x())
return false; // same line and wrong X pos ?
return true;
};
auto checkRtlLeftHandle = [&leftRect](QPointF &handlePos) {
if (handlePos.y() < leftRect.center().y())
handlePos.setY(leftRect.center().y()); // adjust Y handle pos
if (handlePos.y() >= leftRect.y() && handlePos.y() <= leftRect.bottom() && handlePos.x() >= leftRect.x())
return false; // same line and wrong X pos ?
return true;
};
if (handleId == 2) {
QPoint rightPoint(rightRect.center().toPoint());
QPointF rightPoint(rightRect.center());
if ((!rtl && !checkLeftHandle(point)) || (rtl && !checkRtlRightHandle(point)))
return;
setSelectionOnFocusObject(point, rightPoint);
} else if (handleId == 3) {
QPoint leftPoint(leftRect.center().toPoint());
QPointF leftPoint(leftRect.center());
if ((!rtl && !checkRightHandle(point)) || (rtl && !checkRtlLeftHandle(point)))
return;
setSelectionOnFocusObject(leftPoint, point);
}
}

View File

@ -311,6 +311,24 @@ QT_USE_NAMESPACE
return NO; // Someday qApp->quitOnLastWindowClosed(); when QApp and NSApp work closer together.
}
- (void)applicationWillHide:(NSNotification *)notification
{
if (reflectionDelegate
&& [reflectionDelegate respondsToSelector:@selector(applicationWillHide:)]) {
[reflectionDelegate applicationWillHide:notification];
}
// When the application is hidden Qt will hide the popup windows associated with
// it when it has lost the activation for the application. However, when it gets
// to this point it believes the popup windows to be hidden already due to the
// fact that the application itself is hidden, which will cause a problem when
// the application is made visible again.
const QWindowList topLevelWindows = QGuiApplication::topLevelWindows();
for (QWindow *topLevelWindow : qAsConst(topLevelWindows)) {
if ((topLevelWindow->type() & Qt::Popup) == Qt::Popup && topLevelWindow->isVisible())
topLevelWindow->hide();
}
}
- (void)applicationDidBecomeActive:(NSNotification *)notification
{

View File

@ -415,6 +415,13 @@ static QString strippedText(QString s)
} else {
QList<QUrl> result;
QString filename = QString::fromNSString([[mSavePanel URL] path]).normalized(QString::NormalizationForm_C);
const QString defaultSuffix = mOptions->defaultSuffix();
const QFileInfo fileInfo(filename);
// If neither the user or the NSSavePanel have provided a suffix, use
// the default suffix (if it exists).
if (fileInfo.suffix().isEmpty() && !defaultSuffix.isEmpty()) {
filename.append('.').append(defaultSuffix);
}
result << QUrl::fromLocalFile(filename.remove(QLatin1String("___qt_very_unlikely_prefix_")));
return result;
}
@ -442,10 +449,7 @@ static QString strippedText(QString s)
[mPopUpButton setHidden:chooseDirsOnly]; // TODO hide the whole sunken pane instead?
if (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) {
QStringList ext = [self acceptableExtensionsForSave];
const QString defaultSuffix = mOptions->defaultSuffix();
if (!ext.isEmpty() && !defaultSuffix.isEmpty())
ext.prepend(defaultSuffix);
const QStringList ext = [self acceptableExtensionsForSave];
[mSavePanel setAllowedFileTypes:ext.isEmpty() ? nil : qt_mac_QStringListToNSMutableArray(ext)];
} else {
[mOpenPanel setAllowedFileTypes:nil]; // delegate panel:shouldEnableURL: does the file filtering for NSOpenPanel

View File

@ -44,9 +44,11 @@
#include <QtCore/QtDebug>
#include "qcocoaapplication.h"
#include "qcocoaintegration.h"
#include "qcocoamenuloader.h"
#include "qcocoamenubar.h"
#include "qcocoawindow.h"
#include "qcocoascreen.h"
QT_BEGIN_NAMESPACE
@ -364,8 +366,9 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect,
[popupCell setMenu:m_nativeMenu];
[popupCell selectItem:nsItem];
int availableHeight = screen->availableSize().height();
const QPoint &globalPos = parentWindow->mapToGlobal(pos);
QCocoaScreen *cocoaScreen = static_cast<QCocoaScreen *>(screen->handle());
int availableHeight = cocoaScreen->availableGeometry().height();
const QPoint &globalPos = cocoaWindow->mapToGlobal(pos);
int menuHeight = m_nativeMenu.size.height;
if (globalPos.y() + menuHeight > availableHeight) {
// Maybe we need to fix the vertical popup position but we don't know the

View File

@ -72,8 +72,6 @@
**
****************************************************************************/
#define QT_MAC_SYSTEMTRAY_USE_GROWL
#include "qcocoasystemtrayicon.h"
#ifndef QT_NO_SYSTEMTRAYICON

View File

@ -117,7 +117,7 @@ void QEglFSWindow::create()
QOpenGLCompositor *compositor = QOpenGLCompositor::instance();
if (screen->primarySurface() != EGL_NO_SURFACE) {
if (Q_UNLIKELY(!isRaster() || !compositor->targetWindow())) {
#if !defined(Q_OS_ANDROID)
#if !defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_EMBEDDED)
// We can have either a single OpenGL window or multiple raster windows.
// Other combinations cannot work.
qFatal("EGLFS: OpenGL windows cannot be mixed with others.");

View File

@ -59,13 +59,13 @@
#include <QtInputSupport/private/qlibinputhandler_p.h>
#endif
#if QT_CONFIG(evdev) && !defined(Q_OS_ANDROID)
#if QT_CONFIG(evdev)
#include <QtInputSupport/private/qevdevmousemanager_p.h>
#include <QtInputSupport/private/qevdevkeyboardmanager_p.h>
#include <QtInputSupport/private/qevdevtouchmanager_p.h>
#endif
#if QT_CONFIG(tslib) && !defined(Q_OS_ANDROID)
#if QT_CONFIG(tslib)
#include <QtInputSupport/private/qtslib_p.h>
#endif
@ -162,7 +162,7 @@ void QLinuxFbIntegration::createInputHandlers()
new QTsLibMouseHandler(QLatin1String("TsLib"), QString());
#endif
#if QT_CONFIG(evdev) && !defined(Q_OS_ANDROID)
#if QT_CONFIG(evdev)
new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this);
new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this);
#if QT_CONFIG(tslib)

View File

@ -1,7 +1,7 @@
TEMPLATE = subdirs
QT_FOR_CONFIG += gui-private
android: SUBDIRS += android
android:!android-embedded: SUBDIRS += android
!android: SUBDIRS += minimal
@ -36,7 +36,7 @@ qtConfig(directfb) {
qtConfig(linuxfb): SUBDIRS += linuxfb
qtConfig(vnc): SUBDIRS += vnc
qtHaveModule(network):qtConfig(vnc): SUBDIRS += vnc
freebsd {
SUBDIRS += bsdfb

View File

@ -71,14 +71,14 @@ HEADERS = main.h \
LIBS += -lscreen
qtConfig(opengles2) {
qtConfig(egl) {
SOURCES += qqnxglcontext.cpp \
qqnxeglwindow.cpp
HEADERS += qqnxglcontext.h \
qqnxeglwindow.h
QMAKE_USE += opengl_es2 egl
QMAKE_USE += egl
}
qtConfig(qqnx_pps) {

View File

@ -56,18 +56,12 @@ QT_BEGIN_NAMESPACE
QQnxEglWindow::QQnxEglWindow(QWindow *window, screen_context_t context, bool needRootWindow) :
QQnxWindow(window, context, needRootWindow),
m_platformOpenGLContext(0),
m_newSurfaceRequested(true),
m_eglDisplay(EGL_NO_DISPLAY),
m_eglSurface(EGL_NO_SURFACE)
{
initWindow();
// Set window usage
const int val = SCREEN_USAGE_OPENGL_ES2;
const int result = screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_USAGE, &val);
if (Q_UNLIKELY(result != 0))
qFatal("QQnxEglWindow: failed to set window alpha usage, errno=%d", errno);
m_requestedBufferSize = shouldMakeFullScreen() ? screen()->geometry().size() : window->geometry().size();
}
@ -77,14 +71,58 @@ QQnxEglWindow::~QQnxEglWindow()
destroyEGLSurface();
}
void QQnxEglWindow::createEGLSurface()
bool QQnxEglWindow::isInitialized() const
{
return m_eglSurface != EGL_NO_SURFACE;
}
void QQnxEglWindow::ensureInitialized(QQnxGLContext* context)
{
if (m_newSurfaceRequested.testAndSetOrdered(true, false)) {
const QMutexLocker locker(&m_mutex); // Set geomety must not reset the requestedBufferSize till
// the surface is created
if (m_requestedBufferSize != bufferSize() || m_eglSurface == EGL_NO_SURFACE) {
if (m_eglSurface != EGL_NO_SURFACE) {
context->doneCurrent();
destroyEGLSurface();
}
createEGLSurface(context);
} else {
// Must've been a sequence of unprocessed changes returning us to the original size.
resetBuffers();
}
}
}
void QQnxEglWindow::createEGLSurface(QQnxGLContext *context)
{
if (context->format().renderableType() != QSurfaceFormat::OpenGLES) {
qFatal("QQnxEglWindow: renderable type is not OpenGLES");
return;
}
// Set window usage
int usage = SCREEN_USAGE_OPENGL_ES2;
#if _SCREEN_VERSION >= _SCREEN_MAKE_VERSION(1, 0, 0)
if (context->format().majorVersion() == 3)
usage |= SCREEN_USAGE_OPENGL_ES3;
#endif
const int result = screen_set_window_property_iv(nativeHandle(), SCREEN_PROPERTY_USAGE, &usage);
if (Q_UNLIKELY(result != 0))
qFatal("QQnxEglWindow: failed to set window usage, errno=%d", errno);
if (!m_requestedBufferSize.isValid()) {
qWarning("QQNX: Trying to create 0 size EGL surface. "
"Please set a valid window size before calling QOpenGLContext::makeCurrent()");
return;
}
m_eglDisplay = context->eglDisplay();
m_eglConfig = context->eglConfig();
m_format = context->format();
// update the window's buffers before we create the EGL surface
setBufferSize(m_requestedBufferSize);
@ -94,24 +132,27 @@ void QQnxEglWindow::createEGLSurface()
EGL_NONE
};
qEglWindowDebug() << "Creating EGL surface" << platformOpenGLContext()->getEglDisplay()
<< platformOpenGLContext()->getEglConfig();
qEglWindowDebug() << "Creating EGL surface from" << this << context
<< window()->surfaceType() << window()->type();
// Create EGL surface
m_eglSurface = eglCreateWindowSurface(platformOpenGLContext()->getEglDisplay(),
platformOpenGLContext()->getEglConfig(),
(EGLNativeWindowType) nativeHandle(), eglSurfaceAttrs);
if (m_eglSurface == EGL_NO_SURFACE) {
const EGLenum error = QQnxGLContext::checkEGLError("eglCreateWindowSurface");
qWarning("QQNX: failed to create EGL surface, err=%d", error);
}
EGLSurface eglSurface = eglCreateWindowSurface(
m_eglDisplay,
m_eglConfig,
(EGLNativeWindowType) nativeHandle(),
eglSurfaceAttrs);
if (eglSurface == EGL_NO_SURFACE)
qWarning("QQNX: failed to create EGL surface, err=%d", eglGetError());
m_eglSurface = eglSurface;
}
void QQnxEglWindow::destroyEGLSurface()
{
// Destroy EGL surface if it exists
if (m_eglSurface != EGL_NO_SURFACE) {
EGLBoolean eglResult = eglDestroySurface(platformOpenGLContext()->getEglDisplay(), m_eglSurface);
EGLBoolean eglResult = eglDestroySurface(m_eglDisplay, m_eglSurface);
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQNX: failed to destroy EGL surface, err=%d", eglGetError());
}
@ -119,40 +160,8 @@ void QQnxEglWindow::destroyEGLSurface()
m_eglSurface = EGL_NO_SURFACE;
}
void QQnxEglWindow::swapEGLBuffers()
EGLSurface QQnxEglWindow::surface() const
{
qEglWindowDebug();
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
// Post EGL surface to window
eglResult = eglSwapBuffers(m_platformOpenGLContext->getEglDisplay(), m_eglSurface);
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQNX: failed to swap EGL buffers, err=%d", eglGetError());
windowPosted();
}
EGLSurface QQnxEglWindow::getSurface()
{
if (m_newSurfaceRequested.testAndSetOrdered(true, false)) {
const QMutexLocker locker(&m_mutex); //Set geomety must not reset the requestedBufferSize till
//the surface is created
if ((m_requestedBufferSize != bufferSize()) || (m_eglSurface == EGL_NO_SURFACE)) {
if (m_eglSurface != EGL_NO_SURFACE) {
platformOpenGLContext()->doneCurrent();
destroyEGLSurface();
}
createEGLSurface();
} else {
// Must've been a sequence of unprocessed changes returning us to the original size.
resetBuffers();
}
}
return m_eglSurface;
}
@ -169,35 +178,24 @@ void QQnxEglWindow::setGeometry(const QRect &rect)
// that test.
const QMutexLocker locker(&m_mutex);
m_requestedBufferSize = newGeometry.size();
if (m_platformOpenGLContext != 0 && bufferSize() != newGeometry.size())
if (isInitialized() && bufferSize() != newGeometry.size())
m_newSurfaceRequested.testAndSetRelease(false, true);
}
QQnxWindow::setGeometry(newGeometry);
}
void QQnxEglWindow::setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext)
{
// This function does not take ownership of the platform gl context.
// It is owned by the frontend QOpenGLContext
m_platformOpenGLContext = platformOpenGLContext;
}
int QQnxEglWindow::pixelFormat() const
{
if (!m_platformOpenGLContext) //The platform GL context was not set yet
return -1;
const QSurfaceFormat format = m_platformOpenGLContext->format();
// Extract size of color channels from window format
const int redSize = format.redBufferSize();
const int redSize = m_format.redBufferSize();
if (Q_UNLIKELY(redSize == -1))
qFatal("QQnxWindow: red size not defined");
const int greenSize = format.greenBufferSize();
const int greenSize = m_format.greenBufferSize();
if (Q_UNLIKELY(greenSize == -1))
qFatal("QQnxWindow: green size not defined");
const int blueSize = format.blueBufferSize();
const int blueSize = m_format.blueBufferSize();
if (Q_UNLIKELY(blueSize == -1))
qFatal("QQnxWindow: blue size not defined");

View File

@ -53,13 +53,10 @@ public:
QQnxEglWindow(QWindow *window, screen_context_t context, bool needRootWindow);
~QQnxEglWindow();
void createEGLSurface();
void destroyEGLSurface();
void swapEGLBuffers();
EGLSurface getSurface();
EGLSurface surface() const;
void setPlatformOpenGLContext(QQnxGLContext *platformOpenGLContext);
QQnxGLContext *platformOpenGLContext() const { return m_platformOpenGLContext; }
bool isInitialized() const;
void ensureInitialized(QQnxGLContext *context);
void setGeometry(const QRect &rect) override;
@ -68,6 +65,9 @@ protected:
void resetBuffers() override;
private:
void createEGLSurface(QQnxGLContext *context);
void destroyEGLSurface();
QSize m_requestedBufferSize;
// This mutex is used to protect access to the m_requestedBufferSize
@ -78,9 +78,11 @@ private:
// QQnxGLContext::makeCurrent()
mutable QMutex m_mutex;
QQnxGLContext *m_platformOpenGLContext;
QAtomicInt m_newSurfaceRequested;
EGLDisplay m_eglDisplay;
EGLConfig m_eglConfig;
EGLSurface m_eglSurface;
QSurfaceFormat m_format;
};
QT_END_NAMESPACE

View File

@ -59,117 +59,13 @@ QT_BEGIN_NAMESPACE
EGLDisplay QQnxGLContext::ms_eglDisplay = EGL_NO_DISPLAY;
QQnxGLContext::QQnxGLContext(QOpenGLContext *glContext)
: QPlatformOpenGLContext(),
m_glContext(glContext),
m_currentEglSurface(EGL_NO_SURFACE)
QQnxGLContext::QQnxGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share)
: QEGLPlatformContext(format, share, ms_eglDisplay)
{
qGLContextDebug();
QSurfaceFormat format = m_glContext->format();
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
// Get colour channel sizes from window format
int alphaSize = format.alphaBufferSize();
int redSize = format.redBufferSize();
int greenSize = format.greenBufferSize();
int blueSize = format.blueBufferSize();
// Check if all channels are don't care
if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
// Set colour channels based on depth of window's screen
QQnxScreen *screen = static_cast<QQnxScreen*>(glContext->screen()->handle());
int depth = screen->depth();
if (depth == 32) {
// SCREEN_FORMAT_RGBA8888
alphaSize = 8;
redSize = 8;
greenSize = 8;
blueSize = 8;
} else {
// SCREEN_FORMAT_RGB565
alphaSize = 0;
redSize = 5;
greenSize = 6;
blueSize = 5;
}
} else {
// Choose best match based on supported pixel formats
if (alphaSize <= 0 && redSize <= 5 && greenSize <= 6 && blueSize <= 5) {
// SCREEN_FORMAT_RGB565
alphaSize = 0;
redSize = 5;
greenSize = 6;
blueSize = 5;
} else {
// SCREEN_FORMAT_RGBA8888
alphaSize = 8;
redSize = 8;
greenSize = 8;
blueSize = 8;
}
}
// Update colour channel sizes in window format
format.setAlphaBufferSize(alphaSize);
format.setRedBufferSize(redSize);
format.setGreenBufferSize(greenSize);
format.setBlueBufferSize(blueSize);
// Select EGL config based on requested window format
m_eglConfig = q_configFromGLFormat(ms_eglDisplay, format);
if (Q_UNLIKELY(m_eglConfig == 0))
qFatal("QQnxGLContext: failed to find EGL config");
QQnxGLContext *glShareContext = static_cast<QQnxGLContext*>(m_glContext->shareHandle());
m_eglShareContext = glShareContext ? glShareContext->m_eglContext : EGL_NO_CONTEXT;
m_eglContext = eglCreateContext(ms_eglDisplay, m_eglConfig, m_eglShareContext,
contextAttrs(format));
if (Q_UNLIKELY(m_eglContext == EGL_NO_CONTEXT)) {
checkEGLError("eglCreateContext");
qFatal("QQnxGLContext: failed to create EGL context, err=%d", eglGetError());
}
// Query/cache window format of selected EGL config
m_windowFormat = q_glFormatFromConfig(ms_eglDisplay, m_eglConfig);
}
QQnxGLContext::~QQnxGLContext()
{
qGLContextDebug();
// Cleanup EGL context if it exists
if (m_eglContext != EGL_NO_CONTEXT)
eglDestroyContext(ms_eglDisplay, m_eglContext);
}
EGLenum QQnxGLContext::checkEGLError(const char *msg)
{
static const char *errmsg[] =
{
"EGL function succeeded",
"EGL is not initialized, or could not be initialized, for the specified display",
"EGL cannot access a requested resource",
"EGL failed to allocate resources for the requested operation",
"EGL fail to access an unrecognized attribute or attribute value was passed in an attribute list",
"EGLConfig argument does not name a valid EGLConfig",
"EGLContext argument does not name a valid EGLContext",
"EGL current surface of the calling thread is no longer valid",
"EGLDisplay argument does not name a valid EGLDisplay",
"EGL arguments are inconsistent",
"EGLNativePixmapType argument does not refer to a valid native pixmap",
"EGLNativeWindowType argument does not refer to a valid native window",
"EGL one or more argument values are invalid",
"EGLSurface argument does not name a valid surface configured for rendering",
"EGL power management event has occurred",
};
EGLenum error = eglGetError();
fprintf(stderr, "%s: %s\n", msg, errmsg[error - EGL_SUCCESS]);
return error;
}
void QQnxGLContext::initializeContext()
@ -178,16 +74,12 @@ void QQnxGLContext::initializeContext()
// Initialize connection to EGL
ms_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (Q_UNLIKELY(ms_eglDisplay == EGL_NO_DISPLAY)) {
checkEGLError("eglGetDisplay");
qFatal("QQnxGLContext: failed to obtain EGL display");
}
if (Q_UNLIKELY(ms_eglDisplay == EGL_NO_DISPLAY))
qFatal("QQnxGLContext: failed to obtain EGL display: %x", eglGetError());
EGLBoolean eglResult = eglInitialize(ms_eglDisplay, 0, 0);
if (Q_UNLIKELY(eglResult != EGL_TRUE)) {
checkEGLError("eglInitialize");
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQnxGLContext: failed to initialize EGL display, err=%d", eglGetError());
}
}
void QQnxGLContext::shutdownContext()
@ -198,98 +90,32 @@ void QQnxGLContext::shutdownContext()
eglTerminate(ms_eglDisplay);
}
EGLSurface QQnxGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
{
QQnxEglWindow *window = static_cast<QQnxEglWindow *>(surface);
window->ensureInitialized(this);
return window->surface();
}
bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
{
qGLContextDebug();
Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQnxGLContext: failed to set EGL API, err=%d", eglGetError());
QQnxEglWindow *platformWindow = dynamic_cast<QQnxEglWindow*>(surface);
if (!platformWindow)
return false;
platformWindow->setPlatformOpenGLContext(this);
if (m_currentEglSurface == EGL_NO_SURFACE || m_currentEglSurface != platformWindow->getSurface()) {
m_currentEglSurface = platformWindow->getSurface();
doneCurrent();
}
eglResult = eglMakeCurrent(ms_eglDisplay, m_currentEglSurface, m_currentEglSurface, m_eglContext);
if (eglResult != EGL_TRUE) {
checkEGLError("eglMakeCurrent");
qWarning("QQNX: failed to set current EGL context, err=%d", eglGetError());
return false;
}
return (eglResult == EGL_TRUE);
}
void QQnxGLContext::doneCurrent()
{
qGLContextDebug();
// set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
// clear curent EGL context and unbind EGL surface
eglResult = eglMakeCurrent(ms_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQNX: failed to clear current EGL context, err=%d", eglGetError());
return QEGLPlatformContext::makeCurrent(surface);
}
void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
{
qGLContextDebug();
QQnxEglWindow *platformWindow = dynamic_cast<QQnxEglWindow*>(surface);
if (!platformWindow)
return;
platformWindow->swapEGLBuffers();
QEGLPlatformContext::swapBuffers(surface);
QQnxEglWindow *platformWindow = static_cast<QQnxEglWindow*>(surface);
platformWindow->windowPosted();
}
QFunctionPointer QQnxGLContext::getProcAddress(const char *procName)
void QQnxGLContext::doneCurrent()
{
qGLContextDebug();
// Set current rendering API
EGLBoolean eglResult = eglBindAPI(EGL_OPENGL_ES_API);
if (Q_UNLIKELY(eglResult != EGL_TRUE))
qFatal("QQNX: failed to set EGL API, err=%d", eglGetError());
// Lookup EGL extension function pointer
QFunctionPointer result = static_cast<QFunctionPointer>(eglGetProcAddress(procName));
if (!result)
result = reinterpret_cast<QFunctionPointer>(dlsym(RTLD_DEFAULT, procName));
return result;
}
bool QQnxGLContext::isSharing() const
{
return m_eglShareContext != EGL_NO_CONTEXT;
}
EGLDisplay QQnxGLContext::getEglDisplay() {
return ms_eglDisplay;
}
EGLint *QQnxGLContext::contextAttrs(const QSurfaceFormat &format)
{
qGLContextDebug();
// Choose EGL settings based on OpenGL version
#if defined(QT_OPENGL_ES_2)
static EGLint attrs[] = { EGL_CONTEXT_CLIENT_VERSION, format.version().first, EGL_NONE };
return attrs;
#else
return 0;
#endif
QEGLPlatformContext::doneCurrent();
}
QT_END_NAMESPACE

View File

@ -46,49 +46,31 @@
#include <QtCore/QSize>
#include <EGL/egl.h>
#include <QtEglSupport/private/qeglplatformcontext_p.h>
QT_BEGIN_NAMESPACE
class QQnxWindow;
class QQnxGLContext : public QPlatformOpenGLContext
class QQnxGLContext : public QEGLPlatformContext
{
public:
QQnxGLContext(QOpenGLContext *glContext);
QQnxGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share);
virtual ~QQnxGLContext();
static EGLenum checkEGLError(const char *msg);
static void initializeContext();
static void shutdownContext();
void requestSurfaceChange();
bool makeCurrent(QPlatformSurface *surface) override;
void doneCurrent() override;
void swapBuffers(QPlatformSurface *surface) override;
QFunctionPointer getProcAddress(const char *procName) override;
void doneCurrent() override;
virtual QSurfaceFormat format() const override { return m_windowFormat; }
bool isSharing() const override;
static EGLDisplay getEglDisplay();
EGLConfig getEglConfig() const { return m_eglConfig;}
EGLContext getEglContext() const { return m_eglContext; }
protected:
EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override;
private:
//Can be static because different displays returne the same handle
static EGLDisplay ms_eglDisplay;
QSurfaceFormat m_windowFormat;
QOpenGLContext *m_glContext;
EGLConfig m_eglConfig;
EGLContext m_eglContext;
EGLContext m_eglShareContext;
EGLSurface m_currentEglSurface;
static EGLint *contextAttrs(const QSurfaceFormat &format);
};
QT_END_NAMESPACE

View File

@ -313,7 +313,58 @@ QPlatformBackingStore *QQnxIntegration::createPlatformBackingStore(QWindow *wind
QPlatformOpenGLContext *QQnxIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
qIntegrationDebug();
return new QQnxGLContext(context);
// Get color channel sizes from window format
QSurfaceFormat format = context->format();
int alphaSize = format.alphaBufferSize();
int redSize = format.redBufferSize();
int greenSize = format.greenBufferSize();
int blueSize = format.blueBufferSize();
// Check if all channels are don't care
if (alphaSize == -1 && redSize == -1 && greenSize == -1 && blueSize == -1) {
// Set color channels based on depth of window's screen
QQnxScreen *screen = static_cast<QQnxScreen*>(context->screen()->handle());
int depth = screen->depth();
if (depth == 32) {
// SCREEN_FORMAT_RGBA8888
alphaSize = 8;
redSize = 8;
greenSize = 8;
blueSize = 8;
} else {
// SCREEN_FORMAT_RGB565
alphaSize = 0;
redSize = 5;
greenSize = 6;
blueSize = 5;
}
} else {
// Choose best match based on supported pixel formats
if (alphaSize <= 0 && redSize <= 5 && greenSize <= 6 && blueSize <= 5) {
// SCREEN_FORMAT_RGB565
alphaSize = 0;
redSize = 5;
greenSize = 6;
blueSize = 5;
} else {
// SCREEN_FORMAT_RGBA8888
alphaSize = 8;
redSize = 8;
greenSize = 8;
blueSize = 8;
}
}
// Update color channel sizes in window format
format.setAlphaBufferSize(alphaSize);
format.setRedBufferSize(redSize);
format.setGreenBufferSize(greenSize);
format.setBlueBufferSize(blueSize);
context->setFormat(format);
QQnxGLContext *ctx = new QQnxGLContext(context->format(), context->shareHandle());
return ctx;
}
#endif

View File

@ -98,7 +98,7 @@ void *QQnxNativeInterface::nativeResourceForIntegration(const QByteArray &resour
void *QQnxNativeInterface::nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context)
{
if (resource == "eglcontext" && context)
return static_cast<QQnxGLContext*>(context->handle())->getEglContext();
return static_cast<QQnxGLContext*>(context->handle())->eglContext();
return 0;
}

View File

@ -49,10 +49,14 @@
#include <screen/screen.h>
// For pre-7.0 SDPs, map some screen property names to the old
#if !defined(_SCREEN_VERSION)
#define _SCREEN_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch))
#define _SCREEN_VERSION _SCREEN_MAKE_VERSION(0, 0, 0)
#endif
// For pre-1.0.0 screen, map some screen property names to the old
// names.
#include <sys/neutrino.h>
#if _NTO_VERSION < 700
#if _SCREEN_VERSION < _SCREEN_MAKE_VERSION(1, 0, 0)
const int SCREEN_PROPERTY_FLAGS = SCREEN_PROPERTY_KEY_FLAGS;
const int SCREEN_PROPERTY_FOCUS = SCREEN_PROPERTY_KEYBOARD_FOCUS;
const int SCREEN_PROPERTY_MODIFIERS = SCREEN_PROPERTY_KEY_MODIFIERS;

View File

@ -112,12 +112,13 @@ public:
bool shouldMakeFullScreen() const;
void windowPosted();
protected:
virtual int pixelFormat() const = 0;
virtual void resetBuffers() = 0;
void initWindow();
void windowPosted();
screen_context_t m_screenContext;

View File

@ -68,7 +68,6 @@
#include <QtCore/QMutex>
#include <QtCore/QMutexLocker>
#include <QtCore/QUuid>
#include <QtCore/QRegularExpression>
#include <QtCore/QTemporaryFile>
#include <QtCore/private/qsystemlibrary_p.h>
@ -1135,12 +1134,32 @@ void QWindowsNativeFileDialogBase::setLabelText(QFileDialogOptions::DialogLabel
}
}
static bool isHexRange(const QString& s, int start, int end)
{
for (;start < end; ++start) {
QChar ch = s.at(start);
if (!(ch.isDigit()
|| (ch >= QLatin1Char('a') && ch <= QLatin1Char('f'))
|| (ch >= QLatin1Char('A') && ch <= QLatin1Char('F'))))
return false;
}
return true;
}
static inline bool isClsid(const QString &s)
{
// detect "374DE290-123F-4565-9164-39C4925E467B".
static const QRegularExpression pattern(QLatin1String("\\A[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\\z"));
Q_ASSERT(pattern.isValid());
return pattern.match(s).hasMatch();
const QChar dash(QLatin1Char('-'));
return s.size() == 36
&& isHexRange(s, 0, 8)
&& s.at(8) == dash
&& isHexRange(s, 9, 13)
&& s.at(13) == dash
&& isHexRange(s, 14, 18)
&& s.at(18) == dash
&& isHexRange(s, 19, 23)
&& s.at(23) == dash
&& isHexRange(s, 24, 36);
}
void QWindowsNativeFileDialogBase::selectFile(const QString &fileName) const

View File

@ -2558,7 +2558,7 @@ void QWindowsWindow::setCustomMargins(const QMargins &newCustomMargins)
newFrame.moveTo(topLeft);
qCDebug(lcQpaWindows) << __FUNCTION__ << oldCustomMargins << "->" << newCustomMargins
<< currentFrameGeometry << "->" << newFrame;
SetWindowPos(m_data.hwnd, 0, newFrame.x(), newFrame.y(), newFrame.width(), newFrame.height(), SWP_NOZORDER | SWP_FRAMECHANGED);
SetWindowPos(m_data.hwnd, 0, newFrame.x(), newFrame.y(), newFrame.width(), newFrame.height(), SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE);
}
}

View File

@ -134,7 +134,11 @@ static void updateFormatFromContext(QSurfaceFormat &format)
}
format.setProfile(QSurfaceFormat::NoProfile);
const bool isStereo = format.testOption(QSurfaceFormat::StereoBuffers);
format.setOptions(QSurfaceFormat::FormatOptions());
// Restore flags that come from the VisualInfo/FBConfig.
if (isStereo)
format.setOption(QSurfaceFormat::StereoBuffers);
if (format.renderableType() == QSurfaceFormat::OpenGL) {
if (format.version() < qMakePair(3, 0)) {

View File

@ -2071,7 +2071,7 @@ bool QXcbWindow::isEmbedded() const
QPoint QXcbWindow::mapToGlobal(const QPoint &pos) const
{
if (!m_embedded)
return pos;
return QPlatformWindow::mapToGlobal(pos);
QPoint ret;
auto reply = Q_XCB_REPLY(xcb_translate_coordinates, xcb_connection(),
@ -2088,7 +2088,7 @@ QPoint QXcbWindow::mapToGlobal(const QPoint &pos) const
QPoint QXcbWindow::mapFromGlobal(const QPoint &pos) const
{
if (!m_embedded)
return pos;
return QPlatformWindow::mapFromGlobal(pos);
QPoint ret;
auto reply = Q_XCB_REPLY(xcb_translate_coordinates, xcb_connection(),

View File

@ -41,6 +41,7 @@
#include <QtGui/qwindow.h>
#include <QtGui/qpa/qplatformtheme.h>
#include <QtGui/qpa/qplatformwindow.h>
#undef signals
#include <gtk/gtk.h>
@ -426,9 +427,11 @@ void QGtk3Menu::showPopup(const QWindow *parentWindow, const QRect &targetRect,
if (index != -1)
gtk_menu_set_active(GTK_MENU(m_menu), index);
m_targetPos = targetRect.bottomLeft();
if (parentWindow)
m_targetPos = parentWindow->mapToGlobal(m_targetPos);
m_targetPos = QPoint(targetRect.x(), targetRect.y() + targetRect.height());
QPlatformWindow *pw = parentWindow ? parentWindow->handle() : nullptr;
if (pw)
m_targetPos = pw->mapToGlobal(m_targetPos);
gtk_menu_popup(GTK_MENU(m_menu), NULL, NULL, qt_gtk_menu_position_func, this, 0, gtk_get_current_event_time());
}

View File

@ -153,7 +153,7 @@ bool QGtk3Theme::usePlatformNativeDialog(DialogType type) const
case ColorDialog:
return true;
case FileDialog:
return true;
return useNativeFileDialog();
case FontDialog:
return true;
default:
@ -167,6 +167,8 @@ QPlatformDialogHelper *QGtk3Theme::createPlatformDialogHelper(DialogType type) c
case ColorDialog:
return new QGtk3ColorDialogHelper;
case FileDialog:
if (!useNativeFileDialog())
return nullptr;
return new QGtk3FileDialogHelper;
case FontDialog:
return new QGtk3FontDialogHelper;
@ -185,4 +187,17 @@ QPlatformMenuItem* QGtk3Theme::createPlatformMenuItem() const
return new QGtk3MenuItem;
}
bool QGtk3Theme::useNativeFileDialog()
{
/* Require GTK3 >= 3.15.5 to avoid running into this bug:
* https://bugzilla.gnome.org/show_bug.cgi?id=725164
*
* While this bug only occurs when using widget-based file dialogs
* (native GTK3 dialogs are fine) we have to disable platform file
* dialogs entirely since we can't avoid creation of a platform
* dialog helper.
*/
return gtk_check_version(3, 15, 5) == 0;
}
QT_END_NAMESPACE

View File

@ -59,6 +59,8 @@ public:
QPlatformMenuItem* createPlatformMenuItem() const override;
static const char *name;
private:
static bool useNativeFileDialog();
};
QT_END_NAMESPACE

View File

@ -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.
@ -165,6 +165,19 @@
QTextEdit requires a QPrinter rather than a QPainter because it uses information
about the configured page dimensions in order to insert page breaks at the most
appropriate places in printed documents.
\section1 Licenses and Trademarks
The Qt Print Support 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.
Please note that Adobe\reg places restrictions on the use of its trademarks
(including logos) in conjunction with PDF; e.g. "Adobe PDF". Please refer
to \l{http://www.adobe.com}{www.adobe.com} for guidelines.
*/
/*!

View File

@ -54,12 +54,13 @@
\section1 Licenses and Attributions
Qt SQL 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 SQL potentially contains third party
Furthermore, Qt SQL in Qt \QtVersion may contain third party
modules under following permissive licenses:
\generatelist{groupsbymodule attributions-qtsql}

View File

@ -210,9 +210,11 @@ qtConfig(gui) {
src_plugins.depends += src_gui src_platformsupport src_platformheaders
src_testlib.depends += src_gui # if QtGui is enabled, QtTest requires QtGui's headers
qtConfig(widgets) {
SUBDIRS += src_tools_uic src_widgets src_printsupport
SUBDIRS += src_tools_uic src_widgets
!android-embedded: SUBDIRS += src_printsupport
TOOLS += src_tools_uic
src_plugins.depends += src_widgets src_printsupport
src_plugins.depends += src_widgets
!android-embedded: src_plugins.depends += src_printsupport
src_testlib.depends += src_widgets # if QtWidgets is enabled, QtTest requires QtWidgets's headers
qtConfig(opengl) {
SUBDIRS += src_opengl
@ -224,7 +226,7 @@ SUBDIRS += src_plugins
nacl: SUBDIRS -= src_network src_testlib
android: SUBDIRS += src_android src_3rdparty_gradle
android:!android-embedded: SUBDIRS += src_android src_3rdparty_gradle
TR_EXCLUDE = \
src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_uic src_tools_qlalr \

View File

@ -55,12 +55,13 @@
\section1 Licenses and Attributions
Qt Test 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 Test potentially contains third party
Furthermore, Qt Test in Qt \QtVersion may contain third party
modules under following permissive licenses:
\generatelist{groupsbymodule attributions-qttestlib}

View File

@ -2830,7 +2830,10 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter,
if (!nameFilter.isEmpty())
q->setNameFilter(nameFilter);
q->setDirectoryUrl(workingDirectory(directory));
q->selectFile(initialSelection(directory));
if (directory.isLocalFile())
q->selectFile(initialSelection(directory));
else
q->selectUrl(directory);
#ifndef QT_NO_SETTINGS
// Try to restore from the FileDialog settings group; if it fails, fall back

Some files were not shown because too many files have changed in this diff Show More