Merge master -> api_changes

Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac.

Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
This commit is contained in:
Rohan McGovern 2012-02-29 09:18:59 +10:00
commit 98dd1781d9
513 changed files with 14727 additions and 4332 deletions

1
.gitignore vendored
View File

@ -122,6 +122,7 @@ translations/*.qm
translations/*_untranslated.ts
qrc_*.cpp
src/concurrent/qtconcurrentversion.h
src/corelib/qtcoreversion.h
src/dbus/qtdbusversion.h
src/gui/qtguiversion.h

View File

@ -351,7 +351,7 @@ sub syncHeader {
#write it
my $iheader_out = fixPaths($iheader, $header_dir);
open HEADER, ">$header" || die "Could not open $header for writing!\n";
open(HEADER, ">$header") || die "Could not open $header for writing: $!\n";
print HEADER "#include \"$iheader_out\"\n";
close HEADER;
if(defined($ts)) {
@ -1133,7 +1133,7 @@ foreach my $lib (@modules_to_sync) {
my $header_dir = dirname($header_path);
make_path($header_dir, $lib, $verbose_level);
open HEADER, ">$header_path" || die "Could not open $header_path for writing!\n";
open(HEADER, ">$header_path") || die "Could not open $header_path for writing: $!\n";
print HEADER "#ifndef $guard\n";
print HEADER "#define $guard\n";
my $warning = "Header <$lib/";

View File

@ -1,3 +0,0 @@
SOURCES = ahi.cpp
CONFIG -= qt
LIBS += -lahi -lahioem

View File

@ -1,5 +0,0 @@
SOURCES = directfb.cpp
CONFIG -= qt
QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB
LIBS += $$QT_LIBS_DIRECTFB

View File

@ -1,2 +0,0 @@
SOURCES = sound.cpp
CONFIG -= qt

View File

@ -1,3 +0,0 @@
SOURCES = svgalib.cpp
CONFIG -= qt
LIBS += -lvgagl -lvga

View File

@ -41,7 +41,11 @@ elif strings - $binary | grep MostSignificantByteFirst >/dev/null 2>&1; then
fi
# make clean as this tests is compiled for both the host and the target
$MAKE distclean
if [ "$VERBOSE" = "yes" ]; then
$MAKE distclean
else
$MAKE distclean >/dev/null 2>&1
fi
# done
if [ "$ENDIAN" = "LITTLE" ]; then

552
configure vendored
View File

@ -134,7 +134,7 @@ BEGIN {
values["LITERAL_WHITESPACE"] = " "
values["LITERAL_DOLLAR"] = "$"
}
/^[_A-Z0-9.]+ *\+?=/ {
/^[_A-Z0-9.]+[ \t]*\+?=/ {
valStart = index($0, "=") + 1
append = 0
@ -245,7 +245,6 @@ fi
#-------------------------------------------------------------------------------
PLATFORM_X11=no
PLATFORM_QWS=no
PLATFORM_QPA=yes
BUILD_ON_MAC=no
PLATFORM_MAC=no
@ -290,7 +289,6 @@ fi
#-------------------------------------------------------------------------------
COMMERCIAL_USER=ask
CFG_DEV=no
CFG_EMBEDDED=no
CFG_RTOS_ENABLED=yes
EditionString=Commercial
@ -318,16 +316,6 @@ earlyArgParse()
VAR=`echo $1 | sed "s,^--no-\(.*\),\1,"`
VAL=no
;;
-embedded)
VAR=embedded
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=auto
else
shift;
VAL=$1
fi
;;
-embedded-lite|-qpa)
VAR=qpa
# this option may or may not be followed by an argument
@ -367,25 +355,15 @@ earlyArgParse()
UNKNOWN_OPT=no
case "$VAR" in
embedded)
CFG_EMBEDDED="$VAL"
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=yes
PLATFORM_QPA=no
;;
qpa)
CFG_EMBEDDED="no"
if [ "$PLATFORM_QPA" != "no" ]; then
if [ "$PLATFORM_QPA" = "maybe" ]; then
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=no
PLATFORM_QPA=yes
fi
else
echo "No license exists to enable Qt QPA. Disabling."
CFG_EMBEDDED=no
fi
;;
developer-build)
@ -436,7 +414,6 @@ elif [ $COMMERCIAL_USER = "yes" ]; then
# one of commercial editions
[ "$PLATFORM_MAC" = "maybe" ] && PLATFORM_MAC=yes
[ "$PLATFORM_QPA" = "maybe" ] && PLATFORM_QPA=no
[ "$PLATFORM_QWS" = "maybe" ] && PLATFORM_QWS=no
# read in the license file
if [ -f "$LICENSE_FILE" ]; then
@ -549,7 +526,6 @@ elif [ $COMMERCIAL_USER = "yes" ]; then
*)
Platform=Linux/X11
[ "$PLATFORM_MAC" = "yes" ] && Platform='Mac OS X'
[ "$PLATFORM_QWS" = "yes" ] && Platform='Embedded Linux'
echo
echo "You are not licensed for the $Platform platform."
echo
@ -719,7 +695,6 @@ CFG_EGL=no
CFG_EGL_GLES_INCLUDES=no
CFG_SSE=auto
CFG_FONTCONFIG=auto
CFG_QWS_FREETYPE=auto
CFG_LIBFREETYPE=auto
CFG_SQL_AVAILABLE=
QT_DEFAULT_BUILD_PARTS="libs examples tests"
@ -741,17 +716,6 @@ CFG_KBD_ON="tty" #default, see QMakeVar above
CFG_MOUSE_AVAILABLE="pc linuxtp linuxinput tslib qvfb"
CFG_MOUSE_ON="pc linuxtp" #default, see QMakeVar above
if [ -f "$relpath/src/gui/embedded/qscreenqnx_qws.cpp" ]; then
CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} qnx"
CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} qnx"
CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} qnx"
fi
if [ -f "$relpath/src/gui/embedded/qscreenintegrityfb_qws.cpp" ]; then
CFG_KBD_AVAILABLE="${CFG_KBD_AVAILABLE} integrity"
CFG_MOUSE_AVAILABLE="${CFG_MOUSE_AVAILABLE} integrity"
CFG_GFX_AVAILABLE="${CFG_GFX_AVAILABLE} integrityfb"
fi
CFG_ARCH=
CFG_HOST_ARCH=
CFG_KBD_PLUGIN_AVAILABLE=
@ -799,7 +763,6 @@ CFG_SSE4_2=auto
CFG_AVX=auto
CFG_REDUCE_RELOCATIONS=auto
CFG_NAS=no
CFG_QWS_DEPTHS=all
CFG_ACCESSIBILITY=auto
CFG_ENDIAN=auto
CFG_HOST_ENDIAN=auto
@ -1005,7 +968,7 @@ while [ "$#" -gt 0 ]; do
;;
#Qt style options that pass an argument
-qconfig)
if [ "$PLATFORM_QWS" != "yes" -a "$PLATFORM_QPA" != "yes" ]; then
if [ "$PLATFORM_QPA" != "yes" ]; then
echo
echo "WARNING: -qconfig is only tested and supported on Qt for Embedded Linux."
echo
@ -1035,16 +998,6 @@ while [ "$#" -gt 0 ]; do
VAR=fatal_error
VAL=no
;;
-embedded)
VAR=embedded
# this option may or may not be followed by an argument
if [ -z "$2" ] || echo "$2" | grep '^-' >/dev/null 2>&1; then
VAL=auto
else
shift;
VAL=$1
fi
;;
-embedded-lite|-qpa)
VAR=qpa
# this option may or may not be followed by an argument
@ -1267,18 +1220,9 @@ while [ "$#" -gt 0 ]; do
sxe)
CFG_SXE="$VAL"
;;
embedded)
CFG_EMBEDDED="$VAL"
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=yes
PLATFORM_QPA=no
;;
embedded-lite|qpa)
CFG_EMBEDDED="no"
PLATFORM_X11=no
PLATFORM_MAC=no
PLATFORM_QWS=no
PLATFORM_QPA=yes
;;
sse)
@ -1313,9 +1257,6 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
depths)
CFG_QWS_DEPTHS="$VAL"
;;
opengl)
if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] ||
[ "$VAL" = "yes" ] || [ "$VAL" = "no" ] ||
@ -1361,7 +1302,6 @@ while [ "$#" -gt 0 ]; do
x11)
PLATFORM_QPA=no
PLATFORM_MAC=no
PLATFORM_QWS=no
PLATFORM_X11=yes
;;
sdk)
@ -1742,14 +1682,6 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
freetype)
[ "$VAL" = "qt" ] && VAL=yes
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
CFG_QWS_FREETYPE="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
zlib)
[ "$VAL" = "qt" ] && VAL=yes
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
@ -2293,7 +2225,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
[ "$OPT_VERBOSE" = "yes" ] && echo "Performing shadow build..."
fi
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QPA" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "yes" ]; then
echo
echo "WARNING: -debug-and-release is not supported anymore on Qt/X11 and Qt for Embedded Linux"
echo "Qt can be built in release mode with separate debug information, so"
@ -2389,7 +2321,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then
fi
# symlink fonts to be able to run application from build directory
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ] && [ ! -d "${outpath}/lib/fonts" ]; then
if [ "$PLATFORM_QPA" = "yes" ] && [ ! -d "${outpath}/lib/fonts" ]; then
if [ "$PLATFORM" = "$XPLATFORM" ]; then
mkdir -p "${outpath}/lib"
ln -s "${relpath}/lib/fonts" "${outpath}/lib/fonts"
@ -2428,85 +2360,6 @@ fi ### help
# auto-detect all that hasn't been specified in the arguments
#-------------------------------------------------------------------------------
[ "$PLATFORM_QWS" = "yes" -a "$CFG_EMBEDDED" = "no" ] && CFG_EMBEDDED=auto
if [ "$CFG_EMBEDDED" != "no" ]; then
case "$UNAME_SYSTEM:$UNAME_RELEASE" in
Darwin:*)
[ -z "$PLATFORM" ] && PLATFORM=qws/macx-generic-g++
if [ -z "$XPLATFORM" ]; then
[ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
XPLATFORM="qws/macx-$CFG_EMBEDDED-g++"
fi
;;
FreeBSD:*)
[ -z "$PLATFORM" ] && PLATFORM=qws/freebsd-generic-g++
if [ -z "$XPLATFORM" ]; then
[ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
XPLATFORM="qws/freebsd-$CFG_EMBEDDED-g++"
fi
;;
SunOS:5*)
[ -z "$PLATFORM" ] && PLATFORM=qws/solaris-generic-g++
if [ -z "$XPLATFORM" ]; then
[ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
XPLATFORM="qws/solaris-$CFG_EMBEDDED-g++"
fi
;;
Linux:*)
if [ -z "$PLATFORM" ]; then
case "$UNAME_MACHINE" in
*86)
PLATFORM=qws/linux-x86-g++
;;
*86_64)
PLATFORM=qws/linux-x86_64-g++
;;
*)
PLATFORM=qws/linux-generic-g++
;;
esac
fi
if [ -z "$XPLATFORM" ]; then
if [ "$CFG_EMBEDDED" = "auto" ]; then
if [ -n "$CFG_ARCH" ]; then
CFG_EMBEDDED=$CFG_ARCH
else
case "$UNAME_MACHINE" in
*86)
CFG_EMBEDDED=x86
;;
*86_64)
CFG_EMBEDDED=x86_64
;;
*)
CFG_EMBEDDED=generic
;;
esac
fi
fi
XPLATFORM="qws/linux-$CFG_EMBEDDED-g++"
fi
;;
QNX:*)
[ -z "$PLATFORM" ] && PLATFORM=unsupported/qws/qnx-generic-g++
if [ -z "$XPLATFORM" ]; then
[ "$CFG_EMBEDDED" = "auto" ] && CFG_EMBEDDED=generic
XPLATFORM="unsupported/qws/qnx-$CFG_EMBEDDED-g++"
fi
;;
CYGWIN*:*)
if [ -z "$XPLATFORM" ]; then
CFG_EMBEDDED=x86
fi
;;
*)
echo "Qt for Embedded Linux is not supported on this platform. Disabling."
CFG_EMBEDDED=no
PLATFORM_QWS=no
PLATFORM_QPA=no
;;
esac
fi
if [ -z "$PLATFORM" ]; then
PLATFORM_NOTES=
case "$UNAME_SYSTEM:$UNAME_RELEASE" in
@ -2685,12 +2538,7 @@ if [ -z "$PLATFORM" ]; then
esac
fi
if [ "$PLATFORM_QWS" = "yes" ]; then
CFG_SM=no
PLATFORMS=`find "$relpath/mkspecs/qws" | sed "s,$relpath/mkspecs/qws/,,"`
else
PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
fi
PLATFORMS=`find "$relpath/mkspecs/" -type f | grep -v qws | sed "s,$relpath/mkspecs/qws/,,"`
[ -z "$XPLATFORM" ] && XPLATFORM="$PLATFORM"
@ -2757,7 +2605,7 @@ if [ '!' -f "${XQMAKESPEC}/qplatformdefs.h" ]; then
fi
# now look at the configs and figure out what platform we are config'd for
[ "$CFG_EMBEDDED" = "no" ] && [ "$PLATFORM_QPA" != "yes" ] \
[ "$PLATFORM_QPA" != "yes" ] \
&& [ -n "`getXQMakeConf QMAKE_LIBS_X11`" ] \
&& PLATFORM_X11=yes
### echo "$XQMAKESPEC" | grep mkspecs/qws >/dev/null 2>&1 && PLATFORM_QWS=yes
@ -2777,17 +2625,6 @@ if [ "$OPT_VERBOSE" = "yes" ]; then
echo "Determining system architecture... ($UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_MACHINE)"
fi
if [ "$CFG_EMBEDDED" != "no" -a "$CFG_EMBEDDED" != "auto" ] && [ -n "$CFG_ARCH" ]; then
if [ "$CFG_ARCH" != "$CFG_EMBEDDED" ]; then
echo ""
echo "You have specified a target architecture with -embedded and -arch."
echo "The two architectures you have specified are different, so we can"
echo "not proceed. Either set both to be the same, or only use -embedded."
echo ""
exit 1
fi
fi
if [ "$CFG_RTOS_ENABLED" = "no" ]; then
case `basename "$XPLATFORM"` in
qnx-* | vxworks-*)
@ -2926,38 +2763,7 @@ if [ -z "${CFG_HOST_ARCH}" ]; then
esac
fi
if [ "$PLATFORM" != "$XPLATFORM" -a "$CFG_EMBEDDED" != "no" ]; then
if [ -n "$CFG_ARCH" ]; then
CFG_EMBEDDED=$CFG_ARCH
fi
case "$CFG_EMBEDDED" in
x86)
CFG_ARCH=i386
;;
x86_64)
CFG_ARCH=x86_64
;;
ipaq|sharp)
CFG_ARCH=arm
;;
dm7000)
CFG_ARCH=powerpc
;;
dm800)
CFG_ARCH=mips
;;
sh4al)
CFG_ARCH=sh4a
;;
arm*)
CFG_ARCH=arm
;;
*)
CFG_ARCH="$CFG_EMBEDDED"
;;
esac
elif [ "$XPLATFORM_MINGW" = "yes" ]; then
if [ "$XPLATFORM_MINGW" = "yes" ]; then
[ -z "$CFG_ARCH" ] && CFG_ARCH="windows"
elif [ "$PLATFORM_MAC" = "yes" ] || [ -z "$CFG_ARCH" ]; then
CFG_ARCH=$CFG_HOST_ARCH
@ -2975,7 +2781,7 @@ esac
if [ "$OPT_VERBOSE" = "yes" ]; then
echo "System architecture: '$CFG_ARCH'"
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
if [ "$PLATFORM_QPA" = "yes" ]; then
echo "Host architecture: '$CFG_HOST_ARCH'"
fi
fi
@ -3155,11 +2961,6 @@ if [ "$CFG_USE_GNUMAKE" = "auto" ] && "$MAKE" -v | grep "GNU Make" >/dev/null 2>
CFG_USE_GNUMAKE=yes
fi
# If -opengl wasn't specified, don't try to auto-detect
if [ "$PLATFORM_QWS" = "yes" ] && [ "$CFG_OPENGL" = "auto" ]; then
CFG_OPENGL=no
fi
# find the default framework value
if [ "$BUILD_ON_MAC" = "yes" ]; then
if [ "$CFG_FRAMEWORK" = "auto" ]; then
@ -3426,7 +3227,7 @@ Installation options:
-prefix <dir> ...... This will install everything relative to <dir>
(default $QT_INSTALL_PREFIX)
EOF
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
if [ "$PLATFORM_QPA" = "yes" ]; then
cat <<EOF
-hostprefix [dir] .. Tools and libraries needed when developing
@ -3499,7 +3300,7 @@ Configure options:
+ -largefile ......... Enables Qt to access files larger than 4 GB.
EOF
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
if [ "$PLATFORM_QPA" = "yes" ]; then
EXCN="*"
EXCY=" "
else
@ -3551,7 +3352,7 @@ fi
operating systems and compilers.
EOF
if [ "${PLATFORM_QWS}" != "yes" -a "${PLATFORM_QPA}" != "yes" ]; then
if [ "${PLATFORM_QPA}" != "yes" ]; then
cat << EOF
-graphicssystem <sys> Sets an alternate graphics system. Available options are:
raster - Software rasterizer
@ -3680,7 +3481,7 @@ else
SBN="*"
fi
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
cat << EOF
@ -3695,7 +3496,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "ye
EOF
fi # X11/QWS
fi # X11
if [ "$XPLATFORM_MAEMO" = "yes" ]; then
@ -3922,23 +3723,13 @@ Qt/Mac only:
EOF
fi
if [ "$PLATFORM_QWS" = "yes" ]; then
cat << EOF
Qt for Embedded Linux:
-embedded <arch> .... This will enable the embedded build, you must have a
proper license for this switch to work.
Example values for <arch>: arm mips x86 generic
EOF
fi
if [ "$PLATFORM_QPA" = "yes" ]; then
cat << EOF
Qt for QPA only:
EOF
fi
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
if [ "$PLATFORM_QPA" = "yes" ]; then
cat << EOF
-xplatform target ... The target platform when cross-compiling.
@ -3979,53 +3770,7 @@ if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
EOF
fi
if [ "$PLATFORM_QWS" = "yes" ]; then
cat << EOF
-depths <list> ...... Comma-separated list of supported bit-per-pixel
depths, from: 1, 4, 8, 12, 15, 16, 18, 24, 32 and 'all'.
-qt-decoration-<style> ....Enable a decoration <style> in the QtGui library,
by default all available decorations are on.
Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
-plugin-decoration-<style> Enable decoration <style> as a plugin to be
linked to at run time.
Possible values for <style>: [ $CFG_DECORATION_PLUGIN_AVAILABLE ]
-no-decoration-<style> ....Disable decoration <style> entirely.
Possible values for <style>: [ $CFG_DECORATION_AVAILABLE ]
-qt-gfx-<driver> ... Enable a graphics <driver> in the QtGui library.
Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
-plugin-gfx-<driver> Enable graphics <driver> as a plugin to be
linked to at run time.
Possible values for <driver>: [ $CFG_GFX_PLUGIN_AVAILABLE ]
-no-gfx-<driver> ... Disable graphics <driver> entirely.
Possible values for <driver>: [ $CFG_GFX_AVAILABLE ]
-qt-kbd-<driver> ... Enable a keyboard <driver> in the QtGui library.
Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
-plugin-kbd-<driver> Enable keyboard <driver> as a plugin to be linked to
at runtime.
Possible values for <driver>: [ $CFG_KBD_PLUGIN_AVAILABLE ]
-no-kbd-<driver> ... Disable keyboard <driver> entirely.
Possible values for <driver>: [ $CFG_KBD_AVAILABLE ]
-qt-mouse-<driver> ... Enable a mouse <driver> in the QtGui library.
Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
-plugin-mouse-<driver> Enable mouse <driver> as a plugin to be linked to
at runtime.
Possible values for <driver>: [ $CFG_MOUSE_PLUGIN_AVAILABLE ]
-no-mouse-<driver> ... Disable mouse <driver> entirely.
Possible values for <driver>: [ $CFG_MOUSE_AVAILABLE ]
-iwmmxt ............ Compile using the iWMMXt instruction set
(available on some XScale CPUs).
EOF
fi
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
if [ "$PLATFORM_QPA" = "yes" -o "$PLATFORM_X11" = "yes" ]; then
if [ "$CFG_GLIB" = "no" ]; then
GBY=" "
GBN="+"
@ -4049,9 +3794,7 @@ fi # Help
# LICENSING, INTERACTIVE PART
# -----------------------------------------------------------------------------
if [ "$PLATFORM_QWS" = "yes" ]; then
Platform="Qt for Embedded Linux"
elif [ "$PLATFORM_QPA" = "yes" ]; then
if [ "$PLATFORM_QPA" = "yes" ]; then
Platform="Qt Lighthouse"
elif [ "$XPLATFORM_MINGW" = "yes" ]; then
Platform="Qt for Windows"
@ -4493,7 +4236,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
EXTRA_LFLAGS="$EXTRA_LFLAGS \$(SDK_LFLAGS)"
fi
fi
[ "$CFG_EMBEDDED" != "no" ] && EXTRA_CFLAGS="$EXTRA_CFLAGS -DQWS"
if [ '!' -z "$D_FLAGS" ]; then
for DEF in $D_FLAGS; do
EXTRA_CFLAGS="$EXTRA_CFLAGS \"-D${DEF}\""
@ -4996,7 +4738,7 @@ fi
# auto-detect iconv(3) support
if [ "$CFG_ICONV" != "no" ]; then
if [ "$PLATFORM_QWS" = "yes" -o "$XPLATFORM_MINGW" = "yes" ] || [ "$PLATFORM_QPA" = "yes" -a "$CFG_ICONV" = "auto" ]; then
if [ "$XPLATFORM_MINGW" = "yes" ] || [ "$PLATFORM_QPA" = "yes" -a "$CFG_ICONV" = "auto" ]; then
CFG_ICONV=no
elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" "$OPT_VERBOSE" "$relpath" "$outpath" "config.tests/unix/iconv" "POSIX iconv" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
CFG_ICONV=yes
@ -5042,8 +4784,8 @@ if [ "$CFG_DBUS" != "no" ]; then
fi
fi
# X11/QWS/Lighthouse
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
# X11/Lighthouse
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
# auto-detect Glib support
if [ "$CFG_GLIB" != "no" ]; then
@ -5134,7 +4876,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "ye
fi
fi
fi
fi # X11/QWS/Lighthouse
fi # X11/Lighthouse
# X11
if [ "$PLATFORM_X11" = "yes" -a "$CFG_GUI" != "no" ]; then
@ -5764,124 +5506,9 @@ if [ "$PLATFORM_QPA" = "yes" ]; then
fi
# QWS
if [ "$PLATFORM_QWS" = "yes" ]; then
# auto-detect OpenGL support (es2 = OpenGL ES 2.x)
if [ "$CFG_GUI" = "no" ]; then
if [ "$CFG_OPENGL" = "auto" ]; then
CFG_OPENGL=no
fi
if [ "$CFG_OPENGL" != "no" ]; then
echo "OpenGL enabled, but GUI disabled."
echo " You might need to either enable the GUI or disable OpenGL"
exit 1
fi
fi
if [ "$CFG_OPENGL" = "yes" ]; then
CFG_EGL=auto
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then
CFG_OPENGL=es2
fi
elif [ "$CFG_OPENGL" = "es2" ]; then
#OpenGL ES 2.x
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS
if [ $? != "0" ]; then
echo "The OpenGL ES 2.0 functionality test failed!"
echo " You might need to modify the include and library search paths by editing"
echo " QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in"
echo " ${XQMAKESPEC}."
exit 1
fi
CFG_EGL=yes
elif [ "$CFG_OPENGL" = "desktop" ]; then
# Desktop OpenGL support
echo "Desktop OpenGL support is not avaliable on Qt for Embedded Linux"
exit 1
fi
fi
if [ "$PLATFORM_QWS" = "yes" ]; then
# screen drivers
for screen in ${CFG_GFX_ON} ${CFG_GFX_PLUGIN}; do
if [ "${screen}" = "ahi" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/ahi "Ahi" $L_FLAGS $I_FLAGS $l_FLAGS
if [ $? != "0" ]; then
echo "The Ahi screen driver functionality test failed!"
echo " You might need to modify the include and library search paths by editing"
echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
echo " ${XQMAKESPEC}."
exit 1
fi
fi
if [ "${screen}" = "svgalib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/svgalib "SVGAlib" $L_FLAGS $I_FLAGS $l_FLAGS
if [ $? != "0" ]; then
echo "The SVGAlib screen driver functionality test failed!"
echo " You might need to modify the include and library search paths by editing"
echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
echo " ${XQMAKESPEC}."
exit 1
fi
fi
if [ "${screen}" = "directfb" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists directfb 2>/dev/null; then
QT_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
QT_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
elif directfb-config --version >/dev/null 2>&1; then
QT_CFLAGS_DIRECTFB=`directfb-config --cflags 2>/dev/null`
QT_LIBS_DIRECTFB=`directfb-config --libs 2>/dev/null`
fi
# QMake variables set here override those in the mkspec. Therefore we only set the variables here if they are not zero.
if [ -n "$QT_CFLAGS_DIRECTFB" ] || [ -n "$QT_LIBS_DIRECTFB" ]; then
QMakeVar set QT_CFLAGS_DIRECTFB "$QT_CFLAGS_DIRECTFB"
QMakeVar set QT_LIBS_DIRECTFB "$QT_LIBS_DIRECTFB"
fi
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/directfb "DirectFB" $L_FLAGS $I_FLAGS $l_FLAGS $QT_CFLAGS_DIRECTFB $QT_LIBS_DIRECTFB
if [ $? != "0" ]; then
echo "The DirectFB screen driver functionality test failed!"
echo " You might need to modify the include and library search paths by editing"
echo " QT_CFLAGS_DIRECTFB and QT_LIBS_DIRECTFB in"
echo " ${XQMAKESPEC}."
exit 1
fi
fi
done
# mouse drivers
for mouse in ${CFG_MOUSE_ON} ${CFG_MOUSE_PLUGIN}; do
if [ "${mouse}" = "tslib" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/tslib "tslib" $L_FLAGS $I_FLAGS $l_FLAGS
if [ $? != "0" ]; then
echo "The tslib functionality test failed!"
echo " You might need to modify the include and library search paths by editing"
echo " QMAKE_INCDIR and QMAKE_LIBDIR in"
echo " ${XQMAKESPEC}."
exit 1
fi
fi
done
CFG_QGTKSTYLE=no
# sound
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/qws/sound "sound" $L_FLAGS $I_FLAGS $l_FLAGS
if [ $? != "0" ]; then
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SOUND"
fi
fi # QWS
EGL_VARIANT=none
# EGL Support
if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then
if [ "$PLATFORM_X11" = "yes" ]; then
if [ "$CFG_EGL" != "no" ]; then
# detect EGL support
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" "config.tests/unix/egl" "EGL (EGL/egl.h)" $L_FLAGS $I_FLAGS $l_FLAGS; then
@ -5911,7 +5538,6 @@ fi
[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_PHONON" != "no" ] && CFG_PHONON="yes"
# freetype support
[ "x$CFG_EMBEDDED" != "xno" ] && CFG_LIBFREETYPE="$CFG_QWS_FREETYPE"
[ "$XPLATFORM_MINGW" = "yes" ] && [ "$CFG_LIBFREETYPE" = "auto" ] && CFG_LIBFREETYPE=no
if [ "$CFG_LIBFREETYPE" = "auto" ]; then
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/freetype "FreeType" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
@ -5977,7 +5603,7 @@ fi
if [ "$CFG_DOUBLEFORMAT" = "auto" ]; then
if [ "$PLATFORM_QWS" != "yes" -o "$PLATFORM_QPA" = "yes" ]; then
if [ "$PLATFORM_QPA" = "yes" ]; then
CFG_DOUBLEFORMAT=normal
else
"$unixtests/doubleformat.test" "$XQMAKESPEC" $OPT_VERBOSE "$relpath" "$outpath"
@ -6242,45 +5868,6 @@ fi
# ask for all that hasn't been auto-detected or specified in the arguments
#-------------------------------------------------------------------------------
### fix this: user input should be validated in a loop
if [ "$PLATFORM_QWS" = "yes" ]; then
PROMPT_FOR_DEPTHS="yes"
else
PROMPT_FOR_DEPTHS="no"
fi
if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PROMPT_FOR_DEPTHS" = "yes" ]; then
echo
echo "Choose pixel-depths to support:"
echo
echo " 1. 1bpp, black/white"
echo " 4. 4bpp, grayscale"
echo " 8. 8bpp, paletted"
echo " 12. 12bpp, rgb 4-4-4"
echo " 15. 15bpp, rgb 5-5-5"
echo " 16. 16bpp, rgb 5-6-5"
echo " 18. 18bpp, rgb 6-6-6"
echo " 24. 24bpp, rgb 8-8-8"
echo " 32. 32bpp, argb 8-8-8-8 and rgb 8-8-8"
echo " all. All supported depths"
echo
echo "Your choices (default 8,16,32):"
read CFG_QWS_DEPTHS
if [ -z "$CFG_QWS_DEPTHS" ] || [ "$CFG_QWS_DEPTHS" = "yes" ]; then
CFG_QWS_DEPTHS=8,16,32
fi
fi
if [ -n "$CFG_QWS_DEPTHS" -a "$PLATFORM_QWS" = "yes" ]; then
if [ "$CFG_QWS_DEPTHS" = "all" ]; then
CFG_QWS_DEPTHS="1 4 8 12 15 16 18 24 32 generic"
fi
for D in `echo "$CFG_QWS_DEPTHS" | sed -e 's/,/ /g'`; do
case $D in
1|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";;
generic) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_GENERIC";;
esac
done
fi
# enable dwarf2 support on Mac
if [ "$CFG_MAC_DWARF2" = "yes" ]; then
QT_CONFIG="$QT_CONFIG dwarf2"
@ -6392,12 +5979,6 @@ elif [ "$CFG_SHARED" = "no" ]; then
QMAKE_OUTDIR="${QMAKE_OUTDIR}-static"
QMAKE_CONFIG="$QMAKE_CONFIG static"
fi
if [ "$PLATFORM_QWS" = "yes" ]; then
QMAKE_OUTDIR="${QMAKE_OUTDIR}-emb-$CFG_EMBEDDED"
QMAKE_CONFIG="$QMAKE_CONFIG embedded"
QT_CONFIG="$QT_CONFIG embedded"
rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
fi
if [ "$PLATFORM_QPA" = "yes" ]; then
QMAKE_CONFIG="$QMAKE_CONFIG qpa"
QT_CONFIG="$QT_CONFIG qpa"
@ -6639,16 +6220,11 @@ if [ '!' -z "$W_FLAGS" ]; then
fi
# turn off exceptions for the compilers that support it
if [ "$PLATFORM_QWS" = "yes" ]; then
COMPILER=`echo $XPLATFORM | cut -f 3- -d-`
elif [ "$XPLATFORM" != "$PLATFORM" ]; then
if [ "$XPLATFORM" != "$PLATFORM" ]; then
COMPILER=`echo $XPLATFORM | cut -f 2- -d-`
else
COMPILER=`echo $PLATFORM | cut -f 2- -d-`
fi
if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then
CFG_EXCEPTIONS=no
fi
if [ "$CFG_EXCEPTIONS" != "no" ]; then
QTCONFIG_CONFIG="$QTCONFIG_CONFIG exceptions"
@ -7036,54 +6612,6 @@ if [ "$CFG_DEV" = "yes" ]; then
echo "#define QT_BUILD_INTERNAL" >>"$outpath/src/corelib/global/qconfig.h.new"
fi
# Embedded compile time options
if [ "$PLATFORM_QWS" = "yes" ]; then
# Add QWS to config.h
QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QWS"
# Add excluded decorations to $QCONFIG_FLAGS
decors=`grep '^decorations -= ' "$QMAKE_VARS_FILE" | ${AWK} '{print $3}'`
for decor in $decors; do
NODECORATION=`echo $decor | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
QCONFIG_FLAGS="${QCONFIG_FLAGS} QT_NO_QWS_DECORATION_${NODECORATION}"
done
# Figure which embedded drivers which are turned off
CFG_GFX_OFF="$CFG_GFX_AVAILABLE"
for ADRIVER in $CFG_GFX_ON; do
CFG_GFX_OFF=`echo "${CFG_GFX_OFF} " | sed "s,${ADRIVER} ,,g"`
done
CFG_KBD_OFF="$CFG_KBD_AVAILABLE"
# the um driver is currently not in the available list for external builds
if [ "$CFG_DEV" = "no" ]; then
CFG_KBD_OFF="$CFG_KBD_OFF um"
fi
for ADRIVER in $CFG_KBD_ON; do
CFG_KBD_OFF=`echo "${CFG_KBD_OFF} " | sed "s,${ADRIVER} ,,g"`
done
CFG_MOUSE_OFF="$CFG_MOUSE_AVAILABLE"
for ADRIVER in $CFG_MOUSE_ON; do
CFG_MOUSE_OFF=`echo "${CFG_MOUSE_OFF} " | sed "s,${ADRIVER} ,,g"`
done
for DRIVER in $CFG_GFX_OFF; do
NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_$NODRIVER"
done
for DRIVER in $CFG_KBD_OFF; do
NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_KBD_$NODRIVER"
done
for DRIVER in $CFG_MOUSE_OFF; do
NODRIVER=`echo $DRIVER | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_QWS_MOUSE_$NODRIVER"
done
fi # QWS
if [ "$PLATFORM_QPA" = "yes" ]; then
# Add QPA to config.h
QCONFIG_FLAGS="$QCONFIG_FLAGS Q_WS_QPA QT_NO_QWS_QPF QT_NO_QWS_QPF2"
@ -7229,9 +6757,9 @@ else
[ -f "$outpath/src/corelib/global/qconfig.h" ] && chmod +w "$outpath/src/corelib/global/qconfig.h"
mv "$outpath/src/corelib/global/qconfig.h.new" "$outpath/src/corelib/global/qconfig.h"
chmod -w "$outpath/src/corelib/global/qconfig.h"
for conf in "$outpath/include/QtCore/qconfig.h" "$outpath/include/Qt/qconfig.h"; do
ln -s "$outpath/src/corelib/global/qconfig.h" "$conf"
done
if [ ! -f "$outpath/include/QtCore/qconfig.h" ]; then
ln -s "$outpath/src/corelib/global/qconfig.h" "$outpath/include/QtCore/qconfig.h"
fi
fi
#-------------------------------------------------------------------------------
@ -7491,7 +7019,7 @@ else
echo "Architecture: $CFG_ARCH"
fi
if [ "$PLATFORM_QWS" = "yes" -o "$PLATFORM_QPA" = "yes" ]; then
if [ "$PLATFORM_QPA" = "yes" ]; then
echo "Host architecture: $CFG_HOST_ARCH"
fi
@ -7565,31 +7093,7 @@ else
fi
echo "zlib support ........... $CFG_ZLIB"
echo "Session management ..... $CFG_SM"
if [ "$PLATFORM_QWS" = "yes" ]; then
echo "Embedded support ....... $CFG_EMBEDDED"
if [ "$CFG_QWS_FREETYPE" = "auto" ]; then
echo "Freetype2 support ...... $CFG_QWS_FREETYPE ($CFG_LIBFREETYPE)"
else
echo "Freetype2 support ...... $CFG_QWS_FREETYPE"
fi
# Normalize the decoration output first
CFG_GFX_ON=`echo ${CFG_GFX_ON}`
CFG_GFX_PLUGIN=`echo ${CFG_GFX_PLUGIN}`
echo "Graphics (qt) .......... ${CFG_GFX_ON}"
echo "Graphics (plugin) ...... ${CFG_GFX_PLUGIN}"
CFG_DECORATION_ON=`echo ${CFG_DECORATION_ON}`
CFG_DECORATION_PLUGIN=`echo ${CFG_DECORATION_PLUGIN}`
echo "Decorations (qt) ....... $CFG_DECORATION_ON"
echo "Decorations (plugin) ... $CFG_DECORATION_PLUGIN"
CFG_KBD_ON=`echo ${CFG_KBD_ON}`
CFG_KBD_PLUGIN=`echo ${CFG_KBD_PLUGIN}`
echo "Keyboard driver (qt) ... ${CFG_KBD_ON}"
echo "Keyboard driver (plugin) .. ${CFG_KBD_PLUGIN}"
CFG_MOUSE_ON=`echo ${CFG_MOUSE_ON}`
CFG_MOUSE_PLUGIN=`echo ${CFG_MOUSE_PLUGIN}`
echo "Mouse driver (qt) ...... $CFG_MOUSE_ON"
echo "Mouse driver (plugin) .. $CFG_MOUSE_PLUGIN"
fi
if [ "$CFG_OPENGL" = "desktop" ]; then
echo "OpenGL support ......... yes (Desktop OpenGL)"
elif [ "$CFG_OPENGL" = "es2" ]; then

5
dist/changes-5.0.0 vendored
View File

@ -199,6 +199,7 @@ information about a particular change.
You might need to adjust your code if it used a QIconEngine.
- qmake
* Projects which explicitly set an empty TARGET are considered broken now.
* several functions and built-in variables were modified to return normalized paths.
- QTextCodecPlugin has been removed since it is no longer used. All text codecs
@ -295,6 +296,10 @@ QtCore
* The QDate::addDays() and QDateTime::addDays() methods now take a qint64
* The QDate::daysTo() and QDateTime::daysTo() methods now return a qint64
* QTextCodec::codecForCStrings() and QTextCodec::setCodecForCStrings() have both
been removed. This was removed due to issues with breaking other code from
libraries, creating uncertainty/bugs in using QString easily, and (to a lesser
extent) performance issues.
* QIntValidator and QDoubleValidator no longer fall back to using the C locale if
the requested locale fails to validate the input.

View File

@ -76,7 +76,7 @@ extern "C" MY_EXPORT int avg(int a, int b)
//! [4]
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#define MY_EXPORT __declspec(dllexport)
#else
#define MY_EXPORT

View File

@ -41,14 +41,16 @@
//! [0]
void MyWidget::wheelEvent(QWheelEvent *event)
{
int numDegrees = event->delta() / 8;
int numSteps = numDegrees / 15;
QPoint numPixels = envent->pixelDelta();
QPoint numDegrees = envent->angleDelta() / 8;
if (event->orientation() == Qt::Horizontal) {
scrollHorizontally(numSteps);
} else {
scrollVertically(numSteps);
if (!numPixels.isNull()) {
scrollWithPixels(numpixels);
} else if (!numDegrees.isNull()) {
QPoint numSteps = numDegrees / 15;
scrollWithDegrees(numSteps);
}
event->accept();
}
//! [0]

View File

@ -45,13 +45,13 @@
//Qt
#include <QGraphicsView>
#include <QApplication>
#include <QMenu>
#include <QMenuBar>
#include <QLayout>
#ifdef QT_NO_OPENGL
#include <QtGui/QMenuBar>
#include <QtGui/QLayout>
#include <QtGui/QApplication>
#else
#include <QtOpenGL/QtOpenGL>
#ifndef QT_NO_OPENGL
# include <QtOpenGL/QtOpenGL>
#endif
MainWindow::MainWindow() : QMainWindow(0)

View File

@ -48,9 +48,9 @@
PixmapItem::PixmapItem(const QString &fileName,GraphicsScene::Mode mode, QGraphicsItem * parent) : QGraphicsObject(parent)
{
if (mode == GraphicsScene::Big)
pix = ":/big/" + fileName;
pix = QPixmap(QStringLiteral(":/big/") + fileName);
else
pix = ":/small/" + fileName;
pix = QPixmap(QStringLiteral(":/small/") + fileName);
}
PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene) : QGraphicsObject(), pix(fileName)

View File

@ -1,4 +1,5 @@
contains(QT_CONFIG, opengl):QT += opengl widgets
QT += widgets
contains(QT_CONFIG, opengl):QT += opengl
HEADERS += boat.h \
bomb.h \
mainwindow.h \

View File

@ -1,14 +1,9 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
# Input
HEADERS += complexping.h ping-common.h
SOURCES += complexping.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong

View File

@ -1,14 +1,9 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
# Input
HEADERS += complexpong.h
SOURCES += complexpong.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong

View File

@ -1,9 +1,6 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += qdbus
QT += widgets
# Input
HEADERS += chat.h chat_adaptor.h chat_interface.h
SOURCES += chat.cpp chat_adaptor.cpp chat_interface.cpp
FORMS += chatmainwindow.ui chatsetnickname.ui
@ -17,5 +14,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/chat
INSTALLS += target sources
QT += widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,14 +1,9 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
win32:CONFIG += console
# Input
SOURCES += listnames.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/listnames
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/listnames

View File

@ -1,15 +1,9 @@
TEMPLATE = app
TARGET = ping
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
# Input
HEADERS += ping-common.h
SOURCES += ping.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong

View File

@ -1,15 +1,9 @@
TEMPLATE = app
TARGET = pong
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
# Input
HEADERS += ping-common.h pong.h
SOURCES += pong.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong

View File

@ -1,13 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) Mon Aug 28 19:50:14 2006
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
CONFIG += qdbus
# Input
# DBUS_ADAPTORS += car.xml
HEADERS += car.h car_adaptor.h
SOURCES += car.cpp main.cpp car_adaptor.cpp
@ -18,5 +11,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/remotecontrolledcar/car
INSTALLS += target sources
QT += widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,13 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) Tue Aug 29 12:28:05 2006
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
CONFIG += qdbus
# Input
# DBUS_INTERFACES += car.xml
FORMS += controller.ui
HEADERS += car_interface.h controller.h
@ -19,5 +12,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/remotecontrolledcar/controller
INSTALLS += target sources
QT += widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,6 +1,5 @@
TEMPLATE = app
QT += widgets
# Input
HEADERS += stylewidget.h
FORMS += stylewidget.ui
SOURCES += main.cpp stylewidget.cpp
@ -10,5 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/embedded/styleexample
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.html
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/embedded/styleexample
INSTALLS += target sources
QT += widgets widgets

View File

@ -1,13 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) ma 3. nov 17:33:30 2008
######################################################################
QT += opengl widgets
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
# Input
HEADERS += 3rdparty/fbm.h \
glbuffers.h \
glextensions.h \
@ -27,8 +19,6 @@ SOURCES += 3rdparty/fbm.c \
RESOURCES += boxes.qrc
QT += opengl widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/boxes
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.jpg *.png *.fsh *.vsh *.par

View File

@ -1,12 +1,8 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
QMAKE_PROJECT_NAME = flowlayout_graphicsview
# Input
HEADERS += flowlayout.h window.h
SOURCES += flowlayout.cpp main.cpp window.cpp
QT += widgets
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -16,7 +16,8 @@ RESOURCES += \
FORMS += \
form.ui
contains(QT_CONFIG, opengl):QT += opengl widgets
QT += widgets
contains(QT_CONFIG, opengl):QT += opengl
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/padnavigator

View File

@ -1,8 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Tue May 12 15:22:25 2009
######################################################################
QT += widgets
# Input
SOURCES += main.cpp
RESOURCES += weatheranchorlayout.qrc
@ -12,5 +9,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES weatheranchorlayout.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/weatheranchorlayout
INSTALLS += target sources
QT += widgets
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -95,7 +95,7 @@ QVariant Model::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
if (role == Qt::DisplayRole)
return "Item " + QString::number(index.row()) + ":" + QString::number(index.column());
return QVariant("Item " + QString::number(index.row()) + ":" + QString::number(index.column()));
if (role == Qt::DecorationRole) {
if (index.column() == 0)
return iconProvider.icon(QFileIconProvider::Folder);

View File

@ -1,17 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) Thu Mar 5 14:39:33 2009
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets printsupport
CONFIG += qt warn_on
#unix:contains(QT_CONFIG, dbus):QT += dbus widgets
# Input
HEADERS += printview.h spreadsheet.h spreadsheetdelegate.h spreadsheetitem.h
SOURCES += main.cpp \
printview.cpp \
@ -20,7 +9,6 @@ SOURCES += main.cpp \
spreadsheetitem.cpp
RESOURCES += spreadsheet.qrc
build_all:!build_pass {
CONFIG -= build_all
CONFIG += release

View File

@ -1,14 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) fr. nov. 16 13:18:20 2007
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT = core network
CONFIG += console
# Input
SOURCES += main.cpp
# install
@ -17,5 +9,4 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/download
INSTALLS += target sources
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -1,14 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) fr. nov. 16 14:11:36 2007
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT = core network
CONFIG += console
# Input
HEADERS += downloadmanager.h textprogressbar.h
SOURCES += downloadmanager.cpp main.cpp textprogressbar.cpp
@ -18,7 +10,6 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/downloadmanager
INSTALLS += target sources
OTHER_FILES += \
debian/changelog \
debian/compat \
@ -26,4 +17,5 @@ OTHER_FILES += \
debian/copyright \
debian/README \
debian/rules
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -108,10 +108,10 @@ void TrackerClient::fetchPeerList()
// Percent encode the hash
QByteArray infoHash = torrentDownloader->infoHash();
QString encodedSum;
QByteArray encodedSum;
for (int i = 0; i < infoHash.size(); ++i) {
encodedSum += '%';
encodedSum += QString::number(infoHash[i], 16).right(2).rightJustified(2, '0');
encodedSum += QByteArray::number(infoHash[i], 16).right(2).rightJustified(2, '0');
}
bool seeding = (torrentDownloader->state() == TorrentClient::Seeding);

View File

@ -1,17 +1,12 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += gui
# Input
SOURCES += main.cpp
SOURCES += glwindow.cpp
HEADERS += glwindow.h
RESOURCES += texture.qrc
QT += gui
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es

View File

@ -1,12 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Thu Oct 4 19:01:12 2007
######################################################################
QT += opengl widgets
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
SOURCES += glwidget.cpp
SOURCES += mainwindow.cpp
@ -17,7 +10,6 @@ HEADERS += mainwindow.h
HEADERS += bubble.h
RESOURCES += texture.qrc
QT += opengl widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es2
@ -25,7 +17,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es2
INSTALLS += target sources
maemo5 {
# Debian package name may not contain numbers or special characters
# such as '_', lets change this in Maemo.

View File

@ -1,12 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Wed Apr 27 16:40:46 2011
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += gui-private core-private
# Input
HEADERS += hellowindow.h
SOURCES += hellowindow.cpp main.cpp

View File

@ -1,12 +1,3 @@
######################################################################
# Automatically generated by qmake (2.01a) Wed Apr 27 16:40:46 2011
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
HEADERS += paintedwindow.h
SOURCES += paintedwindow.cpp main.cpp
@ -15,4 +6,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/paintedwindow
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS paintedwindow.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/paintedwindow
INSTALLS += target sources

View File

@ -1,14 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Fri May 12 17:15:46 2006
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += opengl svg widgets
# Input
HEADERS += glwidget.h
SOURCES += glwidget.cpp main.cpp
RESOURCES += pbuffers2.qrc
@ -19,5 +10,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES pbuffers2.pro *.png *.svg
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/pbuffers2
INSTALLS += target sources
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -3,8 +3,9 @@ HEADERS += xform.h
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
SHARED_FOLDER = ../shared

View File

@ -8,8 +8,9 @@ include($$SHARED_FOLDER/shared.pri)
RESOURCES += composition.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/composition

View File

@ -9,8 +9,9 @@ RESOURCES += deform.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/deform

View File

@ -8,8 +8,9 @@ include($$SHARED_FOLDER/shared.pri)
RESOURCES += gradients.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/gradients

View File

@ -9,8 +9,9 @@ RESOURCES += pathstroke.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/pathstroke

View File

@ -1,15 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Wed Apr 27 16:40:46 2011
######################################################################
CONFIG += console
QT += gui-private core-private
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG+=console
QT += gui-private
QT += core-private
# Input
HEADERS += window.h
SOURCES += window.cpp main.cpp

View File

@ -1,20 +1,13 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += concurrent
QT += concurrent widgets
# Input
SOURCES += main.cpp imagescaling.cpp
HEADERS += imagescaling.h
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/imagescaling
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/imagescaling
INSTALLS += target sources
wince*: DEPLOYMENT_PLUGIN += qgif qjpeg
QT += widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,14 +1,10 @@
TEMPLATE = app
TARGET = mapdemo
DEPENDPATH += .
INCLUDEPATH += .
QT += concurrent widgets
# Input
SOURCES += main.cpp
CONFIG += console
# install
SOURCES += main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/map
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/map

View File

@ -1,17 +1,11 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
QT += concurrent widgets
CONFIG += console
# install
SOURCES += main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/progressdialog
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/progressdialog
INSTALLS += target sources
QT += concurrent widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,17 +1,11 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
QT += concurrent widgets
CONFIG += console
# install
SOURCES += main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/runfunction
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/runfunction
INSTALLS += target sources
QT += concurrent widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,17 +1,11 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
QT += concurrent widgets
CONFIG += console
# install
SOURCES += main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/wordcount
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/wordcount
INSTALLS += target sources
QT += concurrent widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,16 +1,8 @@
######################################################################
# Automatically generated by qmake (1.08a) Fri Jan 7 15:25:07 2005
######################################################################
TEMPLATE = app
QT = core gui
CONFIG -= moc app_bundle
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += console
# Input
SOURCES += waitconditions.cpp
CONFIG += qt warn_on create_prl link_prl console
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/waitconditions
@ -18,5 +10,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS waitconditions.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/waitconditions
INSTALLS += target sources
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -53,8 +53,10 @@ public:
QT_BEGIN_NAMESPACE
Q_DECLARE_INTERFACE(EchoInterface,
"com.trolltech.Plugin.EchoInterface/1.0");
#define EchoInterface_iid "org.qt-project.Qt.Examples.EchoInterface"
Q_DECLARE_INTERFACE(EchoInterface, EchoInterface_iid)
QT_END_NAMESPACE
//! [0]

View File

@ -48,7 +48,3 @@ QString EchoPlugin::echo(const QString &message)
return message;
}
//! [0]
//! [1]
Q_EXPORT_PLUGIN2(echoplugin, EchoPlugin);
//! [1]

View File

@ -42,6 +42,7 @@
#define ECHOPLUGIN_H
#include <QObject>
#include <QtPlugin>
#include "echoplugin.h"
#include "echointerface.h"
@ -49,6 +50,7 @@
class EchoPlugin : public QObject, EchoInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.EchoInterface" FILE "echoplugin.json")
Q_INTERFACES(EchoInterface)
public:

View File

@ -0,0 +1 @@
{}

View File

@ -4,6 +4,7 @@ CONFIG += plugin
INCLUDEPATH += ../echowindow
HEADERS = echoplugin.h
SOURCES = echoplugin.cpp
OTHER_FILES += echoplugin.json
TARGET = $$qtLibraryTarget(echoplugin)
DESTDIR = ../plugins
#! [0]

View File

@ -96,14 +96,18 @@ public:
QT_BEGIN_NAMESPACE
//! [3] //! [4]
Q_DECLARE_INTERFACE(BrushInterface,
"com.trolltech.PlugAndPaint.BrushInterface/1.0")
#define BrushInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface"
Q_DECLARE_INTERFACE(BrushInterface, BrushInterface_iid)
//! [3]
Q_DECLARE_INTERFACE(ShapeInterface,
"com.trolltech.PlugAndPaint.ShapeInterface/1.0")
#define ShapeInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.ShapeInterface"
Q_DECLARE_INTERFACE(ShapeInterface, ShapeInterface_iid)
//! [5]
Q_DECLARE_INTERFACE(FilterInterface,
"com.trolltech.PlugAndPaint.FilterInterface/1.0")
#define FilterInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface"
Q_DECLARE_INTERFACE(FilterInterface, FilterInterface_iid)
//! [4] //! [5]
QT_END_NAMESPACE

View File

@ -43,9 +43,7 @@
#include <QtPlugin>
#include <QApplication>
QT_BEGIN_NAMESPACE
Q_IMPORT_PLUGIN(pnp_basictools)
QT_END_NAMESPACE
Q_IMPORT_PLUGIN(BasicToolsPlugin)
int main(int argc, char *argv[])
{

View File

@ -0,0 +1 @@
{}

View File

@ -4,6 +4,7 @@ CONFIG += plugin static
INCLUDEPATH += ../..
HEADERS = basictoolsplugin.h
SOURCES = basictoolsplugin.cpp
OTHER_FILES += basictools.json
TARGET = $$qtLibraryTarget(pnp_basictools)
DESTDIR = ../../plugandpaint/plugins
#! [0]

View File

@ -189,9 +189,3 @@ QImage BasicToolsPlugin::filterImage(const QString &filter, const QImage &image,
return result;
}
//! [8]
QT_BEGIN_NAMESPACE
//! [9]
Q_EXPORT_PLUGIN2(pnp_basictools, BasicToolsPlugin)
//! [9]
QT_END_NAMESPACE

View File

@ -43,6 +43,7 @@
#include <QRect>
#include <QObject>
#include <QtPlugin>
#include <QStringList>
#include <QPainterPath>
#include <QImage>
@ -57,6 +58,7 @@ class BasicToolsPlugin : public QObject,
public FilterInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface" FILE "basictools.json")
Q_INTERFACES(BrushInterface ShapeInterface FilterInterface)
//! [0]

View File

@ -4,6 +4,7 @@ CONFIG += plugin
INCLUDEPATH += ../..
HEADERS = extrafiltersplugin.h
SOURCES = extrafiltersplugin.cpp
OTHER_FILES += extrafilters.json
TARGET = $$qtLibraryTarget(pnp_extrafilters)
DESTDIR = ../../plugandpaint/plugins

View File

@ -120,5 +120,3 @@ QImage ExtraFiltersPlugin::filterImage(const QString &filter,
}
return result;
}
Q_EXPORT_PLUGIN2(pnp_extrafilters, ExtraFiltersPlugin)

View File

@ -43,6 +43,7 @@
//! [0]
#include <QObject>
#include <QtPlugin>
#include <QStringList>
#include <QImage>
@ -51,6 +52,7 @@
class ExtraFiltersPlugin : public QObject, public FilterInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface" FILE "extrafilters.json")
Q_INTERFACES(FilterInterface)
public:

View File

@ -5,6 +5,7 @@ HEADERS = simplestyle.h \
simplestyleplugin.h
SOURCES = simplestyle.cpp \
simplestyleplugin.cpp
OTHER_FILES += simplestyle.json
TARGET = simplestyleplugin
#! [0]
win32 {

View File

@ -0,0 +1,3 @@
{
"Keys": [ "simplestyle" ]
}

View File

@ -58,7 +58,3 @@ QStyle *SimpleStylePlugin::create(const QString &key)
return 0;
}
//! [1]
QT_BEGIN_NAMESPACE
Q_EXPORT_PLUGIN2(simplestyleplugin, SimpleStylePlugin)
QT_END_NAMESPACE

View File

@ -52,9 +52,10 @@ QT_END_NAMESPACE
class SimpleStylePlugin : public QStylePlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "simplestyle.json")
public:
SimpleStylePlugin() {};
SimpleStylePlugin() {}
QStringList keys() const;
QStyle *create(const QString &key);

View File

@ -1,16 +1,8 @@
######################################################################
# Automatically generated by qmake (2.01a) Tue Nov 28 13:20:04 2006
######################################################################
TEMPLATE = app
TARGET = validators
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
FORMS += validators.ui
RESOURCES += validators.qrc
# Input
SOURCES += main.cpp ledwidget.cpp localeselector.cpp
HEADERS += ledwidget.h localeselector.h
@ -20,6 +12,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/validators
INSTALLS += target sources
QT += widgets
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -6,7 +6,12 @@ set(Qt5$${CMAKE_MODULE_NAME}_VERSION_MINOR "$$eval(QT.$${MODULE}.MINOR_VERSION)"
set(Qt5$${CMAKE_MODULE_NAME}_VERSION_PATCH "$$eval(QT.$${MODULE}.PATCH_VERSION)")
set(Qt5$${CMAKE_MODULE_NAME}_LIBRARIES Qt5::$${CMAKE_MODULE_NAME})
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${_qt5_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_install_prefix}/$$CMAKE_INCLUDE_DIR/Qt$${CMAKE_MODULE_NAME}\")
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${_qt5_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_install_prefix}/$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
!!ENDIF
string(TOUPPER "$${CMAKE_MODULE_NAME}" _CMAKE_MODULE_NAME_UPPER)
set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -DQT_\${_CMAKE_MODULE_NAME_UPPER}_LIB)
@ -32,46 +37,58 @@ endif()
if (NOT _Qt5$${CMAKE_MODULE_NAME}_target)
set(_Qt5$${CMAKE_MODULE_NAME}_target 1)
if (\"$${CMAKE_STATIC_TYPE}\" STREQUAL \"\")
add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
else()
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
endif()
if (NOT \"$${CMAKE_BUILD_IS_FRAMEWORK}\" STREQUAL \"\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
endif()
!!IF !isEmpty(CMAKE_STATIC_TYPE)
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
!!ELSE
add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
!!ENDIF
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
!!ENDIF
endif()
if (NOT \"$${debug_type}\" STREQUAL \"\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG \"$${CMAKE_QT5_MODULE_DEPS}\"
IMPORTED_LOCATION_DEBUG \"${_qt5_install_prefix}/$$CMAKE_LIB_DIR/$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
)
if (NOT \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" STREQUAL \"\")
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_IMPLIB_DEBUG \"${_qt5_install_prefix}/$$CMAKE_LIB_DIR/$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\"
)
endif()
endif()
!!IF !isEmpty(debug_type)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG \"$${CMAKE_QT5_MODULE_DEPS}\"
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_DEBUG \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
!!ELSE
IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
!!ENDIF
)
!!IF !isEmpty(CMAKE_IMPLIB_FILE_LOCATION_DEBUG)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_IMPLIB_DEBUG \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\"
)
!!ENDIF
!!ENDIF
if (NOT \"$${release_type}\" STREQUAL \"\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE \"$${CMAKE_QT5_MODULE_DEPS}\"
IMPORTED_LOCATION_RELEASE \"${_qt5_install_prefix}/$$CMAKE_LIB_DIR/$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
)
if (NOT \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" STREQUAL \"\")
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_IMPLIB_RELEASE \"${_qt5_install_prefix}/$$CMAKE_LIB_DIR/$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\"
)
endif()
endif()
!!IF !isEmpty(release_type)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE \"$${CMAKE_QT5_MODULE_DEPS}\"
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
!!ELSE
IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
!!ENDIF
)
!!IF !isEmpty(CMAKE_IMPLIB_FILE_LOCATION_RELEASE)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_IMPLIB_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\"
!!ELSE
IMPORTED_IMPLIB_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\"
!!ENDIF
)
!!ENDIF
!!ENDIF
if (NOT \"$${CMAKE_MODULE_EXTRAS}\" STREQUAL \"\")
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
endif()
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
!!ENDIF
if (NOT \"$${CMAKE_MODULE_MACROS}\" STREQUAL \"\")
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
endif()
!!IF !isEmpty(CMAKE_MODULE_MACROS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
!!ENDIF

View File

@ -15,6 +15,7 @@ QMAKE_CFLAGS_RELEASE += -O2
QMAKE_CFLAGS_DEBUG += -g
QMAKE_CFLAGS_SHLIB += -fPIC
QMAKE_CFLAGS_STATIC_LIB += -fPIC
QMAKE_CFLAGS_APP += -fPIE
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
@ -26,6 +27,7 @@ QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_APP += $$QMAKE_CFLAGS_APP
QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden

View File

@ -21,13 +21,40 @@ CMAKE_MODULE_DEPS = $$cmakeModuleList($$eval(QT.$${MODULE}.depends))
CMAKE_PARTIAL_MODULE_DEPS = $$replace(CMAKE_MODULE_DEPS, ";", ";Qt5::")
!isEmpty(CMAKE_PARTIAL_MODULE_DEPS):CMAKE_QT5_MODULE_DEPS = "Qt5::$${CMAKE_PARTIAL_MODULE_DEPS}"
CMAKE_INCLUDE_DIR = include
CMAKE_LIBS = $$eval(QT.$${MODULE}.libs)
CMAKE_LIB_DIR = $$replace(CMAKE_LIBS, ^.*/, )
CMAKE_BINS = $$eval(QT.$${MODULE}.bins)
CMAKE_BIN_DIR = $$replace(CMAKE_BINS, ^.*/, )
CMAKE_QT_INSTALL_PREFIX = $$replace($$list($$[QT_INSTALL_PREFIX]), \\\\, /)/
CMAKE_QT_INSTALL_PREFIX_ESCAPED = "^$$re_escape($$CMAKE_QT_INSTALL_PREFIX)"
CMAKE_RELATIVE_INSTALL_DIR = "../../../"
CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]
contains(CMAKE_INCLUDE_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
CMAKE_INCLUDE_DIR = $$replace(CMAKE_INCLUDE_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
} else {
CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
}
CMAKE_LIB_DIR = $$replace($$list($$[QT_INSTALL_LIBS]), \\\\, /)/
contains(CMAKE_LIB_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
CMAKE_LIB_DIR = $$replace(CMAKE_LIB_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
CMAKE_RELATIVE_INSTALL_DIR = $$replace(CMAKE_LIB_DIR, "[^/]+", ..)
# We need to go up another two levels because the CMake files are
# installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_DIR}../../"
} else {
CMAKE_LIB_DIR_IS_ABSOLUTE = True
}
CMAKE_BIN_DIR = $$replace($$list($$[QT_INSTALL_BINS]), \\\\, /)/
contains(CMAKE_BIN_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
CMAKE_BIN_DIR = $$replace(CMAKE_BIN_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
} else {
CMAKE_BIN_DIR_IS_ABSOLUTE = True
}
CMAKE_DATA_DIR = $$replace($$list($$[QT_INSTALL_DATA]), \\\\, /)/ # For the mkspecs
contains(CMAKE_DATA_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
CMAKE_DATA_DIR = $$replace(CMAKE_DATA_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
} else {
CMAKE_DATA_DIR_IS_ABSOLUTE = True
}
static|staticlib:CMAKE_STATIC_TYPE = true
@ -48,16 +75,35 @@ macx {
}
}
} else:win32 {
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d.lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.lib
} else {
CMAKE_LIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
CMAKE_LIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
}
CMAKE_WINDOWS_BUILD = "true"
CMAKE_BIN_SUFFIX = ".exe"
CMAKE_LIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
CMAKE_LIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
win32-g++ {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d.a
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a
} else {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).a
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).a
}
} else {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d.lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.lib
} else {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
}
}
} else {
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_LIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a

View File

@ -0,0 +1,2 @@
QMAKE_LIBS_OPENGL_ES2 =
LIBS += $$QMAKE_LIBS_OPENGL_ES1

View File

@ -158,7 +158,7 @@ QT = $$sort_depends(QT, "QT.")
QT_DEPENDS=
unset(using_privates)
for(QTLIB, $$list($$lower($$unique(QT)))) {
for(QTLIB, QT) {
# Figure out if we're wanting to use the private headers of a module
contains(QTLIB, .*-private) {
QTLIB ~= s/-private//

View File

@ -6,9 +6,10 @@ exists($$_QMAKE_CACHE_) {
QMAKE_EXTRA_MODULE_FORWARDS = $$fromfile($$_QMAKE_CACHE_, QMAKE_EXTRA_MODULE_FORWARDS)
}
isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) {
!isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE/mkspecs/qconfig.pri
else:exists($$_QMAKE_CACHE_):infile($$_QMAKE_CACHE_, QT_BUILD_TREE):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)/mkspecs/qconfig.pri
isEmpty(QMAKE_QT_CONFIG):exists($$[QT_INSTALL_DATA]/mkspecs/qconfig.pri):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]/mkspecs/qconfig.pri
!isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE
else:exists($$_QMAKE_CACHE_):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)
isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]
QMAKE_QT_CONFIG = $$QMAKE_QT_CONFIG/mkspecs/qconfig.pri
}
!exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) {
debug(1, "Cannot load qconfig.pri!")

View File

@ -1,4 +1,4 @@
QMAKE_TARGET_COMPANY = Nokia Corporation and/or its subsidiary(-ies)
QMAKE_TARGET_PRODUCT = Qt4
QMAKE_TARGET_PRODUCT = Qt5
QMAKE_TARGET_DESCRIPTION = C++ application development framework.
QMAKE_TARGET_COPYRIGHT = Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).

View File

@ -2508,10 +2508,10 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(!in_directory.isEmpty()) {
t << mkdir_p_asstring(out_directory)
<< out_directory_cdin
<< "$(QMAKE) " << escapeFilePath(in) << buildArgs(in_directory) << " -o " << out
<< "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out
<< in_directory_cdout << endl;
} else {
t << "$(QMAKE) " << escapeFilePath(in) << buildArgs(in_directory) << " -o " << out << endl;
t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << endl;
}
t << subtarget->target << "-qmake_all: ";
if(project->isEmpty("QMAKE_NOFORCE"))
@ -2520,10 +2520,10 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(!in_directory.isEmpty()) {
t << mkdir_p_asstring(out_directory)
<< out_directory_cdin
<< "$(QMAKE) " << escapeFilePath(in) << buildArgs(in_directory) << " -o " << out
<< "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out
<< in_directory_cdout << endl;
} else {
t << "$(QMAKE) " << escapeFilePath(in) << buildArgs(in_directory) << " -o " << out << endl;
t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << endl;
}
}
@ -3287,6 +3287,7 @@ MakefileGenerator::writePkgConfigFile()
} else {
pkgConfiglibDir = "-L${libdir}";
pkgConfiglibName = "-l" + lname.left(lname.length()-Option::libtool_ext.length());
pkgConfiglibName += project->first("TARGET_VERSION_EXT");
}
t << pkgConfiglibDir << " " << pkgConfiglibName << " " << endl;

View File

@ -85,12 +85,6 @@ ProjectGenerator::init()
templ.prepend(Option::user_template_prefix);
v["TEMPLATE_ASSIGN"] += templ;
//figure out target
if(Option::output.fileName() == "-")
v["TARGET_ASSIGN"] = QStringList("unknown");
else
v["TARGET_ASSIGN"] = QStringList(QFileInfo(Option::output).baseName());
//the scary stuff
if(project->first("TEMPLATE_ASSIGN") != "subdirs") {
QString builtin_regex = project_builtin_regx();
@ -360,6 +354,12 @@ ProjectGenerator::writeMakefile(QTextStream &t)
t << endl << "# Directories" << "\n"
<< getWritableVar("SUBDIRS");
} else {
//figure out target
QString ofn = QFileInfo(static_cast<QFile *>(t.device())->fileName()).completeBaseName();
if (ofn.isEmpty() || ofn == "-")
ofn = "unknown";
project->variables()["TARGET_ASSIGN"] = QStringList(ofn);
t << getWritableVar("TARGET_ASSIGN")
<< getWritableVar("CONFIG", false)
<< getWritableVar("CONFIG_REMOVE", false)

View File

@ -844,6 +844,12 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
QString dst_pc = pkgConfigFileName(false);
if (!dst_pc.isEmpty()) {
dst_pc = filePrefixRoot(root, targetdir + dst_pc);
const QString dst_pc_dir = fileInfo(dst_pc).path();
if (!dst_pc_dir.isEmpty()) {
if (!ret.isEmpty())
ret += "\n\t";
ret += mkdir_p_asstring(dst_pc_dir, true);
}
if(!ret.isEmpty())
ret += "\n\t";
ret += "-$(INSTALL_FILE) \"" + pkgConfigFileName(true) + "\" \"" + dst_pc + "\"";

View File

@ -163,6 +163,11 @@ int runQMake(int argc, char **argv)
fn = fn.right(fn.length() - di - 1);
}
if (!Option::prepareProject()) {
exit_val = 3;
break;
}
// read project..
if(!project.read(fn)) {
fprintf(stderr, "Error processing project file: %s\n",

View File

@ -116,6 +116,7 @@ bool Option::mkfile::do_dep_heuristics = true;
bool Option::mkfile::do_preprocess = false;
bool Option::mkfile::do_stub_makefile = false;
bool Option::mkfile::do_cache = true;
QString Option::mkfile::project_build_root;
QString Option::mkfile::cachefile;
QStringList Option::mkfile::project_files;
QString Option::mkfile::qmakespec_commandline;
@ -146,6 +147,14 @@ static QString detectProjectFile(const QString &path)
return ret;
}
static QString cleanSpec(const QString &spec)
{
QString ret = QDir::cleanPath(spec);
if (ret.contains('/'))
ret = QDir::cleanPath(QFileInfo(ret).absoluteFilePath());
return ret;
}
QString project_builtin_regx();
bool usage(const char *a0)
{
@ -314,7 +323,7 @@ Option::parseCommandLine(int argc, char **argv, int skip)
} else if(opt == "cache") {
Option::mkfile::cachefile = argv[++x];
} else if(opt == "platform" || opt == "spec") {
Option::mkfile::qmakespec = argv[++x];
Option::mkfile::qmakespec = cleanSpec(argv[++x]);
Option::mkfile::qmakespec_commandline = argv[x];
} else {
fprintf(stderr, "***Unknown option -%s\n", opt.toLatin1().constData());
@ -567,6 +576,34 @@ void Option::applyHostMode()
}
}
bool Option::prepareProject()
{
mkfile::project_build_root.clear();
if (mkfile::do_cache) {
if (mkfile::cachefile.isEmpty()) { //find it as it has not been specified
QDir dir(output_dir);
while (!dir.exists(QLatin1String(".qmake.cache")))
if (dir.isRoot() || !dir.cdUp())
goto no_cache;
mkfile::cachefile = dir.filePath(QLatin1String(".qmake.cache"));
mkfile::project_build_root = dir.path();
} else {
QFileInfo fi(mkfile::cachefile);
mkfile::cachefile = QDir::cleanPath(fi.absoluteFilePath());
mkfile::project_build_root = QDir::cleanPath(fi.absolutePath());
}
if (mkfile::qmakespec.isEmpty()) {
QMakeProject cproj;
if (!cproj.read(mkfile::cachefile, QMakeProject::ReadProFile))
return false;
mkfile::qmakespec = cproj.first(QLatin1String("QMAKESPEC"));
}
}
no_cache:
return true;
}
bool Option::postProcessProject(QMakeProject *project)
{
Option::cpp_ext = project->variables()["QMAKE_EXT_CPP"];

View File

@ -108,6 +108,7 @@ struct Option
//both of these must be called..
static int init(int argc=0, char **argv=0); //parse cmdline
static void applyHostMode();
static bool prepareProject();
static bool postProcessProject(QMakeProject *);
enum StringFixFlags {
@ -201,6 +202,7 @@ struct Option
static bool do_dep_heuristics;
static bool do_preprocess;
static bool do_stub_makefile;
static QString project_build_root;
static QString cachefile;
static int cachefile_depth;
static QStringList project_files;

View File

@ -590,10 +590,6 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
}
}
}
for(QStringList::Iterator concat_it = concat.begin();
concat_it != concat.end(); ++concat_it)
feature_roots << (QLibraryInfo::location(QLibraryInfo::PrefixPath) +
mkspecs_concat + (*concat_it));
for(QStringList::Iterator concat_it = concat.begin();
concat_it != concat.end(); ++concat_it)
feature_roots << (QLibraryInfo::location(QLibraryInfo::DataPath) +
@ -1285,35 +1281,9 @@ QMakeProject::read(uchar cmd)
base_vars["TEMPLATE_PREFIX"] = QStringList(Option::user_template_prefix);
if ((cmd & ReadSetup) && Option::mkfile::do_cache) { // parse the cache
int cache_depth = -1;
QString qmake_cache = Option::mkfile::cachefile;
if(qmake_cache.isEmpty()) { //find it as it has not been specified
QString dir = Option::output_dir;
while(!QFile::exists((qmake_cache = dir + QLatin1String("/.qmake.cache")))) {
dir = dir.left(dir.lastIndexOf(QLatin1Char('/')));
if(dir.isEmpty() || dir.indexOf(QLatin1Char('/')) == -1) {
qmake_cache = "";
break;
}
if(cache_depth == -1)
cache_depth = 1;
else
cache_depth++;
}
} else {
QString abs_cache = QFileInfo(Option::mkfile::cachefile).absoluteDir().path();
if(Option::output_dir.startsWith(abs_cache))
cache_depth = Option::output_dir.mid(abs_cache.length()).count('/');
}
if(!qmake_cache.isEmpty()) {
QHash<QString, QStringList> cache;
if(read(qmake_cache, cache)) {
Option::mkfile::cachefile_depth = cache_depth;
Option::mkfile::cachefile = qmake_cache;
if(Option::mkfile::qmakespec.isEmpty() && !cache["QMAKESPEC"].isEmpty())
Option::mkfile::qmakespec = cache["QMAKESPEC"].first();
}
}
if (Option::output_dir.startsWith(Option::mkfile::project_build_root))
Option::mkfile::cachefile_depth =
Option::output_dir.mid(Option::mkfile::project_build_root.length()).count('/');
}
if (cmd & ReadSetup) { // parse mkspec
QString qmakespec = fixEnvVariables(Option::mkfile::qmakespec);
@ -1444,9 +1414,6 @@ QMakeProject::read(uchar cmd)
parse("CONFIG += " + Option::after_user_configs.join(" "), vars);
}
if(pfile != "-" && vars["TARGET"].isEmpty())
vars["TARGET"].append(QFileInfo(pfile).baseName());
if(cmd & ReadFeatures) {
debug_msg(1, "Processing default_post: %s", vars["CONFIG"].join("::").toLatin1().constData());
doProjectInclude("default_post", IncludeFlagFeature, vars);
@ -1528,12 +1495,15 @@ QMakeProject::resolveSpec(QString *spec, const QString &qmakespec)
// We can't resolve symlinks as they do on Unix, so configure.exe puts the source of the
// qmake.conf at the end of the default/qmake.conf in the QMAKESPEC_ORG variable.
const QStringList &spec_org = base_vars["QMAKESPEC_ORIGINAL"];
if (!spec_org.isEmpty()) {
if (spec_org.isEmpty()) {
// try again the next time around
*spec = QString();
} else {
*spec = spec_org.at(0);
#endif
int lastSlash = spec->lastIndexOf(QLatin1Char('/'));
if (lastSlash != -1)
spec->remove(lastSlash + 1);
spec->remove(0, lastSlash + 1);
}
}
}
@ -1712,9 +1682,6 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString
warn_msg(WarnParser, "%s:%d: QtScript support disabled for %s.",
pi.file.toLatin1().constData(), pi.line_no, orig_file.toLatin1().constData());
} else {
QStack<ScopeBlock> sc = scope_blocks;
IteratorBlock *it = iterator;
FunctionBlock *fu = function;
if(flags & (IncludeFlagNewProject|IncludeFlagNewParser)) {
// The "project's variables" are used in other places (eg. export()) so it's not
// possible to use "place" everywhere. Instead just set variables and grab them later
@ -1730,11 +1697,14 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString
}
place = proj.variables();
} else {
QStack<ScopeBlock> sc = scope_blocks;
IteratorBlock *it = iterator;
FunctionBlock *fu = function;
parsed = read(file, place);
iterator = it;
function = fu;
scope_blocks = sc;
}
iterator = it;
function = fu;
scope_blocks = sc;
}
if(parsed) {
if(place["QMAKE_INTERNAL_INCLUDED_FILES"].indexOf(orig_file) == -1)

View File

@ -265,6 +265,34 @@ static inline void positionCluster(HB_ShaperItem *item, int gfrom, int glast)
//qreal offsetBase = (size - 4) / 4 + qMin<qreal>(size, 4) + 1;
// qDebug("offset = %f", offsetBase);
// To fix some Thai character heights check for two above glyphs
if (nmarks == 2 && (attributes[gfrom+1].combiningClass == HB_Combining_AboveRight ||
attributes[gfrom+1].combiningClass == HB_Combining_AboveLeft ||
attributes[gfrom+1].combiningClass == HB_Combining_Above))
if (attributes[gfrom+2].combiningClass == 23 ||
attributes[gfrom+2].combiningClass == 24 ||
attributes[gfrom+2].combiningClass == 25 ||
attributes[gfrom+2].combiningClass == 27 ||
attributes[gfrom+2].combiningClass == 28 ||
attributes[gfrom+2].combiningClass == 30 ||
attributes[gfrom+2].combiningClass == 31 ||
attributes[gfrom+2].combiningClass == 33 ||
attributes[gfrom+2].combiningClass == 34 ||
attributes[gfrom+2].combiningClass == 35 ||
attributes[gfrom+2].combiningClass == 36 ||
attributes[gfrom+2].combiningClass == 107 ||
attributes[gfrom+2].combiningClass == 122) {
// Two above glyphs, check total height
int markTotalHeight = baseMetrics.height;
HB_GlyphMetrics markMetrics;
item->font->klass->getGlyphMetrics(item->font, glyphs[gfrom+1], &markMetrics);
markTotalHeight += markMetrics.height;
item->font->klass->getGlyphMetrics(item->font, glyphs[gfrom+2], &markMetrics);
markTotalHeight += markMetrics.height;
if ((markTotalHeight + 2 * offsetBase) > (size * 10))
offsetBase = ((size * 10) - markTotalHeight) / 2; // Use offset that just fits
}
bool rightToLeft = item->item.bidiLevel % 2;
int i;

View File

@ -74,10 +74,10 @@ static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr)
for (i = 0; i < len; ++i) {
if (string[i] <= 0xa0)
result[i] = (unsigned char)string[i];
if (string[i] >= 0xe01 && string[i] <= 0xe5b)
else if (string[i] >= 0xe01 && string[i] <= 0xe5b)
result[i] = (unsigned char)(string[i] - 0xe00 + 0xa0);
else
result[i] = '?';
result[i] = (unsigned char)~0; // Same encoding as libthai uses for invalid chars
}
result[len] = 0;
@ -259,8 +259,13 @@ static HB_Bool HB_ThaiConvertStringToGlyphIndices (HB_ShaperItem *item)
for (int lgi = 0; lgi < lgn; lgi++) {
if ( rglyphs[lgi] == 0xdd/*TH_BLANK_BASE_GLYPH*/ ) {
glyphString[slen++] = C_DOTTED_CIRCLE;
}
else {
} else if (cstr[i] == (signed char)~0) {
// The only glyphs that should be passed to this function that cannot be mapped to
// tis620 are the ones of type Inherited class. Pass these glyphs untouched.
glyphString[slen++] = string[i];
if (string[i] == 0x200D || string[i] == 0x200C)
item->attributes[slen-1].dontPrint = true; // Hide ZWJ and ZWNJ characters
} else {
glyphString[slen++] = (HB_UChar16) thai_get_glyph_index (font_type, rglyphs[lgi]);
}
}
@ -353,7 +358,7 @@ HB_Bool HB_ThaiShape (HB_ShaperItem *shaper_item)
const int availableGlyphs = shaper_item->num_glyphs;
if ( HB_SelectScript (shaper_item, thai_features) ) {
HB_OpenTypeShape (shaper_item, /*properties*/0);
return HB_OpenTypePosition (shaper_item, availableGlyphs, /*doLogClusters*/false);
return HB_OpenTypePosition (shaper_item, availableGlyphs, /*doLogClusters*/true);
}
#endif

28
src/3rdparty/rfc6234/sha-private.h vendored Normal file
View File

@ -0,0 +1,28 @@
/************************ sha-private.h ************************/
/***************** See RFC 6234 for details. *******************/
#ifndef _SHA_PRIVATE__H
#define _SHA_PRIVATE__H
/*
* These definitions are defined in FIPS 180-3, section 4.1.
* Ch() and Maj() are defined identically in sections 4.1.1,
* 4.1.2, and 4.1.3.
*
* The definitions used in FIPS 180-3 are as follows:
*/
#ifndef USE_MODIFIED_MACROS
#define SHA_Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z)))
#define SHA_Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
#else /* USE_MODIFIED_MACROS */
/*
* The following definitions are equivalent and potentially faster.
*/
#define SHA_Ch(x, y, z) (((x) & ((y) ^ (z))) ^ (z))
#define SHA_Maj(x, y, z) (((x) & ((y) | (z))) | ((y) & (z)))
#endif /* USE_MODIFIED_MACROS */
#define SHA_Parity(x, y, z) ((x) ^ (y) ^ (z))
#endif /* _SHA_PRIVATE__H */

357
src/3rdparty/rfc6234/sha.h vendored Normal file
View File

@ -0,0 +1,357 @@
/**************************** sha.h ****************************/
/***************** See RFC 6234 for details. *******************/
/*
Copyright (c) 2011 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
- Redistributions of source code must retain the above
copyright notice, this list of conditions and
the following disclaimer.
- Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
- Neither the name of Internet Society, IETF or IETF Trust, nor
the names of specific contributors, may be used to endorse or
promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _SHA_H_
#define _SHA_H_
/*
* Description:
* This file implements the Secure Hash Algorithms
* as defined in the U.S. National Institute of Standards
* and Technology Federal Information Processing Standards
* Publication (FIPS PUB) 180-3 published in October 2008
* and formerly defined in its predecessors, FIPS PUB 180-1
* and FIP PUB 180-2.
*
* A combined document showing all algorithms is available at
* http://csrc.nist.gov/publications/fips/
* fips180-3/fips180-3_final.pdf
*
* The five hashes are defined in these sizes:
* SHA-1 20 byte / 160 bit
* SHA-224 28 byte / 224 bit
* SHA-256 32 byte / 256 bit
* SHA-384 48 byte / 384 bit
* SHA-512 64 byte / 512 bit
*
* Compilation Note:
* These files may be compiled with two options:
* USE_32BIT_ONLY - use 32-bit arithmetic only, for systems
* without 64-bit integers
*
* USE_MODIFIED_MACROS - use alternate form of the SHA_Ch()
* and SHA_Maj() macros that are equivalent
* and potentially faster on many systems
*
*/
// stdint.h include commented out by Nokia, it is not available on all platforms.
// #include <stdint.h>
/*
* If you do not have the ISO standard stdint.h header file, then you
* must typedef the following:
* name meaning
* uint64_t unsigned 64-bit integer
* uint32_t unsigned 32-bit integer
* uint8_t unsigned 8-bit integer (i.e., unsigned char)
* int_least16_t integer of >= 16 bits
*
* See stdint-example.h
*/
#ifndef _SHA_enum_
#define _SHA_enum_
/*
* All SHA functions return one of these values.
*/
enum {
shaSuccess = 0,
shaNull, /* Null pointer parameter */
shaInputTooLong, /* input data too long */
shaStateError, /* called Input after FinalBits or Result */
shaBadParam /* passed a bad parameter */
};
#endif /* _SHA_enum_ */
/*
* These constants hold size information for each of the SHA
* hashing operations
*/
enum {
SHA1_Message_Block_Size = 64, SHA224_Message_Block_Size = 64,
SHA256_Message_Block_Size = 64, SHA384_Message_Block_Size = 128,
SHA512_Message_Block_Size = 128,
USHA_Max_Message_Block_Size = SHA512_Message_Block_Size,
SHA1HashSize = 20, SHA224HashSize = 28, SHA256HashSize = 32,
SHA384HashSize = 48, SHA512HashSize = 64,
USHAMaxHashSize = SHA512HashSize,
SHA1HashSizeBits = 160, SHA224HashSizeBits = 224,
SHA256HashSizeBits = 256, SHA384HashSizeBits = 384,
SHA512HashSizeBits = 512, USHAMaxHashSizeBits = SHA512HashSizeBits
};
/*
* These constants are used in the USHA (Unified SHA) functions.
*/
typedef enum SHAversion {
SHA1, SHA224, SHA256, SHA384, SHA512
} SHAversion;
/*
* This structure will hold context information for the SHA-1
* hashing operation.
*/
typedef struct SHA1Context {
uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */
uint32_t Length_High; /* Message length in bits */
uint32_t Length_Low; /* Message length in bits */
int_least16_t Message_Block_Index; /* Message_Block array index */
/* 512-bit message blocks */
uint8_t Message_Block[SHA1_Message_Block_Size];
int Computed; /* Is the hash computed? */
int Corrupted; /* Cumulative corruption code */
} SHA1Context;
/*
* This structure will hold context information for the SHA-256
* hashing operation.
*/
typedef struct SHA256Context {
uint32_t Intermediate_Hash[SHA256HashSize/4]; /* Message Digest */
uint32_t Length_High; /* Message length in bits */
uint32_t Length_Low; /* Message length in bits */
int_least16_t Message_Block_Index; /* Message_Block array index */
/* 512-bit message blocks */
uint8_t Message_Block[SHA256_Message_Block_Size];
int Computed; /* Is the hash computed? */
int Corrupted; /* Cumulative corruption code */
} SHA256Context;
/*
* This structure will hold context information for the SHA-512
* hashing operation.
*/
typedef struct SHA512Context {
#ifdef USE_32BIT_ONLY
uint32_t Intermediate_Hash[SHA512HashSize/4]; /* Message Digest */
uint32_t Length[4]; /* Message length in bits */
#else /* !USE_32BIT_ONLY */
uint64_t Intermediate_Hash[SHA512HashSize/8]; /* Message Digest */
uint64_t Length_High, Length_Low; /* Message length in bits */
#endif /* USE_32BIT_ONLY */
int_least16_t Message_Block_Index; /* Message_Block array index */
/* 1024-bit message blocks */
uint8_t Message_Block[SHA512_Message_Block_Size];
int Computed; /* Is the hash computed?*/
int Corrupted; /* Cumulative corruption code */
} SHA512Context;
/*
* This structure will hold context information for the SHA-224
* hashing operation. It uses the SHA-256 structure for computation.
*/
typedef struct SHA256Context SHA224Context;
/*
* This structure will hold context information for the SHA-384
* hashing operation. It uses the SHA-512 structure for computation.
*/
typedef struct SHA512Context SHA384Context;
/*
* This structure holds context information for all SHA
* hashing operations.
*/
typedef struct USHAContext {
int whichSha; /* which SHA is being used */
union {
SHA1Context sha1Context;
SHA224Context sha224Context; SHA256Context sha256Context;
SHA384Context sha384Context; SHA512Context sha512Context;
} ctx;
} USHAContext;
/*
* This structure will hold context information for the HMAC
* keyed-hashing operation.
*/
typedef struct HMACContext {
int whichSha; /* which SHA is being used */
int hashSize; /* hash size of SHA being used */
int blockSize; /* block size of SHA being used */
USHAContext shaContext; /* SHA context */
unsigned char k_opad[USHA_Max_Message_Block_Size];
/* outer padding - key XORd with opad */
int Computed; /* Is the MAC computed? */
int Corrupted; /* Cumulative corruption code */
} HMACContext;
/*
* This structure will hold context information for the HKDF
* extract-and-expand Key Derivation Functions.
*/
typedef struct HKDFContext {
int whichSha; /* which SHA is being used */
HMACContext hmacContext;
int hashSize; /* hash size of SHA being used */
unsigned char prk[USHAMaxHashSize];
/* pseudo-random key - output of hkdfInput */
int Computed; /* Is the key material computed? */
int Corrupted; /* Cumulative corruption code */
} HKDFContext;
/*
* Function Prototypes
*/
/* SHA-1 */
extern int SHA1Reset(SHA1Context *);
extern int SHA1Input(SHA1Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA1FinalBits(SHA1Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA1Result(SHA1Context *,
uint8_t Message_Digest[SHA1HashSize]);
/* SHA-224 */
extern int SHA224Reset(SHA224Context *);
extern int SHA224Input(SHA224Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA224FinalBits(SHA224Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA224Result(SHA224Context *,
uint8_t Message_Digest[SHA224HashSize]);
/* SHA-256 */
extern int SHA256Reset(SHA256Context *);
extern int SHA256Input(SHA256Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA256FinalBits(SHA256Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA256Result(SHA256Context *,
uint8_t Message_Digest[SHA256HashSize]);
/* SHA-384 */
extern int SHA384Reset(SHA384Context *);
extern int SHA384Input(SHA384Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA384FinalBits(SHA384Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA384Result(SHA384Context *,
uint8_t Message_Digest[SHA384HashSize]);
/* SHA-512 */
extern int SHA512Reset(SHA512Context *);
extern int SHA512Input(SHA512Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA512FinalBits(SHA512Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA512Result(SHA512Context *,
uint8_t Message_Digest[SHA512HashSize]);
/* Unified SHA functions, chosen by whichSha */
extern int USHAReset(USHAContext *context, SHAversion whichSha);
extern int USHAInput(USHAContext *context,
const uint8_t *bytes, unsigned int bytecount);
extern int USHAFinalBits(USHAContext *context,
uint8_t bits, unsigned int bit_count);
extern int USHAResult(USHAContext *context,
uint8_t Message_Digest[USHAMaxHashSize]);
extern int USHABlockSize(enum SHAversion whichSha);
extern int USHAHashSize(enum SHAversion whichSha);
extern int USHAHashSizeBits(enum SHAversion whichSha);
extern const char *USHAHashName(enum SHAversion whichSha);
/*
* HMAC Keyed-Hashing for Message Authentication, RFC 2104,
* for all SHAs.
* This interface allows a fixed-length text input to be used.
*/
extern int hmac(SHAversion whichSha, /* which SHA algorithm to use */
const unsigned char *text, /* pointer to data stream */
int text_len, /* length of data stream */
const unsigned char *key, /* pointer to authentication key */
int key_len, /* length of authentication key */
uint8_t digest[USHAMaxHashSize]); /* caller digest to fill in */
/*
* HMAC Keyed-Hashing for Message Authentication, RFC 2104,
* for all SHAs.
* This interface allows any length of text input to be used.
*/
extern int hmacReset(HMACContext *context, enum SHAversion whichSha,
const unsigned char *key, int key_len);
extern int hmacInput(HMACContext *context, const unsigned char *text,
int text_len);
extern int hmacFinalBits(HMACContext *context, uint8_t bits,
unsigned int bit_count);
extern int hmacResult(HMACContext *context,
uint8_t digest[USHAMaxHashSize]);
/*
* HKDF HMAC-based Extract-and-Expand Key Derivation Function,
* RFC 5869, for all SHAs.
*/
extern int hkdf(SHAversion whichSha, const unsigned char *salt,
int salt_len, const unsigned char *ikm, int ikm_len,
const unsigned char *info, int info_len,
uint8_t okm[ ], int okm_len);
extern int hkdfExtract(SHAversion whichSha, const unsigned char *salt,
int salt_len, const unsigned char *ikm,
int ikm_len, uint8_t prk[USHAMaxHashSize]);
extern int hkdfExpand(SHAversion whichSha, const uint8_t prk[ ],
int prk_len, const unsigned char *info,
int info_len, uint8_t okm[ ], int okm_len);
/*
* HKDF HMAC-based Extract-and-Expand Key Derivation Function,
* RFC 5869, for all SHAs.
* This interface allows any length of text input to be used.
*/
extern int hkdfReset(HKDFContext *context, enum SHAversion whichSha,
const unsigned char *salt, int salt_len);
extern int hkdfInput(HKDFContext *context, const unsigned char *ikm,
int ikm_len);
extern int hkdfFinalBits(HKDFContext *context, uint8_t ikm_bits,
unsigned int ikm_bit_count);
extern int hkdfResult(HKDFContext *context,
uint8_t prk[USHAMaxHashSize],
const unsigned char *info, int info_len,
uint8_t okm[USHAMaxHashSize], int okm_len);
#endif /* _SHA_H_ */

583
src/3rdparty/rfc6234/sha224-256.c vendored Normal file
View File

@ -0,0 +1,583 @@
/************************* sha224-256.c ************************/
/***************** See RFC 6234 for details. *******************/
/* Copyright (c) 2011 IETF Trust and the persons identified as */
/* authors of the code. All rights reserved. */
/* See sha.h for terms of use and redistribution. */
/*
* Description:
* This file implements the Secure Hash Algorithms SHA-224 and
* SHA-256 as defined in the U.S. National Institute of Standards
* and Technology Federal Information Processing Standards
* Publication (FIPS PUB) 180-3 published in October 2008
* and formerly defined in its predecessors, FIPS PUB 180-1
* and FIP PUB 180-2.
*
* A combined document showing all algorithms is available at
* http://csrc.nist.gov/publications/fips/
* fips180-3/fips180-3_final.pdf
*
* The SHA-224 and SHA-256 algorithms produce 224-bit and 256-bit
* message digests for a given data stream. It should take about
* 2**n steps to find a message with the same digest as a given
* message and 2**(n/2) to find any two messages with the same
* digest, when n is the digest size in bits. Therefore, this
* algorithm can serve as a means of providing a
* "fingerprint" for a message.
*
* Portability Issues:
* SHA-224 and SHA-256 are defined in terms of 32-bit "words".
* This code uses <stdint.h> (included via "sha.h") to define 32-
* and 8-bit unsigned integer types. If your C compiler does not
* support 32-bit unsigned integers, this code is not
* appropriate.
*
* Caveats:
* SHA-224 and SHA-256 are designed to work with messages less
* than 2^64 bits long. This implementation uses SHA224/256Input()
* to hash the bits that are a multiple of the size of an 8-bit
* octet, and then optionally uses SHA224/256FinalBits()
* to hash the final few bits of the input.
*/
#include "sha.h"
#include "sha-private.h"
/* Define the SHA shift, rotate left, and rotate right macros */
#define SHA256_SHR(bits,word) ((word) >> (bits))
#define SHA256_ROTL(bits,word) \
(((word) << (bits)) | ((word) >> (32-(bits))))
#define SHA256_ROTR(bits,word) \
(((word) >> (bits)) | ((word) << (32-(bits))))
/* Define the SHA SIGMA and sigma macros */
#define SHA256_SIGMA0(word) \
(SHA256_ROTR( 2,word) ^ SHA256_ROTR(13,word) ^ SHA256_ROTR(22,word))
#define SHA256_SIGMA1(word) \
(SHA256_ROTR( 6,word) ^ SHA256_ROTR(11,word) ^ SHA256_ROTR(25,word))
#define SHA256_sigma0(word) \
(SHA256_ROTR( 7,word) ^ SHA256_ROTR(18,word) ^ SHA256_SHR( 3,word))
#define SHA256_sigma1(word) \
(SHA256_ROTR(17,word) ^ SHA256_ROTR(19,word) ^ SHA256_SHR(10,word))
/*
* Add "length" to the length.
* Set Corrupted when overflow has occurred.
*/
/* addTemp commented out by Nokia, static variables are not thread-safe */
/* static uint32_t addTemp; */
/* 'M' appended to Macro name by Nokia */
#define SHA224_256AddLengthM(context, length) \
(addTemp = (context)->Length_Low, (context)->Corrupted = \
(((context)->Length_Low += (length)) < addTemp) && \
(++(context)->Length_High == 0) ? shaInputTooLong : \
(context)->Corrupted )
/* Local Function Prototypes */
static int SHA224_256Reset(SHA256Context *context, uint32_t *H0);
static void SHA224_256ProcessMessageBlock(SHA256Context *context);
static void SHA224_256Finalize(SHA256Context *context,
uint8_t Pad_Byte);
static void SHA224_256PadMessage(SHA256Context *context,
uint8_t Pad_Byte);
static int SHA224_256ResultN(SHA256Context *context,
uint8_t Message_Digest[ ], int HashSize);
/* Initial Hash Values: FIPS 180-3 section 5.3.2 */
static uint32_t SHA224_H0[SHA256HashSize/4] = {
0xC1059ED8, 0x367CD507, 0x3070DD17, 0xF70E5939,
0xFFC00B31, 0x68581511, 0x64F98FA7, 0xBEFA4FA4
};
/* Initial Hash Values: FIPS 180-3 section 5.3.3 */
static uint32_t SHA256_H0[SHA256HashSize/4] = {
0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,
0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19
};
/*
* SHA224Reset
*
* Description:
* This function will initialize the SHA224Context in preparation
* for computing a new SHA224 message digest.
*
* Parameters:
* context: [in/out]
* The context to reset.
*
* Returns:
* sha Error Code.
*/
int SHA224Reset(SHA224Context *context)
{
return SHA224_256Reset(context, SHA224_H0);
}
/*
* SHA224Input
*
* Description:
* This function accepts an array of octets as the next portion
* of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* message_array[ ]: [in]
* An array of octets representing the next portion of
* the message.
* length: [in]
* The length of the message in message_array.
*
* Returns:
* sha Error Code.
*
*/
int SHA224Input(SHA224Context *context, const uint8_t *message_array,
unsigned int length)
{
return SHA256Input(context, message_array, length);
}
/*
* SHA224FinalBits
*
* Description:
* This function will add in any final bits of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* message_bits: [in]
* The final bits of the message, in the upper portion of the
* byte. (Use 0b###00000 instead of 0b00000### to input the
* three bits ###.)
* length: [in]
* The number of bits in message_bits, between 1 and 7.
*
* Returns:
* sha Error Code.
*/
int SHA224FinalBits(SHA224Context *context,
uint8_t message_bits, unsigned int length)
{
return SHA256FinalBits(context, message_bits, length);
}
/*
* SHA224Result
*
* Description:
* This function will return the 224-bit message digest
* into the Message_Digest array provided by the caller.
* NOTE:
* The first octet of hash is stored in the element with index 0,
* the last octet of hash in the element with index 27.
*
* Parameters:
* context: [in/out]
* The context to use to calculate the SHA hash.
* Message_Digest[ ]: [out]
* Where the digest is returned.
*
* Returns:
* sha Error Code.
*/
int SHA224Result(SHA224Context *context,
uint8_t Message_Digest[SHA224HashSize])
{
return SHA224_256ResultN(context, Message_Digest, SHA224HashSize);
}
/*
* SHA256Reset
*
* Description:
* This function will initialize the SHA256Context in preparation
* for computing a new SHA256 message digest.
*
* Parameters:
* context: [in/out]
* The context to reset.
*
* Returns:
* sha Error Code.
*/
int SHA256Reset(SHA256Context *context)
{
return SHA224_256Reset(context, SHA256_H0);
}
/*
* SHA256Input
*
* Description:
* This function accepts an array of octets as the next portion
* of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* message_array[ ]: [in]
* An array of octets representing the next portion of
* the message.
* length: [in]
* The length of the message in message_array.
*
* Returns:
* sha Error Code.
*/
int SHA256Input(SHA256Context *context, const uint8_t *message_array,
unsigned int length)
{
if (!context) return shaNull;
if (!length) return shaSuccess;
if (!message_array) return shaNull;
if (context->Computed) return context->Corrupted = shaStateError;
if (context->Corrupted) return context->Corrupted;
while (length--) {
context->Message_Block[context->Message_Block_Index++] =
*message_array;
if ((SHA224_256AddLength(context, 8) == shaSuccess) &&
(context->Message_Block_Index == SHA256_Message_Block_Size))
SHA224_256ProcessMessageBlock(context);
message_array++;
}
return context->Corrupted;
}
/*
* SHA256FinalBits
*
* Description:
* This function will add in any final bits of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* message_bits: [in]
* The final bits of the message, in the upper portion of the
* byte. (Use 0b###00000 instead of 0b00000### to input the
* three bits ###.)
* length: [in]
* The number of bits in message_bits, between 1 and 7.
*
* Returns:
* sha Error Code.
*/
int SHA256FinalBits(SHA256Context *context,
uint8_t message_bits, unsigned int length)
{
static uint8_t masks[8] = {
/* 0 0b00000000 */ 0x00, /* 1 0b10000000 */ 0x80,
/* 2 0b11000000 */ 0xC0, /* 3 0b11100000 */ 0xE0,
/* 4 0b11110000 */ 0xF0, /* 5 0b11111000 */ 0xF8,
/* 6 0b11111100 */ 0xFC, /* 7 0b11111110 */ 0xFE
};
static uint8_t markbit[8] = {
/* 0 0b10000000 */ 0x80, /* 1 0b01000000 */ 0x40,
/* 2 0b00100000 */ 0x20, /* 3 0b00010000 */ 0x10,
/* 4 0b00001000 */ 0x08, /* 5 0b00000100 */ 0x04,
/* 6 0b00000010 */ 0x02, /* 7 0b00000001 */ 0x01
};
if (!context) return shaNull;
if (!length) return shaSuccess;
if (context->Corrupted) return context->Corrupted;
if (context->Computed) return context->Corrupted = shaStateError;
if (length >= 8) return context->Corrupted = shaBadParam;
SHA224_256AddLength(context, length);
SHA224_256Finalize(context, (uint8_t)
((message_bits & masks[length]) | markbit[length]));
return context->Corrupted;
}
/*
* SHA256Result
*
* Description:
* This function will return the 256-bit message digest
* into the Message_Digest array provided by the caller.
* NOTE:
* The first octet of hash is stored in the element with index 0,
* the last octet of hash in the element with index 31.
*
* Parameters:
* context: [in/out]
* The context to use to calculate the SHA hash.
* Message_Digest[ ]: [out]
* Where the digest is returned.
*
* Returns:
* sha Error Code.
*/
int SHA256Result(SHA256Context *context,
uint8_t Message_Digest[SHA256HashSize])
{
return SHA224_256ResultN(context, Message_Digest, SHA256HashSize);
}
/*
* SHA224_256Reset
*
* Description:
* This helper function will initialize the SHA256Context in
* preparation for computing a new SHA-224 or SHA-256 message digest.
*
* Parameters:
* context: [in/out]
* The context to reset.
* H0[ ]: [in]
* The initial hash value array to use.
*
* Returns:
* sha Error Code.
*/
static int SHA224_256Reset(SHA256Context *context, uint32_t *H0)
{
if (!context) return shaNull;
context->Length_High = context->Length_Low = 0;
context->Message_Block_Index = 0;
context->Intermediate_Hash[0] = H0[0];
context->Intermediate_Hash[1] = H0[1];
context->Intermediate_Hash[2] = H0[2];
context->Intermediate_Hash[3] = H0[3];
context->Intermediate_Hash[4] = H0[4];
context->Intermediate_Hash[5] = H0[5];
context->Intermediate_Hash[6] = H0[6];
context->Intermediate_Hash[7] = H0[7];
context->Computed = 0;
context->Corrupted = shaSuccess;
return shaSuccess;
}
/*
* SHA224_256ProcessMessageBlock
*
* Description:
* This helper function will process the next 512 bits of the
* message stored in the Message_Block array.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
*
* Returns:
* Nothing.
*
* Comments:
* Many of the variable names in this code, especially the
* single character names, were used because those were the
* names used in the Secure Hash Standard.
*/
static void SHA224_256ProcessMessageBlock(SHA256Context *context)
{
/* Constants defined in FIPS 180-3, section 4.2.2 */
static const uint32_t K[64] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,
0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,
0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,
0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,
0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,
0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,
0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,
0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,
0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};
int t, t4; /* Loop counter */
uint32_t temp1, temp2; /* Temporary word value */
uint32_t W[64]; /* Word sequence */
uint32_t A, B, C, D, E, F, G, H; /* Word buffers */
/*
* Initialize the first 16 words in the array W
*/
for (t = t4 = 0; t < 16; t++, t4 += 4)
W[t] = (((uint32_t)context->Message_Block[t4]) << 24) |
(((uint32_t)context->Message_Block[t4 + 1]) << 16) |
(((uint32_t)context->Message_Block[t4 + 2]) << 8) |
(((uint32_t)context->Message_Block[t4 + 3]));
for (t = 16; t < 64; t++)
W[t] = SHA256_sigma1(W[t-2]) + W[t-7] +
SHA256_sigma0(W[t-15]) + W[t-16];
A = context->Intermediate_Hash[0];
B = context->Intermediate_Hash[1];
C = context->Intermediate_Hash[2];
D = context->Intermediate_Hash[3];
E = context->Intermediate_Hash[4];
F = context->Intermediate_Hash[5];
G = context->Intermediate_Hash[6];
H = context->Intermediate_Hash[7];
for (t = 0; t < 64; t++) {
temp1 = H + SHA256_SIGMA1(E) + SHA_Ch(E,F,G) + K[t] + W[t];
temp2 = SHA256_SIGMA0(A) + SHA_Maj(A,B,C);
H = G;
G = F;
F = E;
E = D + temp1;
D = C;
C = B;
B = A;
A = temp1 + temp2;
}
context->Intermediate_Hash[0] += A;
context->Intermediate_Hash[1] += B;
context->Intermediate_Hash[2] += C;
context->Intermediate_Hash[3] += D;
context->Intermediate_Hash[4] += E;
context->Intermediate_Hash[5] += F;
context->Intermediate_Hash[6] += G;
context->Intermediate_Hash[7] += H;
context->Message_Block_Index = 0;
}
/*
* SHA224_256Finalize
*
* Description:
* This helper function finishes off the digest calculations.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* Pad_Byte: [in]
* The last byte to add to the message block before the 0-padding
* and length. This will contain the last bits of the message
* followed by another single bit. If the message was an
* exact multiple of 8-bits long, Pad_Byte will be 0x80.
*
* Returns:
* sha Error Code.
*/
static void SHA224_256Finalize(SHA256Context *context,
uint8_t Pad_Byte)
{
int i;
SHA224_256PadMessage(context, Pad_Byte);
/* message may be sensitive, so clear it out */
for (i = 0; i < SHA256_Message_Block_Size; ++i)
context->Message_Block[i] = 0;
context->Length_High = 0; /* and clear length */
context->Length_Low = 0;
context->Computed = 1;
}
/*
* SHA224_256PadMessage
*
* Description:
* According to the standard, the message must be padded to the next
* even multiple of 512 bits. The first padding bit must be a '1'.
* The last 64 bits represent the length of the original message.
* All bits in between should be 0. This helper function will pad
* the message according to those rules by filling the
* Message_Block array accordingly. When it returns, it can be
* assumed that the message digest has been computed.
*
* Parameters:
* context: [in/out]
* The context to pad.
* Pad_Byte: [in]
* The last byte to add to the message block before the 0-padding
* and length. This will contain the last bits of the message
* followed by another single bit. If the message was an
* exact multiple of 8-bits long, Pad_Byte will be 0x80.
*
* Returns:
* Nothing.
*/
static void SHA224_256PadMessage(SHA256Context *context,
uint8_t Pad_Byte)
{
/*
* Check to see if the current message block is too small to hold
* the initial padding bits and length. If so, we will pad the
* block, process it, and then continue padding into a second
* block.
*/
if (context->Message_Block_Index >= (SHA256_Message_Block_Size-8)) {
context->Message_Block[context->Message_Block_Index++] = Pad_Byte;
while (context->Message_Block_Index < SHA256_Message_Block_Size)
context->Message_Block[context->Message_Block_Index++] = 0;
SHA224_256ProcessMessageBlock(context);
} else
context->Message_Block[context->Message_Block_Index++] = Pad_Byte;
while (context->Message_Block_Index < (SHA256_Message_Block_Size-8))
context->Message_Block[context->Message_Block_Index++] = 0;
/*
* Store the message length as the last 8 octets
*/
context->Message_Block[56] = (uint8_t)(context->Length_High >> 24);
context->Message_Block[57] = (uint8_t)(context->Length_High >> 16);
context->Message_Block[58] = (uint8_t)(context->Length_High >> 8);
context->Message_Block[59] = (uint8_t)(context->Length_High);
context->Message_Block[60] = (uint8_t)(context->Length_Low >> 24);
context->Message_Block[61] = (uint8_t)(context->Length_Low >> 16);
context->Message_Block[62] = (uint8_t)(context->Length_Low >> 8);
context->Message_Block[63] = (uint8_t)(context->Length_Low);
SHA224_256ProcessMessageBlock(context);
}
/*
* SHA224_256ResultN
*
* Description:
* This helper function will return the 224-bit or 256-bit message
* digest into the Message_Digest array provided by the caller.
* NOTE:
* The first octet of hash is stored in the element with index 0,
* the last octet of hash in the element with index 27/31.
*
* Parameters:
* context: [in/out]
* The context to use to calculate the SHA hash.
* Message_Digest[ ]: [out]
* Where the digest is returned.
* HashSize: [in]
* The size of the hash, either 28 or 32.
*
* Returns:
* sha Error Code.
*/
static int SHA224_256ResultN(SHA256Context *context,
uint8_t Message_Digest[ ], int HashSize)
{
int i;
if (!context) return shaNull;
if (!Message_Digest) return shaNull;
if (context->Corrupted) return context->Corrupted;
if (!context->Computed)
SHA224_256Finalize(context, 0x80);
for (i = 0; i < HashSize; ++i)
Message_Digest[i] = (uint8_t)
(context->Intermediate_Hash[i>>2] >> 8 * ( 3 - ( i & 0x03 ) ));
return shaSuccess;
}

1034
src/3rdparty/rfc6234/sha384-512.c vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@ class Q_CONCURRENT_EXPORT QFutureWatcherBase : public QObject
Q_DECLARE_PRIVATE(QFutureWatcherBase)
public:
QFutureWatcherBase(QObject *parent = 0);
explicit QFutureWatcherBase(QObject *parent = 0);
int progressValue() const;
int progressMinimum() const;
@ -119,7 +119,7 @@ template <typename T>
class QFutureWatcher : public QFutureWatcherBase
{
public:
QFutureWatcher(QObject *_parent = 0)
explicit QFutureWatcher(QObject *_parent = 0)
: QFutureWatcherBase(_parent)
{ }
~QFutureWatcher()
@ -189,7 +189,7 @@ template <>
class QFutureWatcher<void> : public QFutureWatcherBase
{
public:
QFutureWatcher(QObject *_parent = 0)
explicit QFutureWatcher(QObject *_parent = 0)
: QFutureWatcherBase(_parent)
{ }
~QFutureWatcher()

View File

@ -1,18 +1,62 @@
get_filename_component(_qt5_corelib_install_prefix ${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR} ABSOLUTE)
# Required by default:
set(QT_QMAKE_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/qmake$$CMAKE_BIN_SUFFIX\")
set(QT_MOC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/moc$$CMAKE_BIN_SUFFIX\")
set(QT_RCC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/rcc$$CMAKE_BIN_SUFFIX\")
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
set(QT_QMAKE_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
set(QT_MOC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
set(QT_RCC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
!!ELSE
set(QT_QMAKE_EXECUTABLE \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
set(QT_MOC_EXECUTABLE \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
set(QT_RCC_EXECUTABLE \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
!!ENDIF
!!IF isEmpty(CMAKE_DATA_DIR_IS_ABSOLUTE)
list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/default\")
!!ELSE
list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_DATA_DIR}mkspecs/default\")
!!ENDIF
if (NOT \"$${CMAKE_ADD_FPIE_FLAGS}\" STREQUAL \"\")
set(Qt5Core_EXECUTABLE_COMPILE_FLAGS "-fPIE")
!!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS)
set(Qt5Core_EXECUTABLE_COMPILE_FLAGS "-fPIE")
!!ENDIF
!!IF !isEmpty(QT_NAMESPACE)
list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
!!ENDIF
!!IF !isEmpty(QT_LIBINFIX)
set(QT_LIBINFIX \"$${QT_LIBINFIX}\")
!!ENDIF
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain)
if (NOT _Qt5WinMain_target)
set(_Qt5WinMain_target 1)
add_library(Qt5::WinMain STATIC IMPORTED)
endif()
if (NOT \"$$QT_NAMESPACE\" STREQUAL \"\")
list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
endif()
!!IF !isEmpty(debug_type)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt5::WinMain PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_DEBUG "${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}"
!!ELSE
IMPORTED_LOCATION_DEBUG "$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}"
!!ENDIF
)
!!ENDIF
!!IF !isEmpty(release_type)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Qt5::WinMain PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
!!ELSE
IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
!!ENDIF
)
!!ENDIF
!!ENDIF

View File

@ -83,7 +83,7 @@ macro(QT5_GET_MOC_FLAGS _moc_flags)
set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
endforeach()
if(Q_WS_WIN)
if(WIN32)
set(${_moc_flags} ${${_moc_flags}} -DWIN32)
endif()
endmacro()

View File

@ -1495,35 +1495,7 @@ QString QTextDecoder::toUnicode(const QByteArray &ba)
files to be loaded. For details of internationalization, see
\l{Internationalization with Qt}.
\sa codecForTr(), setCodecForCStrings()
*/
/*!
\fn QTextCodec* QTextCodec::codecForCStrings()
Returns the codec used by QString to convert to and from \c{const
char *} and QByteArrays. If this function returns 0 (the default),
QString assumes Latin-1.
\sa setCodecForCStrings()
*/
/*!
\fn void QTextCodec::setCodecForCStrings(QTextCodec *codec)
\nonreentrant
Sets the codec used by QString to convert to and from \c{const
char *} and QByteArrays. If the \a codec is 0 (the default),
QString assumes Latin-1.
\warning Some codecs do not preserve the characters in the ASCII
range (0x00 to 0x7F). For example, the Japanese Shift-JIS
encoding maps the backslash character (0x5A) to the Yen
character. To avoid undesirable side-effects, we recommend
avoiding such codecs with setCodecsForCString().
\sa codecForCStrings(), setCodecForTr()
\sa codecForTr()
*/
/*!

View File

@ -75,9 +75,6 @@ public:
static QTextCodec* codecForTr();
static void setCodecForTr(QTextCodec *c);
static QTextCodec* codecForCStrings();
static void setCodecForCStrings(QTextCodec *c);
static QTextCodec *codecForHtml(const QByteArray &ba);
static QTextCodec *codecForHtml(const QByteArray &ba, QTextCodec *defaultCodec);
@ -139,8 +136,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QTextCodec::ConversionFlags)
inline QTextCodec* QTextCodec::codecForTr() { return validCodecs() ? cftr : 0; }
inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; }
inline QTextCodec* QTextCodec::codecForCStrings() { return validCodecs() ? QString::codecForCStrings : 0; }
inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { QString::codecForCStrings = c; }
class Q_CORE_EXPORT QTextEncoder {
Q_DISABLE_COPY(QTextEncoder)

View File

@ -76,14 +76,13 @@
# define Q_CC_SYM
/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
# if defined(__SC__) && __SC__ < 0x750
# define Q_NO_EXPLICIT_KEYWORD
# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD
#elif defined(_MSC_VER)
# define Q_CC_MSVC
# define Q_CC_MSVC_NET
# define Q_CANNOT_DELETE_CONSTANT
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_NO_TEMPLATE_FRIENDS
# define Q_ALIGNOF(type) __alignof(type)
@ -114,8 +113,7 @@
# define Q_CC_BOR
# define Q_INLINE_TEMPLATE
# if __BORLANDC__ < 0x502
# define Q_NO_BOOL_TYPE
# define Q_NO_EXPLICIT_KEYWORD
# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD
@ -140,45 +138,19 @@
# define Q_CC_MINGW
# endif
# if defined(__INTEL_COMPILER)
/* Intel C++ also masquerades as GCC 3.2.0 */
/* Intel C++ also masquerades as GCC */
# define Q_CC_INTEL
# endif
# if defined(__clang__)
/* Clang also masquerades as GCC 4.2.1 */
/* Clang also masquerades as GCC */
# define Q_CC_CLANG
# endif
# ifdef __APPLE__
# define Q_NO_DEPRECATED_CONSTRUCTORS
# endif
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
# define Q_FULL_TEMPLATE_INSTANTIATION
# endif
/* GCC 2.95 knows "using" but does not support it correctly */
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
# define Q_NO_USING_KEYWORD
# endif
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# endif
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
# endif
/* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */
# if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1
# define Q_WRONG_SB_CTYPE_MACROS
# endif
/* GCC <= 3.3 cannot handle template friends */
# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3)
# define Q_NO_TEMPLATE_FRIENDS
# endif
/* Apple's GCC 3.1 chokes on our streaming qDebug() */
# if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3)
# define Q_BROKEN_DEBUG_STREAM
# endif
# if (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_MOC_CPP)
# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
# if !defined(QT_MOC_CPP)
# define Q_PACKED __attribute__ ((__packed__))
# define Q_NO_PACKED_REFERENCE
# ifndef __ARM_EABI__
@ -251,12 +223,7 @@
# define Q_CC_XLC
# define Q_FULL_TEMPLATE_INSTANTIATION
# if __xlC__ < 0x400
# define Q_NO_BOOL_TYPE
# define Q_NO_EXPLICIT_KEYWORD
# define Q_NO_USING_KEYWORD
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
# define Q_CANNOT_DELETE_CONSTANT
# error "Compiler not supported"
# elif __xlC__ >= 0x0600
# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
@ -280,7 +247,7 @@
- observed on Compaq C++ V6.3-002.
In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
# if !defined(_BOOL_EXISTS)
# define Q_NO_BOOL_TYPE
# error "Compiler not supported"
# endif
/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
# define Q_NO_USING_KEYWORD
@ -288,7 +255,6 @@
DEC C++ V5.5-004. */
# if __DECCXX_VER < 60060000
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
# define Q_CANNOT_DELETE_CONSTANT
# endif
/* avoid undefined symbol problems with out-of-line template members */
# define Q_OUTOFLINE_TEMPLATE inline
@ -315,7 +281,7 @@
__BOOL_DEFINED
Defined in Microsoft C++ mode when bool is a keyword. */
# if !defined(_BOOL) && !defined(__BOOL_DEFINED)
# define Q_NO_BOOL_TYPE
# error "Compiler not supported"
# endif
/* The Comeau compiler is based on EDG and does define __EDG__ */
@ -341,9 +307,8 @@
# elif defined(__DCC__)
# define Q_CC_DIAB
# undef Q_NO_BOOL_TYPE
# if !defined(__bool)
# define Q_NO_BOOL_TYPE
# error "Compiler not supported"
# endif
/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
@ -407,7 +372,7 @@
# define Q_NO_TEMPLATE_FRIENDS
# endif
# if !defined(_BOOL)
# define Q_NO_BOOL_TYPE
# error "Compiler not supported"
# endif
# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
# define Q_NO_USING_KEYWORD
@ -415,9 +380,7 @@
# define Q_C_CALLBACKS
/* 4.2 compiler or older */
# else
# define Q_NO_BOOL_TYPE
# define Q_NO_EXPLICIT_KEYWORD
# define Q_NO_USING_KEYWORD
# error "Compiler not supported"
# endif
/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
@ -426,7 +389,7 @@
# define Q_CC_EDG
# define Q_CC_CDS
# if !defined(_BOOL)
# define Q_NO_BOOL_TYPE
# error "Compiler not supported"
# endif
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
@ -449,11 +412,7 @@
# define Q_DECL_IMPORT Q_DECL_EXPORT
# endif
# else
# define Q_CC_HP
# define Q_NO_BOOL_TYPE
# define Q_FULL_TEMPLATE_INSTANTIATION
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
# define Q_NO_EXPLICIT_KEYWORD
# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD /* ### check "using" status */

View File

@ -191,7 +191,7 @@ namespace QT_NAMESPACE {}
#endif
#ifndef Q_REQUIRED_RESULT
# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
# if defined(Q_CC_GNU)
# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
# else
# define Q_REQUIRED_RESULT
@ -275,11 +275,6 @@ typedef unsigned int uint;
typedef unsigned long ulong;
QT_END_INCLUDE_NAMESPACE
#if defined(Q_NO_BOOL_TYPE)
#error "Compiler doesn't support the bool type"
#endif
/*
Constant bool values
*/
@ -315,9 +310,7 @@ QT_END_INCLUDE_NAMESPACE
/*
Warnings and errors when using deprecated methods
*/
#if defined(Q_MOC_RUN)
# define Q_DECL_DEPRECATED Q_DECL_DEPRECATED
#elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT)
#if defined(Q_CC_GNU) || defined(Q_CC_RVCT)
# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
#elif defined(Q_CC_MSVC)
# define Q_DECL_DEPRECATED __declspec(deprecated)
@ -331,15 +324,6 @@ QT_END_INCLUDE_NAMESPACE
#ifndef Q_DECL_VARIABLE_DEPRECATED
# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
#endif
#ifndef Q_DECL_CONSTRUCTOR_DEPRECATED
# if defined(Q_MOC_RUN)
# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
# elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)
# define Q_DECL_CONSTRUCTOR_DEPRECATED
# else
# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED
# endif
#endif
#if defined(QT_NO_DEPRECATED)
# undef QT_DEPRECATED
@ -394,24 +378,13 @@ QT_END_INCLUDE_NAMESPACE
#ifdef QT_ASCII_CAST_WARNINGS
# define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED
# if defined(Q_CC_GNU) && __GNUC__ < 4
/* gcc < 4 doesn't like Q_DECL_DEPRECATED in front of constructors */
# define QT_ASCII_CAST_WARN_CONSTRUCTOR
# else
# define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED
# endif
#else
# define QT_ASCII_CAST_WARN
# define QT_ASCII_CAST_WARN_CONSTRUCTOR
#endif
#if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE)
# if defined(Q_CC_GNU)
#if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332)
# define QT_FASTCALL __attribute__((regparm(3)))
#else
# define QT_FASTCALL
#endif
# elif defined(Q_CC_MSVC)
# define QT_FASTCALL __fastcall
# else
@ -512,17 +485,12 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
class QDataStream;
#if !defined(QT_NO_COP)
# define QT_NO_COP
#endif
#if defined(Q_OS_VXWORKS)
# define QT_NO_CRASHHANDLER // no popen
# define QT_NO_PROCESS // no exec*, no fork
# define QT_NO_LPR
# 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
# define QT_NO_QWS_MULTIPROCESS // no processes
#endif
# include <QtCore/qfeatures.h>
@ -1237,12 +1205,15 @@ class QFlags
int i;
public:
typedef Enum enum_type;
Q_DECL_CONSTEXPR inline QFlags(const QFlags &f) : i(f.i) {}
// compiler-generated copy/move ctor/assignment operators are fine!
#ifdef qdoc
inline QFlags(const QFlags &other);
inline QFlags &operator=(const QFlags &other);
#endif
Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {}
Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {}
inline QFlags(QFlag f) : i(f) {}
inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
inline QFlags &operator&=(int mask) { i &= mask; return *this; }
inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
@ -1463,8 +1434,6 @@ Q_CORE_EXPORT int qrand();
#ifdef Q_OS_QNX
// QNX doesn't have SYSV style shared memory. Multiprocess QWS apps,
// shared fonts and QSystemSemaphore + QSharedMemory are not available
# define QT_NO_QWS_MULTIPROCESS
# define QT_NO_QWS_SHARE_FONTS
# define QT_NO_SYSTEMSEMAPHORE
# define QT_NO_SHAREDMEMORY
#endif

View File

@ -348,71 +348,8 @@ QLibraryInfo::location(LibraryLocation loc)
QSettings *config = QLibraryInfoPrivate::configuration();
config->beginGroup(QLatin1String("Paths"));
QString subKey;
{
/*
find the child group whose version number is closest
to the library version. for example and we have the
following groups:
ret = config->value(key, defaultValue).toString();
Paths
Paths/4.0
Paths/4.1.2
Paths/4.2.5
Paths/5
if QT_VERSION is 4.0.1, then we use 'Paths/4.0'
if QT_VERSION is 4.1.5, then we use 'Paths/4.1.2'
if QT_VERSION is 4.6.3, then we use 'Paths/4.2.5'
if QT_VERSION is 6.0.2, then we use 'Paths/5'
note: any of the trailing version numbers may be
omitted (in which case, they default to zero),
i.e. 4 == 4.0.0, 4.1 == 4.1.0, and so on
*/
enum {
QT_MAJOR = ((QT_VERSION >> 16) & 0xFF),
QT_MINOR = ((QT_VERSION >> 8) & 0xFF),
QT_PATCH = (QT_VERSION & 0xFF)
};
int maj = 0, min = 0, pat = 0;
QStringList children = config->childGroups();
for(int child = 0; child < children.size(); ++child) {
QString cver = children.at(child);
QStringList cver_list = cver.split(QLatin1Char('.'));
if(cver_list.size() > 0 && cver_list.size() < 4) {
bool ok;
int cmaj = -1, cmin = -1, cpat = -1;
cmaj = cver_list[0].toInt(&ok);
if(!ok || cmaj < 0)
continue;
if(cver_list.size() >= 2) {
cmin = cver_list[1].toInt(&ok);
if(!ok)
continue;
if(cmin < 0)
cmin = -1;
}
if(cver_list.size() >= 3) {
cpat = cver_list[2].toInt(&ok);
if(!ok)
continue;
if(cpat < 0)
cpat = -1;
}
if((cmaj >= maj && cmaj <= QT_MAJOR) &&
(cmin == -1 || (cmin >= min && cmin <= QT_MINOR)) &&
(cpat == -1 || (cpat >= pat && cpat <= QT_PATCH)) &&
config->contains(cver + QLatin1Char('/') + key)) {
subKey = cver + QLatin1Char('/');
maj = cmaj;
min = cmin;
pat = cpat;
}
}
}
}
ret = config->value(subKey + key, defaultValue).toString();
// expand environment variables in the form $(ENVVAR)
int rep;
QRegExp reg_var(QLatin1String("\\$\\(.*\\)"));

View File

@ -293,6 +293,7 @@ public:
WindowStaysOnTopHint = 0x00040000,
WindowTransparentForInput = 0x00080000,
WindowOverridesSystemGestures = 0x00100000,
WindowDoesNotAcceptFocus = 0x00200000,
CustomizeWindowHint = 0x02000000,
WindowStaysOnBottomHint = 0x04000000,

View File

@ -2112,6 +2112,9 @@
implements its own set of gestures and that system level gestures, like for
instance three-finger desktop switching, should be disabled.
\value WindowDoesNotAcceptFocus Informs the window system that this window should
not receive the input focus.
\value WindowType_Mask A mask for extracting the window type
part of the window flags.

View File

@ -66,7 +66,9 @@
QT_BEGIN_NAMESPACE
#ifndef Q_OS_WIN
#define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER
#endif
// used in testing framework
#define QSETTINGS_P_H_VERSION 3

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