Merge 5.8 into 5.8.0

Change-Id: If74f0ade36baa9454ebcffb8d6bdd14ac963c1cb
This commit is contained in:
Oswald Buddenhagen 2016-11-29 12:31:41 +01:00
commit 947cace799
195 changed files with 2555 additions and 2298 deletions

117
configure vendored
View File

@ -399,7 +399,6 @@ HostVar()
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# detect the "echo without newline" style. usage: echo $ECHO_N "<string>$ECHO_C"
if echo '\c' | grep '\c' >/dev/null; then
@ -479,7 +478,7 @@ XPLATFORM_TVOS=no # Whether target platform is tvOS
XPLATFORM_WATCHOS=no # Whether target platform is watchOS
XPLATFORM_ANDROID=no
XPLATFORM_MINGW=no # Whether target platform is MinGW (win32-g++*)
PLATFORM=$QMAKESPEC
PLATFORM=
OPT_CONFIRM_LICENSE=no
OPT_SHADOW=maybe
OPT_VERBOSE=no
@ -512,8 +511,6 @@ QT_HOST_LIBS=
QT_HOST_DATA=
QT_EXT_PREFIX=
# default qpa platform
# Android vars
CFG_DEFAULT_ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT
CFG_DEFAULT_ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT
@ -529,7 +526,6 @@ CFG_DEFAULT_ANDROID_NDK_HOST=$ANDROID_NDK_HOST
# parse the arguments, setting things to "yes" or "no"
while [ "$#" -gt 0 ]; do
CURRENT_OPT="$1"
UNKNOWN_ARG=no
case "$1" in
#Autoconf style options
--enable-*)
@ -658,10 +654,6 @@ while [ "$#" -gt 0 ]; do
extprefix)
QT_EXT_PREFIX="$VAL"
;;
pkg-config)
;;
force-pkg-config)
;;
docdir)
QT_INSTALL_DOCS="$VAL"
;;
@ -1314,8 +1306,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then
[ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
fi
# if the source tree is different from the build tree,
# symlink or copy part of the sources
if [ "$OPT_SHADOW" = "yes" ]; then
echo "Preparing build tree..."
@ -1628,35 +1618,19 @@ setBootstrapVariable()
}
# build qmake
if true; then ###[ '!' -f "$outpath/bin/qmake" ];
echo "Creating qmake..."
mkdir -p "$outpath/qmake" || exit
# fix makefiles
for mkfile in GNUmakefile Makefile; do
EXTRA_LFLAGS=
EXTRA_CFLAGS=
in_mkfile="${mkfile}.in"
if [ "$mkfile" = "Makefile" ]; then
# if which qmake >/dev/null 2>&1 && [ -f qmake/qmake.pro ]; then
# (cd qmake && qmake) >/dev/null 2>&1 && continue
# fi
in_mkfile="${mkfile}.unix"
fi
in_mkfile="$relpath/qmake/$in_mkfile"
mkfile="$outpath/qmake/$mkfile"
in_mkfile=$relpath/qmake/Makefile.unix
mkfile=$outpath/qmake/Makefile
if [ -f "$mkfile" ]; then
[ "$CFG_DEV" = "yes" ] && "$WHICH" chflags >/dev/null 2>&1 && chflags nouchg "$mkfile"
rm -f "$mkfile"
fi
[ -f "$in_mkfile" ] || continue
echo "########################################################################" > "$mkfile"
echo "## This file was autogenerated by configure, all changes will be lost ##" >> "$mkfile"
echo "########################################################################" >> "$mkfile"
EXTRA_OBJS=
EXTRA_SRCS=
EXTRA_CFLAGS="\$(QMAKE_CFLAGS) \$(QMAKE_CFLAGS_SPLIT_SECTIONS)"
EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS) \$(QMAKE_CXXFLAGS_CXX11) \$(QMAKE_CXXFLAGS_SPLIT_SECTIONS)"
EXTRA_LFLAGS="\$(QMAKE_LFLAGS) \$(QMAKE_LFLAGS_GCSECTIONS)"
@ -1667,8 +1641,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
[ "$CFG_SILENT" = "yes" ] && CC_TRANSFORM='s,^,\@,' || CC_TRANSFORM=
setBootstrapVariable QMAKE_CC CC "$CC_TRANSFORM"
setBootstrapVariable QMAKE_CXX CXX "$CC_TRANSFORM"
setBootstrapVariable QMAKE_CFLAGS
setBootstrapVariable QMAKE_CFLAGS_SPLIT_SECTIONS
setBootstrapVariable QMAKE_CXXFLAGS
setBootstrapVariable QMAKE_CXXFLAGS_CXX11
setBootstrapVariable QMAKE_CXXFLAGS_SPLIT_SECTIONS
@ -1676,71 +1648,13 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
setBootstrapVariable QMAKE_LFLAGS_GCSECTIONS
if [ "$CFG_DEBUG" = "no" ] || [ "$CFG_RELEASE_TOOLS" = "yes" ]; then
setBootstrapVariable QMAKE_CFLAGS_RELEASE
setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_RELEASE)"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_RELEASE)"
else
setBootstrapVariable QMAKE_CFLAGS_DEBUG
setBootstrapVariable QMAKE_CXXFLAGS_DEBUG
EXTRA_CFLAGS="$EXTRA_CFLAGS \$(QMAKE_CFLAGS_DEBUG)"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(QMAKE_CXXFLAGS_DEBUG)"
fi
case `basename "$PLATFORM"` in
win32-g++*)
EXTRA_CFLAGS="$EXTRA_CFLAGS -DUNICODE"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -DUNICODE"
EXTRA_OBJS="qfilesystemengine_win.o \
qfilesystemiterator_win.o \
qfsfileengine_win.o \
qlocale_win.o \
qsettings_win.o \
qsystemlibrary.o \
registry.o"
EXTRA_SRCS="\"\$(SOURCE_PATH)/src/corelib/corelib/io/qfilesystemengine_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp\" \
\"\$(SOURCE_PATH)/tools/shared/windows/registry.cpp\""
EXTRA_LFLAGS="$EXTRA_LFLAGS -static -s -lole32 -luuid -ladvapi32 -lkernel32"
EXEEXT=".exe"
;;
*)
EXTRA_OBJS="qfilesystemengine_unix.o \
qfilesystemiterator_unix.o \
qfsfileengine_unix.o \
qlocale_unix.o"
EXTRA_SRCS="\"\$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_unix.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp\""
EXEEXT=
;;
esac
if [ "$BUILD_ON_MAC" = "yes" ]; then
echo "COCOA_LFLAGS =-framework Foundation -framework CoreServices" >>"$mkfile"
echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile"
EXTRA_LFLAGS="$EXTRA_LFLAGS \$(COCOA_LFLAGS)"
EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
EXTRA_OBJS="$EXTRA_OBJS \
qsettings_mac.o \
qcore_mac.o \
qcore_mac_objc.o \
qcore_foundation.o"
EXTRA_SRCS="$EXTRA_SRCS \
\"\$(SOURCE_PATH)/src/corelib/io/qsettings_mac.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/kernel/qcore_mac_objc.mm\" \
\"\$(SOURCE_PATH)/src/corelib/kernel/qcore_foundation.mm\""
fi
echo >>"$mkfile"
adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'`
adjqmakespec=`echo "$QMAKESPEC" | sed 's/ /\\\\\\\\ /g'`
@ -1757,15 +1671,24 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
echo "QT_MAJOR_VERSION = $QT_MAJOR_VERSION" >> "$mkfile"
echo "QT_MINOR_VERSION = $QT_MINOR_VERSION" >> "$mkfile"
echo "QT_PATCH_VERSION = $QT_PATCH_VERSION" >> "$mkfile"
echo "EXTRA_CFLAGS = $EXTRA_CFLAGS" >> "$mkfile"
echo "EXTRA_CXXFLAGS = $EXTRA_CXXFLAGS" >> "$mkfile"
echo "QTOBJS =" $EXTRA_OBJS >> "$mkfile"
echo "QTSRCS =" $EXTRA_SRCS >> "$mkfile"
echo "LFLAGS = $EXTRA_LFLAGS" >> "$mkfile"
echo "EXEEXT = $EXEEXT" >> "$mkfile"
echo "CONFIG_CXXFLAGS = $EXTRA_CXXFLAGS" >> "$mkfile"
echo "CONFIG_LFLAGS = $EXTRA_LFLAGS" >> "$mkfile"
echo "RM_F = rm -f" >> "$mkfile"
echo "RM_RF = rm -rf" >> "$mkfile"
case `basename "$PLATFORM"` in
win32-g++*)
cat "$in_mkfile.win32" >> "$mkfile"
;;
*)
cat "$in_mkfile.unix" >> "$mkfile"
if [ "$BUILD_ON_MAC" = "yes" ]; then
cat "$in_mkfile.macos" >> "$mkfile"
fi
;;
esac
echo >>"$mkfile"
if [ "$BUILD_ON_MAC" = "yes" ]; then
echo "EXTRA_CXXFLAGS += -MMD" >> "$mkfile"
cat "$in_mkfile" >> "$mkfile"
@ -1779,7 +1702,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
rm "$mkfile.tmp"
fi
fi
done
if [ "$OPT_VERBOSE" = yes ]; then
# Show the output of make
@ -1797,7 +1719,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
fi
echo "Done."
fi
fi # Build qmake
#-------------------------------------------------------------------------------
# create a qt.conf for the Qt build tree itself

View File

@ -515,7 +515,7 @@
},
"release_tools": {
"label": "Compile tools in release mode",
"autoDetect": "!features.debug",
"autoDetect": "features.debug",
"output": [ "privateFeature", "publicQtConfig" ]
},
"simulator_and_device": {

221
dist/changes-5.7.1 vendored Normal file
View File

@ -0,0 +1,221 @@
Qt 5.7.1 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 5.7.0.
For more details, refer to the online documentation included in this
distribution. The documentation is also available online:
http://doc.qt.io/qt-5/index.html
The Qt version 5.7 series is binary compatible with the 5.6.x series.
Applications compiled for 5.6 will continue to run with 5.7.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
https://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
This release contains all fixes included in the Qt 5.6.2 release.
****************************************************************************
* Important Behavior Changes *
****************************************************************************
- [QTBUG-45031] The NSURLConnection backend of QNetworkAccessManager has
been removed, since SecureTransport is the default SSL backend on iOS
and is enabled by default. This means that building with -no-openssl
-no-securetransport will no longer provide SSL capabilities on iOS.
- QtCore / QDataStream:
* [QTBUG-54022] Incomplete reads of Qt containers are now handled same
way as for primitive types, meaning that previous errors are latched.
****************************************************************************
* Library *
****************************************************************************
QtCore
------
- QLockFile:
* Fixed permissions on lock files on Unix to allow for adjustments via
umask.
- QMimeType:
* [QTBUG-50776] QMimeType::comment() now uses the default locale rather
than system locale, so that applications can control which language is
being used.
- QUrl:
* QUrl::resolved() no longer treats a URL with a scheme as a relative URL
if it matches this URL's scheme. For now it still treats "file:name.txt"
as relative for compatibility, but be warned that in Qt 5.8 it will no
longer consider those to be relative. Both isRelative() and RFC 3986 say
that such URLs are not relative, so starting from Qt 5.8, resolved() will
return them as is.
- QXmlStreamReader:
* Fixed a bug in the XML parser that prevented to load XML that
contained invalid characters for XML 1.0.
- QXmlStreamWriter:
* Fixed a bug that prevented the generation of valid XML files when
using encoding with 8 bit per character but not ASCII compatible.
QXMLStreamWriter generated XML markup using always ASCII in this case.
QtGui
-----
- QGuiApplication:
* [QTBUG-51703] Fixed a bug that would cause QGuiApplication::sync() to
be left undefined for Qt builds without session management support.
- QIconLoaderEngine:
* Fixed theme lookup for scalable entries
- QTextDocument:
* [QTBUG-48182] Fixed a bug that would return a wrong position when
searching backward from the end of the document.
- Text:
* [QTBUG-49452] Fixed a performance regression in Freetype engine that
was introduced in Qt 5.5.
* [QTBUG-53911] Fixed a crash that could happen if you were doing many
different text layouts with different fonts and superscript or
subscript alignment.
* [QTBUG-42033] Fixed bug where a QTextLayout with
ShowLineAndParagraphSeparators would modify the layout's input string.
* [QTBUG-54180] Fixed performance regression when rapidly switching
between a large set of fonts.
QtNetwork
---------
- QSslSocket:
* [QTBUG-55170] Fixed a bug in SecureTransport backend that would cause
a memory usage growth in case 'readBufferMaxSize' is set.
* [QTBUG-52975] Fixed a bug in SecureTransport backend where transmit
was using invalid SSL context and reporting (incorrectly) some irrelevant
errors as a result.
QtSql
-----
- [QTBUG-53969][QTBUG-53237] Fixed QSqlQuery::prepare value truncation
error when using UNSIGNED values in a MySQL database.
QtWidgets
---------
- QAbstractItemDelegate:
* [QTBUG-16469] Show localized detailed tooltips and "What's this?"
texts.
- QTreeView:
* [QTBUG-52793] Fixed a key navigation bug when the columns were
reordered.
****************************************************************************
* Platform-specific Changes *
****************************************************************************
Android
-------
- [QTBUG-50724] Added support for clang compiler
- [QTBUG-53511] Fixed CJK font resolution on Android 7.
FreeBSD
-------
- The freebsd-g++ mkspec was moved back and no longer requires the
"unsupported/" prefix, matching the FreeBSD ports tree, as FreeBSD 9.3
still defaults to using GCC. Users of GCC that did not previously use
the ports patch will need to adapt their build scripts and drop the
"unsupported/" prefix.
Linux
-----
- [QTBUG-54733] It is now possible to opt out from installing signal
handlers when running with eglfs and linuxfb by setting the
QT_QPA_NO_SIGNAL_HANDLER environment variable to a non-zero value.
- [QTBUG-55140] xcb with EGL and OpenGL ES, as well as eglfs with the
eglfs_x11 backend, are now supported on DRIVE CX boards when using the
linux-drive-cx-g++ device spec.
Windows
-------
- [QTBUG-41186] QWindow::fromWinId() may return 0 when passing invalid
window handles.
- [QTBUG-55595] Fixed crash when loading color fonts from data.
- [QTBUG-55097] Fixed rendering Adobe/Mozilla format color fonts with
other colors than black after Windows 10 Anniversary update.
- [QTBUG-54494] Fixed stretch when combined with either no or vertical
hinting preference or a device pixel ratio different from 1.
- [QTBUG-51024] Fixed height of text bounding box when using no or
vertical hinting preference, or when the device pixel ratio is
different from 1.
****************************************************************************
* Tools *
****************************************************************************
configure & build system
------------------------
- [QTBUG-35886][QTBUG-51417] Fixed Fontconfig vs. system FreeType
configuration.
- [QTBUG-43784][X11] Fixed detection of GLX with -qt-xcb.
- [QTBUG-51534][Windows] The configure.exe bootstrapping now prefers
cl over clang-cl, to avoid header incompatibility problems.
- [QTBUG-52940] Fixed missing plugins.qmltypes files in static builds.
- [QTBUG-52951] Fixed dynamic library support detection for platforms
without libdl.
- [QTBUG-53038] Fixed running of configure tests outside qtbase when
cross compiling on Windows (for example for Android).
- [QTBUG-53312] The flags supplied by the configure -D/-I/-L/-l options
are now applied after Qt's own flags. This helps in some cases when
the provided paths contain files which conflict with the Qt build.
- [QTBUG-53926] Fixed linkage of QML plugins in static prefix builds.
- [QTBUG-55011][Unix] Fixed -no-pkg-config being ignored by some
configure tests, which led to build failures later on.
- Fixed configure tests outside qtbase when $MAKEFLAGS contains the
-i flag.
- [Android] Some unused plugins are not built anymore.
- [MinGW] Added support for -separate-debug-info.
- [Unix] Added configure -no-opengles3 option.
- [Unix] Fixed MySQL detection/use on RHEL 6.6.
qmake
-----
- [QTBUG-41830] Fixed nested custom functions inheriting their callers'
arguments.
- [QTBUG-53895][MSVC] Started using separate PDB files for compiling
and linking.
- [QTBUG-54036][Darwin] Fixed installation of debug symbols.
- [QTBUG-54299] Various QMAKE_EXTRA_COMPILERS' .depends entries are now
appended to rather than overwritten.
- [QTBUG-54346][MSys/Apple] Fixed detection of QMAKE_DEFAULT_{INC,LIB}DIRS.
- [QTBUG-54550] Fixed access to freed memory in $$absolute_path().
- [QTBUG-54674] The obsolete -target xp is now properly rejected.
- [QTBUG-55183][nmake] _WINDLL is now automatically defined when building
a DLL, consistently with Visual Studio.
- [QTBUG-55505] Fixed build of projects with spaces in the source or build
path against static builds of Qt.
- [QTBUG-55649][QTBUG-55915][Xcode] Fixed support for Xcode 8.
- [QTBUG-56162][MinGW] Fixed -release -force-debug-info missing both
optimization and debug info.
- Fixed several cases where the error() function would not abort qmake.
- Interrupting a command run via system() will now abort qmake as well.
- The packagesExist() function will now warn when used when Qt was
configured with -no-pkg-config.
- [Android] The default compiler flags were adjusted to match newer
NDK versions.
- [Darwin] Fixed detection of QMAKE_DEFAULT_INCDIRS.
- [Darwin][make] Added support for building Xcode asset catalogs.

View File

@ -66,7 +66,7 @@ Server::Server(QWidget *parent)
setWindowTitle(tr("Multi-stream Server"));
sctpServer = new QSctpServer(this);
sctpServer->setMaxChannelCount(NumberOfChannels);
sctpServer->setMaximumChannelCount(NumberOfChannels);
statusLabel = new QLabel;
QPushButton *quitButton = new QPushButton(tr("Quit"));

View File

@ -67,12 +67,12 @@ public:
painter->drawPixmap(QPointF(), p);
}
virtual void mousePressEvent(QGraphicsSceneMouseEvent *) override
void mousePressEvent(QGraphicsSceneMouseEvent *) override
{
emit clicked();
}
virtual void setGeometry(const QRectF &rect) override
void setGeometry(const QRectF &rect) override
{
QGraphicsWidget::setGeometry(rect);
@ -98,7 +98,7 @@ public:
{
}
virtual void resizeEvent(QResizeEvent *) override
void resizeEvent(QResizeEvent *) override
{
fitInView(sceneRect(), Qt::KeepAspectRatio);
}

View File

@ -98,14 +98,14 @@ public:
protected:
//![14]
virtual bool eventTest(QEvent *event) override
bool eventTest(QEvent *event) override
{
return (event->type() == QEvent::Type(StateSwitchEvent::StateSwitchType))
&& (static_cast<StateSwitchEvent *>(event)->rand() == m_rand);
}
//![14]
virtual void onTransition(QEvent *) override {}
void onTransition(QEvent *) override {}
private:
int m_rand;
@ -122,7 +122,7 @@ public:
//![10]
//![11]
virtual void onEntry(QEvent *) override
void onEntry(QEvent *) override
{
int n;
while ((n = (qrand() % m_stateCount + 1)) == m_lastIndex)
@ -130,7 +130,7 @@ public:
m_lastIndex = n;
machine()->postEvent(new StateSwitchEvent(n));
}
virtual void onExit(QEvent *) override {}
void onExit(QEvent *) override {}
//![11]
//![12]
@ -174,7 +174,7 @@ public:
}
protected:
virtual void resizeEvent(QResizeEvent *event) override
void resizeEvent(QResizeEvent *event) override
{
fitInView(scene()->sceneRect());
QGraphicsView::resizeEvent(event);

View File

@ -79,7 +79,7 @@ public:
{
}
virtual void resizeEvent(QResizeEvent *) override
void resizeEvent(QResizeEvent *) override
{
fitInView(sceneRect(), Qt::KeepAspectRatio);
}

View File

@ -61,7 +61,7 @@ public:
GraphicsView(QWidget *parent = 0);
protected:
virtual void resizeEvent(QResizeEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void keyPressEvent(QKeyEvent *) override;
signals:

View File

@ -70,7 +70,7 @@ public:
setTargetState(target);
}
virtual bool eventTest(QEvent *e) override
bool eventTest(QEvent *e) override
{
if (QSignalTransition::eventTest(e)) {
QVariant key = static_cast<QStateMachine::SignalEvent*>(e)->arguments().at(0);
@ -95,7 +95,7 @@ public:
startTimer(1000);
}
virtual bool eventTest(QEvent *e) override
bool eventTest(QEvent *e) override
{
return QEventTransition::eventTest(e) && ((qrand() % 50) == 0);
}

View File

@ -60,13 +60,13 @@ public:
RectButton(QString buttonText);
~RectButton();
virtual QRectF boundingRect() const override;
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
QString m_ButtonText;
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
signals:
void clicked();

View File

@ -69,8 +69,8 @@ public:
StickMan();
~StickMan();
virtual QRectF boundingRect() const override;
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
int nodeCount() const;
Node *node(int idx) const;

View File

@ -86,7 +86,7 @@ public:
void updateBoatMovement();
virtual int type() const override;
int type() const override;
signals:
void boatDestroyed();

View File

@ -81,7 +81,7 @@ public:
{
}
protected:
virtual bool eventTest(QEvent *event) override
bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;
@ -100,7 +100,7 @@ public:
{
}
protected:
virtual bool eventTest(QEvent *event) override
bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;
@ -131,7 +131,7 @@ public:
{
}
protected:
virtual bool eventTest(QEvent *event) override
bool eventTest(QEvent *event) override
{
if (!QKeyEventTransition::eventTest(event))
return false;

View File

@ -152,7 +152,7 @@ class UpdateScoreTransition : public QSignalTransition
public:
UpdateScoreTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target);
protected:
virtual bool eventTest(QEvent *event) override;
bool eventTest(QEvent *event) override;
private:
PlayState * game;
GraphicsScene *scene;
@ -164,7 +164,7 @@ class WinTransition : public QSignalTransition
public:
WinTransition(GraphicsScene *scene, PlayState *game, QAbstractState *target);
protected:
virtual bool eventTest(QEvent *event) override;
bool eventTest(QEvent *event) override;
private:
PlayState * game;
GraphicsScene *scene;
@ -176,7 +176,7 @@ private:
public:
CustomSpaceTransition(QWidget *widget, PlayState *game, QEvent::Type type, int key);
protected:
virtual bool eventTest(QEvent *event) override;
bool eventTest(QEvent *event) override;
private:
PlayState *game;
};

View File

@ -81,7 +81,7 @@ public:
void launchTorpedo(int speed);
void destroy();
virtual int type() const override;
int type() const override;
QGraphicsRotation *rotation() const { return graphicsRotation; }

View File

@ -110,8 +110,8 @@ public:
GLTexture2D(int width, int height);
explicit GLTexture2D(const QString& fileName, int width = 0, int height = 0);
void load(int width, int height, QRgb *data);
virtual void bind() override;
virtual void unbind() override;
void bind() override;
void unbind() override;
};
class GLTexture3D : public GLTexture
@ -121,8 +121,8 @@ public:
// TODO: Implement function below
//GLTexture3D(const QString& fileName, int width = 0, int height = 0);
void load(int width, int height, int depth, QRgb *data);
virtual void bind() override;
virtual void unbind() override;
void bind() override;
void unbind() override;
};
class GLTextureCube : public GLTexture
@ -131,8 +131,8 @@ public:
GLTextureCube(int size);
explicit GLTextureCube(const QStringList& fileNames, int size = 0);
void load(int size, int face, QRgb *data);
virtual void bind() override;
virtual void unbind() override;
void bind() override;
void unbind() override;
};
// TODO: Define and implement class below

View File

@ -63,18 +63,18 @@ public:
ItemBase(int size, int x, int y);
virtual ~ItemBase();
virtual QRectF boundingRect() const override;
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
virtual ItemBase *createNew(int size, int x, int y) = 0;
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
virtual void keyPressEvent(QKeyEvent *event) override;
virtual void wheelEvent(QGraphicsSceneWheelEvent *event) override;
virtual int type() const override;
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void wheelEvent(QGraphicsSceneWheelEvent *event) override;
int type() const override;
bool isInResizeArea(const QPointF &pos);
static void duplicateSelectedItems(QGraphicsScene *scene);
@ -92,9 +92,9 @@ class QtBox : public ItemBase
public:
QtBox(int size, int x, int y);
virtual ~QtBox();
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
virtual ItemBase *createNew(int size, int x, int y) override;
ItemBase *createNew(int size, int x, int y) override;
private:
QVector3D m_vertices[8];
QVector3D m_texCoords[4];
@ -106,9 +106,9 @@ class CircleItem : public ItemBase
{
public:
CircleItem(int size, int x, int y);
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
virtual ItemBase *createNew(int size, int x, int y) override;
ItemBase *createNew(int size, int x, int y) override;
QColor m_color;
};
@ -117,9 +117,9 @@ class SquareItem : public ItemBase
{
public:
SquareItem(int size, int x, int y);
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
virtual ItemBase *createNew(int size, int x, int y) override;
ItemBase *createNew(int size, int x, int y) override;
QPixmap m_image;
};

View File

@ -87,7 +87,7 @@ public slots:
signals:
void colorChanged(QRgb color, int id);
protected:
virtual void mousePressEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void setColor(QRgb color); // also emits colorChanged()
private:
QGraphicsScene *m_dialogParentScene;
@ -120,9 +120,9 @@ class GraphicsWidget : public QGraphicsProxyWidget
public:
GraphicsWidget() : QGraphicsProxyWidget(0, Qt::Window) {}
protected:
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
virtual void resizeEvent(QGraphicsSceneResizeEvent *event) override;
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
void resizeEvent(QGraphicsSceneResizeEvent *event) override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
};
class TwoSidedGraphicsWidget : public QObject
@ -162,7 +162,7 @@ signals:
void shaderChanged(int);
void doubleClicked();
protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
QVector<QByteArray> m_parameterNames;
QComboBox *m_textureCombo;
@ -189,7 +189,7 @@ signals:
void doubleClicked();
void newItemTriggered(ItemDialog::ItemType type);
protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
};
class Scene : public QGraphicsScene
@ -198,7 +198,7 @@ class Scene : public QGraphicsScene
public:
Scene(int width, int height, int maxTextureSize);
~Scene();
virtual void drawBackground(QPainter *painter, const QRectF &rect) override;
void drawBackground(QPainter *painter, const QRectF &rect) override;
public slots:
void setShader(int index);
@ -214,10 +214,10 @@ protected:
void defaultStates();
void renderCubemaps();
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
virtual void wheelEvent(QGraphicsSceneWheelEvent * event) override;
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
void wheelEvent(QGraphicsSceneWheelEvent * event) override;
private:
void initGL();
QPointF pixelPosToViewPos(const QPointF& p);

View File

@ -50,10 +50,8 @@
#include "view.h"
#ifndef QT_NO_PRINTER
#include <QPrinter>
#include <QPrintDialog>
#endif
#ifndef QT_NO_OPENGL
#include <QtOpenGL>
#else

View File

@ -63,7 +63,7 @@ public:
}
protected:
virtual void resizeEvent(QResizeEvent *) override
void resizeEvent(QResizeEvent *) override
{
}
};

View File

@ -69,7 +69,7 @@ public:
{
}
virtual void resizeEvent(QResizeEvent *event) override
void resizeEvent(QResizeEvent *event) override
{
w->setGeometry(0, 0, event->size().width(), event->size().height());
}

View File

@ -63,8 +63,8 @@ public:
protected:
virtual void resizeEvent(QResizeEvent *event) override;
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
void resizeEvent(QResizeEvent *event) override;
QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
void scrollTo (const QModelIndex & index, ScrollHint hint = EnsureVisible) override;
private:

View File

@ -49,11 +49,7 @@
****************************************************************************/
#include <QtWidgets>
#ifndef QT_NO_PRINTER
#include <QPrinter>
#include <QPrintDialog>
#include <QPrintPreviewDialog>
#endif
#include "mainwindow.h"

View File

@ -52,6 +52,8 @@
#define MAINWINDOW_H
#include "ui_mainwindowbase.h"
#include <QPrinter>
#include <QPrintDialog>
QT_BEGIN_NAMESPACE
class QPrinter;

View File

@ -78,7 +78,7 @@ public slots:
void fileNew();
protected:
virtual void closeEvent(QCloseEvent *e) override;
void closeEvent(QCloseEvent *e) override;
private slots:
void fileOpen();

View File

@ -103,7 +103,7 @@ public:
: QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact)
{}
virtual bool eventTest(QEvent *e) override
bool eventTest(QEvent *e) override
{
if (!QSignalTransition::eventTest(e))
return false;
@ -111,7 +111,7 @@ public:
return se->arguments().at(0).toInt() > 1;
}
virtual void onTransition(QEvent *e) override
void onTransition(QEvent *e) override
{
QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e);
int x = se->arguments().at(0).toInt();
@ -133,7 +133,7 @@ public:
: QSignalTransition(fact, SIGNAL(xChanged(int))), m_fact(fact)
{}
virtual bool eventTest(QEvent *e) override
bool eventTest(QEvent *e) override
{
if (!QSignalTransition::eventTest(e))
return false;
@ -141,7 +141,7 @@ public:
return se->arguments().at(0).toInt() <= 1;
}
virtual void onTransition(QEvent *) override
void onTransition(QEvent *) override
{
fprintf(stdout, "%d\n", m_fact->property("fac").toInt());
}

View File

@ -75,7 +75,7 @@ public:
: QState(parent) {}
protected:
virtual void onEntry(QEvent *) override
void onEntry(QEvent *) override
{
machine()->postEvent(new PingEvent());
fprintf(stdout, "ping?\n");
@ -93,7 +93,7 @@ protected:
virtual bool eventTest(QEvent *e) override {
return (e->type() == QEvent::User+3);
}
virtual void onTransition(QEvent *) override
void onTransition(QEvent *) override
{
machine()->postDelayedEvent(new PingEvent(), 500);
fprintf(stdout, "ping?\n");
@ -111,7 +111,7 @@ protected:
virtual bool eventTest(QEvent *e) override {
return (e->type() == QEvent::User+2);
}
virtual void onTransition(QEvent *) override
void onTransition(QEvent *) override
{
machine()->postDelayedEvent(new PongEvent(), 500);
fprintf(stdout, "pong!\n");

View File

@ -74,7 +74,7 @@ public slots:
void turnOn() { setOn(true); }
protected:
virtual void paintEvent(QPaintEvent *) override
void paintEvent(QPaintEvent *) override
{
if (!m_on)
return;

View File

@ -1,4 +1,4 @@
# qmake configuration for building with android-g++
# qmake configuration for building with android-clang
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = android
QMAKE_COMPILER = gcc clang llvm
@ -6,6 +6,7 @@ QMAKE_COMPILER = gcc clang llvm
CONFIG += android_install unversioned_soname unversioned_libname plugin_with_soname android_deployment_settings
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/clang.conf)
include(../common/android-base-head.conf)

View File

@ -32,7 +32,8 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit {
gcc: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -dM -E -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:intel_icl: moc_predefs.commands = $$QMAKE_CXX $$QMAKE_CXXFLAGS -QdM -P -Fi${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
else:msvc {
moc_predefs.commands += $$QMAKE_CXX -Bx$$QMAKE_QMAKE $$QMAKE_CXXFLAGS -E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
moc_predefs.commands += $$QMAKE_CXX -Bx$$shell_quote($$shell_path($$QMAKE_QMAKE)) $$QMAKE_CXXFLAGS \
-E ${QMAKE_FILE_IN} 2>NUL >${QMAKE_FILE_OUT}
} else: error("Oops, I messed up")
moc_predefs.output = $$MOC_DIR/moc_predefs.h
moc_predefs.input = MOC_PREDEF_FILE

View File

@ -194,13 +194,8 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
# static builds: link qml import plugins into the app.
contains(qt_module_deps, qml): \
qtConfig(static):contains(TEMPLATE, .*app):!host_build:!no_import_scan {
!isEmpty(QTREPOS) {
for (qrep, QTREPOS): \
exists($$qrep/qml): \
QMLPATHS += $$qrep/qml
} else {
QMLPATHS += $$[QT_INSTALL_QML/get]
}
exists($$[QT_INSTALL_QML/get]): \
QMLPATHS *= $$[QT_INSTALL_QML/get]
# run qmlimportscanner
qtPrepareTool(QMLIMPORTSCANNER, qmlimportscanner, , system)

View File

@ -37,6 +37,8 @@ INSTALLS += target
load(qt_targets)
load(qt_common)
qtSetQmlPath()
no_launch_target: return()
load(resolve_target)

View File

@ -52,6 +52,22 @@ QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR
unset(modpath)
}
defineTest(qtSetQmlPath) {
!qtConfig(static)|host_build|no_import_scan: \
return()
deps = $$replace(QT, -private$, _private)
deps = $$resolve_depends(deps, "QT.")
!contains(deps, qml): \
return()
isEmpty(QTREPOS): \
QTREPOS = $$shadowed($$dirname(_QMAKE_CONF_))
for (qrep, QTREPOS): \
exists($$qrep/qml): \
QMLPATHS += $$qrep/qml
export(QMLPATHS)
}
# Apply extra compiler flags passed via configure last.
CONFIG = qt_build_extra $$CONFIG

View File

@ -22,7 +22,7 @@ defineTest(qtConfAddWarning) {
defineTest(qtConfAddError) {
QT_CONFIGURE_ERRORS += "ERROR: $$join(1, $$escape_expand(\\n))"
export(QT_CONFIGURE_ERRORS)
equals(2, log) {
equals(2, log):qt_conf_tests_allowed {
CONFIG += mention_config_log
export(CONFIG)
}

View File

@ -9,6 +9,9 @@
# We mean it.
#
contains(TEMPLATE, .*app): \
qtSetQmlPath()
contains(TEMPLATE, "vc.*"): return()
defineTest(addInstallFiles) {

View File

@ -0,0 +1,10 @@
#
# qmake configuration for win32-msvc2017
#
# Written for Microsoft Visual C++ 2017
#
MSC_VER = 1910
MSVC_VER = 15.0
include(../common/msvc-desktop.conf)
load(qt_config)

View File

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

View File

@ -20,7 +20,7 @@ QOBJS=qtextcodec.o qutfcodec.o qstring.o qstring_compat.o qstringbuilder.o qtext
qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlinkedlist.o qnumeric.o \
qcryptographichash.o qxmlstream.o qxmlutils.o qlogging.o \
qjson.o qjsondocument.o qjsonparser.o qjsonarray.o qjsonobject.o qjsonvalue.o \
$(QTOBJS)
$(QTOBJS) $(QTOBJS2)
#all sources, used for the depend target
@ -92,11 +92,11 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/json/qjsonarray.cpp \
$(SOURCE_PATH)/src/corelib/json/qjsonobject.cpp \
$(SOURCE_PATH)/src/corelib/json/qjsonvalue.cpp \
$(QTSRCS)
$(QTSRCS) $(QTSRCS2)
CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
-I$(QMKSRC) -I$(QMKLIBSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 \
-I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \
-I$(QMKSRC)/generators/mac \
-I$(INC_PATH) -I$(INC_PATH)/QtCore \
-I$(INC_PATH)/QtCore/$(QT_VERSION) -I$(INC_PATH)/QtCore/$(QT_VERSION)/QtCore \
-I$(BUILD_PATH)/src/corelib/global \
@ -106,7 +106,8 @@ CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL \
-DQT_NO_FOREACH
CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS)
CXXFLAGS = $(EXTRA_CXXFLAGS) $(CONFIG_CXXFLAGS) $(CPPFLAGS)
LFLAGS = $(EXTRA_LFLAGS) $(CONFIG_LFLAGS)
first all: $(BUILD_PATH)/bin/qmake$(EXEEXT)
qmake: $(BUILD_PATH)/bin/qmake$(EXEEXT)

17
qmake/Makefile.unix.macos Normal file
View File

@ -0,0 +1,17 @@
COCOA_LFLAGS = -framework Foundation -framework CoreServices
CARBON_LFLAGS = -framework ApplicationServices
CARBON_CFLAGS = -fconstant-cfstrings
EXTRA_CXXFLAGS = $(CARBON_CFLAGS)
EXTRA_LFLAGS = $(COCOA_LFLAGS) $(CARBON_LFLAGS)
QTOBJS2 = \
qsettings_mac.o \
qcore_mac.o \
qcore_mac_objc.o \
qcore_foundation.o
QTSRCS2 = \
$(SOURCE_PATH)/src/corelib/io/qsettings_mac.cpp \
$(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp \
$(SOURCE_PATH)/src/corelib/kernel/qcore_mac_objc.mm \
$(SOURCE_PATH)/src/corelib/kernel/qcore_foundation.mm

27
qmake/Makefile.unix.mingw Normal file
View File

@ -0,0 +1,27 @@
# SHELL is the full path of sh.exe, unless
# 1) it is found in the current directory
# 2) it is not found at all
# 3) it is overridden on the command line with an existing file
# ... otherwise it is always sh.exe. Specifically, SHELL from the
# environment has no effect.
#
# This check will fail if SHELL is explicitly set to a not
# sh-compatible shell. This is not a problem, because configure.bat
# will not do that.
ifeq ($(SHELL), sh.exe)
ifeq ($(wildcard $(CURDIR)/sh.exe), )
SH = 0
else
SH = 1
endif
else
SH = 1
endif
ifeq ($(SH), 1)
RM_F = rm -f
RM_RF = rm -rf
else
RM_F = del /f
RM_RF = rmdir /s /q
endif

11
qmake/Makefile.unix.unix Normal file
View File

@ -0,0 +1,11 @@
EXEEXT =
QTOBJS = \
qfilesystemengine_unix.o \
qfilesystemiterator_unix.o \
qfsfileengine_unix.o \
qlocale_unix.o
QTSRCS = \
$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_unix.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp \
$(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp

19
qmake/Makefile.unix.win32 Normal file
View File

@ -0,0 +1,19 @@
EXEEXT = .exe
EXTRA_CXXFLAGS = -DUNICODE
EXTRA_LFLAGS = -static -s -lole32 -luuid -ladvapi32 -lkernel32
QTOBJS = \
qfilesystemengine_win.o \
qfilesystemiterator_win.o \
qfsfileengine_win.o \
qlocale_win.o \
qsettings_win.o \
qsystemlibrary.o \
registry.o
QTSRCS = \
$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp \
$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp \
$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp \
$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp \
$(SOURCE_PATH)/tools/shared/windows/registry.cpp

View File

@ -23,7 +23,7 @@ CXX = cl
LINKER = link
! if "$(QMAKESPEC)" == "win32-msvc2013"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS $(CFLAGS_CRT)
! elseif "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-clang-msvc2015"
! elseif "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-msvc2017" || "$(QMAKESPEC)" == "win32-clang-msvc2015"
CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 /wd4577 $(CFLAGS_CRT)
! else
! error Unsupported compiler for this Makefile
@ -38,7 +38,7 @@ PCH_OBJECT = qmake_pch.obj
CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
-W3 -nologo -O1 \
$(CFLAGS_EXTRA) \
-I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \
-I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac \
-I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \
-I$(BUILD_PATH)\src\corelib\global \
-I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \
@ -147,18 +147,9 @@ distclean:: clean
-del $(BUILD_PATH)\bin\qmake.exe
-del Makefile
.c.obj:
$(CXX) $(CFLAGS) $<
.cpp.obj:
$(CXX) $(CXXFLAGS) $<
.cc.obj:
$(CXX) $(CXXFLAGS) $<
.cxx.obj:
$(CXX) $(CXXFLAGS) $<
$(OBJS): $(PCH_OBJECT)
$(QTOBJS): $(PCH_OBJECT)
@ -174,9 +165,6 @@ qmake_pch.obj:
{$(SOURCE_PATH)\qmake\generators\mac}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
{$(SOURCE_PATH)\qmake\generators\integrity}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
{$(SOURCE_PATH)\qmake\generators\unix}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<

View File

@ -2057,6 +2057,12 @@
value of this variable is typically handled by qmake or
\l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
\section1 QMAKE_OBJECTIVE_CFLAGS
Specifies the Objective C/C++ compiler flags for building
a project. These flags are used in addition to QMAKE_CFLAGS and
QMAKE_CXXFLAGS.
\section1 QMAKE_POST_LINK
Specifies the command to execute after linking the \l{TARGET}

View File

@ -308,7 +308,12 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
t << "first: all\n";
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
<< ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
<< ' ' << depVar("ALL_DEPS");
if (project->first("TEMPLATE") == "aux") {
t << "\n\n";
return;
}
t << " $(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" <<var("QMAKE_PRE_LINK");
@ -318,7 +323,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
} else {
t << "\n\t" << objectsLinkLine << " " ;
}
} else if (project->first("TEMPLATE") != "aux") {
} else {
t << "\n\t$(LINKER) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) " << objectsLinkLine << " $(LIBS)";
}
if(!project->isEmpty("QMAKE_POST_LINK"))

View File

@ -517,7 +517,12 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
t << "first: all\n";
t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName()))
<< ' ' << depVar("ALL_DEPS") << " $(DESTDIR_TARGET)\n\n";
<< ' ' << depVar("ALL_DEPS");
if (templateName == "aux") {
t << "\n\n";
return;
}
t << " $(DESTDIR_TARGET)\n\n";
t << "$(DESTDIR_TARGET): " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) " << depVar("POST_TARGETDEPS");
if(!project->isEmpty("QMAKE_PRE_LINK"))
@ -526,7 +531,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
t << "\n\t$(LIBAPP) $(LIBFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(DESTDIR_TARGET) @<<\n\t "
<< "$(OBJECTS)"
<< "\n<<";
} else if (templateName != "aux") {
} else {
const bool embedManifest = ((templateName == "app" && project->isActiveConfig("embed_manifest_exe"))
|| (templateName == "lib" && project->isActiveConfig("embed_manifest_dll")
&& !(project->isActiveConfig("plugin") && project->isActiveConfig("no_plugin_manifest"))

View File

@ -52,7 +52,8 @@ enum DotNET {
NET2010 = 0xa0,
NET2012 = 0xb0,
NET2013 = 0xc0,
NET2015 = 0xd0
NET2015 = 0xd0,
NET2017 = 0xe0
};
/*

View File

@ -64,6 +64,7 @@ struct DotNetCombo {
const char *versionStr;
const char *regKey;
} dotNetCombo[] = {
{NET2017, "MSVC.NET 2017 (15.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\15.0"},
{NET2015, "MSVC.NET 2015 (14.0)", "Software\\Microsoft\\VisualStudio\\14.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 (12.0)", "Software\\Microsoft\\VisualStudio\\12.0\\Setup\\VC\\ProductDir"},
{NET2013, "MSVC.NET 2013 Express Edition (12.0)", "Software\\Microsoft\\VCExpress\\12.0\\Setup\\VC\\ProductDir"},
@ -158,6 +159,8 @@ const char _slnHeader120[] = "Microsoft Visual Studio Solution File, Format
"\n# Visual Studio 2013";
const char _slnHeader140[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
"\n# Visual Studio 2015";
const char _slnHeader141[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
"\n# Visual Studio 2017";
// The following UUID _may_ change for later servicepacks...
// If so we need to search through the registry at
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects
@ -386,6 +389,8 @@ QString VcprojGenerator::retrievePlatformToolSet() const
return QStringLiteral("v120") + suffix;
case NET2015:
return QStringLiteral("v140") + suffix;
case NET2017:
return QStringLiteral("v141") + suffix;
default:
return QString();
}
@ -613,6 +618,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) {
case NET2017:
t << _slnHeader141;
break;
case NET2015:
t << _slnHeader140;
break;
@ -934,6 +942,9 @@ void VcprojGenerator::initProject()
// Own elements -----------------------------
vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString();
switch (which_dotnet_version(project->first("MSVC_VER").toLatin1())) {
case NET2017:
vcProject.Version = "15.00";
break;
case NET2015:
vcProject.Version = "14.00";
break;

View File

@ -568,16 +568,18 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
t << "####### Build rules\n\n";
writeBuildRulesPart(t);
if(project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
<< escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
if (project->first("TEMPLATE") != "aux") {
if (project->isActiveConfig("shared") && !project->values("DLLDESTDIR").isEmpty()) {
const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
<< escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
}
}
}
t << endl;
t << endl;
writeRcFilePart(t);
writeRcFilePart(t);
}
writeMakeQmake(t);
@ -601,8 +603,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
const ProStringList &inputs = project->values(ProKey(*it + ".input"));
for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input)
t << escapeFilePath(*input) << ' ';
for (ProStringList::ConstIterator input = inputs.begin(); input != inputs.end(); ++input) {
const ProStringList &val = project->values((*input).toKey());
t << escapeFilePaths(val).join(' ') << ' ';
}
}
}
t << endl << endl;

View File

@ -971,6 +971,13 @@ static ProString msvcBinDirToQMakeArch(QString subdir)
subdir = subdir.toLower();
if (subdir == QLatin1String("amd64"))
return ProString("x86_64");
// Since 2017 the folder structure from here is HostX64|X86/x64|x86
idx = subdir.indexOf(QLatin1Char('\\'));
if (idx == -1)
return ProString("x86");
subdir.remove(0, idx + 1);
if (subdir == QLatin1String("x64"))
return ProString("x86_64");
return ProString(subdir);
}
@ -1065,8 +1072,12 @@ void QMakeEvaluator::loadDefaults()
vars[ProKey("QMAKE_HOST.arch")] << archStr;
# if defined(Q_CC_MSVC) // ### bogus condition, but nobody x-builds for msvc with a different qmake
// Since VS 2017 we need VCToolsInstallDir instead of VCINSTALLDIR
QString vcInstallDir = m_option->getEnv(QLatin1String("VCToolsInstallDir"));
if (vcInstallDir.isEmpty())
vcInstallDir = m_option->getEnv(QLatin1String("VCINSTALLDIR"));
vars[ProKey("QMAKE_TARGET.arch")] = msvcArchitecture(
m_option->getEnv(QLatin1String("VCINSTALLDIR")),
vcInstallDir,
m_option->getEnv(QLatin1String("PATH")));
# endif
#elif defined(Q_OS_UNIX)

View File

@ -27,7 +27,6 @@ INCLUDEPATH += . \
generators/unix \
generators/win32 \
generators/mac \
generators/integrity \
../tools/shared
include(qmake.pri)

View File

@ -12,7 +12,7 @@
},
{
"Id": "angle-arrayboundsclamper",
"Name": "ANGLE Array Bounds Clamper for WebKit",
"Name": "ANGLE: Array Bounds Clamper for WebKit",
"QDocModule": "qtgui",
"QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
@ -25,7 +25,7 @@
},
{
"Id": "angle-murmurhash",
"Name": "Murmurhash (as part of ANGLE)",
"Name": "ANGLE: Murmurhash",
"QDocModule": "qtgui",
"QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
@ -36,7 +36,7 @@
},
{
"Id": "angle-systeminfo",
"Name": "Systeminfo (as part of ANGLE)",
"Name": "ANGLE: Systeminfo",
"QDocModule": "qtgui",
"QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",
@ -48,7 +48,7 @@
},
{
"Id": "angle-trace_event",
"Name": "trace_event (as part of ANGLE)",
"Name": "ANGLE: trace_event",
"QDocModule": "qtgui",
"QtUsage": "Used on Windows to implement OpenGL ES on top of DirectX. Configure with -no-opengl, or -opengl desktop to exclude.",

View File

@ -1,4 +1,5 @@
Copyright (C) 2016 Intel Corporation.
Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -7,6 +7,6 @@
"License": "MIT License",
"LicenseId": "MIT",
"LicenseFile": "LICENSE",
"Copyright": "Copyright (C) 2013-2016 Intel Corporation
"Copyright": "Copyright (C) 2016 Intel Corporation
Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com"
}

View File

@ -4,14 +4,10 @@
"QDocModule": "qtcore",
"QtUsage": "Used in Qt Core.",
"Description": "strtoll() and strtoull() are functions for converting a string to (unsigned) long long integer.",
"License": "BSD 3-clause \"New\" or \"Revised\" License",
"LicenseId": "BSD-3-Clause",
"LicenseFile": "LICENSE",
"Copyright": "Copyright (c) 1992, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 2011 The FreeBSD Foundation
All rights reserved.
Portions of this software were developed by David Chisnall
under sponsorship from the FreeBSD Foundation."
"Copyright": "Copyright (c) 1992, 1993 The Regents of the University of California.
Copyright (c) 2011 The FreeBSD Foundation"
}

View File

@ -4,6 +4,7 @@
"Name": "Secure Hash Algorithm SHA-3 - brg_endian",
"QDocModule": "qtcore",
"QtUsage": "Used in Qt Core (QCryptographicHash).",
"Files": "brg_endian.h",
"Description": "SHA-3, originally known as Keccak, is a cryptographic hash function.",
"License": "BSD 3-clause \"New\" or \"Revised\" License",
@ -16,6 +17,7 @@
"Name": "Secure Hash Algorithm SHA-3 - Keccak",
"QDocModule": "qtcore",
"QtUsage": "Used in Qt Core (QCryptographicHash).",
"Files": "KeccakF-1600-32-rvk.macros KeccakF-1600-32.macros KeccakF-1600-64.macros KeccakF-1600-interface.h KeccakF-1600-opt32.c KeccakF-1600-opt64.c KeccakF-1600-unrolling.macros KeccakNISTInterface.c KeccakNISTInterface.h KeccakSponge.c KeccakSponge.h",
"Description": "SHA-3, originally known as Keccak, is a cryptographic hash function.",
"License": "Creative Commons Zero v1.0 Universal",

View File

@ -22,18 +22,24 @@ get_filename_component(_qt5_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/..\" ABSO
set(_Qt5_NOTFOUND_MESSAGE)
include(${CMAKE_CURRENT_LIST_DIR}/Qt5ModuleLocation.cmake)
foreach(module ${Qt5_FIND_COMPONENTS})
find_package(Qt5${module}
${_Qt5_FIND_PARTS_QUIET}
${_Qt5_FIND_PARTS_REQUIRED}
PATHS \"${_qt5_install_prefix}\" NO_DEFAULT_PATH
PATHS ${_qt5_module_paths} NO_DEFAULT_PATH
)
if (NOT Qt5${module}_FOUND)
string(CONFIGURE ${_qt5_module_location_template} _expected_module_location @ONLY)
if (Qt5_FIND_REQUIRED_${module})
set(_Qt5_NOTFOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\\\"\\n\")
set(_Qt5_NOTFOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_expected_module_location}\\\"\\n\")
elseif(NOT Qt5_FIND_QUIETLY)
message(WARNING \"Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/Qt5${module}/Qt5${module}Config.cmake\\\"\")
message(WARNING \"Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_expected_module_location}\\\"\")
endif()
unset(_expected_module_location)
endif()
endforeach()

View File

@ -0,0 +1,15 @@
!!IF !isEmpty(_QMAKE_SUPER_CACHE_)
get_filename_component(_qt5_root_dir \"${CMAKE_CURRENT_LIST_DIR}/../../../..\" ABSOLUTE)
file(GLOB qtmodules ${_qt5_root_dir} "${_qt5_root_dir}/*")
foreach(qtmodule ${qtmodules})
if(IS_DIRECTORY ${qtmodule})
list(APPEND _qt5_module_paths ${qtmodule})
endif()
endforeach()
!!ELSE
set(_qt5_root_dir ${_qt5_install_prefix})
set(_qt5_module_paths ${_qt5_install_prefix})
!!ENDIF
set(_qt5_module_location_template ${_qt5_root_dir})

View File

@ -0,0 +1,4 @@
set(_qt5_root_dir ${_qt5_install_prefix})
set(_qt5_module_paths ${_qt5_install_prefix})
set(_qt5_module_location_template ${_qt5_install_prefix}/Qt5@module@/Qt5@module@Config.cmake)

View File

@ -43,12 +43,8 @@ qtConfig(icu) {
qtConfig(iconv) {
HEADERS += codecs/qiconvcodec_p.h
SOURCES += codecs/qiconvcodec.cpp
qtConfig(gnu-libiconv) {
DEFINES += GNU_LIBICONV
qtConfig(gnu-libiconv): \
QMAKE_USE_PRIVATE += iconv
} else: qtConfig(sun-libiconv) {
DEFINES += GNU_LIBICONV
}
}
win32 {

View File

@ -37,7 +37,9 @@
**
****************************************************************************/
#ifndef QT_NO_ICONV
#include <QtCore/private/qglobal_p.h>
QT_REQUIRE_CONFIG(iconv);
#include "qiconvcodec_p.h"
#include "qtextcodec_p.h"
@ -62,7 +64,7 @@
#elif defined(Q_OS_AIX)
# define NO_BOM
# define UTF16 "UCS-2"
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
#elif defined(Q_OS_FREEBSD)
# define NO_BOM
# if Q_BYTE_ORDER == Q_BIG_ENDIAN
# define UTF16 "UTF-16BE"
@ -73,19 +75,6 @@
# define UTF16 "UTF-16"
#endif
#if defined(Q_OS_MAC)
#ifndef GNU_LIBICONV
#define GNU_LIBICONV
#endif
typedef iconv_t (*Ptr_iconv_open) (const char*, const char*);
typedef size_t (*Ptr_iconv) (iconv_t, const char **, size_t *, char **, size_t *);
typedef int (*Ptr_iconv_close) (iconv_t);
static Ptr_iconv_open ptr_iconv_open = 0;
static Ptr_iconv ptr_iconv = 0;
static Ptr_iconv_close ptr_iconv_close = 0;
#endif
QT_BEGIN_NAMESPACE
QIconvCodec::QIconvCodec()
@ -103,33 +92,6 @@ void QIconvCodec::init() const
fprintf(stderr, "QIconvCodec::convertToUnicode: internal error, UTF-16 codec not found\n");
utf16Codec = reinterpret_cast<QTextCodec *>(~0);
}
#if defined(Q_OS_MAC)
if (ptr_iconv_open == 0) {
QLibrary libiconv(QLatin1String("/usr/lib/libiconv"));
libiconv.setLoadHints(QLibrary::ExportExternalSymbolsHint);
ptr_iconv_open = reinterpret_cast<Ptr_iconv_open>(libiconv.resolve("libiconv_open"));
if (!ptr_iconv_open)
ptr_iconv_open = reinterpret_cast<Ptr_iconv_open>(libiconv.resolve("iconv_open"));
ptr_iconv = reinterpret_cast<Ptr_iconv>(libiconv.resolve("libiconv"));
if (!ptr_iconv)
ptr_iconv = reinterpret_cast<Ptr_iconv>(libiconv.resolve("iconv"));
ptr_iconv_close = reinterpret_cast<Ptr_iconv_close>(libiconv.resolve("libiconv_close"));
if (!ptr_iconv_close)
ptr_iconv_close = reinterpret_cast<Ptr_iconv_close>(libiconv.resolve("iconv_close"));
Q_ASSERT_X(ptr_iconv_open && ptr_iconv && ptr_iconv_close,
"QIconvCodec::QIconvCodec()",
"internal error, could not resolve the iconv functions");
# undef iconv_open
# define iconv_open ptr_iconv_open
# undef iconv
# define iconv ptr_iconv
# undef iconv_close
# define iconv_close ptr_iconv_close
}
#endif
}
QIconvCodec::~QIconvCodec()
@ -221,7 +183,7 @@ QString QIconvCodec::convertToUnicode(const char* chars, int len, ConverterState
IconvState *state = *pstate;
size_t inBytesLeft = len;
// best case assumption, each byte is converted into one UTF-16 character, plus 2 bytes for the BOM
#ifdef GNU_LIBICONV
#if !QT_CONFIG(posix_libiconv)
// GNU doesn't disagree with POSIX :/
const char *inBytes = chars;
#else
@ -320,7 +282,7 @@ static bool setByteOrder(iconv_t cd)
size_t outBytesLeft = sizeof buf;
size_t inBytesLeft = sizeof bom;
#if defined(GNU_LIBICONV)
#if !QT_CONFIG(posix_libiconv)
const char **inBytesPtr = const_cast<const char **>(&inBytes);
#else
char **inBytesPtr = &inBytes;
@ -342,7 +304,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
char *outBytes;
size_t inBytesLeft;
#if defined(GNU_LIBICONV)
#if !QT_CONFIG(posix_libiconv)
const char **inBytesPtr = const_cast<const char **>(&inBytes);
#else
char **inBytesPtr = &inBytes;
@ -472,7 +434,7 @@ iconv_t QIconvCodec::createIconv_t(const char *to, const char *from) const
init();
iconv_t cd = (iconv_t) -1;
#if defined(__GLIBC__) || defined(GNU_LIBICONV) || defined(Q_OS_QNX)
#if defined(__GLIBC__) || !QT_CONFIG(posix_libiconv) || defined(Q_OS_QNX)
#if defined(Q_OS_QNX)
// on QNX the default locale is UTF-8, and an empty string will cause iconv_open to fail
static const char empty_codeset[] = "UTF-8";
@ -562,5 +524,3 @@ iconv_t QIconvCodec::createIconv_t(const char *to, const char *from) const
}
QT_END_NAMESPACE
#endif /* #ifndef QT_NO_ICONV */

View File

@ -54,13 +54,9 @@
#include <QtCore/private/qglobal_p.h>
#include "qtextcodec.h"
#if defined(Q_OS_UNIX) && !defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
QT_REQUIRE_CONFIG(iconv);
#ifdef Q_OS_MAC
typedef void * iconv_t;
#else
#include <iconv.h>
#endif
QT_BEGIN_NAMESPACE
@ -100,6 +96,4 @@ public:
QT_END_NAMESPACE
#endif // Q_OS_UNIX && !QT_NO_ICONV && !QT_BOOTSTRAPPED
#endif // QICONVCODEC_P_H

View File

@ -67,12 +67,12 @@ public:
explicit QSimpleTextCodec(int);
~QSimpleTextCodec();
QString convertToUnicode(const char *, int, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
QString convertToUnicode(const char *, int, ConverterState *) const override;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const override;
QByteArray name() const;
QList<QByteArray> aliases() const;
int mibEnum() const;
QByteArray name() const override;
QList<QByteArray> aliases() const override;
int mibEnum() const override;
private:
int forwardIndex;

View File

@ -61,7 +61,7 @@
#if defined(QT_USE_ICU)
#include "qicucodec_p.h"
#else
#if !defined(QT_NO_ICONV)
#if QT_CONFIG(iconv)
# include "qiconvcodec_p.h"
#endif
#ifdef Q_OS_WIN
@ -184,7 +184,7 @@ static QTextCodec *setupLocaleMapper()
if (charset)
locale = QTextCodec::codecForName(charset);
#endif
#if !defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
#if QT_CONFIG(iconv)
if (!locale) {
// no builtin codec for the locale found, let's try using iconv
(void) new QIconvCodec();
@ -286,7 +286,7 @@ static void setup()
(void)new QBig5Codec;
(void)new QBig5hkscsCodec;
# endif // !QT_NO_BIG_CODECS && !Q_OS_INTEGRITY
#if !defined(QT_NO_ICONV)
#if QT_CONFIG(iconv)
(void) new QIconvCodec;
#endif
#if defined(Q_OS_WIN32)

View File

@ -245,21 +245,21 @@
"label": "iconv",
"purpose": "Provides internationalization on Unix.",
"section": "Internationalization",
"condition": "features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv",
"condition": "!features.icu && (features.posix-libiconv || features.sun-libiconv || features.gnu-libiconv)",
"output": [ "privateFeature", "feature" ]
},
"posix-libiconv": {
"label": "POSIX iconv",
"enable": "input.iconv == 'posix'",
"disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'",
"condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv"
"condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv",
"output": [ "privateFeature" ]
},
"sun-libiconv": {
"label": "SUN iconv",
"enable": "input.iconv == 'sun'",
"disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'",
"condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv",
"output": [ "privateFeature", "publicQtConfig" ]
"condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv"
},
"gnu-libiconv": {
"label": "GNU iconv",
@ -372,11 +372,6 @@
"condition": "tests.syslog",
"output": [ "privateConfig" ]
},
"systemsemaphore": {
"label": "Enable QSystemSemaphore",
"condition": "config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix",
"output": [ { "type": "define", "negative": true, "name": "QT_NO_SYSTEMSEMAPHORE" } ]
},
"threadsafe-cloexec": {
"label": "Threadsafe pipe creation",
"condition": "tests.cloexec",
@ -401,12 +396,17 @@
"label": "QSharedMemory",
"purpose": "Provides access to a shared memory segment.",
"section": "Kernel",
"condition": "!config.vxworks",
"output": [ "publicFeature", "feature" ]
},
"systemsemaphore": {
"label": "QSystemSemaphore",
"purpose": "Provides a general counting system semaphore.",
"section": "Kernel",
"condition": [
"!config.integrity && !config.vxworks",
"config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix"
],
"output": [ "publicFeature", "feature" ]
},
"xmlstream": {
@ -446,6 +446,7 @@
"label": "QProcess",
"purpose": "Supports external process invocation.",
"section": "File I/O",
"condition": "!config.winrt && !config.uikit && !config.integrity && !config.vxworks",
"output": [ "publicFeature", "feature" ]
},
"temporaryfile": {
@ -470,6 +471,7 @@
"label": "QFileSystemWatcher",
"purpose": "Provides an interface for monitoring files and directories for modifications.",
"section": "File I/O",
"condition": "!config.winrt",
"output": [ "publicFeature", "feature" ]
},
"filesystemiterator": {

View File

@ -93,6 +93,12 @@ ctest_macros_file.CONFIG = verbatim
cmake_umbrella_config_file.input = $$PWD/Qt5Config.cmake.in
cmake_umbrella_config_file.output = $$DESTDIR/cmake/Qt5/Qt5Config.cmake
cmake_umbrella_config_module_location.input = $$PWD/Qt5ModuleLocation.cmake.in
cmake_umbrella_config_module_location.output = $$DESTDIR/cmake/Qt5/Qt5ModuleLocation.cmake
cmake_umbrella_config_module_location_for_install.input = $$PWD/Qt5ModuleLocationForInstall.cmake.in
cmake_umbrella_config_module_location_for_install.output = $$DESTDIR/cmake/install/Qt5/Qt5ModuleLocation.cmake
cmake_umbrella_config_version_file.input = $$PWD/../../mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion.cmake
@ -119,10 +125,21 @@ contains(CMAKE_INSTALL_DATA_DIR, "^\\.\\./.*"):!isEmpty(CMAKE_INSTALL_DATA_DIR)
cmake_extras_mkspec_dir_for_install.input = $$PWD/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in
cmake_extras_mkspec_dir_for_install.output = $$DESTDIR/cmake/install/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake
cmake_qt5_umbrella_module_files.files = $$cmake_umbrella_config_file.output $$cmake_umbrella_config_version_file.output
cmake_qt5_umbrella_module_files.files = \
$$cmake_umbrella_config_file.output \
$$cmake_umbrella_config_version_file.output \
$$cmake_umbrella_config_module_location_for_install.output
cmake_qt5_umbrella_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5
QMAKE_SUBSTITUTES += ctest_macros_file cmake_umbrella_config_file cmake_umbrella_config_version_file cmake_extras_mkspec_dir cmake_extras_mkspec_dir_for_install
QMAKE_SUBSTITUTES += \
ctest_macros_file \
cmake_umbrella_config_file \
cmake_umbrella_config_module_location \
cmake_umbrella_config_module_location_for_install \
cmake_umbrella_config_version_file \
cmake_extras_mkspec_dir \
cmake_extras_mkspec_dir_for_install
ctest_qt5_module_files.files += $$ctest_macros_file.output $$cmake_extras_mkspec_dir_for_install.output

View File

@ -986,6 +986,9 @@
# define Q_COMPILER_THREADSAFE_STATICS
# define Q_COMPILER_UNIFORM_INIT
# endif
# if _MSC_VER >= 1910
# define Q_COMPILER_CONSTEXPR
# endif
# endif /* __cplusplus */
#endif /* Q_CC_MSVC */
@ -1270,6 +1273,7 @@
# define QT_WARNING_DISABLE_INTEL(number) __pragma(warning(disable: number))
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1786)
#elif defined(Q_CC_INTEL)
/* icc: Intel compiler on Linux or OS X */
# define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push))
@ -1278,6 +1282,7 @@
# define QT_WARNING_DISABLE_MSVC(number)
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_INTEL(1786)
#elif defined(Q_CC_MSVC) && _MSC_VER >= 1500 && !defined(Q_CC_CLANG)
# undef QT_DO_PRAGMA /* not needed */
# define QT_WARNING_PUSH __pragma(warning(push))
@ -1286,6 +1291,7 @@
# define QT_WARNING_DISABLE_INTEL(number)
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_MSVC(4996)
#elif defined(Q_CC_CLANG)
# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
@ -1293,6 +1299,7 @@
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_DISABLE_INTEL(number)
# define QT_WARNING_DISABLE_MSVC(number)
# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
@ -1300,6 +1307,7 @@
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_INTEL(number)
# define QT_WARNING_DISABLE_MSVC(number)
# define QT_WARNING_DISABLE_DEPRECATED QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
#else // All other compilers, GCC < 4.6 and MSVC < 2008
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_PUSH
@ -1308,6 +1316,7 @@
# define QT_WARNING_DISABLE_MSVC(number)
# define QT_WARNING_DISABLE_CLANG(text)
# define QT_WARNING_DISABLE_GCC(text)
# define QT_WARNING_DISABLE_DEPRECATED
#endif
/*

View File

@ -68,6 +68,7 @@
#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1
#define QT_NO_DATASTREAM
#define QT_FEATURE_iconv -1
#define QT_NO_LIBRARY
#define QT_FEATURE_library -1
#define QT_NO_QOBJECT

View File

@ -1244,6 +1244,12 @@ bool qSharedBuild() Q_DECL_NOTHROW
\value MV_TVOS_9_2 tvOS 9.2
\value MV_TVOS_10_0 tvOS 10.0
\value MV_WATCHOS watchOS (any)
\value MV_WATCHOS_2_0 watchOS 2.0
\value MV_WATCHOS_2_1 watchOS 2.1
\value MV_WATCHOS_2_2 watchOS 2.2
\value MV_WATCHOS_3_0 watchOS 3.0
\value MV_None Not a Darwin operating system
\sa WinVersion

View File

@ -619,32 +619,6 @@ private:
class QDataStream;
#if defined(Q_OS_VXWORKS)
# define QT_NO_CRASHHANDLER // no popen
# define QT_NO_PROCESS // no exec*, no fork
# define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end...
# define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space
#endif
#if defined(Q_OS_WINRT)
# define QT_NO_FILESYSTEMWATCHER
# define QT_NO_NETWORKPROXY
# define QT_NO_PROCESS
# define QT_NO_SOCKETNOTIFIER
# define QT_NO_SOCKS5
#endif
#if defined(QT_PLATFORM_UIKIT)
# define QT_NO_PROCESS
#endif
#if defined(Q_OS_INTEGRITY)
# define QT_NO_CRASHHANDLER // no popen
# define QT_NO_PROCESS // no exec*, no fork
# define QT_NO_SYSTEMSEMAPHORE // not needed at all in a single AddressSpace
# define QT_NO_MULTIPROCESS // no system
#endif
inline void qt_noop(void) {}
/* These wrap try/catch so we can switch off exceptions later.

View File

@ -318,8 +318,10 @@ QLibraryInfo::buildDate()
# define COMPILER_STRING "MSVC 2012"
# elif _MSC_VER < 1900
# define COMPILER_STRING "MSVC 2013"
# elif _MSC_VER < 2000
# elif _MSC_VER < 1910
# define COMPILER_STRING "MSVC 2015"
# elif _MSC_VER < 2000
# define COMPILER_STRING "MSVC 2017"
# else
# define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER)
# endif

View File

@ -1779,7 +1779,7 @@ void qErrnoWarning(int code, const char *msg, ...)
\snippet code/src_corelib_global_qglobal.cpp 23
\sa QtMessageHandler, QtMsgType, qDebug(), qWarning(), qCritical(), qFatal(),
\sa QtMessageHandler, QtMsgType, qDebug(), qInfo(), qWarning(), qCritical(), qFatal(),
{Debugging Techniques}
*/

View File

@ -0,0 +1,373 @@
Mozilla Public License Version 2.0
==================================
1. Definitions
--------------
1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.
1.3. "Contribution"
means Covered Software of a particular Contributor.
1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.
1.5. "Incompatible With Secondary Licenses"
means
(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View File

@ -70,7 +70,7 @@ protected:
bool openExternalFile(int flags, int fd, QFile::FileHandleFlags handleFlags);
bool openExternalFile(int flags, FILE *fh, QFile::FileHandleFlags handleFlags);
virtual QAbstractFileEngine *engine() const;
QAbstractFileEngine *engine() const override;
QString fileName;
};

View File

@ -65,6 +65,13 @@
#include <MobileCoreServices/MobileCoreServices.h>
#endif
#if defined(Q_OS_DARWIN)
// We cannot include <Foundation/Foundation.h> (it's an Objective-C header), but
// we need these declarations:
Q_FORWARD_DECLARE_OBJC_CLASS(NSString);
extern "C" NSString *NSTemporaryDirectory();
#endif
QT_BEGIN_NAMESPACE
#if defined(Q_OS_DARWIN)
@ -703,8 +710,17 @@ QString QFileSystemEngine::tempPath()
return QLatin1String(QT_UNIX_TEMP_PATH_OVERRIDE);
#else
QString temp = QFile::decodeName(qgetenv("TMPDIR"));
if (temp.isEmpty())
temp = QLatin1String("/tmp");
if (temp.isEmpty()) {
#if defined(Q_OS_DARWIN) && !defined(QT_BOOTSTRAPPED)
if (NSString *nsPath = NSTemporaryDirectory()) {
temp = QString::fromCFString((CFStringRef)nsPath);
} else {
#else
{
#endif
temp = QLatin1String("/tmp");
}
}
return QDir::cleanPath(temp);
#endif
}

View File

@ -49,6 +49,7 @@
#include "qdatetime.h"
#include "qbytearray.h"
#include "qstringlist.h"
#include "qendian.h"
#include <qshareddata.h>
#include <qplatformdefs.h>
#include "private/qabstractfileengine_p.h"
@ -101,35 +102,38 @@ class QResourceRoot
Directory = 0x02
};
const uchar *tree, *names, *payloads;
inline int findOffset(int node) const { return node * 14; } //sizeof each tree element
int version;
inline int findOffset(int node) const { return node * (14 + (version >= 0x02 ? 8 : 0)); } //sizeof each tree element
uint hash(int node) const;
QString name(int node) const;
short flags(int node) const;
public:
mutable QAtomicInt ref;
inline QResourceRoot(): tree(0), names(0), payloads(0) {}
inline QResourceRoot(const uchar *t, const uchar *n, const uchar *d) { setSource(t, n, d); }
inline QResourceRoot(): tree(0), names(0), payloads(0), version(0) {}
inline QResourceRoot(int version, const uchar *t, const uchar *n, const uchar *d) { setSource(version, t, n, d); }
virtual ~QResourceRoot() { }
int findNode(const QString &path, const QLocale &locale=QLocale()) const;
inline bool isContainer(int node) const { return flags(node) & Directory; }
inline bool isCompressed(int node) const { return flags(node) & Compressed; }
const uchar *data(int node, qint64 *size) const;
QDateTime lastModified(int node) const;
QStringList children(int node) const;
virtual QString mappingRoot() const { return QString(); }
bool mappingRootSubdir(const QString &path, QString *match=0) const;
inline bool operator==(const QResourceRoot &other) const
{ return tree == other.tree && names == other.names && payloads == other.payloads; }
{ return tree == other.tree && names == other.names && payloads == other.payloads && version == other.version; }
inline bool operator!=(const QResourceRoot &other) const
{ return !operator==(other); }
enum ResourceRootType { Resource_Builtin, Resource_File, Resource_Buffer };
virtual ResourceRootType type() const { return Resource_Builtin; }
protected:
inline void setSource(const uchar *t, const uchar *n, const uchar *d) {
inline void setSource(int v, const uchar *t, const uchar *n, const uchar *d) {
tree = t;
names = n;
payloads = d;
version = v;
}
};
@ -231,6 +235,7 @@ public:
mutable qint64 size;
mutable const uchar *data;
mutable QStringList children;
mutable QDateTime lastModified;
QResource *q_ptr;
Q_DECLARE_PUBLIC(QResource)
@ -244,6 +249,7 @@ QResourcePrivate::clear()
data = 0;
size = 0;
children.clear();
lastModified = QDateTime();
container = 0;
for(int i = 0; i < related.size(); ++i) {
QResourceRoot *root = related.at(i);
@ -274,6 +280,7 @@ QResourcePrivate::load(const QString &file)
size = 0;
compressed = 0;
}
lastModified = res->lastModified(node);
} else if(res->isContainer(node) != container) {
qWarning("QResourceInfo: Resource [%s] has both data and children!", file.toLatin1().constData());
}
@ -284,6 +291,7 @@ QResourcePrivate::load(const QString &file)
data = 0;
size = 0;
compressed = 0;
lastModified = QDateTime();
res->ref.ref();
related.append(res);
}
@ -513,6 +521,17 @@ const uchar *QResource::data() const
return d->data;
}
/*!
Returns the date and time when the file was last modified before
packaging into a resource.
*/
QDateTime QResource::lastModified() const
{
Q_D(const QResource);
d->ensureInitialized();
return d->lastModified;
}
/*!
Returns \c true if the resource represents a directory and thus may have
children() in it, false if it represents a file.
@ -588,11 +607,9 @@ inline uint QResourceRoot::hash(int node) const
if(!node) //root
return 0;
const int offset = findOffset(node);
int name_offset = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
qint32 name_offset = qFromBigEndian<qint32>(tree + offset);
name_offset += 2; //jump past name length
return (names[name_offset+0] << 24) + (names[name_offset+1] << 16) +
(names[name_offset+2] << 8) + (names[name_offset+3] << 0);
return qFromBigEndian<quint32>(names + name_offset);
}
inline QString QResourceRoot::name(int node) const
{
@ -601,10 +618,8 @@ inline QString QResourceRoot::name(int node) const
const int offset = findOffset(node);
QString ret;
int name_offset = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
const short name_length = (names[name_offset+0] << 8) +
(names[name_offset+1] << 0);
qint32 name_offset = qFromBigEndian<qint32>(tree + offset);
const qint16 name_length = qFromBigEndian<qint16>(names + name_offset);
name_offset += 2;
name_offset += 4; //jump past hash
@ -644,10 +659,8 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
return 0;
//the root node is always first
int child_count = (tree[6] << 24) + (tree[7] << 16) +
(tree[8] << 8) + (tree[9] << 0);
int child = (tree[10] << 24) + (tree[11] << 16) +
(tree[12] << 8) + (tree[13] << 0);
qint32 child_count = qFromBigEndian<qint32>(tree + 6);
qint32 child = qFromBigEndian<qint32>(tree + 10);
//now iterate up the tree
int node = -1;
@ -693,18 +706,15 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
#endif
offset += 4; //jump past name
const short flags = (tree[offset+0] << 8) +
(tree[offset+1] << 0);
const qint16 flags = qFromBigEndian<qint16>(tree + offset);
offset += 2;
if(!splitter.hasNext()) {
if(!(flags & Directory)) {
const short country = (tree[offset+0] << 8) +
(tree[offset+1] << 0);
const qint16 country = qFromBigEndian<qint16>(tree + offset);
offset += 2;
const short language = (tree[offset+0] << 8) +
(tree[offset+1] << 0);
const qint16 language = qFromBigEndian<qint16>(tree + offset);
offset += 2;
#ifdef DEBUG_RESOURCE_MATCH
qDebug() << " " << "LOCALE" << country << language;
@ -731,11 +741,9 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
if(!(flags & Directory))
return -1;
child_count = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
child_count = qFromBigEndian<qint32>(tree + offset);
offset += 4;
child = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
child = qFromBigEndian<qint32>(tree + offset);
break;
}
}
@ -753,7 +761,7 @@ short QResourceRoot::flags(int node) const
if(node == -1)
return 0;
const int offset = findOffset(node) + 4; //jump past name
return (tree[offset+0] << 8) + (tree[offset+1] << 0);
return qFromBigEndian<qint16>(tree + offset);
}
const uchar *QResourceRoot::data(int node, qint64 *size) const
{
@ -763,16 +771,14 @@ const uchar *QResourceRoot::data(int node, qint64 *size) const
}
int offset = findOffset(node) + 4; //jump past name
const short flags = (tree[offset+0] << 8) + (tree[offset+1] << 0);
const qint16 flags = qFromBigEndian<qint16>(tree + offset);
offset += 2;
offset += 4; //jump past locale
if(!(flags & Directory)) {
const int data_offset = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
const uint data_length = (payloads[data_offset+0] << 24) + (payloads[data_offset+1] << 16) +
(payloads[data_offset+2] << 8) + (payloads[data_offset+3] << 0);
const qint32 data_offset = qFromBigEndian<qint32>(tree + offset);
const quint32 data_length = qFromBigEndian<quint32>(payloads + data_offset);
const uchar *ret = payloads+data_offset+4;
*size = data_length;
return ret;
@ -780,22 +786,35 @@ const uchar *QResourceRoot::data(int node, qint64 *size) const
*size = 0;
return 0;
}
QDateTime QResourceRoot::lastModified(int node) const
{
if (node == -1 || version < 0x02)
return QDateTime();
const int offset = findOffset(node) + 14;
const quint64 timeStamp = qFromBigEndian<quint64>(tree + offset);
if (timeStamp == 0)
return QDateTime();
return QDateTime::fromMSecsSinceEpoch(timeStamp);
}
QStringList QResourceRoot::children(int node) const
{
if(node == -1)
return QStringList();
int offset = findOffset(node) + 4; //jump past name
const short flags = (tree[offset+0] << 8) + (tree[offset+1] << 0);
const qint16 flags = qFromBigEndian<qint16>(tree + offset);
offset += 2;
QStringList ret;
if(flags & Directory) {
const int child_count = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
const qint32 child_count = qFromBigEndian<qint32>(tree + offset);
offset += 4;
const int child_off = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
const qint32 child_off = qFromBigEndian<qint32>(tree + offset);
ret.reserve(child_count);
for(int i = child_off; i < child_off+child_count; ++i)
ret << name(i);
@ -829,9 +848,9 @@ Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree,
const unsigned char *name, const unsigned char *data)
{
QMutexLocker lock(resourceMutex());
if(version == 0x01 && resourceList()) {
if ((version == 0x01 || version == 0x2) && resourceList()) {
bool found = false;
QResourceRoot res(tree, name, data);
QResourceRoot res(version, tree, name, data);
for(int i = 0; i < resourceList()->size(); ++i) {
if(*resourceList()->at(i) == res) {
found = true;
@ -839,7 +858,7 @@ Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree,
}
}
if(!found) {
QResourceRoot *root = new QResourceRoot(tree, name, data);
QResourceRoot *root = new QResourceRoot(version, tree, name, data);
root->ref.ref();
resourceList()->append(root);
}
@ -852,8 +871,8 @@ Q_CORE_EXPORT bool qUnregisterResourceData(int version, const unsigned char *tre
const unsigned char *name, const unsigned char *data)
{
QMutexLocker lock(resourceMutex());
if(version == 0x01 && resourceList()) {
QResourceRoot res(tree, name, data);
if ((version == 0x01 || version == 0x02) && resourceList()) {
QResourceRoot res(version, tree, name, data);
for(int i = 0; i < resourceList()->size(); ) {
if(*resourceList()->at(i) == res) {
QResourceRoot *root = resourceList()->takeAt(i);
@ -899,29 +918,25 @@ public:
}
offset += 4;
const int version = (b[offset+0] << 24) + (b[offset+1] << 16) +
(b[offset+2] << 8) + (b[offset+3] << 0);
const int version = qFromBigEndian<qint32>(b + offset);
offset += 4;
const int tree_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
(b[offset+2] << 8) + (b[offset+3] << 0);
const int tree_offset = qFromBigEndian<qint32>(b + offset);
offset += 4;
const int data_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
(b[offset+2] << 8) + (b[offset+3] << 0);
const int data_offset = qFromBigEndian<qint32>(b + offset);
offset += 4;
const int name_offset = (b[offset+0] << 24) + (b[offset+1] << 16) +
(b[offset+2] << 8) + (b[offset+3] << 0);
const int name_offset = qFromBigEndian<qint32>(b + offset);
offset += 4;
// Some sanity checking for sizes. This is _not_ a security measure.
if (size >= 0 && (tree_offset >= size || data_offset >= size || name_offset >= size))
return false;
if(version == 0x01) {
if (version == 0x01 || version == 0x02) {
buffer = b;
setSource(b+tree_offset, b+name_offset, b+data_offset);
setSource(version, b+tree_offset, b+name_offset, b+data_offset);
return true;
}
return false;
@ -1430,8 +1445,11 @@ QString QResourceFileEngine::owner(FileOwner) const
return QString();
}
QDateTime QResourceFileEngine::fileTime(FileTime) const
QDateTime QResourceFileEngine::fileTime(FileTime time) const
{
Q_D(const QResourceFileEngine);
if (time == ModificationTime)
return d->resource.lastModified();
return QDateTime();
}

View File

@ -69,6 +69,7 @@ public:
bool isCompressed() const;
qint64 size() const;
const uchar *data() const;
QDateTime lastModified() const;
static void addSearchPath(const QString &path);
static QStringList searchPaths();

View File

@ -97,14 +97,6 @@ using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Storage;
#endif
#ifndef CSIDL_COMMON_APPDATA
#define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
#endif
#ifndef CSIDL_APPDATA
#define CSIDL_APPDATA 0x001a // <username>\Application Data
#endif
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID)
#define Q_XDG_PLATFORM
#endif
@ -959,31 +951,34 @@ void QConfFileSettingsPrivate::initAccess()
}
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
static QString windowsConfigPath(int type)
static QString windowsConfigPath(const KNOWNFOLDERID &type)
{
QString result;
wchar_t path[MAX_PATH];
if (SHGetSpecialFolderPath(0, path, type, false))
PWSTR path = nullptr;
if (SHGetKnownFolderPath(type, KF_FLAG_DONT_VERIFY, NULL, &path) == S_OK) {
result = QString::fromWCharArray(path);
CoTaskMemFree(path);
}
if (result.isEmpty()) {
switch (type) {
case CSIDL_COMMON_APPDATA:
if (type == FOLDERID_ProgramData) {
result = QLatin1String("C:\\temp\\qt-common");
break;
case CSIDL_APPDATA:
} else if (type == FOLDERID_RoamingAppData) {
result = QLatin1String("C:\\temp\\qt-user");
break;
default:
;
}
}
return result;
}
#elif defined(Q_OS_WINRT) // Q_OS_WIN && !Q_OS_WINRT
static QString windowsConfigPath(int type)
enum ConfigPathType {
ConfigPath_CommonAppData,
ConfigPath_UserAppData
};
static QString windowsConfigPath(ConfigPathType type)
{
static QString result;
while (result.isEmpty()) {
@ -1006,12 +1001,10 @@ static QString windowsConfigPath(int type)
}
switch (type) {
case CSIDL_COMMON_APPDATA:
case ConfigPath_CommonAppData:
return result + QLatin1String("\\qt-common");
case CSIDL_APPDATA:
case ConfigPath_UserAppData:
return result + QLatin1String("\\qt-user");
default:
break;
}
return result;
}
@ -1068,10 +1061,18 @@ static void initDefaultPaths(QMutexLocker *locker)
Windows registry and the Mac CFPreferences.)
*/
#ifdef Q_OS_WIN
# ifdef Q_OS_WINRT
const QString roamingAppDataFolder = windowsConfigPath(ConfigPath_UserAppData);
const QString programDataFolder = windowsConfigPath(ConfigPath_CommonAppData);
# else
const QString roamingAppDataFolder = windowsConfigPath(FOLDERID_RoamingAppData);
const QString programDataFolder = windowsConfigPath(FOLDERID_ProgramData);
# endif
pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope),
windowsConfigPath(CSIDL_APPDATA) + QDir::separator());
roamingAppDataFolder + QDir::separator());
pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::SystemScope),
windowsConfigPath(CSIDL_COMMON_APPDATA) + QDir::separator());
programDataFolder + QDir::separator());
#else
const QString userPath = make_user_path();
pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::UserScope), userPath);
@ -2231,20 +2232,20 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
On Windows, the following files are used:
\list 1
\li \c{CSIDL_APPDATA\MySoft\Star Runner.ini}
\li \c{CSIDL_APPDATA\MySoft.ini}
\li \c{CSIDL_COMMON_APPDATA\MySoft\Star Runner.ini}
\li \c{CSIDL_COMMON_APPDATA\MySoft.ini}
\li \c{FOLDERID_RoamingAppData\MySoft\Star Runner.ini}
\li \c{FOLDERID_RoamingAppData\MySoft.ini}
\li \c{FOLDERID_ProgramData\MySoft\Star Runner.ini}
\li \c{FOLDERID_ProgramData\MySoft.ini}
\endlist
The identifiers prefixed by \c{CSIDL_} are special item ID lists to be passed
to the Win32 API function \c{SHGetSpecialFolderPath()} to obtain the
The identifiers prefixed by \c{FOLDERID_} are special item ID lists to be passed
to the Win32 API function \c{SHGetKnownFolderPath()} to obtain the
corresponding path.
\c{CSIDL_APPDATA} usually points to \tt{C:\\Users\\\e{User Name}\\AppData\\Roaming},
\c{FOLDERID_RoamingAppData} usually points to \tt{C:\\Users\\\e{User Name}\\AppData\\Roaming},
also shown by the environment variable \c{%APPDATA%}.
\c{CSIDL_COMMON_APPDATA} usually points to \tt{C:\\ProgramData}.
\c{FOLDERID_ProgramData} usually points to \tt{C:\\ProgramData}.
If the file format is IniFormat, this is "Settings/MySoft/Star Runner.ini"
in the application's home directory.
@ -3348,8 +3349,8 @@ void QSettings::setUserIniPath(const QString &dir)
\table
\header \li Platform \li Format \li Scope \li Path
\row \li{1,2} Windows \li{1,2} IniFormat \li UserScope \li \c CSIDL_APPDATA
\row \li SystemScope \li \c CSIDL_COMMON_APPDATA
\row \li{1,2} Windows \li{1,2} IniFormat \li UserScope \li \c FOLDERID_RoamingAppData
\row \li SystemScope \li \c FOLDERID_ProgramData
\row \li{1,2} Unix \li{1,2} NativeFormat, IniFormat \li UserScope \li \c $HOME/.config
\row \li SystemScope \li \c /etc/xdg
\row \li{1,2} Qt for Embedded Linux \li{1,2} NativeFormat, IniFormat \li UserScope \li \c $HOME/Settings

View File

@ -1,3 +1,4 @@
[
{
"Id": "qtemporaryfile",
"Name": "Parts of QTemporaryFile",
@ -10,4 +11,32 @@
"LicenseId": "BSD-3-Clause",
"LicenseFile": "QTEMPORARYFILE_LICENSE.txt",
"Copyright": "Copyright (c) 1987, 1993 The Regents of the University of California."
},
{
"Id": "psl",
"Name": "The Public Suffix List",
"QDocModule": "qtcore",
"Description": "The Public Suffix List is an initiative of the Mozilla Project,
but is maintained as a community resource. It is available for use in any software,
but was originally created to meet the needs of browser manufacturers.
It allows browsers to, for example:
- Avoid privacy-damaging \"supercookies\" being set for high-level domain name suffixes
- Highlight the most important part of a domain name in the user interface
- Accurately sort history entries by site",
"Files": "qurltlds_p.h",
"QtUsage": "Used in Qt Core to avoid \"supercookies\" being set in the cookie jar
supported by Qt (by the QNetworkCookieJar class).",
"Homepage": "http://publicsuffix.org/",
"Version": "Generated on 2016-10-20 from revision 915565885d0fbd25caf7d8b339cd3478f558da94",
"License": "Mozilla Public License 2.0",
"LicenseFile": "PSL-LICENSE.txt",
"LicenseId": "MPL-2.0",
"Copyright": "The list was originally provided by Jo Hermans <jo.hermans@gmail.com>.
It is now maintained on github (https://github.com/publicsuffix/list)."
}
]

View File

@ -70,7 +70,7 @@ protected:
explicit QTemporaryFilePrivate(const QString &templateNameIn);
~QTemporaryFilePrivate();
QAbstractFileEngine *engine() const;
QAbstractFileEngine *engine() const override;
void resetFileEngine() const;
bool autoRemove = true;
@ -99,14 +99,14 @@ public:
~QTemporaryFileEngine();
bool isReallyOpen() const;
void setFileName(const QString &file);
void setFileName(const QString &file) override;
void setFileTemplate(const QString &fileTemplate);
bool open(QIODevice::OpenMode flags);
bool remove();
bool rename(const QString &newName);
bool renameOverwrite(const QString &newName);
bool close();
bool open(QIODevice::OpenMode flags) override;
bool remove() override;
bool rename(const QString &newName) override;
bool renameOverwrite(const QString &newName) override;
bool close() override;
quint32 fileMode;
bool filePathIsTemplate;

View File

@ -3690,6 +3690,9 @@ bool QUrl::matches(const QUrl &url, FormattingOptions options) const
if ((d->sectionIsPresent & mask) != (url.d->sectionIsPresent & mask))
return false;
if (options & QUrl::RemovePath)
return true;
// Compare paths, after applying path-related options
QString path1;
d->appendPath(path1, options, QUrlPrivate::Path);

View File

@ -9,9 +9,6 @@ Those arrays in qurltlds_p.h are derived from the Public
Suffix List ([2]), which was originally provided by
Jo Hermans <jo.hermans@gmail.com>.
The file qurltlds_p.h was last generated Thursday,
October 20th 8:40 2016.
----
[1] list: http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1
[2] homepage: http://publicsuffix.org/

View File

@ -500,9 +500,10 @@ namespace {
memcpy(newValues, data, size*sizeof(QJsonPrivate::Value));
data = newValues;
} else {
data = static_cast<QJsonPrivate::Value *>(realloc(data, alloc*sizeof(QJsonPrivate::Value)));
if (!data)
void *newValues = realloc(data, alloc * sizeof(QJsonPrivate::Value));
if (!newValues)
return false;
data = static_cast<QJsonPrivate::Value *>(newValues);
}
return true;
}

View File

@ -108,11 +108,12 @@ private:
inline int reserveSpace(int space) {
if (current + space >= dataLength) {
dataLength = 2*dataLength + space;
data = (char *)realloc(data, dataLength);
if (!data) {
char *newData = (char *)realloc(data, dataLength);
if (!newData) {
lastError = QJsonParseError::DocumentTooLarge;
return -1;
}
data = newData;
}
int pos = current;
current += space;

View File

@ -173,9 +173,9 @@ Q_DECL_CONST_FUNCTION static inline QPair<qint64, qint64> toSecsAndNSecs(qint64
*/
/*!
\fn QDeadlineTimer::QDeadlineTimer(ForeverConstant, Qt::TimerType timerType)
\fn QDeadlineTimer::QDeadlineTimer(ForeverConstant foreverConstant, Qt::TimerType timerType)
QDeadlineTimer objects created with parameter \a ForeverConstant never expire.
QDeadlineTimer objects created with parameter \a foreverConstant never expire.
For such objects, remainingTime() will return -1, deadline() will return the
maximum value, and isForever() will return true.
@ -295,7 +295,7 @@ void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) Q_D
parameters are zero, this QDeadlineTimer will be marked as expired.
The timer type for this QDeadlineTimer object will be set to the specified
\a type.
\a timerType.
\sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
*/
@ -341,24 +341,7 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time
*/
/*!
\fn void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, unsigned nsecs, Qt::TimerType type)
Sets the remaining time for this QDeadlineTimer object to \a secs seconds
and \a nsecs nanoseconds from now, if \a secs is a positive value. If both
values are zero, this QDeadlineTimer object will be marked as expired,
whereas if \a secs is -1, it will set it to never expire.
If value of \a nsecs is more than 1 billion nanoseconds (1 second), this
function will adjust \a secs accordingly.
The timer type for this QDeadlineTimer object will be set to the specified \a type.
\sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
*/
/*!
\overload
\fn Duration QDeadlineTimer::remainingTime() const
\fn std::chrono::nanoseconds remainingTimeAsDuration() const
Returns a \c{std::chrono::duration} object of type \c{Duration} containing
the remaining time in this QDeadlineTimer, if it still has time left. If

View File

@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
\snippet qelapsedtimer/main.cpp 2
It is often more convenient to use \ref{QDeadlineTimer} in this case, which
It is often more convenient to use \l{QDeadlineTimer} in this case, which
counts towards a timeout in the future instead of tracking elapsed time.
\section1 Reference Clocks

View File

@ -229,8 +229,14 @@ namespace QtPrivate {
(std::is_floating_point<From>::value && std::is_integral<To>::value) ||
(std::is_floating_point<From>::value && std::is_floating_point<To>::value && sizeof(From) > sizeof(To)) ||
((std::is_integral<From>::value || std::is_enum<From>::value) && std::is_floating_point<To>::value) ||
(std::is_integral<From>::value && std::is_integral<To>::value && (sizeof(From) > sizeof(To) || std::is_signed<From>::value != std::is_signed<To>::value)) ||
(std::is_enum<From>::value && std::is_integral<To>::value && (sizeof(From) > sizeof(To) || IsEnumUnderlyingTypeSigned<From>::value != std::is_signed<To>::value))
(std::is_integral<From>::value && std::is_integral<To>::value
&& (sizeof(From) > sizeof(To)
|| (std::is_signed<From>::value ? !std::is_signed<To>::value
: (std::is_signed<To>::value && sizeof(From) == sizeof(To))))) ||
(std::is_enum<From>::value && std::is_integral<To>::value
&& (sizeof(From) > sizeof(To)
|| (IsEnumUnderlyingTypeSigned<From>::value ? !std::is_signed<To>::value
: (std::is_signed<To>::value && sizeof(From) == sizeof(To)))))
>
{
};

View File

@ -264,7 +264,7 @@ bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent)
\code
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/vnd.nokia.qt.qmakeprofile">
<mime-type type="application/vnd.qt.qmakeprofile">
<comment xml:lang="en">Qt qmake Profile</comment>
<glob pattern="*.pro" weight="50"/>
</mime-type>

View File

@ -108,19 +108,19 @@ public:
explicit QMimeTypeParser(QMimeXMLProvider &provider) : m_provider(provider) {}
protected:
inline bool process(const QMimeType &t, QString *)
inline bool process(const QMimeType &t, QString *) override
{ m_provider.addMimeType(t); return true; }
inline bool process(const QMimeGlobPattern &glob, QString *)
inline bool process(const QMimeGlobPattern &glob, QString *) override
{ m_provider.addGlobPattern(glob); return true; }
inline void processParent(const QString &child, const QString &parent)
inline void processParent(const QString &child, const QString &parent) override
{ m_provider.addParent(child, parent); }
inline void processAlias(const QString &alias, const QString &name)
inline void processAlias(const QString &alias, const QString &name) override
{ m_provider.addAlias(alias, name); }
inline void processMagicMatcher(const QMimeMagicRuleMatcher &matcher)
inline void processMagicMatcher(const QMimeMagicRuleMatcher &matcher) override
{ m_provider.addMagicMatcher(matcher); }
private:

View File

@ -88,8 +88,8 @@ protected:
// state, it will handle this transition as a special case. The history state itself is never
// entered either: either the stored configuration will be used, or the target(s) of this
// transition are used.
virtual bool eventTest(QEvent *event) { Q_UNUSED(event); return false; }
virtual void onTransition(QEvent *event) { Q_UNUSED(event); }
bool eventTest(QEvent *event) override { Q_UNUSED(event); return false; }
void onTransition(QEvent *event) override { Q_UNUSED(event); }
};
QT_END_NAMESPACE

View File

@ -61,6 +61,9 @@
# error "Qt requires C++11 support"
#endif
QT_WARNING_PUSH
QT_WARNING_DISABLE_MSVC(4522)
QT_BEGIN_NAMESPACE
#if 0
@ -323,4 +326,6 @@ public:
QT_END_NAMESPACE
QT_WARNING_POP
#endif // QBASICATOMIC_H

View File

@ -83,13 +83,33 @@ QFutureInterfaceBase::~QFutureInterfaceBase()
delete d;
}
static inline int switch_on(QAtomicInt &a, int which)
{
return a.fetchAndOrRelaxed(which) | which;
}
static inline int switch_off(QAtomicInt &a, int which)
{
return a.fetchAndAndRelaxed(~which) & ~which;
}
static inline int switch_from_to(QAtomicInt &a, int from, int to)
{
int newValue;
int expected = a.load();
do {
newValue = (expected & ~from) | to;
} while (!a.testAndSetRelaxed(expected, newValue, expected));
return newValue;
}
void QFutureInterfaceBase::cancel()
{
QMutexLocker locker(&d->m_mutex);
if (d->state & Canceled)
if (d->state.load() & Canceled)
return;
d->state = State((d->state & ~Paused) | Canceled);
switch_from_to(d->state, Paused, Canceled);
d->waitCondition.wakeAll();
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
@ -99,10 +119,10 @@ void QFutureInterfaceBase::setPaused(bool paused)
{
QMutexLocker locker(&d->m_mutex);
if (paused) {
d->state = State(d->state | Paused);
switch_on(d->state, Paused);
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
} else {
d->state = State(d->state & ~Paused);
switch_off(d->state, Paused);
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed));
}
@ -111,29 +131,24 @@ void QFutureInterfaceBase::setPaused(bool paused)
void QFutureInterfaceBase::togglePaused()
{
QMutexLocker locker(&d->m_mutex);
if (d->state & Paused) {
d->state = State(d->state & ~Paused);
if (d->state.load() & Paused) {
switch_off(d->state, Paused);
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed));
} else {
d->state = State(d->state | Paused);
switch_on(d->state, Paused);
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
}
}
void QFutureInterfaceBase::setThrottled(bool enable)
{
// bail out if we are not changing the state
if ((enable && (d->state & Throttled)) || (!enable && !(d->state & Throttled)))
return;
// lock and change the state
QMutexLocker lock(&d->m_mutex);
if (enable) {
d->state = State(d->state | Throttled);
switch_on(d->state, Throttled);
} else {
d->state = State(d->state & ~Throttled);
if (!(d->state & Paused))
switch_off(d->state, Throttled);
if (!(d->state.load() & Paused))
d->pausedWaitCondition.wakeAll();
}
}
@ -184,11 +199,15 @@ bool QFutureInterfaceBase::waitForNextResult()
void QFutureInterfaceBase::waitForResume()
{
// return early if possible to avoid taking the mutex lock.
if ((d->state & Paused) == false || (d->state & Canceled))
return;
{
const int state = d->state.load();
if (!(state & Paused) || (state & Canceled))
return;
}
QMutexLocker lock(&d->m_mutex);
if ((d->state & Paused) == false || (d->state & Canceled))
const int state = d->state.load();
if (!(state & Paused) || (state & Canceled))
return;
// decrease active thread count since this thread will wait.
@ -236,7 +255,7 @@ bool QFutureInterfaceBase::isProgressUpdateNeeded() const
void QFutureInterfaceBase::reportStarted()
{
QMutexLocker locker(&d->m_mutex);
if ((d->state & Started) || (d->state & Canceled) || (d->state & Finished))
if (d->state.load() & (Started|Canceled|Finished))
return;
d->setState(State(Started | Running));
@ -252,11 +271,11 @@ void QFutureInterfaceBase::reportCanceled()
void QFutureInterfaceBase::reportException(const QException &exception)
{
QMutexLocker locker(&d->m_mutex);
if ((d->state & Canceled) || (d->state & Finished))
if (d->state.load() & (Canceled|Finished))
return;
d->m_exceptionStore.setException(exception);
d->state = State(d->state | Canceled);
switch_on(d->state, Canceled);
d->waitCondition.wakeAll();
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
@ -266,8 +285,8 @@ void QFutureInterfaceBase::reportException(const QException &exception)
void QFutureInterfaceBase::reportFinished()
{
QMutexLocker locker(&d->m_mutex);
if (!(d->state & Finished)) {
d->state = State((d->state & ~Running) | Finished);
if (!isFinished()) {
switch_from_to(d->state, Running, Finished);
d->waitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Finished));
}
@ -287,7 +306,7 @@ int QFutureInterfaceBase::expectedResultCount()
bool QFutureInterfaceBase::queryState(State state) const
{
return (d->state & state);
return d->state.load() & state;
}
void QFutureInterfaceBase::waitForResult(int resultIndex)
@ -295,7 +314,7 @@ void QFutureInterfaceBase::waitForResult(int resultIndex)
d->m_exceptionStore.throwPossibleException();
QMutexLocker lock(&d->m_mutex);
if (!(d->state & Running))
if (!isRunning())
return;
lock.unlock();
@ -305,11 +324,9 @@ void QFutureInterfaceBase::waitForResult(int resultIndex)
lock.relock();
if (d->state & Running) {
const int waitIndex = (resultIndex == -1) ? INT_MAX : resultIndex;
while ((d->state & Running) && d->internal_isResultReadyAt(waitIndex) == false)
d->waitCondition.wait(&d->m_mutex);
}
const int waitIndex = (resultIndex == -1) ? INT_MAX : resultIndex;
while (isRunning() && !d->internal_isResultReadyAt(waitIndex))
d->waitCondition.wait(&d->m_mutex);
d->m_exceptionStore.throwPossibleException();
}
@ -317,7 +334,7 @@ void QFutureInterfaceBase::waitForResult(int resultIndex)
void QFutureInterfaceBase::waitForFinished()
{
QMutexLocker lock(&d->m_mutex);
const bool alreadyFinished = !(d->state & Running);
const bool alreadyFinished = !isRunning();
lock.unlock();
if (!alreadyFinished) {
@ -325,7 +342,7 @@ void QFutureInterfaceBase::waitForFinished()
lock.relock();
while (d->state & Running)
while (isRunning())
d->waitCondition.wait(&d->m_mutex);
}
@ -334,7 +351,7 @@ void QFutureInterfaceBase::waitForFinished()
void QFutureInterfaceBase::reportResultsReady(int beginIndex, int endIndex)
{
if ((d->state & Canceled) || (d->state & Finished) || beginIndex == endIndex)
if (beginIndex == endIndex || (d->state.load() & (Canceled|Finished)))
return;
d->waitCondition.wakeAll();
@ -396,7 +413,7 @@ void QFutureInterfaceBase::setProgressValueAndText(int progressValue,
if (d->m_progressValue >= progressValue)
return;
if ((d->state & Canceled) || (d->state & Finished))
if (d->state.load() & (Canceled|Finished))
return;
if (d->internal_updateProgress(progressValue, progressText)) {
@ -468,10 +485,10 @@ bool QFutureInterfaceBasePrivate::internal_waitForNextResult()
if (m_results.hasNextResult())
return true;
while ((state & QFutureInterfaceBase::Running) && m_results.hasNextResult() == false)
while ((state.load() & QFutureInterfaceBase::Running) && m_results.hasNextResult() == false)
waitCondition.wait(&m_mutex);
return (!(state & QFutureInterfaceBase::Canceled) && m_results.hasNextResult());
return !(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();
}
bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,
@ -494,16 +511,16 @@ bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,
void QFutureInterfaceBasePrivate::internal_setThrottled(bool enable)
{
// bail out if we are not changing the state
if ((enable && (state & QFutureInterfaceBase::Throttled))
|| (!enable && !(state & QFutureInterfaceBase::Throttled)))
if ((enable && (state.load() & QFutureInterfaceBase::Throttled))
|| (!enable && !(state.load() & QFutureInterfaceBase::Throttled)))
return;
// change the state
if (enable) {
state = QFutureInterfaceBase::State(state | QFutureInterfaceBase::Throttled);
switch_on(state, QFutureInterfaceBase::Throttled);
} else {
state = QFutureInterfaceBase::State(state & ~QFutureInterfaceBase::Throttled);
if (!(state & QFutureInterfaceBase::Paused))
switch_off(state, QFutureInterfaceBase::Throttled);
if (!(state.load() & QFutureInterfaceBase::Paused))
pausedWaitCondition.wakeAll();
}
}
@ -538,7 +555,7 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface
{
QMutexLocker locker(&m_mutex);
if (state & QFutureInterfaceBase::Started) {
if (state.load() & QFutureInterfaceBase::Started) {
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Started));
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::ProgressRange,
m_progressMinimum,
@ -558,13 +575,13 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface
it.batchedAdvance();
}
if (state & QFutureInterfaceBase::Paused)
if (state.load() & QFutureInterfaceBase::Paused)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
if (state & QFutureInterfaceBase::Canceled)
if (state.load() & QFutureInterfaceBase::Canceled)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
if (state & QFutureInterfaceBase::Finished)
if (state.load() & QFutureInterfaceBase::Finished)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));
outputConnections.append(interface);
@ -583,7 +600,7 @@ void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterf
void QFutureInterfaceBasePrivate::setState(QFutureInterfaceBase::State newState)
{
state = newState;
state.store(newState);
}
QT_END_NAMESPACE

View File

@ -162,7 +162,7 @@ public:
int m_progressValue; // TQ
int m_progressMinimum; // TQ
int m_progressMaximum; // TQ
QFutureInterfaceBase::State state;
QAtomicInt state; // reads and writes can happen unprotected, both must be atomic
QElapsedTimer progressTime;
QWaitCondition pausedWaitCondition;
QtPrivate::ResultStoreBase m_results;

View File

@ -275,7 +275,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
Attempts to lock the mutex. This function returns \c true if the lock
was obtained; otherwise it returns \c false. If another thread has
locked the mutex, this function will wait for at most \a duration
locked the mutex, this function will wait for at least \a duration
for the mutex to become available.
Note: Passing a negative duration as the \a duration is equivalent to
@ -299,7 +299,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
Attempts to lock the mutex. This function returns \c true if the lock
was obtained; otherwise it returns \c false. If another thread has
locked the mutex, this function will wait at most until \a timePoint
locked the mutex, this function will wait at least until \a timePoint
for the mutex to become available.
Note: Passing a \a timePoint which has already passed is equivalent

View File

@ -46,8 +46,11 @@
#if QT_HAS_INCLUDE(<chrono>)
# include <chrono>
# include <limits>
#endif
class tst_QMutex;
QT_BEGIN_NAMESPACE
@ -135,14 +138,7 @@ public:
template <class Rep, class Period>
bool try_lock_for(std::chrono::duration<Rep, Period> duration)
{
// N4606 § 30.4.1.3 [thread.timedmutex.requirements]/5 specifies that
// a duration less than or equal to duration.zero() shall result in a
// try_lock, unlike QMutex's tryLock with a negative duration which
// results in a lock.
if (duration <= duration.zero())
return tryLock(0);
return tryLock(std::chrono::duration_cast<std::chrono::milliseconds>(duration).count());
return tryLock(convertToMilliseconds(duration));
}
// TimedLockable concept
@ -162,6 +158,32 @@ public:
private:
Q_DISABLE_COPY(QMutex)
friend class QMutexLocker;
friend class ::tst_QMutex;
#if QT_HAS_INCLUDE(<chrono>)
template<class Rep, class Period>
static int convertToMilliseconds(std::chrono::duration<Rep, Period> duration)
{
// N4606 § 30.4.1.3.5 [thread.timedmutex.requirements] specifies that a
// duration less than or equal to duration.zero() shall result in a
// try_lock, unlike QMutex's tryLock with a negative duration which
// results in a lock.
if (duration <= duration.zero())
return 0;
// when converting from 'duration' to milliseconds, make sure that
// the result is not shorter than 'duration':
std::chrono::milliseconds wait = std::chrono::duration_cast<std::chrono::milliseconds>(duration);
if (wait < duration)
wait += std::chrono::milliseconds(1);
Q_ASSERT(wait >= duration);
const auto ms = wait.count();
const auto maxInt = (std::numeric_limits<int>::max)();
return ms < maxInt ? int(ms) : maxInt;
}
#endif
};
class Q_CORE_EXPORT QMutexLocker

View File

@ -48,8 +48,7 @@
QT_BEGIN_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
QT_WARNING_DISABLE_CLANG("-Wdeprecated-declarations")
QT_WARNING_DISABLE_DEPRECATED
/*
Warning: The contents of QAlgorithmsPrivate is not a part of the public Qt API

View File

@ -3835,7 +3835,7 @@ QString QDateTime::toString(Qt::DateFormat format) const
\li the abbreviated localized day name (e.g. 'Mon' to 'Sun').
Uses the system locale to localize the name, i.e. QLocale::system().
\row \li dddd
\li the long localized day name (e.g. 'Monday' to 'Qt::Sunday').
\li the long localized day name (e.g. 'Monday' to 'Sunday').
Uses the system locale to localize the name, i.e. QLocale::system().
\row \li M \li the month as number without a leading zero (1-12)
\row \li MM \li the month as number with a leading zero (01-12)

View File

@ -888,12 +888,12 @@ QDateTimeParser::StateNode QDateTimeParser::parse(QString &input, int &cursorPos
State state = Acceptable;
QDateTime newCurrentValue;
int pos = 0;
bool conflicts = false;
const int sectionNodesCount = sectionNodes.size();
QDTPDEBUG << "parse" << input;
{
int pos = 0;
int year, month, day;
const QDate currentDate = currentValue.date();
const QTime currentTime = currentValue.time();

View File

@ -104,14 +104,6 @@ public:
none.zeroesAdded = 0;
}
virtual ~QDateTimeParser() {}
enum AmPmFinder {
Neither = -1,
AM = 0,
PM = 1,
PossibleAM = 2,
PossiblePM = 3,
PossibleBoth = 4
};
enum Section {
NoSection = 0x00000,
@ -187,50 +179,11 @@ public:
#ifndef QT_NO_DATESTRING
StateNode parse(QString &input, int &cursorPosition, const QDateTime &currentValue, bool fixup) const;
#endif
int sectionMaxSize(int index) const;
int sectionSize(int index) const;
int sectionMaxSize(Section s, int count) const;
int sectionPos(int index) const;
int sectionPos(const SectionNode &sn) const;
const SectionNode &sectionNode(int index) const;
Section sectionType(int index) const;
QString sectionText(int sectionIndex) const;
QString sectionText(const QString &text, int sectionIndex, int index) const;
int getDigit(const QDateTime &dt, int index) const;
bool setDigit(QDateTime &t, int index, int newval) const;
int parseSection(const QDateTime &currentValue, int sectionIndex, QString &txt, int &cursorPosition,
int index, QDateTimeParser::State &state, int *used = 0) const;
int absoluteMax(int index, const QDateTime &value = QDateTime()) const;
int absoluteMin(int index) const;
bool parseFormat(const QString &format);
#ifndef QT_NO_DATESTRING
bool fromString(const QString &text, QDate *date, QTime *time) const;
#endif
#ifndef QT_NO_TEXTDATE
int findMonth(const QString &str1, int monthstart, int sectionIndex,
QString *monthName = 0, int *used = 0) const;
int findDay(const QString &str1, int intDaystart, int sectionIndex,
QString *dayName = 0, int *used = 0) const;
#endif
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
bool potentialValue(const QString &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const
{
return potentialValue(QStringRef(&str), min, max, index, currentValue, insert);
}
bool skipToNextSection(int section, const QDateTime &current, const QStringRef &sectionText) const;
bool skipToNextSection(int section, const QDateTime &current, const QString &sectionText) const
{
return skipToNextSection(section, current, QStringRef(&sectionText));
}
QString stateName(State s) const;
enum FieldInfoFlag {
Numeric = 0x01,
FixedWidth = 0x02,
@ -242,17 +195,68 @@ public:
FieldInfo fieldInfo(int index) const;
void setDefaultLocale(const QLocale &loc) { defaultLocale = loc; }
virtual QString displayText() const { return text; }
private:
int sectionMaxSize(Section s, int count) const;
QString sectionText(const QString &text, int sectionIndex, int index) const;
int parseSection(const QDateTime &currentValue, int sectionIndex, QString &txt, int &cursorPosition,
int index, QDateTimeParser::State &state, int *used = 0) const;
#ifndef QT_NO_TEXTDATE
int findMonth(const QString &str1, int monthstart, int sectionIndex,
QString *monthName = 0, int *used = 0) const;
int findDay(const QString &str1, int intDaystart, int sectionIndex,
QString *dayName = 0, int *used = 0) const;
#endif
enum AmPmFinder {
Neither = -1,
AM = 0,
PM = 1,
PossibleAM = 2,
PossiblePM = 3,
PossibleBoth = 4
};
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
bool potentialValue(const QString &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const
{
return potentialValue(QStringRef(&str), min, max, index, currentValue, insert);
}
protected: // for the benefit of QDateTimeEditPrivate
int sectionSize(int index) const;
int sectionMaxSize(int index) const;
int sectionPos(int index) const;
int sectionPos(const SectionNode &sn) const;
const SectionNode &sectionNode(int index) const;
Section sectionType(int index) const;
QString sectionText(int sectionIndex) const;
int getDigit(const QDateTime &dt, int index) const;
bool setDigit(QDateTime &t, int index, int newval) const;
int absoluteMax(int index, const QDateTime &value = QDateTime()) const;
int absoluteMin(int index) const;
bool skipToNextSection(int section, const QDateTime &current, const QStringRef &sectionText) const;
bool skipToNextSection(int section, const QDateTime &current, const QString &sectionText) const
{
return skipToNextSection(section, current, QStringRef(&sectionText));
}
QString stateName(State s) const;
virtual QDateTime getMinimum() const;
virtual QDateTime getMaximum() const;
virtual int cursorPosition() const { return -1; }
virtual QString displayText() const { return text; }
virtual QString getAmPmText(AmPm ap, Case cs) const;
virtual QLocale locale() const { return defaultLocale; }
mutable int currentSectionIndex;
Sections display;
/*
This stores the stores the most recently selected day.
This stores the most recently selected day.
It is useful when considering the following scenario:
1. Date is: 31/01/2000
@ -272,9 +276,7 @@ public:
QString displayFormat;
QLocale defaultLocale;
QVariant::Type parserType;
bool fixday;
Qt::TimeSpec spec; // spec if used by QDateTimeEdit
Context context;
};

View File

@ -2300,21 +2300,20 @@ QString &QString::remove(const QString &str, Qt::CaseSensitivity cs)
*/
QString &QString::remove(QChar ch, Qt::CaseSensitivity cs)
{
int i = 0;
ushort c = ch.unicode();
if (cs == Qt::CaseSensitive) {
while (i < d->size)
if (d->data()[i] == ch)
remove(i, 1);
else
i++;
} else {
c = foldCase(c);
while (i < d->size)
if (foldCase(d->data()[i]) == c)
remove(i, 1);
else
i++;
const int idx = indexOf(ch, 0, cs);
if (idx != -1) {
const auto first = begin(); // implicit detach()
auto last = end();
if (cs == Qt::CaseSensitive) {
last = std::remove(first + idx, last, ch);
} else {
const QChar c = ch.toCaseFolded();
auto caseInsensEqual = [c](QChar x) {
return c == x.toCaseFolded();
};
last = std::remove_if(first + idx, last, caseInsensEqual);
}
resize(last - first);
}
return *this;
}
@ -3261,6 +3260,23 @@ static int lastIndexOfHelper(const ushort *haystack, int from, const ushort *nee
return -1;
}
static inline int lastIndexOfHelper(
const QStringRef &haystack, int from, const QStringRef &needle, Qt::CaseSensitivity cs)
{
return lastIndexOfHelper(reinterpret_cast<const ushort*>(haystack.unicode()), from,
reinterpret_cast<const ushort*>(needle.unicode()), needle.size(), cs);
}
static inline int lastIndexOfHelper(
const QStringRef &haystack, int from, QLatin1String needle, Qt::CaseSensitivity cs)
{
const int size = needle.size();
QVarLengthArray<ushort> s(size);
qt_from_latin1(s.data(), needle.latin1(), size);
return lastIndexOfHelper(reinterpret_cast<const ushort*>(haystack.unicode()), from,
s.data(), size, cs);
}
/*!
Returns the index position of the last occurrence of the string \a
str in this string, searching backward from index position \a
@ -9817,6 +9833,27 @@ int QStringRef::lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
return qt_last_index_of(unicode(), size(), ch, from, cs);
}
template<typename T>
static int last_index_of_impl(const QStringRef &haystack, int from, const T &needle, Qt::CaseSensitivity cs)
{
const int sl = needle.size();
if (sl == 1)
return haystack.lastIndexOf(needle.at(0), from, cs);
const int l = haystack.size();
if (from < 0)
from += l;
int delta = l - sl;
if (from == l && sl == 0)
return from;
if (uint(from) >= uint(l) || delta < 0)
return -1;
if (from > delta)
from = delta;
return lastIndexOfHelper(haystack, from, needle, cs);
}
/*!
\since 4.8
\overload lastIndexOf()
@ -9834,25 +9871,7 @@ int QStringRef::lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
*/
int QStringRef::lastIndexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) const
{
const int sl = str.size();
if (sl == 1)
return lastIndexOf(str.at(0), from, cs);
const int l = size();
if (from < 0)
from += l;
int delta = l - sl;
if (from == l && sl == 0)
return from;
if (uint(from) >= uint(l) || delta < 0)
return -1;
if (from > delta)
from = delta;
QVarLengthArray<ushort> s(sl);
qt_from_latin1(s.data(), str.latin1(), sl);
return lastIndexOfHelper(reinterpret_cast<const ushort*>(unicode()), from, s.data(), sl, cs);
return last_index_of_impl(*this, from, str, cs);
}
/*!
@ -9872,24 +9891,7 @@ int QStringRef::lastIndexOf(QLatin1String str, int from, Qt::CaseSensitivity cs)
*/
int QStringRef::lastIndexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs) const
{
const int sl = str.size();
if (sl == 1)
return lastIndexOf(str.at(0), from, cs);
const int l = size();
if (from < 0)
from += l;
int delta = l - sl;
if (from == l && sl == 0)
return from;
if (uint(from) >= uint(l) || delta < 0)
return -1;
if (from > delta)
from = delta;
return lastIndexOfHelper(reinterpret_cast<const ushort*>(unicode()), from,
reinterpret_cast<const ushort*>(str.unicode()),
str.size(), cs);
return last_index_of_impl(*this, from, str, cs);
}
/*!

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