diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2017-08-02 23:15:27 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-08-02 23:15:27 +0000 |
commit | 6c2bfbf88efa745882c636d9b91c4210b8fa5572 (patch) | |
tree | 54625073d07ee5830bdfba3853cf9d95ec211b7d | |
parent | 72cf2339edbb302b8b1dbe14c5475e8d2c3f62b1 (diff) | |
parent | ee07b912a1768ea0b103544f9eeac41f3cf50cf6 (diff) |
Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev
399 files changed, 2440 insertions, 6509 deletions
diff --git a/config.tests/arch/arch.pro b/config.tests/arch/arch.pro index d89d70b1ee..2ffdb2c889 100644 --- a/config.tests/arch/arch.pro +++ b/config.tests/arch/arch.pro @@ -1,4 +1,2 @@ TARGET = arch SOURCES = arch.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console diff --git a/config.tests/common/atomicfptr/icc2016_mac.diff b/config.tests/atomicfptr/icc2016_mac.diff index 5de3b6e19a..5de3b6e19a 100644 --- a/config.tests/common/atomicfptr/icc2016_mac.diff +++ b/config.tests/atomicfptr/icc2016_mac.diff diff --git a/config.tests/common/atomicfptr/qnx66.txt b/config.tests/atomicfptr/qnx66.txt index b4ea9d65b5..b4ea9d65b5 100644 --- a/config.tests/common/atomicfptr/qnx66.txt +++ b/config.tests/atomicfptr/qnx66.txt diff --git a/config.tests/common/avx512/avx512.cpp b/config.tests/avx512/avx512.cpp index ca1a5d1357..ca1a5d1357 100644 --- a/config.tests/common/avx512/avx512.cpp +++ b/config.tests/avx512/avx512.cpp diff --git a/config.tests/common/avx512/avx512.pro b/config.tests/avx512/avx512.pro index 96dddb14fd..1edf5e5432 100644 --- a/config.tests/common/avx512/avx512.pro +++ b/config.tests/avx512/avx512.pro @@ -1,6 +1,4 @@ SOURCES = avx512.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console !defined(AVX512, "var"): error("You must set the AVX512 variable!") diff --git a/config.tests/common/alloca/alloca.cpp b/config.tests/common/alloca/alloca.cpp deleted file mode 100644 index 500bdb9ba2..0000000000 --- a/config.tests/common/alloca/alloca.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if defined(USE_ALLOCA_H) -# include <alloca.h> -# ifdef __QNXNTO__ -// extra include needed in QNX7 to define NULL for the alloca() macro -# include <stddef.h> -# endif -#elif defined(USE_MALLOC_H) -# include <malloc.h> -#else -# include <stdlib.h> -#endif - -int main(int, char **) -{ - alloca(1); - return 0; -} diff --git a/config.tests/common/alloca/alloca.pro b/config.tests/common/alloca/alloca.pro deleted file mode 100644 index a2d7d45da2..0000000000 --- a/config.tests/common/alloca/alloca.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = alloca.cpp diff --git a/config.tests/common/atomic64/atomic64.cpp b/config.tests/common/atomic64/atomic64.cpp deleted file mode 100644 index 3181caf15e..0000000000 --- a/config.tests/common/atomic64/atomic64.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <atomic> -#include <cstdint> - -void test(volatile std::atomic<std::int64_t> &a) -{ - std::int64_t v = a.load(std::memory_order_acquire); - while (!a.compare_exchange_strong(v, v + 1, - std::memory_order_acq_rel, - std::memory_order_acquire)) { - v = a.exchange(v - 1); - } - - a.store(v + 1, std::memory_order_release); -} - -int main(int, char **) -{ - void *ptr = (void*)0xffffffc0; // any random pointer - test(*reinterpret_cast<std::atomic<std::int64_t> *>(ptr)); - return 0; -} diff --git a/config.tests/common/atomic64/atomic64.pro b/config.tests/common/atomic64/atomic64.pro deleted file mode 100644 index c9a85817ca..0000000000 --- a/config.tests/common/atomic64/atomic64.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = atomic64.cpp -CONFIG += c++11 console -CONFIG -= qt diff --git a/config.tests/common/atomicfptr/atomicfptr.cpp b/config.tests/common/atomicfptr/atomicfptr.cpp deleted file mode 100644 index a993357127..0000000000 --- a/config.tests/common/atomicfptr/atomicfptr.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <atomic> - -typedef void (*fptr)(int); -typedef std::atomic<fptr> atomicfptr; - -void testfunction(int) { } - -void test(volatile atomicfptr &a) -{ - fptr v = a.load(std::memory_order_acquire); - while (!a.compare_exchange_strong(v, &testfunction, - std::memory_order_acq_rel, - std::memory_order_acquire)) { - v = a.exchange(&testfunction); - } - - a.store(&testfunction, std::memory_order_release); -} - -int main(int, char **) -{ - atomicfptr fptr(testfunction); - test(fptr); - return 0; -} diff --git a/config.tests/common/atomicfptr/atomicfptr.pro b/config.tests/common/atomicfptr/atomicfptr.pro deleted file mode 100644 index 5509862a30..0000000000 --- a/config.tests/common/atomicfptr/atomicfptr.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = atomicfptr.cpp -CONFIG += c++11 console -CONFIG -= qt app_bundle diff --git a/config.tests/common/avx/avx.cpp b/config.tests/common/avx/avx.cpp deleted file mode 100644 index a26f87f157..0000000000 --- a/config.tests/common/avx/avx.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <immintrin.h> - -int main(int, char**) -{ - __m256d a = _mm256_setzero_pd(); - __m256d b = _mm256_set1_pd(42.42); - __m256d result = _mm256_add_pd(a, b); - (void)result; - return 0; -} diff --git a/config.tests/common/avx/avx.pro b/config.tests/common/avx/avx.pro deleted file mode 100644 index bf84089883..0000000000 --- a/config.tests/common/avx/avx.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = avx.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console -!defined(QMAKE_CFLAGS_AVX, "var"):error("This compiler does not support AVX") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX diff --git a/config.tests/common/avx2/avx2.cpp b/config.tests/common/avx2/avx2.cpp deleted file mode 100644 index 2df7e908dd..0000000000 --- a/config.tests/common/avx2/avx2.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <immintrin.h> - -int main(int, char**) -{ - /* AVX */ - _mm256_zeroall(); - __m256i a = _mm256_setzero_si256(); - - /* AVX2 */ - __m256i b = _mm256_and_si256(a, a); - __m256i result = _mm256_add_epi8(a, b); - (void)result; - return 0; -} diff --git a/config.tests/common/avx2/avx2.pro b/config.tests/common/avx2/avx2.pro deleted file mode 100644 index 7ccf66ca28..0000000000 --- a/config.tests/common/avx2/avx2.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = avx2.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console -!defined(QMAKE_CFLAGS_AVX2, "var"):error("This compiler does not support AVX2") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX2 diff --git a/config.tests/common/c++14/c++14.cpp b/config.tests/common/c++14/c++14.cpp deleted file mode 100644 index 1129213d1f..0000000000 --- a/config.tests/common/c++14/c++14.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if __cplusplus > 201103L -// Compiler claims to support C++14, trust it -#else -# error "__cplusplus must be > 201103L (the value of C++11)" -#endif - -int main(int, char **) { return 0; } diff --git a/config.tests/common/c++14/c++14.pro b/config.tests/common/c++14/c++14.pro deleted file mode 100644 index cbd78ba6fe..0000000000 --- a/config.tests/common/c++14/c++14.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = c++14.cpp -CONFIG += c++11 c++14 console -CONFIG -= qt diff --git a/config.tests/common/c++1z/c++1z.cpp b/config.tests/common/c++1z/c++1z.cpp deleted file mode 100644 index 63c6fb5b8a..0000000000 --- a/config.tests/common/c++1z/c++1z.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if __cplusplus > 201402L -// Compiler claims to support experimental C++1z, trust it -#else -# error "__cplusplus must be > 201402L (the value for C++14)" -#endif - -#include <map> // https://bugs.llvm.org//show_bug.cgi?id=33117 - -int main(int, char **) { return 0; } diff --git a/config.tests/common/c++1z/c++1z.pro b/config.tests/common/c++1z/c++1z.pro deleted file mode 100644 index 3a24946276..0000000000 --- a/config.tests/common/c++1z/c++1z.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = c++1z.cpp -CONFIG += c++11 c++14 c++1z console -CONFIG -= qt diff --git a/config.tests/common/f16c/f16c.cpp b/config.tests/common/f16c/f16c.cpp deleted file mode 100644 index aeeb35eac3..0000000000 --- a/config.tests/common/f16c/f16c.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <immintrin.h> - -int main(int, char**) -{ - __m128i a = _mm_setzero_si128(); - __m128 b = _mm_cvtph_ps(a); - __m256 b256 = _mm256_cvtph_ps(a); - __m128i c = _mm_cvtps_ph(b, 0); - c = _mm256_cvtps_ph(b256, 0); - (void)c; - return 0; -} diff --git a/config.tests/common/f16c/f16c.pro b/config.tests/common/f16c/f16c.pro deleted file mode 100644 index 6b36c99d96..0000000000 --- a/config.tests/common/f16c/f16c.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = f16c.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console -!defined(QMAKE_CFLAGS_F16C, "var"):error("This compiler does not support F16C") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_F16C diff --git a/config.tests/common/libproxy/libproxy.cpp b/config.tests/common/libproxy/libproxy.cpp deleted file mode 100644 index 97a1a94ed7..0000000000 --- a/config.tests/common/libproxy/libproxy.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <stdio.h> -#include <stdlib.h> -#include <proxy.h> - -int main(int, char **) -{ - pxProxyFactory *factory = px_proxy_factory_new(); - char **proxies = px_proxy_factory_get_proxies(factory, "http://qt-project.org"); - if (proxies) { - for (int i = 0; proxies[i]; i++) { - printf("%s\n", proxies[i]); - free(proxies[i]); - } - free(proxies); - } - px_proxy_factory_free(factory); - return 0; -} diff --git a/config.tests/common/libproxy/libproxy.pro b/config.tests/common/libproxy/libproxy.pro deleted file mode 100644 index e3183d99e7..0000000000 --- a/config.tests/common/libproxy/libproxy.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = libproxy.cpp -CONFIG -= qt dylib -mac:CONFIG -= app_bundle diff --git a/config.tests/common/sse2/sse2.cpp b/config.tests/common/sse2/sse2.cpp deleted file mode 100644 index 7ae0eaf4a7..0000000000 --- a/config.tests/common/sse2/sse2.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <emmintrin.h> -#if defined(__GNUC__) && __GNUC__ < 4 && __GNUC_MINOR__ < 3 -#error GCC < 3.2 is known to create internal compiler errors with our MMX code -#endif - -int main(int, char**) -{ - __m128i a = _mm_setzero_si128(); - _mm_maskmoveu_si128(a, _mm_setzero_si128(), 0); - return 0; -} diff --git a/config.tests/common/sse2/sse2.pro b/config.tests/common/sse2/sse2.pro deleted file mode 100644 index 0567eba19d..0000000000 --- a/config.tests/common/sse2/sse2.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = sse2.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console -!defined(QMAKE_CFLAGS_SSE2, var): error("This compiler does not support SSE2") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2 diff --git a/config.tests/common/sse3/sse3.cpp b/config.tests/common/sse3/sse3.cpp deleted file mode 100644 index a1e7694daa..0000000000 --- a/config.tests/common/sse3/sse3.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <pmmintrin.h> - -int main(int, char**) -{ - __m128d a = _mm_set1_pd(6.28); - __m128d b = _mm_set1_pd(3.14); - __m128d result = _mm_addsub_pd(a, b); - result = _mm_movedup_pd(result); - return 0; -} diff --git a/config.tests/common/sse3/sse3.pro b/config.tests/common/sse3/sse3.pro deleted file mode 100644 index e2e09bac91..0000000000 --- a/config.tests/common/sse3/sse3.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = sse3.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console -!defined(QMAKE_CFLAGS_SSE3, "var"):error("This compiler does not support SSE3") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE3 diff --git a/config.tests/common/sse4_1/sse4_1.cpp b/config.tests/common/sse4_1/sse4_1.cpp deleted file mode 100644 index 7592ac33f4..0000000000 --- a/config.tests/common/sse4_1/sse4_1.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <smmintrin.h> - -int main(int, char**) -{ - __m128 a = _mm_setzero_ps(); - _mm_ceil_ps(a); - __m128i result = _mm_mullo_epi32(_mm_set1_epi32(42), _mm_set1_epi32(64)); - (void)result; - return 0; -} diff --git a/config.tests/common/sse4_1/sse4_1.pro b/config.tests/common/sse4_1/sse4_1.pro deleted file mode 100644 index 273c705efc..0000000000 --- a/config.tests/common/sse4_1/sse4_1.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = sse4_1.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console -!defined(QMAKE_CFLAGS_SSE4_1, "var"):error("This compiler does not support SSE4.1") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_1 diff --git a/config.tests/common/sse4_2/sse4_2.cpp b/config.tests/common/sse4_2/sse4_2.cpp deleted file mode 100644 index 5ad151c96c..0000000000 --- a/config.tests/common/sse4_2/sse4_2.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <nmmintrin.h> - -int main(int, char**) -{ - __m128i a = _mm_setzero_si128(); - __m128i b = _mm_set1_epi32(42); - __m128i result = _mm_cmpestrm(a, 16, b, 16, 0); - (void)result; - return 0; -} diff --git a/config.tests/common/sse4_2/sse4_2.pro b/config.tests/common/sse4_2/sse4_2.pro deleted file mode 100644 index 3816fdeae9..0000000000 --- a/config.tests/common/sse4_2/sse4_2.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = sse4_2.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console -!defined(QMAKE_CFLAGS_SSE4_2, "var"):error("This compiler does not support SSE4.2") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_2 diff --git a/config.tests/common/ssse3/ssse3.cpp b/config.tests/common/ssse3/ssse3.cpp deleted file mode 100644 index 79c0e2b6b6..0000000000 --- a/config.tests/common/ssse3/ssse3.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <tmmintrin.h> - -int main(int, char**) -{ - __m128i a = _mm_set1_epi32(42); - _mm_abs_epi8(a); - __m128i result = _mm_sign_epi16(a, _mm_set1_epi32(64)); - (void)result; - return 0; -} diff --git a/config.tests/common/ssse3/ssse3.pro b/config.tests/common/ssse3/ssse3.pro deleted file mode 100644 index 597b169140..0000000000 --- a/config.tests/common/ssse3/ssse3.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = ssse3.cpp -CONFIG -= qt dylib release debug_and_release -CONFIG += debug console -!defined(QMAKE_CFLAGS_SSSE3, "var"):error("This compiler does not support SSSE3") -else:QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSSE3 diff --git a/config.tests/mac/corewlan/corewlan.pro b/config.tests/corewlan/corewlan.pro index 97e864f476..c19f0be4fd 100644 --- a/config.tests/mac/corewlan/corewlan.pro +++ b/config.tests/corewlan/corewlan.pro @@ -1,2 +1 @@ OBJECTIVE_SOURCES = corewlantest.mm -CONFIG -= qt diff --git a/config.tests/mac/corewlan/corewlantest.mm b/config.tests/corewlan/corewlantest.mm index 73b4d0d145..73b4d0d145 100644 --- a/config.tests/mac/corewlan/corewlantest.mm +++ b/config.tests/corewlan/corewlantest.mm diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp b/config.tests/gnu-libiconv/gnu-libiconv.cpp index 1276311e08..fe4b87b923 100644 --- a/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp +++ b/config.tests/gnu-libiconv/gnu-libiconv.cpp @@ -37,9 +37,6 @@ ** ****************************************************************************/ -#if defined(__sgi) -#error "iconv not supported on IRIX" -#else #include <iconv.h> int main(int, char **) @@ -55,4 +52,3 @@ int main(int, char **) return 0; } -#endif diff --git a/config.tests/unix/gnu-libiconv/gnu-libiconv.pro b/config.tests/gnu-libiconv/gnu-libiconv.pro index 4008f882eb..e4e020cffb 100644 --- a/config.tests/unix/gnu-libiconv/gnu-libiconv.pro +++ b/config.tests/gnu-libiconv/gnu-libiconv.pro @@ -1,2 +1 @@ SOURCES = gnu-libiconv.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/iconv/iconv.cpp b/config.tests/iconv/iconv.cpp index 993a12c7ee..be4236436f 100644 --- a/config.tests/unix/iconv/iconv.cpp +++ b/config.tests/iconv/iconv.cpp @@ -37,9 +37,6 @@ ** ****************************************************************************/ -#if defined(__sgi) -#error "iconv not supported on IRIX" -#else #include <iconv.h> int main(int, char **) @@ -55,4 +52,3 @@ int main(int, char **) return 0; } -#endif diff --git a/config.tests/unix/iconv/iconv.pro b/config.tests/iconv/iconv.pro index 65273ccc94..70af0d2eb2 100644 --- a/config.tests/unix/iconv/iconv.pro +++ b/config.tests/iconv/iconv.pro @@ -1,3 +1,2 @@ SOURCES = iconv.cpp -CONFIG -= qt dylib mac|mingw|openbsd|qnx|haiku:LIBS += -liconv diff --git a/config.tests/unix/openssl/openssl.cpp b/config.tests/openssl/openssl.cpp index d33b62389c..d33b62389c 100644 --- a/config.tests/unix/openssl/openssl.cpp +++ b/config.tests/openssl/openssl.cpp diff --git a/config.tests/unix/openssl/openssl.pro b/config.tests/openssl/openssl.pro index a023aee4aa..f0ee5e2b0c 100644 --- a/config.tests/unix/openssl/openssl.pro +++ b/config.tests/openssl/openssl.pro @@ -1,2 +1 @@ SOURCES = openssl.cpp -CONFIG -= x11 qt diff --git a/config.tests/qpa/direct2d/direct2d.cpp b/config.tests/qpa/direct2d/direct2d.cpp deleted file mode 100644 index 87ce1d1dab..0000000000 --- a/config.tests/qpa/direct2d/direct2d.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <d3d11_1.h> -#include <d2d1_1.h> -#include <d2d1_1helper.h> -#include <dxgi1_2.h> -#include <wrl.h> -#include <dwrite.h> - -using Microsoft::WRL::ComPtr; - -int main(int, char**) -{ - ComPtr<ID2D1Factory1> d2dFactory; - D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, d2dFactory.ReleaseAndGetAddressOf()); - ComPtr<IDXGISurface1> surface; - (void)surface; // Q_UNUSED - - return 0; -} diff --git a/config.tests/qpa/directfb/directfb.cpp b/config.tests/qpa/directfb/directfb.cpp deleted file mode 100644 index 72df1195b0..0000000000 --- a/config.tests/qpa/directfb/directfb.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <directfb.h> - -#ifdef __typeof__ -#error DirectFB headers are unclean and cannot compile -#endif - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/qpa/directfb/directfb.pro b/config.tests/qpa/directfb/directfb.pro deleted file mode 100644 index b138fd0109..0000000000 --- a/config.tests/qpa/directfb/directfb.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = directfb.cpp -CONFIG -= qt diff --git a/config.tests/qpa/egl-x11/egl-x11.cpp b/config.tests/qpa/egl-x11/egl-x11.cpp deleted file mode 100644 index 9cda661a47..0000000000 --- a/config.tests/qpa/egl-x11/egl-x11.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <EGL/egl.h> -#include <xcb/xcb.h> -#include <X11/Xlib.h> -#include <X11/Xlib-xcb.h> - -// Check if EGL is compatible with X. Some EGL implementations, typically on -// embedded devices, are not intended to be used together with X. EGL support -// has to be disabled in plugins like xcb in this case since the native display, -// window and pixmap types will be different than what an X-based platform -// plugin would expect. - -int main(int, char **) -{ - Display *dpy = EGL_DEFAULT_DISPLAY; - EGLNativeDisplayType egldpy = XOpenDisplay(""); - dpy = egldpy; - EGLNativeWindowType w = XCreateWindow(dpy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - XDestroyWindow(dpy, w); - XCloseDisplay(dpy); - return 0; -} diff --git a/config.tests/qpa/egl-x11/egl-x11.pro b/config.tests/qpa/egl-x11/egl-x11.pro deleted file mode 100644 index fd8479ba35..0000000000 --- a/config.tests/qpa/egl-x11/egl-x11.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = egl-x11.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/egl/egl.cpp b/config.tests/qpa/egl/egl.cpp deleted file mode 100644 index a4ef1f2f0e..0000000000 --- a/config.tests/qpa/egl/egl.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <EGL/egl.h> - -int main(int, char **) -{ - EGLint x = 0; - EGLDisplay dpy = 0; - EGLContext ctx = 0; - eglDestroyContext(dpy, ctx); - return 0; -} diff --git a/config.tests/qpa/egl/egl.pro b/config.tests/qpa/egl/egl.pro deleted file mode 100644 index 2c4ae07e64..0000000000 --- a/config.tests/qpa/egl/egl.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = egl.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp b/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp deleted file mode 100644 index e6ba06f89b..0000000000 --- a/config.tests/qpa/eglfs-brcm/eglfs-brcm.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <EGL/egl.h> -#include <bcm_host.h> - -int main(int, char **) -{ - EGLDisplay dpy = 0; - EGLContext ctx = 0; - eglDestroyContext(dpy, ctx); - vc_dispmanx_display_open(0); - return 0; -} diff --git a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro b/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro deleted file mode 100644 index d4afa460f7..0000000000 --- a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = eglfs-brcm.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp deleted file mode 100644 index fa3e9d33f7..0000000000 --- a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <EGL/egl.h> -#include <EGL/eglext.h> - -int main(int, char **) -{ - EGLDeviceEXT device = 0; - EGLStreamKHR stream = 0; - EGLOutputLayerEXT layer = 0; - return EGL_DRM_CRTC_EXT; -} diff --git a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro b/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro deleted file mode 100644 index 2f20d993f5..0000000000 --- a/config.tests/qpa/eglfs-egldevice/eglfs-egldevice.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = eglfs-egldevice.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp deleted file mode 100644 index f8481bb27c..0000000000 --- a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <EGL/egl.h> -#include <GLES2/gl2.h> - -int main(int, char **) -{ - EGLDisplay dpy = 0; - EGLContext ctx = 0; - mali_native_window *w = 0; - eglDestroyContext(dpy, ctx); - return 0; -} diff --git a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro b/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro deleted file mode 100644 index de6f85f20f..0000000000 --- a/config.tests/qpa/eglfs-mali-2/eglfs-mali-2.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = eglfs-mali-2.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-mali/eglfs-mali.cpp b/config.tests/qpa/eglfs-mali/eglfs-mali.cpp deleted file mode 100644 index 13b10fce02..0000000000 --- a/config.tests/qpa/eglfs-mali/eglfs-mali.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <EGL/fbdev_window.h> -#include <EGL/egl.h> -#include <GLES2/gl2.h> - -int main(int, char **) -{ - EGLDisplay dpy = 0; - EGLContext ctx = 0; - fbdev_window *w = 0; - eglDestroyContext(dpy, ctx); - return 0; -} diff --git a/config.tests/qpa/eglfs-mali/eglfs-mali.pro b/config.tests/qpa/eglfs-mali/eglfs-mali.pro deleted file mode 100644 index 80f8282842..0000000000 --- a/config.tests/qpa/eglfs-mali/eglfs-mali.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = eglfs-mali.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/eglfs-viv/eglfs-viv.cpp b/config.tests/qpa/eglfs-viv/eglfs-viv.cpp deleted file mode 100644 index 1f5c5dbf50..0000000000 --- a/config.tests/qpa/eglfs-viv/eglfs-viv.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <EGL/egl.h> -#include <EGL/eglvivante.h> - -int main(int, char **) -{ -#if defined(__INTEGRITY) - fbGetDisplay(); -#else - // Do not rely on fbGetDisplay() since the signature has changed over time. - // Stick to fbGetDisplayByIndex(). - fbGetDisplayByIndex(0); -#endif - return 0; -} diff --git a/config.tests/qpa/eglfs-viv/eglfs-viv.pro b/config.tests/qpa/eglfs-viv/eglfs-viv.pro deleted file mode 100644 index 2c3dc5cb01..0000000000 --- a/config.tests/qpa/eglfs-viv/eglfs-viv.pro +++ /dev/null @@ -1,7 +0,0 @@ -SOURCES = eglfs-viv.cpp -integrity { - DEFINES += EGL_API_FB=1 -} else { - DEFINES += LINUX=1 EGL_API_FB=1 -} -CONFIG -= qt diff --git a/config.tests/qpa/gbm/gbm.cpp b/config.tests/qpa/gbm/gbm.cpp deleted file mode 100644 index a1f436a7fe..0000000000 --- a/config.tests/qpa/gbm/gbm.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <stdlib.h> -#include <stdint.h> -extern "C" { -#include <gbm.h> -} - -int main(int, char **) -{ - gbm_surface *surface = 0; - return 0; -} diff --git a/config.tests/qpa/gbm/gbm.pro b/config.tests/qpa/gbm/gbm.pro deleted file mode 100644 index 1c08eb4e67..0000000000 --- a/config.tests/qpa/gbm/gbm.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = gbm.cpp -CONFIG -= qt diff --git a/config.tests/qpa/integrityfb/integrityfb.pro b/config.tests/qpa/integrityfb/integrityfb.pro deleted file mode 100644 index 5da4e77923..0000000000 --- a/config.tests/qpa/integrityfb/integrityfb.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = integrityfb.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/integrityhid/integrityhid.cpp b/config.tests/qpa/integrityhid/integrityhid.cpp deleted file mode 100644 index 1493e7c7e4..0000000000 --- a/config.tests/qpa/integrityhid/integrityhid.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <stdlib.h> -#include <stdint.h> -#include <device/hiddriver.h> - -int main(int, char **) -{ - HIDDriver *driver; - uintptr_t devicecontext; - uint32_t device_id; - gh_hid_enum_devices(driver, &device_id, &devicecontext); - - return 0; -} diff --git a/config.tests/qpa/integrityhid/integrityhid.pro b/config.tests/qpa/integrityhid/integrityhid.pro deleted file mode 100644 index 87fafde897..0000000000 --- a/config.tests/qpa/integrityhid/integrityhid.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = integrityhid.cpp -CONFIG -= qt diff --git a/config.tests/qpa/kms/kms.cpp b/config.tests/qpa/kms/kms.cpp deleted file mode 100644 index fbd1bf095d..0000000000 --- a/config.tests/qpa/kms/kms.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <stdlib.h> -#include <stdint.h> -extern "C" { -#include <xf86drmMode.h> -#include <xf86drm.h> -} - -int main(int, char **) -{ - drmModeCrtcPtr currentMode = drmModeGetCrtc(0, 0); - return 0; -} diff --git a/config.tests/qpa/kms/kms.pro b/config.tests/qpa/kms/kms.pro deleted file mode 100644 index c823914308..0000000000 --- a/config.tests/qpa/kms/kms.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = kms.cpp -CONFIG -= qt diff --git a/config.tests/qpa/linuxfb/linuxfb.cpp b/config.tests/qpa/linuxfb/linuxfb.cpp deleted file mode 100644 index ed9f9b242e..0000000000 --- a/config.tests/qpa/linuxfb/linuxfb.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <linux/fb.h> -#include <sys/kd.h> -#include <sys/ioctl.h> - -int main(int, char **) -{ - fb_fix_screeninfo finfo; - fb_var_screeninfo vinfo; - - int fd = 3; - ioctl(fd, FBIOGET_FSCREENINFO, &finfo); - ioctl(fd, FBIOGET_VSCREENINFO, &vinfo); - - return 0; -} diff --git a/config.tests/qpa/linuxfb/linuxfb.pro b/config.tests/qpa/linuxfb/linuxfb.pro deleted file mode 100644 index 45db4b78dd..0000000000 --- a/config.tests/qpa/linuxfb/linuxfb.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = linuxfb.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/mirclient/mirclient.cpp b/config.tests/qpa/mirclient/mirclient.cpp deleted file mode 100644 index c93f8509ef..0000000000 --- a/config.tests/qpa/mirclient/mirclient.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <mir_toolkit/mir_client_library.h> -#include <ubuntu/application/lifecycle_delegate.h> -#include <EGL/egl.h> - -static void surfaceCreateCallback(MirSurface*, void*) -{ -} - - -int main(int, char **) -{ - u_application_lifecycle_delegate_new(); - mir_surface_create(0, surfaceCreateCallback, 0); -} diff --git a/config.tests/qpa/mirclient/mirclient.pro b/config.tests/qpa/mirclient/mirclient.pro deleted file mode 100644 index 3e87194e4e..0000000000 --- a/config.tests/qpa/mirclient/mirclient.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = mirclient.cpp -CONFIG -= qt diff --git a/config.tests/qpa/wayland-server/wayland-server.pro b/config.tests/qpa/wayland-server/wayland-server.pro deleted file mode 100644 index 969bc542bb..0000000000 --- a/config.tests/qpa/wayland-server/wayland-server.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = wl.cpp - -CONFIG -= qt diff --git a/config.tests/qpa/wayland-server/wl.cpp b/config.tests/qpa/wayland-server/wl.cpp deleted file mode 100644 index a5ec3b5150..0000000000 --- a/config.tests/qpa/wayland-server/wl.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <wayland-server.h> - -int main(int, char **) -{ - wl_display_create(); - return 0; -} diff --git a/config.tests/qpa/xcb-glx/xcb-glx.cpp b/config.tests/qpa/xcb-glx/xcb-glx.cpp deleted file mode 100644 index 3e78941f5c..0000000000 --- a/config.tests/qpa/xcb-glx/xcb-glx.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <xcb/xcb.h> -#include <xcb/glx.h> - -int main(int, char **) -{ - int primaryScreen = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - xcb_generic_error_t *error = 0; - xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(connection, - XCB_GLX_MAJOR_VERSION, - XCB_GLX_MINOR_VERSION); - xcb_glx_query_version_reply(connection, xglx_query_cookie, &error); - - return 0; -} diff --git a/config.tests/qpa/xcb-glx/xcb-glx.pro b/config.tests/qpa/xcb-glx/xcb-glx.pro deleted file mode 100644 index 8086e3a388..0000000000 --- a/config.tests/qpa/xcb-glx/xcb-glx.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb-glx.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb-render/xcb-render.cpp b/config.tests/qpa/xcb-render/xcb-render.cpp deleted file mode 100644 index d19a9502bc..0000000000 --- a/config.tests/qpa/xcb-render/xcb-render.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <xcb/xcb.h> -#include <xcb/render.h> - -// 'template' is used as a function argument name in xcb_renderutil.h -#define template template_param -// extern "C" is missing too -extern "C" { -#include <xcb/xcb_renderutil.h> -} -#undef template - -int main(int, char **) -{ - int primaryScreen = 0; - xcb_generic_error_t *error = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - xcb_render_query_pict_formats_cookie_t formatsCookie = - xcb_render_query_pict_formats(connection); - - xcb_render_query_pict_formats_reply_t *formatsReply = - xcb_render_query_pict_formats_reply( - connection, - formatsCookie, - &error); - - xcb_render_util_find_standard_format(formatsReply, - XCB_PICT_STANDARD_ARGB_32); - - return 0; -} diff --git a/config.tests/qpa/xcb-render/xcb-render.pro b/config.tests/qpa/xcb-render/xcb-render.pro deleted file mode 100644 index 7555fa9b61..0000000000 --- a/config.tests/qpa/xcb-render/xcb-render.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb-render.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro b/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro deleted file mode 100644 index 6363ae90ee..0000000000 --- a/config.tests/qpa/xcb-syslibs/xcb-syslibs.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb-syslibs/xcb.cpp b/config.tests/qpa/xcb-syslibs/xcb.cpp deleted file mode 100644 index 00d0da1b6c..0000000000 --- a/config.tests/qpa/xcb-syslibs/xcb.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <xcb/xcb.h> - -// FIXME This workaround can be removed for xcb-icccm > 3.8 -#define class class_name -#include <xcb/xcb_icccm.h> -#undef class - -#include <xcb/xfixes.h> -#include <xcb/xcb_image.h> -#include <xcb/xcb_keysyms.h> -#include <xcb/sync.h> -#include <xcb/randr.h> -#include <xcb/shm.h> - -int main(int, char **) -{ - int primaryScreen = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - - return 0; -} diff --git a/config.tests/qpa/xcb-xkb/xcb-xkb.cpp b/config.tests/qpa/xcb-xkb/xcb-xkb.cpp deleted file mode 100644 index 9685649633..0000000000 --- a/config.tests/qpa/xcb-xkb/xcb-xkb.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <xcb/xcb.h> - -// This is needed to make Qt compile together with XKB. xkb.h is using a variable -// which is called 'explicit', this is a reserved keyword in c++ */ -#define explicit dont_use_cxx_explicit -#include <xcb/xkb.h> -#undef explicit - -int main(int, char **) -{ - int primaryScreen = 0; - - xcb_connection_t *connection = xcb_connect("", &primaryScreen); - - // This takes more arguments in xcb-xkb < 1.10. - xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0); - - // This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY. - int xcbAtomPrimary = XCB_ATOM_PRIMARY; - - return 0; -} diff --git a/config.tests/qpa/xcb-xkb/xcb-xkb.pro b/config.tests/qpa/xcb-xkb/xcb-xkb.pro deleted file mode 100644 index 804be7b894..0000000000 --- a/config.tests/qpa/xcb-xkb/xcb-xkb.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb-xkb.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb-xlib/xcb-xlib.cpp b/config.tests/qpa/xcb-xlib/xcb-xlib.cpp deleted file mode 100644 index 5a850404e1..0000000000 --- a/config.tests/qpa/xcb-xlib/xcb-xlib.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <xcb/xcb.h> -#include <X11/Xlib.h> -#include <X11/Xlib-xcb.h> - -int main(int, char **) -{ - Display *dpy = XOpenDisplay(""); - xcb_connection_t *connection = XGetXCBConnection(dpy); - - return 0; -} diff --git a/config.tests/qpa/xcb-xlib/xcb-xlib.pro b/config.tests/qpa/xcb-xlib/xcb-xlib.pro deleted file mode 100644 index 0e98a00fd0..0000000000 --- a/config.tests/qpa/xcb-xlib/xcb-xlib.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb-xlib.cpp -CONFIG -= qt diff --git a/config.tests/qpa/xcb/xcb.cpp b/config.tests/qpa/xcb/xcb.cpp deleted file mode 100644 index efb4f0ca2e..0000000000 --- a/config.tests/qpa/xcb/xcb.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <xcb/xcb.h> - -int main(int, char **) -{ - int primaryScreen = 0; - xcb_connection_t *t = xcb_connect("", &primaryScreen); - - // This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY. - int xcbAtomPrimary = XCB_ATOM_PRIMARY; - - return 0; -} diff --git a/config.tests/qpa/xcb/xcb.pro b/config.tests/qpa/xcb/xcb.pro deleted file mode 100644 index 6363ae90ee..0000000000 --- a/config.tests/qpa/xcb/xcb.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xcb.cpp -CONFIG -= qt diff --git a/config.tests/unix/stl/stl.pro b/config.tests/stl/stl.pro index 7303e8d31c..91f29a232c 100644 --- a/config.tests/unix/stl/stl.pro +++ b/config.tests/stl/stl.pro @@ -1,2 +1 @@ SOURCES = stltest.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/stl/stltest.cpp b/config.tests/stl/stltest.cpp index a7a36ba0d3..a7a36ba0d3 100644 --- a/config.tests/unix/stl/stltest.cpp +++ b/config.tests/stl/stltest.cpp diff --git a/config.tests/unix/sun-libiconv/sun-libiconv.pro b/config.tests/sun-libiconv/sun-libiconv.pro index 923afc7dd2..d0881b732a 100644 --- a/config.tests/unix/sun-libiconv/sun-libiconv.pro +++ b/config.tests/sun-libiconv/sun-libiconv.pro @@ -1,2 +1 @@ SOURCES = ../gnu-libiconv/gnu-libiconv.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/clock-gettime/clock-gettime.cpp b/config.tests/unix/clock-gettime/clock-gettime.cpp deleted file mode 100644 index 486cdc6b38..0000000000 --- a/config.tests/unix/clock-gettime/clock-gettime.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <unistd.h> -#include <time.h> - -int main(int, char **) -{ -#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(__OpenBSD__) - timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); -#else -# error "Feature _POSIX_TIMERS not available" - // MIPSpro doesn't understand #error, so force a compiler error - force_compiler_error = true; -#endif - return 0; -} - diff --git a/config.tests/unix/clock-gettime/clock-gettime.pro b/config.tests/unix/clock-gettime/clock-gettime.pro deleted file mode 100644 index 985b94e3fe..0000000000 --- a/config.tests/unix/clock-gettime/clock-gettime.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = clock-gettime.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.cpp b/config.tests/unix/clock-monotonic/clock-monotonic.cpp deleted file mode 100644 index 0e75ed5a59..0000000000 --- a/config.tests/unix/clock-monotonic/clock-monotonic.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <unistd.h> -#include <time.h> - -int main(int, char **) -{ -#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0) - timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); -#else -# error "Feature _POSIX_MONOTONIC_CLOCK not available" - // MIPSpro doesn't understand #error, so force a compiler error - force_compiler_error = true; -#endif - return 0; -} - diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.pro b/config.tests/unix/clock-monotonic/clock-monotonic.pro deleted file mode 100644 index 4c421c2413..0000000000 --- a/config.tests/unix/clock-monotonic/clock-monotonic.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = clock-monotonic.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/cloexec/cloexec.cpp b/config.tests/unix/cloexec/cloexec.cpp deleted file mode 100644 index cc6948a280..0000000000 --- a/config.tests/unix/cloexec/cloexec.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#define _GNU_SOURCE 1 - -#include <sys/types.h> -#include <sys/socket.h> -#include <fcntl.h> -#include <unistd.h> - -int main() -{ - int pipes[2]; - (void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK); - (void) fcntl(0, F_DUPFD_CLOEXEC, 0); - (void) dup3(0, 3, O_CLOEXEC); -#if defined(__NetBSD__) - (void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK); -#else - (void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK); -#endif - return 0; -} diff --git a/config.tests/unix/cloexec/cloexec.pro b/config.tests/unix/cloexec/cloexec.pro deleted file mode 100644 index bc735f9b1f..0000000000 --- a/config.tests/unix/cloexec/cloexec.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = cloexec.cpp -CONFIG -= qt -QT = diff --git a/config.tests/unix/cups/cups.cpp b/config.tests/unix/cups/cups.cpp deleted file mode 100644 index 20cdd7e969..0000000000 --- a/config.tests/unix/cups/cups.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <cups/cups.h> - -int main(int, char **) -{ - // CUPS 1.4 test - cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL); - return 0; -} diff --git a/config.tests/unix/cups/cups.pro b/config.tests/unix/cups/cups.pro deleted file mode 100644 index d19ce7d9a6..0000000000 --- a/config.tests/unix/cups/cups.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = cups.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/db2/db2.cpp b/config.tests/unix/db2/db2.cpp deleted file mode 100644 index 98b90f78be..0000000000 --- a/config.tests/unix/db2/db2.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sqlcli.h> -#include <sqlcli1.h> - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/db2/db2.pro b/config.tests/unix/db2/db2.pro deleted file mode 100644 index ef233fc184..0000000000 --- a/config.tests/unix/db2/db2.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = db2.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/dbus/dbus.cpp b/config.tests/unix/dbus/dbus.cpp deleted file mode 100644 index 295c904400..0000000000 --- a/config.tests/unix/dbus/dbus.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#define DBUS_API_SUBJECT_TO_CHANGE -#include <dbus/dbus.h> - -#if DBUS_MAJOR_PROTOCOL_VERSION < 1 -#error Needs at least dbus version 1 -#endif - -int main(int, char **) -{ - dbus_shutdown(); - return 0; -} diff --git a/config.tests/unix/dbus/dbus.pro b/config.tests/unix/dbus/dbus.pro deleted file mode 100644 index f9d793b867..0000000000 --- a/config.tests/unix/dbus/dbus.pro +++ /dev/null @@ -1,8 +0,0 @@ -SOURCES = dbus.cpp -CONFIG -= qt - -CONFIG += build_all -CONFIG(debug, debug|release): \ - LIBS += $$LIBS_DEBUG -else: \ - LIBS += $$LIBS_RELEASE diff --git a/config.tests/unix/dlopen/dlopen.cpp b/config.tests/unix/dlopen/dlopen.cpp deleted file mode 100644 index 454ca3bf72..0000000000 --- a/config.tests/unix/dlopen/dlopen.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <dlfcn.h> - -int main(int, char **) -{ - dlopen(0, 0); -} diff --git a/config.tests/unix/dlopen/dlopen.pro b/config.tests/unix/dlopen/dlopen.pro deleted file mode 100644 index 1d34314332..0000000000 --- a/config.tests/unix/dlopen/dlopen.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = $$PWD/dlopen.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/doubleconversion/doubleconversion.cpp b/config.tests/unix/doubleconversion/doubleconversion.cpp deleted file mode 100644 index c26eef97e5..0000000000 --- a/config.tests/unix/doubleconversion/doubleconversion.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <double-conversion/double-conversion.h> - -int main(int, char **) -{ - int flags = double_conversion::StringToDoubleConverter::NO_FLAGS; - return flags; -} diff --git a/config.tests/unix/doubleconversion/doubleconversion.pro b/config.tests/unix/doubleconversion/doubleconversion.pro deleted file mode 100644 index 8253d0c2a5..0000000000 --- a/config.tests/unix/doubleconversion/doubleconversion.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = doubleconversion.cpp -CONFIG -= qt -CONFIG += console diff --git a/config.tests/unix/evdev/evdev.cpp b/config.tests/unix/evdev/evdev.cpp deleted file mode 100644 index b00b1a8141..0000000000 --- a/config.tests/unix/evdev/evdev.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if defined(__FreeBSD__) -#include <dev/evdev/input.h> -#else -#include <linux/input.h> -#include <linux/kd.h> -#endif - -enum { - e1 = ABS_PRESSURE, - e2 = ABS_X, - e3 = REL_X, - e4 = SYN_REPORT, -}; - -int main() -{ - ::input_event buf[32]; - (void) buf; - return 0; -} diff --git a/config.tests/unix/evdev/evdev.pro b/config.tests/unix/evdev/evdev.pro deleted file mode 100644 index 42db391216..0000000000 --- a/config.tests/unix/evdev/evdev.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = evdev.cpp -CONFIG -= qt diff --git a/config.tests/unix/eventfd/eventfd.pro b/config.tests/unix/eventfd/eventfd.pro deleted file mode 100644 index de99717750..0000000000 --- a/config.tests/unix/eventfd/eventfd.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = main.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/eventfd/main.cpp b/config.tests/unix/eventfd/main.cpp deleted file mode 100644 index 0f65fe7e2b..0000000000 --- a/config.tests/unix/eventfd/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sys/eventfd.h> - -int main() -{ - eventfd_t value; - int fd = eventfd(0, EFD_CLOEXEC); - eventfd_read(fd, &value); - eventfd_write(fd, value); - return 0; -} diff --git a/config.tests/unix/fontconfig/fontconfig.cpp b/config.tests/unix/fontconfig/fontconfig.cpp deleted file mode 100644 index 49c0d94a1e..0000000000 --- a/config.tests/unix/fontconfig/fontconfig.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <ft2build.h> -#include FT_FREETYPE_H -#include <fontconfig/fontconfig.h> - -#ifndef FC_RGBA_UNKNOWN -# error "This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define" -#endif - -#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20110) -# error "This version of freetype is too old." -#endif - -int main(int, char **) -{ - FT_Face face; - face = 0; - FcPattern *pattern; - pattern = 0; - return 0; -} diff --git a/config.tests/unix/fontconfig/fontconfig.pro b/config.tests/unix/fontconfig/fontconfig.pro deleted file mode 100644 index d6fd00aa3c..0000000000 --- a/config.tests/unix/fontconfig/fontconfig.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = fontconfig.cpp -CONFIG -= qt diff --git a/config.tests/unix/freetype/freetype.cpp b/config.tests/unix/freetype/freetype.cpp deleted file mode 100644 index c051600b02..0000000000 --- a/config.tests/unix/freetype/freetype.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <ft2build.h> -#include FT_FREETYPE_H - -#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20200) -# error "This version of freetype is too old." -#endif - -int main(int, char **) -{ - FT_Face face; - face = 0; - return 0; -} diff --git a/config.tests/unix/freetype/freetype.pro b/config.tests/unix/freetype/freetype.pro deleted file mode 100644 index 525b60121b..0000000000 --- a/config.tests/unix/freetype/freetype.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = freetype.cpp -CONFIG -= qt diff --git a/config.tests/unix/getaddrinfo/getaddrinfo.pro b/config.tests/unix/getaddrinfo/getaddrinfo.pro deleted file mode 100644 index 18e40971e5..0000000000 --- a/config.tests/unix/getaddrinfo/getaddrinfo.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = getaddrinfotest.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/getaddrinfo/getaddrinfotest.cpp b/config.tests/unix/getaddrinfo/getaddrinfotest.cpp deleted file mode 100644 index b4deaae91e..0000000000 --- a/config.tests/unix/getaddrinfo/getaddrinfotest.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* Sample program for configure to test for getaddrinfo on the unix - platform. we check for all structures and functions required. */ - -#include <stdio.h> -#include <stdlib.h> -#ifdef __MINGW32__ -#include <winsock2.h> -#include <ws2tcpip.h> -#else -#include <sys/types.h> -#include <sys/socket.h> -#include <netdb.h> -#endif - -int main() -{ - addrinfo *res = 0; - if (getaddrinfo("foo", 0, 0, &res) == 0) - freeaddrinfo(res); - gai_strerror(0); - - return 0; -} diff --git a/config.tests/unix/getifaddrs/getifaddrs.cpp b/config.tests/unix/getifaddrs/getifaddrs.cpp deleted file mode 100644 index ad1ecc3fb2..0000000000 --- a/config.tests/unix/getifaddrs/getifaddrs.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* Sample program for configure to test for if_nametoindex support -on target platforms. */ - -#if defined(__hpux) -#define _HPUX_SOURCE -#endif - -#include <sys/types.h> -#include <sys/socket.h> -#include <net/if.h> -#include <ifaddrs.h> - -int main() -{ - ifaddrs *list; - getifaddrs(&list); - freeifaddrs(list); - return 0; -} diff --git a/config.tests/unix/getifaddrs/getifaddrs.pro b/config.tests/unix/getifaddrs/getifaddrs.pro deleted file mode 100644 index db2956a338..0000000000 --- a/config.tests/unix/getifaddrs/getifaddrs.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = getifaddrs.cpp -CONFIG -= qt -QT = diff --git a/config.tests/unix/glib/glib.cpp b/config.tests/unix/glib/glib.cpp deleted file mode 100644 index 63456c662d..0000000000 --- a/config.tests/unix/glib/glib.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -typedef struct _GMainContext GMainContext; - -#include <glib.h> - -int main(int, char **) -{ - GMainContext *context; - GSource *source; - GPollFD *pollfd = NULL; - if (!g_thread_supported()) - g_thread_init(NULL); - context = g_main_context_default(); - (void)context; - source = g_source_new(0, 0); - g_source_add_poll(source, pollfd); - return 0; -} diff --git a/config.tests/unix/glib/glib.pro b/config.tests/unix/glib/glib.pro deleted file mode 100644 index 15d059df77..0000000000 --- a/config.tests/unix/glib/glib.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = glib.cpp -CONFIG -= qt diff --git a/config.tests/unix/harfbuzz/harfbuzz.cpp b/config.tests/unix/harfbuzz/harfbuzz.cpp deleted file mode 100644 index d1d0530423..0000000000 --- a/config.tests/unix/harfbuzz/harfbuzz.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <harfbuzz/hb.h> - -#if !HB_VERSION_ATLEAST(0, 9, 42) -# error "This version of harfbuzz is too old." -#endif - -int main(int, char **) -{ - hb_buffer_t *buffer = hb_buffer_create(); - - const uint16_t string[] = { 'A', 'b', 'c' }; - hb_buffer_add_utf16(buffer, string, 3, 0, 3); - hb_buffer_guess_segment_properties(buffer); - hb_buffer_set_flags(buffer, hb_buffer_flags_t(HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES)); - - hb_buffer_destroy(buffer); - - return 0; -} diff --git a/config.tests/unix/harfbuzz/harfbuzz.pro b/config.tests/unix/harfbuzz/harfbuzz.pro deleted file mode 100644 index 71a7c355cb..0000000000 --- a/config.tests/unix/harfbuzz/harfbuzz.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = harfbuzz.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/ibase/ibase.cpp b/config.tests/unix/ibase/ibase.cpp deleted file mode 100644 index c1e2a24b51..0000000000 --- a/config.tests/unix/ibase/ibase.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <ibase.h> - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/ibase/ibase.pro b/config.tests/unix/ibase/ibase.pro deleted file mode 100644 index 8c47f66954..0000000000 --- a/config.tests/unix/ibase/ibase.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = ibase.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/icu/icu.cpp b/config.tests/unix/icu/icu.cpp deleted file mode 100644 index e74de43980..0000000000 --- a/config.tests/unix/icu/icu.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <unicode/utypes.h> -#include <unicode/ucol.h> -#include <unicode/ustring.h> - -int main(int, char **) -{ - UErrorCode status = U_ZERO_ERROR; - UCollator *collator = ucol_open("ru_RU", &status); - if (U_FAILURE(status)) - return 0; - ucol_close(collator); - return 0; -} diff --git a/config.tests/unix/icu/icu.pro b/config.tests/unix/icu/icu.pro deleted file mode 100644 index eeed0eaff3..0000000000 --- a/config.tests/unix/icu/icu.pro +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES = icu.cpp -CONFIG += console -CONFIG -= qt dylib - -CONFIG += build_all -CONFIG(debug, debug|release): \ - LIBS += $$LIBS_DEBUG -else: \ - LIBS += $$LIBS_RELEASE diff --git a/config.tests/unix/inotify/inotify.pro b/config.tests/unix/inotify/inotify.pro deleted file mode 100644 index 35880de3c0..0000000000 --- a/config.tests/unix/inotify/inotify.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = inotifytest.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/inotify/inotifytest.cpp b/config.tests/unix/inotify/inotifytest.cpp deleted file mode 100644 index cb43bc81b7..0000000000 --- a/config.tests/unix/inotify/inotifytest.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sys/inotify.h> - -int main() -{ - inotify_init(); - inotify_add_watch(0, "foobar", IN_ACCESS); - inotify_rm_watch(0, 1); - return 0; -} diff --git a/config.tests/unix/ipc_posix/ipc.cpp b/config.tests/unix/ipc_posix/ipc.cpp deleted file mode 100644 index 9d14145ea2..0000000000 --- a/config.tests/unix/ipc_posix/ipc.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sys/types.h> -#include <sys/mman.h> -#include <semaphore.h> -#include <fcntl.h> - -int main(int, char **) -{ - sem_t *semaphore = sem_open("test", O_CREAT | O_EXCL, 0666, 0); - if (semaphore != SEM_FAILED) - sem_close(semaphore); - - shm_open("test", O_RDWR | O_CREAT | O_EXCL, 0666); - shm_unlink("test"); - - return 0; -} diff --git a/config.tests/unix/ipc_posix/ipc_posix.pro b/config.tests/unix/ipc_posix/ipc_posix.pro deleted file mode 100644 index a8bcb397bb..0000000000 --- a/config.tests/unix/ipc_posix/ipc_posix.pro +++ /dev/null @@ -1,4 +0,0 @@ -SOURCES = ipc.cpp -CONFIG -= qt dylib -mac:CONFIG -= app_bundle -linux:LIBS += -lpthread -lrt diff --git a/config.tests/unix/ipc_sysv/ipc.cpp b/config.tests/unix/ipc_sysv/ipc.cpp deleted file mode 100644 index deb57622ba..0000000000 --- a/config.tests/unix/ipc_sysv/ipc.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sys/types.h> -#include <sys/ipc.h> -#include <sys/sem.h> -#include <sys/shm.h> -#include <fcntl.h> - -int main(int, char **) -{ - key_t unix_key = ftok("test", 'Q'); - int semaphore = semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL); - if (semaphore != -1) - semctl(semaphore, 0, IPC_RMID, 0); - - shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL); - shmctl(0, 0, static_cast<struct shmid_ds *>(0)); - - return 0; -} diff --git a/config.tests/unix/ipc_sysv/ipc_sysv.pro b/config.tests/unix/ipc_sysv/ipc_sysv.pro deleted file mode 100644 index 1b6de0296f..0000000000 --- a/config.tests/unix/ipc_sysv/ipc_sysv.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = ipc.cpp -CONFIG -= qt dylib -mac:CONFIG -= app_bundle diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.cpp b/config.tests/unix/ipv6ifname/ipv6ifname.cpp deleted file mode 100644 index bf2fe6f6ae..0000000000 --- a/config.tests/unix/ipv6ifname/ipv6ifname.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* Sample program for configure to test for if_nametoindex support -on target platforms. */ - -#if defined(__hpux) -#define _HPUX_SOURCE -#endif - -#include <sys/types.h> -#include <sys/socket.h> -#include <net/if.h> - -int main() -{ - char buf[IFNAMSIZ]; - if_nametoindex("eth0"); - if_indextoname(1, buf); - return 0; -} diff --git a/config.tests/unix/ipv6ifname/ipv6ifname.pro b/config.tests/unix/ipv6ifname/ipv6ifname.pro deleted file mode 100644 index 7574dce180..0000000000 --- a/config.tests/unix/ipv6ifname/ipv6ifname.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = ipv6ifname.cpp -CONFIG -= qt -QT = diff --git a/config.tests/unix/journald/journald.c b/config.tests/unix/journald/journald.c deleted file mode 100644 index 6b14cd7c69..0000000000 --- a/config.tests/unix/journald/journald.c +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Jolla Ltd, author: <robin.burchell@jollamobile.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <systemd/sd-journal.h> -#include <syslog.h> - -int main(int argc, char **argv) -{ - sd_journal_send("MESSAGE=%s", "test message", - "PRIORITY=%i", LOG_INFO, - "CODE_FUNC=%s", "unknown", - "CODE_LINE=%d", 0, - "CODE_FILE=%s", "foo.c", - NULL); - return 0; -} diff --git a/config.tests/unix/journald/journald.pro b/config.tests/unix/journald/journald.pro deleted file mode 100644 index deb28ae97f..0000000000 --- a/config.tests/unix/journald/journald.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = journald.c - -CONFIG -= qt diff --git a/config.tests/unix/lgmon/lgmon.cpp b/config.tests/unix/lgmon/lgmon.cpp deleted file mode 100644 index 2f3800a422..0000000000 --- a/config.tests/unix/lgmon/lgmon.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2014 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <lgmon.h> - -int main(int, char **) -{ - lgmon_supported(getpid()); - return 0; -} - diff --git a/config.tests/unix/lgmon/lgmon.pro b/config.tests/unix/lgmon/lgmon.pro deleted file mode 100644 index 33633b19f8..0000000000 --- a/config.tests/unix/lgmon/lgmon.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = lgmon.cpp -CONFIG -= qt diff --git a/config.tests/unix/libinput/libinput.cpp b/config.tests/unix/libinput/libinput.cpp deleted file mode 100644 index 87bfe5c889..0000000000 --- a/config.tests/unix/libinput/libinput.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <libinput.h> - -int main() -{ - libinput_udev_create_context(NULL, NULL, NULL); - return 0; -} diff --git a/config.tests/unix/libinput/libinput.pro b/config.tests/unix/libinput/libinput.pro deleted file mode 100644 index 941a0b73ef..0000000000 --- a/config.tests/unix/libinput/libinput.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libinput.cpp -CONFIG -= qt diff --git a/config.tests/unix/libinput_axis_api/libinput_axis_api.cpp b/config.tests/unix/libinput_axis_api/libinput_axis_api.cpp deleted file mode 100644 index d469b8920e..0000000000 --- a/config.tests/unix/libinput_axis_api/libinput_axis_api.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <libinput.h> - -int main() -{ - libinput_event_pointer_has_axis(nullptr, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); - return 0; -} diff --git a/config.tests/unix/libinput_axis_api/libinput_axis_api.pro b/config.tests/unix/libinput_axis_api/libinput_axis_api.pro deleted file mode 100644 index 7221e62792..0000000000 --- a/config.tests/unix/libinput_axis_api/libinput_axis_api.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libinput_axis_api.cpp -CONFIG -= qt diff --git a/config.tests/unix/libjpeg/libjpeg.cpp b/config.tests/unix/libjpeg/libjpeg.cpp deleted file mode 100644 index 106043c608..0000000000 --- a/config.tests/unix/libjpeg/libjpeg.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sys/types.h> -#include <stdio.h> -extern "C" { -#include <jpeglib.h> -} - -j_compress_ptr cinfo; - -int main(int, char **) -{ - jpeg_create_compress(cinfo); - return 0; -} diff --git a/config.tests/unix/libjpeg/libjpeg.pro b/config.tests/unix/libjpeg/libjpeg.pro deleted file mode 100644 index 173249c634..0000000000 --- a/config.tests/unix/libjpeg/libjpeg.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libjpeg.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/libpng/libpng.cpp b/config.tests/unix/libpng/libpng.cpp deleted file mode 100644 index 6808b5fcb3..0000000000 --- a/config.tests/unix/libpng/libpng.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <png.h> - -#if !defined(PNG_LIBPNG_VER) || PNG_LIBPNG_VER < 10017 -# error "Required libpng version 1.0.17 not found." -#endif - -int main(int, char **) -{ - png_structp png_ptr; - png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0); - return 0; -} diff --git a/config.tests/unix/libpng/libpng.pro b/config.tests/unix/libpng/libpng.pro deleted file mode 100644 index 72e5e77b06..0000000000 --- a/config.tests/unix/libpng/libpng.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libpng.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/libudev/libudev.cpp b/config.tests/unix/libudev/libudev.cpp deleted file mode 100644 index 6636f49732..0000000000 --- a/config.tests/unix/libudev/libudev.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <libudev.h> - -int main() -{ - udev *u = udev_new(); - udev_unref(u); - return 0; -} diff --git a/config.tests/unix/libudev/libudev.pro b/config.tests/unix/libudev/libudev.pro deleted file mode 100644 index b557e7b17b..0000000000 --- a/config.tests/unix/libudev/libudev.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = libudev.cpp -CONFIG -= qt diff --git a/config.tests/unix/mtdev/mtdev.cpp b/config.tests/unix/mtdev/mtdev.cpp deleted file mode 100644 index bda6b06fda..0000000000 --- a/config.tests/unix/mtdev/mtdev.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Jolla Ltd, author: <robin.burchell@jollamobile.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <mtdev.h> - -int main(int, char **) -{ - mtdev m; - mtdev_open(&m, 0); - return 0; -} diff --git a/config.tests/unix/mtdev/mtdev.pro b/config.tests/unix/mtdev/mtdev.pro deleted file mode 100644 index 14111c6dc6..0000000000 --- a/config.tests/unix/mtdev/mtdev.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = mtdev.cpp - -CONFIG -= qt diff --git a/config.tests/unix/mysql/mysql.cpp b/config.tests/unix/mysql/mysql.cpp deleted file mode 100644 index 3f83cb1e68..0000000000 --- a/config.tests/unix/mysql/mysql.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) -#include <windows.h> -#endif - -#include "mysql.h" - -int main(int, char **) -{ - mysql_get_client_version(); - return 0; -} diff --git a/config.tests/unix/mysql/mysql.pro b/config.tests/unix/mysql/mysql.pro deleted file mode 100644 index 745f9ee0fb..0000000000 --- a/config.tests/unix/mysql/mysql.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = mysql.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/objcopy/objcopy.cpp b/config.tests/unix/objcopy/objcopy.cpp deleted file mode 100644 index 8e8ff43ae9..0000000000 --- a/config.tests/unix/objcopy/objcopy.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -int main() -{ - return 0; -} diff --git a/config.tests/unix/objcopy/objcopy.pro b/config.tests/unix/objcopy/objcopy.pro deleted file mode 100644 index 3c76ae92ef..0000000000 --- a/config.tests/unix/objcopy/objcopy.pro +++ /dev/null @@ -1,7 +0,0 @@ -SOURCES = objcopy.cpp -CONFIG -= qt -TARGET = objcopytest - -load(resolve_target) - -QMAKE_POST_LINK += $$QMAKE_OBJCOPY --only-keep-debug $$QMAKE_RESOLVED_TARGET objcopytest.debug && $$QMAKE_OBJCOPY --strip-debug $$QMAKE_RESOLVED_TARGET && $$QMAKE_OBJCOPY --add-gnu-debuglink=objcopytest.debug $$QMAKE_RESOLVED_TARGET diff --git a/config.tests/unix/oci/oci.cpp b/config.tests/unix/oci/oci.cpp deleted file mode 100644 index 0a73d06c7c..0000000000 --- a/config.tests/unix/oci/oci.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <oci.h> - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/oci/oci.pro b/config.tests/unix/oci/oci.pro deleted file mode 100644 index c9aec08ee0..0000000000 --- a/config.tests/unix/oci/oci.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = oci.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/odbc/odbc.cpp b/config.tests/unix/odbc/odbc.cpp deleted file mode 100644 index fc36f121c4..0000000000 --- a/config.tests/unix/odbc/odbc.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) -#include <windows.h> -#endif -#include <sql.h> -#include <sqlext.h> - -int main(int, char **) -{ - SQLHANDLE env; - SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env); - return 0; -} diff --git a/config.tests/unix/odbc/odbc.pro b/config.tests/unix/odbc/odbc.pro deleted file mode 100644 index 6c72dc7b1c..0000000000 --- a/config.tests/unix/odbc/odbc.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = odbc.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/opengldesktop/opengldesktop.cpp b/config.tests/unix/opengldesktop/opengldesktop.cpp deleted file mode 100644 index 0a5ce4e78c..0000000000 --- a/config.tests/unix/opengldesktop/opengldesktop.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifdef __APPLE__ -#include <OpenGL/gl.h> -#else -#define GL_GLEXT_PROTOTYPES -#include <GL/gl.h> -#endif - -int main(int, char **) -{ - glBegin(GL_TRIANGLES); - glVertex2f(20.0f, 10.0f); - glVertex2f(10.0f, 30.0f); - glVertex2f(20.0f, 50.0f); - glEnd(); - return 0; -} diff --git a/config.tests/unix/opengldesktop/opengldesktop.pro b/config.tests/unix/opengldesktop/opengldesktop.pro deleted file mode 100644 index 22c0be247d..0000000000 --- a/config.tests/unix/opengldesktop/opengldesktop.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES = opengldesktop.cpp - -CONFIG -= qt - -mac:DEFINES += Q_OS_MAC diff --git a/config.tests/unix/opengles2/opengles2.cpp b/config.tests/unix/opengles2/opengles2.cpp deleted file mode 100644 index a9ad0d6766..0000000000 --- a/config.tests/unix/opengles2/opengles2.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifdef BUILD_ON_MAC - #include <OpenGLES/ES2/gl.h> -#else - #define GL_GLEXT_PROTOTYPES - #include <GLES2/gl2.h> -#endif - -int main(int, char **) -{ - glUniform1f(1, GLfloat(1.0)); - glClear(GL_COLOR_BUFFER_BIT); - - return 0; -} diff --git a/config.tests/unix/opengles2/opengles2.pro b/config.tests/unix/opengles2/opengles2.pro deleted file mode 100644 index c84563f62e..0000000000 --- a/config.tests/unix/opengles2/opengles2.pro +++ /dev/null @@ -1,7 +0,0 @@ -SOURCES = opengles2.cpp - -CONFIG -= qt - -mac { - DEFINES += BUILD_ON_MAC -} diff --git a/config.tests/unix/opengles3/opengles3.cpp b/config.tests/unix/opengles3/opengles3.cpp deleted file mode 100644 index b5bf9b4a80..0000000000 --- a/config.tests/unix/opengles3/opengles3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifdef BUILD_ON_MAC - #include <OpenGLES/ES3/gl.h> -#else - #define GL_GLEXT_PROTOTYPES - #include <GLES3/gl3.h> -#endif - -int main(int, char **) -{ - glGetStringi(GL_EXTENSIONS, 0); - glReadBuffer(GL_COLOR_ATTACHMENT1); - static GLfloat f[6]; - glUniformMatrix2x3fv(0, 0, GL_FALSE, f); - glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); - - return 0; -} diff --git a/config.tests/unix/opengles3/opengles3.pro b/config.tests/unix/opengles3/opengles3.pro deleted file mode 100644 index 956a3bc102..0000000000 --- a/config.tests/unix/opengles3/opengles3.pro +++ /dev/null @@ -1,11 +0,0 @@ -# The library is expected to be the same as in ES 2.0 (libGLESv2). -# The difference is the header and the presence of the functions in -# the library. - -SOURCES = opengles3.cpp - -CONFIG -= qt - -mac { - DEFINES += BUILD_ON_MAC -} diff --git a/config.tests/unix/opengles31/opengles31.cpp b/config.tests/unix/opengles31/opengles31.cpp deleted file mode 100644 index dbc7eb3b29..0000000000 --- a/config.tests/unix/opengles31/opengles31.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <GLES3/gl31.h> - -int main(int, char **) -{ - glDispatchCompute(1, 1, 1); - glProgramUniform1i(0, 0, 0); - - return 0; -} diff --git a/config.tests/unix/opengles31/opengles31.pro b/config.tests/unix/opengles31/opengles31.pro deleted file mode 100644 index 7895be9efc..0000000000 --- a/config.tests/unix/opengles31/opengles31.pro +++ /dev/null @@ -1,7 +0,0 @@ -# The library is expected to be the same as in ES 2.0 (libGLESv2). -# The difference is the header and the presence of the functions in -# the library. - -SOURCES = opengles31.cpp - -CONFIG -= qt diff --git a/config.tests/unix/openvg/openvg.cpp b/config.tests/unix/openvg/openvg.cpp deleted file mode 100644 index f9cf7786ab..0000000000 --- a/config.tests/unix/openvg/openvg.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <VG/openvg.h> - - -int main(int, char **) -{ - VGint i; - i = 2; - vgFlush(); - return 0; -} diff --git a/config.tests/unix/openvg/openvg.pro b/config.tests/unix/openvg/openvg.pro deleted file mode 100644 index 1933e3789c..0000000000 --- a/config.tests/unix/openvg/openvg.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES += openvg.cpp - -CONFIG -= qt diff --git a/config.tests/unix/pcre2/pcre2.cpp b/config.tests/unix/pcre2/pcre2.cpp deleted file mode 100644 index 9c94d29999..0000000000 --- a/config.tests/unix/pcre2/pcre2.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#define PCRE2_CODE_UNIT_WIDTH 16 - -#include <pcre2.h> - -#if (PCRE2_MAJOR < 10) || ((PCRE2_MAJOR == 10) && (PCRE2_MINOR < 20)) -#error This PCRE version is not supported -#endif - -int main(int, char **) -{ - return 0; -} - diff --git a/config.tests/unix/pcre2/pcre2.pro b/config.tests/unix/pcre2/pcre2.pro deleted file mode 100644 index 6a3fc275bc..0000000000 --- a/config.tests/unix/pcre2/pcre2.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = pcre2.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/poll/poll.cpp b/config.tests/unix/poll/poll.cpp deleted file mode 100644 index ad33900a63..0000000000 --- a/config.tests/unix/poll/poll.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <poll.h> - -int main() -{ - struct pollfd pfd; - - pfd.fd = -1; - pfd.events = 0; - pfd.revents = 0; - - return ::poll(&pfd, 1, 0); -} diff --git a/config.tests/unix/poll/poll.pro b/config.tests/unix/poll/poll.pro deleted file mode 100644 index 70121b4586..0000000000 --- a/config.tests/unix/poll/poll.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = poll.cpp -CONFIG -= qt diff --git a/config.tests/unix/pollts/pollts.cpp b/config.tests/unix/pollts/pollts.cpp deleted file mode 100644 index ce5db6a37b..0000000000 --- a/config.tests/unix/pollts/pollts.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <poll.h> -#include <signal.h> -#include <time.h> - -int main() -{ - struct pollfd pfd; - struct timespec ts; - - pfd.fd = -1; - pfd.events = 0; - pfd.revents = 0; - - ts.tv_sec = 0; - ts.tv_nsec = 0; - - return ::pollts(&pfd, 1, &ts, nullptr); -} diff --git a/config.tests/unix/pollts/pollts.pro b/config.tests/unix/pollts/pollts.pro deleted file mode 100644 index 5109dc33fd..0000000000 --- a/config.tests/unix/pollts/pollts.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = pollts.cpp -CONFIG -= qt diff --git a/config.tests/unix/posix_fallocate/posix_fallocate.cpp b/config.tests/unix/posix_fallocate/posix_fallocate.cpp deleted file mode 100644 index ce1286813a..0000000000 --- a/config.tests/unix/posix_fallocate/posix_fallocate.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <fcntl.h> -// NetBSD 7 has posix_fallocate, but in unistd.h instead of fcntl.h -#ifdef __NetBSD__ -# include <unistd.h> -#endif - -int main(int, char **) -{ - return ::posix_fallocate(0, 0, 0); -} diff --git a/config.tests/unix/posix_fallocate/posix_fallocate.pro b/config.tests/unix/posix_fallocate/posix_fallocate.pro deleted file mode 100644 index f01b15f3d7..0000000000 --- a/config.tests/unix/posix_fallocate/posix_fallocate.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = posix_fallocate.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/ppoll/ppoll.cpp b/config.tests/unix/ppoll/ppoll.cpp deleted file mode 100644 index 9e065afadc..0000000000 --- a/config.tests/unix/ppoll/ppoll.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <signal.h> -#include <poll.h> - -int main() -{ - struct pollfd pfd; - struct timespec ts; - - pfd.fd = -1; - pfd.events = 0; - pfd.revents = 0; - - ts.tv_sec = 0; - ts.tv_nsec = 0; - - return ::ppoll(&pfd, 1, &ts, nullptr); -} diff --git a/config.tests/unix/ppoll/ppoll.pro b/config.tests/unix/ppoll/ppoll.pro deleted file mode 100644 index d08a8a0679..0000000000 --- a/config.tests/unix/ppoll/ppoll.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = ppoll.cpp -CONFIG -= qt diff --git a/config.tests/unix/pps/pps.cpp b/config.tests/unix/pps/pps.cpp deleted file mode 100644 index fba0673bf1..0000000000 --- a/config.tests/unix/pps/pps.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sys/pps.h> - -int main(int, char **) -{ - pps_decoder_t decoder; - - pps_decoder_initialize(&decoder, NULL); - return 0; -} diff --git a/config.tests/unix/pps/pps.pro b/config.tests/unix/pps/pps.pro deleted file mode 100644 index af9b339f97..0000000000 --- a/config.tests/unix/pps/pps.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = pps.cpp -CONFIG -= qt diff --git a/config.tests/unix/psql/psql.cpp b/config.tests/unix/psql/psql.cpp deleted file mode 100644 index 8d40d84c9e..0000000000 --- a/config.tests/unix/psql/psql.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "libpq-fe.h" - -int main(int, char **) -{ - PQescapeBytea(0, 0, 0); - PQunescapeBytea(0, 0); - return 0; -} diff --git a/config.tests/unix/psql/psql.pro b/config.tests/unix/psql/psql.pro deleted file mode 100644 index dae7375be5..0000000000 --- a/config.tests/unix/psql/psql.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = psql.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/qqnx_imf/qqnx_imf.cpp b/config.tests/unix/qqnx_imf/qqnx_imf.cpp deleted file mode 100644 index 5af5fb627c..0000000000 --- a/config.tests/unix/qqnx_imf/qqnx_imf.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 BlackBerry Limited. All rights reserved. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "imf/imf_client.h" - -int main(int, char **) -{ - imf_client_init(); - return 0; -} diff --git a/config.tests/unix/qqnx_imf/qqnx_imf.pro b/config.tests/unix/qqnx_imf/qqnx_imf.pro deleted file mode 100644 index e1a2d9cecb..0000000000 --- a/config.tests/unix/qqnx_imf/qqnx_imf.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = qqnx_imf.cpp -CONFIG -= qt diff --git a/config.tests/unix/reduce_exports/fvisibility.c b/config.tests/unix/reduce_exports/fvisibility.c deleted file mode 100644 index 71af9d99a3..0000000000 --- a/config.tests/unix/reduce_exports/fvisibility.c +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if defined(__GNUC__) -# if (__GNUC__ < 4) -# error "GCC3 with backported visibility patch is known to miscompile Qt" -# endif -__attribute((visibility("default"))) void blah(); -#elif defined(__SUNPRO_CC) -# if (__SUNPRO_CC < 0x0550) -# error "SunStudio 8 or later is required for ELF visibility" -# endif -__global void blah(); -#else -# error "GCC4+ or SunStudio 8+ are required to support ELF visibility" -#endif diff --git a/config.tests/unix/reduce_exports/reduce_exports.pro b/config.tests/unix/reduce_exports/reduce_exports.pro deleted file mode 100644 index dc8adc2637..0000000000 --- a/config.tests/unix/reduce_exports/reduce_exports.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE = lib -CONFIG += dll hide_symbols -SOURCES = fvisibility.c - -isEmpty(QMAKE_CFLAGS_HIDESYMS): error("Nope") diff --git a/config.tests/unix/reduce_relocs/bsymbolic_functions.c b/config.tests/unix/reduce_relocs/bsymbolic_functions.c deleted file mode 100644 index 36ff410c81..0000000000 --- a/config.tests/unix/reduce_relocs/bsymbolic_functions.c +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64)) -# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129). -#endif - -int main() { return 0; } diff --git a/config.tests/unix/reduce_relocs/reduce_relocs.pro b/config.tests/unix/reduce_relocs/reduce_relocs.pro deleted file mode 100644 index 2f23465a3f..0000000000 --- a/config.tests/unix/reduce_relocs/reduce_relocs.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE = lib -CONFIG += dll bsymbolic_functions -SOURCES = bsymbolic_functions.c - -isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope") diff --git a/config.tests/unix/sctp/sctp.cpp b/config.tests/unix/sctp/sctp.cpp deleted file mode 100644 index 61c33d5fc5..0000000000 --- a/config.tests/unix/sctp/sctp.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - Sample program for configure to test for SCTP sockets support - on target platforms. -*/ - -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netinet/sctp.h> - -int main() -{ - int fd; - sctp_initmsg sctpInitMsg; - socklen_t sctpInitMsgSize = sizeof(sctpInitMsg); - - fd = socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP); - if (fd == -1 || getsockopt(fd, SOL_SCTP, SCTP_INITMSG, &sctpInitMsg, - &sctpInitMsgSize) != 0) - return 1; - - return 0; -} diff --git a/config.tests/unix/sctp/sctp.pro b/config.tests/unix/sctp/sctp.pro deleted file mode 100644 index 2138254732..0000000000 --- a/config.tests/unix/sctp/sctp.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = sctp.cpp -CONFIG -= qt -QT = diff --git a/config.tests/unix/slog2/slog2.cpp b/config.tests/unix/slog2/slog2.cpp deleted file mode 100644 index 351829ea99..0000000000 --- a/config.tests/unix/slog2/slog2.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 - 2012 Research In Motion -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <slog2.h> - -int main(int, char **) -{ - slog2_set_default_buffer((slog2_buffer_t)-1); - return 0; -} diff --git a/config.tests/unix/slog2/slog2.pro b/config.tests/unix/slog2/slog2.pro deleted file mode 100644 index 269a88a383..0000000000 --- a/config.tests/unix/slog2/slog2.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = slog2.cpp -CONFIG -= qt diff --git a/config.tests/unix/sqlite/sqlite.cpp b/config.tests/unix/sqlite/sqlite.cpp deleted file mode 100644 index dd17f74101..0000000000 --- a/config.tests/unix/sqlite/sqlite.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sqlite3.h> - -int main(int, char **) -{ - sqlite3_open_v2(0, 0, 0, 0); - return 0; -} diff --git a/config.tests/unix/sqlite/sqlite.pro b/config.tests/unix/sqlite/sqlite.pro deleted file mode 100644 index 4b24e014ba..0000000000 --- a/config.tests/unix/sqlite/sqlite.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = sqlite.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/sqlite2/sqlite2.cpp b/config.tests/unix/sqlite2/sqlite2.cpp deleted file mode 100644 index 1c1058052a..0000000000 --- a/config.tests/unix/sqlite2/sqlite2.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sqlite.h> - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/sqlite2/sqlite2.pro b/config.tests/unix/sqlite2/sqlite2.pro deleted file mode 100644 index b1252721dc..0000000000 --- a/config.tests/unix/sqlite2/sqlite2.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = sqlite2.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/stack-protector/stack-protector.cpp b/config.tests/unix/stack-protector/stack-protector.cpp deleted file mode 100644 index 8b3926fe1f..0000000000 --- a/config.tests/unix/stack-protector/stack-protector.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if defined(__QNXNTO__) -#include <sys/neutrino.h> - -#if _NTO_VERSION < 700 -#error stack-protector not used (by default) before QNX 7.0.0. -#endif - -#endif - -int main() -{ - return 0; -} diff --git a/config.tests/unix/stack-protector/stack-protector.pro b/config.tests/unix/stack-protector/stack-protector.pro deleted file mode 100644 index ac84d7f148..0000000000 --- a/config.tests/unix/stack-protector/stack-protector.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = stack-protector.cpp -QMAKE_CXXFLAGS += -fstack-protector-strong diff --git a/config.tests/unix/syslog/syslog.c b/config.tests/unix/syslog/syslog.c deleted file mode 100644 index aaf0fe7509..0000000000 --- a/config.tests/unix/syslog/syslog.c +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Tasuku Suzuki <stasuku@gmail.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <syslog.h> - -int main(int argc, char **argv) -{ - openlog("qt", 0, LOG_USER); - syslog(LOG_INFO, "configure"); - closelog(); - return 0; -} diff --git a/config.tests/unix/syslog/syslog.pro b/config.tests/unix/syslog/syslog.pro deleted file mode 100644 index abe8cc9cd7..0000000000 --- a/config.tests/unix/syslog/syslog.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = syslog.c - -CONFIG -= qt diff --git a/config.tests/unix/tds/tds.cpp b/config.tests/unix/tds/tds.cpp deleted file mode 100644 index 9d595154b7..0000000000 --- a/config.tests/unix/tds/tds.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <sybfront.h> -#include <sybdb.h> - -int main(int, char **) -{ - return 0; -} diff --git a/config.tests/unix/tds/tds.pro b/config.tests/unix/tds/tds.pro deleted file mode 100644 index f60fc0a602..0000000000 --- a/config.tests/unix/tds/tds.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = tds.cpp -CONFIG -= qt dylib diff --git a/config.tests/unix/tslib/tslib.cpp b/config.tests/unix/tslib/tslib.cpp deleted file mode 100644 index 7afb07aa66..0000000000 --- a/config.tests/unix/tslib/tslib.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <tslib.h> - -int main() -{ - ts_open("foo", 0); - return 0; -} diff --git a/config.tests/unix/tslib/tslib.pro b/config.tests/unix/tslib/tslib.pro deleted file mode 100644 index 6fc652dd96..0000000000 --- a/config.tests/unix/tslib/tslib.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = tslib.cpp -CONFIG -= qt diff --git a/config.tests/unix/which.test b/config.tests/unix/which.test deleted file mode 100755 index 37c858c2f7..0000000000 --- a/config.tests/unix/which.test +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -HOME=/dev/null -export HOME - -unset which - -WHICH=`which which 2>/dev/null` -if echo $WHICH | grep 'shell built-in command' >/dev/null 2>&1; then - WHICH=which -elif [ -z "$WHICH" ]; then - if which which >/dev/null 2>&1; then - WHICH=which - else - for a in /usr/ucb /usr/bin /bin /usr/local/bin; do - if [ -x $a/which ]; then - WHICH=$a/which - break; - fi - done - fi -fi - -if [ -z "$WHICH" ]; then - IFS=: - for a in $PATH; do - if [ -x $a/$1 ]; then - echo "$a/$1" - exit 0 - fi - done -else - a=`"$WHICH" "$1" 2>/dev/null` - if [ ! -z "$a" -a -x "$a" ]; then - echo "$a" - exit 0 - fi -fi -exit 1 diff --git a/config.tests/unix/xkbcommon/xkbcommon.cpp b/config.tests/unix/xkbcommon/xkbcommon.cpp deleted file mode 100644 index f13b4f721a..0000000000 --- a/config.tests/unix/xkbcommon/xkbcommon.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <xkbcommon/xkbcommon.h> -#include <xkbcommon/xkbcommon-keysyms.h> -#include <xkbcommon/xkbcommon-names.h> - -int main() -{ - xkb_context_new(XKB_CONTEXT_NO_FLAGS); - return 0; -} diff --git a/config.tests/unix/xkbcommon/xkbcommon.pro b/config.tests/unix/xkbcommon/xkbcommon.pro deleted file mode 100644 index 4bc6e493b2..0000000000 --- a/config.tests/unix/xkbcommon/xkbcommon.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xkbcommon.cpp -CONFIG -= qt diff --git a/config.tests/unix/zlib/zlib.cpp b/config.tests/unix/zlib/zlib.cpp deleted file mode 100644 index 3908e59c36..0000000000 --- a/config.tests/unix/zlib/zlib.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <zlib.h> - -int main(int, char **) -{ - z_streamp stream; - stream = 0; - const char *ver = zlibVersion(); - ver = 0; - // compress2 was added in zlib version 1.0.8 - int res = compress2(0, 0, 0, 0, 1); - res = 0; - return 0; -} diff --git a/config.tests/unix/zlib/zlib.pro b/config.tests/unix/zlib/zlib.pro deleted file mode 100644 index 6a6b324611..0000000000 --- a/config.tests/unix/zlib/zlib.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = zlib.cpp -CONFIG -= qt dylib diff --git a/config.tests/common/verifyspec/verifyspec.cpp b/config.tests/verifyspec/verifyspec.cpp index bd5560bf02..bd5560bf02 100644 --- a/config.tests/common/verifyspec/verifyspec.cpp +++ b/config.tests/verifyspec/verifyspec.cpp diff --git a/config.tests/common/verifyspec/verifyspec.pro b/config.tests/verifyspec/verifyspec.pro index 11a280e4ce..11a280e4ce 100644 --- a/config.tests/common/verifyspec/verifyspec.pro +++ b/config.tests/verifyspec/verifyspec.pro diff --git a/config.tests/qpa/integrityfb/integrityfb.cpp b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp index 7f2dd0705f..2dde2914a2 100644 --- a/config.tests/qpa/integrityfb/integrityfb.cpp +++ b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp @@ -37,10 +37,11 @@ ** ****************************************************************************/ -#include <device/fbdriver.h> +#include <D3D11.h> -int main(int, char **) +int main(int, char**) { - FBDriver *driver = 0; + D3D11_QUERY_DATA_TIMESTAMP_DISJOINT qdtd; + (void)qdtd; return 0; } diff --git a/config.tests/qpa/direct2d/direct2d.pro b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro index 98527b12a7..f1e530ab6e 100644 --- a/config.tests/qpa/direct2d/direct2d.pro +++ b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro @@ -1,3 +1,3 @@ -SOURCES = direct2d.cpp +SOURCES = angle_d3d11_qdtd.cpp CONFIG -= qt CONFIG += console diff --git a/config.tests/win/directwrite/directwrite.cpp b/config.tests/win/directwrite/directwrite.cpp deleted file mode 100644 index 8380c703ad..0000000000 --- a/config.tests/win/directwrite/directwrite.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <dwrite.h> -#include <d2d1.h> - -int main(int, char**) -{ - IDWriteFactory *factory = 0; - DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, - __uuidof(IDWriteFactory), - reinterpret_cast<IUnknown **>(&factory)); - return 0; -} diff --git a/config.tests/win/directwrite/directwrite.pro b/config.tests/win/directwrite/directwrite.pro deleted file mode 100644 index 88ff6ee2b8..0000000000 --- a/config.tests/win/directwrite/directwrite.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = directwrite.cpp -CONFIG -= qt -CONFIG += console diff --git a/config.tests/win/directwrite2/directwrite2.cpp b/config.tests/win/directwrite2/directwrite2.cpp deleted file mode 100644 index 65fa9d44cd..0000000000 --- a/config.tests/win/directwrite2/directwrite2.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <dwrite_2.h> -#include <d2d1.h> - -int main(int, char**) -{ - IUnknown *factory = 0; - const size_t dummy = size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2); - DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, - __uuidof(IDWriteFactory2), - &factory); - return 0; -} diff --git a/config.tests/win/directwrite2/directwrite2.pro b/config.tests/win/directwrite2/directwrite2.pro deleted file mode 100644 index 5d6fe24a4b..0000000000 --- a/config.tests/win/directwrite2/directwrite2.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = directwrite2.cpp -CONFIG -= qt -CONFIG += console diff --git a/config.tests/x11/xinput2/xinput2.cpp b/config.tests/x11/xinput2/xinput2.cpp deleted file mode 100644 index 4cdac72945..0000000000 --- a/config.tests/x11/xinput2/xinput2.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <X11/Xlib.h> -#include <X11/extensions/XInput2.h> -#include <X11/extensions/Xge.h> - -#ifndef XInput_2_0 -# error "Missing XInput_2_0 #define" -#endif - -int main(int, char **) -{ - // need XGenericEventCookie for XInput2 to work - Display *dpy = 0; - XEvent xevent; - if (XGetEventData(dpy, &xevent.xcookie)) { - XFreeEventData(dpy, &xevent.xcookie); - } - - XIEvent *xievent; - xievent = 0; - - XIDeviceEvent *xideviceevent; - xideviceevent = 0; - - XIHierarchyEvent *xihierarchyevent; - xihierarchyevent = 0; - - int deviceid = 0; - int len = 0; - Atom *atoms = XIListProperties(dpy, deviceid, &len); - if (atoms) - XFree(atoms); - - return 0; -} diff --git a/config.tests/x11/xinput2/xinput2.pro b/config.tests/x11/xinput2/xinput2.pro deleted file mode 100644 index 4788f0e14b..0000000000 --- a/config.tests/x11/xinput2/xinput2.pro +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG += x11 -CONFIG -= qt -SOURCES = xinput2.cpp diff --git a/config.tests/x11/xlib/xlib.cpp b/config.tests/x11/xlib/xlib.cpp deleted file mode 100644 index 6743847335..0000000000 --- a/config.tests/x11/xlib/xlib.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <X11/Xlib.h> - -int main(int, char **) -{ - Display *d = XOpenDisplay(NULL); - XCloseDisplay(d); - return 0; -} - diff --git a/config.tests/x11/xlib/xlib.pro b/config.tests/x11/xlib/xlib.pro deleted file mode 100644 index 658161ed9d..0000000000 --- a/config.tests/x11/xlib/xlib.pro +++ /dev/null @@ -1,3 +0,0 @@ -CONFIG += x11 -CONFIG -= qt -SOURCES = xlib.cpp diff --git a/config.tests/common/xlocalescanprint/qglobal.h b/config.tests/xlocalescanprint/qglobal.h index 98de822847..98de822847 100644 --- a/config.tests/common/xlocalescanprint/qglobal.h +++ b/config.tests/xlocalescanprint/qglobal.h diff --git a/config.tests/common/xlocalescanprint/xlocalescanprint.cpp b/config.tests/xlocalescanprint/xlocalescanprint.cpp index 2f1f28f74e..2f1f28f74e 100644 --- a/config.tests/common/xlocalescanprint/xlocalescanprint.cpp +++ b/config.tests/xlocalescanprint/xlocalescanprint.cpp diff --git a/config.tests/common/xlocalescanprint/xlocalescanprint.pro b/config.tests/xlocalescanprint/xlocalescanprint.pro index a37a01f227..3748d2a728 100644 --- a/config.tests/common/xlocalescanprint/xlocalescanprint.pro +++ b/config.tests/xlocalescanprint/xlocalescanprint.pro @@ -1,3 +1 @@ SOURCES = xlocalescanprint.cpp -CONFIG -= qt -CONFIG += console @@ -40,9 +40,7 @@ relpath=`(cd "$relpath"; /bin/pwd)` # the current directory is the "build tree" or "object tree" outpath=`/bin/pwd` -# where to find which.. -unixtests="$relpath/config.tests/unix" -WHICH="$unixtests/which.test" +WHICH="which" PERL=`$WHICH perl 2>/dev/null` diff --git a/configure.json b/configure.json index a46a3380fc..803178a597 100644 --- a/configure.json +++ b/configure.json @@ -147,7 +147,14 @@ "libraries": { "zlib": { "label": "zlib", - "test": "unix/zlib", + "test": { + "include": "zlib.h", + "main": [ + "z_streamp stream = 0;", + "(void) zlibVersion();", + "(void) compress2(0, 0, 0, 0, 1); // compress2 was added in zlib version 1.0.8" + ] + }, "sources": [ { "libs": "-lzdll", "condition": "config.msvc" }, { "libs": "-lz", "condition": "!config.msvc" } @@ -155,7 +162,17 @@ }, "dbus": { "label": "D-Bus >= 1.2", - "test": "unix/dbus", + "test": { + "include": "dbus/dbus.h", + "main": "(void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL);", + "qmake": [ + "CONFIG += build_all", + "CONFIG(debug, debug|release): \\", + " LIBS += $$LIBS_DEBUG", + "else: \\", + " LIBS += $$LIBS_RELEASE" + ] + }, "sources": [ { "type": "pkgConfig", "args": "dbus-1 >= 1.2" }, { @@ -179,7 +196,10 @@ }, "libudev": { "label": "udev", - "test": "unix/libudev", + "test": { + "include": "libudev.h", + "main": "udev_unref(udev_new());" + }, "sources": [ { "type": "pkgConfig", "args": "libudev" }, "-ludev" @@ -209,7 +229,7 @@ "verifyspec": { "label": "valid makespec", "type": "verifySpec", - "test": "common/verifyspec" + "test": "verifyspec" }, "architecture": { "label": "target architecture", @@ -236,17 +256,36 @@ "stl": { "label": "STL compatibility", "type": "compile", - "test": "unix/stl" + "test": "stl" }, "c++14": { "label": "C++14 support", "type": "compile", - "test": "common/c++14" + "test": { + "head": [ + "#if __cplusplus > 201103L", + "// Compiler claims to support C++14, trust it", + "#else", + "# error __cplusplus must be > 201103L (the value of C++11)", + "#endif" + ], + "qmake": "CONFIG += c++11 c++14" + } }, "c++1z": { "label": "C++1z support", "type": "compile", - "test": "common/c++1z" + "test": { + "head": [ + "#if __cplusplus > 201402L", + "// Compiler claims to support experimental C++1z, trust it", + "#else", + "# error __cplusplus must be > 201402L (the value for C++14)", + "#endif", + "#include <map> // https://bugs.llvm.org//show_bug.cgi?id=33117" + ], + "qmake": "CONFIG += c++11 c++14 c++1z" + } }, "precompile_header": { "label": "precompiled header support", @@ -271,12 +310,38 @@ "reduce_exports": { "label": "symbol visibility support", "type": "compile", - "test": "unix/reduce_exports" + "test": { + "head": [ + "#if defined(__GNUC__)", + "__attribute((visibility(\"default\")))", + "#elif defined(__SUNPRO_CC)", + "__global", + "#else", + "# error GCC4+ or SunStudio 8+ are required to support ELF visibility", + "#endif" + ], + "qmake": [ + "TEMPLATE = lib", + "CONFIG += dll hide_symbols", + "isEmpty(QMAKE_CFLAGS_HIDESYMS): error(\"Nope\")" + ] + } }, "reduce_relocations": { "label": "-Bsymbolic-functions support", "type": "compile", - "test": "unix/reduce_relocs" + "test": { + "head": [ + "#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64))", + "# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).", + "#endif" + ], + "qmake": [ + "TEMPLATE = lib", + "CONFIG += dll bsymbolic_functions", + "isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error(\"Nope\")" + ] + } }, "build_parts": { "type": "buildParts" @@ -284,32 +349,97 @@ "separate_debug_info": { "label": "separate debug information support", "type": "compile", - "test": "unix/objcopy" + "test": { + "qmake": [ + "TARGET = objcopytest", + "load(resolve_target)", + "QMAKE_POST_LINK += \\", + " $$QMAKE_OBJCOPY --only-keep-debug $$QMAKE_RESOLVED_TARGET objcopytest.debug && \\", + " $$QMAKE_OBJCOPY --strip-debug $$QMAKE_RESOLVED_TARGET && \\", + " $$QMAKE_OBJCOPY --add-gnu-debuglink=objcopytest.debug $$QMAKE_RESOLVED_TARGET" + ] + } }, "sse2": { "label": "SSE2 instructions", "type": "compile", - "test": "common/sse2" + "test": { + "include": "emmintrin.h", + "main": [ + "__m128i a = _mm_setzero_si128();", + "_mm_maskmoveu_si128(a, _mm_setzero_si128(), 0);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSE2, var): error(\"This compiler does not support SSE2\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2" + ] + } }, "sse3": { "label": "SSE3 instructions", "type": "compile", - "test": "common/sse3" + "test": { + "include": "pmmintrin.h", + "main": [ + "__m128d a = _mm_set1_pd(6.28);", + "__m128d b = _mm_set1_pd(3.14);", + "__m128d result = _mm_addsub_pd(a, b);", + "(void) _mm_movedup_pd(result);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSE3, var): error(\"This compiler does not support SSE3\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE3" + ] + } }, "ssse3": { "label": "SSSE3 instructions", "type": "compile", - "test": "common/ssse3" + "test": { + "include": "tmmintrin.h", + "main": [ + "__m128i a = _mm_set1_epi32(42);", + "_mm_abs_epi8(a);", + "(void) _mm_sign_epi16(a, _mm_set1_epi32(64));" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSSE3, var): error(\"This compiler does not support SSSE3\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSSE3" + ] + } }, "sse4_1": { "label": "SSE4.1 instructions", "type": "compile", - "test": "common/sse4_1" + "test": { + "include": "smmintrin.h", + "main": [ + "__m128 a = _mm_setzero_ps();", + "_mm_ceil_ps(a);", + "__m128i result = _mm_mullo_epi32(_mm_set1_epi32(42), _mm_set1_epi32(64));", + "(void)result;" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSE4_1, var): error(\"This compiler does not support SSE4.1\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_1" + ] + } }, "sse4_2": { "label": "SSE4.2 instructions", "type": "compile", - "test": "common/sse4_2" + "test": { + "include": "nmmintrin.h", + "main": [ + "__m128i a = _mm_setzero_si128();", + "__m128i b = _mm_set1_epi32(42);", + "(void) _mm_cmpestrm(a, 16, b, 16, 0);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_SSE4_2, var): error(\"This compiler does not support SSE4.2\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE4_2" + ] + } }, "aesni": { "label": "AES new instructions", @@ -319,7 +449,20 @@ "f16c": { "label": "F16C instructions", "type": "compile", - "test": "common/f16c" + "test": { + "include": "immintrin.h", + "main": [ + "__m128i a = _mm_setzero_si128();", + "__m128 b = _mm_cvtph_ps(a);", + "__m256 b256 = _mm256_cvtph_ps(a);", + "(void) _mm_cvtps_ph(b, 0);", + "(void) _mm256_cvtps_ph(b256, 0);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_F16C, var): error(\"This compiler does not support F16C\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_F16C" + ] + } }, "rdrnd": { "label": "RDRAND instruction", @@ -334,65 +477,90 @@ "avx": { "label": "AVX instructions", "type": "compile", - "test": "common/avx" + "test": { + "include": "immintrin.h", + "main": [ + "__m256d a = _mm256_setzero_pd();", + "__m256d b = _mm256_set1_pd(42.42);", + "(void) _mm256_add_pd(a, b);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_AVX, var): error(\"This compiler does not support AVX\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX" + ] + } }, "avx2": { "label": "AVX2 instructions", "type": "compile", - "test": "common/avx2" + "test": { + "include": "immintrin.h", + "main": [ + "// AVX", + "_mm256_zeroall();", + "__m256i a = _mm256_setzero_si256();", + "// AVX2", + "__m256i b = _mm256_and_si256(a, a);", + "(void) _mm256_add_epi8(a, b);" + ], + "qmake": [ + "!defined(QMAKE_CFLAGS_AVX2, var): error(\"This compiler does not support AVX2\")", + "QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX2" + ] + } }, "avx512f": { "label": "AVX512 F instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=F" }, "avx512er": { "label": "AVX512 ER instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=ER" }, "avx512cd": { "label": "AVX512 CD instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=CD" }, "avx512pf": { "label": "AVX512 PF instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=PF" }, "avx512dq": { "label": "AVX512 DQ instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=DQ" }, "avx512bw": { "label": "AVX512 BW instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=BW" }, "avx512vl": { "label": "AVX512 VL instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=VL" }, "avx512ifma": { "label": "AVX512 IFMA instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=IFMA" }, "avx512vbmi": { "label": "AVX512 VBMI instructions", "type": "compile", - "test": "common/avx512", + "test": "avx512", "args": "AVX512=VBMI" }, "mips_dsp": { @@ -410,33 +578,58 @@ "type": "subarch", "subarch": "neon" }, - "posix_fallocate": { "label": "POSIX fallocate()", "type": "compile", - "test": "unix/posix_fallocate" + "test": { + "include": [ "fcntl.h", "unistd.h" ], + "main": "(void) posix_fallocate(0, 0, 0);" + } }, "alloca_stdlib_h": { "label": "alloca() in stdlib.h", "type": "compile", - "test": "common/alloca" + "test": { + "include": "stdlib.h", + "main": "alloca(1);" + } }, "alloca_h": { "label": "alloca() in alloca.h", "type": "compile", - "test": "common/alloca", - "args": "DEFINES+=USE_ALLOCA_H" + "test": { + "include": "alloca.h", + "tail": [ + "#ifdef __QNXNTO__", + "// extra include needed in QNX7 to define NULL for the alloca() macro", + "# include <stddef.h>", + "#endif" + ], + "main": "alloca(1);" + } }, "alloca_malloc_h": { "label": "alloca() in malloc.h", "type": "compile", - "test": "common/alloca", - "args": "DEFINES+=USE_MALLOC_H" + "test": { + "include": "malloc.h", + "main": "alloca(1);" + } }, "stack_protector": { "label": "stack protection", "type": "compile", - "test": "unix/stack-protector" + "test": { + "head": [ + "#ifdef __QNXNTO__", + "# include <sys/neutrino.h>", + "# if _NTO_VERSION < 700", + "# error stack-protector not used (by default) before QNX 7.0.0.", + "# endif", + "#endif" + ], + "qmake": "QMAKE_CXXFLAGS += -fstack-protector-strong" + } }, "incredibuild_xge": { "label": "IncrediBuild", diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp index 371e2bda4b..7fdce3b674 100644 --- a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp +++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp @@ -58,12 +58,14 @@ #include <QComboBox> #include <QLabel> #include <QLineEdit> +#include <QMenu> #include <QSpinBox> #include <QPlainTextEdit> #include <QTreeWidget> #include <QAction> #include <QClipboard> +#include <QContextMenuEvent> #include <QHBoxLayout> #include <QGridLayout> @@ -75,6 +77,94 @@ Q_DECLARE_METATYPE(QRegularExpression::MatchType) +static QString patternToCode(QString pattern) +{ + pattern.replace(QLatin1String("\\"), QLatin1String("\\\\")); + pattern.replace(QLatin1String("\""), QLatin1String("\\\"")); + pattern.prepend(QLatin1Char('"')); + pattern.append(QLatin1Char('"')); + return pattern; +} + +static QString codeToPattern(QString code) +{ + for (int i = 0; i < code.size(); ++i) { + if (code.at(i) == QLatin1Char('\\')) + code.remove(i, 1); + } + if (code.startsWith(QLatin1Char('"')) && code.endsWith(QLatin1Char('"'))) { + code.chop(1); + code.remove(0, 1); + } + return code; +} + +class PatternLineEdit : public QLineEdit +{ + Q_OBJECT +public: + explicit PatternLineEdit(QWidget *parent = nullptr); + +private slots: + void copyToCode(); + void pasteFromCode(); + void escapeSelection(); + +protected: + void contextMenuEvent(QContextMenuEvent *event) override; + +private: + QAction *escapeSelectionAction; + QAction *copyToCodeAction; + QAction *pasteFromCodeAction; +}; + +PatternLineEdit::PatternLineEdit(QWidget *parent) : + QLineEdit(parent), + escapeSelectionAction(new QAction(tr("Escape Selection"), this)), + copyToCodeAction(new QAction(tr("Copy to Code"), this)), + pasteFromCodeAction(new QAction(tr("Paste from Code"), this)) +{ + setClearButtonEnabled(true); + connect(escapeSelectionAction, &QAction::triggered, this, &PatternLineEdit::escapeSelection); + connect(copyToCodeAction, &QAction::triggered, this, &PatternLineEdit::copyToCode); + connect(pasteFromCodeAction, &QAction::triggered, this, &PatternLineEdit::pasteFromCode); +} + +void PatternLineEdit::escapeSelection() +{ + const QString selection = selectedText(); + const QString escapedSelection = QRegularExpression::escape(selection); + if (escapedSelection != selection) { + QString t = text(); + t.replace(selectionStart(), selection.size(), escapedSelection); + setText(t); + } +} + +void PatternLineEdit::copyToCode() +{ + QGuiApplication::clipboard()->setText(patternToCode(text())); +} + +void PatternLineEdit::pasteFromCode() +{ + setText(codeToPattern(QGuiApplication::clipboard()->text())); +} + +void PatternLineEdit::contextMenuEvent(QContextMenuEvent *event) +{ + QMenu *menu = createStandardContextMenu(); + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->addSeparator(); + escapeSelectionAction->setEnabled(hasSelectedText()); + menu->addAction(escapeSelectionAction); + menu->addSeparator(); + menu->addAction(copyToCodeAction); + menu->addAction(pasteFromCodeAction); + menu->popup(event->globalPos()); +} + RegularExpressionDialog::RegularExpressionDialog(QWidget *parent) : QDialog(parent) { @@ -131,12 +221,7 @@ void RegularExpressionDialog::refresh() offsetSpinBox->setMaximum(qMax(0, text.length() - 1)); - QString escaped = pattern; - escaped.replace(QLatin1String("\\"), QLatin1String("\\\\")); - escaped.replace(QLatin1String("\""), QLatin1String("\\\"")); - escaped.prepend(QLatin1Char('"')); - escaped.append(QLatin1Char('"')); - escapedPatternLineEdit->setText(escaped); + escapedPatternLineEdit->setText(patternToCode(pattern)); setTextColor(patternLineEdit, subjectTextEdit->palette().color(QPalette::Text)); matchDetailsTreeWidget->clear(); @@ -266,7 +351,7 @@ QWidget *RegularExpressionDialog::setupLeftUi() QLabel *regexpAndSubjectLabel = new QLabel(tr("<h3>Regular expression and text input</h3>")); layout->addRow(regexpAndSubjectLabel); - patternLineEdit = new QLineEdit; + patternLineEdit = new PatternLineEdit; patternLineEdit->setClearButtonEnabled(true); layout->addRow(tr("&Pattern:"), patternLineEdit); @@ -373,3 +458,5 @@ QWidget *RegularExpressionDialog::setupRightUi() return container; } + +#include "regularexpressiondialog.moc" diff --git a/mkspecs/common/android-base-tail.conf b/mkspecs/common/android-base-tail.conf index 2610918c4e..3f1b414d3f 100644 --- a/mkspecs/common/android-base-tail.conf +++ b/mkspecs/common/android-base-tail.conf @@ -15,8 +15,14 @@ QMAKE_CFLAGS += --sysroot=$$ANDROID_PLATFORM_ROOT_PATH QMAKE_CFLAGS_WARN_ON = -Wall -W QMAKE_CFLAGS_WARN_OFF = equals(ANDROID_TARGET_ARCH, armeabi-v7a) | equals(ANDROID_TARGET_ARCH, armeabi) { - QMAKE_CFLAGS_RELEASE = -Os - QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Os + contains(QMAKE_COMPILER, clang) { + QMAKE_CFLAGS_RELEASE = -Oz + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Oz + } else { + QMAKE_CFLAGS_RELEASE = -Os + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Os + } + QMAKE_CFLAGS_DEBUG = -g -marm -O0 equals(ANDROID_TARGET_ARCH, armeabi):if(equals(NDK_TOOLCHAIN_VERSION, 4.8)|equals(NDK_TOOLCHAIN_VERSION, 4.9)) { DEFINES += QT_OS_ANDROID_GCC_48_WORKAROUND diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf index cb84ae0da8..883f8ca215 100644 --- a/mkspecs/features/qt_app.prf +++ b/mkspecs/features/qt_app.prf @@ -14,6 +14,10 @@ TEMPLATE = app load(qt_build_paths) DESTDIR = $$MODULE_BASE_OUTDIR/bin +isEmpty(VERSION): VERSION = $$MODULE_VERSION +isEmpty(QMAKE_TARGET_DESCRIPTION): \ + QMAKE_TARGET_DESCRIPTION = "Qt $$title($$TARGET)" + isEmpty(QMAKE_INFO_PLIST): CONFIG -= app_bundle # This decreases the binary size for tools if statically linked diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index f3db6b467d..c3ea334dd8 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -34,6 +34,18 @@ defineTest(qtConfFatalError) { error() } +# Return a string list for the specified JSON path, which may be either a +# single string or an array of strings. +# Note that this returns a variable name, so it can be directly iterated over. +defineReplace(qtConfScalarOrList) { + defined($$1, var): return($$1) + vals = $$list() + for (i, $${1}._KEYS_): \ + $$vals += $$eval($${1}.$$i) + export($$vals) + return($$vals) +} + defineTest(qtConfCommandlineSetInput) { arg = $${1} val = $${2} @@ -721,7 +733,7 @@ defineTest(qtConfHandleLibrary) { } # if the library defines a test, use it to verify the source. - !isEmpty($${lpfx}.test) { + !isEmpty($${lpfx}.test)|!isEmpty($${lpfx}.test._KEYS_) { $${lpfx}.literal_args = $$qtConfLibraryArgs($$spfx) $$use_args $${lpfx}.host = $$eval($${spfx}.host) !qtConfTest_compile($$lpfx) { @@ -843,16 +855,58 @@ defineTest(qtConfTestPrepare_compile) { return(true) } +defineTest(qtConfPrepareCompileTestSource) { + test_dir = $$2 + + # Create source code + contents = "/* Generated by configure */" + # Custom code before includes + for (ent, $$qtConfScalarOrList($${1}.head)): \ + contents += $$ent + # Includes + for (ent, $$qtConfScalarOrList($${1}.include)): \ + contents += "$${LITERAL_HASH}include <$$ent>" + # Custom code after includes + for (ent, $$qtConfScalarOrList($${1}.tail)): \ + contents += $$ent + # And finally the custom code inside main() + contents += \ + "int main(int argc, char **argv)" \ + "{" \ + " (void)argc; (void)argv;" \ + " /* BEGIN TEST: */" + for (ent, $$qtConfScalarOrList($${1}.main)): \ + contents += " $$ent" + contents += \ + " /* END TEST */" \ + " return 0;" \ + "}" + write_file($$test_dir/main.cpp, contents)|error() + + # Create stub .pro file + contents = "SOURCES = main.cpp" + # Custom project code + for (ent, $$qtConfScalarOrList($${1}.qmake)): \ + contents += $$ent + write_file($$test_dir/$$basename(test_dir).pro, contents)|error() +} + defineTest(qtConfTest_compile) { test = $$eval($${1}.test) host = $$eval($${1}.host) isEmpty(host): host = false - test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test test_base_out_dir = $$OUT_PWD/$$basename(QMAKE_CONFIG_TESTS_DIR) - test_out_dir = $$test_base_out_dir/$$test - !isEmpty($${1}.pro): \ - test_dir = $$test_dir/$$eval($${1}.pro) + isEmpty(test) { + test_dir = $$test_base_out_dir/$$section(1, ".", -1) + test_out_dir = $$test_dir + qtConfPrepareCompileTestSource($${1}.test, $$test_dir) + } else { + test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test + test_out_dir = $$test_base_out_dir/$$test + !isEmpty($${1}.pro): \ + test_dir = $$test_dir/$$eval($${1}.pro) + } test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" qmake_args = $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE)) @@ -1340,17 +1394,10 @@ defineTest(qtConfCheckFeature) { # feature not auto-detected and not explicitly enabled result = false } else { - condition = $$eval($${fpfx}.condition) - !isEmpty(condition) { + result = true + for (condition, $$qtConfScalarOrList($${fpfx}.condition)) { result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled) - } else { - result = true - # check whether we have an array of conditions - for (i, $${fpfx}.condition._KEYS_) { - condition = $$eval($${fpfx}.condition.$$i) - result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled) - !$$result: break() - } + !$$result: break() } } $${fpfx}.available = $$result diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index a516e5ba4b..a8d589f0fa 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -10,9 +10,6 @@ # CONFIG += no_launch_target -isEmpty(VERSION): VERSION = $$MODULE_VERSION -isEmpty(QMAKE_TARGET_DESCRIPTION): QMAKE_TARGET_DESCRIPTION = \ - "Tool for the Qt Application Development Framework" load(qt_app) CONFIG += console diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 7507b26c09..ab699157ca 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -576,13 +576,13 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) FileFixifyFromOutdir | FileFixifyAbsolute)); //DUMP SOURCES + QSet<QString> processedSources; QMap<QString, ProStringList> groups; QList<ProjectBuilderSources> sources; sources.append(ProjectBuilderSources("SOURCES", true)); sources.append(ProjectBuilderSources("GENERATED_SOURCES", true)); sources.append(ProjectBuilderSources("GENERATED_FILES")); sources.append(ProjectBuilderSources("HEADERS")); - sources.append(ProjectBuilderSources("QMAKE_INTERNAL_INCLUDED_FILES")); if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) { const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS"); for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { @@ -626,6 +626,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } } } + sources.append(ProjectBuilderSources("QMAKE_INTERNAL_INCLUDED_FILES")); for(int source = 0; source < sources.size(); ++source) { ProStringList &src_list = project->values(ProKey("QMAKE_PBX_" + sources.at(source).keyName())); ProStringList &root_group_list = project->values("QMAKE_PBX_GROUPS"); @@ -639,6 +640,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) continue; if(file.endsWith(Option::prl_ext)) continue; + if (processedSources.contains(file)) + continue; + processedSources.insert(file); bool in_root = true; QString src_key = keyFor(file); diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index cc1aaf3817..24d1657552 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -629,6 +629,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) for(QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { QString platform = is64Bit ? "x64" : "Win32"; QString xplatform = platform; + const bool isWinRT = project->isActiveConfig("winrt"); if (!project->isEmpty("VCPROJ_ARCH")) { xplatform = project->first("VCPROJ_ARCH").toQString(); } @@ -636,11 +637,11 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) platform = xplatform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag1).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag2).arg(xplatform) << platform; - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) + if (isWinRT) t << "\n\t\t" << (*it)->uuid << QString(_slnProjDbgConfTag3).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag1).arg(xplatform) << platform; t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag2).arg(xplatform) << platform; - if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) + if (isWinRT) t << "\n\t\t" << (*it)->uuid << QString(_slnProjRelConfTag3).arg(xplatform) << platform; } t << _slnProjConfEnd; @@ -1016,7 +1017,7 @@ void VcprojGenerator::initConfiguration() initCustomBuildTool(); initPreBuildEventTools(); initPostBuildEventTools(); - // Only deploy for CE and WinRT projects + // Only deploy for crosscompiled projects if (!project->isHostBuild() || conf.WinRT) initDeploymentTool(); initWinDeployQtTool(); diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp index 972c289412..0a79b26df0 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp @@ -20,7 +20,7 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS { } D3D11_QUERY_DATA_SO_STATISTICS; #endif // ANGLE_MINGW32_COMPAT -#ifdef __MINGW32__ +#ifndef ANGLE_D3D11_QDTD_AVAILABLE typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT { UINT64 Frequency; BOOL Disjoint; diff --git a/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch b/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch new file mode 100644 index 0000000000..9809fefd9d --- /dev/null +++ b/src/angle/patches/0015-ANGLE-Use-ANGLE_D3D11_QDTD_AVAILABLE-to-check-struct-.patch @@ -0,0 +1,32 @@ +From 640361e72369d612270c6e59126019c917e33c9a Mon Sep 17 00:00:00 2001 +From: Oliver Wolff <oliver.wolff@qt.io> +Date: Fri, 28 Jul 2017 09:02:50 +0200 +Subject: [PATCH] ANGLE: Use ANGLE_D3D11_QDTD_AVAILABLE to check struct's + availability + +Checking mingw when defining the structure is not enough, as it is +available in recent versions of MinGW. The define that is used is set +depending on a configure test which works independently of the used +toolchain. + +Change-Id: Ia9cb48f3e673841101a93cbc8ea23aff9547f639 +--- + src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +index 972c289..97c65e1 100644 +--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp ++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp +@@ -20,7 +20,7 @@ typedef struct D3D11_QUERY_DATA_SO_STATISTICS { + } D3D11_QUERY_DATA_SO_STATISTICS; + #endif // ANGLE_MINGW32_COMPAT + +-#ifdef __MINGW32__ ++#ifndef ANGLE_D3D11_QDTD_AVAILABLE + typedef struct D3D11_QUERY_DATA_TIMESTAMP_DISJOINT { + UINT64 Frequency; + BOOL Disjoint; +-- +2.10.2.windows.1 + diff --git a/src/angle/src/common/gles_common.pri b/src/angle/src/common/gles_common.pri index 7b2e4c71b0..ea4fb03aae 100644 --- a/src/angle/src/common/gles_common.pri +++ b/src/angle/src/common/gles_common.pri @@ -23,6 +23,11 @@ for(libname, STATICLIBS) { DEFINES += LIBANGLE_IMPLEMENTATION LIBGLESV2_IMPLEMENTATION GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= !winrt: DEFINES += ANGLE_ENABLE_D3D9 ANGLE_SKIP_DXGI_1_2_CHECK +QT_FOR_CONFIG += gui-private +include($$OUT_PWD/../../../gui/qtgui-config.pri) + +qtConfig(angle_d3d11_qdtd): DEFINES += ANGLE_D3D11_QDTD_AVAILABLE + HEADERS += \ $$ANGLE_DIR/src/common/mathutil.h \ $$ANGLE_DIR/src/common/blocklayout.h \ diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri index b628bcc6ec..e490617c6b 100644 --- a/src/corelib/arch/arch.pri +++ b/src/corelib/arch/arch.pri @@ -4,4 +4,4 @@ HEADERS += \ arch/qatomic_bootstrap.h \ arch/qatomic_cxx11.h -qtConfig(libatomic): QMAKE_USE += libatomic +qtConfig(std-atomic64): QMAKE_USE += libatomic diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h index 484ec73e7f..1404849382 100644 --- a/src/corelib/arch/qatomic_cxx11.h +++ b/src/corelib/arch/qatomic_cxx11.h @@ -187,7 +187,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() { return false; } #endif -#ifndef QT_NO_STD_ATOMIC64 +#if QT_CONFIG(std_atomic64) template<> struct QAtomicOpsSupport<8> { enum { IsSupported = 1 }; }; # define Q_ATOMIC_INT64_IS_SUPPORTED # if ATOMIC_LLONG_LOCK_FREE == 2 diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 7e5a7b8fde..44d6ccfdf5 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -22,14 +22,26 @@ "libraries": { "doubleconversion": { "label": "DoubleConversion", - "test": "unix/doubleconversion", + "test": { + "include": "double-conversion/double-conversion.h", + "main": "(void) double_conversion::StringToDoubleConverter::NO_FLAGS;" + }, "sources": [ "-ldouble-conversion" ] }, "glib": { "label": "GLib", - "test": "unix/glib", + "test": { + "head": "typedef struct _GMainContext GMainContext;", + "include": "glib.h", + "main": [ + "g_thread_init(NULL);", + "(void) g_main_context_default();", + "(void) g_source_new(0, 0);", + "g_source_add_poll(NULL, NULL);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ] @@ -37,14 +49,29 @@ "gnu_iconv": { "label": "GNU libiconv", "export": "iconv", - "test": "unix/gnu-libiconv", + "test": "gnu-libiconv", "sources": [ "-liconv" ] }, "icu": { "label": "ICU", - "test": "unix/icu", + "test": { + "include": [ "unicode/utypes.h", "unicode/ucol.h", "unicode/ustring.h" ], + "main": [ + "UErrorCode status = U_ZERO_ERROR;", + "UCollator *collator = ucol_open(\"ru_RU\", &status);", + "if (!U_FAILURE(status))", + " ucol_close(collator);" + ], + "qmake": [ + "CONFIG += build_all", + "CONFIG(debug, debug|release): \\", + " LIBS += $$LIBS_DEBUG", + "else: \\", + " LIBS += $$LIBS_RELEASE" + ] + }, "sources": [ { "builds": { @@ -62,22 +89,48 @@ }, "journald": { "label": "journald", - "test": "unix/journald", + "test": { + "include": [ "systemd/sd-journal.h", "syslog.h" ], + "main": "sd_journal_send(\"PRIORITY=%i\", LOG_INFO, NULL);" + }, "sources": [ { "type": "pkgConfig", "args": "libsystemd" }, { "type": "pkgConfig", "args": "libsystemd-journal" } ] }, "libatomic": { - "label": "64 bit atomics in libatomic", - "test": "common/atomic64", + "label": "64 bit atomics", + "test": { + "include": [ "atomic", "cstdint" ], + "tail": [ + "void test(volatile std::atomic<std::int64_t> &a)", + "{", + " std::int64_t v = a.load(std::memory_order_acquire);", + " while (!a.compare_exchange_strong(v, v + 1,", + " std::memory_order_acq_rel,", + " std::memory_order_acquire)) {", + " v = a.exchange(v - 1);", + " }", + " a.store(v + 1, std::memory_order_release);", + "}" + ], + "main": [ + "void *ptr = (void*)0xffffffc0; // any random pointer", + "test(*reinterpret_cast<std::atomic<std::int64_t> *>(ptr));" + ], + "qmake": "CONFIG += c++11" + }, "sources": [ + "", "-latomic" ] }, "libdl": { "label": "dlopen()", - "test": "unix/dlopen", + "test": { + "include": "dlfcn.h", + "main": "dlopen(0, 0);" + }, "sources": [ "", "-ldl" @@ -85,7 +138,10 @@ }, "librt": { "label": "clock_gettime()", - "test": "unix/clock-gettime", + "test": { + "include": [ "unistd.h", "time.h" ], + "main": "timespec ts; clock_gettime(CLOCK_REALTIME, &ts);" + }, "sources": [ "", "-lrt" @@ -93,21 +149,38 @@ }, "pcre2": { "label": "PCRE2", - "test": "unix/pcre2", + "test": { + "head": "#define PCRE2_CODE_UNIT_WIDTH 16", + "include": "pcre2.h", + "tail": [ + "#if (PCRE2_MAJOR < 10) || ((PCRE2_MAJOR == 10) && (PCRE2_MINOR < 20))", + "# error This PCRE version is not supported", + "#endif" + ] + }, "sources": [ "-lpcre2-16" ] }, "pps": { "label": "PPS", - "test": "unix/pps", + "test": { + "include": "sys/pps.h", + "main": [ + "pps_decoder_t decoder;", + "pps_decoder_initialize(&decoder, NULL);" + ] + }, "sources": [ "-lpps" ] }, "slog2": { "label": "slog2", - "test": "unix/slog2", + "test": { + "include": "slog2.h", + "main": "slog2_set_default_buffer((slog2_buffer_t)-1);" + }, "export": "", "sources": [ "-lslog2" @@ -116,26 +189,67 @@ }, "tests": { - "atomic64": { - "label": "64 bit atomics", - "type": "compile", - "test": "common/atomic64" - }, "atomicfptr": { "label": "working std::atomic for function pointers", "type": "compile", - "test": "common/atomicfptr" + "test": { + "include": "atomic", + "tail": [ + "typedef void (*fptr)(int);", + "typedef std::atomic<fptr> atomicfptr;", + "void testfunction(int) { }", + "void test(volatile atomicfptr &a)", + "{", + " fptr v = a.load(std::memory_order_acquire);", + " while (!a.compare_exchange_strong(v, &testfunction,", + " std::memory_order_acq_rel,", + " std::memory_order_acquire)) {", + " v = a.exchange(&testfunction);", + " }", + " a.store(&testfunction, std::memory_order_release);", + "}" + ], + "main": [ + "atomicfptr fptr(testfunction);", + "test(fptr);" + ], + "qmake": "CONFIG += c++11" + } }, "clock-monotonic": { "label": "POSIX monotonic clock", "type": "compile", - "test": "unix/clock-monotonic", + "test": { + "include": [ "unistd.h", "time.h" ], + "main": [ + "#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)", + "timespec ts;", + "clock_gettime(CLOCK_MONOTONIC, &ts);", + "#else", + "# error Feature _POSIX_MONOTONIC_CLOCK not available", + "#endif" + ] + }, "use": "librt" }, "cloexec": { "label": "O_CLOEXEC", "type": "compile", - "test": "unix/cloexec" + "test": { + "head": "#define _GNU_SOURCE 1", + "include": [ "sys/types.h", "sys/socket.h", "fcntl.h", "unistd.h" ], + "main": [ + "int pipes[2];", + "(void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK);", + "(void) fcntl(0, F_DUPFD_CLOEXEC, 0);", + "(void) dup3(0, 3, O_CLOEXEC);", + "#if defined(__NetBSD__)", + "(void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK);", + "#else", + "(void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK);", + "#endif" + ] + } }, "cxx11_random": { "label": "C++11 <random>", @@ -145,7 +259,15 @@ "eventfd": { "label": "eventfd", "type": "compile", - "test": "unix/eventfd" + "test": { + "include": "sys/eventfd.h", + "main": [ + "eventfd_t value;", + "int fd = eventfd(0, EFD_CLOEXEC);", + "eventfd_read(fd, &value);", + "eventfd_write(fd, value);" + ] + } }, "futimens": { "label": "futimens()", @@ -175,57 +297,104 @@ "posix-iconv": { "label": "POSIX iconv", "type": "compile", - "test": "unix/iconv" + "test": "iconv" }, "sun-iconv": { "label": "SUN libiconv", "type": "compile", - "test": "unix/sun-libiconv" + "test": "sun-libiconv" }, "inotify": { "label": "inotify", "type": "compile", - "test": "unix/inotify" + "test": { + "include": "sys/inotify.h", + "main": [ + "inotify_init();", + "inotify_add_watch(0, \"foobar\", IN_ACCESS);", + "inotify_rm_watch(0, 1);" + ] + } }, "ipc_sysv": { "label": "SysV IPC", "type": "compile", - "test": "unix/ipc_sysv" + "test": { + "include": [ "sys/types.h", "sys/ipc.h", "sys/sem.h", "sys/shm.h", "fcntl.h" ], + "main": [ + "key_t unix_key = ftok(\"test\", 'Q');", + "semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0);", + "shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL);", + "shmctl(0, 0, (struct shmid_ds *)(0));" + ] + } }, "ipc_posix": { "label": "POSIX IPC", "type": "compile", - "test": "unix/ipc_posix" - }, - "journald": { - "label": "journald", - "type": "compile", - "test": "unix/journald" + "test": { + "include": [ "sys/types.h", "sys/mman.h", "semaphore.h", "fcntl.h" ], + "main": [ + "sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0));", + "shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666);", + "shm_unlink(\"test\");" + ], + "qmake": "linux: LIBS += -lpthread -lrt" + } }, "ppoll": { "label": "ppoll()", "type": "compile", - "test": "unix/ppoll" + "test": { + "include": [ "signal.h", "poll.h" ], + "main": [ + "struct pollfd pfd;", + "struct timespec ts;", + "sigset_t sig;", + "ppoll(&pfd, 1, &ts, &sig);" + ] + } }, "pollts": { "label": "pollts()", "type": "compile", - "test": "unix/pollts" + "test": { + "include": [ "poll.h", "signal.h", "time.h" ], + "main": [ + "struct pollfd pfd;", + "struct timespec ts;", + "sigset_t sig;", + "pollts(&pfd, 1, &ts, &sig);" + ] + } }, "poll": { "label": "poll()", "type": "compile", - "test": "unix/poll" + "test": { + "include": "poll.h", + "main": [ + "struct pollfd pfd;", + "poll(&pfd, 1, 0);" + ] + } }, "syslog": { "label": "syslog", "type": "compile", - "test": "unix/syslog" + "test": { + "include": "syslog.h", + "main": [ + "openlog(\"qt\", 0, LOG_USER);", + "syslog(LOG_INFO, \"configure\");", + "closelog();" + ] + } }, "xlocalescanprint": { "label": "xlocale.h (or equivalents)", "type": "compile", - "test": "common/xlocalescanprint" + "test": "xlocalescanprint" } }, @@ -301,7 +470,7 @@ "label": "iconv", "purpose": "Provides internationalization on Unix.", "section": "Internationalization", - "condition": "!features.icu && (features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv)", + "condition": "!features.icu && features.textcodec && (features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv)", "output": [ "privateFeature", "feature" ] }, "posix-libiconv": { @@ -349,13 +518,8 @@ }, "std-atomic64": { "label": "64 bit atomic operations", - "condition": "tests.atomic64 || libs.libatomic", - "output": [ { "type": "define", "negative": true, "name": "QT_NO_STD_ATOMIC64" } ] - }, - "libatomic": { - "label": "64 bit atomic operations in libatomic", - "condition": "!tests.atomic64 && libs.libatomic", - "output": [ "privateFeature" ] + "condition": "libs.libatomic", + "output": [ "publicFeature" ] }, "mimetype": { "label": "Mimetype handling", @@ -675,7 +839,7 @@ You need to use libdouble-conversion for double/string conversion." "condition": "!tests.atomicfptr", "message": "detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in - qtbase/config.tests/common/atomicfptr" + qtbase/config.tests/atomicfptr" } ], diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 5d1b24f065..376ef872ee 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -104,11 +104,17 @@ cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion load(cmake_functions) +defineTest(pathIsAbsolute) { + p = $$clean_path($$1) + !isEmpty(p):isEqual(p, $$absolute_path($$p)): return(true) + return(false) +} + ##### This requires fixing, so that the feature system works with cmake as well CMAKE_DISABLED_FEATURES = $$join(QT_DISABLED_FEATURES, "$$escape_expand(\\n) ") CMAKE_HOST_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA/src], $$[QT_INSTALL_PREFIX]) -contains(CMAKE_HOST_DATA_DIR, "^\\.\\./.*"):!isEmpty(CMAKE_HOST_DATA_DIR) { +pathIsAbsolute($$CMAKE_HOST_DATA_DIR) { CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA/src]/ CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = True } @@ -117,7 +123,7 @@ cmake_extras_mkspec_dir.input = $$PWD/Qt5CoreConfigExtrasMkspecDir.cmake.in cmake_extras_mkspec_dir.output = $$DESTDIR/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake CMAKE_INSTALL_DATA_DIR = $$cmakeRelativePath($$[QT_HOST_DATA], $$[QT_INSTALL_PREFIX]) -contains(CMAKE_INSTALL_DATA_DIR, "^\\.\\./.*"):!isEmpty(CMAKE_INSTALL_DATA_DIR) { +pathIsAbsolute($$CMAKE_INSTALL_DATA_DIR) { CMAKE_INSTALL_DATA_DIR = $$[QT_HOST_DATA]/ CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = True } diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 05e3f6c45a..2c58ff87e9 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1172,7 +1172,8 @@ # define Q_DECL_ALIGN(n) alignas(n) #endif -#if QT_HAS_CPP_ATTRIBUTE(nodiscard) // P0188R1 +#if QT_HAS_CPP_ATTRIBUTE(nodiscard) && !defined(Q_CC_CLANG) // P0188R1 +// Can't use [[nodiscard]] with Clang, see https://bugs.llvm.org/show_bug.cgi?id=33518 # undef Q_REQUIRED_RESULT # define Q_REQUIRED_RESULT [[nodiscard]] #endif diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 24050dbbf8..5a9864edb2 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -541,13 +541,20 @@ QByteArray fileIdWin8(HANDLE handle) QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry) { QByteArray result; - const HANDLE handle = + #ifndef Q_OS_WINRT + const HANDLE handle = CreateFile((wchar_t*)entry.nativeFilePath().utf16(), 0, - FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + FILE_SHARE_READ, NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS, NULL); #else // !Q_OS_WINRT + CREATEFILE2_EXTENDED_PARAMETERS params; + params.dwSize = sizeof(params); + params.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + params.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS; + const HANDLE handle = CreateFile2((const wchar_t*)entry.nativeFilePath().utf16(), 0, - FILE_SHARE_READ, OPEN_EXISTING, NULL); + FILE_SHARE_READ, OPEN_EXISTING, ¶ms); #endif // Q_OS_WINRT if (handle != INVALID_HANDLE_VALUE) { result = id(handle); diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index 4f6c83ebcf..c33fba2d1f 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -111,13 +111,12 @@ QStringList QKqueueFileSystemWatcherEngine::addPaths(const QStringList &paths, continue; } if (fd >= (int)FD_SETSIZE / 2 && fd < (int)FD_SETSIZE) { - int fddup = fcntl(fd, F_DUPFD, FD_SETSIZE); + int fddup = qt_safe_dup(fd, FD_SETSIZE); if (fddup != -1) { ::close(fd); fd = fddup; } } - fcntl(fd, F_SETFD, FD_CLOEXEC); QT_STATBUF st; if (QT_FSTAT(fd, &st) == -1) { diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp index ff0d45935c..2b5cb63282 100644 --- a/src/corelib/io/qfilesystemwatcher_win.cpp +++ b/src/corelib/io/qfilesystemwatcher_win.cpp @@ -113,7 +113,8 @@ public: signals: void driveAdded(); - void driveRemoved(const QString &); + void driveRemoved(); // Some drive removed + void driveRemoved(const QString &); // Watched/known drive removed void driveLockForRemoval(const QString &); void driveLockForRemovalFailed(const QString &); @@ -252,7 +253,8 @@ inline void QWindowsRemovableDriveListener::handleDbtDriveArrivalRemoval(const M case DBT_DEVICEARRIVAL: emit driveAdded(); break; - case DBT_DEVICEREMOVECOMPLETE: // handled by DBT_DEVTYP_HANDLE above + case DBT_DEVICEREMOVECOMPLETE: // See above for handling of drives registered with watchers + emit driveRemoved(); break; } } @@ -348,7 +350,8 @@ QWindowsFileSystemWatcherEngine::QWindowsFileSystemWatcherEngine(QObject *parent this, &QWindowsFileSystemWatcherEngine::driveLockForRemoval); QObject::connect(m_driveListener, &QWindowsRemovableDriveListener::driveLockForRemovalFailed, this, &QWindowsFileSystemWatcherEngine::driveLockForRemovalFailed); - QObject::connect(m_driveListener, &QWindowsRemovableDriveListener::driveRemoved, + QObject::connect(m_driveListener, + QOverload<const QString &>::of(&QWindowsRemovableDriveListener::driveRemoved), this, &QWindowsFileSystemWatcherEngine::driveRemoved); #endif // !Q_OS_WINRT } diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 5a7057aa80..0decd26179 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -141,20 +141,6 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode) { Q_Q(QFSFileEngine); - // Check if the file name is valid: - // https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions - const QString fileName = fileEntry.fileName(); - for (QString::const_iterator it = fileName.constBegin(), end = fileName.constEnd(); - it != end; ++it) { - const QChar c = *it; - if (c == QLatin1Char('<') || c == QLatin1Char('>') || c == QLatin1Char(':') || - c == QLatin1Char('\"') || c == QLatin1Char('/') || c == QLatin1Char('\\') || - c == QLatin1Char('|') || c == QLatin1Char('?') || c == QLatin1Char('*')) { - q->setError(QFile::OpenError, QStringLiteral("Invalid file name")); - return false; - } - } - // All files are opened in share mode (both read and write). DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp index 0283c5f31f..3f45ca5f91 100644 --- a/src/corelib/io/qsavefile.cpp +++ b/src/corelib/io/qsavefile.cpp @@ -232,7 +232,11 @@ bool QSaveFile::open(OpenMode mode) } d->fileEngine = new QTemporaryFileEngine; - static_cast<QTemporaryFileEngine *>(d->fileEngine)->initialize(d->finalFileName, 0666); + // if the target file exists, we'll copy its permissions below, + // but until then, let's ensure the temporary file is not accessible + // to a third party + int perm = (existingFile.exists() ? 0600 : 0666); + static_cast<QTemporaryFileEngine *>(d->fileEngine)->initialize(d->finalFileName, perm); // Same as in QFile: QIODevice provides the buffering, so there's no need to request it from the file engine. if (!d->fileEngine->open(mode | QIODevice::Unbuffered)) { QFileDevice::FileError err = d->fileEngine->error(); diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp index 8e3de2d620..75cb8a7ede 100644 --- a/src/corelib/io/qwindowspipewriter.cpp +++ b/src/corelib/io/qwindowspipewriter.cpp @@ -197,7 +197,15 @@ bool QWindowsPipeWriter::write(const QByteArray &ba) overlapped, &writeFileCompleted)) { writeSequenceStarted = false; buffer.clear(); - qErrnoWarning("QWindowsPipeWriter::write failed."); + + const DWORD errorCode = GetLastError(); + switch (errorCode) { + case ERROR_NO_DATA: // "The pipe is being closed." + // The other end has closed the pipe. This can happen in QLocalSocket. Do not warn. + break; + default: + qErrnoWarning(errorCode, "QWindowsPipeWriter::write failed."); + } return false; } diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index 8dcd80808b..59a10e9057 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -44,8 +44,6 @@ #include <algorithm> #include <functional> -#ifndef QT_NO_ITEMVIEWS - QT_BEGIN_NAMESPACE /*! @@ -1917,5 +1915,3 @@ QDebug operator<<(QDebug dbg, const QItemSelectionRange &range) QT_END_NAMESPACE #include "moc_qitemselectionmodel.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 2421610bce..9d33303ddc 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -42,8 +42,6 @@ #include <QtCore/qglobal.h> -#ifndef QT_NO_ITEMVIEWS - #include <QtCore/qset.h> #include <QtCore/qvector.h> #include <QtCore/qlist.h> @@ -273,6 +271,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QItemSelectionRange) Q_DECLARE_METATYPE(QItemSelection) -#endif // QT_NO_ITEMVIEWS - #endif // QITEMSELECTIONMODEL_H diff --git a/src/corelib/itemmodels/qitemselectionmodel_p.h b/src/corelib/itemmodels/qitemselectionmodel_p.h index c2d9384b09..dfc0387563 100644 --- a/src/corelib/itemmodels/qitemselectionmodel_p.h +++ b/src/corelib/itemmodels/qitemselectionmodel_p.h @@ -55,7 +55,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_ITEMVIEWS class QItemSelectionModelPrivate: public QObjectPrivate { Q_DECLARE_PUBLIC(QItemSelectionModel) @@ -106,8 +105,6 @@ public: int tableColCount, tableRowCount; }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMSELECTIONMODEL_P_H diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index b7fe1557d3..569fbc2796 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -209,7 +209,8 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA // in the queue. WM_QT_ACTIVATENOTIFIERS will be posted again as a result of // event processing. MSG msg; - if (!PeekMessage(&msg, 0, WM_QT_SOCKETNOTIFIER, WM_QT_SOCKETNOTIFIER, PM_NOREMOVE) + if (!PeekMessage(&msg, d->internalHwnd, + WM_QT_SOCKETNOTIFIER, WM_QT_SOCKETNOTIFIER, PM_NOREMOVE) && d->queuedSocketEvents.isEmpty()) { // register all socket notifiers for (QSFDict::iterator it = d->active_fd.begin(), end = d->active_fd.end(); diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 0b0f935b26..715acc77ce 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -959,8 +959,22 @@ Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const return false; // Keys in the ranges are equal by construction; this checks only the values. - if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first)) + // + // When using the 3-arg std::is_permutation, MSVC will emit warning C4996, + // passing an unchecked iterator to a Standard Library algorithm. We don't + // want to suppress the warning, and we can't use stdext::make_checked_array_iterator + // because QHash::(const_)iterator does not work with size_t and thus will + // emit more warnings. Use the 4-arg std::is_permutation instead (which + // is supported since MSVC 2015). + // + // ### Qt 6: if C++14 library support is a mandated minimum, remove the ifdef for MSVC. + if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first +#if defined(Q_CC_MSVC) && _MSC_VER >= 1900 + , otherEqualRange.second +#endif + )) { return false; + } it = thisEqualRangeEnd; } diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 789a15dded..5db181885c 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -320,7 +320,7 @@ QByteArray QLocalePrivate::bcp47Name(char separator) const if (m_data->m_language_id == QLocale::AnyLanguage) return QByteArray(); if (m_data->m_language_id == QLocale::C) - return QByteArrayLiteral("C"); + return QByteArrayLiteral("en"); QLocaleId localeId = QLocaleId::fromIds(m_data->m_language_id, m_data->m_script_id, m_data->m_country_id); return localeId.withLikelySubtagsRemoved().name(separator); diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 61aacfc922..c599df6a32 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -197,7 +197,7 @@ static inline QDBusError::ErrorType get(const char *name) values: \value NoError QDBusError is invalid (i.e., the call succeeded) - \value Other QDBusError contains an error that is one of the well-known ones + \value Other QDBusError contains an error that is not one of the well-known ones \value Failed The call failed (\c org.freedesktop.DBus.Error.Failed) \value NoMemory Out of memory (\c org.freedesktop.DBus.Error.NoMemory) \value ServiceUnknown The called service is not known diff --git a/src/gui/configure.json b/src/gui/configure.json index 62bf02bdbb..9a7b78d536 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -68,14 +68,30 @@ "direct2d": { "label": "Direct 2D", "export": "", - "test": "qpa/direct2d", + "test": { + "include": [ "d3d11_1.h", "d2d1_1.h", "d2d1_1helper.h", "dxgi1_2.h", "wrl.h", "dwrite.h" ], + "tail": "using Microsoft::WRL::ComPtr;", + "main": [ + "ComPtr<ID2D1Factory1> d2dFactory;", + "D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, d2dFactory.ReleaseAndGetAddressOf());", + "ComPtr<IDXGISurface1> surface;", + "(void) surface;" + ] + }, "sources": [ "-ld2d1 -ldwrite -ld3d11" ] }, "directfb": { "label": "DirectFB", - "test": "qpa/directfb", + "test": { + "include": "directfb.h", + "tail": [ + "#ifdef __typeof__", + "# error DirectFB headers are unclean and cannot compile", + "#endif" + ] + }, "sources": [ { "type": "pkgConfig", "args": "directfb" } ] @@ -83,14 +99,30 @@ "directwrite": { "label": "DirectWrite", "export": "", - "test": "win/directwrite", + "test": { + "include": [ "dwrite.h", "d2d1.h" ], + "main": [ + "IDWriteFactory *factory = 0;", + "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory),", + " (IUnknown **)(&factory));" + ] + }, "sources": [ "-ldwrite" ] }, "drm": { "label": "KMS", - "test": "qpa/kms", + "test": { + "include": [ "stdlib.h", "stdint.h" ], + "tail": [ + "extern \"C\" {", + "#include <xf86drmMode.h>", + "#include <xf86drm.h>", + "}" + ], + "main": "(void) drmModeGetCrtc(0, 0);" + }, "sources": [ { "type": "pkgConfig", "args": "libdrm" }, { "libs": "-ldrm", "condition": "!config.integrity" }, @@ -99,7 +131,13 @@ }, "egl": { "label": "EGL", - "test": "qpa/egl", + "test": { + "include": "EGL/egl.h", + "main": [ + "EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0;", + "eglDestroyContext(dpy, ctx);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "egl" }, { "type": "makeSpec", "spec": "EGL" } @@ -107,7 +145,18 @@ }, "freetype": { "label": "FreeType", - "test": "unix/freetype", + "test": { + "head": [ + "#include <ft2build.h>", + "#include FT_FREETYPE_H", + "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20200)", + "# error This version of freetype is too old.", + "#endif" + ], + "main": [ + "FT_Face face = 0;" + ] + }, "sources": [ { "type": "pkgConfig", "args": "freetype2" }, { "type": "freetype", "libs": "-lfreetype" } @@ -115,7 +164,23 @@ }, "fontconfig": { "label": "Fontconfig", - "test": "unix/fontconfig", + "test": { + "head": [ + "#include <ft2build.h>", + "#include FT_FREETYPE_H", + "#include <fontconfig/fontconfig.h>", + "#ifndef FC_RGBA_UNKNOWN", + "# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define", + "#endif", + "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20110)", + "# error This version of freetype is too old.", + "#endif" + ], + "main": [ + "FT_Face face = 0;", + "FcPattern *pattern = 0;" + ] + }, "sources": [ { "type": "pkgConfig", "args": "fontconfig freetype2" }, { "type": "freetype", "libs": "-lfontconfig -lfreetype" } @@ -123,14 +188,37 @@ }, "gbm": { "label": "GBM", - "test": "qpa/gbm", + "test": { + "include": [ "stdlib.h", "stdint.h" ], + "tail": [ + "extern \"C\" {", + "#include <gbm.h>", + "}" + ], + "main": "gbm_surface *surface = 0;" + }, "sources": [ { "type": "pkgConfig", "args": "gbm" } ] }, "harfbuzz": { "label": "HarfBuzz", - "test": "unix/harfbuzz", + "test": { + "include": "harfbuzz/hb.h", + "tail": [ + "#if !HB_VERSION_ATLEAST(0, 9, 42)", + "# error This version of harfbuzz is too old.", + "#endif" + ], + "main": [ + "hb_buffer_t *buffer = hb_buffer_create();", + "const uint16_t string[] = { 'A', 'b', 'c' };", + "hb_buffer_add_utf16(buffer, string, 3, 0, 3);", + "hb_buffer_guess_segment_properties(buffer);", + "hb_buffer_set_flags(buffer, hb_buffer_flags_t(HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES));", + "hb_buffer_destroy(buffer);" + ] + }, "sources": [ "-lharfbuzz" ] @@ -138,35 +226,62 @@ "imf": { "label": "IMF", "export": "", - "test": "unix/qqnx_imf", + "test": { + "include": "imf/imf_client.h", + "main": "imf_client_init();" + }, "sources": [ "-linput_client" ] }, "lgmon": { "label": "lgmon", - "test": "unix/lgmon", + "test": { + "include": "lgmon.h", + "main": "lgmon_supported(getpid());" + }, "sources": [ "-llgmon" ] }, "libinput": { "label": "libinput", - "test": "unix/libinput", + "test": { + "include": "libinput.h", + "main": "libinput_udev_create_context(NULL, NULL, NULL);" + }, "sources": [ { "type": "pkgConfig", "args": "libinput" } ] }, "integrityhid": { "label": "integrityhid", - "test": "qpa/integrityhid", + "test": { + "include": [ "stdlib.h", "stdint.h", "device/hiddriver.h" ], + "main": [ + "HIDDriver *driver;", + "uintptr_t devicecontext;", + "uint32_t device_id;", + "gh_hid_enum_devices(driver, &device_id, &devicecontext);" + ] + }, "sources": [ { "libs": "-lhiddev -lusbhid -lusb" } ] }, "libjpeg": { "label": "libjpeg", - "test": "unix/libjpeg", + "test": { + "include": [ "sys/types.h", "stdio.h" ], + "tail": [ + "extern \"C\" {", + "#include <jpeglib.h>", + "}", + "", + "j_compress_ptr cinfo;" + ], + "main": "jpeg_create_compress(cinfo);" + }, "sources": [ { "libs": "-llibjpeg", "condition": "config.msvc" }, { "libs": "-ljpeg", "condition": "!config.msvc" } @@ -174,7 +289,10 @@ }, "libpng": { "label": "libpng", - "test": "unix/libpng", + "test": { + "include": "png.h", + "main": "(void) png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);" + }, "sources": [ { "type": "pkgConfig", "args": "libpng" }, { "libs": "-llibpng", "condition": "config.msvc" }, @@ -186,21 +304,50 @@ }, "mirclient": { "label": "Mir client libraries", - "test": "qpa/mirclient", + "test": { + "include": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ], + "tail": "static void surfaceCreateCallback(MirSurface*, void*) {}", + "main": [ + "u_application_lifecycle_delegate_new();", + "mir_surface_create(0, surfaceCreateCallback, 0);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api libcontent-hub >= 0.2.0" } ] }, "mtdev": { "label": "mtdev", - "test": "unix/mtdev", + "test": { + "include": "mtdev.h", + "main": [ + "mtdev m;", + "mtdev_open(&m, 0);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "mtdev" } ] }, "opengl": { "label": "Desktop OpenGL", - "test": "unix/opengldesktop", + "test": { + "head": [ + "#ifdef __APPLE__", + "# include <OpenGL/gl.h>", + "#else", + "# define GL_GLEXT_PROTOTYPES", + "# include <GL/gl.h>", + "#endif" + ], + "main": [ + "glBegin(GL_TRIANGLES);", + " glVertex2f(20.0f, 10.0f);", + " glVertex2f(10.0f, 30.0f);", + " glVertex2f(20.0f, 50.0f);", + "glEnd();" + ] + }, "sources": [ { "type": "pkgConfig", "args": "gl", "condition": "!config.darwin" }, { "type": "makeSpec", "spec": "OPENGL" } @@ -208,7 +355,20 @@ }, "opengl_es2": { "label": "OpenGL ES 2.0", - "test": "unix/opengles2", + "test": { + "head": [ + "#ifdef __APPLE__", + "# include <OpenGLES/ES2/gl.h>", + "#else", + "# define GL_GLEXT_PROTOTYPES", + "# include <GLES2/gl2.h>", + "#endif" + ], + "main": [ + "glUniform1f(1, GLfloat(1.0));", + "glClear(GL_COLOR_BUFFER_BIT);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "glesv2", "condition": "!config.darwin" }, { "type": "makeSpec", "spec": "OPENGL_ES2" } @@ -216,7 +376,10 @@ }, "openvg": { "label": "OpenVG", - "test": "unix/openvg", + "test": { + "include": "VG/openvg.h", + "main": "VGint i = 2; vgFlush();" + }, "sources": [ { "type": "pkgConfig", "args": "vg" }, { "type": "makeSpec", "spec": "OPENVG" } @@ -224,7 +387,10 @@ }, "tslib": { "label": "tslib", - "test": "unix/tslib", + "test": { + "include": "tslib.h", + "main": "ts_open(\"foo\", 0);" + }, "sources": [ "-lts" ] @@ -239,7 +405,10 @@ }, "wayland_server": { "label": "Wayland Server", - "test": "qpa/wayland-server", + "test": { + "include": "wayland-server.h", + "main": "wl_display_create();" + }, "sources": [ { "type": "pkgConfig", "args": "wayland-server" } ] @@ -252,7 +421,15 @@ }, "xcb": { "label": "XCB >= 1.5 (core)", - "test": "qpa/xcb", + "test": { + "include": "xcb/xcb.h", + "main": [ + "int primaryScreen = 0;", + "(void)xcb_connect(\"\", &primaryScreen);", + "// This won't compile unless libxcb >= 1.5 which defines XCB_ATOM_PRIMARY.", + "int xcbAtomPrimary = XCB_ATOM_PRIMARY;" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb >= 1.5" }, "-lxcb" @@ -260,7 +437,27 @@ }, "xcb_syslibs": { "label": "XCB (extensions)", - "test": "qpa/xcb-syslibs", + "test": { + "include": [ + "xcb/xcb.h", + "xcb/xfixes.h", + "xcb/xcb_image.h", + "xcb/xcb_keysyms.h", + "xcb/sync.h", + "xcb/randr.h", + "xcb/shm.h" + ], + "tail": [ + "// This workaround can be removed for xcb-icccm > 3.8", + "#define class class_name", + "#include <xcb/xcb_icccm.h>", + "#undef class" + ], + "main": [ + "int primaryScreen = 0;", + "(void) xcb_connect(\"\", &primaryScreen);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb xcb-shm xcb-sync xcb-xfixes xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape" }, @@ -269,7 +466,13 @@ }, "xcb_xlib": { "label": "XCB Xlib", - "test": "qpa/xcb-xlib", + "test": { + "include": [ "xcb/xcb.h", "X11/Xlib.h", "X11/Xlib-xcb.h" ], + "main": [ + "Display *dpy = XOpenDisplay(\"\");", + "(void) XGetXCBConnection(dpy);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "x11-xcb x11 xcb" }, "-lxcb -lX11 -lX11-xcb" @@ -277,7 +480,18 @@ }, "xcb_xkb": { "label": "XCB XKB >= 1.10", - "test": "qpa/xcb-xkb", + "test": { + "head": [ + "// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++", + "#define explicit dont_use_cxx_explicit" + ], + "include": "xcb/xkb.h", + "tail": "#undef explicit", + "main": [ + "// This takes more arguments in xcb-xkb < 1.10.", + "xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb-xkb >= 1.10 xcb" }, "-lxcb-xkb -lxcb" @@ -285,7 +499,30 @@ }, "xcb_render": { "label": "XCB XRender", - "test": "qpa/xcb-render", + "test": { + "include": [ "xcb/xcb.h", "xcb/render.h" ], + "tail": [ + "// 'template' is used as a function argument name in xcb_renderutil.h", + "#define template template_param", + "// extern \"C\" is missing, too", + "extern \"C\" {", + "#include <xcb/xcb_renderutil.h>", + "}", + "#undef template" + ], + "main": [ + "int primaryScreen = 0;", + "xcb_generic_error_t *error = 0;", + "xcb_connection_t *connection = xcb_connect(\"\", &primaryScreen);", + "xcb_render_query_pict_formats_cookie_t formatsCookie =", + " xcb_render_query_pict_formats(connection);", + "xcb_render_query_pict_formats_reply_t *formatsReply =", + " xcb_render_query_pict_formats_reply(", + " connection, formatsCookie, &error);", + "xcb_render_util_find_standard_format(", + " formatsReply, XCB_PICT_STANDARD_ARGB_32);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb-renderutil xcb-render xcb" }, "-lxcb-render-util -lxcb-render -lxcb" @@ -293,7 +530,17 @@ }, "xcb_glx": { "label": "XCB GLX", - "test": "qpa/xcb-glx", + "test": { + "include": [ "xcb/xcb.h", "xcb/glx.h" ], + "main": [ + "int primaryScreen = 0;", + "xcb_connection_t *connection = xcb_connect(\"\", &primaryScreen);", + "xcb_generic_error_t *error = 0;", + "xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(", + " connection, XCB_GLX_MAJOR_VERSION, XCB_GLX_MINOR_VERSION);", + "xcb_glx_query_version_reply(connection, xglx_query_cookie, &error);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "xcb-glx xcb" }, "-lxcb-glx -lxcb" @@ -301,7 +548,28 @@ }, "xinput2": { "label": "Xinput2", - "test": "x11/xinput2", + "test": { + "include": [ "X11/Xlib.h", "X11/extensions/XInput2.h", "X11/extensions/Xge.h" ], + "tail": [ + "#ifndef XInput_2_0", + "# error Missing XInput_2_0 #define", + "#endif" + ], + "main": [ + "// need XGenericEventCookie for XInput2 to work", + "Display *dpy = 0;", + "XEvent xevent;", + "XIEvent *xievent = 0;", + "XIDeviceEvent *xideviceevent = 0;", + "XIHierarchyEvent *xihierarchyevent = 0;", + "int deviceid = 0;", + "int len = 0;", + "(void) XGetEventData(dpy, &xevent.xcookie);", + "XFreeEventData(dpy, &xevent.xcookie);", + "(void) XIListProperties(dpy, deviceid, &len);" + ], + "qmake": "CONFIG += x11" + }, "sources": [ { "type": "pkgConfig", "args": "xi" }, "-lXi" @@ -310,7 +578,10 @@ "xkbcommon": { "label": "xkbcommon", "export": "xkbcommon_evdev", - "test": "unix/xkbcommon", + "test": { + "include": [ "xkbcommon/xkbcommon.h", "xkbcommon/xkbcommon-keysyms.h", "xkbcommon/xkbcommon-names.h" ], + "main": "xkb_context_new(XKB_CONTEXT_NO_FLAGS);" + }, "sources": [ { "type": "pkgConfig", "args": "xkbcommon" } ] @@ -337,10 +608,23 @@ }, "tests": { + "angle_d3d11_qdtd": { + "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", + "type": "compile", + "test": "win/angle_d3d11_qdtd" + }, "directwrite2": { "label": "DirectWrite 2", "type": "compile", - "test": "win/directwrite2", + "test": { + "include": [ "dwrite_2.h", "d2d1.h" ], + "main": [ + "IUnknown *factory = 0;", + "(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2));", + "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),", + " &factory);" + ] + }, "use": "directwrite" }, "directx": { @@ -355,70 +639,180 @@ "egl-x11": { "label": "EGL on X11", "type": "compile", - "test": "qpa/egl-x11", + "test": { + "head": [ + "// Check if EGL is compatible with X. Some EGL implementations, typically on", + "// embedded devices, are not intended to be used together with X. EGL support", + "// has to be disabled in plugins like xcb in this case since the native display,", + "// window and pixmap types will be different than what an X-based platform", + "// plugin would expect." + ], + "include": [ "EGL/egl.h", "xcb/xcb.h", "X11/Xlib.h", "X11/Xlib-xcb.h" ], + "main": [ + "Display *dpy = EGL_DEFAULT_DISPLAY;", + "EGLNativeDisplayType egldpy = XOpenDisplay(\"\");", + "dpy = egldpy;", + "EGLNativeWindowType w = XCreateWindow(dpy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);", + "XDestroyWindow(dpy, w);", + "XCloseDisplay(dpy);" + ] + }, "use": "egl xcb_xlib" }, "egl-brcm": { "label": "Broadcom EGL (Raspberry Pi)", "type": "compile", - "test": "qpa/eglfs-brcm", + "test": { + "include": [ "EGL/egl.h", "bcm_host.h" ], + "main": "vc_dispmanx_display_open(0);" + }, "use": "egl bcm_host" }, "egl-egldevice": { "label": "EGLDevice", "type": "compile", - "test": "qpa/eglfs-egldevice", + "test": { + "include": [ "EGL/egl.h", "EGL/eglext.h" ], + "main": [ + "EGLDeviceEXT device = 0;", + "EGLStreamKHR stream = 0;", + "EGLOutputLayerEXT layer = 0;", + "(void) EGL_DRM_CRTC_EXT;" + ] + }, "use": "egl" }, "egl-mali": { "label": "Mali EGL", "type": "compile", - "test": "qpa/eglfs-mali", + "test": { + "include": [ "EGL/fbdev_window.h", "EGL/egl.h", "GLES2/gl2.h" ], + "main": "fbdev_window *w = 0;" + }, "use": "egl" }, "egl-mali-2": { "label": "Mali 2 EGL", "type": "compile", - "test": "qpa/eglfs-mali-2", + "test": { + "include": [ "EGL/egl.h", "GLES2/gl2.h" ], + "main": "mali_native_window *w = 0;" + }, "use": "egl" }, "egl-viv": { "label": "i.Mx6 EGL", "type": "compile", - "test": "qpa/eglfs-viv", + "test": { + "include": [ "EGL/egl.h", "EGL/eglvivante.h" ], + "main": [ + "#ifdef __INTEGRITY", + "fbGetDisplay();", + "#else", + "// Do not rely on fbGetDisplay(), since the signature has changed over time.", + "// Stick to fbGetDisplayByIndex().", + "fbGetDisplayByIndex(0);", + "#endif" + ], + "qmake": [ + "DEFINES += EGL_API_FB=1", + "!integrity: DEFINES += LINUX=1" + ] + }, "use": "egl" }, "evdev": { "label": "evdev", "type": "compile", - "test": "unix/evdev" + "test": { + "head": [ + "#if defined(__FreeBSD__)", + "# include <dev/evdev/input.h>", + "#else", + "# include <linux/input.h>", + "# include <linux/kd.h>", + "#endif", + "enum {", + " e1 = ABS_PRESSURE,", + " e2 = ABS_X,", + " e3 = REL_X,", + " e4 = SYN_REPORT,", + "};" + ], + "main": [ + "input_event buf[32];", + "(void) buf;" + ] + } }, "integrityfb": { "label": "INTEGRITY framebuffer", "type": "compile", - "test": "qpa/integrityfb" + "test": { + "include": "device/fbdriver.h", + "main": "FBDriver *driver = 0;" + } }, "libinput_axis_api": { "label": "axis API in libinput", "type": "compile", - "test": "unix/libinput_axis_api", + "test": { + "include": "libinput.h", + "main": "libinput_event_pointer_has_axis(nullptr, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);" + }, "use": "libinput" }, "linuxfb": { "label": "LinuxFB", "type": "compile", - "test": "qpa/linuxfb" + "test": { + "include": [ "linux/fb.h", "sys/kd.h", "sys/ioctl.h" ], + "main": [ + "fb_fix_screeninfo finfo;", + "fb_var_screeninfo vinfo;", + "int fd = 3;", + "ioctl(fd, FBIOGET_FSCREENINFO, &finfo);", + "ioctl(fd, FBIOGET_VSCREENINFO, &vinfo);" + ] + } }, "opengles3": { "label": "OpenGL ES 3.0", "type": "compile", - "test": "unix/opengles3", + "test": { + "head": [ + "#ifdef __APPLE__", + "# include <OpenGLES/ES3/gl.h>", + "#else", + "# define GL_GLEXT_PROTOTYPES", + "# include <GLES3/gl3.h>", + "#endif" + ], + "main": [ + "static GLfloat f[6];", + "glGetStringi(GL_EXTENSIONS, 0);", + "glReadBuffer(GL_COLOR_ATTACHMENT1);", + "glUniformMatrix2x3fv(0, 0, GL_FALSE, f);", + "glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT);" + ] + }, + "comment": [ + "The library is expected to be the same as in ES 2.0 (libGLESv2).", + "The difference is the header and the presence of the functions in", + "the library." + ], "use": "opengl_es2" }, "opengles31": { "label": "OpenGL ES 3.1", "type": "compile", - "test": "unix/opengles31", + "test": { + "include": "GLES3/gl31.h", + "main": [ + "glDispatchCompute(1, 1, 1);", + "glProgramUniform1i(0, 0, 0);" + ] + }, "use": "opengl_es2" }, "opengles32": { @@ -450,7 +844,14 @@ "xlib": { "label": "XLib", "type": "compile", - "test": "x11/xlib" + "test": { + "include": "X11/Xlib.h", + "main": [ + "Display *d = XOpenDisplay(NULL);", + "XCloseDisplay(d);" + ], + "qmake": "CONFIG += x11" + } } }, @@ -469,6 +870,11 @@ { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" } ] }, + "angle_d3d11_qdtd": { + "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", + "condition": "features.angle && tests.angle_d3d11_qdtd", + "output": [ "privateFeature" ] + }, "combined-angle-lib": { "label": "Combined ANGLE Library", "autoDetect": false, diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 625e145647..742aa31ba9 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -383,8 +383,9 @@ bool QPMCache::remove(const QString &key) //The key was not in the cache if (cacheKey == cacheKeys.constEnd()) return false; + const bool result = QCache<QPixmapCache::Key, QPixmapCacheEntry>::remove(cacheKey.value()); cacheKeys.erase(cacheKey); - return QCache<QPixmapCache::Key, QPixmapCacheEntry>::remove(cacheKey.value()); + return result; } bool QPMCache::remove(const QPixmapCache::Key &key) diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index 1d6e2924b1..07e372b1ae 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -148,8 +148,14 @@ void QStandardItemPrivate::setChild(int row, int column, QStandardItem *item, if (model && emitChanged) emit model->layoutChanged(); - if (emitChanged && model) - model->d_func()->itemChanged(item); + if (emitChanged && model) { + if (item) { + model->d_func()->itemChanged(item); + } else { + const QModelIndex idx = model->index(row, column, q->index()); + emit model->dataChanged(idx, idx); + } + } } @@ -174,7 +180,9 @@ void QStandardItemPrivate::childDeleted(QStandardItem *child) { int index = childIndex(child); Q_ASSERT(index != -1); + const auto modelIndex = child->index(); children.replace(index, 0); + emit model->dataChanged(modelIndex, modelIndex); } /*! @@ -476,6 +484,7 @@ bool QStandardItemPrivate::insertColumns(int column, int count, const QList<QSta void QStandardItemModelPrivate::itemChanged(QStandardItem *item) { Q_Q(QStandardItemModel); + Q_ASSERT(item); if (item->d_func()->parent == 0) { // Header item int idx = columnHeaderItems.indexOf(item); @@ -1721,6 +1730,8 @@ bool QStandardItem::hasChildren() const item) takes ownership of \a item. If necessary, the row count and column count are increased to fit the item. + \note Passing a null pointer as \a item removes the item. + \sa child() */ void QStandardItem::setChild(int row, int column, QStandardItem *item) diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h index 32c8f07dc0..0a060a2d2c 100644 --- a/src/gui/kernel/qhighdpiscaling_p.h +++ b/src/gui/kernel/qhighdpiscaling_p.h @@ -398,11 +398,11 @@ inline QRegion fromNativeLocalExposedRegion(const QRegion &pixelRegion, const QW const qreal scaleFactor = QHighDpiScaling::factor(window); QRegion pointRegion; - for (const QRect &rect : pixelRegion) { - const QPointF topLeftP = QPointF(rect.topLeft()) / scaleFactor; - const QPointF bottomRightP = QPointF(rect.bottomRight()) / scaleFactor; + for (const QRectF &rect : pixelRegion) { + const QPointF topLeftP = rect.topLeft() / scaleFactor; + const QSizeF sizeP = rect.size() / scaleFactor; pointRegion += QRect(QPoint(qFloor(topLeftP.x()), qFloor(topLeftP.y())), - QPoint(qCeil(bottomRightP.x()), qCeil(bottomRightP.y()))); + QSize(qCeil(sizeP.width()), qCeil(sizeP.height()))); } return pointRegion; } diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 1241193332..5db4e5a919 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2339,8 +2339,8 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe if (s->matrix.type() > QTransform::TxTranslate || stretch_sr) { QRectF targetBounds = s->matrix.mapRect(r); - bool exceedsPrecision = targetBounds.width() > 0xffff - || targetBounds.height() > 0xffff; + bool exceedsPrecision = targetBounds.width() > 0x7fff + || targetBounds.height() > 0x7fff; if (!exceedsPrecision && d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) { if (s->matrix.type() > QTransform::TxScale) { diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index f3c9b92bae..812cb8c02d 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -137,6 +137,7 @@ const QVectorPath &qtVectorPathForPath(const QPainterPath &path) #ifndef QT_NO_DEBUG_STREAM QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path) { + QDebugStateSaver saver(s); QRectF rf = path.controlPointRect(); s << "QVectorPath(size:" << path.elementCount() << " hints:" << hex << path.hints() diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 58933e38fb..2cc071d67b 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -948,7 +948,8 @@ QFontEngine *loadSingleEngine(int script, if (engine) { // Also check for OpenType tables when using complex scripts if (Q_UNLIKELY(!engine->supportsScript(QChar::Script(script)))) { - qWarning(" OpenType support missing for script %d", script); + qWarning(" OpenType support missing for \"%s\", script %d", + qPrintable(def.family), script); return 0; } @@ -972,7 +973,8 @@ QFontEngine *loadSingleEngine(int script, if (engine) { // Also check for OpenType tables when using complex scripts if (!engine->supportsScript(QChar::Script(script))) { - qWarning(" OpenType support missing for script %d", script); + qWarning(" OpenType support missing for \"%s\", script %d", ++ qPrintable(def.family), script); if (engine->ref.load() == 0) delete engine; return 0; diff --git a/src/network/configure.json b/src/network/configure.json index f3b75b8b85..de40872e16 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -25,7 +25,7 @@ "corewlan": { "label": "CoreWLan", "export": "", - "test": "mac/corewlan", + "test": "corewlan", "sources": [ "-framework CoreWLAN -framework Foundation" ] @@ -38,7 +38,14 @@ }, "libproxy": { "label": "libproxy", - "test": "common/libproxy", + "test": { + "include": [ "proxy.h" ], + "main": [ + "pxProxyFactory *factory = px_proxy_factory_new();", + "px_proxy_factory_get_proxies(factory, \"http://qt-project.org\");", + "px_proxy_factory_free(factory);" + ] + }, "sources": [ "-lproxy" ] @@ -46,7 +53,7 @@ "openssl_headers": { "label": "OpenSSL Headers", "export": "openssl", - "test": "unix/openssl", + "test": "openssl", "sources": [ { "comment": "placeholder for OPENSSL_PATH", @@ -56,7 +63,7 @@ }, "openssl": { "label": "OpenSSL", - "test": "unix/openssl", + "test": "openssl", "sources": [ { "type": "openssl" }, { @@ -85,25 +92,66 @@ "getaddrinfo": { "label": "getaddrinfo()", "type": "compile", - "test": "unix/getaddrinfo", + "test": { + "head": [ + "#include <stdio.h>", + "#include <stdlib.h>", + "#ifdef __MINGW32__", + "# include <winsock2.h>", + "# include <ws2tcpip.h>", + "#else", + "# include <sys/types.h>", + "# include <sys/socket.h>", + "# include <netdb.h>", + "#endif" + ], + "main": [ + "addrinfo *res = 0;", + "(void) getaddrinfo(\"foo\", 0, 0, &res);", + "freeaddrinfo(res);", + "gai_strerror(0);" + ] + }, "use": "network" }, "getifaddrs": { "label": "getifaddrs()", "type": "compile", - "test": "unix/getifaddrs", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "net/if.h", "ifaddrs.h" ], + "main": [ + "ifaddrs *list;", + "getifaddrs(&list);", + "freeifaddrs(list);" + ] + }, "use": "network" }, "ipv6ifname": { "label": "IPv6 ifname", "type": "compile", - "test": "unix/ipv6ifname", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "net/if.h" ], + "main": [ + "char buf[IFNAMSIZ];", + "if_nametoindex(\"eth0\");", + "if_indextoname(1, buf);" + ] + }, "use": "network" }, "sctp": { "label": "SCTP support", "type": "compile", - "test": "unix/sctp", + "test": { + "include": [ "sys/types.h", "sys/socket.h", "netinet/in.h", "netinet/sctp.h" ], + "main": [ + "sctp_initmsg sctpInitMsg;", + "socklen_t sctpInitMsgSize = sizeof(sctpInitMsg);", + "(void) socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);", + "(void) getsockopt(-1, SOL_SCTP, SCTP_INITMSG, &sctpInitMsg, &sctpInitMsgSize);" + ] + }, "use": "network" }, "openssl11": { diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index 12c5aa0023..e21bf29d4b 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -1088,11 +1088,14 @@ qint64 QNativeSocketEnginePrivate::nativeBytesAvailable() const WSABUF buf; buf.buf = &c; buf.len = sizeof(c); + DWORD bytesReceived; DWORD flags = MSG_PEEK; - if (::WSARecvFrom(socketDescriptor, &buf, 1, 0, &flags, 0,0,0,0) == SOCKET_ERROR) { + if (::WSARecvFrom(socketDescriptor, &buf, 1, &bytesReceived, &flags, 0,0,0,0) == SOCKET_ERROR) { int err = WSAGetLastError(); if (err != WSAECONNRESET && err != WSAENETRESET) return 0; + } else { + return bytesReceived; } } return nbytes; diff --git a/src/network/socket/qnativesocketengine_winrt.cpp b/src/network/socket/qnativesocketengine_winrt.cpp index 291d85844d..b7d7042923 100644 --- a/src/network/socket/qnativesocketengine_winrt.cpp +++ b/src/network/socket/qnativesocketengine_winrt.cpp @@ -535,8 +535,8 @@ QNativeSocketEngine::QNativeSocketEngine(QObject *parent) { qRegisterMetaType<WinRtDatagram>(); qRegisterMetaType<WinRTSocketEngine::ErrorString>(); -#ifndef QT_NO_SSL Q_D(QNativeSocketEngine); +#ifndef QT_NO_SSL if (parent) d->sslSocket = qobject_cast<QSslSocket *>(parent->parent()); #endif diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp index 4be2182188..a337332b53 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp @@ -56,6 +56,7 @@ #include <QtCore/QtEndian> #include <QtCore/QFile> #include <QtCore/qmath.h> +#include <QtCore/QTextStream> #include <QtCore/QThreadStorage> #include <QtCore/private/qsystemlibrary_p.h> #include <QtCore/private/qstringiterator_p.h> @@ -66,6 +67,7 @@ #if !defined(QT_NO_DIRECTWRITE) # include <dwrite.h> +# include <comdef.h> #endif QT_BEGIN_NAMESPACE @@ -1214,6 +1216,22 @@ QWindowsMultiFontEngine::QWindowsMultiFontEngine(QFontEngine *fe, int script) { } +#ifndef QT_NO_DIRECTWRITE +static QString msgDirectWriteFunctionFailed(HRESULT hr, const char *function, + const QString &fam, const QString &substitute) +{ + _com_error error(hr); + QString result; + QTextStream str(&result); + str << function << " failed for \"" << fam << '"'; + if (substitute != fam) + str << " (substitute: \"" << substitute << "\")"; + str << ": error " << hex << showbase << ulong(hr) << ' ' << noshowbase << dec + << ": " << QString::fromWCharArray(error.ErrorMessage()); + return result; +} +#endif // !QT_NO_DIRECTWRITE + QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) { QFontEngine *fontEngine = engine(0); @@ -1252,7 +1270,8 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) IDWriteFont *directWriteFont = 0; HRESULT hr = data->directWriteGdiInterop->CreateFontFromLOGFONT(&lf, &directWriteFont); if (FAILED(hr)) { - qErrnoWarning("%s: CreateFontFromLOGFONT failed", __FUNCTION__); + qWarning("%s: %s", __FUNCTION__, + qPrintable(msgDirectWriteFunctionFailed(hr, "CreateFontFromLOGFONT", fam, nameSubstitute))); } else { Q_ASSERT(directWriteFont); IDWriteFontFace *directWriteFontFace = NULL; @@ -1270,7 +1289,8 @@ QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) fedw->fontDef.stretch = fontEngine->fontDef.stretch; return fedw; } else { - qErrnoWarning("%s: CreateFontFace failed", __FUNCTION__); + qWarning("%s: %s", __FUNCTION__, + qPrintable(msgDirectWriteFunctionFailed(hr, "CreateFontFace", fam, nameSubstitute))); } } } diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp index eb9e9c8b8d..6df454adb0 100644 --- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp +++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp @@ -133,7 +133,7 @@ QIBusPlatformInputContext::~QIBusPlatformInputContext (void) bool QIBusPlatformInputContext::isValid() const { - return d->valid; + return d->valid && d->busConnected; } void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int) diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index a2e0876073..4478895538 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -167,7 +167,12 @@ QT_END_NAMESPACE - (void)onCancelClicked; @end -@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView +@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView { + NSButton *_okButton; + NSButton *_cancelButton; + NSView *_panelContents; + NSEdgeInsets _panelContentsMargins; +} @property (nonatomic, readonly) NSButton *okButton; @property (nonatomic, readonly) NSButton *cancelButton; diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 37e69fa8c8..9f9618177d 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -301,6 +301,11 @@ QT_END_NAMESPACE */ @implementation QNSPanelContentsWrapper +@synthesize okButton = _okButton; +@synthesize cancelButton = _cancelButton; +@synthesize panelContents = _panelContents; +@synthesize panelContentsMargins = _panelContentsMargins; + - (instancetype)initWithPanelDelegate:(id<QT_MANGLE_NAMESPACE(QNSPanelDelegate)>)panelDelegate { if ((self = [super initWithFrame:NSZeroRect])) { diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 8295d4a36c..1224d138d9 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -75,7 +75,7 @@ // window.screen.visibleFrame directly, as that ensures we have the same // behavior for both use-cases/APIs. Q_ASSERT(window == m_cocoaWindow->nativeWindow()); - return m_cocoaWindow->screen()->availableGeometry().toCGRect(); + return NSRectFromCGRect(m_cocoaWindow->screen()->availableGeometry().toCGRect()); } #if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11) @@ -90,7 +90,7 @@ { Q_UNUSED(proposedSize); Q_ASSERT(window == m_cocoaWindow->nativeWindow()); - return m_cocoaWindow->screen()->geometry().size().toCGSize(); + return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize()); } #endif diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp index 5f85e4b0b0..e218d580a2 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp @@ -142,7 +142,7 @@ void QEglFSKmsGbmDevice::handleDrmEvent() { drmEventContext drmEvent; memset(&drmEvent, 0, sizeof(drmEvent)); - drmEvent.version = DRM_EVENT_CONTEXT_VERSION; + drmEvent.version = 2; drmEvent.vblank_handler = nullptr; drmEvent.page_flip_handler = pageFlipHandler; diff --git a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp index c9fbb8281c..e15d6fee24 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp @@ -314,7 +314,7 @@ void QLinuxFbDevice::swapBuffers(Output *output) while (output->backFb == fbIdx) { drmEventContext drmEvent; memset(&drmEvent, 0, sizeof(drmEvent)); - drmEvent.version = DRM_EVENT_CONTEXT_VERSION; + drmEvent.version = 2; drmEvent.vblank_handler = nullptr; drmEvent.page_flip_handler = pageFlipHandler; // Blocks until there is something to read on the drm fd diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp index 81512b1561..a716a6092a 100644 --- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp +++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp @@ -100,6 +100,7 @@ QMinimalEglIntegration::QMinimalEglIntegration() QMinimalEglIntegration::~QMinimalEglIntegration() { destroyScreen(mScreen); + delete mFontDb; } bool QMinimalEglIntegration::hasCapability(QPlatformIntegration::Capability cap) const diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index aa2e4db193..33ce0f924c 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -140,11 +140,17 @@ EGLSurface QQnxEglWindow::getSurface() if (m_newSurfaceRequested.testAndSetOrdered(true, false)) { const QMutexLocker locker(&m_mutex); //Set geomety must not reset the requestedBufferSize till //the surface is created - if (m_eglSurface != EGL_NO_SURFACE) { - platformOpenGLContext()->doneCurrent(); - destroyEGLSurface(); + + if ((m_requestedBufferSize != bufferSize()) || (m_eglSurface == EGL_NO_SURFACE)) { + if (m_eglSurface != EGL_NO_SURFACE) { + platformOpenGLContext()->doneCurrent(); + destroyEGLSurface(); + } + createEGLSurface(); + } else { + // Must've been a sequence of unprocessed changes returning us to the original size. + resetBuffers(); } - createEGLSurface(); } return m_eglSurface; diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index d87fb75d14..6d4b7922db 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -988,8 +988,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); return true; case QtWindows::NonClientCreate: - if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel()) + if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel() + && !d->m_creationContext->window->property(QWindowsWindow::embeddedNativeParentHandleProperty).isValid()) { enableNonClientDpiScaling(msg.hwnd); + } return false; case QtWindows::CalculateSize: return QWindowsGeometryHint::handleCalculateSize(d->m_creationContext->customMargins, msg, result); diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index 0e15ab08c1..af4304cb19 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -387,12 +387,13 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, && (!hasCapture || currentWindowUnderMouse == window)) || (m_previousCaptureWindow && window != m_previousCaptureWindow && currentWindowUnderMouse && currentWindowUnderMouse != m_previousCaptureWindow)) { + QPoint localPosition; qCDebug(lcQpaEvents) << "Entering " << currentWindowUnderMouse; - if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(currentWindowUnderMouse)) + if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(currentWindowUnderMouse)) { + localPosition = wumPlatformWindow->mapFromGlobal(globalPosition); wumPlatformWindow->applyCursor(); - QWindowSystemInterface::handleEnterEvent(currentWindowUnderMouse, - currentWindowUnderMouse->mapFromGlobal(globalPosition), - globalPosition); + } + QWindowSystemInterface::handleEnterEvent(currentWindowUnderMouse, localPosition, globalPosition); } // We need to track m_windowUnderMouse separately from m_trackedWindow, as // Windows mouse tracking will not trigger WM_MOUSELEAVE for leaving window when diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 513bad35aa..3e445f0f7f 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -515,7 +515,7 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag // Sometimes QWindow doesn't have a QWindow parent but does have a native parent window, // e.g. in case of embedded ActiveQt servers. They should not be considered a top-level // windows in such cases. - QVariant prop = w->property("_q_embedded_native_parent_handle"); + QVariant prop = w->property(QWindowsWindow::embeddedNativeParentHandleProperty); if (prop.isValid()) { embedded = true; parentHandle = reinterpret_cast<HWND>(prop.value<WId>()); @@ -1062,6 +1062,8 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w, \ingroup qt-lighthouse-win */ +const char *QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle"; + QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) : QWindowsBaseWindow(aWindow), m_data(data), @@ -1859,7 +1861,7 @@ bool QWindowsWindow::isFullScreen_sys() const if (testFlag(HasBorderInFullScreen)) geometry += QMargins(1, 1, 1, 1); QPlatformScreen *screen = screenForGeometry(geometry); - return screen && geometry == QHighDpi::toNativePixels(screen->geometry(), screen); + return screen && geometry == screen->geometry(); } /*! diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 3308dfb239..f0789e5167 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -334,6 +334,8 @@ public: void setHasBorderInFullScreen(bool border); static QString formatWindowTitle(const QString &title); + static const char *embeddedNativeParentHandleProperty; + private: inline void show_sys() const; inline QWindowsWindowData setWindowFlags_sys(Qt::WindowFlags wt, unsigned flags = 0) const; diff --git a/src/plugins/platforms/winrt/qwinrttheme.cpp b/src/plugins/platforms/winrt/qwinrttheme.cpp index 5696ae7a10..283825a880 100644 --- a/src/plugins/platforms/winrt/qwinrttheme.cpp +++ b/src/plugins/platforms/winrt/qwinrttheme.cpp @@ -61,6 +61,26 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQpaTheme, "qt.qpa.theme") +class QWinRTApiInformationHandler { +public: + QWinRTApiInformationHandler() + { + HRESULT hr; + hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(), + IID_PPV_ARGS(&m_apiInformationStatics)); + Q_ASSERT_SUCCEEDED(hr); + } + + ComPtr<IApiInformationStatics> apiInformationStatics() const + { + return m_apiInformationStatics; + } + +private: + ComPtr<IApiInformationStatics> m_apiInformationStatics; +}; +Q_GLOBAL_STATIC(QWinRTApiInformationHandler, gApiHandler); + static IUISettings *uiSettings() { static ComPtr<IUISettings> settings; @@ -86,17 +106,16 @@ static inline QColor fromColor(const Color &color) static bool uiColorSettings(const wchar_t *value, UIElementType type, Color *color) { - static ComPtr<IApiInformationStatics> apiInformationStatics; - HRESULT hr; + ComPtr<IApiInformationStatics> apiInformationStatics = gApiHandler->apiInformationStatics(); if (!apiInformationStatics) { - hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(), - IID_PPV_ARGS(&apiInformationStatics)); - RETURN_FALSE_IF_FAILED("Could not get ApiInformationStatics"); + qErrnoWarning("Could not get ApiInformationStatics"); + return false; } static const HStringReference enumRef(L"Windows.UI.ViewManagement.UIElementType"); HStringReference valueRef(value); + HRESULT hr; boolean exists; hr = apiInformationStatics->IsEnumNamedValuePresent(enumRef.Get(), valueRef.Get(), &exists); @@ -149,6 +168,14 @@ static void nativeColorSettings(QPalette &p) // Starting with SDK 15063 those have been removed. #ifndef QT_WINRT_DISABLE_PHONE_COLORS //Phone related + ComPtr<IApiInformationStatics> apiInformationStatics = gApiHandler->apiInformationStatics(); + boolean phoneApiPresent = false; + HRESULT hr; + HStringReference phoneRef(L"Windows.Phone.PhoneContract"); + hr = apiInformationStatics.Get()->IsApiContractPresentByMajor(phoneRef.Get(), 1, &phoneApiPresent); + if (FAILED(hr) || !phoneApiPresent) + return; + if (uiColorSettings(L"PopupBackground", UIElementType_PopupBackground, &color)) { p.setColor(QPalette::ToolTipBase, fromColor(color)); p.setColor(QPalette::AlternateBase, fromColor(color)); diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 674b0cef4b..13f5cd5842 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -428,6 +428,7 @@ public: #if QT_CONFIG(xinput2) void xi2Select(xcb_window_t window); + void xi2SelectStateEvents(); bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } #endif diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index bf17e9c1e1..8ed6909990 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -79,6 +79,7 @@ void QXcbConnection::initializeXInput2() qCDebug(lcQpaXInput, "Using XInput version %d.%d", xiMajor, m_xi2Minor); m_xi2Enabled = true; xi2SetupDevices(); + xi2SelectStateEvents(); break; case BadRequest: // Must be an X server with XInput 1 qCDebug(lcQpaXInput, "X server does not support XInput 2"); @@ -90,6 +91,22 @@ void QXcbConnection::initializeXInput2() } } +void QXcbConnection::xi2SelectStateEvents() +{ + // These state events do not depend on a specific X window, but are global + // for the X client's (application's) state. + unsigned int bitMask = 0; + unsigned char *xiBitMask = reinterpret_cast<unsigned char *>(&bitMask); + XIEventMask xiEventMask; + bitMask = XI_HierarchyChangedMask; + bitMask |= XI_DeviceChangedMask; + xiEventMask.deviceid = XIAllDevices; + xiEventMask.mask_len = sizeof(bitMask); + xiEventMask.mask = xiBitMask; + Display *dpy = static_cast<Display *>(m_xlib_display); + XISelectEvents(dpy, DefaultRootWindow(dpy), &xiEventMask, 1); +} + void QXcbConnection::xi2SetupDevice(void *info, bool removeExisting) { XIDeviceInfo *deviceInfo = reinterpret_cast<XIDeviceInfo *>(info); @@ -373,17 +390,6 @@ void QXcbConnection::xi2Select(xcb_window_t window) #else Q_UNUSED(xiBitMask); #endif - - { - // Listen for hotplug events - XIEventMask xiEventMask; - bitMask = XI_HierarchyChangedMask; - bitMask |= XI_DeviceChangedMask; - xiEventMask.deviceid = XIAllDevices; - xiEventMask.mask_len = sizeof(bitMask); - xiEventMask.mask = xiBitMask; - XISelectEvents(xDisplay, window, &xiEventMask, 1); - } } QXcbConnection::TouchDeviceData *QXcbConnection::touchDeviceForId(int id) diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 8ba6834565..c8efe2fce8 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -329,12 +329,15 @@ QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const void QXcbIntegration::initialize() { + const QLatin1String defaultInputContext("compose"); // Perform everything that may potentially need the event dispatcher (timers, socket // notifiers) here instead of the constructor. QString icStr = QPlatformInputContextFactory::requested(); if (icStr.isNull()) - icStr = QLatin1String("compose"); + icStr = defaultInputContext; m_inputContext.reset(QPlatformInputContextFactory::create(icStr)); + if (!m_inputContext && icStr != defaultInputContext && icStr != QLatin1String("none")) + m_inputContext.reset(QPlatformInputContextFactory::create(defaultInputContext)); } void QXcbIntegration::moveToScreen(QWindow *window, int screen) diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp index 99e8ec8999..1cb14514ee 100644 --- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp +++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp @@ -449,7 +449,9 @@ QStringList QWindowsPrintDevice::availablePrintDeviceIds() QString QWindowsPrintDevice::defaultPrintDeviceId() { DWORD size = 0; - GetDefaultPrinter(NULL, &size); + if (GetDefaultPrinter(NULL, &size) == ERROR_FILE_NOT_FOUND) + return QString(); + QScopedArrayPointer<wchar_t> name(new wchar_t[size]); GetDefaultPrinter(name.data(), &size); return QString::fromWCharArray(name.data()); diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json index 5603ceb37b..234f880579 100644 --- a/src/plugins/sqldrivers/configure.json +++ b/src/plugins/sqldrivers/configure.json @@ -39,7 +39,9 @@ "libraries": { "db2": { "label": "DB2 (IBM)", - "test": "unix/db2", + "test": { + "include": [ "sqlcli.h", "sqlcli1.h" ] + }, "sources": [ { "libs": "-ldb2cli", "condition": "config.win32" }, { "libs": "-ldb2", "condition": "!config.win32" } @@ -47,7 +49,9 @@ }, "ibase": { "label": "InterBase", - "test": "unix/ibase", + "test": { + "include": "ibase.h" + }, "sources": [ { "libs": "-lgds32_ms", "condition": "config.win32" }, { "libs": "-lgds", "condition": "!config.win32" } @@ -55,7 +59,15 @@ }, "mysql": { "label": "MySQL", - "test": "unix/mysql", + "test": { + "head": [ + "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)", + "# include <windows.h>", + "#endif" + ], + "include": "mysql.h", + "main": "mysql_get_client_version();" + }, "sources": [ { "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true }, { "type": "mysqlConfig", "query": "--libs", "cleanlibs": true }, @@ -68,7 +80,13 @@ }, "psql": { "label": "PostgreSQL", - "test": "unix/psql", + "test": { + "include": "libpq-fe.h", + "main": [ + "PQescapeBytea(0, 0, 0);", + "PQunescapeBytea(0, 0);" + ] + }, "sources": [ { "type": "pkgConfig", "args": "libpq" }, { "type": "psqlConfig" }, @@ -78,7 +96,9 @@ }, "tds": { "label": "TDS (Sybase)", - "test": "unix/tds", + "test": { + "include": [ "sybfront.h", "sybdb.h" ] + }, "sources": [ { "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" }, { "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" } @@ -86,7 +106,9 @@ }, "oci": { "label": "OCI (Oracle)", - "test": "unix/oci", + "test": { + "include": "oci.h" + }, "sources": [ { "libs": "-loci", "condition": "config.win32" }, { "libs": "-lclntsh", "condition": "!config.win32" } @@ -94,7 +116,18 @@ }, "odbc": { "label": "ODBC", - "test": "unix/odbc", + "test": { + "head": [ + "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)", + "# include <windows.h>", + "#endif" + ], + "include": [ "sql.h", "sqlext.h" ], + "main": [ + "SQLHANDLE env;", + "SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);" + ] + }, "sources": [ { "libs": "-lodbc32", "condition": "config.win32" }, { "libs": "-liodbc", "condition": "config.darwin" }, @@ -103,7 +136,9 @@ }, "sqlite2": { "label": "SQLite (version 2)", - "test": "unix/sqlite2", + "test": { + "include": "sqlite.h" + }, "sources": [ "-lsqlite" ] @@ -111,7 +146,10 @@ "sqlite3": { "label": "SQLite (version 3)", "export": "sqlite", - "test": "unix/sqlite", + "test": { + "include": "sqlite3.h", + "main": "sqlite3_open_v2(0, 0, 0, 0);" + }, "sources": [ { "type": "pkgConfig", "args": "sqlite3" }, "-lsqlite3" diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp index b0db1c276e..e9f5ee9508 100644 --- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp +++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp @@ -55,6 +55,7 @@ #include <qcache.h> #include <qregularexpression.h> #endif +#include <QTimeZone> #if defined Q_OS_WIN # include <qt_windows.h> @@ -416,6 +417,32 @@ bool QSQLiteResult::prepare(const QString &query) return true; } +static QString secondsToOffset(int seconds) +{ + const QChar sign = ushort(seconds < 0 ? '-' : '+'); + seconds = qAbs(seconds); + const int hours = seconds / 3600; + const int minutes = (seconds % 3600) / 60; + + return QString(QStringLiteral("%1%2:%3")).arg(sign).arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0')); +} + +static QString timespecToString(const QDateTime &dateTime) +{ + switch (dateTime.timeSpec()) { + case Qt::LocalTime: + return QString(); + case Qt::UTC: + return QStringLiteral("Z"); + case Qt::OffsetFromUTC: + return secondsToOffset(dateTime.offsetFromUtc()); + case Qt::TimeZone: + return secondsToOffset(dateTime.timeZone().offsetFromUtc(dateTime)); + default: + return QString(); + } +} + bool QSQLiteResult::exec() { Q_D(QSQLiteResult); @@ -481,7 +508,7 @@ bool QSQLiteResult::exec() break; case QVariant::DateTime: { const QDateTime dateTime = value.toDateTime(); - const QString str = dateTime.toString(QStringViewLiteral("yyyy-MM-ddThh:mm:ss.zzz")); + const QString str = dateTime.toString(QLatin1String("yyyy-MM-ddThh:mm:ss.zzz") + timespecToString(dateTime)); res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(), str.size() * sizeof(ushort), SQLITE_TRANSIENT); break; diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 6266728c84..a6ece7632a 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -52,16 +52,22 @@ //#define DEBUG_SIZE_CONSTRAINT #include <private/qcore_mac_p.h> -#include <private/qcombobox_p.h> +#if QT_CONFIG(tabbar) #include <private/qtabbar_p.h> +#endif #include <private/qpainter_p.h> #include <qapplication.h> #include <qbitmap.h> +#if QT_CONFIG(combobox) +#include <private/qcombobox_p.h> #include <qcombobox.h> +#endif #if QT_CONFIG(dialogbuttonbox) #include <qdialogbuttonbox.h> #endif +#if QT_CONFIG(dockwidget) #include <qdockwidget.h> +#endif #include <qevent.h> #include <qfocusframe.h> #include <qformlayout.h> @@ -287,7 +293,7 @@ static const QColor tabBarCloseButtonCrossSelected(115, 115, 115); static const int closeButtonSize = 14; static const qreal closeButtonCornerRadius = 2.0; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) static bool isVerticalTabs(const QTabBar::Shape shape) { return (shape == QTabBar::RoundedEast || shape == QTabBar::TriangularEast @@ -363,7 +369,7 @@ static void drawTabCloseButton(QPainter *p, bool hover, bool selected, bool pres p->drawLine(margin, height - margin, width - margin, margin); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QRect rotateTabPainter(QPainter *p, QTabBar::Shape shape, QRect tabRect) { if (isVerticalTabs(shape)) { @@ -502,7 +508,7 @@ static inline bool isTreeView(const QWidget *widget) } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) static inline ThemeTabDirection getTabDirection(QTabBar::Shape shape) { ThemeTabDirection ttd; @@ -771,7 +777,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg else if (qobject_cast<const QCheckBox *>(widg)) ct = QStyle::CT_CheckBox; #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) else if (qobject_cast<const QComboBox *>(widg)) ct = QStyle::CT_ComboBox; #endif @@ -1017,7 +1023,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg break; } #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case QStyle::CT_LineEdit: if (!widg || !qobject_cast<QComboBox *>(widg->parentWidget())) { //should I take into account the font dimentions of the lineedit? -Sam @@ -1145,17 +1151,17 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h NSBezierPath *focusRingPath; if (radius > 0) { const CGFloat roundedRectInset = -1.5; - focusRingPath = [NSBezierPath bezierPathWithRoundedRect:CGRectInset(focusRingRect, roundedRectInset, roundedRectInset) + focusRingPath = [NSBezierPath bezierPathWithRoundedRect:NSRectFromCGRect(CGRectInset(focusRingRect, roundedRectInset, roundedRectInset)) xRadius:radius yRadius:radius]; } else { const CGFloat outerClipInset = -focusRingWidth / 2; - NSBezierPath *focusRingClipPath = [NSBezierPath bezierPathWithRect:CGRectInset(focusRingRect, outerClipInset, outerClipInset)]; + NSBezierPath *focusRingClipPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(CGRectInset(focusRingRect, outerClipInset, outerClipInset))]; const CGFloat innerClipInset = 1; - NSBezierPath *focusRingInnerClipPath = [NSBezierPath bezierPathWithRect:CGRectInset(focusRingRect, innerClipInset, innerClipInset)]; + NSBezierPath *focusRingInnerClipPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(CGRectInset(focusRingRect, innerClipInset, innerClipInset))]; [focusRingClipPath appendBezierPath:focusRingInnerClipPath.bezierPathByReversingPath]; [focusRingClipPath setClip]; - focusRingPath = [NSBezierPath bezierPathWithRect:focusRingRect]; + focusRingPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(focusRingRect)]; focusRingPath.lineJoinStyle = NSRoundLineJoinStyle; } @@ -1200,7 +1206,7 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRect &targetRect, int h QRect(focusRingPixmap.width() - shCornerSize, svCornerSize, shCornerSize, focusRingPixmap.width() - 2 * svCornerSize)); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void QMacStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const { Q_ASSERT(textRect); @@ -1263,7 +1269,7 @@ void QMacStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *widg *textRect = tr; } -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) QStyleHelper::WidgetSizePolicy QMacStylePrivate::effectiveAquaSizeConstrain(const QStyleOption *option, const QWidget *widg, @@ -2357,7 +2363,7 @@ void QMacStyle::polish(QWidget* w) { #ifndef QT_NO_MENU if (qobject_cast<QMenu*>(w) -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) || qobject_cast<QComboBoxPrivateContainer *>(w) #endif ) { @@ -2382,7 +2388,7 @@ void QMacStyle::polish(QWidget* w) } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (QTabBar *tb = qobject_cast<QTabBar*>(w)) { if (tb->documentMode()) { w->setAttribute(Qt::WA_Hover); @@ -2424,7 +2430,7 @@ void QMacStyle::unpolish(QWidget* w) w->setWindowOpacity(1.0); } -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (QComboBox *combo = qobject_cast<QComboBox *>(w)) { if (!combo->isEditable()) { if (QWidget *widget = combo->findChild<QComboBoxPrivateContainer *>()) @@ -2433,7 +2439,7 @@ void QMacStyle::unpolish(QWidget* w) } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (qobject_cast<QTabBar*>(w)) { if (!w->testAttribute(Qt::WA_SetFont)) w->setFont(qApp->font(w)); @@ -2941,7 +2947,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w ret = QEvent::MouseButtonRelease; break; case SH_TabBar_SelectMouseType: -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (const QStyleOptionTabBarBase *opt2 = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) { ret = opt2->documentMode ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease; } else @@ -2966,7 +2972,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w ret = Qt::AlignRight; break; case SH_TabBar_Alignment: { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (const QTabWidget *tab = qobject_cast<const QTabWidget*>(w)) { if (tab->documentMode()) { ret = Qt::AlignLeft; @@ -2974,7 +2980,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w } } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (const QTabBar *tab = qobject_cast<const QTabBar*>(w)) { if (tab->documentMode()) { ret = Qt::AlignLeft; @@ -3151,7 +3157,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_ItemView_PaintAlternatingRowColorsForEmptyArea: ret = true; break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SH_TabBar_CloseButtonPosition: ret = QTabBar::LeftSide; break; @@ -3282,7 +3288,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai p->drawPath(path); p->restore(); break; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PE_FrameTabBarBase: if (const QStyleOptionTabBarBase *tbb = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) { @@ -3598,7 +3604,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai } break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case PE_FrameTabWidget: if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { @@ -4112,7 +4118,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter QCommonStyle::drawControl(CE_ComboBoxLabel, &comboCopy, p, w); } break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CE_TabBarTabShape: if (const QStyleOptionTab *tabOpt = qstyleoption_cast<const QStyleOptionTab *>(opt)) { if (tabOpt->documentMode) { @@ -4261,7 +4267,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter } break; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case CE_DockWidgetTitle: if (const QDockWidget *dockWidget = qobject_cast<const QDockWidget *>(w)) { bool floating = dockWidget->isFloating(); @@ -4440,7 +4446,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter // Always be normal or disabled to follow the Mac style. int smallIconSize = proxy()->pixelMetric(PM_SmallIconSize); QSize iconSize(smallIconSize, smallIconSize); -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (const QComboBox *comboBox = qobject_cast<const QComboBox *>(w)) { iconSize = comboBox->iconSize(); } @@ -4816,7 +4822,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, int(outRect.size.height)); break; } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case SE_TabWidgetLeftCorner: if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { @@ -4949,7 +4955,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, #endif case SE_LineEditContents: rect = QCommonStyle::subElementRect(sr, opt, widget); -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (widget && qobject_cast<const QComboBox*>(widget->parentWidget())) rect.adjust(-1, -2, 0, 0); else @@ -5093,7 +5099,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, } rect.setBottom(rect.bottom() - 1); break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case SE_TabWidgetLayoutItem: if (const QStyleOptionTabWidgetFrame *tabWidgetOpt = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { @@ -5108,7 +5114,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, } break; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case SE_DockWidgetCloseButton: case SE_DockWidgetFloatButton: case SE_DockWidgetTitleBarText: @@ -6411,7 +6417,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, * overlap is how much the pane should overlap the tab bar */ // then add the size between the stackwidget and the "contentsRect" -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { QSize extra(0,0); @@ -6427,7 +6433,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, } #endif break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QStyle::CT_TabBarTab: if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { const QStyleHelper::WidgetSizePolicy AquaSize = d->aquaSizeConstrain(opt, widget); @@ -6510,7 +6516,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, case QStyle::CT_MenuItem: if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { int maxpmw = mi->maxIconWidth; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) const QComboBox *comboBox = qobject_cast<const QComboBox *>(widget); #endif int w = sz.width(), @@ -6521,7 +6527,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, } else { h = mi->fontMetrics.height() + 2; if (!mi->icon.isNull()) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (comboBox) { const QSize &iconSize = comboBox->iconSize(); h = qMax(h, iconSize.height() + 4); @@ -6542,7 +6548,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, w += maxpmw + 6; // add space for a check. All items have place for a check too. w += 20; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (comboBox && comboBox->isVisible()) { QStyleOptionComboBox cmb; cmb.initFrom(comboBox); diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h index 2dff9afacb..8574a52a87 100644 --- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h +++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h @@ -48,7 +48,9 @@ #include <QtWidgets/private/qcommonstyle_p.h> #include "qmacstyle_mac_p.h" #include <private/qapplication_p.h> +#if QT_CONFIG(combobox) #include <private/qcombobox_p.h> +#endif #include <private/qpainter_p.h> #include <private/qstylehelper_p.h> #include <qapplication.h> @@ -60,7 +62,9 @@ #if QT_CONFIG(dialogbuttonbox) #include <qdialogbuttonbox.h> #endif +#if QT_CONFIG(dockwidget) #include <qdockwidget.h> +#endif #include <qevent.h> #include <qfocusframe.h> #include <qformlayout.h> @@ -69,7 +73,9 @@ #include <qheaderview.h> #include <qlayout.h> #include <qlineedit.h> +#if QT_CONFIG(listview) #include <qlistview.h> +#endif #include <qmainwindow.h> #include <qmap.h> #include <qmenubar.h> @@ -249,7 +255,7 @@ public: void drawFocusRing(QPainter *p, const QRect &targetRect, int hMargin, int vMargin, qreal radius = 0) const; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *iconRect) const; #endif diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp index ebd3934c90..60a5c25b1f 100644 --- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp @@ -1436,7 +1436,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption } } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: { const QStyleOptionViewItem *vopt; @@ -1471,12 +1471,12 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption } break; } -#endif // QT_NO_ITEMVIEWS -#ifndef QT_NO_COMBOBOX +#endif // QT_CONFIG(itemviews) +#if QT_CONFIG(combobox) case CE_ComboBoxLabel: QCommonStyle::drawControl(element, option, painter, widget); break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) default: QWindowsXPStyle::drawControl(element, option, painter, widget); break; @@ -2119,7 +2119,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt QRect rect = QWindowsXPStyle::subControlRect(control, option, subControl, widget); switch (control) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { int x = cb->rect.x(), @@ -2152,7 +2152,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt return rect; } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CC_TitleBar: if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(option)) { if (!buttonVisible(subControl, tb)) diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h index c8e9edeb3b..14af2c6bbc 100644 --- a/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h +++ b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h @@ -70,11 +70,17 @@ #include <qtoolbutton.h> #include <qspinbox.h> #include <qtoolbar.h> +#if QT_CONFIG(combobox) #include <qcombobox.h> +#endif #include <qscrollbar.h> #include <qprogressbar.h> +#if QT_CONFIG(dockwidget) #include <qdockwidget.h> +#endif +#if QT_CONFIG(listview) #include <qlistview.h> +#endif #if QT_CONFIG(treeview) #include <qtreeview.h> #endif diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp index e670794cd3..a3a665f22b 100644 --- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp @@ -56,12 +56,18 @@ #include <qdesktopwidget.h> #include <qtoolbutton.h> +#if QT_CONFIG(tabbar) #include <qtabbar.h> +#endif +#if QT_CONFIG(combobox) #include <qcombobox.h> +#endif #include <qscrollbar.h> #include <qheaderview.h> #include <qspinbox.h> +#if QT_CONFIG(listview) #include <qlistview.h> +#endif #include <qstackedwidget.h> #if QT_CONFIG(pushbutton) #include <qpushbutton.h> @@ -1151,9 +1157,9 @@ void QWindowsXPStyle::polish(QWidget *widget) #endif || qobject_cast<QToolButton*>(widget) || qobject_cast<QTabBar*>(widget) -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) || qobject_cast<QComboBox*>(widget) -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) || qobject_cast<QScrollBar*>(widget) || qobject_cast<QSlider*>(widget) || qobject_cast<QHeaderView*>(widget) @@ -1226,9 +1232,9 @@ void QWindowsXPStyle::unpolish(QWidget *widget) #endif || qobject_cast<QToolButton*>(widget) || qobject_cast<QTabBar*>(widget) -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) || qobject_cast<QComboBox*>(widget) -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) || qobject_cast<QScrollBar*>(widget) || qobject_cast<QSlider*>(widget) || qobject_cast<QHeaderView*>(widget) @@ -2292,7 +2298,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op drawItemText(p, mbi->rect, alignment, mbi->palette, mbi->state & State_Enabled, mbi->text, textRole); } return; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case CE_DockWidgetTitle: if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(option)) { @@ -2417,7 +2423,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op return; } break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #if QT_CONFIG(rubberband) case CE_RubberBand: if (qstyleoption_cast<const QStyleOptionRubberBand *>(option)) { @@ -2554,7 +2560,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } break; #endif // QT_NO_SPINBOX -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { @@ -2605,7 +2611,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CC_ScrollBar: if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(option)) { diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json index ad38281145..e8cec22c09 100644 --- a/src/printsupport/configure.json +++ b/src/printsupport/configure.json @@ -16,7 +16,10 @@ "libraries": { "cups": { "label": "CUPS", - "test": "unix/cups", + "test": { + "include": "cups/cups.h", + "main": "cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL); // CUPS 1.4 test" + }, "sources": [ "-lcups" ] diff --git a/src/sql/models/qsqlrelationaldelegate.h b/src/sql/models/qsqlrelationaldelegate.h index a689e88ba3..53f43a4acb 100644 --- a/src/sql/models/qsqlrelationaldelegate.h +++ b/src/sql/models/qsqlrelationaldelegate.h @@ -45,8 +45,12 @@ #ifdef QT_WIDGETS_LIB #include <QtWidgets/qitemdelegate.h> +#if QT_CONFIG(listview) #include <QtWidgets/qlistview.h> +#endif +#if QT_CONFIG(combobox) #include <QtWidgets/qcombobox.h> +#endif #include <QtSql/qsqldriver.h> #include <QtSql/qsqlrelationaltablemodel.h> diff --git a/src/widgets/accessible/accessible.pri b/src/widgets/accessible/accessible.pri index e63ae28d30..06467d0ff0 100644 --- a/src/widgets/accessible/accessible.pri +++ b/src/widgets/accessible/accessible.pri @@ -5,7 +5,6 @@ qtConfig(accessibility) { accessible/qaccessiblewidget.h \ accessible/qaccessiblewidgetfactory_p.h \ accessible/complexwidgets_p.h \ - accessible/itemviews_p.h \ accessible/qaccessiblemenu_p.h \ accessible/qaccessiblewidgets_p.h \ accessible/rangecontrols_p.h \ @@ -15,9 +14,13 @@ qtConfig(accessibility) { accessible/qaccessiblewidget.cpp \ accessible/qaccessiblewidgetfactory.cpp \ accessible/complexwidgets.cpp \ - accessible/itemviews.cpp \ accessible/qaccessiblemenu.cpp \ accessible/qaccessiblewidgets.cpp \ accessible/rangecontrols.cpp \ accessible/simplewidgets.cpp + + qtConfig(itemviews) { + HEADERS += accessible/itemviews_p.h + SOURCES += accessible/itemviews.cpp + } } diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp index 50aba759c3..5442c145a0 100644 --- a/src/widgets/accessible/complexwidgets.cpp +++ b/src/widgets/accessible/complexwidgets.cpp @@ -42,10 +42,16 @@ #include <qaccessible.h> #include <qapplication.h> #include <qevent.h> +#if QT_CONFIG(itemviews) #include <qheaderview.h> +#endif +#if QT_CONFIG(tabbar) #include <qtabbar.h> +#include <private/qtabbar_p.h> +#endif +#if QT_CONFIG(combobox) #include <qcombobox.h> -#include <qlistview.h> +#endif #include <qlineedit.h> #include <qstyle.h> #include <qstyleoption.h> @@ -53,7 +59,6 @@ #if QT_CONFIG(whatsthis) #include <qwhatsthis.h> #endif -#include <private/qtabbar_p.h> #include <QAbstractScrollArea> #include <QScrollArea> #include <QScrollBar> @@ -66,7 +71,7 @@ QT_BEGIN_NAMESPACE QString qt_accStripAmp(const QString &text); QString qt_accHotKey(const QString &text); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \class QAccessibleTabBar \brief The QAccessibleTabBar class implements the QAccessibleInterface for tab bars. @@ -259,9 +264,9 @@ QString QAccessibleTabBar::text(QAccessible::Text t) const return QString(); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) /*! \class QAccessibleComboBox \brief The QAccessibleComboBox class implements the QAccessibleInterface for editable and read-only combo boxes. @@ -379,7 +384,7 @@ QStringList QAccessibleComboBox::keyBindingsForAction(const QString &/*actionNam return QStringList(); } -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_SCROLLAREA // ======================= QAccessibleAbstractScrollArea ======================= diff --git a/src/widgets/accessible/complexwidgets_p.h b/src/widgets/accessible/complexwidgets_p.h index d43b06f4a4..6f5c950631 100644 --- a/src/widgets/accessible/complexwidgets_p.h +++ b/src/widgets/accessible/complexwidgets_p.h @@ -54,7 +54,9 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> #include <QtCore/qpointer.h> #include <QtWidgets/qaccessiblewidget.h> +#if QT_CONFIG(itemviews) #include <QtWidgets/qabstractitemview.h> +#endif QT_BEGIN_NAMESPACE @@ -105,7 +107,7 @@ public: }; #endif // QT_NO_SCROLLAREA -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class QAccessibleTabBar : public QAccessibleWidget { public: @@ -122,9 +124,9 @@ protected: QTabBar *tabBar() const; mutable QHash<int, QAccessible::Id> m_childInterfaces; }; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) class QAccessibleComboBox : public QAccessibleWidget { public: @@ -146,7 +148,7 @@ public: protected: QComboBox *comboBox() const; }; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #endif // QT_NO_ACCESSIBILITY diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp index 4d1a4589ee..4d37400dc9 100644 --- a/src/widgets/accessible/itemviews.cpp +++ b/src/widgets/accessible/itemviews.cpp @@ -43,7 +43,9 @@ #if QT_CONFIG(tableview) #include <qtableview.h> #endif +#if QT_CONFIG(listview) #include <qlistview.h> +#endif #if QT_CONFIG(treeview) #include <qtreeview.h> #include <private/qtreeview_p.h> @@ -54,7 +56,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_ITEMVIEWS /* Implementation of the IAccessible2 table2 interface. Much simpler than the other table interfaces since there is only the main table and cells: @@ -96,7 +97,7 @@ QAccessibleTable::QAccessibleTable(QWidget *w) m_role = QAccessible::Tree; } else #endif -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (qobject_cast<const QListView*>(view())) { m_role = QAccessible::List; } else @@ -1213,8 +1214,6 @@ QHeaderView *QAccessibleTableHeaderCell::headerView() const return header; } -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QT_NO_ACCESSIBILITY diff --git a/src/widgets/accessible/itemviews_p.h b/src/widgets/accessible/itemviews_p.h index 9542a569db..72841b8a0f 100644 --- a/src/widgets/accessible/itemviews_p.h +++ b/src/widgets/accessible/itemviews_p.h @@ -58,13 +58,12 @@ #include <QtWidgets/qabstractitemview.h> #include <QtWidgets/qheaderview.h> +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE #ifndef QT_NO_ACCESSIBILITY -#ifndef QT_NO_ITEMVIEWS - class QAccessibleTableCell; class QAccessibleTableHeaderCell; @@ -299,8 +298,6 @@ private: }; -#endif - #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp index a39674dc7a..c3de7a7dd6 100644 --- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp +++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp @@ -43,7 +43,9 @@ #include "simplewidgets_p.h" #include "rangecontrols_p.h" #include "complexwidgets_p.h" +#if QT_CONFIG(itemviews) #include "itemviews_p.h" +#endif #include <qtoolbutton.h> #if QT_CONFIG(treeview) @@ -79,7 +81,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje else iface = new QAccessibleLineEdit(widget); #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) } else if (classname == QLatin1String("QComboBox")) { iface = new QAccessibleComboBox(widget); #endif @@ -146,12 +148,12 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje } else if (classname == QLatin1String("QTreeView")) { iface = new QAccessibleTree(widget); #endif // QT_CONFIG(treeview) -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) } else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) { iface = new QAccessibleTable(widget); // ### This should be cleaned up. We return the parent for the scrollarea to hide it. -#endif // QT_NO_ITEMVIEWS -#ifndef QT_NO_TABBAR +#endif // QT_CONFIG(itemviews) +#if QT_CONFIG(tabbar) } else if (classname == QLatin1String("QTabBar")) { iface = new QAccessibleTabBar(widget); #endif @@ -209,11 +211,11 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje } else if (classname == QLatin1String("QScrollArea")) { iface = new QAccessibleScrollArea(widget); #endif -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) } else if (classname == QLatin1String("QCalendarWidget")) { iface = new QAccessibleCalendarWidget(widget); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) } else if (classname == QLatin1String("QDockWidget")) { iface = new QAccessibleDockWidget(widget); #endif diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp index 60f489d487..e28833274e 100644 --- a/src/widgets/accessible/qaccessiblewidgets.cpp +++ b/src/widgets/accessible/qaccessiblewidgets.cpp @@ -62,11 +62,17 @@ #include <QRubberBand> #endif #include <QTextBrowser> +#if QT_CONFIG(calendarwidget) #include <QCalendarWidget> +#endif +#if QT_CONFIG(itemviews) #include <QAbstractItemView> +#endif +#if QT_CONFIG(dockwidget) #include <QDockWidget> -#include <QMainWindow> #include <private/qdockwidget_p.h> +#endif +#include <QMainWindow> #include <QFocusFrame> #ifndef QT_NO_ACCESSIBILITY @@ -506,7 +512,7 @@ QAccessible::Role QAccessibleTextBrowser::role() const } #endif // QT_NO_TEXTBROWSER && QT_NO_CURSOR -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) // ===================== QAccessibleCalendarWidget ======================== QAccessibleCalendarWidget::QAccessibleCalendarWidget(QWidget *widget) : QAccessibleWidget(widget, QAccessible::Table) @@ -561,9 +567,9 @@ QWidget *QAccessibleCalendarWidget::navigationBar() const } return 0; } -#endif // QT_NO_CALENDARWIDGET +#endif // QT_CONFIG(calendarwidget) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // Dock Widget - order of children: // - Content widget @@ -644,7 +650,7 @@ QString QAccessibleDockWidget::text(QAccessible::Text t) const } return QString(); } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_CURSOR diff --git a/src/widgets/accessible/qaccessiblewidgets_p.h b/src/widgets/accessible/qaccessiblewidgets_p.h index 4d945a2016..3ff67c0c9b 100644 --- a/src/widgets/accessible/qaccessiblewidgets_p.h +++ b/src/widgets/accessible/qaccessiblewidgets_p.h @@ -266,7 +266,7 @@ public: }; #endif // QT_NO_TEXTBROWSER && QT_NO_CURSOR -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) class QAccessibleCalendarWidget : public QAccessibleWidget { public: @@ -284,9 +284,9 @@ private: QAbstractItemView *calendarView() const; QWidget *navigationBar() const; }; -#endif // QT_NO_CALENDARWIDGET +#endif // QT_CONFIG(calendarwidget) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) class QAccessibleDockWidget: public QAccessibleWidget { public: @@ -302,7 +302,7 @@ protected: QDockWidgetLayout *dockWidgetLayout() const; }; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_MAINWINDOW class QAccessibleMainWindow : public QAccessibleWidget diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index b638adeaec..97afce1734 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -3417,7 +3417,7 @@ void QFileDialogPrivate::_q_deleteCurrent() QModelIndexList list = qFileDialogUi->listView->selectionModel()->selectedRows(); for (int i = list.count() - 1; i >= 0; --i) { - QModelIndex index = list.at(i); + QPersistentModelIndex index = list.at(i); if (index == qFileDialogUi->listView->rootIndex()) continue; @@ -3427,7 +3427,6 @@ void QFileDialogPrivate::_q_deleteCurrent() QString fileName = index.data(QFileSystemModel::FileNameRole).toString(); QString filePath = index.data(QFileSystemModel::FilePathRole).toString(); - bool isDir = model->isDir(index); QFile::Permissions p(index.parent().data(QFileSystemModel::FilePermissions).toInt()); #if QT_CONFIG(messagebox) @@ -3443,13 +3442,16 @@ void QFileDialogPrivate::_q_deleteCurrent() QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; + // the event loop has run, we have to validate if the index is valid because the model might have removed it. + if (!index.isValid()) + return; + #else if (!(p & QFile::WriteUser)) return; #endif // QT_CONFIG(messagebox) - // the event loop has run, we can NOT reuse index because the model might have removed it. - if (isDir) { + if (model->isDir(index) && !model->fileInfo(index).isSymLink()) { if (!removeDirectory(filePath)) { #if QT_CONFIG(messagebox) QMessageBox::warning(q, q->windowTitle(), diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index 9f2d15d31b..710ee611b9 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -98,7 +98,7 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent) if (listener.canConvert<QObject *>()) { if (QObject *driveListener = listener.value<QObject *>()) { connect(driveListener, SIGNAL(driveAdded()), this, SLOT(driveAdded())); - connect(driveListener, SIGNAL(driveRemoved(QString)), this, SLOT(driveRemoved())); + connect(driveListener, SIGNAL(driveRemoved()), this, SLOT(driveRemoved())); } } # endif // Q_OS_WIN && !Q_OS_WINRT diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 872b8daf22..f88ac71cf3 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -203,8 +203,12 @@ QFileInfo QFileSystemModel::fileInfo(const QModelIndex &index) const bool QFileSystemModel::remove(const QModelIndex &aindex) { - const QString path = filePath(aindex); - const bool success = QFileInfo(path).isFile() ? QFile::remove(path) : QDir(path).removeRecursively(); + Q_D(QFileSystemModel); + + const QString path = d->filePath(aindex); + const QFileInfo fileInfo(path); + const bool success = (fileInfo.isFile() || fileInfo.isSymLink()) + ? QFile::remove(path) : QDir(path).removeRecursively(); #ifndef QT_NO_FILESYSTEMWATCHER if (success) { QFileSystemModelPrivate * d = const_cast<QFileSystemModelPrivate*>(d_func()); diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index eface182ae..5e692abd73 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -55,7 +55,6 @@ #include <QtGui/qpainter.h> #include <QtWidgets/qstyleoption.h> #include <QtWidgets/qgraphicsview.h> -#include <QtWidgets/qlistview.h> #include <QtWidgets/qlineedit.h> #include <QtWidgets/qtextedit.h> diff --git a/src/widgets/itemviews/itemviews.pri b/src/widgets/itemviews/itemviews.pri index c68aa590bc..e95b640d18 100644 --- a/src/widgets/itemviews/itemviews.pri +++ b/src/widgets/itemviews/itemviews.pri @@ -6,29 +6,22 @@ HEADERS += \ itemviews/qabstractitemview_p.h \ itemviews/qheaderview.h \ itemviews/qheaderview_p.h \ - itemviews/qlistview.h \ - itemviews/qlistview_p.h \ itemviews/qbsptree_p.h \ itemviews/qabstractitemdelegate.h \ itemviews/qabstractitemdelegate_p.h \ itemviews/qitemdelegate.h \ - itemviews/qdirmodel.h \ itemviews/qwidgetitemdata_p.h \ itemviews/qitemeditorfactory.h \ itemviews/qitemeditorfactory_p.h \ - itemviews/qdatawidgetmapper.h \ itemviews/qstyleditemdelegate.h SOURCES += \ itemviews/qabstractitemview.cpp \ itemviews/qheaderview.cpp \ - itemviews/qlistview.cpp \ itemviews/qbsptree.cpp \ itemviews/qabstractitemdelegate.cpp \ itemviews/qitemdelegate.cpp \ - itemviews/qdirmodel.cpp \ itemviews/qitemeditorfactory.cpp \ - itemviews/qdatawidgetmapper.cpp \ itemviews/qstyleditemdelegate.cpp } @@ -43,6 +36,24 @@ qtConfig(columnview) { itemviews/qcolumnviewgrip.cpp } +qtConfig(datawidgetmapper) { + HEADERS += itemviews/qdatawidgetmapper.h + SOURCES += itemviews/qdatawidgetmapper.cpp +} + +qtConfig(dirmodel) { + HEADERS += itemviews/qdirmodel.h + SOURCES += itemviews/qdirmodel.cpp +} + +qtConfig(listview) { + HEADERS += \ + itemviews/qlistview.h \ + itemviews/qlistview_p.h + + SOURCES += itemviews/qlistview.cpp +} + qtConfig(listwidget) { HEADERS += \ itemviews/qlistwidget.h \ diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index 5b119cc79e..fd4699409c 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -39,7 +39,6 @@ #include "qabstractitemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include <qabstractitemmodel.h> #include <qabstractitemview.h> #include <qfontmetrics.h> @@ -606,5 +605,3 @@ void QAbstractItemDelegatePrivate::_q_commitDataAndCloseEditor(QWidget *editor) QT_END_NAMESPACE #include "moc_qabstractitemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qabstractitemdelegate.h b/src/widgets/itemviews/qabstractitemdelegate.h index 9f7a7716af..9b6bde1c87 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.h +++ b/src/widgets/itemviews/qabstractitemdelegate.h @@ -44,10 +44,9 @@ #include <QtCore/qobject.h> #include <QtWidgets/qstyleoption.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QPainter; class QModelIndex; @@ -127,8 +126,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_commitDataAndCloseEditor(QWidget*)) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QABSTRACTITEMDELEGATE_H diff --git a/src/widgets/itemviews/qabstractitemdelegate_p.h b/src/widgets/itemviews/qabstractitemdelegate_p.h index 0b03be63f0..da76d31e8b 100644 --- a/src/widgets/itemviews/qabstractitemdelegate_p.h +++ b/src/widgets/itemviews/qabstractitemdelegate_p.h @@ -55,7 +55,7 @@ #include "qabstractitemdelegate.h" #include <private/qobject_p.h> -#ifndef QT_NO_ITEMVIEWS +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE @@ -73,6 +73,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QABSTRACTITEMDELEGATE_P_H diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 78189c13c3..f7b0ecdf5d 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -39,7 +39,6 @@ #include "qabstractitemview.h" -#ifndef QT_NO_ITEMVIEWS #include <qpointer.h> #include <qapplication.h> #include <qclipboard.h> @@ -4502,5 +4501,3 @@ QModelIndexList QAbstractItemViewPrivate::selectedDraggableIndexes() const QT_END_NAMESPACE #include "moc_qabstractitemview.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h index e2249ec3aa..6a007da348 100644 --- a/src/widgets/itemviews/qabstractitemview.h +++ b/src/widgets/itemviews/qabstractitemview.h @@ -49,10 +49,9 @@ class tst_QAbstractItemView; class tst_QTreeView; -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QMenu; class QDrag; @@ -382,8 +381,6 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractItemView::EditTriggers) -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QABSTRACTITEMVIEW_H diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index 5e3858f491..d8af96af55 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -64,7 +64,7 @@ #include "QtCore/qbasictimer.h" #include "QtCore/qelapsedtimer.h" -#ifndef QT_NO_ITEMVIEWS +QT_REQUIRE_CONFIG(itemviews); QT_BEGIN_NAMESPACE @@ -477,6 +477,4 @@ inline int qBinarySearch(const QVector<T> &vec, const T &item, int start, int en QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QABSTRACTITEMVIEW_P_H diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp index 99704c7911..1f0dbff7a9 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.cpp +++ b/src/widgets/itemviews/qdatawidgetmapper.cpp @@ -39,8 +39,6 @@ #include "qdatawidgetmapper.h" -#ifndef QT_NO_DATAWIDGETMAPPER - #include "qabstractitemmodel.h" #include "qitemdelegate.h" #include "qmetaobject.h" @@ -827,5 +825,3 @@ QDataWidgetMapper::SubmitPolicy QDataWidgetMapper::submitPolicy() const QT_END_NAMESPACE #include "moc_qdatawidgetmapper.cpp" - -#endif // QT_NO_DATAWIDGETMAPPER diff --git a/src/widgets/itemviews/qdatawidgetmapper.h b/src/widgets/itemviews/qdatawidgetmapper.h index 4d244349ad..7d4d61378a 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.h +++ b/src/widgets/itemviews/qdatawidgetmapper.h @@ -43,11 +43,10 @@ #include <QtWidgets/qtwidgetsglobal.h> #include "QtCore/qobject.h" -#ifndef QT_NO_DATAWIDGETMAPPER +QT_REQUIRE_CONFIG(datawidgetmapper); QT_BEGIN_NAMESPACE - class QAbstractItemDelegate; class QAbstractItemModel; class QModelIndex; @@ -117,6 +116,4 @@ private: QT_END_NAMESPACE -#endif // QT_NO_DATAWIDGETMAPPER #endif - diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp index 9b54c5c2fe..449850c42e 100644 --- a/src/widgets/itemviews/qdirmodel.cpp +++ b/src/widgets/itemviews/qdirmodel.cpp @@ -39,7 +39,6 @@ #include "qdirmodel.h" -#ifndef QT_NO_DIRMODEL #include <qfile.h> #include <qfilesystemmodel.h> #include <qurl.h> @@ -1374,5 +1373,3 @@ QFileInfo QDirModelPrivate::resolvedInfo(QFileInfo info) QT_END_NAMESPACE #include "moc_qdirmodel.cpp" - -#endif // QT_NO_DIRMODEL diff --git a/src/widgets/itemviews/qdirmodel.h b/src/widgets/itemviews/qdirmodel.h index 90a9809986..30810cf4f6 100644 --- a/src/widgets/itemviews/qdirmodel.h +++ b/src/widgets/itemviews/qdirmodel.h @@ -45,10 +45,9 @@ #include <QtCore/qdir.h> #include <QtWidgets/qfileiconprovider.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(dirmodel); -#ifndef QT_NO_DIRMODEL +QT_BEGIN_NAMESPACE class QDirModelPrivate; @@ -143,8 +142,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_refresh()) }; -#endif // QT_NO_DIRMODEL - QT_END_NAMESPACE #endif // QDIRMODEL_H diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 89d0c7f93c..d6db7deee7 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -39,7 +39,6 @@ #include "qheaderview.h" -#ifndef QT_NO_ITEMVIEWS #include <qbitarray.h> #include <qbrush.h> #include <qdebug.h> @@ -3961,6 +3960,4 @@ bool QHeaderViewPrivate::read(QDataStream &in) QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #include "moc_qheaderview.cpp" diff --git a/src/widgets/itemviews/qheaderview.h b/src/widgets/itemviews/qheaderview.h index 4be97c0c7e..ec4500d81e 100644 --- a/src/widgets/itemviews/qheaderview.h +++ b/src/widgets/itemviews/qheaderview.h @@ -43,10 +43,9 @@ #include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qabstractitemview.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QHeaderViewPrivate; class QStyleOptionHeader; @@ -265,8 +264,6 @@ inline void QHeaderView::hideSection(int alogicalIndex) inline void QHeaderView::showSection(int alogicalIndex) { setSectionHidden(alogicalIndex, false); } -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QHEADERVIEW_H diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h index d6b119512c..8fc8b88aa5 100644 --- a/src/widgets/itemviews/qheaderview_p.h +++ b/src/widgets/itemviews/qheaderview_p.h @@ -54,14 +54,14 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> #include "private/qabstractitemview_p.h" -#ifndef QT_NO_ITEMVIEWS - #include "QtCore/qbitarray.h" #include "QtWidgets/qapplication.h" #if QT_CONFIG(label) #include "QtWidgets/qlabel.h" #endif +QT_REQUIRE_CONFIG(itemviews); + QT_BEGIN_NAMESPACE class QHeaderViewPrivate: public QAbstractItemViewPrivate @@ -391,6 +391,4 @@ Q_DECLARE_TYPEINFO(QHeaderViewPrivate::SectionItem, Q_PRIMITIVE_TYPE); QT_END_NAMESPACE -#endif // QT_NO_ITEMVIEWS - #endif // QHEADERVIEW_P_H diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp index 86deea75b7..d9caebec8a 100644 --- a/src/widgets/itemviews/qitemdelegate.cpp +++ b/src/widgets/itemviews/qitemdelegate.cpp @@ -39,7 +39,6 @@ #include "qitemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include <qabstractitemmodel.h> #include <qapplication.h> #include <qbrush.h> @@ -1199,5 +1198,3 @@ QStyleOptionViewItem QItemDelegate::setOptions(const QModelIndex &index, QT_END_NAMESPACE #include "moc_qitemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qitemdelegate.h b/src/widgets/itemviews/qitemdelegate.h index 3d98419c80..21594327ef 100644 --- a/src/widgets/itemviews/qitemdelegate.h +++ b/src/widgets/itemviews/qitemdelegate.h @@ -46,10 +46,9 @@ #include <QtGui/qpixmap.h> #include <QtCore/qvariant.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QItemDelegatePrivate; class QItemEditorFactory; @@ -126,8 +125,6 @@ private: Q_DISABLE_COPY(QItemDelegate) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMDELEGATE_H diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp index a31689e0b5..54b7c6666f 100644 --- a/src/widgets/itemviews/qitemeditorfactory.cpp +++ b/src/widgets/itemviews/qitemeditorfactory.cpp @@ -41,9 +41,9 @@ #include "qitemeditorfactory.h" #include "qitemeditorfactory_p.h" -#ifndef QT_NO_ITEMVIEWS - +#if QT_CONFIG(combobox) #include <qcombobox.h> +#endif #if QT_CONFIG(datetimeedit) #include <qdatetimeedit.h> #endif @@ -52,6 +52,8 @@ #endif #include <qlineedit.h> #include <qspinbox.h> +#include <qstyle.h> +#include <qstyleoption.h> #include <limits.h> #include <float.h> #include <qapplication.h> @@ -62,7 +64,7 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) class QBooleanComboBox : public QComboBox { @@ -75,7 +77,7 @@ public: bool value() const; }; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_SPINBOX @@ -234,7 +236,7 @@ public: QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent) const { switch (userType) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case QVariant::Bool: { QBooleanComboBox *cb = new QBooleanComboBox(parent); cb->setFrame(false); @@ -300,7 +302,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent) QByteArray QDefaultItemEditorFactory::valuePropertyName(int userType) const { switch (userType) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case QVariant::Bool: return "currentIndex"; #endif @@ -595,7 +597,7 @@ void QExpandingLineEdit::resizeToContents() #endif // QT_NO_LINEEDIT -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) QBooleanComboBox::QBooleanComboBox(QWidget *parent) : QComboBox(parent) @@ -614,14 +616,12 @@ bool QBooleanComboBox::value() const return (currentIndex() == 1); } -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) QT_END_NAMESPACE -#if !defined(QT_NO_LINEEDIT) || !defined(QT_NO_COMBOBOX) +#if !defined(QT_NO_LINEEDIT) || QT_CONFIG(combobox) #include "qitemeditorfactory.moc" #endif #include "moc_qitemeditorfactory_p.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qitemeditorfactory.h b/src/widgets/itemviews/qitemeditorfactory.h index dea9bce794..f2610ad3de 100644 --- a/src/widgets/itemviews/qitemeditorfactory.h +++ b/src/widgets/itemviews/qitemeditorfactory.h @@ -46,10 +46,9 @@ #include <QtCore/qhash.h> #include <QtCore/qvariant.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QWidget; @@ -111,8 +110,6 @@ private: QHash<int, QItemEditorCreatorBase *> creatorMap; }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QITEMEDITORFACTORY_H diff --git a/src/widgets/itemviews/qitemeditorfactory_p.h b/src/widgets/itemviews/qitemeditorfactory_p.h index 91edcf65ba..409ecc684f 100644 --- a/src/widgets/itemviews/qitemeditorfactory_p.h +++ b/src/widgets/itemviews/qitemeditorfactory_p.h @@ -55,12 +55,11 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> #include <qlineedit.h> -#ifndef QT_NO_ITEMVIEWS - #ifndef QT_NO_LINEEDIT -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(itemviews); +QT_BEGIN_NAMESPACE class QExpandingLineEdit : public QLineEdit { @@ -92,6 +91,4 @@ QT_END_NAMESPACE #endif // QT_NO_LINEEDIT -#endif //QT_NO_ITEMVIEWS - #endif //QITEMEDITORFACTORY_P_H diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp index e234bae4dd..0efee755a2 100644 --- a/src/widgets/itemviews/qlistview.cpp +++ b/src/widgets/itemviews/qlistview.cpp @@ -40,7 +40,6 @@ #include "qlistview.h" -#ifndef QT_NO_LISTVIEW #include <qabstractitemdelegate.h> #include <qapplication.h> #include <qpainter.h> @@ -2814,11 +2813,17 @@ bool QIconModeViewBase::filterDragLeaveEvent(QDragLeaveEvent *e) bool QIconModeViewBase::filterDragMoveEvent(QDragMoveEvent *e) { - if (e->source() != qq || !dd->canDrop(e)) - return false; + const bool wasAccepted = e->isAccepted(); // ignore by default e->ignore(); + + if (e->source() != qq || !dd->canDrop(e)) { + // restore previous acceptance on failure + e->setAccepted(wasAccepted); + return false; + } + // get old dragged items rect QRect itemsRect = this->itemsRect(draggedItems); viewport()->update(itemsRect.translated(draggedItemsDelta())); @@ -3297,5 +3302,3 @@ QSize QListView::viewportSizeHint() const QT_END_NAMESPACE #include "moc_qlistview.cpp" - -#endif // QT_NO_LISTVIEW diff --git a/src/widgets/itemviews/qlistview.h b/src/widgets/itemviews/qlistview.h index 6b164aeec8..66ec9b18b1 100644 --- a/src/widgets/itemviews/qlistview.h +++ b/src/widgets/itemviews/qlistview.h @@ -43,10 +43,9 @@ #include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qabstractitemview.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(listview); -#ifndef QT_NO_LISTVIEW +QT_BEGIN_NAMESPACE class QListViewPrivate; @@ -195,8 +194,6 @@ private: Q_DISABLE_COPY(QListView) }; -#endif // QT_NO_LISTVIEW - QT_END_NAMESPACE #endif // QLISTVIEW_H diff --git a/src/widgets/itemviews/qlistview_p.h b/src/widgets/itemviews/qlistview_p.h index 6c0e470a93..8d29767951 100644 --- a/src/widgets/itemviews/qlistview_p.h +++ b/src/widgets/itemviews/qlistview_p.h @@ -58,7 +58,7 @@ #include <limits.h> #include <qscrollbar.h> -#ifndef QT_NO_LISTVIEW +QT_REQUIRE_CONFIG(listview); QT_BEGIN_NAMESPACE @@ -474,6 +474,4 @@ inline bool QCommonListViewBase::isRightToLeft() const { return qq->isRightToLef QT_END_NAMESPACE -#endif // QT_NO_LISTVIEW - #endif // QLISTVIEW_P_H diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index 0b8019c21c..bda3325adb 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -39,7 +39,6 @@ #include "qstyleditemdelegate.h" -#ifndef QT_NO_ITEMVIEWS #include <qabstractitemmodel.h> #include <qapplication.h> #include <qbrush.h> @@ -643,5 +642,3 @@ bool QStyledItemDelegate::editorEvent(QEvent *event, QT_END_NAMESPACE #include "moc_qstyleditemdelegate.cpp" - -#endif // QT_NO_ITEMVIEWS diff --git a/src/widgets/itemviews/qstyleditemdelegate.h b/src/widgets/itemviews/qstyleditemdelegate.h index d30e6e0e9c..f3b7c4d1f4 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.h +++ b/src/widgets/itemviews/qstyleditemdelegate.h @@ -46,10 +46,9 @@ #include <QtGui/qpixmap.h> #include <QtCore/qvariant.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(itemviews); -#ifndef QT_NO_ITEMVIEWS +QT_BEGIN_NAMESPACE class QStyledItemDelegatePrivate; class QItemEditorFactory; @@ -101,8 +100,6 @@ private: Q_DISABLE_COPY(QStyledItemDelegate) }; -#endif // QT_NO_ITEMVIEWS - QT_END_NAMESPACE #endif // QSTYLEDITEMDELEGATE_H diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 48afeb1dcc..830a328948 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -493,12 +493,12 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons } if (!text.isEmpty()){ // no tip can be reused, create new tip: -#if 1 // Used to be excluded in Qt4 for Q_WS_WIN - new QTipLabel(text, w, msecDisplayTime); // sets QTipLabel::instance to itself -#else +#ifdef Q_OS_WIN32 // On windows, we can't use the widget as parent otherwise the window will be // raised when the tooltip will be shown new QTipLabel(text, QApplication::desktop()->screen(QTipLabel::getTipScreen(pos, w)), msecDisplayTime); +#else + new QTipLabel(text, w, msecDisplayTime); // sets QTipLabel::instance to itself #endif QTipLabel::instance->setTipRect(w, rect); QTipLabel::instance->placeTip(pos, w); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index e46ef55324..eee0908593 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -107,7 +107,9 @@ #include "private/qgesturemanager_p.h" #ifdef QT_KEYPAD_NAVIGATION +#if QT_CONFIG(tabwidget) #include "qtabwidget.h" // Needed in inTabWidget() +#endif #endif // QT_KEYPAD_NAVIGATION #include "qwindowcontainer_p.h" diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index ceff1a50a3..c15703ca58 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -41,13 +41,17 @@ #include "qcommonstyle_p.h" #include <qfile.h> +#if QT_CONFIG(itemviews) #include <qabstractitemview.h> +#endif #include <qapplication.h> #include <private/qguiapplication_p.h> #include <qpa/qplatformtheme.h> #include <qbitmap.h> #include <qcache.h> +#if QT_CONFIG(dockwidget) #include <qdockwidget.h> +#endif #include <qdrawutil.h> #if QT_CONFIG(dialogbuttonbox) #include <qdialogbuttonbox.h> @@ -65,8 +69,12 @@ #include <qpainterpath.h> #include <qslider.h> #include <qstyleoption.h> +#if QT_CONFIG(tabbar) #include <qtabbar.h> +#endif +#if QT_CONFIG(tabwidget) #include <qtabwidget.h> +#endif #include <qtoolbar.h> #include <qtoolbutton.h> #if QT_CONFIG(rubberband) @@ -91,7 +99,7 @@ #include <limits.h> -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) # include "private/qtextengine_p.h" #endif @@ -362,7 +370,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->setPen(oldPen); } break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PE_FrameTabBarBase: if (const QStyleOptionTabBarBase *tbb = qstyleoption_cast<const QStyleOptionTabBarBase *>(opt)) { @@ -425,7 +433,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } #else Q_UNUSED(d); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case PE_FrameTabWidget: case PE_FrameWindow: qDrawWinPanel(p, opt->rect, opt->palette, false, 0); @@ -450,7 +458,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } break; #endif // QT_NO_GROUPBOX -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case PE_FrameDockWidget: if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { int lw = frame->lineWidth; @@ -460,7 +468,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q qDrawShadePanel(p, frame->rect, frame->palette, false, lw); } break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR case PE_IndicatorToolBarHandle: p->save(); @@ -569,7 +577,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->setBrush(oldBrush); break; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PE_IndicatorTabTear: if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { bool rtl = tab->direction == Qt::RightToLeft; @@ -603,7 +611,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->drawPath(path); } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_LINEEDIT case PE_PanelLineEdit: if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { @@ -675,7 +683,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q else p->drawRect(rect); break; } -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case PE_PanelItemViewRow: if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled)) @@ -713,7 +721,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q } } break; -#endif //QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) case PE_PanelScrollAreaCorner: { const QBrush brush(opt->palette.brush(QPalette::Window)); p->fillRect(opt->rect, brush); @@ -824,7 +832,7 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut } #endif // QT_NO_TOOLBUTTON -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth) { @@ -1095,10 +1103,10 @@ void QCommonStylePrivate::viewItemLayout(const QStyleOptionViewItem *opt, QRect *textRect = display; } } -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \internal Compute the textRect and the pixmapRect from the opt rect @@ -1165,7 +1173,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *w *textRect = tr; } -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_ANIMATION /*! \internal */ @@ -1712,7 +1720,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; #endif // QT_NO_TOOLBOX -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CE_TabBarTab: if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { proxy()->drawControl(CE_TabBarTabShape, tab, p, widget); @@ -1932,7 +1940,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_SIZEGRIP case CE_SizeGrip: { p->save(); @@ -2036,7 +2044,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; } #endif // QT_CONFIG(rubberband) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case CE_DockWidgetTitle: if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) { QRect r = dwOpt->rect.adjusted(0, 0, -1, -1); @@ -2068,7 +2076,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } } break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) case CE_Header: if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { QRegion clipRegion = p->clipRegion(); @@ -2096,7 +2104,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, case CE_HeaderEmptyArea: p->fillRect(opt->rect, opt->palette.background()); break; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CE_ComboBoxLabel: if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { QRect editRect = proxy()->subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget); @@ -2128,7 +2136,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, p->restore(); } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_TOOLBAR case CE_ToolBar: if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) { @@ -2168,7 +2176,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { p->save(); @@ -2248,7 +2256,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_FRAME case CE_ShapedFrame: if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { @@ -2505,7 +2513,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, } break; #endif // QT_NO_PROGRESSBAR -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case SE_ComboBoxFocusRect: if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { int margin = cb->frame ? 3 : 0; @@ -2514,7 +2522,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = visualRect(opt->direction, opt->rect, r); } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_TOOLBOX case SE_ToolBoxTabContents: r = opt->rect; @@ -2564,7 +2572,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = subElementRect(SE_CheckBoxFocusRect, opt, widget); r |= subElementRect(SE_CheckBoxIndicator, opt, widget); break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case SE_TabWidgetTabBar: if (const QStyleOptionTabWidgetFrame *twf = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { @@ -2806,8 +2814,8 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, } break; -#endif // QT_NO_TABWIDGET -#ifndef QT_NO_TABBAR +#endif // QT_CONFIG(tabwidget) +#if QT_CONFIG(tabbar) case SE_TabBarTearIndicator: if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { switch (tab->shape) { @@ -2919,7 +2927,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = f->rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth); } break; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case SE_DockWidgetCloseButton: case SE_DockWidgetFloatButton: case SE_DockWidgetTitleBarText: @@ -3020,7 +3028,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, break; } #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case SE_ItemViewItemCheckIndicator: if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { r = subElementRect(SE_CheckBoxIndicator, opt, widget); @@ -3047,7 +3055,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt, r = d->displayRect; } break; -#endif //QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_TOOLBAR case SE_ToolBarHandle: if (const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) { @@ -3439,7 +3447,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl ir = proxy()->subControlRect(CC_TitleBar, tb, SC_TitleBarCloseButton, widget); down = tb->activeSubControls & SC_TitleBarCloseButton && (opt->state & State_Sunken); if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) || qobject_cast<const QDockWidget *>(widget) #endif ) @@ -3892,7 +3900,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const } } break; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { QRect r; @@ -3907,7 +3915,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const } } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_GROUPBOX case CC_GroupBox: if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) { @@ -4140,7 +4148,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex } break; #endif // QT_NO_TOOLBUTTON -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { int x = cb->rect.x(), @@ -4172,7 +4180,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex ret = visualRect(cb->direction, cb->rect, ret); } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CC_TitleBar: if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { const int controlMargin = 2; @@ -4412,7 +4420,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) { if ((tb->titleBarFlags & Qt::WindowType_Mask) == Qt::Tool) { ret = qMax(widget ? widget->fontMetrics().height() : opt->fontMetrics.height(), 16); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) } else if (qobject_cast<const QDockWidget*>(widget)) { ret = qMax(widget->fontMetrics().height(), int(QStyleHelper::dpiScaled(13))); #endif @@ -4524,7 +4532,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid } break; #endif // QT_NO_SLIDER -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case PM_DockWidgetSeparatorExtent: ret = int(QStyleHelper::dpiScaled(6.)); break; @@ -4538,7 +4546,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid case PM_DockWidgetFrameWidth: ret = 1; break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) case PM_SpinBoxSliderHeight: case PM_MenuBarPanelWidth: @@ -4575,7 +4583,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid break; #endif // QT_NO_TOOLBAR -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PM_TabBarTabOverlap: ret = 3; break; @@ -4839,7 +4847,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QSize(sz.width() + 6, sz.height() + 5); break; #endif // QT_NO_TOOLBUTTON -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CT_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { int fw = cmb->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, opt, widget) * 2 : 0; @@ -4849,7 +4857,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QSize(sz.width() + fw + other, sz.height() + fw); } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CT_HeaderSection: if (const QStyleOptionHeader *hdr = qstyleoption_cast<const QStyleOptionHeader *>(opt)) { bool nullIcon = hdr->icon.isNull(); @@ -4897,7 +4905,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz = QSize(1 + 3 * (buttonSize + 1), buttonSize); } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CT_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { QRect decorationRect, displayRect, checkRect; @@ -4909,7 +4917,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, break; #else Q_UNUSED(d); -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) #ifndef QT_NO_SPINBOX case CT_SpinBox: if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { @@ -5177,7 +5185,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_FocusFrame_AboveWidget: ret = false; break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case SH_TabWidget_DefaultTabPosition: ret = QTabWidget::North; break; @@ -5219,7 +5227,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_ItemView_DrawDelegateFrame: ret = 0; break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SH_TabBar_CloseButtonPosition: ret = QTabBar::RightSide; break; diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h index ebfc06139c..93db75ac2d 100644 --- a/src/widgets/styles/qcommonstyle_p.h +++ b/src/widgets/styles/qcommonstyle_p.h @@ -68,7 +68,7 @@ class Q_WIDGETS_EXPORT QCommonStylePrivate : public QStylePrivate Q_DECLARE_PUBLIC(QCommonStyle) public: inline QCommonStylePrivate() : -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) cachedOption(0), #endif animationFps(30) @@ -79,12 +79,12 @@ public: #ifndef QT_NO_ANIMATION qDeleteAll(animations); #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) delete cachedOption; #endif } -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) void viewItemDrawText(QPainter *p, const QStyleOptionViewItem *option, const QRect &rect) const; void viewItemLayout(const QStyleOptionViewItem *opt, QRect *checkRect, QRect *pixmapRect, QRect *textRect, bool sizehint) const; @@ -110,7 +110,7 @@ public: } #endif mutable QIcon tabBarcloseButtonIcon; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void tabLayout(const QStyleOptionTab *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const; #endif diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 1e584f47b8..c1b240a381 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -42,7 +42,9 @@ #if QT_CONFIG(style_fusion) || defined(QT_PLUGIN) #include "qcommonstyle_p.h" +#if QT_CONFIG(combobox) #include <qcombobox.h> +#endif #if QT_CONFIG(pushbutton) #include <qpushbutton.h> #endif diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp index 88482d28c9..63308a5e36 100644 --- a/src/widgets/styles/qpixmapstyle.cpp +++ b/src/widgets/styles/qpixmapstyle.cpp @@ -52,10 +52,16 @@ #include <QProgressBar> #include <QSlider> #include <QEvent> +#if QT_CONFIG(combobox) #include <QComboBox> +#endif +#if QT_CONFIG(itemviews) #include <QAbstractItemView> -#include <QListView> #include <QStyledItemDelegate> +#endif +#if QT_CONFIG(listview) +#include <QListView> +#endif #include <QAbstractScrollArea> #include <QScrollBar> diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp index 51fecd0d13..a346ee18c4 100644 --- a/src/widgets/styles/qstyleoption.cpp +++ b/src/widgets/styles/qstyleoption.cpp @@ -1227,7 +1227,7 @@ QStyleOptionToolBar::QStyleOptionToolBar(int version) #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \class QStyleOptionTab \brief The QStyleOptionTab class is used to describe the @@ -1475,7 +1475,7 @@ QStyleOptionTab::QStyleOptionTab(int version) The default value is QSize(-1, -1), i.e. an invalid size; */ -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /*! \class QStyleOptionProgressBar @@ -2996,7 +2996,7 @@ QStyleOptionTitleBar::QStyleOptionTitleBar(int version) \sa Qt::WindowFlags */ -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) /*! \class QStyleOptionViewItem \brief The QStyleOptionViewItem class is used to describe the @@ -3263,7 +3263,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version) therefore both at the beginning and the end. */ -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) /*! \fn T qstyleoption_cast<T>(const QStyleOption *option) \relates QStyleOption @@ -3286,7 +3286,7 @@ QStyleOptionViewItem::QStyleOptionViewItem(int version) Returns a T or 0 depending on the type of the given \a option. */ -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) /*! \class QStyleOptionTabWidgetFrame \brief The QStyleOptionTabWidgetFrame class is used to describe the @@ -3430,9 +3430,9 @@ QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version) and the height set to 0. */ -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \class QStyleOptionTabBarBase @@ -3552,7 +3552,7 @@ QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version) The default value is false; */ -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_SIZEGRIP /*! diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h index a3ed35c762..af97479ef0 100644 --- a/src/widgets/styles/qstyleoption.h +++ b/src/widgets/styles/qstyleoption.h @@ -47,13 +47,17 @@ #include <QtGui/qmatrix.h> #include <QtWidgets/qslider.h> #include <QtWidgets/qstyle.h> +#if QT_CONFIG(tabbar) #include <QtWidgets/qtabbar.h> +#endif +#if QT_CONFIG(tabwidget) #include <QtWidgets/qtabwidget.h> +#endif #if QT_CONFIG(rubberband) #include <QtWidgets/qrubberband.h> #endif #include <QtWidgets/qframe.h> -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) # include <QtCore/qabstractitemmodel.h> #endif @@ -143,7 +147,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionFrame::FrameFeatures) typedef Q_DECL_DEPRECATED QStyleOptionFrame QStyleOptionFrameV2; typedef Q_DECL_DEPRECATED QStyleOptionFrame QStyleOptionFrameV3; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) class Q_WIDGETS_EXPORT QStyleOptionTabWidgetFrame : public QStyleOption { public: @@ -168,10 +172,10 @@ protected: }; typedef Q_DECL_DEPRECATED QStyleOptionTabWidgetFrame QStyleOptionTabWidgetFrameV2; -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class Q_WIDGETS_EXPORT QStyleOptionTabBarBase : public QStyleOption { public: @@ -191,7 +195,7 @@ protected: }; typedef Q_DECL_DEPRECATED QStyleOptionTabBarBase QStyleOptionTabBarBaseV2; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) class Q_WIDGETS_EXPORT QStyleOptionHeader : public QStyleOption { @@ -245,7 +249,7 @@ protected: Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionButton::ButtonFeatures) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class Q_WIDGETS_EXPORT QStyleOptionTab : public QStyleOption { public: @@ -284,7 +288,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionTab::CornerWidgets) typedef Q_DECL_DEPRECATED QStyleOptionTab QStyleOptionTabV2; typedef Q_DECL_DEPRECATED QStyleOptionTab QStyleOptionTabV3; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) #ifndef QT_NO_TOOLBAR @@ -388,7 +392,7 @@ protected: typedef Q_DECL_DEPRECATED QStyleOptionDockWidget QStyleOptionDockWidgetV2; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) class Q_WIDGETS_EXPORT QStyleOptionViewItem : public QStyleOption { @@ -443,7 +447,7 @@ typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV2; typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV3; typedef Q_DECL_DEPRECATED QStyleOptionViewItem QStyleOptionViewItemV4; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) class Q_WIDGETS_EXPORT QStyleOptionToolBox : public QStyleOption { diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 4fe697a32f..b42876d72e 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -51,7 +51,9 @@ #include <qstyleoption.h> #include <qlineedit.h> #include <private/qwindowsstyle_p.h> +#if QT_CONFIG(combobox) #include <qcombobox.h> +#endif #include "private/qcssparser_p.h" #include "private/qmath_p.h" #include <qabstractscrollarea.h> @@ -69,13 +71,19 @@ #include <qcheckbox.h> #endif #include <qstatusbar.h> +#if QT_CONFIG(itemviews) #include <qheaderview.h> +#endif #include <private/qwindowsstyle_p_p.h> #include <private/qstyleanimation_p.h> +#if QT_CONFIG(tabbar) #include <qtabbar.h> +#endif #include <QMetaProperty> #include <qmainwindow.h> +#if QT_CONFIG(dockwidget) #include <qdockwidget.h> +#endif #include <qmdisubwindow.h> #if QT_CONFIG(dialog) #include <qdialog.h> @@ -1641,7 +1649,7 @@ int QStyleSheetStyle::nativeFrameWidth(const QWidget *w) return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w); #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (qobject_cast<const QComboBox *>(w)) return base->pixelMetric(QStyle::PM_ComboBoxFrameWidth, 0, w); #endif @@ -1719,7 +1727,7 @@ static quint64 pseudoClass(QStyle::State state) static void qt_check_if_internal_object(const QObject **obj, int *element) { -#ifdef QT_NO_DOCKWIDGET +#if !QT_CONFIG(dockwidget) Q_UNUSED(obj); Q_UNUSED(element); #else @@ -1885,7 +1893,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption extraClass |= PseudoClass_NextSelected; else if (hdr->selectedPosition == QStyleOptionHeader::PreviousIsSelected) extraClass |= PseudoClass_PreviousSelected; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) } else if (const QStyleOptionTabWidgetFrame *tab = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { switch (tab->shape) { case QTabBar::RoundedNorth: @@ -1908,7 +1916,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption break; } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) } else if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { if (tab->position == QStyleOptionTab::OnlyOneTab) extraClass |= PseudoClass_OnlyOne; @@ -1944,7 +1952,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption default: break; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } else if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(opt)) { if (btn->features & QStyleOptionButton::Flat) extraClass |= PseudoClass_Flat; @@ -1994,7 +2002,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption extraClass |= PseudoClass_PreviousSelected; } #endif // QT_NO_TOOLBOX -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) else if (const QStyleOptionDockWidget *dw = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) { if (dw->verticalTitleBar) extraClass |= PseudoClass_Vertical; @@ -2007,8 +2015,8 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption if (dw->movable) extraClass |= PseudoClass_Movable; } -#endif // QT_NO_DOCKWIDGET -#ifndef QT_NO_ITEMVIEWS +#endif // QT_CONFIG(dockwidget) +#if QT_CONFIG(itemviews) else if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { if (vopt->features & QStyleOptionViewItem::Alternate) extraClass |= PseudoClass_Alternate; @@ -2340,7 +2348,7 @@ QRect QStyleSheetStyle::positionRect(const QWidget *w, const QRenderRule& rule1, */ static QWidget *embeddedWidget(QWidget *w) { -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (QComboBox *cmb = qobject_cast<QComboBox *>(w)) { if (cmb->isEditable()) return cmb->lineEdit(); @@ -2374,7 +2382,7 @@ static QWidget *containerWidget(const QWidget *w) #ifndef QT_NO_LINEEDIT if (qobject_cast<const QLineEdit *>(w)) { //if the QLineEdit is an embeddedWidget, we need the rule of the real widget -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (qobject_cast<const QComboBox *>(w->parentWidget())) return w->parentWidget(); #endif @@ -2413,7 +2421,7 @@ static bool unstylable(const QWidget *w) // detect QComboBoxPrivateContainer else if (qobject_cast<const QFrame *>(w)) { if (0 -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) || qobject_cast<const QComboBox *>(w->parentWidget()) #endif ) @@ -2421,7 +2429,7 @@ static bool unstylable(const QWidget *w) } #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (w->metaObject() == &QWidget::staticMetaObject && qobject_cast<const QTabBar*>(w->parentWidget())) return true; // The moving tab of a QTabBar @@ -2438,7 +2446,7 @@ static quint64 extendedPseudoClass(const QWidget *w) pc |= ((slider->orientation() == Qt::Vertical) ? PseudoClass_Vertical : PseudoClass_Horizontal); } else #endif -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (const QComboBox *combo = qobject_cast<const QComboBox *>(w)) { if (combo->isEditable()) pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly); @@ -2805,10 +2813,10 @@ void QStyleSheetStyle::polish(QWidget *w) QRenderRule rule = renderRule(w, PseudoElement_None, PseudoClass_Any); if (rule.hasDrawable() || rule.hasBox()) { if (w->metaObject() == &QWidget::staticMetaObject -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) || qobject_cast<QHeaderView *>(w) #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) || qobject_cast<QTabBar *>(w) #endif #ifndef QT_NO_FRAME @@ -2912,7 +2920,7 @@ void QStyleSheetStyle::unpolish(QApplication *app) styleSheetCaches->styleSheetCache.remove(qApp); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) inline static bool verticalTabs(QTabBar::Shape shape) { return shape == QTabBar::RoundedWest @@ -2920,7 +2928,7 @@ inline static bool verticalTabs(QTabBar::Shape shape) || shape == QTabBar::TriangularWest || shape == QTabBar::TriangularEast; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *w) const @@ -3771,7 +3779,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q } return; -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CE_ComboBoxLabel: if (!rule.hasBox()) break; @@ -3807,7 +3815,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q return; } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) case CE_Header: if (hasStyleRule(w, PseudoElement_HeaderViewUpArrow) @@ -4069,7 +4077,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q fallback = true; break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CE_ItemViewItem: if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); @@ -4086,9 +4094,9 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q return; } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CE_TabBarTab: if (hasStyleRule(w, PseudoElement_TabBarTab)) { QWindowsStyle::drawControl(ce, opt, p, w); @@ -4123,7 +4131,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q return; } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case CE_ColumnViewGrip: if (rule.hasDrawable()) { @@ -4477,7 +4485,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op rule.drawBorder(p, opt->rect); return; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case PE_FrameTabWidget: if (const QStyleOptionTabWidgetFrame *frm = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(opt)) { QRenderRule subRule = renderRule(w, opt, PseudoElement_TabWidgetPane); @@ -4492,7 +4500,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op return; } break; -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) case PE_IndicatorProgressChunk: pseudoElement = PseudoElement_ProgressBarChunk; @@ -4530,7 +4538,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op case PE_IndicatorSpinPlus: pseudoElement = PseudoElement_SpinBoxUpArrow; break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case PE_IndicatorTabClose: if (w) w = w->parentWidget(); //match on the QTabBar instead of the CloseButton @@ -4790,7 +4798,7 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const } break; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) case PM_TabBarTabHSpace: case PM_TabBarTabVSpace: subRule = renderRule(w, opt, PseudoElement_TabBarTab); @@ -4823,7 +4831,7 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const } break; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) case PM_SliderThickness: // horizontal slider's height (sizeHint) case PM_SliderLength: // minimum length of slider @@ -5051,7 +5059,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op return rule.boxSize(sz); break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CT_TabBarTab: { QRenderRule subRule = renderRule(w, opt, PseudoElement_TabBarTab); if (subRule.hasBox() || !subRule.hasNativeBorder()) { @@ -5075,7 +5083,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op sz = subRule.adjustSize(csz); break; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case CT_MdiControls: if (const QStyleOptionComplex *ccOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)) { @@ -5107,7 +5115,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op } break; -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case CT_ItemViewItem: { QRenderRule subRule = renderRule(w, opt, PseudoElement_ViewItem); sz = baseStyle()->sizeFromContents(ct, opt, csz, w); @@ -5116,7 +5124,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op sz = subRule.boxSize(sz); return sz; } -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) default: break; @@ -5275,16 +5283,16 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi case SH_ScrollBar_RollBetweenButtons: s = QLatin1String("scrollbar-roll-between-buttons"); break; case SH_ScrollBar_ScrollWhenPointerLeavesControl: s = QLatin1String("scrollbar-scroll-when-pointer-leaves-control"); break; case SH_TabBar_Alignment: -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (qobject_cast<const QTabWidget *>(w)) { rule = renderRule(w, opt, PseudoElement_TabWidgetTabBar); if (rule.hasPosition()) return rule.position()->position; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) s = QLatin1String("alignment"); break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SH_TabBar_CloseButtonPosition: rule = renderRule(w, opt, PseudoElement_TabBarTabCloseButton); if (rule.hasPosition()) { @@ -5299,7 +5307,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi case SH_TabBar_ElideMode: s = QLatin1String("tabbar-elide-mode"); break; case SH_TabBar_PreferNoArrows: s = QLatin1String("tabbar-prefer-no-arrows"); break; case SH_ComboBox_PopupFrameStyle: -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) if (qobject_cast<const QComboBox *>(w)) { QAbstractItemView *view = w->findChild<QAbstractItemView *>(); if (view) { @@ -5309,7 +5317,7 @@ int QStyleSheetStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWi return QFrame::NoFrame; } } -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) break; case SH_DialogButtonBox_ButtonsHaveIcons: s = QLatin1String("dialogbuttonbox-buttons-have-icons"); break; case SH_Workspace_FillSpaceOnMaximize: s = QLatin1String("mdi-fill-space-on-maximize"); break; @@ -5692,7 +5700,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c RECURSION_GUARD(return baseStyle()->subElementRect(se, opt, w)) QRenderRule rule = renderRule(w, opt); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) int pe = PseudoElement_None; #endif @@ -5758,7 +5766,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c case SE_CheckBoxClickRect: // relies on indicator and contents return ParentStyle::subElementRect(se, opt, w); -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) case SE_ViewItemCheckIndicator: if (!qstyleoption_cast<const QStyleOptionViewItem *>(opt)) { return subElementRect(SE_CheckBoxIndicator, opt, w); @@ -5787,7 +5795,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c } } break; -#endif // QT_NO_ITEMVIEWS +#endif // QT_CONFIG(itemviews) case SE_HeaderArrow: { QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewUpArrow); @@ -5820,7 +5828,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c } break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case SE_TabWidgetLeftCorner: pe = PseudoElement_TabWidgetLeftCorner; // intentionally falls through @@ -5887,7 +5895,7 @@ QRect QStyleSheetStyle::subElementRect(SubElement se, const QStyleOption *opt, c } break; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case SE_DockWidgetCloseButton: case SE_DockWidgetFloatButton: { diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index f805e29db1..63f7cd43ef 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -55,7 +55,9 @@ #include "qrubberband.h" #endif #include "qstyleoption.h" +#if QT_CONFIG(tabbar) #include "qtabbar.h" +#endif #include "qwidget.h" #include "qdebug.h" #include "qmainwindow.h" @@ -65,7 +67,9 @@ #if QT_CONFIG(wizard) #include "qwizard.h" #endif +#if QT_CONFIG(listview) #include "qlistview.h" +#endif #include <private/qmath_p.h> #include <qmath.h> #include <QtGui/qscreen.h> @@ -332,7 +336,7 @@ int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm) break; case QStyle::PM_DockWidgetSeparatorExtent: return 4; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QStyle::PM_TabBarTabShiftHorizontal: return 0; case QStyle::PM_TabBarTabShiftVertical: @@ -548,7 +552,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid break; case SH_ItemView_ShowDecorationSelected: -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (qobject_cast<const QListView*>(widget)) ret = 1; #endif @@ -715,7 +719,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, case PE_FrameButtonTool: case PE_PanelButtonTool: { QPen oldPen = p->pen(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (w && w->inherits("QDockWidgetTitleButton")) { if (const QWidget *dw = w->parentWidget()) if (dw->isWindow()){ @@ -725,7 +729,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, return; } } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) QBrush fill; bool stippled; bool panel = (pe == PE_PanelButtonTool); @@ -1020,7 +1024,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, popupPal.setColor(QPalette::Midlight, opt->palette.light().color()); qDrawWinPanel(p, opt->rect, popupPal, opt->state & State_Sunken); break; } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case PE_IndicatorDockWidgetResizeHandle: break; case PE_FrameDockWidget: @@ -1028,7 +1032,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, proxy()->drawPrimitive(QStyle::PE_FrameWindow, opt, p, w); } break; -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) case PE_FrameStatusBarItem: qDrawShadePanel(p, opt->rect, opt->palette, true, 1, 0); @@ -1281,7 +1285,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } break; #endif // QT_NO_MENUBAR -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case CE_TabBarTabShape: if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(opt)) { bool rtlHorTabs = (tab->direction == Qt::RightToLeft @@ -1484,7 +1488,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } } break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) case CE_ToolBoxTabShape: qDrawShadePanel(p, opt->rect, opt->palette, opt->state & (State_Sunken | State_On), 1, @@ -1617,6 +1621,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai default: break; } + Q_FALLTHROUGH(); // It continues in the end of the next case case Qt::TopToolBarArea : switch(toolbar->positionWithinLine){ case QStyleOptionToolBar::Beginning: @@ -1782,7 +1787,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } break; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case CE_DockWidgetTitle: if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast<const QStyleOptionDockWidget *>(opt)) { @@ -1856,8 +1861,8 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai p->restore(); } return; -#endif // QT_NO_DOCKWIDGET -#ifndef QT_NO_COMBOBOX +#endif // QT_CONFIG(dockwidget) +#if QT_CONFIG(combobox) case CE_ComboBoxLabel: if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { if (cb->state & State_HasFocus) { @@ -1870,7 +1875,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai } QCommonStyle::drawControl(ce, opt, p, widget); break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) default: QCommonStyle::drawControl(ce, opt, p, widget); } @@ -2148,7 +2153,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp } break; #endif // QT_NO_SCROLLBAR -#ifndef QT_NO_COMBOBOX +#if QT_CONFIG(combobox) case CC_ComboBox: if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) { QBrush editBrush = cmb->palette.brush(QPalette::Base); @@ -2221,7 +2226,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp } } break; -#endif // QT_NO_COMBOBOX +#endif // QT_CONFIG(combobox) #ifndef QT_NO_SPINBOX case CC_SpinBox: if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index 96f91188b8..3a1821240e 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -147,12 +147,16 @@ #include "QtWidgets/qscrollbar.h" #include "QtCore/qstringlistmodel.h" +#if QT_CONFIG(dirmodel) #include "QtWidgets/qdirmodel.h" +#endif #if QT_CONFIG(filesystemmodel) #include "QtWidgets/qfilesystemmodel.h" #endif #include "QtWidgets/qheaderview.h" +#if QT_CONFIG(listview) #include "QtWidgets/qlistview.h" +#endif #include "QtWidgets/qapplication.h" #include "QtGui/qevent.h" #include "QtWidgets/qdesktopwidget.h" @@ -463,7 +467,7 @@ QMatchData QCompletionEngine::filterHistory() if (curParts.count() <= 1 || c->proxy->showAll || !source) return QMatchData(); -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) const bool isDirModel = (qobject_cast<QDirModel *>(source) != 0); #else const bool isDirModel = false; @@ -833,11 +837,11 @@ void QCompleterPrivate::init(QAbstractItemModel *m) proxy = new QCompletionModel(this, q); QObject::connect(proxy, SIGNAL(rowsAdded()), q, SLOT(_q_autoResizePopup())); q->setModel(m); -#ifdef QT_NO_LISTVIEW +#if !QT_CONFIG(listview) q->setCompletionMode(QCompleter::InlineCompletion); #else q->setCompletionMode(QCompleter::PopupCompletion); -#endif // QT_NO_LISTVIEW +#endif // QT_CONFIG(listview) } void QCompleterPrivate::setCurrentIndex(QModelIndex index, bool select) @@ -884,7 +888,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) QModelIndex si = proxy->mapToSource(index); si = si.sibling(si.row(), column); // for clicked() completion = q->pathFromIndex(si); -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) // add a trailing separator in inline if (mode == QCompleter::InlineCompletion) { if (qobject_cast<QDirModel *>(proxy->sourceModel()) && QFileInfo(completion).isDir()) @@ -1072,7 +1076,7 @@ void QCompleter::setModel(QAbstractItemModel *model) setPopup(d->popup); // set the model and make new connections if (oldModel && oldModel->QObject::parent() == this) delete oldModel; -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) if (qobject_cast<QDirModel *>(model)) { #if defined(Q_OS_WIN) setCaseSensitivity(Qt::CaseInsensitive); @@ -1080,7 +1084,7 @@ void QCompleter::setModel(QAbstractItemModel *model) setCaseSensitivity(Qt::CaseSensitive); #endif } -#endif // QT_NO_DIRMODEL +#endif // QT_CONFIG(dirmodel) #if QT_CONFIG(filesystemmodel) QFileSystemModel *fsModel = qobject_cast<QFileSystemModel *>(model); if (fsModel) { @@ -1231,7 +1235,7 @@ void QCompleter::setPopup(QAbstractItemView *popup) popup->setFocusProxy(d->widget); popup->installEventFilter(this); popup->setItemDelegate(new QCompleterItemDelegate(popup)); -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (QListView *listView = qobject_cast<QListView *>(popup)) { listView->setModelColumn(d->column); } @@ -1255,7 +1259,7 @@ void QCompleter::setPopup(QAbstractItemView *popup) QAbstractItemView *QCompleter::popup() const { Q_D(const QCompleter); -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (!d->popup && completionMode() != QCompleter::InlineCompletion) { QListView *listView = new QListView; listView->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -1266,7 +1270,7 @@ QAbstractItemView *QCompleter::popup() const QCompleter *that = const_cast<QCompleter*>(this); that->setPopup(listView); } -#endif // QT_NO_LISTVIEW +#endif // QT_CONFIG(listview) return d->popup; } @@ -1597,7 +1601,7 @@ void QCompleter::setCompletionColumn(int column) Q_D(QCompleter); if (d->column == column) return; -#ifndef QT_NO_LISTVIEW +#if QT_CONFIG(listview) if (QListView *listView = qobject_cast<QListView *>(d->popup)) listView->setModelColumn(column); #endif @@ -1786,7 +1790,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const return QString(); bool isDirModel = false; bool isFsModel = false; -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0; #endif #if QT_CONFIG(filesystemmodel) @@ -1835,12 +1839,12 @@ QStringList QCompleter::splitPath(const QString& path) const { bool isDirModel = false; bool isFsModel = false; -#ifndef QT_NO_DIRMODEL +#if QT_CONFIG(dirmodel) Q_D(const QCompleter); isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0; #endif #if QT_CONFIG(filesystemmodel) -#ifdef QT_NO_DIRMODEL +#if !QT_CONFIG(dirmodel) Q_D(const QCompleter); #endif isFsModel = qobject_cast<QFileSystemModel *>(d->proxy->sourceModel()) != 0; diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index e65613d5cd..1d78d24a88 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -40,7 +40,9 @@ #include "private/qabstractbutton_p.h" #include "private/qbuttongroup_p.h" +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qbuttongroup.h" #include "qabstractbutton_p.h" #include "qevent.h" @@ -1071,7 +1073,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e) #ifndef QT_NO_BUTTONGROUP || d->group #endif -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) || (pw && qobject_cast<QAbstractItemView *>(pw->parentWidget())) #endif ) { diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 673983d575..14498c8b90 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -50,7 +50,9 @@ #include "qboxlayout.h" #include "qpainter.h" #include "qmargins.h" +#if QT_CONFIG(itemviews) #include "qheaderview.h" +#endif #include <QDebug> diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index b96492d623..94911d1cb1 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -39,8 +39,6 @@ #include "qcalendarwidget.h" -#ifndef QT_NO_CALENDARWIDGET - #include <qabstractitemmodel.h> #include <qitemdelegate.h> #include <qdatetime.h> @@ -3129,5 +3127,3 @@ QT_END_NAMESPACE #include "qcalendarwidget.moc" #include "moc_qcalendarwidget.cpp" - -#endif //QT_NO_CALENDARWIDGET diff --git a/src/widgets/widgets/qcalendarwidget.h b/src/widgets/widgets/qcalendarwidget.h index 7780065117..29e2ff698b 100644 --- a/src/widgets/widgets/qcalendarwidget.h +++ b/src/widgets/widgets/qcalendarwidget.h @@ -44,10 +44,9 @@ #include <QtWidgets/qwidget.h> #include <QtCore/qdatetime.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(calendarwidget); -#ifndef QT_NO_CALENDARWIDGET +QT_BEGIN_NAMESPACE class QDate; class QTextCharFormat; @@ -184,9 +183,6 @@ private: }; -#endif // QT_NO_CALENDARWIDGET - QT_END_NAMESPACE #endif // QCALENDARWIDGET_H - diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 1259c236e4..58a1ff9e7f 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -39,7 +39,6 @@ #include "qcombobox.h" -#ifndef QT_NO_COMBOBOX #include <qstylepainter.h> #include <qpa/qplatformtheme.h> #include <qpa/qplatformmenu.h> @@ -3508,5 +3507,3 @@ QT_END_NAMESPACE #include "moc_qcombobox.cpp" #include "moc_qcombobox_p.cpp" - -#endif // QT_NO_COMBOBOX diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index 8f99594a76..a6aac6f8aa 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -46,9 +46,9 @@ #include <QtCore/qabstractitemmodel.h> #include <QtCore/qvariant.h> -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(combobox); -#ifndef QT_NO_COMBOBOX +QT_BEGIN_NAMESPACE class QAbstractItemView; class QLineEdit; @@ -277,8 +277,6 @@ inline void QComboBox::insertItem(int aindex, const QString &atext, const QVariant &auserData) { insertItem(aindex, QIcon(), atext, auserData); } -#endif // QT_NO_COMBOBOX - QT_END_NAMESPACE #endif // QCOMBOBOX_H diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h index 8d3b46a950..6bee9409ee 100644 --- a/src/widgets/widgets/qcombobox_p.h +++ b/src/widgets/widgets/qcombobox_p.h @@ -54,7 +54,6 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> #include "QtWidgets/qcombobox.h" -#ifndef QT_NO_COMBOBOX #include "QtWidgets/qabstractslider.h" #include "QtWidgets/qapplication.h" #include "QtWidgets/qitemdelegate.h" @@ -74,6 +73,8 @@ #include <limits.h> +QT_REQUIRE_CONFIG(combobox); + QT_BEGIN_NAMESPACE class QAction; @@ -424,6 +425,4 @@ public: QT_END_NAMESPACE -#endif // QT_NO_COMBOBOX - #endif // QCOMBOBOX_P_H diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h index bc70780de9..5ac5a9db6a 100644 --- a/src/widgets/widgets/qdatetimeedit_p.h +++ b/src/widgets/widgets/qdatetimeedit_p.h @@ -52,7 +52,6 @@ // #include <QtWidgets/private/qtwidgetsglobal_p.h> -#include "QtWidgets/qcombobox.h" #include "QtWidgets/qcalendarwidget.h" #include "QtWidgets/qspinbox.h" #include "QtWidgets/qtoolbutton.h" diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp index 60f6f6d26d..5edcbcf4ec 100644 --- a/src/widgets/widgets/qdockarealayout.cpp +++ b/src/widgets/widgets/qdockarealayout.cpp @@ -40,7 +40,9 @@ #include "QtWidgets/qapplication.h" #include "QtWidgets/qwidget.h" +#if QT_CONFIG(tabbar) #include "QtWidgets/qtabbar.h" +#endif #include "QtWidgets/qstyle.h" #include "QtWidgets/qdesktopwidget.h" #include "QtWidgets/qapplication.h" @@ -56,8 +58,6 @@ #include <qpainter.h> #include <qstyleoption.h> -#ifndef QT_NO_DOCKWIDGET - QT_BEGIN_NAMESPACE // qmainwindow.cpp @@ -214,7 +214,7 @@ QDockAreaLayoutItem ** QDockAreaLayoutInfo */ -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) static quintptr tabId(const QDockAreaLayoutItem &item) { if (item.widgetItem == 0) @@ -227,7 +227,7 @@ static const int zero = 0; QDockAreaLayoutInfo::QDockAreaLayoutInfo() : sep(&zero), dockPos(QInternal::LeftDock), o(Qt::Horizontal), mainWindow(0) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) , tabbed(false), tabBar(0), tabBarShape(QTabBar::RoundedSouth) #endif { @@ -237,11 +237,11 @@ QDockAreaLayoutInfo::QDockAreaLayoutInfo(const int *_sep, QInternal::DockPositio Qt::Orientation _o, int tbshape, QMainWindow *window) : sep(_sep), dockPos(_dockPos), o(_o), mainWindow(window) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) , tabbed(false), tabBar(0), tabBarShape(static_cast<QTabBar::Shape>(tbshape)) #endif { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(tbshape); #endif } @@ -255,7 +255,7 @@ void QDockAreaLayoutInfo::clear() { item_list.clear(); rect = QRect(); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) tabbed = false; tabBar = 0; #endif @@ -289,7 +289,7 @@ QSize QDockAreaLayoutInfo::minimumSize() const continue; QSize min_size = item.minimumSize(); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { a = qMax(a, pick(o, min_size)); } else @@ -308,7 +308,7 @@ QSize QDockAreaLayoutInfo::minimumSize() const rpick(o, result) = a; rperp(o, result) = b; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QSize tbm = tabBarMinimumSize(); if (!tbm.isNull()) { switch (tabBarShape) { @@ -330,7 +330,7 @@ QSize QDockAreaLayoutInfo::minimumSize() const break; } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) return result; } @@ -341,7 +341,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const return QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); int a = 0, b = QWIDGETSIZE_MAX; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) a = QWIDGETSIZE_MAX; #endif @@ -357,7 +357,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const QSize max_size = item.maximumSize(); min_perp = qMax(min_perp, perp(o, item.minimumSize())); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { a = qMin(a, pick(o, max_size)); } else @@ -381,7 +381,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const rpick(o, result) = a; rperp(o, result) = b; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QSize tbh = tabBarSizeHint(); if (!tbh.isNull()) { switch (tabBarShape) { @@ -397,7 +397,7 @@ QSize QDockAreaLayoutInfo::maximumSize() const break; } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) return result; } @@ -422,7 +422,7 @@ QSize QDockAreaLayoutInfo::sizeHint() const min_perp = qMax(min_perp, perp(o, item.minimumSize())); max_perp = qMin(max_perp, perp(o, item.maximumSize())); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { a = qMax(a, gap ? item.size : pick(o, size_hint)); } else @@ -447,7 +447,7 @@ QSize QDockAreaLayoutInfo::sizeHint() const rpick(o, result) = a; rperp(o, result) = b; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { QSize tbh = tabBarSizeHint(); switch (tabBarShape) { @@ -469,7 +469,7 @@ QSize QDockAreaLayoutInfo::sizeHint() const break; } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) return result; } @@ -545,7 +545,7 @@ static int realMaxSize(const QDockAreaLayoutInfo &info) void QDockAreaLayoutInfo::fitItems() { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { return; } @@ -759,7 +759,7 @@ QList<int> QDockAreaLayoutInfo::gapIndex(const QPoint& _pos, QRect item_rect; int item_index = 0; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { item_rect = tabContentRect(); } else @@ -779,7 +779,7 @@ QList<int> QDockAreaLayoutInfo::gapIndex(const QPoint& _pos, continue; if (item.subinfo != 0 -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) && !item.subinfo->tabbed #endif ) { @@ -941,7 +941,7 @@ static int separatorMoveHelper(QVector<QLayoutStruct> &list, int index, int delt int QDockAreaLayoutInfo::separatorMove(int index, int delta) { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) Q_ASSERT(!tabbed); #endif @@ -1065,7 +1065,7 @@ QLayoutItem *QDockAreaLayoutInfo::unplug(const QList<int> &path) Q_ASSERT(!(item.flags & QDockAreaLayoutItem::GapItem)); item.flags |= QDockAreaLayoutItem::GapItem; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { } else #endif @@ -1081,7 +1081,7 @@ QLayoutItem *QDockAreaLayoutInfo::unplug(const QList<int> &path) return item.widgetItem; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) quintptr QDockAreaLayoutInfo::currentTabId() const { @@ -1113,7 +1113,7 @@ void QDockAreaLayoutInfo::setCurrentTabId(quintptr id) } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) static QRect dockedGeometry(QWidget *widget) { @@ -1146,7 +1146,7 @@ bool QDockAreaLayoutInfo::insertGap(const QList<int> &path, QLayoutItem *dockWid QDockAreaLayoutItem &item = item_list[index]; if (item.subinfo == 0 -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) || (item.subinfo->tabbed && !insert_tabbed) #endif ) { @@ -1159,7 +1159,7 @@ bool QDockAreaLayoutInfo::insertGap(const QList<int> &path, QLayoutItem *dockWid QRect r = subinfo == 0 ? widgetItem ? dockedGeometry(widgetItem->widget()) : placeHolderItem->topLevelRect : subinfo->rect; Qt::Orientation opposite = o == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal; -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) const int tabBarShape = 0; #endif QDockAreaLayoutInfo *new_info @@ -1177,7 +1177,7 @@ bool QDockAreaLayoutInfo::insertGap(const QList<int> &path, QLayoutItem *dockWid new_item.size = pick(opposite, r.size()); new_item.pos = pick(opposite, r.topLeft()); new_info->item_list.append(new_item); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (insert_tabbed) { new_info->tabbed = true; } @@ -1192,7 +1192,7 @@ bool QDockAreaLayoutInfo::insertGap(const QList<int> &path, QLayoutItem *dockWid gap_item.flags |= QDockAreaLayoutItem::GapItem; gap_item.widgetItem = dockWidgetItem; // so minimumSize(), maximumSize() and // sizeHint() will work -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (!tabbed) #endif { @@ -1267,7 +1267,7 @@ QDockAreaLayoutInfo *QDockAreaLayoutInfo::info(QWidget *widget) if (item.skip()) continue; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed && widget == tabBar) return this; #endif @@ -1308,7 +1308,7 @@ QRect QDockAreaLayoutInfo::itemRect(int index, bool isGap) const QRect result; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { if (isGap || tabId(item) == currentTabId()) result = tabContentRect(); @@ -1357,7 +1357,7 @@ QRect QDockAreaLayoutInfo::itemRect(const QList<int> &path) const QRect QDockAreaLayoutInfo::separatorRect(int index) const { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) return QRect(); #endif @@ -1389,7 +1389,7 @@ QRect QDockAreaLayoutInfo::separatorRect(const QList<int> &path) const QList<int> QDockAreaLayoutInfo::findSeparator(const QPoint &_pos) const { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) return QList<int>(); #endif @@ -1500,7 +1500,7 @@ QDockWidget *QDockAreaLayoutInfo::apply(bool animate) { QWidgetAnimator &widgetAnimator = mainWindowLayout()->widgetAnimator; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { QRect tab_rect; QSize tbh = tabBarSizeHint(); @@ -1533,7 +1533,7 @@ QDockWidget *QDockAreaLayoutInfo::apply(bool animate) widgetAnimator.animate(tabBar, tab_rect, animate); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) QDockWidget *activated = nullptr; @@ -1569,10 +1569,10 @@ QDockWidget *QDockAreaLayoutInfo::apply(bool animate) } } } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (*sep == 1) updateSeparatorWidgets(); -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) return activated; } @@ -1599,7 +1599,7 @@ QRegion QDockAreaLayoutInfo::separatorRegion() const if (isEmpty()) return result; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) return result; #endif @@ -1629,7 +1629,7 @@ void QDockAreaLayoutInfo::paintSeparators(QPainter *p, QWidget *widget, { if (isEmpty()) return; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) return; #endif @@ -1678,7 +1678,7 @@ int QDockAreaLayoutInfo::prev(int index) const void QDockAreaLayoutInfo::tab(int index, QLayoutItem *dockWidgetItem) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(index); Q_UNUSED(dockWidgetItem); #else @@ -1697,7 +1697,7 @@ void QDockAreaLayoutInfo::tab(int index, QLayoutItem *dockWidgetItem) new_info->updateTabBar(); new_info->setCurrentTab(dockWidgetItem->widget()); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QDockAreaLayoutInfo::split(int index, Qt::Orientation orientation, @@ -1706,7 +1706,7 @@ void QDockAreaLayoutInfo::split(int index, Qt::Orientation orientation, if (orientation == o) { item_list.insert(index + 1, QDockAreaLayoutItem(dockWidgetItem)); } else { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) const int tabBarShape = 0; #endif QDockAreaLayoutInfo *new_info @@ -1787,7 +1787,7 @@ void QDockAreaLayoutInfo::deleteAllLayoutItems() void QDockAreaLayoutInfo::saveState(QDataStream &stream) const { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabbed) { stream << (uchar) TabMarker; @@ -1802,7 +1802,7 @@ void QDockAreaLayoutInfo::saveState(QDataStream &stream) const } stream << index; } else -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) { stream << (uchar) SequenceMarker; } @@ -1876,7 +1876,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> if (marker != TabMarker && marker != SequenceMarker) return false; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) tabbed = marker == TabMarker; int index = -1; @@ -1981,7 +1981,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> } } else if (nextMarker == SequenceMarker) { int dummy; -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) const int tabBarShape = 0; #endif QDockAreaLayoutItem item(new QDockAreaLayoutInfo(sep, dockPos, o, @@ -2002,7 +2002,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> } } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (!testing && tabbed && index >= 0 && index < item_list.count()) { updateTabBar(); setCurrentTabId(tabId(item_list.at(index))); @@ -2014,7 +2014,7 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*> return true; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void QDockAreaLayoutInfo::updateSeparatorWidgets() const { if (tabbed) { @@ -2065,9 +2065,7 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const separatorWidgets.resize(j); Q_ASSERT(separatorWidgets.size() == j); } -#endif //QT_NO_TABBAR -#ifndef QT_NO_TABBAR /*! \internal reparent all the widgets contained in this layout portion to the specified parent. This is used to reparent dock widgets and tabbars @@ -2293,7 +2291,7 @@ void QDockAreaLayoutInfo::moveTab(int from, int to) { item_list.move(tabIndexToListIndex(from), tabIndexToListIndex(to)); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /****************************************************************************** ** QDockAreaLayout @@ -2303,7 +2301,7 @@ QDockAreaLayout::QDockAreaLayout(QMainWindow *win) : fallbackToSizeHints(true) { mainWindow = win; sep = win->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, win); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) const int tabShape = QTabBar::RoundedSouth; #else const int tabShape = 0; @@ -2423,7 +2421,7 @@ QList<int> QDockAreaLayout::gapIndex(const QPoint &pos, bool disallowTabs) const QMainWindow::DockOptions opts = mainWindow->dockOptions(); bool nestingEnabled = opts & QMainWindow::AllowNestedDocks; QDockAreaLayoutInfo::TabMode tabMode = QDockAreaLayoutInfo::NoTabs; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (!disallowTabs) { if (opts & QMainWindow::AllowTabbedDocks || opts & QMainWindow::VerticalTabs) tabMode = QDockAreaLayoutInfo::AllowTabs; @@ -3115,14 +3113,14 @@ void QDockAreaLayout::addDockWidget(QInternal::DockPosition pos, QDockWidget *do QDockAreaLayoutItem new_item(dockWidgetItem); info.item_list.append(new_item); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (info.tabbed && !new_item.skip()) { info.updateTabBar(); info.setCurrentTabId(tabId(new_item)); } #endif } else { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) int tbshape = info.tabBarShape; #else int tbshape = 0; @@ -3223,10 +3221,10 @@ void QDockAreaLayout::apply(bool animate) widgetAnimator.animate(centralWidgetItem->widget(), centralWidgetRect, animate); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (sep == 1) updateSeparatorWidgets(); -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QDockAreaLayout::paintSeparators(QPainter *p, QWidget *widget, @@ -3317,7 +3315,7 @@ int QDockAreaLayoutInfo::separatorMove(const QList<int> &separator, const QPoint return delta; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) // Sets the correct positions for the separator widgets // Allocates new sepearator widgets with getSeparatorWidget void QDockAreaLayout::updateSeparatorWidgets() const @@ -3351,7 +3349,7 @@ void QDockAreaLayout::updateSeparatorWidgets() const separatorWidgets.resize(j); } -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) QLayoutItem *QDockAreaLayout::itemAt(int *x, int index) const { @@ -3394,7 +3392,7 @@ void QDockAreaLayout::deleteAllLayoutItems() docks[i].deleteAllLayoutItems(); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QSet<QTabBar*> QDockAreaLayout::usedTabBars() const { QSet<QTabBar*> result; @@ -3450,5 +3448,3 @@ void QDockAreaLayout::styleChangedEvent() } QT_END_NAMESPACE - -#endif // QT_NO_DOCKWIDGET diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h index e4cdc9f296..49bd157179 100644 --- a/src/widgets/widgets/qdockarealayout_p.h +++ b/src/widgets/widgets/qdockarealayout_p.h @@ -58,7 +58,7 @@ #include "QtCore/qvector.h" #include "QtWidgets/qlayout.h" -#ifndef QT_NO_DOCKWIDGET +QT_REQUIRE_CONFIG(dockwidget); QT_BEGIN_NAMESPACE @@ -197,12 +197,10 @@ public: QRect rect; QMainWindow *mainWindow; QList<QDockAreaLayoutItem> item_list; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void updateSeparatorWidgets() const; QSet<QWidget*> usedSeparatorWidgets() const; -#endif //QT_NO_TABBAR -#ifndef QT_NO_TABBAR quintptr currentTabId() const; void setCurrentTab(QWidget *widget); void setCurrentTabId(quintptr id); @@ -221,7 +219,7 @@ public: int tabIndexToListIndex(int) const; void moveTab(int from, int to); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) }; class Q_AUTOTEST_EXPORT QDockAreaLayout @@ -286,9 +284,9 @@ public: const QPoint &mouse) const; QRegion separatorRegion() const; int separatorMove(const QList<int> &separator, const QPoint &origin, const QPoint &dest); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void updateSeparatorWidgets() const; -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) QLayoutItem *itemAt(int *x, int index) const; QLayoutItem *takeAt(int *x, int index); @@ -302,15 +300,13 @@ public: QRect gapRect(const QList<int> &path) const; void keepSize(QDockWidget *w); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QSet<QTabBar*> usedTabBars() const; QSet<QWidget*> usedSeparatorWidgets() const; -#endif //QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void styleChangedEvent(); }; QT_END_NAMESPACE -#endif // QT_NO_QDOCKWIDGET - #endif // QDOCKAREALAYOUT_P_H diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 15f79638c8..36d7ab3421 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -39,7 +39,6 @@ #include "qdockwidget.h" -#ifndef QT_NO_DOCKWIDGET #include <qaction.h> #include <qapplication.h> #include <qdesktopwidget.h> @@ -1392,14 +1391,14 @@ void QDockWidget::changeEvent(QEvent *event) d->fixedWindowTitle = qt_setWindowTitle_helperHelper(windowTitle(), this); d->toggleViewAction->setText(d->fixedWindowTitle); #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) { if (QMainWindowLayout *winLayout = qt_mainwindow_layout_from_dock(this)) { if (QDockAreaLayoutInfo *info = winLayout->layoutState.dockAreaLayout.info(this)) info->updateTabBar(); } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) break; default: break; @@ -1689,5 +1688,3 @@ QT_END_NAMESPACE #include "qdockwidget.moc" #include "moc_qdockwidget.cpp" #include "moc_qdockwidget_p.cpp" - -#endif // QT_NO_DOCKWIDGET diff --git a/src/widgets/widgets/qdockwidget.h b/src/widgets/widgets/qdockwidget.h index 80df009007..b53fa19a03 100644 --- a/src/widgets/widgets/qdockwidget.h +++ b/src/widgets/widgets/qdockwidget.h @@ -43,10 +43,9 @@ #include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qwidget.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(dockwidget); -#ifndef QT_NO_DOCKWIDGET +QT_BEGIN_NAMESPACE class QDockAreaLayout; class QDockWidgetPrivate; @@ -134,8 +133,6 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QDockWidget::DockWidgetFeatures) -#endif // QT_NO_DOCKWIDGET - QT_END_NAMESPACE #endif // QDYNAMICDOCKWIDGET_H diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h index 2d62cf5acd..2c16176c37 100644 --- a/src/widgets/widgets/qdockwidget_p.h +++ b/src/widgets/widgets/qdockwidget_p.h @@ -57,7 +57,7 @@ #include "QtWidgets/qboxlayout.h" #include "QtWidgets/qdockwidget.h" -#ifndef QT_NO_DOCKWIDGET +QT_REQUIRE_CONFIG(dockwidget); QT_BEGIN_NAMESPACE @@ -204,6 +204,4 @@ inline QDockWidgetLayout *QDockWidgetItem::dockWidgetLayout() const QT_END_NAMESPACE -#endif // QT_NO_DOCKWIDGET - #endif // QDYNAMICDOCKWIDGET_P_H diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index f859ec0ddb..f57fa4fd85 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -68,7 +68,9 @@ #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "private/qstylesheetstyle_p.h" #ifndef QT_NO_SHORTCUT diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index e1c7a4e280..83dab9e110 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -43,7 +43,9 @@ #ifndef QT_NO_LINEEDIT #include "qvariant.h" +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qdrag.h" #include "qwidgetaction.h" #include "qclipboard.h" diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 889082cb2a..694a36ed5b 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -44,7 +44,9 @@ #ifndef QT_NO_MAINWINDOW +#if QT_CONFIG(dockwidget) #include "qdockwidget.h" +#endif #include "qtoolbar.h" #include <qapplication.h> @@ -348,7 +350,7 @@ void QMainWindowPrivate::init() \sa setToolButtonStyle() */ -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! \fn void QMainWindow::tabifiedDockWidgetActivated(QDockWidget *dockWidget) @@ -660,7 +662,7 @@ QWidget *QMainWindow::takeCentralWidget() return oldcentralwidget; } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! Sets the given dock widget \a area to occupy the specified \a corner. @@ -766,12 +768,12 @@ void QMainWindow::addToolBar(Qt::ToolBarArea area, QToolBar *toolbar) if(toolbar->d_func()->state && toolbar->d_func()->state->dragging) { //removing a toolbar which is dragging will cause crash -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) bool animated = isAnimated(); setAnimated(false); #endif toolbar->d_func()->endDrag(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) setAnimated(animated); #endif } @@ -870,7 +872,7 @@ bool QMainWindow::toolBarBreak(QToolBar *toolbar) const #endif // QT_NO_TOOLBAR -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) /*! \property QMainWindow::animated \brief whether manipulating dock widgets and tool bars is animated @@ -984,7 +986,7 @@ static bool checkDockWidgetArea(Qt::DockWidgetArea area, const char *where) return false; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \property QMainWindow::documentMode \brief whether the tab bar for tabbed dockwidgets is set to document mode. @@ -1003,9 +1005,9 @@ void QMainWindow::setDocumentMode(bool enabled) { d_func()->layout->setDocumentMode(enabled); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) /*! \property QMainWindow::tabShape \brief the tab shape used for tabbed dock widgets. @@ -1057,7 +1059,7 @@ void QMainWindow::setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosit { d_func()->layout->setTabPosition(areas, tabPosition); } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) /*! Adds the given \a dockwidget to the specified \a area. @@ -1160,7 +1162,7 @@ void QMainWindow::tabifyDockWidget(QDockWidget *first, QDockWidget *second) QList<QDockWidget*> QMainWindow::tabifiedDockWidgets(QDockWidget *dockwidget) const { QList<QDockWidget*> ret; -#if defined(QT_NO_TABBAR) +#if !QT_CONFIG(tabbar) Q_UNUSED(dockwidget); #else const QDockAreaLayoutInfo *info = d_func()->layout->layoutState.dockAreaLayout.info(dockwidget); @@ -1232,7 +1234,7 @@ void QMainWindow::resizeDocks(const QList<QDockWidget *> &docks, } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) /*! Saves the current state of this mainwindow's toolbars and @@ -1323,7 +1325,7 @@ bool QMainWindow::event(QEvent *event) #endif // QT_CONFIG(statustip) case QEvent::StyleChange: -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) d->layout->layoutState.dockAreaLayout.styleChangedEvent(); #endif if (!d->explicitIconSize) @@ -1388,7 +1390,7 @@ bool QMainWindow::unifiedTitleAndToolBarOnMac() const */ bool QMainWindow::isSeparator(const QPoint &pos) const { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) Q_D(const QMainWindow); return !d->layout->layoutState.dockAreaLayout.findSeparator(pos).isEmpty(); #else @@ -1415,7 +1417,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event) break; } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QDockWidget *dw = qobject_cast<QDockWidget *>(child)) { if (dw->parentWidget() != this) return; @@ -1426,7 +1428,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event) } break; } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR if (QToolBar *tb = qobject_cast<QToolBar *>(child)) { if (tb->parentWidget() != this) @@ -1474,7 +1476,7 @@ QMenu *QMainWindow::createPopupMenu() { Q_D(QMainWindow); QMenu *menu = 0; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) QList<QDockWidget *> dockwidgets = findChildren<QDockWidget *>(); if (dockwidgets.size()) { menu = new QMenu(this); @@ -1497,7 +1499,7 @@ QMenu *QMainWindow::createPopupMenu() } menu->addSeparator(); } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR QList<QToolBar *> toolbars = findChildren<QToolBar *>(); if (toolbars.size()) { diff --git a/src/widgets/widgets/qmainwindow.h b/src/widgets/widgets/qmainwindow.h index bab1176d8a..aa26d4c23b 100644 --- a/src/widgets/widgets/qmainwindow.h +++ b/src/widgets/widgets/qmainwindow.h @@ -42,7 +42,9 @@ #include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qwidget.h> +#if QT_CONFIG(tabwidget) #include <QtWidgets/qtabwidget.h> +#endif QT_BEGIN_NAMESPACE @@ -62,16 +64,16 @@ class Q_WIDGETS_EXPORT QMainWindow : public QWidget Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize) Q_PROPERTY(Qt::ToolButtonStyle toolButtonStyle READ toolButtonStyle WRITE setToolButtonStyle) -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) Q_PROPERTY(bool animated READ isAnimated WRITE setAnimated) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode) -#endif // QT_NO_TABBAR -#ifndef QT_NO_TABWIDGET +#endif // QT_CONFIG(tabbar) +#if QT_CONFIG(tabwidget) Q_PROPERTY(QTabWidget::TabShape tabShape READ tabShape WRITE setTabShape) -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) Q_PROPERTY(bool dockNestingEnabled READ isDockNestingEnabled WRITE setDockNestingEnabled) -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) Q_PROPERTY(DockOptions dockOptions READ dockOptions WRITE setDockOptions) #ifndef QT_NO_TOOLBAR Q_PROPERTY(bool unifiedTitleAndToolBarOnMac READ unifiedTitleAndToolBarOnMac WRITE setUnifiedTitleAndToolBarOnMac) @@ -99,22 +101,22 @@ public: Qt::ToolButtonStyle toolButtonStyle() const; void setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) bool isAnimated() const; bool isDockNestingEnabled() const; #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) bool documentMode() const; void setDocumentMode(bool enabled); #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabShape tabShape() const; void setTabShape(QTabWidget::TabShape tabShape); QTabWidget::TabPosition tabPosition(Qt::DockWidgetArea area) const; void setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition); -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) void setDockOptions(DockOptions options); DockOptions dockOptions() const; @@ -139,7 +141,7 @@ public: QWidget *takeCentralWidget(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void setCorner(Qt::Corner corner, Qt::DockWidgetArea area); Qt::DockWidgetArea corner(Qt::Corner corner) const; #endif @@ -160,7 +162,7 @@ public: Qt::ToolBarArea toolBarArea(QToolBar *toolbar) const; bool toolBarBreak(QToolBar *toolbar) const; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget); void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget, Qt::Orientation orientation); @@ -175,7 +177,7 @@ public: void resizeDocks(const QList<QDockWidget *> &docks, const QList<int> &sizes, Qt::Orientation orientation); -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) QByteArray saveState(int version = 0) const; bool restoreState(const QByteArray &state, int version = 0); @@ -185,7 +187,7 @@ public: #endif public Q_SLOTS: -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void setAnimated(bool enabled); void setDockNestingEnabled(bool enabled); #endif @@ -196,7 +198,7 @@ public Q_SLOTS: Q_SIGNALS: void iconSizeChanged(const QSize &iconSize); void toolButtonStyleChanged(Qt::ToolButtonStyle toolButtonStyle); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void tabifiedDockWidgetActivated(QDockWidget *dockWidget); #endif diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index e48ce301fb..2c1c2ab75c 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -39,11 +39,13 @@ ****************************************************************************/ #include "qmainwindowlayout_p.h" -#include "qdockarealayout_p.h" #ifndef QT_NO_MAINWINDOW +#if QT_CONFIG(dockwidget) +#include "qdockarealayout_p.h" #include "qdockwidget.h" #include "qdockwidget_p.h" +#endif #include "qtoolbar_p.h" #include "qmainwindow.h" #include "qtoolbar.h" @@ -52,7 +54,9 @@ #if QT_CONFIG(rubberband) #include "qrubberband.h" #endif +#if QT_CONFIG(tabbar) #include "qtabbar_p.h" +#endif #include <qapplication.h> #include <qstatusbar.h> @@ -81,7 +85,7 @@ extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window); ** debug */ -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_DEBUG_STREAM) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_DEBUG_STREAM) static void dumpLayout(QTextStream &qout, const QDockAreaLayoutInfo &layout, QString indent); @@ -170,7 +174,7 @@ QDebug operator<<(QDebug debug, const QMainWindowLayout *layout) return debug; } -#endif // !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_DEBUG) +#endif // QT_CONFIG(dockwidget) && !defined(QT_NO_DEBUG) /****************************************************************************** ** QDockWidgetGroupWindow @@ -182,7 +186,7 @@ QDebug operator<<(QDebug debug, const QMainWindowLayout *layout) // If there is only one QDockWidgets, or all QDockWidgets are tabbed together, it is equivalent // of a floating QDockWidget (the title of the QDockWidget is the title of the window). But if there // are nested QDockWidget, an additional title bar is there. -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) class QDockWidgetGroupLayout : public QLayout, public QMainWindowLayoutSeparatorHelper<QDockWidgetGroupLayout> { @@ -590,7 +594,7 @@ QMainWindowLayoutState::QMainWindowLayoutState(QMainWindow *win) #ifndef QT_NO_TOOLBAR toolBarAreaLayout(win), #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout(win) #else centralWidgetItem(0) @@ -605,7 +609,7 @@ QSize QMainWindowLayoutState::sizeHint() const QSize result(0, 0); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) result = dockAreaLayout.sizeHint(); #else if (centralWidgetItem != 0) @@ -623,7 +627,7 @@ QSize QMainWindowLayoutState::minimumSize() const { QSize result(0, 0); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) result = dockAreaLayout.minimumSize(); #else if (centralWidgetItem != 0) @@ -643,7 +647,7 @@ void QMainWindowLayoutState::apply(bool animated) toolBarAreaLayout.apply(animated); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // dumpLayout(dockAreaLayout, QString()); dockAreaLayout.apply(animated); #else @@ -665,7 +669,7 @@ void QMainWindowLayoutState::fitLayout() r = toolBarAreaLayout.fitLayout(); #endif // QT_NO_TOOLBAR -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.rect = r; dockAreaLayout.fitLayout(); #else @@ -679,14 +683,14 @@ void QMainWindowLayoutState::deleteAllLayoutItems() toolBarAreaLayout.deleteAllLayoutItems(); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.deleteAllLayoutItems(); #endif } void QMainWindowLayoutState::deleteCentralWidgetItem() { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) delete dockAreaLayout.centralWidgetItem; dockAreaLayout.centralWidgetItem = 0; #else @@ -702,7 +706,7 @@ QLayoutItem *QMainWindowLayoutState::itemAt(int index, int *x) const return ret; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QLayoutItem *ret = dockAreaLayout.itemAt(x, index)) return ret; #else @@ -720,7 +724,7 @@ QLayoutItem *QMainWindowLayoutState::takeAt(int index, int *x) return ret; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QLayoutItem *ret = dockAreaLayout.takeAt(x, index)) return ret; #else @@ -748,7 +752,7 @@ QList<int> QMainWindowLayoutState::indexOf(QWidget *widget) const } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // is it a dock widget? if (qobject_cast<QDockWidget *>(widget) || qobject_cast<QDockWidgetGroupWindow *>(widget)) { result = dockAreaLayout.indexOf(widget); @@ -756,14 +760,14 @@ QList<int> QMainWindowLayoutState::indexOf(QWidget *widget) const result.prepend(1); return result; } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return result; } bool QMainWindowLayoutState::contains(QWidget *widget) const { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (dockAreaLayout.centralWidgetItem != 0 && dockAreaLayout.centralWidgetItem->widget() == widget) return true; if (!dockAreaLayout.indexOf(widget).isEmpty()) @@ -789,7 +793,7 @@ void QMainWindowLayoutState::setCentralWidget(QWidget *widget) if (widget != 0) item = new QWidgetItemV2(widget); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.centralWidgetItem = item; #else centralWidgetItem = item; @@ -800,7 +804,7 @@ QWidget *QMainWindowLayoutState::centralWidget() const { QLayoutItem *item = 0; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) item = dockAreaLayout.centralWidgetItem; #else item = centralWidgetItem; @@ -826,7 +830,7 @@ QList<int> QMainWindowLayoutState::gapIndex(QWidget *widget, } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // is it a dock widget? if (qobject_cast<QDockWidget *>(widget) != 0 || qobject_cast<QDockWidgetGroupWindow *>(widget)) { @@ -842,7 +846,7 @@ QList<int> QMainWindowLayoutState::gapIndex(QWidget *widget, result.prepend(1); return result; } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return result; } @@ -861,12 +865,12 @@ bool QMainWindowLayoutState::insertGap(const QList<int> &path, QLayoutItem *item } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) { Q_ASSERT(qobject_cast<QDockWidget*>(item->widget()) || qobject_cast<QDockWidgetGroupWindow*>(item->widget())); return dockAreaLayout.insertGap(path.mid(1), item); } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return false; } @@ -880,10 +884,10 @@ void QMainWindowLayoutState::remove(const QList<int> &path) toolBarAreaLayout.remove(path.mid(1)); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) dockAreaLayout.remove(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) } void QMainWindowLayoutState::remove(QLayoutItem *item) @@ -892,14 +896,14 @@ void QMainWindowLayoutState::remove(QLayoutItem *item) toolBarAreaLayout.remove(item); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // is it a dock widget? if (QDockWidget *dockWidget = qobject_cast<QDockWidget *>(item->widget())) { QList<int> path = dockAreaLayout.indexOf(dockWidget); if (!path.isEmpty()) dockAreaLayout.remove(path); } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) } void QMainWindowLayoutState::clear() @@ -908,7 +912,7 @@ void QMainWindowLayoutState::clear() toolBarAreaLayout.clear(); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.clear(); #else centralWidgetRect = QRect(); @@ -934,10 +938,10 @@ QLayoutItem *QMainWindowLayoutState::item(const QList<int> &path) } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.item(path.mid(1)).widgetItem; -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return 0; } @@ -951,10 +955,10 @@ QRect QMainWindowLayoutState::itemRect(const QList<int> &path) const return toolBarAreaLayout.itemRect(path.mid(1)); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.itemRect(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return QRect(); } @@ -968,10 +972,10 @@ QRect QMainWindowLayoutState::gapRect(const QList<int> &path) const return toolBarAreaLayout.itemRect(path.mid(1)); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.gapRect(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return QRect(); } @@ -985,10 +989,10 @@ QLayoutItem *QMainWindowLayoutState::plug(const QList<int> &path) return toolBarAreaLayout.plug(path.mid(1)); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.plug(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return 0; } @@ -1004,19 +1008,19 @@ QLayoutItem *QMainWindowLayoutState::unplug(const QList<int> &path, QMainWindowL return toolBarAreaLayout.unplug(path.mid(1), other ? &other->toolBarAreaLayout : 0); #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (i == 1) return dockAreaLayout.unplug(path.mid(1)); -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return 0; } void QMainWindowLayoutState::saveState(QDataStream &stream) const { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) dockAreaLayout.saveState(stream); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QList<QDockWidgetGroupWindow *> floatingTabs = mainWindow->findChildren<QDockWidgetGroupWindow *>(QString(), Qt::FindDirectChildrenOnly); @@ -1048,7 +1052,7 @@ static QList<T> findChildrenHelper(const QObject *o) return result; } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) static QList<QDockWidget*> allMyDockWidgets(const QWidget *mainWindow) { QList<QDockWidget*> result; @@ -1065,7 +1069,7 @@ static QList<QDockWidget*> allMyDockWidgets(const QWidget *mainWindow) return result; } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) //pre4.3 tests the format that was used before 4.3 bool QMainWindowLayoutState::checkFormat(QDataStream &stream) @@ -1087,7 +1091,7 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream) break; #endif // QT_NO_TOOLBAR -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case QDockAreaLayout::DockWidgetStateMarker: { const auto dockWidgets = allMyDockWidgets(mainWindow); @@ -1096,7 +1100,7 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream) } } break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QDockAreaLayout::FloatingDockWidgetTabMarker: { QRect geom; @@ -1107,8 +1111,8 @@ bool QMainWindowLayoutState::checkFormat(QDataStream &stream) return false; } break; -#endif // QT_NO_TABBAR -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(tabbar) +#endif // QT_CONFIG(dockwidget) default: //there was an error during the parsing return false; @@ -1143,7 +1147,7 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream, stream >> marker; switch(marker) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) case QDockAreaLayout::DockWidgetStateMarker: { const auto dockWidgets = allMyDockWidgets(mainWindow); @@ -1192,7 +1196,7 @@ bool QMainWindowLayoutState::restoreState(QDataStream &_stream, } break; #endif // QT_CONFIG(tabwidget) -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR case QToolBarAreaLayout::ToolBarStateMarker: @@ -1410,7 +1414,7 @@ void QMainWindowLayout::toggleToolBarsVisible() ** QMainWindowLayoutState - dock areas */ -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) static QInternal::DockPosition toDockPos(Qt::DockWidgetArea area) { @@ -1494,7 +1498,7 @@ bool QMainWindowLayout::restoreDockWidget(QDockWidget *dockwidget) return true; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) bool QMainWindowLayout::documentMode() const { return _documentMode; @@ -1513,11 +1517,11 @@ void QMainWindowLayout::setDocumentMode(bool enabled) foreach (QTabBar *bar, unusedTabBars) bar->setDocumentMode(_documentMode); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void QMainWindowLayout::setVerticalTabsEnabled(bool enabled) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(enabled); #else if (verticalTabsEnabled == enabled) @@ -1526,10 +1530,10 @@ void QMainWindowLayout::setVerticalTabsEnabled(bool enabled) verticalTabsEnabled = enabled; updateTabBarShapes(); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabShape QMainWindowLayout::tabShape() const { return _tabShape; @@ -1585,12 +1589,12 @@ static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWid return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest; return QTabBar::RoundedNorth; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void QMainWindowLayout::updateTabBarShapes() { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) const QTabWidget::TabPosition vertical[] = { QTabWidget::West, QTabWidget::East, @@ -1609,7 +1613,7 @@ void QMainWindowLayout::updateTabBarShapes() QDockAreaLayout &layout = layoutState.dockAreaLayout; for (int i = 0; i < QInternal::DockCount; ++i) { -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabPosition pos = verticalTabsEnabled ? vertical[i] : tabPositions[i]; QTabBar::Shape shape = tabBarShapeFrom(_tabShape, pos); #else @@ -1618,7 +1622,7 @@ void QMainWindowLayout::updateTabBarShapes() layout.docks[i].setTabBarShape(shape); } } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void QMainWindowLayout::splitDockWidget(QDockWidget *after, QDockWidget *dockwidget, @@ -1643,7 +1647,7 @@ void QMainWindowLayout::keepSize(QDockWidget *w) layoutState.dockAreaLayout.keepSize(w); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) // Handle custom tooltip, and allow to drag tabs away. class QMainWindowTabBar : public QTabBar @@ -1828,11 +1832,11 @@ void QMainWindowLayout::tabMoved(int from, int to) info->moveTab(from, to); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) void QMainWindowLayout::raise(QDockWidget *widget) { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QDockAreaLayoutInfo *info = dockInfo(widget); if (info == 0) return; @@ -1842,7 +1846,7 @@ void QMainWindowLayout::raise(QDockWidget *widget) #endif } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) /****************************************************************************** @@ -1964,7 +1968,7 @@ void QMainWindowLayout::invalidate() minSize = szHint = QSize(); } -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void QMainWindowLayout::setCurrentHoveredFloat(QDockWidgetGroupWindow *w) { if (currentHoveredFloat != w) { @@ -1987,7 +1991,7 @@ void QMainWindowLayout::setCurrentHoveredFloat(QDockWidgetGroupWindow *w) updateGapIndicator(); } } -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) /****************************************************************************** ** QMainWindowLayout - remaining stuff @@ -2080,7 +2084,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem) QWidget *widget = widgetItem->widget(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // Let's remove the widget from any possible group window foreach (QDockWidgetGroupWindow *dwgw, parent()->findChildren<QDockWidgetGroupWindow*>(QString(), Qt::FindDirectChildrenOnly)) { @@ -2102,7 +2106,7 @@ bool QMainWindowLayout::plug(QLayoutItem *widgetItem) pluggingWidget = widget; QRect globalRect = currentGapRect; globalRect.moveTopLeft(parentWidget()->mapToGlobal(globalRect.topLeft())); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (qobject_cast<QDockWidget*>(widget) != 0) { QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(widget->layout()); if (layout->nativeWindowDeco()) { @@ -2136,7 +2140,7 @@ void QMainWindowLayout::animationFinished(QWidget *widget) if (widget == pluggingWidget) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) #if QT_CONFIG(tabbar) if (QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(widget)) { // When the animated widget was a QDockWidgetGroupWindow, it means each of the @@ -2208,8 +2212,8 @@ void QMainWindowLayout::animationFinished(QWidget *widget) //and all the geometries (especially the one from the central widget) is correct layoutState.apply(false); -#ifndef QT_NO_DOCKWIDGET -#ifndef QT_NO_TABBAR +#if QT_CONFIG(dockwidget) +#if QT_CONFIG(tabbar) if (qobject_cast<QDockWidget*>(widget) != 0) { // info() might return null if the widget is destroyed while // animating but before the animationFinished signal is received. @@ -2222,13 +2226,13 @@ void QMainWindowLayout::animationFinished(QWidget *widget) if (!widgetAnimator.animating()) { //all animations are finished -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) parentWidget()->update(layoutState.dockAreaLayout.separatorRegion()); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) foreach (QTabBar *tab_bar, usedTabBars) tab_bar->show(); -#endif // QT_NO_TABBAR -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(tabbar) +#endif // QT_CONFIG(dockwidget) } updateGapIndicator(); @@ -2254,31 +2258,31 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay , savedState(mainwindow) , dockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowTabbedDocks) , statusbar(0) -#ifndef QT_NO_DOCKWIDGET -#ifndef QT_NO_TABBAR +#if QT_CONFIG(dockwidget) +#if QT_CONFIG(tabbar) , _documentMode(false) , verticalTabsEnabled(false) -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) , _tabShape(QTabWidget::Rounded) #endif #endif -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) , widgetAnimator(this) , pluggingWidget(0) { if (parentLayout) setParent(parentLayout); -#ifndef QT_NO_DOCKWIDGET -#ifndef QT_NO_TABBAR +#if QT_CONFIG(dockwidget) +#if QT_CONFIG(tabbar) sep = mainwindow->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, mainwindow); #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) for (int i = 0; i < QInternal::DockCount; ++i) tabPositions[i] = QTabWidget::South; #endif -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) pluggingWidget = 0; setObjectName(mainwindow->objectName() + QLatin1String("_layout")); @@ -2299,7 +2303,7 @@ void QMainWindowLayout::setDockOptions(QMainWindow::DockOptions opts) dockOptions = opts; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) setVerticalTabsEnabled(opts & QMainWindow::VerticalTabs); #endif @@ -2331,7 +2335,7 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget) addChildWidget(widget); layoutState.setCentralWidget(widget); if (savedState.isValid()) { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) savedState.dockAreaLayout.centralWidgetItem = layoutState.dockAreaLayout.centralWidgetItem; savedState.dockAreaLayout.fallbackToSizeHints = true; #else @@ -2383,7 +2387,7 @@ static bool unplugGroup(QMainWindowLayout *layout, QLayoutItem **item, */ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) { -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar) auto *groupWindow = qobject_cast<const QDockWidgetGroupWindow *>(widget->parentWidget()); if (!widget->isWindow() && groupWindow) { if (group && groupWindow->tabLayoutInfo()) { @@ -2423,7 +2427,7 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) QRect r = layoutState.itemRect(path); savedState = layoutState; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) { Q_ASSERT(path.constFirst() == 1); #if QT_CONFIG(tabwidget) @@ -2438,7 +2442,7 @@ QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) dw->d_func()->unplug(r); } } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) #ifndef QT_NO_TOOLBAR if (QToolBar *tb = qobject_cast<QToolBar*>(widget)) { tb->d_func()->unplug(r); @@ -2503,7 +2507,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) QWidget *widget = widgetItem->widget(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if ((dockOptions & QMainWindow::GroupedDragging) && (qobject_cast<QDockWidget*>(widget) || qobject_cast<QDockWidgetGroupWindow *>(widget))) { @@ -2565,7 +2569,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) } setCurrentHoveredFloat(nullptr); layoutState.dockAreaLayout.fallbackToSizeHints = false; -#endif //QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) QPoint pos = parentWidget()->mapFromGlobal(mousePos); @@ -2577,7 +2581,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) if (!path.isEmpty()) { bool allowed = false; -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) allowed = dw->isAreaAllowed(toDockWidgetArea(path.at(1))); @@ -2624,7 +2628,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos) currentGapRect = newState.gapRect(currentGapPos); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) parentWidget()->update(layoutState.dockAreaLayout.separatorRegion()); #endif layoutState = std::move(newState); @@ -2703,15 +2707,15 @@ bool QMainWindowLayout::restoreState(QDataStream &stream) savedState.deleteAllLayoutItems(); savedState.clear(); -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) if (parentWidget()->isVisible()) { -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) foreach (QTabBar *tab_bar, usedTabBars) tab_bar->show(); #endif } -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) return true; } diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index 6b75ef1caf..948d6edeef 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -57,16 +57,20 @@ #ifndef QT_NO_MAINWINDOW #include "QtWidgets/qlayout.h" +#if QT_CONFIG(tabbar) #include "QtWidgets/qtabbar.h" #include "QtGui/qpainter.h" #include "QtGui/qevent.h" +#endif #include "QtCore/qvector.h" #include "QtCore/qset.h" #include "QtCore/qbasictimer.h" #include "private/qlayoutengine_p.h" #include "private/qwidgetanimator_p.h" +#if QT_CONFIG(dockwidget) #include "qdockarealayout_p.h" +#endif #include "qtoolbararealayout_p.h" QT_BEGIN_NAMESPACE @@ -319,7 +323,7 @@ bool QMainWindowLayoutSeparatorHelper<Layout>::endSeparatorMove(const QPoint &) } #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) class QDockWidgetGroupWindow : public QWidget { Q_OBJECT @@ -381,7 +385,7 @@ public: QToolBarAreaLayout toolBarAreaLayout; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) QDockAreaLayout dockAreaLayout; #else QLayoutItem *centralWidgetItem; @@ -471,7 +475,7 @@ public: // dock widgets -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) void setCorner(Qt::Corner corner, Qt::DockWidgetArea area); Qt::DockWidgetArea corner(Qt::Corner corner) const; void addDockWidget(Qt::DockWidgetArea area, @@ -486,7 +490,7 @@ public: void setVerticalTabsEnabled(bool enabled); bool restoreDockWidget(QDockWidget *dockwidget); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) QDockAreaLayoutInfo *dockInfo(QWidget *w); bool _documentMode; bool documentMode() const; @@ -502,7 +506,7 @@ public: QList<QWidget*> unusedSeparatorWidgets; int sep; // separator extent -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabPosition tabPositions[4]; QTabWidget::TabShape _tabShape; @@ -512,12 +516,12 @@ public: void setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition); QDockWidgetGroupWindow *createTabbedDockWindow(); -#endif // QT_NO_TABWIDGET -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabwidget) +#endif // QT_CONFIG(tabbar) QDockAreaLayout *dockAreaLayoutInfo() { return &layoutState.dockAreaLayout; } void keepSize(QDockWidget *w); -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) // save/restore @@ -550,7 +554,7 @@ public: #if QT_CONFIG(rubberband) QPointer<QRubberBand> gapIndicator; #endif -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) QPointer<QDockWidgetGroupWindow> currentHoveredFloat; // set when dragging over a floating dock widget void setCurrentHoveredFloat(QDockWidgetGroupWindow *w); #endif @@ -566,19 +570,19 @@ public: private Q_SLOTS: void updateGapIndicator(); -#ifndef QT_NO_DOCKWIDGET -#ifndef QT_NO_TABBAR +#if QT_CONFIG(dockwidget) +#if QT_CONFIG(tabbar) void tabChanged(); void tabMoved(int from, int to); #endif #endif private: -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void updateTabBarShapes(); #endif }; -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_DEBUG_STREAM) +#if QT_CONFIG(dockwidget) && !defined(QT_NO_DEBUG_STREAM) class QDebug; QDebug operator<<(QDebug debug, const QDockAreaLayout &layout); QDebug operator<<(QDebug debug, const QMainWindowLayout *layout); diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index 83b5068bba..31d9ae21ae 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -254,7 +254,7 @@ static inline QMdiArea *mdiAreaParent(QWidget *widget) return 0; } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position) { const bool rounded = (shape == QTabWidget::Rounded); @@ -268,7 +268,7 @@ static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWid return rounded ? QTabBar::RoundedWest : QTabBar::TriangularWest; return QTabBar::RoundedNorth; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) static inline QString tabTextFor(QMdiSubWindow *subWindow) { @@ -561,7 +561,7 @@ QPoint MinOverlapPlacer::place(const QSize &size, const QVector<QRect> &rects, return findBestPlacement(domain, rects, candidates); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) class QMdiAreaTabBar : public QTabBar { public: @@ -659,7 +659,7 @@ QMdiSubWindow *QMdiAreaTabBar::subWindowFromIndex(int index) const return subWindow; } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /*! \internal @@ -672,17 +672,17 @@ QMdiAreaPrivate::QMdiAreaPrivate() #if QT_CONFIG(rubberband) rubberBand(0), #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) tabBar(0), #endif activationOrder(QMdiArea::CreationOrder), viewMode(QMdiArea::SubWindowView), -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) documentMode(false), tabsClosable(false), tabsMovable(false), #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) tabShape(QTabWidget::Rounded), tabPosition(QTabWidget::North), #endif @@ -777,7 +777,7 @@ void QMdiAreaPrivate::_q_processWindowStateChanged(Qt::WindowStates oldState, void QMdiAreaPrivate::_q_currentTabChanged(int index) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(index); #else if (!tabBar || index < 0) @@ -796,28 +796,28 @@ void QMdiAreaPrivate::_q_currentTabChanged(int index) QMdiSubWindow *subWindow = childWindows.at(index); Q_ASSERT(subWindow); activateWindow(subWindow); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QMdiAreaPrivate::_q_closeTab(int index) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(index); #else QMdiSubWindow *subWindow = childWindows.at(index); Q_ASSERT(subWindow); subWindow->close(); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } void QMdiAreaPrivate::_q_moveTab(int from, int to) { -#ifdef QT_NO_TABBAR +#if !QT_CONFIG(tabbar) Q_UNUSED(from); Q_UNUSED(to); #else childWindows.move(from, to); -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) } /*! @@ -855,7 +855,7 @@ void QMdiAreaPrivate::appendChild(QMdiSubWindow *child) indicesToActivatedChildren.prepend(childWindows.size() - 1); Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar) { tabBar->addTab(child->windowIcon(), tabTextFor(child)); updateTabBarGeometry(); @@ -1079,7 +1079,7 @@ void QMdiAreaPrivate::emitWindowActivated(QMdiSubWindow *activeWindow) aboutToBecomeActive = 0; Q_ASSERT(active->d_func()->isActive); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar && tabBar->currentIndex() != indexToActiveWindow) tabBar->setCurrentIndex(indexToActiveWindow); #endif @@ -1122,7 +1122,7 @@ void QMdiAreaPrivate::updateActiveWindow(int removedIndex, bool activeRemoved) { Q_ASSERT(indicesToActivatedChildren.size() == childWindows.size()); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (tabBar && removedIndex >= 0) { const QSignalBlocker blocker(tabBar); tabBar->removeTab(removedIndex); @@ -1560,14 +1560,14 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) // Just a guard since we cannot set viewMode = mode here. inViewModeChange = true; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (mode == QMdiArea::TabbedView) { Q_ASSERT(!tabBar); tabBar = new QMdiAreaTabBar(q); tabBar->setDocumentMode(documentMode); tabBar->setTabsClosable(tabsClosable); tabBar->setMovable(tabsMovable); -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); #endif @@ -1601,12 +1601,12 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) QObject::connect(tabBar, SIGNAL(tabCloseRequested(int)), q, SLOT(_q_closeTab(int))); QObject::connect(tabBar, SIGNAL(tabMoved(int,int)), q, SLOT(_q_moveTab(int,int))); } else -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) { // SubWindowView -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) delete tabBar; tabBar = 0; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) viewMode = mode; q->setViewportMargins(0, 0, 0, 0); @@ -1621,7 +1621,7 @@ void QMdiAreaPrivate::setViewMode(QMdiArea::ViewMode mode) inViewModeChange = false; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \internal */ @@ -1631,7 +1631,7 @@ void QMdiAreaPrivate::updateTabBarGeometry() return; Q_Q(QMdiArea); -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) Q_ASSERT(tabBarShapeFrom(tabShape, tabPosition) == tabBar->shape()); #endif const QSize tabBarSizeHint = tabBar->sizeHint(); @@ -1645,7 +1645,7 @@ void QMdiAreaPrivate::updateTabBarGeometry() areaWidth -= vbar->width(); QRect tabBarRect; -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) switch (tabPosition) { case QTabWidget::North: q->setViewportMargins(0, tabBarSizeHint.height(), 0, 0); @@ -1672,7 +1672,7 @@ void QMdiAreaPrivate::updateTabBarGeometry() default: break; } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) tabBar->setGeometry(QStyle::visualRect(q->layoutDirection(), q->contentsRect(), tabBarRect)); } @@ -1688,12 +1688,12 @@ void QMdiAreaPrivate::refreshTabBar() tabBar->setDocumentMode(documentMode); tabBar->setTabsClosable(tabsClosable); tabBar->setMovable(tabsMovable); -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) tabBar->setShape(tabBarShapeFrom(tabShape, tabPosition)); #endif updateTabBarGeometry(); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) /*! Constructs an empty mdi area. \a parent is passed to QWidget's @@ -2138,7 +2138,7 @@ void QMdiArea::setViewMode(ViewMode mode) d->setViewMode(mode); } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) /*! \property QMdiArea::documentMode \brief whether the tab bar is set to document mode in tabbed view mode. @@ -2213,9 +2213,9 @@ void QMdiArea::setTabsMovable(bool movable) d->tabsMovable = movable; d->refreshTabBar(); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) /*! \property QMdiArea::tabShape \brief the shape of the tabs in tabbed view mode. @@ -2267,7 +2267,7 @@ void QMdiArea::setTabPosition(QTabWidget::TabPosition position) d->tabPosition = position; d->refreshTabBar(); } -#endif // QT_NO_TABWIDGET +#endif // QT_CONFIG(tabwidget) /*! \reimp @@ -2294,7 +2294,7 @@ void QMdiArea::resizeEvent(QResizeEvent *resizeEvent) return; } -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) d->updateTabBarGeometry(); #endif @@ -2532,7 +2532,7 @@ bool QMdiArea::event(QEvent *event) d->setActive(d->active, false, false); d->setChildActivationEnabled(false); break; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QEvent::LayoutDirectionChange: d->updateTabBarGeometry(); break; @@ -2629,13 +2629,13 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) d->isSubWindowsTiled = false; break; case QEvent::Show: -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) if (d->tabBar) { const int tabIndex = d->childWindows.indexOf(subWindow); if (!d->tabBar->isTabEnabled(tabIndex)) d->tabBar->setTabEnabled(tabIndex, true); } -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) // fall through case QEvent::Hide: d->isSubWindowsTiled = false; @@ -2646,7 +2646,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) d->hideRubberBand(); break; #endif -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) case QEvent::WindowTitleChange: case QEvent::ModifiedChange: if (d->tabBar) @@ -2656,7 +2656,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event) if (d->tabBar) d->tabBar->setTabIcon(d->childWindows.indexOf(subWindow), subWindow->windowIcon()); break; -#endif // QT_NO_TABBAR +#endif // QT_CONFIG(tabbar) default: break; } diff --git a/src/widgets/widgets/qmdiarea.h b/src/widgets/widgets/qmdiarea.h index 44a40948af..acc59296b6 100644 --- a/src/widgets/widgets/qmdiarea.h +++ b/src/widgets/widgets/qmdiarea.h @@ -42,7 +42,9 @@ #include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qabstractscrollarea.h> +#if QT_CONFIG(tabwidget) #include <QtWidgets/qtabwidget.h> +#endif QT_BEGIN_NAMESPACE @@ -58,12 +60,12 @@ class Q_WIDGETS_EXPORT QMdiArea : public QAbstractScrollArea Q_PROPERTY(QBrush background READ background WRITE setBackground) Q_PROPERTY(WindowOrder activationOrder READ activationOrder WRITE setActivationOrder) Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode) -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) Q_PROPERTY(bool documentMode READ documentMode WRITE setDocumentMode) Q_PROPERTY(bool tabsClosable READ tabsClosable WRITE setTabsClosable) Q_PROPERTY(bool tabsMovable READ tabsMovable WRITE setTabsMovable) #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) Q_PROPERTY(QTabWidget::TabShape tabShape READ tabShape WRITE setTabShape) Q_PROPERTY(QTabWidget::TabPosition tabPosition READ tabPosition WRITE setTabPosition) #endif @@ -111,7 +113,7 @@ public: void setViewMode(ViewMode mode); ViewMode viewMode() const; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) bool documentMode() const; void setDocumentMode(bool enabled); @@ -121,7 +123,7 @@ public: void setTabsMovable(bool movable); bool tabsMovable() const; #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) void setTabShape(QTabWidget::TabShape shape); QTabWidget::TabShape tabShape() const; diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h index b77f3f63ea..10b5de6840 100644 --- a/src/widgets/widgets/qmdiarea_p.h +++ b/src/widgets/widgets/qmdiarea_p.h @@ -158,12 +158,12 @@ public: QMdiArea::WindowOrder activationOrder; QMdiArea::AreaOptions options; QMdiArea::ViewMode viewMode; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) bool documentMode; bool tabsClosable; bool tabsMovable; #endif -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) QTabWidget::TabShape tabShape; QTabWidget::TabPosition tabPosition; #endif @@ -213,7 +213,7 @@ public: QList<QMdiSubWindow *> subWindowList(QMdiArea::WindowOrder, bool reversed = false) const; void disconnectSubWindow(QObject *subWindow); void setViewMode(QMdiArea::ViewMode mode); -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) void updateTabBarGeometry(); void refreshTabBar(); #endif diff --git a/src/widgets/widgets/qmdisubwindow.h b/src/widgets/widgets/qmdisubwindow.h index e2bb533ddf..875c9a22c8 100644 --- a/src/widgets/widgets/qmdisubwindow.h +++ b/src/widgets/widgets/qmdisubwindow.h @@ -138,7 +138,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_enterInteractiveMode()) Q_PRIVATE_SLOT(d_func(), void _q_processFocusChanged(QWidget *, QWidget *)) friend class QMdiAreaPrivate; -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) friend class QMdiAreaTabBar; #endif friend class QMdi::ControlContainer; diff --git a/src/widgets/widgets/qscrollbar.h b/src/widgets/widgets/qscrollbar.h index 963ae4263b..c180a62585 100644 --- a/src/widgets/widgets/qscrollbar.h +++ b/src/widgets/widgets/qscrollbar.h @@ -85,7 +85,7 @@ private: Q_DISABLE_COPY(QScrollBar) Q_DECLARE_PRIVATE(QScrollBar) -#ifndef QT_NO_ITEMVIEWS +#if QT_CONFIG(itemviews) friend class QTableView; friend class QTreeViewPrivate; friend class QCommonListViewBase; diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 9e803f4388..adaafc7d21 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -38,7 +38,9 @@ ****************************************************************************/ #include "private/qlayoutengine_p.h" +#if QT_CONFIG(itemviews) #include "qabstractitemdelegate.h" +#endif #include "qapplication.h" #include "qbitmap.h" #include "qcursor.h" @@ -47,7 +49,9 @@ #include "qstyle.h" #include "qstyleoption.h" #include "qstylepainter.h" +#if QT_CONFIG(tabwidget) #include "qtabwidget.h" +#endif #include "qtooltip.h" #if QT_CONFIG(whatsthis) #include "qwhatsthis.h" @@ -63,8 +67,6 @@ #include "qdebug.h" #include "private/qtabbar_p.h" -#ifndef QT_NO_TABBAR - #if 0 // Used to be included in Qt4 for Q_WS_MAC #include <private/qt_mac_p.h> #include <private/qt_cocoa_helpers_mac_p.h> @@ -205,7 +207,7 @@ void QTabBarPrivate::initBasicStyleOption(QStyleOptionTab *option, int tabIndex) option->position = QStyleOptionTab::Middle; } -#ifndef QT_NO_TABWIDGET +#if QT_CONFIG(tabwidget) if (const QTabWidget *tw = qobject_cast<const QTabWidget *>(q->parentWidget())) { option->features |= QStyleOptionTab::HasFrame; if (tw->cornerWidget(Qt::TopLeftCorner) || tw->cornerWidget(Qt::BottomLeftCorner)) @@ -2690,6 +2692,4 @@ QT_END_NAMESPACE #include "moc_qtabbar.cpp" -#endif // QT_NO_TABBAR - #include "moc_qtabbar_p.cpp" diff --git a/src/widgets/widgets/qtabbar.h b/src/widgets/widgets/qtabbar.h index 2a27a98661..ebcd1094ef 100644 --- a/src/widgets/widgets/qtabbar.h +++ b/src/widgets/widgets/qtabbar.h @@ -43,10 +43,9 @@ #include <QtWidgets/qtwidgetsglobal.h> #include <QtWidgets/qwidget.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(tabbar); -#ifndef QT_NO_TABBAR +QT_BEGIN_NAMESPACE class QIcon; class QTabBarPrivate; @@ -221,8 +220,6 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_closeTab()) }; -#endif // QT_NO_TABBAR - QT_END_NAMESPACE #endif // QTABBAR_H diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h index 7141ffc8d5..195ff79c5d 100644 --- a/src/widgets/widgets/qtabbar_p.h +++ b/src/widgets/widgets/qtabbar_p.h @@ -60,12 +60,12 @@ #include <qdebug.h> #include <qvariantanimation.h> -#ifndef QT_NO_TABBAR - #define ANIMATION_DURATION 250 #include <qstyleoption.h> +QT_REQUIRE_CONFIG(tabbar); + QT_BEGIN_NAMESPACE class QMovableTabWidget : public QWidget @@ -286,9 +286,6 @@ public: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; }; - QT_END_NAMESPACE #endif - -#endif diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp index c84c78275d..c496d267b3 100644 --- a/src/widgets/widgets/qtabwidget.cpp +++ b/src/widgets/widgets/qtabwidget.cpp @@ -39,7 +39,6 @@ #include "qtabwidget.h" -#ifndef QT_NO_TABWIDGET #include "private/qwidget_p.h" #include "private/qtabbar_p.h" #include "qapplication.h" @@ -1375,5 +1374,3 @@ void QTabWidget::clear() QT_END_NAMESPACE #include "moc_qtabwidget.cpp" - -#endif //QT_NO_TABWIDGET diff --git a/src/widgets/widgets/qtabwidget.h b/src/widgets/widgets/qtabwidget.h index 7d8864241a..b80fdba1fb 100644 --- a/src/widgets/widgets/qtabwidget.h +++ b/src/widgets/widgets/qtabwidget.h @@ -44,10 +44,9 @@ #include <QtWidgets/qwidget.h> #include <QtGui/qicon.h> -QT_BEGIN_NAMESPACE - +QT_REQUIRE_CONFIG(tabwidget); -#ifndef QT_NO_TABWIDGET +QT_BEGIN_NAMESPACE class QTabBar; class QTabWidgetPrivate; @@ -181,8 +180,6 @@ private: void setUpLayout(bool = false); }; -#endif // QT_NO_TABWIDGET - QT_END_NAMESPACE #endif // QTABWIDGET_H diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index aaa64c8b2f..476f9d4cfa 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -42,7 +42,9 @@ #ifndef QT_NO_TOOLBAR #include <qapplication.h> +#if QT_CONFIG(combobox) #include <qcombobox.h> +#endif #include <qevent.h> #include <qlayout.h> #include <qmainwindow.h> diff --git a/src/widgets/widgets/qtoolbarlayout.cpp b/src/widgets/widgets/qtoolbarlayout.cpp index 79174bdbff..39e61a1951 100644 --- a/src/widgets/widgets/qtoolbarlayout.cpp +++ b/src/widgets/widgets/qtoolbarlayout.cpp @@ -666,7 +666,7 @@ void QToolBarLayout::setExpanded(bool exp) extension->setChecked(expanded); if (QMainWindow *win = qobject_cast<QMainWindow*>(tb->parentWidget())) { -#ifdef QT_NO_DOCKWIDGET +#if !QT_CONFIG(dockwidget) animating = false; #else animating = !tb->isWindow() && win->isAnimated(); diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 97df3427b0..9555ccc5b6 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -41,7 +41,9 @@ #ifndef QT_NO_LINEEDIT +#if QT_CONFIG(itemviews) #include "qabstractitemview.h" +#endif #include "qclipboard.h" #include <private/qguiapplication_p.h> #include <qpa/qplatformtheme.h> @@ -548,10 +550,10 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event) if (!event->commitString().isEmpty()) { internalInsert(event->commitString()); cursorPositionChanged = true; + } else { + m_cursor = qBound(0, c, m_text.length()); } - m_cursor = qBound(0, c, m_text.length()); - for (int i = 0; i < event->attributes().size(); ++i) { const QInputMethodEvent::Attribute &a = event->attributes().at(i); if (a.type == QInputMethodEvent::Selection) { diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri index 610932c6ce..aed3f53478 100644 --- a/src/widgets/widgets/widgets.pri +++ b/src/widgets/widgets/widgets.pri @@ -5,13 +5,7 @@ HEADERS += \ widgets/qbuttongroup_p.h \ widgets/qabstractspinbox.h \ widgets/qabstractspinbox_p.h \ - widgets/qcalendarwidget.h \ - widgets/qcombobox.h \ - widgets/qcombobox_p.h \ widgets/qdial.h \ - widgets/qdockwidget.h \ - widgets/qdockwidget_p.h \ - widgets/qdockarealayout_p.h \ widgets/qframe.h \ widgets/qframe_p.h \ widgets/qgroupbox.h \ @@ -40,9 +34,6 @@ HEADERS += \ widgets/qsplitter_p.h \ widgets/qstackedwidget.h \ widgets/qstatusbar.h \ - widgets/qtabbar.h \ - widgets/qtabbar_p.h \ - widgets/qtabwidget.h \ widgets/qtextedit.h \ widgets/qtextedit_p.h \ widgets/qtextbrowser.h \ @@ -67,11 +58,7 @@ HEADERS += \ SOURCES += \ widgets/qbuttongroup.cpp \ widgets/qabstractspinbox.cpp \ - widgets/qcalendarwidget.cpp \ - widgets/qcombobox.cpp \ widgets/qdial.cpp \ - widgets/qdockwidget.cpp \ - widgets/qdockarealayout.cpp \ widgets/qeffects.cpp \ widgets/qframe.cpp \ widgets/qgroupbox.cpp \ @@ -92,8 +79,6 @@ SOURCES += \ widgets/qsplitter.cpp \ widgets/qstackedwidget.cpp \ widgets/qstatusbar.cpp \ - widgets/qtabbar.cpp \ - widgets/qtabwidget.cpp \ widgets/qtextedit.cpp \ widgets/qtextbrowser.cpp \ widgets/qtoolbar.cpp \ @@ -129,6 +114,11 @@ qtConfig(abstractslider) { widgets/qabstractslider.cpp } +qtConfig(calendarwidget) { + HEADERS += widgets/qcalendarwidget.h + SOURCES += widgets/qcalendarwidget.cpp +} + qtConfig(checkbox) { HEADERS += \ widgets/qcheckbox.h @@ -137,6 +127,14 @@ qtConfig(checkbox) { widgets/qcheckbox.cpp } +qtConfig(combobox) { + HEADERS += \ + widgets/qcombobox.h \ + widgets/qcombobox_p.h + + SOURCES += widgets/qcombobox.cpp +} + qtConfig(commandlinkbutton) { HEADERS += \ widgets/qcommandlinkbutton.h @@ -154,6 +152,17 @@ qtConfig(datetimeedit) { widgets/qdatetimeedit.cpp } +qtConfig(dockwidget) { + HEADERS += \ + widgets/qdockwidget.h \ + widgets/qdockwidget_p.h \ + widgets/qdockarealayout_p.h + + SOURCES += \ + widgets/qdockwidget.cpp \ + widgets/qdockarealayout.cpp +} + qtConfig(fontcombobox) { HEADERS += widgets/qfontcombobox.h SOURCES += widgets/qfontcombobox.cpp @@ -214,6 +223,19 @@ qtConfig(splashscreen) { widgets/qsplashscreen.cpp } +qtConfig(tabbar) { + HEADERS += \ + widgets/qtabbar.h \ + widgets/qtabbar_p.h + + SOURCES += widgets/qtabbar.cpp +} + +qtConfig(tabwidget) { + HEADERS += widgets/qtabwidget.h + SOURCES += widgets/qtabwidget.cpp +} + qtConfig(widgettextcontrol) { HEADERS += \ widgets/qwidgettextcontrol_p.h \ diff --git a/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp index 4bb3fa5b28..2e698e6615 100644 --- a/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp +++ b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp @@ -81,7 +81,6 @@ private slots: void stresstest(); void noIterations(); void throttling(); - void blockSize(); void multipleResults(); }; @@ -240,50 +239,6 @@ void tst_QtConcurrentIterateKernel::throttling() QCOMPARE(threads.count(), 1); } -class BlockSizeRecorder : public IterateKernel<TestIterator, void> -{ -public: - BlockSizeRecorder(TestIterator begin, TestIterator end) - : IterateKernel<TestIterator, void>(begin, end) - , peakBlockSize(0) - , peakBegin(0) - {} - - inline bool runIterations(TestIterator, int begin, int end, void *) - { - const int blockSize = end - begin; - if (blockSize > peakBlockSize) { - peakBlockSize = blockSize; - peakBegin = begin; - } - return false; - } - int peakBlockSize; - int peakBegin; -}; - -static QByteArray msgBlockSize(const BlockSizeRecorder &recorder, int expectedMinimumBlockSize) -{ - return QByteArrayLiteral("peakBlockSize=") + QByteArray::number(recorder.peakBlockSize) - + QByteArrayLiteral(" is less than expectedMinimumBlockSize=") - + QByteArray::number(expectedMinimumBlockSize) - + QByteArrayLiteral(", reached at: ") + QByteArray::number(recorder.peakBegin) - + QByteArrayLiteral(" (ideal thread count: ") + QByteArray::number(QThread::idealThreadCount()) - + ')'; -} - -void tst_QtConcurrentIterateKernel::blockSize() -{ - const int expectedMinimumBlockSize = 1024 / QThread::idealThreadCount(); - BlockSizeRecorder recorder(0, 10000); - recorder.startBlocking(); -#ifdef Q_OS_WIN - if (recorder.peakBlockSize < expectedMinimumBlockSize) - QEXPECT_FAIL("", msgBlockSize(recorder, expectedMinimumBlockSize).constData(), Abort); -#endif // Q_OS_WIN - QVERIFY2(recorder.peakBlockSize >= expectedMinimumBlockSize, msgBlockSize(recorder, expectedMinimumBlockSize)); -} - class MultipleResultsFor : public IterateKernel<TestIterator, int> { public: diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp index 99e1d5a32f..5975303ca6 100644 --- a/tests/auto/corelib/io/largefile/tst_largefile.cpp +++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp @@ -228,7 +228,7 @@ QByteArray const &tst_LargeFile::getDataBlock(int index, qint64 position) void tst_LargeFile::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir); + m_tempDir = QSharedPointer<QTemporaryDir>::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp index 4e5059c1a2..68fc628a41 100644 --- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp +++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp @@ -473,7 +473,7 @@ protected: if (create) { QSharedPointer<File> &p = fileSystem[fileName_]; if (p.isNull()) - p = QSharedPointer<File>(new File); + p = QSharedPointer<File>::create(); return p; } @@ -571,7 +571,7 @@ class FileEngineHandler void tst_QAbstractFileEngine::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_currentDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir()); + m_currentDir = QSharedPointer<QTemporaryDir>::create(); QVERIFY2(!m_currentDir.isNull(), qPrintable("Could not create current directory.")); QDir::setCurrent(m_currentDir->path()); } diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp index 0068411b94..14a2528cc6 100644 --- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp +++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp @@ -300,7 +300,7 @@ void tst_QDataStream::getSetCheck() void tst_QDataStream::initTestCase() { m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir); + m_tempDir = QSharedPointer<QTemporaryDir>::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); } diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index da948849f6..e6bad9a8ef 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -93,6 +93,9 @@ private slots: void entryList_data(); void entryList(); + void entryListWithTestFiles_data(); + void entryListWithTestFiles(); + void entryListTimedSort(); void entryListSimple_data(); @@ -717,6 +720,32 @@ void tst_QDir::entryList_data() QTest::newRow("resources2") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") << (int)(QDir::Files) << (int)(QDir::NoSort) << QString("file1.data,file2.data,file3.data").split(','); +} + +void tst_QDir::entryList() +{ + QFETCH(QString, dirName); + QFETCH(QStringList, nameFilters); + QFETCH(int, filterspec); + QFETCH(int, sortspec); + QFETCH(QStringList, expected); + + QDir dir(dirName); + QVERIFY2(dir.exists(), msgDoesNotExist(dirName).constData()); + + QStringList actual = dir.entryList(nameFilters, (QDir::Filters)filterspec, + (QDir::SortFlags)sortspec); + + QCOMPARE(actual, expected); +} + +void tst_QDir::entryListWithTestFiles_data() +{ + QTest::addColumn<QString>("dirName"); // relative from current path or abs + QTest::addColumn<QStringList>("nameFilters"); + QTest::addColumn<int>("filterspec"); + QTest::addColumn<int>("sortspec"); + QTest::addColumn<QStringList>("expected"); QTest::newRow("nofilter") << (m_dataPath + "/entrylist/") << QStringList("*") << int(QDir::NoFilter) << int(QDir::Name) @@ -823,7 +852,7 @@ void tst_QDir::entryList_data() << QString("c,b,a,a.a,a.b,a.c,b.b,b.c,b.a,c.c,c.b,c.a,f.c,f.b,f.a,f,e.c,e.b,e.a,e,d.c,d.b,d.a,d").split(','); } -void tst_QDir::entryList() +void tst_QDir::entryListWithTestFiles() { QFETCH(QString, dirName); QFETCH(QStringList, nameFilters); @@ -831,28 +860,49 @@ void tst_QDir::entryList() QFETCH(int, sortspec); QFETCH(QStringList, expected); + QStringList testFiles; + QString entrylistPath = (m_dataPath + "/entrylist/"); - QFile(entrylistPath + "writable").open(QIODevice::ReadWrite); - QFile(entrylistPath + "file").setPermissions(QFile::ReadOwner | QFile::ReadUser); - QFile::remove(entrylistPath + "linktofile"); - QFile::remove(entrylistPath + "linktodirectory"); - QFile::remove(entrylistPath + "linktofile.lnk"); - QFile::remove(entrylistPath + "linktodirectory.lnk"); - QFile::remove(entrylistPath + "brokenlink.lnk"); - QFile::remove(entrylistPath + "brokenlink"); + + { + const QString writableFileName = entrylistPath + "writable"; + QFile writableFile(writableFileName); + testFiles.append(writableFileName); + + QVERIFY2(writableFile.open(QIODevice::ReadWrite), + qPrintable(writableFile.errorString())); + } + + { + QFile readOnlyFile(entrylistPath + "file"); + QVERIFY2(readOnlyFile.setPermissions(QFile::ReadOwner | QFile::ReadUser), + qPrintable(readOnlyFile.errorString())); + } + #ifndef Q_NO_SYMLINKS #if defined(Q_OS_WIN) // ### Sadly, this is a platform difference right now. // Note we are using capital L in entryList on one side here, to test case-insensitivity - QFile::link((m_dataPath + "/entryList/") + "file", entrylistPath + "linktofile.lnk"); - QFile::link((m_dataPath + "/entryList/") + "directory", entrylistPath + "linktodirectory.lnk"); - QFile::link((m_dataPath + "/entryList/") + "nothing", entrylistPath + "brokenlink.lnk"); + const QVector<QPair<QString, QString> > symLinks = + { + {m_dataPath + "/entryList/file", entrylistPath + "linktofile.lnk"}, + {m_dataPath + "/entryList/directory", entrylistPath + "linktodirectory.lnk"}, + {m_dataPath + "/entryList/nothing", entrylistPath + "brokenlink.lnk"} + }; #else - QFile::link("file", entrylistPath + "linktofile.lnk"); - QFile::link("directory", entrylistPath + "linktodirectory.lnk"); - QFile::link("nothing", entrylistPath + "brokenlink.lnk"); + const QVector<QPair<QString, QString> > symLinks = + { + {"file", entrylistPath + "linktofile.lnk"}, + {"directory", entrylistPath + "linktodirectory.lnk"}, + {"nothing", entrylistPath + "brokenlink.lnk"} + }; #endif + for (const auto &symLink : symLinks) { + QVERIFY2(QFile::link(symLink.first, symLink.second), + qPrintable(symLink.first + "->" + symLink.second)); + testFiles.append(symLink.second); + } #endif //Q_NO_SYMLINKS QDir dir(dirName); @@ -861,8 +911,6 @@ void tst_QDir::entryList() QStringList actual = dir.entryList(nameFilters, (QDir::Filters)filterspec, (QDir::SortFlags)sortspec); - int max = qMin(actual.count(), expected.count()); - bool doContentCheck = true; #if defined(Q_OS_UNIX) if (qstrcmp(QTest::currentDataTag(), "QDir::AllEntries | QDir::Writable") == 0) { @@ -872,20 +920,11 @@ void tst_QDir::entryList() } #endif - if (doContentCheck) { - for (int i=0; i<max; ++i) - QCOMPARE(actual[i], expected[i]); - - QCOMPARE(actual.count(), expected.count()); - } + for (int i = testFiles.size() - 1; i >= 0; --i) + QVERIFY2(QFile::remove(testFiles.at(i)), qPrintable(testFiles.at(i))); - QFile::remove(entrylistPath + "writable"); - QFile::remove(entrylistPath + "linktofile"); - QFile::remove(entrylistPath + "linktodirectory"); - QFile::remove(entrylistPath + "linktofile.lnk"); - QFile::remove(entrylistPath + "linktodirectory.lnk"); - QFile::remove(entrylistPath + "brokenlink.lnk"); - QFile::remove(entrylistPath + "brokenlink"); + if (doContentCheck) + QCOMPARE(actual, expected); } void tst_QDir::entryListTimedSort() diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index 17497e46b9..54d089f3bb 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -1155,7 +1155,6 @@ void tst_QFile::invalidFile_data() #else #if !defined(Q_OS_WINRT) QTest::newRow( "colon2" ) << invalidDriveLetter() + QString::fromLatin1(":ail:invalid"); - QTest::newRow( "date" ) << QString( "testLog-03:20.803Z.txt" ); #endif QTest::newRow( "colon3" ) << QString( ":failinvalid" ); QTest::newRow( "forwardslash" ) << QString( "fail/invalid" ); diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp index 5cb532f76b..a76fd4703e 100644 --- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp @@ -71,7 +71,7 @@ void tst_QIODevice::initTestCase() || QFile::copy(QStringLiteral(":/tst_qiodevice.cpp"), QStringLiteral("./tst_qiodevice.cpp"))); #endif m_previousCurrent = QDir::currentPath(); - m_tempDir = QSharedPointer<QTemporaryDir>(new QTemporaryDir); + m_tempDir = QSharedPointer<QTemporaryDir>::create(); QVERIFY2(!m_tempDir.isNull(), qPrintable("Could not create temporary directory.")); QVERIFY2(QDir::setCurrent(m_tempDir->path()), qPrintable("Could not switch current directory")); } diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index aff04afe08..0b4f76ef70 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -216,12 +216,11 @@ void tst_QEventLoop::processEvents() awakeSpy.clear(); QVERIFY(eventLoop.processEvents(QEventLoop::WaitForMoreEvents)); - // Verify that the eventloop has blocked and woken up. Some eventloops - // may block and wake up multiple times. - QVERIFY(aboutToBlockSpy.count() > 0); - QVERIFY(awakeSpy.count() > 0); // We should get one awake for each aboutToBlock, plus one awake when - // processEvents is entered. + // processEvents is entered. There is no guarantee that that the + // processEvents call actually blocked, since the OS may introduce + // native events at any time. + QVERIFY(awakeSpy.count() > 0); QVERIFY(awakeSpy.count() >= aboutToBlockSpy.count()); killTimer(timerId); diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 88984feff7..d424e6086d 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -139,6 +139,7 @@ private slots: void formattedDataSize_data(); void formattedDataSize(); + void bcp47Name(); private: QString m_decimal, m_thousand, m_sdate, m_ldate, m_time; @@ -2609,5 +2610,26 @@ void tst_QLocale::formattedDataSize() QCOMPARE(QLocale(language).formattedDataSize(bytes, decimalPlaces, units), output); } +void tst_QLocale::bcp47Name() +{ + QCOMPARE(QLocale("C").bcp47Name(), QStringLiteral("en")); + QCOMPARE(QLocale("en").bcp47Name(), QStringLiteral("en")); + QCOMPARE(QLocale("en_US").bcp47Name(), QStringLiteral("en")); + QCOMPARE(QLocale("en_GB").bcp47Name(), QStringLiteral("en-GB")); + QCOMPARE(QLocale("en_DE").bcp47Name(), QStringLiteral("en-DE")); + QCOMPARE(QLocale("de_DE").bcp47Name(), QStringLiteral("de")); + QCOMPARE(QLocale("sr_RS").bcp47Name(), QStringLiteral("sr")); + QCOMPARE(QLocale("sr_Cyrl_RS").bcp47Name(), QStringLiteral("sr")); + QCOMPARE(QLocale("sr_Latn_RS").bcp47Name(), QStringLiteral("sr-Latn")); + QCOMPARE(QLocale("sr_ME").bcp47Name(), QStringLiteral("sr-ME")); + QCOMPARE(QLocale("sr_Cyrl_ME").bcp47Name(), QStringLiteral("sr-Cyrl-ME")); + QCOMPARE(QLocale("sr_Latn_ME").bcp47Name(), QStringLiteral("sr-ME")); + + // Fall back to defaults when country isn't in CLDR for this language: + QCOMPARE(QLocale("sr_HR").bcp47Name(), QStringLiteral("sr")); + QCOMPARE(QLocale("sr_Cyrl_HR").bcp47Name(), QStringLiteral("sr")); + QCOMPARE(QLocale("sr_Latn_HR").bcp47Name(), QStringLiteral("sr-Latn")); +} + QTEST_MAIN(tst_QLocale) #include "tst_qlocale.moc" diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp index 9e257267ca..11896d2f15 100644 --- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp +++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp @@ -56,7 +56,7 @@ class tst_QDBusAbstractInterface: public QObject return Pinger(); if (service.isEmpty() && !service.isNull()) service = con.baseService(); - return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con)); + return Pinger::create(service, path, con); } Pinger getPingerPeer(const QString &path = "/", const QString &service = "") @@ -64,7 +64,7 @@ class tst_QDBusAbstractInterface: public QObject QDBusConnection con = QDBusConnection("peer"); if (!con.isConnected()) return Pinger(); - return Pinger(new org::qtproject::QtDBus::Pinger(service, path, con)); + return Pinger::create(service, path, con); } void resetServer() diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp index cff26be7bb..2f5537adfe 100644 --- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp +++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp @@ -117,6 +117,9 @@ private slots: void useCase2(); void useCase3(); + void setNullChild(); + void deleteChild(); + void rootItemFlags(); #ifdef QT_BUILD_INTERNAL void treeDragAndDrop(); @@ -1364,6 +1367,30 @@ void tst_QStandardItemModel::useCase3() delete childItem; } +void tst_QStandardItemModel::setNullChild() +{ + QStandardItemModel model; + model.setColumnCount(2); + createChildren(&model, model.invisibleRootItem(), 0); + QStandardItem *item = model.item(0); + QSignalSpy spy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>))); + item->setChild(0, nullptr); + QCOMPARE(item->child(0), nullptr); + QCOMPARE(spy.count(), 1); +} + +void tst_QStandardItemModel::deleteChild() +{ + QStandardItemModel model; + model.setColumnCount(2); + createChildren(&model, model.invisibleRootItem(), 0); + QStandardItem *item = model.item(0); + QSignalSpy spy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>))); + delete item->child(0); + QCOMPARE(item->child(0), nullptr); + QCOMPARE(spy.count(), 1); +} + void tst_QStandardItemModel::rootItemFlags() { QStandardItemModel model(6, 4); diff --git a/tests/auto/gui/kernel/qguieventloop/BLACKLIST b/tests/auto/gui/kernel/qguieventloop/BLACKLIST index 2303d9380e..03acb2f5b0 100644 --- a/tests/auto/gui/kernel/qguieventloop/BLACKLIST +++ b/tests/auto/gui/kernel/qguieventloop/BLACKLIST @@ -1,4 +1,2 @@ -[processEvents] -osx-10.12 [testQuitLock] osx-10.12 diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index a1c8399a26..3711ce431c 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -205,7 +205,7 @@ void tst_QFtp::initTestCase() QVERIFY(QtNetworkSettings::verifyTestNetworkSettings()); #ifndef QT_NO_BEARERMANAGEMENT QNetworkConfigurationManager manager; - networkSessionImplicit = QSharedPointer<QNetworkSession>(new QNetworkSession(manager.defaultConfiguration())); + networkSessionImplicit = QSharedPointer<QNetworkSession>::create(manager.defaultConfiguration()); networkSessionImplicit->open(); QVERIFY(networkSessionImplicit->waitForOpened(60000)); //there may be user prompt on 1st connect #endif diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST index cf25c96fd8..5adb05d3f2 100644 --- a/tests/auto/network/socket/qudpsocket/BLACKLIST +++ b/tests/auto/network/socket/qudpsocket/BLACKLIST @@ -6,7 +6,6 @@ osx windows osx [asyncReadDatagram] -windows osx [multicastLeaveAfterClose] osx diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 43d0781083..af7cf24838 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -213,7 +213,7 @@ void tst_QUdpSocket::initTestCase_data() #ifndef QT_NO_BEARERMANAGEMENT netConfMan = new QNetworkConfigurationManager(this); networkConfiguration = netConfMan->defaultConfiguration(); - networkSession = QSharedPointer<QNetworkSession>(new QNetworkSession(networkConfiguration)); + networkSession = QSharedPointer<QNetworkSession>::create(networkConfiguration); if (!networkSession->isOpen()) { networkSession->open(); QVERIFY(networkSession->waitForOpened(30000)); diff --git a/tests/auto/other/macgui/BLACKLIST b/tests/auto/other/macgui/BLACKLIST index 2b6a0e2fe8..5a5d6a175f 100644 --- a/tests/auto/other/macgui/BLACKLIST +++ b/tests/auto/other/macgui/BLACKLIST @@ -1,3 +1,2 @@ [nonModalOrder] -osx-10.11 ci -osx-10.12 ci +osx diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp index c6fc67f998..75fa4815c9 100644 --- a/tests/auto/other/macgui/tst_macgui.cpp +++ b/tests/auto/other/macgui/tst_macgui.cpp @@ -190,7 +190,6 @@ void tst_MacGui::nonModalOrder() primary.resize(400, 400); primary.move(100, 100); primary.exec(); - QEXPECT_FAIL("", "Non-modal child windows show behind the modal dialig", Abort); QCOMPARE(primary.frontWidget, primary.secondaryWindow); } diff --git a/tests/auto/other/macnativeevents/BLACKLIST b/tests/auto/other/macnativeevents/BLACKLIST index 5be479a6b1..674e62144a 100644 --- a/tests/auto/other/macnativeevents/BLACKLIST +++ b/tests/auto/other/macnativeevents/BLACKLIST @@ -21,10 +21,6 @@ osx osx [testMouseDragToNonClientArea] osx -# QTQAINFRA-1292 -[testPushButtonPressRelease] -osx-10.11 ci - # The following key tests fail after switching to synchronous # expose events, and we don't know why yet. QTBUG-62042 [testKeyPressOnToplevel] @@ -35,3 +31,9 @@ osx osx [testModifierCtrl] osx +# QTQAINFRA-1292 +[testPushButtonPressRelease] +osx-10.11 ci +# QTQAINFRA-1292 +[testModifierCtrlWithDontSwapCtrlAndMeta] +osx-10.12 ci diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 4f60fe3d96..4ffdc4c762 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -3344,7 +3344,7 @@ void tst_QAccessibility::tableTest() void tst_QAccessibility::calendarWidgetTest() { -#ifndef QT_NO_CALENDARWIDGET +#if QT_CONFIG(calendarwidget) { QCalendarWidget calendarWidget; @@ -3420,12 +3420,12 @@ void tst_QAccessibility::calendarWidgetTest() } QTestAccessibility::clearEvents(); -#endif // QT_NO_CALENDARWIDGET +#endif // QT_CONFIG(calendarwidget) } void tst_QAccessibility::dockWidgetTest() { -#ifndef QT_NO_DOCKWIDGET +#if QT_CONFIG(dockwidget) // Set up a proper main window with two dock widgets QMainWindow *mw = new QMainWindow(); QFrame *central = new QFrame(mw); @@ -3558,7 +3558,7 @@ void tst_QAccessibility::dockWidgetTest() delete mw; QTestAccessibility::clearEvents(); -#endif // QT_NO_DOCKWIDGET +#endif // QT_CONFIG(dockwidget) } void tst_QAccessibility::comboBoxTest() diff --git a/tests/auto/other/qaccessibilitymac/BLACKLIST b/tests/auto/other/qaccessibilitymac/BLACKLIST new file mode 100644 index 0000000000..f53fa7e853 --- /dev/null +++ b/tests/auto/other/qaccessibilitymac/BLACKLIST @@ -0,0 +1,2 @@ +[hierarchyTest] +osx-10.12 ci diff --git a/tests/auto/other/qfocusevent/BLACKLIST b/tests/auto/other/qfocusevent/BLACKLIST new file mode 100644 index 0000000000..502820fa12 --- /dev/null +++ b/tests/auto/other/qfocusevent/BLACKLIST @@ -0,0 +1,5 @@ +[checkReason_Shortcut] +osx-10.12 ci +[checkReason_ActiveWindow] +osx-10.12 ci + diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index 8deb5ddf8f..35f86772e2 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -243,6 +243,9 @@ private slots: void integralTypesMysql_data() { generic_data("QMYSQL"); } void integralTypesMysql(); + void QTBUG_57138_data() { generic_data("QSQLITE"); } + void QTBUG_57138(); + private: // returns all database connections void generic_data(const QString &engine=QString()); @@ -4083,5 +4086,40 @@ void tst_QSqlQuery::integralTypesMysql() } } +void tst_QSqlQuery::QTBUG_57138() +{ + QDateTime utc = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::UTC); + QDateTime localtime = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::LocalTime); + QDateTime tzoffset = QDateTime(QDate(2150, 1, 5), QTime(14, 0, 0, 123), Qt::OffsetFromUTC, 3600); + + QFETCH(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + QSqlQuery create(db); + QString tableName = qTableName("qtbug57138", __FILE__, db); + + QVERIFY_SQL(create, exec("create table " + tableName + " (id int, dt_utc datetime, dt_lt datetime, dt_tzoffset datetime)")); + QVERIFY_SQL(create, prepare("insert into " + tableName + " (id, dt_utc, dt_lt, dt_tzoffset) values (?, ?, ?, ?)")); + + create.addBindValue(0); + create.addBindValue(utc); + create.addBindValue(localtime); + create.addBindValue(tzoffset); + + QVERIFY_SQL(create, exec()); + + QSqlQuery q(db); + q.prepare("SELECT dt_utc, dt_lt, dt_tzoffset FROM " + tableName + " WHERE id = ?"); + q.addBindValue(0); + + QVERIFY_SQL(q, exec()); + QVERIFY(q.next()); + + QCOMPARE(q.value(0).toDateTime(), utc); + QCOMPARE(q.value(1).toDateTime(), localtime); + QCOMPARE(q.value(2).toDateTime(), tzoffset); +} + QTEST_MAIN( tst_QSqlQuery ) #include "tst_qsqlquery.moc" diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp index a0273513f7..62286d703f 100644 --- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp @@ -260,6 +260,14 @@ void tst_QInputDialog::getInt() QFETCH(int, min); QFETCH(int, max); QVERIFY(min < max); + +#if defined(Q_OS_MACOS) + if (QSysInfo::productVersion() == QLatin1String("10.12")) { + QSKIP("Test hangs on macOS 10.12 -- QTQAINFRA-1356"); + return; + } +#endif + parent = new QWidget; doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetInt; @@ -300,6 +308,14 @@ void tst_QInputDialog::getDouble() QFETCH(double, max); QFETCH(int, decimals); QVERIFY(min < max && decimals >= 0 && decimals <= 13); + +#if defined(Q_OS_MACOS) + if (QSysInfo::productVersion() == QLatin1String("10.12")) { + QSKIP("Test hangs on macOS 10.12 -- QTQAINFRA-1356"); + return; + } +#endif + parent = new QWidget; doneCode = QDialog::Accepted; testFunc = &tst_QInputDialog::testFuncGetDouble; diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index c75c1dc87e..a27e0b6048 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -3442,7 +3442,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_Right << Qt::Key_Down; - model.reset(new QStandardItemModel(4, 2)); + model = QSharedPointer<QStandardItemModel>::create(4, 2); QTest::newRow("row span, top down") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1); @@ -3455,7 +3455,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_End << Qt::Key_Down << Qt::Key_Left; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("row span, right to left") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1); @@ -3468,7 +3468,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Right; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("row span, left to right") << keyPresses << model << 1 << 1 << 2 << 1 << model->index(2, 1) << model->index(1, 1); @@ -3481,7 +3481,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Up; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("col span, bottom up") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 0) << model->index(1, 0); @@ -3494,7 +3494,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_PageDown << Qt::Key_Right << Qt::Key_Up; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("col span, bottom up #2") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 1) << model->index(1, 0); @@ -3507,7 +3507,7 @@ void tst_QTableView::editSpanFromDirections_data() +---+---+---+ */ keyPresses.clear(); keyPresses << Qt::Key_End << Qt::Key_Down; - model.reset(new QStandardItemModel(3, 3)); + model = QSharedPointer<QStandardItemModel>::create(3, 3); QTest::newRow("col span, top down") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 2) << model->index(1, 0); } diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index 21575fbaf9..5648218d04 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -48,6 +48,7 @@ osx [showMinimizedKeepsFocus] osx-10.10 osx-10.11 ci +osx-10.12 ci [moveWindowInShowEvent:1] osx [moveWindowInShowEvent:2] @@ -75,3 +76,5 @@ osx ubuntu-14.04 [moveChild:right] osx +[activateWindow] +osx-10.12 ci diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 3da26613bb..096beedf63 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -4954,8 +4954,7 @@ static QPixmap grabWindow(QWindow *window, int x, int y, int width, int height) { QScreen *screen = window->screen(); Q_ASSERT(screen); - QPixmap result = screen->grabWindow(window->winId(), x, y, width, height); - return result.devicePixelRatio() > 1 ? result.scaled(width, height) : result; + return screen->grabWindow(window->winId(), x, y, width, height); } #define VERIFY_COLOR(child, region, color) verifyColor(child, region, color, __LINE__) @@ -4973,7 +4972,8 @@ bool verifyColor(QWidget &child, const QRegion ®ion, const QColor &color, uns const QPixmap pixmap = grabBackingStore ? child.grab(rect) : grabWindow(window, rect.left(), rect.top(), rect.width(), rect.height()); - if (!QTest::qCompare(pixmap.size(), rect.size(), "pixmap.size()", "rect.size()", __FILE__, callerLine)) + const QSize actualSize = pixmap.size() / pixmap.devicePixelRatioF(); + if (!QTest::qCompare(actualSize, rect.size(), "pixmap.size()", "rect.size()", __FILE__, callerLine)) return false; QPixmap expectedPixmap(pixmap); /* ensure equal formats */ expectedPixmap.detach(); @@ -5718,6 +5718,8 @@ void tst_QWidget::setToolTip() QTest::qWait(2200); // delay is 2000 QTest::mouseMove(popupWindow); } + + QTRY_COMPARE(QApplication::topLevelWidgets().size(), 1); } void tst_QWidget::testWindowIconChangeEventPropagation() @@ -5755,14 +5757,14 @@ void tst_QWidget::testWindowIconChangeEventPropagation() QList <EventSpyPtr> applicationEventSpies; QList <EventSpyPtr> widgetEventSpies; foreach (QWidget *widget, widgets) { - applicationEventSpies.append(EventSpyPtr(new EventSpy<QWidget>(widget, QEvent::ApplicationWindowIconChange))); - widgetEventSpies.append(EventSpyPtr(new EventSpy<QWidget>(widget, QEvent::WindowIconChange))); + applicationEventSpies.append(EventSpyPtr::create(widget, QEvent::ApplicationWindowIconChange)); + widgetEventSpies.append(EventSpyPtr::create(widget, QEvent::WindowIconChange)); } QList <WindowEventSpyPtr> appWindowEventSpies; QList <WindowEventSpyPtr> windowEventSpies; foreach (QWindow *window, windows) { - appWindowEventSpies.append(WindowEventSpyPtr(new EventSpy<QWindow>(window, QEvent::ApplicationWindowIconChange))); - windowEventSpies.append(WindowEventSpyPtr(new EventSpy<QWindow>(window, QEvent::WindowIconChange))); + appWindowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::ApplicationWindowIconChange)); + windowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::WindowIconChange)); } // QApplication::setWindowIcon @@ -10341,7 +10343,8 @@ public slots: QPoint point2(15, 20); QPoint point3(20, 20); QWindow *window = modal->windowHandle(); - QWindowSystemInterface::handleEnterEvent(window, point1, window->mapToGlobal(point1)); + const QPoint nativePoint1 = QHighDpi::toNativePixels(point1, window->screen()); + QWindowSystemInterface::handleEnterEvent(window, nativePoint1); QTest::mouseMove(window, point1); QTest::mouseMove(window, point2); QTest::mouseMove(window, point3); diff --git a/tests/auto/widgets/styles/qstyle/task_25863.png b/tests/auto/widgets/styles/qstyle/task_25863.png Binary files differdeleted file mode 100644 index a2de8d6f78..0000000000 --- a/tests/auto/widgets/styles/qstyle/task_25863.png +++ /dev/null diff --git a/tests/auto/widgets/styles/qstyle/testdata.qrc b/tests/auto/widgets/styles/qstyle/testdata.qrc index c16b9be775..29bb46726e 100644 --- a/tests/auto/widgets/styles/qstyle/testdata.qrc +++ b/tests/auto/widgets/styles/qstyle/testdata.qrc @@ -15,6 +15,5 @@ <file>images/vista/radiobutton.png</file> <file>images/vista/slider.png</file> <file>images/vista/spinbox.png</file> - <file>task_25863.png</file> </qresource> </RCC> diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index 3607f1ba92..d5ef2fe94b 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -58,6 +58,8 @@ #include <qscrollarea.h> #include <qwidget.h> +#include <algorithm> + // Make a widget frameless to prevent size constraints of title bars // from interfering (Windows). static inline void setFrameless(QWidget *w) @@ -197,13 +199,12 @@ void tst_QStyle::drawItemPixmap() testWidget->resize(300, 300); testWidget->showNormal(); - const QString imageFileName = QFINDTESTDATA("task_25863.png"); - QVERIFY(!imageFileName.isEmpty()); - - QPixmap p(imageFileName, "PNG"); - const QPixmap actualPix = testWidget->grab(); - - QCOMPARE(actualPix, p); + QImage image = testWidget->grab().toImage(); + const QRgb green = QColor(Qt::green).rgb(); + QVERIFY(image.reinterpretAsFormat(QImage::Format_RGB32)); + const QRgb *bits = reinterpret_cast<const QRgb *>(image.constBits()); + const QRgb *end = bits + image.byteCount() / sizeof(QRgb); + QVERIFY(std::all_of(bits, end, [green] (QRgb r) { return r == green; })); testWidget->hide(); } diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 3e21c4ecab..8f0dd10940 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -147,6 +147,7 @@ private slots: void keypress_inputMask_data(); void keypress_inputMask(); + void keypress_inputMethod_inputMask(); void inputMaskAndValidator_data(); void inputMaskAndValidator(); @@ -803,6 +804,37 @@ void tst_QLineEdit::keypress_inputMask() QCOMPARE(testWidget->displayText(), expectedDisplayText); } +void tst_QLineEdit::keypress_inputMethod_inputMask() +{ + // Similar to the keypress_inputMask test, but this is done solely via + // input methods + QLineEdit *testWidget = ensureTestWidget(); + testWidget->setInputMask("AA.AA.AA"); + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("EE"); + QApplication::sendEvent(testWidget, &event); + } + QCOMPARE(testWidget->cursorPosition(), 3); + QCOMPARE(testWidget->text(), QStringLiteral("EE..")); + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("EE"); + QApplication::sendEvent(testWidget, &event); + } + QCOMPARE(testWidget->cursorPosition(), 6); + QCOMPARE(testWidget->text(), QStringLiteral("EE.EE.")); + { + QList<QInputMethodEvent::Attribute> attributes; + QInputMethodEvent event("", attributes); + event.setCommitString("EE"); + QApplication::sendEvent(testWidget, &event); + } + QCOMPARE(testWidget->cursorPosition(), 8); + QCOMPARE(testWidget->text(), QStringLiteral("EE.EE.EE")); +} void tst_QLineEdit::hasAcceptableInputMask_data() { diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp index 680fea27dd..292080c55f 100644 --- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp @@ -29,8 +29,10 @@ #include <QtTest/QtTest> - +#include <QtWidgets/qtwidgetsglobal.h> +#if QT_CONFIG(dockwidget) #include <qdockwidget.h> +#endif #include <qlayout.h> #include <qmainwindow.h> #include <qmenubar.h> @@ -45,7 +47,7 @@ #include <private/qmainwindowlayout_p.h> #include <private/qdockarealayout_p.h> -#ifndef QT_NO_TABBAR +#if QT_CONFIG(tabbar) #include <qtabbar.h> #endif @@ -148,7 +150,7 @@ private slots: void QTBUG21378_animationFinished(); void resizeDocks(); void resizeDocks_data(); -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar) void QTBUG52175_tabifiedDockWidgetActivated(); #endif }; @@ -2044,7 +2046,7 @@ void tst_QMainWindow::resizeDocks() } } -#if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR) +#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar) void tst_QMainWindow::QTBUG52175_tabifiedDockWidgetActivated() { QMainWindow w; diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST index 92a810bc84..1c970c43b3 100644 --- a/tests/auto/widgets/widgets/qmenu/BLACKLIST +++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST @@ -2,6 +2,7 @@ osx [submenuTearOffDontClose] osx-10.11 ci +osx-10.12 ci [layoutDirection] # Fails when enabling synchronous expose events QTBUG-62092 osx ci |