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

Conflicts:
	tests/auto/corelib/io/qfile/tst_qfile.cpp
	tests/auto/corelib/io/qprocess/tst_qprocess.cpp
	tests/auto/corelib/tools/qversionnumber/qversionnumber.pro

Change-Id: Ia93ce500349d96a2fbf0b4a37b73f088cc505c6e
bb10
Liang Qi 2015-10-14 15:45:35 +02:00
commit 4456984da7
591 changed files with 6470 additions and 3534 deletions

View File

@ -1149,9 +1149,12 @@ if($check_includes) {
$header = 0 if($header eq $_);
}
if($header) {
# We need both $public_header and $private_header because QPA headers count as neither
my $public_header = $header;
my $private_header = 0;
if($public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) {
$public_header = 0;
$private_header = $header =~ /_p.h$/ && $subdir !~ /3rdparty/
} elsif (isQpaHeader($public_header)) {
$public_header = 0;
} else {
@ -1169,43 +1172,50 @@ if($check_includes) {
}
my $iheader = $subdir . "/" . $header;
if($public_header) {
if(open(F, "<$iheader")) {
my $qt_begin_namespace_found = 0;
my $qt_end_namespace_found = 0;
my $qt_namespace_suffix = "";
my $line;
my $stop_processing = 0;
while($line = <F>) {
chomp $line;
my $output_line = 1;
if($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) {
$stop_processing = 1;
last;
} elsif($line =~ /^ *\# *include/) {
my $include = $line;
if($line =~ /<.*>/) {
$include =~ s,.*<(.*)>.*,$1,;
} elsif($line =~ /".*"/) {
$include =~ s,.*"(.*)".*,$1,;
} else {
$include = 0;
}
if($include) {
if (open(F, "<$iheader")) {
my $qt_begin_namespace_found = 0;
my $qt_end_namespace_found = 0;
my $qt_namespace_suffix = "";
my $line;
my $stop_processing = 0;
my $we_mean_it = 0;
while ($line = <F>) {
chomp $line;
my $output_line = 1;
if ($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) {
$stop_processing = 1;
last;
} elsif ($line =~ /^ *\# *include/) {
my $include = $line;
if ($line =~ /<.*>/) {
$include =~ s,.*<(.*)>.*,$1,;
} elsif ($line =~ /".*"/) {
$include =~ s,.*"(.*)".*,$1,;
} else {
$include = 0;
}
if ($include) {
if ($public_header) {
for my $trylib (keys(%modules)) {
if(-e "$out_basedir/include/$trylib/$include") {
print "$lib: WARNING: $iheader includes $include when it should include $trylib/$include\n";
}
}
}
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) {
}
} elsif (!$private_header) {
if ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) {
$qt_namespace_suffix = defined($1) ? $1 : "";
$qt_begin_namespace_found = 1;
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) {
$qt_end_namespace_found = 1;
}
} elsif ($line =~ "^// We mean it.") {
++$we_mean_it;
}
}
if ($public_header) {
if ($header_skip_qt_begin_namespace_test == 0 and $stop_processing == 0) {
if ($qt_begin_namespace_found == 0) {
print "$lib: WARNING: $iheader does not include QT_BEGIN_NAMESPACE\n";
@ -1215,9 +1225,11 @@ if($check_includes) {
print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE$qt_namespace_suffix but no QT_END_NAMESPACE$qt_namespace_suffix\n";
}
}
close(F);
} elsif ($private_header) {
print "$lib: WARNING: $iheader does not have the \"We mean it.\" warning\n" if (!$we_mean_it);
}
close(F);
}
}
}

View File

@ -0,0 +1,53 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
// Test both EGLDevice/Output/Stream and DRM as we only use them in combination.
//
// Other KMS/DRM tests relying on pkgconfig for libdrm are not suitable since
// some systems do not use pkgconfig for the graphics stuff.
#include <stdlib.h>
#include <stdint.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
int main(int, char **)
{
EGLDeviceEXT device = 0;
EGLStreamKHR stream = 0;
EGLOutputLayerEXT layer = 0;
drmModeCrtcPtr currentMode = drmModeGetCrtc(0, 0);
return EGL_DRM_CRTC_EXT;
}

View File

@ -0,0 +1,12 @@
SOURCES = eglfs-egldevice.cpp
for(p, QMAKE_LIBDIR_EGL) {
exists($$p):LIBS += -L$$p
}
INCLUDEPATH += $$QMAKE_INCDIR_EGL
LIBS += $$QMAKE_LIBS_EGL
LIBS += -ldrm
CONFIG -= qt

View File

@ -0,0 +1,44 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the config.tests of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(int, char **)
{
EGLDisplay dpy = 0;
EGLContext ctx = 0;
mali_native_window *w = 0;
eglDestroyContext(dpy, ctx);
return 0;
}

View File

@ -0,0 +1,5 @@
SOURCES = eglfs-mali-2.cpp
CONFIG -= qt
LIBS += -lEGL -lGLESv2

View File

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

View File

@ -0,0 +1,4 @@
SOURCES = gbm.cpp
CONFIG += link_pkgconfig
PKGCONFIG += gbm
CONFIG -= qt

View File

@ -32,17 +32,14 @@
****************************************************************************/
#include <stdlib.h>
#include <stdint.h>
extern "C" {
#include <gbm.h>
#include <xf86drmMode.h>
#include <xf86drm.h>
}
#include <EGL/egl.h>
#include <GLES2/gl2.h>
int main(int, char **)
{
// Check for gbm_surface which is quite a recent addition.
gbm_surface *surface = 0;
drmModeCrtcPtr currentMode = drmModeGetCrtc(0, 0);
return 0;
}

View File

@ -1,4 +1,4 @@
SOURCES = kms.cpp
CONFIG += link_pkgconfig
PKGCONFIG += libdrm libudev egl gbm glesv2
PKGCONFIG += libdrm libudev
CONFIG -= qt

View File

@ -37,6 +37,5 @@
int main(int, char**)
{
gst_is_initialized();
return 0;
}

115
configure vendored
View File

@ -318,7 +318,7 @@ macSDKify()
val=$(echo $sdk_val $(echo $val | cut -s -d ' ' -f 2-))
echo "$var=$val"
;;
QMAKE_CFLAGS=*|QMAKE_CXXFLAGS=*|QMAKE_OBJECTIVE_CFLAGS=*)
QMAKE_CFLAGS=*|QMAKE_CXXFLAGS=*)
echo "$line -isysroot $sysroot $version_min_flag"
;;
QMAKE_LFLAGS=*)
@ -682,9 +682,11 @@ CFG_XCB_XLIB=auto
CFG_XCB_GLX=no
CFG_EGLFS=auto
CFG_EGLFS_BRCM=no
CFG_EGLFS_EGLDEVICE=no
CFG_EGLFS_MALI=no
CFG_EGLFS_VIV=no
CFG_DIRECTFB=auto
CFG_GBM=auto
CFG_LINUXFB=auto
CFG_KMS=auto
CFG_MIRCLIENT=auto
@ -1811,6 +1813,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
gbm)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_GBM="$VAL"
else
UNKNOWN_OPT=yes
fi
;;
linuxfb)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_LINUXFB="$VAL"
@ -1970,7 +1979,8 @@ while [ "$#" -gt 0 ]; do
if [ "$VAL" = "no" ] || [ "$VAL" = "linked" ] || [ "$VAL" = "runtime" ]; then
CFG_DBUS="$VAL"
elif [ "$VAL" = "yes" ]; then
CFG_DBUS="runtime"
# keep as auto, we'll auto-detect whether to go linked or runtime later
CFG_DBUS=auto
else
UNKNOWN_OPT=yes
fi
@ -1982,6 +1992,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
dbus-runtime)
if [ "$VAL" = "yes" ]; then
CFG_DBUS="runtime"
else
UNKNOWN_OPT=yes
fi
;;
nis)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_NIS="$VAL"
@ -2616,8 +2633,8 @@ Additional options:
-pch ............... Use precompiled header support.
-no-dbus ........... Do not compile the Qt D-Bus module.
+ -dbus .............. Compile the Qt D-Bus module and dynamically load libdbus-1.
-dbus-linked ....... Compile the Qt D-Bus module and link to libdbus-1.
+ -dbus-linked ....... Compile the Qt D-Bus module and link to libdbus-1.
-dbus-runtime ...... Compile the Qt D-Bus module and dynamically load libdbus-1.
-reduce-relocations ..... Reduce relocations in the libraries through extra
linker optimizations (Qt/X11 and Qt for Embedded Linux only;
@ -2643,8 +2660,11 @@ Additional options:
-no-eglfs .......... Do not compile EGLFS (EGL Full Screen/Single Surface) support.
* -eglfs ............. Compile EGLFS support.
-no-kms ............ Do not compile EGLFS KMS backend.
* -kms ............... Compile EGLFS KMS backend.
-no-kms ............ Do not compile backends for KMS.
* -kms ............... Compile backends for KMS.
-no-gbm ............ Do not compile backends for GBM.
* -gbm ............... Compile backends for GBM.
-no-directfb ....... Do not compile DirectFB support.
* -directfb .......... Compile DirectFB support.
@ -3324,6 +3344,8 @@ fi
# tests that don't need qmake (must be run before displaying help)
#-------------------------------------------------------------------------------
echo "Running configuration tests (phase 1)..."
# detect build style
if [ "$CFG_DEBUG" = "auto" ]; then
if [ "$XPLATFORM_MAC" = "yes" -o "$XPLATFORM_MINGW" = "yes" ]; then
@ -3596,6 +3618,8 @@ unset tty
eval "`LC_ALL=C $TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null | $AWK "$awkprog" | tee $tty`"
unset tty
echo "Done running configuration tests."
#setup the build parts
if [ -z "$CFG_BUILD_PARTS" ]; then
CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
@ -4097,7 +4121,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
fi
fi # Build qmake
echo "Running configuration tests..."
echo "Running configuration tests (phase 2)..."
#-------------------------------------------------------------------------------
# create a qt.conf for the Qt build tree itself
@ -4724,13 +4748,6 @@ if [ "$CFG_EGLFS" = "yes" ]; then
CFG_EGL=yes
fi
if [ "$CFG_KMS" = "yes" ]; then
if [ "$CFG_EGL" = "no" ]; then
echo "The KMS plugin requires EGL support and cannot be built"
exit 101
fi
fi
# auto-detect SQL-modules support
for _SQLDR in $CFG_SQL_AVAILABLE; do
case $_SQLDR in
@ -5043,10 +5060,10 @@ if [ "$CFG_ICONV" != "no" ]; then
fi
# auto-detect libdbus-1 support
if [ "$CFG_DBUS" = "auto" ]; then
CFG_DBUS="runtime"
fi
if [ "$CFG_DBUS" = "linked" ]; then
# auto: detect if libdbus-1 is present; if so, link to it
# linked: fail if libdbus-1 is not present; otherwise link to it
# runtime: no detection (cannot fail), load libdbus-1 at runtime
if [ "$CFG_DBUS" = "auto" ] || [ "$CFG_DBUS" = "linked" ]; then
if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then
QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null`
QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null`
@ -5062,14 +5079,19 @@ if [ "$CFG_DBUS" = "linked" ]; then
QT_CFLAGS_DBUS=`env -i PATH="$PATH" pkg-config --cflags dbus-1 2>/dev/null`
fi
QMakeVar set QT_HOST_CFLAGS_DBUS "$QT_CFLAGS_DBUS"
CFG_DBUS=linked
else
if [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
# Failed to compile the test, so it's an error if CFG_DBUS is "linked"
if [ "$CFG_DBUS" = "linked" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo "The Qt D-Bus module cannot be enabled because libdbus-1 version $MIN_DBUS_1_VERSION was not found."
[ -z "$PKG_CONFIG" ] && echo " Use of pkg-config is not enabled, maybe you want to pass -pkg-config?"
echo " Turn on verbose messaging (-v) to $0 to see the final report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
exit 101
else
# CFG_DBUS is "auto" here
CFG_DBUS=runtime
fi
fi
fi
@ -5353,7 +5375,6 @@ ORIG_CFG_XCB="$CFG_XCB"
ORIG_CFG_EGLFS="$CFG_EGLFS"
ORIG_CFG_DIRECTFB="$CFG_DIRECTFB"
ORIG_CFG_LINUXFB="$CFG_LINUXFB"
ORIG_CFG_KMS="$CFG_KMS"
ORIG_CFG_MIRCLIENT="$CFG_MIRCLIENT"
if [ "$CFG_LIBUDEV" != "no" ]; then
@ -5608,6 +5629,20 @@ if [ "$CFG_DIRECTFB" != "no" ]; then
fi
fi
if [ "$CFG_GBM" != "no" ]; then
if compileTest qpa/gbm "GBM"; then
CFG_GBM=yes
elif [ "$CFG_GBM" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then
echo " GBM support cannot be enabled due to functionality tests!"
echo " Turn on verbose messaging (-v) to $0 to see the final report."
echo " If you believe this message is in error you may use the continue"
echo " switch (-continue) to $0 to continue."
exit 101
else
CFG_GBM=no
fi
fi
if [ "$CFG_LINUXFB" != "no" ]; then
if compileTest qpa/linuxfb "LinuxFB"; then
CFG_LINUXFB=yes
@ -5746,7 +5781,13 @@ if [ "$CFG_EGLFS" != "no" ]; then
else
CFG_EGLFS_BRCM=no
fi
if compileTest qpa/eglfs-mali "eglfs-mali"; then
if compileTest qpa/eglfs-egldevice "eglfs-egldevice"; then
CFG_EGLFS_EGLDEVICE=yes
else
CFG_EGLFS_EGLDEVICE=no
fi
if compileTest qpa/eglfs-mali "eglfs-mali" \
|| compileTest qpa/eglfs-mali-2 "eglfs-mali-2"; then
CFG_EGLFS_MALI=yes
else
CFG_EGLFS_MALI=no
@ -5761,14 +5802,6 @@ if [ "$CFG_EGLFS" != "no" ]; then
fi
fi
if [ "$CFG_KMS" = "yes" ]; then
if [ "$CFG_EGL" = "yes" ]; then
CFG_KMS="yes"
else
CFG_KMS="no"
fi
fi
# Detect accessibility support
if [ "$CFG_ACCESSIBILITY" = "no" ]; then
echo >&2 "Warning: Disabling Accessibility. This version of Qt is unsupported."
@ -5814,6 +5847,9 @@ if [ "$CFG_DIRECTFB" = "yes" ]; then
QMakeVar set QMAKE_CFLAGS_DIRECTFB "$QMAKE_CFLAGS_DIRECTFB"
QMakeVar set QMAKE_LIBS_DIRECTFB "$QMAKE_LIBS_DIRECTFB"
fi
if [ "$CFG_GBM" = "yes" ]; then
QT_CONFIG="$QT_CONFIG gbm"
fi
if [ "$CFG_LINUXFB" = "yes" ]; then
QT_CONFIG="$QT_CONFIG linuxfb"
fi
@ -5825,9 +5861,9 @@ if [ "$CFG_MIRCLIENT" = "yes" ]; then
fi
if [ "$XPLATFORM_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ] && [ "$XPLATFORM_QNX" = "no" ] && [ "$XPLATFORM_ANDROID" = "no" ] && [ "$XPLATFORM_HAIKU" = "no" ]; then
if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ] && [ "$CFG_KMS" = "no" ] && [ "$CFG_MIRCLIENT" = "no" ]; then
if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ] && [ "$CFG_LINUXFB" = "no" ] && [ "$CFG_MIRCLIENT" = "no" ]; then
if [ "$QPA_PLATFORM_GUARD" = "yes" ] &&
( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] || [ "$ORIG_CFG_KMS" = "auto" ] || [ "$ORIG_CFG_MIRCLIENT" = "auto" ] ); then
( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] || [ "$ORIG_CFG_LINUXFB" = "auto" ] || [ "$ORIG_CFG_MIRCLIENT" = "auto" ] ); then
echo "No QPA platform plugin enabled!"
echo " If you really want to build without a QPA platform plugin you must pass"
echo " -no-qpa-platform-guard to configure. Doing this will"
@ -6193,6 +6229,15 @@ fi
if [ "$CFG_EGLFS_BRCM" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_brcm"
fi
if [ "$CFG_EGLFS_EGLDEVICE" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_egldevice"
fi
if [ "$CFG_EGLFS" = "yes" ] && [ "$CFG_KMS" = "yes" ] && [ "$CFG_GBM" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_gbm"
CFG_EGLFS_GBM="yes"
else
CFG_EGLFS_GBM="no"
fi
if [ "$CFG_EGLFS_MALI" = "yes" ]; then
QT_CONFIG="$QT_CONFIG eglfs_mali"
fi
@ -6415,7 +6460,6 @@ if [ '!' -z "$W_FLAGS" ]; then
# add the user defined warning flags
QMakeVar add QMAKE_CFLAGS_WARN_ON "$W_FLAGS"
QMakeVar add QMAKE_CXXFLAGS_WARN_ON "$W_FLAGS"
QMakeVar add QMAKE_OBJECTIVE_CFLAGS_WARN_ON "$W_FLAGS"
fi
if [ "$XPLATFORM_MINGW" = "yes" ]; then
@ -6660,6 +6704,8 @@ s/icpc version \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\) .*$/QT_ICC_MAJOR_VERSION=\1; Q
;;
esac
echo "Done running configuration tests."
#-------------------------------------------------------------------------------
# part of configuration information goes into qconfig.h
#-------------------------------------------------------------------------------
@ -7257,8 +7303,9 @@ report_support " PulseAudio ............." "$CFG_PULSEAUDIO"
report_support " QPA backends:"
report_support " DirectFB ............." "$CFG_DIRECTFB"
report_support " EGLFS ................" "$CFG_EGLFS"
report_support " EGLFS i.MX6....... ." "$CFG_EGLFS_VIV"
report_support " EGLFS KMS .........." "$CFG_KMS"
report_support " EGLFS i.MX6 ........" "$CFG_EGLFS_VIV"
report_support " EGLFS EGLDevice ...." "$CFG_EGLFS_EGLDEVICE"
report_support " EGLFS GBM .........." "$CFG_EGLFS_GBM"
report_support " EGLFS Mali ........." "$CFG_EGLFS_MALI"
report_support " EGLFS Raspberry Pi ." "$CFG_EGLFS_BRCM"
report_support " EGLFS X11 .........." "$CFG_EGL_X"

140
dist/changes-5.5.1 vendored Normal file
View File

@ -0,0 +1,140 @@
Qt 5.5.1 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 5.5.0.
For more details, refer to the online documentation included in this
distribution. The documentation is also available online:
http://doc.qt.io/qt-5.5/
The Qt version 5.5 series is binary compatible with the 5.4.x series.
Applications compiled for 5.4 will continue to run with 5.5.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
http://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* Important Behavior Changes *
****************************************************************************
- [QTBUG-47316] QDebug output for QStrings changed compared to Qt 5.5.0 to
more closely match the output of previous Qt versions. Like Qt 5.5.0,
QDebug will escape non-printable characters, the backslash and quote
characters, but will no longer escape the printable characters.
****************************************************************************
* Future Direction Notice *
****************************************************************************
- Qt 5.7 will begin requiring certain C++11 features in order to
compile. Due to bugs in the Clang compiler that comes with XCode 5.0,
that version will not be supported, despite what was noted in the Qt
5.5.0 changelog.
The minimum compiler versions for Qt 5.7 release will be:
* Clang 3.3 (XCode 5.1 contains version 3.4)
* GCC 4.7
* Intel C++ Composer XE 2013 SP1 (compiler version 14.0) on Linux and OS X
* Intel C++ Composer XE 2016 (compiler version 16.0) on Windows
* Microsoft Visual Studio 2012 (compiler version 17.0)
****************************************************************************
* Library *
****************************************************************************
QtCore
------
- Logging framework:
* Fixed a bug that would cause a
"%{time boot}" field in the logging framework's pattern to always
display the same value, instead of the time since boot.
- QDate/QTime:
* Fixed a minor source-incompatibility between Qt 5.4 and 5.5.0
involving sets of functions overloaded on QTime and some integer or
QDate and some integer.
- QDir:
* QDir::relativeFilePath() now returns "." instead of an empty string if
the given path is the same as the directory.
- QLoggingCategory:
* Fixed behavior of default severity passed to constructor or
Q_LOGGING_CATEGORY with regards to QtInfoMsg, which was previously
treated as being more severe than QtFatalMsg.
- QTimeZone:
* [QTBUG-47037] Fixed a wrong timezone conversion when the POSIX
timezone rule contains a fractional timezone (e.g. VET4:30).
QtNetwork
---------
- [QTBUG-47048] Fix HTTP issues with "Unknown Error" and "Connection
Closed"
[ChangeLog][QtNetwork][Sockets] Read OS/encrypted read buffers when
connection closed by server.
QtSql
-----
- QSqlDatabase:
* [QTBUG-47784][QTBUG-47452] Fixed a bug where opening a connection to a
MySQL database using the QMYSQL plugin would always return true even
if the server was unreachable. This bug could also lead to crashes
depending on the platform used.
QtWidgets
---------
- Important behavior changes:
* [QTBUG-46379] Tooltips on OS X are now transparent for mouse events.
****************************************************************************
* Platform Specific Changes *
****************************************************************************
Windows
-------
- Text:
* [QTBUG-46963] Fixed crash in DirectWrite engine when constructing a
QRawFont from raw font data.
****************************************************************************
* Compiler Specific Changes *
****************************************************************************
GCC
---
- Fixed a regression introduced Qt 5.5.0 that generated lots of
compiler warnings in Qt public headers when using the (deprecated)
version 4.5 of GCC.
****************************************************************************
* Tools *
****************************************************************************
configure & build system
------------------------
- [QTBUG-46125] Fixed misuse of target linker features for host tools.
- [QTBUG-46473] QML plugin DLLs now have version information.
qmake
-----
- [QTBUG-46824][Darwin] Characters in the bundle identifier which
the App Store considers invalid are now substituted.
- [QTBUG-47065][Unix] Fixed use of CONFIG+=separate_debug_info together
with CONFIG+=unversioned_libname.
- [QTBUG-47450][Xcode] Fixed Info.plist creation in shadow builds.
- [QTBUG-47775][Darwin] Fixed Info.plist creation when bundle name
contains spaces.
- [QTBUG-48110][VS] Fixed VS2015 solution file generation.
- [MSVC][nmake] Fixed use of VS2013 mkspecs from VS2015 shell.

View File

@ -41,11 +41,11 @@
\title Qt Licensing Overview
*/
/*!
\externalpage http://doc.qt.digia.com/qq/
\externalpage http://doc.qt.io/archives/qq/
\title Qt Quarterly
*/
/*!
\externalpage http://doc.qt.digia.com/qq/qq19-plurals.html
\externalpage http://doc.qt.io/archives/qq/qq19-plurals.html
\title Qt Quarterly: Plural Form in Translation
*/
/*!
@ -62,11 +62,11 @@
\title Qt Coding Style
*/
/*!
\externalpage http://doc.qt.digia.com/qt-eclipse-1.6/index.html
\externalpage http://doc.qt.io/archives/qt-eclipse-1.6/index.html
\title Eclipse Plugin
*/
/*!
\externalpage http://doc.qt.digia.com/qq/qq11-events.html
\externalpage http://doc.qt.io/archives/qq/qq11-events.html
\title Qt Quarterly: Another Look at Events
*/
/*!

View File

@ -27,24 +27,16 @@
/*!
\externalpage http://doc.qt.io/qtcreator/creator-deployment-qnx.html
\title Qt Creator: Deploying Applications to QNX Devices
\title Qt Creator: Deploying Applications to QNX Neutrino Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-baremetal.html
\title Qt Creator: Connecting Bare Metal Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-bb10.html
\title Qt Creator: Connecting BlackBerry 10 Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-qnx.html
\title Qt Creator: Connecting QNX Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-deployment-bb10.html
\title Qt Creator: Deploying Applications to BlackBerry 10 Devices
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-developing-generic-linux.html
\title Qt Creator: Connecting Embedded Linux Devices
@ -98,7 +90,19 @@
\title Qt Creator: Creating Screens
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-qml-application.html
\externalpage http://doc.qt.io/qtcreator/creator-qtquick-designer-extensions.html
\title Qt Creator: Using Qt Quick Designer Extensions
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qmldesigner-pathview-editor.html
\title Qt Creator: Editing PathView Properties
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qmldesigner-connections.html
\title Qt Creator: Adding Connections
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qtcreator-transitions-example.html
\title Qt Creator: Creating a Qt Quick Application
*/
/*!
@ -279,7 +283,7 @@
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-testing.html
\title Qt Creator: Debugging and Analyzing
\title Qt Creator: Testing
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-deployment.html
@ -297,10 +301,6 @@
\externalpage http://doc.qt.io/qtcreator/creator-design-mode.html
\title Qt Creator: Designing User Interfaces
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-publish-ovi.html
\title Qt Creator: Publishing
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-glossary.html
\title Qt Creator: Glossary
@ -499,7 +499,19 @@
\externalpage http://doc.qt.io/qtcreator/creator-quick-ui-forms.html
\title Qt Creator: Qt Quick UI Forms
*/
/*!
\externalpage http://doc.qt.io/qtcreator/qtcreator-uiforms-example.html
\title Qt Creator: Using Qt Quick UI Forms
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-clang-static-analyzer.html
\title Qt Creator: Using Clang Static Analyzer
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html
\title Qt Creator: Analyzing CPU Usage
*/
/*!
\externalpage http://doc.qt.io/qtcreator/creator-autotest.html
\title Qt Creator: Running Autotests
*/

View File

@ -2,7 +2,7 @@ naturallanguage = en
outputencoding = UTF-8
sourceencoding = UTF-8
examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css"
examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css *.glsl"
examples.imageextensions = "*.png *.jpg *.gif"
headers.fileextensions = "*.ch *.h *.h++ *.hh *.hpp *.hxx"

View File

@ -112,7 +112,7 @@ protected:
QString str = QString::number(n);
if (str.length() == 1)
str.prepend("0");
str.prepend('0');
QFont font;
font.setFamily("Helvetica");

View File

@ -57,8 +57,6 @@ public:
void render() Q_DECL_OVERRIDE;
private:
GLuint loadShader(GLenum type, const char *source);
GLuint m_posAttr;
GLuint m_colAttr;
GLuint m_matrixUniform;
@ -113,14 +111,6 @@ static const char *fragmentShaderSource =
//! [3]
//! [4]
GLuint TriangleWindow::loadShader(GLenum type, const char *source)
{
GLuint shader = glCreateShader(type);
glShaderSource(shader, 1, &source, 0);
glCompileShader(shader);
return shader;
}
void TriangleWindow::initialize()
{
m_program = new QOpenGLShaderProgram(this);

View File

@ -35,37 +35,4 @@
supported by the Qt Network APIs.
\image torrent-example.png
\section1 License Information
The implementation of the US Secure Hash Algorithm 1 (SHA1) in this example is
derived from the original description in \l{http://www.rfc-editor.org/rfc/rfc3174.txt}{RFC 3174}.
\legalese
Copyright (C) The Internet Society (2001). All Rights Reserved.
This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
\endlegalese
*/

View File

@ -219,8 +219,8 @@ bool FileManager::generateFiles()
QString prefix;
if (!destinationPath.isEmpty()) {
prefix = destinationPath;
if (!prefix.endsWith("/"))
prefix += "/";
if (!prefix.endsWith('/'))
prefix += '/';
QDir dir;
if (!dir.mkpath(prefix)) {
errString = tr("Failed to create directory %1").arg(prefix);
@ -261,13 +261,13 @@ bool FileManager::generateFiles()
if (!destinationPath.isEmpty()) {
prefix = destinationPath;
if (!prefix.endsWith("/"))
prefix += "/";
if (!prefix.endsWith('/'))
prefix += '/';
}
if (!metaInfo.name().isEmpty()) {
prefix += metaInfo.name();
if (!prefix.endsWith("/"))
prefix += "/";
if (!prefix.endsWith('/'))
prefix += '/';
}
if (!dir.mkpath(prefix)) {
errString = tr("Failed to create directory %1").arg(prefix);

View File

@ -96,7 +96,7 @@ bool MetaInfo::parse(const QByteArray &data)
QByteArray path;
foreach (QVariant p, pathElements) {
if (!path.isEmpty())
path += "/";
path += '/';
path += p.toByteArray();
}

View File

@ -299,7 +299,7 @@ void Widget::printFormat(const QSurfaceFormat &format)
QString opts;
for (size_t i = 0; i < sizeof(options) / sizeof(Option); ++i)
if (format.testOption(options[i].option))
opts += QString::fromLatin1(options[i].str) + QStringLiteral(" ");
opts += QString::fromLatin1(options[i].str) + QLatin1Char(' ');
m_output->append(tr("Options: %1").arg(opts));
for (size_t i = 0; i < sizeof(renderables) / sizeof(Renderable); ++i)

View File

@ -61,10 +61,10 @@ QStringList findFiles(const QString &startDir, QStringList filters)
QDir dir(startDir);
foreach (QString file, dir.entryList(filters, QDir::Files))
names += startDir + "/" + file;
names += startDir + '/' + file;
foreach (QString subdir, dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot))
names += findFiles(startDir + "/" + subdir, filters);
names += findFiles(startDir + '/' + subdir, filters);
return names;
}
@ -81,7 +81,7 @@ WordCount singleThreadedWordCount(QStringList files)
f.open(QIODevice::ReadOnly);
QTextStream textStream(&f);
while (textStream.atEnd() == false)
foreach(QString word, textStream.readLine().split(" "))
foreach (const QString &word, textStream.readLine().split(' '))
wordCount[word] += 1;
}
@ -100,7 +100,7 @@ WordCount countWords(const QString &file)
WordCount wordCount;
while (textStream.atEnd() == false)
foreach (QString word, textStream.readLine().split(" "))
foreach (const QString &word, textStream.readLine().split(' '))
wordCount[word] += 1;
return wordCount;

View File

@ -153,7 +153,7 @@ void Dialog::addTracks(int albumId, QStringList tracks)
for (int i = 0; i < tracks.count(); i++) {
QString trackNumber = QString::number(i);
if (i < 10)
trackNumber.prepend("0");
trackNumber.prepend('0');
QDomText textNode = albumDetails.createTextNode(tracks.at(i));

View File

@ -53,7 +53,7 @@ QVariant CustomSqlModel::data(const QModelIndex &index, int role) const
QVariant value = QSqlQueryModel::data(index, role);
if (value.isValid() && role == Qt::DisplayRole) {
if (index.column() == 0)
return value.toString().prepend("#");
return value.toString().prepend('#');
else if (index.column() == 2)
return value.toString().toUpper();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,183 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\example desktop/systray
\title System Tray Icon Example
The System Tray Icon example shows how to add an icon with a menu
and popup messages to a desktop environment's system tray.
\image systemtray-example.png Screenshot of the System Tray Icon.
Modern operating systems usually provide a special area on the
desktop, called the system tray or notification area, where
long-running applications can display icons and short messages.
This example consists of one single class, \c Window, providing
the main application window (i.e., an editor for the system tray
icon) and the associated icon.
\image systemtray-editor.png
The editor allows the user to choose the preferred icon as well as
set the balloon message's type and duration. The user can also
edit the message's title and body. Finally, the editor provide a
checkbox controlling whether the icon is actually shown in the
system tray, or not.
\section1 Window Class Definition
The \c Window class inherits QWidget:
\snippet desktop/systray/window.h 0
We implement several private slots to respond to user
interaction. The other private functions are only convenience
functions provided to simplify the constructor.
The tray icon is an instance of the QSystemTrayIcon class. To
check whether a system tray is present on the user's desktop, call
the static QSystemTrayIcon::isSystemTrayAvailable()
function. Associated with the icon, we provide a menu containing
the typical \gui minimize, \gui maximize, \gui restore and \gui
quit actions. We reimplement the QWidget::setVisible() function to
update the tray icon's menu whenever the editor's appearance
changes, e.g., when maximizing or minimizing the main application
window.
Finally, we reimplement QWidget's \l {QWidget::}{closeEvent()}
function to be able to inform the user (when closing the editor
window) that the program will keep running in the system tray
until the user chooses the \gui Quit entry in the icon's context
menu.
\section1 Window Class Implementation
When constructing the editor widget, we first create the various
editor elements before we create the actual system tray icon:
\snippet desktop/systray/window.cpp 0
We ensure that the application responds to user input by
connecting most of the editor's input widgets (including the
system tray icon) to the application's private slots. But note the
visibility checkbox; its \l {QCheckBox::}{toggled()} signal is
connected to the \e {icon}'s \l {QSystemTrayIcon::}{setVisible()}
function instead.
\snippet desktop/systray/window.cpp 3
The \c setIcon() slot is triggered whenever the current index in
the icon combobox changes, i.e., whenever the user chooses another
icon in the editor. Note that it is also called when the user
activates the tray icon with the left mouse button, triggering the
icon's \l {QSystemTrayIcon::}{activated()} signal. We will come
back to this signal shortly.
The QSystemTrayIcon::setIcon() function sets the \l
{QSystemTrayIcon::}{icon} property that holds the actual system
tray icon. On Windows, the system tray icon size is 16x16; on X11,
the preferred size is 22x22. The icon will be scaled to the
appropriate size as necessary.
Note that on X11, due to a limitation in the system tray
specification, mouse clicks on transparent areas in the icon are
propagated to the system tray. If this behavior is unacceptable,
we suggest using an icon with no transparency.
\snippet desktop/systray/window.cpp 4
Whenever the user activates the system tray icon, it emits its \l
{QSystemTrayIcon::}{activated()} signal passing the triggering
reason as parameter. QSystemTrayIcon provides the \l
{QSystemTrayIcon::}{ActivationReason} enum to describe how the
icon was activated.
In the constructor, we connected our icon's \l
{QSystemTrayIcon::}{activated()} signal to our custom \c
iconActivated() slot: If the user has clicked the icon using the
left mouse button, this function changes the icon image by
incrementing the icon combobox's current index, triggering the \c
setIcon() slot as mentioned above. If the user activates the icon
using the middle mouse button, it calls the custom \c
showMessage() slot:
\snippet desktop/systray/window.cpp 5
When the \e showMessage() slot is triggered, we first retrieve the
message icon depending on the currently chosen message type. The
QSystemTrayIcon::MessageIcon enum describes the icon that is shown
when a balloon message is displayed. Then we call
QSystemTrayIcon's \l {QSystemTrayIcon::}{showMessage()} function
to show the message with the title, body, and icon for the time
specified in milliseconds.
OS X users note: The Growl notification system must be
installed for QSystemTrayIcon::showMessage() to display messages.
QSystemTrayIcon also has the corresponding, \l {QSystemTrayIcon::}
{messageClicked()} signal, which is emitted when the user clicks a
message displayed by \l {QSystemTrayIcon::}{showMessage()}.
\snippet desktop/systray/window.cpp 6
In the constructor, we connected the \l
{QSystemTrayIcon::}{messageClicked()} signal to our custom \c
messageClicked() slot that simply displays a message using the
QMessageBox class.
QMessageBox provides a modal dialog with a short message, an icon,
and buttons laid out depending on the current style. It supports
four severity levels: "Question", "Information", "Warning" and
"Critical". The easiest way to pop up a message box in Qt is to
call one of the associated static functions, e.g.,
QMessageBox::information().
As we mentioned earlier, we reimplement a couple of QWidget's
virtual functions:
\snippet desktop/systray/window.cpp 1
Our reimplementation of the QWidget::setVisible() function updates
the tray icon's menu whenever the editor's appearance changes,
e.g., when maximizing or minimizing the main application window,
before calling the base class implementation.
\snippet desktop/systray/window.cpp 2
We have reimplemented the QWidget::closeEvent() event handler to
receive widget close events, showing the above message to the
users when they are closing the editor window.
In addition to the functions and slots discussed above, we have
also implemented several convenience functions to simplify the
constructor: \c createIconGroupBox(), \c createMessageGroupBox(),
\c createActions() and \c createTrayIcon(). See the \l
{desktop/systray/window.cpp}{window.cpp} file for details.
*/

View File

@ -79,31 +79,31 @@ void ClassWizard::accept()
if (field("comment").toBool()) {
block += "/*\n";
block += " " + header.toLatin1() + "\n";
block += " " + header.toLatin1() + '\n';
block += "*/\n";
block += "\n";
block += '\n';
}
if (field("protect").toBool()) {
block += "#ifndef " + macroName + "\n";
block += "#define " + macroName + "\n";
block += "\n";
block += "#ifndef " + macroName + '\n';
block += "#define " + macroName + '\n';
block += '\n';
}
if (field("includeBase").toBool()) {
block += "#include " + baseInclude + "\n";
block += "\n";
block += "#include " + baseInclude + '\n';
block += '\n';
}
block += "class " + className;
if (!baseClass.isEmpty())
block += " : public " + baseClass;
block += "\n";
block += '\n';
block += "{\n";
/* qmake ignore Q_OBJECT */
if (field("qobjectMacro").toBool()) {
block += " Q_OBJECT\n";
block += "\n";
block += '\n';
}
block += "public:\n";
@ -115,7 +115,7 @@ void ClassWizard::accept()
block += " " + className + "();\n";
if (field("copyCtor").toBool()) {
block += " " + className + "(const " + className + " &other);\n";
block += "\n";
block += '\n';
block += " " + className + " &operator=" + "(const " + className
+ " &other);\n";
}
@ -123,11 +123,11 @@ void ClassWizard::accept()
block += "};\n";
if (field("protect").toBool()) {
block += "\n";
block += '\n';
block += "#endif\n";
}
QFile headerFile(outputDir + "/" + header);
QFile headerFile(outputDir + '/' + header);
if (!headerFile.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(0, QObject::tr("Simple Wizard"),
QObject::tr("Cannot write file %1:\n%2")
@ -141,12 +141,12 @@ void ClassWizard::accept()
if (field("comment").toBool()) {
block += "/*\n";
block += " " + implementation.toLatin1() + "\n";
block += " " + implementation.toLatin1() + '\n';
block += "*/\n";
block += "\n";
block += '\n';
}
block += "#include \"" + header.toLatin1() + "\"\n";
block += "\n";
block += '\n';
if (field("qobjectCtor").toBool()) {
block += className + "::" + className + "(QObject *parent)\n";
@ -171,7 +171,7 @@ void ClassWizard::accept()
block += "{\n";
block += " *this = other;\n";
block += "}\n";
block += "\n";
block += '\n';
block += className + " &" + className + "::operator=(const "
+ className + " &other)\n";
block += "{\n";
@ -183,7 +183,7 @@ void ClassWizard::accept()
}
}
QFile implementationFile(outputDir + "/" + implementation);
QFile implementationFile(outputDir + '/' + implementation);
if (!implementationFile.open(QFile::WriteOnly | QFile::Text)) {
QMessageBox::warning(0, QObject::tr("Simple Wizard"),
QObject::tr("Cannot write file %1:\n%2")
@ -356,9 +356,9 @@ void CodeStylePage::initializePage()
if (baseClass.isEmpty()) {
baseIncludeLineEdit->clear();
} else if (QRegExp("Q[A-Z].*").exactMatch(baseClass)) {
baseIncludeLineEdit->setText("<" + baseClass + ">");
baseIncludeLineEdit->setText('<' + baseClass + '>');
} else {
baseIncludeLineEdit->setText("\"" + baseClass.toLower() + ".h\"");
baseIncludeLineEdit->setText('"' + baseClass.toLower() + ".h\"");
}
}
//! [16]

View File

@ -192,6 +192,6 @@
fetched with QTextBlock::userData(). Matching parentheses can be
highlighted with an extra selection. The "Matching Parentheses
with QSyntaxHighlighter" article in Qt Quarterly 31 implements
this. You find it here: \l{http://doc.qt.digia.com/qq/}.
this. You find it here: \l{http://doc.qt.io/archives/qq/}.
*/

View File

@ -248,7 +248,7 @@
It is possible to implement parenthesis matching with
QSyntaxHighlighter. The "Matching Parentheses with
QSyntaxHighlighter" article in Qt Quarterly 31
(\l{http://doc.qt.digia.com/qq/}) implements this. We also have
(\l{http://doc.qt.io/archives/qq/}) implements this. We also have
the \l{Code Editor Example}, which shows how to implement line
numbers and how to highlight the current line.

View File

@ -50,11 +50,10 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
QWidget mainWidget;
QHBoxLayout *horizontalLayout = new QHBoxLayout;
QHBoxLayout *horizontalLayout = new QHBoxLayout(&mainWidget);
horizontalLayout->addWidget(new DragWidget);
horizontalLayout->addWidget(new DragWidget);
mainWidget.setLayout(horizontalLayout);
mainWidget.setWindowTitle(QObject::tr("Draggable Icons"));
mainWidget.show();

View File

@ -1,10 +1,8 @@
QT += widgets
HEADERS = draglabel.h \
dragwidget.h
HEADERS = dragwidget.h
RESOURCES = draggabletext.qrc
SOURCES = draglabel.cpp \
dragwidget.cpp \
SOURCES = dragwidget.cpp \
main.cpp
# install

View File

@ -1,49 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "draglabel.h"
DragLabel::DragLabel(const QString &text, QWidget *parent)
: QLabel(text, parent)
{
setAutoFillBackground(true);
setFrameShape(QFrame::Panel);
setFrameShadow(QFrame::Raised);
}

View File

@ -1,58 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef DRAGLABEL_H
#define DRAGLABEL_H
#include <QLabel>
QT_BEGIN_NAMESPACE
class QDragEnterEvent;
class QDragMoveEvent;
class QFrame;
QT_END_NAMESPACE
class DragLabel : public QLabel
{
public:
DragLabel(const QString &text, QWidget *parent);
};
#endif // DRAGLABEL_H

View File

@ -40,13 +40,23 @@
#include <QtWidgets>
#include "draglabel.h"
#include "dragwidget.h"
static QLabel *createDragLabel(const QString &text, QWidget *parent)
{
QLabel *label = new QLabel(text, parent);
label->setAutoFillBackground(true);
label->setFrameShape(QFrame::Panel);
label->setFrameShadow(QFrame::Raised);
return label;
}
static QString hotSpotMimeDataKey() { return QStringLiteral("application/x-hotspot"); }
DragWidget::DragWidget(QWidget *parent)
: QWidget(parent)
{
QFile dictionaryFile(":/dictionary/words.txt");
QFile dictionaryFile(QStringLiteral(":/dictionary/words.txt"));
dictionaryFile.open(QIODevice::ReadOnly);
QTextStream inputStream(&dictionaryFile);
@ -57,7 +67,7 @@ DragWidget::DragWidget(QWidget *parent)
QString word;
inputStream >> word;
if (!word.isEmpty()) {
DragLabel *wordLabel = new DragLabel(word, this);
QLabel *wordLabel = createDragLabel(word, this);
wordLabel->move(x, y);
wordLabel->show();
wordLabel->setAttribute(Qt::WA_DeleteOnClose);
@ -69,12 +79,6 @@ DragWidget::DragWidget(QWidget *parent)
}
}
/*
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
setPalette(newPalette);
*/
setAcceptDrops(true);
setMinimumSize(400, qMax(200, y));
setWindowTitle(tr("Draggable Text"));
@ -98,19 +102,19 @@ void DragWidget::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasText()) {
const QMimeData *mime = event->mimeData();
QStringList pieces = mime->text().split(QRegExp("\\s+"),
QStringList pieces = mime->text().split(QRegularExpression(QStringLiteral("\\s+")),
QString::SkipEmptyParts);
QPoint position = event->pos();
QPoint hotSpot;
QList<QByteArray> hotSpotPos = mime->data("application/x-hotspot").split(' ');
QByteArrayList hotSpotPos = mime->data(hotSpotMimeDataKey()).split(' ');
if (hotSpotPos.size() == 2) {
hotSpot.setX(hotSpotPos.first().toInt());
hotSpot.setY(hotSpotPos.last().toInt());
}
foreach (QString piece, pieces) {
DragLabel *newLabel = new DragLabel(piece, this);
foreach (const QString &piece, pieces) {
QLabel *newLabel = createDragLabel(piece, this);
newLabel->move(position - hotSpot);
newLabel->show();
newLabel->setAttribute(Qt::WA_DeleteOnClose);
@ -127,18 +131,15 @@ void DragWidget::dropEvent(QDropEvent *event)
} else {
event->ignore();
}
foreach (QObject *child, children()) {
if (child->inherits("QWidget")) {
QWidget *widget = static_cast<QWidget *>(child);
if (!widget->isVisible())
widget->deleteLater();
}
foreach (QWidget *widget, findChildren<QWidget *>()) {
if (!widget->isVisible())
widget->deleteLater();
}
}
void DragWidget::mousePressEvent(QMouseEvent *event)
{
QLabel *child = static_cast<QLabel*>(childAt(event->pos()));
QLabel *child = qobject_cast<QLabel*>(childAt(event->pos()));
if (!child)
return;
@ -146,8 +147,8 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
QMimeData *mimeData = new QMimeData;
mimeData->setText(child->text());
mimeData->setData("application/x-hotspot",
QByteArray::number(hotSpot.x()) + " " + QByteArray::number(hotSpot.y()));
mimeData->setData(hotSpotMimeDataKey(),
QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
QPixmap pixmap(child->size());
child->render(&pixmap);

View File

@ -92,10 +92,8 @@ void DropArea::dropEvent(QDropEvent *event)
} else if (mimeData->hasUrls()) {
QList<QUrl> urlList = mimeData->urls();
QString text;
for (int i = 0; i < urlList.size() && i < 32; ++i) {
QString url = urlList.at(i).path();
text += url + QString("\n");
}
for (int i = 0; i < urlList.size() && i < 32; ++i)
text += urlList.at(i).path() + QLatin1Char('\n');
setText(text);
} else {
setText(tr("Cannot display data"));

View File

@ -55,8 +55,8 @@ DropSiteWindow::DropSiteWindow()
//! [constructor part2]
dropArea = new DropArea;
connect(dropArea, SIGNAL(changed(const QMimeData*)),
this, SLOT(updateFormatsTable(const QMimeData*)));
connect(dropArea, &DropArea::changed,
this, &DropSiteWindow::updateFormatsTable);
//! [constructor part2]
//! [constructor part3]
@ -78,17 +78,16 @@ DropSiteWindow::DropSiteWindow()
buttonBox->addButton(clearButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
connect(quitButton, SIGNAL(pressed()), this, SLOT(close()));
connect(clearButton, SIGNAL(pressed()), dropArea, SLOT(clear()));
connect(quitButton, &QAbstractButton::pressed, this, &QWidget::close);
connect(clearButton, &QAbstractButton::pressed, dropArea, &DropArea::clear);
//! [constructor part4]
//! [constructor part5]
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(abstractLabel);
mainLayout->addWidget(dropArea);
mainLayout->addWidget(formatsTable);
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
setWindowTitle(tr("Drop Site"));
setMinimumSize(350, 500);
@ -112,22 +111,18 @@ void DropSiteWindow::updateFormatsTable(const QMimeData *mimeData)
//! [updateFormatsTable() part3]
QString text;
if (format == "text/plain") {
if (format == QLatin1String("text/plain")) {
text = mimeData->text().simplified();
} else if (format == "text/html") {
} else if (format == QLatin1String("text/html")) {
text = mimeData->html().simplified();
} else if (format == "text/uri-list") {
} else if (format == QLatin1String("text/uri-list")) {
QList<QUrl> urlList = mimeData->urls();
for (int i = 0; i < urlList.size() && i < 32; ++i)
text.append(urlList[i].toString() + " ");
text.append(urlList.at(i).toString() + QLatin1Char(' '));
} else {
QByteArray data = mimeData->data(format);
for (int i = 0; i < data.size() && i < 32; ++i) {
QString hex = QString("%1").arg(uchar(data[i]), 2, 16,
QChar('0'))
.toUpper();
text.append(hex + " ");
}
for (int i = 0; i < data.size() && i < 32; ++i)
text.append(QStringLiteral("%1 ").arg(uchar(data[i]), 2, 16, QLatin1Char('0')).toUpper());
}
//! [updateFormatsTable() part3]

View File

@ -43,11 +43,13 @@
#include <QtWidgets>
static inline QString fridgetMagnetsMimeType() { return QStringLiteral("application/x-fridgemagnet"); }
//! [0]
DragWidget::DragWidget(QWidget *parent)
: QWidget(parent)
{
QFile dictionaryFile(":/dictionary/words.txt");
QFile dictionaryFile(QStringLiteral(":/dictionary/words.txt"));
dictionaryFile.open(QFile::ReadOnly);
QTextStream inputStream(&dictionaryFile);
//! [0]
@ -74,7 +76,6 @@ DragWidget::DragWidget(QWidget *parent)
//! [1]
//! [2]
//Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
setPalette(newPalette);
@ -90,7 +91,7 @@ DragWidget::DragWidget(QWidget *parent)
void DragWidget::dragEnterEvent(QDragEnterEvent *event)
{
//! [4] //! [5]
if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
if (children().contains(event->source())) {
event->setDropAction(Qt::MoveAction);
event->accept();
@ -110,7 +111,7 @@ void DragWidget::dragEnterEvent(QDragEnterEvent *event)
//! [8]
void DragWidget::dragMoveEvent(QDragMoveEvent *event)
{
if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
if (children().contains(event->source())) {
event->setDropAction(Qt::MoveAction);
event->accept();
@ -128,10 +129,10 @@ void DragWidget::dragMoveEvent(QDragMoveEvent *event)
//! [9]
void DragWidget::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasFormat("application/x-fridgemagnet")) {
if (event->mimeData()->hasFormat(fridgetMagnetsMimeType())) {
const QMimeData *mime = event->mimeData();
//! [9] //! [10]
QByteArray itemData = mime->data("application/x-fridgemagnet");
QByteArray itemData = mime->data(fridgetMagnetsMimeType());
QDataStream dataStream(&itemData, QIODevice::ReadOnly);
QString text;
@ -152,11 +153,11 @@ void DragWidget::dropEvent(QDropEvent *event)
}
//! [11] //! [12]
} else if (event->mimeData()->hasText()) {
QStringList pieces = event->mimeData()->text().split(QRegExp("\\s+"),
QStringList pieces = event->mimeData()->text().split(QRegularExpression(QStringLiteral("\\s+")),
QString::SkipEmptyParts);
QPoint position = event->pos();
foreach (QString piece, pieces) {
foreach (const QString &piece, pieces) {
DragLabel *newLabel = new DragLabel(piece, this);
newLabel->move(position);
newLabel->show();
@ -190,7 +191,7 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
//! [15]
QMimeData *mimeData = new QMimeData;
mimeData->setData("application/x-fridgemagnet", itemData);
mimeData->setData(fridgetMagnetsMimeType(), itemData);
mimeData->setText(child->labelText());
//! [15]

View File

@ -52,7 +52,7 @@ int main(int argc, char *argv[])
#endif
DragWidget window;
bool smallScreen = QApplication::arguments().contains("-small-screen");
bool smallScreen = QApplication::arguments().contains(QStringLiteral("-small-screen"));
if (smallScreen)
window.showFullScreen();
else

View File

@ -48,7 +48,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow window;
window.openImage(":/images/example.jpg");
window.loadImage(QStringLiteral(":/images/example.jpg"));
window.show();
return app.exec();
}

View File

@ -55,26 +55,27 @@ MainWindow::MainWindow(QWidget *parent)
setWindowTitle(tr("Puzzle"));
}
void MainWindow::openImage(const QString &path)
void MainWindow::openImage()
{
QString fileName = path;
const QString fileName =
QFileDialog::getOpenFileName(this, tr("Open Image"), QString(),
tr("Image Files (*.png *.jpg *.bmp)"));
if (fileName.isNull()) {
fileName = QFileDialog::getOpenFileName(this,
tr("Open Image"), "", "Image Files (*.png *.jpg *.bmp)");
}
if (!fileName.isEmpty())
loadImage(fileName);
}
if (!fileName.isEmpty()) {
QPixmap newImage;
if (!newImage.load(fileName)) {
QMessageBox::warning(this, tr("Open Image"),
tr("The image file could not be loaded."),
QMessageBox::Cancel);
return;
}
puzzleImage = newImage;
setupPuzzle();
void MainWindow::loadImage(const QString &fileName)
{
QPixmap newImage;
if (!newImage.load(fileName)) {
QMessageBox::warning(this, tr("Open Image"),
tr("The image file could not be loaded."),
QMessageBox::Close);
return;
}
puzzleImage = newImage;
setupPuzzle();
}
void MainWindow::setCompleted()
@ -120,19 +121,15 @@ void MainWindow::setupMenus()
{
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
QAction *openAction = fileMenu->addAction(tr("&Open..."));
QAction *openAction = fileMenu->addAction(tr("&Open..."), this, &MainWindow::openImage);
openAction->setShortcuts(QKeySequence::Open);
QAction *exitAction = fileMenu->addAction(tr("E&xit"));
QAction *exitAction = fileMenu->addAction(tr("E&xit"), qApp, &QCoreApplication::quit);
exitAction->setShortcuts(QKeySequence::Quit);
QMenu *gameMenu = menuBar()->addMenu(tr("&Game"));
QAction *restartAction = gameMenu->addAction(tr("&Restart"));
connect(openAction, SIGNAL(triggered()), this, SLOT(openImage()));
connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(restartAction, SIGNAL(triggered()), this, SLOT(setupPuzzle()));
gameMenu->addAction(tr("&Restart"), this, &MainWindow::setupPuzzle);
}
void MainWindow::setupWidgets()
@ -144,8 +141,8 @@ void MainWindow::setupWidgets()
piecesList = new PiecesList(puzzleWidget->pieceSize(), this);
connect(puzzleWidget, SIGNAL(puzzleCompleted()),
this, SLOT(setCompleted()), Qt::QueuedConnection);
connect(puzzleWidget, &PuzzleWidget::puzzleCompleted,
this, &MainWindow::setCompleted, Qt::QueuedConnection);
frameLayout->addWidget(piecesList);
frameLayout->addWidget(puzzleWidget);

View File

@ -56,9 +56,10 @@ class MainWindow : public QMainWindow
public:
MainWindow(QWidget *parent = 0);
void loadImage(const QString &path);
public slots:
void openImage(const QString &path = QString());
void openImage();
void setupPuzzle();
private slots:

View File

@ -57,7 +57,7 @@ PiecesList::PiecesList(int pieceSize, QWidget *parent)
void PiecesList::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasFormat("image/x-puzzle-piece"))
if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType()))
event->accept();
else
event->ignore();
@ -65,7 +65,7 @@ void PiecesList::dragEnterEvent(QDragEnterEvent *event)
void PiecesList::dragMoveEvent(QDragMoveEvent *event)
{
if (event->mimeData()->hasFormat("image/x-puzzle-piece")) {
if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())) {
event->setDropAction(Qt::MoveAction);
event->accept();
} else {
@ -75,8 +75,8 @@ void PiecesList::dragMoveEvent(QDragMoveEvent *event)
void PiecesList::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasFormat("image/x-puzzle-piece")) {
QByteArray pieceData = event->mimeData()->data("image/x-puzzle-piece");
if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())) {
QByteArray pieceData = event->mimeData()->data(PiecesList::puzzleMimeType());
QDataStream dataStream(&pieceData, QIODevice::ReadOnly);
QPixmap pixmap;
QPoint location;
@ -112,7 +112,7 @@ void PiecesList::startDrag(Qt::DropActions /*supportedActions*/)
dataStream << pixmap << location;
QMimeData *mimeData = new QMimeData;
mimeData->setData("image/x-puzzle-piece", itemData);
mimeData->setData(PiecesList::puzzleMimeType(), itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);

View File

@ -51,6 +51,8 @@ public:
explicit PiecesList(int pieceSize, QWidget *parent = 0);
void addPiece(QPixmap pixmap, QPoint location);
static QString puzzleMimeType() { return QStringLiteral("image/x-puzzle-piece"); }
protected:
void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE;

View File

@ -39,6 +39,7 @@
****************************************************************************/
#include "puzzlewidget.h"
#include "pieceslist.h"
#include <QDrag>
#include <QDragEnterEvent>
@ -65,7 +66,7 @@ void PuzzleWidget::clear()
void PuzzleWidget::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasFormat("image/x-puzzle-piece"))
if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType()))
event->accept();
else
event->ignore();
@ -83,8 +84,8 @@ void PuzzleWidget::dragMoveEvent(QDragMoveEvent *event)
{
QRect updateRect = highlightedRect.united(targetSquare(event->pos()));
if (event->mimeData()->hasFormat("image/x-puzzle-piece")
&& findPiece(targetSquare(event->pos())) == -1) {
if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())
&& pieceRects.indexOf(targetSquare(event->pos())) == -1) {
highlightedRect = targetSquare(event->pos());
event->setDropAction(Qt::MoveAction);
@ -99,10 +100,10 @@ void PuzzleWidget::dragMoveEvent(QDragMoveEvent *event)
void PuzzleWidget::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasFormat("image/x-puzzle-piece")
&& findPiece(targetSquare(event->pos())) == -1) {
if (event->mimeData()->hasFormat(PiecesList::puzzleMimeType())
&& pieceRects.indexOf(targetSquare(event->pos())) == -1) {
QByteArray pieceData = event->mimeData()->data("image/x-puzzle-piece");
QByteArray pieceData = event->mimeData()->data(PiecesList::puzzleMimeType());
QDataStream dataStream(&pieceData, QIODevice::ReadOnly);
QRect square = targetSquare(event->pos());
QPixmap pixmap;
@ -130,19 +131,10 @@ void PuzzleWidget::dropEvent(QDropEvent *event)
}
}
int PuzzleWidget::findPiece(const QRect &pieceRect) const
{
for (int i = 0; i < pieceRects.size(); ++i) {
if (pieceRect == pieceRects[i])
return i;
}
return -1;
}
void PuzzleWidget::mousePressEvent(QMouseEvent *event)
{
QRect square = targetSquare(event->pos());
int found = findPiece(square);
int found = pieceRects.indexOf(square);
if (found == -1)
return;
@ -164,7 +156,7 @@ void PuzzleWidget::mousePressEvent(QMouseEvent *event)
dataStream << pixmap << location;
QMimeData *mimeData = new QMimeData;
mimeData->setData("image/x-puzzle-piece", itemData);
mimeData->setData(PiecesList::puzzleMimeType(), itemData);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);

View File

@ -75,7 +75,6 @@ protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
int findPiece(const QRect &pieceRect) const;
const QRect targetSquare(const QPoint &position) const;
QList<QPixmap> piecePixmaps;

View File

@ -200,7 +200,6 @@ void ImageWidget::openDirectory(const QString &path)
QImage ImageWidget::loadImage(const QString &fileName)
{
qDebug() << position << files << fileName;
QImageReader reader(fileName);
reader.setAutoTransform(true);
qCDebug(lcExample) << "loading" << QDir::toNativeSeparators(fileName) << position << '/' << files.size();
@ -230,7 +229,7 @@ void ImageWidget::goNextImage()
prevImage = currentImage;
currentImage = nextImage;
if (position+1 < files.size())
nextImage = loadImage(path+QLatin1String("/")+files.at(position+1));
nextImage = loadImage(path + QLatin1Char('/') + files.at(position+1));
else
nextImage = QImage();
}
@ -247,7 +246,7 @@ void ImageWidget::goPrevImage()
nextImage = currentImage;
currentImage = prevImage;
if (position > 0)
prevImage = loadImage(path+QLatin1String("/")+files.at(position-1));
prevImage = loadImage(path + QLatin1Char('/') + files.at(position-1));
else
prevImage = QImage();
}
@ -277,12 +276,12 @@ void ImageWidget::goToImage(int index)
position = index;
if (index > 0)
prevImage = loadImage(path+QLatin1String("/")+files.at(position-1));
prevImage = loadImage(path + QLatin1Char('/') + files.at(position-1));
else
prevImage = QImage();
currentImage = loadImage(path+QLatin1String("/")+files.at(position));
currentImage = loadImage(path + QLatin1Char('/') + files.at(position));
if (position+1 < files.size())
nextImage = loadImage(path+QLatin1String("/")+files.at(position+1));
nextImage = loadImage(path + QLatin1Char('/') + files.at(position+1));
else
nextImage = QImage();
update();

View File

@ -77,7 +77,6 @@ private:
void swipeTriggered(QSwipeGesture*);
//! [class definition begin]
void updateImage();
QImage loadImage(const QString &fileName);
void loadImage();
void goNextImage();

View File

@ -57,8 +57,6 @@ public slots:
void openDirectory(const QString &path);
private:
bool loadImage(const QString &fileName);
ImageWidget *imageWidget;
};

View File

@ -319,9 +319,9 @@ RenderOptionsDialog::RenderOptionsDialog()
while (++it != tokens.end()) {
m_parameterNames << name;
if (!singleElement) {
m_parameterNames.back() += "[";
m_parameterNames.back() += '[';
m_parameterNames.back() += counter + counterPos;
m_parameterNames.back() += "]";
m_parameterNames.back() += ']';
int j = 8; // position of last digit
++counter[j];
while (j > 0 && counter[j] > '9') {

View File

@ -124,7 +124,7 @@ void MainWindow::loadFile(const QString &fileName)
if (!line.isEmpty()) {
model->insertRows(row, 1, QModelIndex());
QStringList pieces = line.split(",", QString::SkipEmptyParts);
QStringList pieces = line.split(',', QString::SkipEmptyParts);
model->setData(model->index(row, 0, QModelIndex()),
pieces.value(0));
model->setData(model->index(row, 1, QModelIndex()),

View File

@ -246,7 +246,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
while (number < lines.count()) {
int position = 0;
while (position < lines[number].length()) {
if (lines[number].mid(position, 1) != " ")
if (lines[number].at(position) != ' ')
break;
++position;
}

View File

@ -54,15 +54,15 @@ int main(int argc, char* argv[])
QFile file(":/grades.txt");
if (file.open(QFile::ReadOnly)) {
QString line = file.readLine(200);
QStringList list = line.simplified().split(",");
QStringList list = line.simplified().split(',');
model->setHorizontalHeaderLabels(list);
int row = 0;
QStandardItem *newItem = 0;
while (file.canReadLine()) {
line = file.readLine(200);
if (!line.startsWith("#") && line.contains(",")) {
list= line.simplified().split(",");
if (!line.startsWith('#') && line.contains(',')) {
list = line.simplified().split(',');
for (int col = 0; col < list.length(); ++col){
newItem = new QStandardItem(list.at(col));
model->setItem(row, col, newItem);

View File

@ -88,7 +88,7 @@ QVariant Model::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
if (role == Qt::DisplayRole)
return QVariant("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

@ -88,7 +88,7 @@ QVariant DomModel::data(const QModelIndex &index, int role) const
for (int i = 0; i < attributeMap.count(); ++i) {
QDomNode attribute = attributeMap.item(i);
attributes << attribute.nodeName() + "=\""
+attribute.nodeValue() + "\"";
+attribute.nodeValue() + '"';
}
return attributes.join(' ');
case 2:

View File

@ -180,7 +180,7 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
while (number < lines.count()) {
int position = 0;
while (position < lines[number].length()) {
if (lines[number].mid(position, 1) != " ")
if (lines[number].at(position) != ' ')
break;
position++;
}

View File

@ -153,8 +153,8 @@ void RegExpDialog::refresh()
QString escaped = pattern;
escaped.replace("\\", "\\\\");
escaped.replace("\"", "\\\"");
escaped.prepend("\"");
escaped.append("\"");
escaped.prepend('"');
escaped.append('"');
escapedPatternLineEdit->setText(escaped);
QRegExp rx(pattern);

View File

@ -111,8 +111,8 @@ void RegularExpressionDialog::refresh()
QString escaped = pattern;
escaped.replace(QLatin1String("\\"), QLatin1String("\\\\"));
escaped.replace(QLatin1String("\""), QLatin1String("\\\""));
escaped.prepend(QLatin1String("\""));
escaped.append(QLatin1String("\""));
escaped.prepend(QLatin1Char('"'));
escaped.append(QLatin1Char('"'));
escapedPatternLineEdit->setText(escaped);
QRegularExpression rx(pattern);

View File

@ -60,7 +60,7 @@ VariantDelegate::VariantDelegate(QObject *parent)
dateExp.setPattern("([0-9]{,4})-([0-9]{,2})-([0-9]{,2})");
timeExp.setPattern("([0-9]{,2}):([0-9]{,2}):([0-9]{,2})");
dateTimeExp.setPattern(dateExp.pattern() + "T" + timeExp.pattern());
dateTimeExp.setPattern(dateExp.pattern() + 'T' + timeExp.pattern());
}
void VariantDelegate::paint(QPainter *painter,
@ -217,7 +217,7 @@ void VariantDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,
value = QSize(sizeExp.cap(1).toInt(), sizeExp.cap(2).toInt());
break;
case QVariant::StringList:
value = text.split(",");
value = text.split(',');
break;
case QVariant::Time:
{

View File

@ -421,23 +421,23 @@ void AddressBook::exportAsVCard()
//! [export function part2]
//! [export function part3]
out << "BEGIN:VCARD" << "\n";
out << "VERSION:2.1" << "\n";
out << "N:" << lastName << ";" << firstName << "\n";
out << "BEGIN:VCARD" << '\n';
out << "VERSION:2.1" << '\n';
out << "N:" << lastName << ';' << firstName << '\n';
if (!nameList.isEmpty())
out << "FN:" << nameList.join(' ') << "\n";
out << "FN:" << nameList.join(' ') << '\n';
else
out << "FN:" << firstName << "\n";
out << "FN:" << firstName << '\n';
//! [export function part3]
//! [export function part4]
address.replace(";", "\\;", Qt::CaseInsensitive);
address.replace("\n", ";", Qt::CaseInsensitive);
address.replace('\n', ";", Qt::CaseInsensitive);
address.replace(",", " ", Qt::CaseInsensitive);
out << "ADR;HOME:;" << address << "\n";
out << "END:VCARD" << "\n";
out << "ADR;HOME:;" << address << '\n';
out << "END:VCARD" << '\n';
QMessageBox::information(this, tr("Export Successful"),
tr("\"%1\" has been exported as a vCard.").arg(name));

View File

@ -83,7 +83,7 @@ bool MyModel::setData(const QModelIndex & index, const QVariant & value, int rol
{
for(int col= 0; col < COLS; col++)
{
result += m_gridData[row][col] + " ";
result += m_gridData[row][col] + ' ';
}
}
emit editCompleted( result );

View File

@ -276,7 +276,7 @@ void Calculator::pointClicked()
{
if (waitingForOperand)
display->setText("0");
if (!display->text().contains("."))
if (!display->text().contains('.'))
display->setText(display->text() + tr("."));
waitingForOperand = false;
}

View File

@ -67,7 +67,7 @@ void MainWindow::on_aboutAction_triggered()
{
QMessageBox::about(this, tr("About Style sheet"),
tr("The <b>Style Sheet</b> example shows how widgets can be styled "
"using <a href=\"http://doc.qt.digia.com/4.5/stylesheet.html\">Qt "
"using <a href=\"http://doc.qt.io/qt-5/stylesheet.html\">Qt "
"Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop up the "
"style editor, and either choose an existing style sheet or design "
"your own."));

View File

@ -79,7 +79,7 @@ void parseHtmlFile(QTextStream &out, const QString &fileName) {
}
//! [2]
out << " Title: \"" << title << "\"" << endl
out << " Title: \"" << title << '"' << endl
<< " Number of paragraphs: " << paragraphCount << endl
<< " Number of links: " << links.size() << endl
<< " Showing first few links:" << endl;

View File

@ -81,8 +81,8 @@ QString XbelGenerator::escapedAttribute(const QString &str)
{
QString result = escapedText(str);
result.replace("\"", "&quot;");
result.prepend("\"");
result.append("\"");
result.prepend(QLatin1Char('"'));
result.append(QLatin1Char('"'));
return result;
}

View File

@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = aix
include(../common/unix.conf)
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@ -67,5 +69,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB = ranlib -X64
include(../common/unix.conf)
load(qt_config)

View File

@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = aix
include(../common/unix.conf)
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
@ -67,5 +69,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
include(../common/unix.conf)
load(qt_config)

View File

@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = aix
include(../common/unix.conf)
QMAKE_COMPILER = ibm_xlc
QMAKE_CC = xlc
@ -66,5 +68,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB = ranlib -X64
include(../common/unix.conf)
load(qt_config)

View File

@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = aix
include(../common/unix.conf)
QMAKE_COMPILER = ibm_xlc
QMAKE_CC = xlc
@ -69,5 +71,4 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB = ranlib
include(../common/unix.conf)
load(qt_config)

View File

@ -1,44 +0,0 @@
#
# qmake configuration for armcc
#
QMAKE_COMPILER = armcc
CONFIG += rvct_linker
QMAKE_CC = armcc
QMAKE_CFLAGS +=
QMAKE_CFLAGS_DEPS += -M
QMAKE_CFLAGS_WARN_ON +=
QMAKE_CFLAGS_WARN_OFF += -W
QMAKE_CFLAGS_RELEASE += -O2
QMAKE_CFLAGS_DEBUG += -g -O0
QMAKE_CFLAGS_HIDESYMS += --visibility_inlines_hidden
QMAKE_CXX = armcc
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS --exceptions --exceptions_unwind
QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS
QMAKE_LINK = armlink
QMAKE_LINK_SHLIB = armlink
QMAKE_LINK_C = armlink
QMAKE_LINK_C_SHLIB = armlink
QMAKE_LFLAGS +=
QMAKE_LFLAGS_RELEASE +=
QMAKE_LFLAGS_DEBUG +=
QMAKE_LFLAGS_APP +=
QMAKE_LFLAGS_SHLIB +=
QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_THREAD +=
QMAKE_AR = armar --create
QMAKE_LIB = armar --create
QMAKE_RANLIB =

View File

@ -7,5 +7,4 @@ QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_OBJECTIVE_CFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++

View File

@ -12,14 +12,6 @@ include(gcc-base.conf)
QMAKE_COMPILER_DEFINES += __APPLE__ __GNUC__=4 __APPLE_CC__
QMAKE_OBJECTIVE_CFLAGS = $$QMAKE_CFLAGS
QMAKE_OBJECTIVE_CFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_OBJECTIVE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS
QMAKE_LFLAGS += -headerpad_max_install_names
QMAKE_LFLAGS_SHLIB += -single_module -dynamiclib

View File

@ -22,7 +22,7 @@ QMAKE_IOS_OBJ_CFLAGS += -Wno-deprecated-implementations -Wprotocol -Wno-select
# Set build flags
QMAKE_CFLAGS += $$QMAKE_IOS_CFLAGS
QMAKE_CXXFLAGS += $$QMAKE_IOS_CFLAGS $$QMAKE_IOS_CXXFLAGS
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_IOS_CFLAGS $$QMAKE_IOS_CXXFLAGS $$QMAKE_IOS_OBJ_CFLAGS
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_IOS_OBJ_CFLAGS
QMAKE_IOS_CFLAGS =
QMAKE_IOS_CXXFLAGS =

View File

@ -4,6 +4,8 @@
QMAKE_PLATFORM += linux
include(unix.conf)
QMAKE_CFLAGS_THREAD += -D_REENTRANT
QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
@ -51,5 +53,3 @@ QMAKE_RANLIB =
QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
include(unix.conf)

View File

@ -6,6 +6,8 @@
QMAKE_PLATFORM += mac darwin
include(unix.conf)
QMAKE_RESOURCE = /Developer/Tools/Rez
QMAKE_EXTENSION_SHLIB = dylib
QMAKE_LIBDIR =
@ -27,5 +29,3 @@ QMAKE_LIBS_THREAD =
QMAKE_AR = ar cq
QMAKE_RANLIB = ranlib -s
QMAKE_NM = nm -P
include(unix.conf)

View File

@ -74,6 +74,9 @@ QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
QMAKE_LFLAGS_EXE = \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\"
QMAKE_LFLAGS_DLL = /DLL
QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_PREFIX_SHLIB =
QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib

View File

@ -4,9 +4,10 @@
MAKEFILE_GENERATOR = UNIX
include(g++-unix.conf)
include(unix.conf)
include(g++-unix.conf)
QMAKE_CC = qcc -Vgcc_ntoarmv7le
QMAKE_CXX = qcc -Vgcc_ntoarmv7le
QNX_CPUDIR = armle-v7

View File

@ -4,9 +4,10 @@
MAKEFILE_GENERATOR = UNIX
include(g++-unix.conf)
include(unix.conf)
include(g++-unix.conf)
QMAKE_CC = qcc -Vgcc_ntox86
QMAKE_CXX = qcc -Vgcc_ntox86
QNX_CPUDIR = x86

View File

@ -4,7 +4,7 @@
include(qcc-base.conf)
QMAKE_PLATFORM += qnx
QMAKE_PLATFORM = qnx $$QMAKE_PLATFORM
#Choose qnx QPA Plugin as default
QT_QPA_DEFAULT_PLATFORM = qnx

View File

@ -12,5 +12,6 @@ QMAKE_YACCFLAGS_MANGLE += -p $base -b $base
QMAKE_YACC_HEADER = $base.tab.h
QMAKE_YACC_SOURCE = $base.tab.c
QMAKE_PREFIX_SHLIB = lib
QMAKE_EXTENSION_SHLIB = so
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a

View File

@ -62,6 +62,9 @@ QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_LIBS_NETWORK = ws2.lib
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_COMPAT =
QMAKE_PREFIX_SHLIB =
QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS_EGL = libEGL.lib

View File

@ -70,6 +70,9 @@ QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
QMAKE_LFLAGS_EXE = /MANIFEST:NO
QMAKE_LFLAGS_DLL = /MANIFEST:NO /DLL
QMAKE_LFLAGS_LTCG = /LTCG
QMAKE_PREFIX_SHLIB =
QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS += runtimeobject.lib

View File

@ -6,7 +6,7 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = cygwin unix posix
CONFIG += incremental
CONFIG += incremental unversioned_libname
QMAKE_INCREMENTAL_STYLE = sublib
QMAKE_COMPILER = gcc
@ -56,8 +56,6 @@ QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME = -Wl,-soname,
QMAKE_LFLAGS_THREAD =
QMAKE_LFLAGS_RPATH = -Wl,-rpath,
QMAKE_CYGWIN_SHLIB = 1
QMAKE_CYGWIN_EXE = 1
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
@ -65,6 +63,7 @@ QMAKE_LIBS_X11 = -lXext -lX11
QMAKE_LIBS_OPENGL = -lGL
QMAKE_LIBS_THREAD = -lpthread
QMAKE_PREFIX_SHLIB = lib
QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a

View File

@ -9,6 +9,8 @@ QMAKE_PLATFORM = osx macx mac darwin
CONFIG += native_precompiled_headers
DEFINES += __USE_WS_X11__
include(../common/unix.conf)
QMAKE_COMPILER = gcc
QMAKE_CC = cc
@ -84,5 +86,4 @@ QMAKE_PCH_OUTPUT_EXT = .gch
QMAKE_CXXFLAGS_PRECOMPILE += -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
include(../common/unix.conf)
load(qt_config)

View File

@ -0,0 +1,38 @@
#
# qmake configuration for the Jetson TK1 Pro boards
#
# A typical configure line might look like:
# configure \
# -device jetson-tk1-pro \
# -device-option VIBRANTE_SDK_TOPDIR=/opt/nvidia/vibrante-vcm30t124-linux
# -device-option CROSS_COMPILE=/opt/nvidia/toolchains/tegra-4.8.1-nv/usr/bin/arm-cortex_a15-linux-gnueabi/arm-cortex_a15-linux-gnueabi- \
# -sysroot /opt/nvidia/vibrante-vcm30t124-linux/targetfs \
# -no-gcc-sysroot
include(../common/linux_device_pre.conf)
isEmpty(VIBRANTE_SDK_TOPDIR):error("You must pass -device-option VIBRANTE_SDK_TOPDIR=/path/to/sdk")
QMAKE_INCDIR += \
$${VIBRANTE_SDK_TOPDIR}/include \
$$[QT_SYSROOT]/usr/include
QMAKE_LIBDIR += \
$${VIBRANTE_SDK_TOPDIR}/lib-target \
$$[QT_SYSROOT]/usr/lib \
$$[QT_SYSROOT]/lib/arm-linux-gnueabihf \
$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf
QMAKE_LFLAGS += \
-Wl,-rpath-link,$${VIBRANTE_SDK_TOPDIR}/lib-target \
-Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib \
-Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib/arm-linux-gnueabihf \
-Wl,-rpath-link,$$[QT_SYSROOT]/lib/arm-linux-gnueabihf
DISTRO_OPTS += hard-float
COMPILER_FLAGS += -mtune=cortex-a15 -march=armv7-a -mfpu=neon-vfpv4 -DWIN_INTERFACE_CUSTOM
EGLFS_DEVICE_INTEGRATION = eglfs_kms_egldevice
include(../common/linux_arm_device_post.conf)
load(qt_config)

View File

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

View File

@ -35,7 +35,6 @@ force_debug_info|debug: \
force_debug_info {
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
}
@ -51,13 +50,11 @@ optimize_full {
debug {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_DEBUG
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_DEBUG
QMAKE_LFLAGS += $$QMAKE_LFLAGS_DEBUG
QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_DEBUG
} else {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_RELEASE
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_RELEASE
QMAKE_LFLAGS += $$QMAKE_LFLAGS_RELEASE
QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_RELEASE
}
@ -107,7 +104,6 @@ c++11|c++14|c++1z {
!strict_c++:!isEmpty(QMAKE_CXXFLAGS_GNU$$cxxstd): cxxstd = GNU$$cxxstd
QMAKE_CXXFLAGS += $$eval(QMAKE_CXXFLAGS_$$cxxstd)
QMAKE_OBJECTIVE_CFLAGS += $$eval(QMAKE_CXXFLAGS_$$cxxstd)
QMAKE_LFLAGS += $$eval(QMAKE_LFLAGS_$$cxxstd)
unset(cxxstd)

View File

@ -25,7 +25,6 @@
QMAKE_CFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_OBJECTIVE_CFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_CLEAN += $(OBJECTS_DIR)*.gcno and $(OBJECTS_DIR)*.gcda

View File

@ -1,23 +1,10 @@
for(source, SOURCES) {
contains(source,.*\\.mm?$) {
warning(Objective-C source \'$$source\' found in SOURCES but should be in OBJECTIVE_SOURCES)
SOURCES -= $$source
OBJECTIVE_SOURCES += $$source
}
}
# Objective-C/C++ sources go in SOURCES, like all other sources
SOURCES += $$OBJECTIVE_SOURCES
isEmpty(QMAKE_OBJECTIVE_CC):QMAKE_OBJECTIVE_CC = $$QMAKE_CC
# Strip C/C++ flags from QMAKE_OBJECTIVE_CFLAGS just in case
QMAKE_OBJECTIVE_CFLAGS -= $$QMAKE_CFLAGS $$QMAKE_CXXFLAGS
OBJECTIVE_C_OBJECTS_DIR = $$OBJECTS_DIR
isEmpty(OBJECTIVE_C_OBJECTS_DIR):OBJECTIVE_C_OBJECTS_DIR = .
isEmpty(QMAKE_EXT_OBJECTIVE_C):QMAKE_EXT_OBJECTIVE_C = .mm .m
objective_c.dependency_type = TYPE_C
objective_c.variables = QMAKE_OBJECTIVE_CFLAGS
objective_c.commands = $$QMAKE_OBJECTIVE_CC -c $(QMAKE_COMP_QMAKE_OBJECTIVE_CFLAGS) $(DEFINES) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
objective_c.output = $$OBJECTIVE_C_OBJECTS_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
objective_c.input = OBJECTIVE_SOURCES
objective_c.name = Compile ${QMAKE_FILE_IN}
silent:objective_c.commands = @echo objective-c ${QMAKE_FILE_IN} && $$objective_c.commands
QMAKE_EXTRA_COMPILERS += objective_c
# Add Objective-C/C++ flags to C/C++ flags, the compiler can handle it
QMAKE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS
QMAKE_CXXFLAGS += $$QMAKE_OBJECTIVE_CFLAGS

View File

@ -32,7 +32,6 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.version) {
!equals(MAKEFILE_GENERATOR, XCODE) {
QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
QMAKE_OBJECTIVE_CFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK_PATH
}
@ -80,6 +79,5 @@ isEmpty(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.platform_name) {
version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
QMAKE_CFLAGS += $$version_min_flag
QMAKE_CXXFLAGS += $$version_min_flag
QMAKE_OBJECTIVE_CFLAGS += $$version_min_flag
QMAKE_LFLAGS += $$version_min_flag
}

View File

@ -16,7 +16,7 @@ MOC_INCLUDEPATH = $$QMAKESPEC $$_PRO_FILE_PWD_ $$MOC_INCLUDEPATH $$QMAKE_DEFAULT
# has too many includes. We do this to overcome a command-line limit on Win < XP
WIN_INCLUDETEMP=
win32:count(MOC_INCLUDEPATH, 40, >) {
WIN_INCLUDETEMP = $$MOC_DIR/mocinclude.tmp
WIN_INCLUDETEMP = $$MOC_DIR/mocinclude.opt
WIN_INCLUDETEMP_CONT =
for (inc, MOC_INCLUDEPATH): \

View File

@ -119,12 +119,6 @@ for(ever) {
!mac|!contains(MODULE_CONFIG, lib_bundle): \
MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION,
win32 {
# Make sure the version number isn't appended again to the lib name
QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}_VERSION_OVERRIDE = 0
QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}D_VERSION_OVERRIDE = 0
}
isEmpty(LINKAGE) {
!isEmpty(MODULE_LIBS_ADD): \
LINKAGE = -L$$MODULE_LIBS_ADD
@ -161,7 +155,8 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
!no_qt_rpath:!static:contains(QT_CONFIG, rpath):!contains(QT_CONFIG, static):\
contains(qt_module_deps, core) {
relative_qt_rpath:defined(target.path, var) {
relative_qt_rpath:contains(INSTALLS, target):\
isEmpty(target.files):isEmpty(target.commands):isEmpty(target.extra) {
mac {
if(equals(TEMPLATE, app):app_bundle)|\
if(equals(TEMPLATE, lib):plugin:plugin_bundle) {
@ -172,11 +167,17 @@ qt_module_deps = $$resolve_depends(qt_module_deps, "QT.")
} else {
binpath = $$target.path
}
QMAKE_RPATHDIR += @loader_path/$$relative_path($$[QT_INSTALL_LIBS], $$binpath)
rpath = @loader_path
} else {
QMAKE_LFLAGS += -Wl,-z,origin
QMAKE_RPATHDIR += $ORIGIN/$$relative_path($$[QT_INSTALL_LIBS], $$target.path)
binpath = $$target.path
rpath = $ORIGIN
}
# NOT the /dev property, as INSTALLS use host paths
relpath = $$relative_path($$[QT_INSTALL_LIBS], $$binpath)
!equals(relpath, .): \
rpath = $$rpath/$$relpath
QMAKE_RPATHDIR += $$rpath
} else {
QMAKE_RPATHDIR += $$[QT_INSTALL_LIBS/dev]
}

View File

@ -54,13 +54,13 @@ win32 {
} else {
equals(TEMPLATE, lib) {
static {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.a
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_STATICLIB}
} else: plugin|unversioned_libname {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.so
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_SHLIB}
} else {
TEMP_VERSION = $$VERSION
isEmpty(TEMP_VERSION):TEMP_VERSION = 1.0.0
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.so.$${TEMP_VERSION}
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${LIBPREFIX}$${TARGET}.$${QMAKE_EXTENSION_SHLIB}.$${TEMP_VERSION}
}
} else {
QMAKE_RESOLVED_TARGET = $${QMAKE_RESOLVED_TARGET}$${TARGET}

View File

@ -7,6 +7,8 @@ QMAKE_DIRLIST_SEP = $$DIRLIST_SEPARATOR
QMAKE_EXT_C = .c
QMAKE_EXT_CPP = .cpp .cc .cxx
QMAKE_EXT_OBJC = .m
QMAKE_EXT_OBJCXX = .mm
QMAKE_EXT_CPP_MOC = .moc
QMAKE_EXT_H = .h .hpp .hh .hxx
QMAKE_EXT_H_MOC = .cpp

View File

@ -1,4 +1,3 @@
QMAKE_CFLAGS += $$QMAKE_CFLAGS_HIDESYMS
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_HIDESYMS
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_HIDESYMS
QMAKE_LFLAGS += $$QMAKE_LFLAGS_HIDESYMS

View File

@ -1,4 +1,3 @@
CONFIG -= warn_on
QMAKE_CFLAGS += $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_WARN_OFF
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_WARN_OFF

View File

@ -1,5 +1,4 @@
CONFIG -= warn_off
QMAKE_CFLAGS += $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_WARN_ON
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_WARN_ON

View File

@ -1,62 +0,0 @@
# Provide default fonts for windows phone
# The DEFAULTFONTS variable indicates, whether the default set of fonts is
# used for deployment. The check below won't work after the fonts are added
# so this helper variable is added and used for the user warning check later.
!defined(FONTS, var):winphone {
FONTS = \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-Bold.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-BoldOblique.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-Bold.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-BoldOblique.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSansMono-Oblique.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSans-Oblique.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-Bold.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-BoldOblique.ttf \
$$[QT_HOST_PREFIX/src]/lib/fonts/DejaVuSerif-Oblique.ttf
DEFAULTFONTS =
}
if(build_pass:equals(TEMPLATE, "app"))| \
if(!build_pass:equals(TEMPLATE, "vcapp")) {
defined(DEFAULTFONTS, var) {
message(Default fonts will automatically be deployed with your application. \
To avoid automatic deployment unset the \"FONTS\" variable (\"FONTS =\") in your .pro file. \
You can also customize which fonts are deployed by setting the \"FONTS\" variable.)
}
contains(TEMPLATE, "vc.*") {
BUILD_DIR = $$OUT_PWD
} else {
load(resolve_target)
BUILD_DIR = $$dirname(QMAKE_RESOLVED_TARGET)
}
for (FONT, FONTS) {
font_$${FONT}.input = $$FONT
font_$${FONT}.output = $$BUILD_DIR/fonts/$$basename(FONT)
font_$${FONT}.CONFIG = verbatim
QMAKE_SUBSTITUTES += font_$${FONT}
}
!isEmpty(FONTS):equals(TEMPLATE, "app") {
fonts.files = $$BUILD_DIR/fonts/*
isEmpty(target.path) {
fonts.path = $$OUT_PWD/fonts
} else {
fonts.path = $$target.path/fonts
}
INSTALLS += fonts
}
}
!isEmpty(FONTS):winphone:equals(TEMPLATE, "vcapp"):build_pass {
for (FONT, FONTS) {
fonts.files += $$OUT_PWD/fonts/$$basename(FONT)
}
fonts.path = fonts
DEPLOYMENT += fonts
}

View File

@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = freebsd bsd
include(../common/unix.conf)
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
@ -27,7 +29,6 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
include(../common/unix.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
load(qt_config)

View File

@ -5,6 +5,8 @@
MAKEFILE_GENERATOR = UNIX
QMAKE_PLATFORM = freebsd bsd
include(../common/unix.conf)
QMAKE_CFLAGS_THREAD = -pthread -D_THREAD_SAFE
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
@ -27,7 +29,6 @@ QMAKE_OBJCOPY = objcopy
QMAKE_NM = nm -P
QMAKE_RANLIB =
include(../common/unix.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

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