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

Conflicts:
	mkspecs/qnx-x86-qcc/qplatformdefs.h
	src/corelib/global/qglobal.h
	src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
	src/opengl/qgl.cpp
	src/opengl/qglpixelbuffer.cpp
	src/opengl/qglshaderprogram.cpp
	tests/auto/opengl/qglthreads/tst_qglthreads.cpp

Change-Id: Iaba137884d3526a139000ca26fee02bb27b5cdb5
This commit is contained in:
Frederik Gladhorn 2014-05-06 16:19:14 +02:00
commit 1326cd15f7
266 changed files with 4333 additions and 2050 deletions

View File

@ -69,15 +69,11 @@ rm -f "$EXE" "${EXE}.exe"
set -- "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG+=android_app" "CONFIG-=debug_and_release app_bundle lib_bundle" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
if [ "$VERBOSE" = "yes" ]; then
OUTDIR=$OUTDIR "$@"
$MAKE
OUTDIR=$OUTDIR "$@" && $MAKE && SUCCESS=yes
else
OUTDIR=$OUTDIR "$@" >/dev/null 2>&1
$MAKE >/dev/null 2>&1
OUTDIR=$OUTDIR "$@" >/dev/null 2>&1 && $MAKE >/dev/null 2>&1 && SUCCESS=yes
fi
( [ -f "$EXE" ] || [ -f "${EXE}.exe" ] ) && SUCCESS=yes
# done
if [ "$SUCCESS" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "$DESCRIPTION disabled."

View File

@ -1,6 +1,7 @@
SOURCES = icu.cpp
CONFIG += console
CONFIG -= qt dylib
win32 {
CONFIG(static, static|shared) {
CONFIG(debug, debug|release) {
@ -9,8 +10,8 @@ win32 {
LIBS += -lsicuin -lsicuuc -lsicudt
}
} else {
LIBS += -licuin -licuuc
LIBS += -licuin -licuuc -licudt
}
} else {
LIBS += -licui18n -licuuc
LIBS += -licui18n -licuuc -licudata
}

View File

@ -1,29 +0,0 @@
#!/bin/sh
TEST_PATH=`dirname "$0"`
SEP_DEBUG_SUPPORT=no
COMPILER=$1
QMAKE_OBJCOPY=$2
VERBOSE=$3
if [ -n "$QMAKE_OBJCOPY" ]; then
echo "int main() { return 0; }" > objcopy_test.cpp
if $TEST_PATH/which.test "$QMAKE_OBJCOPY" >/dev/null 2>&1 && $COMPILER $SYSROOT_FLAG -g -o objcopy_test objcopy_test.cpp >/dev/null 2>&1; then
"$QMAKE_OBJCOPY" --only-keep-debug objcopy_test objcopy_test.debug >/dev/null 2>&1 \
&& "$QMAKE_OBJCOPY" --strip-debug objcopy_test >/dev/null 2>&1 \
&& "$QMAKE_OBJCOPY" --add-gnu-debuglink=objcopy_test.debug objcopy_test >/dev/null 2>&1 \
&& SEP_DEBUG_SUPPORT=yes
fi
rm -f objcopy_test objcopy_test.debug objcopy_test.cpp
else
[ "$VERBOSE" = "yes" ] && echo "Separate debug info check skipped, QMAKE_OBJCOPY is unset.";
fi
# done
if [ "$SEP_DEBUG_SUPPORT" != "yes" ]; then
[ "$VERBOSE" = "yes" ] && echo "Separate debug info support disabled."
exit 0
else
[ "$VERBOSE" = "yes" ] && echo "Separate debug info support enabled."
exit 1
fi

View File

@ -0,0 +1,45 @@
/****************************************************************************
**
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
int main()
{
return 0;
}

View File

@ -0,0 +1,4 @@
SOURCES = objcopy.cpp
CONFIG -= qt
QMAKE_POST_LINK += $$QMAKE_OBJCOPY --only-keep-debug objcopy objcopy.debug && $$QMAKE_OBJCOPY --strip-debug objcopy && $$QMAKE_OBJCOPY --add-gnu-debuglink=objcopy.debug objcopy

62
configure vendored
View File

@ -616,7 +616,7 @@ CFG_EGL=auto
CFG_EGL_X=auto
CFG_FONTCONFIG=auto
CFG_FREETYPE=auto
CFG_HARFBUZZ=no
CFG_HARFBUZZ=auto
CFG_SQL_AVAILABLE=
QT_ALL_BUILD_PARTS=" libs tools examples tests "
QT_DEFAULT_BUILD_PARTS="libs tools examples"
@ -781,8 +781,6 @@ QT_LIBS_GLIB=
# default qpa platform
QT_QPA_DEFAULT_PLATFORM=
# default print support plugin
QT_PRINTSUPPORT_DEFAULT_PLUGIN=
# Android vars
CFG_DEFAULT_ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT
@ -1806,6 +1804,20 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
pulseaudio)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_PULSEAUDIO="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
alsa)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_ALSA="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
gtkstyle)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_QGTKSTYLE="$VAL"
@ -2370,6 +2382,15 @@ Third Party Libraries:
-no-glib ........... Do not compile Glib support.
+ -glib .............. Compile Glib support.
-no-pulseaudio ..... Do not compile PulseAudio support.
+ -pulseaudio ........ Compile PulseAudio support.
-no-alsa ........... Do not compile ALSA support.
+ -alsa .............. Compile ALSA support.
-no-gtkstyle ....... Do not compile GTK theme support.
+ -gtkstyle .......... Compile GTK theme support.
Additional options:
-make <part> ....... Add part to the list of parts to be built at make time.
@ -3104,7 +3125,7 @@ if [ "$XPLATFORM_IOS" = "yes" ]; then
CFG_PKGCONFIG="no"
CFG_NOBUILD_PARTS="$CFG_NOBUILD_PARTS examples"
CFG_SHARED="no" # iOS builds should be static to be able to submit to the App Store
CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtconnectivity qtdoc qtmacextras qtserialport qttools qtwebkit qtwebkit-examples"
CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtconnectivity qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples"
# 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.
@ -3179,7 +3200,7 @@ if [ "$CFG_PRECOMPILE" = "auto" ]; then
fi
fi
# auto-detect support for separate debug info in objcopy
# sanity-check for separate debug info
if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
if [ "$CFG_SHARED" = "no" ]; then
echo "ERROR: -separate-debug-info is incompatible with -static"
@ -3189,13 +3210,6 @@ if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
echo "ERROR: -separate-debug-info needs -debug, -debug-and-release, or -force-debug-info"
exit 1
fi
TEST_OBJCOPY=`getXQMakeConf QMAKE_OBJCOPY`
COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
echo "ERROR: -separate-debug-info was requested but this binutils does not support it."
echo "Re-run configure with -v for more information"
exit 1
fi
fi
# auto-detect -fvisibility support
@ -3937,6 +3951,15 @@ fi
# functionality tests
#-------------------------------------------------------------------------------
# Detect objcopy support
if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
if ! compileTest unix/objcopy "objcopy"; then
echo "ERROR: -separate-debug-info was requested but this binutils does not support it."
echo "Re-run configure with -v for more information"
exit 1
fi
fi
# Detect C++11 support
if [ "$CFG_CXX11" != "no" ]; then
# Configure detects compiler features based on cross compiler, so we need
@ -4618,7 +4641,7 @@ if [ "$CFG_GLIB" = "yes" -a "$CFG_QGTKSTYLE" != "no" ]; then
QMakeVar set QT_LIBS_QGTK2 "$QT_LIBS_QGTK2"
else
if [ "$CFG_QGTKSTYLE" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "Gtk theme support cannot be enabled due to functionality tests!"
echo "GTK theme support cannot be enabled due to functionality tests!"
echo " Turn on verbose messaging (-v) to $0 to see the fin al report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
@ -5197,15 +5220,6 @@ if [ -z "$QT_QPA_DEFAULT_PLATFORM" ]; then
fi
fi
# Determine print support plugin belonging to the default QPA platform
if [ "$QT_QPA_DEFAULT_PLATFORM" = "cocoa" ]; then
QT_PRINTSUPPORT_DEFAULT_PLUGIN=cocoaprintersupport
elif [ "$QT_QPA_DEFAULT_PLATFORM" = "windows" ]; then
QT_PRINTSUPPORT_DEFAULT_PLUGIN=windowsprintersupport
elif [ "$QT_QPA_DEFAULT_PLATFORM" = "xcb" ]; then
QT_PRINTSUPPORT_DEFAULT_PLUGIN=cupsprintersupport
fi
if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then
QMakeVar set QMAKE_CFLAGS_XCB "$QMAKE_CFLAGS_XCB"
QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB"
@ -5249,8 +5263,8 @@ if [ "$CFG_FREETYPE" = "auto" ]; then
fi
# harfbuzz support
[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_HARFBUZZ" = "auto" ] && CFG_HARFBUZZ=no
[ "$XPLATFORM_MAC" = "yes" ] && [ "$CFG_HARFBUZZ" = "auto" ] && CFG_HARFBUZZ=yes
[ "$CFG_HARFBUZZ" = "auto" ] && CFG_HARFBUZZ=no # disable auto-detection on non-Mac for now
if [ "$CFG_HARFBUZZ" = "auto" ]; then
if compileTest unix/harfbuzz "HarfBuzz"; then
CFG_HARFBUZZ=system
@ -6165,7 +6179,6 @@ EOF
fi
echo "#define QT_QPA_DEFAULT_PLATFORM_NAME \"$QT_QPA_DEFAULT_PLATFORM\"" >>"$outpath/src/corelib/global/qconfig.h.new"
echo "#define QT_QPA_DEFAULT_PRINTSUPPORTPLUGIN_NAME \"QT_PRINTSUPPORT_DEFAULT_PLUGIN\"" >>"$outpath/src/corelib/global/qconfig.h.new"
# avoid unecessary rebuilds by copying only if qconfig.h has changed
if cmp -s "$outpath/src/corelib/global/qconfig.h" "$outpath/src/corelib/global/qconfig.h.new"; then
@ -6235,7 +6248,6 @@ EOF
if [ "$CFG_SHARED" = "no" ]; then
echo "QT_DEFAULT_QPA_PLUGIN = q$QT_QPA_DEFAULT_PLATFORM" >> "$QTCONFIG.tmp"
echo "QT_DEFAULT_PRINTSUPPORTPLUGIN = $QT_PRINTSUPPORT_DEFAULT_PLUGIN" >> "$QTCONFIG.tmp"
echo >> "$QTCONFIG.tmp"
fi

465
dist/changes-5.3.0 vendored
View File

@ -15,6 +15,50 @@ corresponding to tasks in the Qt Bug Tracker:
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* Important Behavior Changes *
****************************************************************************
- SIMD support in CPUs:
* [QTBUG-30440] Qt no longer checks for support for the Neon FPU on
ARM platforms at runtime. Code optimized for Neon must be enabled
unconditionally at compile time by ensuring the compiler supports
Neon. You may need to edit your mkspec for that.
* Qt now automatically generates code for processors supporting SSE2
on i386 platforms. To disable this, pass the -no-sse2 option during
Qt configuration. Since this feature has been present on CPUs for
10 years and since Qt no longer checks for runtime support for
SSE2, we strongly encourage users to leave the default setting on
for best performance.
- For Linux distributions that must retain support for CPUs without
SSE2, we recommend doing two builds of Qt and installing the
SSE2-enabled libraries in the LIBDIR/sse2 directory (specially
QtGui, QtQml and QtQuick libraries). Tools, plugins, and examples
are not affected.
- See discussion on the Qt development mailing list:
http://lists.qt-project.org/pipermail/development/2013-November/014085.html
- SSL and security:
* The default set of ciphers used by QSslSocket has been changed to
exclude ciphers that are using key lengths smaller than 128
bits. These ciphers are still available and can be enabled by
applications if required.
* [QTBUG-20666] Support for DH and ECDH key exchange cipher suites
when acting as an SSL server has been made possible. This change
means the you can now implement servers that offer forward-secrecy
using Qt.
* Running Qt applications that are setuid is no longer allowed by
default. If you really need to do this then you can call
QCoreApplication::setSetuidAllowed(true) before creating the
QCoreApplication instance.
- UTF-8 decoding:
* The QString and QTextCodec UTF-8 decoder changed behavior slightly:
when it encounters invalid sequences, it will insert one
replacement character per byte that is invalid, instead of one
replacement character for the whole invalid length.
****************************************************************************
* Platform deprecation notice *
****************************************************************************
@ -24,17 +68,125 @@ information about a particular change.
not tested, and most likely has issues that are not fully documented.
****************************************************************************
* Library *
* General *
****************************************************************************
QtWidgets
---------
- Support for the following platforms has been removed, due to lack of
interest in updating support: INTEGRITY, VxWorks, Solaris on UltraSPARC
(with the Sun Studio compiler suite), AIX on POWER processors (with IBM
Visual Age compiler suite).
- Builtin command-line options such as -reverse, -session, -style
-etc. now all support double dash, e.g. --reverse, --session,
--style...
****************************************************************************
* Library *
****************************************************************************
QtCore
------
- Added QSignalBlocker, a RAII-style wrapper around
QObject::blockSignals().
- QLibraryInfo provides information on how Qt was built.
- Added class QMarginsF to support handling margins with floating-point
values.
- Atomic support:
* Added more operations to the atomic classes, including operator T(),
operator=(T), operator++, operator--. For the QAtomicInteger,
bit-manipulation operations are also provided, both in operator and in
fetchAndXxxYyyyyy modes.
- Event loop:
* [QTBUG-36611] QCoreApplication::hasPendingEvents and
QAbstractEventDispatcher::hasPendingEvents are now deprecated. Please
refer to the documentation for more information.
- Logging:
* It is now possible for the qCDebug macros to be used in a printf
style.
* All qCDebug categories are enabled by default, except for Qt's own
categories.
* The logging framework can now be configured with an .ini file.
* Q_LOGGING_CATEGORY and Q_DECLARE_LOGGING_CATEGORY now return a const
object.
- QByteArray:
* Added NSData/CDataRef converters for QByteArray.
- QChar:
* Added JoiningType enum and joiningType() method that deprecates the
old QChar::Joining enum and joining() method.
- QFileSelector:
* [QTBUG-35073] The identifier for OS X has been changed back to
'osx' from 'mac', and 'mac' and 'darwin' have now been added as
selectors for Darwin OS (which is the base of both OS X and iOS).
- QHash/QSet:
* Added qHash overloads for float, double and long double.
- QJsonArray:
* Added convenience methods to QJsonArray for appending QJsonValues
- QJsonValue:
* Added constructor to QJsonValue for const char *
* QJsonValue::fromVariant() will now convert single-precision Floats
into Doubles instead of Strings
- QMargins:
* Added missing addition and subtraction operators.
- QProcess:
* [QTBUG-26136] Added processId() to QProcess. This function will,
unlike pid(), return the actual process identifier on both Windows
and Unix.
- QRect:
* Added QMargins subtraction operator.
- QSettings:
* [QTBUG-9824][QTBUG-21062][QTBUG-22745] QSettings now returns the
correct value for isWritable() when using SystemScope settings.
- QSortFilterProxyModel:
* [QTBUG-30662] Fixed sorting when a previously empty proxy model
becomes populated because of a change in the filter.
- QStandardPaths:
* [QTBUG-34631] Added QStandardPaths implementation for Android.
- QString:
* Added QLatin1String overload of contains()
* QString::toUcs4 now does not return invalid UCS-4 code units belonging
to the surrogate range (U+D800 to U+DFFF) when the QString contains
malformed UTF-16 data. Instead, U+FFFD is returned in place of the
malformed subsequence.
- QTextCodec:
* Encoding a QString in UTF-32 will now replace malformed UTF-16
subsequences in the string with the Unicode replacement character
(U+FFFD).
- QVarLengthArray:
* Added the indexOf, lastIndexOf and contains functions to
QVarLengthArray. These functions make the class more similar to
QVector.
- Windows:
* [QTBUG-35194] Now QStandardPaths::DownloadLocation returns the proper
path for Windows Vista and up
QtDBus
------
- QtDBus adaptors now include the PropertiesChanged signal in
introspection data
- QDBusServer:
* Added method to QDBusServer to allow anonymous client connections,
even if the connecting client is not authenticated as a user.
QtGui
-----
@ -42,12 +194,313 @@ QtGui
- Added setSwapInterval() to QSurfaceFormat. Platforms that support
setting the swap interval are now defaulting to the value of 1,
meaning vsync is enabled.
- [QTBUG-35220] Reading bmp images with alpha channel is now supported
- [QTBUG-36394] The main Embedded Linux platform plugins (eglfs, linuxfb,
kms) are changed to behave identically with regards to terminal keyboard
input: it is turned off by default on all of these platforms. If this
feature is not desired, it can be disabled by setting the environment
variable QT_QPA_ENABLE_TERMINAL_KEYBOARD.
- [QTBUG-36374] Mouse hotplugging is now fully supported in eglfs when
running on Embedded Linux systems with libudev support enabled.
- [QTBUG-36603] Windows Accessibility now handles the disabled state of
widgets correctly.
- Accessibility on Linux now reports the active state correctly.
- [QTBUG-36483] Qt builds on Windows can now be configured for dynamic
loading of the OpenGL implementation. This can be requested by passing
-opengl dynamic to configure. In this mode no modules will link to
opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt
libraries with the ability of transparently falling back to Angle in
case the opengl32.dll is not suitable, due to missing graphics drivers
for example.
- Added class QPageLayout to support handling page layouts including the
page size, orientation and margins.
- [QTBUG-28813][QTBUG-29930][QTBUG-35836] Fixed regression in
arabic text rendering.
- [QTBUG-37332] GLES3 and desktop OpenGL are now fully supported with
EGL
- [QTBUG-36993] Native (that is, not distance field based) text
rendering is now functional on OpenGL 3.2+ core profiles too.
- Accessibility:
* [QTBUG-37204] Implemented text attributes to enable VoiceOver to read
QTextEdit and QPlainTextEdit.
* Assistive apps such as VoiceOver can now set the focus on widgets
and controls.
- QColor:
* Exported highly optimized methods for premultiply and unpremultiply of
QRgb values.
- QFont:
* Added qHash overload for this class.
- QGuiApplication:
* Restored support for -title command line argument on X11 and added
-qwindowtitle on all platforms.
- QImage:
* Added rvalue-qualified overloads for mirrored(), rgbSwapped() and
convertToFormat(), allowing in-place conversion in some cases
- QOpenGLFramebufferObject:
* [QTBUG-35881] Added takeTexture() for retrieving and detaching the
texture from the framebuffer object.
- QPageSize:
* Added new QPageSize class to implement Adobe Postscript PPD standard
page sizes. This class supports the standard page sizes, names and
keys from the PPD standard, and provides convenient size and rect
conversion methods.
- QPagedPaintDevice:
* [QTBUG-27685][QTBUG-25744] Paged paint devices such as QPrinter and
QPdfWriter now support all Postscript standard page sizes.
- QPdfWriter:
* The QPdfWriter now supports setting the PDF orientation, layout and
resolution by using QPageSize and QPageLayout.
- QTextLayout:
* [QTBUG-18060] Fixed visual cursor movement in bidirectional text.
- QWindow:
* QWindow::icon() now defaults to the application icon, which can be set
with QGuiApplication::setWindowIcon().
QtNetwork
---------
- [QTBUG-18714] Added support for the SPDY protocol (version 3.0).
- QNetworkReply:
* [QTBUG-30880] Added more (specific) HTTP status codes to NetworkError
enum.
- QSslConfiguration:
* [QTBUG-33208] Added support for the Next Protocol Negotiation (NPN)
TLS extension.
QtPrintSupport
--------------
- [QTBUG-29663] Made the Qt buildsystem automatically include the
necessary plugins so that static applications can print.
- CUPS 1.4 is now required for print support on Linux and other *nix
platforms.
- QPrintPreviewDialog:
* [QTBUG-36561] Fixed initialization of QPrintPreviewDialog's image
resources for static builds.
- QPrinter:
* QPrinter can now use QPageSize and QPageLayout in the public api to
control the page layout for a print job.
- QPrinterInfo:
* [QTBUG-35248] Added new public api for isRemote(), state(),
defaultPageSize(), supportedPageSizes(), supportsCustomPageSizes(),
minimumPhysicalPageSize(), maximumPhysicalPageSize(),
supportedResolutions(), availablePrinterNames(), and
defaultPrinterName(). The use of availablePrinters() is discouraged
due to performance concerns.
QtSql
-----
- QSqlQuery::isNull(field) now correctly returns true for "no such field".
- QSqlQuery::isNull(fieldname) is a new overload.
- QSQLITE: Empty database name now opens in-memory database.
- QSqlError: Now handles alphanumeric error codes. Used by QPSQL.
Old numeric code is deprecated.
- [QTBUG-12186] Fixed the order of values with positional binding in a
QSqlQuery
- QSQLITE:
* Creating temporary databases is now possible
* Empty database name now opens in-memory database.
- QSqlError
* Now handles alphanumeric error codes. Used by QPSQL. Old numeric
code is deprecated.
QtTest
------
- Added test duration to xml output. When running tests with xml output a
new tag of the form
<duration msecs="123"/> is added to each test function and the test as a
whole.
- Added a CSV logging mode that is suitable for importing benchmark
results into spreadsheets. This can be enabled by the -csv option on the
command-line. The CSV logging mode will not print test failures, debug
messages, warnings, etc.
- QtTest now prints an escaped version of QStrings that failed to compare
with QCOMPARE. That is, instead of converting non-printable characters
to question marks, QtTest will print the Unicode representation of the
character in question.
- Windows:
* [QTBUG-35743] Use correct UTF-8 encoding for XML test results on
platforms with different console encoding.
QtWidgets
---------
- Accessibility:
* Fixed QTextEdit not reporting newlines to accessibility frameworks and
add editable text interface.
- QAbstractSpinBox:
* [QTBUG-5142] QSpinBox and QDoubleSpinBox widgets can now show the
group (thousands) separators.
- QColorDialog:
* Ensured QColorDialog::DontUseNativeDialog is respected when showing
the dialog.
- QDateEdit:
* [QTBUG-36692] Fixed incorrect appearance on OS X of QDateEdit with
calendarPopup enabled.
- QDrag
* Fixed Drag and Drop driven by touch-synthesized mouse events on
Windows.
- QListView:
* [QTBUG-4714] Fixed QListView ignoring the grid size for word
wrapping in icon mode
- QMdiSubWindow:
* [QTBUG-9933][QTBUG-27274] Fixed setWindowFlags() for QMdiSubWindow.
- QMenu:
* [QTBUG-20094] Enabled sloppy submenu mouse navigation.
* [QTBUG-36142] QMenu now correctly uses text color set by style
sheet for menu items on Windows.
* [QTBUG-36218] Fixed position of menu gutter on Windows when using a
custom widget action.
- QPlainTextEdit:
* Added find method overload using QRegExp
- QSpinBox:
* [QTBUG-3032] Fixed keyboard selection with multiple-character strings.
- QScrollArea:
* [QTBUG-36314] The setting for click position is now respected on OS X.
- QTextDocument:
* [QTBUG-33336] Added support for empty inline elements in block tags.
- QTextEdit:
* Added find method overload using QRegExp
- QWidget:
* [QTBUG-25831] Restored the Qt 4 behavior in the sequence of events
that are delivered to widget windows and their children when a
mouse double click happens: the second MouseButtonPress event from
Qt 5.0-5.2 is no longer sent.
* [QTBUG-33716] QWidgets embedded in QGraphicsProxyWidget are no longer
sent close events when the app is closed on OS X.
* [QTBUG-36178] Fixed an issue where stay-on-top widgets would cover
their own children on OS X.
- QWizard:
* [QTBUG-7484] Added NoCancelButtonOnLastPage option.
* [QTBUG-36192] Fixed frame when using Vista style/MSVC2012.
- Text support:
* [QTBUG-36444] Fixed off-by-one in the height of text background.
- Windows:
* [QTBUG-21371][QTBUG-4397] QWidget::restoreGeometry() now restores
maximized/full screen widgets to the correct screen.
****************************************************************************
* Compiler Specific Changes *
****************************************************************************
- Variadic macros are now enabled more liberally for gcc, clang, icc. If
you have warnings (because you e.g. compile with -pedantic), disable
them by -Wno-variadic-macros.
****************************************************************************
* Platform Specific Changes *
****************************************************************************
Android
-------
- [QTBUG-34781] Fixed regression in "make install" on library projects on
Android so they can be used inside subdirs projects again.
- [QTBUG-36074] Fixed crash on populating large combo boxes or menus.
- [QTBUG-36528] Fixed QDir::entryList() for assets scheme to no longer
skip the first file in the directory.
- [QTBUG-30652] It is now possible to define a splash screen which will be
visible until the first window is created.
- [QTBUG-33704] Sped up first time directory listing in assets by using
pregenerated entry list.
- [QTBUG-37738] Fixed font merging problem which caused e.g. missing
glyphs for Arabic numerals.
- [QTBUG-36025] Fixed a memory leak in the clipboard
- Fonts:
* [QTBUG-36789] Fixed support for Arabic text.
Linux
-----
- Systems with systemd may now pass -journald to configure to send
logging output to journald. Logging will still be sent to stderr for
interactive applications (run from a tty) or with QT_NO_JOURNALD_LOG
set to a non-empty value.
OS X
----
- [QTBUG-18980][QTBUG-38246] Use CoreText text shaping engine for
support of complex scripts. If required, the shaping engine used in
previous versions can be preferred by configuring Qt with
-no-harfbuzz. Alternatively, the QT_HARFBUZZ environment variable
could be set to "old".
Windows
-------
- Introduced experimental direct2d platform plugin for Windows. This
plugin shares most code with the current windows plugin, but
substitutes a direct2d-based paint engine for window backing stores
and pixmaps.
- QtWidgets / QFileDialog:
* Handled the case of having trailing spaces in a filename correctly so
if the filename ends up being empty that the parent path is used
instead.
- Windows Embedded:
* Fixed building issue when configuring Qt with -qtlibinfix
X11 / XCB
---------
- Qt now supports XInput2 smooth scrolling events
****************************************************************************
* Tools *
****************************************************************************
moc
---
- [QTBUG-33668] Fixed passing -D of a macro defined to something more
complex than a single identifier.
- QTBUG-36128:
* [QTBUG-36128] Fixed sign conversion warning in generated file.
qdbus
-----
- [QTBUG-36524] Fixed a bug that caused the qdbus tool to crash when
trying to display remote interfaces that had complex types without a
matching base Qt type.

View File

@ -19,6 +19,7 @@ defines += Q_QDOC \
Q_COMPILER_RVALUE_REFS
Cpp.ignoretokens += \
ENGINIOCLIENT_EXPORT \
PHONON_EXPORT \
Q_AUTOTEST_EXPORT \
Q_BLUETOOTH_EXPORT \

View File

@ -1,67 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
#include <QX11EmbedContainer>
//! [0]
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
if (app.arguments().count() != 2) {
qFatal("Error - expected executable path as argument");
return 1;
}
QX11EmbedContainer container;
container.show();
QProcess process(&container);
QString executable(app.arguments()[1]);
QStringList arguments;
arguments << QString::number(container.winId());
process.start(executable, arguments);
int status = app.exec();
process.close();
return status;
}
//! [0]

View File

@ -1,61 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QApplication>
#include "embedwidget.h"
//! [0]
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
if (app.arguments().count() != 2) {
qFatal("Error - expected window id as argument");
return 1;
}
QString windowId(app.arguments()[1]);
EmbedWidget window;
window.embedInto(windowId.toULong());
window.show();
return app.exec();
}
//! [0]

View File

@ -73,7 +73,7 @@ AddressBook::AddressBook(QWidget *parent)
previousButton->setEnabled(false);
//! [instantiating FindDialog]
dialog = new FindDialog;
dialog = new FindDialog(this);
//! [instantiating FindDialog]
connect(addButton, SIGNAL(clicked()), this, SLOT(addContact()));

View File

@ -80,7 +80,7 @@ AddressBook::AddressBook(QWidget *parent)
//! [tooltip 2]
saveButton->setEnabled(false);
dialog = new FindDialog;
dialog = new FindDialog(this);
connect(addButton, SIGNAL(clicked()), this, SLOT(addContact()));
connect(submitButton, SIGNAL(clicked()), this, SLOT(submitContact()));

View File

@ -80,7 +80,7 @@ AddressBook::AddressBook(QWidget *parent)
exportButton->setToolTip(tr("Export as vCard"));
exportButton->setEnabled(false);
dialog = new FindDialog;
dialog = new FindDialog(this);
connect(addButton, SIGNAL(clicked()), this, SLOT(addContact()));
connect(submitButton, SIGNAL(clicked()), this, SLOT(submitContact()));

View File

@ -3,7 +3,7 @@ MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = android
QMAKE_COMPILER = gcc
CONFIG += android_install unversioned_soname android_deployment_settings
CONFIG += android_install unversioned_soname unversioned_libname android_deployment_settings
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
@ -26,6 +26,7 @@ contains(QMAKE_HOST.os,Windows) {
} else {
MINGW_IN_SHELL = 1
QMAKE_DIR_SEP = /
QMAKE_DIRLIST_SEP = :
# Because install's ability to set permissions is not relevant on Windows,
# and git's msys does not provide it to start with.
QMAKE_INSTALL_FILE = cp -f

View File

@ -57,4 +57,5 @@ QMAKE_STRIPFLAGS_LIB += --strip-unneeded
equals(QMAKE_HOST.os, Windows) {
isEmpty(QMAKE_SH): error("This mkspec requires an MSYS environment.")
QMAKE_DIR_SEP = /
QMAKE_DIRLIST_SEP = :
}

View File

@ -1,6 +1,6 @@
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<Deployment xmlns=\"http://schemas.microsoft.com/windowsphone/2012/deployment\" AppPlatformVersion=\"8.0\">
<DefaultLanguage xmlns=\"\" code=\"en-US\" />
<DefaultLanguage xmlns=\"\" code=\"$${WINRT_MANIFEST.default_language}\" />$${WINRT_MANIFEST.languages}
<App xmlns=\"\"
ProductID=\"$${WINRT_MANIFEST.identity}\"
Title=\"$${WINRT_MANIFEST.name}\"

View File

@ -83,8 +83,8 @@ silent {
breakpad {
load(resolve_target)
DEBUGFILENAME = $$shell_quote($$shell_path($$QMAKE_RESOLVED_TARGET))
PROJECTPATH = $$shell_quote($$shell_path($$OUT_PWD))
DEBUGFILENAME = $$shell_quote($$system_path($$QMAKE_RESOLVED_TARGET))
PROJECTPATH = $$shell_quote($$system_path($$OUT_PWD))
!isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$QMAKE_POST_LINK$$escape_expand(\\n\\t)
QMAKE_POST_LINK = $$QMAKE_POST_LINK$$quote($${QT_BREAKPAD_ROOT_PATH}$${QMAKE_DIR_SEP}qtbreakpadsymbols $$DEBUGFILENAME $$PROJECTPATH)

View File

@ -3,6 +3,6 @@ contains(TEMPLATE, "vc.*") {
EOC = $$escape_expand(\\r\\h)
for(xge, INCREDIBUILD_XGE) {
$${xge}.commands = Rem IncrediBuild_AllowRemote $$EOC Rem IncrediBuild_OutputFile $$shell_path($${xge}.output) $$EOC $$eval($${xge}.commands)
$${xge}.commands = Rem IncrediBuild_AllowRemote $$EOC Rem IncrediBuild_OutputFile $$system_path($${xge}.output) $$EOC $$eval($${xge}.commands)
}
}

View File

@ -44,7 +44,7 @@ CONFIG += plugin no_plugin_name_prefix
javac.input = JAVASOURCES
javac.output = $$CLASS_DIR
javac.CONFIG += combine
javac.commands = javac -source 6 -target 6 -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$shell_path($$join(JAVACLASSPATH, $$QMAKE_DIRLIST_SEP))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN}
javac.commands = javac -source 6 -target 6 -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$system_path($$join(JAVACLASSPATH, $$DIRLIST_SEP))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN}
# Force rebuild every time, because we don't know the paths of the destination files
# as they depend on the code.
javac.depends = FORCE

View File

@ -100,12 +100,3 @@ load(qt_common)
}
load(qml_module)
unix|mingw {
!isEmpty(_QMAKE_SUPER_CACHE_): \
lib_replace.match = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*/lib
else: \
lib_replace.match = $$MODULE_BASE_OUTDIR
lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
QMAKE_PRL_INSTALL_REPLACE += lib_replace
}

View File

@ -163,6 +163,14 @@ contains(qt_module_deps, qml): \
}
}
!import_qpa_plugin {
warning("CONFIG-=import_qpa_plugin is deprecated. Use QTPLUGIN.platforms=- instead.")
QTPLUGIN.platforms = -
} else: qpa_minimal_plugin {
warning("CONFIG+=qpa_minimal_plugin is deprecated. Use QTPLUGIN.platforms=qminimal instead.")
QTPLUGIN.platforms = qminimal
}
contains(TEMPLATE, .*app) {
autoplugs =
for (qtmod, qt_module_deps) {
@ -198,14 +206,6 @@ QT_PLUGIN_VERIFY = DEPLOYMENT_PLUGIN
contains(QT_CONFIG, static) {
QT_PLUGIN_VERIFY += QTPLUGIN
force_import_plugins|contains(TEMPLATE, .*app) {
needs_qpa_plugin:import_qpa_plugin {
qpa_minimal_plugin: \
QTPLUGIN += qminimal
else: \
QTPLUGIN += $$QT_DEFAULT_QPA_PLUGIN
}
needs_printsupport_plugin: \
QTPLUGIN += $$QT_DEFAULT_PRINTSUPPORTPLUGIN
import_plugins:!isEmpty(QTPLUGIN) {
IMPORT_FILE_CONT = \
"// This file is autogenerated by qmake. It imports static plugin classes for" \

View File

@ -19,6 +19,24 @@ contains(TEMPLATE, .*lib) {
unix:contains(QT_CONFIG, reduce_relocations): CONFIG += bsymbolic_functions
contains(QT_CONFIG, largefile): CONFIG += largefile
contains(QT_CONFIG, separate_debug_info): CONFIG += separate_debug_info
!isEmpty(_QMAKE_SUPER_CACHE_): \
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
else: \
rplbase = $$MODULE_BASE_OUTDIR
host_build: \
qt_libdir = $$[QT_HOST_LIBS]
else: \
qt_libdir = $$[QT_INSTALL_LIBS/raw]
contains(QMAKE_DEFAULT_LIBDIRS, $$qt_libdir) {
lib_replace.match = "[^ ']*$$rplbase/lib"
lib_replace.replace =
} else {
lib_replace.match = $$rplbase/lib
lib_replace.replace = $$qt_libdir
}
lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += lib_replace
}
warnings_are_errors:warning_clean {

View File

@ -210,7 +210,7 @@ defineTest(qtPrepareTool) {
$$1$$3 = $$system_path($$eval($$1))
qtAddTargetEnv($$1$$3, QT_TOOL.$${2}.depends, system)
}
$$1 = $$shell_path($$eval($$1))
$$1 = $$system_path($$eval($$1))
qtAddTargetEnv($$1, QT_TOOL.$${2}.depends, )
}

View File

@ -127,6 +127,8 @@ win32 {
# keeps the code clean and helps in writing code that is
# safe across all platforms.
DEFINES *= _CRT_SECURE_NO_WARNINGS
DEFINES += _USE_MATH_DEFINES
}
aix-g++* {
@ -166,43 +168,29 @@ android: CONFIG += qt_android_deps
#install directives
load(qt_installs)
!isEmpty(_QMAKE_SUPER_CACHE_): \
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
else: \
rplbase = $$MODULE_BASE_OUTDIR
include_replace.match = $$rplbase/include
include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
include_replace.CONFIG = path
lib_replace.match = $$rplbase/lib
host_build: \
lib_replace.replace = $$[QT_HOST_LIBS]
else: \
lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
unix|mingw {
CONFIG += create_pc
QMAKE_PKGCONFIG_LIBDIR = $$lib_replace.replace
QMAKE_PKGCONFIG_INCDIR = $$include_replace.replace
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace
}
unix {
CONFIG += create_libtool explicitlib
QMAKE_LIBTOOL_LIBDIR = $$lib_replace.replace
QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
}
load(qt_targets)
load(qt_common)
# this builds on top of qt_common
unix|mingw {
CONFIG += create_pc
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
QMAKE_PKGCONFIG_LIBDIR = $$qt_libdir
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
QMAKE_PKGCONFIG_CFLAGS = -I${includedir}/$$MODULE_INCNAME
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$section(VERSION, ., 0, 0) ")
QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$section(VERSION, ., 0, 0))
for(i, MODULE_DEPENDS): \
QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$eval(QT.$${i}.MAJOR_VERSION))
isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
unix {
CONFIG += create_libtool explicitlib
QMAKE_LIBTOOL_LIBDIR = $$qt_libdir
QMAKE_LIBTOOL_INSTALL_REPLACE += lib_replace
}
}
contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE
@ -221,9 +209,3 @@ win32 {
}
TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end
load(qt_targets)
load(qt_common)
win32:DEFINES+=_USE_MATH_DEFINES

View File

@ -177,9 +177,8 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri
include($$mod_work_pfx/qt_lib_$${pri}.pri)
for(mod, mods_to_load) {
for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \
name depends module_config CONFIG DEFINES sources \
name depends run_depends plugin_types module_config CONFIG DEFINES \
includes bins libs libexecs plugins imports qml \
rpath_link \
)):defined(QT.$${mod}.$$var, var):cache(QT.$${mod}.$$var, transient)
}
cache(QT_MODULES, transient)

View File

@ -38,7 +38,7 @@ CONFIG(static, static|shared) {
!build_pass {
MODULE_PRI_CONT = \
"QT_PLUGIN.$${MODULE}.TYPE = $$PLUGIN_TYPE" \
"QT_PLUGIN.$${MODULE}.EXTENDS = $$PLUGIN_EXTENDS" \
"QT_PLUGIN.$${MODULE}.EXTENDS =$$join(PLUGIN_EXTENDS, " ", " ")" \
"QT_PLUGIN.$${MODULE}.CLASS_NAME = $$PLUGIN_CLASS_NAME" \
"QT_PLUGINS += $$MODULE"
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.")
@ -83,12 +83,3 @@ load(qt_common)
wince*:LIBS += $$QMAKE_LIBS_GUI
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
!isEmpty(_QMAKE_SUPER_CACHE_): \
rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
else: \
rplbase = $$MODULE_BASE_OUTDIR
lib_replace.match = $$rplbase/lib
lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
lib_replace.CONFIG = path
QMAKE_PRL_INSTALL_REPLACE += lib_replace

View File

@ -22,7 +22,7 @@ debug_and_release:debug_and_release_target {
}
!isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD,^\\./?): \
check.commands = cd $$system_path($$TESTRUN_CWD) &&
check.commands = cd $$shell_path($$TESTRUN_CWD) &&
# Allow for a custom test runner script
check.commands += $(TESTRUNNER)

View File

@ -3,9 +3,9 @@ qtPrepareTool(QMAKE_WINDEPLOYQT, windeployqt)
build_pass {
load(resolve_target)
isEmpty(WINDEPLOYQT_OPTIONS): WINDEPLOYQT_OPTIONS = -qmldir $$shell_quote($$shell_path($$_PRO_FILE_PWD_))
WINDEPLOYQT_TARGET = $$shell_quote($$shell_path($$QMAKE_RESOLVED_TARGET))
WINDEPLOYQT_OUTPUT = $$shell_quote($$shell_path($$dirname(QMAKE_RESOLVED_TARGET)/$$basename(TARGET).windeployqt))
isEmpty(WINDEPLOYQT_OPTIONS): WINDEPLOYQT_OPTIONS = -qmldir $$shell_quote($$system_path($$_PRO_FILE_PWD_))
WINDEPLOYQT_TARGET = $$shell_quote($$system_path($$QMAKE_RESOLVED_TARGET))
WINDEPLOYQT_OUTPUT = $$shell_quote($$system_path($$dirname(QMAKE_RESOLVED_TARGET)/$$basename(TARGET).windeployqt))
windeployqt.target = windeployqt
windeployqt.commands = $$QMAKE_WINDEPLOYQT $$WINDEPLOYQT_OPTIONS -list target $$WINDEPLOYQT_TARGET > $$WINDEPLOYQT_OUTPUT

View File

@ -7,6 +7,8 @@ contains(TEMPLATE, ".*app"){
qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
isEqual(entryLib, -lqtmain): {
!contains(QMAKE_DEFAULT_LIBDIRS, $$QT.core.libs): \
QMAKE_LIBS += -L$$QT.core.libs
CONFIG(debug, debug|release): QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}d
else: QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}
} else {

View File

@ -43,7 +43,7 @@ if(!build_pass:equals(TEMPLATE, "vcapp")) {
!isEmpty(FONTS):equals(TEMPLATE, "app") {
fonts.files = $$BUILD_DIR/fonts/*
isEmpty($$target.path) {
isEmpty(target.path) {
fonts.path = $$OUT_PWD/fonts
} else {
fonts.path = $$target.path/fonts
@ -54,7 +54,9 @@ if(!build_pass:equals(TEMPLATE, "vcapp")) {
}
!isEmpty(FONTS):winphone:equals(TEMPLATE, "vcapp"):build_pass {
fonts.files = $$OUT_PWD/fonts/*
for (FONT, FONTS) {
fonts.files += $$OUT_PWD/fonts/$$basename(FONT)
}
fonts.path = fonts
DEPLOYMENT += fonts
}

View File

@ -27,6 +27,8 @@
# WINRT_MANIFEST.splash_screen: Splash screen image file. Default provided by the mkspec.
# WINRT_MANIFEST.iconic_tile_icon: Image file for the "iconic" tile template icon. Default provided by the mkspec.
# WINRT_MANIFEST.iconic_tile_small: Image file for the small "iconic" tile template logo. Default provided by the mkspec.
# WINRT_MANIFEST.default_language: Specifies the default language of the application
# WINRT_MANIFEST.languages: Specifies the languages the application supports
# WINRT_MANIFEST.capabilities: Specifies capabilities to add to the capability list.
# WINRT_MANIFEST.capabilities_device: Specifies device capabilities to add to the capability list. (location, webcam...)
# WINRT_MANIFEST.dependencies: Specifies dependencies required by the package.
@ -90,10 +92,23 @@
isEmpty(WINRT_MANIFEST.genre): WINRT_MANIFEST.genre = apps.normal
isEmpty(WINRT_MANIFEST.background): WINRT_MANIFEST.background = green
isEmpty(WINRT_MANIFEST.foreground): WINRT_MANIFEST.foreground = light
isEmpty(WINRT_MANIFEST.default_language): WINRT_MANIFEST.default_language = en
winphone: INDENT = "$$escape_expand(\\r\\n) "
else: INDENT = "$$escape_expand(\\r\\n) "
# Languages are given as a string list
WINRT_MANIFEST.languages = $$unique(WINRT_MANIFEST.languages)
winphone:equals(WINSDK_VER, 8.0):!isEmpty(WINRT_MANIFEST.languages) {
for(LANGUAGE, WINRT_MANIFEST.languages): \
MANIFEST_LANGUAGES += "<Language code=\"$$LANGUAGE\" />"
WINRT_MANIFEST.languages = \
$$join(MANIFEST_LANGUAGES, $$INDENT, \
"$$escape_expand(\\r\\n) <Languages xmlns=\"\">$$INDENT", \
"$$escape_expand(\\r\\n) </Languages>")
}
# Capabilities are given as a string list and may change with the configuration (network, sensors, etc.)
WINRT_MANIFEST.capabilities = $$unique(WINRT_MANIFEST.capabilities)
WINRT_MANIFEST.capabilities_device = $$unique(WINRT_MANIFEST.capabilities_device)

View File

@ -77,6 +77,9 @@ equals(TEMPLATE, app) {
args += $$system_quote($$arg)
system("cd $$system_quote($$OUT_PWD) && $$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode")
check.commands = "$(MAKE) -f $(MAKEFILE).ReleaseSimulator xcode_build_check"
QMAKE_EXTRA_TARGETS += check
} else {
load(resolve_config)
@ -113,6 +116,9 @@ equals(TEMPLATE, app) {
QMAKE_EXTRA_TARGETS += xcode_build_dir_distclean
distclean.depends = xcode_build_dir_distclean
QMAKE_EXTRA_TARGETS += distclean
xcode_build_check.commands = "$(TESTRUNNER) $$title($$cfg)-$${sdk}/$(TARGET).app $(TESTARGS)"
QMAKE_EXTRA_TARGETS += xcode_build_check
}
CONFIG =

View File

@ -83,7 +83,7 @@
#include <arpa/inet.h>
#define QT_USE_XOPEN_LFS_EXTENSIONS
#if !defined(__EXT_QNX__READDIR64_R)
#if defined(__EXT_QNX__READDIR_R) && !defined(__EXT_QNX__READDIR64_R)
#define QT_NO_READDIR64
#endif
#include "../common/posix/qplatformdefs.h"

View File

@ -93,6 +93,7 @@ QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
!isEmpty(QMAKE_SH) {
MINGW_IN_SHELL = 1
QMAKE_DIR_SEP = /
QMAKE_DIRLIST_SEP = :
include(../common/shell-unix.conf)
# Because install's ability to set permissions is not relevant on Windows,
# and git's msys does not provide it to start with.

View File

@ -2133,6 +2133,16 @@
linked with an application so that they are available as built-in
resources.
qmake automatically adds the plugins that are typically needed
by the used Qt modules (see \c QT).
The defaults are tuned towards an optimal out-of-the-box experience.
See \l{Static Plugins} for a list of available plugins, and ways
to override the automatic linking.
This variable currently has no effect when linking against a
shared/dynamic build of Qt, or when linking libraries.
It may be used for deployment of dynamic plugins at a later time.
\target QT_VERSION_variable
\section1 QT_VERSION
@ -2411,6 +2421,9 @@
\li capabilities_device
\li Specifies device capabilities to add to the capability list
(location, webcam, and so on). This option is not available on Windows Phone.
\row
\li default_language
\li The default language code of the application. Defaults to "en".
\row
\li dependencies
\li Specifies dependencies required by the package.
@ -2437,6 +2450,10 @@
\li identity
\li The unique ID of the app. Defaults to reusing the existing generated
manifest's UUID, or generates a new UUID if none is present.
\row
\li languages
\li A list of additional language codes supported by the application. This list
is empty by default.
\row
\li logo_large
\li Large logo image file. Default provided by the mkspec.

View File

@ -370,7 +370,8 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
regex.remove(0, dir.length());
}
if(real_dir.isEmpty() || exists(real_dir)) {
QStringList files = QDir(real_dir).entryList(QStringList(regex));
QStringList files = QDir(real_dir).entryList(QStringList(regex),
QDir::NoDotAndDotDot | QDir::AllEntries);
if(files.isEmpty()) {
debug_msg(1, "%s:%d Failure to find %s in vpath (%s)",
__FILE__, __LINE__,
@ -383,8 +384,6 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
l.removeAt(val_it);
QString a;
for(int i = (int)files.count()-1; i >= 0; i--) {
if(files[i] == "." || files[i] == "..")
continue;
a = real_dir + files[i];
if(!(flags & VPATH_NoFixify))
a = fileFixify(a);
@ -1324,7 +1323,8 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
continue;
}
QString local_dirstr = Option::fixPathToLocalOS(dirstr, true);
QStringList files = QDir(local_dirstr).entryList(QStringList(filestr));
QStringList files = QDir(local_dirstr).entryList(QStringList(filestr),
QDir::NoDotAndDotDot | QDir::AllEntries);
if (installConfigValues.contains("no_check_exist") && files.isEmpty()) {
QString dst_file = filePrefixRoot(root, dst_dir);
QString cmd;
@ -1346,8 +1346,6 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
}
for(int x = 0; x < files.count(); x++) {
QString file = files[x];
if(file == "." || file == "..") //blah
continue;
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + file, FileFixifyAbsolute, false))));
QFileInfo fi(fileInfo(dirstr + file));
QString dst_file = filePrefixRoot(root, fileFixify(dst_dir, FileFixifyAbsolute, false));
@ -3217,7 +3215,7 @@ MakefileGenerator::writePkgConfigFile()
QString prefix = pkgConfigPrefix();
QString libDir = project->first("QMAKE_PKGCONFIG_LIBDIR").toQString();
if(libDir.isEmpty())
libDir = prefix + Option::dir_sep + "lib" + Option::dir_sep;
libDir = prefix + "/lib";
QString includeDir = project->first("QMAKE_PKGCONFIG_INCDIR").toQString();
if(includeDir.isEmpty())
includeDir = prefix + "/include";
@ -3284,10 +3282,12 @@ MakefileGenerator::writePkgConfigFile()
// libs
t << "Libs: ";
QString pkgConfiglibDir;
QString pkgConfiglibName;
if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")) {
pkgConfiglibDir = "-F${libdir}";
if (libDir != QLatin1String("/System/Library/Frameworks")
&& libDir != QLatin1String("/Library/Frameworks")) {
t << "-F${libdir} ";
}
ProString bundle;
if (!project->isEmpty("QMAKE_FRAMEWORK_BUNDLE_NAME"))
bundle = unescapeFilePath(project->first("QMAKE_FRAMEWORK_BUNDLE_NAME"));
@ -3298,12 +3298,13 @@ MakefileGenerator::writePkgConfigFile()
bundle = bundle.left(suffix);
pkgConfiglibName = "-framework " + bundle + " ";
} else {
pkgConfiglibDir = "-L${libdir}";
if (!project->values("QMAKE_DEFAULT_LIBDIRS").contains(libDir))
t << "-L${libdir} ";
pkgConfiglibName = "-l" + unescapeFilePath(project->first("QMAKE_ORIG_TARGET"));
if (project->isActiveConfig("shared"))
pkgConfiglibName += project->first("TARGET_VERSION_EXT").toQString();
}
t << pkgConfiglibDir << " " << pkgConfiglibName << " \n";
t << pkgConfiglibName << " \n";
ProStringList libs;
if(!project->isEmpty("QMAKE_INTERNAL_PRL_LIBS")) {
@ -3327,7 +3328,10 @@ MakefileGenerator::writePkgConfigFile()
<< varGlue("PRL_EXPORT_CXXFLAGS", "", " ", " ")
<< varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
// << varGlue("DEFINES","-D"," -D"," ")
<< "-I${includedir}\n";
;
if (!project->values("QMAKE_DEFAULT_INCDIRS").contains(includeDir))
t << "-I${includedir}";
t << endl;
// requires
const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');

View File

@ -111,10 +111,8 @@ ProjectGenerator::init()
dir += Option::dir_sep;
if (Option::recursive) {
QStringList files = QDir(dir).entryList(QDir::Files);
for(int i = 0; i < (int)files.count(); i++) {
if(files[i] != "." && files[i] != "..")
dirs.append(dir + files[i] + QDir::separator() + builtin_regex);
}
for (int i = 0; i < files.count(); i++)
dirs.append(dir + files[i] + QDir::separator() + builtin_regex);
}
regex = builtin_regex;
} else {
@ -137,12 +135,9 @@ ProjectGenerator::init()
regex = regex.right(regex.length() - (s+1));
}
if (Option::recursive) {
QStringList entries = QDir(dir).entryList(QDir::Dirs);
for(int i = 0; i < (int)entries.count(); i++) {
if(entries[i] != "." && entries[i] != "..") {
dirs.append(dir + entries[i] + QDir::separator() + regex);
}
}
QStringList entries = QDir(dir).entryList(QDir::Dirs | QDir::NoDotAndDotDot);
for (int i = 0; i < entries.count(); i++)
dirs.append(dir + entries[i] + QDir::separator() + regex);
}
QStringList files = QDir(dir).entryList(QDir::nameFiltersFromString(regex));
for(int i = 0; i < (int)files.count(); i++) {
@ -186,16 +181,15 @@ ProjectGenerator::init()
nd += QDir::separator();
nd += profiles[i];
fileFixify(nd);
if(profiles[i] != "." && profiles[i] != ".." &&
!subdirs.contains(nd, Qt::CaseInsensitive) && !out_file.endsWith(nd))
if (!subdirs.contains(nd, Qt::CaseInsensitive) && !out_file.endsWith(nd))
subdirs.append(nd);
}
}
if (Option::recursive) {
QStringList dirs = QDir(newdir).entryList(QDir::Dirs);
QStringList dirs = QDir(newdir).entryList(QDir::Dirs | QDir::NoDotAndDotDot);
for(int i = 0; i < (int)dirs.count(); i++) {
QString nd = fileFixify(newdir + QDir::separator() + dirs[i]);
if(dirs[i] != "." && dirs[i] != ".." && !knownDirs.contains(nd, Qt::CaseInsensitive))
if (!knownDirs.contains(nd, Qt::CaseInsensitive))
knownDirs.append(nd);
}
}
@ -207,12 +201,13 @@ ProjectGenerator::init()
dir = regx.left(s+1);
regx = regx.right(regx.length() - (s+1));
}
QStringList files = QDir(dir).entryList(QDir::nameFiltersFromString(regx), QDir::Dirs);
QStringList files = QDir(dir).entryList(QDir::nameFiltersFromString(regx),
QDir::Dirs | QDir::NoDotAndDotDot);
ProStringList &subdirs = v["SUBDIRS"];
for(int i = 0; i < (int)files.count(); i++) {
QString newdir(dir + files[i]);
QFileInfo fi(fileInfo(newdir));
if(fi.fileName() != "." && fi.fileName() != "..") {
{
newdir = fileFixify(newdir);
if(exists(fi.filePath() + QDir::separator() + fi.fileName() + Option::pro_ext) &&
!subdirs.contains(newdir)) {

View File

@ -749,7 +749,9 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
target = "$(QMAKE_TARGET)";
} else if(project->first("TEMPLATE") == "lib") {
if(project->isEmpty("QMAKE_CYGWIN_SHLIB")) {
if(!project->isActiveConfig("staticlib") && !project->isActiveConfig("plugin")) {
if (!project->isActiveConfig("staticlib")
&& !project->isActiveConfig("plugin")
&& !project->isActiveConfig("unversioned_libname")) {
if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
links << "$(TARGET0)" << "$(TARGET1)" << "$(TARGET2)";
} else {

View File

@ -234,14 +234,15 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("QMAKE_BUNDLE")) {
t << "TARGETD = " << escapeFilePath(var("TARGET_x.y")) << endl;
t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "TARGETD = " << escapeFilePath(var("TARGET_x.y.z")) << endl;
t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl;
t << "TARGET1 = " << escapeFilePath(var("TARGET_x")) << endl;
t << "TARGET2 = " << escapeFilePath(var("TARGET_x.y")) << endl;
} else {
t << "TARGETD = " << escapeFilePath(var("TARGET_x")) << endl;
} else if (!project->isActiveConfig("unversioned_libname")) {
t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl;
if (project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "TARGETD = " << escapeFilePath(var("TARGET_x.y.z")) << endl;
t << "TARGET1 = " << escapeFilePath(var("TARGET_x")) << endl;
t << "TARGET2 = " << escapeFilePath(var("TARGET_x.y")) << endl;
} else {
t << "TARGETD = " << escapeFilePath(var("TARGET_x")) << endl;
}
}
}
writeExtraCompilerVariables(t);
@ -574,22 +575,36 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)\n\t"
<< var("QMAKE_LINK_SHLIB_CMD") << "\n\t";
t << varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET0)") << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET1)") << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET2)");
if(!destdir.isEmpty())
t << "\n\t";
if (!project->isActiveConfig("unversioned_libname"))
t << "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)";
else
t << "-$(DEL_FILE) $(TARGET)";
t << "\n\t" << var("QMAKE_LINK_SHLIB_CMD");
if (!project->isActiveConfig("unversioned_libname")) {
t << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET0)") << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET1)") << "\n\t"
<< varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET2)");
}
if (!destdir.isEmpty()) {
t << "\n\t"
<< "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t"
<< "-$(DEL_FILE) " << destdir << "$(TARGET0)\n\t"
<< "-$(DEL_FILE) " << destdir << "$(TARGET1)\n\t"
<< "-$(DEL_FILE) " << destdir << "$(TARGET2)\n\t"
<< "-$(MOVE) $(TARGET) " << destdir << " \n\t"
<< "-$(MOVE) $(TARGET0) " << destdir << " \n\t"
<< "-$(MOVE) $(TARGET1) " << destdir << " \n\t"
<< "-$(MOVE) $(TARGET2) " << destdir << " \n\t";
<< "-$(MOVE) $(TARGET) " << destdir << " ";
if (!project->isActiveConfig("unversioned_libname")) {
t << "\n\t"
<< "-$(DEL_FILE) " << destdir << "$(TARGET0)\n\t"
<< "-$(DEL_FILE) " << destdir << "$(TARGET1)\n\t"
<< "-$(DEL_FILE) " << destdir << "$(TARGET2)\n\t"
<< "-$(MOVE) $(TARGET0) " << destdir << " \n\t"
<< "-$(MOVE) $(TARGET1) " << destdir << " \n\t"
<< "-$(MOVE) $(TARGET2) " << destdir << " ";
}
}
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
t << endl << endl;
@ -924,8 +939,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty() &&
!project->isActiveConfig("plugin")) {
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n";
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
<< destdir << "$(TARGET2) $(TARGETA)\n";
if (!project->isActiveConfig("unversioned_libname")) {
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
<< destdir << "$(TARGET2) $(TARGETA)\n";
} else {
t << "\t-$(DEL_FILE) $(TARGETA)\n";
}
} else {
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n";
}
@ -1165,7 +1184,10 @@ void UnixMakefileGenerator::init2()
project->first("VER_MIN") + "." +
project->first("VER_PAT"));
}
project->values("TARGET") = project->values("TARGET_x.y.z");
if (project->isActiveConfig("unversioned_libname"))
project->values("TARGET") = project->values("TARGET_");
else
project->values("TARGET") = project->values("TARGET_x.y.z");
}
if(project->isEmpty("QMAKE_LN_SHLIB"))
project->values("QMAKE_LN_SHLIB").append("ln -s");

View File

@ -397,8 +397,8 @@ QString VcprojGenerator::retrievePlatformToolSet() const
return envVar;
QString suffix;
if (vcProject.Configuration.WinPhone)
suffix = "_wp80";
if (project->isActiveConfig("winphone"))
suffix = '_' + project->first("WINTARGET_VER").toQString().toLower();
else if (project->first("QMAKE_TARGET_OS") == "xp")
suffix = "_xp";

View File

@ -1064,10 +1064,18 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
evalError(fL1S("shell_path(path) requires one argument."));
} else {
QString rstr = args.at(0).toQString(m_tmp1);
if (m_dirSep.startsWith(QLatin1Char('\\')))
if (m_dirSep.startsWith(QLatin1Char('\\'))) {
rstr.replace(QLatin1Char('/'), QLatin1Char('\\'));
else
} else {
rstr.replace(QLatin1Char('\\'), QLatin1Char('/'));
#ifdef Q_OS_WIN
// Convert d:/foo/bar to msys-style /d/foo/bar.
if (rstr.length() > 2 && rstr.at(1) == QLatin1Char(':') && rstr.at(2) == QLatin1Char('/')) {
rstr[1] = rstr.at(0);
rstr[0] = QLatin1Char('/');
}
#endif
}
ret << (rstr.isSharedWith(m_tmp1) ? args.at(0) : ProString(rstr).setSource(args.at(0)));
}
break;

View File

@ -488,7 +488,7 @@ bool Option::postProcessProject(QMakeProject *project)
Option::dir_sep = project->dirSep().toQString();
if (Option::output_dir.startsWith(project->buildRoot()))
if (!project->buildRoot().isEmpty() && Option::output_dir.startsWith(project->buildRoot()))
Option::mkfile::cachefile_depth =
Option::output_dir.mid(project->buildRoot().length()).count('/');

View File

@ -87,7 +87,7 @@ INSTALLS += syncqt
# qtPrepareTool() to find the non-installed syncqt.
prefix_build|!equals(PWD, $$OUT_PWD) {
cmd = perl -w $$shell_path($$PWD/bin/syncqt.pl)
cmd = perl -w $$system_path($$PWD/bin/syncqt.pl)
TOOL_PRI = $$OUT_PWD/mkspecs/modules/qt_tool_syncqt.pri

View File

@ -40,6 +40,13 @@
#include "libEGL/Display.h"
#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
# include <dxgi1_3.h>
# include <wrl.h>
# include <windows.applicationmodel.core.h>
typedef ABI::Windows::Foundation::IEventHandler<ABI::Windows::ApplicationModel::SuspendingEventArgs *> SuspendEventHandler;
#endif
#ifdef _DEBUG
// this flag enables suppressing some spurious warnings that pop up in certain WebGL samples
// and conformance tests. to enable all warnings, remove this define.
@ -426,9 +433,49 @@ EGLint Renderer11::initialize()
}
}
#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
// Monitor when the application suspends so that Trim() can be called
Microsoft::WRL::ComPtr<ABI::Windows::ApplicationModel::Core::ICoreApplication> application;
result = RoGetActivationFactory(Microsoft::WRL::Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
IID_PPV_ARGS(&application));
if (FAILED(result))
{
ERR("Error obtaining CoreApplication: 0x%08X", result);
return EGL_NOT_INITIALIZED;
}
EventRegistrationToken cookie;
result = application->add_Suspending(Microsoft::WRL::Callback<SuspendEventHandler>(this, &Renderer11::onSuspend).Get(), &cookie);
if (FAILED(result))
{
ERR("Error setting suspend callback: 0x%08X", result);
return EGL_NOT_INITIALIZED;
}
#endif
return EGL_SUCCESS;
}
#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
HRESULT Renderer11::onSuspend(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *)
{
if (!mDevice)
return S_OK;
Microsoft::WRL::ComPtr<IDXGIDevice3> dxgiDevice;
HRESULT result = mDevice->QueryInterface(IID_PPV_ARGS(&dxgiDevice));
if (FAILED(result))
{
ERR("Error obtaining DXGIDevice3 on suspend: 0x%08X", result);
return S_OK;
}
dxgiDevice->Trim();
return S_OK;
}
#endif
// do any one-time device initialization
// NOTE: this is also needed after a device lost/reset
// to reset the scene status and ensure the default states are reset.

View File

@ -18,6 +18,17 @@
#include "libGLESv2/renderer/d3d11/InputLayoutCache.h"
#include "libGLESv2/renderer/RenderTarget.h"
#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
struct IInspectable;
namespace ABI {
namespace Windows {
namespace ApplicationModel {
struct ISuspendingEventArgs;
}
}
}
#endif
namespace gl
{
class Renderbuffer;
@ -202,6 +213,10 @@ class Renderer11 : public Renderer
RenderTarget *drawRenderTarget, bool wholeBufferCopy);
ID3D11Texture2D *resolveMultisampledTexture(ID3D11Texture2D *source, unsigned int subresource);
#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
HRESULT onSuspend(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *);
#endif
HMODULE mD3d11Module;
HMODULE mDxgiModule;

View File

@ -7,6 +7,9 @@ CONFIG += \
exceptions_off rtti_off
CONFIG -= qt
contains(QT_CONFIG, debug_and_release):CONFIG += debug_and_release
contains(QT_CONFIG, build_all):CONFIG += build_all
DESTDIR = $$QT_BUILD_TREE/lib
DEFINES += HAVE_CONFIG_H

View File

@ -0,0 +1,118 @@
From 158b7642c53843ed954fa667ff23b8746f95f8eb Mon Sep 17 00:00:00 2001
From: Andrew Knight <andrew.knight@digia.com>
Date: Tue, 22 Apr 2014 09:13:57 +0300
Subject: [PATCH] ANGLE WinRT: Call Trim() when application suspends
This is required by Windows Store Apps to pass certification.
Task-number: QTBUG-38481
Change-Id: I6dc00431ee5f6c7d4c64111ccc38f46483d3b9a8
---
.../src/libGLESv2/renderer/d3d11/Renderer11.cpp | 47 ++++++++++++++++++++++
.../src/libGLESv2/renderer/d3d11/Renderer11.h | 15 +++++++
2 files changed, 62 insertions(+)
diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/Renderer11.cpp b/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/Renderer11.cpp
index 2de477b..e70727c 100644
--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/Renderer11.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/Renderer11.cpp
@@ -40,6 +40,13 @@
#include "libEGL/Display.h"
+#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
+# include <dxgi1_3.h>
+# include <wrl.h>
+# include <windows.applicationmodel.core.h>
+typedef ABI::Windows::Foundation::IEventHandler<ABI::Windows::ApplicationModel::SuspendingEventArgs *> SuspendEventHandler;
+#endif
+
#ifdef _DEBUG
// this flag enables suppressing some spurious warnings that pop up in certain WebGL samples
// and conformance tests. to enable all warnings, remove this define.
@@ -426,9 +433,49 @@ EGLint Renderer11::initialize()
}
}
+#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
+ // Monitor when the application suspends so that Trim() can be called
+ Microsoft::WRL::ComPtr<ABI::Windows::ApplicationModel::Core::ICoreApplication> application;
+ result = RoGetActivationFactory(Microsoft::WRL::Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
+ IID_PPV_ARGS(&application));
+ if (FAILED(result))
+ {
+ ERR("Error obtaining CoreApplication: 0x%08X", result);
+ return EGL_NOT_INITIALIZED;
+ }
+
+ EventRegistrationToken cookie;
+ result = application->add_Suspending(Microsoft::WRL::Callback<SuspendEventHandler>(this, &Renderer11::onSuspend).Get(), &cookie);
+ if (FAILED(result))
+ {
+ ERR("Error setting suspend callback: 0x%08X", result);
+ return EGL_NOT_INITIALIZED;
+ }
+#endif
+
return EGL_SUCCESS;
}
+#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
+HRESULT Renderer11::onSuspend(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *)
+{
+ if (!mDevice)
+ return S_OK;
+
+ Microsoft::WRL::ComPtr<IDXGIDevice3> dxgiDevice;
+ HRESULT result = mDevice->QueryInterface(IID_PPV_ARGS(&dxgiDevice));
+ if (FAILED(result))
+ {
+ ERR("Error obtaining DXGIDevice3 on suspend: 0x%08X", result);
+ return S_OK;
+ }
+
+ dxgiDevice->Trim();
+
+ return S_OK;
+}
+#endif
+
// do any one-time device initialization
// NOTE: this is also needed after a device lost/reset
// to reset the scene status and ensure the default states are reset.
diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/Renderer11.h b/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/Renderer11.h
index a8a722c..773fc26 100644
--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/Renderer11.h
+++ b/src/3rdparty/angle/src/libGLESv2/renderer/d3d11/Renderer11.h
@@ -18,6 +18,17 @@
#include "libGLESv2/renderer/d3d11/InputLayoutCache.h"
#include "libGLESv2/renderer/RenderTarget.h"
+#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
+struct IInspectable;
+namespace ABI {
+ namespace Windows {
+ namespace ApplicationModel {
+ struct ISuspendingEventArgs;
+ }
+ }
+}
+#endif
+
namespace gl
{
class Renderbuffer;
@@ -202,6 +213,10 @@ class Renderer11 : public Renderer
RenderTarget *drawRenderTarget, bool wholeBufferCopy);
ID3D11Texture2D *resolveMultisampledTexture(ID3D11Texture2D *source, unsigned int subresource);
+#if defined(ANGLE_OS_WINRT) && !defined(ANGLE_OS_WINPHONE)
+ HRESULT onSuspend(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *);
+#endif
+
HMODULE mD3d11Module;
HMODULE mDxgiModule;
--
1.9.0.msysgit.0

View File

@ -253,8 +253,9 @@ QUnifiedTimer *QUnifiedTimer::instance()
void QUnifiedTimer::maybeUpdateAnimationsToCurrentTime()
{
if (time.elapsed() - lastTick > 50)
updateAnimationTimers(driver->elapsed());
qint64 elapsed = driver->elapsed();
if (elapsed - lastTick > 50)
updateAnimationTimers(elapsed);
}
void QUnifiedTimer::updateAnimationTimers(qint64 currentTick)
@ -263,7 +264,7 @@ void QUnifiedTimer::updateAnimationTimers(qint64 currentTick)
if(insideTick)
return;
qint64 totalElapsed = currentTick >= 0 ? currentTick : time.elapsed();
qint64 totalElapsed = currentTick >= 0 ? currentTick : driver->elapsed();
// ignore consistentTiming in case the pause timer is active
qint64 delta = (consistentTiming && !pauseTimer.isActive()) ?

View File

@ -52,6 +52,8 @@ QT_BEGIN_NAMESPACE
enum { Endian = 0, Data = 1 };
static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf };
#if defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSE2)
static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const ushort *&src, const ushort *end)
{
@ -187,9 +189,9 @@ QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::Conve
int invalid = 0;
if (state && !(state->flags & QTextCodec::IgnoreHeader)) {
// append UTF-8 BOM
*cursor++ = 0xef;
*cursor++ = 0xbb;
*cursor++ = 0xbf;
*cursor++ = utf8bom[0];
*cursor++ = utf8bom[1];
*cursor++ = utf8bom[2];
}
const ushort *nextAscii = src;
@ -240,19 +242,31 @@ QString QUtf8::convertToUnicode(const char *chars, int len)
const uchar *src = reinterpret_cast<const uchar *>(chars);
const uchar *end = src + len;
while (src < end) {
const uchar *nextAscii = end;
if (simdDecodeAscii(dst, nextAscii, src, end))
break;
// attempt to do a full decoding in SIMD
const uchar *nextAscii = end;
if (!simdDecodeAscii(dst, nextAscii, src, end)) {
// at least one non-ASCII entry
// check if we failed to decode the UTF-8 BOM; if so, skip it
if (Q_UNLIKELY(src == reinterpret_cast<const uchar *>(chars))
&& end - src >= 3
&& Q_UNLIKELY(src[0] == utf8bom[0] && src[1] == utf8bom[1] && src[2] == utf8bom[2])) {
src += 3;
}
do {
uchar b = *src++;
int res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, dst, src, end);
if (res < 0) {
// decoding error
*dst++ = QChar::ReplacementCharacter;
}
} while (src < nextAscii);
while (src < end) {
nextAscii = end;
if (simdDecodeAscii(dst, nextAscii, src, end))
break;
do {
uchar b = *src++;
int res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, dst, src, end);
if (res < 0) {
// decoding error
*dst++ = QChar::ReplacementCharacter;
}
} while (src < nextAscii);
}
}
result.truncate(dst - reinterpret_cast<const ushort *>(result.constData()));

View File

@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
depends += qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtqml qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
headerdirs += ..

View File

@ -43,7 +43,7 @@ CONFIG += release
#! [3]
#! [4]
CONFIG += qpa_minimal_plugin
QTPLUGIN.platforms = qminimal
#! [4]
#! [5]
@ -53,7 +53,7 @@ QTPLUGIN += qjpeg \
#! [5]
#! [6]
CONFIG -= import_qpa_plugin
QTPLUGIN.platforms = -
#! [6]
#! [7]

View File

@ -77,7 +77,7 @@ QRegExp mark("\\b" // word boundary
QRegExp rx("^\\d\\d?$"); // match integers 0 to 99
rx.indexIn("123"); // returns -1 (no match)
rx.indexIn("-6"); // returns -1 (no match)
rx.indexIn("6"); // returns 0 (matched as position 0)
rx.indexIn("6"); // returns 0 (matched at position 0)
//! [4]

View File

@ -234,7 +234,7 @@
application is to compile it into a dynamic library that is shipped
separately, and detected and loaded at runtime.
Plugins can be linked statically against your application. If you
Plugins can be linked statically into your application. If you
build the static version of Qt, this is the only option for
including Qt's predefined plugins. Using static plugins makes the
deployment less error-prone, but has the disadvantage that no
@ -253,7 +253,8 @@
\row \li \c qico \li Image formats \li ICO
\row \li \c qsvg \li Image formats \li SVG
\row \li \c qtiff \li Image formats \li TIFF
\row \li \c qsqldb2 \li SQL driver \li IBM DB2 \row \li \c qsqlibase \li SQL driver \li Borland InterBase
\row \li \c qsqldb2 \li SQL driver \li IBM DB2
\row \li \c qsqlibase \li SQL driver \li Borland InterBase
\row \li \c qsqlite \li SQL driver \li SQLite version 3
\row \li \c qsqlite2 \li SQL driver \li SQLite version 2
\row \li \c qsqlmysql \li SQL driver \li MySQL
@ -263,22 +264,48 @@
\row \li \c qsqltds \li SQL driver \li Sybase Adaptive Server (TDS)
\endtable
To link statically against those plugins, you need to add
To link those plugins statically, you need to add
the required plugins to your build using \c QTPLUGIN.
Q_IMPORT_PLUGIN() macros are also needed in application code,
but those are automatically generated by qmake and added to
your application project.
In the \c .pro file for your application, you need the following
entry:
\snippet code/doc_src_plugins-howto.pro 5
qmake automatically adds the plugins to QTPLUGIN that are typically
needed by the used Qt modules (see \c QT), while more specialized
plugins need to be added manually.
The default list of automatically added plugins can be overridden
per type.
For example, to link the minimal plugin instead of the default Qt
platform adaptation plugin, use:
\snippet code/doc_src_plugins-howto.pro 4
If you want neither the default nor the minimal QPA plugin to be
linked automatically, use:
\snippet code/doc_src_plugins-howto.pro 6
The defaults are tuned towards an optimal out-of-the-box experience,
but may unnecessarily bloat the application.
It is recommended to inspect the linker command line built by qmake
and eliminate unnecessary plugins.
\section2 Details of Linking Static Plugins
To cause static plugins actually being linked and instantiated,
Q_IMPORT_PLUGIN() macros are also needed in application code,
but those are automatically generated by qmake and added to
your application project.
If you do not want all plugins added to QTPLUGIN to be automatically
linked, remove \c import_plugins from the \c CONFIG variable:
\snippet code/doc_src_plugins-howto.pro 7
\section2 Creating Static Plugins
It is also possible to create your own static plugins, by
following these steps:
@ -297,17 +324,6 @@
to make sure that the \c{QT_STATICPLUGIN} preprocessor macro is
defined.
The default Qt platform adaptation plugin is automatically added to QTPLUGIN
in static builds. If you want to add the minimal plugin instead, add \c qpa_minimal_plugin
to \c CONFIG:
\snippet code/doc_src_plugins-howto.pro 4
If you want neither the default nor the minimal QPA plugin to be linked automatically,
remove \c import_qpa_plugin from \c CONFIG:
\snippet code/doc_src_plugins-howto.pro 6
\section1 Deploying and Debugging Plugins
The \l{Deploying Plugins} document covers the process of deploying

View File

@ -844,21 +844,28 @@
#endif /* Q_CC_MSVC */
#ifdef __cplusplus
# include <utility>
# if defined(Q_OS_QNX)
# include <utility>
# if defined(_YVALS) || defined(_LIBCPP_VER)
// QNX: libcpp (Dinkumware-based) doesn't have the <initializer_list>
// header, so the feature is useless, even if the compiler supports
// it. Disable.
# ifdef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_INITIALIZER_LISTS
# endif
# ifdef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_RVALUE_REFS
# endif
# undef Q_COMPILER_INITIALIZER_LISTS
// That libcpp doesn't have std::move either, so disable everything
// related to rvalue refs.
# undef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_REF_QUALIFIERS
# endif
# endif // Q_OS_QNX
# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \
&& ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
// Mac OS X: Apple has not updated libstdc++ since 2007, which means it does not have
// <initializer_list> or std::move. Let's disable these features
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_REF_QUALIFIERS
# endif
#endif // Q_OS_QNX
#endif
/*
* C++11 keywords and expressions

View File

@ -58,7 +58,10 @@
#if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE)
#include <QtCore/qconfig.h>
#include <QtCore/qfeatures.h>
#endif
#define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE))
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
# define QT_NO_UNSHARABLE_CONTAINERS
#endif
/* These two macros makes it possible to turn the builtin line expander into a

View File

@ -1207,6 +1207,23 @@ static void android_default_message_handler(QtMsgType type,
static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context,
const QString &buf)
{
// to determine logging destination and marking logging environment variable as deprecated
// ### remove when deprecated
struct LogDestination {
LogDestination(const char *deprecated, bool forceConsole) {
const char* replacement = "QT_LOGGING_TO_CONSOLE";
bool newEnv = qEnvironmentVariableIsSet(replacement);
bool oldEnv = qEnvironmentVariableIsSet(deprecated);
if (oldEnv && !newEnv && !forceConsole) {
fprintf(stderr, "Warning: Environment variable %s is deprecated, "
"use %s instead.\n", deprecated, replacement);
fflush(stderr);
}
toConsole = newEnv || oldEnv || forceConsole;
}
bool toConsole;
};
QString logMessage = qMessageFormatString(type, context, buf);
#if defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB)
@ -1217,12 +1234,19 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
#endif // Q_OS_WIN
#if defined(QT_USE_SLOG2)
slog2_default_handler(type, logMessage.toLocal8Bit().constData());
static const bool logToConsole = qEnvironmentVariableIsSet("QT_LOGGING_TO_CONSOLE");
if (!logToConsole) {
slog2_default_handler(type, logMessage.toLocal8Bit().constData());
} else {
fprintf(stderr, "%s", logMessage.toLocal8Bit().constData());
fflush(stderr);
}
#elif defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)
// We use isatty to catch the obvious case of someone running something interactively.
// We also support an environment variable for Qt Creator use, or more complicated cases like subprocesses.
static bool logToConsole = isatty(fileno(stdin)) || !qEnvironmentVariableIsEmpty("QT_NO_JOURNALD_LOG");
if (Q_LIKELY(!logToConsole)) {
// We also support environment variables for Qt Creator use, or more complicated cases
// like subprocesses.
static const LogDestination logdest("QT_NO_JOURNALD_LOG", isatty(fileno(stdin)));
if (Q_LIKELY(!logdest.toConsole)) {
// remove trailing \n, systemd appears to want them newline-less
logMessage.chop(1);
systemd_default_message_handler(type, context, logMessage);
@ -1231,8 +1255,8 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
fflush(stderr);
}
#elif defined(Q_OS_ANDROID)
static bool logToAndroid = qEnvironmentVariableIsEmpty("QT_ANDROID_PLAIN_LOG");
if (logToAndroid) {
static const LogDestination logdest("QT_ANDROID_PLAIN_LOG", false);
if (!logdest.toConsole) {
android_default_message_handler(type, context, logMessage);
} else {
fprintf(stderr, "%s", logMessage.toLocal8Bit().constData());

View File

@ -139,10 +139,9 @@ void QFileDevicePrivate::setError(QFileDevice::FileError err, int errNum)
are returned and on Windows the rights of the current user are
returned. This behavior might change in a future Qt version.
Note that Qt does not by default check for permissions on NTFS
file systems, as this may decrease the performance of file
handling considerably. It is possible to force permission checking
on NTFS by including the following code in your source:
\note On NTFS file systems, ownership and permissions checking is
disabled by default for performance reasons. To enable it,
include the following line:
\snippet ntfsp.cpp 0

View File

@ -271,6 +271,17 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
groupId(). You can examine a file's permissions and ownership in a
single statement using the permission() function.
\note On NTFS file systems, ownership and permissions checking is
disabled by default for performance reasons. To enable it,
include the following line:
\snippet ntfsp.cpp 0
Permission checking is then turned on and off by incrementing and
decrementing \c qt_ntfs_permission_lookup by 1.
\snippet ntfsp.cpp 1
\section1 Performance Issues
Some of QFileInfo's functions query the file system, but for

View File

@ -224,7 +224,7 @@ bool QFileSystemEngine::fillMetaData(int fd, QFileSystemMetaData &data)
return false;
}
#if defined(Q_OS_QNX)
#if defined(QT_EXT_QNX_READDIR_R)
static void fillStat64fromStat32(struct stat64 *statBuf64, const struct stat &statBuf32)
{
statBuf64->st_mode = statBuf32.st_mode;
@ -289,7 +289,7 @@ void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
void QFileSystemMetaData::fillFromDirEnt(const QT_DIRENT &entry)
{
#if defined(Q_OS_QNX)
#if defined(QT_EXT_QNX_READDIR_R)
knownFlagsMask = 0;
entryFlags = 0;
for (dirent_extra *extra = _DEXTRA_FIRST(&entry); _DEXTRA_VALID(extra, &entry);

View File

@ -95,10 +95,10 @@ private:
#else
QT_DIR *dir;
QT_DIRENT *dirEntry;
#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) || defined(QT_EXT_QNX_READDIR_R)
// for readdir_r
QScopedPointer<QT_DIRENT, QScopedPointerPodDeleter> mt_file;
#if defined(Q_OS_QNX) && defined(__EXT_QNX__READDIR_R)
#if defined(QT_EXT_QNX_READDIR_R)
// for _readdir_r
size_t direntSize;
#endif

View File

@ -70,7 +70,7 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
if (!nativePath.endsWith('/'))
nativePath.append('/');
#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) || defined(QT_EXT_QNX_READDIR_R)
// ### Race condition; we should use fpathconf and dirfd().
size_t maxPathName = ::pathconf(nativePath.constData(), _PC_NAME_MAX);
if (maxPathName == size_t(-1))
@ -81,13 +81,14 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
Q_CHECK_PTR(p);
mt_file.reset(p);
#if defined(Q_OS_QNX) && defined(__EXT_QNX__READDIR_R)
#if defined(QT_EXT_QNX_READDIR_R)
direntSize = maxPathName;
// Include extra stat information in the readdir() call (d_stat member of dirent_extra_stat).
// This is used in QFileSystemMetaData::fillFromDirEnt() to avoid extra stat() calls when iterating
// over directories
if (dircntl(dir, D_SETFLAG, D_FLAG_STAT) == -1)
// Include extra stat information in the readdir() call (d_stat member of
// dirent_extra_stat). This is used in QFileSystemMetaData::fillFromDirEnt() to
// avoid extra stat() calls when iterating over directories
int flags = dircntl(dir, D_GETFLAG) | D_FLAG_STAT | D_FLAG_FILTER;
if (dircntl(dir, D_SETFLAG, flags) == -1)
lastError = errno;
#endif
#endif
@ -105,7 +106,7 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa
if (!dir)
return false;
#if defined(Q_OS_QNX) && defined(QT_EXT_QNX_READDIR_R)
#if defined(QT_EXT_QNX_READDIR_R)
lastError = QT_EXT_QNX_READDIR_R(dir, mt_file.data(), &dirEntry, direntSize);
if (lastError)
return false;

View File

@ -65,14 +65,16 @@ QStringList QPollingFileSystemWatcherEngine::addPaths(const QStringList &paths,
if (!fi.exists())
continue;
if (fi.isDir()) {
if (!directories->contains(path))
directories->append(path);
if (directories->contains(path))
continue;
directories->append(path);
if (!path.endsWith(QLatin1Char('/')))
fi = QFileInfo(path + QLatin1Char('/'));
this->directories.insert(path, fi);
} else {
if (!files->contains(path))
files->append(path);
if (files->contains(path))
continue;
files->append(path);
this->files.insert(path, fi);
}
it.remove();

View File

@ -318,6 +318,7 @@ bool QWindowsPipeReader::waitForPipeClosed(int msecs)
QElapsedTimer stopWatch;
stopWatch.start();
forever {
waitForReadyRead(0);
checkPipeState();
if (pipeBroken)
return true;

View File

@ -40,7 +40,6 @@
****************************************************************************/
#include "qwindowspipewriter_p.h"
#include <string.h>
QT_BEGIN_NAMESPACE

View File

@ -303,88 +303,4 @@ const qreal qt_sine_table[QT_SINE_TABLE_SIZE] = {
qreal(-0.024541228522912448)
};
/*!
\headerfile <QtMath>
\title Generic Math Declarations
\ingroup funclists
\brief The <QtMath> header file includes generic math declarations.
These functions are partly convenience definitions for basic
operations, for instance not available in the Standard Template Library et
al.
*/
/*!
\fn float qDegreesToRadians(float degrees)
\relates <QtMath>
\since 5.1
\brief The function converts the \a degrees in float to radians.
The purpose of the function is to aid the conversion as such a convenient
function is not part of the Standard Template Library, i.e. in <cmath> or
elsewhere.
Example:
\snippet code/src_corelib_kernel_qmath.cpp 0
\sa qRadiansToDegrees()
*/
/*!
\fn double qDegreesToRadians(double degrees)
\relates <QtMath>
\since 5.1
\brief The function converts the \a degrees in double to radians.
The purpose of the function is to aid the conversion as such a convenient
function is not part of the Standard Template Library, i.e. in <cmath> or
elsewhere.
Example:
\snippet code/src_corelib_kernel_qmath.cpp 1
\sa qRadiansToDegrees()
*/
/*!
\fn float qRadiansToDegrees(float radians)
\relates <QtMath>
\since 5.1
\brief The function converts the \a radians in float to degrees.
The purpose of the function is to aid the conversion as such a convenient
function is not part of the Standard Template Library, i.e. in <cmath> or
elsewhere.
Example:
\snippet code/src_corelib_kernel_qmath.cpp 2
\sa qDegreesToRadians()
*/
/*!
\fn double qRadiansToDegrees(double radians)
\relates <QtMath>
\since 5.1
\brief The function converts the \a radians in double to degrees.
The purpose of the function is to aid the conversion as such a convenient
function is not part of the Standard Template Library, i.e. in <cmath> or
elsewhere.
Example:
\snippet code/src_corelib_kernel_qmath.cpp 3
\sa qDegreesToRadians()
*/
QT_END_NAMESPACE

View File

@ -26,10 +26,15 @@
****************************************************************************/
/*!
\headerfile <QtCore/qmath.h>
\title Math Functions
\headerfile <QtMath>
\title Generic Math Functions
\ingroup funclists
\brief The <QtCore/qmath.h> header provides various math functions.
\brief The <QtMath> header file provides various math functions.
These functions are partly convenience definitions for basic math operations
not available in the C or Standard Template Libraries.
\pagekeywords math trigonometry qmath floor ceiling absolute sine cosine tangent inverse tan exponent power natural logarithm
*/
@ -40,7 +45,7 @@
The ceiling is the smallest integer that is not less than \a v.
For example, if \a v is 41.2, then the ceiling is 42.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qFloor()
*/
@ -51,7 +56,7 @@
The floor is the largest integer that is not greater than \a v.
For example, if \a v is 41.2, then the floor is 41.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qCeil()
*/
@ -59,14 +64,14 @@
\fn qreal qFabs(qreal v)
Returns the absolute value of \a v as a qreal.
\relates <QtCore/qmath.h>
\relates <QtMath>
*/
/*!
\fn qreal qSin(qreal v)
Returns the sine of the angle \a v in radians.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qCos(), qTan()
*/
@ -74,7 +79,7 @@
\fn qreal qCos(qreal v)
Returns the cosine of an angle \a v in radians.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qSin(), qTan()
*/
@ -82,7 +87,7 @@
\fn qreal qTan(qreal v)
Returns the tangent of an angle \a v in radians.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qSin(), qCos()
*/
@ -91,7 +96,7 @@
Returns the arccosine of \a v as an angle in radians.
Arccosine is the inverse operation of cosine.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qAtan(), qAsin(), qCos()
*/
@ -100,7 +105,7 @@
Returns the arcsine of \a v as an angle in radians.
Arcsine is the inverse operation of sine.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qSin(), qAtan(), qAcos()
*/
@ -109,7 +114,7 @@
Returns the arctangent of \a v as an angle in radians.
Arctangent is the inverse operation of tangent.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qTan(), qAcos(), qAsin()
*/
@ -118,7 +123,7 @@
Returns the arctangent of a point specified by the coordinates \a y and \a x.
This function will return the angle (argument) of that point.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qAtan()
*/
@ -127,7 +132,7 @@
Returns the square root of \a v.
This function returns a NaN if \a v is a negative number.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qPow()
*/
@ -135,7 +140,7 @@
\fn qreal qLn(qreal v)
Returns the natural logarithm of \a v. Natural logarithm uses base e.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qExp()
*/
@ -143,7 +148,7 @@
\fn qreal qExp(qreal v)
Returns the exponential function of \c e to the power of \a v.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qLn()
*/
@ -152,6 +157,62 @@
Returns the value of \a x raised to the power of \a y.
That is, \a x is the base and \a y is the exponent.
\relates <QtCore/qmath.h>
\relates <QtMath>
\sa qSqrt()
*/
/*!
\fn float qDegreesToRadians(float degrees)
\relates <QtMath>
\since 5.1
This function converts the \a degrees in float to radians.
Example:
\snippet code/src_corelib_kernel_qmath.cpp 0
\sa qRadiansToDegrees()
*/
/*!
\fn double qDegreesToRadians(double degrees)
\relates <QtMath>
\since 5.1
This function converts the \a degrees in double to radians.
Example:
\snippet code/src_corelib_kernel_qmath.cpp 1
\sa qRadiansToDegrees()
*/
/*!
\fn float qRadiansToDegrees(float radians)
\relates <QtMath>
\since 5.1
This function converts the \a radians in float to degrees.
Example:
\snippet code/src_corelib_kernel_qmath.cpp 2
\sa qDegreesToRadians()
*/
/*!
\fn double qRadiansToDegrees(double radians)
\relates <QtMath>
\since 5.1
This function converts the \a radians in double to degrees.
Example:
\snippet code/src_corelib_kernel_qmath.cpp 3
\sa qDegreesToRadians()
*/

View File

@ -4071,18 +4071,21 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
\macro Q_CLASSINFO(Name, Value)
\relates QObject
This macro associates extra information to the class, which is
available using QObject::metaObject(). Except for the ActiveQt
extension, Qt doesn't use this information.
This macro associates extra information to the class, which is available
using QObject::metaObject(). Qt makes only limited use of this feature, in
the \l{Active Qt}, \l{Qt D-Bus} and \l{Qt QML} modules.
The extra information takes the form of a \a Name string and a \a
Value literal string.
The extra information takes the form of a \a Name string and a \a Value
literal string.
Example:
\snippet code/src_corelib_kernel_qobject.cpp 35
\sa QMetaObject::classInfo()
\sa QAxFactory
\sa {Using Qt D-Bus Adaptors}
\sa {Extending QML - Default Property Example}
*/
/*!
@ -4441,6 +4444,8 @@ void qDeleteInEventHandler(QObject *o)
\snippet code/src_corelib_kernel_qobject.cpp 46
The connection will automatically disconnect if the sender is destroyed.
However, you should take care that any objects used within the functor
are still alive when the signal is emitted.
\note If the compiler does not support C++11 variadic templates, the number
of arguments in the signal or slot are limited to 6, and the functor object
@ -4478,6 +4483,8 @@ void qDeleteInEventHandler(QObject *o)
The connection will automatically disconnect if the sender or the context
is destroyed.
However, you should take care that any objects used within the functor
are still alive when the signal is emitted.
\note If the compiler does not support C++11 variadic templates, the number
of arguments in the signal or slot are limited to 6, and the functor object

View File

@ -549,7 +549,7 @@ template <class T> inline const char * qobject_interface_iid()
Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
#endif
class Q_CORE_EXPORT QSignalBlocker
class QSignalBlocker
{
public:
inline explicit QSignalBlocker(QObject *o);

View File

@ -465,6 +465,12 @@ QTranslator::~QTranslator()
\li \c /opt/foolib/foo.qm
\li \c /opt/foolib/foo
\endlist
Usually, it is better to use the QTranslator::load(const QLocale &,
const QString &, const QString &, const QString &, const QString &)
function instead, because it uses \l{QLocale::uiLanguages()} and not simply
the locale name, which refers to the formatting of dates and numbers and not
necessarily the UI language.
*/
bool QTranslator::load(const QString & filename, const QString & directory,

View File

@ -63,6 +63,7 @@
#include <qt_windows.h>
#ifdef Q_OS_WINRT
#include <qelapsedtimer.h>
#include <thread>
#endif
@ -680,21 +681,11 @@ bool QThread::wait(unsigned long time)
break;
}
#else // !Q_OS_WINRT
if (d->handle->joinable()) {
HANDLE handle = d->handle->native_handle();
switch (WaitForSingleObjectEx(handle, time, FALSE)) {
case WAIT_OBJECT_0:
ret = true;
d->handle->join();
break;
case WAIT_FAILED:
qErrnoWarning("QThread::wait: WaitForSingleObjectEx() failed");
break;
case WAIT_ABANDONED:
case WAIT_TIMEOUT:
default:
break;
}
if (!d->finished) {
QElapsedTimer timer;
timer.start();
while (timer.elapsed() < time && !d->finished)
yieldCurrentThread();
}
#endif // Q_OS_WINRT

View File

@ -75,10 +75,13 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
&& !(alignment & (alignment - 1)));
// Don't allocate empty headers
if (!(options & RawData) && !capacity)
return !(options & Unsharable)
? const_cast<QArrayData *>(&qt_array_empty)
: const_cast<QArrayData *>(&qt_array_unsharable_empty);
if (!(options & RawData) && !capacity) {
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (options & Unsharable)
return const_cast<QArrayData *>(&qt_array_unsharable_empty);
#endif
return const_cast<QArrayData *>(&qt_array_empty);
}
size_t headerSize = sizeof(QArrayData);
@ -118,8 +121,10 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize,
&& !(alignment & (alignment - 1)));
Q_UNUSED(objectSize) Q_UNUSED(alignment)
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (data == &qt_array_unsharable_empty)
return;
#endif
Q_ASSERT_X(!data->ref.isStatic(), "QArrayData::deallocate", "Static data can not be deleted");
::free(data);

View File

@ -80,7 +80,9 @@ struct Q_CORE_EXPORT QArrayData
enum AllocationOption {
CapacityReserved = 0x1,
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
Unsharable = 0x2,
#endif
RawData = 0x4,
Grow = 0x8,
@ -99,8 +101,10 @@ struct Q_CORE_EXPORT QArrayData
AllocationOptions detachFlags() const
{
AllocationOptions result;
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (!ref.isSharable())
result |= Unsharable;
#endif
if (capacityReserved)
result |= CapacityReserved;
return result;

View File

@ -134,6 +134,7 @@ public:
return (!d->isMutable() || d->ref.isShared());
}
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
void setSharable(bool sharable)
{
if (needsDetach()) {
@ -147,6 +148,9 @@ public:
}
}
bool isSharable() const { return d->isSharable(); }
#endif
void swap(QArrayDataPointer &other)
{
qSwap(d, other.d);

View File

@ -358,6 +358,9 @@ public:
case QChar::Joining_Causing: return QChar::Center;
case QChar::Joining_Dual: return QChar::Dual;
case QChar::Joining_Right: return QChar::Right;
case QChar::Joining_None:
case QChar::Joining_Left:
case QChar::Joining_Transparent:
default: return QChar::OtherJoining;
}
}

View File

@ -205,6 +205,11 @@ QLocale QCollator::locale() const
By default this mode is off.
\note On Windows, this functionality makes use of the \l{ICU} library. If Qt was
compiled without ICU support, it falls back to code using native Windows API,
which only works from Windows 7 onwards. On older versions of Windows, it will not work
and a warning will be emitted at runtime.
\sa numericMode()
*/

View File

@ -104,7 +104,9 @@ public:
inline void detach() { if (d->ref.load() != 1) detach_helper(); }
inline bool isDetached() const { return d->ref.load() == 1; }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
#endif
QContiguousCache<T> &operator=(const QContiguousCache<T> &other);
#ifdef Q_COMPILER_RVALUE_REFS

View File

@ -326,7 +326,9 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QHashData::shared_null) d->sharable = sharable; }
#endif
inline bool isSharedWith(const QHash<Key, T> &other) const { return d == other.d; }
void clear();

View File

@ -106,7 +106,9 @@ public:
inline void detach()
{ if (d->ref.isShared()) detach_helper2(this->e); }
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QLinkedListData::shared_null) d->sharable = sharable; }
#endif
inline bool isSharedWith(const QLinkedList<T> &other) const { return d == other.d; }
inline bool isEmpty() const { return d->size == 0; }

View File

@ -146,6 +146,7 @@ public:
}
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
@ -155,6 +156,7 @@ public:
if (d != &QListData::shared_null)
d->ref.setSharable(sharable);
}
#endif
inline bool isSharedWith(const QList<T> &other) const { return d == other.d; }
inline bool isEmpty() const { return p.isEmpty(); }

View File

@ -377,6 +377,7 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
@ -386,6 +387,7 @@ public:
// Don't call on shared_null
d->ref.setSharable(sharable);
}
#endif
inline bool isSharedWith(const QMap<Key, T> &other) const { return d == other.d; }
void clear();

View File

@ -55,8 +55,10 @@ class RefCount
public:
inline bool ref() Q_DECL_NOTHROW {
int count = atomic.load();
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
#endif
if (count != -1) // !isStatic
atomic.ref();
return true;
@ -64,13 +66,16 @@ public:
inline bool deref() Q_DECL_NOTHROW {
int count = atomic.load();
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
#endif
if (count == -1) // isStatic
return true;
return atomic.deref();
}
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
bool setSharable(bool sharable) Q_DECL_NOTHROW
{
Q_ASSERT(!isShared());
@ -80,17 +85,18 @@ public:
return atomic.testAndSetRelaxed(1, 0);
}
bool isStatic() const Q_DECL_NOTHROW
{
// Persistent object, never deleted
return atomic.load() == -1;
}
bool isSharable() const Q_DECL_NOTHROW
{
// Sharable === Shared ownership.
return atomic.load() != 0;
}
#endif
bool isStatic() const Q_DECL_NOTHROW
{
// Persistent object, never deleted
return atomic.load() == -1;
}
bool isShared() const Q_DECL_NOTHROW
{

View File

@ -388,7 +388,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
Note: Quantifiers are normally "greedy". They always match as much
text as they can. For example, \b{0+} matches the first zero it
finds and all the consecutive zeros after the first zero. Applied
to '20005', it matches'2\underline{000}5'. Quantifiers can be made
to '20005', it matches '2\underline{000}5'. Quantifiers can be made
non-greedy, see setMinimal().
\target capturing parentheses
@ -678,7 +678,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
QRegExp can match case insensitively using setCaseSensitivity(),
and can use non-greedy matching, see setMinimal(). By
default QRegExp uses full regexps but this can be changed with
setWildcard(). Searching can be forward with indexIn() or backward
setPatternSyntax(). Searching can be done forward with indexIn() or backward
with lastIndexIn(). Captured text can be accessed using
capturedTexts() which returns a string list of all captured
strings, or using cap() which returns the captured string for the

View File

@ -91,7 +91,9 @@ public:
inline void detach() { q_hash.detach(); }
inline bool isDetached() const { return q_hash.isDetached(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { q_hash.setSharable(sharable); }
#endif
inline void clear() { q_hash.clear(); }

View File

@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
width and height can be swapped using the transpose() function.
The isValid() function determines if a size is valid (a valid size
has both width and height greater than zero). The isEmpty()
has both width and height greater than or equal to zero). The isEmpty()
function returns \c true if either of the width and height is less
than, or equal to, zero, while the isNull() function returns \c true
only if both the width and the height is zero.

View File

@ -4331,14 +4331,6 @@ QByteArray QString::toLocal8Bit_helper(const QChar *data, int size)
UTF-8 is a Unicode codec and can represent all characters in a Unicode
string like QString.
However, in the Unicode range, there are certain codepoints that are not
considered characters. The Unicode standard reserves the last two
codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF,
U+2FFFE, etc.), as well as 32 codepoints in the range U+FDD0..U+FDEF,
inclusive, as non-characters. If any of those appear in the string, they
may be discarded and will not appear in the UTF-8 representation, or they
may be replaced by one or more replacement characters.
\sa fromUtf8(), toLatin1(), toLocal8Bit(), QTextCodec
*/
@ -4493,10 +4485,10 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
sequences, non-characters, overlong sequences or surrogate codepoints
encoded into UTF-8.
Non-characters are codepoints that the Unicode standard reserves and must
not be used in text interchange. They are the last two codepoints in each
Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, etc.), as well
as 32 codepoints in the range U+FDD0..U+FDEF, inclusive.
This function can be used to process incoming data incrementally as long as
all UTF-8 characters are terminated within the incoming data. Any
unterminated characters at the end of the string will be replaced or
suppressed. In order to do stateful decoding, please use \l QTextDecoder.
\sa toUtf8(), fromLatin1(), fromLocal8Bit()
*/
@ -9517,14 +9509,6 @@ QByteArray QStringRef::toLocal8Bit() const
UTF-8 is a Unicode codec and can represent all characters in a Unicode
string like QString.
However, in the Unicode range, there are certain codepoints that are not
considered characters. The Unicode standard reserves the last two
codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF,
U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF,
inclusive, as non-characters. If any of those appear in the string, they
may be discarded and will not appear in the UTF-8 representation, or they
may be replaced by one or more replacement characters.
\sa toLatin1(), toLocal8Bit(), QTextCodec
*/
QByteArray QStringRef::toUtf8() const

View File

@ -954,6 +954,9 @@ public:
case QChar::Joining_Causing: return QChar::Center;
case QChar::Joining_Dual: return QChar::Dual;
case QChar::Joining_Right: return QChar::Right;
case QChar::Joining_None:
case QChar::Joining_Left:
case QChar::Joining_Transparent:
default: return QChar::OtherJoining;
}
}

View File

@ -417,6 +417,13 @@ QTimeZone::~QTimeZone()
{
}
/*!
\fn QTimeZone::swap(QTimeZone &other)
Swaps this time zone instance with \a other. This function is very
fast and never fails.
*/
/*!
Assignment operator, assign \a other to this.
*/

View File

@ -667,7 +667,7 @@ Q_CORE_EXPORT void initCharAttributes(const ushort *string, int length,
// ----------------------------------------------------------------------------
//
// The Unicode script property. See http://www.unicode.org/reports/tr24/ (some very old version)
// The Unicode script property. See http://www.unicode.org/reports/tr24/tr24-21.html
//
// ----------------------------------------------------------------------------
@ -689,15 +689,36 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts)
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ucs4);
if (Q_LIKELY(prop->script == script || prop->script == QChar::Script_Inherited))
if (Q_LIKELY(prop->script == script || prop->script <= QChar::Script_Inherited))
continue;
// Never break between a combining mark (gc= Mc, Mn or Me) and its base character.
// Thus, a combining mark — whatever its script property value is — should inherit
// the script property value of its base character.
static const int test = (FLAG(QChar::Mark_NonSpacing) | FLAG(QChar::Mark_SpacingCombining) | FLAG(QChar::Mark_Enclosing));
if (Q_UNLIKELY(FLAG(prop->category) & test))
continue;
if (Q_UNLIKELY(FLAG(prop->category) & test)) {
// In cases where the base character itself has the Common script property value,
// and it is followed by one or more combining marks with a specific script property value,
// it may be even better for processing to let the base acquire the script property value
// from the first mark. This approach can be generalized by treating all the characters
// of a combining character sequence as having the script property value
// of the first non-Inherited, non-Common character in the sequence if there is one,
// and otherwise treating all the characters as having the Common script property value.
if (Q_LIKELY(script > QChar::Script_Common || prop->script <= QChar::Script_Common))
continue;
script = QChar::Script(prop->script);
}
if (Q_LIKELY(script != QChar::Script_Common)) {
// override preceding Common-s
while (sor > 0 && scripts[sor - 1] == QChar::Script_Common)
--sor;
} else {
// see if we are inheriting preceding run
if (sor > 0)
script = scripts[sor - 1];
}
while (sor < eor)
scripts[sor++] = script;
@ -705,6 +726,15 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts)
script = prop->script;
}
eor = length;
if (Q_LIKELY(script != QChar::Script_Common)) {
// override preceding Common-s
while (sor > 0 && scripts[sor - 1] == QChar::Script_Common)
--sor;
} else {
// see if we are inheriting preceding run
if (sor > 0)
script = scripts[sor - 1];
}
while (sor < eor)
scripts[sor++] = script;
}

View File

@ -107,6 +107,7 @@ public:
inline void detach();
inline bool isDetached() const { return !d->ref.isShared(); }
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
@ -122,6 +123,7 @@ public:
}
Q_ASSERT(d->ref.isSharable() == sharable);
}
#endif
inline bool isSharedWith(const QVector<T> &other) const { return d == other.d; }
@ -348,10 +350,12 @@ template <typename T>
void QVector<T>::detach()
{
if (!isDetached()) {
if (d->alloc)
reallocData(d->size, int(d->alloc));
else
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (!d->alloc)
d = Data::unsharableEmpty();
else
#endif
reallocData(d->size, int(d->alloc));
}
Q_ASSERT(isDetached());
}
@ -503,7 +507,9 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
x = Data::allocate(aalloc, options);
Q_CHECK_PTR(x);
// aalloc is bigger then 0 so it is not [un]sharedEmpty
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
Q_ASSERT(x->ref.isSharable() || options.testFlag(QArrayData::Unsharable));
#endif
Q_ASSERT(!x->ref.isStatic());
x->size = asize;
@ -569,7 +575,9 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
Q_ASSERT(d->data());
Q_ASSERT(uint(d->size) <= d->alloc);
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
Q_ASSERT(d != Data::unsharableEmpty());
#endif
Q_ASSERT(aalloc ? d != Data::sharedNull() : d == Data::sharedNull());
Q_ASSERT(d->alloc >= uint(aalloc));
Q_ASSERT(d->size == asize);

View File

@ -163,10 +163,10 @@ contains(QT_CONFIG,icu) {
LIBS_PRIVATE += -lsicuin -lsicuuc -lsicudt
}
} else {
LIBS_PRIVATE += -licuin -licuuc
LIBS_PRIVATE += -licuin -licuuc -licudt
}
} else {
LIBS_PRIVATE += -licui18n -licuuc
LIBS_PRIVATE += -licui18n -licuuc -licudata
}
} else: win32 {
SOURCES += tools/qcollator_win.cpp

View File

@ -32,6 +32,7 @@
include(MacroAddFileDependencies)
include(CMakeParseArguments)
function(QT5_ADD_DBUS_INTERFACE _sources _interface _basename)
get_filename_component(_infile ${_interface} ABSOLUTE)

View File

@ -1,8 +1,7 @@
TARGET = QtGui
QT = core-private
MODULE_CONFIG = needs_qpa_plugin
contains(QT_CONFIG, opengl.*):MODULE_CONFIG += opengl
contains(QT_CONFIG, opengl.*): MODULE_CONFIG = opengl
DEFINES += QT_NO_USING_NAMESPACE

View File

@ -359,6 +359,13 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length,
memset(bits, 0, image->byteCount());
}
// Check if the previous attempt to create the image failed. If it
// did then the image is broken and we should give up.
if (image->isNull()) {
state = Error;
return -1;
}
disposePrevious(image);
disposed = false;

View File

@ -1880,7 +1880,11 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate
return;
if (previous) {
QFocusEvent focusOut(QEvent::FocusOut, e->reason);
Qt::FocusReason r = e->reason;
if ((r == Qt::OtherFocusReason || r == Qt::ActiveWindowFocusReason) &&
newFocus && (newFocus->flags() & Qt::Popup) == Qt::Popup)
r = Qt::PopupFocusReason;
QFocusEvent focusOut(QEvent::FocusOut, r);
QCoreApplication::sendSpontaneousEvent(previous, &focusOut);
QObject::disconnect(previous, SIGNAL(focusObjectChanged(QObject*)),
qApp, SLOT(_q_updateFocusObject(QObject*)));
@ -1889,7 +1893,11 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate
}
if (QGuiApplicationPrivate::focus_window) {
QFocusEvent focusIn(QEvent::FocusIn, e->reason);
Qt::FocusReason r = e->reason;
if ((r == Qt::OtherFocusReason || r == Qt::ActiveWindowFocusReason) &&
previous && (previous->flags() & Qt::Popup) == Qt::Popup)
r = Qt::PopupFocusReason;
QFocusEvent focusIn(QEvent::FocusIn, r);
QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn);
QObject::connect(QGuiApplicationPrivate::focus_window, SIGNAL(focusObjectChanged(QObject*)),
qApp, SLOT(_q_updateFocusObject(QObject*)));

View File

@ -61,6 +61,10 @@
#include <QDebug>
#ifndef QT_OPENGL_ES_2
#include <QOpenGLFunctions_1_0>
#endif
QT_BEGIN_NAMESPACE
class QOpenGLVersionProfilePrivate
@ -360,13 +364,15 @@ int QOpenGLContextPrivate::maxTextureSize()
funcs->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);
#ifndef QT_OPENGL_ES
if (!q->isES()) {
if (!q->isOpenGLES()) {
GLenum proxy = GL_PROXY_TEXTURE_2D;
GLint size;
GLint next = 64;
funcs->glTexImage2D(proxy, 0, GL_RGBA, next, next, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size);
QOpenGLFunctions_1_0 *gl1funcs = q->versionFunctions<QOpenGLFunctions_1_0>();
gl1funcs->initializeOpenGLFunctions();
gl1funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size);
if (size == 0) {
return max_texture_size;
}
@ -377,7 +383,7 @@ int QOpenGLContextPrivate::maxTextureSize()
if (next > max_texture_size)
break;
funcs->glTexImage2D(proxy, 0, GL_RGBA, next, next, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next);
gl1funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next);
} while (next > size);
max_texture_size = size;
@ -730,7 +736,7 @@ QOpenGLFunctions *QOpenGLContext::functions() const
QAbstractOpenGLFunctions *QOpenGLContext::versionFunctions(const QOpenGLVersionProfile &versionProfile) const
{
#ifndef QT_OPENGL_ES_2
if (isES()) {
if (isOpenGLES()) {
qWarning("versionFunctions: Not supported on OpenGL ES");
return 0;
}
@ -1090,8 +1096,8 @@ void *QOpenGLContext::openGLModuleHandle()
\enum QOpenGLContext::OpenGLModuleType
This enum defines the type of the underlying OpenGL implementation.
\value DesktopGL Desktop OpenGL
\value GLES2 OpenGL ES 2.0 or higher
\value LibGL OpenGL
\value LibGLES OpenGL ES 2.0 or higher
\since 5.3
*/
@ -1106,7 +1112,7 @@ void *QOpenGLContext::openGLModuleHandle()
\note A desktop OpenGL implementation may be capable of creating
ES-compatible contexts too. Therefore in most cases it is more
appropriate to check QSurfaceFormat::renderableType() or using the
the convenience function isES().
the convenience function isOpenGLES().
\note This function requires that the QGuiApplication instance is already created.
@ -1118,9 +1124,9 @@ QOpenGLContext::OpenGLModuleType QOpenGLContext::openGLModuleType()
Q_ASSERT(qGuiApp);
return QGuiApplicationPrivate::instance()->platformIntegration()->openGLModuleType();
#elif defined(QT_OPENGL_ES_2)
return GLES2;
return LibGLES;
#else
return DesktopGL;
return LibGL;
#endif
}
@ -1134,7 +1140,7 @@ QOpenGLContext::OpenGLModuleType QOpenGLContext::openGLModuleType()
\since 5.3
*/
bool QOpenGLContext::isES() const
bool QOpenGLContext::isOpenGLES() const
{
return format().renderableType() == QSurfaceFormat::OpenGLES;
}

View File

@ -198,13 +198,19 @@ public:
static void *openGLModuleHandle();
enum OpenGLModuleType {
DesktopGL,
GLES2
LibGL,
LibGLES,
// ###
DesktopGL = LibGL,
GLES2 = LibGLES
};
static OpenGLModuleType openGLModuleType();
bool isES() const;
bool isOpenGLES() const;
bool isES() const { return isOpenGLES(); } // ###
Q_SIGNALS:
void aboutToBeDestroyed();

View File

@ -127,7 +127,7 @@ private:
class Q_GUI_EXPORT QOpenGLContextGroupPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QOpenGLContextGroup);
Q_DECLARE_PUBLIC(QOpenGLContextGroup)
public:
QOpenGLContextGroupPrivate()
: m_context(0)

View File

@ -510,14 +510,14 @@ void QPlatformIntegration::sync()
a desktop OpenGL implementation may be capable of creating OpenGL
ES-compatible contexts too.
\sa QOpenGLContext::openGLModuleType(), QOpenGLContext::isES()
\sa QOpenGLContext::openGLModuleType(), QOpenGLContext::isOpenGLES()
\since 5.3
*/
QOpenGLContext::OpenGLModuleType QPlatformIntegration::openGLModuleType()
{
qWarning("This plugin does not support dynamic OpenGL loading!");
return QOpenGLContext::DesktopGL;
return QOpenGLContext::LibGL;
}
#endif

View File

@ -86,6 +86,9 @@ public:
virtual void setChecked(bool isChecked) = 0;
virtual void setShortcut(const QKeySequence& shortcut) = 0;
virtual void setEnabled(bool enabled) = 0;
virtual void setNativeContents(WId item) { Q_UNUSED(item); }
Q_SIGNALS:
void activated();
void hovered();
@ -118,6 +121,8 @@ public:
setVisible(true);
}
virtual void dismiss() { } // Closes this and all its related menu popups
virtual QPlatformMenuItem *menuItemAt(int position) const = 0;
virtual QPlatformMenuItem *menuItemForTag(quintptr tag) const = 0;

View File

@ -458,7 +458,7 @@ void QWindow::setVisible(bool visible)
}
#ifndef QT_NO_CURSOR
if (visible && d->hasCursor)
if (visible && (d->hasCursor || QGuiApplication::overrideCursor()))
d->applyCursor();
#endif
d->platformWindow->setVisible(visible);
@ -746,7 +746,7 @@ void QWindow::setTitle(const QString &title)
d->windowTitle = title;
changed = true;
}
if (d->platformWindow)
if (d->platformWindow && type() != Qt::Desktop)
d->platformWindow->setWindowTitle(title);
if (changed)
emit windowTitleChanged(title);

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