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
BUILD_ON_MSYS=yes
DEV_NULL=/tmp/empty-file
echo "" > $DEV_NULL
relpath=`(cd "$relpath"; pwd -W)`
outpath=`pwd -W`
fi
#-------------------------------------------------------------------------------
......@@ -1001,6 +1003,7 @@ CFG_SYSROOT=
CFG_GCC_SYSROOT="yes"
QT_HOST_PREFIX=
QT_HOST_BINS=
QT_HOST_LIBS=
QT_HOST_DATA=
#flags for SQL drivers
......@@ -1109,7 +1112,7 @@ while [ "$#" -gt 0 ]; do
VAL=no
;;
#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,"`
shift
VAL="$1"
......@@ -1294,6 +1297,9 @@ while [ "$#" -gt 0 ]; do
hostbindir)
QT_HOST_BINS="$VAL"
;;
hostlibdir)
QT_HOST_LIBS="$VAL"
;;
pkg-config)
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
CFG_PKGCONFIG="$VAL"
......@@ -2390,26 +2396,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then
[ -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
test -d "$outpath/mkspecs/modules" && \
mv "$outpath/mkspecs/modules" "$outpath/mkspecs-modules"
......@@ -2497,7 +2483,10 @@ if [ -z "$PLATFORM" ]; then
# 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
# 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
# Advertise g++ as an alternative on Lion and below
......@@ -3150,6 +3139,15 @@ if [ -z "$QT_HOST_BINS" ]; then #default
fi
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 $haveHpx; then
QT_HOST_DATA="$QT_HOST_PREFIX"
......@@ -3323,6 +3321,8 @@ Installation options:
-hostbindir <dir> .. Host executables will be installed to <dir>
(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>
(default HOSTPREFIX)
......@@ -3837,6 +3837,7 @@ static const char qt_configure_prefix_path_strs[][256 + 12] = {
"qt_ssrtpath=$CFG_SYSROOT",
"qt_hpfxpath=$QT_HOST_PREFIX",
"qt_hbinpath=$QT_HOST_BINS",
"qt_hlibpath=$QT_HOST_LIBS",
"qt_hdatpath=$QT_HOST_DATA",
"qt_targspec=$shortxspec",
"qt_hostspec=$shortspec",
......@@ -3885,8 +3886,8 @@ fi
# -----------------------------------------------------------------------------
# symlink includes
if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt" ]; then
"$outpath/bin/syncqt" -minimal -module QtCore "$relpath" || exit 1
if [ -n "$PERL" ] && [ -x "$relpath/bin/syncqt.pl" ]; then
"$relpath/bin/syncqt.pl" -minimal -module QtCore "$relpath" || exit 1
fi
# $1: input variable name (awk regexp)
......@@ -6608,6 +6609,50 @@ fi
#-------------------------------------------------------------------------------
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 " Configure summary"
echo
......@@ -6665,142 +6710,89 @@ fi
# Qt modules
echo
echo "Qt modules and options:"
[ "$CFG_DBUS" = "no" ] && echo " Qt D-Bus ............... no"
[ "$CFG_DBUS" = "yes" ] && echo " Qt D-Bus ............... yes (loading dbus-1 at runtime)"
[ "$CFG_DBUS" = "linked" ] && echo " Qt D-Bus ............... yes (linked to dbus-1)"
echo " Qt Concurrent .......... $CFG_CONCURRENT"
echo " Qt GUI ................. $CFG_GUI"
echo " Qt Widgets ............. $CFG_WIDGETS"
if [ "$CFG_JAVASCRIPTCORE_JIT" = "auto" ]; then
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"
report_support " Qt D-Bus ..............." "$CFG_DBUS" yes "loading dbus-1 at runtime" linked "linked to dbus-1"
report_support " Qt Concurrent .........." "$CFG_CONCURRENT"
report_support " Qt GUI ................." "$CFG_GUI"
report_support " Qt Widgets ............." "$CFG_WIDGETS"
report_support " JavaScriptCore JIT ....." "$CFG_JAVASCRIPTCORE_JIT" auto "To be decided by JavaScriptCore"
report_support " QML debugging .........." "$CFG_QML_DEBUG"
report_support " Use system proxies ....." "$CFG_SYSTEM_PROXIES"
# Other things
# 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.
echo
echo "Support enabled for:"
echo " Accessibility .......... $CFG_ACCESSIBILITY"
echo " ALSA ................... $CFG_ALSA"
echo " CUPS ................... $CFG_CUPS"
report_support " Accessibility .........." "$CFG_ACCESSIBILITY"
report_support " ALSA ..................." "$CFG_ALSA"
report_support " CUPS ..................." "$CFG_CUPS"
[ "$XPLATFORM_MINGW" = "yes" ] && \
echo " DirectWrite ............ $CFG_DIRECTWRITE"
echo " FontConfig ............. $CFG_FONTCONFIG"
echo " Iconv .................. $CFG_ICONV"
echo " ICU .................... $CFG_ICU"
echo " Image formats:"
echo " GIF .................. $CFG_GIF"
if [ "$CFG_JPEG" = "no" ]; then
echo " JPEG ................. $CFG_JPEG"
else
echo " JPEG ................. $CFG_JPEG ($CFG_LIBJPEG)"
fi
if [ "$CFG_PNG" = "no" ]; then
echo " PNG .................. $CFG_PNG"
else
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:"
report_support " DirectWrite ............" "$CFG_DIRECTWRITE"
report_support " FontConfig ............." "$CFG_FONTCONFIG"
report_support " Iconv .................." "$CFG_ICONV"
report_support " ICU ...................." "$CFG_ICU"
report_support " Image formats:"
report_support_plugin " GIF .................." "$CFG_GIF" system QtGui
report_support_plugin " JPEG ................." "$CFG_JPEG" "$CFG_LIBJPEG" QtGui
report_support_plugin " PNG .................." "$CFG_PNG" "$CFG_LIBPNG" QtGui
report_support " Glib ..................." "$CFG_GLIB"
report_support " GStreamer .............." "$CFG_GSTREAMER"
report_support " GTK theme .............." "$CFG_QGTKSTYLE"
report_support " Large File ............." "$CFG_LARGEFILE"
report_support " libudev ................" "$CFG_LIBUDEV"
report_support " Networking:"
[ "$BUILD_ON_MAC" = "yes" ] && \
echo " CoreWlan ............. $CFG_COREWLAN"
echo " getaddrinfo .......... $CFG_GETADDRINFO"
echo " getifaddrs ........... $CFG_GETIFADDRS"
echo " IPv6 ifname .......... $CFG_IPV6IFNAME"
OPENSSL_LINKAGE=""
if [ "$CFG_OPENSSL" = "yes" ]; then
OPENSSL_LINKAGE="(loading libraries at run-time)"
elif [ "$CFG_OPENSSL" = "linked" ]; then
OPENSSL_LINKAGE="(linked to the libraries)"
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
report_support " CoreWlan ............." "$CFG_COREWLAN"
report_support " getaddrinfo .........." "$CFG_GETADDRINFO"
report_support " getifaddrs ..........." "$CFG_GETIFADDRS"
report_support " IPv6 ifname .........." "$CFG_IPV6IFNAME"
report_support " OpenSSL .............." "$CFG_OPENSSL" yes "loading libraries at run-time" linked "linked to the libraries"
report_support " NIS ...................." "$CFG_NIS"
report_support " OpenGL ................." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.x"
report_support " OpenVG ................." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native"
report_support " PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy"
if [ -n "$PKG_CONFIG" ]; then
echo " pkg-config ............. yes"
report_support " pkg-config ............. yes"
else
echo " pkg-config ............. no"
fi
echo " PulseAudio ............. $CFG_PULSEAUDIO"
echo " QPA backends:"
echo " DirectFB ............. $CFG_DIRECTFB"
echo " EGLFS ................ $CFG_EGLFS"
echo " KMS .................. $CFG_KMS"
echo " LinuxFB .............. $CFG_LINUXFB"
echo " XCB .................. $CFG_XCB"
report_support " pkg-config ............. no"
fi
report_support " PulseAudio ............." "$CFG_PULSEAUDIO"
report_support " QPA backends:"
report_support " DirectFB ............." "$CFG_DIRECTFB"
report_support " EGLFS ................" "$CFG_EGLFS"
report_support " KMS .................." "$CFG_KMS"
report_support " LinuxFB .............." "$CFG_LINUXFB"
report_support " XCB .................." "$CFG_XCB" system "system library" qt "bundled copy"
if [ "$CFG_XCB" != "no" ]; then
echo " MIT-SHM ............ $CFG_MITSHM"
echo " Xcursor ............ $CFG_XCURSOR"
echo " Xfixes ............. $CFG_XFIXES"
echo " Xi ................. $CFG_XINPUT"
echo " Xi2 ................ $CFG_XINPUT2"
echo " Xinerama ........... $CFG_XINERAMA"
echo " Xrandr ............. $CFG_XRANDR"
echo " Xrender ............ $CFG_XRENDER"
echo " XKB ................ $CFG_XKB"
echo " XShape ............. $CFG_XSHAPE"
echo " XSync .............. $CFG_XSYNC"
echo " XVideo ............. $CFG_XVIDEO"
fi
echo " Session management ..... $CFG_SM"
report_support " MIT-SHM ............" "$CFG_MITSHM"
report_support " Xcursor ............" "$CFG_XCURSOR" runtime "loaded at runtime"
report_support " Xfixes ............." "$CFG_XFIXES" runtime "loaded at runtime"
report_support " Xi ................." "$CFG_XINPUT" runtime "loaded at runtime"
report_support " Xi2 ................" "$CFG_XINPUT2" runtime "loaded at runtime"
report_support " Xinerama ..........." "$CFG_XINERAMA" runtime "loaded at runtime"
report_support " Xrandr ............." "$CFG_XRANDR" runtime "loaded at runtime"
report_support " Xrender ............" "$CFG_XRENDER"
report_support " XKB ................" "$CFG_XKB"
report_support " XShape ............." "$CFG_XSHAPE"
report_support " XSync .............." "$CFG_XSYNC"
report_support " XVideo ............." "$CFG_XVIDEO"
fi
report_support " Session management ....." "$CFG_SM"
[ "$XPLATFORM_QNX" = "yes" ] && \
echo " SLOG2 .................. $CFG_SLOG2"
echo " SQL drivers:"
echo " DB2 .................. $CFG_SQL_db2"
echo " InterBase ............ $CFG_SQL_ibase"
echo " MySQL ................ $CFG_SQL_mysql"
echo " OCI .................. $CFG_SQL_oci"
echo " ODBC ................. $CFG_SQL_odbc"
echo " PostgreSQL ........... $CFG_SQL_psql"
echo " SQLite 2 ............. $CFG_SQL_sqlite2"
echo " SQLite ............... $CFG_SQL_sqlite ($CFG_SQLITE)"
echo " TDS .................. $CFG_SQL_tds"
echo " udev ................... $CFG_LIBUDEV"
if [ "$CFG_XKBCOMMON" = "no" ]; then
echo " xkbcommon............... no"
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
report_support " SLOG2 .................." "$CFG_SLOG2"
report_support " SQL drivers:"
report_support " DB2 .................." "$CFG_SQL_db2" plugin "plugin" yes "built into QtSql"
report_support " InterBase ............" "$CFG_SQL_ibase" plugin "plugin" yes "built into QtSql"
report_support " MySQL ................" "$CFG_SQL_mysql" plugin "plugin" yes "built into QtSql"
report_support " OCI .................." "$CFG_SQL_oci" plugin "plugin" yes "built into QtSql"
report_support " ODBC ................." "$CFG_SQL_odbc" plugin "plugin" yes "built into QtSql"
report_support " PostgreSQL ..........." "$CFG_SQL_psql" plugin "plugin" yes "built into QtSql"
report_support " SQLite 2 ............." "$CFG_SQL_sqlite2" plugin "plugin" yes "built into QtSql"
report_support_plugin " SQLite ..............." "$CFG_SQL_sqlite" "$CFG_SQLITE" QtSql
report_support " TDS .................." "$CFG_SQL_tds" plugin "plugin" yes "built into QtSql"
report_support " udev ..................." "$CFG_LIBUDEV"
report_support " xkbcommon .............." "$CFG_XKBCOMMON" system "system library" qt "bundled copy"
report_support " zlib ..................." "$CFG_ZLIB" system "system library" yes "bundled copy"
echo
......
......@@ -55,7 +55,7 @@ if not exist mkspecs (
md mkspecs
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 not exist tools\configure (
......
......@@ -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
*/
/*!
\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
*/
/*!
\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
*/
/*!
\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
*/
/*!
\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
*/
......
......@@ -32,7 +32,7 @@
# manifestmeta.global.names = *
# manifestmeta.global.tags = qt5
manifestmeta.filters = highlighted
manifestmeta.filters = highlighted webkit1 webkit2
manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
"QtQuick/Qt Quick Demo - Photo Surface" \
......@@ -50,3 +50,23 @@ manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \
"QtWidgets/Application Example"
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()
connect(this, SIGNAL(rotationChanged(qreal)), this, SLOT(paint()));
}
void PaintedWindow::resizeEvent(QResizeEvent *)
{
paint();
}
void PaintedWindow::exposeEvent(QExposeEvent *)
{
paint();
if (isExposed())
paint();
}
void PaintedWindow::mousePressEvent(QMouseEvent *)
......
......@@ -74,7 +74,6 @@ private slots:
void rotationDone();
private:
void resizeEvent(QResizeEvent *);
void exposeEvent(QExposeEvent *);
void mousePressEvent(QMouseEvent *);
......
......@@ -78,55 +78,38 @@ static bool createConnection()
query.exec("insert into person values(104, 'Roberto', 'Robitaille')");
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,"
"location varchar(20),"
"country varchar(20),"
"itemtype varchar(20),"
"description varchar(100))");
query.exec("insert into offices "
"values(0, 0, 'Oslo', 'Norway',"
"'Oslo is home to more than 500 000 citizens and has a "
"lot to offer.It has been called \"The city with the big "
"heart\" and this is a nickname we are happy to live up to.')");
query.exec("insert into offices "
"values(1, 1, 'Brisbane', 'Australia',"
"'Brisbane is the capital of Queensland, the Sunshine State, "
"where it is beautiful one day, perfect the next. "
"Brisbane is Australia''s 3rd largest city, being home "
"to almost 2 million people.')");
query.exec("insert into offices "
"values(2, 2, 'Redwood City', 'US',"
"'You find Redwood City in the heart of the Bay Area "
"just north of Silicon Valley. The largest nearby city is "
"San Jose which is the third largest city in California "
"and the 10th largest in the US.')");
query.exec("insert into offices "
"values(3, 3, 'Berlin', 'Germany',"
"'Berlin, the capital of Germany is dynamic, cosmopolitan "
"and creative, allowing for every kind of lifestyle. "
"East meets West in the metropolis at the heart of a "
"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("insert into items "
"values(0, 0, 'Qt',"
"'Qt is a full development framework with tools designed to "
"streamline the creation of stunning applications and "
"amazing user interfaces for desktop, embedded and mobile "
"platforms.')");
query.exec("insert into items "
"values(1, 1, 'Qt Quick',"
"'Qt Quick is a collection of techniques designed to help "
"developers create intuitive, modern-looking, and fluid "
"user interfaces using a CSS & JavaScript like language.')");
query.exec("insert into items "
"values(2, 2, 'Qt Creator',"
"'Qt Creator is a powerful cross-platform integrated "
"development environment (IDE), including UI design tools "
"and on-device debugging.')");
query.exec("insert into items "
"values(3, 3, 'Qt Project',"
"'The Qt Project governs the open source development of Qt, "
"allowing anyone wanting to contribute to join the effort "
"through a meritocratic structure of approvers and "
"maintainers.')");
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;
}
......
examples/sql/doc/images/drilldown-example.png

125 KB | W: 0px | H: 0px

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

51.7 KB | W: 0px | H: 0px

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