Merge branch 'stable' into dev
Conflicts: examples/widgets/painting/shared/shared.pri src/corelib/tools/qharfbuzz_p.h src/corelib/tools/qunicodetools.cpp src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
3
.gitignore
vendored
@ -312,3 +312,6 @@ tests/auto/dbus/qdbusinterface/qmyserver/qmyserver
|
||||
tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal
|
||||
tests/auto/network/bearer/qnetworksession/lackey/lackey
|
||||
tests/auto/widgets/kernel/qapplication/modal/modal
|
||||
|
||||
# Generated static plugin import sources
|
||||
*_plugin_import.cpp
|
||||
|
@ -1 +1,2 @@
|
||||
load(qt_build_config)
|
||||
CONFIG += qt_example_installs
|
||||
|
58
bin/syncqt
@ -87,7 +87,7 @@ my $mkspecsdir = dirname(dirname($0));
|
||||
normalizePath(\$mkspecsdir) if (defined $mkspecsdir);
|
||||
|
||||
# will be defined based on the modules sync.profile
|
||||
our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %modulepris, %explicitheaders, %deprecatedheaders);
|
||||
our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %explicitheaders, %deprecatedheaders);
|
||||
our @qpa_headers = ();
|
||||
|
||||
# global variables (modified by options)
|
||||
@ -291,8 +291,7 @@ sub classNames {
|
||||
foreach my $symbol (@symbols) {
|
||||
$symbol = (join("::", @namespaces) . "::" . $symbol) if (scalar @namespaces);
|
||||
|
||||
if ($symbol =~ /^Q[^:]*$/ # no-namespace, starting with Q
|
||||
|| $symbol =~ /^Phonon::/) { # or in the Phonon namespace
|
||||
if ($symbol =~ /^Q[^:]*$/) { # no-namespace, starting with Q
|
||||
push @ret, $symbol;
|
||||
} elsif (defined($publicclassregexp)) {
|
||||
push @ret, $symbol if ($symbol =~ $publicclassregexp);
|
||||
@ -803,26 +802,14 @@ foreach my $lib (@modules_to_sync) {
|
||||
die "No such module: $lib" unless(defined $modules{$lib});
|
||||
|
||||
#iteration info
|
||||
my $dir = $modules{$lib};
|
||||
my @dirs = split(/;/, $modules{$lib});
|
||||
my $dir = $dirs[0];
|
||||
|
||||
my $project = $dir;
|
||||
$project =~ s,/([^/]+)$,/$1/$1.pro,;
|
||||
my $module_version = fileContents($project);
|
||||
$module_version = $qt_version unless ($module_version =~ s,.*^VERSION[ \t]*=[ \t]*(\S+).*,$1,sm);
|
||||
|
||||
# Backwards compatibility for modules with checked in .pri files.
|
||||
if (defined $modulepris{$lib} and -e "$modulepris{$lib}") {
|
||||
my $content = fileContents($modulepris{$lib});
|
||||
my @version_rows = grep(/QT\..*\.VERSION/, split('\n', $content));
|
||||
if(@version_rows) {
|
||||
# We only pick the first one, since each module need a separate .pri file
|
||||
$module_version = $version_rows[0];
|
||||
chomp $module_version;
|
||||
$module_version =~ s/^\s*QT\..*\.VERSION\s*=\s*([^#]+).*$/$1/;
|
||||
$module_version =~ s/\s+$//;
|
||||
}
|
||||
}
|
||||
|
||||
my $pathtoheaders = "";
|
||||
$pathtoheaders = $moduleheaders{$lib} if ($moduleheaders{$lib});
|
||||
|
||||
@ -883,7 +870,9 @@ foreach my $lib (@modules_to_sync) {
|
||||
}
|
||||
|
||||
#create the new ones
|
||||
foreach my $current_dir (split(/;/, $dir)) {
|
||||
foreach my $current_dir (@dirs) {
|
||||
my $thisprivate = 0;
|
||||
($current_dir =~ s/^\^//) and $thisprivate = 1;
|
||||
my @headers_paths = split(/;/, $pathtoheaders);
|
||||
if (@headers_paths) {
|
||||
@headers_paths = map { "$current_dir/$_" } @headers_paths;
|
||||
@ -919,7 +908,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
if(isQpaHeader($public_header)) {
|
||||
$public_header = 0;
|
||||
$qpa_header = 1;
|
||||
} elsif($allheadersprivate || $public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) {
|
||||
} elsif($allheadersprivate || $thisprivate || $public_header =~ /_p.h$/ || $public_header =~ /_pch.h$/) {
|
||||
$public_header = 0;
|
||||
} else {
|
||||
foreach (@ignore_for_master_contents) {
|
||||
@ -956,11 +945,6 @@ foreach my $lib (@modules_to_sync) {
|
||||
$class_lib_map_contents .= "QT_CLASS_LIB($full_class, $lib, $header_base)\n";
|
||||
$header_copies++ if(syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts));
|
||||
}
|
||||
|
||||
# KDE-Compat headers for Phonon
|
||||
if ($lib eq "phonon") {
|
||||
$header_copies++ if (syncHeader($lib, "$out_basedir/include/phonon_compat/Phonon/$class", "$out_basedir/include/$lib/$header", 0, $ts));
|
||||
}
|
||||
}
|
||||
|
||||
if ($explicitheaders{$lib}{basename($header)}) {
|
||||
@ -980,7 +964,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
if($public_header) {
|
||||
#deal with the install directives
|
||||
if($public_header) {
|
||||
my $pri_install_iheader = fixPaths($iheader, $current_dir);
|
||||
my $pri_install_iheader = fixPaths($iheader, $dir);
|
||||
foreach my $class (@classes) {
|
||||
# Strip namespaces:
|
||||
$class =~ s/^.*:://;
|
||||
@ -988,23 +972,24 @@ foreach my $lib (@modules_to_sync) {
|
||||
# $class =~ s,::,/,g;
|
||||
# }
|
||||
my $class_header = fixPaths("$out_basedir/include/$lib/$class",
|
||||
$current_dir) . " ";
|
||||
$dir) . " ";
|
||||
$pri_install_classes .= $class_header
|
||||
unless($pri_install_classes =~ $class_header);
|
||||
}
|
||||
if ($explicitheaders{$lib}{basename($iheader)}) {
|
||||
my $compat_header = fixPaths("$out_basedir/include/$lib/$explicitheaders{$lib}{basename($iheader)}", $current_dir) . " ";
|
||||
my $compat_header = fixPaths("$out_basedir/include/$lib/$explicitheaders{$lib}{basename($iheader)}",
|
||||
$dir) . " ";
|
||||
$pri_install_files .= $compat_header unless($pri_install_files =~ $compat_header);
|
||||
}
|
||||
$pri_install_files.= "$pri_install_iheader ";;
|
||||
}
|
||||
}
|
||||
elsif ($qpa_header) {
|
||||
my $pri_install_iheader = fixPaths($iheader, $current_dir);
|
||||
my $pri_install_iheader = fixPaths($iheader, $dir);
|
||||
$pri_install_qpafiles.= "$pri_install_iheader ";;
|
||||
}
|
||||
else {
|
||||
my $pri_install_iheader = fixPaths($iheader, $current_dir);
|
||||
my $pri_install_iheader = fixPaths($iheader, $dir);
|
||||
$pri_install_pfiles.= "$pri_install_iheader ";;
|
||||
}
|
||||
}
|
||||
@ -1104,11 +1089,6 @@ foreach my $lib (@modules_to_sync) {
|
||||
$pri_install_files .= fixPaths($vheader, $dir) . " ";
|
||||
$pri_install_classes .= fixPaths($VHeader, $dir) . " ";
|
||||
|
||||
# KDE-Compat master header for Phonon
|
||||
if ($lib eq "phonon") {
|
||||
syncHeader($lib, "$out_basedir/include/phonon_compat/Phonon/Phonon", "$out_basedir/include/phonon/phonon", 0);
|
||||
}
|
||||
|
||||
#handle the headers.pri for each module
|
||||
my $headers_pri_contents = "";
|
||||
$headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n";
|
||||
@ -1156,17 +1136,11 @@ unless($showonly || !$create_uic_class_map) {
|
||||
}
|
||||
|
||||
if($check_includes) {
|
||||
for my $lib (keys(%modules)) {
|
||||
foreach my $lib (@modules_to_sync) {
|
||||
#calc subdirs
|
||||
my @subdirs = listSubdirs($modules{$lib});
|
||||
my @subdirs = listSubdirs(map { s/^\^//; $_ } split(/;/, $modules{$lib}));
|
||||
|
||||
foreach my $subdir (@subdirs) {
|
||||
my $header_skip_qt_module_test = 0;
|
||||
foreach(@ignore_for_qt_module_check) {
|
||||
foreach (split(/;/, $_)) {
|
||||
$header_skip_qt_module_test = 1 if ($subdir =~ /^$_/);
|
||||
}
|
||||
}
|
||||
my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
|
||||
foreach my $header (@headers) {
|
||||
my $header_skip_qt_begin_header_test = 0;
|
||||
|
86
configure
vendored
@ -861,7 +861,6 @@ PLATFORM=$QMAKESPEC
|
||||
QT_CROSS_COMPILE=no
|
||||
OPT_CONFIRM_LICENSE=no
|
||||
OPT_SHADOW=maybe
|
||||
OPT_FAST=auto
|
||||
OPT_VERBOSE=no
|
||||
OPT_HELP=
|
||||
CFG_SILENT=no
|
||||
@ -874,6 +873,7 @@ CFG_FORCE_ASSERTS=no
|
||||
CFG_PCRE=auto
|
||||
QPA_PLATFORM_GUARD=yes
|
||||
CFG_CXX11=auto
|
||||
CFG_DIRECTWRITE=no
|
||||
|
||||
# initalize variables used for installation
|
||||
QT_INSTALL_PREFIX=
|
||||
@ -2014,13 +2014,6 @@ while [ "$#" -gt 0 ]; do
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
fast)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
OPT_FAST="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
rpath)
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_RPATH="$VAL"
|
||||
@ -2116,6 +2109,17 @@ while [ "$#" -gt 0 ]; do
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
directwrite)
|
||||
if [ "$XPLATFORM_MINGW" = "yes" ] ; then
|
||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||
CFG_DIRECTWRITE="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
UNKNOWN_OPT=yes
|
||||
;;
|
||||
@ -2293,14 +2297,6 @@ if [ ! -d "${outpath}/lib/fonts" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$OPT_FAST" = "auto" ]; then
|
||||
if [ '!' -z "$AWK" ] && [ "$CFG_DEV" = "yes" ]; then
|
||||
OPT_FAST=yes
|
||||
else
|
||||
OPT_FAST=no
|
||||
fi
|
||||
fi
|
||||
|
||||
# find a make command
|
||||
if [ -z "$MAKE" ]; then
|
||||
MAKE=
|
||||
@ -3087,12 +3083,6 @@ Configure options:
|
||||
-fully-process ..... Generate Makefiles for the entire Qt tree.
|
||||
-dont-process ...... Do not generate any Makefiles.
|
||||
|
||||
* -no-fast ........... Configure Qt normally by generating Makefiles for all
|
||||
project files.
|
||||
-fast .............. Configure Qt quickly by generating Makefiles only for
|
||||
library and subdirectory targets. All other Makefiles
|
||||
are created as wrappers, which will in turn run qmake.
|
||||
|
||||
-no-largefile ...... Disables large file support.
|
||||
+ -largefile ......... Enables Qt to access files larger than 4 GB.
|
||||
|
||||
@ -5333,7 +5323,6 @@ fi
|
||||
QMAKE_CONFIG="$QMAKE_CONFIG qpa"
|
||||
QT_CONFIG="$QT_CONFIG qpa"
|
||||
QTCONFIG_CONFIG="$QTCONFIG_CONFIG qpa"
|
||||
rm -f "src/.moc/$QMAKE_OUTDIR/allmoc.cpp" # needs remaking if config changes
|
||||
|
||||
if [ "$XPLATFORM_MINGW" != "yes" ]; then
|
||||
# Do not set this here for Windows. Let qmake do it so
|
||||
@ -5469,6 +5458,7 @@ fi
|
||||
[ "$CFG_XCB" != "no" ] && QT_CONFIG="$QT_CONFIG xcb"
|
||||
[ "$CFG_XINPUT2" = "yes" ] && QT_CONFIG="$QT_CONFIG xinput2"
|
||||
[ "$CFG_SYSTEM_PROXIES" = "yes" ] && QT_CONFIG="$QT_CONFIG system-proxies"
|
||||
[ "$CFG_DIRECTWRITE" = "yes" ] && QT_CONFIG="$QT_CONFIG directwrite"
|
||||
|
||||
[ '!' -z "$DEFINES" ] && QMakeVar add DEFINES "$DEFINES"
|
||||
[ '!' -z "$L_FLAGS" ] && QMakeVar add LIBS "$L_FLAGS"
|
||||
@ -6027,6 +6017,11 @@ QT_NAMESPACE = $QT_NAMESPACE
|
||||
|
||||
EOF
|
||||
|
||||
if [ "$CFG_SHARED" = "no" ]; then
|
||||
echo "QT_DEFAULT_QPA_PLUGIN = q$QT_QPA_DEFAULT_PLATFORM" >> "$QTCONFIG.tmp"
|
||||
echo >> "$QTCONFIG.tmp"
|
||||
fi
|
||||
|
||||
if [ -n "$PKG_CONFIG_SYSROOT_DIR" ] || [ -n "$PKG_CONFIG_LIBDIR" ]; then
|
||||
echo "# pkgconfig" >> "$QTCONFIG.tmp"
|
||||
echo "PKG_CONFIG_SYSROOT_DIR = $PKG_CONFIG_SYSROOT_DIR" >> "$QTCONFIG.tmp"
|
||||
@ -6110,7 +6105,7 @@ fi
|
||||
|
||||
# cmdline args
|
||||
cat "$QMAKE_VARS_FILE" >> "$QTMODULE.tmp"
|
||||
rm -f "$QMAKE_VARS_FILE" 2>/dev/null
|
||||
# QMAKE_VARS_FILE will be still needed for a status message.
|
||||
|
||||
# replace qmodule.pri if it differs from the newly created temp file
|
||||
if cmp -s "$QTMODULE.tmp" "$QTMODULE"; then
|
||||
@ -6126,7 +6121,6 @@ fi
|
||||
CACHEFILE="$outpath/.qmake.cache"
|
||||
[ -f "$CACHEFILE.tmp" ] && rm -f "$CACHEFILE.tmp"
|
||||
cat >>"$CACHEFILE.tmp" <<EOF
|
||||
#paths
|
||||
QT_SOURCE_TREE = \$\$quote($relpath)
|
||||
QT_BUILD_TREE = \$\$quote($outpath)
|
||||
EOF
|
||||
@ -6274,6 +6268,10 @@ echo "FontConfig support ..... $CFG_FONTCONFIG"
|
||||
echo "XKB Support ............ $CFG_XKB"
|
||||
echo "GTK theme support ...... $CFG_QGTKSTYLE"
|
||||
|
||||
if [ "$XPLATFORM_MINGW" = "yes" ] ; then
|
||||
echo "DirectWrite support .... $CFG_DIRECTWRITE"
|
||||
fi
|
||||
|
||||
[ "$CFG_SQL_mysql" != "no" ] && echo "MySQL support .......... $CFG_SQL_mysql"
|
||||
[ "$CFG_SQL_psql" != "no" ] && echo "PostgreSQL support ..... $CFG_SQL_psql"
|
||||
[ "$CFG_SQL_odbc" != "no" ] && echo "ODBC support ........... $CFG_SQL_odbc"
|
||||
@ -6340,6 +6338,7 @@ sepath=`echo "$relpath" | sed -e 's/\\./\\\\./g'`
|
||||
PROCS=1
|
||||
EXEC=""
|
||||
|
||||
rm -f "$QMAKE_VARS_FILE" 2>/dev/null
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# build makefiles based on the configuration
|
||||
@ -6354,43 +6353,6 @@ if [ "$CFG_PROCESS" != "no" ]; then
|
||||
else
|
||||
"$outpath/bin/qmake" "$relpath"
|
||||
fi
|
||||
|
||||
if [ "$OPT_FAST" = "yes" ]; then
|
||||
PART_ROOTS=
|
||||
for part in $CFG_BUILD_PARTS; do
|
||||
case "$part" in
|
||||
examples|tests) PART_ROOTS="$PART_ROOTS $part" ;;
|
||||
esac
|
||||
done
|
||||
if [ "x$PART_ROOTS" != "x" ]; then
|
||||
echo
|
||||
echo "Creating stub makefiles. Please wait..."
|
||||
QMAKE="$outpath/bin/qmake"
|
||||
[ "$CFG_DEBUG_RELEASE" = "no" ] && first_tgt="first_target: first" || first_tgt=
|
||||
(cd "$relpath" && find $PART_ROOTS -name '*.pro') | grep -v /testdata/ | while read p; do
|
||||
d=${p%/*}
|
||||
test -f "$outpath/$d/Makefile" && continue
|
||||
echo " for $relpath/$p"
|
||||
|
||||
mkdir -p "$outpath/$d" || exit
|
||||
cat > "$outpath/$d/Makefile" <<EOF || exit
|
||||
# $outpath/$d/Makefile: generated by configure
|
||||
#
|
||||
# WARNING: This makefile will be replaced with a real makefile.
|
||||
# All changes made to this file will be lost.
|
||||
|
||||
QMAKE = "$QMAKE"
|
||||
|
||||
$first_tgt
|
||||
all clean install qmake first Makefile: FORCE
|
||||
\$(QMAKE) $QMAKE_SWITCHES "$relpath/$p"
|
||||
\$(MAKE) \$@
|
||||
FORCE:
|
||||
EOF
|
||||
done || exit
|
||||
echo "Done"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
9
dist/README
vendored
@ -91,10 +91,6 @@ Running Example Applications
|
||||
You can open example applications in the Qt Creator Welcome mode to build and
|
||||
run them.
|
||||
|
||||
Ready to run example applications are located in
|
||||
<install_dir>/<version>/<compiler>/examples. You can launch the C++ based
|
||||
examples directly either from command line or your file system browser.
|
||||
|
||||
The QML based Quick 2 examples are located in
|
||||
<install_dir>/<version>/<compiler>/examples/qtdeclarative. You can load them
|
||||
using the qmlscene application.
|
||||
@ -156,3 +152,8 @@ Much more information is available at:
|
||||
We hope you will enjoy using Qt!
|
||||
|
||||
- The Qt developers @ qt-project.org
|
||||
|
||||
|
||||
|
||||
In memory of Trond Kjernåsen.
|
||||
You will not be forgotten.
|
204
dist/changes-5.0.0
vendored
@ -11,6 +11,14 @@ information about a particular change.
|
||||
* Source incompatible changes *
|
||||
****************************************************************************
|
||||
|
||||
- The Qt 3 support module and all related code was removed.
|
||||
|
||||
- QAtomicInt's and QAtomicPointer's non-atomic convenience methods
|
||||
(i.e., operator=, operator int / operator T*, operator!, operator==,
|
||||
operator!= and operator->) have been removed as they did implicit
|
||||
loads and stores of unspecified memory ordering. Code dealing with
|
||||
is expected to use load(), loadAquire(), store() and storeRelease()
|
||||
as necessary instead.
|
||||
|
||||
- QObject
|
||||
* The signatures of the connectNotify() and disconnectNotify() functions
|
||||
@ -60,6 +68,8 @@ information about a particular change.
|
||||
in Qt4, so these methods return a bool now. If your code used the undocumented
|
||||
QBool, simply replace it with bool.
|
||||
|
||||
- The old macros TRUE and FALSE have been removed, use true and false instead.
|
||||
|
||||
- qIsDetached<> has been removed without replacement.
|
||||
|
||||
- The return type of QFlags<Enum>::operator int() now matches the Enum's underlying
|
||||
@ -274,23 +284,6 @@ information about a particular change.
|
||||
- QIconEngineV2 was merged into QIconEngine
|
||||
You might need to adjust your code if it used a QIconEngine.
|
||||
|
||||
- qmake
|
||||
* Projects which explicitly set an empty TARGET are considered broken now.
|
||||
* The makespec and .qmake.cache do not see build pass specific variables any more.
|
||||
* load()/include() with a target namespace and infile()/$$fromfile() now start with
|
||||
an entirely pristine context.
|
||||
* Configure's -sysroot and -hostprefix are now handled slightly differently.
|
||||
The QT_INSTALL_... properties are now automatically prefixed with the sysroot;
|
||||
the raw values are available as QT_INSTALL_.../raw and the sysroot as QT_SYSROOT.
|
||||
The new QT_HOST_... properties can be used to refer to the Qt host tools.
|
||||
* Several functions and built-in variables were modified to return normalized paths.
|
||||
* The -(no-)exception flags in configure have been removed. Qt modules are now compiled
|
||||
without exceptions by default, as they do not use them and can neither handle them
|
||||
properly. Qt Core still has exceptions enabled to correctly throw bad_alloc exceptions
|
||||
in our tool classes.
|
||||
Whether code should be compiled with exception support enabled or disabled can be
|
||||
controlled by a CONFIG += exceptions/exceptions_off setting in the .pro file.
|
||||
|
||||
- QTextCodecPlugin has been removed since it is no longer used. All text codecs
|
||||
are now built into QtCore.
|
||||
|
||||
@ -838,6 +831,18 @@ appended in parantheses.
|
||||
* Platform Specific Changes *
|
||||
****************************************************************************
|
||||
|
||||
The Qt platform implementations have been rewritten as plugins for the Qt
|
||||
Platform Abstraction (QPA):
|
||||
|
||||
* The platform plugin(s) needs to be bundled when applications are deployed.
|
||||
* The platform implementations are in large parts rewrites.
|
||||
* Q_WS_* defines are no longer defined. Q_OS_* is.
|
||||
* Some platform specific functionality and API is missing from the 5.0
|
||||
release and will be added later.
|
||||
* Platform spesific functionality will be added in separate modules:
|
||||
QtMacExtras: http://qt.gitorious.org/qtplayground/qtmacextras
|
||||
|
||||
|
||||
Qt for Linux/X11
|
||||
----------------
|
||||
|
||||
@ -849,6 +854,35 @@ Qt for Windows
|
||||
|
||||
Qt for Mac OS X
|
||||
---------------
|
||||
* Qt now uses Cocoa, the Carbon port has been removed.
|
||||
* The minimum supported OS X version is 10.6. PPC is not supported.
|
||||
* Qt generally supports cross OS X version build and deployment (build
|
||||
on any supported version and deploy to any other). One exception is
|
||||
QtWebkit, which should be built using the 10.6 SDK if you want to target
|
||||
that platform.
|
||||
* The Qt binary installer has been changed to use the Qt installer framework.
|
||||
Qt is now installed into one location instead of being spread out over multiple
|
||||
directories.
|
||||
* The Qt binary installer is built against the 10.7 SDK and does not
|
||||
run on 10.6.
|
||||
* The Clang compiler is used by default. Gcc is available trough the
|
||||
macx-g++* mkspecs.
|
||||
* Build-system support for universal binaries has been removed. The "lipo"
|
||||
command-line tool can be used as a workaround.
|
||||
* Qt now use the raster paint engine on all platforms for drawing widgets.
|
||||
CoreGraphics is still used for printing on Mac.
|
||||
* Support for high-dpi "retina" displays has been added for widgets,
|
||||
OpenGL and QtQuick.
|
||||
* The unified toolbar implementation from Qt 4 has not and will not be ported
|
||||
to Qt 5. This means calling QMainWindow::setUnifiedTitleAndToolBarOnMac has
|
||||
no effect on Qt 5. A replacement API which wraps NSToolbar is available in
|
||||
QtMacExtras.
|
||||
* MacDeployQt plugin deployment has been improved. It will no longer try to
|
||||
deploy all plugins with all dependencies.
|
||||
* Qt has been updated to be in compliance with the Mac App Store sandbox, and
|
||||
will for example no longer try to write settings to files outside the sandbox.
|
||||
* The "qt_menu.nib" issue preventing static/non-framework builds from working
|
||||
has been fixed.
|
||||
|
||||
|
||||
Qt for Embedded Linux
|
||||
@ -870,9 +904,66 @@ Qt for Windows CE
|
||||
|
||||
- Build System
|
||||
|
||||
* Remove qttest_p4.prf file. From now on we should explicitly enable the
|
||||
things from it which we want. Autotest .pro files should stop using
|
||||
'load(qttest_p4)' and start using 'CONFIG+=testcase' instead.
|
||||
* Qt has been split into numerous repositories. Configure covers mostly only qtbase's options.
|
||||
* Qt will now install CMake configuration files for all its libraries.
|
||||
|
||||
- configure
|
||||
|
||||
* The Mac OS X -dwarf2 configure argument has been removed. DWARF2 is always
|
||||
used on Mac OS X now.
|
||||
* The following options have been added: (-no)-force-asserts, (-no)-strip, (-no)-gui &
|
||||
(-no)-widgets, -device & -device-option, -archdatadir, -libexecdir & -qmldir,
|
||||
and numerous changes relating to specific Qt features and dependencies.
|
||||
* Configure will no longer call "qmake -recursive" by default, as the subsequent
|
||||
build invokes qmake as needed. Use -fully-process to restore the old behavior.
|
||||
|
||||
- qmake
|
||||
|
||||
* default_pre.prf is now evaluated per subproject & build pass, symmetrically
|
||||
to default_post.prf.
|
||||
* .qmake.conf files (.qmake.cache equivalent in source tree) are read now.
|
||||
* Project-specific mkspecs/ and features/ directories are supported now.
|
||||
QMAKEPATH and QMAKEFEATURES can be set in .qmake.{config,cache} to specifiy their
|
||||
location, and qmake will find them in the project's top-level directory automatically.
|
||||
* Mixing host and target subprojects is now supported. "default-host" makespec
|
||||
was added; option(host_build) enables its use.
|
||||
* QMAKE_MOC_OPTIONS variable is now available for passing additional parameters
|
||||
to the moc.
|
||||
* The CROSS_COMPILE variable and property can be used to parametrize the device
|
||||
and mingw makespecs.
|
||||
* QMAKE_RPATHLINKDIR (complementary to QMAKE_RPATHDIR) is now understood.
|
||||
* The "aux" TEMPLATE was added. Does not work with vcproj and xcode output files.
|
||||
* The properties QT_INSTALL_ARCHDATA, QT_INSTALL_LIBEXECS, QT_INSTALL_QML,
|
||||
QMAKE_SPEC & QMAKE_XSPEC were added. QT_INSTALL_DEMOS is obsolete.
|
||||
* The following functions have been added: $$sort_depends, $$resolve_depends,
|
||||
$$enumerate_vars, $$reverse, $$val_escape, $$format_number, $$shadowed,
|
||||
$$clean_path, $$system_path, $$shell_path, $$absolute_path, $$relative_path,
|
||||
$$system_quote, $$shell_quote, cache, write_file, touch, mkpath & log.
|
||||
defined can now query variables; $$cat and $$system support more splitting modes.
|
||||
qtCompileTest (available from configure.prf) was added.
|
||||
* Removed qttest_p4.prf. Use CONFIG+=testcase and other flags instead.
|
||||
* QMAKE_SUBSTITUTES can now copy files verbatim.
|
||||
* MSVC desktop builds now use -Zc:wchar_t.
|
||||
* The following variables were added: QMAKESPEC, _QMAKE_CONF_ & _QMAKE_SUPER_CACHE_.
|
||||
* QDBUSXML2CPP_{INTERFACES,ADAPTORS}_{HEADER,SOURCE}_FLAGS are now understood,
|
||||
and DBUS_{INTERFACES,ADAPTORS} support file groups with individual flags now.
|
||||
* QT_PRIVATE and PKGCONFIG_PRIVATE (analogous to LIBS_PRIVATE resp. PKGCONFIG) are now understood.
|
||||
* INSTALLS entries now support copying with subdirectory (e.g., entry.base = $$dirname(PWD)).
|
||||
* Defining QTPLUGIN in dynamically linked projects does not hurt any more.
|
||||
* CONFIG+=import_plugins will now cause plugin imports for QTPLUGIN being auto-generated.
|
||||
* Debug info generation can now be enabled also for release builds (CONFIG+=force_debug_info).
|
||||
* The following CONFIG flags have been deprecated in favor of QT module entries:
|
||||
qtestlib, qdbus, help, designer, uitools, qaxserver & qaxcontainer (the leading 'q'
|
||||
was stripped from the affected modules).
|
||||
* The IN_PWD alias for PWD was deprecated.
|
||||
* QMAKE_{DIST,}CLEAN support normalized path separators now.
|
||||
* CONFIG+=depend_includepath is on by default now. DEPENDPATH is unnecessary in most projects.
|
||||
* Makespecs should be adjusted in the following ways:
|
||||
* The QMAKE_INCDIR_QT, QMAKE_LIBDIR_QT, QMAKE_MOC, QMAKE_UIC, QMAKE_IDC, TEMPLATE & QT
|
||||
variables should not be defined any more. Furthermore, QMAKE_LIBS_X11SM is obsolete.
|
||||
* The qt, warn_on, release, & link_prl CONFIG flags should not be set any more.
|
||||
* The QMAKE_PLATFORM & QMAKE_COMPILER variables should be defined now.
|
||||
Several other variables should be defined by including files from mkspecs/common/.
|
||||
|
||||
- Assistant
|
||||
|
||||
@ -883,6 +974,11 @@ Qt for Windows CE
|
||||
|
||||
- Linguist
|
||||
|
||||
* The integration with Mac OS' document handling was improved
|
||||
* lupdate can now treat other .ts files as sources
|
||||
* lupdate's CODECFORTR is deprecated and will be removed soon. All source code
|
||||
written with Qt is expected to use UTF-8 encoding.
|
||||
|
||||
- rcc
|
||||
|
||||
|
||||
@ -895,20 +991,6 @@ Qt for Windows CE
|
||||
- uic
|
||||
|
||||
|
||||
- uic3
|
||||
|
||||
|
||||
- qmake
|
||||
|
||||
* QMAKE_MOC_OPTIONS variable is now available for passing additional parameters
|
||||
to the moc.
|
||||
|
||||
|
||||
- configure
|
||||
|
||||
* The Mac OS X -dwarf2 configure argument has been removed. DWARF2 is always
|
||||
used on Mac OS X now.
|
||||
|
||||
- qtconfig
|
||||
|
||||
|
||||
@ -957,6 +1039,10 @@ Qt for Windows CE
|
||||
in the URL by themselves. Now, it will return "%25", like
|
||||
QUrl::toEncoded().
|
||||
|
||||
- QLibraryInfo
|
||||
|
||||
* location() always returns paths with normalized separators now.
|
||||
|
||||
- QVariant
|
||||
|
||||
* Definition of QVariant::UserType changed. Currently it is the same as
|
||||
@ -977,9 +1063,59 @@ Qt for Windows CE
|
||||
Please, notice that QMetaType::UnknownType has value 0, which previously was
|
||||
reserved for QMetaType::Void.
|
||||
|
||||
- QWidget
|
||||
|
||||
* No need to set the application name in setWindowTitle() anymore, this is done
|
||||
automatically, on Windows and Unix/X11, provided that the (possibly translated)
|
||||
application display name is set with QGuiApplication::setApplicationDisplayName().
|
||||
|
||||
- QMessageBox
|
||||
|
||||
* The static function QMessageBox::question has changed the default argument
|
||||
for buttons. Before the default was to have an Ok button. That is changed
|
||||
to having a yes and a no button.
|
||||
|
||||
- qmake & configure
|
||||
|
||||
* The project file parser has been rewritten from scratch. Invalid syntax will be
|
||||
rejected more aggressively, and interpretation may have changed in some corner cases.
|
||||
* Projects which explicitly set an empty TARGET are considered broken now.
|
||||
* The makespec and .qmake.cache do not see build pass specific variables any more.
|
||||
* load()/include() with a target namespace and infile()/$$fromfile() now start with
|
||||
an entirely pristine context.
|
||||
* Configure's -sysroot and -hostprefix are now handled slightly differently.
|
||||
The QT_INSTALL_... properties are now automatically prefixed with the sysroot;
|
||||
the raw values are available as QT_INSTALL_.../raw and the sysroot as QT_SYSROOT.
|
||||
The new QT_HOST_... properties can be used to refer to the Qt host tools.
|
||||
-no-gcc-sysroot can be used for non-standard sysroot configurations.
|
||||
* The QMAKE_MKSPECS property became unavailable at the command line. Query QT_HOST_DATA instead.
|
||||
* The TEMPLATE_PREFIX variable is gone. Use contains(TEMPLATE, vc.*) instead.
|
||||
* The "default" makespec symlink/directory is gone. Use qmake -query QMAKE_XSPEC instead.
|
||||
* DEPENDPATH does not end up in VPATH any more. Some SOURCES may not be found any more.
|
||||
* Several functions and built-in variables were modified to return normalized paths.
|
||||
* The -(no-)exception flags in configure have been removed. Qt modules are now compiled
|
||||
without exceptions by default, as they do not use them and can neither handle them
|
||||
properly. Qt Core still has exceptions enabled to correctly throw bad_alloc exceptions
|
||||
in our tool classes.
|
||||
Whether code should be compiled with exception support enabled or disabled can be
|
||||
controlled by a CONFIG += exceptions/exceptions_off setting in the .pro file.
|
||||
* The -no/-stl configure options are gone. Qt always uses the STL now.
|
||||
* The -no/-fast configure options are gone.
|
||||
* The -prefix-install configure option is gone. Use -prefix, etc. instead.
|
||||
* The -make option of the Windows configure was renamed to -make-tool.
|
||||
-make now complements -no-make, like in the Unix version.
|
||||
* The object_with_source CONFIG flag was removed. Use object_parallel_to_source instead.
|
||||
* Support for universal binaries on Mac OS has been removed.
|
||||
* The processor architecture handling changed significantly. This affects the -arch & -*-endian
|
||||
configure options, the QT_ARCH qmake variable, and more.
|
||||
* No "make_default" make targets will be generated any more. Use "make_first" instead.
|
||||
* The "qmake" make targets are non-recursive now. Use "qmake_all" to recurse.
|
||||
* load() with paths relative to the current project is not supported any more.
|
||||
Use include() instead.
|
||||
* Persistent qmake properties are not versioned any more. Also, the vendor changed to
|
||||
"QtProject", so old settings are lost.
|
||||
* Support for the Borland toolchain was removed. Numerous obsolete makespecs were culled.
|
||||
* setcepaths.bat is gone. QMake-generated Makefiles are self-contained now.
|
||||
* moc_dir, rcc_dir and some other tool variables are not defined in Qt's .pc files any more;
|
||||
the generic host_bins is defined instead.
|
||||
|
||||
|
115
dist/changes-5.0.1
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
Qt 5.0.1 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.0.0.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
http://qt-project.org/doc/qt-5.0/
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
http://bugreports.qt-project.org/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
|
||||
****************************************************************************
|
||||
* General *
|
||||
****************************************************************************
|
||||
|
||||
General Improvements
|
||||
--------------------
|
||||
|
||||
Third party components
|
||||
----------------------
|
||||
|
||||
Legal
|
||||
-----
|
||||
|
||||
|
||||
****************************************************************************
|
||||
* Library *
|
||||
****************************************************************************
|
||||
|
||||
|
||||
QtCore
|
||||
-----
|
||||
|
||||
QtGui
|
||||
-----
|
||||
|
||||
QtWidgets
|
||||
---------
|
||||
|
||||
QtNetwork
|
||||
---------
|
||||
|
||||
QtDBus
|
||||
------
|
||||
|
||||
QtConcurrent
|
||||
------------
|
||||
|
||||
QtOpenGL
|
||||
--------
|
||||
|
||||
QtScript
|
||||
--------
|
||||
|
||||
QTestLib
|
||||
--------
|
||||
|
||||
QtSql
|
||||
-----
|
||||
|
||||
****************************************************************************
|
||||
* Database Drivers *
|
||||
****************************************************************************
|
||||
|
||||
sqlite
|
||||
------
|
||||
|
||||
postgres
|
||||
--------
|
||||
|
||||
****************************************************************************
|
||||
* Platform Specific Changes *
|
||||
****************************************************************************
|
||||
|
||||
Qt for Linux/X11
|
||||
----------------
|
||||
|
||||
Qt for Windows
|
||||
--------------
|
||||
|
||||
Qt for Mac OS X
|
||||
---------------
|
||||
|
||||
Qt for Embedded Linux
|
||||
---------------------
|
||||
|
||||
Qt for Windows CE
|
||||
-----------------
|
||||
|
||||
|
||||
****************************************************************************
|
||||
* Compiler Specific Changes *
|
||||
****************************************************************************
|
||||
|
||||
|
||||
****************************************************************************
|
||||
* Tools *
|
||||
****************************************************************************
|
||||
|
||||
|
||||
****************************************************************************
|
||||
* Plugins *
|
||||
****************************************************************************
|
||||
|
||||
|
||||
****************************************************************************
|
||||
* Important Behavior Changes *
|
||||
****************************************************************************
|
||||
|
109
doc/README
Normal file
@ -0,0 +1,109 @@
|
||||
Qt 5 Documentation
|
||||
==================
|
||||
|
||||
New in Qt 5.0, each module has its own documentation package. The documentation
|
||||
resides in the module sources as well as the configuration files needed to build
|
||||
the module documentation. The main Qt 5.0 Reference Documentation resides in the
|
||||
qtdoc repository.
|
||||
|
||||
There are two ways to build Qt documentation:
|
||||
* run "make docs" in qt5/ or in the repositories
|
||||
* run the QDoc tool for each module
|
||||
|
||||
|
||||
Running "make docs"
|
||||
===================
|
||||
|
||||
To build the documentation using Makefiles, qtbase needs to be compiled and
|
||||
installed.
|
||||
|
||||
Running qmake will create make targets to build the documentation:
|
||||
* html_docs - builds only the HTML documentation
|
||||
* qch_docs - packages the HTML documentation into QCH files for Qt Creator and
|
||||
Qt Assistant.
|
||||
* docs - runs html_docs and qch_docs
|
||||
|
||||
Note: qch_docs needs qhelpgenerator to package the documentation. qhelpgenerator
|
||||
is in the qttools repository.
|
||||
|
||||
These make targets use qmake's QT_INSTALL_DOCS variable as the output directory.
|
||||
Running "qmake -query" will list the directory set to QT_INSTALL_DOCS.
|
||||
|
||||
To create all of the modules' documentation, run "make docs" in the
|
||||
qt5 directory:
|
||||
$> make docs # builds the bundled modules' documentation
|
||||
|
||||
It is also possible to build only a small subset of the documentation by using
|
||||
make:
|
||||
$> cd qtbase
|
||||
$> make docs # builds the documentation for modules in qtbase
|
||||
|
||||
$> cd qtbase/src/sql
|
||||
$> make docs # builds only the Qt SQL documentation
|
||||
|
||||
|
||||
Running QDoc
|
||||
============
|
||||
|
||||
QDoc is the tool for generating Qt documentation and is located in qtbase.
|
||||
The simplest way to compile QDoc is to compile qtbase or only the tools in
|
||||
qtbase.
|
||||
|
||||
$> cd qtbase/src
|
||||
$> make sub-tools # compiles QDoc
|
||||
|
||||
Each module has a QDoc configuration file (.qdocconf). To build a module's
|
||||
documentation, run the "qdoc" binary and pass the qdocconf file as a parameter.
|
||||
A mandatory "outputdir" must be specified.
|
||||
|
||||
$> qdoc doc/config/qtdoc.qdocconf -outputdir html
|
||||
|
||||
Note that QDoc will delete the contents of the "html" output directory.
|
||||
|
||||
Packaging the Documentation
|
||||
===========================
|
||||
|
||||
To package the documentation, the HTML files must be compiled
|
||||
into a QCH file (.qch).
|
||||
|
||||
Required binaries:
|
||||
* assistant - found in qttools
|
||||
* qhelpgenerator - found in qttools
|
||||
|
||||
To compile the qch file for each module, first enter the output directory that
|
||||
contains the .qhp file and generate the QCH file.
|
||||
|
||||
$> cd qtbase/doc/qtdoc #the default path for QT_INSTALL_DOCS for qtdoc
|
||||
$> qhelpgenerator qtdoc.qhp #creates the QCH file called qtdoc.qch
|
||||
|
||||
The QCH file can then be loaded in Qt Assistant or Qt Creator. For Qt Assistant,
|
||||
the QCH file can be registered to automatically load it.
|
||||
|
||||
$> assistant -register qtdoc.qch #to automatically load the documentation
|
||||
|
||||
|
||||
Global Files
|
||||
============
|
||||
|
||||
The qtbase/doc/global directory contains various files used by the modules to
|
||||
build the documentation. These include macros, stylesheets, and images for
|
||||
displaying documentation.
|
||||
|
||||
To include these files in a qdocconf, add the following to a qdocconf file:
|
||||
|
||||
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
|
||||
|
||||
|
||||
Documentation Structure
|
||||
=======================
|
||||
For a typical module, the documentation will reside in the source directory.
|
||||
The examples and the example documentation are in the "examples" directory.
|
||||
|
||||
qtbase/src/sql/doc/src #Qt SQL's documentation
|
||||
qtbase/examples/sql #Qt SQL's examples
|
||||
|
||||
More Information
|
||||
================
|
||||
|
||||
For more information about Qt 5's documentation, refer to the Qt Project wiki:
|
||||
http://qt-project.org/wiki/Qt5DocumentationProject
|
@ -464,7 +464,7 @@
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage ftp://ftp.qt.nokia.com/pub/qt/solutions/lgpl/qtmotifextension-2.7_1-opensource.tar.gz
|
||||
\externalpage ftp://ftp.qt-project.org/pub/qt/solutions/lgpl/qtmotifextension-2.7_1-opensource.tar.gz
|
||||
\title Motif Extension
|
||||
*/
|
||||
|
||||
|
@ -1,6 +1,26 @@
|
||||
HTML.nobreadcrumbs = "true"
|
||||
|
||||
HTML.stylesheets = template/style/offline.css
|
||||
HTML.extraimages += template/images/ico_out.png \
|
||||
template/images/ico_note.png \
|
||||
template/images/ico_note_attention.png \
|
||||
template/images/btn_prev.png \
|
||||
template/images/btn_next.png \
|
||||
template/images/bullet_dn.png \
|
||||
template/images/bullet_sq.png \
|
||||
template/images/bgrContent.png
|
||||
|
||||
#specify which files in the output directory should be packed into the qch file.
|
||||
qhp.extraFiles += style/offline.css \
|
||||
images/ico_out.png \
|
||||
images/ico_note.png \
|
||||
images/ico_note_attention.png \
|
||||
images/btn_prev.png \
|
||||
images/btn_next.png \
|
||||
images/bullet_dn.png \
|
||||
images/bullet_sq.png \
|
||||
images/bgrContent.png
|
||||
|
||||
|
||||
HTML.headerstyles = \
|
||||
" <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline.css\" />\n"
|
||||
|
@ -1,36 +1,14 @@
|
||||
HTML.nobreadcrumbs = "true"
|
||||
|
||||
HTML.stylesheets = template/style/online.css
|
||||
HTML.extraimages = template/images/btn_next_green.png \
|
||||
template/images/box_bg.png \
|
||||
template/images/page.png \
|
||||
template/images/arrow_down.png \
|
||||
template/images/btn_prev.png \
|
||||
template/images/blu_dot.png \
|
||||
template/images/ico_note_attention.png \
|
||||
template/images/btn_prev_green.png \
|
||||
template/images/bg_ll_blank.png \
|
||||
template/images/btn_next.png \
|
||||
template/images/bg_l_blank.png \
|
||||
HTML.extraimages += template/images/ico_out.png \
|
||||
template/images/ico_note.png \
|
||||
template/images/home.png \
|
||||
template/images/ico_out.png \
|
||||
template/images/header_bg.png \
|
||||
template/images/page_bg.png \
|
||||
template/images/bg_l.png \
|
||||
template/images/bg_r.png \
|
||||
template/images/breadcrumb.png \
|
||||
template/images/ico_note_attention.png \
|
||||
template/images/btn_prev.png \
|
||||
template/images/btn_next.png \
|
||||
template/images/bullet_dn.png \
|
||||
template/images/feedbackground.png \
|
||||
template/images/bullet_gt.png \
|
||||
template/images/arrow.png \
|
||||
template/images/bullet_sq.png \
|
||||
template/images/bullet_up.png \
|
||||
template/images/sprites-combined.png \
|
||||
template/images/horBar.png \
|
||||
template/images/bg_ul_blank.png \
|
||||
template/images/bgrContent.png \
|
||||
|
||||
template/images/bgrContent.png
|
||||
|
||||
HTML.headerstyles = \
|
||||
" <link rel=\"stylesheet\" type=\"text/css\" href=\"style/online.css\" />\n"
|
||||
@ -38,7 +16,7 @@ HTML.headerstyles = \
|
||||
HTML.endheader = \
|
||||
"</head>\n" \
|
||||
"<body>\n" \
|
||||
"<div class=\"header\" id=\"qtdocheader\"></div>\n"
|
||||
"<div class=\"header\" id=\"qtdocheader\"></div>\n" \
|
||||
" <header>\n" \
|
||||
" <div class=\"nav\">\n" \
|
||||
" <a href=\"http://qt-project.org/\">Qt Home</a>\n" \
|
||||
|
@ -25,8 +25,5 @@ versionsym = QT_VERSION_STR
|
||||
|
||||
macro.raisedaster.HTML = "<sup>*</sup>"
|
||||
|
||||
#for including files into the qch file
|
||||
qhp.extraFiles += style/offline.css
|
||||
|
||||
#include the external websites
|
||||
sourcedirs += externalsites
|
||||
|
BIN
doc/global/template/images/btn_next.png
Executable file → Normal file
Before Width: | Height: | Size: 689 B After Width: | Height: | Size: 695 B |
Before Width: | Height: | Size: 695 B |
BIN
doc/global/template/images/btn_prev.png
Executable file → Normal file
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 687 B |
Before Width: | Height: | Size: 687 B |
Before Width: | Height: | Size: 362 B After Width: | Height: | Size: 388 B |
@ -8,6 +8,9 @@ margin-left:5px;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 20px;
|
||||
}
|
||||
img{
|
||||
-moz-box-shadow: 3px 3px 3px #ccc;
|
||||
-webkit-box-shadow: 3px 3px 3px #ccc;
|
||||
@ -63,6 +66,16 @@ color: #44a51c;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
a[href*="http://"], a[href*="ftp://"],a[href*="https://"]
|
||||
{
|
||||
text-decoration: none;
|
||||
background-image:url(../images/ico_out.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:left;
|
||||
padding-left:20px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
.flags{
|
||||
text-decoration:none;
|
||||
text-height:24px;
|
||||
@ -155,71 +168,6 @@ height:20px;
|
||||
margin-left:30px;
|
||||
}
|
||||
|
||||
.breadcrumb{
|
||||
display: block;
|
||||
position: relative;
|
||||
top:-20px;
|
||||
/*border-top:2px solid #ffffff;*/
|
||||
border-bottom: 1px solid #cecece;
|
||||
background-color:#F2F2F2;
|
||||
z-index:1;
|
||||
height:20px;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
padding-left:10px;
|
||||
padding-top:2px;
|
||||
margin-left:-5px;
|
||||
margin-right:-5px;
|
||||
}
|
||||
|
||||
.breadcrumb ul{
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
|
||||
.breadcrumb ul li{
|
||||
background-color:#F2F2F2;
|
||||
list-style-type:none;
|
||||
padding:0;
|
||||
margin:0;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
.breadcrumb li{
|
||||
float:left;
|
||||
}
|
||||
|
||||
.breadcrumb .first {
|
||||
background:url(../images/home.png);
|
||||
background-position:left;
|
||||
background-repeat:no-repeat;
|
||||
padding-left:20px;
|
||||
}
|
||||
|
||||
|
||||
.breadcrumb li a{
|
||||
color:#2C418D;
|
||||
display:block;
|
||||
text-decoration:none;
|
||||
background:url(../images/arrow.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:right;
|
||||
padding-right:25px;
|
||||
padding-left:10px;
|
||||
}
|
||||
|
||||
.breadcrumb li a:hover{
|
||||
color:#909090;
|
||||
display:block;
|
||||
text-decoration:none;
|
||||
background:url(../images/arrow.png);
|
||||
background-repeat:no-repeat;
|
||||
background-position:right;
|
||||
padding-right:20px;
|
||||
padding-left:10px;
|
||||
}
|
||||
|
||||
|
||||
/* table of content
|
||||
no display
|
||||
*/
|
||||
@ -483,7 +431,7 @@ margin: 10;
|
||||
overflow: hidden;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
padding: 20px 0 20px 0;
|
||||
padding: 20px 20px 20px 20px;
|
||||
}
|
||||
|
||||
.qmldefault{
|
||||
@ -566,8 +514,7 @@ padding-right:5px;
|
||||
|
||||
.toc ul li{
|
||||
margin-left:15px;
|
||||
list-style-image:url(../images/blu_dot.png);
|
||||
list-style:outside;
|
||||
list-style-image:url(../images/bullet_dn.png);
|
||||
marker-offset: 0px;
|
||||
margin-bottom:8px;
|
||||
padding-left:0px;
|
||||
@ -643,7 +590,7 @@ margin-bottom: 20px;
|
||||
|
||||
.indexboxcont .sectionlist ul li
|
||||
{
|
||||
line-height: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.content .indexboxcont li
|
||||
|
@ -8,6 +8,9 @@ margin-right:5px;
|
||||
background: none repeat scroll 0% 0% rgb(230,231,232);
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 20px;
|
||||
}
|
||||
img{
|
||||
-moz-box-shadow: 3px 3px 3px #ccc;
|
||||
-webkit-box-shadow: 3px 3px 3px #ccc;
|
||||
@ -540,7 +543,7 @@ margin: 10;
|
||||
overflow: hidden;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
padding: 20px 0 20px 0;
|
||||
padding: 20px 20px 20px 20px;
|
||||
}
|
||||
|
||||
.qmldefault{
|
||||
@ -701,7 +704,7 @@ margin-bottom: 20px;
|
||||
|
||||
.indexboxcont .sectionlist ul li
|
||||
{
|
||||
line-height: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.content .indexboxcont li
|
||||
|
@ -1,223 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example linguist/arrowpad
|
||||
\title Arrow Pad Example
|
||||
|
||||
This example is a slightly more involved and introduces a key \e
|
||||
{Qt Linguist} concept: "contexts". It also shows how to use two
|
||||
or more languages.
|
||||
|
||||
\image linguist-arrowpad_en.png
|
||||
|
||||
We will use two translations, French and Dutch, although there is no
|
||||
effective limit on the number of possible translations that can be used
|
||||
with an application. The relevant lines of \c arrowpad.pro are
|
||||
|
||||
\snippet examples/linguist/arrowpad/arrowpad.pro 0
|
||||
\codeline
|
||||
\snippet examples/linguist/arrowpad/arrowpad.pro 1
|
||||
|
||||
Run \c lupdate; it should produce two identical message files
|
||||
\c arrowpad_fr.ts and \c arrowpad_nl.ts. These files will contain all the source
|
||||
texts marked for translation with \c tr() calls and their contexts.
|
||||
|
||||
See the \l{Qt Linguist manual} for more information about
|
||||
translating Qt application.
|
||||
|
||||
\section1 Line by Line Walkthrough
|
||||
|
||||
In \c arrowpad.h we define the \c ArrowPad subclass which is a
|
||||
subclass of QWidget. In the screenshot above, the central
|
||||
widget with the four buttons is an \c ArrowPad.
|
||||
|
||||
\snippet examples/linguist/arrowpad/arrowpad.h 0
|
||||
\snippet examples/linguist/arrowpad/arrowpad.h 1
|
||||
\snippet examples/linguist/arrowpad/arrowpad.h 2
|
||||
|
||||
When \c lupdate is run it not only extracts the source texts but it
|
||||
also groups them into contexts. A context is the name of the class in
|
||||
which the source text appears. Thus, in this example, "ArrowPad" is a
|
||||
context: it is the context of the texts in the \c ArrowPad class.
|
||||
The \c Q_OBJECT macro defines \c tr(x) in \c ArrowPad like this:
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_arrowpad.cpp 0
|
||||
|
||||
Knowing which class each source text appears in enables \e {Qt
|
||||
Linguist} to group texts that are logically related together, e.g.
|
||||
all the text in a dialog will have the context of the dialog's class
|
||||
name and will be shown together. This provides useful information for
|
||||
the translator since the context in which text appears may influence how
|
||||
it should be translated. For some translations keyboard
|
||||
accelerators may need to be changed and having all the source texts in a
|
||||
particular context (class) grouped together makes it easier for the
|
||||
translator to perform any accelerator changes without introducing
|
||||
conflicts.
|
||||
|
||||
In \c arrowpad.cpp we implement the \c ArrowPad class.
|
||||
|
||||
\snippet examples/linguist/arrowpad/arrowpad.cpp 0
|
||||
\snippet examples/linguist/arrowpad/arrowpad.cpp 1
|
||||
\snippet examples/linguist/arrowpad/arrowpad.cpp 2
|
||||
\snippet examples/linguist/arrowpad/arrowpad.cpp 3
|
||||
|
||||
We call \c ArrowPad::tr() for each button's label since the labels are
|
||||
user-visible text.
|
||||
|
||||
\image linguist-arrowpad_en.png
|
||||
|
||||
\snippet examples/linguist/arrowpad/mainwindow.h 0
|
||||
\snippet examples/linguist/arrowpad/mainwindow.h 1
|
||||
|
||||
In the screenshot above, the whole window is a \c MainWindow.
|
||||
This is defined in the \c mainwindow.h header file. Here too, we
|
||||
use \c Q_OBJECT, so that \c MainWindow will become a context in
|
||||
\e {Qt Linguist}.
|
||||
|
||||
\snippet examples/linguist/arrowpad/mainwindow.cpp 0
|
||||
|
||||
In the implementation of \c MainWindow, \c mainwindow.cpp, we create
|
||||
an instance of our \c ArrowPad class.
|
||||
|
||||
\snippet examples/linguist/arrowpad/mainwindow.cpp 1
|
||||
|
||||
We also call \c MainWindow::tr() twice, once for the action and
|
||||
once for the shortcut.
|
||||
|
||||
Note the use of \c tr() to support different keys in other
|
||||
languages. "Ctrl+Q" is a good choice for Quit in English, but a
|
||||
Dutch translator might want to use "Ctrl+A" (for Afsluiten) and a
|
||||
German translator "Strg+E" (for Beenden). When using \c tr() for
|
||||
\uicontrol Ctrl key accelerators, the two argument form should be used
|
||||
with the second argument describing the function that the
|
||||
accelerator performs.
|
||||
|
||||
Our \c main() function is defined in \c main.cpp as usual.
|
||||
|
||||
\snippet examples/linguist/arrowpad/main.cpp 2
|
||||
\snippet examples/linguist/arrowpad/main.cpp 3
|
||||
|
||||
We choose which translation to use according to the current locale.
|
||||
QLocale::system() can be influenced by setting the \c LANG
|
||||
environment variable, for example. Notice that the use of a naming
|
||||
convention that incorporates the locale for \c .qm message files,
|
||||
(and TS files), makes it easy to implement choosing the
|
||||
translation file according to locale.
|
||||
|
||||
If there is no QM message file for the locale chosen the original
|
||||
source text will be used and no error raised.
|
||||
|
||||
\section1 Translating to French and Dutch
|
||||
|
||||
We'll begin by translating the example application into French. Start
|
||||
\e {Qt Linguist} with \c arrowpad_fr.ts. You should get the seven source
|
||||
texts ("\&Up", "\&Left", etc.) grouped in two contexts ("ArrowPad"
|
||||
and "MainWindow").
|
||||
|
||||
Now, enter the following translations:
|
||||
|
||||
\list
|
||||
\li \c ArrowPad
|
||||
\list
|
||||
\li \&Up - \&Haut
|
||||
\li \&Left - \&Gauche
|
||||
\li \&Right - \&Droite
|
||||
\li \&Down - \&Bas
|
||||
\endlist
|
||||
\li \c MainWindow
|
||||
\list
|
||||
\li E\&xit - \&Quitter
|
||||
\li Ctrl+Q - Ctrl+Q
|
||||
\li \&File - \&Fichier
|
||||
\endlist
|
||||
\endlist
|
||||
|
||||
It's quickest to press \uicontrol{Alt+D} (which clicks the \uicontrol {Done \& Next}
|
||||
button) after typing each translation, since this marks the
|
||||
translation as done and moves on to the next source text.
|
||||
|
||||
Save the file and do the same for Dutch working with \c arrowpad_nl.ts:
|
||||
|
||||
\list
|
||||
\li \c ArrowPad
|
||||
\list
|
||||
\li \&Up - \&Omhoog
|
||||
\li \&Left - \&Links
|
||||
\li \&Right - \&Rechts
|
||||
\li \&Down - Omlaa\&g
|
||||
\endlist
|
||||
\li \c MainWindow
|
||||
\list
|
||||
\li E\&xit - \&Afsluiten
|
||||
\li Ctrl+Q - Ctrl+A
|
||||
\li File - \&Bestand
|
||||
\endlist
|
||||
\endlist
|
||||
|
||||
We have to convert the \c tt1_fr.ts and \c tt1_nl.ts translation source
|
||||
files into QM files. We could use \e {Qt Linguist} as we've done
|
||||
before; however using the command line tool \c lrelease ensures that
|
||||
\e all the QM files for the application are created without us
|
||||
having to remember to load and \uicontrol File|Release each one
|
||||
individually from \e {Qt Linguist}.
|
||||
|
||||
Type
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 1
|
||||
|
||||
This should create both \c arrowpad_fr.qm and \c arrowpad_nl.qm. Set the \c
|
||||
LANG environment variable to \c fr. In Unix, one of the two following
|
||||
commands should work
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 2
|
||||
|
||||
In Windows, either modify \c autoexec.bat or run
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_arrowpad.qdoc 3
|
||||
|
||||
When you run the program, you should now see the French version:
|
||||
|
||||
\image linguist-arrowpad_fr.png
|
||||
|
||||
Try the same with Dutch, by setting \c LANG=nl. Now the Dutch
|
||||
version should appear:
|
||||
|
||||
\image linguist-arrowpad_nl.png
|
||||
|
||||
\section1 Exercises
|
||||
|
||||
Mark one of the translations in \e {Qt Linguist} as not done, i.e.
|
||||
by unchecking the "done" checkbox; run \c lupdate, then \c lrelease,
|
||||
then the example. What effect did this change have?
|
||||
|
||||
Set \c LANG=fr_CA (French Canada) and run the example program again.
|
||||
Explain why the result is the same as with \c LANG=fr.
|
||||
|
||||
Change one of the accelerators in the Dutch translation to eliminate the
|
||||
conflict between \e \&Bestand and \e \&Boven.
|
||||
*/
|
@ -1,174 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example linguist/hellotr
|
||||
\title Hello tr() Example
|
||||
|
||||
This example is a small Hello World program with a Latin translation. The
|
||||
screenshot below shows the English version.
|
||||
|
||||
\image linguist-hellotr_en.png
|
||||
|
||||
See the \l{Qt Linguist manual} for more information about
|
||||
translating Qt application.
|
||||
|
||||
\section1 Line by Line Walkthrough
|
||||
|
||||
|
||||
\snippet examples/linguist/hellotr/main.cpp 0
|
||||
|
||||
This line includes the definition of the QTranslator class.
|
||||
Objects of this class provide translations for user-visible text.
|
||||
|
||||
\snippet examples/linguist/hellotr/main.cpp 5
|
||||
|
||||
Creates a QTranslator object without a parent.
|
||||
|
||||
\snippet examples/linguist/hellotr/main.cpp 6
|
||||
|
||||
Tries to load a file called \c hellotr_la.qm (the \c .qm file extension is
|
||||
implicit) that contains Latin translations for the source texts used in
|
||||
the program. No error will occur if the file is not found.
|
||||
|
||||
\snippet examples/linguist/hellotr/main.cpp 7
|
||||
|
||||
Adds the translations from \c hellotr_la.qm to the pool of translations used
|
||||
by the program.
|
||||
|
||||
\snippet examples/linguist/hellotr/main.cpp 8
|
||||
|
||||
Creates a push button that displays "Hello world!". If \c hellotr_la.qm
|
||||
was found and contains a translation for "Hello world!", the
|
||||
translation appears; if not, the source text appears.
|
||||
|
||||
All classes that inherit QObject have a \c tr() function. Inside
|
||||
a member function of a QObject class, we simply write \c tr("Hello
|
||||
world!") instead of \c QPushButton::tr("Hello world!") or \c
|
||||
QObject::tr("Hello world!").
|
||||
|
||||
\section1 Running the Application in English
|
||||
|
||||
Since we haven't made the translation file \c hellotr_la.qm, the source text
|
||||
is shown when we run the application:
|
||||
|
||||
\image linguist-hellotr_en.png
|
||||
|
||||
\section1 Creating a Latin Message File
|
||||
|
||||
The first step is to create a project file, \c hellotr.pro, that lists
|
||||
all the source files for the project. The project file can be a qmake
|
||||
project file, or even an ordinary makefile. Any file that contains
|
||||
|
||||
\snippet examples/linguist/hellotr/hellotr.pro 0
|
||||
\snippet examples/linguist/hellotr/hellotr.pro 1
|
||||
|
||||
will work. \c TRANSLATIONS specifies the message files we want to
|
||||
maintain. In this example, we just maintain one set of translations,
|
||||
namely Latin.
|
||||
|
||||
Note that the file extension is \c .ts, not \c .qm. The \c .ts
|
||||
translation source format is designed for use during the
|
||||
application's development. Programmers or release managers run
|
||||
the \c lupdate program to generate and update TS files with
|
||||
the source text that is extracted from the source code.
|
||||
Translators read and update the TS files using \e {Qt
|
||||
Linguist} adding and editing their translations.
|
||||
|
||||
The TS format is human-readable XML that can be emailed directly
|
||||
and is easy to put under version control. If you edit this file
|
||||
manually, be aware that the default encoding for XML is UTF-8, not
|
||||
Latin1 (ISO 8859-1). One way to type in a Latin1 character such as
|
||||
'\oslash' (Norwegian o with slash) is to use an XML entity:
|
||||
"\ø". This will work for any Unicode 4.0 character.
|
||||
|
||||
Once the translations are complete the \c lrelease program is used to
|
||||
convert the TS files into the QM Qt message file format. The
|
||||
QM format is a compact binary format designed to deliver very
|
||||
fast lookup performance. Both \c lupdate and \c lrelease read all the
|
||||
project's source and header files (as specified in the HEADERS and
|
||||
SOURCES lines of the project file) and extract the strings that
|
||||
appear in \c tr() function calls.
|
||||
|
||||
\c lupdate is used to create and update the message files (\c hellotr_la.ts
|
||||
in this case) to keep them in sync with the source code. It is safe to
|
||||
run \c lupdate at any time, as \c lupdate does not remove any
|
||||
information. For example, you can put it in the makefile, so the TS
|
||||
files are updated whenever the source changes.
|
||||
|
||||
Try running \c lupdate right now, like this:
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 0
|
||||
|
||||
(The \c -verbose option instructs \c lupdate to display messages that
|
||||
explain what it is doing.) You should now have a file \c hellotr_la.ts in
|
||||
the current directory, containing this:
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 1
|
||||
|
||||
You don't need to understand the file format since it is read and
|
||||
updated using tools (\c lupdate, \e {Qt Linguist}, \c lrelease).
|
||||
|
||||
\section1 Translating to Latin with Qt Linguist
|
||||
|
||||
We will use \e {Qt Linguist} to provide the translation, although
|
||||
you can use any XML or plain text editor to enter a translation into a
|
||||
TS file.
|
||||
|
||||
To start \e {Qt Linguist}, type
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 2
|
||||
|
||||
You should now see the text "QPushButton" in the top left pane.
|
||||
Double-click it, then click on "Hello world!" and enter "Orbis, te
|
||||
saluto!" in the \uicontrol Translation pane (the middle right of the
|
||||
window). Don't forget the exclamation mark!
|
||||
|
||||
Click the \uicontrol Done checkbox and choose \uicontrol File|Save from the
|
||||
menu bar. The TS file will no longer contain
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 3
|
||||
|
||||
but instead will have
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_hellotr.qdoc 4
|
||||
|
||||
\section1 Running the Application in Latin
|
||||
|
||||
To see the application running in Latin, we have to generate a QM
|
||||
file from the TS file. Generating a QM file can be achieved
|
||||
either from within \e {Qt Linguist} (for a single TS file), or
|
||||
by using the command line program \c lrelease which will produce one
|
||||
QM file for each of the TS files listed in the project file.
|
||||
Generate \c hellotr_la.qm from \c hellotr_la.ts by choosing
|
||||
\uicontrol File|Release from \e {Qt Linguist}'s menu bar and pressing
|
||||
\uicontrol Save in the file save dialog that pops up. Now run the \c hellotr
|
||||
program again. This time the button will be labelled "Orbis, te
|
||||
saluto!".
|
||||
|
||||
\image linguist-hellotr_la.png
|
||||
*/
|
@ -1,94 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example uitools/multipleinheritance
|
||||
\title Multiple Inheritance Example
|
||||
|
||||
The Multiple Inheritance Example shows how to use a form created with
|
||||
Qt Designer in an application by subclassing both QWidget and the user
|
||||
interface class, which is \c{Ui::CalculatorForm}.
|
||||
|
||||
\image multipleinheritance-example.png
|
||||
|
||||
To subclass the \c calculatorform.ui file and ensure that \c qmake
|
||||
processes it with the \c uic, we have to include \c calculatorform.ui
|
||||
in the \c .pro file, as shown below:
|
||||
|
||||
\snippet examples/uitools/multipleinheritance/multipleinheritance.pro 0
|
||||
|
||||
When the project is compiled, the \c uic will generate a corresponding
|
||||
\c ui_calculatorform.h.
|
||||
|
||||
\section1 CalculatorForm Definition
|
||||
|
||||
In the \c CalculatorForm definition, we include the \c ui_calculatorform.h
|
||||
that was generated earlier.
|
||||
|
||||
\snippet examples/uitools/multipleinheritance/calculatorform.h 0
|
||||
|
||||
As mentioned earlier, the class is a subclass of both QWidget and
|
||||
\c{Ui::CalculatorForm}.
|
||||
|
||||
\snippet examples/uitools/multipleinheritance/calculatorform.h 1
|
||||
|
||||
Two slots are defined according to the \l{Automatic Connections}
|
||||
{automatic connection} naming convention required by \c uic. This is
|
||||
to ensure that \l{QMetaObject}'s auto-connection facilities connect
|
||||
all the signals and slots involved automatically.
|
||||
|
||||
\section1 CalculatorForm Implementation
|
||||
|
||||
In the constructor, we call \c setupUi() to load the user interface file.
|
||||
Note that we do not need the \c{ui} prefix as \c CalculatorForm is a
|
||||
subclass of the user interface class.
|
||||
|
||||
\snippet examples/uitools/multipleinheritance/calculatorform.cpp 0
|
||||
|
||||
We include two slots, \c{on_inputSpinBox1_valueChanged()} and
|
||||
\c{on_inputSpinBox2_valueChanged()}. These slots respond to the
|
||||
\l{QSpinBox::valueChanged()}{valueChanged()} signal that both spin boxes
|
||||
emit. Whenever there is a change in one spin box's value, we take that
|
||||
value and add it to whatever value the other spin box has.
|
||||
|
||||
\snippet examples/uitools/multipleinheritance/calculatorform.cpp 1
|
||||
\codeline
|
||||
\snippet examples/uitools/multipleinheritance/calculatorform.cpp 2
|
||||
|
||||
\section1 \c main() Function
|
||||
|
||||
The \c main() function instantiates QApplication and \c CalculatorForm.
|
||||
The \c calculator object is displayed by invoking the \l{QWidget::show()}
|
||||
{show()} function.
|
||||
|
||||
\snippet examples/uitools/multipleinheritance/main.cpp 0
|
||||
|
||||
There are various approaches to include forms into applications. The
|
||||
Multiple Inheritance approach is just one of them. See
|
||||
\l{Using a Designer UI File in Your Application} for more information on
|
||||
the other approaches available.
|
||||
*/
|
@ -1,261 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example linguist/trollprint
|
||||
\title Troll Print Example
|
||||
|
||||
Troll Print is an example application that lets the user choose
|
||||
printer settings. It comes in two versions: English and
|
||||
Portuguese.
|
||||
|
||||
\image linguist-trollprint_10_en.png
|
||||
|
||||
We've included a translation file, \c trollprint_pt.ts, which contains some
|
||||
Portuguese translations for this example.
|
||||
|
||||
We will consider two releases of the same application: Troll Print
|
||||
1.0 and 1.1. We will learn to reuse the translations created for one
|
||||
release in a subsequent release. (In this tutorial, you need to edit
|
||||
some source files. It's probably best to copy all the files to a new
|
||||
temporary directory and work from there.)
|
||||
|
||||
See the \l{Qt Linguist manual} for more information about
|
||||
translating Qt application.
|
||||
|
||||
\section1 Line by Line Walkthrough
|
||||
|
||||
The \c PrintPanel class is defined in \c printpanel.h.
|
||||
|
||||
\snippet examples/linguist/trollprint/printpanel.h 0
|
||||
|
||||
\c PrintPanel is a QWidget. It needs the \c Q_OBJECT macro for \c
|
||||
tr() to work properly.
|
||||
|
||||
The implementation file is \c printpanel.cpp.
|
||||
|
||||
\snippet examples/linguist/trollprint/printpanel.cpp 0
|
||||
|
||||
Some of the code is commented out in Troll Print 1.0; you will
|
||||
uncomment it later, for Troll Print 1.1.
|
||||
|
||||
\snippet examples/linguist/trollprint/printpanel.cpp 1
|
||||
\snippet examples/linguist/trollprint/printpanel.cpp 2
|
||||
|
||||
Notice the two occurrences of \c tr("Enabled") and of \c
|
||||
tr("Disabled") in PrintPanel. Since both "Enabled"s and "Disabled"s
|
||||
appear in the same context \e {Qt Linguist} will only display one
|
||||
occurrence of each and will use the same translations for the
|
||||
duplicates that it doesn't display. Whilst this is a useful
|
||||
timesaver, in some languages, such as Portuguese, the second
|
||||
occurrence requires a separate translation. We will see how \e {Qt
|
||||
Linguist} can be made to display all the occurrences for separate
|
||||
translation shortly.
|
||||
|
||||
The header file for \c MainWindow, \c mainwindow.h, contains no
|
||||
surprises. In the implementation, \c mainwindow.cpp, we have some
|
||||
user-visible source texts that must be marked for translation.
|
||||
|
||||
\snippet examples/linguist/trollprint/mainwindow.cpp 0
|
||||
|
||||
We must translate the window title.
|
||||
|
||||
\snippet examples/linguist/trollprint/mainwindow.cpp 1
|
||||
\snippet examples/linguist/trollprint/mainwindow.cpp 3
|
||||
|
||||
We also need to translate the actions and menus. Note that the
|
||||
two argument form of \c tr() is used for the keyboard
|
||||
accelerator, "Ctrl+Q", since the second argument is the only clue
|
||||
the translator has to indicate what function that accelerator
|
||||
will perform.
|
||||
|
||||
\snippet examples/linguist/trollprint/main.cpp 0
|
||||
|
||||
The \c main() function in \c main.cpp is the same as the one in
|
||||
the \l{linguist/arrowpad}{Arrow Pad} example. In particular, it
|
||||
chooses a translation file based on the current locale.
|
||||
|
||||
\section1 Running Troll Print 1.0 in English and in Portuguese
|
||||
|
||||
We will use the translations in the \c trollprint_pt.ts file that is provided.
|
||||
|
||||
Set the \c LANG environment variable to \c pt, and then run \c
|
||||
trollprint. You should still see the English version. Now run \c
|
||||
lrelease, e.g. \c {lrelease trollprint.pro}, and then run the
|
||||
example again. Now you should see the Portuguese edition (Troll
|
||||
Imprimir 1.0):
|
||||
|
||||
\image linguist-trollprint_10_pt_bad.png
|
||||
|
||||
Whilst the translation has appeared correctly, it is in fact wrong. In
|
||||
good Portuguese, the second occurrence of "Enabled" should be
|
||||
"Ativadas", not "Ativado" and the ending for the second translation of
|
||||
"Disabled" must change similarly too.
|
||||
|
||||
If you open \c trollprint_pt.ts using \e {Qt Linguist}, you will see that
|
||||
there is just one occurrence of "Enabled" and of "Disabled" in the
|
||||
translation source file, even though there are two of each in the
|
||||
source code. This is because \e {Qt Linguist} tries to minimize the
|
||||
translator's work by using the same translation for duplicate source
|
||||
texts. In cases such as this where an identical translation is wrong,
|
||||
the programmer must disambiguate the duplicate occurrences. This is
|
||||
easily achieved by using the two argument form of \c tr().
|
||||
|
||||
We can easily determine which file must be changed because the
|
||||
translator's "context" is in fact the class name for the class where
|
||||
the texts that must be changed appears. In this case the file is \c
|
||||
printpanel.cpp, where there are four lines to change. Add the
|
||||
second argument "two-sided" in the appropriate \c tr() calls to the
|
||||
first pair of radio buttons:
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_trollprint.cpp 0
|
||||
|
||||
and add the second argument "colors" in the appropriate \c tr() calls
|
||||
for the second pair of radio buttons:
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_trollprint.cpp 1
|
||||
|
||||
Now run \c lupdate and open \c trollprint_pt.ts with \e {Qt Linguist}. You
|
||||
should now see two changes.
|
||||
|
||||
First, the translation source file now contains \e three "Enabled",
|
||||
"Disabled" pairs. The first pair is marked "(obs.)" signifying that they
|
||||
are obsolete. This is because these texts appeared in \c tr() calls that
|
||||
have been replaced by new calls with two arguments. The second pair has
|
||||
"two-sided" as their comment, and the third pair has "colors" as their
|
||||
comment. The comments are shown in the \uicontrol {Source text and comments}
|
||||
area in \e {Qt Linguist}.
|
||||
|
||||
Second, the translation text "Ativado" and "Desativado" have been
|
||||
automatically used as translations for the new "Enabled" and "Disabled"
|
||||
texts, again to minimize the translator's work. Of course in this case
|
||||
these are not correct for the second occurrence of each word, but they
|
||||
provide a good starting point.
|
||||
|
||||
Change the second "Ativado" into "Ativadas" and the second
|
||||
"Desativado" into "Desativadas", then save and quit. Run \c lrelease
|
||||
to obtain an up-to-date binary \c trollprint_pt.qm file, and run Troll Print
|
||||
(or rather Troll Imprimir).
|
||||
|
||||
\image linguist-trollprint_10_pt_good.png
|
||||
|
||||
The second argument to \c tr() calls, called "comments" in \e {Qt
|
||||
Linguist}, distinguish between identical source texts that occur in
|
||||
the same context (class). They are also useful in other cases to give
|
||||
clues to the translator, and in the case of Ctrl key accelerators are
|
||||
the only means of conveying the function performed by the accelerator to
|
||||
the translator.
|
||||
|
||||
An additional way of helping the translator is to provide information on
|
||||
how to navigate to the particular part of the application that contains
|
||||
the source texts they must translate. This helps them see the context
|
||||
in which the translation appears and also helps them to find and test
|
||||
the translations. This can be achieved by using a \c TRANSLATOR comment
|
||||
in the source code:
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_trollprint.cpp 2
|
||||
|
||||
Try adding these comments to some source files, particularly to
|
||||
dialog classes, describing the navigation necessary to reach the
|
||||
dialogs. You could also add them to the example files, e.g. \c
|
||||
mainwindow.cpp and \c printpanel.cpp are appropriate files. Run \c
|
||||
lupdate and then start \e {Qt Linguist} and load in \c trollprint_pt.ts.
|
||||
You should see the comments in the \uicontrol {Source text and comments} area
|
||||
as you browse through the list of source texts.
|
||||
|
||||
Sometimes, particularly with large programs, it can be difficult for
|
||||
the translator to find their translations and check that they're
|
||||
correct. Comments that provide good navigation information can save
|
||||
them time:
|
||||
|
||||
\snippet doc/src/snippets/code/doc_src_examples_trollprint.cpp 3
|
||||
|
||||
\section1 Troll Print 1.1
|
||||
|
||||
We'll now prepare release 1.1 of Troll Print. Start your favorite text
|
||||
editor and follow these steps:
|
||||
|
||||
\list
|
||||
\li Uncomment the two lines that create a QLabel with the text
|
||||
"\<b\>TROLL PRINT\</b\>" in \c printpanel.cpp.
|
||||
\li Word-tidying: Replace "2-sided" by "Two-sided" in \c printpanel.cpp.
|
||||
\li Replace "1.0" with "1.1" everywhere it occurs in \c mainwindow.cpp.
|
||||
\li Update the copyright year to 1999-2000 in \c mainwindow.cpp.
|
||||
\endlist
|
||||
|
||||
(Of course the version number and copyright year would be consts or
|
||||
#defines in a real application.)
|
||||
|
||||
Once finished, run \c lupdate, then open \c trollprint_pt.ts in \e {Qt
|
||||
Linguist}. The following items are of special interest:
|
||||
|
||||
\list
|
||||
\li \c MainWindow
|
||||
\list
|
||||
\li Troll Print 1.0 - marked "(obs.)", obsolete
|
||||
\li About Troll Print 1.0 - marked "(obs.)", obsolete
|
||||
\li Troll Print 1.0. Copyright 1999 Software, Inc. -
|
||||
marked obsolete
|
||||
\li Troll Print 1.1 - automatically translated as
|
||||
"Troll Imprimir 1.1"
|
||||
\li About Troll Print 1.1 - automatically translated as
|
||||
"Troll Imprimir 1.1"
|
||||
\li Troll Print 1.1. Copyright 1999-2000 Software,
|
||||
Inc. - automatically translated as "Troll Imprimir 1.1.
|
||||
Copyright 1999-2000 Software, Inc."
|
||||
\endlist
|
||||
\li \c PrintPanel
|
||||
\list
|
||||
\li 2-sided - marked "(obs.)", obsolete
|
||||
\li \<b\>TROLL PRINT\</b\> - unmarked, i.e. untranslated
|
||||
\li Two-sided - unmarked, i.e. untranslated.
|
||||
\endlist
|
||||
\endlist
|
||||
|
||||
Notice that \c lupdate works hard behind the scenes to make revisions
|
||||
easier, and it's pretty smart with numbers.
|
||||
|
||||
Go over the translations in \c MainWindow and mark these as "done".
|
||||
Translate "\<b\>TROLL PRINT\</b\>" as "\<b\>TROLL IMPRIMIR\</b\>".
|
||||
When you're translating "Two-sided", press the \uicontrol {Guess Again}
|
||||
button to translate "Two-sided", but change the "2" into "Dois".
|
||||
|
||||
Save and quit, then run \c lrelease. The Portuguese version
|
||||
should look like this:
|
||||
|
||||
\image linguist-trollprint_11_pt.png
|
||||
|
||||
Choose \uicontrol{Ajuda|Sobre} (\uicontrol{Help|About}) to see the about box.
|
||||
|
||||
If you choose \uicontrol {Ajuda|Sobre Qt} (\uicontrol {Help|About Qt}), you'll get
|
||||
an English dialog. Oops! Qt itself needs to be translated. See
|
||||
\l{Internationalization with Qt} for details.
|
||||
|
||||
Now set \c LANG=en to get the original English version:
|
||||
|
||||
\image linguist-trollprint_11_en.png
|
||||
*/
|
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 753 B |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.1 KiB |
@ -1,43 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//! [0]
|
||||
qApp->translate("ArrowPad", x)
|
||||
//! [0]
|
@ -1,54 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//! [1]
|
||||
lrelease arrowpad.pro
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
export LANG=fr
|
||||
setenv LANG fr
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
set LANG=fr
|
||||
//! [3]
|
@ -1,71 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//! [0]
|
||||
lupdate -verbose hellotr.pro
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
<!DOCTYPE TS><TS>
|
||||
<context>
|
||||
<name>QPushButton</name>
|
||||
<message>
|
||||
<source>Hello world!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
linguist hellotr_la.ts
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
<translation type='unfinished'></translation>
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
<translation>Orbis, te saluto!</translation>
|
||||
//! [4]
|
@ -1,6 +0,0 @@
|
||||
#! [0]
|
||||
QT += uitools
|
||||
HEADERS = textfinder.h
|
||||
RESOURCES = textfinder.qrc
|
||||
SOURCES = textfinder.cpp main.cpp
|
||||
#! [0]
|
@ -1,77 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//! [0]
|
||||
twoSidedEnabledRadio = new QRadioButton(tr("Enabled", "two-sided"));
|
||||
twoSidedDisabledRadio = new QRadioButton(tr("Disabled", "two-sided"));
|
||||
//! [0]
|
||||
|
||||
|
||||
//! [1]
|
||||
colorsEnabledRadio = new QRadioButton(tr("Enabled", "colors"), colors);
|
||||
colorsDisabledRadio = new QRadioButton(tr("Disabled", "colors"), colors);
|
||||
//! [1]
|
||||
|
||||
|
||||
//! [2]
|
||||
/*
|
||||
TRANSLATOR MainWindow
|
||||
|
||||
In this application the whole application is a MainWindow.
|
||||
Choose Help|About from the menu bar to see some text
|
||||
belonging to MainWindow.
|
||||
|
||||
...
|
||||
*/
|
||||
//! [2]
|
||||
|
||||
|
||||
//! [3]
|
||||
/*
|
||||
TRANSLATOR ZClientErrorDialog
|
||||
|
||||
Choose Client|Edit to reach the Client Edit dialog, then choose
|
||||
Client Specification from the drop down list at the top and pick
|
||||
client Bartel Leendert van der Waerden. Now check the Profile
|
||||
checkbox and then click the Start Processing button. You should
|
||||
now see a pop up window with the text "Error: Name too long!".
|
||||
This window is a ZClientErrorDialog.
|
||||
*/
|
||||
//! [3]
|
6
examples/aggregate/examples.pro
Normal file
@ -0,0 +1,6 @@
|
||||
TEMPLATE = subdirs
|
||||
|
||||
sd = $$files(*)
|
||||
for(d, sd): \
|
||||
exists($$d/$${d}.pro): \
|
||||
SUBDIRS += $$d
|
@ -2,4 +2,3 @@ TEMPLATE = subdirs
|
||||
CONFIG += ordered
|
||||
win32:CONFIG += console
|
||||
SUBDIRS = complexping.pro complexpong.pro
|
||||
QT += widgets
|
||||
|
@ -3,9 +3,7 @@ SUBDIRS = listnames \
|
||||
pingpong \
|
||||
complexpingpong
|
||||
|
||||
!contains(QT_CONFIG, no-widgets) {
|
||||
qtHaveModule(widgets) {
|
||||
SUBDIRS += chat \
|
||||
remotecontrolledcar
|
||||
}
|
||||
|
||||
QT += widgets
|
||||
|
31
examples/dbus/doc/src/chat.qdoc
Normal file
@ -0,0 +1,31 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example chat
|
||||
\title D-Bus Chat Example
|
||||
*/
|
31
examples/dbus/doc/src/complexpingpong.qdoc
Normal file
@ -0,0 +1,31 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example complexpingpong
|
||||
\title D-Bus Complex Ping Pong Example
|
||||
*/
|
31
examples/dbus/doc/src/listnames.qdoc
Normal file
@ -0,0 +1,31 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example listnames
|
||||
\title D-Bus List Names Example
|
||||
*/
|
31
examples/dbus/doc/src/pingpong.qdoc
Normal file
@ -0,0 +1,31 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example pingpong
|
||||
\title D-Bus Ping Pong Example
|
||||
*/
|
31
examples/dbus/doc/src/remotecontrolledcar.qdoc
Normal file
@ -0,0 +1,31 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example remotecontrolledcar
|
||||
\title D-Bus Remote Controlled Car Example
|
||||
*/
|
@ -2,4 +2,3 @@ TEMPLATE = subdirs
|
||||
CONFIG += ordered
|
||||
win32:CONFIG += console
|
||||
SUBDIRS = ping.pro pong.pro
|
||||
QT += widgets
|
||||
|
After Width: | Height: | Size: 8.6 KiB |
@ -0,0 +1,36 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example dbus/remotecontrolledcar
|
||||
\title D-Bus Remote Controlled Car Example
|
||||
|
||||
The Remote Controlled Car example shows how to use D-Bus to control one
|
||||
application using another.
|
||||
|
||||
\image remotecontrolledcar-car-example.png
|
||||
*/
|
@ -1,5 +1,3 @@
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = car \
|
||||
controller
|
||||
|
||||
QT += widgets
|
||||
|
@ -3,5 +3,3 @@ SUBDIRS = styleexample raycasting flickable digiflip
|
||||
|
||||
SUBDIRS += lightmaps
|
||||
SUBDIRS += flightinfo
|
||||
|
||||
QT += widgets widgets
|
||||
|
@ -1,6 +1,7 @@
|
||||
QT += widgets
|
||||
|
||||
SOURCES = flickable.cpp main.cpp
|
||||
HEADERS = flickable.h
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/embedded/flickable
|
||||
INSTALLS += target
|
||||
QT += widgets widgets
|
||||
|
@ -1,7 +1,7 @@
|
||||
TEMPLATE = app
|
||||
QT += widgets
|
||||
SOURCES = raycasting.cpp
|
||||
RESOURCES += raycasting.qrc
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/embedded/raycasting
|
||||
INSTALLS += target
|
||||
QT += widgets widgets
|
||||
|
@ -8,19 +8,24 @@ SUBDIRS = \
|
||||
xml \
|
||||
qpa
|
||||
|
||||
!contains(QT_CONFIG, no-widgets) {
|
||||
qtHaveModule(widgets) {
|
||||
SUBDIRS += widgets \
|
||||
ipc \
|
||||
linguist \
|
||||
sql \
|
||||
tools \
|
||||
touch \
|
||||
gestures
|
||||
}
|
||||
|
||||
wince*|embedded|x11:!contains(QT_CONFIG, no-gui): SUBDIRS += embedded
|
||||
wince*|embedded|x11:qtHaveModule(gui): SUBDIRS += embedded
|
||||
|
||||
contains(QT_BUILD_PARTS, tools):!contains(QT_CONFIG, no-gui):!contains(QT_CONFIG, no-widgets):SUBDIRS += qtestlib
|
||||
contains(QT_CONFIG, opengl):!contains(QT_CONFIG, no-widgets):SUBDIRS += opengl
|
||||
contains(QT_CONFIG, dbus): SUBDIRS += dbus
|
||||
contains(QT_CONFIG, concurrent): SUBDIRS += qtconcurrent
|
||||
contains(QT_BUILD_PARTS, tools):qtHaveModule(gui):qtHaveModule(widgets): SUBDIRS += qtestlib
|
||||
qtHaveModule(opengl):qtHaveModule(widgets): SUBDIRS += opengl
|
||||
qtHaveModule(dbus): SUBDIRS += dbus
|
||||
qtHaveModule(concurrent): SUBDIRS += qtconcurrent
|
||||
|
||||
aggregate.files = aggregate/examples.pro
|
||||
aggregate.path = $$[QT_INSTALL_EXAMPLES]
|
||||
readme.files = README
|
||||
readme.path = $$[QT_INSTALL_EXAMPLES]
|
||||
INSTALLS += aggregate readme
|
||||
|
@ -2,5 +2,3 @@ TEMPLATE = \
|
||||
subdirs
|
||||
SUBDIRS = \
|
||||
imagegestures
|
||||
|
||||
QT += widgets
|
||||
|
@ -1,3 +1,5 @@
|
||||
QT += widgets
|
||||
|
||||
HEADERS = imagewidget.h \
|
||||
mainwidget.h
|
||||
SOURCES = imagewidget.cpp \
|
||||
@ -8,5 +10,3 @@ SOURCES = imagewidget.cpp \
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/gestures/imagegestures
|
||||
INSTALLS += target
|
||||
|
||||
QT += widgets
|
||||
|
||||
|
@ -1,4 +1,10 @@
|
||||
include(../rasterwindow/rasterwindow.pri)
|
||||
|
||||
# work-around for QTBUG-13496
|
||||
CONFIG += no_batch
|
||||
|
||||
SOURCES += \
|
||||
main.cpp
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/gui/analogclock
|
||||
INSTALLS += target
|
||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
@ -26,7 +26,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example gui/analogclock
|
||||
\example analogclock
|
||||
\title Analog Clock Window Example
|
||||
|
||||
\brief The Analog Clock Window example shows how to draw the contents of
|
@ -26,7 +26,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example gui/openglwindow
|
||||
\example openglwindow
|
||||
\title OpenGL Window Example
|
||||
|
||||
\brief This example shows how to create a minimal QWindow based application
|
||||
@ -105,8 +105,8 @@
|
||||
QOpenGLContext::functions(). QOpenGLFunctions gives access to all the
|
||||
OpenGL ES 2.0 level OpenGL calls that are not already standard in both
|
||||
OpenGL ES 2.0 and desktop OpenGL. For more information about the OpenGL and
|
||||
OpenGL ES APIs, refer to the official \l{OpenGL Registry} and
|
||||
\l{Khronos OpenGL ES API Registry}.
|
||||
OpenGL ES APIs, refer to the official \l{http://www.opengl.org/registry/}{OpenGL Registry} and
|
||||
\l {http://www.khronos.org/registry/gles/}{Khronos OpenGL ES API Registry}.
|
||||
|
||||
If animation has been enabled with OpenGLWindow::setAnimating(true), we
|
||||
call renderLater() to put another update request on the event loop.
|
@ -26,7 +26,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example gui/rasterwindow
|
||||
\example rasterwindow
|
||||
\title Raster Window Example
|
||||
|
||||
\brief This example shows how to create a minimal QWindow based
|
@ -2,3 +2,6 @@ include(openglwindow.pri)
|
||||
|
||||
SOURCES += \
|
||||
main.cpp
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/gui/openglwindow
|
||||
INSTALLS += target
|
||||
|
@ -2,3 +2,6 @@ include(rasterwindow.pri)
|
||||
|
||||
SOURCES += \
|
||||
main.cpp
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/gui/rasterwindow
|
||||
INSTALLS += target
|
||||
|
@ -2,5 +2,3 @@ TEMPLATE = subdirs
|
||||
# no QSharedMemory
|
||||
!vxworks:!qnx:SUBDIRS = sharedmemory
|
||||
!wince*: SUBDIRS += localfortuneserver localfortuneclient
|
||||
|
||||
QT += widgets
|
||||
|
@ -1,3 +1,5 @@
|
||||
QT += widgets
|
||||
|
||||
SOURCES += main.cpp \
|
||||
dialog.cpp
|
||||
|
||||
@ -12,6 +14,4 @@ EXAMPLE_FILES = *.png
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/ipc/sharedmemory
|
||||
INSTALLS += target
|
||||
|
||||
QT += widgets
|
||||
|
||||
simulator: warning(This example does not work on Simulator platform)
|
||||
|
@ -1,11 +0,0 @@
|
||||
#! [0]
|
||||
SOURCES = main.cpp
|
||||
#! [0] #! [1]
|
||||
TRANSLATIONS = hellotr_ja.ts
|
||||
#! [1]
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr
|
||||
INSTALLS += target
|
||||
|
||||
QT += widgets
|
@ -1,70 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QPushButton>
|
||||
//! [0]
|
||||
#include <QTranslator>
|
||||
//! [0]
|
||||
|
||||
//! [1] //! [2]
|
||||
int main(int argc, char *argv[])
|
||||
//! [1] //! [3] //! [4]
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
//! [3]
|
||||
|
||||
//! [5]
|
||||
QTranslator translator;
|
||||
//! [5] //! [6]
|
||||
translator.load("hellotr_ja");
|
||||
//! [6] //! [7]
|
||||
app.installTranslator(&translator);
|
||||
//! [4] //! [7]
|
||||
|
||||
//! [8]
|
||||
QPushButton hello(QPushButton::tr("Hello world!"));
|
||||
//! [8]
|
||||
hello.resize(100, 30);
|
||||
|
||||
hello.show();
|
||||
return app.exec();
|
||||
}
|
||||
//! [2]
|
@ -1,6 +0,0 @@
|
||||
Internationalization is a core feature of Qt. These examples show how to
|
||||
access translation and localization facilities at run-time.
|
||||
|
||||
|
||||
Documentation for these examples can be found via the Examples
|
||||
link in the main Qt documentation.
|
@ -1,64 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "arrowpad.h"
|
||||
|
||||
ArrowPad::ArrowPad(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
//! [0]
|
||||
upButton = new QPushButton(tr("&Up"));
|
||||
//! [0] //! [1]
|
||||
downButton = new QPushButton(tr("&Down"));
|
||||
//! [1] //! [2]
|
||||
leftButton = new QPushButton(tr("&Left"));
|
||||
//! [2] //! [3]
|
||||
rightButton = new QPushButton(tr("&Right"));
|
||||
//! [3]
|
||||
|
||||
QGridLayout *mainLayout = new QGridLayout;
|
||||
mainLayout->addWidget(upButton, 0, 1);
|
||||
mainLayout->addWidget(leftButton, 1, 0);
|
||||
mainLayout->addWidget(rightButton, 1, 2);
|
||||
mainLayout->addWidget(downButton, 2, 1);
|
||||
setLayout(mainLayout);
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef ARROWPAD_H
|
||||
#define ARROWPAD_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPushButton;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
//! [0]
|
||||
class ArrowPad : public QWidget
|
||||
//! [0] //! [1]
|
||||
{
|
||||
//! [1] //! [2]
|
||||
Q_OBJECT
|
||||
//! [2]
|
||||
|
||||
public:
|
||||
ArrowPad(QWidget *parent = 0);
|
||||
|
||||
private:
|
||||
QPushButton *upButton;
|
||||
QPushButton *downButton;
|
||||
QPushButton *leftButton;
|
||||
QPushButton *rightButton;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,18 +0,0 @@
|
||||
#! [0]
|
||||
HEADERS = arrowpad.h \
|
||||
mainwindow.h
|
||||
SOURCES = arrowpad.cpp \
|
||||
main.cpp \
|
||||
mainwindow.cpp
|
||||
#! [0] #! [1]
|
||||
TRANSLATIONS = arrowpad_fr.ts \
|
||||
arrowpad_nl.ts
|
||||
#! [1]
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/linguist/arrowpad
|
||||
INSTALLS += target
|
||||
|
||||
QT += widgets
|
||||
|
||||
simulator: warning(This example might not fully work on Simulator platform)
|
@ -1,63 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
//! [0]
|
||||
int main(int argc, char *argv[])
|
||||
//! [0] //! [1]
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QString locale = QLocale::system().name();
|
||||
|
||||
//! [2]
|
||||
QTranslator translator;
|
||||
//! [2] //! [3]
|
||||
translator.load(QString("arrowpad_") + locale);
|
||||
app.installTranslator(&translator);
|
||||
//! [1] //! [3]
|
||||
|
||||
MainWindow mainWindow;
|
||||
mainWindow.show();
|
||||
return app.exec();
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "arrowpad.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
//! [0]
|
||||
arrowPad = new ArrowPad;
|
||||
//! [0]
|
||||
setCentralWidget(arrowPad);
|
||||
|
||||
//! [1]
|
||||
exitAct = new QAction(tr("E&xit"), this);
|
||||
exitAct->setShortcuts(QKeySequence::Quit);
|
||||
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
|
||||
//! [1]
|
||||
|
||||
fileMenu = menuBar()->addMenu(tr("&File"));
|
||||
fileMenu->addAction(exitAct);
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
class QMenu;
|
||||
QT_END_NAMESPACE
|
||||
class ArrowPad;
|
||||
|
||||
//! [0]
|
||||
class MainWindow : public QMainWindow
|
||||
//! [0] //! [1]
|
||||
{
|
||||
Q_OBJECT
|
||||
//! [1]
|
||||
|
||||
public:
|
||||
MainWindow();
|
||||
|
||||
private:
|
||||
ArrowPad *arrowPad;
|
||||
QMenu *fileMenu;
|
||||
QAction *exitAct;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,13 +0,0 @@
|
||||
#! [0]
|
||||
SOURCES = main.cpp
|
||||
#! [0] #! [1]
|
||||
TRANSLATIONS = hellotr_la.ts
|
||||
#! [1]
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/linguist/hellotr
|
||||
INSTALLS += target
|
||||
|
||||
QT += widgets
|
||||
|
||||
simulator: warning(This example might not fully work on Simulator platform)
|
@ -1,6 +0,0 @@
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = arrowpad \
|
||||
hellotr \
|
||||
trollprint
|
||||
|
||||
QT += widgets
|
@ -1,60 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QString locale = QLocale::system().name();
|
||||
|
||||
//! [0]
|
||||
QTranslator translator;
|
||||
translator.load(QString("trollprint_") + locale);
|
||||
app.installTranslator(&translator);
|
||||
//! [0]
|
||||
|
||||
MainWindow mainWindow;
|
||||
mainWindow.show();
|
||||
return app.exec();
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "printpanel.h"
|
||||
|
||||
MainWindow::MainWindow()
|
||||
{
|
||||
printPanel = new PrintPanel;
|
||||
setCentralWidget(printPanel);
|
||||
|
||||
createActions();
|
||||
createMenus();
|
||||
|
||||
//! [0]
|
||||
setWindowTitle(tr("Troll Print 1.0"));
|
||||
//! [0]
|
||||
}
|
||||
|
||||
void MainWindow::about()
|
||||
{
|
||||
QMessageBox::information(this, tr("About Troll Print 1.0"),
|
||||
tr("Troll Print 1.0.\n\n"
|
||||
"Copyright 1999 Software, Inc."));
|
||||
}
|
||||
|
||||
//! [1]
|
||||
void MainWindow::createActions()
|
||||
{
|
||||
//! [2]
|
||||
exitAct = new QAction(tr("E&xit"), this);
|
||||
exitAct->setShortcut(tr("Ctrl+Q", "Quit"));
|
||||
//! [2]
|
||||
connect(exitAct, SIGNAL(triggered()), this, SLOT(close()));
|
||||
|
||||
aboutAct = new QAction(tr("&About"), this);
|
||||
aboutAct->setShortcut(Qt::Key_F1);
|
||||
connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
|
||||
|
||||
aboutQtAct = new QAction(tr("About &Qt"), this);
|
||||
connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
|
||||
}
|
||||
|
||||
void MainWindow::createMenus()
|
||||
//! [1] //! [3]
|
||||
{
|
||||
QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
|
||||
fileMenu->addAction(exitAct);
|
||||
|
||||
menuBar()->addSeparator();
|
||||
|
||||
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
|
||||
helpMenu->addAction(aboutAct);
|
||||
helpMenu->addAction(aboutQtAct);
|
||||
}
|
||||
//! [3]
|
@ -1,74 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
class QMenu;
|
||||
QT_END_NAMESPACE
|
||||
class PrintPanel;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow();
|
||||
|
||||
private slots:
|
||||
void about();
|
||||
|
||||
private:
|
||||
void createActions();
|
||||
void createMenus();
|
||||
|
||||
PrintPanel *printPanel;
|
||||
QMenu *fileMenu;
|
||||
QMenu *helpMenu;
|
||||
QAction *exitAct;
|
||||
QAction *aboutAct;
|
||||
QAction *aboutQtAct;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,85 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "printpanel.h"
|
||||
|
||||
//! [0]
|
||||
PrintPanel::PrintPanel(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
/*
|
||||
QLabel *label = new QLabel(tr("<b>TROLL PRINT</b>"));
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
*/
|
||||
//! [0]
|
||||
|
||||
//! [1]
|
||||
twoSidedGroupBox = new QGroupBox(tr("2-sided"));
|
||||
twoSidedEnabledRadio = new QRadioButton(tr("Enabled"));
|
||||
twoSidedDisabledRadio = new QRadioButton(tr("Disabled"));
|
||||
//! [1] //! [2]
|
||||
twoSidedDisabledRadio->setChecked(true);
|
||||
|
||||
colorsGroupBox = new QGroupBox(tr("Colors"));
|
||||
colorsEnabledRadio = new QRadioButton(tr("Enabled"));
|
||||
colorsDisabledRadio = new QRadioButton(tr("Disabled"));
|
||||
//! [2]
|
||||
colorsDisabledRadio->setChecked(true);
|
||||
|
||||
QHBoxLayout *twoSidedLayout = new QHBoxLayout;
|
||||
twoSidedLayout->addWidget(twoSidedEnabledRadio);
|
||||
twoSidedLayout->addWidget(twoSidedDisabledRadio);
|
||||
twoSidedGroupBox->setLayout(twoSidedLayout);
|
||||
|
||||
QHBoxLayout *colorsLayout = new QHBoxLayout;
|
||||
colorsLayout->addWidget(colorsEnabledRadio);
|
||||
colorsLayout->addWidget(colorsDisabledRadio);
|
||||
colorsGroupBox->setLayout(colorsLayout);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||
/*
|
||||
mainLayout->addWidget(label);
|
||||
*/
|
||||
mainLayout->addWidget(twoSidedGroupBox);
|
||||
mainLayout->addWidget(colorsGroupBox);
|
||||
setLayout(mainLayout);
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef PRINTPANEL_H
|
||||
#define PRINTPANEL_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QGroupBox;
|
||||
class QRadioButton;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
//! [0]
|
||||
class PrintPanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
//! [0]
|
||||
|
||||
public:
|
||||
PrintPanel(QWidget *parent = 0);
|
||||
|
||||
private:
|
||||
QGroupBox *twoSidedGroupBox;
|
||||
QGroupBox *colorsGroupBox;
|
||||
QRadioButton *twoSidedEnabledRadio;
|
||||
QRadioButton *twoSidedDisabledRadio;
|
||||
QRadioButton *colorsEnabledRadio;
|
||||
QRadioButton *colorsDisabledRadio;
|
||||
};
|
||||
|
||||
#endif
|
@ -1,14 +0,0 @@
|
||||
HEADERS = mainwindow.h \
|
||||
printpanel.h
|
||||
SOURCES = main.cpp \
|
||||
mainwindow.cpp \
|
||||
printpanel.cpp
|
||||
TRANSLATIONS = trollprint_pt.ts
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/linguist/trollprint
|
||||
INSTALLS += target
|
||||
|
||||
QT += widgets
|
||||
|
||||
simulator: warning(This example might not fully work on Simulator platform)
|
@ -1,65 +0,0 @@
|
||||
<!DOCTYPE TS><TS>
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<source>Troll Print 1.0</source>
|
||||
<translation>Troll Imprimir 1.0</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>E&xit</source>
|
||||
<translation>&Sair</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&About</source>
|
||||
<translation>&Sobre</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>About &Qt</source>
|
||||
<translation>Sobre &Qt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&File</source>
|
||||
<translation>&Arquivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Help</source>
|
||||
<translation>A&juda</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>About Troll Print 1.0</source>
|
||||
<translation>Sobre Troll Imprimir 1.0</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Troll Print 1.0.
|
||||
|
||||
Copyright 1999 Software, Inc.</source>
|
||||
<translation>Troll Imprimir 1.0
|
||||
|
||||
Copyright 1999 Software, Inc.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ctrl+Q</source>
|
||||
<comment>Quit</comment>
|
||||
<translation>Ctrl+Q</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PrintPanel</name>
|
||||
<message>
|
||||
<source>2-sided</source>
|
||||
<translation>2-lados</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabled</source>
|
||||
<translation>Ativado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Disabled</source>
|
||||
<translation>Desativado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Colors</source>
|
||||
<translation>Cores</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
@ -1,11 +1,10 @@
|
||||
QT += widgets
|
||||
QT += network widgets
|
||||
|
||||
HEADERS = blockingclient.h \
|
||||
fortunethread.h
|
||||
SOURCES = blockingclient.cpp \
|
||||
main.cpp \
|
||||
fortunethread.cpp
|
||||
QT += network
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/network/blockingfortuneclient
|
||||
|
@ -1,9 +1,8 @@
|
||||
QT += widgets
|
||||
QT += network widgets
|
||||
|
||||
HEADERS = receiver.h
|
||||
SOURCES = receiver.cpp \
|
||||
main.cpp
|
||||
QT += network
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastreceiver
|
||||
|
@ -1,9 +1,8 @@
|
||||
QT += widgets
|
||||
QT += network widgets
|
||||
|
||||
HEADERS = sender.h
|
||||
SOURCES = sender.cpp \
|
||||
main.cpp
|
||||
QT += network
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/network/broadcastsender
|
||||
|
@ -28,9 +28,8 @@
|
||||
/*!
|
||||
\example blockingfortuneclient
|
||||
\title Blocking Fortune Client Example
|
||||
|
||||
\brief The Blocking Fortune Client example shows how to create a client for a
|
||||
network service using QTcpSocket's synchronous API in a non-GUI thread.
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates how to create a client for a network service
|
||||
|
||||
\image blockingfortuneclient-example.png
|
||||
|
||||
|
@ -28,9 +28,11 @@
|
||||
/*!
|
||||
\example broadcastreceiver
|
||||
\title Broadcast Receiver Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates how to receive information broadcasted over a local network.
|
||||
|
||||
\brief The Broadcast Receiver example shows how to receive information that is broadcasted
|
||||
over a local network.
|
||||
This example uses the Qt Network APIs to demonstrate how to receive
|
||||
messages broadcasted over a local network.
|
||||
|
||||
\image broadcastreceiver-example.png
|
||||
*/
|
||||
|
@ -28,9 +28,11 @@
|
||||
/*!
|
||||
\example broadcastsender
|
||||
\title Broadcast Sender Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates how to broadcast information to multiple clients on a local network.
|
||||
|
||||
\brief The Broadcast Sender example shows how to broadcast information to multiple clients
|
||||
on a local network.
|
||||
This example uses Qt Network APIs to demonstrate how to broadcast messages
|
||||
to multiple clients over a local network.
|
||||
|
||||
\image broadcastsender-example.png
|
||||
*/
|
||||
|
@ -28,9 +28,10 @@
|
||||
/*!
|
||||
\example fortuneclient
|
||||
\title Fortune Client Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates how to create a client for a network service
|
||||
|
||||
\brief The Fortune Client example shows how to create a client for a simple
|
||||
network service using QTcpSocket. It is intended to be run alongside the
|
||||
This example uses QTcpSocket, and is intended to be run alongside the
|
||||
\l{fortuneserver}{Fortune Server} example or
|
||||
the \l{threadedfortuneserver}{Threaded Fortune Server} example.
|
||||
|
||||
|
@ -28,15 +28,16 @@
|
||||
/*!
|
||||
\example fortuneserver
|
||||
\title Fortune Server Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates how to create a server for a network service.
|
||||
|
||||
\brief The Fortune Server example shows how to create a server for a simple
|
||||
network service. It is intended to be run alongside the
|
||||
This example is intended to be run alongside the
|
||||
\l{fortuneclient}{Fortune Client} example or the
|
||||
\l{blockingfortuneclient}{Blocking Fortune Client} example.
|
||||
|
||||
\image fortuneserver-example.png Screenshot of the Fortune Server example
|
||||
|
||||
This example uses QTcpServer to accept incoming TCP connections, and a
|
||||
It uses QTcpServer to accept incoming TCP connections, and a
|
||||
simple QDataStream based data transfer protocol to write a fortune to the
|
||||
connecting client (from the \l{fortuneclient}{Fortune Client}
|
||||
example), before closing the connection.
|
||||
@ -55,7 +56,7 @@
|
||||
|
||||
\snippet fortuneserver/server.cpp 2
|
||||
|
||||
Our server generates a list of random fortunes that is can send to
|
||||
Our server generates a list of random fortunes that it can send to
|
||||
connecting clients.
|
||||
|
||||
\snippet fortuneserver/server.cpp 3
|
||||
|
@ -28,10 +28,11 @@
|
||||
/*!
|
||||
\example googlesuggest
|
||||
\title Google Suggest Example
|
||||
\ingroup examples-network
|
||||
\brief Obtains the list of search recommendations by the Google search engine
|
||||
|
||||
\brief The Google Suggest example demonstrates how to use the QNetworkAccessManager
|
||||
class to obtain a list of suggestions from the Google search engine as the
|
||||
user types into a QLineEdit.
|
||||
The example uses the QNetworkAccessManager to obtain the list of search
|
||||
recommendations by Google as the user types into a QLineEdit.
|
||||
|
||||
\image googlesuggest-example.png
|
||||
|
||||
|
@ -28,9 +28,11 @@
|
||||
/*!
|
||||
\example http
|
||||
\title HTTP Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates a simple HTTP client
|
||||
|
||||
\brief The HTTP example demonstrates a simple HTTP client that shows how to fetch files
|
||||
specified by URLs from remote hosts.
|
||||
This example demonstrates how a simple HTTP client can fetch files
|
||||
from remote hosts.
|
||||
|
||||
\image http-example.png
|
||||
*/
|
||||
|
@ -28,9 +28,11 @@
|
||||
/*!
|
||||
\example loopback
|
||||
\title Loopback Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates the client-server communication on a local host
|
||||
|
||||
\brief The Loopback example shows how to communicate between simple clients and servers on a local
|
||||
host.
|
||||
The example demonstrates how the clients and servers on a local host
|
||||
communicate with each other.
|
||||
|
||||
\image loopback-example.png
|
||||
*/
|
||||
|
@ -28,9 +28,9 @@
|
||||
/*!
|
||||
\example multicastreceiver
|
||||
\title Multicast Receiver Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates how to receive information sent to a multicast group
|
||||
|
||||
\brief The Multicast Receiever example shows how to receive information that is
|
||||
sent to a multicast group.
|
||||
|
||||
This example demonstrates how to receive messages sent to a multicast group
|
||||
\image multicastreceiver-example.png
|
||||
*/
|
||||
|
@ -28,9 +28,11 @@
|
||||
/*!
|
||||
\example multicastsender
|
||||
\title Multicast Sender Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates how to send messages to a multicast group
|
||||
|
||||
\brief The Multicast Sender example shows how to send information to multiple
|
||||
clients in a multicast group.
|
||||
This example demonstrates how to send messages to the clients of a
|
||||
multicast group.
|
||||
|
||||
\image multicastsender-example.png
|
||||
*/
|
||||
|
@ -28,10 +28,11 @@
|
||||
/*!
|
||||
\example network-chat
|
||||
\title Network Chat Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates a stateful peer-to-peer Chat client
|
||||
|
||||
\brief The Network Chat example demonstrates a stateful peer-to-peer Chat client
|
||||
that uses broadcasting with QUdpSocket and QNetworkInterface to discover
|
||||
its peers.
|
||||
This example uses broadcasting with QUdpSocket and QNetworkInterface to
|
||||
discover its peers.
|
||||
|
||||
\image network-chat-example.png
|
||||
*/
|
||||
|
41
examples/network/doc/src/network-download.qdoc
Normal file
@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example network/download
|
||||
\title Network Download Example
|
||||
\brief Demonstrates how to use networking APIs for multiple downloads
|
||||
\ingroup examples-network
|
||||
|
||||
The Network Download example shows how to perform multiple downloads in
|
||||
parallel using the QNetworkAccessManager class.
|
||||
|
||||
This example is designed to be run from the command-line.
|
||||
|
||||
The \l{Network Download Manager Example} implements a more complex system
|
||||
that places files in a queue for sequential downloading.
|
||||
*/
|
41
examples/network/doc/src/network-downloadmanager.qdoc
Normal file
@ -0,0 +1,41 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and 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 Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: http://www.gnu.org/copyleft/fdl.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\example network/downloadmanager
|
||||
\title Network Download Manager Example
|
||||
\brief Demonstrates how to use the networking APIs for multiple downloads
|
||||
\ingroup examples-network
|
||||
|
||||
The Network Download example shows how to implement a queue for multiple
|
||||
downloads using the QNetworkAccessManager class.
|
||||
|
||||
This example is designed to be run from the command-line.
|
||||
|
||||
See the \l{Network Download Example} for a simpler version of this example
|
||||
that obtains multiple files in parallel.
|
||||
*/
|
@ -28,11 +28,12 @@
|
||||
/*!
|
||||
\example securesocketclient
|
||||
\title Secure Socket Client Example
|
||||
\ingroup examples-network
|
||||
\brief Demonstrates how to communicate over an encrypted (SSL) connection
|
||||
|
||||
\brief The Secure Socket Client example shows how to use QSslSocket to
|
||||
communicate over an encrypted (SSL) connection. It also demonstrates how
|
||||
to deal with authenticity problems, and how to display security and
|
||||
certificate information.
|
||||
This example uses QSslSocket to demonstrate how to communicate over an
|
||||
encrypted connection, deal with authenticity problems, and display security
|
||||
and certificate information.
|
||||
|
||||
\image securesocketclient.png
|
||||
\image securesocketclient2.png
|
||||
|