mirror of https://github.com/qt/qtbase.git
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: configure mkspecs/macx-ios-clang/features/default_pre.prf mkspecs/macx-ios-clang/features/sdk.prf mkspecs/unsupported/freebsd-g++46/qplatformdefs.h src/widgets/styles/qgtkstyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro Change-Id: Ia943555d1e59234a66f7dc65bdfda838e40001b5
This commit is contained in:
commit
cbe332405a
|
@ -42,7 +42,7 @@
|
|||
|
||||
int main(int, char **)
|
||||
{
|
||||
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
|
||||
#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(__OpenBSD__)
|
||||
timespec ts;
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
#else
|
||||
|
|
|
@ -3432,8 +3432,7 @@ if [ "$XPLATFORM_IOS" = "yes" ]; then
|
|||
# If the user passes -sdk on the command line we build a SDK-specific Qt build.
|
||||
# Otherwise we build a joined simulator and device build, which is the default.
|
||||
if [ -z "$OPT_MAC_SDK" ]; then
|
||||
QT_CONFIG="$QT_CONFIG build_all"
|
||||
QTCONFIG_CONFIG="$QTCONFIG_CONFIG simulator_and_device"
|
||||
QT_CONFIG="$QT_CONFIG build_all simulator_and_device"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -15,7 +15,9 @@ TEMPLATE = lib
|
|||
CONFIG += plugin
|
||||
|
||||
if(win32|mac):!macx-xcode {
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all
|
||||
contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||
}
|
||||
|
||||
CONFIG += relative_qt_rpath # Qt's QML plugins should be relocatable
|
||||
|
|
|
@ -18,7 +18,9 @@ QT = # In case qt is re-added.
|
|||
CONFIG -= warning_clean # Don't presume 3rd party code to be clean
|
||||
load(qt_common)
|
||||
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all
|
||||
contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||
|
||||
DESTDIR = $$MODULE_BASE_OUTDIR/lib
|
||||
DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
|
||||
|
|
|
@ -89,7 +89,9 @@ INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.inclu
|
|||
# If Qt was configured with -debug-and-release then build the module the same way
|
||||
# - unless this is a host library
|
||||
!host_build:if(win32|mac):!macx-xcode {
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all
|
||||
contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||
}
|
||||
|
||||
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
|
||||
|
|
|
@ -26,7 +26,9 @@ win32:CONFIG(shared, static|shared) {
|
|||
tool_plugin {
|
||||
!build_pass:contains(QT_CONFIG, debug_and_release): CONFIG += release
|
||||
} else:if(win32|mac):!macx-xcode {
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release build_all
|
||||
contains(QT_CONFIG, simulator_and_device): CONFIG += iphonesimulator_and_iphoneos
|
||||
contains(QT_CONFIG, debug_and_release): CONFIG += debug_and_release
|
||||
contains(QT_CONFIG, build_all): CONFIG += build_all
|
||||
}
|
||||
|
||||
CONFIG += relative_qt_rpath # Qt's plugins should be relocatable
|
||||
|
|
|
@ -7,7 +7,7 @@ QMAKE_PLATFORM = freebsd bsd
|
|||
|
||||
include(../common/unix.conf)
|
||||
|
||||
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
|
||||
QMAKE_CFLAGS_THREAD = -pthread
|
||||
|
||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ QMAKE_PLATFORM = freebsd bsd
|
|||
|
||||
include(../common/unix.conf)
|
||||
|
||||
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
|
||||
QMAKE_CFLAGS_THREAD = -pthread
|
||||
|
||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
load(default_pre)
|
||||
|
||||
# In case Qt was built for a specific SDK
|
||||
!simulator_and_device:contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
|
||||
!contains(QT_CONFIG, simulator_and_device):contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*): \
|
||||
CONFIG += simulator $${simulator.sdk}
|
||||
|
||||
# Check for supported Xcode versions
|
||||
lessThan(QMAKE_XCODE_VERSION, "4.3"): \
|
||||
error("This mkspec requires Xcode 4.3 or later")
|
||||
|
||||
simulator_and_device:iphonesimulator {
|
||||
build_pass:simulator {
|
||||
# For a simulator_and_device build all the config tests
|
||||
# are based on the iPhoneOS ARM SDK, but we know that the simulator
|
||||
# is i386 and that we support SSE/SSE2.
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
|
||||
# In case the user sets the SDK manually
|
||||
contains(QMAKE_MAC_SDK, ^$${simulator.sdk}.*) {
|
||||
simulator_and_device: \
|
||||
contains(QT_CONFIG, simulator_and_device): \
|
||||
error("iOS simulator is handled automatically for simulator_and_device")
|
||||
|
||||
CONFIG += simulator $${simulator.sdk}
|
||||
}
|
||||
|
||||
simulator_and_device:simulator: \
|
||||
build_pass:simulator: \
|
||||
QMAKE_MAC_SDK ~= s,^$${device.sdk},$${simulator.sdk},
|
||||
|
||||
load(sdk)
|
||||
|
|
|
@ -6,58 +6,21 @@ MAKEFILE_GENERATOR = UNIX
|
|||
QMAKE_PLATFORM = netbsd bsd
|
||||
|
||||
include(../common/unix.conf)
|
||||
include(../common/gcc-base-unix.conf)
|
||||
include(../common/g++-unix.conf)
|
||||
|
||||
QMAKE_COMPILER = gcc
|
||||
|
||||
QMAKE_CC = gcc
|
||||
QMAKE_LEX = flex
|
||||
QMAKE_LEXFLAGS =
|
||||
QMAKE_YACC = yacc
|
||||
QMAKE_YACCFLAGS = -d
|
||||
QMAKE_CFLAGS = -pipe
|
||||
QMAKE_CFLAGS_DEPS = -M
|
||||
QMAKE_CFLAGS_WARN_ON = -Wall -W
|
||||
QMAKE_CFLAGS_WARN_OFF = -w
|
||||
QMAKE_CFLAGS_RELEASE = -O2
|
||||
QMAKE_CFLAGS_DEBUG = -g
|
||||
QMAKE_CFLAGS_SHLIB = -fPIC
|
||||
QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB
|
||||
QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
|
||||
QMAKE_CFLAGS_THREAD = -pthread
|
||||
|
||||
QMAKE_CXX = g++
|
||||
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
|
||||
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
|
||||
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
|
||||
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
|
||||
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
|
||||
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
|
||||
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
|
||||
QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB
|
||||
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
|
||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
||||
|
||||
QMAKE_INCDIR = /usr/local/include
|
||||
QMAKE_LIBDIR = /usr/local/lib
|
||||
QMAKE_INCDIR_X11 = /usr/X11R6/include
|
||||
QMAKE_LIBDIR_X11 = /usr/X11R6/lib
|
||||
QMAKE_INCDIR_OPENGL = /usr/X11R6/include
|
||||
QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
|
||||
QMAKE_INCDIR = /usr/pkg/include
|
||||
QMAKE_LIBDIR = /usr/pkg/lib
|
||||
QMAKE_INCDIR_X11 = /usr/X11R7/include
|
||||
QMAKE_LIBDIR_X11 = /usr/X11R7/lib
|
||||
QMAKE_INCDIR_OPENGL = /usr/X11R7/include
|
||||
QMAKE_LIBDIR_OPENGL = /usr/X11R7/lib
|
||||
|
||||
QMAKE_LINK = g++
|
||||
QMAKE_LINK_SHLIB = g++
|
||||
QMAKE_LINK_C = gcc
|
||||
QMAKE_LINK_C_SHLIB = gcc
|
||||
QMAKE_LINK_SHLIB_CMD = $$QMAKE_LINK_SHLIB $$QMAKE_LFLAGS_SHLIB $(LFLAGS) $$QMAKE_LFLAGS -o $(TARGETD) $(OBJECTS) $(OBJMOC) $(LIBS)
|
||||
QMAKE_LFLAGS =
|
||||
QMAKE_LFLAGS_RELEASE =
|
||||
QMAKE_LFLAGS_DEBUG =
|
||||
QMAKE_LFLAGS_SHLIB = -shared
|
||||
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
|
||||
QMAKE_LFLAGS_SONAME = -Wl,-soname,
|
||||
QMAKE_LFLAGS_THREAD = -pthread
|
||||
QMAKE_LFLAGS_NOUNDEF = -Wl,-no_unresolved
|
||||
QMAKE_LFLAGS_RPATH = -Wl,-rpath,
|
||||
|
||||
QMAKE_LIBS =
|
||||
QMAKE_LIBS_DYNLOAD =
|
||||
|
@ -69,6 +32,6 @@ QMAKE_LIBS_THREAD =
|
|||
QMAKE_AR = ar cqs
|
||||
QMAKE_OBJCOPY = objcopy
|
||||
QMAKE_NM = nm -P
|
||||
QMAKE_RANLIB = ranlib
|
||||
QMAKE_RANLIB =
|
||||
|
||||
load(qt_config)
|
||||
|
|
|
@ -78,16 +78,7 @@
|
|||
#undef QT_OPEN_LARGEFILE
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
|
||||
// QT_SOCKLEN_T
|
||||
// NetBSD 1.0 - 1.3.3 int
|
||||
// NetBSD 1.4 - 1.5 socklen_t
|
||||
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
|
||||
// Older NetBSD versions may still use the a.out format instead of ELF.
|
||||
#ifndef __ELF__
|
||||
#define QT_AOUT_UNDERSCORE
|
||||
#endif
|
||||
|
||||
#endif // QPLATFORMDEFS_H
|
||||
|
|
|
@ -6,35 +6,11 @@ MAKEFILE_GENERATOR = UNIX
|
|||
QMAKE_PLATFORM = openbsd bsd
|
||||
|
||||
include(../common/unix.conf)
|
||||
include(../common/gcc-base-unix.conf)
|
||||
include(../common/g++-unix.conf)
|
||||
|
||||
QMAKE_COMPILER = gcc
|
||||
|
||||
QMAKE_CC = gcc
|
||||
QMAKE_LEX = flex
|
||||
QMAKE_LEXFLAGS =
|
||||
QMAKE_YACC = yacc
|
||||
QMAKE_YACCFLAGS = -d
|
||||
QMAKE_CFLAGS = -pipe
|
||||
QMAKE_CFLAGS_DEPS = -M
|
||||
QMAKE_CFLAGS_WARN_ON = -Wall -W
|
||||
QMAKE_CFLAGS_WARN_OFF = -w
|
||||
QMAKE_CFLAGS_RELEASE = -O2
|
||||
QMAKE_CFLAGS_DEBUG = -g
|
||||
QMAKE_CFLAGS_SHLIB = -fPIC
|
||||
QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB
|
||||
QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
|
||||
QMAKE_CFLAGS_THREAD = -pthread
|
||||
|
||||
QMAKE_CXX = g++
|
||||
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
|
||||
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
|
||||
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
|
||||
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
|
||||
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
|
||||
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
|
||||
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
|
||||
QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB
|
||||
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
|
||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
||||
|
||||
QMAKE_INCDIR = /usr/local/include
|
||||
|
@ -44,21 +20,8 @@ QMAKE_LIBDIR_X11 = /usr/X11R6/lib
|
|||
QMAKE_INCDIR_OPENGL = /usr/X11R6/include
|
||||
QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib
|
||||
|
||||
QMAKE_LINK = g++
|
||||
QMAKE_LINK_SHLIB = g++
|
||||
QMAKE_LINK_C = gcc
|
||||
QMAKE_LINK_C_SHLIB = gcc
|
||||
QMAKE_LINK_SHLIB_CMD = $$QMAKE_LINK_SHLIB $(LFLAGS) \
|
||||
$$QMAKE_CFLAGS_SHLIB $$QMAKE_LFLAGS \
|
||||
-o $(TARGETD) $(OBJECTS) $(OBJMOC) $(LIBS)
|
||||
QMAKE_LFLAGS =
|
||||
QMAKE_LFLAGS_RELEASE =
|
||||
QMAKE_LFLAGS_DEBUG =
|
||||
QMAKE_LFLAGS_SHLIB = -shared
|
||||
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
|
||||
QMAKE_LFLAGS_SONAME = -Wl,-soname,
|
||||
QMAKE_LFLAGS_THREAD = -pthread
|
||||
QMAKE_LFLAGS_NOUNDEF = -Wl,-no_unresolved
|
||||
QMAKE_LFLAGS_NOUNDEF =
|
||||
|
||||
QMAKE_LIBS =
|
||||
QMAKE_LIBS_DYNLOAD =
|
||||
|
@ -67,9 +30,9 @@ QMAKE_LIBS_X11 = -lXext -lX11 -lm
|
|||
QMAKE_LIBS_OPENGL = -lGL
|
||||
QMAKE_LIBS_THREAD =
|
||||
|
||||
QMAKE_AR = ar q
|
||||
QMAKE_AR = ar cqs
|
||||
QMAKE_OBJCOPY = objcopy
|
||||
QMAKE_NM = nm -P
|
||||
QMAKE_RANLIB = ranlib
|
||||
QMAKE_RANLIB =
|
||||
|
||||
load(qt_config)
|
||||
|
|
|
@ -79,31 +79,7 @@
|
|||
#undef QT_OPEN_LARGEFILE
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
|
||||
// QT_SOCKLEN_T
|
||||
// OpenBSD 2.2 - 2.4 int
|
||||
// OpenBSD 2.5 - 2.8 socklen_t
|
||||
|
||||
#define QT_SNPRINTF ::snprintf
|
||||
#define QT_VSNPRINTF ::vsnprintf
|
||||
|
||||
// 1003.1c-1995 says on page 38 (2.9.3, paragraph 3) that if _POSIX_THREADS
|
||||
// is defined, then _POSIX_THREAD_SAFE_FUNCTIONS must also be defined.
|
||||
// However this looks like a well-known typo (reversed dependency).
|
||||
//
|
||||
// On the other hand _POSIX_THREAD_SAFE_FUNCTIONS should be defined only
|
||||
// if the Thread-Safe Functions option is implemented. OpenBSD does not
|
||||
// support all of the required _r() interfaces, especially getpwuid_r(),
|
||||
// which means it should not define _POSIX_THREAD_SAFE_FUNCTIONS.
|
||||
//
|
||||
// Since OpenBSD does define _POSIX_THREAD_SAFE_FUNCTIONS, we have to
|
||||
// undefine it behind its back.
|
||||
#ifdef _POSIX_THREAD_SAFE_FUNCTIONS
|
||||
#undef _POSIX_THREAD_SAFE_FUNCTIONS
|
||||
#endif
|
||||
|
||||
// Older OpenBSD versions may still use the a.out format instead of ELF.
|
||||
#ifndef __ELF__
|
||||
#define QT_AOUT_UNDERSCORE
|
||||
#endif
|
||||
|
||||
#endif // QPLATFORMDEFS_H
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
#
|
||||
# qmake configuration for freebsd-g++46 (using g++46 from ports/lang/gcc)
|
||||
#
|
||||
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
QMAKE_PLATFORM = freebsd bsd
|
||||
|
||||
include(../../common/unix.conf)
|
||||
|
||||
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
|
||||
|
||||
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
|
||||
|
||||
# Addon software goes into /usr/local on the BSDs, by default we will look there
|
||||
QMAKE_INCDIR = /usr/local/include
|
||||
QMAKE_LIBDIR = /usr/local/lib
|
||||
|
||||
QMAKE_LFLAGS_THREAD = -pthread
|
||||
|
||||
QMAKE_LIBS =
|
||||
QMAKE_LIBS_DYNLOAD =
|
||||
QMAKE_LIBS_EXECINFO = -lexecinfo
|
||||
QMAKE_LIBS_X11 = -lXext -lX11 -lm
|
||||
QMAKE_LIBS_OPENGL = -lGL
|
||||
QMAKE_LIBS_THREAD =
|
||||
|
||||
QMAKE_AR = ar cqs
|
||||
QMAKE_OBJCOPY = objcopy
|
||||
QMAKE_NM = nm -P
|
||||
QMAKE_RANLIB =
|
||||
|
||||
include(../../common/gcc-base-unix.conf)
|
||||
include(../../common/g++-unix.conf)
|
||||
|
||||
# Redefined here because g++-base.conf sets QMAKE_CC and QMAKE_CXX
|
||||
# to gcc and g++, respectively.
|
||||
QMAKE_CC = gcc46
|
||||
QMAKE_CXX = g++46
|
||||
QMAKE_LINK_C = $$QMAKE_CC
|
||||
QMAKE_LINK_C_SHLIB = $$QMAKE_CC
|
||||
QMAKE_LINK = $$QMAKE_CXX
|
||||
QMAKE_LINK_SHLIB = $$QMAKE_CXX
|
||||
|
||||
load(qt_config)
|
|
@ -1,40 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the qmake spec 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 "../../freebsd-clang/qplatformdefs.h"
|
|
@ -77,7 +77,7 @@ static qint64 getticks()
|
|||
|
||||
static qint64 getticks()
|
||||
{
|
||||
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)
|
||||
#if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)) || defined(Q_OS_OPENBSD)
|
||||
clockid_t clockId;
|
||||
|
||||
#ifndef _POSIX_THREAD_CPUTIME
|
||||
|
|
|
@ -54,15 +54,13 @@ QT_BEGIN_NAMESPACE
|
|||
\class QVariantAnimation
|
||||
\inmodule QtCore
|
||||
\ingroup animation
|
||||
\brief The QVariantAnimation class provides an abstract base class for animations.
|
||||
\brief The QVariantAnimation class provides a base class for animations.
|
||||
\since 4.6
|
||||
|
||||
This class is part of \l{The Animation Framework}. It serves as a
|
||||
base class for property and item animations, with functions for
|
||||
shared functionality.
|
||||
|
||||
QVariantAnimation cannot be used directly as it is an abstract
|
||||
class; it has a pure virtual method called updateCurrentValue().
|
||||
The class performs interpolation over
|
||||
\l{QVariant}s, but leaves using the interpolated values to its
|
||||
subclasses. Currently, Qt provides QPropertyAnimation, which
|
||||
|
@ -75,7 +73,7 @@ QT_BEGIN_NAMESPACE
|
|||
start the animation. QVariantAnimation will interpolate the
|
||||
property of the target object and emit valueChanged(). To react to
|
||||
a change in the current value you have to reimplement the
|
||||
updateCurrentValue() virtual function.
|
||||
updateCurrentValue() virtual function or connect to said signal.
|
||||
|
||||
It is also possible to set values at specified steps situated
|
||||
between the start and end value. The interpolation will then
|
||||
|
|
|
@ -118,11 +118,12 @@
|
|||
|
||||
\section1 Animating Qt Properties
|
||||
|
||||
As mentioned in the previous section, the QPropertyAnimation class
|
||||
can interpolate over Qt properties. It is this class that should
|
||||
be used for animation of values; in fact, its superclass,
|
||||
QVariantAnimation, is an abstract class, and cannot be used
|
||||
directly.
|
||||
As mentioned in the previous section, the QPropertyAnimation class can
|
||||
interpolate over Qt properties. It is often this class that should be used
|
||||
for animation of values; in fact, its superclass, QVariantAnimation, has an
|
||||
empty implementation of \l{QAbstractAnimation::}{updateCurrentValue()}, and
|
||||
does not change any value unless we change it ourselves on the
|
||||
\l{QVariantAnimation::valueChanged()}{valueChanged signal}.
|
||||
|
||||
A major reason we chose to animate Qt properties is that it
|
||||
presents us with freedom to animate already existing classes in
|
||||
|
|
|
@ -166,16 +166,15 @@ void QDebug::putUcs4(uint ucs4)
|
|||
{
|
||||
maybeQuote('\'');
|
||||
if (ucs4 < 0x20) {
|
||||
stream->ts << hex << "\\x" << ucs4 << reset;
|
||||
stream->ts << "\\x" << hex << ucs4 << reset;
|
||||
} else if (ucs4 < 0x80) {
|
||||
stream->ts << char(ucs4);
|
||||
} else {
|
||||
stream->ts << hex << qSetPadChar(QLatin1Char('0'));
|
||||
if (ucs4 < 0x10000)
|
||||
stream->ts << qSetFieldWidth(4) << "\\u";
|
||||
stream->ts << "\\u" << qSetFieldWidth(4);
|
||||
else
|
||||
stream->ts << qSetFieldWidth(8) << "\\U";
|
||||
stream->ts << ucs4 << reset;
|
||||
stream->ts << "\\U" << qSetFieldWidth(8);
|
||||
stream->ts << hex << qSetPadChar(QLatin1Char('0')) << ucs4 << reset;
|
||||
}
|
||||
maybeQuote('\'');
|
||||
}
|
||||
|
|
|
@ -820,7 +820,7 @@ QString QFileInfo::completeBaseName() const
|
|||
}
|
||||
|
||||
/*!
|
||||
Returns the complete suffix of the file.
|
||||
Returns the complete suffix (extension) of the file.
|
||||
|
||||
The complete suffix consists of all characters in the file after
|
||||
(but not including) the first '.'.
|
||||
|
@ -839,7 +839,7 @@ QString QFileInfo::completeSuffix() const
|
|||
}
|
||||
|
||||
/*!
|
||||
Returns the suffix of the file.
|
||||
Returns the suffix (extension) of the file.
|
||||
|
||||
The suffix consists of all characters in the file after (but not
|
||||
including) the last '.'.
|
||||
|
|
|
@ -684,6 +684,8 @@ public:
|
|||
bool operator >=(const Entry &other) const;
|
||||
};
|
||||
|
||||
inline bool operator!=(const Entry &lhs, const Entry &rhs) { return !(lhs == rhs); }
|
||||
|
||||
inline bool Entry::operator >=(const QString &key) const
|
||||
{
|
||||
if (value.latinKey)
|
||||
|
|
|
@ -599,8 +599,8 @@ bool QJsonObject::operator==(const QJsonObject &other) const
|
|||
|
||||
for (uint i = 0; i < o->length; ++i) {
|
||||
QJsonPrivate::Entry *e = o->entryAt(i);
|
||||
QJsonValue v(d, o, e->value);
|
||||
if (other.value(e->key()) != v)
|
||||
QJsonPrivate::Entry *oe = other.o->entryAt(i);
|
||||
if (*e != *oe || QJsonValue(d, o, e->value) != QJsonValue(other.d, other.o, oe->value))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -3025,10 +3025,14 @@ void QXmlStreamWriterPrivate::checkIfASCIICompatibleCodec()
|
|||
{
|
||||
#ifndef QT_NO_TEXTCODEC
|
||||
Q_ASSERT(encoder);
|
||||
// assumes ASCII-compatibility for all 8-bit encodings
|
||||
QChar space = QLatin1Char(' ');
|
||||
const QByteArray bytes = encoder->fromUnicode(&space, 1);
|
||||
isCodecASCIICompatible = (bytes.count() == 1);
|
||||
// test ASCII-compatibility using the letter 'a'
|
||||
QChar letterA = QLatin1Char('a');
|
||||
const QByteArray bytesA = encoder->fromUnicode(&letterA, 1);
|
||||
const bool isCodecASCIICompatibleA = (bytesA.count() == 1) && (bytesA[0] == 0x61) ;
|
||||
QChar letterLess = QLatin1Char('<');
|
||||
const QByteArray bytesLess = encoder->fromUnicode(&letterLess, 1);
|
||||
const bool isCodecASCIICompatibleLess = (bytesLess.count() == 1) && (bytesLess[0] == 0x3C) ;
|
||||
isCodecASCIICompatible = isCodecASCIICompatibleA && isCodecASCIICompatibleLess ;
|
||||
#else
|
||||
isCodecASCIICompatible = true;
|
||||
#endif
|
||||
|
|
|
@ -3908,6 +3908,9 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
|
|||
case QEvent::Expose:
|
||||
dbg << "QExposeEvent(" << static_cast<const QExposeEvent *>(e)->region() << ')';
|
||||
break;
|
||||
case QEvent::Paint:
|
||||
dbg << "QPaintEvent(" << static_cast<const QPaintEvent *>(e)->region() << ')';
|
||||
break;
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::MouseMove:
|
||||
case QEvent::MouseButtonRelease:
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
static void handleWheelEvent(QWindow *w, ulong timestamp, const QPointF & local, const QPointF & global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
|
||||
|
||||
struct TouchPoint {
|
||||
TouchPoint() : id(0), pressure(0), state(Qt::TouchPointStationary), flags(0) { }
|
||||
TouchPoint() : id(0), pressure(0), state(Qt::TouchPointStationary) { }
|
||||
int id; // for application use
|
||||
QPointF normalPosition; // touch device coordinates, (0 to 1, 0 to 1)
|
||||
QRectF area; // the touched area, centered at position in screen coordinates
|
||||
|
@ -139,7 +139,7 @@ public:
|
|||
|
||||
// rect is relative to parent
|
||||
static void handleGeometryChange(QWindow *w, const QRect &newRect, const QRect &oldRect = QRect());
|
||||
static void handleCloseEvent(QWindow *w, bool *accepted = 0);
|
||||
static void handleCloseEvent(QWindow *w, bool *accepted = Q_NULLPTR);
|
||||
static void handleEnterEvent(QWindow *w, const QPointF &local = QPointF(), const QPointF& global = QPointF());
|
||||
static void handleLeaveEvent(QWindow *w);
|
||||
static void handleEnterLeaveEvent(QWindow *enter, QWindow *leave, const QPointF &local = QPointF(), const QPointF& global = QPointF());
|
||||
|
|
|
@ -2732,7 +2732,6 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
|
|||
}
|
||||
if (req.pointSize < 0)
|
||||
req.pointSize = req.pixelSize*72.0/d->dpi;
|
||||
req.weight = QFont::Normal;
|
||||
if (req.stretch == 0)
|
||||
req.stretch = 100;
|
||||
|
||||
|
|
|
@ -1320,8 +1320,12 @@ void QSslSocketBackendPrivate::_q_caRootLoaded(QSslCertificate cert, QSslCertifi
|
|||
if (plainSocket)
|
||||
plainSocket->resume();
|
||||
paused = false;
|
||||
if (checkSslErrors() && ssl)
|
||||
if (checkSslErrors() && ssl) {
|
||||
bool willClose = (autoStartHandshake && pendingClose);
|
||||
continueHandshake();
|
||||
if (!willClose)
|
||||
transmit();
|
||||
}
|
||||
}
|
||||
|
||||
class QWindowsCaRootFetcherThread : public QThread
|
||||
|
|
|
@ -330,17 +330,16 @@
|
|||
|
||||
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration
|
||||
{
|
||||
Q_UNUSED(orientation);
|
||||
Q_UNUSED(duration);
|
||||
|
||||
self.changingOrientation = YES;
|
||||
|
||||
[super willRotateToInterfaceOrientation:orientation duration:duration];
|
||||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)orientation
|
||||
{
|
||||
Q_UNUSED(orientation);
|
||||
|
||||
self.changingOrientation = NO;
|
||||
|
||||
[super didRotateFromInterfaceOrientation:orientation];
|
||||
}
|
||||
|
||||
- (void)willChangeStatusBarFrame:(NSNotification*)notification
|
||||
|
|
|
@ -207,8 +207,10 @@ QPlatformOffscreenSurface *QXcbGlxIntegration::createPlatformOffscreenSurface(QO
|
|||
display = static_cast<Display *>(m_connection->xlib_display());
|
||||
#endif
|
||||
const char *glxvendor = glXGetClientString(display, GLX_VENDOR);
|
||||
if (glxvendor && !strcmp(glxvendor, "ATI"))
|
||||
glxPbufferUsable = false;
|
||||
if (glxvendor) {
|
||||
if (!strcmp(glxvendor, "ATI") || !strcmp(glxvendor, "Chromium"))
|
||||
glxPbufferUsable = false;
|
||||
}
|
||||
}
|
||||
if (glxPbufferUsable)
|
||||
return new QGLXPbuffer(surface);
|
||||
|
|
|
@ -797,9 +797,9 @@ void QXcbWindow::show()
|
|||
propagateSizeHints();
|
||||
|
||||
// update WM_TRANSIENT_FOR
|
||||
const QWindow *tp = window()->transientParent();
|
||||
if (isTransient(window()) || tp != 0) {
|
||||
xcb_window_t transientXcbParent = 0;
|
||||
xcb_window_t transientXcbParent = 0;
|
||||
if (isTransient(window())) {
|
||||
const QWindow *tp = window()->transientParent();
|
||||
if (tp && tp->handle())
|
||||
transientXcbParent = static_cast<const QXcbWindow *>(tp->handle())->winId();
|
||||
// Default to client leader if there is no transient parent, else modal dialogs can
|
||||
|
@ -812,6 +812,8 @@ void QXcbWindow::show()
|
|||
1, &transientXcbParent));
|
||||
}
|
||||
}
|
||||
if (!transientXcbParent)
|
||||
Q_XCB_CALL(xcb_delete_property(xcb_connection(), m_window, XCB_ATOM_WM_TRANSIENT_FOR));
|
||||
|
||||
// update _MOTIF_WM_HINTS
|
||||
updateMotifWmHintsBeforeMap();
|
||||
|
@ -1173,9 +1175,11 @@ void QXcbWindow::setMotifWindowFlags(Qt::WindowFlags flags)
|
|||
mwmhints.flags |= MWM_HINTS_DECORATIONS;
|
||||
|
||||
bool customize = flags & Qt::CustomizeWindowHint;
|
||||
if (type == Qt::Window && !customize)
|
||||
flags |= Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
|
||||
|
||||
if (type == Qt::Window && !customize) {
|
||||
const Qt::WindowFlags defaultFlags = Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint;
|
||||
if (!(flags & defaultFlags))
|
||||
flags |= defaultFlags;
|
||||
}
|
||||
if (!(flags & Qt::FramelessWindowHint) && !(customize && !(flags & Qt::WindowTitleHint))) {
|
||||
mwmhints.decorations |= MWM_DECOR_BORDER;
|
||||
mwmhints.decorations |= MWM_DECOR_RESIZEH;
|
||||
|
|
|
@ -116,7 +116,7 @@ public:
|
|||
|
||||
inline bool isDirty() const
|
||||
{
|
||||
return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !fullUpdatePending);
|
||||
return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !fullUpdatePending && dirtyRenderToTextureWidgets.isEmpty());
|
||||
}
|
||||
|
||||
// ### Qt 4.6: Merge into a template function (after MSVC isn't supported anymore).
|
||||
|
|
|
@ -2389,8 +2389,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption
|
|||
if (!titleBar->icon.isNull()) {
|
||||
titleBar->icon.paint(painter, iconRect);
|
||||
} else {
|
||||
QStyleOption tool(0);
|
||||
tool.palette = titleBar->palette;
|
||||
QStyleOption tool = *titleBar;
|
||||
QPixmap pm = proxy()->standardIcon(SP_TitleBarMenuButton, &tool, widget).pixmap(16, 16);
|
||||
tool.rect = iconRect;
|
||||
painter->save();
|
||||
|
|
|
@ -5954,12 +5954,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||
#ifndef QT_NO_ACCESSIBILITY
|
||||
if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) {
|
||||
if (tb->subControls & SC_ToolButtonMenu) {
|
||||
QStyleOption arrowOpt(0);
|
||||
QStyleOption arrowOpt = *tb;
|
||||
arrowOpt.rect = proxy()->subControlRect(cc, tb, SC_ToolButtonMenu, widget);
|
||||
arrowOpt.rect.setY(arrowOpt.rect.y() + arrowOpt.rect.height() / 2);
|
||||
arrowOpt.rect.setHeight(arrowOpt.rect.height() / 2);
|
||||
arrowOpt.state = tb->state;
|
||||
arrowOpt.palette = tb->palette;
|
||||
proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget);
|
||||
} else if ((tb->features & QStyleOptionToolButton::HasMenu)
|
||||
&& (tb->toolButtonStyle != Qt::ToolButtonTextOnly && !tb->icon.isNull())) {
|
||||
|
|
|
@ -1443,8 +1443,7 @@ void QWindowsCEStyle::drawComplexControl(ComplexControl control, const QStyleOpt
|
|||
if (toolbutton->activeSubControls & SC_ToolButtonMenu)
|
||||
mflags |= State_Sunken;
|
||||
|
||||
QStyleOption tool(0);
|
||||
tool.palette = toolbutton->palette;
|
||||
QStyleOption tool = *toolbutton;
|
||||
if (toolbutton->subControls & SC_ToolButton) {
|
||||
tool.rect = button;
|
||||
tool.state = bflags;
|
||||
|
@ -1626,9 +1625,8 @@ void QWindowsCEStyle::drawComplexControl(ComplexControl control, const QStyleOpt
|
|||
|
||||
if (cmb->activeSubControls == SC_ComboBoxArrow)
|
||||
flags |= State_Sunken;
|
||||
QStyleOption arrowOpt(0);
|
||||
QStyleOption arrowOpt = *cmb;
|
||||
arrowOpt.rect = ar;
|
||||
arrowOpt.palette = cmb->palette;
|
||||
arrowOpt.state = flags;
|
||||
drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget);
|
||||
}
|
||||
|
|
|
@ -6111,8 +6111,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl
|
|||
buttonFlags |= State_Sunken;
|
||||
if (toolbutton->activeSubControls & SC_ToolButtonMenu)
|
||||
menuFlags |= State_On;
|
||||
QStyleOption tool(0);
|
||||
tool.palette = toolbutton->palette;
|
||||
QStyleOption tool = *toolbutton;
|
||||
if (toolbutton->subControls & SC_ToolButton) {
|
||||
tool.rect = button;
|
||||
tool.state = buttonFlags;
|
||||
|
@ -6121,14 +6120,11 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl
|
|||
if (toolbutton->subControls & SC_ToolButtonMenu) {
|
||||
tool.rect = menuarea;
|
||||
tool.state = buttonFlags & State_Enabled;
|
||||
QStyleOption toolMenu(0);
|
||||
toolMenu = *toolbutton;
|
||||
QStyleOption toolMenu = *toolbutton;
|
||||
toolMenu.state = menuFlags;
|
||||
if (buttonFlags & State_Sunken)
|
||||
proxy()->drawPrimitive(PE_PanelButtonTool, &toolMenu, painter, widget);
|
||||
QStyleOption arrowOpt(0);
|
||||
arrowOpt.rect = tool.rect;
|
||||
arrowOpt.palette = tool.palette;
|
||||
QStyleOption arrowOpt = toolMenu;
|
||||
State flags = State_None;
|
||||
if (menuFlags & State_Enabled)
|
||||
flags |= State_Enabled;
|
||||
|
@ -6250,9 +6246,8 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl
|
|||
flags |= State_Enabled;
|
||||
if (option->state & State_On)
|
||||
flags |= State_Sunken;
|
||||
QStyleOption arrowOpt(0);
|
||||
QStyleOption arrowOpt = *cmb;
|
||||
arrowOpt.rect = ar;
|
||||
arrowOpt.palette = cmb->palette;
|
||||
arrowOpt.state = flags;
|
||||
proxy()->drawPrimitive(PrimitiveElement(PE_IndicatorArrowDownBig), &arrowOpt, painter, widget);
|
||||
if (cmb->subControls & SC_ComboBoxEditField) {
|
||||
|
|
|
@ -2173,9 +2173,8 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
|
|||
|
||||
if (sunkenArrow)
|
||||
flags |= State_Sunken;
|
||||
QStyleOption arrowOpt(0);
|
||||
QStyleOption arrowOpt = *cmb;
|
||||
arrowOpt.rect = ar.adjusted(1, 1, -1, -1);
|
||||
arrowOpt.palette = cmb->palette;
|
||||
arrowOpt.state = flags;
|
||||
proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, p, widget);
|
||||
}
|
||||
|
|
|
@ -1065,7 +1065,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
|
|||
QPainter imagePainter(&image);
|
||||
theme.painter = &imagePainter;
|
||||
theme.partId = vertical ? PP_FILLVERT : PP_FILL;
|
||||
theme.rect = QRect(QPoint(0,0), theme.rect.size());
|
||||
theme.rect = QRect(QPoint(0,0), animRect.size());
|
||||
QLinearGradient alphaGradient(0, 0, vertical ? 0 : image.width(),
|
||||
vertical ? image.height() : 0);
|
||||
alphaGradient.setColorAt(0, QColor(0, 0, 0, 0));
|
||||
|
|
|
@ -3052,8 +3052,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
|
|||
}
|
||||
}
|
||||
|
||||
QStyleOption tool(0);
|
||||
tool.palette = toolbutton->palette;
|
||||
QStyleOption tool = *toolbutton;
|
||||
if (toolbutton->subControls & SC_ToolButton) {
|
||||
if (flags & (State_Sunken | State_On | State_Raised) || !autoRaise) {
|
||||
if (toolbutton->features & QStyleOptionToolButton::MenuButtonPopup && autoRaise) {
|
||||
|
|
|
@ -2745,10 +2745,15 @@ QMenu::event(QEvent *e)
|
|||
return true;
|
||||
}
|
||||
} break;
|
||||
case QEvent::ContextMenu:
|
||||
if (d->delayState.timer.isActive()) {
|
||||
d->delayState.stop();
|
||||
internalDelayedPopup();
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::ContextMenu: {
|
||||
bool canPopup = true;
|
||||
if (e->type() == QEvent::MouseButtonPress)
|
||||
canPopup = (static_cast<QMouseEvent*>(e)->button() == Qt::LeftButton);
|
||||
if (canPopup && d->delayState.timer.isActive()) {
|
||||
d->delayState.stop();
|
||||
internalDelayedPopup();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QEvent::Resize: {
|
||||
|
|
|
@ -1563,6 +1563,7 @@ void QWidgetLineControl::processShortcutOverrideEvent(QKeyEvent *ke)
|
|||
if (ke == QKeySequence::Copy
|
||||
|| ke == QKeySequence::MoveToNextWord
|
||||
|| ke == QKeySequence::MoveToPreviousWord
|
||||
|| ke == QKeySequence::MoveToStartOfLine
|
||||
|| ke == QKeySequence::MoveToEndOfLine
|
||||
|| ke == QKeySequence::MoveToStartOfDocument
|
||||
|| ke == QKeySequence::MoveToEndOfDocument
|
||||
|
|
|
@ -359,14 +359,14 @@ void tst_QDebug::qDebugQChar() const
|
|||
MessageHandlerSetter mhs(myMessageHandler);
|
||||
{
|
||||
QDebug d = qDebug();
|
||||
d << QChar('f');
|
||||
d.nospace().noquote() << QChar('o') << QChar('o');
|
||||
d << QChar('f') << QChar(QLatin1Char('\xE4')); // f, ä
|
||||
d.nospace().noquote() << QChar('o') << QChar('o') << QChar(QLatin1Char('\xC4')); // o, o, Ä
|
||||
}
|
||||
#ifndef QT_NO_MESSAGELOGCONTEXT
|
||||
file = __FILE__; line = __LINE__ - 5; function = Q_FUNC_INFO;
|
||||
#endif
|
||||
QCOMPARE(s_msgType, QtDebugMsg);
|
||||
QCOMPARE(s_msg, QString::fromLatin1("'f' oo"));
|
||||
QCOMPARE(s_msg, QString::fromLatin1("'f' '\\u00e4' oo\\u00c4"));
|
||||
QCOMPARE(QString::fromLatin1(s_file), file);
|
||||
QCOMPARE(s_line, line);
|
||||
QCOMPARE(QString::fromLatin1(s_function), function);
|
||||
|
|
|
@ -11,5 +11,3 @@ contains(CONFIG, builtin_testdata): DEFINES += BUILTIN_TESTDATA
|
|||
android {
|
||||
RESOURCES += android_testdata.qrc
|
||||
}
|
||||
|
||||
win32: CONFIG += insignificant_test # Crashes on Windows in release builds
|
||||
|
|
|
@ -208,6 +208,7 @@ private slots:
|
|||
|
||||
void cdNonreadable();
|
||||
|
||||
void cdBelowRoot_data();
|
||||
void cdBelowRoot();
|
||||
|
||||
private:
|
||||
|
@ -2259,31 +2260,37 @@ void tst_QDir::cdNonreadable()
|
|||
#endif
|
||||
}
|
||||
|
||||
void tst_QDir::cdBelowRoot_data()
|
||||
{
|
||||
QTest::addColumn<QString>("rootPath");
|
||||
QTest::addColumn<QString>("cdInto");
|
||||
QTest::addColumn<QString>("targetPath");
|
||||
|
||||
#if defined(Q_OS_ANDROID)
|
||||
QTest::newRow("android") << "/" << "system" << "/system";
|
||||
#elif defined(Q_OS_UNIX)
|
||||
QTest::newRow("unix") << "/" << "tmp" << "/tmp";
|
||||
#elif defined(Q_OS_WINRT)
|
||||
QTest::newRow("winrt") << QDir::rootPath() << QDir::rootPath() << QDir::rootPath();
|
||||
#else // Windows+CE
|
||||
const QString systemDrive = QString::fromLocal8Bit(qgetenv("SystemDrive")) + QLatin1Char('/');
|
||||
const QString systemRoot = QString::fromLocal8Bit(qgetenv("SystemRoot"));
|
||||
QTest::newRow("windows-drive")
|
||||
<< systemDrive << systemRoot.mid(3) << QDir::cleanPath(systemRoot);
|
||||
#endif // Windows
|
||||
}
|
||||
|
||||
void tst_QDir::cdBelowRoot()
|
||||
{
|
||||
#if defined (Q_OS_ANDROID)
|
||||
#define ROOT QString("/")
|
||||
#define DIR QString("/system")
|
||||
#define CD_INTO "system"
|
||||
#elif defined (Q_OS_UNIX)
|
||||
#define ROOT QString("/")
|
||||
#define DIR QString("/tmp")
|
||||
#define CD_INTO "tmp"
|
||||
#elif defined (Q_OS_WINRT)
|
||||
#define ROOT QDir::rootPath()
|
||||
#define DIR QDir::rootPath()
|
||||
#define CD_INTO QDir::rootPath()
|
||||
#else
|
||||
#define ROOT QString::fromLocal8Bit(qgetenv("SystemDrive"))+"/"
|
||||
#define DIR QString::fromLocal8Bit(qgetenv("SystemRoot")).replace('\\', '/')
|
||||
#define CD_INTO QString::fromLocal8Bit(qgetenv("SystemRoot")).mid(3)
|
||||
#endif
|
||||
QFETCH(QString, rootPath);
|
||||
QFETCH(QString, cdInto);
|
||||
QFETCH(QString, targetPath);
|
||||
|
||||
QDir root(ROOT);
|
||||
QVERIFY(!root.cd(".."));
|
||||
QCOMPARE(root.path(), ROOT);
|
||||
QVERIFY(root.cd(CD_INTO));
|
||||
QCOMPARE(root.path(), DIR);
|
||||
QDir root(rootPath);
|
||||
QVERIFY2(!root.cd(".."), qPrintable(root.absolutePath()));
|
||||
QCOMPARE(root.path(), rootPath);
|
||||
QVERIFY(root.cd(cdInto));
|
||||
QCOMPARE(root.path(), targetPath);
|
||||
#ifdef Q_OS_UNIX
|
||||
if (::getuid() == 0)
|
||||
QSKIP("Running this test as root doesn't make sense");
|
||||
|
@ -2291,13 +2298,13 @@ void tst_QDir::cdBelowRoot()
|
|||
#ifdef Q_OS_WINRT
|
||||
QSKIP("WinRT has no concept of system root");
|
||||
#endif
|
||||
QDir dir(DIR);
|
||||
QVERIFY(!dir.cd("../.."));
|
||||
QCOMPARE(dir.path(), DIR);
|
||||
QVERIFY(!dir.cd("../abs/../.."));
|
||||
QCOMPARE(dir.path(), DIR);
|
||||
QDir dir(targetPath);
|
||||
QVERIFY2(!dir.cd("../.."), qPrintable(dir.absolutePath()));
|
||||
QCOMPARE(dir.path(), targetPath);
|
||||
QVERIFY2(!dir.cd("../abs/../.."), qPrintable(dir.absolutePath()));
|
||||
QCOMPARE(dir.path(), targetPath);
|
||||
QVERIFY(dir.cd(".."));
|
||||
QCOMPARE(dir.path(), ROOT);
|
||||
QCOMPARE(dir.path(), rootPath);
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QDir)
|
||||
|
|
|
@ -8,5 +8,3 @@ TESTDATA += entrylist
|
|||
contains(CONFIG, builtin_testdata): DEFINES += BUILTIN_TESTDATA
|
||||
|
||||
wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1
|
||||
|
||||
win32: CONFIG += insignificant_test # Crashes on Windows in release builds
|
||||
|
|
|
@ -6,5 +6,3 @@ RESOURCES += qfileinfo.qrc \
|
|||
testdata.qrc
|
||||
|
||||
win32:!wince:!winrt:LIBS += -ladvapi32 -lnetapi32
|
||||
|
||||
win32: CONFIG += insignificant_test # Crashes on Windows in release builds
|
||||
|
|
|
@ -1,27 +1,17 @@
|
|||
QT = core
|
||||
TEMPLATE = subdirs
|
||||
TESTPLUGINS =
|
||||
|
||||
win32 {
|
||||
exists($$[QT_INSTALL_LIBS/get]/QtCore4.dll) {
|
||||
SUBDIRS = releaseplugin
|
||||
}
|
||||
exists($$[QT_INSTALL_LIBS/get]/QtCored4.dll) {
|
||||
SUBDIRS += debugplugin
|
||||
}
|
||||
contains(QT_CONFIG, debug): TESTPLUGINS += debugplugin
|
||||
contains(QT_CONFIG, release): TESTPLUGINS += releaseplugin
|
||||
} else:osx {
|
||||
CONFIG(debug, debug|release): TESTPLUGINS += debugplugin
|
||||
CONFIG(release, debug|release): TESTPLUGINS += releaseplugin
|
||||
} else {
|
||||
TESTPLUGINS = debugplugin releaseplugin
|
||||
}
|
||||
mac {
|
||||
CONFIG(debug, debug|release): {
|
||||
SUBDIRS += debugplugin
|
||||
tst_qplugin_pro.depends += debugplugin
|
||||
}
|
||||
CONFIG(release, debug|release): {
|
||||
SUBDIRS += releaseplugin
|
||||
tst_qplugin_pro.depends += releaseplugin
|
||||
}
|
||||
}
|
||||
!win32:!mac:{
|
||||
SUBDIRS = debugplugin releaseplugin
|
||||
tst_qplugin_pro.depends += debugplugin releaseplugin
|
||||
}
|
||||
SUBDIRS += tst_qplugin.pro
|
||||
|
||||
SUBDIRS += main $$TESTPLUGINS
|
||||
main.file = tst_qplugin.pro
|
||||
main.depends = $$TESTPLUGINS
|
||||
|
||||
|
|
|
@ -556,6 +556,7 @@ private slots:
|
|||
void checkCommentIndentation() const;
|
||||
void checkCommentIndentation_data() const;
|
||||
void crashInXmlStreamReader() const;
|
||||
void write8bitCodec() const;
|
||||
void hasError() const;
|
||||
|
||||
private:
|
||||
|
@ -1576,5 +1577,43 @@ void tst_QXmlStream::hasError() const
|
|||
|
||||
}
|
||||
|
||||
void tst_QXmlStream::write8bitCodec() const
|
||||
{
|
||||
QBuffer outBuffer;
|
||||
QVERIFY(outBuffer.open(QIODevice::WriteOnly));
|
||||
QXmlStreamWriter writer(&outBuffer);
|
||||
writer.setAutoFormatting(false);
|
||||
|
||||
QTextCodec *codec = QTextCodec::codecForName("IBM500");
|
||||
if (!codec) {
|
||||
QSKIP("Encoding IBM500 not available.");
|
||||
}
|
||||
writer.setCodec(codec);
|
||||
|
||||
writer.writeStartDocument();
|
||||
writer.writeStartElement("root");
|
||||
writer.writeAttribute("attrib", "1");
|
||||
writer.writeEndElement();
|
||||
writer.writeEndDocument();
|
||||
outBuffer.close();
|
||||
|
||||
// test 8 bit encoding
|
||||
QByteArray values = outBuffer.data();
|
||||
QVERIFY(values.size() > 1);
|
||||
// check '<'
|
||||
QCOMPARE(values[0] & 0x00FF, 0x4c);
|
||||
// check '?'
|
||||
QCOMPARE(values[1] & 0x00FF, 0x6F);
|
||||
|
||||
// convert the start of the XML
|
||||
const QString expected = ("<?xml version=\"1.0\" encoding=\"IBM500\"?>");
|
||||
QTextDecoder *decoder = codec->makeDecoder();
|
||||
QVERIFY(decoder);
|
||||
QString decodedText = decoder->toUnicode(values);
|
||||
delete decoder;
|
||||
QVERIFY(decodedText.startsWith(expected));
|
||||
}
|
||||
|
||||
|
||||
#include "tst_qxmlstream.moc"
|
||||
// vim: et:ts=4:sw=4:sts=4
|
||||
|
|
|
@ -35,6 +35,11 @@
|
|||
#include <QtTest/QtTest>
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
# include <sys/types.h>
|
||||
# include <signal.h>
|
||||
#endif
|
||||
|
||||
void MyObject::method(const QDBusMessage &msg)
|
||||
{
|
||||
path = msg.path();
|
||||
|
@ -1352,23 +1357,39 @@ void tst_QDBusConnection::callVirtualObjectLocal()
|
|||
|
||||
void tst_QDBusConnection::pendingCallWhenDisconnected()
|
||||
{
|
||||
#ifdef QT_NO_PROCESS
|
||||
QSKIP("Test requires QProcess");
|
||||
#else
|
||||
if (!QCoreApplication::instance())
|
||||
QSKIP("Test requires a QCoreApplication");
|
||||
|
||||
QDBusServer *server = new QDBusServer;
|
||||
QDBusConnection con = QDBusConnection::connectToPeer(server->address(), "disconnect");
|
||||
QTestEventLoop::instance().enterLoop(2);
|
||||
QVERIFY(con.isConnected());
|
||||
QDBusMessage message = QDBusMessage::createMethodCall("", "/", QString(), "method");
|
||||
QProcess daemon;
|
||||
daemon.start("dbus-daemon", QStringList() << "--session" << "--nofork" << "--print-address");
|
||||
QVERIFY2(daemon.waitForReadyRead(2000),
|
||||
"Daemon didn't print its address in time; error: \"" + daemon.errorString().toLocal8Bit() +
|
||||
"\"; stderr:\n" + daemon.readAllStandardError());
|
||||
|
||||
QString address = QString::fromLocal8Bit(daemon.readAll().trimmed());
|
||||
QDBusConnection con = QDBusConnection::connectToBus(address, "disconnect");
|
||||
QVERIFY2(con.isConnected(), (con.lastError().name() + ": " + con.lastError().message()).toLocal8Bit());
|
||||
|
||||
// confirm we're connected and we're alone in this bus
|
||||
QCOMPARE(con.baseService(), QString(":1.0"));
|
||||
|
||||
// kill the bus
|
||||
daemon.terminate();
|
||||
daemon.waitForFinished();
|
||||
|
||||
// send something, which we should get an error with
|
||||
QDBusMessage message = QDBusMessage::createMethodCall("org.freedesktop.DBus", "/", QString(), "ListNames");
|
||||
QDBusPendingCall reply = con.asyncCall(message);
|
||||
|
||||
delete server;
|
||||
|
||||
QTestEventLoop::instance().enterLoop(2);
|
||||
reply.waitForFinished();
|
||||
QVERIFY(!con.isConnected());
|
||||
QVERIFY(reply.isFinished());
|
||||
QVERIFY(reply.isError());
|
||||
QVERIFY(reply.error().type() == QDBusError::Disconnected);
|
||||
QCOMPARE(reply.error().type(), QDBusError::Disconnected);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString MyObject::path;
|
||||
|
|
|
@ -104,10 +104,6 @@ private slots:
|
|||
|
||||
void caseSensitivity();
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
void Win32LongFileName();
|
||||
#endif
|
||||
|
||||
void drives_data();
|
||||
void drives();
|
||||
void dirsBeforeFiles();
|
||||
|
@ -928,20 +924,6 @@ void tst_QFileSystemModel::caseSensitivity()
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
void tst_QFileSystemModel::Win32LongFileName()
|
||||
{
|
||||
QString tmp = flatDirTestPath;
|
||||
QStringList files;
|
||||
files << "aaaaaaaaaa" << "bbbbbbbbbb" << "cccccccccc";
|
||||
QVERIFY(createFiles(tmp, files));
|
||||
QModelIndex root = model->setRootPath(tmp);
|
||||
QTRY_VERIFY(model->index(tmp + QLatin1String("/aaaaaa~1")).isValid());
|
||||
QTRY_VERIFY(model->index(tmp + QLatin1String("/bbbbbb~1")).isValid());
|
||||
QTRY_VERIFY(model->index(tmp + QLatin1String("/cccccc~1")).isValid());
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QFileSystemModel::drives_data()
|
||||
{
|
||||
QTest::addColumn<QString>("path");
|
||||
|
|
|
@ -930,17 +930,14 @@ private:
|
|||
void tst_QStyle::testStyleOptionInit()
|
||||
{
|
||||
QStringList keys = QStyleFactory::keys();
|
||||
QVector<QStyle*> styles;
|
||||
styles.reserve(keys.size() + 1);
|
||||
keys.prepend(QString()); // QCommonStyle marker
|
||||
|
||||
styles << new QCommonStyle();
|
||||
|
||||
Q_FOREACH (QStyle *style, styles) {
|
||||
Q_FOREACH (const QString &key, keys) {
|
||||
QStyle* style = key.isEmpty() ? new QCommonStyle : QStyleFactory::create(key);
|
||||
TestStyleOptionInitProxy testStyle;
|
||||
testStyle.setBaseStyle(style);
|
||||
testAllFunctions(style);
|
||||
QVERIFY(!testStyle.invalidOptionsDetected);
|
||||
delete style;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue