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

Conflicts:
	src/widgets/widgets/qpushbutton.cpp

Change-Id: I615de00e6e64540c50f658d4d8ab3e002d701a81
This commit is contained in:
Liang Qi 2017-03-14 10:49:20 +01:00
commit 0c034a649f
187 changed files with 2842 additions and 1367 deletions

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2016 Intel Corporation.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the FOO module of the Qt Toolkit. ** This file is part of the FOO module of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the config.tests of the Qt Toolkit. ** This file is part of the config.tests of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -196,6 +196,7 @@ Cpp.ignoredirectives += \
Q_DECLARE_TYPEINFO \ Q_DECLARE_TYPEINFO \
Q_DECL_NOEXCEPT_EXPR \ Q_DECL_NOEXCEPT_EXPR \
QT_DEPRECATED_X \ QT_DEPRECATED_X \
QT_SYSINFO_DEPRECATED_X \
Q_DISABLE_COPY \ Q_DISABLE_COPY \
Q_DUMMY_COMPARISON_OPERATOR \ Q_DUMMY_COMPARISON_OPERATOR \
Q_ENUM \ Q_ENUM \

View File

@ -1,12 +1,22 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: http://www.qt.io/licensing/
** **
** This file is part of the examples of the Qt Toolkit. ** This file is part of the examples of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are

View File

@ -1,12 +1,22 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: http://www.qt.io/licensing/
** **
** This file is part of the examples of the Qt Toolkit. ** This file is part of the examples of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are

View File

@ -1,12 +1,22 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: http://www.qt.io/licensing/
** **
** This file is part of the examples of the Qt Toolkit. ** This file is part of the examples of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are

View File

@ -1,12 +1,22 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: http://www.qt.io/licensing/
** **
** This file is part of the examples of the Qt Toolkit. ** This file is part of the examples of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are

View File

@ -1,12 +1,22 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: http://www.qt.io/licensing/
** **
** This file is part of the examples of the Qt Toolkit. ** This file is part of the examples of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are

View File

@ -1,12 +1,22 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: http://www.qt.io/licensing/
** **
** This file is part of the examples of the Qt Toolkit. ** This file is part of the examples of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are
@ -44,7 +54,7 @@
#include <QOpenGLContext> #include <QOpenGLContext>
#include <QOpenGLFunctions> #include <QOpenGLFunctions>
#include <QOpenGLExtraFunctions> #include <QOpenGLExtraFunctions>
//#include <QtGui/qopenglext.h> #include <QOpenGLVertexArrayObject>
#include <QtGui/qopengl.h> #include <QtGui/qopengl.h>
#include <QDebug> #include <QDebug>
#include <QTimer> #include <QTimer>
@ -70,7 +80,8 @@ GLWindow::GLWindow()
m_shaderComputeV(0), m_shaderComputeV(0),
m_shaderComputeH(0), m_shaderComputeH(0),
m_blurRadius(0.0f), m_blurRadius(0.0f),
m_animate(true) m_animate(true),
m_vao(0)
{ {
const float animationStart = 0.0; const float animationStart = 0.0;
const float animationEnd = 10.0; const float animationEnd = 10.0;
@ -106,6 +117,7 @@ GLWindow::~GLWindow()
delete m_animationGroup; delete m_animationGroup;
delete m_animationForward; delete m_animationForward;
delete m_animationBackward; delete m_animationBackward;
delete m_vao;
} }
void GLWindow::setBlurRadius(float blurRadius) void GLWindow::setBlurRadius(float blurRadius)
@ -168,19 +180,21 @@ static const char *fsDisplaySource =
"}\n"; "}\n";
static const char *csComputeSourceV = static const char *csComputeSourceV =
//"#extension GL_EXT_gpu_shader5 : require \n"
"#define COMPUTEPATCHSIZE 32 \n" "#define COMPUTEPATCHSIZE 32 \n"
"#define IMGFMT rgba8 \n" "#define IMGFMT rgba8 \n"
"layout (local_size_x = COMPUTEPATCHSIZE, local_size_y = COMPUTEPATCHSIZE) in;\n" "layout (local_size_x = COMPUTEPATCHSIZE, local_size_y = COMPUTEPATCHSIZE) in;\n"
"layout(binding=0, IMGFMT) uniform highp image2D inputImage; // Use a sampler to improve performance \n" "layout(binding=0, IMGFMT) uniform readonly highp image2D inputImage; // Use a sampler to improve performance \n"
"layout(binding=1, IMGFMT) uniform highp image2D resultImage;\n" "layout(binding=1, IMGFMT) uniform writeonly highp image2D resultImage;\n"
"uniform int radius;\n" "uniform int radius;\n"
"const float cutoff = 2.2;\n" "const float cutoff = 2.2;\n"
"float sigma = clamp(float(radius) / cutoff,0.02,100.0);\n" // Const initialization with dynamically uniform expressions doesn't work in GLES
"float expFactor = 1.0 / (2.0 * sigma * sigma);\n" // Same here
"float gaussian(float distance) {\n" "float expFactor() { // a function, otherwise MESA produces error: initializer of global variable `expFactor' must be a constant expression\n"
" return exp( -(distance * distance) * expFactor);\n" " float sigma = clamp(float(radius) / cutoff,0.02,100.0);\n"
" return 1.0 / (2.0 * sigma * sigma);\n"
"}\n"
"float gaussian(float distance, float expfactor) {\n"
" return exp( -(distance * distance) * expfactor);\n"
"}\n" "}\n"
"void main() {\n" "void main() {\n"
@ -194,31 +208,34 @@ static const char *csComputeSourceV =
" int right = clamp(x + radius, 0, imgSize.x - 1);\n" " int right = clamp(x + radius, 0, imgSize.x - 1);\n"
" int top = clamp(y - radius, 0, imgSize.y - 1);\n" " int top = clamp(y - radius, 0, imgSize.y - 1);\n"
" int bottom = clamp(y + radius, 0, imgSize.y - 1);\n" " int bottom = clamp(y + radius, 0, imgSize.y - 1);\n"
" float expfactor = expFactor();\n"
" for (int iY = top; iY <= bottom; iY++) {\n" " for (int iY = top; iY <= bottom; iY++) {\n"
" float dy = float(abs(iY - y));\n" " float dy = float(abs(iY - y));\n"
" vec4 imgValue = imageLoad(inputImage, ivec2(x,iY));\n" " vec4 imgValue = imageLoad(inputImage, ivec2(x,iY));\n"
" float weight = gaussian(dy);\n" " float weight = gaussian(dy, expfactor);\n"
" sumWeights += weight;\n" " sumWeights += weight;\n"
" sumPixels += (imgValue * weight);\n" " sumPixels += (imgValue * weight);\n"
" }\n" " }\n"
" sumPixels /= sumWeights;\n" " sumPixels /= sumWeights;\n"
" imageStore(resultImage, ivec2(x,y), sumPixels);" " imageStore(resultImage, ivec2(x,y), sumPixels);\n"
"}\n"; "}\n";
static const char *csComputeSourceH = static const char *csComputeSourceH =
//"#extension GL_EXT_gpu_shader5 : require \n"
"#define COMPUTEPATCHSIZE 32 \n" "#define COMPUTEPATCHSIZE 32 \n"
"#define IMGFMT rgba8 \n" "#define IMGFMT rgba8 \n"
"layout (local_size_x = COMPUTEPATCHSIZE, local_size_y = COMPUTEPATCHSIZE) in;\n" "layout (local_size_x = COMPUTEPATCHSIZE, local_size_y = COMPUTEPATCHSIZE) in;\n"
"layout(binding=0, IMGFMT) uniform highp image2D inputImage; // Use a sampler to improve performance \n" "layout(binding=0, IMGFMT) uniform readonly highp image2D inputImage; // Use a sampler to improve performance \n"
"layout(binding=1, IMGFMT) uniform highp image2D resultImage;\n" "layout(binding=1, IMGFMT) uniform writeonly highp image2D resultImage;\n"
"uniform int radius;\n" "uniform int radius;\n"
"const float cutoff = 2.2;\n" "const float cutoff = 2.2;\n"
"float sigma = clamp(float(radius) / cutoff,0.02,100.0);\n"
"float expFactor = 1.0 / (2.0 * sigma * sigma);\n"
"float gaussian(float distance) {\n" "float expFactor() { // a function, otherwise MESA produces error: initializer of global variable `expFactor' must be a constant expression\n"
" return exp( -(distance * distance) * expFactor);\n" " float sigma = clamp(float(radius) / cutoff,0.02,100.0);\n"
" return 1.0 / (2.0 * sigma * sigma);\n"
"}\n"
"float gaussian(float distance, float expfactor) {\n"
" return exp( -(distance * distance) * expfactor);\n"
"}\n" "}\n"
"void main() {\n" "void main() {\n"
@ -232,15 +249,16 @@ static const char *csComputeSourceH =
" int right = clamp(x + radius, 0, imgSize.x - 1);\n" " int right = clamp(x + radius, 0, imgSize.x - 1);\n"
" int top = clamp(y - radius, 0, imgSize.y - 1);\n" " int top = clamp(y - radius, 0, imgSize.y - 1);\n"
" int bottom = clamp(y + radius, 0, imgSize.y - 1);\n" " int bottom = clamp(y + radius, 0, imgSize.y - 1);\n"
" float expfactor = expFactor();\n"
" for (int iX = left; iX <= right; iX++) {\n" " for (int iX = left; iX <= right; iX++) {\n"
" float dx = float(abs(iX - x));\n" " float dx = float(abs(iX - x));\n"
" vec4 imgValue = imageLoad(inputImage, ivec2(iX,y));\n" " vec4 imgValue = imageLoad(inputImage, ivec2(iX,y));\n"
" float weight = gaussian(dx);\n" " float weight = gaussian(dx, expfactor);\n"
" sumWeights += weight;\n" " sumWeights += weight;\n"
" sumPixels += (imgValue * weight);\n" " sumPixels += (imgValue * weight);\n"
" }\n" " }\n"
" sumPixels /= sumWeights;\n" " sumPixels /= sumWeights;\n"
" imageStore(resultImage, ivec2(x,y), sumPixels);" " imageStore(resultImage, ivec2(x,y), sumPixels);\n"
"}\n"; "}\n";
@ -252,7 +270,7 @@ QByteArray versionedShaderCode(const char *src)
if (QOpenGLContext::currentContext()->isOpenGLES()) if (QOpenGLContext::currentContext()->isOpenGLES())
versionedSrc.append(QByteArrayLiteral("#version 310 es\n")); versionedSrc.append(QByteArrayLiteral("#version 310 es\n"));
else else
versionedSrc.append(QByteArrayLiteral("#version 430\n")); versionedSrc.append(QByteArrayLiteral("#version 430 core\n"));
versionedSrc.append(src); versionedSrc.append(src);
return versionedSrc; return versionedSrc;
@ -305,7 +323,6 @@ void GLWindow::initializeGL()
<< ctx->format().minorVersion() << ctx->format().minorVersion()
<< ((ctx->format().renderableType() == QSurfaceFormat::OpenGLES) ? (" GLES") : (" GL")) << ((ctx->format().renderableType() == QSurfaceFormat::OpenGLES) ? (" GLES") : (" GL"))
<< " context"; << " context";
//QOpenGLFunctions *f = ctx->functions();
if (m_texImageInput) { if (m_texImageInput) {
delete m_texImageInput; delete m_texImageInput;
@ -363,6 +380,10 @@ void GLWindow::initializeGL()
m_shaderComputeH = new QOpenGLShaderProgram; m_shaderComputeH = new QOpenGLShaderProgram;
m_shaderComputeH->addShaderFromSourceCode(QOpenGLShader::Compute, versionedShaderCode(csComputeSourceH)); m_shaderComputeH->addShaderFromSourceCode(QOpenGLShader::Compute, versionedShaderCode(csComputeSourceH));
m_shaderComputeH->link(); m_shaderComputeH->link();
// Create a VAO. Not strictly required for ES 3, but it is for plain OpenGL core context.
m_vao = new QOpenGLVertexArrayObject;
m_vao->create();
} }
void GLWindow::resizeGL(int w, int h) void GLWindow::resizeGL(int w, int h)
@ -411,13 +432,15 @@ void GLWindow::paintGL()
// Display processed image // Display processed image
f->glClearColor(0, 0, 0, 1); f->glClearColor(0, 0, 0, 1);
f->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); f->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_texImageProcessed->bind(GL_TEXTURE0); m_texImageProcessed->bind(0);
m_shaderDisplay->bind(); m_shaderDisplay->bind();
m_shaderDisplay->setUniformValue("matProjection",m_proj); m_shaderDisplay->setUniformValue("matProjection",m_proj);
m_shaderDisplay->setUniformValue("imageRatio",m_quadSize); m_shaderDisplay->setUniformValue("imageRatio",m_quadSize);
m_shaderDisplay->setUniformValue("samImage",0); m_shaderDisplay->setUniformValue("samImage",0);
m_vao->bind();
f->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); f->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
m_vao->release();
m_shaderDisplay->release(); m_shaderDisplay->release();
m_texImageProcessed->release(GL_TEXTURE0); m_texImageProcessed->release(0);
} }

View File

@ -1,12 +1,22 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: http://www.qt.io/licensing/
** **
** This file is part of the examples of the Qt Toolkit. ** This file is part of the examples of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are
@ -94,6 +104,7 @@ private:
int m_blurRadius; int m_blurRadius;
bool m_animate; bool m_animate;
QOpenGLVertexArrayObject *m_vao;
}; };
#endif #endif

View File

@ -1,12 +1,22 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: http://www.qt.io/licensing/
** **
** This file is part of the examples of the Qt Toolkit. ** This file is part of the examples of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are
@ -46,15 +56,17 @@
#include <QPair> #include <QPair>
#include "glwindow.h" #include "glwindow.h"
bool OGLSupports(int major, int minor, bool gles = false) bool OGLSupports(int major, int minor, bool gles = false, QSurfaceFormat::OpenGLContextProfile profile = QSurfaceFormat::NoProfile)
{ {
QOpenGLContext ctx; QOpenGLContext ctx;
QSurfaceFormat fmt; QSurfaceFormat fmt;
fmt.setVersion(major, minor); fmt.setVersion(major, minor);
if (gles) if (gles) {
fmt.setRenderableType(QSurfaceFormat::OpenGLES); fmt.setRenderableType(QSurfaceFormat::OpenGLES);
else } else {
fmt.setRenderableType(QSurfaceFormat::OpenGL); fmt.setRenderableType(QSurfaceFormat::OpenGL);
fmt.setProfile(profile);
}
ctx.setFormat(fmt); ctx.setFormat(fmt);
ctx.create(); ctx.create();
@ -68,6 +80,8 @@ bool OGLSupports(int major, int minor, bool gles = false)
if (ctxMajor < major) return false; if (ctxMajor < major) return false;
if (ctxMajor == major && ctxMinor < minor) if (ctxMajor == major && ctxMinor < minor)
return false; return false;
if (!gles && ctx.format().profile() != profile)
return false;
return true; return true;
} }
@ -75,18 +89,34 @@ int main(int argc, char *argv[])
{ {
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
qDebug() << "Support for GL 2.0 "<<( OGLSupports(2,0) ? "yes" : "no"); qDebug() << "Support for GL 2.0 noprof "<<( OGLSupports(2,0,false) ? "yes" : "no");
qDebug() << "Support for GL 2.1 "<<( OGLSupports(2,1) ? "yes" : "no"); qDebug() << "Support for GL 2.0 core "<<( OGLSupports(2,0,false, QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 3.0 "<<( OGLSupports(3,0) ? "yes" : "no"); qDebug() << "Support for GL 2.0 compat "<<( OGLSupports(2,0,false, QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 3.1 "<<( OGLSupports(3,1) ? "yes" : "no"); qDebug() << "Support for GL 2.1 noprof "<<( OGLSupports(2,1,false) ? "yes" : "no");
qDebug() << "Support for GL 3.2 "<<( OGLSupports(3,2) ? "yes" : "no"); qDebug() << "Support for GL 2.1 core "<<( OGLSupports(2,1,false, QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 3.3 "<<( OGLSupports(3,3) ? "yes" : "no"); qDebug() << "Support for GL 2.1 compat "<<( OGLSupports(2,1,false, QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.0 "<<( OGLSupports(4,0) ? "yes" : "no"); qDebug() << "Support for GL 3.0 noprof "<<( OGLSupports(3,0,false) ? "yes" : "no");
qDebug() << "Support for GL 4.1 "<<( OGLSupports(4,1) ? "yes" : "no"); qDebug() << "Support for GL 3.0 core "<<( OGLSupports(3,0,false, QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.2 "<<( OGLSupports(4,2) ? "yes" : "no"); qDebug() << "Support for GL 3.0 compat "<<( OGLSupports(3,0,false, QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.3 "<<( OGLSupports(4,3) ? "yes" : "no"); qDebug() << "Support for GL 3.1 noprof "<<( OGLSupports(3,1,false) ? "yes" : "no");
qDebug() << "Support for GL 4.4 "<<( OGLSupports(4,4) ? "yes" : "no"); qDebug() << "Support for GL 3.1 core "<<( OGLSupports(3,1,false, QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.5 "<<( OGLSupports(4,5) ? "yes" : "no"); qDebug() << "Support for GL 3.1 compat "<<( OGLSupports(3,1,false, QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 3.2 core "<<( OGLSupports(3,2,false,QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 3.2 compat "<<( OGLSupports(3,2,false,QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 3.3 core "<<( OGLSupports(3,3,false,QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 3.3 compat "<<( OGLSupports(3,3,false,QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.0 core "<<( OGLSupports(4,0,false,QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.0 compat "<<( OGLSupports(4,0,false,QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.1 core "<<( OGLSupports(4,1,false,QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.1 compat "<<( OGLSupports(4,1,false,QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.2 core "<<( OGLSupports(4,2,false,QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.2 compat "<<( OGLSupports(4,2,false,QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.3 core "<<( OGLSupports(4,3,false,QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.3 compat "<<( OGLSupports(4,3,false,QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.4 core "<<( OGLSupports(4,4,false,QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.4 compat "<<( OGLSupports(4,4,false,QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.5 core "<<( OGLSupports(4,5,false,QSurfaceFormat::CoreProfile) ? "yes" : "no");
qDebug() << "Support for GL 4.5 compat "<<( OGLSupports(4,5,false,QSurfaceFormat::CompatibilityProfile) ? "yes" : "no");
qDebug() << "Support for GLES 2.0 "<<( OGLSupports(2,0,true) ? "yes" : "no"); qDebug() << "Support for GLES 2.0 "<<( OGLSupports(2,0,true) ? "yes" : "no");
qDebug() << "Support for GLES 3.0 "<<( OGLSupports(3,0,true) ? "yes" : "no"); qDebug() << "Support for GLES 3.0 "<<( OGLSupports(3,0,true) ? "yes" : "no");
qDebug() << "Support for GLES 3.1 "<<( OGLSupports(3,1,true) ? "yes" : "no"); qDebug() << "Support for GLES 3.1 "<<( OGLSupports(3,1,true) ? "yes" : "no");
@ -95,16 +125,16 @@ int main(int argc, char *argv[])
QSurfaceFormat fmt; QSurfaceFormat fmt;
fmt.setDepthBufferSize(24); fmt.setDepthBufferSize(24);
// Request OpenGL 4.3 compatibility or OpenGL ES 3.1. // Request OpenGL ES 3.1 context, as this is a GLES example. If not available, go for OpenGL 4.3 core.
if (OGLSupports(4,3)) { if (OGLSupports(3,1,true)) {
qDebug("Requesting 4.3 compatibility context");
fmt.setVersion(4, 3);
fmt.setRenderableType(QSurfaceFormat::OpenGL);
fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
} else if (OGLSupports(3,1,true)) {
qDebug("Requesting 3.1 GLES context"); qDebug("Requesting 3.1 GLES context");
fmt.setVersion(3, 1); fmt.setVersion(3, 1);
fmt.setRenderableType(QSurfaceFormat::OpenGLES); fmt.setRenderableType(QSurfaceFormat::OpenGLES);
} else if (OGLSupports(4,3,false,QSurfaceFormat::CoreProfile)) {
qDebug("Requesting 4.3 core context");
fmt.setVersion(4, 3);
fmt.setRenderableType(QSurfaceFormat::OpenGL);
fmt.setProfile(QSurfaceFormat::CoreProfile);
} else { } else {
qWarning("Error: This system does not support OpenGL Compute Shaders! Exiting."); qWarning("Error: This system does not support OpenGL Compute Shaders! Exiting.");
return -1; return -1;

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 Green Hills Software. All rights reserved. ** Copyright (C) 2015 Green Hills Software. All rights reserved.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -2,32 +2,38 @@
############################################################################# #############################################################################
## ##
## Copyright (C) 2015 The Qt Company Ltd. ## Copyright (C) 2017 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/ ## Contact: https://www.qt.io/licensing/
## ##
## This file is the build configuration utility of the Qt Toolkit. ## This file is the build configuration utility of the Qt Toolkit.
## ##
## $QT_BEGIN_LICENSE:LGPL21$ ## $QT_BEGIN_LICENSE:LGPL$
## Commercial License Usage ## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in ## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the ## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in ## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and The Qt Company. For licensing terms ## a written agreement between you and The Qt Company. For licensing terms
## and conditions see http://www.qt.io/terms-conditions. For further ## and conditions see https://www.qt.io/terms-conditions. For further
## information use the contact form at http://www.qt.io/contact-us. ## information use the contact form at https://www.qt.io/contact-us.
## ##
## GNU Lesser General Public License Usage ## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser ## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 or version 3 as published by the Free ## General Public License version 3 as published by the Free Software
## Software Foundation and appearing in the file LICENSE.LGPLv21 and ## Foundation and appearing in the file LICENSE.LGPL3 included in the
## LICENSE.LGPLv3 included in the packaging of this file. Please review the ## packaging of this file. Please review the following information to
## following information to ensure the GNU Lesser General Public License ## ensure the GNU Lesser General Public License version 3 requirements
## requirements will be met: https://www.gnu.org/licenses/lgpl.html and ## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
## ##
## As a special exception, The Qt Company gives you certain additional ## GNU General Public License Usage
## rights. These rights are described in The Qt Company LGPL Exception ## Alternatively, this file may be used under the terms of the GNU
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## 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$ ## $QT_END_LICENSE$
## ##

View File

@ -2,32 +2,38 @@
############################################################################# #############################################################################
## ##
## Copyright (C) 2016 The Qt Company Ltd. ## Copyright (C) 2017 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/ ## Contact: https://www.qt.io/licensing/
## ##
## This file is the build configuration utility of the Qt Toolkit. ## This file is the build configuration utility of the Qt Toolkit.
## ##
## $QT_BEGIN_LICENSE:LGPL21$ ## $QT_BEGIN_LICENSE:LGPL$
## Commercial License Usage ## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in ## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the ## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in ## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and The Qt Company. For licensing terms ## a written agreement between you and The Qt Company. For licensing terms
## and conditions see http://www.qt.io/terms-conditions. For further ## and conditions see https://www.qt.io/terms-conditions. For further
## information use the contact form at http://www.qt.io/contact-us. ## information use the contact form at https://www.qt.io/contact-us.
## ##
## GNU Lesser General Public License Usage ## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser ## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 or version 3 as published by the Free ## General Public License version 3 as published by the Free Software
## Software Foundation and appearing in the file LICENSE.LGPLv21 and ## Foundation and appearing in the file LICENSE.LGPL3 included in the
## LICENSE.LGPLv3 included in the packaging of this file. Please review the ## packaging of this file. Please review the following information to
## following information to ensure the GNU Lesser General Public License ## ensure the GNU Lesser General Public License version 3 requirements
## requirements will be met: https://www.gnu.org/licenses/lgpl.html and ## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
## ##
## As a special exception, The Qt Company gives you certain additional ## GNU General Public License Usage
## rights. These rights are described in The Qt Company LGPL Exception ## Alternatively, this file may be used under the terms of the GNU
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ## 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$ ## $QT_END_LICENSE$
## ##

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 Green Hills Software. All rights reserved. ** Copyright (C) 2015 Green Hills Software. All rights reserved.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 Green Hills Software. All rights reserved. ** Copyright (C) 2015 Green Hills Software. All rights reserved.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 Green Hills Software. All rights reserved. ** Copyright (C) 2015 Green Hills Software. All rights reserved.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 QNX Software Systems. All rights reserved. ** Copyright (C) 2016 QNX Software Systems. All rights reserved.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 QNX Software Systems. All rights reserved. ** Copyright (C) 2016 QNX Software Systems. All rights reserved.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the qmake spec of the Qt Toolkit. ** This file is part of the qmake spec of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -2024,6 +2024,15 @@
of this variable is typically handled by qmake of this variable is typically handled by qmake
or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
\section1 QMAKE_LINK
Specifies the linker that will be used when building
application based projects. Only the file name of the linker
executable needs to be specified as long as it is on a path
contained in the \c PATH variable when the Makefile is processed.
The value of this variable is typically handled by qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
\section1 QMAKE_LINK_SHLIB_CMD \section1 QMAKE_LINK_SHLIB_CMD
Specifies the command to execute when creating a shared Specifies the command to execute when creating a shared

View File

@ -662,8 +662,6 @@ void NmakeMakefileGenerator::writeLinkCommand(QTextStream &t, const QString &ext
void NmakeMakefileGenerator::writeResponseFileFiles(QTextStream &t, const ProStringList &files) void NmakeMakefileGenerator::writeResponseFileFiles(QTextStream &t, const ProStringList &files)
{ {
if (files.isEmpty())
return;
// Add line breaks in file lists in reponse files to work around LNK1170. // Add line breaks in file lists in reponse files to work around LNK1170.
// The actual line length limit is 131070, but let's use a smaller limit // The actual line length limit is 131070, but let's use a smaller limit
// in case other tools are similarly hampered. // in case other tools are similarly hampered.

View File

@ -58,6 +58,7 @@
#include <time.h> #include <time.h>
#include <utime.h> #include <utime.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <sys/wait.h> #include <sys/wait.h>
@ -1818,10 +1819,16 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
evalError(fL1S("Cannot stat() reference file %1: %2.").arg(rfn, fL1S(strerror(errno)))); evalError(fL1S("Cannot stat() reference file %1: %2.").arg(rfn, fL1S(strerror(errno))));
return ReturnFalse; return ReturnFalse;
} }
#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
const struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim };
const bool utimeError = utimensat(AT_FDCWD, tfn.toLocal8Bit().constData(), times, 0) < 0;
#else
struct utimbuf utb; struct utimbuf utb;
utb.actime = time(0); utb.actime = time(0);
utb.modtime = st.st_mtime; utb.modtime = st.st_mtime;
if (utime(tfn.toLocal8Bit().constData(), &utb)) { const bool utimeError = utime(tfn.toLocal8Bit().constData(), &utb) < 0;
#endif
if (utimeError) {
evalError(fL1S("Cannot touch %1: %2.").arg(tfn, fL1S(strerror(errno)))); evalError(fL1S("Cannot touch %1: %2.").arg(tfn, fL1S(strerror(errno))));
return ReturnFalse; return ReturnFalse;
} }

View File

@ -145,19 +145,11 @@ bool QString::contains(const QRegularExpression &regexp) const;
//! [9] //! [9]
//! [10]
std::bind(&QString::contains, QRegularExpression("^\\S+$")); // matches strings without whitespace
//! [10]
//! [11]
bool contains(const QString &string)
//! [11]
//! [12] //! [12]
QStringList strings = ...; QStringList strings = ...;
std::bind(static_cast<bool(QString::*)(const QRegularExpression&)>( &QString::contains ), QRegularExpression("...")); QFuture<QString> future = QtConcurrent::filtered(list, [](const QString &str) {
return str.contains(QRegularExpression("^\\S+$")); // matches strings without whitespace
});
//! [12] //! [12]
//! [13] //! [13]

View File

@ -158,19 +158,11 @@ QImage QImage::scaledToWidth(int width, Qt::TransformationMode) const;
//! [10] //! [10]
//! [11]
std::bind(&QImage::scaledToWidth, 100, Qt::SmoothTransformation)
//! [11]
//! [12]
QImage scaledToWith(const QImage &image)
//! [12]
//! [13] //! [13]
QList<QImage> images = ...; QList<QImage> images = ...;
QFuture<QImage> thumbnails = QtConcurrent::mapped(images, std::bind(&QImage::scaledToWidth, 100, Qt::SmoothTransformation)); QFuture<QImage> thumbnails = QtConcurrent::mapped(images, [](const QImage &img) {
return img.scaledToWidth(100, Qt::SmoothTransformation);
});
//! [13] //! [13]
//! [14] //! [14]

View File

@ -109,7 +109,8 @@ future.waitForFinished();
//! [6] //! [6]
void someFunction(int arg1, double arg2); QFuture<void> future = QtConcurrent::run([=]() {
QFuture<void> future = QtConcurrent::run(std::bind(someFunction, 1, 2.0)); // Code in this block will run in another thread
});
... ...
//! [6] //! [6]

View File

@ -148,13 +148,11 @@
\snippet code/src_concurrent_qtconcurrentfilter.cpp 13 \snippet code/src_concurrent_qtconcurrentfilter.cpp 13
\section2 Using Bound Function Arguments \section2 Wrapping Functions that Take Multiple Arguments
If you want to use a filter function takes more than one argument, you can If you want to use a filter function takes more than one argument, you can
use std::bind() to transform it onto a function that takes one argument. If use a lambda function or \c std::bind() to transform it onto a function that
C++11 support is not available, \l{http://www.boost.org/libs/bind/bind.html} takes one argument.
{boost::bind()} or \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf}
{std::tr1::bind()} are suitable replacements.
As an example, we use QString::contains(): As an example, we use QString::contains():
@ -166,16 +164,6 @@
use QString::contains() with QtConcurrent::filtered() we have to provide a use QString::contains() with QtConcurrent::filtered() we have to provide a
value for the \e regexp argument: value for the \e regexp argument:
\snippet code/src_concurrent_qtconcurrentfilter.cpp 10
The return value from std::bind() is a function object (functor) with
the following signature:
\snippet code/src_concurrent_qtconcurrentfilter.cpp 11
This matches what QtConcurrent::filtered() expects, and the complete
example becomes:
\snippet code/src_concurrent_qtconcurrentfilter.cpp 12 \snippet code/src_concurrent_qtconcurrentfilter.cpp 12
*/ */

View File

@ -198,13 +198,11 @@
\snippet code/src_concurrent_qtconcurrentmap.cpp 14 \snippet code/src_concurrent_qtconcurrentmap.cpp 14
\section2 Using Bound Function Arguments \section2 Wrapping Functions that Take Multiple Arguments
If you want to use a map function that takes more than one argument you can If you want to use a map function that takes more than one argument you can
use std::bind() to transform it onto a function that takes one argument. If use a lambda function or \c std::bind() to transform it onto a function that
C++11 support is not available, \l{http://www.boost.org/libs/bind/bind.html} takes one argument.
{boost::bind()} or \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf}
{std::tr1::bind()} are suitable replacements.
As an example, we'll use QImage::scaledToWidth(): As an example, we'll use QImage::scaledToWidth():
@ -216,16 +214,6 @@
QImage::scaledToWidth() with QtConcurrent::mapped() we have to provide a QImage::scaledToWidth() with QtConcurrent::mapped() we have to provide a
value for the \e{width} and the \e{transformation mode}: value for the \e{width} and the \e{transformation mode}:
\snippet code/src_concurrent_qtconcurrentmap.cpp 11
The return value from std::bind() is a function object (functor) with
the following signature:
\snippet code/src_concurrent_qtconcurrentmap.cpp 12
This matches what QtConcurrent::mapped() expects, and the complete example
becomes:
\snippet code/src_concurrent_qtconcurrentmap.cpp 13 \snippet code/src_concurrent_qtconcurrentmap.cpp 13
*/ */

View File

@ -107,25 +107,9 @@
\snippet code/src_concurrent_qtconcurrentrun.cpp 5 \snippet code/src_concurrent_qtconcurrentrun.cpp 5
\section2 Using Bound Function Arguments \section2 Using Lambda Functions
You can use std::bind() to \e bind a number of arguments to a function when Calling a lambda function is done like this:
called. If C++11 support is not available, \l{http://www.boost.org/libs/bind/bind.html}
{boost::bind()} or \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf}
{std::tr1::bind()} are suitable replacements.
There are number of reasons for binding:
\list
\li To call a function that takes more than 5 arguments.
\li To simplify calling a function with constant arguments.
\li Changing the order of arguments.
\endlist
See the documentation for the relevant functions for details on how to use
the bind API.
Calling a bound function is done like this:
\snippet code/src_concurrent_qtconcurrentrun.cpp 6 \snippet code/src_concurrent_qtconcurrentrun.cpp 6
*/ */

View File

@ -6,7 +6,17 @@
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are

View File

@ -6,7 +6,17 @@
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are

View File

@ -364,9 +364,6 @@
connect(sender, &QObject::destroyed, [=](){ this->m_objects.remove(sender); }); connect(sender, &QObject::destroyed, [=](){ this->m_objects.remove(sender); });
\endcode \endcode
Note that if your compiler does not support C++11 variadic templates,
this syntax only works if the signal and slot have 6 arguments or less.
The other way to connect a signal to a slot is to use QObject::connect() The other way to connect a signal to a slot is to use QObject::connect()
and the \c{SIGNAL} and \c{SLOT} macros. and the \c{SIGNAL} and \c{SLOT} macros.
The rule about whether to The rule about whether to

View File

@ -1938,6 +1938,19 @@ bool qSharedBuild() Q_DECL_NOTHROW
disable functions deprecated in Qt 5.1 and earlier. In any release, set disable functions deprecated in Qt 5.1 and earlier. In any release, set
QT_DISABLE_DEPRECATED_BEFORE=0x000000 to enable any functions, including the ones QT_DISABLE_DEPRECATED_BEFORE=0x000000 to enable any functions, including the ones
deprecated in Qt 5.0 deprecated in Qt 5.0
\sa QT_DEPRECATED_WARNINGS
*/
/*!
\macro QT_DEPRECATED_WARNINGS
\relates <QtGlobal>
If this macro is defined, the compiler will generate warnings if API declared as
deprecated by Qt is used.
\sa QT_DISABLE_DEPRECATED_BEFORE
*/ */
#if defined(QT_BUILD_QMAKE) #if defined(QT_BUILD_QMAKE)

View File

@ -825,9 +825,91 @@ void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp,
} }
#endif // QT_NO_DATASTREAM #endif // QT_NO_DATASTREAM
#if defined(Q_COMPILER_CONSTEXPR) || (defined(Q_CC_MSVC) && Q_CC_MSVC >= 1900)
// We don't officially support constexpr in MSVC 2015, but the limited support it
// has is enough for the code below.
# define STRINGIFY_TYPE_NAME(MetaTypeName, TypeId, RealName) \
#RealName "\0"
# define CALCULATE_TYPE_LEN(MetaTypeName, TypeId, RealName) \
short(sizeof(#RealName)),
# define MAP_TYPE_ID_TO_IDX(MetaTypeName, TypeId, RealName) \
TypeId,
namespace {
// All type names in one long string.
constexpr char metaTypeStrings[] = QT_FOR_EACH_STATIC_TYPE(STRINGIFY_TYPE_NAME);
// The sizes of the strings in the metaTypeStrings string (including terminating null)
constexpr short metaTypeNameSizes[] = {
QT_FOR_EACH_STATIC_TYPE(CALCULATE_TYPE_LEN)
};
// The type IDs, in the order of the metaTypeStrings data
constexpr short metaTypeIds[] = {
QT_FOR_EACH_STATIC_TYPE(MAP_TYPE_ID_TO_IDX)
};
constexpr int MetaTypeNameCount = sizeof(metaTypeNameSizes) / sizeof(metaTypeNameSizes[0]);
template <typename IntegerSequence> struct MetaTypeOffsets;
template <int... TypeIds> struct MetaTypeOffsets<QtPrivate::IndexesList<TypeIds...>>
{
// This would have been a lot easier if the meta types that the macro
// QT_FOR_EACH_STATIC_TYPE declared were in sorted, ascending order, but
// they're not (i.e., the first one declared is QMetaType::Void == 43,
// followed by QMetaType::Bool == 1)... As a consequence, we need to use
// the C++11 constexpr function calculateOffsetForTypeId below in order to
// create the offset array.
static constexpr int findTypeId(int typeId, int i = 0)
{
return i >= MetaTypeNameCount ? -1 :
metaTypeIds[i] == typeId ? i : findTypeId(typeId, i + 1);
}
static constexpr short calculateOffsetForIdx(int i)
{
return i < 0 ? -1 :
i == 0 ? 0 : metaTypeNameSizes[i - 1] + calculateOffsetForIdx(i - 1);
}
static constexpr short calculateOffsetForTypeId(int typeId)
{
return calculateOffsetForIdx(findTypeId(typeId));
#if 0
// same as, but this is only valid in C++14:
short offset = 0;
for (int i = 0; i < MetaTypeNameCount; ++i) {
if (metaTypeIds[i] == typeId)
return offset;
offset += metaTypeNameSizes[i];
}
return -1;
#endif
}
short offsets[sizeof...(TypeIds)];
constexpr MetaTypeOffsets() : offsets{calculateOffsetForTypeId(TypeIds)...} {}
const char *operator[](int typeId) const Q_DECL_NOTHROW
{
short o = offsets[typeId];
return o < 0 ? nullptr : metaTypeStrings + o;
}
};
} // anonymous namespace
constexpr MetaTypeOffsets<QtPrivate::Indexes<QMetaType::HighestInternalId + 1>::Value> metaTypeNames {};
# undef STRINGIFY_TYPE_NAME
# undef CALCULATE_TYPE_LEN
# undef MAP_TYPE_ID_TO_IDX
#endif
/*! /*!
Returns the type name associated with the given \a typeId, or 0 if no Returns the type name associated with the given \a typeId, or a null
matching type was found. The returned pointer must not be deleted. pointer if no matching type was found. The returned pointer must not be
deleted.
\sa type(), isRegistered(), Type \sa type(), isRegistered(), Type
*/ */
@ -837,14 +919,18 @@ const char *QMetaType::typeName(int typeId)
#define QT_METATYPE_TYPEID_TYPENAME_CONVERTER(MetaTypeName, TypeId, RealName) \ #define QT_METATYPE_TYPEID_TYPENAME_CONVERTER(MetaTypeName, TypeId, RealName) \
case QMetaType::MetaTypeName: return #RealName; break; case QMetaType::MetaTypeName: return #RealName; break;
if (Q_LIKELY(type <= QMetaType::HighestInternalId)) {
#if defined(Q_COMPILER_CONSTEXPR) || (defined(Q_CC_MSVC) && Q_CC_MSVC >= 1900)
return metaTypeNames[typeId];
#else
switch (QMetaType::Type(type)) { switch (QMetaType::Type(type)) {
QT_FOR_EACH_STATIC_TYPE(QT_METATYPE_TYPEID_TYPENAME_CONVERTER) QT_FOR_EACH_STATIC_TYPE(QT_METATYPE_TYPEID_TYPENAME_CONVERTER)
case QMetaType::UnknownType: case QMetaType::UnknownType:
case QMetaType::User: case QMetaType::User:
break; break;
} }
#endif
if (Q_UNLIKELY(type < QMetaType::User)) { } else if (Q_UNLIKELY(type < QMetaType::User)) {
return nullptr; // It can happen when someone cast int to QVariant::Type, we should not crash... return nullptr; // It can happen when someone cast int to QVariant::Type, we should not crash...
} }

View File

@ -4655,12 +4655,8 @@ void qDeleteInEventHandler(QObject *o)
make sure to declare the argument type with Q_DECLARE_METATYPE make sure to declare the argument type with Q_DECLARE_METATYPE
Overloaded functions can be resolved with help of \l qOverload. Overloaded functions can be resolved with help of \l qOverload.
\note The number of arguments in the signal or slot are limited to 6 if
the compiler does not support C++11 variadic templates.
*/ */
/*! /*!
\fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, Functor functor) \fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
@ -4683,7 +4679,7 @@ void qDeleteInEventHandler(QObject *o)
\snippet code/src_corelib_kernel_qobject.cpp 45 \snippet code/src_corelib_kernel_qobject.cpp 45
If your compiler support C++11 lambda expressions, you can use them: Lambda expressions can also be used:
\snippet code/src_corelib_kernel_qobject.cpp 46 \snippet code/src_corelib_kernel_qobject.cpp 46
@ -4693,9 +4689,6 @@ void qDeleteInEventHandler(QObject *o)
Overloaded functions can be resolved with help of \l qOverload. Overloaded functions can be resolved with help of \l qOverload.
\note If the compiler does not support C++11 variadic templates, the number
of arguments in the signal or slot are limited to 6, and the functor object
must not have an overloaded or templated operator().
*/ */
/*! /*!
@ -4726,7 +4719,7 @@ void qDeleteInEventHandler(QObject *o)
\snippet code/src_corelib_kernel_qobject.cpp 50 \snippet code/src_corelib_kernel_qobject.cpp 50
If your compiler support C++11 lambda expressions, you can use them: Lambda expressions can also be used:
\snippet code/src_corelib_kernel_qobject.cpp 51 \snippet code/src_corelib_kernel_qobject.cpp 51
@ -4736,10 +4729,6 @@ void qDeleteInEventHandler(QObject *o)
are still alive when the signal is emitted. are still alive when the signal is emitted.
Overloaded functions can be resolved with help of \l qOverload. Overloaded functions can be resolved with help of \l qOverload.
\note If the compiler does not support C++11 variadic templates, the number
of arguments in the signal or slot are limited to 6, and the functor object
must not have an overloaded or templated operator().
*/ */
/*! /*!

View File

@ -207,7 +207,9 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include <qlabel.h> #include <qlabel.h>
#include <qlayout.h> #include <qlayout.h>
#include <qmessagebox.h> #include <qmessagebox.h>
#if QT_CONFIG(pushbutton)
#include <qpushbutton.h> #include <qpushbutton.h>
#endif
#include <qtimer.h> #include <qtimer.h>
#include <qapplication.h> #include <qapplication.h>
QT_END_INCLUDE_NAMESPACE QT_END_INCLUDE_NAMESPACE

View File

@ -83,7 +83,9 @@ private:
}; };
}; };
class QStaticByteArrayMatcherBase { class QStaticByteArrayMatcherBase
{
Q_DECL_ALIGN(16)
struct Skiptable { struct Skiptable {
uchar data[256]; uchar data[256];
} m_skiptable; } m_skiptable;

View File

@ -54,6 +54,8 @@
#include <QtCore/qatomic.h> #include <QtCore/qatomic.h>
#include <QtCore/qdatastream.h> #include <QtCore/qdatastream.h>
#define PCRE2_CODE_UNIT_WIDTH 16
#include <pcre2.h> #include <pcre2.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -348,9 +348,6 @@ public:
QObject *receiver, const char *signal, int minMIdx, QObject *receiver, const char *signal, int minMIdx,
bool buildSignature); bool buildSignature);
static DBusHandlerResult messageFilter(DBusConnection *, DBusMessage *, void *); static DBusHandlerResult messageFilter(DBusConnection *, DBusMessage *, void *);
static bool checkReplyForDelivery(QDBusConnectionPrivate *target, QObject *object,
int idx, const QList<int> &metaTypes,
const QDBusMessage &msg);
static QDBusCallDeliveryEvent *prepareReply(QDBusConnectionPrivate *target, QObject *object, static QDBusCallDeliveryEvent *prepareReply(QDBusConnectionPrivate *target, QObject *object,
int idx, const QVector<int> &metaTypes, int idx, const QVector<int> &metaTypes,
const QDBusMessage &msg); const QDBusMessage &msg);

View File

@ -170,7 +170,7 @@
"label": "Mir client libraries", "label": "Mir client libraries",
"test": "qpa/mirclient", "test": "qpa/mirclient",
"sources": [ "sources": [
{ "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api libcontent-hub" } { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api libcontent-hub >= 0.2.0" }
] ]
}, },
"mtdev": { "mtdev": {
@ -534,12 +534,19 @@
"linuxfb": { "linuxfb": {
"label": "LinuxFB", "label": "LinuxFB",
"section": "Platform plugins", "section": "Platform plugins",
"condition": "tests.linuxfb", "condition": "tests.linuxfb && features.regularexpression",
"output": [ "privateFeature" ]
},
"vnc": {
"label": "VNC",
"section": "Platform plugins",
"condition": "config.unix && !config.android && !config.darwin && features.regularexpression",
"output": [ "privateFeature" ] "output": [ "privateFeature" ]
}, },
"mirclient": { "mirclient": {
"label": "Mir client", "label": "Mir client",
"section": "Platform plugins", "section": "Platform plugins",
"autoDetect": false,
"condition": "libs.mirclient", "condition": "libs.mirclient",
"output": [ "privateFeature" ] "output": [ "privateFeature" ]
}, },
@ -889,7 +896,6 @@
"label": "QImageIOPlugin", "label": "QImageIOPlugin",
"purpose": "Provides a base for writing a image format plugins.", "purpose": "Provides a base for writing a image format plugins.",
"section": "Images", "section": "Images",
"condition": "features.library",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"movie": { "movie": {
@ -1114,7 +1120,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
"eglfs_viv", "eglfs_viv_wl", "eglfs_egldevice", "eglfs_gbm", "eglfs_mali", "eglfs_brcm", "egl_x11" "eglfs_viv", "eglfs_viv_wl", "eglfs_egldevice", "eglfs_gbm", "eglfs_mali", "eglfs_brcm", "egl_x11"
] ]
}, },
"linuxfb", "mirclient", "linuxfb", "vnc", "mirclient",
{ {
"type": "feature", "type": "feature",
"message": "INTEGRITY framebuffer", "message": "INTEGRITY framebuffer",

View File

@ -700,7 +700,7 @@ QIcon::QIcon(const QIcon &other)
the relevant file must be found relative to the runtime working the relevant file must be found relative to the runtime working
directory. directory.
The file name can be either refer to an actual file on disk or to The file name can refer to an actual file on disk or to
one of the application's embedded resources. See the one of the application's embedded resources. See the
\l{resources.html}{Resource System} overview for details on how to \l{resources.html}{Resource System} overview for details on how to
embed images and other resource files in the application's embed images and other resource files in the application's
@ -1049,7 +1049,7 @@ static QIconEngine *iconEngineFromSuffix(const QString &fileName, const QString
the relevant file must be found relative to the runtime working the relevant file must be found relative to the runtime working
directory. directory.
The file name can be either refer to an actual file on disk or to The file name can refer to an actual file on disk or to
one of the application's embedded resources. See the one of the application's embedded resources. See the
\l{resources.html}{Resource System} overview for details on how to \l{resources.html}{Resource System} overview for details on how to
embed images and other resource files in the application's embed images and other resource files in the application's

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -45,6 +45,7 @@
#include <qvariant.h> #include <qvariant.h>
#include <qvector.h> #include <qvector.h>
#include <ctype.h> #include <ctype.h>
#include <qrgba64.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -120,6 +121,11 @@ static bool read_pbm_header(QIODevice *device, char& type, int& w, int& h, int&
return true; return true;
} }
static inline QRgb scale_pbm_color(quint16 mx, quint16 rv, quint16 gv, quint16 bv)
{
return QRgba64::fromRgba64((rv * 0xffff) / mx, (gv * 0xffff) / mx, (bv * 0xffff) / mx, 0xffff).toArgb32();
}
static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, QImage *outImage) static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, QImage *outImage)
{ {
int nbits, y; int nbits, y;
@ -148,9 +154,6 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q
} }
raw = type >= '4'; raw = type >= '4';
int maxc = mcc;
if (maxc > 255)
maxc = 255;
if (outImage->size() != QSize(w, h) || outImage->format() != format) { if (outImage->size() != QSize(w, h) || outImage->format() != format) {
*outImage = QImage(w, h, format); *outImage = QImage(w, h, format);
if (outImage->isNull()) if (outImage->isNull())
@ -175,22 +178,50 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q
b = buf24; b = buf24;
while (p < end) { while (p < end) {
if (mcc < 256) { if (mcc < 256) {
if (mcc == 255)
*p++ = qRgb(b[0],b[1],b[2]); *p++ = qRgb(b[0],b[1],b[2]);
else
*p++ = scale_pbm_color(mcc, b[0], b[1], b[2]);
b += 3; b += 3;
} else { } else {
*p++ = qRgb(((int(b[0]) * 256 + int(b[1]) + 1) * 256) / (mcc + 1) - 1, quint16 rv = b[0] << 8 | b[1];
((int(b[2]) * 256 + int(b[3]) + 1) * 256) / (mcc + 1) - 1, quint16 gv = b[2] << 8 | b[3];
((int(b[4]) * 256 + int(b[5]) + 1) * 256) / (mcc + 1) - 1); quint16 bv = b[4] << 8 | b[5];
if (mcc == 0xffff)
*p++ = QRgba64::fromRgba64(rv, gv, bv, 0xffff).toArgb32();
else
*p++ = scale_pbm_color(mcc, rv, gv, bv);
b += 6; b += 6;
} }
} }
} }
delete[] buf24; delete[] buf24;
} else if (nbits == 8 && mcc > 255) { // type 5 16bit
pbm_bpl = 2*w;
uchar *buf16 = new uchar[pbm_bpl];
for (y=0; y<h; y++) {
if (device->read((char *)buf16, pbm_bpl) != pbm_bpl) {
delete[] buf16;
return false;
}
uchar *p = outImage->scanLine(y);
uchar *end = p + w;
uchar *b = buf16;
while (p < end) {
*p++ = (b[0] << 8 | b[1]) * 255 / mcc;
b += 2;
}
}
delete[] buf16;
} else { // type 4,5 } else { // type 4,5
for (y=0; y<h; y++) { for (y=0; y<h; y++) {
if (device->read((char *)outImage->scanLine(y), pbm_bpl) uchar *p = outImage->scanLine(y);
!= pbm_bpl) if (device->read((char *)p, pbm_bpl) != pbm_bpl)
return false; return false;
if (nbits == 8 && mcc < 255) {
for (int i = 0; i < pbm_bpl; i++)
p[i] = (p[i] * 255) / mcc;
}
} }
} }
} else { // read ascii data } else { // read ascii data
@ -227,7 +258,7 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q
} else { // 32 bits } else { // 32 bits
n /= 4; n /= 4;
int r, g, b; int r, g, b;
if (mcc == maxc) { if (mcc == 255) {
while (n--) { while (n--) {
r = read_pbm_int(device); r = read_pbm_int(device);
g = read_pbm_int(device); g = read_pbm_int(device);
@ -237,10 +268,10 @@ static bool read_pbm_body(QIODevice *device, char type, int w, int h, int mcc, Q
} }
} else { } else {
while (n--) { while (n--) {
r = read_pbm_int(device) * maxc / mcc; r = read_pbm_int(device);
g = read_pbm_int(device) * maxc / mcc; g = read_pbm_int(device);
b = read_pbm_int(device) * maxc / mcc; b = read_pbm_int(device);
*((QRgb*)p) = qRgb(r, g, b); *((QRgb*)p) = scale_pbm_color(mcc, r, g, b);
p += 4; p += 4;
} }
} }

View File

@ -3685,7 +3685,7 @@ bool QOpenGLTexture::hasFeature(Feature feature)
const char *renderer = reinterpret_cast<const char *>(ctx->functions()->glGetString(GL_RENDERER)); const char *renderer = reinterpret_cast<const char *>(ctx->functions()->glGetString(GL_RENDERER));
switch (feature) { switch (feature) {
case ImmutableStorage: case ImmutableStorage:
supported = (f.version() >= qMakePair(3, 0) || ctx->hasExtension(QByteArrayLiteral("EXT_texture_storage"))) supported = (f.version() >= qMakePair(3, 0) || ctx->hasExtension(QByteArrayLiteral("GL_EXT_texture_storage")))
&& !(renderer && strstr(renderer, "Mali")); // do not use on Mali: QTBUG-45106 && !(renderer && strstr(renderer, "Mali")); // do not use on Mali: QTBUG-45106
break; break;

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -5588,7 +5588,7 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied(); srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied();
} }
QRgba64 buffer[buffer_size]; quint64 buffer[buffer_size];
const DestFetchProc64 destFetch64 = destFetchProc64[rasterBuffer->format]; const DestFetchProc64 destFetch64 = destFetchProc64[rasterBuffer->format];
const DestStoreProc64 destStore64 = destStoreProc64[rasterBuffer->format]; const DestStoreProc64 destStore64 = destStoreProc64[rasterBuffer->format];
@ -5598,12 +5598,12 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
int length = mapWidth; int length = mapWidth;
while (length > 0) { while (length > 0) {
int l = qMin(buffer_size, length); int l = qMin(buffer_size, length);
QRgba64 *dest = destFetch64(buffer, rasterBuffer, i, y + ly, l); QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, i, y + ly, l);
for (int j=0; j < l; ++j) { for (int j=0; j < l; ++j) {
const int coverage = map[j + (i - x)]; const int coverage = map[j + (i - x)];
alphamapblend_generic(coverage, dest, j, srcColor, color, colorProfile); alphamapblend_generic(coverage, dest, j, srcColor, color, colorProfile);
} }
destStore64(rasterBuffer, i, y + ly, buffer, l); destStore64(rasterBuffer, i, y + ly, dest, l);
length -= l; length -= l;
i += l; i += l;
} }
@ -5625,7 +5625,7 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
int start = qMax<int>(x, clip.x); int start = qMax<int>(x, clip.x);
int end = qMin<int>(x + mapWidth, clip.x + clip.len); int end = qMin<int>(x + mapWidth, clip.x + clip.len);
Q_ASSERT(clip.len <= buffer_size); Q_ASSERT(clip.len <= buffer_size);
QRgba64 *dest = destFetch64(buffer, rasterBuffer, start, clip.y, clip.len); QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, clip.len);
for (int xp=start; xp<end; ++xp) { for (int xp=start; xp<end; ++xp) {
const int coverage = map[xp - x]; const int coverage = map[xp - x];
@ -5873,7 +5873,7 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied(); srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied();
} }
QRgba64 buffer[buffer_size]; quint64 buffer[buffer_size];
const DestFetchProc64 destFetch64 = destFetchProc64[rasterBuffer->format]; const DestFetchProc64 destFetch64 = destFetchProc64[rasterBuffer->format];
const DestStoreProc64 destStore64 = destStoreProc64[rasterBuffer->format]; const DestStoreProc64 destStore64 = destStoreProc64[rasterBuffer->format];
@ -5883,12 +5883,12 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
int length = mapWidth; int length = mapWidth;
while (length > 0) { while (length > 0) {
int l = qMin(buffer_size, length); int l = qMin(buffer_size, length);
QRgba64 *dest = destFetch64(buffer, rasterBuffer, i, y + ly, l); QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, i, y + ly, l);
for (int j=0; j < l; ++j) { for (int j=0; j < l; ++j) {
const uint coverage = src[j + (i - x)]; const uint coverage = src[j + (i - x)];
alphargbblend_generic(coverage, dest, j, srcColor, color, colorProfile); alphargbblend_generic(coverage, dest, j, srcColor, color, colorProfile);
} }
destStore64(rasterBuffer, i, y + ly, buffer, l); destStore64(rasterBuffer, i, y + ly, dest, l);
length -= l; length -= l;
i += l; i += l;
} }
@ -5910,7 +5910,7 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
int start = qMax<int>(x, clip.x); int start = qMax<int>(x, clip.x);
int end = qMin<int>(x + mapWidth, clip.x + clip.len); int end = qMin<int>(x + mapWidth, clip.x + clip.len);
Q_ASSERT(clip.len <= buffer_size); Q_ASSERT(clip.len <= buffer_size);
QRgba64 *dest = destFetch64(buffer, rasterBuffer, start, clip.y, clip.len); QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, clip.len);
for (int xp=start; xp<end; ++xp) { for (int xp=start; xp<end; ++xp) {
const uint coverage = src[xp - x]; const uint coverage = src[xp - x];
@ -6495,6 +6495,17 @@ static void qInitDrawhelperFunctions()
qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_avx2; qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_avx2;
qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_avx2; qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_avx2;
qt_functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_avx2; qt_functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_avx2;
extern void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_upscale_helper_avx2(uint *b, uint *end, const QTextureData &image,
int &fx, int &fy, int fdx, int /*fdy*/);
extern void QT_FASTCALL fetchTransformedBilinearARGB32PM_downscale_helper_avx2(uint *b, uint *end, const QTextureData &image,
int &fx, int &fy, int fdx, int /*fdy*/);
extern void QT_FASTCALL fetchTransformedBilinearARGB32PM_fast_rotate_helper_avx2(uint *b, uint *end, const QTextureData &image,
int &fx, int &fy, int fdx, int fdy);
bilinearFastTransformHelperARGB32PM[0][SimpleUpscaleTransform] = fetchTransformedBilinearARGB32PM_simple_upscale_helper_avx2;
bilinearFastTransformHelperARGB32PM[0][DownscaleTransform] = fetchTransformedBilinearARGB32PM_downscale_helper_avx2;
bilinearFastTransformHelperARGB32PM[0][FastRotateTransform] = fetchTransformedBilinearARGB32PM_fast_rotate_helper_avx2;
} }
#endif #endif

View File

@ -44,6 +44,13 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
static Q_CONSTEXPR int BufferSize = 2048;
enum {
FixedScale = 1 << 16,
HalfPoint = 1 << 15
};
// Vectorized blend functions: // Vectorized blend functions:
// See BYTE_MUL_SSE2 for details. // See BYTE_MUL_SSE2 for details.
@ -343,6 +350,413 @@ void QT_FASTCALL comp_func_solid_SourceOver_avx2(uint *destPixels, int length, u
} }
} }
#define interpolate_4_pixels_16_avx2(tlr1, tlr2, blr1, blr2, distx, disty, colorMask, v_256, b) \
{ \
/* Correct for later unpack */ \
const __m256i vdistx = _mm256_permute4x64_epi64(distx, _MM_SHUFFLE(3, 1, 2, 0)); \
const __m256i vdisty = _mm256_permute4x64_epi64(disty, _MM_SHUFFLE(3, 1, 2, 0)); \
\
__m256i dxdy = _mm256_mullo_epi16 (vdistx, vdisty); \
const __m256i distx_ = _mm256_slli_epi16(vdistx, 4); \
const __m256i disty_ = _mm256_slli_epi16(vdisty, 4); \
__m256i idxidy = _mm256_add_epi16(dxdy, _mm256_sub_epi16(v_256, _mm256_add_epi16(distx_, disty_))); \
__m256i dxidy = _mm256_sub_epi16(distx_, dxdy); \
__m256i idxdy = _mm256_sub_epi16(disty_, dxdy); \
\
__m256i tlr1AG = _mm256_srli_epi16(tlr1, 8); \
__m256i tlr1RB = _mm256_and_si256(tlr1, colorMask); \
__m256i tlr2AG = _mm256_srli_epi16(tlr2, 8); \
__m256i tlr2RB = _mm256_and_si256(tlr2, colorMask); \
__m256i blr1AG = _mm256_srli_epi16(blr1, 8); \
__m256i blr1RB = _mm256_and_si256(blr1, colorMask); \
__m256i blr2AG = _mm256_srli_epi16(blr2, 8); \
__m256i blr2RB = _mm256_and_si256(blr2, colorMask); \
\
__m256i odxidy1 = _mm256_unpacklo_epi32(idxidy, dxidy); \
__m256i odxidy2 = _mm256_unpackhi_epi32(idxidy, dxidy); \
tlr1AG = _mm256_mullo_epi16(tlr1AG, odxidy1); \
tlr1RB = _mm256_mullo_epi16(tlr1RB, odxidy1); \
tlr2AG = _mm256_mullo_epi16(tlr2AG, odxidy2); \
tlr2RB = _mm256_mullo_epi16(tlr2RB, odxidy2); \
__m256i odxdy1 = _mm256_unpacklo_epi32(idxdy, dxdy); \
__m256i odxdy2 = _mm256_unpackhi_epi32(idxdy, dxdy); \
blr1AG = _mm256_mullo_epi16(blr1AG, odxdy1); \
blr1RB = _mm256_mullo_epi16(blr1RB, odxdy1); \
blr2AG = _mm256_mullo_epi16(blr2AG, odxdy2); \
blr2RB = _mm256_mullo_epi16(blr2RB, odxdy2); \
\
/* Add the values, and shift to only keep 8 significant bits per colors */ \
__m256i topAG = _mm256_hadd_epi32(tlr1AG, tlr2AG); \
__m256i topRB = _mm256_hadd_epi32(tlr1RB, tlr2RB); \
__m256i botAG = _mm256_hadd_epi32(blr1AG, blr2AG); \
__m256i botRB = _mm256_hadd_epi32(blr1RB, blr2RB); \
__m256i rAG = _mm256_add_epi16(topAG, botAG); \
__m256i rRB = _mm256_add_epi16(topRB, botRB); \
rRB = _mm256_srli_epi16(rRB, 8); \
/* Correct for hadd */ \
rAG = _mm256_permute4x64_epi64(rAG, _MM_SHUFFLE(3, 1, 2, 0)); \
rRB = _mm256_permute4x64_epi64(rRB, _MM_SHUFFLE(3, 1, 2, 0)); \
_mm256_storeu_si256((__m256i*)(b), _mm256_blendv_epi8(rAG, rRB, colorMask)); \
}
inline void fetchTransformedBilinear_pixelBounds(int, int l1, int l2, int &v1, int &v2)
{
if (v1 < l1)
v2 = v1 = l1;
else if (v1 >= l2)
v2 = v1 = l2;
else
v2 = v1 + 1;
Q_ASSERT(v1 >= l1 && v1 <= l2);
Q_ASSERT(v2 >= l1 && v2 <= l2);
}
void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_upscale_helper_avx2(uint *b, uint *end, const QTextureData &image,
int &fx, int &fy, int fdx, int /*fdy*/)
{
int y1 = (fy >> 16);
int y2;
fetchTransformedBilinear_pixelBounds(image.height, image.y1, image.y2 - 1, y1, y2);
const uint *s1 = (const uint *)image.scanLine(y1);
const uint *s2 = (const uint *)image.scanLine(y2);
int disty = (fy & 0x0000ffff) >> 8;
int idisty = 256 - disty;
int x = fx >> 16;
int length = end - b;
// The idea is first to do the interpolation between the row s1 and the row s2
// into an intermediate buffer, then we interpolate between two pixel of this buffer.
// intermediate_buffer[0] is a buffer of red-blue component of the pixel, in the form 0x00RR00BB
// intermediate_buffer[1] is the alpha-green component of the pixel, in the form 0x00AA00GG
// +1 for the last pixel to interpolate with, and +1 for rounding errors.
quint32 intermediate_buffer[2][BufferSize + 2];
// count is the size used in the intermediate_buffer.
int count = (qint64(length) * fdx + FixedScale - 1) / FixedScale + 2;
Q_ASSERT(count <= BufferSize + 2); //length is supposed to be <= buffer_size and data->m11 < 1 in this case
int f = 0;
int lim = qMin(count, image.x2 - x);
if (x < image.x1) {
Q_ASSERT(x < image.x2);
uint t = s1[image.x1];
uint b = s2[image.x1];
quint32 rb = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
quint32 ag = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
do {
intermediate_buffer[0][f] = rb;
intermediate_buffer[1][f] = ag;
f++;
x++;
} while (x < image.x1 && f < lim);
}
const __m256i disty_ = _mm256_set1_epi16(disty);
const __m256i idisty_ = _mm256_set1_epi16(idisty);
const __m256i colorMask = _mm256_set1_epi32(0x00ff00ff);
lim -= 7;
for (; f < lim; x += 8, f += 8) {
// Load 8 pixels from s1, and split the alpha-green and red-blue component
__m256i top = _mm256_loadu_si256((const __m256i*)((const uint *)(s1)+x));
__m256i topAG = _mm256_srli_epi16(top, 8);
__m256i topRB = _mm256_and_si256(top, colorMask);
// Multiplies each color component by idisty
topAG = _mm256_mullo_epi16 (topAG, idisty_);
topRB = _mm256_mullo_epi16 (topRB, idisty_);
// Same for the s2 vector
__m256i bottom = _mm256_loadu_si256((const __m256i*)((const uint *)(s2)+x));
__m256i bottomAG = _mm256_srli_epi16(bottom, 8);
__m256i bottomRB = _mm256_and_si256(bottom, colorMask);
bottomAG = _mm256_mullo_epi16 (bottomAG, disty_);
bottomRB = _mm256_mullo_epi16 (bottomRB, disty_);
// Add the values, and shift to only keep 8 significant bits per colors
__m256i rAG =_mm256_add_epi16(topAG, bottomAG);
rAG = _mm256_srli_epi16(rAG, 8);
_mm256_storeu_si256((__m256i*)(&intermediate_buffer[1][f]), rAG);
__m256i rRB =_mm256_add_epi16(topRB, bottomRB);
rRB = _mm256_srli_epi16(rRB, 8);
_mm256_storeu_si256((__m256i*)(&intermediate_buffer[0][f]), rRB);
}
for (; f < count; f++) { // Same as above but without simd
x = qMin(x, image.x2 - 1);
uint t = s1[x];
uint b = s2[x];
intermediate_buffer[0][f] = (((t & 0xff00ff) * idisty + (b & 0xff00ff) * disty) >> 8) & 0xff00ff;
intermediate_buffer[1][f] = ((((t>>8) & 0xff00ff) * idisty + ((b>>8) & 0xff00ff) * disty) >> 8) & 0xff00ff;
x++;
}
// Now interpolate the values from the intermediate_buffer to get the final result.
fx &= FixedScale - 1;
Q_ASSERT((fx >> 16) == 0);
const __m128i v_fdx = _mm_set1_epi32(fdx * 4);
const __m128i v_blend = _mm_set1_epi32(0x00800080);
__m128i v_fx = _mm_setr_epi32(fx, fx + fdx, fx + fdx + fdx, fx + fdx + fdx + fdx);
while (b < end - 3) {
const __m128i offset = _mm_srli_epi32(v_fx, 16);
__m256i vrb = _mm256_i32gather_epi64((const long long *)intermediate_buffer[0], offset, 4);
__m256i vag = _mm256_i32gather_epi64((const long long *)intermediate_buffer[1], offset, 4);
__m128i vdx = _mm_and_si128(v_fx, _mm_set1_epi32(0x0000ffff));
vdx = _mm_srli_epi16(vdx, 8);
__m128i vidx = _mm_sub_epi32(_mm_set1_epi32(256), vdx);
__m256i vmulx = _mm256_castsi128_si256(_mm_unpacklo_epi32(vidx, vdx));
vmulx = _mm256_inserti128_si256(vmulx, _mm_unpackhi_epi32(vidx, vdx), 1);
vrb = _mm256_mullo_epi32(vrb, vmulx);
vag = _mm256_mullo_epi32(vag, vmulx);
__m256i vrbag = _mm256_hadd_epi32(vrb, vag);
vrbag = _mm256_permute4x64_epi64(vrbag, _MM_SHUFFLE(3, 1, 2, 0));
__m128i rb = _mm256_castsi256_si128(vrbag);
__m128i ag = _mm256_extracti128_si256(vrbag, 1);
rb = _mm_srli_epi16(rb, 8);
_mm_storeu_si128((__m128i*)b, _mm_blendv_epi8(ag, rb, v_blend));
b += 4;
fx += 4 * fdx;
v_fx = _mm_add_epi32(v_fx, v_fdx);
}
while (b < end) {
int x = (fx >> 16);
uint distx = (fx & 0x0000ffff) >> 8;
uint idistx = 256 - distx;
uint rb = ((intermediate_buffer[0][x] * idistx + intermediate_buffer[0][x + 1] * distx) >> 8) & 0xff00ff;
uint ag = (intermediate_buffer[1][x] * idistx + intermediate_buffer[1][x + 1] * distx) & 0xff00ff00;
*b = rb | ag;
b++;
fx += fdx;
}
}
void QT_FASTCALL fetchTransformedBilinearARGB32PM_downscale_helper_avx2(uint *b, uint *end, const QTextureData &image,
int &fx, int &fy, int fdx, int /*fdy*/)
{
int y1 = (fy >> 16);
int y2;
fetchTransformedBilinear_pixelBounds(image.height, image.y1, image.y2 - 1, y1, y2);
const uint *s1 = (const uint *)image.scanLine(y1);
const uint *s2 = (const uint *)image.scanLine(y2);
const int disty8 = (fy & 0x0000ffff) >> 8;
const int disty4 = (disty8 + 0x08) >> 4;
const qint64 min_fx = qint64(image.x1) * FixedScale;
const qint64 max_fx = qint64(image.x2 - 1) * FixedScale;
while (b < end) {
int x1 = (fx >> 16);
int x2;
fetchTransformedBilinear_pixelBounds(image.width, image.x1, image.x2 - 1, x1, x2);
if (x1 != x2)
break;
uint top = s1[x1];
uint bot = s2[x1];
*b = INTERPOLATE_PIXEL_256(top, 256 - disty8, bot, disty8);
fx += fdx;
++b;
}
uint *boundedEnd = end;
if (fdx > 0)
boundedEnd = qMin(boundedEnd, b + (max_fx - fx) / fdx);
else if (fdx < 0)
boundedEnd = qMin(boundedEnd, b + (min_fx - fx) / fdx);
// A fast middle part without boundary checks
const __m256i vdistShuffle =
_mm256_setr_epi8(0, char(0x80), 0, char(0x80), 4, char(0x80), 4, char(0x80), 8, char(0x80), 8, char(0x80), 12, char(0x80), 12, char(0x80),
0, char(0x80), 0, char(0x80), 4, char(0x80), 4, char(0x80), 8, char(0x80), 8, char(0x80), 12, char(0x80), 12, char(0x80));
const __m256i colorMask = _mm256_set1_epi32(0x00ff00ff);
const __m256i v_256 = _mm256_set1_epi16(256);
const __m256i v_disty = _mm256_set1_epi16(disty4);
const __m256i v_fdx = _mm256_set1_epi32(fdx * 8);
const __m256i v_fx_r = _mm256_set1_epi32(0x08);
const __m256i v_index = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
__m256i v_fx = _mm256_set1_epi32(fx);
v_fx = _mm256_add_epi32(v_fx, _mm256_mullo_epi32(_mm256_set1_epi32(fdx), v_index));
while (b < boundedEnd - 7) {
const __m256i offset = _mm256_srli_epi32(v_fx, 16);
const __m128i offsetLo = _mm256_castsi256_si128(offset);
const __m128i offsetHi = _mm256_extracti128_si256(offset, 1);
const __m256i toplo = _mm256_i32gather_epi64((const long long *)s1, offsetLo, 4);
const __m256i tophi = _mm256_i32gather_epi64((const long long *)s1, offsetHi, 4);
const __m256i botlo = _mm256_i32gather_epi64((const long long *)s2, offsetLo, 4);
const __m256i bothi = _mm256_i32gather_epi64((const long long *)s2, offsetHi, 4);
__m256i v_distx = _mm256_srli_epi16(v_fx, 8);
v_distx = _mm256_srli_epi16(_mm256_add_epi32(v_distx, v_fx_r), 4);
v_distx = _mm256_shuffle_epi8(v_distx, vdistShuffle);
interpolate_4_pixels_16_avx2(toplo, tophi, botlo, bothi, v_distx, v_disty, colorMask, v_256, b);
b += 8;
v_fx = _mm256_add_epi32(v_fx, v_fdx);
}
fx = _mm_extract_epi32(_mm256_castsi256_si128(v_fx) , 0);
while (b < boundedEnd) {
int x = (fx >> 16);
int distx8 = (fx & 0x0000ffff) >> 8;
*b = interpolate_4_pixels(s1 + x, s2 + x, distx8, disty8);
fx += fdx;
++b;
}
while (b < end) {
int x1 = (fx >> 16);
int x2;
fetchTransformedBilinear_pixelBounds(image.width, image.x1, image.x2 - 1, x1, x2);
uint tl = s1[x1];
uint tr = s1[x2];
uint bl = s2[x1];
uint br = s2[x2];
int distx8 = (fx & 0x0000ffff) >> 8;
*b = interpolate_4_pixels(tl, tr, bl, br, distx8, disty8);
fx += fdx;
++b;
}
}
void QT_FASTCALL fetchTransformedBilinearARGB32PM_fast_rotate_helper_avx2(uint *b, uint *end, const QTextureData &image,
int &fx, int &fy, int fdx, int fdy)
{
const qint64 min_fx = qint64(image.x1) * FixedScale;
const qint64 max_fx = qint64(image.x2 - 1) * FixedScale;
const qint64 min_fy = qint64(image.y1) * FixedScale;
const qint64 max_fy = qint64(image.y2 - 1) * FixedScale;
// first handle the possibly bounded part in the beginning
while (b < end) {
int x1 = (fx >> 16);
int x2;
int y1 = (fy >> 16);
int y2;
fetchTransformedBilinear_pixelBounds(image.width, image.x1, image.x2 - 1, x1, x2);
fetchTransformedBilinear_pixelBounds(image.height, image.y1, image.y2 - 1, y1, y2);
if (x1 != x2 && y1 != y2)
break;
const uint *s1 = (const uint *)image.scanLine(y1);
const uint *s2 = (const uint *)image.scanLine(y2);
uint tl = s1[x1];
uint tr = s1[x2];
uint bl = s2[x1];
uint br = s2[x2];
int distx = (fx & 0x0000ffff) >> 8;
int disty = (fy & 0x0000ffff) >> 8;
*b = interpolate_4_pixels(tl, tr, bl, br, distx, disty);
fx += fdx;
fy += fdy;
++b;
}
uint *boundedEnd = end;
if (fdx > 0)
boundedEnd = qMin(boundedEnd, b + (max_fx - fx) / fdx);
else if (fdx < 0)
boundedEnd = qMin(boundedEnd, b + (min_fx - fx) / fdx);
if (fdy > 0)
boundedEnd = qMin(boundedEnd, b + (max_fy - fy) / fdy);
else if (fdy < 0)
boundedEnd = qMin(boundedEnd, b + (min_fy - fy) / fdy);
// until boundedEnd we can now have a fast middle part without boundary checks
const __m256i vdistShuffle =
_mm256_setr_epi8(0, char(0x80), 0, char(0x80), 4, char(0x80), 4, char(0x80), 8, char(0x80), 8, char(0x80), 12, char(0x80), 12, char(0x80),
0, char(0x80), 0, char(0x80), 4, char(0x80), 4, char(0x80), 8, char(0x80), 8, char(0x80), 12, char(0x80), 12, char(0x80));
const __m256i colorMask = _mm256_set1_epi32(0x00ff00ff);
const __m256i v_256 = _mm256_set1_epi16(256);
const __m256i v_fdx = _mm256_set1_epi32(fdx * 8);
const __m256i v_fdy = _mm256_set1_epi32(fdy * 8);
const __m256i v_fxy_r = _mm256_set1_epi32(0x08);
const __m256i v_index = _mm256_setr_epi32(0, 1, 2, 3, 4, 5, 6, 7);
__m256i v_fx = _mm256_set1_epi32(fx);
__m256i v_fy = _mm256_set1_epi32(fy);
v_fx = _mm256_add_epi32(v_fx, _mm256_mullo_epi32(_mm256_set1_epi32(fdx), v_index));
v_fy = _mm256_add_epi32(v_fy, _mm256_mullo_epi32(_mm256_set1_epi32(fdy), v_index));
const uchar *textureData = image.imageData;
const int bytesPerLine = image.bytesPerLine;
const __m256i vbpl = _mm256_set1_epi16(bytesPerLine/4);
while (b < boundedEnd - 7) {
const __m256i vy = _mm256_packs_epi32(_mm256_srli_epi32(v_fy, 16), _mm256_setzero_si256());
// 8x16bit * 8x16bit -> 8x32bit
__m256i offset = _mm256_unpacklo_epi16(_mm256_mullo_epi16(vy, vbpl), _mm256_mulhi_epi16(vy, vbpl));
offset = _mm256_add_epi32(offset, _mm256_srli_epi32(v_fx, 16));
const __m128i offsetLo = _mm256_castsi256_si128(offset);
const __m128i offsetHi = _mm256_extracti128_si256(offset, 1);
const uint *topData = (const uint *)(textureData);
const uint *botData = (const uint *)(textureData + bytesPerLine);
const __m256i toplo = _mm256_i32gather_epi64((const long long *)topData, offsetLo, 4);
const __m256i tophi = _mm256_i32gather_epi64((const long long *)topData, offsetHi, 4);
const __m256i botlo = _mm256_i32gather_epi64((const long long *)botData, offsetLo, 4);
const __m256i bothi = _mm256_i32gather_epi64((const long long *)botData, offsetHi, 4);
__m256i v_distx = _mm256_srli_epi16(v_fx, 8);
__m256i v_disty = _mm256_srli_epi16(v_fy, 8);
v_distx = _mm256_srli_epi16(_mm256_add_epi32(v_distx, v_fxy_r), 4);
v_disty = _mm256_srli_epi16(_mm256_add_epi32(v_disty, v_fxy_r), 4);
v_distx = _mm256_shuffle_epi8(v_distx, vdistShuffle);
v_disty = _mm256_shuffle_epi8(v_disty, vdistShuffle);
interpolate_4_pixels_16_avx2(toplo, tophi, botlo, bothi, v_distx, v_disty, colorMask, v_256, b);
b += 8;
v_fx = _mm256_add_epi32(v_fx, v_fdx);
v_fy = _mm256_add_epi32(v_fy, v_fdy);
}
fx = _mm_extract_epi32(_mm256_castsi256_si128(v_fx) , 0);
fy = _mm_extract_epi32(_mm256_castsi256_si128(v_fy) , 0);
while (b < boundedEnd) {
int x = (fx >> 16);
int y = (fy >> 16);
const uint *s1 = (const uint *)image.scanLine(y);
const uint *s2 = (const uint *)image.scanLine(y + 1);
int distx = (fx & 0x0000ffff) >> 8;
int disty = (fy & 0x0000ffff) >> 8;
*b = interpolate_4_pixels(s1 + x, s2 + x, distx, disty);
fx += fdx;
fy += fdy;
++b;
}
while (b < end) {
int x1 = (fx >> 16);
int x2;
int y1 = (fy >> 16);
int y2;
fetchTransformedBilinear_pixelBounds(image.width, image.x1, image.x2 - 1, x1, x2);
fetchTransformedBilinear_pixelBounds(image.height, image.y1, image.y2 - 1, y1, y2);
const uint *s1 = (const uint *)image.scanLine(y1);
const uint *s2 = (const uint *)image.scanLine(y2);
uint tl = s1[x1];
uint tr = s1[x2];
uint bl = s2[x1];
uint br = s2[x2];
int distx = (fx & 0x0000ffff) >> 8;
int disty = (fy & 0x0000ffff) >> 8;
*b = interpolate_4_pixels(tl, tr, bl, br, distx, disty);
fx += fdx;
fy += fdy;
++b;
}
}
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif

View File

@ -110,7 +110,11 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
// IDNA 2003 (RFC3490) for us, as required by HSTS (RFC6797, section 10). // IDNA 2003 (RFC3490) for us, as required by HSTS (RFC6797, section 10).
const HostName hostName(host); const HostName hostName(host);
const auto pos = knownHosts.find(hostName); const auto pos = knownHosts.find(hostName);
const QHstsPolicy newPolicy(expires, includeSubDomains, hostName.name); QHstsPolicy::PolicyFlags flags;
if (includeSubDomains)
flags = QHstsPolicy::IncludeSubDomains;
const QHstsPolicy newPolicy(expires, flags, hostName.name);
if (pos == knownHosts.end()) { if (pos == knownHosts.end()) {
// A new, previously unknown host. // A new, previously unknown host.
if (newPolicy.isExpired()) { if (newPolicy.isExpired()) {

View File

@ -63,6 +63,14 @@ QT_BEGIN_NAMESPACE
\sa QNetworkAccessManager::setStrictTransportSecurityEnabled() \sa QNetworkAccessManager::setStrictTransportSecurityEnabled()
*/ */
/*
\enum QHstsPolicy::PolicyFlag
Specifies attributes that a policy can have.
\value IncludeSubDomains HSTS policy also applies to subdomains.
*/
class QHstsPolicyPrivate : public QSharedData class QHstsPolicyPrivate : public QSharedData
{ {
public: public:
@ -101,13 +109,13 @@ QHstsPolicy::QHstsPolicy() : d(new QHstsPolicyPrivate)
\sa QUrl::setHost(), QUrl::ParsingMode \sa QUrl::setHost(), QUrl::ParsingMode
*/ */
QHstsPolicy::QHstsPolicy(const QDateTime &expiry, bool includeSubDomains, const QString &host, QHstsPolicy::QHstsPolicy(const QDateTime &expiry, PolicyFlags flags,
QUrl::ParsingMode mode) const QString &host, QUrl::ParsingMode mode)
: d(new QHstsPolicyPrivate) : d(new QHstsPolicyPrivate)
{ {
d->url.setHost(host, mode); d->url.setHost(host, mode);
d->expiry = expiry; d->expiry = expiry;
d->includeSubDomains = includeSubDomains; d->includeSubDomains = flags.testFlag(IncludeSubDomains);
} }
/*! /*!

View File

@ -43,6 +43,7 @@
#include <QtNetwork/qtnetworkglobal.h> #include <QtNetwork/qtnetworkglobal.h>
#include <QtCore/qshareddata.h> #include <QtCore/qshareddata.h>
#include <QtCore/qflags.h>
#include <QtCore/qurl.h> #include <QtCore/qurl.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -53,9 +54,14 @@ class QString;
class Q_NETWORK_EXPORT QHstsPolicy class Q_NETWORK_EXPORT QHstsPolicy
{ {
public: public:
enum PolicyFlag
{
IncludeSubDomains = 1
};
Q_DECLARE_FLAGS(PolicyFlags, PolicyFlag)
QHstsPolicy(); QHstsPolicy();
explicit QHstsPolicy(const QDateTime &expiry, bool includeSubDomains, const QString &host, QHstsPolicy(const QDateTime &expiry, PolicyFlags flags, const QString &host,
QUrl::ParsingMode mode = QUrl::DecodedMode); QUrl::ParsingMode mode = QUrl::DecodedMode);
QHstsPolicy(const QHstsPolicy &rhs); QHstsPolicy(const QHstsPolicy &rhs);
QHstsPolicy &operator=(const QHstsPolicy &rhs); QHstsPolicy &operator=(const QHstsPolicy &rhs);
@ -81,6 +87,7 @@ private:
}; };
Q_DECLARE_SHARED(QHstsPolicy) Q_DECLARE_SHARED(QHstsPolicy)
Q_DECLARE_OPERATORS_FOR_FLAGS(QHstsPolicy::PolicyFlags)
Q_NETWORK_EXPORT bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs); Q_NETWORK_EXPORT bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs);

View File

@ -6,7 +6,17 @@
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:BSD$ ** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows: ** 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.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
** **
** "Redistribution and use in source and binary forms, with or without ** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are ** modification, are permitted provided that the following conditions are

View File

@ -3,29 +3,35 @@
** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com> ** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com>
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the plugins of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -3,29 +3,35 @@
** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com> ** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com>
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the plugins of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -3,29 +3,35 @@
** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com> ** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com>
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the plugins of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,32 +1,38 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com> ** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com>
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the plugins of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com> ** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com>
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the plugins of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com> ** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com>
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the plugins of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com> ** Copyright (C) 2015-2016 Oleksandr Tymoshenko <gonzo@bluezbox.com>
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtGui module of the Qt Toolkit. ** This file is part of the plugins of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -2,7 +2,9 @@ TEMPLATE = subdirs
QT_FOR_CONFIG += gui-private network-private QT_FOR_CONFIG += gui-private network-private
qtConfig(evdev) { qtConfig(evdev) {
SUBDIRS += evdevmouse evdevtouch evdevkeyboard evdevtablet SUBDIRS += evdevmouse evdevtouch evdevkeyboard
qtConfig(tabletevent): \
SUBDIRS += evdevtablet
} }
qtConfig(tslib) { qtConfig(tslib) {

View File

@ -79,7 +79,10 @@ private:
QEglFSCursor *m_cursor; QEglFSCursor *m_cursor;
}; };
class Q_EGLFS_EXPORT QEglFSCursor : public QPlatformCursor, protected QOpenGLFunctions #if QT_CONFIG(opengl)
class Q_EGLFS_EXPORT QEglFSCursor : public QPlatformCursor
, protected QOpenGLFunctions
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -153,6 +156,7 @@ private:
}; };
QHash<QOpenGLContext *, GraphicsContextData> m_gfx; QHash<QOpenGLContext *, GraphicsContextData> m_gfx;
}; };
#endif // QT_CONFIG(opengl)
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -9,7 +9,7 @@ qtConfig(eglfs_mali): SUBDIRS += eglfs_mali
qtConfig(eglfs_viv): SUBDIRS += eglfs_viv qtConfig(eglfs_viv): SUBDIRS += eglfs_viv
qtConfig(eglfs_viv_wl): SUBDIRS += eglfs_viv_wl qtConfig(eglfs_viv_wl): SUBDIRS += eglfs_viv_wl
SUBDIRS += eglfs_emu qtConfig(opengl): SUBDIRS += eglfs_emu
eglfs_kms_egldevice.depends = eglfs_kms_support eglfs_kms_egldevice.depends = eglfs_kms_support
eglfs_kms.depends = eglfs_kms_support eglfs_kms.depends = eglfs_kms_support

View File

@ -105,12 +105,13 @@ void QEglFSKmsGbmIntegration::destroyNativeWindow(EGLNativeWindowType window)
QPlatformCursor *QEglFSKmsGbmIntegration::createCursor(QPlatformScreen *screen) const QPlatformCursor *QEglFSKmsGbmIntegration::createCursor(QPlatformScreen *screen) const
{ {
if (screenConfig()->hwCursor()) { #if QT_CONFIG(opengl)
return nullptr; if (!screenConfig()->hwCursor()) {
} else {
qCDebug(qLcEglfsKmsDebug, "Using plain OpenGL mouse cursor"); qCDebug(qLcEglfsKmsDebug, "Using plain OpenGL mouse cursor");
return new QEglFSCursor(screen); return new QEglFSCursor(screen);
} }
#endif
return nullptr;
} }
void QEglFSKmsGbmIntegration::presentBuffer(QPlatformSurface *surface) void QEglFSKmsGbmIntegration::presentBuffer(QPlatformSurface *surface)

View File

@ -85,12 +85,12 @@ EGLNativeDisplayType QEglFSKmsEglDevice::nativeDisplay() const
QPlatformScreen *QEglFSKmsEglDevice::createScreen(const QKmsOutput &output) QPlatformScreen *QEglFSKmsEglDevice::createScreen(const QKmsOutput &output)
{ {
QEglFSKmsScreen *screen = new QEglFSKmsEglDeviceScreen(this, output); QEglFSKmsScreen *screen = new QEglFSKmsEglDeviceScreen(this, output);
#if QT_CONFIG(opengl)
if (!m_globalCursor && !screenConfig()->separateScreens()) { if (!m_globalCursor && !screenConfig()->separateScreens()) {
qCDebug(qLcEglfsKmsDebug, "Creating new global mouse cursor"); qCDebug(qLcEglfsKmsDebug, "Creating new global mouse cursor");
m_globalCursor = new QEglFSCursor(screen); m_globalCursor = new QEglFSCursor(screen);
} }
#endif
return screen; return screen;
} }

View File

@ -280,7 +280,11 @@ bool QEglFSKmsEglDeviceIntegration::query_egl_device()
QPlatformCursor *QEglFSKmsEglDeviceIntegration::createCursor(QPlatformScreen *screen) const QPlatformCursor *QEglFSKmsEglDeviceIntegration::createCursor(QPlatformScreen *screen) const
{ {
return screenConfig()->separateScreens() ? new QEglFSCursor(screen) : nullptr; #if QT_CONFIG(opengl)
if (screenConfig()->separateScreens())
return new QEglFSCursor(screen);
#endif
return nullptr;
} }
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -36,7 +36,7 @@ qtConfig(directfb) {
qtConfig(linuxfb): SUBDIRS += linuxfb qtConfig(linuxfb): SUBDIRS += linuxfb
unix:!android:!darwin: SUBDIRS += vnc qtConfig(vnc): SUBDIRS += vnc
freebsd { freebsd {
SUBDIRS += bsdfb SUBDIRS += bsdfb

View File

@ -531,13 +531,12 @@ void QRfbRawEncoder::write()
socket->flush(); socket->flush();
} }
#if QT_CONFIG(cursor)
QVncClientCursor::QVncClientCursor() QVncClientCursor::QVncClientCursor()
{ {
#ifndef QT_NO_CURSOR
QWindow *w = QGuiApplication::focusWindow(); QWindow *w = QGuiApplication::focusWindow();
QCursor c = w ? w->cursor() : QCursor(Qt::ArrowCursor); QCursor c = w ? w->cursor() : QCursor(Qt::ArrowCursor);
changeCursor(&c, 0); changeCursor(&c, 0);
#endif
} }
QVncClientCursor::~QVncClientCursor() QVncClientCursor::~QVncClientCursor()
@ -587,7 +586,6 @@ void QVncClientCursor::write(QVncClient *client) const
void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window) void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window)
{ {
Q_UNUSED(window); Q_UNUSED(window);
#ifndef QT_NO_CURSOR
const Qt::CursorShape shape = widgetCursor ? widgetCursor->shape() : Qt::ArrowCursor; const Qt::CursorShape shape = widgetCursor ? widgetCursor->shape() : Qt::ArrowCursor;
if (shape == Qt::BitmapCursor) { if (shape == Qt::BitmapCursor) {
@ -601,9 +599,6 @@ void QVncClientCursor::changeCursor(QCursor *widgetCursor, QWindow *window)
cursor = *platformImage.image(); cursor = *platformImage.image();
hotspot = platformImage.hotspot(); hotspot = platformImage.hotspot();
} }
#else // !QT_NO_CURSOR
Q_UNUSED(widgetCursor);
#endif
for (auto client : clients) for (auto client : clients)
client->setDirtyCursor(); client->setDirtyCursor();
} }
@ -619,6 +614,7 @@ uint QVncClientCursor::removeClient(QVncClient *client)
clients.removeOne(client); clients.removeOne(client);
return clients.count(); return clients.count();
} }
#endif // QT_CONFIG(cursor)
QVncServer::QVncServer(QVncScreen *screen, quint16 port) QVncServer::QVncServer(QVncScreen *screen, quint16 port)
: qvnc_screen(screen) : qvnc_screen(screen)

View File

@ -364,6 +364,7 @@ private:
friend class QRfbMultiColorHextile<SRC>; friend class QRfbMultiColorHextile<SRC>;
}; };
#if QT_CONFIG(cursor)
class QVncClientCursor : public QPlatformCursor class QVncClientCursor : public QPlatformCursor
{ {
public: public:
@ -381,7 +382,7 @@ public:
QPoint hotspot; QPoint hotspot;
QVector<QVncClient *> clients; QVector<QVncClient *> clients;
}; };
#endif // QT_CONFIG(cursor)
class QVncServer : public QObject class QVncServer : public QObject
{ {

View File

@ -425,14 +425,14 @@ void QVncClient::checkUpdate()
{ {
if (!m_wantUpdate) if (!m_wantUpdate)
return; return;
#if QT_CONFIG(cursor)
if (m_dirtyCursor) { if (m_dirtyCursor) {
m_server->screen()->clientCursor->write(this); m_server->screen()->clientCursor->write(this);
m_dirtyCursor = false; m_dirtyCursor = false;
m_wantUpdate = false; m_wantUpdate = false;
return; return;
} }
#endif
if (!m_dirtyRegion.isEmpty()) { if (!m_dirtyRegion.isEmpty()) {
if (m_encoder) if (m_encoder)
m_encoder->write(); m_encoder->write();

View File

@ -58,8 +58,10 @@ QVncScreen::QVncScreen(const QStringList &args)
QVncScreen::~QVncScreen() QVncScreen::~QVncScreen()
{ {
#if QT_CONFIG(cursor)
if (clientCursor) if (clientCursor)
delete clientCursor; delete clientCursor;
#endif
} }
bool QVncScreen::initialize() bool QVncScreen::initialize()
@ -120,17 +122,21 @@ QRegion QVncScreen::doRedraw()
return touched; return touched;
} }
void QVncScreen::enableClientCursor(QVncClient *client) void QVncScreen::enableClientCursor(QVncClient *client)
{ {
#if QT_CONFIG(cursor)
delete mCursor; delete mCursor;
mCursor = nullptr; mCursor = nullptr;
if (!clientCursor) if (!clientCursor)
clientCursor = new QVncClientCursor(); clientCursor = new QVncClientCursor();
clientCursor->addClient(client); clientCursor->addClient(client);
#endif
} }
void QVncScreen::disableClientCursor(QVncClient *client) void QVncScreen::disableClientCursor(QVncClient *client)
{ {
#if QT_CONFIG(cursor)
uint clientCount = clientCursor->removeClient(client); uint clientCount = clientCursor->removeClient(client);
if (clientCount == 0) { if (clientCount == 0) {
delete clientCursor; delete clientCursor;
@ -138,11 +144,16 @@ void QVncScreen::disableClientCursor(QVncClient *client)
} }
mCursor = new QFbCursor(this); mCursor = new QFbCursor(this);
#endif
} }
QPlatformCursor *QVncScreen::cursor() const QPlatformCursor *QVncScreen::cursor() const
{ {
#if QT_CONFIG(cursor)
return mCursor ? static_cast<QPlatformCursor *>(mCursor) : static_cast<QPlatformCursor *>(clientCursor); return mCursor ? static_cast<QPlatformCursor *>(mCursor) : static_cast<QPlatformCursor *>(clientCursor);
#else
return nullptr;
#endif
} }
// grabWindow() grabs "from the screen" not from the backingstores. // grabWindow() grabs "from the screen" not from the backingstores.

View File

@ -86,7 +86,9 @@ public:
QRegion dirtyRegion; QRegion dirtyRegion;
int refreshRate = 30; int refreshRate = 30;
QVncServer *vncServer = 0; QVncServer *vncServer = 0;
#if QT_CONFIG(cursor)
QVncClientCursor *clientCursor = 0; QVncClientCursor *clientCursor = 0;
#endif
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@ -1767,10 +1767,9 @@ bool QWindowsWindow::isFullScreen_sys() const
const QWindow *w = window(); const QWindow *w = window();
if (!w->isTopLevel()) if (!w->isTopLevel())
return false; return false;
const QScreen *screen = w->screen(); QRect geometry = geometry_sys();
if (!screen) QPlatformScreen *screen = screenForGeometry(geometry);
screen = QGuiApplication::primaryScreen(); return screen && geometry == QHighDpi::toNativePixels(screen->geometry(), screen);
return screen && geometry_sys() == QHighDpi::toNativePixels(screen->geometry(), w);
} }
/*! /*!
@ -1842,6 +1841,13 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
newStyle |= WS_VISIBLE; newStyle |= WS_VISIBLE;
setStyle(newStyle); setStyle(newStyle);
const QScreen *screen = window()->screen();
if (!screen)
screen = QGuiApplication::primaryScreen();
// That area of the virtual desktop might not be covered by a screen anymore.
if (!screen->geometry().intersects(m_savedFrameGeometry))
m_savedFrameGeometry.moveTo(screen->geometry().topLeft());
UINT swpf = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE; UINT swpf = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE;
if (!m_savedFrameGeometry.isValid()) if (!m_savedFrameGeometry.isValid())
swpf |= SWP_NOSIZE | SWP_NOMOVE; swpf |= SWP_NOSIZE | SWP_NOMOVE;

View File

@ -504,6 +504,8 @@ static HRESULT qt_drop(IInspectable *sender, ABI::Windows::UI::Xaml::IDragEventA
class QtDragEventHandler##name : public IDragEventHandler \ class QtDragEventHandler##name : public IDragEventHandler \
{ \ { \
public: \ public: \
virtual ~QtDragEventHandler##name() {\
}\
STDMETHODIMP Invoke(IInspectable *sender, \ STDMETHODIMP Invoke(IInspectable *sender, \
ABI::Windows::UI::Xaml::IDragEventArgs *e) \ ABI::Windows::UI::Xaml::IDragEventArgs *e) \
{ \ { \

View File

@ -58,7 +58,7 @@
#include <functional> #include <functional>
#include <wrl.h> #include <wrl.h>
#include <windows.system.h> #include <windows.system.h>
#include <Windows.Applicationmodel.h> #include <Windows.ApplicationModel.h>
#include <Windows.ApplicationModel.core.h> #include <Windows.ApplicationModel.core.h>
#include <windows.devices.input.h> #include <windows.devices.input.h>
#include <windows.ui.h> #include <windows.ui.h>

View File

@ -42,6 +42,7 @@
#include "qxcbscreen.h" #include "qxcbscreen.h"
#include "qxcbwindow.h" #include "qxcbwindow.h"
#include "qtouchdevice.h" #include "qtouchdevice.h"
#include "QtCore/qmetaobject.h"
#include <qpa/qwindowsysteminterface_p.h> #include <qpa/qwindowsysteminterface_p.h>
#include <QDebug> #include <QDebug>
#include <cmath> #include <cmath>
@ -208,6 +209,8 @@ void QXcbConnection::xi2SetupDevices()
isTablet = true; isTablet = true;
tabletData.pointerType = QTabletEvent::Cursor; tabletData.pointerType = QTabletEvent::Cursor;
dbgType = QLatin1String("cursor"); dbgType = QLatin1String("cursor");
} else if (name.contains("wacom") && name.contains("finger touch")) {
isTablet = false;
} else if ((name.contains("pen") || name.contains("stylus")) && isTablet) { } else if ((name.contains("pen") || name.contains("stylus")) && isTablet) {
tabletData.pointerType = QTabletEvent::Pen; tabletData.pointerType = QTabletEvent::Pen;
dbgType = QLatin1String("pen"); dbgType = QLatin1String("pen");
@ -1107,6 +1110,18 @@ static QTabletEvent::TabletDevice toolIdToTabletDevice(quint32 toolId) {
return QTabletEvent::Stylus; // Safe default assumption if nonzero return QTabletEvent::Stylus; // Safe default assumption if nonzero
} }
static const char *toolName(QTabletEvent::TabletDevice tool) {
static const QMetaObject *metaObject = qt_getEnumMetaObject(tool);
static const QMetaEnum me = metaObject->enumerator(metaObject->indexOfEnumerator(qt_getEnumName(tool)));
return me.valueToKey(tool);
}
static const char *pointerTypeName(QTabletEvent::PointerType ptype) {
static const QMetaObject *metaObject = qt_getEnumMetaObject(ptype);
static const QMetaEnum me = metaObject->enumerator(metaObject->indexOfEnumerator(qt_getEnumName(ptype)));
return me.valueToKey(ptype);
}
bool QXcbConnection::xi2HandleTabletEvent(const void *event, TabletData *tabletData) bool QXcbConnection::xi2HandleTabletEvent(const void *event, TabletData *tabletData)
{ {
bool handled = true; bool handled = true;
@ -1180,9 +1195,9 @@ bool QXcbConnection::xi2HandleTabletEvent(const void *event, TabletData *tabletD
// TODO maybe have a hash of tabletData->deviceId to device data so we can // TODO maybe have a hash of tabletData->deviceId to device data so we can
// look up the tablet name here, and distinguish multiple tablets // look up the tablet name here, and distinguish multiple tablets
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled())) if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "XI2 proximity change on tablet %d (USB %x): last tool: %x id %x current tool: %x id %x TabletDevice %d", qCDebug(lcQpaXInputEvents, "XI2 proximity change on tablet %d (USB %x): last tool: %x id %x current tool: %x id %x %s",
tabletData->deviceId, ptr[_WACSER_USB_ID], ptr[_WACSER_LAST_TOOL_SERIAL], ptr[_WACSER_LAST_TOOL_ID], tabletData->deviceId, ptr[_WACSER_USB_ID], ptr[_WACSER_LAST_TOOL_SERIAL], ptr[_WACSER_LAST_TOOL_ID],
ptr[_WACSER_TOOL_SERIAL], ptr[_WACSER_TOOL_ID], tabletData->tool); ptr[_WACSER_TOOL_SERIAL], ptr[_WACSER_TOOL_ID], toolName(tabletData->tool));
} }
XFree(data); XFree(data);
} }
@ -1245,9 +1260,10 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD
} }
if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled())) if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled()))
qCDebug(lcQpaXInputEvents, "XI2 event on tablet %d with tool %d type %d seq %d detail %d time %d " qCDebug(lcQpaXInputEvents, "XI2 event on tablet %d with tool %s type %s seq %d detail %d time %d "
"pos %6.1f, %6.1f root pos %6.1f, %6.1f buttons 0x%x pressure %4.2lf tilt %d, %d rotation %6.2lf", "pos %6.1f, %6.1f root pos %6.1f, %6.1f buttons 0x%x pressure %4.2lf tilt %d, %d rotation %6.2lf",
tabletData->deviceId, tabletData->tool, ev->evtype, ev->sequenceNumber, ev->detail, ev->time, tabletData->deviceId, toolName(tabletData->tool), pointerTypeName(tabletData->pointerType),
ev->sequenceNumber, ev->detail, ev->time,
fixed1616ToReal(ev->event_x), fixed1616ToReal(ev->event_y), fixed1616ToReal(ev->event_x), fixed1616ToReal(ev->event_y),
fixed1616ToReal(ev->root_x), fixed1616ToReal(ev->root_y), fixed1616ToReal(ev->root_x), fixed1616ToReal(ev->root_y),
(int)tabletData->buttons, pressure, xTilt, yTilt, rotation); (int)tabletData->buttons, pressure, xTilt, yTilt, rotation);

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the plugins of the Qt Toolkit. ** This file is part of the QtGui module of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the plugins of the Qt Toolkit. ** This file is part of the plugins of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -28,13 +28,20 @@
"label": "CUPS", "label": "CUPS",
"purpose": "Provides support for the Common Unix Printing System.", "purpose": "Provides support for the Common Unix Printing System.",
"section": "Painting", "section": "Painting",
"condition": "libs.cups && features.printer", "condition": "libs.cups && features.printer && features.datestring",
"output": [ "privateFeature", "feature" ] "output": [ "privateFeature", "feature" ]
}, },
"cupsjobwidget": { "cupsjobwidget": {
"label": "CUPS job control widget", "label": "CUPS job control widget",
"section": "Widgets", "section": "Widgets",
"condition": "features.cups && features.calendarwidget && features.datetimeedit && features.groupbox && features.combobox", "condition": [
"features.calendarwidget",
"features.checkbox",
"features.combobox",
"features.cups",
"features.datetimeedit",
"features.groupbox"
],
"output": [ "privateFeature", "feature" ] "output": [ "privateFeature", "feature" ]
}, },
"printer": { "printer": {
@ -55,14 +62,25 @@
"label": "QPrintDialog", "label": "QPrintDialog",
"purpose": "Provides a dialog widget for specifying printer configuration.", "purpose": "Provides a dialog widget for specifying printer configuration.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.printer && features.combobox && features.buttongroup && features.spinbox && features.treeview && features.tabwidget && features.datetimeedit", "condition": [
"features.buttongroup",
"features.checkbox",
"features.combobox",
"features.datetimeedit",
"features.dialogbuttonbox",
"features.printer",
"features.radiobutton",
"features.spinbox",
"features.tabwidget",
"features.treeview"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"printpreviewdialog": { "printpreviewdialog": {
"label": "QPrintPreviewDialog", "label": "QPrintPreviewDialog",
"purpose": "Provides a dialog for previewing and configuring page layouts for printer output.", "purpose": "Provides a dialog for previewing and configuring page layouts for printer output.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.printpreviewwidget && features.printdialog && features.toolbar", "condition": "features.printpreviewwidget && features.printdialog && features.toolbar && features.formlayout",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
} }
}, },

View File

@ -46,7 +46,6 @@
#include <QtWidgets/qaction.h> #include <QtWidgets/qaction.h>
#include <QtWidgets/qboxlayout.h> #include <QtWidgets/qboxlayout.h>
#include <QtWidgets/qcombobox.h> #include <QtWidgets/qcombobox.h>
#include <QtWidgets/qlabel.h>
#include <QtWidgets/qlineedit.h> #include <QtWidgets/qlineedit.h>
#include <QtPrintSupport/qpagesetupdialog.h> #include <QtPrintSupport/qpagesetupdialog.h>
#include <QtPrintSupport/qprinter.h> #include <QtPrintSupport/qprinter.h>
@ -56,11 +55,13 @@
#include <QtWidgets/qfiledialog.h> #include <QtWidgets/qfiledialog.h>
#include <QtWidgets/qmainwindow.h> #include <QtWidgets/qmainwindow.h>
#include <QtWidgets/qtoolbar.h> #include <QtWidgets/qtoolbar.h>
#include <QtWidgets/qformlayout.h>
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#ifndef QT_NO_PRINTPREVIEWDIALOG #ifndef QT_NO_PRINTPREVIEWDIALOG
#include <QtWidgets/qformlayout.h>
#include <QtWidgets/qlabel.h>
static void initResources() static void initResources()
{ {
static bool resourcesInitialized = false; static bool resourcesInitialized = false;

View File

@ -153,7 +153,7 @@
}, },
"sql-odbc": { "sql-odbc": {
"label": "ODBC", "label": "ODBC",
"condition": "libs.odbc && features.textdate", "condition": "libs.odbc && features.datestring",
"output": [ "publicFeature" ] "output": [ "publicFeature" ]
}, },
"sql-psql": { "sql-psql": {
@ -168,7 +168,7 @@
}, },
"sql-sqlite": { "sql-sqlite": {
"label": "SQLite", "label": "SQLite",
"condition": "features.textdate", "condition": "features.datestring",
"output": [ "publicFeature" ] "output": [ "publicFeature" ]
}, },
"system-sqlite": { "system-sqlite": {
@ -179,7 +179,7 @@
}, },
"sql-tds": { "sql-tds": {
"label": "TDS (Sybase)", "label": "TDS (Sybase)",
"condition": "libs.tds && features.textdate", "condition": "libs.tds && features.datestring",
"output": [ "publicFeature" ] "output": [ "publicFeature" ]
} }
}, },

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtTest module of the Qt Toolkit. ** This file is part of the QtTest module of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -1,31 +1,37 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtTest module of the Qt Toolkit. ** This file is part of the QtTest module of the Qt Toolkit.
** **
** $QT_BEGIN_LICENSE:LGPL21$ ** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage ** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in ** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the ** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in ** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms ** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further ** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us. ** information use the contact form at https://www.qt.io/contact-us.
** **
** GNU Lesser General Public License Usage ** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free ** General Public License version 3 as published by the Free Software
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Foundation and appearing in the file LICENSE.LGPL3 included in the
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** packaging of this file. Please review the following information to
** following information to ensure the GNU Lesser General Public License ** ensure the GNU Lesser General Public License version 3 requirements
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
** **
** As a special exception, The Qt Company gives you certain additional ** GNU General Public License Usage
** rights. These rights are described in The Qt Company LGPL Exception ** Alternatively, this file may be used under the terms of the GNU
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** 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$ ** $QT_END_LICENSE$
** **

View File

@ -549,12 +549,20 @@ void Moc::parse()
case NAMESPACE: { case NAMESPACE: {
int rewind = index; int rewind = index;
if (test(IDENTIFIER)) { if (test(IDENTIFIER)) {
QByteArray nsName = lexem();
QByteArrayList nested;
while (test(SCOPE)) {
next(IDENTIFIER);
nested.append(nsName);
nsName = lexem();
}
if (test(EQ)) { if (test(EQ)) {
// namespace Foo = Bar::Baz; // namespace Foo = Bar::Baz;
until(SEMIC); until(SEMIC);
} else if (!test(SEMIC)) { } else if (!test(SEMIC)) {
NamespaceDef def; NamespaceDef def;
def.classname = lexem(); def.classname = nsName;
next(LBRACE); next(LBRACE);
def.begin = index - 1; def.begin = index - 1;
until(RBRACE); until(RBRACE);
@ -568,11 +576,23 @@ void Moc::parse()
def.qualified.prepend(namespaceList.at(i).classname + "::"); def.qualified.prepend(namespaceList.at(i).classname + "::");
} }
} }
for (const QByteArray &ns : nested) {
NamespaceDef parentNs;
parentNs.classname = ns;
parentNs.qualified = def.qualified;
def.qualified += ns + "::";
parentNs.begin = def.begin;
parentNs.end = def.end;
namespaceList += parentNs;
} }
}
while (parseNamespace && inNamespace(&def) && hasNext()) { while (parseNamespace && inNamespace(&def) && hasNext()) {
switch (next()) { switch (next()) {
case NAMESPACE: case NAMESPACE:
if (test(IDENTIFIER)) { if (test(IDENTIFIER)) {
while (test(SCOPE))
next(IDENTIFIER);
if (test(EQ)) { if (test(EQ)) {
// namespace Foo = Bar::Baz; // namespace Foo = Bar::Baz;
until(SEMIC); until(SEMIC);

View File

@ -1,227 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifdef MOC_MWERKS_PLUGIN
#include "mwerks_mac.h"
#include "qt_mac.h"
/* compiler headers */
#include "DropInCompilerLinker.h"
#include "CompilerMapping.h"
#include "CWPluginErrors.h"
/* standard headers */
#include <stdio.h>
#include <string.h>
QT_BEGIN_NAMESPACE
//qglobal.cpp
const unsigned char * p_str(const char * c);
QCString pstring2qstring(const unsigned char *c);
#if CW_USE_PRAGMA_EXPORT
#pragma export on
#endif
CWPLUGIN_ENTRY(CWPlugin_GetDropInFlags)(const DropInFlags** flags, long* flagsSize)
{
static const DropInFlags sFlags = {
kCurrentDropInFlagsVersion,
CWDROPINCOMPILERTYPE,
DROPINCOMPILERLINKERAPIVERSION_7,
kCompAlwaysReload|kCompRequiresProjectBuildStartedMsg,
Lang_C_CPP,
DROPINCOMPILERLINKERAPIVERSION
};
*flags = &sFlags;
*flagsSize = sizeof(sFlags);
return cwNoErr;
}
CWPLUGIN_ENTRY(CWPlugin_GetDropInName)(const char** dropinName)
{
static const char sDropInName[] = "McMoc";
*dropinName = sDropInName;
return cwNoErr;
}
CWPLUGIN_ENTRY(CWPlugin_GetDisplayName)(const char** displayName)
{
static const char sDisplayName[] = "McMoc";
*displayName = sDisplayName;
return cwNoErr;
}
CWPLUGIN_ENTRY(CWPlugin_GetTargetList)(const CWTargetList** targetList)
{
static CWDataType sCPU = targetCPUAny;
static CWDataType sOS = targetOSMacintosh;
static CWTargetList sTargetList = {kCurrentCWTargetListVersion, 1, &sCPU, 1, &sOS};
*targetList = &sTargetList;
return cwNoErr;
}
CWPLUGIN_ENTRY(CWPlugin_GetDefaultMappingList)(const CWExtMapList** defaultMappingList)
{
static CWExtensionMapping sExtension[] = { {'TEXT', ".mocs", kPrecompile } };
static CWExtMapList sExtensionMapList = {kCurrentCWExtMapListVersion, 3, sExtension};
*defaultMappingList = &sExtensionMapList;
return cwNoErr;
}
#if CW_USE_PRAGMA_EXPORT
#pragma export off
#endif
typedef short CWFileRef;
static int line_count = 0;
moc_status do_moc(CWPluginContext, const QCString &, const QCString &, CWFileSpec *, bool);
static CWResult mocify(CWPluginContext context, const QCString &source)
{
CWDisplayLines(context, line_count++);
source.stripWhiteSpace();
CWResult err;
bool dotmoc=false;
QCString stem = source, ext;
int dotpos = stem.findRev('.');
if(dotpos != -1) {
ext = stem.right(stem.length() - (dotpos+1));
stem = stem.left(dotpos);
if(ext == "cpp")
dotmoc = true;
} else {
//whoa!
}
QCString dest;
if(dotmoc)
dest = stem + ".moc";
else
dest = "moc_" + stem + ".cpp";
//moc it
CWFileSpec destSpec;
moc_status mocd = do_moc(context, source, dest, &destSpec, dotmoc);
#if 0
QCString derr = "Weird";
switch(mocd) {
case moc_success: derr = "Success"; break;
case moc_parse_error: derr = "Parser Error"; break;
case moc_no_qobject:derr = "No QOBJECT"; break;
case moc_not_time: derr = "Not Time"; break;
case moc_no_source: derr = "No Source"; break;
case moc_general_error: derr = "General Error"; break;
}
char dmsg[200];
sprintf(dmsg, "\"%s\" %s", source.data(), derr.data());
CWReportMessage(context, NULL, dmsg, NULL, messagetypeError, 0);
#endif
//handle project
if(mocd == moc_no_qobject) {
char msg[400];
sprintf(msg, "\"%s\" No relevant classes found. No output generated.", source.data());
CWReportMessage(context, NULL, msg, NULL, messagetypeWarning, 0);
} else if ((mocd == moc_success || mocd == moc_not_time) && !dotmoc)
{
long whichFile;
CWNewProjectEntryInfo ei;
memset(&ei, '\0', sizeof(ei));
ei.groupPath = "QtGenerated";
err = CWAddProjectEntry(context, &destSpec, true, &ei, &whichFile);
if (!CWSUCCESS(err))
{
char msg[200];
sprintf(msg, "\"%s\" not added", dest.data());
CWReportMessage(context, NULL, msg, NULL, messagetypeWarning, 0);
}
if(mocd == moc_success)
CWSetModDate(context, &destSpec, NULL, true);
}
return cwNoErr;
}
pascal short main(CWPluginContext context)
{
short result;
long request;
if (CWGetPluginRequest(context, &request) != cwNoErr)
return cwErrRequestFailed;
result = cwErrInvalidParameter;
/* dispatch on compiler request */
switch (request)
{
case reqInitCompiler:
case reqTermCompiler:
result = cwNoErr;
break;
case reqCompile:
{
line_count = 0;
const char *files = NULL;
long filelen;
CWGetMainFileText(context, &files, &filelen);
const char *beg = files;
for(int x = 0; x < filelen; x++) {
if(*(files++) == '\r') {
char file[1024];
memcpy(file, beg, files - beg);
file[(files-beg)-1] = '\0';
mocify(context, file);
beg = files;
}
}
if(beg != files) {
char file[1024];
memcpy(file, beg, files - beg);
file[(files-beg)] = '\0';
mocify(context, file);
}
result = cwNoErr;
break;
}
}
/* return result code */
return result;
}
#endif
QT_END_NAMESPACE

View File

@ -236,7 +236,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
data -= 2; data -= 2;
break; break;
case DIGIT: case DIGIT:
while (is_digit_char(*data)) while (is_digit_char(*data) || *data == '\'')
++data; ++data;
if (!*data || *data != '.') { if (!*data || *data != '.') {
token = INTEGER_LITERAL; token = INTEGER_LITERAL;
@ -244,7 +244,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
(*data == 'x' || *data == 'X') (*data == 'x' || *data == 'X')
&& *lexem == '0') { && *lexem == '0') {
++data; ++data;
while (is_hex_char(*data)) while (is_hex_char(*data) || *data == '\'')
++data; ++data;
} }
break; break;
@ -253,13 +253,13 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
++data; ++data;
Q_FALLTHROUGH(); Q_FALLTHROUGH();
case FLOATING_LITERAL: case FLOATING_LITERAL:
while (is_digit_char(*data)) while (is_digit_char(*data) || *data == '\'')
++data; ++data;
if (*data == '+' || *data == '-') if (*data == '+' || *data == '-')
++data; ++data;
if (*data == 'e' || *data == 'E') { if (*data == 'e' || *data == 'E') {
++data; ++data;
while (is_digit_char(*data)) while (is_digit_char(*data) || *data == '\'')
++data; ++data;
} }
if (*data == 'f' || *data == 'F' if (*data == 'f' || *data == 'F'
@ -413,7 +413,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
token = PP_CHARACTER_LITERAL; token = PP_CHARACTER_LITERAL;
break; break;
case PP_DIGIT: case PP_DIGIT:
while (is_digit_char(*data)) while (is_digit_char(*data) || *data == '\'')
++data; ++data;
if (!*data || *data != '.') { if (!*data || *data != '.') {
token = PP_INTEGER_LITERAL; token = PP_INTEGER_LITERAL;
@ -421,7 +421,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
(*data == 'x' || *data == 'X') (*data == 'x' || *data == 'X')
&& *lexem == '0') { && *lexem == '0') {
++data; ++data;
while (is_hex_char(*data)) while (is_hex_char(*data) || *data == '\'')
++data; ++data;
} }
break; break;
@ -430,13 +430,13 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
++data; ++data;
Q_FALLTHROUGH(); Q_FALLTHROUGH();
case PP_FLOATING_LITERAL: case PP_FLOATING_LITERAL:
while (is_digit_char(*data)) while (is_digit_char(*data) || *data == '\'')
++data; ++data;
if (*data == '+' || *data == '-') if (*data == '+' || *data == '-')
++data; ++data;
if (*data == 'e' || *data == 'E') { if (*data == 'e' || *data == 'E') {
++data; ++data;
while (is_digit_char(*data)) while (is_digit_char(*data) || *data == '\'')
++data; ++data;
} }
if (*data == 'f' || *data == 'F' if (*data == 'f' || *data == 'F'

View File

@ -1484,6 +1484,8 @@ void WriteInitialization::writeProperties(const QString &varName,
defineC = whatsThisDefineC; defineC = whatsThisDefineC;
else if (propertyName == QLatin1String("statusTip")) else if (propertyName == QLatin1String("statusTip"))
defineC = statusTipDefineC; defineC = statusTipDefineC;
else if (propertyName == QLatin1String("shortcut"))
defineC = shortcutDefineC;
else if (propertyName == QLatin1String("accessibleName") || propertyName == QLatin1String("accessibleDescription")) else if (propertyName == QLatin1String("accessibleName") || propertyName == QLatin1String("accessibleDescription"))
defineC = accessibilityDefineC; defineC = accessibilityDefineC;

View File

@ -1,5 +1,5 @@
option(host_build) option(host_build)
!force_bootstrap:if(!qtConfig(commandlineparser)|!qtConfig(textcodec)): \ !force_bootstrap:if(!qtConfig(commandlineparser)|!qtConfig(textcodec)|!qtConfig(xmlstreamreader)|!qtConfig(xmlstreamwriter)): \
CONFIG += force_bootstrap CONFIG += force_bootstrap
DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH

View File

@ -44,7 +44,9 @@
#include "qaction.h" #include "qaction.h"
#include "qapplication.h" #include "qapplication.h"
#include "qgroupbox.h" #include "qgroupbox.h"
#if QT_CONFIG(label)
#include "qlabel.h" #include "qlabel.h"
#endif
#include "qtooltip.h" #include "qtooltip.h"
#include "qwhatsthis.h" #include "qwhatsthis.h"
#include "qwidget.h" #include "qwidget.h"
@ -81,7 +83,7 @@ static QString buddyString(const QWidget *widget)
QWidget *parent = widget->parentWidget(); QWidget *parent = widget->parentWidget();
if (!parent) if (!parent)
return QString(); return QString();
#ifndef QT_NO_SHORTCUT #if QT_CONFIG(shortcut) && QT_CONFIG(label)
for (QObject *o : parent->children()) { for (QObject *o : parent->children()) {
QLabel *label = qobject_cast<QLabel*>(o); QLabel *label = qobject_cast<QLabel*>(o);
if (label && label->buddy() == widget) if (label && label->buddy() == widget)
@ -309,7 +311,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
if (match & QAccessible::Label) { if (match & QAccessible::Label) {
const QAccessible::Relation rel = QAccessible::Label; const QAccessible::Relation rel = QAccessible::Label;
if (QWidget *parent = widget()->parentWidget()) { if (QWidget *parent = widget()->parentWidget()) {
#ifndef QT_NO_SHORTCUT #if QT_CONFIG(shortcut) && QT_CONFIG(label)
// first check for all siblings that are labels to us // first check for all siblings that are labels to us
// ideally we would go through all objects and check, but that // ideally we would go through all objects and check, but that
// will be too expensive // will be too expensive

View File

@ -45,7 +45,6 @@
#include "complexwidgets_p.h" #include "complexwidgets_p.h"
#include "itemviews_p.h" #include "itemviews_p.h"
#include <qpushbutton.h>
#include <qtoolbutton.h> #include <qtoolbutton.h>
#include <qtreeview.h> #include <qtreeview.h>
#include <qvariant.h> #include <qvariant.h>
@ -184,8 +183,10 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QMdiSubWindow")) { } else if (classname == QLatin1String("QMdiSubWindow")) {
iface = new QAccessibleMdiSubWindow(widget); iface = new QAccessibleMdiSubWindow(widget);
#endif #endif
#if QT_CONFIG(dialogbuttonbox)
} else if (classname == QLatin1String("QDialogButtonBox")) { } else if (classname == QLatin1String("QDialogButtonBox")) {
iface = new QAccessibleDialogButtonBox(widget); iface = new QAccessibleDialogButtonBox(widget);
#endif
#ifndef QT_NO_DIAL #ifndef QT_NO_DIAL
} else if (classname == QLatin1String("QDial")) { } else if (classname == QLatin1String("QDial")) {
iface = new QAccessibleDial(widget); iface = new QAccessibleDial(widget);

View File

@ -54,7 +54,9 @@
#include <QToolBox> #include <QToolBox>
#include <QMdiArea> #include <QMdiArea>
#include <QMdiSubWindow> #include <QMdiSubWindow>
#if QT_CONFIG(dialogbuttonbox)
#include <QDialogButtonBox> #include <QDialogButtonBox>
#endif
#include <limits.h> #include <limits.h>
#include <QRubberBand> #include <QRubberBand>
#include <QTextBrowser> #include <QTextBrowser>
@ -480,7 +482,7 @@ QMdiSubWindow *QAccessibleMdiSubWindow::mdiSubWindow() const
} }
#endif // QT_NO_MDIAREA #endif // QT_NO_MDIAREA
#ifndef QT_NO_DIALOGBUTTONBOX #if QT_CONFIG(dialogbuttonbox)
// ======================= QAccessibleDialogButtonBox ====================== // ======================= QAccessibleDialogButtonBox ======================
QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget) QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::Grouping) : QAccessibleWidget(widget, QAccessible::Grouping)
@ -488,7 +490,7 @@ QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)
Q_ASSERT(qobject_cast<QDialogButtonBox*>(widget)); Q_ASSERT(qobject_cast<QDialogButtonBox*>(widget));
} }
#endif // QT_NO_DIALOGBUTTONBOX #endif // QT_CONFIG(dialogbuttonbox)
#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR) #if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
QAccessibleTextBrowser::QAccessibleTextBrowser(QWidget *widget) QAccessibleTextBrowser::QAccessibleTextBrowser(QWidget *widget)

View File

@ -248,11 +248,13 @@ protected:
}; };
#endif // QT_NO_MDIAREA #endif // QT_NO_MDIAREA
#if QT_CONFIG(dialogbuttonbox)
class QAccessibleDialogButtonBox : public QAccessibleWidget class QAccessibleDialogButtonBox : public QAccessibleWidget
{ {
public: public:
explicit QAccessibleDialogButtonBox(QWidget *widget); explicit QAccessibleDialogButtonBox(QWidget *widget);
}; };
#endif
#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR) #if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
class QAccessibleTextBrowser : public QAccessibleTextEdit class QAccessibleTextBrowser : public QAccessibleTextEdit

View File

@ -40,14 +40,22 @@
#include "simplewidgets_p.h" #include "simplewidgets_p.h"
#include <qabstractbutton.h> #include <qabstractbutton.h>
#if QT_CONFIG(checkbox)
#include <qcheckbox.h> #include <qcheckbox.h>
#endif
#if QT_CONFIG(pushbutton)
#include <qpushbutton.h> #include <qpushbutton.h>
#endif
#include <qprogressbar.h> #include <qprogressbar.h>
#include <qstatusbar.h> #include <qstatusbar.h>
#if QT_CONFIG(radiobutton)
#include <qradiobutton.h> #include <qradiobutton.h>
#endif
#include <qtoolbutton.h> #include <qtoolbutton.h>
#include <qmenu.h> #include <qmenu.h>
#if QT_CONFIG(label)
#include <qlabel.h> #include <qlabel.h>
#endif
#include <qgroupbox.h> #include <qgroupbox.h>
#include <qlcdnumber.h> #include <qlcdnumber.h>
#include <qlineedit.h> #include <qlineedit.h>
@ -109,7 +117,7 @@ QString QAccessibleButton::text(QAccessible::Text t) const
switch (t) { switch (t) {
case QAccessible::Accelerator: case QAccessible::Accelerator:
{ {
#ifndef QT_NO_SHORTCUT #if QT_CONFIG(shortcut) && QT_CONFIG(pushbutton)
QPushButton *pb = qobject_cast<QPushButton*>(object()); QPushButton *pb = qobject_cast<QPushButton*>(object());
if (pb && pb->isDefault()) if (pb && pb->isDefault())
str = QKeySequence(Qt::Key_Enter).toString(QKeySequence::NativeText); str = QKeySequence(Qt::Key_Enter).toString(QKeySequence::NativeText);
@ -136,15 +144,20 @@ QAccessible::State QAccessibleButton::state() const
QAccessible::State state = QAccessibleWidget::state(); QAccessible::State state = QAccessibleWidget::state();
QAbstractButton *b = button(); QAbstractButton *b = button();
#if QT_CONFIG(checkbox)
QCheckBox *cb = qobject_cast<QCheckBox *>(b); QCheckBox *cb = qobject_cast<QCheckBox *>(b);
#endif
if (b->isCheckable()) if (b->isCheckable())
state.checkable = true; state.checkable = true;
if (b->isChecked()) if (b->isChecked())
state.checked = true; state.checked = true;
#if QT_CONFIG(checkbox)
else if (cb && cb->checkState() == Qt::PartiallyChecked) else if (cb && cb->checkState() == Qt::PartiallyChecked)
state.checkStateMixed = true; state.checkStateMixed = true;
#endif
if (b->isDown()) if (b->isDown())
state.pressed = true; state.pressed = true;
#if QT_CONFIG(pushbutton)
QPushButton *pb = qobject_cast<QPushButton*>(b); QPushButton *pb = qobject_cast<QPushButton*>(b);
if (pb) { if (pb) {
if (pb->isDefault()) if (pb->isDefault())
@ -154,6 +167,7 @@ QAccessible::State QAccessibleButton::state() const
state.hasPopup = true; state.hasPopup = true;
#endif #endif
} }
#endif
return state; return state;
} }
@ -164,17 +178,22 @@ QRect QAccessibleButton::rect() const
if (!ab->isVisible()) if (!ab->isVisible())
return QRect(); return QRect();
#if QT_CONFIG(checkbox)
if (QCheckBox *cb = qobject_cast<QCheckBox *>(ab)) { if (QCheckBox *cb = qobject_cast<QCheckBox *>(ab)) {
QPoint wpos = cb->mapToGlobal(QPoint(0, 0)); QPoint wpos = cb->mapToGlobal(QPoint(0, 0));
QStyleOptionButton opt; QStyleOptionButton opt;
cb->initStyleOption(&opt); cb->initStyleOption(&opt);
return cb->style()->subElementRect(QStyle::SE_CheckBoxClickRect, &opt, cb).translated(wpos); return cb->style()->subElementRect(QStyle::SE_CheckBoxClickRect, &opt, cb).translated(wpos);
} else if (QRadioButton *rb = qobject_cast<QRadioButton *>(ab)) { }
#endif
#if QT_CONFIG(radiobutton)
else if (QRadioButton *rb = qobject_cast<QRadioButton *>(ab)) {
QPoint wpos = rb->mapToGlobal(QPoint(0, 0)); QPoint wpos = rb->mapToGlobal(QPoint(0, 0));
QStyleOptionButton opt; QStyleOptionButton opt;
rb->initStyleOption(&opt); rb->initStyleOption(&opt);
return rb->style()->subElementRect(QStyle::SE_RadioButtonClickRect, &opt, rb).translated(wpos); return rb->style()->subElementRect(QStyle::SE_RadioButtonClickRect, &opt, rb).translated(wpos);
} }
#endif
return QAccessibleWidget::rect(); return QAccessibleWidget::rect();
} }
@ -390,6 +409,7 @@ QAccessibleDisplay::QAccessibleDisplay(QWidget *w, QAccessible::Role role)
QAccessible::Role QAccessibleDisplay::role() const QAccessible::Role QAccessibleDisplay::role() const
{ {
#if QT_CONFIG(label)
QLabel *l = qobject_cast<QLabel*>(object()); QLabel *l = qobject_cast<QLabel*>(object());
if (l) { if (l) {
if (l->pixmap()) if (l->pixmap())
@ -411,6 +431,7 @@ QAccessible::Role QAccessibleDisplay::role() const
return QAccessible::StatusBar; return QAccessible::StatusBar;
#endif #endif
} }
#endif
return QAccessibleWidget::role(); return QAccessibleWidget::role();
} }
@ -421,7 +442,9 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
case QAccessible::Name: case QAccessible::Name:
str = widget()->accessibleName(); str = widget()->accessibleName();
if (str.isEmpty()) { if (str.isEmpty()) {
if (qobject_cast<QLabel*>(object())) { if (false) {
#if QT_CONFIG(label)
} else if (qobject_cast<QLabel*>(object())) {
QLabel *label = qobject_cast<QLabel*>(object()); QLabel *label = qobject_cast<QLabel*>(object());
str = label->text(); str = label->text();
#ifndef QT_NO_TEXTHTMLPARSER #ifndef QT_NO_TEXTHTMLPARSER
@ -436,6 +459,7 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
if (label->buddy()) if (label->buddy())
str = qt_accStripAmp(str); str = qt_accStripAmp(str);
#endif #endif
#endif // QT_CONFIG(label)
#ifndef QT_NO_LCDNUMBER #ifndef QT_NO_LCDNUMBER
} else if (qobject_cast<QLCDNumber*>(object())) { } else if (qobject_cast<QLCDNumber*>(object())) {
QLCDNumber *l = qobject_cast<QLCDNumber*>(object()); QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
@ -470,7 +494,7 @@ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >
QAccessibleDisplay::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const QAccessibleDisplay::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const
{ {
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match); QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match);
#ifndef QT_NO_SHORTCUT #if QT_CONFIG(shortcut) && QT_CONFIG(label)
if (match & QAccessible::Labelled) { if (match & QAccessible::Labelled) {
if (QLabel *label = qobject_cast<QLabel*>(object())) { if (QLabel *label = qobject_cast<QLabel*>(object())) {
const QAccessible::Relation rel = QAccessible::Labelled; const QAccessible::Relation rel = QAccessible::Labelled;
@ -502,26 +526,34 @@ QString QAccessibleDisplay::imageDescription() const
/*! \internal */ /*! \internal */
QSize QAccessibleDisplay::imageSize() const QSize QAccessibleDisplay::imageSize() const
{ {
#if QT_CONFIG(label)
QLabel *label = qobject_cast<QLabel *>(widget()); QLabel *label = qobject_cast<QLabel *>(widget());
if (!label) if (!label)
#endif
return QSize(); return QSize();
#if QT_CONFIG(label)
const QPixmap *pixmap = label->pixmap(); const QPixmap *pixmap = label->pixmap();
if (!pixmap) if (!pixmap)
return QSize(); return QSize();
return pixmap->size(); return pixmap->size();
#endif
} }
/*! \internal */ /*! \internal */
QPoint QAccessibleDisplay::imagePosition() const QPoint QAccessibleDisplay::imagePosition() const
{ {
#if QT_CONFIG(label)
QLabel *label = qobject_cast<QLabel *>(widget()); QLabel *label = qobject_cast<QLabel *>(widget());
if (!label) if (!label)
#endif
return QPoint(); return QPoint();
#if QT_CONFIG(label)
const QPixmap *pixmap = label->pixmap(); const QPixmap *pixmap = label->pixmap();
if (!pixmap) if (!pixmap)
return QPoint(); return QPoint();
return QPoint(label->mapToGlobal(label->pos())); return QPoint(label->mapToGlobal(label->pos()));
#endif
} }
#ifndef QT_NO_GROUPBOX #ifndef QT_NO_GROUPBOX
@ -664,11 +696,13 @@ void QAccessibleLineEdit::setText(QAccessible::Text t, const QString &text)
} }
QString newText = text; QString newText = text;
#if QT_CONFIG(validator)
if (lineEdit()->validator()) { if (lineEdit()->validator()) {
int pos = 0; int pos = 0;
if (lineEdit()->validator()->validate(newText, pos) != QValidator::Acceptable) if (lineEdit()->validator()->validate(newText, pos) != QValidator::Acceptable)
return; return;
} }
#endif
lineEdit()->setText(newText); lineEdit()->setText(newText);
} }

View File

@ -117,6 +117,13 @@
"condition": "features.tableview", "condition": "features.tableview",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"commandlinkbutton": {
"label": "QCommandLinkButton",
"purpose": "Provides a Vista style command link button.",
"section": "Widgets",
"condition": "features.pushbutton",
"output": [ "publicFeature" ]
},
"datetimeedit": { "datetimeedit": {
"label": "QDateTimeEdit", "label": "QDateTimeEdit",
"purpose": "Supports editing dates and times.", "purpose": "Supports editing dates and times.",
@ -150,6 +157,19 @@
"condition": "features.rubberband", "condition": "features.rubberband",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"label": {
"label": "QLabel",
"purpose": "Provides a text or image display.",
"section": "Widgets",
"output": [ "publicFeature" ]
},
"formlayout": {
"label": "QFormLayout",
"purpose": "Manages forms of input widgets and their associated labels.",
"section": "Widgets",
"condition": "features.label",
"output": [ "publicFeature" ]
},
"lcdnumber": { "lcdnumber": {
"label": "QLCDNumber", "label": "QLCDNumber",
"purpose": "Provides LCD-like digits.", "purpose": "Provides LCD-like digits.",
@ -160,7 +180,7 @@
"label": "QMenu", "label": "QMenu",
"purpose": "Provides popup-menus.", "purpose": "Provides popup-menus.",
"section": "Widgets", "section": "Widgets",
"condition": "features.action", "condition": "features.action && features.pushbutton",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"lineedit": { "lineedit": {
@ -169,6 +189,12 @@
"section": "Widgets", "section": "Widgets",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"radiobutton": {
"label": "QRadioButton",
"purpose": "Provides a radio button with a text label.",
"section": "Widgets",
"output": [ "publicFeature" ]
},
"spinbox": { "spinbox": {
"label": "QSpinBox", "label": "QSpinBox",
"purpose": "Provides spin boxes handling integers and discrete sets of values.", "purpose": "Provides spin boxes handling integers and discrete sets of values.",
@ -204,6 +230,19 @@
"condition": "features.combobox && features.stringlistmodel", "condition": "features.combobox && features.stringlistmodel",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"checkbox": {
"label": "QCheckBox(",
"purpose": "Provides a checkbox with a text label.",
"section": "Widgets",
"output": [ "publicFeature" ]
},
"pushbutton": {
"label": "QPushButton",
"purpose": "Provides a command button.",
"section": "Widgets",
"condition": "features.action",
"output": [ "publicFeature" ]
},
"toolbutton": { "toolbutton": {
"label": "QToolButton", "label": "QToolButton",
"purpose": "Provides quick-access buttons to commands and options.", "purpose": "Provides quick-access buttons to commands and options.",
@ -291,10 +330,17 @@
"section": "Widgets", "section": "Widgets",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"abstractslider": {
"label": "QAbstractSlider",
"purpose": "Common super class for widgets like QScrollBar, QSlider and QDial.",
"section": "Widgets",
"output": [ "publicFeature" ]
},
"slider": { "slider": {
"label": "QSlider", "label": "QSlider",
"purpose": "Provides sliders controlling a bounded value.", "purpose": "Provides sliders controlling a bounded value.",
"section": "Widgets", "section": "Widgets",
"condition": "features.abstractslider",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"scrollbar": { "scrollbar": {
@ -318,6 +364,12 @@
"condition": "features.scrollbar", "condition": "features.scrollbar",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"scroller": {
"label": "QScroller",
"purpose": "Enables kinetic scrolling for any scrolling widget or graphics item.",
"section": "Widgets",
"output": [ "publicFeature" ]
},
"graphicsview": { "graphicsview": {
"label": "QGraphicsView", "label": "QGraphicsView",
"purpose": "Provides a canvas/sprite framework.", "purpose": "Provides a canvas/sprite framework.",
@ -356,6 +408,7 @@
"label": "QToolTip", "label": "QToolTip",
"purpose": "Supports presentation of tooltips.", "purpose": "Supports presentation of tooltips.",
"section": "Widgets", "section": "Widgets",
"condition": "features.label",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"statustip": { "statustip": {
@ -381,7 +434,15 @@
"label": "QCalendarWidget", "label": "QCalendarWidget",
"purpose": "Provides a monthly based calendar widget allowing the user to select a date.", "purpose": "Provides a monthly based calendar widget allowing the user to select a date.",
"section": "Widgets", "section": "Widgets",
"condition": "features.tableview && features.menu && features.textdate && features.spinbox && features.toolbutton", "condition": [
"features.label",
"features.menu",
"features.pushbutton",
"features.spinbox",
"features.tableview",
"features.textdate",
"features.toolbutton"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"keysequenceedit": { "keysequenceedit": {
@ -391,59 +452,119 @@
"condition": "features.lineedit && features.shortcut", "condition": "features.lineedit && features.shortcut",
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"dialogbuttonbox": {
"label": "QDialogButtonBox",
"purpose": "Presents buttons in a layout that is appropriate for the current widget style.",
"section": "Dialogs",
"condition": "features.pushbutton",
"output": [ "publicFeature" ]
},
"messagebox": { "messagebox": {
"label": "QMessageBox", "label": "QMessageBox",
"purpose": "Provides message boxes displaying informative messages and simple questions.", "purpose": "Provides message boxes displaying informative messages and simple questions.",
"section": "Dialogs", "section": "Dialogs",
"condition" : [
"features.checkbox",
"features.dialogbuttonbox",
"features.label",
"features.pushbutton"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"colordialog": { "colordialog": {
"label": "QColorDialog", "label": "QColorDialog",
"purpose": "Provides a dialog widget for specifying colors.", "purpose": "Provides a dialog widget for specifying colors.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.spinbox", "condition": [
"features.dialogbuttonbox",
"features.label",
"features.pushbutton",
"features.spinbox"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"filedialog": { "filedialog": {
"label": "QFileDialog", "label": "QFileDialog",
"purpose": "Provides a dialog widget for selecting files or directories.", "purpose": "Provides a dialog widget for selecting files or directories.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.dirmodel && features.treeview && features.combobox && features.toolbutton && features.buttongroup && features.tooltip && features.splitter && features.stackedwidget && features.proxymodel", "condition": [
"features.buttongroup",
"features.combobox",
"features.dialogbuttonbox",
"features.dirmodel",
"features.label",
"features.proxymodel",
"features.splitter",
"features.stackedwidget",
"features.treeview",
"features.toolbutton"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"fontdialog": { "fontdialog": {
"label": "QFontDialog", "label": "QFontDialog",
"purpose": "Provides a dialog widget for selecting fonts.", "purpose": "Provides a dialog widget for selecting fonts.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.stringlistmodel && features.combobox && features.validator && features.groupbox", "condition": [
"features.checkbox",
"features.combobox",
"features.dialogbuttonbox",
"features.groupbox",
"features.label",
"features.pushbutton",
"features.stringlistmodel",
"features.validator"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"progressdialog": { "progressdialog": {
"label": "QProgressDialog", "label": "QProgressDialog",
"purpose": "Provides feedback on the progress of a slow operation.", "purpose": "Provides feedback on the progress of a slow operation.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.progressbar", "condition": [
"features.label",
"features.pushbutton",
"features.progressbar"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"inputdialog": { "inputdialog": {
"label": "QInputDialog", "label": "QInputDialog",
"purpose": "Provides a simple convenience dialog to get a single value from the user.", "purpose": "Provides a simple convenience dialog to get a single value from the user.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.combobox && features.spinbox && features.stackedwidget && features.textedit", "condition": [
"features.combobox",
"features.dialogbuttonbox",
"features.label",
"features.pushbutton",
"features.spinbox",
"features.stackedwidget",
"features.textedit"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"errormessage": { "errormessage": {
"label": "QErrorMessage", "label": "QErrorMessage",
"purpose": "Provides an error message display dialog.", "purpose": "Provides an error message display dialog.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.textedit", "condition": [
"features.checkbox",
"features.textedit",
"features.label",
"features.pushbutton",
"features.textedit"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"wizard": { "wizard": {
"label": "QWizard", "label": "QWizard",
"purpose": "Provides a framework for multi-page click-through dialogs.", "purpose": "Provides a framework for multi-page click-through dialogs.",
"section": "Dialogs", "section": "Dialogs",
"condition": "features.properties", "condition": [
"features.pushbutton",
"features.properties",
"features.label"
],
"output": [ "publicFeature", "feature" ] "output": [ "publicFeature", "feature" ]
}, },
"dirmodel": { "dirmodel": {

View File

@ -2246,10 +2246,13 @@ bool QColorDialogPrivate::handleColorPickingMouseButtonRelease(QMouseEvent *e)
bool QColorDialogPrivate::handleColorPickingKeyPress(QKeyEvent *e) bool QColorDialogPrivate::handleColorPickingKeyPress(QKeyEvent *e)
{ {
Q_Q(QColorDialog); Q_Q(QColorDialog);
#if QT_CONFIG(shortcut)
if (e->matches(QKeySequence::Cancel)) { if (e->matches(QKeySequence::Cancel)) {
releaseColorPicking(); releaseColorPicking();
q->setCurrentColor(beforeScreenColorPicking); q->setCurrentColor(beforeScreenColorPicking);
} else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { } else
#endif
if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
q->setCurrentColor(grabScreenColor(QCursor::pos())); q->setCurrentColor(grabScreenColor(QCursor::pos()));
releaseColorPicking(); releaseColorPicking();
} }

View File

@ -43,7 +43,6 @@
#include "qevent.h" #include "qevent.h"
#include "qdesktopwidget.h" #include "qdesktopwidget.h"
#include "qpushbutton.h"
#include "qapplication.h" #include "qapplication.h"
#include "qlayout.h" #include "qlayout.h"
#include "qsizegrip.h" #include "qsizegrip.h"
@ -367,6 +366,7 @@ QDialog::~QDialog()
default default button becomes the default button. This is what a default default button becomes the default button. This is what a
push button calls when it loses focus. push button calls when it loses focus.
*/ */
#if QT_CONFIG(pushbutton)
void QDialogPrivate::setDefault(QPushButton *pushButton) void QDialogPrivate::setDefault(QPushButton *pushButton)
{ {
Q_Q(QDialog); Q_Q(QDialog);
@ -411,6 +411,7 @@ void QDialogPrivate::hideDefault()
list.at(i)->setDefault(false); list.at(i)->setDefault(false);
} }
} }
#endif
void QDialogPrivate::resetModalitySetByOpen() void QDialogPrivate::resetModalitySetByOpen()
{ {
@ -644,6 +645,7 @@ void QDialog::keyPressEvent(QKeyEvent *e)
#endif #endif
if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) { if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) {
switch (e->key()) { switch (e->key()) {
#if QT_CONFIG(pushbutton)
case Qt::Key_Enter: case Qt::Key_Enter:
case Qt::Key_Return: { case Qt::Key_Return: {
QList<QPushButton*> list = findChildren<QPushButton*>(); QList<QPushButton*> list = findChildren<QPushButton*>();
@ -657,6 +659,7 @@ void QDialog::keyPressEvent(QKeyEvent *e)
} }
} }
break; break;
#endif
default: default:
e->ignore(); e->ignore();
return; return;
@ -716,6 +719,7 @@ void QDialog::setVisible(bool visible)
and actually catches most cases... If not, then they simply and actually catches most cases... If not, then they simply
have to use [widget*]->setFocus() themselves... have to use [widget*]->setFocus() themselves...
*/ */
#if QT_CONFIG(pushbutton)
if (d->mainDef && fw->focusPolicy() == Qt::NoFocus) { if (d->mainDef && fw->focusPolicy() == Qt::NoFocus) {
QWidget *first = fw; QWidget *first = fw;
while ((first = first->nextInFocusChain()) != fw && first->focusPolicy() == Qt::NoFocus) while ((first = first->nextInFocusChain()) != fw && first->focusPolicy() == Qt::NoFocus)
@ -733,6 +737,7 @@ void QDialog::setVisible(bool visible)
} }
} }
} }
#endif
if (fw && !fw->hasFocus()) { if (fw && !fw->hasFocus()) {
QFocusEvent e(QEvent::FocusIn, Qt::TabFocusReason); QFocusEvent e(QEvent::FocusIn, Qt::TabFocusReason);
QApplication::sendEvent(fw, &e); QApplication::sendEvent(fw, &e);
@ -760,10 +765,12 @@ void QDialog::setVisible(bool visible)
d->eventLoop->exit(); d->eventLoop->exit();
} }
#if QT_CONFIG(pushbutton)
const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme();
if (d->mainDef && isActiveWindow() if (d->mainDef && isActiveWindow()
&& theme->themeHint(QPlatformTheme::DialogSnapToDefaultButton).toBool()) && theme->themeHint(QPlatformTheme::DialogSnapToDefaultButton).toBool())
QCursor::setPos(d->mainDef->mapToGlobal(d->mainDef->rect().center())); QCursor::setPos(d->mainDef->mapToGlobal(d->mainDef->rect().center()));
#endif
} }
/*!\reimp */ /*!\reimp */

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