Source

Target

Commits (113)
Showing with 262 additions and 324 deletions
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
:: Contact: http://www.qt-project.org/legal
::
:: This file is part of the tools applications of the Qt Toolkit.
::
:: $QT_BEGIN_LICENSE:LGPL$
:: Commercial License Usage
:: Licensees holding valid commercial Qt licenses may use this file in
:: accordance with the commercial license agreement provided with the
:: Software or, alternatively, in accordance with the terms contained in
:: a written agreement between you and Digia. For licensing terms and
:: conditions see http://qt.digia.com/licensing. For further information
:: use the contact form at http://qt.digia.com/contact-us.
::
:: GNU Lesser General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU Lesser
:: General Public License version 2.1 as published by the Free Software
:: Foundation and appearing in the file LICENSE.LGPL included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU Lesser General Public License version 2.1 requirements
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
::
:: In addition, as a special exception, Digia gives you certain additional
:: rights. These rights are described in the Digia Qt LGPL Exception
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
::
:: GNU General Public License Usage
:: Alternatively, this file may be used under the terms of the GNU
:: General Public License version 3.0 as published by the Free Software
:: Foundation and appearing in the file LICENSE.GPL included in the
:: packaging of this file. Please review the following information to
:: ensure the GNU General Public License version 3.0 requirements will be
:: met: http://www.gnu.org/copyleft/gpl.html.
::
::
:: $QT_END_LICENSE$
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
rem ***** This assumes PERL is in the PATH *****
set scriptpath=%~dp0
perl.exe %scriptpath%syncqt %*
File moved
...@@ -446,6 +446,8 @@ if [ "$OSTYPE" = "msys" ]; then ...@@ -446,6 +446,8 @@ if [ "$OSTYPE" = "msys" ]; then
BUILD_ON_MSYS=yes BUILD_ON_MSYS=yes
DEV_NULL=/tmp/empty-file DEV_NULL=/tmp/empty-file
echo "" > $DEV_NULL echo "" > $DEV_NULL
relpath=`(cd "$relpath"; pwd -W)`
outpath=`pwd -W`
fi fi
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
...@@ -1001,6 +1003,7 @@ CFG_SYSROOT= ...@@ -1001,6 +1003,7 @@ CFG_SYSROOT=
CFG_GCC_SYSROOT="yes" CFG_GCC_SYSROOT="yes"
QT_HOST_PREFIX= QT_HOST_PREFIX=
QT_HOST_BINS= QT_HOST_BINS=
QT_HOST_LIBS=
QT_HOST_DATA= QT_HOST_DATA=
#flags for SQL drivers #flags for SQL drivers
...@@ -1109,7 +1112,7 @@ while [ "$#" -gt 0 ]; do ...@@ -1109,7 +1112,7 @@ while [ "$#" -gt 0 ]; do
VAL=no VAL=no
;; ;;
#Qt style options that pass an argument #Qt style options that pass an argument
-prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig|-android-sdk|-android-ndk|-android-ndk-platform|-android-ndk-host|-android-arch|-android-toolchain-version) -prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-hostlibdir|-qpa|-qconfig|-android-sdk|-android-ndk|-android-ndk-platform|-android-ndk-host|-android-arch|-android-toolchain-version)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift shift
VAL="$1" VAL="$1"
...@@ -1294,6 +1297,9 @@ while [ "$#" -gt 0 ]; do ...@@ -1294,6 +1297,9 @@ while [ "$#" -gt 0 ]; do
hostbindir) hostbindir)
QT_HOST_BINS="$VAL" QT_HOST_BINS="$VAL"
;; ;;
hostlibdir)
QT_HOST_LIBS="$VAL"
;;
pkg-config) pkg-config)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_PKGCONFIG="$VAL" CFG_PKGCONFIG="$VAL"
...@@ -2390,26 +2396,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then ...@@ -2390,26 +2396,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then
[ -d "$outpath/bin" ] || mkdir -p "$outpath/bin" [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin"
# make a syncqt script that can be used in the shadow
rm -f "$outpath/bin/syncqt"
if [ -x "$relpath/bin/syncqt" ]; then
mkdir -p "$outpath/bin"
echo "#!/bin/sh" >"$outpath/bin/syncqt"
echo "perl \"$relpath/bin/syncqt\" \"\$@\"" >>"$outpath/bin/syncqt"
chmod 755 "$outpath/bin/syncqt"
fi
for i in elf2e32_qtwrapper createpackage patch_capabilities qtmodule-configtests; do
rm -f "$outpath/bin/$i"
if [ -x "$relpath/bin/$i" ]; then
mkdir -p "$outpath/bin"
echo "#!/bin/sh" >"$outpath/bin/$i"
echo "QTDIR=\"$relpath\"; export QTDIR" >>"$outpath/bin/$i"
echo "\"$relpath/bin/$i\" \"\$@\"" >>"$outpath/bin/$i"
chmod 755 "$outpath/bin/$i"
fi
done
# save a pre-existing mkspecs/modules dir # save a pre-existing mkspecs/modules dir
test -d "$outpath/mkspecs/modules" && \ test -d "$outpath/mkspecs/modules" && \
mv "$outpath/mkspecs/modules" "$outpath/mkspecs-modules" mv "$outpath/mkspecs/modules" "$outpath/mkspecs-modules"
...@@ -2497,7 +2483,10 @@ if [ -z "$PLATFORM" ]; then ...@@ -2497,7 +2483,10 @@ if [ -z "$PLATFORM" ]; then
# about the OS version, since we're not using the clang version that comes # about the OS version, since we're not using the clang version that comes
# with the system. We use 'xcrun' to check the clang version that's part of # with the system. We use 'xcrun' to check the clang version that's part of
# the Xcode installation. # the Xcode installation.
if [ "$(/usr/bin/xcrun -sdk macosx clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p')" -ge 3 ]; then XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`
CLANGVERSION=`echo "$XCRUN" | sed -n 's/.*version \([0-9]\).*/\1/p'`
expr "$CLANGVERSION" : '[0-9]' > /dev/null || { echo "Unable to determine CLANG version from output of xcrun: $XCRUN" ; exit 2 ; }
if [ "$CLANGVERSION" -ge 3 ]; then
PLATFORM=macx-clang PLATFORM=macx-clang
# Advertise g++ as an alternative on Lion and below # Advertise g++ as an alternative on Lion and below
...@@ -3150,6 +3139,15 @@ if [ -z "$QT_HOST_BINS" ]; then #default ...@@ -3150,6 +3139,15 @@ if [ -z "$QT_HOST_BINS" ]; then #default
fi fi
QT_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_BINS"` QT_HOST_BINS=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_BINS"`
if [ -z "$QT_HOST_LIBS" ]; then #default
if $haveHpx; then
QT_HOST_LIBS="$QT_HOST_PREFIX/lib" #fallback
else
QT_HOST_LIBS="$QT_INSTALL_LIBS"
fi
fi
QT_HOST_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_HOST_LIBS"`
if [ -z "$QT_HOST_DATA" ]; then #default if [ -z "$QT_HOST_DATA" ]; then #default
if $haveHpx; then if $haveHpx; then
QT_HOST_DATA="$QT_HOST_PREFIX" QT_HOST_DATA="$QT_HOST_PREFIX"
...@@ -3323,6 +3321,8 @@ Installation options: ...@@ -3323,6 +3321,8 @@ Installation options:
-hostbindir <dir> .. Host executables will be installed to <dir> -hostbindir <dir> .. Host executables will be installed to <dir>
(default HOSTPREFIX/bin) (default HOSTPREFIX/bin)
-hostlibdir <dir> .. Host libraries will be installed to <dir>
(default HOSTPREFIX/lib)
-hostdatadir <dir> . Data used by qmake will be installed to <dir> -hostdatadir <dir> . Data used by qmake will be installed to <dir>
(default HOSTPREFIX) (default HOSTPREFIX)
...@@ -3837,6 +3837,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = { ...@@ -3837,6 +3837,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = {
"qt_ssrtpath=$CFG_SYSROOT", "qt_ssrtpath=$CFG_SYSROOT",
"qt_hpfxpath=$QT_HOST_PREFIX", "qt_hpfxpath=$QT_HOST_PREFIX",
"qt_hbinpath=$QT_HOST_BINS", "qt_hbinpath=$QT_HOST_BINS",
"qt_hlibpath=$QT_HOST_LIBS",
"qt_hdatpath=$QT_HOST_DATA", "qt_hdatpath=$QT_HOST_DATA",
"qt_targspec=$shortxspec", "qt_targspec=$shortxspec",
"qt_hostspec=$shortspec", "qt_hostspec=$shortspec",
...@@ -3885,8 +3886,8 @@ fi ...@@ -3885,8 +3886,8 @@ fi
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# symlink includes # symlink includes
if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt" ]; then if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt.pl" ]; then
"$outpath/bin/syncqt" -minimal -module QtCore "$relpath" || exit 1 "$relpath/bin/syncqt.pl" -minimal -module QtCore "$relpath" || exit 1
fi fi
# $1: input variable name (awk regexp) # $1: input variable name (awk regexp)
...@@ -6608,6 +6609,50 @@ fi ...@@ -6608,6 +6609,50 @@ fi
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary
report_support()
{
case "$#,$2" in
2,auto)
# 2 arguments and the result is "auto", so just say "yes"
# this is usually an error in the configure script, but oh well..
echo "$1 yes"
return
;;
[012],* | *,no*)
# 0, 1 or 2 arguments, or anything starting with "no"
# print just the first part of the argument (before the dash)
echo "$1 ${2%%-*}"
return
:;
esac
local heading
heading=$1
shift
local value
value=$1
shift
while [ $# -gt 0 ]; do
if [ "$value" = "$1" ]; then
echo "$heading yes ($2)"
return
fi
shift
shift
done
echo "$heading $value"
}
report_support_plugin()
{
report_support "$1" "$2-$3" \
yes-qt "in $4, using bundled copy" \
yes-system "in $4, using system library" \
plugin-qt "plugin, using bundled copy" \
plugin-system "plugin, using system library"
}
echo echo
echo " Configure summary" echo " Configure summary"
echo echo
...@@ -6665,142 +6710,89 @@ fi ...@@ -6665,142 +6710,89 @@ fi
# Qt modules # Qt modules
echo echo
echo "Qt modules and options:" echo "Qt modules and options:"
[ "$CFG_DBUS" = "no" ] && echo " Qt D-Bus ............... no" report_support " Qt D-Bus ..............." "$CFG_DBUS" yes "loading dbus-1 at runtime" linked "linked to dbus-1"
[ "$CFG_DBUS" = "yes" ] && echo " Qt D-Bus ............... yes (loading dbus-1 at runtime)" report_support " Qt Concurrent .........." "$CFG_CONCURRENT"
[ "$CFG_DBUS" = "linked" ] && echo " Qt D-Bus ............... yes (linked to dbus-1)" report_support " Qt GUI ................." "$CFG_GUI"
echo " Qt Concurrent .......... $CFG_CONCURRENT" report_support " Qt Widgets ............." "$CFG_WIDGETS"
echo " Qt GUI ................. $CFG_GUI" report_support " JavaScriptCore JIT ....." "$CFG_JAVASCRIPTCORE_JIT" auto "To be decided by JavaScriptCore"
echo " Qt Widgets ............. $CFG_WIDGETS" report_support " QML debugging .........." "$CFG_QML_DEBUG"
if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then report_support " Use system proxies ....." "$CFG_SYSTEM_PROXIES"
echo " JavaScriptCore JIT ..... To be decided by JavaScriptCore"
else
echo " JavaScriptCore JIT ..... $CFG_JAVASCRIPTCORE_JIT"
fi
echo " QML debugging .......... $CFG_QML_DEBUG"
echo " Use system proxies ..... $CFG_SYSTEM_PROXIES"
# Other things # Other things
# Please keep sorted and properly grouped! The output is quite long, so it's # Please keep sorted and properly grouped! The output is quite long, so it's
# hard to find something you're searching for if it's not sorted. # hard to find something you're searching for if it's not sorted.
echo echo
echo "Support enabled for:" echo "Support enabled for:"
echo " Accessibility .......... $CFG_ACCESSIBILITY" report_support " Accessibility .........." "$CFG_ACCESSIBILITY"
echo " ALSA ................... $CFG_ALSA" report_support " ALSA ..................." "$CFG_ALSA"
echo " CUPS ................... $CFG_CUPS" report_support " CUPS ..................." "$CFG_CUPS"
[ "$XPLATFORM_MINGW" = "yes" ] && \ [ "$XPLATFORM_MINGW" = "yes" ] && \
echo " DirectWrite ............ $CFG_DIRECTWRITE" report_support " DirectWrite ............" "$CFG_DIRECTWRITE"
echo " FontConfig ............. $CFG_FONTCONFIG" report_support " FontConfig ............." "$CFG_FONTCONFIG"
echo " Iconv .................. $CFG_ICONV" report_support " Iconv .................." "$CFG_ICONV"
echo " ICU .................... $CFG_ICU" report_support " ICU ...................." "$CFG_ICU"
echo " Image formats:" report_support " Image formats:"
echo " GIF .................. $CFG_GIF" report_support_plugin " GIF .................." "$CFG_GIF" system QtGui
if [ "$CFG_JPEG" = "no" ]; then report_support_plugin " JPEG ................." "$CFG_JPEG" "$CFG_LIBJPEG" QtGui
echo " JPEG ................. $CFG_JPEG" report_support_plugin " PNG .................." "$CFG_PNG" "$CFG_LIBPNG" QtGui
else report_support " Glib ..................." "$CFG_GLIB"
echo " JPEG ................. $CFG_JPEG ($CFG_LIBJPEG)" report_support " GStreamer .............." "$CFG_GSTREAMER"
fi report_support " GTK theme .............." "$CFG_QGTKSTYLE"
if [ "$CFG_PNG" = "no" ]; then report_support " Large File ............." "$CFG_LARGEFILE"
echo " PNG .................. $CFG_PNG" report_support " libudev ................" "$CFG_LIBUDEV"
else report_support " Networking:"
echo " PNG .................. $CFG_PNG ($CFG_LIBPNG)"
fi
echo " Glib ................... $CFG_GLIB"
echo " GStreamer .............. $CFG_GSTREAMER"
echo " GTK theme .............. $CFG_QGTKSTYLE"
echo " Large Files ............ $CFG_LARGEFILE"
echo " Networking:"
[ "$BUILD_ON_MAC" = "yes" ] && \ [ "$BUILD_ON_MAC" = "yes" ] && \
echo " CoreWlan ............. $CFG_COREWLAN" report_support " CoreWlan ............." "$CFG_COREWLAN"
echo " getaddrinfo .......... $CFG_GETADDRINFO" report_support " getaddrinfo .........." "$CFG_GETADDRINFO"
echo " getifaddrs ........... $CFG_GETIFADDRS" report_support " getifaddrs ..........." "$CFG_GETIFADDRS"
echo " IPv6 ifname .......... $CFG_IPV6IFNAME" report_support " IPv6 ifname .........." "$CFG_IPV6IFNAME"
OPENSSL_LINKAGE="" report_support " OpenSSL .............." "$CFG_OPENSSL" yes "loading libraries at run-time" linked "linked to the libraries"
if [ "$CFG_OPENSSL" = "yes" ]; then report_support " NIS ...................." "$CFG_NIS"
OPENSSL_LINKAGE="(loading libraries at run-time)" report_support " OpenGL ................." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.x"
elif [ "$CFG_OPENSSL" = "linked" ]; then report_support " OpenVG ................." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native"
OPENSSL_LINKAGE="(linked to the libraries)" report_support " PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy"
fi
echo " OpenSSL .............. $CFG_OPENSSL $OPENSSL_LINKAGE"
unset OPENSSL_LINKAGE
echo " NIS .................... $CFG_NIS"
if [ "$CFG_OPENGL" = "desktop" ]; then
echo " OpenGL ................. yes (Desktop OpenGL)"
elif [ "$CFG_OPENGL" = "es2" ]; then
echo " OpenGL ................. yes (OpenGL ES 2.x)"
else
echo " OpenGL ................. no"
fi
if [ "$CFG_OPENVG" ]; then
if [ "$CFG_OPENVG_SHIVA" = "yes" ]; then
echo " OpenVG ................. ShivaVG"
else
echo " OpenVG ................. $CFG_OPENVG"
fi
fi
if [ "$CFG_PCRE" = "no" ]; then
echo " PCRE ................... no"
else
pcre_sys=system
[ "$CFG_PCRE" = "qt" ] && pcre_sys=qt
echo " PCRE ................... yes ($pcre_sys)"
unset pcre_sys
fi
if [ -n "$PKG_CONFIG" ]; then if [ -n "$PKG_CONFIG" ]; then
echo " pkg-config ............. yes" report_support " pkg-config ............. yes"
else else
echo " pkg-config ............. no" report_support " pkg-config ............. no"
fi fi
echo " PulseAudio ............. $CFG_PULSEAUDIO" report_support " PulseAudio ............." "$CFG_PULSEAUDIO"
echo " QPA backends:" report_support " QPA backends:"
echo " DirectFB ............. $CFG_DIRECTFB" report_support " DirectFB ............." "$CFG_DIRECTFB"
echo " EGLFS ................ $CFG_EGLFS" report_support " EGLFS ................" "$CFG_EGLFS"
echo " KMS .................. $CFG_KMS" report_support " KMS .................." "$CFG_KMS"
echo " LinuxFB .............. $CFG_LINUXFB" report_support " LinuxFB .............." "$CFG_LINUXFB"
echo " XCB .................. $CFG_XCB" report_support " XCB .................." "$CFG_XCB" system "system library" qt "bundled copy"
if [ "$CFG_XCB" != "no" ]; then if [ "$CFG_XCB" != "no" ]; then
echo " MIT-SHM ............ $CFG_MITSHM" report_support " MIT-SHM ............" "$CFG_MITSHM"
echo " Xcursor ............ $CFG_XCURSOR" report_support " Xcursor ............" "$CFG_XCURSOR" runtime "loaded at runtime"
echo " Xfixes ............. $CFG_XFIXES" report_support " Xfixes ............." "$CFG_XFIXES" runtime "loaded at runtime"
echo " Xi ................. $CFG_XINPUT" report_support " Xi ................." "$CFG_XINPUT" runtime "loaded at runtime"
echo " Xi2 ................ $CFG_XINPUT2" report_support " Xi2 ................" "$CFG_XINPUT2" runtime "loaded at runtime"
echo " Xinerama ........... $CFG_XINERAMA" report_support " Xinerama ..........." "$CFG_XINERAMA" runtime "loaded at runtime"
echo " Xrandr ............. $CFG_XRANDR" report_support " Xrandr ............." "$CFG_XRANDR" runtime "loaded at runtime"
echo " Xrender ............ $CFG_XRENDER" report_support " Xrender ............" "$CFG_XRENDER"
echo " XKB ................ $CFG_XKB" report_support " XKB ................" "$CFG_XKB"
echo " XShape ............. $CFG_XSHAPE" report_support " XShape ............." "$CFG_XSHAPE"
echo " XSync .............. $CFG_XSYNC" report_support " XSync .............." "$CFG_XSYNC"
echo " XVideo ............. $CFG_XVIDEO" report_support " XVideo ............." "$CFG_XVIDEO"
fi fi
echo " Session management ..... $CFG_SM" report_support " Session management ....." "$CFG_SM"
[ "$XPLATFORM_QNX" = "yes" ] && \ [ "$XPLATFORM_QNX" = "yes" ] && \
echo " SLOG2 .................. $CFG_SLOG2" report_support " SLOG2 .................." "$CFG_SLOG2"
echo " SQL drivers:" report_support " SQL drivers:"
echo " DB2 .................. $CFG_SQL_db2" report_support " DB2 .................." "$CFG_SQL_db2" plugin "plugin" yes "built into QtSql"
echo " InterBase ............ $CFG_SQL_ibase" report_support " InterBase ............" "$CFG_SQL_ibase" plugin "plugin" yes "built into QtSql"
echo " MySQL ................ $CFG_SQL_mysql" report_support " MySQL ................" "$CFG_SQL_mysql" plugin "plugin" yes "built into QtSql"
echo " OCI .................. $CFG_SQL_oci" report_support " OCI .................." "$CFG_SQL_oci" plugin "plugin" yes "built into QtSql"
echo " ODBC ................. $CFG_SQL_odbc" report_support " ODBC ................." "$CFG_SQL_odbc" plugin "plugin" yes "built into QtSql"
echo " PostgreSQL ........... $CFG_SQL_psql" report_support " PostgreSQL ..........." "$CFG_SQL_psql" plugin "plugin" yes "built into QtSql"
echo " SQLite 2 ............. $CFG_SQL_sqlite2" report_support " SQLite 2 ............." "$CFG_SQL_sqlite2" plugin "plugin" yes "built into QtSql"
echo " SQLite ............... $CFG_SQL_sqlite ($CFG_SQLITE)" report_support_plugin " SQLite ..............." "$CFG_SQL_sqlite" "$CFG_SQLITE" QtSql
echo " TDS .................. $CFG_SQL_tds" report_support " TDS .................." "$CFG_SQL_tds" plugin "plugin" yes "built into QtSql"
echo " udev ................... $CFG_LIBUDEV" report_support " udev ..................." "$CFG_LIBUDEV"
if [ "$CFG_XKBCOMMON" = "no" ]; then report_support " xkbcommon .............." "$CFG_XKBCOMMON" system "system library" qt "bundled copy"
echo " xkbcommon............... no" report_support " zlib ..................." "$CFG_ZLIB" system "system library" yes "bundled copy"
else
xkbcommon_sys=system
[ "$CFG_XKBCOMMON" = "qt" ] && xkbcommon_sys=qt
echo " xkbcommon............... yes ($xkbcommon_sys)"
unset xkbcommon_sys
fi
if [ "$CFG_ZLIB" = "no" ]; then
echo " zlib ................... no"
else
zlib_sys=system
[ "$CFG_ZLIB" = "yes" ] && zlib_sys=qt
echo " zlib ................... yes ($zlib_sys)"
unset zlib_sys
fi
echo echo
......
...@@ -55,7 +55,7 @@ if not exist mkspecs ( ...@@ -55,7 +55,7 @@ if not exist mkspecs (
md mkspecs md mkspecs
if errorlevel 1 goto exit if errorlevel 1 goto exit
) )
perl %QTSRC%bin\syncqt -minimal -module QtCore -outdir %QTDIR% %QTSRC% perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir %QTDIR% %QTSRC%
if errorlevel 1 goto exit if errorlevel 1 goto exit
if not exist tools\configure ( if not exist tools\configure (
......
...@@ -62,28 +62,28 @@ ...@@ -62,28 +62,28 @@
*/ */
/*! /*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:find_package \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_package
\title CMake find_package Documentation \title CMake find_package Documentation
*/ */
/*! /*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:AUTOMOC \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:AUTOMOC
\title CMake AUTOMOC Documentation \title CMake AUTOMOC Documentation
*/ */
/*! /*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:LOCATION \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:LOCATION
\title CMake LOCATION Documentation \title CMake LOCATION Documentation
*/ */
/*! /*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:POSITION_INDEPENDENT_CODE \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:POSITION_INDEPENDENT_CODE
\title CMake POSITION_INDEPENDENT_CODE Documentation \title CMake POSITION_INDEPENDENT_CODE Documentation
*/ */
/*! /*!
\externalpage http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:target_link_libraries \externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:target_link_libraries
\title CMake target_link_libraries Documentation \title CMake target_link_libraries Documentation
*/ */
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
# manifestmeta.global.names = * # manifestmeta.global.names = *
# manifestmeta.global.tags = qt5 # manifestmeta.global.tags = qt5
manifestmeta.filters = highlighted manifestmeta.filters = highlighted webkit1 webkit2
manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
"QtQuick/Qt Quick Demo - Photo Surface" \ "QtQuick/Qt Quick Demo - Photo Surface" \
...@@ -50,3 +50,23 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ ...@@ -50,3 +50,23 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
"QtWidgets/Application Example" "QtWidgets/Application Example"
manifestmeta.highlighted.attributes = isHighlighted:true manifestmeta.highlighted.attributes = isHighlighted:true
# Add 'webkit1' tag for QtWebKit1 examples
manifestmeta.webkit1.names = "QtWebKitExamples/Tab Browser" \
"QtWebKitExamples/DOM Traversal Example" \
"QtWebKitExamples/Fancy Browser Example" \
"QtWebKitExamples/Form Extractor Example" \
"QtWebKitExamples/WebKit Frame Capture Example" \
"QtWebKitExamples/The Webkit Bridge Tutorial*" \
"QtWebKitExamples/Previewer Example" \
"QtWebKitExamples/Wheel Scroller Example" \
"QtWebKitExamples/Simple Selector Example" \
"QtWebKitExamples/QObject XML Model Example"
manifestmeta.webkit1.tags = webkit1
# Add 'webkit2' tag for QtWebKit2 examples
manifestmeta.webkit2.names = "QtWebKitExamples/Flickr View Example" \
"QtWebKitExamples/YouTube View Example"
manifestmeta.webkit2.tags = webkit2
doc/src/images/appicon_packagecontents.png

20.8 KB

doc/src/images/appicon_screenshot.png

147 KB

...@@ -88,14 +88,10 @@ PaintedWindow::PaintedWindow() ...@@ -88,14 +88,10 @@ PaintedWindow::PaintedWindow()
connect(this, SIGNAL(rotationChanged(qreal)), this, SLOT(paint())); connect(this, SIGNAL(rotationChanged(qreal)), this, SLOT(paint()));
} }
void PaintedWindow::resizeEvent(QResizeEvent *)
{
paint();
}
void PaintedWindow::exposeEvent(QExposeEvent *) void PaintedWindow::exposeEvent(QExposeEvent *)
{ {
paint(); if (isExposed())
paint();
} }
void PaintedWindow::mousePressEvent(QMouseEvent *) void PaintedWindow::mousePressEvent(QMouseEvent *)
......
...@@ -74,7 +74,6 @@ private slots: ...@@ -74,7 +74,6 @@ private slots:
void rotationDone(); void rotationDone();
private: private:
void resizeEvent(QResizeEvent *);
void exposeEvent(QExposeEvent *); void exposeEvent(QExposeEvent *);
void mousePressEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *);
......
...@@ -78,55 +78,38 @@ static bool createConnection() ...@@ -78,55 +78,38 @@ static bool createConnection()
query.exec("insert into person values(104, 'Roberto', 'Robitaille')"); query.exec("insert into person values(104, 'Roberto', 'Robitaille')");
query.exec("insert into person values(105, 'Maria', 'Papadopoulos')"); query.exec("insert into person values(105, 'Maria', 'Papadopoulos')");
query.exec("create table offices (id int primary key," query.exec("create table items (id int primary key,"
"imagefile int," "imagefile int,"
"location varchar(20)," "itemtype varchar(20),"
"country varchar(20),"
"description varchar(100))"); "description varchar(100))");
query.exec("insert into offices " query.exec("insert into items "
"values(0, 0, 'Oslo', 'Norway'," "values(0, 0, 'Qt',"
"'Oslo is home to more than 500 000 citizens and has a " "'Qt is a full development framework with tools designed to "
"lot to offer.It has been called \"The city with the big " "streamline the creation of stunning applications and "
"heart\" and this is a nickname we are happy to live up to.')"); "amazing user interfaces for desktop, embedded and mobile "
query.exec("insert into offices " "platforms.')");
"values(1, 1, 'Brisbane', 'Australia'," query.exec("insert into items "
"'Brisbane is the capital of Queensland, the Sunshine State, " "values(1, 1, 'Qt Quick',"
"where it is beautiful one day, perfect the next. " "'Qt Quick is a collection of techniques designed to help "
"Brisbane is Australia''s 3rd largest city, being home " "developers create intuitive, modern-looking, and fluid "
"to almost 2 million people.')"); "user interfaces using a CSS & JavaScript like language.')");
query.exec("insert into offices " query.exec("insert into items "
"values(2, 2, 'Redwood City', 'US'," "values(2, 2, 'Qt Creator',"
"'You find Redwood City in the heart of the Bay Area " "'Qt Creator is a powerful cross-platform integrated "
"just north of Silicon Valley. The largest nearby city is " "development environment (IDE), including UI design tools "
"San Jose which is the third largest city in California " "and on-device debugging.')");
"and the 10th largest in the US.')"); query.exec("insert into items "
query.exec("insert into offices " "values(3, 3, 'Qt Project',"
"values(3, 3, 'Berlin', 'Germany'," "'The Qt Project governs the open source development of Qt, "
"'Berlin, the capital of Germany is dynamic, cosmopolitan " "allowing anyone wanting to contribute to join the effort "
"and creative, allowing for every kind of lifestyle. " "through a meritocratic structure of approvers and "
"East meets West in the metropolis at the heart of a " "maintainers.')");
"changing Europe.')");
query.exec("insert into offices "
"values(4, 4, 'Munich', 'Germany',"
"'Several technology companies are represented in Munich, "
"and the city is often called the \"Bavarian Silicon Valley\". "
"The exciting city is also filled with culture, "
"art and music. ')");
query.exec("insert into offices "
"values(5, 5, 'Beijing', 'China',"
"'Beijing as a capital city has more than 3000 years of "
"history. Today the city counts 12 million citizens, and "
"is the political, economic and cultural centre of China.')");
query.exec("create table images (locationid int, file varchar(20))");
query.exec("insert into images values(0, 'images/oslo.png')");
query.exec("insert into images values(1, 'images/brisbane.png')");
query.exec("insert into images values(2, 'images/redwood.png')");
query.exec("insert into images values(3, 'images/berlin.png')");
query.exec("insert into images values(4, 'images/munich.png')");
query.exec("insert into images values(5, 'images/beijing.png')");
query.exec("create table images (itemid int, file varchar(20))");
query.exec("insert into images values(0, 'images/qt-logo.png')");
query.exec("insert into images values(1, 'images/qt-quick.png')");
query.exec("insert into images values(2, 'images/qt-creator.png')");
query.exec("insert into images values(3, 'images/qt-project.png')");
return true; return true;
} }
......
examples/sql/doc/images/drilldown-example.png

125 KB | W: | H:

examples/sql/doc/images/drilldown-example.png

51.7 KB | W: | H:

examples/sql/doc/images/drilldown-example.png
examples/sql/doc/images/drilldown-example.png
examples/sql/doc/images/drilldown-example.png
examples/sql/doc/images/drilldown-example.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -37,20 +37,19 @@ ...@@ -37,20 +37,19 @@
\image drilldown-example.png Screenshot of the Drill Down Example \image drilldown-example.png Screenshot of the Drill Down Example
When running the example application, a user can retrieve When running the example application, a user can retrieve
information about each of Nokia's Qt offices by clicking the information about each item by clicking the corresponding image.
corresponding image. The application pops up an information window The application pops up an information window displaying the data,
displaying the data, and allows the users to alter the location and allows the users to alter the description as well as the image.
description as well as the image. The main view will be updated The main view will be updated when the users submit their changes.
when the users submit their changes.
The example consists of three classes: The example consists of three classes:
\list \list
\li \c ImageItem is a custom graphics item class used to \li \c ImageItem is a custom graphics item class used to
display the office images. display the images.
\li \c View is the main application widget allowing the user to \li \c View is the main application widget allowing the user to
browse through the various locations. browse through the various items.
\li \c InformationWindow displays the requested information, \li \c InformationWindow displays the requested information,
allowing the users to alter it and submit their changes to the allowing the users to alter it and submit their changes to the
...@@ -70,7 +69,7 @@ ...@@ -70,7 +69,7 @@
\snippet drilldown/informationwindow.h 0 \snippet drilldown/informationwindow.h 0
When we create an information window, we pass the associated When we create an information window, we pass the associated
location ID, a parent, and a pointer to the database, to the item ID, a parent, and a pointer to the database, to the
constructor. We will use the database pointer to populate our constructor. We will use the database pointer to populate our
window with data, while passing the parent parameter on to the window with data, while passing the parent parameter on to the
base class. The ID is stored for future reference. base class. The ID is stored for future reference.
...@@ -84,7 +83,7 @@ ...@@ -84,7 +83,7 @@
\snippet drilldown/informationwindow.h 1 \snippet drilldown/informationwindow.h 1
Since we allow the users to alter some of the location data, we Since we allow the users to alter some of the data, we
must provide functionality for reverting and submitting their must provide functionality for reverting and submitting their
changes. The \c enableButtons() slot is provided for convenience changes. The \c enableButtons() slot is provided for convenience
to enable and disable the various buttons when required. to enable and disable the various buttons when required.
...@@ -93,15 +92,15 @@ ...@@ -93,15 +92,15 @@
The \c createButtons() function is also a convenience function, The \c createButtons() function is also a convenience function,
provided to simplify the constructor. As mentioned above we store provided to simplify the constructor. As mentioned above we store
the location ID for future reference. We also store the name of the item ID for future reference. We also store the name of
the currently displayed image file to be able to determine when to the currently displayed image file to be able to determine when to
emit the \c imageChanged() signal. emit the \c imageChanged() signal.
The information window uses the QLabel class to display the office The information window uses the QLabel class to display the name of
location and the country. The associated image file is displayed an item. The associated image file is displayed using a QComboBox
using a QComboBox instance while the description is displayed using instance while the description is displayed using QTextEdit. In
QTextEdit. In addition, the window has three buttons to control addition, the window has three buttons to control the data flow and
the data flow and whether the window is shown or not. whether the window is shown or not.
Finally, we declare a \e mapper. The QDataWidgetMapper class Finally, we declare a \e mapper. The QDataWidgetMapper class
provides mapping between a section of a data model to widgets. We provides mapping between a section of a data model to widgets. We
...@@ -110,7 +109,7 @@ ...@@ -110,7 +109,7 @@
\section1 InformationWindow Class Implementation \section1 InformationWindow Class Implementation
The constructor takes three arguments: a location ID, a database The constructor takes three arguments: an item ID, a database
pointer and a parent widget. The database pointer is actually a pointer and a parent widget. The database pointer is actually a
pointer to a QSqlRelationalTableModel object providing an editable pointer to a QSqlRelationalTableModel object providing an editable
data model (with foreign key support) for our database table. data model (with foreign key support) for our database table.
...@@ -125,8 +124,8 @@ ...@@ -125,8 +124,8 @@
\snippet drilldown/informationwindow.cpp 2 \snippet drilldown/informationwindow.cpp 2
In this example, the information about the offices are stored in a In this example, information about the items are stored in a
database table called "offices". When creating the model, database table called "items". When creating the model,
we will use a foreign key to establish a relation between this we will use a foreign key to establish a relation between this
table and a second data base table, "images", containing the names table and a second data base table, "images", containing the names
of the available image files. We will get back to how this is done of the available image files. We will get back to how this is done
...@@ -140,7 +139,7 @@ ...@@ -140,7 +139,7 @@
the foreign key (in this case the "imagefile" column number) as the foreign key (in this case the "imagefile" column number) as
argument. We use QComboBox's \l {QComboBox::}{setModel()} function argument. We use QComboBox's \l {QComboBox::}{setModel()} function
to make the combobox use the "images" model. And, since this model to make the combobox use the "images" model. And, since this model
has two columns ("locationid" and "file"), we also specify which has two columns ("itemid" and "file"), we also specify which
column we want to be visible using the QComboBox::setModelColumn() column we want to be visible using the QComboBox::setModelColumn()
function. function.
...@@ -156,7 +155,7 @@ ...@@ -156,7 +155,7 @@
section is a column in the model, otherwise it is a row. We call section is a column in the model, otherwise it is a row. We call
the \l {QDataWidgetMapper::}{setCurrentIndex()} function to the \l {QDataWidgetMapper::}{setCurrentIndex()} function to
initialize the widgets with the data associated with the given initialize the widgets with the data associated with the given
location ID. Every time the current index changes, all the widgets item ID. Every time the current index changes, all the widgets
are updated with the contents from the model. are updated with the contents from the model.
We also set the mapper's submit policy to We also set the mapper's submit policy to
...@@ -168,14 +167,14 @@ ...@@ -168,14 +167,14 @@
view should use for its items. The QSqlRelationalDelegate class view should use for its items. The QSqlRelationalDelegate class
represents a delegate that unlike the default delegate, enables represents a delegate that unlike the default delegate, enables
combobox functionality for fields that are foreign keys into other combobox functionality for fields that are foreign keys into other
tables (like "imagefile" in our "trolltechoffices" table). tables (like "imagefile" in our "items" table).
\snippet drilldown/informationwindow.cpp 4 \snippet drilldown/informationwindow.cpp 4
Finally, we connect the "something's changed" signals in the Finally, we connect the "something's changed" signals in the
editors to our custom \c enableButtons() slot, enabling the users editors to our custom \c enableButtons() slot, enabling the users
to either submit or revert their changes. We add all the widgets to either submit or revert their changes. We add all the widgets
into a layout, store the location ID and the name of the displayed into a layout, store the item ID and the name of the displayed
image file for future reference, and set the window title and image file for future reference, and set the window title and
initial size. initial size.
...@@ -189,7 +188,7 @@ ...@@ -189,7 +188,7 @@
application exits (i.e., if the user closes the information application exits (i.e., if the user closes the information
window, it is only hidden). For this reason we do not want to window, it is only hidden). For this reason we do not want to
create more than one \c InformationWindow object for each create more than one \c InformationWindow object for each
location, and we provide the public \c id() function to be able to item, and we provide the public \c id() function to be able to
determine whether a window already exists for a given location determine whether a window already exists for a given location
when the user requests information about it. when the user requests information about it.
...@@ -256,16 +255,15 @@ ...@@ -256,16 +255,15 @@
{QDialogButtonBox::ButtonRole}{reject} role indicates that {QDialogButtonBox::ButtonRole}{reject} role indicates that
clicking the button causes the dialog to be rejected. On the other clicking the button causes the dialog to be rejected. On the other
hand, since we only hide the information window, any changes that hand, since we only hide the information window, any changes that
the user has made wil be preserved until the user expliclity the user has made will be preserved until the user explicitly
revert or submit them. reverts or submits them.
\snippet drilldown/informationwindow.cpp 10 \snippet drilldown/informationwindow.cpp 10
The \c enableButtons() slot is called to enable the buttons The \c enableButtons() slot is called to enable the buttons
whenever the user changes the presented data. Likewise, when the whenever the user changes the presented data. Likewise, when the
data the user choose to submit the changes, the buttons are user chooses to submit the changes, the buttons are disabled to
disabled to indicate that the current data is stored in the indicate that the current data is stored in the database.
database.
This completes the \c InformationWindow class. Let's take a look This completes the \c InformationWindow class. Let's take a look
at how we have used it in our example application. at how we have used it in our example application.
...@@ -280,19 +278,17 @@ ...@@ -280,19 +278,17 @@
\snippet drilldown/view.h 1 \snippet drilldown/view.h 1
The QGraphicsView class is part of the \l {Graphics View The QGraphicsView class is part of the \l {Graphics View
Framework} which we will use to display the images of Nokia's Framework} which we will use to display the images. To be able to
Qt offices. To be able to respond to user interaction; respond to user interaction by displaying the appropriate
i.e., showing the information window when the image is clicked, we reimplement
appropriate information window whenever the user clicks one of the QGraphicsView's \l{QGraphicsView::}{mouseReleaseEvent()} function.
office images, we reimplement QGraphicsView's \l
{QGraphicsView::}{mouseReleaseEvent()} function.
Note that the constructor expects the names of two database Note that the constructor expects the names of two database
tables: One containing the detailed information about the offices, tables: One containing the detailed information about the items,
and another containing the names of the available image files. We and another containing the names of the available image files. We
also provide a private \c updateImage() slot to catch \c also provide a private \c updateImage() slot to catch \c
{InformationWindow}'s \c imageChanged() signal that is emitted {InformationWindow}'s \c imageChanged() signal that is emitted
whenever the user changes a location's image. whenever the user changes an image associated with the item.
\snippet drilldown/view.h 2 \snippet drilldown/view.h 2
...@@ -303,20 +299,20 @@ ...@@ -303,20 +299,20 @@
The \c findWindow() function, on the other hand, is frequently The \c findWindow() function, on the other hand, is frequently
used. It is called from the \c showInformation() function to used. It is called from the \c showInformation() function to
detemine whether a window is already created for the given detemine whether a window is already created for the given
location (whenever we create an \c InformationWindow object, we item (whenever we create an \c InformationWindow object, we
store a reference to it in the \c informationWindows list). The store a reference to it in the \c informationWindows list). The
latter function is in turn called from our custom \c latter function is in turn called from our custom \c
mouseReleaseEvent() implementation. mouseReleaseEvent() implementation.
\snippet drilldown/view.h 3 \snippet drilldown/view.h 3
Finally we declare a QSqlRelationalTableModel pointer. As Finally, we declare a QSqlRelationalTableModel pointer. As
previously mentioned, the QSqlRelationalTableModel class provides previously mentioned, the QSqlRelationalTableModel class provides
an editable data model with foreign key support. There are a an editable data model with foreign key support. There are a
couple of things you should keep in mind when using the couple of things you should keep in mind when using the
QSqlRelationalTableModel class: The table must have a primary key QSqlRelationalTableModel class: The table must have a primary key
declared and this key cannot contain a relation to another table, declared and this key cannot contain a relation to another table,
i.e., it cannot be a foreign key. Note also that if a relational that is, it cannot be a foreign key. Also note that if a relational
table contains keys that refer to non-existent rows in the table contains keys that refer to non-existent rows in the
referenced table, the rows containing the invalid keys will not be referenced table, the rows containing the invalid keys will not be
exposed through the model. It is the user's or the database's exposed through the model. It is the user's or the database's
...@@ -327,11 +323,11 @@ ...@@ -327,11 +323,11 @@
Although the constructor requests the names of both the table Although the constructor requests the names of both the table
containing office details as well as the table containing the containing office details as well as the table containing the
names of the available image files, we only have to create a names of the available image files, we only have to create a
QSqlRelationalTableModel object for the office table: QSqlRelationalTableModel object for the "items" table:
\snippet drilldown/view.cpp 0 \snippet drilldown/view.cpp 0
The reason is that once we have a model with the office details, The reason is that once we have a model with the item details,
we can create a relation to the available image files using we can create a relation to the available image files using
QSqlRelationalTableModel's \l QSqlRelationalTableModel's \l
{QSqlRelationalTableModel::}{setRelation()} function. This {QSqlRelationalTableModel::}{setRelation()} function. This
...@@ -348,20 +344,19 @@ ...@@ -348,20 +344,19 @@
\snippet drilldown/view.cpp 1 \snippet drilldown/view.cpp 1
Then we create the contents of our view, i.e., the scene and its Then we create the contents of our view, i.e., the scene and its
items. The location labels are regular QGraphicsTextItem objects, items. The labels are regular QGraphicsTextItem objects, whereas
and the "Qt" logo is represented by a QGraphicsPixmapItem the images are instances of the \c ImageItem class, derived from
object. The images, on the other hand, are instances of the \c QGraphicsPixmapItem. We will get back to this shortly when reviewing
ImageItem class (derived from QGraphicsPixmapItem). We will get the \c addItems() function.
back to this shortly when reviewing the \c addItems() function.
Finally, we set the main application widget's size constraints and Finally, we set the main application widget's size constraints and
window title. window title.
\snippet drilldown/view.cpp 3 \snippet drilldown/view.cpp 3
The \c addItems() function is called only once, i.e., when The \c addItems() function is called only once when creating the main
creating the main application window. For each row in the database application window. For each row in the database table, we first
table, we first extract the corresponding record using the model's extract the corresponding record using the model's
\l {QSqlRelationalTableModel::}{record()} function. The QSqlRecord \l {QSqlRelationalTableModel::}{record()} function. The QSqlRecord
class encapsulates both the functionality and characteristics of a class encapsulates both the functionality and characteristics of a
database record, and supports adding and removing fields as well database record, and supports adding and removing fields as well
...@@ -394,7 +389,7 @@ ...@@ -394,7 +389,7 @@
\snippet drilldown/view.cpp 6 \snippet drilldown/view.cpp 6
The \c showInformation() function is given an \c ImageItem object The \c showInformation() function is given an \c ImageItem object
as argument, and starts off by extracting the item's location as argument, and starts off by extracting the item's item
ID. Then it determines if there already is created an information ID. Then it determines if there already is created an information
window for this location. If it is, and the window is visible, it window for this location. If it is, and the window is visible, it
ensures that the window is raised to the top of the widget stack ensures that the window is raised to the top of the widget stack
...@@ -402,7 +397,7 @@ ...@@ -402,7 +397,7 @@
{QWidget::}{show()} slot gives the same result. {QWidget::}{show()} slot gives the same result.
If no window for the given location exists, we create one by If no window for the given location exists, we create one by
passing the location ID, a pointer to the model, and our view as a passing the item ID, a pointer to the model, and our view as a
parent, to the \c InformationWindow constructor. Note that we parent, to the \c InformationWindow constructor. Note that we
connect the information window's \c imageChanged() signal to \e connect the information window's \c imageChanged() signal to \e
this widget's \c updateImage() slot, before we give it a suitable this widget's \c updateImage() slot, before we give it a suitable
...@@ -410,16 +405,16 @@ ...@@ -410,16 +405,16 @@
\snippet drilldown/view.cpp 7 \snippet drilldown/view.cpp 7
The \c updateImage() slot takes a location ID and the name of an The \c updateImage() slot takes an item ID and the name of an
image files as arguments. It filters out the image items, and image file as arguments. It filters out the image items, and
updates the one that correspond to the given location ID, with the updates the one that correspond to the given item ID, with the
provided image file. provided image file.
\snippet drilldown/view.cpp 8 \snippet drilldown/view.cpp 8
The \c findWindow() function simply searches through the list of The \c findWindow() function simply searches through the list of
existing windows, returning a pointer to the window that matches existing windows, returning a pointer to the window that matches
the given location ID, or 0 if the window doesn't exists. the given item ID, or 0 if the window doesn't exists.
Finally, let's take a quick look at our custom \c ImageItem class: Finally, let's take a quick look at our custom \c ImageItem class:
...@@ -442,7 +437,7 @@ ...@@ -442,7 +437,7 @@
returning back to its original size when the cursor leaves its returning back to its original size when the cursor leaves its
borders. borders.
Finally, we store the location ID that this particular record is Finally, we store the item ID that this particular record is
associated with as well as a z-value. In the \l {Graphics View associated with as well as a z-value. In the \l {Graphics View
Framework}, an item's z-value determines its position in the item Framework}, an item's z-value determines its position in the item
stack. An item of high z-value will be drawn on top of an item stack. An item of high z-value will be drawn on top of an item
...@@ -460,8 +455,8 @@ ...@@ -460,8 +455,8 @@
\snippet drilldown/imageitem.cpp 0 \snippet drilldown/imageitem.cpp 0
Then we store the ID for future reference, and ensure that our Then we store the ID for future reference, and ensure that our
item will accept hover events. Hover events are delivered when image item will accept hover events. Hover events are delivered
there is no current mouse grabber item. They are sent when the when there is no current mouse grabber item. They are sent when the
mouse cursor enters an item, when it moves around inside the item, mouse cursor enters an item, when it moves around inside the item,
and when the cursor leaves an item. As we mentioned earlier, none and when the cursor leaves an item. As we mentioned earlier, none
of the \l {Graphics View Framework}'s items accept hover of the \l {Graphics View Framework}'s items accept hover
...@@ -487,7 +482,7 @@ ...@@ -487,7 +482,7 @@
\codeline \codeline
\snippet drilldown/imageitem.cpp 2 \snippet drilldown/imageitem.cpp 2
Whenever the mouse cursor enters or leave the image item, the Whenever the mouse cursor enters or leaves the image item, the
corresponding event handlers are triggered: We first set the time corresponding event handlers are triggered: We first set the time
line's direction, making the item expand or shrink, line's direction, making the item expand or shrink,
respectively. Then we alter the item's z-value if it is not already respectively. Then we alter the item's z-value if it is not already
...@@ -532,6 +527,6 @@ ...@@ -532,6 +527,6 @@
size regardless of the size of the source image. The \c id() size regardless of the size of the source image. The \c id()
function is trivial, and is simply provided to be able to identify function is trivial, and is simply provided to be able to identify
the item. In the \c updateItemPosition() slot we call the the item. In the \c updateItemPosition() slot we call the
QGraphicsItem::setZValue() function, setting the elevation (i.e., QGraphicsItem::setZValue() function, setting the elevation of the
the position) of the item. item.
*/ */
<!DOCTYPE RCC><RCC version="1.0"> <RCC>
<qresource> <qresource prefix="/">
<file>images/oslo.png</file> <file>images/qt-logo.png</file>
<file>images/brisbane.png</file> <file>images/qt-quick.png</file>
<file>images/redwood.png</file> <file>images/qt-creator.png</file>
<file>images/berlin.png</file> <file>images/qt-project.png</file>
<file>images/munich.png</file> </qresource>
<file>images/beijing.png</file>
<file>logo.png</file>
</qresource>
</RCC> </RCC>
...@@ -100,7 +100,7 @@ void ImageItem::setFrame(int frame) ...@@ -100,7 +100,7 @@ void ImageItem::setFrame(int frame)
void ImageItem::adjust() void ImageItem::adjust()
{ {
QMatrix matrix; QMatrix matrix;
matrix.scale(150/ boundingRect().width(), 120/ boundingRect().height()); matrix.scale(120/ boundingRect().width(), 120/ boundingRect().height());
setMatrix(matrix); setMatrix(matrix);
} }
//! [4] //! [4]
......
examples/sql/drilldown/images/beijing.png

96.8 KB

examples/sql/drilldown/images/berlin.png

80 KB

examples/sql/drilldown/images/brisbane.png

56.4 KB

examples/sql/drilldown/images/munich.png

58.4 KB

examples/sql/drilldown/images/oslo.png

40.8 KB