diff options
650 files changed, 42462 insertions, 25272 deletions
diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 460df31..a748ba5 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -155,10 +155,8 @@ my $signed_sis_name = $pkgoutputbasename.".sis"; # Store some utility variables my $scriptpath = dirname(__FILE__); my $certtext = $certificate; -my $certpath = $scriptpath; -$certpath =~ s-^(.*[^\\])$-$1\\-o; # ensure path ends with a backslash -$certpath =~ s-/-\\-go; # for those working with UNIX shells -$certpath =~ s-bin\\$-src\\s60installs\\-; # certificates are one step up in hierarcy +# certificates are one step up in hierarchy +my $certpath = File::Spec->catdir($scriptpath, File::Spec->updir(), "src/s60installs/"); # Check some pre-conditions and print error messages if needed. unless (length($templatepkg)) { @@ -190,14 +188,14 @@ if (length($certificate)) { } else { #If no certificate is given, check default options $certtext = "RnD"; - $certificate = $certpath."rd.cer"; - $key = $certpath."rd-key.pem"; + $certificate = File::Spec->catfile($certpath, "rd.cer"); + $key = File::Spec->catfile($certpath, "rd-key.pem"); stat($certificate); unless( -e _ ) { $certtext = "Self Signed"; - $certificate = $certpath."selfsigned.cer"; - $key = $certpath."selfsigned.key"; + $certificate = File::Spec->catfile($certpath, "selfsigned.cer"); + $key = File::Spec->catfile($certpath, "selfsigned.key"); } } diff --git a/bin/createpackage.sh b/bin/createpackage.sh new file mode 100755 index 0000000..fdd4eeb --- /dev/null +++ b/bin/createpackage.sh @@ -0,0 +1,3 @@ +#!/bin/sh +scriptpath=`dirname $0` +perl $scriptpath/createpackage.pl "$@" @@ -44,7 +44,6 @@ my %modules = ( # path to module name map "Qt3Support" => "$basedir/src/qt3support", "ActiveQt" => "$basedir/src/activeqt/container;$basedir/src/activeqt/control;$basedir/src/activeqt/shared", "QtTest" => "$basedir/src/testlib", - "QtAssistant" => "$basedir/tools/assistant/compat/lib", "QtHelp" => "$basedir/tools/assistant/lib", "QtDesigner" => "$basedir/tools/designer/src/lib", "QtUiTools" => "$basedir/tools/designer/src/uitools", @@ -598,9 +597,6 @@ while ( @ARGV ) { # skip, it's been dealt with at the top of the file shift @ARGV; next; - } elsif("$arg" eq '*') { - # workaround for windows 9x where "%*" expands to "*" - $var = 1; } #do something @@ -680,7 +676,7 @@ my @ignore_for_master_contents = ( "qt.h", "qpaintdevicedefs.h" ); my @ignore_for_include_check = ( "qatomic.h" ); my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" ); my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" ); -my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtAssistant}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" ); +my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" ); foreach (@modules_to_sync) { #iteration info diff --git a/config.tests/unix/fvisibility.test b/config.tests/unix/fvisibility.test index b2bcc07..99e6fbe 100755 --- a/config.tests/unix/fvisibility.test +++ b/config.tests/unix/fvisibility.test @@ -4,25 +4,41 @@ FVISIBILITY_SUPPORT=no COMPILER=$1 VERBOSE=$2 +CMDLINE= + + RunCompileTest() { cat >>fvisibility.c << EOF -__attribute__((visibility("default"))) void blah(); -#if !defined(__GNUC__) -# error "Visiblility support requires GCC" -#elif __GNUC__ < 4 -# error "GCC3 with backported visibility patch is known to miscompile Qt" +#if defined(__GNUC__) +# if (__GNUC__ < 4) +# error "GCC3 with backported visibility patch is known to miscompile Qt" +# endif +__attribute((visibility("default"))) void blah(); +#elif defined(__SUNPRO_CC) +# if (__SUNPRO_CC < 0x0550) +# error "SunStudio 8 or later is required for ELF visibility" +# endif +__global void blah(); +#else +# error "GCC4+ or SunStudio 8+ are required to support ELF visibility" #endif EOF if [ "$VERBOSE" = "yes" ] ; then - "$COMPILER" -c -fvisibility=hidden fvisibility.c && FVISIBILITY_SUPPORT=yes + "$COMPILER" -c $CMDLINE fvisibility.c && FVISIBILITY_SUPPORT=yes else - "$COMPILER" -c -fvisibility=hidden fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes + "$COMPILER" -c $CMDLINE fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes fi rm -f fvisibility.c fvisibility.o } + case "$COMPILER" in +gcc|g++) + CMDLINE="-fvisibility=hidden" + RunCompileTest + ;; + aCC*) ;; @@ -34,14 +50,17 @@ icpc) ;; *) # the compile test works for the intel compiler because it mimics gcc's behavior + CMDLINE="-fvisibility=hidden" RunCompileTest ;; esac ;; - *) - RunCompileTest - ;; +CC) + # This should be SunStudio. If not, it'll get caught. + CMDLINE="-xldscope=hidden" + RunCompileTest + ;; esac # done diff --git a/config.tests/unix/opengles1cl/opengles1cl.pro b/config.tests/unix/opengles1cl/opengles1cl.pro deleted file mode 100644 index c4c069e..0000000 --- a/config.tests/unix/opengles1cl/opengles1cl.pro +++ /dev/null @@ -1,9 +0,0 @@ -SOURCES = opengles1cl.cpp -INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL - -for(p, QMAKE_LIBDIR_OPENGL_ES1CL) { - exists($$p):LIBS += -L$$p -} - -CONFIG -= qt -LIBS += $$QMAKE_LIBS_OPENGL_ES1CL @@ -759,9 +759,9 @@ CFG_MAC_ARCHS= MAC_CONFIG_TEST_COMMANDLINE= # used to make the configure tests run with the correct arch's and SDK settings CFG_MAC_DWARF2=auto CFG_MAC_XARCH=auto -CFG_MAC_CARBON=yes -CFG_MAC_COCOA=auto -COMMANDLINE_MAC_COCOA=no +CFG_MAC_CARBON=no +CFG_MAC_COCOA=yes +COMMANDLINE_MAC_CARBON=no CFG_SXE=no CFG_PREFIX_INSTALL=yes CFG_SDK= @@ -921,7 +921,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-webkit|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1225,7 +1225,7 @@ while [ "$#" -gt 0 ]; do opengl) if [ "$VAL" = "auto" ] || [ "$VAL" = "desktop" ] || [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || - [ "$VAL" = "es1cl" ] || [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then + [ "$VAL" = "es1" ] || [ "$VAL" = "es2" ]; then CFG_OPENGL="$VAL" else UNKNOWN_OPT=yes @@ -1321,13 +1321,17 @@ while [ "$#" -gt 0 ]; do fi ;; cocoa) +# do nothing - Cocoa is the default. + ;; + carbon) if [ "$PLATFORM_MAC" = "yes" ] && [ "$VAL" = "yes" ]; then - CFG_MAC_COCOA="$VAL" - COMMANDLINE_MAC_COCOA="$VAL" + CFG_MAC_CARBON="$VAL" + COMMANDLINE_MAC_CARBON="$VAL" else UNKNOWN_OPT=yes fi ;; + framework) if [ "$PLATFORM_MAC" = "yes" ]; then CFG_FRAMEWORK="$VAL" @@ -3705,11 +3709,11 @@ Qt/X11 only: + -opengl <api> ...... Enable OpenGL support. With no parameter, this will auto-detect the "best" OpenGL API to use. If desktop OpenGL is available, it - will be used. Use desktop, es1, es1cl or es2 for <api> + will be used. Use desktop, es1, or es2 for <api> to force the use of the Desktop (OpenGL 1.x or 2.x), - OpenGL ES 1.x Common profile, 1.x Common Lite profile - or 2.x APIs instead. On X11, the EGL API will be used - to manage GL contexts in the case of OpenGL ES + OpenGL ES 1.x Common profile, or 2.x APIs instead. + On X11, the EGL API will be used to manage GL + contexts in the case of OpenGL ES -no-openvg ........ Do not support OpenVG. + -openvg ........... Enable OpenVG support. @@ -3784,10 +3788,11 @@ Qt/Mac only: -Fstring ........... Add an explicit framework path. -fw string ......... Add an explicit framework. - -cocoa ............. Build the Cocoa version of Qt. Note that -no-framework - and -static is not supported with -cocoa. Specifying - this option creates Qt binaries that requires Mac OS X - 10.5 or higher. + -cocoa ............. [Deprecated] Cocoa is now enabled by default. + + -carbon .............Build the Carbon version of Qt. 64-bit archs + are not supported by carbon and will be built + with cocoa * -framework ......... Build Qt as a series of frameworks and link tools against those frameworks. @@ -3800,8 +3805,7 @@ Qt/Mac only: -arch <arch> ....... Build Qt for <arch> Example values for <arch>: x86 ppc x86_64 ppc64 - Multiple -arch arguments can be specified, 64-bit archs - will be built with the Cocoa framework. + Multiple -arch arguments can be specified. -sdk <sdk> ......... Build Qt using Apple provided SDK <sdk>. This option requires gcc 4. To use a different SDK with gcc 3.3, set the SDKROOT environment variable. @@ -3863,7 +3867,7 @@ Qt for Embedded Linux only: -no-opengl .......... Do not support OpenGL. -opengl <api> ....... Enable OpenGL ES support With no parameter, this will attempt to auto-detect OpenGL ES 1.x - or 2.x. Use es1, es1cl or es2 for <api> to override auto-detection. + or 2.x. Use es1 or es2 for <api> to override auto-detection. NOTE: A QGLScreen driver for the hardware is required to support OpenGL ES on Qt for Embedded Linux. @@ -4968,7 +4972,7 @@ if [ "$PLATFORM_X11" = "yes" -o "$PLATFORM_QWS" = "yes" ]; then CFG_EGL=yes CFG_EGL_GLES_INCLUDES=yes fi - if ( [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ] ) && [ "$CFG_EGL" != "yes" ]; then + if ( [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ] ) && [ "$CFG_EGL" != "yes" ]; then echo "The EGL functionality test failed!" echo " EGL is required for OpenGL ES to manage contexts & surfaces." echo " You might need to modify the include and library search paths by editing" @@ -5068,7 +5072,7 @@ if [ "$PLATFORM_X11" = "yes" ]; then exit 1 fi - # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x) + # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x) if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then CFG_OPENGL=desktop @@ -5076,8 +5080,6 @@ if [ "$PLATFORM_X11" = "yes" ]; then CFG_OPENGL=es2 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es1 - elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then - CFG_OPENGL=es1cl else if [ "$CFG_OPENGL" = "yes" ]; then echo "All the OpenGL functionality tests failed!" @@ -5101,16 +5103,6 @@ if [ "$PLATFORM_X11" = "yes" ]; then *) ;; esac - elif [ "$CFG_OPENGL" = "es1cl" ]; then - # OpenGL ES 1.x common lite - "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS - if [ $? != "0" ]; then - echo "The OpenGL ES 1.x Common Lite Profile functionality test failed!" - echo " You might need to modify the include and library search paths by editing" - echo " QMAKE_INCDIR_OPENGL_ES1CL, QMAKE_LIBDIR_OPENGL_ES1CL and QMAKE_LIBS_OPENGL_ES1CL in" - echo " ${XQMAKESPEC}." - exit 1 - fi elif [ "$CFG_OPENGL" = "es1" ]; then # OpenGL ES 1.x "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS @@ -5420,14 +5412,12 @@ fi # QWS if [ "$PLATFORM_QWS" = "yes" ]; then - # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x) + # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x) if [ "$CFG_OPENGL" = "yes" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es2 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es1 - elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then - CFG_OPENGL=es1cl else echo "All the OpenGL ES functionality tests failed!" echo " You might need to modify the include and library search paths by editing" @@ -5942,14 +5932,14 @@ if [ "$CFG_MAC_DWARF2" = "yes" ]; then QT_CONFIG="$QT_CONFIG dwarf2" fi -# Set the default arch. -# Carbon builds: 32 bit x86/ppc. -# For "-cocoa" builds on snow leopard : compiler default (64-bit). -# For "-cocoa" builds on leopard : compiler default (32-bit). +# Set the default arch if there are no "-arch" arguments on the configure line +# For "-carbon" builds: 32 bit x86/ppc. +# For builds on snow leopard : compiler default (64-bit). +# For builds on leopard : compiler default (32-bit). if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_ARCHS" = "" ]; then source "$mactests/defaultarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" - if [ "$CFG_MAC_COCOA" != "yes" ]; then + if [ "$CFG_MAC_CARBON" = "yes" ]; then if [ "$QT_MAC_DEFAULT_ARCH" = "x86_64" ]; then CFG_MAC_ARCHS=" x86" elif [ "$QT_MAC_DEFAULT_ARCH" = "ppc64" ]; then @@ -5964,12 +5954,13 @@ if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_ARCHS" = "" ]; then [ "$OPT_VERBOSE" = "yes" ] && echo "Setting Mac architechture to$CFG_MAC_ARCHS." fi -# enable cocoa and/or carbon on Mac -if [ "$CFG_MAC_COCOA" = "yes" ]; then -# -cocoa on the command line disables carbon completely (i.e. use cocoa for 32-bit as well) - CFG_MAC_CARBON="no" -else -# check which archs are in use, enable cocoa if we find a 64-bit one +# enable Cocoa and/or Carbon on Mac +# -carbon on the command line disables Cocoa, except for 64-bit archs +if [ "$CFG_MAC_CARBON" = "yes" ]; then + CFG_MAC_CARBON="YES" + CFG_MAC_COCOA="NO" + +# check which archs are in use, enable cocoa if we find a 64-bit one if echo "$CFG_MAC_ARCHS" | grep 64 > /dev/null 2>&1; then CFG_MAC_COCOA="yes"; CFG_MAC_CARBON="no"; @@ -5979,11 +5970,17 @@ else if echo "$CFG_MAC_ARCHS" | grep -w x86 > /dev/null 2>&1; then CFG_MAC_CARBON="yes"; fi - else -# no 64-bit archs found. - CFG_MAC_COCOA="no" fi -fi; +fi + +# select Carbon on 10.4 Tiger. +if [ "$PLATFORM_MAC" = "yes" ]; then + VERSION=`uname -r | tr '.' ' ' | awk '{print $1}'` + if [ "$VERSION" == 8 ]; then + CFG_MAC_COCOA="no"; + CFG_MAC_CARBON="yes"; + fi +fi # set the global Mac deployment target. This is overridden on an arch-by-arch basis # in some cases, see code further down @@ -6061,7 +6058,7 @@ else QT_CONFIG="$QT_CONFIG opengl" fi -if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ]; then +if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ]; then if [ "$PLATFORM_QWS" = "yes" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS Q_BACKINGSTORE_SUBSURFACES" QCONFIG_FLAGS="$QCONFIG_FLAGS Q_USE_EGLWINDOWSURFACE" @@ -6074,11 +6071,6 @@ if [ "$CFG_OPENGL" = "es1" ]; then QT_CONFIG="$QT_CONFIG opengles1" fi -if [ "$CFG_OPENGL" = "es1cl" ]; then - QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1_CL" - QT_CONFIG="$QT_CONFIG opengles1cl" -fi - if [ "$CFG_OPENGL" = "es2" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2" QT_CONFIG="$QT_CONFIG opengles2" @@ -6579,9 +6571,8 @@ fi # On Mac, set the minimum deployment target for the different architechtures # using the Xarch compiler option when supported (10.5 and up). On 10.4 the # deployment version is set to 10.4 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET -# env. variable. "-cocoa" on the command line means Cocoa is used in 32-bit mode also, -# in this case fall back on QMAKE_MACOSX_DEPLOYMENT_TARGET which will be set to 10.5. -if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] && [ "$COMMANDLINE_MAC_COCOA" != "yes" ]; then +# env. variable. +if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" != "no" ] ; then if echo "$CFG_MAC_ARCHS" | grep '\<x86\>' > /dev/null 2>&1; then QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=10.4" QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=10.4" @@ -6901,9 +6892,9 @@ if [ "$CFG_LARGEFILE" = "yes" ]; then fi # if both carbon and cocoa are specified, enable the autodetection code. -if [ "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then - echo "#define AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new" -elif [ "$CFG_MAC_COCOA" = "yes" ]; then +if [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" -a "$CFG_MAC_CARBON" = "yes" ]; then + echo "#define QT_AUTODETECT_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new" +elif [ "$PLATFORM_MAC" = "yes" -a "$CFG_MAC_COCOA" = "yes" ]; then echo "#define QT_MAC_USE_COCOA 1" >>"$outpath/src/corelib/global/qconfig.h.new" fi @@ -7503,8 +7494,6 @@ if [ "$CFG_OPENGL" = "desktop" ]; then echo "OpenGL support ...... yes (Desktop OpenGL)" elif [ "$CFG_OPENGL" = "es1" ]; then echo "OpenGL support ...... yes (OpenGL ES 1.x Common profile)" -elif [ "$CFG_OPENGL" = "es1cl" ]; then - echo "OpenGL support ...... yes (OpenGL ES 1.x Common Lite profile)" elif [ "$CFG_OPENGL" = "es2" ]; then echo "OpenGL support ...... yes (OpenGL ES 2.x)" else @@ -7821,20 +7810,6 @@ done rm -f .projects .projects.3 #------------------------------------------------------------------------------- -# XShape is important, DnD in the Designer doens't work without it -#------------------------------------------------------------------------------- -if [ "$PLATFORM_X11" = "yes" ] && [ "$CFG_XSHAPE" = "no" ]; then - cat <<EOF - - NOTICE: Qt will not be built with XShape support. - - As a result, drag-and-drop in the Qt Designer will NOT - work. We recommend that you enable XShape support by passing - the -xshape switch to $0. -EOF -fi - -#------------------------------------------------------------------------------- # check for platforms that we don't yet know about #------------------------------------------------------------------------------- if [ "$CFG_ARCH" = "generic" ]; then diff --git a/demos/browser/browsermainwindow.cpp b/demos/browser/browsermainwindow.cpp index ed36c25..8c2ed89 100644 --- a/demos/browser/browsermainwindow.cpp +++ b/demos/browser/browsermainwindow.cpp @@ -433,10 +433,8 @@ void BrowserMainWindow::setupMenu() QMenu *toolsMenu = menuBar()->addMenu(tr("&Tools")); toolsMenu->addAction(tr("Web &Search"), this, SLOT(slotWebSearch()), QKeySequence(tr("Ctrl+K", "Web Search"))); -#ifndef Q_CC_MINGW a = toolsMenu->addAction(tr("Enable Web &Inspector"), this, SLOT(slotToggleInspector(bool))); a->setCheckable(true); -#endif QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt())); diff --git a/demos/demos.pro b/demos/demos.pro index 5a9b6db..08dd8af 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -38,7 +38,7 @@ wince*: SUBDIRS = \ demos_undo \ demos_sub-attaq -contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl):!contains(QT_CONFIG, opengles2):{ +contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles2):{ SUBDIRS += demos_boxes } diff --git a/dist/changes-4.7.0 b/dist/changes-4.7.0 new file mode 100644 index 0000000..92f5244 --- /dev/null +++ b/dist/changes-4.7.0 @@ -0,0 +1,122 @@ +Qt 4.7 introduces many new features and improvements as well as bugfixes +over the 4.6.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.trolltech.com/4.7 + +The Qt version 4.7 series is binary compatible with the 4.6.x series. +Applications compiled for 4.6 will continue to run with 4.7. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Task Tracker: + + http://www.qtsoftware.com/developer/task-tracker + +Each of these identifiers can be entered in the task tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + +General Improvements +-------------------- + +- Documentation and Examples + +Third party components +---------------------- + + +**************************************************************************** +* Library * +**************************************************************************** + + +**************************************************************************** +* Database Drivers * +**************************************************************************** + + +**************************************************************************** +* 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 * +**************************************************************************** + +- Build System + +- Assistant + + +- Designer + + +- Linguist + - Linguist GUI + + - lupdate + + - lrelease + + +- rcc + + +- moc + + +- uic + + +- uic3 + + +- qmake + + +- configure + + +- qtconfig + + +- qt3to4 + + +**************************************************************************** +* Plugins * +**************************************************************************** + + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc index 575a6dc..51383da 100644 --- a/doc/src/deployment/deployment.qdoc +++ b/doc/src/deployment/deployment.qdoc @@ -87,30 +87,28 @@ \header \o {4,1} Qt's Libraries \row - \o \l {QtAssistant} \o \l {QAxContainer} \o \l {QAxServer} \o \l {QtCore} - \row \o \l {QtDBus} + \row \o \l {QtDesigner} \o \l {QtGui} \o \l {QtHelp} - \row \o \l {QtNetwork} + \row \o \l {QtOpenGL} \o \l {QtScript} \o \l {QtScriptTools} - \row \o \l {QtSql} + \row \o \l {QtSvg} \o \l {QtWebKit} \o \l {QtXml} - \row \o \l {QtXmlPatterns} + \row \o \l {Phonon Module}{Phonon} \o \l {Qt3Support} - \o \endtable Since Qt is not a system library, it has to be redistributed along diff --git a/doc/src/development/assistant-manual.qdoc b/doc/src/development/assistant-manual.qdoc index c4eb615..7d56ea1 100644 --- a/doc/src/development/assistant-manual.qdoc +++ b/doc/src/development/assistant-manual.qdoc @@ -154,13 +154,17 @@ \row \o -unregister <doc.qch> \o Unregisters the specified compressed help file from the given - collection file. + collection file. \row \o -remove-search-index \o Purges the help search engine's index. This option is useful in case the associated index files get corrupted. \QA will re-index the documentation at the next start-up. \row + \o -rebuild-search-index + \o Rebuilds the help search engine's index. + Note that this operation may take a while to finish. + \row \o -setCurrentFilter <filter> \o Sets the given filter as the active filter. \row @@ -638,12 +642,19 @@ file in the \c{file} tags. It is possible to specify a different file or any language. The icon defined by the \c{icon} tags is applied to any language. \row - \o \c{<cacheDirectory>} - \o Specified as a path relative to the directory given by - QDesktopServices::DataLocation, the cache path is used to store index files + \o \c{<cacheDirectory base="collection|default">} + \o The cache directory is used to store index files needed for the full text search and a copy of the collection file. - The copy is needed because \QA stores all its settings in the collection file; - i.e., it must be writable for the user. + The copy is needed because \QA stores all its settings in the collection file; i.e., it must be writable for the user. + The directory is specified as a relative path. + If the \c{base} attribute is set to "collection", the path is + relative to the directory the collection file resides in. + If the attribute is set to "default" or if it is missing, + the path is relative to the directory given by + QDesktopServices::DataLocation. The first form is useful for + collections that are used in a "mobile" way, e.g. carried around + on a USB stick. + \endtable In addition to those \QA specific tags, the tags for generating and registering @@ -677,9 +688,6 @@ to make Assistant listen to your application, turn on its remote control functionality by passing the \c{-enableRemoteControl} command line option. - \warning The trailing '\0' must be appended separately to the QByteArray, - e.g., \c{QByteArray("command" + '\0')}. - The following example shows how this can be done: \snippet doc/src/snippets/code/doc_src_assistant-manual.qdoc 2 @@ -690,6 +698,9 @@ \snippet doc/src/snippets/code/doc_src_assistant-manual.qdoc 3 + Note that the trailing newline character is required to mark the end + of the input. + The following commands can be used to control \QA: \table @@ -727,13 +738,20 @@ \o Selects the item in the contents widget which corresponds to the currently displayed page. \row - \o \c{setCurrentFilter} + \o \c{setCurrentFilter <filter>} \o Selects the specified filter and updates the visual representation accordingly. \row \o \c{expandToc <Depth>} \o Expands the table of contents tree to the given depth. If depth - is less than 1, the tree will be collapsed completely. + is 0, the tree will be collapsed completely. If depth is -1, + the tree will be expanded completely. + \row + \o \c{register <help file>} + \o Adds the given Qt compressed help file to the collection. + \row + \o \c{unregister <help file>} + \o Removes the given Qt compressed help file from the collection. \endtable If you want to send several commands within a short period of time, it is diff --git a/doc/src/development/developing-on-mac.qdoc b/doc/src/development/developing-on-mac.qdoc index b0862cf..20eefb7 100644 --- a/doc/src/development/developing-on-mac.qdoc +++ b/doc/src/development/developing-on-mac.qdoc @@ -60,26 +60,26 @@ \section1 What Versions of Mac OS X are Supported? - As of Qt 4.6, Qt supports Mac OS X versions 10.4 and up. It is usually in + As of Qt 4.7, Qt supports Mac OS X versions 10.4 and up. It is usually in the best interest of the developer and user to be running the latest updates to any version. We test internally against Mac OS X 10.4.11 as well as the updated release of Mac OS X 10.5 and Mac OS X 10.6. \section2 Carbon or Cocoa? - Historically, Qt has used the Carbon toolkit, which supports 32-bit - applications on Mac OS X 10.4 and up. Qt 4.5 and up has support for the Cocoa - toolkit, which requires 10.5 and provides 64-bit support. - - This detail is typically not important to Qt application developers. Qt is - cross-platform across Carbon and Cocoa, and Qt applications behave - the same way when configured for either one. Eventually, the Carbon - version will be discontinued. This is something to keep in mind when you - consider writing code directly against native APIs. - - The current binary for Qt is built in two flavors, 32-bit Carbon and full - universal Cocoa (32-bit and 64-bit). If you want a different setup for - Qt will use, you must build from scratch. Carbon or Cocoa is chosen when + Qt supports building in two flavors, using either the Carbon or Cocoa APIs. + Using the Cocoa toolkit, Qt requires 10.5 and provides 64-bit support. With + Carbon Qt can be developed on and deployed to 10.4, but there is no 64-bit + support. + + With Qt 4.7 we now reccommend using the Cocoa version of Qt for developement, + unless you want to target the 10.4 platform. Qt now uses Cocoa by default, + both for the binary package and when configuring from source. Download the + Carbon binarypackages or configure with "-carbon" to use that version. + + There are two versions of the Qt binary, one with x86 and x86_64 + Cocoa and another with x86 and ppc Carbon. If you want a different setup + you must build from source. Carbon or Cocoa is chosen when configuring the package for building. The configure process selects Carbon by default, to specify Cocoa use the \c{-cocoa} flag. configure for a 64-bit architecture using one of the \c{-arch} flags (see \l{universal @@ -147,13 +147,11 @@ Carbon and Cocoa both have their advantages and disadvantages. Probably the easiest way to determine is to look at the version of Mac OS X you are - targetting. If you are starting a new application and can target 10.5 and - up, then please consider Cocoa only. If you have an existing application or - need to target earlier versions of the operating system and do not need - access to 64-bit or newer Apple technologies, then Carbon is a good fit. If - your needs fall in between, you can go with a 64-bit Cocoa and 32-bit - Carbon universal application with the appropriate checks in your code to - choose the right path based on where you are running the application. + targetting. If your application can target 10.5 and up, then we reccomend + using Cocoa. If you need to target earlier versions of the operating system + and do not need access to 64-bit or newer Apple technologies, then Carbon + is a good fit. If your needs fall in between, you can go with a 64-bit Cocoa and 32-bit + Carbon universal application. For Mac OS X 10.6, Apple has started recommending developers to build their applications 64-bit. The main reason is that there is a small speed diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 49e1e71..4ba7eba 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -1989,7 +1989,7 @@ distinction between shared and \section1 QMAKE_CFLAGS_WARN_OFF This variable is not empty if the warn_off - \l{#TEMPLATE}{TEMPLATE} option is specified. The value of this + \l{#CONFIG}{CONFIG} option is specified. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. @@ -1997,7 +1997,7 @@ distinction between shared and \section1 QMAKE_CFLAGS_WARN_ON This variable is not empty if the warn_on - \l{#TEMPLATE}{TEMPLATE} option is specified. + \l{#CONFIG}{CONFIG} option is specified. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. @@ -2264,11 +2264,11 @@ For example: If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_INCDIR_EGL may also need to be set. - \section1 QMAKE_INCDIR_OPENGL_ES1, QMAKE_INCDIR_OPENGL_ES1CL, QMAKE_INCDIR_OPENGL_ES2 + \section1 QMAKE_INCDIR_OPENGL_ES1, QMAKE_INCDIR_OPENGL_ES2 These variables contain the location of OpenGL headers files to be added - to INCLUDEPATH when building an application with OpenGL ES 1, OpenGL ES 1 Common - Lite or OpenGL ES 2 support respectively. + to INCLUDEPATH when building an application with OpenGL ES 1 + or OpenGL ES 2 support respectively. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. @@ -2522,10 +2522,10 @@ For example: variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. - \section1 QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES1CL, QMAKE_LIBS_OPENGL_ES2 + \section1 QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES2 - These variables contain all the OpenGL libraries for OpenGL ES 1, - OpenGL ES 1 Common Lite profile and OpenGL ES 2. + These variables contain all the OpenGL libraries for OpenGL ES 1 + and OpenGL ES 2. The value of these variables is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. diff --git a/doc/src/examples/completer.qdoc b/doc/src/examples/completer.qdoc index b69ea69..c0eb947 100644 --- a/doc/src/examples/completer.qdoc +++ b/doc/src/examples/completer.qdoc @@ -48,7 +48,7 @@ \image completer-example.png - This example uses a custom item model, \c DirModel, and a QCompleter object. + This example uses a custom item model, \c FileSystemModel, and a QCompleter object. QCompleter is a class that provides completions based on an item model. The type of model, the completion mode, and the case sensitivity can be selected using combo boxes. @@ -61,32 +61,32 @@ \quotefile examples/tools/completer/completer.qrc - \section1 DirModel Class Definition + \section1 FileSystemModel Class Definition - The \c DirModel class is a subclass of QDirModel, which provides a data + The \c FileSystemModel class is a subclass of QFileSystemModel, which provides a data model for the local filesystem. - \snippet examples/tools/completer/dirmodel.h 0 + \snippet examples/tools/completer/fsmodel.h 0 This class only has a constructor and a \c data() function as it is only created to enable \c data() to return the entire file path for the - display role, unlike \l{QDirModel}'s \c data() function that only returns + display role, unlike \l{QFileSystemModel}'s \c data() function that only returns the folder and not the drive label. This is further explained in - \c DirModel's implementation. + \c FileSystemModel's implementation. - \section1 DirModel Class Implementation + \section1 FileSystemModel Class Implementation - The constructor for the \c DirModel class is used to pass \a parent to - QDirModel. + The constructor for the \c FileSystemModel class is used to pass \a parent to + QFileSystemModel. - \snippet examples/tools/completer/dirmodel.cpp 0 + \snippet examples/tools/completer/fsmodel.cpp 0 As mentioned earlier, the \c data() function is reimplemented in order to get it to return the entire file parth for the display role. For example, - with a QDirModel, you will see "Program Files" in the view. However, with - \c DirModel, you will see "C:\\Program Files". + with a QFileSystemModel, you will see "Program Files" in the view. However, with + \c FileSystemModel, you will see "C:\\Program Files". - \snippet examples/tools/completer/dirmodel.cpp 1 + \snippet examples/tools/completer/fsmodel.cpp 1 The screenshots below illustrate this difference: @@ -120,7 +120,7 @@ is then invoked. We set up three QComboBox objects, \c modelComb, \c modeCombo and - \c caseCombo. By default, the \c modelCombo is set to QDirModel, + \c caseCombo. By default, the \c modelCombo is set to QFileSystemModel, the \c modeCombo is set to "Filtered Popup" and the \c caseCombo is set to "Case Insensitive". @@ -202,7 +202,7 @@ model selected by the user. A \c switch statement is used to change the item model based on the index - of \c modelCombo. If \c case is 0, we use an unsorted QDirModel, providing + of \c modelCombo. If \c case is 0, we use an unsorted QFileSystemModel, providing us with a file path excluding the drive label. \snippet examples/tools/completer/mainwindow.cpp 11 diff --git a/doc/src/examples/contextsensitivehelp.qdoc b/doc/src/examples/contextsensitivehelp.qdoc new file mode 100644 index 0000000..668fa36 --- /dev/null +++ b/doc/src/examples/contextsensitivehelp.qdoc @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example help/contextsensitivehelp + \title Context-Sensitive Help Example + + This example shows how to use the services of the QHelpEngineCore class. +*/ diff --git a/doc/src/examples/hellogl_es.qdoc b/doc/src/examples/hellogl_es.qdoc index fca1150..67a83e0 100644 --- a/doc/src/examples/hellogl_es.qdoc +++ b/doc/src/examples/hellogl_es.qdoc @@ -64,29 +64,6 @@ the OpenGL ES window within the native window manager. In QGLWidget::initializeGL() we initialize OpenGL ES. - \section1 Using OpenGL ES rendering commands - - To update the scene, we reimplment QGLWidget::paintGL(). We use OpenGL ES - rendering commands just like we do with standard OpenGL. Since the OpenGL - ES common light profile only supports fixed point functions, we need to - abstract it somehow. Hence, we define an abstraction layer in - \c{cl_helper.h}. - - \snippet examples/opengl/hellogl_es/cl_helper.h 0 - - Instead of \c glFogxv() or \c glFogfv() we use \c q_glFogv() and to - convert the coordinates of a vertice we use the macro \c f2vt(). That way, - if QT_OPENGL_ES_CL is defined we use the fixed point functions and every - float is converted to fixed point. - - If QT_OPENGL_ES_CL is not defined we use the floating point functions. - - \snippet examples/opengl/hellogl_es/cl_helper.h 1 - - This way we support OpenGL ES Common and Common Light with the same code - and abstract the fact that we use either the floating point functions or - otherwise the fixed point functions. - \section1 Porting OpenGL to OpenGL ES Since OpenGL ES is missing the immediate mode and does not support quads, diff --git a/doc/src/frameworks-technologies/activeqt-server.qdoc b/doc/src/frameworks-technologies/activeqt-server.qdoc index f28097f..4afcee1 100644 --- a/doc/src/frameworks-technologies/activeqt-server.qdoc +++ b/doc/src/frameworks-technologies/activeqt-server.qdoc @@ -99,10 +99,6 @@ \o Register the server \endlist - Note that the QAxServer build system is not supported on Windows 98/ME - (attaching of resources to a binary is not possible there), but a server - built on Windows NT/2000/XP will work on previous Windows versions as well. - To skip the post-processing step, also set the \c qaxserver_no_postlink configuration. @@ -413,8 +409,7 @@ \footnote OLE needs to marshal user defined types by reference (ByRef), and cannot marshal them by value (ByVal). This is why const-references and object - parameters are not supported for QRect, QSize and QPoint. Also note that - servers with this datatype require Windows 98 or DCOM 1.2 to be installed. + parameters are not supported for QRect, QSize and QPoint. \endfootnote \o [in, out] struct QRect (user defined) \row diff --git a/doc/src/getting-started/demos.qdoc b/doc/src/getting-started/demos.qdoc index 03e5aa6..6974634 100644 --- a/doc/src/getting-started/demos.qdoc +++ b/doc/src/getting-started/demos.qdoc @@ -46,7 +46,7 @@ \previouspage Qt Examples \contentspage How to Learn Qt - \nextpage What's New in Qt 4.6 + \nextpage What's New in Qt 4.7 This is the list of demonstrations in Qt's \c demos directory. These are larger and more complicated programs than the diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 0c18773..bc6404c 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -1218,6 +1218,8 @@ \list \o \l{help/simpletextviewer}{Simple Text Viewer}\raisedaster + \o \l{help/remotecontrol}{Remote Control} + \o \l{help/contextsensitivehelp}{Context-Sensitive Help} \endlist Examples marked with an asterisk (*) are fully documented. diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index b679250..638c2da 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -740,9 +740,9 @@ If you are using pre-built binaries, follow the instructions given in the \l{http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en}{here} to avoid runtime conflicts. - If you are using a source code package of Qt, you must first install Perl so + If you are using a source edition of Qt, you must first install Perl so that the syncqt script invoked by configure can be executed. You can download - this \l{http://www.activestate/downloads/}{here}. + this \l{http://www.activestate.com/downloads/}{here}. To build Qt with Phonon on Windows, you require: diff --git a/doc/src/howtos/timers.qdoc b/doc/src/howtos/timers.qdoc index b9c7bfa..cfc2fb4 100644 --- a/doc/src/howtos/timers.qdoc +++ b/doc/src/howtos/timers.qdoc @@ -72,7 +72,7 @@ The upper limit for the interval value is determined by the number of milliseconds that can be specified in a signed integer (in practice, this is a period of just over 24 days). The accuracy - depends on the underlying operating system. Windows 98 has 55 + depends on the underlying operating system. Windows 2000 has 15 millisecond accuracy; other systems that we have tested can handle 1 millisecond intervals. diff --git a/doc/src/images/container_bench.png b/doc/src/images/container_bench.png Binary files differnew file mode 100644 index 0000000..a707b1a --- /dev/null +++ b/doc/src/images/container_bench.png diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc index 7c3b4a1..0a603ce 100644 --- a/doc/src/index.qdoc +++ b/doc/src/index.qdoc @@ -60,7 +60,7 @@ <ul> <li><a href="installation.html">Installation</a> and <a href="how-to-learn-qt.html">First Steps with Qt</a></li> <li><a href="tutorials.html">Tutorials</a> and <a href="examples.html">Examples</a></li> - <li><a href="demos.html">Demonstrations</a> and <a href="qt4-6-intro.html"><b>New in Qt 4.6</b></a></li> + <li><a href="demos.html">Demonstrations</a> and <a href="qt4-7-intro.html"><b>New in Qt 4.7</b></a></li> </ul> </td> <td valign="top"> diff --git a/doc/src/internationalization/i18n.qdoc b/doc/src/internationalization/i18n.qdoc index b26a983..1ca6ab3 100644 --- a/doc/src/internationalization/i18n.qdoc +++ b/doc/src/internationalization/i18n.qdoc @@ -512,9 +512,6 @@ Note that some Windows programs do not understand big-endian Unicode text files even though that is the order prescribed by the Unicode Standard in the absence of higher-level protocols. - \o Unlike programs written with MFC or plain winlib, Qt programs - are portable between Windows 98 and Windows NT. - \e {You do not need different binaries to support Unicode.} \endlist \section2 Mac OS X diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index 44d6ed6..48e1358 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -1080,13 +1080,3 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." \endlegalese */ - -/*! - \page qtassistant.html - \title QtAssistant - - This module is no longer needed. Use the QtHelp module to integrate documentation - into your application. - - \sa {QtHelp} -*/ diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index e08bf1a..b64d67b 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -263,14 +263,6 @@ Install Qt into a subdirectory without spaces to avoid this problem. - \section2 AccelGALAXY graphic card - - When you use a NT 4.0 machine with the driver number - 4,00,1381,1000,021,4.0.0 there is a problem with drag an drop and icons. - The computer freezes, and you have to reset. The problem disappears with - the newest version of the driver, available at - \l{http://www.es.com/}{www.es.com}. - \section2 Possible GL conflict There is a known issue with running Microsoft NetMeeting, Lotus SameTime diff --git a/doc/src/platforms/wince-opengl.qdoc b/doc/src/platforms/wince-opengl.qdoc index afc1c0b..c1be4bc 100644 --- a/doc/src/platforms/wince-opengl.qdoc +++ b/doc/src/platforms/wince-opengl.qdoc @@ -53,7 +53,7 @@ Windows CE window manager. \section2 Configure -To configure Qt for Windows Mobile 5.0 and OpenGL ES Common Lite support +To configure Qt for Windows Mobile 5.0 and OpenGL ES Common support you can run \c{configure} like this: \snippet doc/src/snippets/code/doc_src_wince-opengl.qdoc 0 @@ -61,17 +61,12 @@ you can run \c{configure} like this: OpenGL ES includes profiles for floating-point and fixed-point arithmetic. The floating point profile is called OpenGL ES CM (Common) and the fixed-point profile is called OpenGL ES CL (Common Lite). +The fixed-point profile is no longer supported since Qt 4.7. You can run \c{configure} with the \c{-opengl-es-cm} option for the Common -profile or \c{-opengl-es-cl} for the Common Lite profile. In both cases, -ensure that the \c{lib} and \c{includes} paths include the OpenGL ES +profile. Ensure that the \c{lib} and \c{includes} paths include the OpenGL ES headers and libararies from your SDK. The OpenGL ES lib should be called -either \c{libGLES_CM.lib} for the Common profile or \c{libGLES_CL.lib} for -the Common Lite profile. - -The distinction between the Common and Common Lite profiles is important, -because the Common Lite profile has less functionality and only supports a -fixed-point vertex format. +either \c{libGLES_CM.lib} for the Common profile. To start programming with Qt and OpenGL ES on Windows CE, you can start with the \l{Hello GL ES Example}. This example shows how to use QGLWidget diff --git a/doc/src/porting/porting4.qdoc b/doc/src/porting/porting4.qdoc index d494b0c..25dc792 100644 --- a/doc/src/porting/porting4.qdoc +++ b/doc/src/porting/porting4.qdoc @@ -3793,11 +3793,10 @@ multimedia timer API, which gives us 1 millisecond resolution for QTimer. - Note that other versions of Windows have a lower timer resolution, - and that code relying on underlying system timer restrictions - encounters no such limitations using Qt 4 (e.g., setting an - interval of 0 millisecond results in Qt occupying all of the - processor time when no GUI events need processing). + Note that Windows 2000 has a lower timer resolution, and that code relying + on underlying system timer restrictions encounters no such limitations + using Qt 4 (e.g., setting an interval of 0 millisecond results in Qt + occupying all of the processor time when no GUI events need processing). \section1 QToolBar diff --git a/doc/src/qt4-intro.qdoc b/doc/src/qt4-intro.qdoc index daceba5..5344bcc 100644 --- a/doc/src/qt4-intro.qdoc +++ b/doc/src/qt4-intro.qdoc @@ -457,6 +457,30 @@ */ /*! + \page qt4-7-intro.html + \title What's New in Qt 4.7 + + Qt 4.7 provides many improvements and enhancements over the + previous releases in the Qt 4 series. This document covers the + most important features in this release, separated by category. + + A list of other Qt 4 features can be found on the \bold{\l{What's + New in Qt 4}} page. + + \bold{Highlights} + + \tableofcontents + + \section1 New Classes, Functions, Macros, etc. + + Links to new classes, functions, macros, and other items + introduced in Qt 4.7. + + \sincelist 4.7 + +*/ + +/*! \page qt4-6-intro.html \title What's New in Qt 4.6 diff --git a/doc/src/snippets/code/doc_src_assistant-manual.qdoc b/doc/src/snippets/code/doc_src_assistant-manual.qdoc index 7438365..96aa71d 100644 --- a/doc/src/snippets/code/doc_src_assistant-manual.qdoc +++ b/doc/src/snippets/code/doc_src_assistant-manual.qdoc @@ -58,7 +58,7 @@ assistant -collectionFile file <cacheDirectory>mycompany/myapplication</cacheDirectory> <aboutMenuText> <text>About My Application</text> - <text language="de">ber meine Applikation...</text> + <text language="de">Über meine Applikation...</text> </aboutMenuText> <aboutDialog> <file>about.txt</file> @@ -95,8 +95,7 @@ if (!process->waitForStarted()) //! [3] QByteArray ba; -ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html"); -ba.append('\0'); +ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html\n"); process->write(ba); //! [3] @@ -105,8 +104,7 @@ process->write(ba); QByteArray ba; ba.append("hide bookmarks;"); ba.append("hide index;"); -ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html"); -ba.append('\0'); +ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html\n"); process->write(ba); //! [4] diff --git a/doc/src/snippets/code/doc_src_wince-opengl.qdoc b/doc/src/snippets/code/doc_src_wince-opengl.qdoc index eef1540..601b00a 100644 --- a/doc/src/snippets/code/doc_src_wince-opengl.qdoc +++ b/doc/src/snippets/code/doc_src_wince-opengl.qdoc @@ -40,5 +40,5 @@ ****************************************************************************/ //! [0] -configure -platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005 -opengl-es-cl +configure -platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005 -opengl-es-cm //! [0] diff --git a/examples/assistant/README b/examples/assistant/README deleted file mode 100644 index 85f5a43..0000000 --- a/examples/assistant/README +++ /dev/null @@ -1,38 +0,0 @@ -Support for interactive help is provided by the Qt Assistant application. -Developers can take advantages of the facilities it offers to display -specially-prepared documentation to users of their applications. - - -The example launcher provided with Qt can be used to explore each of the -examples in this directory. - -Documentation for these examples can be found via the Tutorial and Examples -link in the main Qt documentation. - - -Finding the Qt Examples and Demos launcher -========================================== - -On Windows: - -The launcher can be accessed via the Windows Start menu. Select the menu -entry entitled "Qt Examples and Demos" entry in the submenu containing -the Qt tools. - -On Mac OS X: - -For the binary distribution, the qtdemo executable is installed in the -/Developer/Applications/Qt directory. For the source distribution, it is -installed alongside the other Qt tools on the path specified when Qt is -configured. - -On Unix/Linux: - -The qtdemo executable is installed alongside the other Qt tools on the path -specified when Qt is configured. - -On all platforms: - -The source code for the launcher can be found in the demos/qtdemo directory -in the Qt package. This example is built at the same time as the Qt libraries, -tools, examples, and demonstrations. diff --git a/examples/assistant/assistant.pro b/examples/assistant/assistant.pro deleted file mode 100644 index ff1f947..0000000 --- a/examples/assistant/assistant.pro +++ /dev/null @@ -1,10 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = simpletextviewer - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/assistant -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS assistant.pro README -sources.path = $$[QT_INSTALL_EXAMPLES]/assistant -INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) diff --git a/examples/assistant/simpletextviewer/documentation/about.txt b/examples/assistant/simpletextviewer/documentation/about.txt deleted file mode 100644 index eeab35f..0000000 --- a/examples/assistant/simpletextviewer/documentation/about.txt +++ /dev/null @@ -1,9 +0,0 @@ -The Simple Text Viewer enables the user to select and view existing -files. - -HTML files is displayed using rich text, while other files are -presented as plain text. The application provides a file dialog -allowing the user to search for files using wildcard matching. The -search is performed within in the specified directory, and the user is -given an option to browse the existing file system to find the -relevant directory. diff --git a/examples/assistant/simpletextviewer/documentation/browse.html b/examples/assistant/simpletextviewer/documentation/browse.html deleted file mode 100644 index 987abf3..0000000 --- a/examples/assistant/simpletextviewer/documentation/browse.html +++ /dev/null @@ -1,34 +0,0 @@ -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Browse</title> - </head> - <body style="font-size:12pt;font-family:helvetica"> - - <p><center><h2>Browse</h2></center></p> - - <p> - The file dialog let you browse the current file system to - specify the directory in which the file you want to open - resides. - Note that only the specified directory will be searched, any - subdirectories will simply be ignored. - </p> - - <br /> - <br /> - <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%"> - <tr valign="top" bgcolor="#f0f0f0"> - <td><center><img src="images/browse.png" /></center></td> - </tr> - </table> - - <br /> - <br /> - <p> - See also: <a href="filedialog.html">File Dialog</a>, <a href="wildcardmatching.html">Wildcard Matching</a>, - <a href="findfile.html">Find File</a> - </p> - </body> -</html> - diff --git a/examples/assistant/simpletextviewer/documentation/filedialog.html b/examples/assistant/simpletextviewer/documentation/filedialog.html deleted file mode 100644 index afa65ed..0000000 --- a/examples/assistant/simpletextviewer/documentation/filedialog.html +++ /dev/null @@ -1,48 +0,0 @@ -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>File Dialog</title> - </head> - <body style="font-size:12pt;font-family:helvetica"> - - <p><center><h2>File Dialog</h2></center></p> - - <p> - In the file dialog you can name a particular file name, or - search for files using wildcard matching, i.e. specify a - file name containing wildcards. In addition you must specify - the directory in which the file you search for resides. - </p> - - <br /> - <br /> - <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%"> - <tr valign="top" bgcolor="#f0f0f0"> - <td><center><img src="images/filedialog.png" /></center></td> - </tr> - </table> - - <br /> - <br /> - <p> - By default the dialog will search for all files (*) in the - current directory (the directory the application is run from). - </p> - - <p> - When editing the file name and directory parameters, an - overview of the matching files are displayed in the - dialog. The overview is updated whenever the parameters - change. - </p> - - <br /> - <br /> - <p> - See also: <a href="browse.html">Browse</a>, <a href="wildcardmatching.html">Wildcard Matching</a>, - <a href="findfile.html">Find File</a> - </p> - </body> -</html> - - diff --git a/examples/assistant/simpletextviewer/documentation/findfile.html b/examples/assistant/simpletextviewer/documentation/findfile.html deleted file mode 100644 index 32e0147..0000000 --- a/examples/assistant/simpletextviewer/documentation/findfile.html +++ /dev/null @@ -1,32 +0,0 @@ -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Find File</title> - </head> - <body style="font-size:12pt;font-family:helvetica"> - - <p><center><h2>Find File</h2></center></p> - - <p> - To open and view a file in the Simple Text Viewer, select the - 'Open...' option in the 'File' menu. The application will then - provide you with a file dialog that you can use to search for - any existing file. - </p> - - <br /> - <br /> - <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%"> - <tr valign="top" bgcolor="#f0f0f0"> - <td><center><img src="images/fadedfilemenu.png" /></center></td> - </tr> - </table> - - <br /> - <br /> - <p> - See also: <a href="openfile.html">Open File</a>, <a href="filedialog.html">File Dialog</a> - </p> - </body> -</html> - diff --git a/examples/assistant/simpletextviewer/documentation/images/browse.png b/examples/assistant/simpletextviewer/documentation/images/browse.png Binary files differdeleted file mode 100644 index 86db6b1..0000000 --- a/examples/assistant/simpletextviewer/documentation/images/browse.png +++ /dev/null diff --git a/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png b/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png Binary files differdeleted file mode 100644 index fde0e43..0000000 --- a/examples/assistant/simpletextviewer/documentation/images/fadedfilemenu.png +++ /dev/null diff --git a/examples/assistant/simpletextviewer/documentation/images/filedialog.png b/examples/assistant/simpletextviewer/documentation/images/filedialog.png Binary files differdeleted file mode 100644 index 883a33a..0000000 --- a/examples/assistant/simpletextviewer/documentation/images/filedialog.png +++ /dev/null diff --git a/examples/assistant/simpletextviewer/documentation/images/handbook.png b/examples/assistant/simpletextviewer/documentation/images/handbook.png Binary files differdeleted file mode 100644 index 3bd2b92..0000000 --- a/examples/assistant/simpletextviewer/documentation/images/handbook.png +++ /dev/null diff --git a/examples/assistant/simpletextviewer/documentation/images/mainwindow.png b/examples/assistant/simpletextviewer/documentation/images/mainwindow.png Binary files differdeleted file mode 100644 index c28d5e9..0000000 --- a/examples/assistant/simpletextviewer/documentation/images/mainwindow.png +++ /dev/null diff --git a/examples/assistant/simpletextviewer/documentation/images/open.png b/examples/assistant/simpletextviewer/documentation/images/open.png Binary files differdeleted file mode 100644 index 1e5bba3..0000000 --- a/examples/assistant/simpletextviewer/documentation/images/open.png +++ /dev/null diff --git a/examples/assistant/simpletextviewer/documentation/images/wildcard.png b/examples/assistant/simpletextviewer/documentation/images/wildcard.png Binary files differdeleted file mode 100644 index 6e83a56..0000000 --- a/examples/assistant/simpletextviewer/documentation/images/wildcard.png +++ /dev/null diff --git a/examples/assistant/simpletextviewer/documentation/index.html b/examples/assistant/simpletextviewer/documentation/index.html deleted file mode 100644 index 5a7b1d5..0000000 --- a/examples/assistant/simpletextviewer/documentation/index.html +++ /dev/null @@ -1,41 +0,0 @@ -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Manual</title> - </head> - <body style="font-size:12pt;font-family:helvetica"> - - <p><center><h2>Simple Text Viewer</h2></center></p> - - <p> - The Simple Text Viewer enables the user to select and view - existing files. - </p> - - <p><center> - <img src="images/mainwindow.png" /> - </center></p> - - <p> - HTML files is displayed using rich text, while - other files are presented as plain text. The application - provides a file dialog allowing the user to search for files - using wildcard matching. The search is performed within in the - specified directory, and the user is given an option to browse - the existing file system to find the relevant directory. - </p> - - <ul> - <li><a href="findfile.html">Find File</a></li> - <ul> - <li><a href="filedialog.html">File Dialog</a></li> - <li><a href="wildcardmatching.html">WildCard Matching</a></li> - <li><a href="browse.html">Browse</a></li> - </ul> - <li><a href="openfile.html">Open File</a></li> - </ul> - </body> -</html> - - - diff --git a/examples/assistant/simpletextviewer/documentation/intro.html b/examples/assistant/simpletextviewer/documentation/intro.html deleted file mode 100644 index 2e2aa40..0000000 --- a/examples/assistant/simpletextviewer/documentation/intro.html +++ /dev/null @@ -1,28 +0,0 @@ -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Manual</title> - </head> - <body style="font-size:12pt;font-family:helvetica"> - - <p><center><h2>Simple Text Viewer</h2></center></p> - - <p> - The Simple Text Viewer enables the user to select and view - existing files. - </p> - - <p><center> - <img src="images/mainwindow.png" /> - </center></p> - - <p> - The application provides its own custom documentation that is - available through the <b>Help</b> menu in the main window's menubar - and through the <b>Help</b> button in the application's find file - dialog. - </p> - - </body> -</html> - diff --git a/examples/assistant/simpletextviewer/documentation/openfile.html b/examples/assistant/simpletextviewer/documentation/openfile.html deleted file mode 100644 index e172de9..0000000 --- a/examples/assistant/simpletextviewer/documentation/openfile.html +++ /dev/null @@ -1,36 +0,0 @@ -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Open File</title> - </head> - <body style="font-size:12pt;font-family:helvetica"> - - <p><center><h2>Open File</h2></center></p> - - <p> - Once the file you want to view appears in the dialog's - display, you can open it in two different ways. - </p> - - <p> - By pressing the 'Open' button the currently selected file will - be opened. By default, the first file in the list of matching - files is selected. Another way of opening a file is to simply - double click the displayed file name. - </p> - - <br /> - <br /> - <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%"> - <tr valign="top" bgcolor="#f0f0f0"> - <td><center><img src="images/open.png" /></center></td> - </tr> - </table> - - <br /> - <br /> - <p> - See also: <a href="findfile.html">Find File</a> - </p> - </body> -</html> diff --git a/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp b/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp deleted file mode 100644 index 660df4f..0000000 --- a/examples/assistant/simpletextviewer/documentation/simpletextviewer.adp +++ /dev/null @@ -1,40 +0,0 @@ -<!DOCTYPE DCF> - -<assistantconfig version="3.2.0"> - -<profile> - <property name="name">simpletextviewer</property> - <property name="title">Simple Text Viewer</property> - <property name="applicationicon">images/handbook.png</property> - <property name="startpage">index.html</property> - <property name="aboutmenutext">About Simple Text Viewer</property> - <property name="abouturl">about.txt</property> - <property name="assistantdocs">.</property> -</profile> - -<DCF ref="index.html" icon="images/handbook.png" title="Simple Text Viewer"> - <section ref="./findfile.html" title="Find File"> - <keyword ref="./index.html">Display</keyword> - <keyword ref="./index.html">Rich text</keyword> - <keyword ref="./index.html">Plain text</keyword> - <keyword ref="./findfile.html">Find</keyword> - <keyword ref="./findfile.html">File menu</keyword> - <keyword ref="./filedialog.html">File name</keyword> - <keyword ref="./filedialog.html">File dialog</keyword> - <keyword ref="./wildcardmatching.html">File globbing</keyword> - <keyword ref="./wildcardmatching.html">Wildcard matching</keyword> - <keyword ref="./wildcardmatching.html">Wildcard syntax</keyword> - <keyword ref="./browse.html">Browse</keyword> - <keyword ref="./browse.html">Directory</keyword> - <keyword ref="./openfile.html">Open</keyword> - <keyword ref="./openfile.html">Select</keyword> - - <section ref="./filedialog.html" title="File Dialog" /> - <section ref="./wildcardmatching.html" title="Wildcard Matching" /> - <section ref="./browse.html" title="Browse" /> - </section> - <section ref="./openfile.html" title="Open File" /> -</DCF> - -</assistantconfig> - diff --git a/examples/assistant/simpletextviewer/documentation/wildcardmatching.html b/examples/assistant/simpletextviewer/documentation/wildcardmatching.html deleted file mode 100644 index eb1839a..0000000 --- a/examples/assistant/simpletextviewer/documentation/wildcardmatching.html +++ /dev/null @@ -1,57 +0,0 @@ -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - <title>Wildcard Matching</title> - </head> - <body style="font-size:12pt;font-family:helvetica"> - - <p><center><h2>Wildcard Matching</h2></center></p> - - <p> - Most command shells such as bash or cmd.exe support "file - globbing", the ability to identify a group of files by using - wildcards. - - <br /> - <br /> - <table align="center" cellpadding="2" cellspacing="1" border="0" width="100%"> - <tr valign="top" bgcolor="#f0f0f0"> - <td><center><img src="images/wildcard.png" /></center></td> - </tr> - </table> - - <br /> - <br /> - <p> - Wildcard matching provides four features: - </p> - - <ul> - <li>Any character represents itself apart from those - mentioned below. Thus 'c' matches the character 'c'. - </li> - <li>The '?' character matches any single character.</li> - <li>The '*' matches zero or more of any characters.</li> - <li>Sets of characters can be represented in square brackets. - Within the character class, like outside, backslash - has no special meaning. - </li> - </ul> - - <p> - For example we could identify HTML files with - <code>*.html</code>. This will match zero or more characters - followed by a dot followed by 'h', 't', 'm' and 'l'. - </p> - - <br /> - <br /> - <p> - See also: <a href="browse.html">Browse</a>, <a href="filedialog.html">File Dialog</a>, - <a href="findfile.html">Find File</a> - </p> - </body> -</html> - - - diff --git a/examples/assistant/simpletextviewer/findfiledialog.cpp b/examples/assistant/simpletextviewer/findfiledialog.cpp deleted file mode 100644 index 1f11f69..0000000 --- a/examples/assistant/simpletextviewer/findfiledialog.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> - -#include "findfiledialog.h" - -//! [0] -FindFileDialog::FindFileDialog(QTextEdit *editor, QAssistantClient *assistant, - QWidget *parent) - : QDialog(parent) -{ - currentAssistantClient = assistant; - currentEditor = editor; -//! [0] - - createButtons(); - createComboBoxes(); - createFilesTree(); - createLabels(); - createLayout(); - - directoryComboBox->addItem(QDir::toNativeSeparators(QDir::currentPath())); - fileNameComboBox->addItem("*"); - findFiles(); - - setWindowTitle(tr("Find File")); -//! [1] -} -//! [1] - -void FindFileDialog::browse() -{ - QString currentDirectory = directoryComboBox->currentText(); - QString newDirectory = QFileDialog::getExistingDirectory(this, - tr("Select Directory"), currentDirectory); - if (!newDirectory.isEmpty()) { - directoryComboBox->addItem(QDir::toNativeSeparators(newDirectory)); - directoryComboBox->setCurrentIndex(directoryComboBox->count() - 1); - update(); - } -} - -//! [2] -void FindFileDialog::help() -{ - currentAssistantClient->showPage(QLibraryInfo::location(QLibraryInfo::ExamplesPath) + - QDir::separator() + "assistant/simpletextviewer/documentation/filedialog.html"); -} -//! [2] - -void FindFileDialog::openFile(QTreeWidgetItem *item) -{ - if (!item) { - item = foundFilesTree->currentItem(); - if (!item) - return; - } - - QString fileName = item->text(0); - QString path = directoryComboBox->currentText() + QDir::separator(); - - QFile file(path + fileName); - if (file.open(QIODevice::ReadOnly)) { - QString data(file.readAll()); - - if (fileName.endsWith(QLatin1String(".html"))) - currentEditor->setHtml(data); - else - currentEditor->setPlainText(data); - } - close(); -} - -void FindFileDialog::update() -{ - findFiles(); - buttonBox->button(QDialogButtonBox::Open)->setEnabled( - foundFilesTree->topLevelItemCount() > 0); -} - -void FindFileDialog::findFiles() -{ - QRegExp filePattern(fileNameComboBox->currentText() + '*'); - filePattern.setPatternSyntax(QRegExp::Wildcard); - - QDir directory(directoryComboBox->currentText()); - - QStringList allFiles = directory.entryList(QDir::Files | QDir::NoSymLinks); - QStringList matchingFiles; - - foreach (const QString &file, allFiles) { - if (filePattern.exactMatch(file)) - matchingFiles << file; - } - showFiles(matchingFiles); -} - -void FindFileDialog::showFiles(const QStringList &files) -{ - foundFilesTree->clear(); - - for (int i = 0; i < files.count(); ++i) { - QTreeWidgetItem *item = new QTreeWidgetItem(foundFilesTree); - item->setText(0, files[i]); - } - - if (files.count() > 0) - foundFilesTree->setCurrentItem(foundFilesTree->topLevelItem(0)); -} - -void FindFileDialog::createButtons() -{ - browseButton = new QToolButton; - browseButton->setText(tr("...")); - connect(browseButton, SIGNAL(clicked()), this, SLOT(browse())); - - buttonBox = new QDialogButtonBox(QDialogButtonBox::Open - | QDialogButtonBox::Cancel - | QDialogButtonBox::Help); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(openFile())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(help())); -} - -void FindFileDialog::createComboBoxes() -{ - directoryComboBox = new QComboBox; - fileNameComboBox = new QComboBox; - - fileNameComboBox->setEditable(true); - fileNameComboBox->setSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Preferred); - - directoryComboBox->setMinimumContentsLength(30); - directoryComboBox->setSizeAdjustPolicy( - QComboBox::AdjustToMinimumContentsLength); - directoryComboBox->setSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Preferred); - - connect(fileNameComboBox, SIGNAL(editTextChanged(QString)), - this, SLOT(update())); - connect(directoryComboBox, SIGNAL(currentIndexChanged(QString)), - this, SLOT(update())); -} - -void FindFileDialog::createFilesTree() -{ - foundFilesTree = new QTreeWidget; - foundFilesTree->setColumnCount(1); - foundFilesTree->setHeaderLabels(QStringList(tr("Matching Files"))); - foundFilesTree->setRootIsDecorated(false); - foundFilesTree->setSelectionMode(QAbstractItemView::SingleSelection); - - connect(foundFilesTree, SIGNAL(itemActivated(QTreeWidgetItem*,int)), - this, SLOT(openFile(QTreeWidgetItem*))); -} - -void FindFileDialog::createLabels() -{ - directoryLabel = new QLabel(tr("Search in:")); - fileNameLabel = new QLabel(tr("File name (including wildcards):")); -} - -void FindFileDialog::createLayout() -{ - QHBoxLayout *fileLayout = new QHBoxLayout; - fileLayout->addWidget(fileNameLabel); - fileLayout->addWidget(fileNameComboBox); - - QHBoxLayout *directoryLayout = new QHBoxLayout; - directoryLayout->addWidget(directoryLabel); - directoryLayout->addWidget(directoryComboBox); - directoryLayout->addWidget(browseButton); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addLayout(fileLayout); - mainLayout->addLayout(directoryLayout); - mainLayout->addWidget(foundFilesTree); - mainLayout->addStretch(); - mainLayout->addWidget(buttonBox); - setLayout(mainLayout); -} diff --git a/examples/assistant/simpletextviewer/mainwindow.cpp b/examples/assistant/simpletextviewer/mainwindow.cpp deleted file mode 100644 index 03eab02..0000000 --- a/examples/assistant/simpletextviewer/mainwindow.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> - -#include "mainwindow.h" -#include "findfiledialog.h" - -//! [0] -MainWindow::MainWindow() -{ - textViewer = new QTextEdit; - textViewer->setReadOnly(true); - QFile file("documentation/intro.html"); - if (file.open(QIODevice::ReadOnly)) - textViewer->setHtml(file.readAll()); - - setCentralWidget(textViewer); - - createActions(); - createMenus(); - - initializeAssistant(); - - setWindowTitle(tr("Simple Text Viewer")); - resize(750, 400); -} -//! [0] - -//! [1] -void MainWindow::closeEvent(QCloseEvent *) -{ - if (assistantClient) - assistantClient->closeAssistant(); -} -//! [1] - -void MainWindow::about() -{ - QMessageBox::about(this, tr("About Simple Text Viewer"), - tr("This example demonstrates how to use\n" \ - "Qt Assistant as help system for your\n" \ - "own application.")); -} - -//! [2] -void MainWindow::assistant() -{ - assistantClient->showPage(QLibraryInfo::location(QLibraryInfo::ExamplesPath) + - QDir::separator() + - "assistant/simpletextviewer/documentation/index.html"); -} -//! [2] - -//! [3] -void MainWindow::open() -{ - FindFileDialog dialog(textViewer, assistantClient); - dialog.exec(); -} -//! [3] - -void MainWindow::createActions() -{ - assistantAct = new QAction(tr("Help Contents"), this); - assistantAct->setShortcuts(QKeySequence::HelpContents); - connect(assistantAct, SIGNAL(triggered()), this, SLOT(assistant())); - - openAct = new QAction(tr("&Open..."), this); - openAct->setShortcuts(QKeySequence::Open); - connect(openAct, SIGNAL(triggered()), this, SLOT(open())); - - clearAct = new QAction(tr("&Clear"), this); - clearAct->setShortcut(tr("Ctrl+C")); - connect(clearAct, SIGNAL(triggered()), textViewer, SLOT(clear())); - - exitAct = new QAction(tr("E&xit"), this); - exitAct->setShortcuts(QKeySequence::Quit); - connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); - - aboutAct = new QAction(tr("&About"), this); - connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); - - aboutQtAct = new QAction(tr("About &Qt"), this); - connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); -} - -void MainWindow::createMenus() -{ - fileMenu = new QMenu(tr("&File"), this); - fileMenu->addAction(openAct); - fileMenu->addAction(clearAct); - fileMenu->addSeparator(); - fileMenu->addAction(exitAct); - - helpMenu = new QMenu(tr("&Help"), this); - helpMenu->addAction(assistantAct); - helpMenu->addSeparator(); - helpMenu->addAction(aboutAct); - helpMenu->addAction(aboutQtAct); - - - menuBar()->addMenu(fileMenu); - menuBar()->addMenu(helpMenu); -} - -//! [4] -void MainWindow::initializeAssistant() -{ - assistantClient = new QAssistantClient(QLibraryInfo::location(QLibraryInfo::BinariesPath), this); - - QStringList arguments; - arguments << "-profile" << QString("documentation") + QDir::separator() + QString("simpletextviewer.adp"); - assistantClient->setArguments(arguments); -} -//! [4] diff --git a/examples/assistant/simpletextviewer/simpletextviewer.pro b/examples/assistant/simpletextviewer/simpletextviewer.pro deleted file mode 100644 index 2c0eada..0000000 --- a/examples/assistant/simpletextviewer/simpletextviewer.pro +++ /dev/null @@ -1,18 +0,0 @@ -CONFIG += assistant - -QT += network - -HEADERS = mainwindow.h \ - findfiledialog.h -SOURCES = main.cpp \ - mainwindow.cpp \ - findfiledialog.cpp - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer -sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer -INSTALLS += target sources - -symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri) - diff --git a/examples/dbus/dbus-chat/chat_adaptor.cpp b/examples/dbus/dbus-chat/chat_adaptor.cpp index dc07e1c..77e7ab0 100644 --- a/examples/dbus/dbus-chat/chat_adaptor.cpp +++ b/examples/dbus/dbus-chat/chat_adaptor.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -i chat_adaptor.h -a :chat_adaptor.cpp com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i chat_adaptor.h -a :chat_adaptor.cpp com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. diff --git a/examples/dbus/dbus-chat/chat_adaptor.h b/examples/dbus/dbus-chat/chat_adaptor.h index b1e66ad..47b7f8f 100644 --- a/examples/dbus/dbus-chat/chat_adaptor.h +++ b/examples/dbus/dbus-chat/chat_adaptor.h @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -a chat_adaptor.h: com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -a chat_adaptor.h: com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments @@ -49,8 +49,8 @@ ** ****************************************************************************/ -#ifndef CHAT_ADAPTOR_H_142741156243605 -#define CHAT_ADAPTOR_H_142741156243605 +#ifndef CHAT_ADAPTOR_H_1257535021 +#define CHAT_ADAPTOR_H_1257535021 #include <QtCore/QObject> #include <QtDBus/QtDBus> @@ -72,14 +72,14 @@ class ChatAdaptor: public QDBusAbstractAdaptor Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.trolltech.chat") Q_CLASSINFO("D-Bus Introspection", "" -" <interface name=\"com.trolltech.chat\" >\n" -" <signal name=\"message\" >\n" -" <arg direction=\"out\" type=\"s\" name=\"nickname\" />\n" -" <arg direction=\"out\" type=\"s\" name=\"text\" />\n" +" <interface name=\"com.trolltech.chat\">\n" +" <signal name=\"message\">\n" +" <arg direction=\"out\" type=\"s\" name=\"nickname\"/>\n" +" <arg direction=\"out\" type=\"s\" name=\"text\"/>\n" " </signal>\n" -" <signal name=\"action\" >\n" -" <arg direction=\"out\" type=\"s\" name=\"nickname\" />\n" -" <arg direction=\"out\" type=\"s\" name=\"text\" />\n" +" <signal name=\"action\">\n" +" <arg direction=\"out\" type=\"s\" name=\"nickname\"/>\n" +" <arg direction=\"out\" type=\"s\" name=\"text\"/>\n" " </signal>\n" " </interface>\n" "") diff --git a/examples/dbus/dbus-chat/chat_interface.cpp b/examples/dbus/dbus-chat/chat_interface.cpp index f187ee0..3aba098 100644 --- a/examples/dbus/dbus-chat/chat_interface.cpp +++ b/examples/dbus/dbus-chat/chat_interface.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -i chat_interface.h -p :chat_interface.cpp chat/com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i chat_interface.h -p :chat_interface.cpp com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments diff --git a/examples/dbus/dbus-chat/chat_interface.h b/examples/dbus/dbus-chat/chat_interface.h index 3bf427b..a6aa2df 100644 --- a/examples/dbus/dbus-chat/chat_interface.h +++ b/examples/dbus/dbus-chat/chat_interface.h @@ -38,18 +38,18 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -p chat_interface.h: com.trolltech.chat.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -p chat_interface.h: com.trolltech.chat.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. ** ****************************************************************************/ -#ifndef CHAT_INTERFACE_H_143021156243606 -#define CHAT_INTERFACE_H_143021156243606 +#ifndef CHAT_INTERFACE_H_1257535021 +#define CHAT_INTERFACE_H_1257535021 #include <QtCore/QObject> #include <QtCore/QByteArray> diff --git a/examples/dbus/remotecontrolledcar/car/car.pro b/examples/dbus/remotecontrolledcar/car/car.pro index 9b426d3..d362dc9 100644 --- a/examples/dbus/remotecontrolledcar/car/car.pro +++ b/examples/dbus/remotecontrolledcar/car/car.pro @@ -10,7 +10,7 @@ CONFIG += qdbus # Input # DBUS_ADAPTORS += car.xml -HEADERS += car.h car_adaptor_p.h +HEADERS += car.h car_adaptor.h SOURCES += car.cpp main.cpp car_adaptor.cpp # install diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp b/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp index bd4832e..da7505b 100644 --- a/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp +++ b/examples/dbus/remotecontrolledcar/car/car_adaptor.cpp @@ -38,17 +38,17 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarAdaptor -a car_adaptor_p.h:car_adaptor.cpp car.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i car_adaptor.h -a :car_adaptor.cpp car.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. ** ****************************************************************************/ -#include "car_adaptor_p.h" +#include "car_adaptor.h" #include <QtCore/QMetaObject> #include <QtCore/QByteArray> #include <QtCore/QList> @@ -58,40 +58,40 @@ #include <QtCore/QVariant> /* - * Implementation of adaptor class CarAdaptor + * Implementation of adaptor class CarInterfaceAdaptor */ -CarAdaptor::CarAdaptor(QObject *parent) +CarInterfaceAdaptor::CarInterfaceAdaptor(QObject *parent) : QDBusAbstractAdaptor(parent) { // constructor setAutoRelaySignals(true); } -CarAdaptor::~CarAdaptor() +CarInterfaceAdaptor::~CarInterfaceAdaptor() { // destructor } -void CarAdaptor::accelerate() +void CarInterfaceAdaptor::accelerate() { // handle method call com.trolltech.Examples.CarInterface.accelerate QMetaObject::invokeMethod(parent(), "accelerate"); } -void CarAdaptor::decelerate() +void CarInterfaceAdaptor::decelerate() { // handle method call com.trolltech.Examples.CarInterface.decelerate QMetaObject::invokeMethod(parent(), "decelerate"); } -void CarAdaptor::turnLeft() +void CarInterfaceAdaptor::turnLeft() { // handle method call com.trolltech.Examples.CarInterface.turnLeft QMetaObject::invokeMethod(parent(), "turnLeft"); } -void CarAdaptor::turnRight() +void CarInterfaceAdaptor::turnRight() { // handle method call com.trolltech.Examples.CarInterface.turnRight QMetaObject::invokeMethod(parent(), "turnRight"); diff --git a/examples/dbus/remotecontrolledcar/car/car_adaptor_p.h b/examples/dbus/remotecontrolledcar/car/car_adaptor.h index 5f769cd..d16972e 100644 --- a/examples/dbus/remotecontrolledcar/car/car_adaptor_p.h +++ b/examples/dbus/remotecontrolledcar/car/car_adaptor.h @@ -1,17 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -25,23 +25,23 @@ ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarAdaptor -a car_adaptor_p.h:car_adaptor.cpp car.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -a car_adaptor.h: car.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments @@ -49,8 +49,8 @@ ** ****************************************************************************/ -#ifndef CAR_ADAPTOR_P_H_1157030132 -#define CAR_ADAPTOR_P_H_1157030132 +#ifndef CAR_ADAPTOR_H_1264773009 +#define CAR_ADAPTOR_H_1264773009 #include <QtCore/QObject> #include <QtDBus/QtDBus> @@ -67,22 +67,22 @@ QT_END_NAMESPACE /* * Adaptor class for interface com.trolltech.Examples.CarInterface */ -class CarAdaptor: public QDBusAbstractAdaptor +class CarInterfaceAdaptor: public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "com.trolltech.Examples.CarInterface") Q_CLASSINFO("D-Bus Introspection", "" -" <interface name=\"com.trolltech.Examples.CarInterface\" >\n" -" <method name=\"accelerate\" />\n" -" <method name=\"decelerate\" />\n" -" <method name=\"turnLeft\" />\n" -" <method name=\"turnRight\" />\n" -" <signal name=\"crashed\" />\n" +" <interface name=\"com.trolltech.Examples.CarInterface\">\n" +" <method name=\"accelerate\"/>\n" +" <method name=\"decelerate\"/>\n" +" <method name=\"turnLeft\"/>\n" +" <method name=\"turnRight\"/>\n" +" <signal name=\"crashed\"/>\n" " </interface>\n" "") public: - CarAdaptor(QObject *parent); - virtual ~CarAdaptor(); + CarInterfaceAdaptor(QObject *parent); + virtual ~CarInterfaceAdaptor(); public: // PROPERTIES public Q_SLOTS: // METHODS diff --git a/examples/dbus/remotecontrolledcar/car/main.cpp b/examples/dbus/remotecontrolledcar/car/main.cpp index 85b206c..eab82a7 100644 --- a/examples/dbus/remotecontrolledcar/car/main.cpp +++ b/examples/dbus/remotecontrolledcar/car/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "car.h" -#include "car_adaptor_p.h" +#include "car_adaptor.h" #include <QtGui/QApplication> #include <QtGui/QGraphicsView> #include <QtGui/QGraphicsScene> @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) view.resize(400, 300); view.show(); - new CarAdaptor(car); + new CarInterfaceAdaptor(car); QDBusConnection connection = QDBusConnection::sessionBus(); connection.registerObject("/Car", car); connection.registerService("com.trolltech.CarExample"); diff --git a/examples/dbus/remotecontrolledcar/controller/car_interface.cpp b/examples/dbus/remotecontrolledcar/controller/car_interface.cpp index 01be1bf..21662b4 100644 --- a/examples/dbus/remotecontrolledcar/controller/car_interface.cpp +++ b/examples/dbus/remotecontrolledcar/controller/car_interface.cpp @@ -38,10 +38,10 @@ ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarInterface -p car_interface_p.h:car_interface.cpp car.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -i car_interface.h -p :car_interface.cpp car.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qqdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** This file may have been hand-edited. Look for HAND-EDIT comments @@ -49,18 +49,17 @@ ** ****************************************************************************/ -#include "car_interface_p.h" - +#include "car_interface.h" /* - * Implementation of interface class CarInterface + * Implementation of interface class ComTrolltechExamplesCarInterfaceInterface */ -CarInterface::CarInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) +ComTrolltechExamplesCarInterfaceInterface::ComTrolltechExamplesCarInterfaceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) { } -CarInterface::~CarInterface() +ComTrolltechExamplesCarInterfaceInterface::~ComTrolltechExamplesCarInterfaceInterface() { } diff --git a/examples/dbus/remotecontrolledcar/controller/car_interface_p.h b/examples/dbus/remotecontrolledcar/controller/car_interface.h index 8a5a907..c2d281a 100644 --- a/examples/dbus/remotecontrolledcar/controller/car_interface_p.h +++ b/examples/dbus/remotecontrolledcar/controller/car_interface.h @@ -1,17 +1,17 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser @@ -25,31 +25,31 @@ ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** ** $QT_END_LICENSE$ ** ** -** This file was generated by dbusxml2cpp version 0.6 -** Command line was: dbusxml2cpp -c CarInterface -p car_interface_p.h:car_interface.cpp car.xml +** This file was generated by qdbusxml2cpp version 0.7 +** Command line was: qdbusxml2cpp -p car_interface.h: car.xml ** -** dbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** qdbusxml2cpp is Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** ** This is an auto-generated file. ** Do not edit! All changes made to it will be lost. ** ****************************************************************************/ -#ifndef CAR_INTERFACE_P_H_1156853585 -#define CAR_INTERFACE_P_H_1156853585 +#ifndef CAR_INTERFACE_H_1264772826 +#define CAR_INTERFACE_H_1264772826 #include <QtCore/QObject> #include <QtCore/QByteArray> @@ -63,7 +63,7 @@ /* * Proxy class for interface com.trolltech.Examples.CarInterface */ -class CarInterface: public QDBusAbstractInterface +class ComTrolltechExamplesCarInterfaceInterface: public QDBusAbstractInterface { Q_OBJECT public: @@ -71,33 +71,33 @@ public: { return "com.trolltech.Examples.CarInterface"; } public: - CarInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + ComTrolltechExamplesCarInterfaceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); - ~CarInterface(); + ~ComTrolltechExamplesCarInterfaceInterface(); public Q_SLOTS: // METHODS - inline QDBusReply<void> accelerate() + inline QDBusPendingReply<> accelerate() { QList<QVariant> argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("accelerate"), argumentList); + return asyncCallWithArgumentList(QLatin1String("accelerate"), argumentList); } - inline QDBusReply<void> decelerate() + inline QDBusPendingReply<> decelerate() { QList<QVariant> argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("decelerate"), argumentList); + return asyncCallWithArgumentList(QLatin1String("decelerate"), argumentList); } - inline QDBusReply<void> turnLeft() + inline QDBusPendingReply<> turnLeft() { QList<QVariant> argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("turnLeft"), argumentList); + return asyncCallWithArgumentList(QLatin1String("turnLeft"), argumentList); } - inline QDBusReply<void> turnRight() + inline QDBusPendingReply<> turnRight() { QList<QVariant> argumentList; - return callWithArgumentList(QDBus::Block, QLatin1String("turnRight"), argumentList); + return asyncCallWithArgumentList(QLatin1String("turnRight"), argumentList); } Q_SIGNALS: // SIGNALS @@ -107,7 +107,7 @@ Q_SIGNALS: // SIGNALS namespace com { namespace trolltech { namespace Examples { - typedef ::CarInterface CarInterface; + typedef ::ComTrolltechExamplesCarInterfaceInterface CarInterface; } } } diff --git a/examples/dbus/remotecontrolledcar/controller/controller.cpp b/examples/dbus/remotecontrolledcar/controller/controller.cpp index 00a8875..5fca9e3 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.cpp +++ b/examples/dbus/remotecontrolledcar/controller/controller.cpp @@ -42,13 +42,13 @@ #include <QtGui> #include "controller.h" -#include "car_interface_p.h" +#include "car_interface.h" Controller::Controller(QWidget *parent) : QWidget(parent) { ui.setupUi(this); - car = new CarInterface("com.trolltech.CarExample", "/Car", + car = new com::trolltech::Examples::CarInterface("com.trolltech.CarExample", "/Car", QDBusConnection::sessionBus(), this); startTimer(1000); } diff --git a/examples/dbus/remotecontrolledcar/controller/controller.h b/examples/dbus/remotecontrolledcar/controller/controller.h index 07a1355..caadff9 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.h +++ b/examples/dbus/remotecontrolledcar/controller/controller.h @@ -43,8 +43,7 @@ #define CONTROLLER_H #include "ui_controller.h" - -class CarInterface; +#include "car_interface.h" class Controller : public QWidget { @@ -64,7 +63,7 @@ private slots: private: Ui::Controller ui; - CarInterface *car; + com::trolltech::Examples::CarInterface *car; }; #endif diff --git a/examples/dbus/remotecontrolledcar/controller/controller.pro b/examples/dbus/remotecontrolledcar/controller/controller.pro index 159e3b1..375b9d7 100644 --- a/examples/dbus/remotecontrolledcar/controller/controller.pro +++ b/examples/dbus/remotecontrolledcar/controller/controller.pro @@ -11,7 +11,7 @@ CONFIG += qdbus # Input # DBUS_INTERFACES += car.xml FORMS += controller.ui -HEADERS += car_interface_p.h controller.h +HEADERS += car_interface.h controller.h SOURCES += main.cpp car_interface.cpp controller.cpp # install diff --git a/examples/dialogs/standarddialogs/dialog.cpp b/examples/dialogs/standarddialogs/dialog.cpp index 9001619..92ed334 100644 --- a/examples/dialogs/standarddialogs/dialog.cpp +++ b/examples/dialogs/standarddialogs/dialog.cpp @@ -239,7 +239,12 @@ void Dialog::setText() void Dialog::setColor() { - QColor color = QColorDialog::getColor(Qt::green, this); + QColor color; + if (native->isChecked()) + color = QColorDialog::getColor(Qt::green, this); + else + color = QColorDialog::getColor(Qt::green, this, "Select Color", QColorDialog::DontUseNativeDialog); + if (color.isValid()) { colorLabel->setText(color.name()); colorLabel->setPalette(QPalette(color)); diff --git a/examples/examples.pro b/examples/examples.pro index d11e36b..3678cc0 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -48,10 +48,10 @@ contains(QT_CONFIG, phonon):!static: SUBDIRS += phonon contains(QT_CONFIG, webkit): SUBDIRS += webkit embedded:SUBDIRS += qws !wince*:!symbian: { - !contains(QT_EDITION, Console):contains(QT_BUILD_PARTS, tools):SUBDIRS += designer - contains(QT_BUILD_PARTS, tools):SUBDIRS += assistant qtestlib help + !contains(QT_EDITION, Console):contains(QT_BUILD_PARTS, tools):SUBDIRS += designer + contains(QT_BUILD_PARTS, tools):SUBDIRS += qtestlib help } else { - contains(QT_BUILD_PARTS, tools):SUBDIRS += qtestlib + contains(QT_BUILD_PARTS, tools):SUBDIRS += qtestlib } contains(QT_CONFIG, opengl): SUBDIRS += opengl contains(QT_CONFIG, openvg): SUBDIRS += openvg diff --git a/examples/help/remotecontrol/remotecontrol.cpp b/examples/help/remotecontrol/remotecontrol.cpp index 2492298..b51d8f7 100644 --- a/examples/help/remotecontrol/remotecontrol.cpp +++ b/examples/help/remotecontrol/remotecontrol.cpp @@ -123,7 +123,7 @@ void RemoteControl::sendCommand(const QString &cmd) { if (process->state() != QProcess::Running) return; - process->write(cmd.toLocal8Bit() + '\0'); + process->write(cmd.toLocal8Bit() + '\n'); } void RemoteControl::on_indexButton_clicked() diff --git a/examples/help/simpletextviewer/assistant.cpp b/examples/help/simpletextviewer/assistant.cpp index 7d779f3..3acc193 100644 --- a/examples/help/simpletextviewer/assistant.cpp +++ b/examples/help/simpletextviewer/assistant.cpp @@ -73,7 +73,7 @@ void Assistant::showDocumentation(const QString &page) QByteArray ba("SetSource "); ba.append("qthelp://com.trolltech.examples.simpletextviewer/doc/"); - proc->write(ba + page.toLocal8Bit() + '\0'); + proc->write(ba + page.toLocal8Bit() + '\n'); } //! [1] diff --git a/examples/itemviews/dirview/main.cpp b/examples/itemviews/dirview/main.cpp index f26e2f0..5f33810 100644 --- a/examples/itemviews/dirview/main.cpp +++ b/examples/itemviews/dirview/main.cpp @@ -45,7 +45,8 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - QDirModel model; + QFileSystemModel model; + model.setRootPath(""); QTreeView tree; tree.setModel(&model); diff --git a/examples/opengl/hellogl_es/cl_helper.h b/examples/opengl/hellogl_es/cl_helper.h deleted file mode 100644 index 4f4c2bd..0000000 --- a/examples/opengl/hellogl_es/cl_helper.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifdef QT_OPENGL_ES_1_CL - -//! [0] -#define FLOAT2X(f) ((int) ( (f) * (65536))) -#define X2FLOAT(x) ((float)(x) / 65536.0f) - -#define f2vt(f) FLOAT2X(f) -#define vt2f(x) X2FLOAT(x) - -#define q_vertexType GLfixed -#define q_vertexTypeEnum GL_FIXED - -#define q_glFog glFogx -#define q_glFogv glFogxv -//! [0] - -#define q_glLight glLightx -#define q_glLightv glLightxv -#define q_glLightModel glLightModelx -#define q_glLightModelv glLightModelxv - -#define q_glAlphaFunc glAlphaFuncx - -#define q_glMaterial glMaterialx -#define q_glMaterialv glMaterialxv -#define q_glColor4 glColor4x - -#define q_glTexParameter glTexParameterx -#define q_glTexEnv glTexEnvx - -#define q_glOrtho glOrthox -#define q_glFrustum glFrustumx - -#define q_glTranslate glTranslatex -#define q_glScale glScalex -#define q_glRotate glRotatex -#define q_glLoadMatrix glLoadMatrixx - -#define q_glClearColor glClearColorx - -#define q_glMultMatrix glMultMatrixx - -#define q_glNormal3 glNormal3x - -#define q_glPolygonOffset glPolygonOffsetx -#define q_glPointSize glPointSizex - -//! [1] -#else - -#define f2vt(f) (f) -#define vt2f(x) (x) - -#define q_vertexType GLfloat -#define q_vertexTypeEnum GL_FLOAT - -#define q_glFog glFogf -#define q_glFogv glFogfv -//! [1] - -#define q_glLight glLightf -#define q_glLightv glLightfv -#define q_glLightModel glLightModelf -#define q_glLightModelv glLightModelfv - -#define q_glAlphaFunc glAlphaFuncf - -#define q_glMaterial glMaterialf -#define q_glMaterialv glMaterialfv -#define q_glColor4 glColor4f - -#define q_glTexParameter glTexParameterf -#define q_glTexEnv glTexEnvf - -#define q_glOrtho glOrthof -#define q_glFrustum glFrustumf - -#define q_glTranslate glTranslatef -#define q_glScale glScalef -#define q_glRotate glRotatef -#define q_glLoadMatrix glLoadMatrixf - -#define q_glClearColor glClearColor - -#define q_glMultMatrix glMultMatrixf - -#define q_glNormal3 glNormal3f - -#define q_glPolygonOffset glPolygonOffsetf -#define q_glPointSize glPointSizef - -#endif diff --git a/examples/opengl/hellogl_es/glwidget.cpp b/examples/opengl/hellogl_es/glwidget.cpp index 9a45a11..8a6543d 100644 --- a/examples/opengl/hellogl_es/glwidget.cpp +++ b/examples/opengl/hellogl_es/glwidget.cpp @@ -44,7 +44,6 @@ #include <math.h> #include "bubble.h" -#include "cl_helper.h" const int bubbleNum = 8; @@ -114,9 +113,9 @@ void GLWidget::paintQtLogo() { glDisable(GL_TEXTURE_2D); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3,q_vertexTypeEnum,0, createdVertices); + glVertexPointer(3,GL_FLOAT,0, createdVertices); glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(q_vertexTypeEnum,0,createdNormals); + glNormalPointer(GL_FLOAT,0,createdNormals); glDrawArrays(GL_TRIANGLES, 0, m_vertexNumber / 3); } //! [2] @@ -125,83 +124,83 @@ void GLWidget::paintTexturedCube() { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_uiTexture); - q_vertexType afVertices[] = { - f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5), - f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5), - f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5), - - f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(-0.5), - f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5), - f2vt(-0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(-0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(0.5), - - f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5), - f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), - f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5) + GLfloat afVertices[] = { + -0.5, 0.5, 0.5, 0.5,-0.5,0.5,-0.5,-0.5,0.5, + 0.5, -0.5, 0.5, -0.5,0.5,0.5,0.5,0.5,0.5, + -0.5, -0.5, -0.5, 0.5,-0.5,-0.5,-0.5,0.5,-0.5, + 0.5, 0.5, -0.5, -0.5,0.5,-0.5,0.5,-0.5,-0.5, + + 0.5, -0.5, -0.5, 0.5,-0.5,0.5,0.5,0.5,-0.5, + 0.5, 0.5, 0.5, 0.5,0.5,-0.5,0.5,-0.5,0.5, + -0.5, 0.5, -0.5, -0.5,-0.5,0.5,-0.5,-0.5,-0.5, + -0.5, -0.5, 0.5, -0.5,0.5,-0.5,-0.5,0.5,0.5, + + 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, + -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, + 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5 }; glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3,q_vertexTypeEnum,0,afVertices); - - q_vertexType afTexCoord[] = { - f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - - f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - - f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), - f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), - f2vt(0.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f) + glVertexPointer(3,GL_FLOAT,0,afVertices); + + GLfloat afTexCoord[] = { + 0.0f,0.0f, 1.0f,1.0f, 1.0f,0.0f, + 1.0f,1.0f, 0.0f,0.0f, 0.0f,1.0f, + 1.0f,1.0f, 1.0f,0.0f, 0.0f,1.0f, + 0.0f,0.0f, 0.0f,1.0f, 1.0f,0.0f, + + 1.0f,1.0f, 1.0f,0.0f, 0.0f,1.0f, + 0.0f,0.0f, 0.0f,1.0f, 1.0f,0.0f, + 0.0f,0.0f, 1.0f,1.0f, 1.0f,0.0f, + 1.0f,1.0f, 0.0f,0.0f, 0.0f,1.0f, + + 0.0f,1.0f, 1.0f,0.0f, 1.0f,1.0f, + 1.0f,0.0f, 0.0f,1.0f, 0.0f,0.0f, + 1.0f,0.0f, 1.0f,1.0f, 0.0f,0.0f, + 0.0f,1.0f, 0.0f,0.0f, 1.0f,1.0f }; glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2,q_vertexTypeEnum,0,afTexCoord); + glTexCoordPointer(2,GL_FLOAT,0,afTexCoord); - q_vertexType afNormals[] = { + GLfloat afNormals[] = { - f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), - f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), - f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), - f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), + 0,0,-1, 0,0,-1, 0,0,-1, + 0,0,-1, 0,0,-1, 0,0,-1, + 0,0,1, 0,0,1, 0,0,1, + 0,0,1, 0,0,1, 0,0,1, - f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), - f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), - f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), - f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), + -1,0,0, -1,0,0, -1,0,0, + -1,0,0, -1,0,0, -1,0,0, + 1,0,0, 1,0,0, 1,0,0, + 1,0,0, 1,0,0, 1,0,0, - f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), - f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), - f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), - f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0) + 0,-1,0, 0,-1,0, 0,-1,0, + 0,-1,0, 0,-1,0, 0,-1,0, + 0,1,0, 0,1,0, 0,1,0, + 0,1,0, 0,1,0, 0,1,0 }; glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(q_vertexTypeEnum,0,afNormals); + glNormalPointer(GL_FLOAT,0,afNormals); glDrawArrays(GL_TRIANGLES, 0, 36); } void GLWidget::initializeGL () { - q_glClearColor(f2vt(0.1f), f2vt(0.1f), f2vt(0.2f), f2vt(1.0f)); + glClearColor(0.1f, 0.1f, 0.2f, 1.0f); glEnable(GL_TEXTURE_2D); glGenTextures(1, &m_uiTexture); m_uiTexture = bindTexture(QImage(":/qt.png")); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); - q_vertexType aLightPosition[] = {f2vt(0.0f),f2vt(0.3f),f2vt(1.0f),f2vt(0.0f)}; + GLfloat aLightPosition[] = {0.0f,0.3f,1.0f,0.0f}; - q_glLightv(GL_LIGHT0, GL_SPOT_DIRECTION, aLightPosition); + glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, aLightPosition); m_fAngle = 0; m_fScale = 1; createGeometry(); @@ -230,12 +229,12 @@ void GLWidget::paintGL() //Since OpenGL ES does not support glPush/PopAttrib(GL_ALL_ATTRIB_BITS) //we have to take care of the states ourselves - q_glClearColor(f2vt(0.1f), f2vt(0.1f), f2vt(0.2f), f2vt(1.0f)); + glClearColor(0.1f, 0.1f, 0.2f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_TEXTURE_2D); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); @@ -248,14 +247,14 @@ void GLWidget::paintGL() glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - q_glRotate(f2vt(m_fAngle), f2vt(0.0), f2vt(1.0), f2vt(0.0)); - q_glRotate(f2vt(m_fAngle), f2vt(1.0), f2vt(0.0), f2vt(0.0)); - q_glRotate(f2vt(m_fAngle), f2vt(0.0), f2vt(0.0), f2vt(1.0)); - q_glScale(f2vt(m_fScale), f2vt(m_fScale),f2vt(m_fScale)); - q_glTranslate(f2vt(0),f2vt(-0.2),f2vt(0)); + glRotatef(m_fAngle, 0.0f, 1.0f, 0.0f); + glRotatef(m_fAngle, 1.0f, 0.0f, 0.0f); + glRotatef(m_fAngle, 0.0f, 0.0f, 1.0f); + glScalef(m_fScale, m_fScale,m_fScale); + glTranslatef(0.0f,-0.2f,0.0f); - q_vertexType matDiff[] = {f2vt(0.40), f2vt(1.0), f2vt(0.0), f2vt(1.0)}; - q_glMaterialv(GL_FRONT_AND_BACK, GL_DIFFUSE, matDiff); + GLfloat matDiff[] = {0.40f, 1.0f, 0.0f, 1.0f}; + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, matDiff); if (qtLogo) paintQtLogo(); @@ -376,11 +375,11 @@ void GLWidget::createGeometry() //! [1] m_vertexNumber = vertices.size(); - createdVertices = new q_vertexType[m_vertexNumber]; - createdNormals = new q_vertexType[m_vertexNumber]; + createdVertices = new GLfloat[m_vertexNumber]; + createdNormals = new GLfloat[m_vertexNumber]; for (int i = 0;i < m_vertexNumber;i++) { - createdVertices[i] = f2vt(vertices.at(i) * 2); - createdNormals[i] = f2vt(normals.at(i)); + createdVertices[i] = vertices.at(i) * 2; + createdNormals[i] = normals.at(i); } vertices.clear(); normals.clear(); diff --git a/examples/opengl/hellogl_es/glwidget.h b/examples/opengl/hellogl_es/glwidget.h index 7a8df53..3b2b5d4 100644 --- a/examples/opengl/hellogl_es/glwidget.h +++ b/examples/opengl/hellogl_es/glwidget.h @@ -45,7 +45,6 @@ #include <QGLWidget> #include <QTime> -#include "cl_helper.h" class Bubble; @@ -76,8 +75,8 @@ private: void extrude(qreal x1, qreal y1, qreal x2, qreal y2); QList<qreal> vertices; QList<qreal> normals; - q_vertexType *createdVertices; - q_vertexType *createdNormals; + GLfloat *createdVertices; + GLfloat *createdNormals; int m_vertexNumber; bool qtLogo; QList<Bubble*> bubbles; diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro index eaac9b8..c3fbc77 100644 --- a/examples/opengl/opengl.pro +++ b/examples/opengl/opengl.pro @@ -1,14 +1,12 @@ TEMPLATE = subdirs -contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles1cl)|contains(QT_CONFIG, opengles2){ +contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2){ contains(QT_CONFIG, opengles2) { SUBDIRS = hellogl_es2 } else { SUBDIRS = hellogl_es } - !contains(QT_CONFIG, opengles1cl) { - SUBDIRS += textures - } + SUBDIRS += textures contains(QT_CONFIG, opengles1) { SUBDIRS += hellogl } diff --git a/examples/qtestlib/tutorial5/containers.cpp b/examples/qtestlib/tutorial5/containers.cpp new file mode 100644 index 0000000..fe68c85 --- /dev/null +++ b/examples/qtestlib/tutorial5/containers.cpp @@ -0,0 +1,269 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +// This file contains benchmarks for comparing QVector against std::vector + +#include <QtCore> +#include <QVector> +#include <vector> + +#include <qtest.h> + +template <typename T> // T is the item type +class UseCases { +public: + virtual ~UseCases() {} + + // Use case: Insert \a size items into the vector. + virtual void insert(int size) = 0; + + // Use case: Lookup \a size items from the vector. + virtual void lookup(int size) = 0; +}; + +template <typename T> +T * f(T *ts) // dummy function to prevent code from being optimized away by the compiler +{ + return ts; +} + +// This subclass implements the use cases using QVector as efficiently as possible. +template <typename T> +class UseCases_QVector : public UseCases<T> +{ + void insert(int size) + { + QVector<T> v; + T t; + QBENCHMARK { + for (int i = 0; i < size; ++i) + v.append(t); + } + } + + void lookup(int size) + { + QVector<T> v; + + T t; + for (int i = 0; i < size; ++i) + v.append(t); + + T *ts = new T[size]; + QBENCHMARK { + for (int i = 0; i < size; ++i) + ts[i] = v.value(i); + } + f<T>(ts); + delete[] ts; + } +}; + +// This subclass implements the use cases using std::vector as efficiently as possible. +template <typename T> +class UseCases_stdvector : public UseCases<T> +{ + void insert(int size) + { + std::vector<T> v; + T t; + QBENCHMARK { + for (int i = 0; i < size; ++i) + v.push_back(t); + } + } + + void lookup(int size) + { + std::vector<T> v; + + T t; + for (int i = 0; i < size; ++i) + v.push_back(t); + + T *ts = new T[size]; + QBENCHMARK { + for (int i = 0; i < size; ++i) + ts[i] = v[i]; + } + f<T>(ts); + delete[] ts; + } +}; + +struct Large { // A "large" item type + int x[1000]; +}; + +// Symbian devices typically have limited memory +#ifdef Q_OS_SYMBIAN +# define LARGE_MAX_SIZE 2000 +#else +# define LARGE_MAX_SIZE 20000 +#endif + +class tst_vector_vs_std : public QObject +{ + Q_OBJECT +public: + tst_vector_vs_std() + { + useCases_QVector_int = new UseCases_QVector<int>; + useCases_stdvector_int = new UseCases_stdvector<int>; + + useCases_QVector_Large = new UseCases_QVector<Large>; + useCases_stdvector_Large = new UseCases_stdvector<Large>; + } + +private: + UseCases<int> *useCases_QVector_int; + UseCases<int> *useCases_stdvector_int; + UseCases<Large> *useCases_QVector_Large; + UseCases<Large> *useCases_stdvector_Large; + +private slots: + void insert_int_data(); + void insert_int(); + void insert_Large_data(); + void insert_Large(); + void lookup_int_data(); + void lookup_int(); + void lookup_Large_data(); + void lookup_Large(); +}; + +void tst_vector_vs_std::insert_int_data() +{ + QTest::addColumn<bool>("useStd"); + QTest::addColumn<int>("size"); + + for (int size = 10; size < 20000; size += 100) { + const QByteArray sizeString = QByteArray::number(size); + QTest::newRow(("std::vector-int--" + sizeString).constData()) << true << size; + QTest::newRow(("QVector-int--" + sizeString).constData()) << false << size; + } +} + +void tst_vector_vs_std::insert_int() +{ + QFETCH(bool, useStd); + QFETCH(int, size); + + if (useStd) + useCases_stdvector_int->insert(size); + else + useCases_QVector_int->insert(size); +} + +void tst_vector_vs_std::insert_Large_data() +{ + QTest::addColumn<bool>("useStd"); + QTest::addColumn<int>("size"); + + for (int size = 10; size < LARGE_MAX_SIZE; size += 100) { + const QByteArray sizeString = QByteArray::number(size); + QTest::newRow(("std::vector-Large--" + sizeString).constData()) << true << size; + QTest::newRow(("QVector-Large--" + sizeString).constData()) << false << size; + } +} + +void tst_vector_vs_std::insert_Large() +{ + QFETCH(bool, useStd); + QFETCH(int, size); + + if (useStd) + useCases_stdvector_Large->insert(size); + else + useCases_QVector_Large->insert(size); +} + +//! [1] +void tst_vector_vs_std::lookup_int_data() +{ + QTest::addColumn<bool>("useStd"); + QTest::addColumn<int>("size"); + + for (int size = 10; size < 20000; size += 100) { + const QByteArray sizeString = QByteArray::number(size); + QTest::newRow(("std::vector-int--" + sizeString).constData()) << true << size; + QTest::newRow(("QVector-int--" + sizeString).constData()) << false << size; + } +} +//! [1] + +//! [2] +void tst_vector_vs_std::lookup_int() +{ + QFETCH(bool, useStd); + QFETCH(int, size); + + if (useStd) + useCases_stdvector_int->lookup(size); // Create a std::vector and run the benchmark. + else + useCases_QVector_int->lookup(size); // Create a QVector and run the benchmark. +} +//! [2] + +void tst_vector_vs_std::lookup_Large_data() +{ + QTest::addColumn<bool>("useStd"); + QTest::addColumn<int>("size"); + + for (int size = 10; size < LARGE_MAX_SIZE; size += 100) { + const QByteArray sizeString = QByteArray::number(size); + QTest::newRow(("std::vector-Large--" + sizeString).constData()) << true << size; + QTest::newRow(("QVector-Large--" + sizeString).constData()) << false << size; + } +} + +void tst_vector_vs_std::lookup_Large() +{ + QFETCH(bool, useStd); + QFETCH(int, size); + + if (useStd) + useCases_stdvector_Large->lookup(size); + else + useCases_QVector_Large->lookup(size); +} + +QTEST_MAIN(tst_vector_vs_std) +#include "main.moc" diff --git a/examples/tools/completer/completer.pro b/examples/tools/completer/completer.pro index 96d3734..14521b2 100644 --- a/examples/tools/completer/completer.pro +++ b/examples/tools/completer/completer.pro @@ -1,6 +1,6 @@ -HEADERS = dirmodel.h \ +HEADERS = fsmodel.h \ mainwindow.h -SOURCES = dirmodel.cpp \ +SOURCES = fsmodel.cpp \ main.cpp \ mainwindow.cpp RESOURCES = completer.qrc diff --git a/examples/tools/completer/dirmodel.cpp b/examples/tools/completer/fsmodel.cpp index 6279547..9a5a772 100644 --- a/examples/tools/completer/dirmodel.cpp +++ b/examples/tools/completer/fsmodel.cpp @@ -39,17 +39,17 @@ ** ****************************************************************************/ -#include "dirmodel.h" +#include "fsmodel.h" //! [0] -DirModel::DirModel(QObject *parent) - : QDirModel(parent) +FileSystemModel::FileSystemModel(QObject *parent) + : QFileSystemModel(parent) { } //! [0] //! [1] -QVariant DirModel::data(const QModelIndex &index, int role) const +QVariant FileSystemModel::data(const QModelIndex &index, int role) const { if (role == Qt::DisplayRole && index.column() == 0) { QString path = QDir::toNativeSeparators(filePath(index)); @@ -58,6 +58,7 @@ QVariant DirModel::data(const QModelIndex &index, int role) const return path; } - return QDirModel::data(index, role); + return QFileSystemModel::data(index, role); } + //! [1] diff --git a/examples/tools/completer/dirmodel.h b/examples/tools/completer/fsmodel.h index 5fbb4a2..0ec9ce9 100644 --- a/examples/tools/completer/dirmodel.h +++ b/examples/tools/completer/fsmodel.h @@ -39,21 +39,21 @@ ** ****************************************************************************/ -#ifndef DIRMODEL_H -#define DIRMODEL_H +#ifndef FILESYSTEMMODEL_H +#define FILESYSTEMMODEL_H -#include <QDirModel> +#include <QFileSystemModel> -// With a QDirModel, set on a view, you will see "Program Files" in the view +// With a QFileSystemModel, set on a view, you will see "Program Files" in the view // But with this model, you will see "C:\Program Files" in the view. // We acheive this, by having the data() return the entire file path for // the display role. Note that the Qt::EditRole over which the QCompleter // looks for matches is left unchanged //! [0] -class DirModel : public QDirModel +class FileSystemModel : public QFileSystemModel { public: - DirModel(QObject *parent = 0); + FileSystemModel(QObject *parent = 0); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; }; //! [0] diff --git a/examples/tools/completer/mainwindow.cpp b/examples/tools/completer/mainwindow.cpp index f386497..b1f6759 100644 --- a/examples/tools/completer/mainwindow.cpp +++ b/examples/tools/completer/mainwindow.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtGui> -#include "dirmodel.h" +#include "fsmodel.h" #include "mainwindow.h" //! [0] @@ -55,8 +55,8 @@ MainWindow::MainWindow(QWidget *parent) modelLabel->setText(tr("Model")); modelCombo = new QComboBox; - modelCombo->addItem(tr("QDirModel")); - modelCombo->addItem(tr("QDirModel that shows full path")); + modelCombo->addItem(tr("QFileSytemModel")); + modelCombo->addItem(tr("QFileSytemModel that shows full path")); modelCombo->addItem(tr("Country list")); modelCombo->addItem(tr("Word list")); modelCombo->setCurrentIndex(0); @@ -218,17 +218,19 @@ void MainWindow::changeModel() switch (modelCombo->currentIndex()) { default: case 0: - { // Unsorted QDirModel - QDirModel *dirModel = new QDirModel(completer); - completer->setModel(dirModel); + { // Unsorted QFileSystemModel + QFileSystemModel *fsModel = new QFileSystemModel(completer); + fsModel->setRootPath(""); + completer->setModel(fsModel); contentsLabel->setText(tr("Enter file path")); } break; //! [11] //! [12] case 1: - { // DirModel that shows full paths - DirModel *dirModel = new DirModel(completer); - completer->setModel(dirModel); + { // FileSystemModel that shows full paths + FileSystemModel *fsModel = new FileSystemModel(completer); + completer->setModel(fsModel); + fsModel->setRootPath(""); contentsLabel->setText(tr("Enter file path")); } break; diff --git a/examples/webkit/fancybrowser/main.cpp b/examples/webkit/fancybrowser/main.cpp index cf98b51..23f9713 100644 --- a/examples/webkit/fancybrowser/main.cpp +++ b/examples/webkit/fancybrowser/main.cpp @@ -45,7 +45,12 @@ int main(int argc, char * argv[]) { QApplication app(argc, argv); - MainWindow browser; - browser.show(); + QUrl url; + if (argc > 1) + url = QUrl(argv[1]); + else + url = QUrl("http://www.google.com/ncr"); + MainWindow *browser = new MainWindow(url); + browser->show(); return app.exec(); } diff --git a/examples/webkit/fancybrowser/mainwindow.cpp b/examples/webkit/fancybrowser/mainwindow.cpp index 852d981..6499831 100644 --- a/examples/webkit/fancybrowser/mainwindow.cpp +++ b/examples/webkit/fancybrowser/mainwindow.cpp @@ -45,7 +45,7 @@ //! [1] -MainWindow::MainWindow() +MainWindow::MainWindow(const QUrl& url) { progress = 0; @@ -60,7 +60,7 @@ MainWindow::MainWindow() //! [2] view = new QWebView(this); - view->load(QUrl("http://www.google.com/ncr")); + view->load(url); connect(view, SIGNAL(loadFinished(bool)), SLOT(adjustLocation())); connect(view, SIGNAL(titleChanged(QString)), SLOT(adjustTitle())); connect(view, SIGNAL(loadProgress(int)), SLOT(setProgress(int))); @@ -78,6 +78,11 @@ MainWindow::MainWindow() toolBar->addWidget(locationEdit); //! [2] + QMenu *viewMenu = menuBar()->addMenu(tr("&View")); + QAction* viewSourceAction = new QAction("Page Source", this); + connect(viewSourceAction, SIGNAL(triggered()), SLOT(viewSource())); + viewMenu->addAction(viewSourceAction); + //! [3] QMenu *effectMenu = menuBar()->addMenu(tr("&Effect")); effectMenu->addAction("Highlight all links", this, SLOT(highlightAllLinks())); @@ -100,6 +105,24 @@ MainWindow::MainWindow() } //! [3] +void MainWindow::viewSource() +{ + QNetworkAccessManager* accessManager = view->page()->networkAccessManager(); + QNetworkRequest request(view->url()); + QNetworkReply* reply = accessManager->get(request); + connect(reply, SIGNAL(finished()), this, SLOT(slotSourceDownloaded())); +} + +void MainWindow::slotSourceDownloaded() +{ + QNetworkReply* reply = qobject_cast<QNetworkReply*>(const_cast<QObject*>(sender())); + QTextEdit* textEdit = new QTextEdit(NULL); + textEdit->setAttribute(Qt::WA_DeleteOnClose); + textEdit->show(); + textEdit->setPlainText(reply->readAll()); + reply->deleteLater(); +} + //! [4] void MainWindow::adjustLocation() { diff --git a/examples/webkit/fancybrowser/mainwindow.h b/examples/webkit/fancybrowser/mainwindow.h index 08439c1..d3f8e7e 100644 --- a/examples/webkit/fancybrowser/mainwindow.h +++ b/examples/webkit/fancybrowser/mainwindow.h @@ -52,7 +52,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - MainWindow(); + MainWindow(const QUrl& url); protected slots: @@ -62,6 +62,9 @@ protected slots: void setProgress(int p); void finishLoading(bool); + void viewSource(); + void slotSourceDownloaded(); + void highlightAllLinks(); void rotateImages(bool invert); void removeGifImages(); diff --git a/mkspecs/aix-g++-64/qplatformdefs.h b/mkspecs/aix-g++-64/qplatformdefs.h index ecc2cf0..d32f994 100644 --- a/mkspecs/aix-g++-64/qplatformdefs.h +++ b/mkspecs/aix-g++-64/qplatformdefs.h @@ -42,131 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include <unistd.h> - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -// uncomment if you have problems with <sys/proc.h> because your gcc -// hasn't been built on exactly the same OS version your are using now. -// typedef int crid_t; -// typedef unsigned int class_id_t; -#include <pthread.h> -#include <dirent.h> -#include <fcntl.h> -#include <grp.h> -#include <pwd.h> -#include <signal.h> -#include <dlfcn.h> -#include <strings.h> // AIX X11 headers define FD_ZERO using bzero() - -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/ipc.h> -#include <sys/time.h> -#include <sys/select.h> -#include <sys/shm.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <netinet/in.h> -#ifndef QT_NO_IPV6IFNAME -#include <net/if.h> -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#ifdef _AIX43 -// AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t -#elif _AIX42 -// AIX 4.2 -#define QT_SOCKLEN_T size_t -#else -// AIX 4.1 -#define QT_SOCKLEN_T size_t -// override -#define QT_SOCKOPTLEN_T int -#endif - -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) -// AIX 4.3 and better -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf -#endif +#include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/aix-g++/qplatformdefs.h b/mkspecs/aix-g++/qplatformdefs.h index ecc2cf0..d32f994 100644 --- a/mkspecs/aix-g++/qplatformdefs.h +++ b/mkspecs/aix-g++/qplatformdefs.h @@ -42,131 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include <unistd.h> - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -// uncomment if you have problems with <sys/proc.h> because your gcc -// hasn't been built on exactly the same OS version your are using now. -// typedef int crid_t; -// typedef unsigned int class_id_t; -#include <pthread.h> -#include <dirent.h> -#include <fcntl.h> -#include <grp.h> -#include <pwd.h> -#include <signal.h> -#include <dlfcn.h> -#include <strings.h> // AIX X11 headers define FD_ZERO using bzero() - -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/ipc.h> -#include <sys/time.h> -#include <sys/select.h> -#include <sys/shm.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <netinet/in.h> -#ifndef QT_NO_IPV6IFNAME -#include <net/if.h> -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#ifdef _AIX43 -// AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t -#elif _AIX42 -// AIX 4.2 -#define QT_SOCKLEN_T size_t -#else -// AIX 4.1 -#define QT_SOCKLEN_T size_t -// override -#define QT_SOCKOPTLEN_T int -#endif - -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) -// AIX 4.3 and better -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf -#endif +#include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/aix-xlc-64/qplatformdefs.h b/mkspecs/aix-xlc-64/qplatformdefs.h index 2ed0879..d32f994 100644 --- a/mkspecs/aix-xlc-64/qplatformdefs.h +++ b/mkspecs/aix-xlc-64/qplatformdefs.h @@ -42,117 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include <unistd.h> - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -#include <pthread.h> -#include <dirent.h> -#include <fcntl.h> -#include <grp.h> -#include <pwd.h> -#include <signal.h> -#include <dlfcn.h> -#include <strings.h> // AIX X11 headers define FD_ZERO using bzero() - -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/ipc.h> -#include <sys/time.h> -#include <sys/select.h> -#include <sys/shm.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <netinet/in.h> -#ifndef QT_NO_IPV6IFNAME -#include <net/if.h> -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -// Only AIX 4.3 and better support 64-bit -#define QT_SOCKLEN_T socklen_t - -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) -// Only AIX 4.3 and better support 64-bit -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf -#endif +#include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/aix-xlc/qplatformdefs.h b/mkspecs/aix-xlc/qplatformdefs.h index 435fc40..d32f994 100644 --- a/mkspecs/aix-xlc/qplatformdefs.h +++ b/mkspecs/aix-xlc/qplatformdefs.h @@ -42,127 +42,6 @@ #ifndef QPLATFORMDEFS_H #define QPLATFORMDEFS_H -// Get Qt defines/settings - -#include "qglobal.h" - -// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs - -#include <unistd.h> - - -// We are hot - unistd.h should have turned on the specific APIs we requested - - -#include <pthread.h> -#include <dirent.h> -#include <fcntl.h> -#include <grp.h> -#include <pwd.h> -#include <signal.h> -#include <dlfcn.h> -#include <strings.h> // AIX X11 headers define FD_ZERO using bzero() - -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/ipc.h> -#include <sys/time.h> -#include <sys/select.h> -#include <sys/shm.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/wait.h> -#include <netinet/in.h> -#ifndef QT_NO_IPV6IFNAME -#include <net/if.h> -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#ifdef _AIX43 -// AIX 4.3 and better -#define QT_SOCKLEN_T socklen_t -#elif _AIX42 -// AIX 4.2 -#define QT_SOCKLEN_T size_t -#else -// AIX 4.1 -#define QT_SOCKLEN_T size_t -// override -#define QT_SOCKOPTLEN_T int -#endif - -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) -// AIX 4.3 and better -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf -#endif +#include "../common/aix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/common/aix/qplatformdefs.h b/mkspecs/common/aix/qplatformdefs.h new file mode 100644 index 0000000..b3abf68 --- /dev/null +++ b/mkspecs/common/aix/qplatformdefs.h @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q_AIX_QPLATFORMDEFS_H +#define Q_AIX_QPLATFORMDEFS_H + +// Get Qt defines/settings + +#include "qglobal.h" + +// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs + +#include <unistd.h> + + +// We are hot - unistd.h should have turned on the specific APIs we requested + + +// uncomment if you have problems with <sys/proc.h> because your gcc +// hasn't been built on exactly the same OS version your are using now. +// typedef int crid_t; +// typedef unsigned int class_id_t; +#include <pthread.h> +#include <dirent.h> +#include <fcntl.h> +#include <grp.h> +#include <pwd.h> +#include <signal.h> +#include <dlfcn.h> +#include <strings.h> // AIX X11 headers define FD_ZERO using bzero() + +#include <sys/types.h> +#include <sys/ioctl.h> +#include <sys/ipc.h> +#include <sys/time.h> +#include <sys/select.h> +#include <sys/shm.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <sys/wait.h> +#include <netinet/in.h> +#ifndef QT_NO_IPV6IFNAME +#include <net/if.h> +#endif + +// Only AIX 4.3 and better support 64-bit + +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T + +#ifdef _AIX43 +// AIX 4.3 and better +#define QT_SOCKLEN_T socklen_t +#elif _AIX42 +// AIX 4.2 +#define QT_SOCKLEN_T size_t +#else +// AIX 4.1 +#define QT_SOCKLEN_T size_t +// override +#define QT_SOCKOPTLEN_T int +#endif + +#ifdef QT_LARGEFILE_SUPPORT +#undef QT_DIR +#undef QT_OPENDIR +#undef QT_CLOSEDIR + +#define QT_DIR DIR64 +#define QT_OPENDIR ::opendir64 +#define QT_CLOSEDIR ::closedir64 +#endif + +#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) +// AIX 4.3 and better +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf +#endif + +#endif // include guard diff --git a/mkspecs/common/c89/qplatformdefs.h b/mkspecs/common/c89/qplatformdefs.h new file mode 100644 index 0000000..c6a8e14 --- /dev/null +++ b/mkspecs/common/c89/qplatformdefs.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q_C89_QPLATFORMDEFS_H +#define Q_C89_QPLATFORMDEFS_H + +// #include <stdio.h> + +#define QT_FPOS_T fpos_t +#define QT_OFF_T long + +#define QT_FOPEN ::fopen +#define QT_FSEEK ::fseek +#define QT_FTELL ::ftell +#define QT_FGETPOS ::fgetpos +#define QT_FSETPOS ::fsetpos + +#endif // include guard diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index 1ae5608..4fbe2dc 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -15,8 +15,6 @@ QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL -QMAKE_INCDIR_OPENGL_ES1CL = $$QMAKE_INCDIR_OPENGL -QMAKE_LIBDIR_OPENGL_ES1CL = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL = @@ -33,7 +31,6 @@ QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGLU -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM -QMAKE_LIBS_OPENGL_ES1CL = -lGLES_CL QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/common/posix/qplatformdefs.h b/mkspecs/common/posix/qplatformdefs.h new file mode 100644 index 0000000..e29bc6f --- /dev/null +++ b/mkspecs/common/posix/qplatformdefs.h @@ -0,0 +1,160 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef Q_POSIX_QPLATFORMDEFS_H +#define Q_POSIX_QPLATFORMDEFS_H + +#include <signal.h> + +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/stat.h> + +#if defined(QT_USE_XOPEN_LFS_EXTENSIONS) && defined(QT_LARGEFILE_SUPPORT) + +#define QT_STATBUF struct stat64 +#define QT_FPOS_T fpos64_t +#define QT_OFF_T off64_t + +#define QT_STAT ::stat64 +#define QT_LSTAT ::lstat64 +#define QT_TRUNCATE ::truncate64 + +// File I/O +#define QT_OPEN ::open64 +#define QT_LSEEK ::lseek64 +#define QT_FSTAT ::fstat64 +#define QT_FTRUNCATE ::ftruncate64 + +// Standard C89 +#define QT_FOPEN ::fopen64 +#define QT_FSEEK ::fseeko64 +#define QT_FTELL ::ftello64 +#define QT_FGETPOS ::fgetpos64 +#define QT_FSETPOS ::fsetpos64 + +#define QT_MMAP ::mmap64 + +#else // !defined(QT_USE_XOPEN_LFS_EXTENSIONS) || !defined(QT_LARGEFILE_SUPPORT) + +#include "../c89/qplatformdefs.h" + +#define QT_STATBUF struct stat + +#define QT_STAT ::stat +#define QT_LSTAT ::lstat +#define QT_TRUNCATE ::truncate + +// File I/O +#define QT_OPEN ::open +#define QT_LSEEK ::lseek +#define QT_FSTAT ::fstat +#define QT_FTRUNCATE ::ftruncate + +// Posix extensions to C89 +#if !defined(QT_USE_XOPEN_LFS_EXTENSIONS) && !defined(QT_NO_USE_FSEEKO) +#undef QT_OFF_T +#undef QT_FSEEK +#undef QT_FTELL + +#define QT_OFF_T off_t + +#define QT_FSEEK ::fseeko +#define QT_FTELL ::ftello +#endif + +#define QT_MMAP ::mmap + +#endif // !defined (QT_USE_XOPEN_LFS_EXTENSIONS) || !defined(QT_LARGEFILE_SUPPORT) + +#define QT_STAT_MASK S_IFMT +#define QT_STAT_REG S_IFREG +#define QT_STAT_DIR S_IFDIR +#define QT_STAT_LNK S_IFLNK + +#define QT_ACCESS ::access +#define QT_GETCWD ::getcwd +#define QT_CHDIR ::chdir +#define QT_MKDIR ::mkdir +#define QT_RMDIR ::rmdir + +// File I/O +#define QT_CLOSE ::close +#define QT_READ ::read +#define QT_WRITE ::write + +#define QT_OPEN_LARGEFILE O_LARGEFILE +#define QT_OPEN_RDONLY O_RDONLY +#define QT_OPEN_WRONLY O_WRONLY +#define QT_OPEN_RDWR O_RDWR +#define QT_OPEN_CREAT O_CREAT +#define QT_OPEN_TRUNC O_TRUNC +#define QT_OPEN_APPEND O_APPEND + +// Posix extensions to C89 +#define QT_FILENO fileno + +// Directory iteration +#define QT_DIR DIR + +#define QT_OPENDIR ::opendir +#define QT_CLOSEDIR ::closedir + +#if defined(QT_USE_XOPEN_LFS_EXTENSIONS) && defined(QT_LARGEFILE_SUPPORT) +#define QT_DIRENT struct dirent64 +#define QT_READDIR ::readdir64 +#define QT_READDIR_R ::readdir64_r +#else +#define QT_DIRENT struct dirent +#define QT_READDIR ::readdir +#define QT_READDIR_R ::readdir_r +#endif + +#define QT_SOCKLEN_T socklen_t + +#define QT_SOCKET_CONNECT ::connect +#define QT_SOCKET_BIND ::bind + +#define QT_SIGNAL_RETTYPE void +#define QT_SIGNAL_ARGS int +#define QT_SIGNAL_IGNORE SIG_IGN + +#endif // include guard diff --git a/mkspecs/common/symbian/qplatformdefs.h b/mkspecs/common/symbian/qplatformdefs.h index c8a336b..38a1314 100644 --- a/mkspecs/common/symbian/qplatformdefs.h +++ b/mkspecs/common/symbian/qplatformdefs.h @@ -84,86 +84,23 @@ #endif #include <arpa/inet.h> -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#define QT_OPEN_LARGEFILE 0 #if (defined(__GLIBC__) && (__GLIBC__ >= 2)) || defined(Q_OS_SYMBIAN) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif - #if defined(__ISO_C_VISIBLE) && (__ISO_C_VISIBLE >= 1999) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 6113746..6913dc9 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -75,7 +75,7 @@ QMAKE_LIBS_COMPAT = QMAKE_LIBS_QT_ENTRY = -llibcrt0.lib QMAKE_LIBS_S60 = -lavkon -!isEmpty(QMAKE_SH) { +contains(QMAKE_HOST.os, "Windows"):!isEmpty(QMAKE_SH) | unix { QMAKE_COPY = cp QMAKE_COPY_DIR = cp -r QMAKE_MOVE = mv @@ -93,9 +93,15 @@ QMAKE_LIBS_S60 = -lavkon QMAKE_CHK_DIR_EXISTS = if not exist } -QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe -QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe -QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe +contains(QMAKE_HOST.os, "Windows") { + QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe + QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe + QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe +} else { + QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc + QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic + QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc +} QMAKE_IDL = midl QMAKE_LIB = ar -ru @@ -106,7 +112,7 @@ QMAKE_STRIP = strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded load(qt_config) -load(platform_paths) +load(symbian/platform_paths) symbian-abld { # Versions of abld prior to Symbian^3 have a bug where you cannot remove something from the command line without replacing it @@ -138,10 +144,10 @@ default_deployment.pkg_prerules = \ DEPLOYMENT += default_deployment -exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/Series60v5.0.sis) { +exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v5.0.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v5.0.sis) { S60_VERSION = 5.0 } else { - exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/Series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/Series60v3.2.sis) { + exists($${EPOCROOT}epoc32/release/winscw/udeb/z/system/install/series60v3.2.sis )|exists($${EPOCROOT}epoc32/data/z/system/install/series60v3.2.sis) { S60_VERSION = 3.2 } else { S60_VERSION = 3.1 diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf index ff99f1b..705cdc3 100644 --- a/mkspecs/common/wince/qmake.conf +++ b/mkspecs/common/wince/qmake.conf @@ -66,7 +66,6 @@ QMAKE_LIBS_COMPAT = QMAKE_LIBS_EGL = libEGL.lib QMAKE_LIBS_OPENGL_ES1 = libGLES_CM.lib -QMAKE_LIBS_OPENGL_ES1CL = libGLES_CL.lib QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib QMAKE_LIBS_QT_ENTRY = -lqtmain diff --git a/mkspecs/cygwin-g++/qplatformdefs.h b/mkspecs/cygwin-g++/qplatformdefs.h index 9b3be62..a6f57d2 100644 --- a/mkspecs/cygwin-g++/qplatformdefs.h +++ b/mkspecs/cygwin-g++/qplatformdefs.h @@ -81,58 +81,14 @@ //#include <windows.h> #include <netinet/in.h> +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND -#define QT_FOPEN ::fopen -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t +#undef QT_OPEN_LARGEFILE #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/darwin-g++/qplatformdefs.h b/mkspecs/darwin-g++/qplatformdefs.h index 5aea69f..7a67339 100644 --- a/mkspecs/darwin-g++/qplatformdefs.h +++ b/mkspecs/darwin-g++/qplatformdefs.h @@ -74,52 +74,10 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t +#include "../common/posix/qplatformdefs.h" -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir +#undef QT_OPEN_LARGEFILE #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/features/assistant.prf b/mkspecs/features/assistant.prf deleted file mode 100644 index 25e5d4d..0000000 --- a/mkspecs/features/assistant.prf +++ /dev/null @@ -1,9 +0,0 @@ - -INCLUDEPATH = $$QMAKE_INCDIR_QT/QtAssistant $$INCLUDEPATH - -mac:!static:contains(QT_CONFIG, qt_framework) { - qtAddLibrary(QtAssistant) -} else { - qtAddLibrary(QtAssistantClient) -} -QT += network diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf index 00f70d3..7e7d098 100644 --- a/mkspecs/features/egl.prf +++ b/mkspecs/features/egl.prf @@ -11,14 +11,6 @@ wince*:contains(QT_CONFIG, opengles1) { exists($$p):LIBS_PRIVATE += -L$$p } DEFINES += QT_GLES_EGL -} else:wince*:contains(QT_CONFIG, opengles1cl) { - INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL - LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL - LIBS += $$QMAKE_LFLAGS_EGL - for(p, QMAKE_LIBDIR_OPENGL_ES1CL) { - exists($$p):LIBS_PRIVATE += -L$$p - } - DEFINES += QT_GLES_EGL } else { INCLUDEPATH += $$QMAKE_INCDIR_EGL LIBS_PRIVATE += $$QMAKE_LIBS_EGL diff --git a/mkspecs/features/symbian/application_icon.prf b/mkspecs/features/symbian/application_icon.prf index 1edbe14..b790463 100644 --- a/mkspecs/features/symbian/application_icon.prf +++ b/mkspecs/features/symbian/application_icon.prf @@ -30,7 +30,7 @@ contains( CONFIG, no_icon ) { # Note: symbian-sbsv2 builds can't utilize extra compiler for mifconv, so ICON handling is done in code symbian-abld { #Makefile: requires paths with backslash - ICON = $$replace( ICON, /, \\) + contains(QMAKE_HOST.os, "Windows"):ICON = $$replace(ICON, /, \\) # Extra compiler rules for mifconv mifconv.output = ${ZDIR}$$APP_RESOURCE_DIR/$${baseTarget}.mif @@ -48,4 +48,3 @@ contains( CONFIG, no_icon ) { RSS_RULES.icon_file = $$APP_RESOURCE_DIR/$${baseTarget}.mif } } - diff --git a/mkspecs/features/unix/opengl.prf b/mkspecs/features/unix/opengl.prf index f2db819..74a5149 100644 --- a/mkspecs/features/unix/opengl.prf +++ b/mkspecs/features/unix/opengl.prf @@ -3,11 +3,6 @@ contains(QT_CONFIG, opengles1) { !isEmpty(QMAKE_LIBDIR_OPENGL_ES1):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES1 target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1 else:LIBS += $$QMAKE_LIBS_OPENGL_ES1 -} else:contains(QT_CONFIG, opengles1cl) { - INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL - !isEmpty(QMAKE_LIBDIR_OPENGL_ES1CL):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES1CL - target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL - else:LIBS += $$QMAKE_LIBS_OPENGL_ES1CL } else:contains(QT_CONFIG, opengles2) { INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2 !isEmpty(QMAKE_LIBDIR_OPENGL_ES2):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2 diff --git a/mkspecs/freebsd-g++/qplatformdefs.h b/mkspecs/freebsd-g++/qplatformdefs.h index b5d1b2f..5afb965 100644 --- a/mkspecs/freebsd-g++/qplatformdefs.h +++ b/mkspecs/freebsd-g++/qplatformdefs.h @@ -76,57 +76,19 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#include "../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#define QT_OPEN_LARGEFILE 0 #if !defined(__DragonFly__) && (__FreeBSD_version < 400000) // FreeBSD 1.0 - 3.5.1 -# define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #else // FreeBSD 4.0 and better -# define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #endif #define QT_SNPRINTF ::snprintf @@ -143,5 +105,4 @@ #define QT_AOUT_UNDERSCORE #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-acc-64/qplatformdefs.h b/mkspecs/hpux-acc-64/qplatformdefs.h index 50da616..f9789a8 100644 --- a/mkspecs/hpux-acc-64/qplatformdefs.h +++ b/mkspecs/hpux-acc-64/qplatformdefs.h @@ -76,76 +76,13 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int - +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-acc-o64/qplatformdefs.h b/mkspecs/hpux-acc-o64/qplatformdefs.h index 1aee3f9..5237806 100644 --- a/mkspecs/hpux-acc-o64/qplatformdefs.h +++ b/mkspecs/hpux-acc-o64/qplatformdefs.h @@ -77,76 +77,10 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" +#undef QT_SOCKLEN_T +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-acc/qplatformdefs.h b/mkspecs/hpux-acc/qplatformdefs.h index 475c85a..9ce08c6 100644 --- a/mkspecs/hpux-acc/qplatformdefs.h +++ b/mkspecs/hpux-acc/qplatformdefs.h @@ -79,76 +79,14 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int // presence of _XOPEN_UNIX can be used to detect HP-UX 10 or higher #if !defined(_XOPEN_UNIX) @@ -156,5 +94,4 @@ #define select(a,b,c,d,e) select((a), (int *)(b), (int *)(c), (int *)(d), (e)) #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-g++-64/qplatformdefs.h b/mkspecs/hpux-g++-64/qplatformdefs.h index 6082632..f3fbda5 100644 --- a/mkspecs/hpux-g++-64/qplatformdefs.h +++ b/mkspecs/hpux-g++-64/qplatformdefs.h @@ -76,76 +76,7 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t - +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpux-g++/qplatformdefs.h b/mkspecs/hpux-g++/qplatformdefs.h index 161474e..38e9408 100644 --- a/mkspecs/hpux-g++/qplatformdefs.h +++ b/mkspecs/hpux-g++/qplatformdefs.h @@ -78,76 +78,11 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#undef QT_SOCKLEN_T +#define QT_SOCKLEN_T int // presence of _XOPEN_UNIX can be used to detect HP-UX 10 or higher #if !defined(_XOPEN_UNIX) @@ -155,5 +90,4 @@ #define select(a,b,c,d,e) select((a), (int *)(b), (int *)(c), (int *)(d), (e)) #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpuxi-acc-32/qplatformdefs.h b/mkspecs/hpuxi-acc-32/qplatformdefs.h index 04ce3cd..a0d2464 100644 --- a/mkspecs/hpuxi-acc-32/qplatformdefs.h +++ b/mkspecs/hpuxi-acc-32/qplatformdefs.h @@ -77,75 +77,13 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpuxi-acc-64/qplatformdefs.h b/mkspecs/hpuxi-acc-64/qplatformdefs.h index 04ce3cd..a0d2464 100644 --- a/mkspecs/hpuxi-acc-64/qplatformdefs.h +++ b/mkspecs/hpuxi-acc-64/qplatformdefs.h @@ -77,75 +77,13 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hpuxi-g++-64/qplatformdefs.h b/mkspecs/hpuxi-g++-64/qplatformdefs.h index ba62e24..288a331 100644 --- a/mkspecs/hpuxi-g++-64/qplatformdefs.h +++ b/mkspecs/hpuxi-g++-64/qplatformdefs.h @@ -76,75 +76,13 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // QPLATFORMDEFS_H diff --git a/mkspecs/hurd-g++/qplatformdefs.h b/mkspecs/hurd-g++/qplatformdefs.h index 68ee2d8..b734a68 100644 --- a/mkspecs/hurd-g++/qplatformdefs.h +++ b/mkspecs/hurd-g++/qplatformdefs.h @@ -82,57 +82,11 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t +#include "../common/posix/qplatformdefs.h" #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/irix-cc-64/qplatformdefs.h b/mkspecs/irix-cc-64/qplatformdefs.h index f1078df..c95c2e5 100644 --- a/mkspecs/irix-cc-64/qplatformdefs.h +++ b/mkspecs/irix-cc-64/qplatformdefs.h @@ -75,79 +75,15 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // Irix 6.5 and better @@ -156,5 +92,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/irix-cc/qplatformdefs.h b/mkspecs/irix-cc/qplatformdefs.h index f1078df..c95c2e5 100644 --- a/mkspecs/irix-cc/qplatformdefs.h +++ b/mkspecs/irix-cc/qplatformdefs.h @@ -75,79 +75,15 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // Irix 6.5 and better @@ -156,5 +92,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/irix-g++/qplatformdefs.h b/mkspecs/irix-g++/qplatformdefs.h index 49d0bfb..be7fb69 100644 --- a/mkspecs/irix-g++/qplatformdefs.h +++ b/mkspecs/irix-g++/qplatformdefs.h @@ -75,83 +75,22 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_ARGS -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#if defined(_LANGUAGE_C_PLUS_PLUS) || !defined(_SGIAPI) -#define QT_SIGNAL_ARGS int +#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) +#define QT_SOCKLEN_T size_t #else -#define QT_SIGNAL_ARGS void +#define QT_SOCKLEN_T int #endif -#define QT_SIGNAL_IGNORE SIG_IGN -#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) -#define QT_SOCKLEN_T size_t +#if defined(_LANGUAGE_C_PLUS_PLUS) || !defined(_SGIAPI) +#define QT_SIGNAL_ARGS int #else -#define QT_SOCKLEN_T int +#define QT_SIGNAL_ARGS void #endif // Irix 6.5 and better @@ -160,6 +99,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H - diff --git a/mkspecs/linux-cxx/qplatformdefs.h b/mkspecs/linux-cxx/qplatformdefs.h index 11b5ac0..578e63a 100644 --- a/mkspecs/linux-cxx/qplatformdefs.h +++ b/mkspecs/linux-cxx/qplatformdefs.h @@ -82,79 +82,15 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -162,5 +98,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-ecc-64/qplatformdefs.h b/mkspecs/linux-ecc-64/qplatformdefs.h index 11b5ac0..578e63a 100644 --- a/mkspecs/linux-ecc-64/qplatformdefs.h +++ b/mkspecs/linux-ecc-64/qplatformdefs.h @@ -82,79 +82,15 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -162,5 +98,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h index a879279..23816b1 100644 --- a/mkspecs/linux-g++/qplatformdefs.h +++ b/mkspecs/linux-g++/qplatformdefs.h @@ -81,79 +81,15 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -161,5 +97,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-kcc/qplatformdefs.h b/mkspecs/linux-kcc/qplatformdefs.h index 30b3c25..3a37ab9 100644 --- a/mkspecs/linux-kcc/qplatformdefs.h +++ b/mkspecs/linux-kcc/qplatformdefs.h @@ -85,79 +85,15 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -165,5 +101,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-llvm/qplatformdefs.h b/mkspecs/linux-llvm/qplatformdefs.h index 8e59249..a38c86c 100644 --- a/mkspecs/linux-llvm/qplatformdefs.h +++ b/mkspecs/linux-llvm/qplatformdefs.h @@ -82,79 +82,15 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -162,5 +98,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-lsb-g++/qplatformdefs.h b/mkspecs/linux-lsb-g++/qplatformdefs.h index ce0b461..e2a138a 100644 --- a/mkspecs/linux-lsb-g++/qplatformdefs.h +++ b/mkspecs/linux-lsb-g++/qplatformdefs.h @@ -86,90 +86,27 @@ // LSB 3.1 defines htonl and friends here #include <arpa/inet.h> -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir #define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#if defined(__GLIBC__) && (__GLIBC__ >= 2) +#define QT_SOCKLEN_T socklen_t +#else +#define QT_SOCKLEN_T int +#endif #ifndef SIOCGIFBRDADDR # define SIOCGIFBRDADDR 0x8919 #endif -#if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t -#else -#define QT_SOCKLEN_T int -#endif - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/linux-pgcc/qplatformdefs.h b/mkspecs/linux-pgcc/qplatformdefs.h index 11b5ac0..578e63a 100644 --- a/mkspecs/linux-pgcc/qplatformdefs.h +++ b/mkspecs/linux-pgcc/qplatformdefs.h @@ -82,79 +82,15 @@ #include <net/if.h> #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -162,5 +98,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/lynxos-g++/qplatformdefs.h b/mkspecs/lynxos-g++/qplatformdefs.h index bdb492e..cac71d1 100644 --- a/mkspecs/lynxos-g++/qplatformdefs.h +++ b/mkspecs/lynxos-g++/qplatformdefs.h @@ -75,55 +75,14 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t +#include "../common/posix/qplatformdefs.h" -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS void -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_SOCKLEN_T #if defined(__GLIBC__) && (__GLIBC__ >= 2) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) @@ -131,5 +90,4 @@ #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-g++/qplatformdefs.h b/mkspecs/macx-g++/qplatformdefs.h index 03bdce9..99d64ef 100644 --- a/mkspecs/macx-g++/qplatformdefs.h +++ b/mkspecs/macx-g++/qplatformdefs.h @@ -75,59 +75,23 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#include "../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 +#define QT_OPEN_LARGEFILE 0 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-g++40/qplatformdefs.h b/mkspecs/macx-g++40/qplatformdefs.h index 03bdce9..99d64ef 100644 --- a/mkspecs/macx-g++40/qplatformdefs.h +++ b/mkspecs/macx-g++40/qplatformdefs.h @@ -75,59 +75,23 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#include "../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 +#define QT_OPEN_LARGEFILE 0 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-g++42/qplatformdefs.h b/mkspecs/macx-g++42/qplatformdefs.h index 03bdce9..99d64ef 100644 --- a/mkspecs/macx-g++42/qplatformdefs.h +++ b/mkspecs/macx-g++42/qplatformdefs.h @@ -75,59 +75,23 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#include "../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 +#define QT_OPEN_LARGEFILE 0 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-llvm/qplatformdefs.h b/mkspecs/macx-llvm/qplatformdefs.h index 03bdce9..99d64ef 100644 --- a/mkspecs/macx-llvm/qplatformdefs.h +++ b/mkspecs/macx-llvm/qplatformdefs.h @@ -75,59 +75,23 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#include "../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 +#define QT_OPEN_LARGEFILE 0 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-pbuilder/qplatformdefs.h b/mkspecs/macx-pbuilder/qplatformdefs.h index c8e49af..66afad2 100644 --- a/mkspecs/macx-pbuilder/qplatformdefs.h +++ b/mkspecs/macx-pbuilder/qplatformdefs.h @@ -75,59 +75,20 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-xcode/qplatformdefs.h b/mkspecs/macx-xcode/qplatformdefs.h index 03bdce9..99d64ef 100644 --- a/mkspecs/macx-xcode/qplatformdefs.h +++ b/mkspecs/macx-xcode/qplatformdefs.h @@ -75,59 +75,23 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#include "../common/posix/qplatformdefs.h" + +#undef QT_OPEN_LARGEFILE +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 +#define QT_OPEN_LARGEFILE 0 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #else -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif +#define QT_SIGNAL_IGNORE (void (*)(int))1 + #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/macx-xlc/qplatformdefs.h b/mkspecs/macx-xlc/qplatformdefs.h index 43c3158..b830041 100644 --- a/mkspecs/macx-xlc/qplatformdefs.h +++ b/mkspecs/macx-xlc/qplatformdefs.h @@ -75,55 +75,15 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t +#include "../common/posix/qplatformdefs.h" -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#undef QT_SOCKLEN_T +#undef QT_SIGNAL_IGNORE -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE (void (*)(int))1 - -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int +#define QT_SIGNAL_IGNORE (void (*)(int))1 #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/netbsd-g++/qplatformdefs.h b/mkspecs/netbsd-g++/qplatformdefs.h index f455a86..2ce5b4a 100644 --- a/mkspecs/netbsd-g++/qplatformdefs.h +++ b/mkspecs/netbsd-g++/qplatformdefs.h @@ -75,54 +75,14 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#include "../common/posix/qplatformdefs.h" -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 -// NetBSD 1.0 - 1.3.3 int -// NetBSD 1.4 - 1.5 socklen_t -#define QT_SOCKLEN_T socklen_t +// QT_SOCKLEN_T +// NetBSD 1.0 - 1.3.3 int +// NetBSD 1.4 - 1.5 socklen_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf @@ -132,5 +92,4 @@ #define QT_AOUT_UNDERSCORE #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/openbsd-g++/qplatformdefs.h b/mkspecs/openbsd-g++/qplatformdefs.h index 0a9ea21..b3a9ad5 100644 --- a/mkspecs/openbsd-g++/qplatformdefs.h +++ b/mkspecs/openbsd-g++/qplatformdefs.h @@ -76,54 +76,14 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE 0 -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#include "../common/posix/qplatformdefs.h" -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_OPEN_LARGEFILE +#define QT_OPEN_LARGEFILE 0 -// OpenBSD 2.2 - 2.4 int -// OpenBSD 2.5 - 2.8 socklen_t -#define QT_SOCKLEN_T socklen_t +// QT_SOCKLEN_T +// OpenBSD 2.2 - 2.4 int +// OpenBSD 2.5 - 2.8 socklen_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf @@ -148,5 +108,4 @@ #define QT_AOUT_UNDERSCORE #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/sco-cc/qplatformdefs.h b/mkspecs/sco-cc/qplatformdefs.h index b5427c9..078cb45 100644 --- a/mkspecs/sco-cc/qplatformdefs.h +++ b/mkspecs/sco-cc/qplatformdefs.h @@ -76,55 +76,12 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t +#include "../common/posix/qplatformdefs.h" -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T size_t +#undef QT_SOCKLEN_T +#define QT_SOCKLEN_T size_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/sco-g++/qplatformdefs.h b/mkspecs/sco-g++/qplatformdefs.h index 058ab78..a09f77d 100644 --- a/mkspecs/sco-g++/qplatformdefs.h +++ b/mkspecs/sco-g++/qplatformdefs.h @@ -80,55 +80,12 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t +#include "../common/posix/qplatformdefs.h" -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T int +#undef QT_SOCKLEN_T +#define QT_SOCKLEN_T int #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/solaris-cc-64/qmake.conf b/mkspecs/solaris-cc-64/qmake.conf index eb594d9..d51d77a 100644 --- a/mkspecs/solaris-cc-64/qmake.conf +++ b/mkspecs/solaris-cc-64/qmake.conf @@ -41,6 +41,7 @@ QMAKE_CFLAGS_SHLIB = -KPIC QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_THREAD = -mt +QMAKE_CFLAGS_HIDESYMS = -xldscope=hidden QMAKE_CXX = CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS @@ -53,6 +54,7 @@ QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD +QMAKE_CXXFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib/64 diff --git a/mkspecs/solaris-cc-64/qplatformdefs.h b/mkspecs/solaris-cc-64/qplatformdefs.h index 8de7c20..d01c48c 100644 --- a/mkspecs/solaris-cc-64/qplatformdefs.h +++ b/mkspecs/solaris-cc-64/qplatformdefs.h @@ -76,82 +76,16 @@ #include <net/if.h> #endif -// On 64-bit platforms sockets use socklen_t -#define QT_SOCKLEN_T socklen_t +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKET_CONNECT +#define QT_SOCKET_CONNECT qt_socket_connect // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) { return ::connect(s, addr, addrlen); } -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT qt_socket_connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - // Only Solaris 7 and better support 64-bit #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/solaris-cc/qmake.conf b/mkspecs/solaris-cc/qmake.conf index ad430d1..354b83c 100644 --- a/mkspecs/solaris-cc/qmake.conf +++ b/mkspecs/solaris-cc/qmake.conf @@ -24,6 +24,7 @@ QMAKE_CFLAGS_SHLIB = -KPIC QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CFLAGS_YACC = QMAKE_CFLAGS_THREAD = -mt +QMAKE_CFLAGS_HIDESYMS = -xldscope=hidden QMAKE_CXX = CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS @@ -36,6 +37,7 @@ QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD +QMAKE_CXXFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS QMAKE_INCDIR = /usr/sfw/include QMAKE_LIBDIR = /usr/sfw/lib diff --git a/mkspecs/solaris-cc/qplatformdefs.h b/mkspecs/solaris-cc/qplatformdefs.h index 128cd8f..678d076 100644 --- a/mkspecs/solaris-cc/qplatformdefs.h +++ b/mkspecs/solaris-cc/qplatformdefs.h @@ -76,90 +76,29 @@ #include <net/if.h> #endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T +#undef QT_SOCKET_CONNECT + +#define QT_SOCKET_CONNECT qt_socket_connect + #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) && (_XOPEN_VERSION-0 >= 500) // Solaris 7 and better with specific feature test macros -#define QT_SOCKLEN_T socklen_t +#define QT_SOCKLEN_T socklen_t #elif defined(_XOPEN_SOURCE_EXTENDED) && (_XOPEN_VERSION-0 >= 4) // Solaris 2.6 and better with specific feature test macros -#define QT_SOCKLEN_T size_t +#define QT_SOCKLEN_T size_t #else // always this case in practice -#define QT_SOCKLEN_T int +#define QT_SOCKLEN_T int #endif // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) { return ::connect(s, addr, addrlen); } -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT qt_socket_connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - #if !defined(_XOPEN_UNIX) // Solaris 2.5.1 // Function usleep() is defined in C library but not declared in header files diff --git a/mkspecs/solaris-g++-64/qplatformdefs.h b/mkspecs/solaris-g++-64/qplatformdefs.h index d7aebaf..bce0d5b 100644 --- a/mkspecs/solaris-g++-64/qplatformdefs.h +++ b/mkspecs/solaris-g++-64/qplatformdefs.h @@ -79,12 +79,11 @@ #include <net/if.h> #endif -// On 64-bit platforms sockets use socklen_t -#define QT_SOCKLEN_T socklen_t +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" -// Only Solaris 7 and better support 64-bit -#define QT_SNPRINTF ::snprintf -#define QT_VSNPRINTF ::vsnprintf +#undef QT_SOCKET_CONNECT +#define QT_SOCKET_CONNECT qt_socket_connect // Solaris redefines connect -> __xnet_connect with _XOPEN_SOURCE_EXTENDED static inline int qt_socket_connect(int s, struct sockaddr *addr, QT_SOCKLEN_T addrlen) @@ -100,73 +99,8 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr # undef bind #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT qt_socket_connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +// Only Solaris 7 and better support 64-bit +#define QT_SNPRINTF ::snprintf +#define QT_VSNPRINTF ::vsnprintf #endif // QPLATFORMDEFS_H diff --git a/mkspecs/solaris-g++/qplatformdefs.h b/mkspecs/solaris-g++/qplatformdefs.h index 9984a38..5732388 100644 --- a/mkspecs/solaris-g++/qplatformdefs.h +++ b/mkspecs/solaris-g++/qplatformdefs.h @@ -79,6 +79,16 @@ #include <net/if.h> #endif +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../common/posix/qplatformdefs.h" + +#undef QT_SOCKLEN_T +#undef QT_SOCKET_CONNECT +#undef QT_SOCKET_BIND + +#define QT_SOCKET_CONNECT qt_socket_connect +#define QT_SOCKET_BIND qt_socket_bind + #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500) && (_XOPEN_VERSION-0 >= 500) // Solaris 7 and better with specific feature test macros #define QT_SOCKLEN_T socklen_t @@ -104,75 +114,6 @@ static inline int qt_socket_bind(int s, struct sockaddr *addr, QT_SOCKLEN_T addr # undef bind #endif -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT qt_socket_connect -#define QT_SOCKET_BIND qt_socket_bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - #if !defined(_XOPEN_UNIX) // Solaris 2.5.1 // Function usleep() is defined in C library but not declared in header files diff --git a/mkspecs/tru64-cxx/qplatformdefs.h b/mkspecs/tru64-cxx/qplatformdefs.h index 54fb139..ed07d5b 100644 --- a/mkspecs/tru64-cxx/qplatformdefs.h +++ b/mkspecs/tru64-cxx/qplatformdefs.h @@ -78,50 +78,21 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" + +#undef QT_OFF_T +#undef QT_SOCKLEN_T + #define QT_OFF_T off_t -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#if defined(_POSIX_PII_SOCKET) +#define QT_SOCKLEN_T socklen_t +#elif defined(_XOPEN_SOURCE_EXTENDED) +#define QT_SOCKLEN_T size_t +#else +#define QT_SOCKLEN_T int +#endif #if defined(_XOPEN_SOURCE) && defined(_OSF_SOURCE) // Not available in the <unistd.h> header file of Tru64 4.0F. @@ -129,19 +100,10 @@ extern "C" int usleep(useconds_t); #endif -#if defined(_POSIX_PII_SOCKET) -#define QT_SOCKLEN_T socklen_t -#elif defined(_XOPEN_SOURCE_EXTENDED) -#define QT_SOCKLEN_T size_t -#else -#define QT_SOCKLEN_T int -#endif - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 400) // Tru64 5.0 and better #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/tru64-g++/qplatformdefs.h b/mkspecs/tru64-g++/qplatformdefs.h index 44c23f1..ed07d5b 100644 --- a/mkspecs/tru64-g++/qplatformdefs.h +++ b/mkspecs/tru64-g++/qplatformdefs.h @@ -78,50 +78,21 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" + +#undef QT_OFF_T +#undef QT_SOCKLEN_T + #define QT_OFF_T off_t -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#if defined(_POSIX_PII_SOCKET) +#define QT_SOCKLEN_T socklen_t +#elif defined(_XOPEN_SOURCE_EXTENDED) +#define QT_SOCKLEN_T size_t +#else +#define QT_SOCKLEN_T int +#endif #if defined(_XOPEN_SOURCE) && defined(_OSF_SOURCE) // Not available in the <unistd.h> header file of Tru64 4.0F. @@ -129,19 +100,10 @@ extern "C" int usleep(useconds_t); #endif -#if defined(_POSIX_PII_SOCKET) -# define QT_SOCKLEN_T socklen_t -#elif defined(_XOPEN_SOURCE_EXTENDED) -# define QT_SOCKLEN_T size_t -#else -# define QT_SOCKLEN_T int -#endif - #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 400) // Tru64 5.0 and better #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf #endif - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/unixware-cc/qplatformdefs.h b/mkspecs/unixware-cc/qplatformdefs.h index e314713..3a26042 100644 --- a/mkspecs/unixware-cc/qplatformdefs.h +++ b/mkspecs/unixware-cc/qplatformdefs.h @@ -76,55 +76,16 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_OFF_T +#undef QT_SOCKLEN_T -#define QT_SOCKLEN_T size_t +#define QT_OFF_T off_t +#define QT_SOCKLEN_T size_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/unixware-g++/qplatformdefs.h b/mkspecs/unixware-g++/qplatformdefs.h index e314713..3a26042 100644 --- a/mkspecs/unixware-g++/qplatformdefs.h +++ b/mkspecs/unixware-g++/qplatformdefs.h @@ -76,55 +76,16 @@ #include <net/if.h> #endif -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t - -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_OPEN ::open -#define QT_CLOSE ::close -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND +#define QT_NO_USE_FSEEKO +#include "../common/posix/qplatformdefs.h" -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN +#undef QT_OFF_T +#undef QT_SOCKLEN_T -#define QT_SOCKLEN_T size_t +#define QT_OFF_T off_t +#define QT_SOCKLEN_T size_t #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf index 8a480c4..7b17789 100644 --- a/mkspecs/unsupported/linux-host-g++/qmake.conf +++ b/mkspecs/unsupported/linux-host-g++/qmake.conf @@ -88,8 +88,6 @@ QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL -QMAKE_INCDIR_OPENGL_ES1CL = $$QMAKE_INCDIR_OPENGL -QMAKE_LIBDIR_OPENGL_ES1CL = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL = @@ -106,7 +104,6 @@ QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGLU -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM -QMAKE_LIBS_OPENGL_ES1CL = -lGLES_CL QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/unsupported/qnx-g++/qplatformdefs.h b/mkspecs/unsupported/qnx-g++/qplatformdefs.h index 9fe67dd..b5bcee8 100644 --- a/mkspecs/unsupported/qnx-g++/qplatformdefs.h +++ b/mkspecs/unsupported/qnx-g++/qplatformdefs.h @@ -81,76 +81,8 @@ // for htonl #include <arpa/inet.h> -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseeko -#define QT_FTELL ::ftello -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T off_t -#endif - -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::lstat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::lstat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif - -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT ::connect -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close -#define QT_READ ::read -#define QT_WRITE ::write -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR ::mkdir -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN - -#define QT_SOCKLEN_T socklen_t +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../../common/posix/qplatformdefs.h" #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf diff --git a/mkspecs/unsupported/qws/qnx-641/qmake.conf b/mkspecs/unsupported/qws/qnx-641/qmake.conf new file mode 100644 index 0000000..db333b7 --- /dev/null +++ b/mkspecs/unsupported/qws/qnx-641/qmake.conf @@ -0,0 +1,99 @@ +# +# qmake configuration for qnx +# +# Written for QNX 6.4.1 without X11. +# + +MAKEFILE_GENERATOR = UNIX +TEMPLATE = app +CONFIG += qt warn_on release link_prl +QT += core gui +DEFINES += QT_NO_NIS QT_NO_TEXTODFWRITER QT_OPENGL + +QMAKE_CC = qcc +QMAKE_CFLAGS += -V4.3.3,gcc_ntox86_acpp-ne -pipe +QMAKE_CFLAGS_DEPS += -M +QMAKE_CFLAGS_WARN_ON += -Wall -W +QMAKE_CFLAGS_WARN_OFF += -w +QMAKE_CFLAGS_RELEASE += -O2 +QMAKE_CFLAGS_DEBUG += -g +QMAKE_CFLAGS_SHLIB += -fPIC +QMAKE_CFLAGS_STATIC_LIB += -fPIC +QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses +QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden +QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE} +QMAKE_COMPILER_DEFINES += __QNXNTO__ + +QMAKE_CXX = qcc +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS +QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS +QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON +QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF +QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE +QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG +QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB +QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB +QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC +QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden +QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE + +QMAKE_LINK = qcc +QMAKE_LINK_SHLIB = qcc +QMAKE_LINK_SHLIB_CMD = $(LINK) $(LFLAGS) -o ../../lib/$(TARGET) $(OBJECTS) $(LIBS) +QMAKE_LFLAGS = -V4.3.3,gcc_ntox86 -lang-c++ -Y_acpp-ne +QMAKE_LFLAGS_RELEASE = +QMAKE_LFLAGS_DEBUG = +QMAKE_LFLAGS_SHLIB = -shared +QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB +QMAKE_LFLAGS_SONAME = -Wl,-soname, +QMAKE_LFLAGS_THREAD = +QMAKE_LN_SHLIB = -cp +QMAKE_RPATH = -Wl,-rpath, + +QMAKE_PCH_OUTPUT_EXT = .gch + +# -Bsymbolic-functions (ld) support +QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions +QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, + +include(../../common/unix.conf) + +QMAKE_CFLAGS_THREAD = -D_REENTRANT +QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD + +QMAKE_INCDIR = +QMAKE_LIBDIR = +QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] +QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] + + +QMAKE_LIBS = -lm -lz +QMAKE_LIBS_DYNLOAD = +QMAKE_LIBS_THREAD = +QMAKE_LIBS_NETWORK += -lsocket +QMAKE_LIBS_GUI += -lsocket +QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe +QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe +QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe + +QMAKE_AR = ntox86-ar cqs +QMAKE_RANLIB = + +QMAKE_TAR = tar -cf +QMAKE_GZIP = gzip -9f + +QMAKE_COPY = cp -f +QMAKE_COPY_FILE = $(COPY) +QMAKE_COPY_DIR = $(COPY) -r +QMAKE_MOVE = mv -f +QMAKE_DEL_FILE = rm -f +QMAKE_DEL_DIR = rmdir +QMAKE_CHK_DIR_EXISTS = test -d +QMAKE_MKDIR = mkdir -p +QMAKE_STRIP = strip +QMAKE_STRIPFLAGS_LIB += --strip-unneeded +QMAKE_CHK_DIR_EXISTS = test -d +QMAKE_MKDIR = mkdir -p +load(qt_config) diff --git a/mkspecs/unsupported/qws/qnx-641/qplatformdefs.h b/mkspecs/unsupported/qws/qnx-641/qplatformdefs.h new file mode 100644 index 0000000..af04086 --- /dev/null +++ b/mkspecs/unsupported/qws/qnx-641/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../qnx-g++/qplatformdefs.h" diff --git a/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h b/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h index 33ffd96..b183684 100644 --- a/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h +++ b/mkspecs/unsupported/vxworks-simpentium-g++/qplatformdefs.h @@ -47,84 +47,29 @@ #include "qglobal.h" #include "qfunctions_vxworks.h" +#define QT_USE_XOPEN_LFS_EXTENSIONS +#include "../../common/posix/qplatformdefs.h" -#ifdef QT_LARGEFILE_SUPPORT -#define QT_STATBUF struct stat64 -#define QT_STATBUF4TSTAT struct stat64 -#define QT_STAT ::stat64 -#define QT_FSTAT ::fstat64 -#define QT_LSTAT ::stat64 -#define QT_OPEN ::open64 -#define QT_TRUNCATE ::truncate64 -#define QT_FTRUNCATE ::ftruncate64 -#define QT_LSEEK ::lseek64 -#else -#define QT_STATBUF struct stat -#define QT_STATBUF4TSTAT struct stat -#define QT_STAT ::stat -#define QT_FSTAT ::fstat -#define QT_LSTAT ::stat -#define QT_OPEN ::open -#define QT_TRUNCATE ::truncate -#define QT_FTRUNCATE ::ftruncate -#define QT_LSEEK ::lseek -#endif +#undef QT_LSTAT +#undef QT_MKDIR +#undef QT_READ +#undef QT_WRITE +#undef QT_SOCKLEN_T +#undef QT_SOCKET_CONNECT -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FOPEN ::fopen64 -#define QT_FSEEK ::fseeko64 -#define QT_FTELL ::ftello64 -#define QT_FGETPOS ::fgetpos64 -#define QT_FSETPOS ::fsetpos64 -#define QT_MMAP ::mmap64 -#define QT_FPOS_T fpos64_t -#define QT_OFF_T off64_t -#else -#define QT_FOPEN ::fopen -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_MMAP ::mmap -#define QT_FPOS_T fpos_t -#define QT_OFF_T long -#endif +#define QT_LSTAT QT_STAT +#define QT_MKDIR(dir, perm) ::mkdir(dir) -#define QT_STAT_REG S_IFREG -#define QT_STAT_DIR S_IFDIR -#define QT_STAT_MASK S_IFMT -#define QT_STAT_LNK S_IFLNK -#define QT_SOCKET_CONNECT(sd, to, tolen) \ - ::connect(sd, (struct sockaddr *) to, tolen) -#define QT_SOCKET_BIND ::bind -#define QT_FILENO fileno -#define QT_CLOSE ::close #define QT_READ(fd, buf, len) ::read(fd, (char*) buf, len) #define QT_WRITE(fd, buf, len) ::write(fd, (char*) buf, len) -#define QT_ACCESS ::access -#define QT_GETCWD ::getcwd -#define QT_CHDIR ::chdir -#define QT_MKDIR(dir, perm) ::mkdir(dir) -#define QT_RMDIR ::rmdir -#define QT_OPEN_LARGEFILE O_LARGEFILE -#define QT_OPEN_RDONLY O_RDONLY -#define QT_OPEN_WRONLY O_WRONLY -#define QT_OPEN_RDWR O_RDWR -#define QT_OPEN_CREAT O_CREAT -#define QT_OPEN_TRUNC O_TRUNC -#define QT_OPEN_APPEND O_APPEND - -#define QT_SIGNAL_RETTYPE void -#define QT_SIGNAL_ARGS int -#define QT_SIGNAL_IGNORE SIG_IGN // there IS a socklen_t in sys/socket.h (unsigned int), // but sockLib.h uses int in all function declaration... -//#define QT_SOCKLEN_T socklen_t #define QT_SOCKLEN_T int +#define QT_SOCKET_CONNECT(sd, to, tolen) \ + ::connect(sd, (struct sockaddr *) to, tolen) #define QT_SNPRINTF ::snprintf #define QT_VSNPRINTF ::vsnprintf - #endif // QPLATFORMDEFS_H diff --git a/mkspecs/win32-borland/qplatformdefs.h b/mkspecs/win32-borland/qplatformdefs.h index 4efae9a..d8fa4c2 100644 --- a/mkspecs/win32-borland/qplatformdefs.h +++ b/mkspecs/win32-borland/qplatformdefs.h @@ -96,21 +96,16 @@ # define QT_STAT_LNK _S_IFLNK #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::_fseeki64 #define QT_FTELL ::_ftelli64 -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_FILENO _fileno diff --git a/mkspecs/win32-g++/qplatformdefs.h b/mkspecs/win32-g++/qplatformdefs.h index 12828d1..36333b6 100644 --- a/mkspecs/win32-g++/qplatformdefs.h +++ b/mkspecs/win32-g++/qplatformdefs.h @@ -133,21 +133,16 @@ typedef enum { # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::fseeko64 #define QT_FTELL ::ftello64 -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T off64_t -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/mkspecs/win32-icc/qplatformdefs.h b/mkspecs/win32-icc/qplatformdefs.h index 6abfef2..833846f 100644 --- a/mkspecs/win32-icc/qplatformdefs.h +++ b/mkspecs/win32-icc/qplatformdefs.h @@ -113,21 +113,19 @@ # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #if defined(QT_LARGEFILE_SUPPORT) && _MSC_VER > 1310 +#undef QT_FSEEK +#undef QT_FTELL + #define QT_FSEEK ::_fseeki64 #define QT_FTELL ::_ftelli64 -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell #endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT + +#if defined(QT_LARGEFILE_SUPPORT) +#undef QT_OFF_T #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/mkspecs/win32-msvc.net/qplatformdefs.h b/mkspecs/win32-msvc.net/qplatformdefs.h index dcfaec5..05584c9 100644 --- a/mkspecs/win32-msvc.net/qplatformdefs.h +++ b/mkspecs/win32-msvc.net/qplatformdefs.h @@ -113,23 +113,16 @@ # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_FTELL +#undef QT_OFF_T + // 64-bit versions of fseek/ftell not always available. E.g., when linking // dynamically to CRT (/MT) -#define QT_FSEEK ::fseek #define QT_FTELL (QT_OFF_T)::ftell -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/mkspecs/win32-msvc/qplatformdefs.h b/mkspecs/win32-msvc/qplatformdefs.h index 5dee28c..abb5894 100644 --- a/mkspecs/win32-msvc/qplatformdefs.h +++ b/mkspecs/win32-msvc/qplatformdefs.h @@ -113,21 +113,11 @@ # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen -#ifdef QT_LARGEFILE_SUPPORT -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_OFF_T #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/mkspecs/win32-msvc2005/qplatformdefs.h b/mkspecs/win32-msvc2005/qplatformdefs.h index b87ea48..33360b7 100644 --- a/mkspecs/win32-msvc2005/qplatformdefs.h +++ b/mkspecs/win32-msvc2005/qplatformdefs.h @@ -113,21 +113,16 @@ # define QT_OPEN_BINARY _O_BINARY #endif -#define QT_FOPEN ::fopen +#include "../common/c89/qplatformdefs.h" + #ifdef QT_LARGEFILE_SUPPORT +#undef QT_FSEEK +#undef QT_FTELL +#undef QT_OFF_T + #define QT_FSEEK ::_fseeki64 #define QT_FTELL ::_ftelli64 -#else -#define QT_FSEEK ::fseek -#define QT_FTELL ::ftell -#endif -#define QT_FGETPOS ::fgetpos -#define QT_FSETPOS ::fsetpos -#define QT_FPOS_T fpos_t -#ifdef QT_LARGEFILE_SUPPORT #define QT_OFF_T __int64 -#else -#define QT_OFF_T long #endif #define QT_SIGNAL_ARGS int diff --git a/projects.pro b/projects.pro index d405a5b..19a5ff8 100644 --- a/projects.pro +++ b/projects.pro @@ -112,7 +112,8 @@ win32 { } symbian { confclean.depends += distclean - confclean.commands += \ + contains(QMAKE_HOST.os, "Windows") { + confclean.commands += \ (cd src\tools\moc && $(MAKE) distclean) $$escape_expand(\n\t) \ (cd src\tools\rcc && $(MAKE) distclean) $$escape_expand(\n\t) \ (cd src\tools\uic && $(MAKE) distclean) $$escape_expand(\n\t) \ @@ -121,7 +122,17 @@ symbian { -$(DEL_FILE) mkspecs\qconfig.pri $$escape_expand(\n\t) \ -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \ (cd qmake && $(MAKE) distclean) - + } else { + confclean.commands += \ + (cd src/tools/moc && $(MAKE) distclean) $$escape_expand(\n\t) \ + (cd src/tools/rcc && $(MAKE) distclean) $$escape_expand(\n\t) \ + (cd src/tools/uic && $(MAKE) distclean) $$escape_expand(\n\t) \ + -$(DEL_FILE) src/corelib/global/qconfig.h $$escape_expand(\n\t) \ + -$(DEL_FILE) src/corelib/global/qconfig.cpp $$escape_expand(\n\t) \ + -$(DEL_FILE) mkspecs/qconfig.pri $$escape_expand(\n\t) \ + -$(DEL_FILE) .qmake.cache $$escape_expand(\n\t) \ + (cd qmake && $(MAKE) distclean) + } } QMAKE_EXTRA_TARGETS += confclean qmakeclean.commands += (cd qmake && $(MAKE) clean) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index db2737b..b0a8011 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -65,6 +65,12 @@ #include <sys/types.h> #include <sys/stat.h> +#ifdef Q_OS_WIN32 +#define NO_STDERR "2> NUL" +#else +#define NO_STDERR "2>/dev/null" +#endif + QT_BEGIN_NAMESPACE // Well, Windows doesn't have this, so here's the macro @@ -1809,7 +1815,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if(tmp_clean.indexOf("${QMAKE_") == -1) { t << "\n\t" << "-$(DEL_FILE) " << tmp_clean; if (isForSymbian()) - t << " 2> NUL"; // Eliminate unnecessary warnings + t << " " << NO_STDERR; // Eliminate unnecessary warnings wrote_clean = true; } if(!wrote_clean_cmds || !wrote_clean) { @@ -1839,7 +1845,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } if(!cleans.isEmpty()) { if (isForSymbian()) - t << valGlue(cleans, "\n\t" + del_statement, " 2> NUL\n\t" + del_statement, " 2> NUL"); + t << valGlue(cleans, "\n\t" + del_statement, " " NO_STDERR "\n\t" + del_statement, " " NO_STDERR); else t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, ""); } diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index f3e3c3a..7ccce00 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -175,12 +175,12 @@ static void createPluginStub(const QFileInfo& info, QStringList& generatedDirs, QStringList& generatedFiles) { - QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR "\\")); + QDir().mkpath(PLUGIN_STUB_DIR); if (!generatedDirs.contains(PLUGIN_STUB_DIR)) generatedDirs << PLUGIN_STUB_DIR; // Plugin stubs must have different name from the actual plugins, because // the toolchain for creating ROM images cannot handle non-binary .dll files properly. - QFile stubFile(QLatin1String(PLUGIN_STUB_DIR "\\") + info.completeBaseName() + "." SUFFIX_QTPLUGIN); + QFile stubFile(QDir(PLUGIN_STUB_DIR).filePath(info.completeBaseName() + "." SUFFIX_QTPLUGIN)); if (stubFile.open(QIODevice::WriteOnly)) { if (!generatedFiles.contains(stubFile.fileName())) generatedFiles << stubFile.fileName(); @@ -329,12 +329,12 @@ void initProjectDeploySymbian(QMakeProject* project, if (isBinary(info)) { if (deployBinaries) { // Executables and libraries are deployed to \sys\bin - QFileInfo releasePath(epocRoot() + "epoc32\\release\\" + platform + "\\" + build + "\\"); + QFileInfo releasePath(epocRoot() + QDir::toNativeSeparators("epoc32/release/" + platform + "/" + build + "/")); if(devicePathHasDriveLetter) { - deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName(), false, true), + deploymentList.append(CopyItem(Option::fixPathToLocalOS(QDir(releasePath.absolutePath()).filePath(info.fileName()), false, true), Option::fixPathToLocalOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "\\") + info.fileName()))); } else { - deploymentList.append(CopyItem(Option::fixPathToLocalOS(releasePath.absolutePath() + "\\" + info.fileName(), false, true), + deploymentList.append(CopyItem(Option::fixPathToLocalOS(QDir(releasePath.absolutePath()).filePath(info.fileName()), false, true), Option::fixPathToLocalOS(deploymentDrive + QLatin1String(SYSBIN_DIR "\\") + info.fileName()))); } } diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 6c44f0b..5e27af5 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -49,11 +49,18 @@ #include <stdlib.h> #include <qdebug.h> +#ifdef Q_OS_WIN +#define SCRIPT_EXT ".bat" +#else +#define SCRIPT_EXT ".sh" +#endif + #define RESOURCE_DIRECTORY_MMP "/resource/apps" #define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\" #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps" #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" -#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def" +#define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonu.def" +#define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1) #define BLD_INF_RULES_BASE "BLD_INF_RULES." #define BLD_INF_TAG_PLATFORMS "prj_platforms" @@ -452,7 +459,7 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, Deployme for (int i = 0; i < depList.size(); ++i) { t << QString("\"%1\" - \"%2\"") .arg(QString(depList.at(i).from).replace('\\','/')) - .arg(depList.at(i).to) << endl; + .arg(QString(depList.at(i).to).replace('/','\\')) << endl; } t << endl; @@ -1855,7 +1862,7 @@ void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t, t << "\t-@ if EXIST \"" << QDir::toNativeSeparators(item) << "\" "; t << cmd << " " << cmdOptions << " \"" << QDir::toNativeSeparators(item) << "\"" << endl; #else - t << "\t-if test -f " << QDir::toNativeSeparators(item) << "; then "; + t << "\t-if test -e " << QDir::toNativeSeparators(item) << "; then "; t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl; #endif } @@ -1894,7 +1901,7 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t) t << OK_SIS_TARGET ":" << endl; - QString pkgcommand = QString("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ + QString pkgcommand = QString("\tcreatepackage" SCRIPT_EXT " $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \ "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)") .arg(fixedTarget) .arg("pkg"); diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp index 033bcbe..26dd3fd 100644 --- a/qmake/generators/symbian/symmake_abld.cpp +++ b/qmake/generators/symbian/symmake_abld.cpp @@ -195,16 +195,21 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; t << "MOVE = " << var("QMAKE_MOVE") << endl; +#ifdef Q_OS_WIN32 t << "XCOPY = xcopy /d /f /h /r /y /i" << endl; t << "ABLD = ABLD.BAT" << endl; +#else + t << "XCOPY = cp -u -v" << endl; + t << "ABLD = abld" << endl; +#endif t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl; t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl; t << "MAKE = make" << endl; t << endl; t << "ifeq (WINS,$(findstring WINS, $(PLATFORM)))" << endl; - t << "ZDIR=$(EPOCROOT)epoc32\\release\\$(PLATFORM)\\$(CFG)\\Z" << endl; + t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/release/$(PLATFORM)/$(CFG)/z") << endl; t << "else" << endl; - t << "ZDIR=$(EPOCROOT)epoc32\\data\\z" << endl; + t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/data/z") << endl; t << "endif" << endl; t << endl; t << "DEFINES" << '\t' << " = " @@ -304,8 +309,13 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool if (values.at(i).endsWith("/" QT_EXTRA_INCLUDE_DIR)) { QString fixedValue(QDir::toNativeSeparators(values.at(i))); dirsToClean << fixedValue; +#ifdef Q_OS_WIN32 t << "\t-@ if NOT EXIST \"" << fixedValue << "\" mkdir \"" << fixedValue << "\"" << endl; +#else + t << "\t-@ if test ! -d \"" << fixedValue << "\"; then mkdir \"" + << fixedValue << "\"" << "; fi" <<endl; +#endif } } } @@ -314,7 +324,11 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool // Note: EXTENSION_CLEAN will get called many times when doing reallyclean // This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp. t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl; +#ifdef Q_OS_WIN32 generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", ""); +#else + generateCleanCommands(t, dirsToClean, "rm", " -rf ", "", ""); +#endif t << endl; t << PRE_TARGETDEPS_TARGET ":" @@ -441,21 +455,31 @@ bool SymbianAbldMakefileGenerator::writeDeploymentTargets(QTextStream &t) void SymbianAbldMakefileGenerator::writeStoreBuildTarget(QTextStream &t) { +#ifdef Q_OS_WIN +#define HASH "#" +#define EMPTYECHO "." +#else +#define HASH "\\#" +#define EMPTYECHO +#endif + t << STORE_BUILD_TARGET ":" << endl; - t << "\t@echo # ============================================================================== > " MAKE_CACHE_NAME << endl; - t << "\t@echo # This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # make sis target. >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # Version : >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # >> " MAKE_CACHE_NAME << endl; - t << "\t@echo # ============================================================================== >> " MAKE_CACHE_NAME << endl; - t << "\t@echo. >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " ============================================================================== > " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " make sis target. >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " Version : >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " >> " MAKE_CACHE_NAME << endl; + t << "\t@echo " HASH " ============================================================================== >> " MAKE_CACHE_NAME << endl; + t << "\t@echo" EMPTYECHO " >> " MAKE_CACHE_NAME << endl; t << "\t@echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> " MAKE_CACHE_NAME << endl; t << endl; generatedFiles << MAKE_CACHE_NAME; +#undef HASH +#undef EMPTYECHO } void SymbianAbldMakefileGenerator::writeBldInfMkFilePart(QTextStream& t, bool addDeploymentExtension) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 670e3a0..f51c046 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -544,7 +544,6 @@ UnixMakefileGenerator::processPrlFiles() { QList<QMakeLocalFileName> libdirs, frameworkdirs; frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); - frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() }; for(int i = 0; !lflags[i].isNull(); i++) { QStringList &l = project->values(lflags[i]); diff --git a/qmake/option.cpp b/qmake/option.cpp index 5522a80..5e06721 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -136,6 +136,20 @@ static Option::QMAKE_MODE default_mode(QString progname) return Option::QMAKE_GENERATE_MAKEFILE; } +static QString detectProjectFile(const QString &path) +{ + QString ret; + QDir dir(path); + if(dir.exists(dir.dirName() + Option::pro_ext)) { + ret = dir.filePath(dir.dirName()) + Option::pro_ext; + } else { //last try.. + QStringList profiles = dir.entryList(QStringList("*" + Option::pro_ext)); + if(profiles.count() == 1) + ret = dir.filePath(profiles.at(0)); + } + return ret; +} + QString project_builtin_regx(); bool usage(const char *a0) { @@ -322,12 +336,18 @@ Option::parseCommandLine(int argc, char **argv, int skip) if(!fi.makeAbsolute()) //strange arg = fi.filePath(); if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || - Option::qmake_mode == Option::QMAKE_GENERATE_PRL) + Option::qmake_mode == Option::QMAKE_GENERATE_PRL) { + if(fi.isDir()) { + QString proj = detectProjectFile(arg); + if (!proj.isNull()) + arg = proj; + } Option::mkfile::project_files.append(arg); - else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) + } else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) { Option::projfile::project_dirs.append(arg); - else + } else { handled = false; + } } if(!handled) { return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR; @@ -494,15 +514,9 @@ Option::init(int argc, char **argv) //try REALLY hard to do it for them, lazy.. if(Option::mkfile::project_files.isEmpty()) { - QString pwd = qmake_getpwd(), - proj = pwd + "/" + pwd.right(pwd.length() - (pwd.lastIndexOf('/') + 1)) + Option::pro_ext; - if(QFile::exists(proj)) { + QString proj = detectProjectFile(qmake_getpwd()); + if(!proj.isNull()) Option::mkfile::project_files.append(proj); - } else { //last try.. - QStringList profiles = QDir(pwd).entryList(QStringList("*" + Option::pro_ext)); - if(profiles.count() == 1) - Option::mkfile::project_files.append(pwd + "/" + profiles[0]); - } #ifndef QT_BUILD_QMAKE_LIBRARY if(Option::mkfile::project_files.isEmpty()) { usage(argv[0]); diff --git a/src/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp b/src/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp index f4c5e3a..50951e9 100644 --- a/src/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp +++ b/src/3rdparty/clucene/src/CLucene/index/SegmentTermDocs.cpp @@ -112,47 +112,51 @@ CL_NS_DEF(index) return _freq; } - bool SegmentTermDocs::next() { - while (true) { - if (count == df) - return false; - uint32_t docCode = freqStream->readVInt(); - _doc += docCode >> 1; //unsigned shift - if ((docCode & 1) != 0) // if low bit is set - _freq = 1; // _freq is one - else - _freq = freqStream->readVInt(); // else read _freq - count++; - - if ( (deletedDocs == NULL) || (deletedDocs->get(_doc) == false ) ) - break; - skippingDoc(); +bool SegmentTermDocs::next() +{ + while (true) { + if (count == df) + return false; + + uint32_t docCode = freqStream->readVInt(); + _doc += docCode >> 1; //unsigned shift + if ((docCode & 1) != 0) // if low bit is set + _freq = 1; // _freq is one + else + _freq = freqStream->readVInt(); // else read _freq + count++; + + if (deletedDocs == NULL || (_doc >= 0 && !deletedDocs->get(_doc))) + break; + skippingDoc(); } return true; - } +} - int32_t SegmentTermDocs::read(int32_t* docs, int32_t* freqs, int32_t length) { + +int32_t SegmentTermDocs::read(int32_t* docs, int32_t* freqs, int32_t length) +{ int32_t i = 0; -//todo: one optimization would be to get the pointer buffer for ram or mmap dirs -//and iterate over them instead of using readByte() intensive functions. - while (i<length && count < df) { - uint32_t docCode = freqStream->readVInt(); - _doc += docCode >> 1; - if ((docCode & 1) != 0) // if low bit is set - _freq = 1; // _freq is one - else - _freq = freqStream->readVInt(); // else read _freq - count++; - - if (deletedDocs == NULL || !deletedDocs->get(_doc)) { - docs[i] = _doc; - freqs[i] = _freq; - i++; - } + // TODO: one optimization would be to get the pointer buffer for ram or mmap + // dirs and iterate over them instead of using readByte() intensive functions. + while (i < length && count < df) { + uint32_t docCode = freqStream->readVInt(); + _doc += docCode >> 1; + if ((docCode & 1) != 0) // if low bit is set + _freq = 1; // _freq is one + else + _freq = freqStream->readVInt(); // else read _freq + count++; + + if (deletedDocs == NULL || (_doc >= 0 && !deletedDocs->get(_doc))) { + docs[i] = _doc; + freqs[i] = _freq; + i++; + } } return i; - } +} bool SegmentTermDocs::skipTo(const int32_t target){ if (df >= skipInterval) { // optimized case diff --git a/src/3rdparty/clucene/src/CLucene/index/Term.cpp b/src/3rdparty/clucene/src/CLucene/index/Term.cpp index fc32e44..5ff7bb2 100644 --- a/src/3rdparty/clucene/src/CLucene/index/Term.cpp +++ b/src/3rdparty/clucene/src/CLucene/index/Term.cpp @@ -153,7 +153,10 @@ int32_t Term::compareTo(const Term* other) const if (_field == other->_field) return _tcscmp(_text, other->_text); - return _tcscmp(_field, other->_field); + int32_t ret = _tcscmp(_field, other->_field); + if (ret == 0) + ret = _tcscmp(_text, other->_text); + return ret; } TCHAR* Term::toString() const diff --git a/src/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp b/src/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp index ea93ec4..b57896b 100644 --- a/src/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp +++ b/src/3rdparty/clucene/src/CLucene/queryParser/MultiFieldQueryParser.cpp @@ -21,51 +21,62 @@ CL_NS_USE(analysis) CL_NS_DEF(queryParser) -MultiFieldQueryParser::MultiFieldQueryParser(const TCHAR** fields, CL_NS(analysis)::Analyzer* a, BoostMap* boosts): - QueryParser(NULL,a) +MultiFieldQueryParser::MultiFieldQueryParser(const TCHAR** fields, + CL_NS(analysis)::Analyzer* analyzer, BoostMap* boosts) + : QueryParser(NULL, analyzer) { this->fields = fields; this->boosts = boosts; } -MultiFieldQueryParser::~MultiFieldQueryParser(){ + +MultiFieldQueryParser::~MultiFieldQueryParser() +{ } //static -Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, Analyzer* analyzer) +Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, + Analyzer* analyzer) { BooleanQuery* bQuery = _CLNEW BooleanQuery(); int32_t i = 0; - while ( fields[i] != NULL ){ - Query* q = QueryParser::parse(query, fields[i], analyzer); - bQuery->add(q, true, false, false); - + while (fields[i] != NULL){ + Query* q = QueryParser::parse(query, fields[i], analyzer); + if (q && (q->getQueryName() != _T("BooleanQuery") + || ((BooleanQuery*)q)->getClauseCount() > 0)) { + bQuery->add(q , true, false, false); + } else { + _CLDELETE(q); + } i++; } return bQuery; } //static -Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, const uint8_t* flags, Analyzer* analyzer) +Query* MultiFieldQueryParser::parse(const TCHAR* query, const TCHAR** fields, + const uint8_t* flags, Analyzer* analyzer) { BooleanQuery* bQuery = _CLNEW BooleanQuery(); int32_t i = 0; - while ( fields[i] != NULL ) - { - Query* q = QueryParser::parse(query, fields[i], analyzer); - uint8_t flag = flags[i]; - switch (flag) - { - case MultiFieldQueryParser::REQUIRED_FIELD: - bQuery->add(q, true, true, false); - break; - case MultiFieldQueryParser::PROHIBITED_FIELD: - bQuery->add(q, true, false, true); - break; - default: - bQuery->add(q, true, false, false); - break; + while ( fields[i] != NULL ) { + Query* q = QueryParser::parse(query, fields[i], analyzer); + if (q && (q->getQueryName() != _T("BooleanQuery") + || ((BooleanQuery*)q)->getClauseCount() > 0)) { + uint8_t flag = flags[i]; + switch (flag) { + case MultiFieldQueryParser::REQUIRED_FIELD: + bQuery->add(q, true, true, false); + break; + case MultiFieldQueryParser::PROHIBITED_FIELD: + bQuery->add(q, true, false, true); + break; + default: + bQuery->add(q, true, false, false); + break; + } + } else { + _CLDELETE(q); } - i++; } return bQuery; diff --git a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp index e9659cf..5f96e91 100644 --- a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp +++ b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.cpp @@ -91,7 +91,7 @@ QString FSDirectory::FSLock::toString() const // # pragma mark -- FSDirectory::FSIndexInput FSDirectory::FSIndexInput::FSIndexInput(const QString& path, int32_t bufferSize) - : BufferedIndexInput(bufferSize) + : BufferedIndexInput(bufferSize) { CND_PRECONDITION(!path.isEmpty(), "path is NULL"); @@ -155,7 +155,7 @@ FSDirectory::FSIndexInput::FSIndexInput(const FSIndexInput& other) if (other.handle == NULL) _CLTHROWA(CL_ERR_NullPointer, "other handle is null"); - SCOPED_LOCK_MUTEX(other.handle->THIS_LOCK) + SCOPED_LOCK_MUTEX(*other.handle->THIS_LOCK) _pos = other.handle->_fpos; handle = _CL_POINTER(other.handle); @@ -169,7 +169,30 @@ FSDirectory::FSIndexInput::~FSIndexInput() void FSDirectory::FSIndexInput::close() { BufferedIndexInput::close(); +#ifdef _LUCENE_THREADMUTEX + if (handle != NULL) { + // Here we have a bit of a problem... We need to lock the handle to + // ensure that we can safely delete the handle... But if we delete the + // handle, then the scoped unlock, won't be able to unlock the mutex... + + // take a reference of the lock object... + _LUCENE_THREADMUTEX* mutex = handle->THIS_LOCK; + //lock the mutex + mutex->lock(); + + // determine if we are about to delete the handle... + bool doUnlock = (handle->__cl_refcount > 1); + // decdelete (deletes if refcount is down to 0) + _CLDECDELETE(handle); + + if (doUnlock) + mutex->unlock(); + else + delete mutex; + } +#else _CLDECDELETE(handle); +#endif } IndexInput* FSDirectory::FSIndexInput::clone() const @@ -186,7 +209,7 @@ void FSDirectory::FSIndexInput::seekInternal(const int64_t position) void FSDirectory::FSIndexInput::readInternal(uint8_t* b, const int32_t len) { - SCOPED_LOCK_MUTEX(handle->THIS_LOCK) + SCOPED_LOCK_MUTEX(*handle->THIS_LOCK) CND_PRECONDITION(handle != NULL, "shared file handle has closed"); CND_PRECONDITION(handle->fhandle.isOpen(), "file is not open"); @@ -214,8 +237,10 @@ void FSDirectory::FSIndexInput::readInternal(uint8_t* b, const int32_t len) FSDirectory::FSIndexInput::SharedHandle::SharedHandle() : _fpos(0) , _length(0) - { +#ifdef _LUCENE_THREADMUTEX + THIS_LOCK = new _LUCENE_THREADMUTEX; +#endif } FSDirectory::FSIndexInput::SharedHandle::~SharedHandle() diff --git a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.h b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.h index 1302edf..e967380 100644 --- a/src/3rdparty/clucene/src/CLucene/store/FSDirectory.h +++ b/src/3rdparty/clucene/src/CLucene/store/FSDirectory.h @@ -147,7 +147,7 @@ private: void close(); IndexInput* clone() const; - + int64_t length() { return handle->_length; } @@ -174,7 +174,7 @@ private: int64_t _length; QFile fhandle; - DEFINE_MUTEX(THIS_LOCK) + DEFINE_MUTEX(*THIS_LOCK) }; SharedHandle* handle; int64_t _pos; diff --git a/src/3rdparty/clucene/src/CLucene/util/bufferedstream.h b/src/3rdparty/clucene/src/CLucene/util/bufferedstream.h index 2455d5e..b73ad98 100644 --- a/src/3rdparty/clucene/src/CLucene/util/bufferedstream.h +++ b/src/3rdparty/clucene/src/CLucene/util/bufferedstream.h @@ -28,7 +28,9 @@ #include "streambase.h" #include "inputstreambuffer.h" + #include <cassert> +#include <stdio.h> namespace jstreams { diff --git a/src/3rdparty/phonon/ds9/qevr9.h b/src/3rdparty/phonon/ds9/qevr9.h new file mode 100644 index 0000000..8599fce --- /dev/null +++ b/src/3rdparty/phonon/ds9/qevr9.h @@ -0,0 +1,143 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <d3d9.h> + +#define DXVA2_ProcAmp_Brightness 1 +#define DXVA2_ProcAmp_Contrast 2 +#define DXVA2_ProcAmp_Hue 4 +#define DXVA2_ProcAmp_Saturation 8 + +typedef enum { + MFVideoARMode_None = 0x00000000, + MFVideoARMode_PreservePicture = 0x00000001, + MFVideoARMode_PreservePixel = 0x00000002, + MFVideoARMode_NonLinearStretch = 0x00000004, + MFVideoARMode_Mask = 0x00000007 +} MFVideoAspectRatioMode; + +typedef struct { + float left; + float top; + float right; + float bottom; +} MFVideoNormalizedRect; + +typedef struct { + UINT DeviceCaps; + D3DPOOL InputPool; + UINT NumForwardRefSamples; + UINT NumBackwardRefSamples; + UINT Reserved; + UINT DeinterlaceTechnology; + UINT ProcAmpControlCaps; + UINT VideoProcessorOperations; + UINT NoiseFilterTechnology; + UINT DetailFilterTechnology; +} DXVA2_VideoProcessorCaps; + +typedef struct { + union { + struct { + USHORT Fraction; + SHORT Value; + }; + LONG ll; + }; +} DXVA2_Fixed32; + +typedef struct { + DXVA2_Fixed32 MinValue; + DXVA2_Fixed32 MaxValue; + DXVA2_Fixed32 DefaultValue; + DXVA2_Fixed32 StepSize; +} DXVA2_ValueRange; + +typedef struct { + DXVA2_Fixed32 Brightness; + DXVA2_Fixed32 Contrast; + DXVA2_Fixed32 Hue; + DXVA2_Fixed32 Saturation; +} DXVA2_ProcAmpValues; + +DXVA2_Fixed32 DXVA2FloatToFixed(const float _float_) +{ + DXVA2_Fixed32 _fixed_; + _fixed_.Fraction = LOWORD(_float_ * 0x10000); + _fixed_.Value = HIWORD(_float_ * 0x10000); + return _fixed_; +} + +float DXVA2FixedToFloat(const DXVA2_Fixed32 _fixed_) +{ + return (FLOAT)_fixed_.Value + (FLOAT)_fixed_.Fraction / 0x10000; +} + +#undef INTERFACE +#define INTERFACE IMFVideoDisplayControl +DECLARE_INTERFACE_(IMFVideoDisplayControl, IUnknown) +{ + STDMETHOD(GetNativeVideoSize)(THIS_ SIZE* pszVideo, SIZE* pszARVideo) PURE; + STDMETHOD(GetIdealVideoSize)(THIS_ SIZE* pszMin, SIZE* pszMax) PURE; + STDMETHOD(SetVideoPosition)(THIS_ const MFVideoNormalizedRect* pnrcSource, const LPRECT prcDest) PURE; + STDMETHOD(GetVideoPosition)(THIS_ MFVideoNormalizedRect* pnrcSource, LPRECT prcDest) PURE; + STDMETHOD(SetAspectRatioMode)(THIS_ DWORD dwAspectRatioMode) PURE; + STDMETHOD(GetAspectRatioMode)(THIS_ DWORD* pdwAspectRatioMode) PURE; + STDMETHOD(SetVideoWindow)(THIS_ HWND hwndVideo) PURE; + STDMETHOD(GetVideoWindow)(THIS_ HWND* phwndVideo) PURE; + STDMETHOD(RepaintVideo)(THIS_) PURE; + STDMETHOD(GetCurrentImage)(THIS_ BITMAPINFOHEADER* pBih, BYTE** pDib, DWORD* pcbDib, LONGLONG* pTimeStamp) PURE; + STDMETHOD(SetBorderColor)(THIS_ COLORREF Clr) PURE; + STDMETHOD(GetBorderColor)(THIS_ COLORREF* pClr) PURE; + STDMETHOD(SetRenderingPrefs)(THIS_ DWORD dwRenderFlags) PURE; + STDMETHOD(GetRenderingPrefs)(THIS_ DWORD* pdwRenderFlags) PURE; + STDMETHOD(SetFullScreen)(THIS_ BOOL fFullscreen) PURE; + STDMETHOD(GetFullScreen)(THIS_ BOOL* pfFullscreen) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFVideoMixerControl +DECLARE_INTERFACE_(IMFVideoMixerControl, IUnknown) +{ + STDMETHOD(SetStreamZOrder)(THIS_ DWORD dwStreamID, DWORD dwZ) PURE; + STDMETHOD(GetStreamZOrder)(THIS_ DWORD dwStreamID, DWORD* pdwZ) PURE; + STDMETHOD(SetStreamOutputRect)(THIS_ DWORD dwStreamID, const MFVideoNormalizedRect* pnrcOutput) PURE; + STDMETHOD(GetStreamOutputRect)(THIS_ DWORD dwStreamID, MFVideoNormalizedRect* pnrcOutput) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFVideoProcessor +DECLARE_INTERFACE_(IMFVideoProcessor, IUnknown) +{ + STDMETHOD(GetAvailableVideoProcessorModes)(THIS_ UINT* lpdwNumProcessingModes, GUID** ppVideoProcessingModes) PURE; + STDMETHOD(GetVideoProcessorCaps)(THIS_ LPGUID lpVideoProcessorMode, DXVA2_VideoProcessorCaps* lpVideoProcessorCaps) PURE; + STDMETHOD(GetVideoProcessorMode)(THIS_ LPGUID lpMode) PURE; + STDMETHOD(SetVideoProcessorMode)(THIS_ LPGUID lpMode) PURE; + STDMETHOD(GetProcAmpRange)(THIS_ DWORD dwProperty, DXVA2_ValueRange* pPropRange) PURE; + STDMETHOD(GetProcAmpValues)(THIS_ DWORD dwFlags, DXVA2_ProcAmpValues* Values) PURE; + STDMETHOD(SetProcAmpValues)(THIS_ DWORD dwFlags, DXVA2_ProcAmpValues* pValues) PURE; + STDMETHOD(GetFilteringRange)(THIS_ DWORD dwProperty, DXVA2_ValueRange* pPropRange) PURE; + STDMETHOD(GetFilteringValue)(THIS_ DWORD dwProperty, DXVA2_Fixed32* pValue) PURE; + STDMETHOD(SetFilteringValue)(THIS_ DWORD dwProperty, DXVA2_Fixed32* pValue) PURE; + STDMETHOD(GetBackgroundColor)(THIS_ COLORREF* lpClrBkg) PURE; + STDMETHOD(SetBackgroundColor)(THIS_ COLORREF ClrBkg) PURE; +}; +#undef INTERFACE +#define INTERFACE IMFGetService +DECLARE_INTERFACE_(IMFGetService, IUnknown) +{ + STDMETHOD(GetService)(THIS_ REFGUID guidService, REFIID riid, LPVOID* ppvObject) PURE; +}; +#undef INTERFACE diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.cpp b/src/3rdparty/phonon/ds9/videorenderer_default.cpp new file mode 100644 index 0000000..0045a49 --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_default.cpp @@ -0,0 +1,153 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see <http://www.gnu.org/licenses/>. +*/ + + +#include "videorenderer_default.h" + +#ifndef QT_NO_PHONON_VIDEO + +#include <QtGui/QWidget> +#include <QtGui/QPainter> + +#include <uuids.h> + +QT_BEGIN_NAMESPACE + + +namespace Phonon +{ + namespace DS9 + { + VideoRendererDefault::~VideoRendererDefault() + { + } + + bool VideoRendererDefault::isNative() const + { + return true; + } + + + VideoRendererDefault::VideoRendererDefault(QWidget *target) : m_target(target) + { + m_target->setAttribute(Qt::WA_PaintOnScreen, true); + m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter); + } + + QSize VideoRendererDefault::videoSize() const + { + LONG w = 0, + h = 0; + ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->GetVideoSize( &w, &h); + } + return QSize(w, h); + } + + void VideoRendererDefault::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/) + { + //nothing to do here: the renderer paints everything + } + + void VideoRendererDefault::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, + Phonon::VideoWidget::ScaleMode scaleMode) + { + if (!isActive()) { + ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->SetDestinationPosition(0, 0, 0, 0); + } + return; + } + + ComPointer<IVideoWindow> video(m_filter, IID_IVideoWindow); + + OAHWND owner; + HRESULT hr = video->get_Owner(&owner); + if (FAILED(hr)) { + return; + } + + const OAHWND newOwner = reinterpret_cast<OAHWND>(m_target->winId()); + if (owner != newOwner) { + video->put_Owner(newOwner); + video->put_MessageDrain(newOwner); + video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); + } + + //make sure the widget takes the whole size of the parent + video->SetWindowPosition(0, 0, size.width(), size.height()); + + const QSize vsize = videoSize(); + internalNotifyResize(size, vsize, aspectRatio, scaleMode); + + ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo); + if (basic) { + basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight); + } + } + + void VideoRendererDefault::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/) + { + //this can't be supported for the default renderer + } + + QImage VideoRendererDefault::snapshot() const + { + ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo); + if (basic) { + LONG bufferSize = 0; + //1st we get the buffer size + basic->GetCurrentImage(&bufferSize, 0); + + QByteArray buffer; + buffer.resize(bufferSize); + HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast<long*>(buffer.data())); + + if (SUCCEEDED(hr)) { + + const BITMAPINFOHEADER *bmi = reinterpret_cast<const BITMAPINFOHEADER*>(buffer.constData()); + + const int w = qAbs(bmi->biWidth), + h = qAbs(bmi->biHeight); + + // Create image and copy data into image. + QImage ret(w, h, QImage::Format_RGB32); + + if (!ret.isNull()) { + const char *data = buffer.constData() + bmi->biSize; + const int bytes_per_line = w * sizeof(QRgb); + for (int y = h - 1; y >= 0; --y) { + qMemCopy(ret.scanLine(y), //destination + data, //source + bytes_per_line); + data += bytes_per_line; + } + } + return ret; + } + } + return QImage(); + } + + } +} + +QT_END_NAMESPACE + +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/ds9/videorenderer_default.h b/src/3rdparty/phonon/ds9/videorenderer_default.h new file mode 100644 index 0000000..43768d9 --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_default.h @@ -0,0 +1,55 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef PHONON_VIDEORENDERER_DEFAULT_H +#define PHONON_VIDEORENDERER_DEFAULT_H + +#include "abstractvideorenderer.h" + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_PHONON_VIDEO + +namespace Phonon +{ + namespace DS9 + { + class VideoRendererDefault : public AbstractVideoRenderer + { + public: + VideoRendererDefault(QWidget *target); + ~VideoRendererDefault(); + + //Implementation from AbstractVideoRenderer + void repaintCurrentFrame(QWidget *target, const QRect &rect); + void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode); + QSize videoSize() const; + QImage snapshot() const; + void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation); + bool isNative() const; + private: + QWidget *m_target; + }; + } +} + +#endif //QT_NO_PHONON_VIDEO + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.cpp b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp new file mode 100644 index 0000000..d23d9ce --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.cpp @@ -0,0 +1,215 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see <http://www.gnu.org/licenses/>. +*/ + + +#include "videorenderer_evr.h" +#include "qevr9.h" + +#ifndef QT_NO_PHONON_VIDEO + +#include <QtGui/QWidget> +#include <QtGui/QPainter> + +QT_BEGIN_NAMESPACE + +namespace Phonon +{ + namespace DS9 + { + //we have to define them here because not all compilers/sdk have them + static const GUID MR_VIDEO_RENDER_SERVICE = {0x1092a86c, 0xab1a, 0x459a, {0xa3, 0x36, 0x83, 0x1f, 0xbc, 0x4d, 0x11, 0xff} }; + static const GUID MR_VIDEO_MIXER_SERVICE = { 0x73cd2fc, 0x6cf4, 0x40b7, {0x88, 0x59, 0xe8, 0x95, 0x52, 0xc8, 0x41, 0xf8} }; + static const IID IID_IMFVideoDisplayControl = {0xa490b1e4, 0xab84, 0x4d31, {0xa1, 0xb2, 0x18, 0x1e, 0x03, 0xb1, 0x07, 0x7a} }; + static const IID IID_IMFVideoMixerControl = {0xA5C6C53F, 0xC202, 0x4aa5, {0x96, 0x95, 0x17, 0x5B, 0xA8, 0xC5, 0x08, 0xA5} }; + static const IID IID_IMFVideoProcessor = {0x6AB0000C, 0xFECE, 0x4d1f, {0xA2, 0xAC, 0xA9, 0x57, 0x35, 0x30, 0x65, 0x6E} }; + static const IID IID_IMFGetService = {0xFA993888, 0x4383, 0x415A, {0xA9, 0x30, 0xDD, 0x47, 0x2A, 0x8C, 0xF6, 0xF7} }; + static const GUID CLSID_EnhancedVideoRenderer = {0xfa10746c, 0x9b63, 0x4b6c, {0xbc, 0x49, 0xfc, 0x30, 0xe, 0xa5, 0xf2, 0x56} }; + + template <typename T> ComPointer<T> getService(const Filter &filter, REFGUID guidService, REFIID riid) + { + //normally we should use IID_IMFGetService but this introduces another dependency + //so here we simply define our own IId with the same value + ComPointer<IMFGetService> getService(filter, IID_IMFGetService); + Q_ASSERT(getService); + T *ptr = 0; + HRESULT hr = getService->GetService(guidService, riid, reinterpret_cast<void **>(&ptr)); + if (!SUCCEEDED(hr) || ptr == 0) + Q_ASSERT(!SUCCEEDED(hr) && ptr != 0); + ComPointer<T> service(ptr); + return service; + } + + VideoRendererEVR::~VideoRendererEVR() + { + } + + bool VideoRendererEVR::isNative() const + { + return true; + } + + VideoRendererEVR::VideoRendererEVR(QWidget *target) : m_target(target) + { + m_filter = Filter(CLSID_EnhancedVideoRenderer, IID_IBaseFilter); + if (!m_filter) { + return; + } + + ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterControl->SetVideoWindow(reinterpret_cast<HWND>(target->winId())); + filterControl->SetAspectRatioMode(MFVideoARMode_None); // We're in control of the size + } + + QImage VideoRendererEVR::snapshot() const + { + // This will always capture black areas where no video is drawn, if any are present. + // Due to the hack in notifyResize() + ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + if (filterControl) { + BITMAPINFOHEADER bmi; + BYTE *buffer = 0; + DWORD bufferSize; + LONGLONG timeStamp; + + bmi.biSize = sizeof(BITMAPINFOHEADER); + + HRESULT hr = filterControl->GetCurrentImage(&bmi, &buffer, &bufferSize, &timeStamp); + if (SUCCEEDED(hr)) { + + const int w = qAbs(bmi.biWidth), + h = qAbs(bmi.biHeight); + + // Create image and copy data into image. + QImage ret(w, h, QImage::Format_RGB32); + + if (!ret.isNull()) { + uchar *data = buffer; + const int bytes_per_line = w * sizeof(QRgb); + for (int y = h - 1; y >= 0; --y) { + qMemCopy(ret.scanLine(y), //destination + data, //source + bytes_per_line); + data += bytes_per_line; + } + } + ::CoTaskMemFree(buffer); + return ret; + } + } + return QImage(); + } + + QSize VideoRendererEVR::videoSize() const + { + SIZE nativeSize; + SIZE aspectRatioSize; + + ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterControl->GetNativeVideoSize(&nativeSize, &aspectRatioSize); + + return QSize(nativeSize.cx, nativeSize.cy); + } + + void VideoRendererEVR::repaintCurrentFrame(QWidget *target, const QRect &rect) + { + // repaint the video + ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + // All failed results can be safely ignored + filterControl->RepaintVideo(); + } + + void VideoRendererEVR::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, + Phonon::VideoWidget::ScaleMode scaleMode) + { + if (!isActive()) { + RECT dummyRect = { 0, 0, 0, 0}; + ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + filterControl->SetVideoPosition(0, &dummyRect); + return; + } + + const QSize vsize = videoSize(); + internalNotifyResize(size, vsize, aspectRatio, scaleMode); + + RECT dstRectWin = { 0, 0, size.width(), size.height()}; + + // Resize the Stream output rect instead of the destination rect. + // Hacky workaround for flicker in the areas outside of the destination rect + // This way these areas don't exist + MFVideoNormalizedRect streamOutputRect = { float(m_dstX) / float(size.width()), float(m_dstY) / float(size.height()), + float(m_dstWidth + m_dstX) / float(size.width()), float(m_dstHeight + m_dstY) / float(size.height())}; + + ComPointer<IMFVideoMixerControl> filterMixer = getService<IMFVideoMixerControl>(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerControl); + ComPointer<IMFVideoDisplayControl> filterControl = getService<IMFVideoDisplayControl>(m_filter, MR_VIDEO_RENDER_SERVICE, IID_IMFVideoDisplayControl); + + filterMixer->SetStreamOutputRect(0, &streamOutputRect); + filterControl->SetVideoPosition(0, &dstRectWin); + } + + void VideoRendererEVR::applyMixerSettings(qreal brightness, qreal contrast, qreal hue, qreal saturation) + { + InputPin sink = BackendNode::pins(m_filter, PINDIR_INPUT).first(); + OutputPin source; + if (FAILED(sink->ConnectedTo(source.pparam()))) { + return; //it must be connected to work + } + + // Get the "Video Processor" (used for brightness/contrast/saturation/hue) + ComPointer<IMFVideoProcessor> processor = getService<IMFVideoProcessor>(m_filter, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoProcessor); + Q_ASSERT(processor); + + DXVA2_ValueRange contrastRange; + DXVA2_ValueRange brightnessRange; + DXVA2_ValueRange saturationRange; + DXVA2_ValueRange hueRange; + + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Contrast, &contrastRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Brightness, &brightnessRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Saturation, &saturationRange))) + return; + if (FAILED(processor->GetProcAmpRange(DXVA2_ProcAmp_Hue, &hueRange))) + return; + + DXVA2_ProcAmpValues values; + + values.Contrast = DXVA2FloatToFixed(((contrast < 0 + ? DXVA2FixedToFloat(contrastRange.MinValue) : DXVA2FixedToFloat(contrastRange.MaxValue)) + - DXVA2FixedToFloat(contrastRange.DefaultValue)) * qAbs(contrast) + DXVA2FixedToFloat(contrastRange.DefaultValue)); + values.Brightness = DXVA2FloatToFixed(((brightness < 0 + ? DXVA2FixedToFloat(brightnessRange.MinValue) : DXVA2FixedToFloat(brightnessRange.MaxValue)) + - DXVA2FixedToFloat(brightnessRange.DefaultValue)) * qAbs(brightness) + DXVA2FixedToFloat(brightnessRange.DefaultValue)); + values.Saturation = DXVA2FloatToFixed(((saturation < 0 + ? DXVA2FixedToFloat(saturationRange.MinValue) : DXVA2FixedToFloat(saturationRange.MaxValue)) + - DXVA2FixedToFloat(saturationRange.DefaultValue)) * qAbs(saturation) + DXVA2FixedToFloat(saturationRange.DefaultValue)); + values.Hue = DXVA2FloatToFixed(((hue < 0 + ? DXVA2FixedToFloat(hueRange.MinValue) : DXVA2FixedToFloat(hueRange.MaxValue)) + - DXVA2FixedToFloat(hueRange.DefaultValue)) * qAbs(hue) + DXVA2FixedToFloat(hueRange.DefaultValue)); + + //finally set the settings + processor->SetProcAmpValues(DXVA2_ProcAmp_Contrast | DXVA2_ProcAmp_Brightness | DXVA2_ProcAmp_Saturation | DXVA2_ProcAmp_Hue, &values); + + } + } +} + +QT_END_NAMESPACE + +#endif //QT_NO_PHONON_VIDEO diff --git a/src/3rdparty/phonon/ds9/videorenderer_evr.h b/src/3rdparty/phonon/ds9/videorenderer_evr.h new file mode 100644 index 0000000..229c36d --- /dev/null +++ b/src/3rdparty/phonon/ds9/videorenderer_evr.h @@ -0,0 +1,56 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +This library is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 2.1 or 3 of the License. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef PHONON_VIDEORENDERER_EVR_H +#define PHONON_VIDEORENDERER_EVR_H + +#include "abstractvideorenderer.h" +#include "compointer.h" + +QT_BEGIN_NAMESPACE + +#ifndef QT_NO_PHONON_VIDEO + +namespace Phonon +{ + namespace DS9 + { + class VideoRendererEVR : public AbstractVideoRenderer + { + public: + VideoRendererEVR(QWidget *target); + ~VideoRendererEVR(); + + //Implementation from AbstractVideoRenderer + void repaintCurrentFrame(QWidget *target, const QRect &rect); + void notifyResize(const QSize&, Phonon::VideoWidget::AspectRatio, Phonon::VideoWidget::ScaleMode); + QSize videoSize() const; + QImage snapshot() const; + void applyMixerSettings(qreal brightness, qreal contrast, qreal m_hue, qreal saturation); + bool isNative() const; + private: + QWidget *m_target; + }; + } +} + +#endif //QT_NO_PHONON_VIDEO + +QT_END_NAMESPACE + +#endif + diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp index 81ebb8b..545b31e 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp +++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.cpp @@ -22,14 +22,9 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include <QtGui/QWidget> #include <QtGui/QPainter> -#include <QtCore/QTimerEvent> -#ifndef Q_OS_WINCE #include <d3d9.h> #include <vmr9.h> -#else -#include <uuids.h> -#endif QT_BEGIN_NAMESPACE @@ -48,116 +43,10 @@ namespace Phonon } -#ifdef Q_OS_WINCE - VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target) - { - m_target->setAttribute(Qt::WA_PaintOnScreen, true); - m_filter = Filter(CLSID_VideoRenderer, IID_IBaseFilter); - } - - QSize VideoRendererVMR9::videoSize() const - { - LONG w = 0, - h = 0; - ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->GetVideoSize( &w, &h); - } - return QSize(w, h); - } - - void VideoRendererVMR9::repaintCurrentFrame(QWidget * /*target*/, const QRect & /*rect*/) - { - //nothing to do here: the renderer paints everything - } - - void VideoRendererVMR9::notifyResize(const QSize &size, Phonon::VideoWidget::AspectRatio aspectRatio, - Phonon::VideoWidget::ScaleMode scaleMode) - { - if (!isActive()) { - ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->SetDestinationPosition(0, 0, 0, 0); - } - return; - } - - ComPointer<IVideoWindow> video(m_filter, IID_IVideoWindow); - - OAHWND owner; - HRESULT hr = video->get_Owner(&owner); - if (FAILED(hr)) { - return; - } - - const OAHWND newOwner = reinterpret_cast<OAHWND>(m_target->winId()); - if (owner != newOwner) { - video->put_Owner(newOwner); - video->put_MessageDrain(newOwner); - video->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - } - - //make sure the widget takes the whole size of the parent - video->SetWindowPosition(0, 0, size.width(), size.height()); - - const QSize vsize = videoSize(); - internalNotifyResize(size, vsize, aspectRatio, scaleMode); - - ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo); - if (basic) { - basic->SetDestinationPosition(m_dstX, m_dstY, m_dstWidth, m_dstHeight); - } - } - - void VideoRendererVMR9::applyMixerSettings(qreal /*brightness*/, qreal /*contrast*/, qreal /*m_hue*/, qreal /*saturation*/) - { - //this can't be supported for WinCE - } - - QImage VideoRendererVMR9::snapshot() const - { - ComPointer<IBasicVideo> basic(m_filter, IID_IBasicVideo); - if (basic) { - LONG bufferSize = 0; - //1st we get the buffer size - basic->GetCurrentImage(&bufferSize, 0); - - QByteArray buffer; - buffer.resize(bufferSize); - HRESULT hr = basic->GetCurrentImage(&bufferSize, reinterpret_cast<long*>(buffer.data())); - - if (SUCCEEDED(hr)) { - - const BITMAPINFOHEADER *bmi = reinterpret_cast<const BITMAPINFOHEADER*>(buffer.constData()); - - const int w = qAbs(bmi->biWidth), - h = qAbs(bmi->biHeight); - - // Create image and copy data into image. - QImage ret(w, h, QImage::Format_RGB32); - - if (!ret.isNull()) { - const char *data = buffer.constData() + bmi->biSize; - const int bytes_per_line = w * sizeof(QRgb); - for (int y = h - 1; y >= 0; --y) { - qMemCopy(ret.scanLine(y), //destination - data, //source - bytes_per_line); - data += bytes_per_line; - } - } - return ret; - } - } - return QImage(); - } - -#else VideoRendererVMR9::VideoRendererVMR9(QWidget *target) : m_target(target) { m_filter = Filter(CLSID_VideoMixingRenderer9, IID_IBaseFilter); if (!m_filter) { - qWarning("the video widget could not be initialized correctly"); return; } @@ -325,7 +214,6 @@ namespace Phonon //finally set the settings mixer->SetProcAmpControl(0, &ctrl); } -#endif } } diff --git a/src/3rdparty/phonon/ds9/videorenderer_vmr9.h b/src/3rdparty/phonon/ds9/videorenderer_vmr9.h index 4eb237e..516d79d 100644 --- a/src/3rdparty/phonon/ds9/videorenderer_vmr9.h +++ b/src/3rdparty/phonon/ds9/videorenderer_vmr9.h @@ -19,7 +19,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #define PHONON_VIDEORENDERER_VMR9_H #include "abstractvideorenderer.h" -#include "compointer.h" QT_BEGIN_NAMESPACE diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index 95423c6..09d42a4 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -24,7 +24,12 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "mediaobject.h" +#ifndef Q_OS_WINCE +#include "videorenderer_evr.h" #include "videorenderer_vmr9.h" +#else +#include "videorenderer_default.h" +#endif #include "videorenderer_soft.h" QT_BEGIN_NAMESPACE @@ -352,14 +357,29 @@ namespace Phonon int index = graphIndex * 2 + type; if (m_renderers[index] == 0 && autoCreate) { AbstractVideoRenderer *renderer = 0; - if (type == Native) { - renderer = new VideoRendererVMR9(m_widget); + if (type == Native) { +#ifndef Q_OS_WINCE + renderer = new VideoRendererEVR(m_widget); if (renderer->getFilter() == 0) { - //instanciating the renderer might fail with error VFW_E_DDRAW_CAPS_NOT_SUITABLE (0x80040273) + delete renderer; + //EVR not present, let's try VMR + renderer = new VideoRendererVMR9(m_widget); + if (renderer->getFilter() == 0) { + //instanciating the renderer might fail + m_noNativeRendererSupported = true; + delete renderer; + renderer = 0; + } + } +#else + renderer = new VideoRendererDefault(m_widget); + if (renderer->getFilter() == 0) { + //instanciating the renderer might fail m_noNativeRendererSupported = true; delete renderer; renderer = 0; } +#endif } if (renderer == 0) { diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp b/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp index 7237e91..bf5be6d 100644 --- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp +++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.cpp @@ -67,8 +67,6 @@ static const char qt_meta_stringdata_Phonon__ObjectDescriptionModel_Visualizatio namespace Phonon { -#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4 - template<> const QMetaObject ObjectDescriptionModel<AudioOutputDeviceType>::staticMetaObject = { { &QAbstractListModel::staticMetaObject, qt_meta_stringdata_Phonon__ObjectDescriptionModel_AudioOutputDeviceType, qt_meta_data_Phonon__ObjectDescriptionModel, 0 } @@ -139,7 +137,6 @@ int ObjectDescriptionModel<type>::qt_metacall(QMetaObject::Call _c, int _id, voi return QAbstractListModel::qt_metacall(_c, _id, _a); } */ -#endif int ObjectDescriptionModelData::rowCount(const QModelIndex &parent) const { @@ -365,8 +362,6 @@ QStringList ObjectDescriptionModelData::mimeTypes(ObjectDescriptionType type) co return QStringList(QLatin1String("application/x-phonon-objectdescription") + QString::number(static_cast<int>(type))); } -#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4 -#if !defined(Q_CC_MSVC) || _MSC_VER > 1300 || defined(Q_CC_INTEL) #define INSTANTIATE_META_FUNCTIONS(type) \ template const QMetaObject *ObjectDescriptionModel<type>::metaObject() const; \ template void *ObjectDescriptionModel<type>::qt_metacast(const char *) @@ -376,7 +371,6 @@ INSTANTIATE_META_FUNCTIONS(AudioCaptureDeviceType); INSTANTIATE_META_FUNCTIONS(EffectType); INSTANTIATE_META_FUNCTIONS(AudioChannelType); INSTANTIATE_META_FUNCTIONS(SubtitleType); -#endif /*INSTANTIATE_META_FUNCTIONS(VideoOutputDeviceType); INSTANTIATE_META_FUNCTIONS(VideoCaptureDeviceType); INSTANTIATE_META_FUNCTIONS(AudioCodecType); @@ -384,7 +378,6 @@ INSTANTIATE_META_FUNCTIONS(VideoCodecType); INSTANTIATE_META_FUNCTIONS(ContainerFormatType); INSTANTIATE_META_FUNCTIONS(VisualizationType); */ -#endif //Q_CC_MINGW } // namespace Phonon #endif //QT_NO_PHONON_OBJECTDESCRIPTIONMODEL diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h index 96187c3..8fd622f 100644 --- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h +++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h @@ -195,13 +195,6 @@ and existing builds. */ public: Q_OBJECT_CHECK -/* MinGW 3.4.x gives an ICE when trying to instantiate one of the - ObjectDescriptionModel<foo> classes because it can't handle - half exported classes correct. gcc 4.3.x has a fix for this but - we currently there's no official gcc 4.3 on windows available. - Because of this we need this little hack - */ -#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4 /** \internal */ static PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject staticMetaObject; /** \internal */ @@ -209,7 +202,6 @@ and existing builds. */ /** \internal */ PHONON_TEMPLATE_CLASS_MEMBER_EXPORT void *qt_metacast(const char *_clname); //int qt_metacall(QMetaObject::Call _c, int _id, void **_a); -#endif /** * Returns the number of rows in the model. This value corresponds diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index cedb43f..f834a80 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -161,7 +161,9 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_THREAD Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer) +#endif QUnifiedTimer::QUnifiedTimer() : QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL), @@ -173,12 +175,17 @@ QUnifiedTimer::QUnifiedTimer() : QUnifiedTimer *QUnifiedTimer::instance() { QUnifiedTimer *inst; +#ifndef QT_NO_THREAD if (!unifiedTimer()->hasLocalData()) { inst = new QUnifiedTimer; unifiedTimer()->setLocalData(inst); } else { inst = unifiedTimer()->localData(); } +#else + static QUnifiedTimer unifiedTimer; + inst = &unifiedTimer; +#endif return inst; } @@ -242,7 +249,7 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event) animationTimer.stop(); isPauseTimerActive = false; // invalidate the start reference time - time = QTime(); + time.invalidate(); } else { restartAnimationTimer(); if (!time.isValid()) { diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h index ad35d89..8bc3224 100644 --- a/src/corelib/animation/qabstractanimation_p.h +++ b/src/corelib/animation/qabstractanimation_p.h @@ -58,6 +58,10 @@ #include <QtCore/qtimer.h> #include <private/qobject_p.h> +#ifdef Q_OS_WIN +#include <qt_windows.h> +#endif + #ifndef QT_NO_ANIMATION QT_BEGIN_NAMESPACE @@ -109,6 +113,61 @@ private: Q_DECLARE_PUBLIC(QAbstractAnimation) }; +class ElapsedTimer +{ +public: + ElapsedTimer() { + invalidate(); + } + + void invalidate() { + m_started = -1; + } + + bool isValid() const { + return m_started >= 0; + } + + void start() { + m_started = getTickCount_sys(); + } + + qint64 elapsed() const { + qint64 current = getTickCount_sys(); + qint64 delta = current - m_started; + if (delta < 0) + delta += getPeriod_sys(); //we wrapped around + return delta; + } + +private: + enum { + MSECS_PER_HOUR = 3600000, + MSECS_PER_MIN = 60000 + }; + + qint64 m_started; + + quint64 getPeriod_sys() const { +#ifdef Q_OS_WIN + return Q_UINT64_C(0x100000000); +#else + // fallback + return 86400 * 1000; +#endif + } + + qint64 getTickCount_sys() const { +#ifdef Q_OS_WIN + return ::GetTickCount(); +#else + // fallback + const QTime t = QTime::currentTime(); + return MSECS_PER_HOUR * t.hour() + MSECS_PER_MIN * t.minute() + 1000 * t.second() + t.msec(); +#endif + } +}; + class QUnifiedTimer : public QObject { @@ -162,7 +221,8 @@ private: // timer used to delay the check if we should start/stop the animation timer QBasicTimer startStopAnimationTimer; - QTime time; + ElapsedTimer time; + int lastTick; int timingInterval; int currentAnimationIdx; diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp index cfd7cc2..37b79ba 100644 --- a/src/corelib/animation/qpropertyanimation.cpp +++ b/src/corelib/animation/qpropertyanimation.cpp @@ -118,7 +118,9 @@ void QPropertyAnimationPrivate::updateMetaProperty() propertyType = QVariant::Invalid; if (!targetValue->dynamicPropertyNames().contains(propertyName)) qWarning("QPropertyAnimation: you're trying to animate a non-existing property %s of your QObject", propertyName.constData()); - } + } else if (!targetValue->metaObject()->property(propertyIndex).isWritable()) { + qWarning("QPropertyAnimation: you're trying to animate the non-writable property %s of your QObject", propertyName.constData()); + } } void QPropertyAnimationPrivate::updateProperty(const QVariant &newValue) @@ -265,7 +267,9 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState, QPropertyAnimation *animToStop = 0; { +#ifndef QT_NO_THREAD QMutexLocker locker(QMutexPool::globalInstanceGet(&staticMetaObject)); +#endif typedef QPair<QObject *, QByteArray> QPropertyAnimationPair; typedef QHash<QPropertyAnimationPair, QPropertyAnimation*> QPropertyAnimationHash; static QPropertyAnimationHash hash; diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index 115edbe..173802d 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -431,7 +431,9 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun { // will override any existing interpolators QInterpolatorVector *interpolators = registeredInterpolators(); +#ifndef QT_NO_THREAD QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators)); +#endif if (int(interpolationType) >= interpolators->count()) interpolators->resize(int(interpolationType) + 1); interpolators->replace(interpolationType, func); @@ -446,7 +448,9 @@ template<typename T> static inline QVariantAnimation::Interpolator castToInterpo QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int interpolationType) { QInterpolatorVector *interpolators = registeredInterpolators(); +#ifndef QT_NO_THREAD QMutexLocker locker(QMutexPool::globalInstanceGet(interpolators)); +#endif QVariantAnimation::Interpolator ret = 0; if (interpolationType < interpolators->count()) { ret = interpolators->at(interpolationType); diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index b63a82e..43ea1c8 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -1163,6 +1163,19 @@ QTextDecoder* QTextCodec::makeDecoder() const return new QTextDecoder(this); } +/*! + Creates a QTextDecoder with a specified \a flags to decode chunks + of \c{char *} data to create chunks of Unicode data. + + The caller is responsible for deleting the returned object. + + \since 4.7 +*/ +QTextDecoder* QTextCodec::makeDecoder(QTextCodec::ConversionFlags flags) const +{ + return new QTextDecoder(this, flags); +} + /*! Creates a QTextEncoder which stores enough state to encode chunks @@ -1176,6 +1189,19 @@ QTextEncoder* QTextCodec::makeEncoder() const } /*! + Creates a QTextEncoder with a specified \a flags to encode chunks + of Unicode data as \c{char *} data. + + The caller is responsible for deleting the returned object. + + \since 4.7 +*/ +QTextEncoder* QTextCodec::makeEncoder(QTextCodec::ConversionFlags flags) const +{ + return new QTextEncoder(this, flags); +} + +/*! \fn QByteArray QTextCodec::fromUnicode(const QChar *input, int number, ConverterState *state) const @@ -1316,6 +1342,17 @@ QString QTextCodec::toUnicode(const char *chars) const */ /*! + Constructs a text encoder for the given \a codec and conversion \a flags. + + \since 4.7 +*/ +QTextEncoder::QTextEncoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags) + : c(codec), state() +{ + state.flags = flags; +} + +/*! Destroys the encoder. */ QTextEncoder::~QTextEncoder() @@ -1392,6 +1429,18 @@ QByteArray QTextEncoder::fromUnicode(const QString& uc, int& lenInOut) */ /*! + Constructs a text decoder for the given \a codec and conversion \a flags. + + \since 4.7 +*/ + +QTextDecoder::QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags) + : c(codec), state() +{ + state.flags = flags; +} + +/*! Destroys the decoder. */ QTextDecoder::~QTextDecoder() diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h index a099dd9..5012b42 100644 --- a/src/corelib/codecs/qtextcodec.h +++ b/src/corelib/codecs/qtextcodec.h @@ -85,9 +85,6 @@ public: static QTextCodec *codecForUtfText(const QByteArray &ba); static QTextCodec *codecForUtfText(const QByteArray &ba, QTextCodec *defaultCodec); - QTextDecoder* makeDecoder() const; - QTextEncoder* makeEncoder() const; - bool canEncode(QChar) const; bool canEncode(const QString&) const; @@ -120,6 +117,12 @@ public: QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = 0) const { return convertFromUnicode(in, length, state); } + // ### Qt 5: merge these functions. + QTextDecoder* makeDecoder() const; + QTextDecoder* makeDecoder(ConversionFlags flags) const; + QTextEncoder* makeEncoder() const; + QTextEncoder* makeEncoder(ConversionFlags flags) const; + virtual QByteArray name() const = 0; virtual QList<QByteArray> aliases() const; virtual int mibEnum() const = 0; @@ -157,6 +160,7 @@ class Q_CORE_EXPORT QTextEncoder { Q_DISABLE_COPY(QTextEncoder) public: explicit QTextEncoder(const QTextCodec *codec) : c(codec), state() {} + QTextEncoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags); ~QTextEncoder(); QByteArray fromUnicode(const QString& str); QByteArray fromUnicode(const QChar *uc, int len); @@ -178,6 +182,7 @@ class Q_CORE_EXPORT QTextDecoder { Q_DISABLE_COPY(QTextDecoder) public: explicit QTextDecoder(const QTextCodec *codec) : c(codec), state() {} + QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags); ~QTextDecoder(); QString toUnicode(const char* chars, int len); QString toUnicode(const QByteArray &ba); diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index abdafc3..b237659 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -44,11 +44,11 @@ #include <stddef.h> -#define QT_VERSION_STR "4.6.2" +#define QT_VERSION_STR "4.7.0" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x040602 +#define QT_VERSION 0x040700 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ @@ -275,7 +275,7 @@ namespace QT_NAMESPACE {} # endif #endif -#ifdef AUTODETECT_COCOA +#ifdef QT_AUTODETECT_COCOA # ifdef Q_OS_MAC64 # define QT_MAC_USE_COCOA 1 # define QT_BUILD_KEY QT_BUILD_KEY_COCOA @@ -672,8 +672,9 @@ namespace QT_NAMESPACE {} # define Q_ALIGNOF(type) __alignof__(type) # define Q_TYPEOF(expr) __typeof__(expr) # define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) -// using CC 5.9: Warning: attribute visibility is unsupported and will be skipped.. -//# define Q_DECL_EXPORT __attribute__((__visibility__("default"))) +# endif +# if __SUNPRO_CC >= 0x550 +# define Q_DECL_EXPORT __global # endif # if __SUNPRO_CC < 0x5a0 # define Q_NO_TEMPLATE_FRIENDS @@ -1540,6 +1541,7 @@ inline QT3_SUPPORT bool qt_winUnicode() { return true; } inline QT3_SUPPORT int qWinVersion() { return QSysInfo::WindowsVersion; } #endif +// ### Qt 5: remove Win9x support macros QT_WA and QT_WA_INLINE. #define QT_WA(unicode, ansi) unicode #define QT_WA_INLINE(unicode, ansi) (unicode) diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index 02a1586..2ed0e46 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -6,6 +6,7 @@ HEADERS += \ io/qbuffer.h \ io/qdatastream.h \ io/qdatastream_p.h \ + io/qdataurl_p.h \ io/qdebug.h \ io/qdir.h \ io/qdiriterator.h \ @@ -34,6 +35,7 @@ SOURCES += \ io/qabstractfileengine.cpp \ io/qbuffer.cpp \ io/qdatastream.cpp \ + io/qdataurl.cpp \ io/qdebug.cpp \ io/qdir.cpp \ io/qdiriterator.cpp \ diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 82d3b79..7c1887e 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -48,6 +48,7 @@ #include <stdio.h> #include <ctype.h> #include <stdlib.h> +#include "qendian.h" QT_BEGIN_NAMESPACE @@ -570,6 +571,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_4_4 Version 10 (Qt 4.4) \value Qt_4_5 Version 11 (Qt 4.5) \value Qt_4_6 Version 12 (Qt 4.6) + \value Qt_4_7 Same as Qt_4_6. \sa setVersion(), version() */ @@ -672,24 +674,12 @@ QDataStream &QDataStream::operator>>(qint16 &i) { i = 0; CHECK_STREAM_PRECOND(*this) - if (noswap) { - if (dev->read((char *)&i, 2) != 2) { - i = 0; - setStatus(ReadPastEnd); - } + if (dev->read((char *)&i, 2) != 2) { + i = 0; + setStatus(ReadPastEnd); } else { - union { - qint16 val1; - char val2[2]; - } x; - char *p = x.val2; - char b[2]; - if (dev->read(b, 2) == 2) { - *p++ = b[1]; - *p = b[0]; - i = x.val1; - } else { - setStatus(ReadPastEnd); + if (!noswap) { + i = qbswap(i); } } return *this; @@ -715,26 +705,12 @@ QDataStream &QDataStream::operator>>(qint32 &i) { i = 0; CHECK_STREAM_PRECOND(*this) - if (noswap) { - if (dev->read((char *)&i, 4) != 4) { - i = 0; - setStatus(ReadPastEnd); - } - } else { // swap bytes - union { - qint32 val1; - char val2[4]; - } x; - char *p = x.val2; - char b[4]; - if (dev->read(b, 4) == 4) { - *p++ = b[3]; - *p++ = b[2]; - *p++ = b[1]; - *p = b[0]; - i = x.val1; - } else { - setStatus(ReadPastEnd); + if (dev->read((char *)&i, 4) != 4) { + i = 0; + setStatus(ReadPastEnd); + } else { + if (!noswap) { + i = qbswap(i); } } return *this; @@ -763,31 +739,14 @@ QDataStream &QDataStream::operator>>(qint64 &i) quint32 i1, i2; *this >> i2 >> i1; i = ((quint64)i1 << 32) + i2; - } else if (noswap) { // no conversion needed + } else { if (dev->read((char *)&i, 8) != 8) { i = qint64(0); setStatus(ReadPastEnd); - } - } else { // swap bytes - union { - qint64 val1; - char val2[8]; - } x; - - char *p = x.val2; - char b[8]; - if (dev->read(b, 8) == 8) { - *p++ = b[7]; - *p++ = b[6]; - *p++ = b[5]; - *p++ = b[4]; - *p++ = b[3]; - *p++ = b[2]; - *p++ = b[1]; - *p = b[0]; - i = x.val1; } else { - setStatus(ReadPastEnd); + if (!noswap) { + i = qbswap(i); + } } } return *this; @@ -827,27 +786,17 @@ QDataStream &QDataStream::operator>>(float &f) f = 0.0f; CHECK_STREAM_PRECOND(*this) - if (noswap) { - if (dev->read((char *)&f, 4) != 4) { - f = 0.0f; - setStatus(ReadPastEnd); - } - } else { // swap bytes - union { - float val1; - char val2[4]; - } x; - - char *p = x.val2; - char b[4]; - if (dev->read(b, 4) == 4) { - *p++ = b[3]; - *p++ = b[2]; - *p++ = b[1]; - *p = b[0]; + if (dev->read((char *)&f, 4) != 4) { + f = 0.0f; + setStatus(ReadPastEnd); + } else { + if (!noswap) { + union { + float val1; + quint32 val2; + } x; + x.val2 = qbswap(*reinterpret_cast<quint32 *>(&f)); f = x.val1; - } else { - setStatus(ReadPastEnd); } } return *this; @@ -880,30 +829,17 @@ QDataStream &QDataStream::operator>>(double &f) f = 0.0; CHECK_STREAM_PRECOND(*this) #ifndef Q_DOUBLE_FORMAT - if (noswap) { - if (dev->read((char *)&f, 8) != 8) { - f = 0.0; - setStatus(ReadPastEnd); - } - } else { // swap bytes - union { - double val1; - char val2[8]; - } x; - char *p = x.val2; - char b[8]; - if (dev->read(b, 8) == 8) { - *p++ = b[7]; - *p++ = b[6]; - *p++ = b[5]; - *p++ = b[4]; - *p++ = b[3]; - *p++ = b[2]; - *p++ = b[1]; - *p = b[0]; + if (dev->read((char *)&f, 8) != 8) { + f = 0.0; + setStatus(ReadPastEnd); + } else { + if (!noswap) { + union { + double val1; + quint64 val2; + } x; + x.val2 = qbswap(*reinterpret_cast<quint64 *>(&f)); f = x.val1; - } else { - setStatus(ReadPastEnd); } } #else @@ -1075,20 +1011,10 @@ QDataStream &QDataStream::operator<<(qint8 i) QDataStream &QDataStream::operator<<(qint16 i) { CHECK_STREAM_PRECOND(*this) - if (noswap) { - dev->write((char *)&i, sizeof(qint16)); - } else { // swap bytes - union { - qint16 val1; - char val2[2]; - } x; - x.val1 = i; - char *p = x.val2; - char b[2]; - b[1] = *p++; - b[0] = *p; - dev->write(b, 2); + if (!noswap) { + i = qbswap(i); } + dev->write((char *)&i, sizeof(qint16)); return *this; } @@ -1102,22 +1028,10 @@ QDataStream &QDataStream::operator<<(qint16 i) QDataStream &QDataStream::operator<<(qint32 i) { CHECK_STREAM_PRECOND(*this) - if (noswap) { - dev->write((char *)&i, sizeof(qint32)); - } else { // swap bytes - union { - qint32 val1; - char val2[4]; - } x; - x.val1 = i; - char *p = x.val2; - char b[4]; - b[3] = *p++; - b[2] = *p++; - b[1] = *p++; - b[0] = *p; - dev->write(b, 4); + if (!noswap) { + i = qbswap(i); } + dev->write((char *)&i, sizeof(qint32)); return *this; } @@ -1143,25 +1057,11 @@ QDataStream &QDataStream::operator<<(qint64 i) quint32 i1 = i & 0xffffffff; quint32 i2 = i >> 32; *this << i2 << i1; - } else if (noswap) { // no conversion needed + } else { + if (!noswap) { + i = qbswap(i); + } dev->write((char *)&i, sizeof(qint64)); - } else { // swap bytes - union { - qint64 val1; - char val2[8]; - } x; - x.val1 = i; - char *p = x.val2; - char b[8]; - b[7] = *p++; - b[6] = *p++; - b[5] = *p++; - b[4] = *p++; - b[3] = *p++; - b[2] = *p++; - b[1] = *p++; - b[0] = *p; - dev->write(b, 8); } return *this; } @@ -1205,22 +1105,16 @@ QDataStream &QDataStream::operator<<(float f) CHECK_STREAM_PRECOND(*this) float g = f; // fixes float-on-stack problem - if (noswap) { // no conversion needed - dev->write((char *)&g, sizeof(float)); - } else { // swap bytes + if (!noswap) { union { float val1; - char val2[4]; + quint32 val2; } x; - x.val1 = f; - char *p = x.val2; - char b[4]; - b[3] = *p++; - b[2] = *p++; - b[1] = *p++; - b[0] = *p; - dev->write(b, 4); + x.val1 = g; + x.val2 = qbswap(x.val2); + g = x.val1; } + dev->write((char *)&g, sizeof(float)); return *this; } @@ -1244,26 +1138,16 @@ QDataStream &QDataStream::operator<<(double f) CHECK_STREAM_PRECOND(*this) #ifndef Q_DOUBLE_FORMAT - if (noswap) { - dev->write((char *)&f, sizeof(double)); - } else { + if (!noswap) { union { double val1; - char val2[8]; + quint64 val2; } x; x.val1 = f; - char *p = x.val2; - char b[8]; - b[7] = *p++; - b[6] = *p++; - b[5] = *p++; - b[4] = *p++; - b[3] = *p++; - b[2] = *p++; - b[1] = *p++; - b[0] = *p; - dev->write(b, 8); + x.val2 = qbswap(x.val2); + f = x.val1; } + dev->write((char *)&f, sizeof(double)); #else union { double val1; diff --git a/src/corelib/io/qdatastream.h b/src/corelib/io/qdatastream.h index afc16bc..ec4ba2f 100644 --- a/src/corelib/io/qdatastream.h +++ b/src/corelib/io/qdatastream.h @@ -84,10 +84,11 @@ public: Qt_4_3 = 9, Qt_4_4 = 10, Qt_4_5 = 11, - Qt_4_6 = 12 -#if QT_VERSION >= 0x040700 -#error Add the datastream version for this Qt version + Qt_4_6 = 12, Qt_4_7 = Qt_4_6 +#if QT_VERSION >= 0x040800 +#error Add the datastream version for this Qt version + Qt_4_8 = Qt_4_7 #endif }; diff --git a/src/corelib/io/qdataurl.cpp b/src/corelib/io/qdataurl.cpp new file mode 100644 index 0000000..9bb896e --- /dev/null +++ b/src/corelib/io/qdataurl.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qplatformdefs.h" +#include "qurl.h" +#include "private/qdataurl_p.h" + +QT_BEGIN_NAMESPACE + +/*! + \internal + + Decode a data: URL into its mimetype and payload. Returns a null string if + the URL could not be decoded. +*/ +Q_CORE_EXPORT QPair<QString, QByteArray> qDecodeDataUrl(const QUrl &uri) +{ + QString mimeType; + QByteArray payload; + + if (uri.scheme() == QLatin1String("data") && uri.host().isEmpty()) { + mimeType = QLatin1String("text/plain;charset=US-ASCII"); + + // the following would have been the correct thing, but + // reality often differs from the specification. People have + // data: URIs with ? and # + //QByteArray data = QByteArray::fromPercentEncoding(uri.encodedPath()); + QByteArray data = QByteArray::fromPercentEncoding(uri.toEncoded()); + + // remove the data: scheme + data.remove(0, 5); + + // parse it: + int pos = data.indexOf(','); + if (pos != -1) { + payload = data.mid(pos + 1); + data.truncate(pos); + data = data.trimmed(); + + // find out if the payload is encoded in Base64 + if (data.endsWith(";base64")) { + payload = QByteArray::fromBase64(payload); + data.chop(7); + } + + if (data.toLower().startsWith("charset")) { + int i = 7; // strlen("charset") + while (data.at(i) == ' ') + ++i; + if (data.at(i) == '=') + data.prepend("text/plain;"); + } + + if (!data.isEmpty()) + mimeType = QLatin1String(data.trimmed()); + + } + } + + return QPair<QString,QByteArray>(mimeType,payload); +} + +QT_END_NAMESPACE diff --git a/src/corelib/io/qdataurl_p.h b/src/corelib/io/qdataurl_p.h new file mode 100644 index 0000000..be5b10d --- /dev/null +++ b/src/corelib/io/qdataurl_p.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDATAURL_P_H +#define QDATAURL_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of qDecodeDataUrl. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "QtCore/qurl.h" +#include "QtCore/qbytearray.h" +#include "QtCore/qstring.h" +#include "QtCore/qpair.h" + +QT_BEGIN_NAMESPACE + +Q_CORE_EXPORT QPair<QString, QByteArray> qDecodeDataUrl(const QUrl &url); + +QT_END_NAMESPACE + +#endif // QDATAURL_P_H diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index dc7f17e..f5d803e 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -52,13 +52,13 @@ #include "qregexp.h" #include "qvector.h" #include "qalgorithms.h" +#include "qvarlengtharray.h" + #ifdef QT_BUILD_CORE_LIB -# include "qresource.h" +# include "qresource.h" +# include "private/qcoreglobaldata_p.h" #endif -#include "qvarlengtharray.h" - -#include "private/qcoreglobaldata_p.h" #include <stdlib.h> QT_BEGIN_NAMESPACE @@ -83,12 +83,10 @@ static QString driveSpec(const QString &path) //************* QDirPrivate class QDirPrivate { - QDir *q_ptr; - Q_DECLARE_PUBLIC(QDir) - friend struct QScopedPointerDeleter<QDirPrivate>; -protected: - QDirPrivate(QDir*, const QDir *copy=0); + +public: + QDirPrivate(const QDir *copy = 0); ~QDirPrivate(); QString initFileEngine(const QString &file); @@ -96,7 +94,6 @@ protected: void updateFileLists() const; void sortFileList(QDir::SortFlags, QFileInfoList &, QStringList *, QFileInfoList *) const; -private: #ifdef QT3_SUPPORT QChar filterSepChar; bool matchAllDirs; @@ -109,28 +106,30 @@ private: sep = QChar(QLatin1Char(' ')); return sep; } - static inline QStringList splitFilters(const QString &nameFilter, QChar sep=0) { - if(sep == 0) + static inline QStringList splitFilters(const QString &nameFilter, QChar sep = 0) { + if (sep == 0) sep = getFilterSepChar(nameFilter); QStringList ret = nameFilter.split(sep); - for(int i = 0; i < ret.count(); i++) + for (int i = 0; i < ret.count(); ++i) ret[i] = ret[i].trimmed(); return ret; } struct Data { inline Data() - : ref(1), fileEngine(0) - { clear(); } + : ref(1), fileEngine(0), listsDirty(1) + {} inline Data(const Data ©) : ref(1), path(copy.path), nameFilters(copy.nameFilters), sort(copy.sort), - filters(copy.filters), fileEngine(0) - { clear(); } + filters(copy.filters), fileEngine(0), listsDirty(1) + {} inline ~Data() { delete fileEngine; } inline void clear() { listsDirty = 1; + files.clear(); + fileInfos.clear(); } mutable QAtomicInt ref; @@ -147,7 +146,6 @@ private: } *data; inline void setPath(const QString &p) { - detach(false); QString path = p; if ((path.endsWith(QLatin1Char('/')) || path.endsWith(QLatin1Char('\\'))) && path.length() > 1) { @@ -156,12 +154,9 @@ private: #endif path.truncate(path.length() - 1); } - if(!data->fileEngine || !QDir::isRelativePath(path)) - path = initFileEngine(path); - data->fileEngine->setFileName(path); + // set the path to be the qt friendly version so then we can operate on it using just / - data->path = data->fileEngine->fileName(QAbstractFileEngine::DefaultName); - data->clear(); + data->path = initFileEngine(path); } inline void reset() { detach(); @@ -170,18 +165,16 @@ private: void detach(bool createFileEngine = true); }; -QDirPrivate::QDirPrivate(QDir *qq, const QDir *copy) : q_ptr(qq) +QDirPrivate::QDirPrivate(const QDir *copy) #ifdef QT3_SUPPORT - , filterSepChar(0) - , matchAllDirs(false) + : filterSepChar(0), matchAllDirs(false) #endif { - if(copy) { + if (copy) { copy->d_func()->data->ref.ref(); data = copy->d_func()->data; } else { data = new QDirPrivate::Data; - data->clear(); } } @@ -190,18 +183,19 @@ QDirPrivate::~QDirPrivate() if (!data->ref.deref()) delete data; data = 0; - q_ptr = 0; } /* For sorting */ -struct QDirSortItem { +struct QDirSortItem +{ mutable QString filename_cache; mutable QString suffix_cache; QFileInfo item; }; -class QDirSortItemComparator { +class QDirSortItemComparator +{ int qt_cmp_si_sort_flags; public: QDirSortItemComparator(int flags) : qt_cmp_si_sort_flags(flags) {} @@ -240,7 +234,7 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt f2->suffix_cache = ic ? f2->item.suffix().toLower() : f2->item.suffix(); - r = qt_cmp_si_sort_flags & QDir::LocaleAware + r = qt_cmp_si_sort_flags & QDir::LocaleAware ? f1->suffix_cache.localeAwareCompare(f2->suffix_cache) : f1->suffix_cache.compare(f2->suffix_cache); } @@ -260,7 +254,7 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt f2->filename_cache = ic ? f2->item.fileName().toLower() : f2->item.fileName(); - r = qt_cmp_si_sort_flags & QDir::LocaleAware + r = qt_cmp_si_sort_flags & QDir::LocaleAware ? f1->filename_cache.localeAwareCompare(f2->filename_cache) : f1->filename_cache.compare(f2->filename_cache); } @@ -274,16 +268,13 @@ bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortIt inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l, QStringList *names, QFileInfoList *infos) const { - if(names) - names->clear(); - if(infos) - infos->clear(); + // names and infos are always empty lists or 0 here int n = l.size(); - if(n > 0) { + if (n > 0) { if (n == 1 || (sort & QDir::SortByMask) == QDir::Unsorted) { - if(infos) + if (infos) *infos = l; - if(names) { + if (names) { for (int i = 0; i < n; ++i) names->append(l.at(i).fileName()); } @@ -291,13 +282,13 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l, QScopedArrayPointer<QDirSortItem> si(new QDirSortItem[n]); for (int i = 0; i < n; ++i) si[i].item = l.at(i); - qSort(si.data(), si.data()+n, QDirSortItemComparator(sort)); + qSort(si.data(), si.data() + n, QDirSortItemComparator(sort)); // put them back in the list(s) - if(infos) { + if (infos) { for (int i = 0; i < n; ++i) infos->append(si[i].item); } - if(names) { + if (names) { for (int i = 0; i < n; ++i) names->append(si[i].item.fileName()); } @@ -307,7 +298,7 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QFileInfoList &l, inline void QDirPrivate::updateFileLists() const { - if(data->listsDirty) { + if (data->listsDirty) { QFileInfoList l; QDirIterator it(data->path, data->nameFilters, data->filters); while (it.hasNext()) { @@ -319,12 +310,11 @@ inline void QDirPrivate::updateFileLists() const } } -QString QDirPrivate::initFileEngine(const QString &path) +inline QString QDirPrivate::initFileEngine(const QString &path) { detach(false); - delete data->fileEngine; - data->fileEngine = 0; data->clear(); + delete data->fileEngine; data->fileEngine = QAbstractFileEngine::create(path); return data->fileEngine->fileName(QAbstractFileEngine::DefaultName); } @@ -520,8 +510,7 @@ void QDirPrivate::detach(bool createFileEngine) \sa currentPath() */ - -QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(this)) +QDir::QDir(const QString &path) : d_ptr(new QDirPrivate) { Q_D(QDir); d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path); @@ -548,18 +537,17 @@ QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(this)) \sa exists(), setPath(), setNameFilter(), setFilter(), setSorting() */ - QDir::QDir(const QString &path, const QString &nameFilter, - SortFlags sort, Filters filters) : d_ptr(new QDirPrivate(this)) + SortFlags sort, Filters filters) : d_ptr(new QDirPrivate) { Q_D(QDir); d->setPath(path.isEmpty() ? QString::fromLatin1(".") : path); d->data->nameFilters = QDir::nameFiltersFromString(nameFilter); bool empty = d->data->nameFilters.isEmpty(); - if(!empty) { + if (!empty) { empty = true; - for(int i = 0; i < d->data->nameFilters.size(); ++i) { - if(!d->data->nameFilters.at(i).isEmpty()) { + for (int i = 0; i < d->data->nameFilters.size(); ++i) { + if (!d->data->nameFilters.at(i).isEmpty()) { empty = false; break; } @@ -577,8 +565,7 @@ QDir::QDir(const QString &path, const QString &nameFilter, \sa operator=() */ - -QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(this, &dir)) +QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(&dir)) { } @@ -586,7 +573,6 @@ QDir::QDir(const QDir &dir) : d_ptr(new QDirPrivate(this, &dir)) Destroys the QDir object frees up its resources. This has no effect on the underlying directory in the file system. */ - QDir::~QDir() { } @@ -607,7 +593,6 @@ QDir::~QDir() \sa path(), absolutePath(), exists(), cleanPath(), dirName(), absoluteFilePath(), isRelative(), makeAbsolute() */ - void QDir::setPath(const QString &path) { Q_D(QDir); @@ -624,7 +609,6 @@ void QDir::setPath(const QString &path) \sa setPath(), absolutePath(), exists(), cleanPath(), dirName(), absoluteFilePath(), toNativeSeparators(), makeAbsolute() */ - QString QDir::path() const { Q_D(const QDir); @@ -639,7 +623,6 @@ QString QDir::path() const \sa setPath(), canonicalPath(), exists(), cleanPath(), dirName(), absoluteFilePath() */ - QString QDir::absolutePath() const { Q_D(const QDir); @@ -649,7 +632,6 @@ QString QDir::absolutePath() const return cleanPath(ret); } - /*! Returns the canonical path, i.e. a path without symbolic links or redundant "." or ".." elements. @@ -666,12 +648,11 @@ QString QDir::absolutePath() const \sa path(), absolutePath(), exists(), cleanPath(), dirName(), absoluteFilePath() */ - QString QDir::canonicalPath() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return cleanPath(d->data->fileEngine->fileName(QAbstractFileEngine::CanonicalName)); } @@ -687,7 +668,6 @@ QString QDir::canonicalPath() const \sa path(), filePath(), absolutePath(), absoluteFilePath() */ - QString QDir::dirName() const { Q_D(const QDir); @@ -706,7 +686,6 @@ QString QDir::dirName() const \sa dirName() absoluteFilePath(), isRelative(), canonicalPath() */ - QString QDir::filePath(const QString &fileName) const { Q_D(const QDir); @@ -714,7 +693,7 @@ QString QDir::filePath(const QString &fileName) const return QString(fileName); QString ret = d->data->path; - if(!fileName.isEmpty()) { + if (!fileName.isEmpty()) { if (!ret.isEmpty() && ret[(int)ret.length()-1] != QLatin1Char('/') && fileName[0] != QLatin1Char('/')) ret += QLatin1Char('/'); ret += fileName; @@ -730,13 +709,12 @@ QString QDir::filePath(const QString &fileName) const \sa relativeFilePath() filePath() canonicalPath() */ - QString QDir::absoluteFilePath(const QString &fileName) const { Q_D(const QDir); if (isAbsolutePath(fileName)) return fileName; - if(!d->data->fileEngine) + if (!d->data->fileEngine) return fileName; QString ret; @@ -744,7 +722,7 @@ QString QDir::absoluteFilePath(const QString &fileName) const if (isRelativePath(d->data->path)) //get pwd ret = QFSFileEngine::currentPath(fileName); #endif - if(!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) { + if (!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) { if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/'))) ret += QLatin1Char('/'); ret += d->data->path; @@ -764,7 +742,6 @@ QString QDir::absoluteFilePath(const QString &fileName) const \sa absoluteFilePath() filePath() canonicalPath() */ - QString QDir::relativeFilePath(const QString &fileName) const { QString dir = absolutePath(); @@ -851,7 +828,7 @@ QString QDir::toNativeSeparators(const QString &pathName) { QString n(pathName); #if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN) - for (int i=0; i<(int)n.length(); i++) { + for (int i = 0; i < (int)n.length(); ++i) { if (n[i] == QLatin1Char('/')) n[i] = QLatin1Char('\\'); } @@ -875,7 +852,7 @@ QString QDir::fromNativeSeparators(const QString &pathName) { QString n(pathName); #if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN) - for (int i=0; i<(int)n.length(); i++) { + for (int i = 0; i < (int)n.length(); ++i) { if (n[i] == QLatin1Char('\\')) n[i] = QLatin1Char('/'); } @@ -894,7 +871,6 @@ QString QDir::fromNativeSeparators(const QString &pathName) \sa cdUp(), isReadable(), exists(), path() */ - bool QDir::cd(const QString &dirName) { Q_D(QDir); @@ -930,14 +906,13 @@ bool QDir::cd(const QString &dirName) } } } - { - QFileInfo fi(newPath); - if (!(fi.exists() && fi.isDir())) - return false; - } - d->setPath(newPath); - refresh(); + QDir dir(*this); + dir.setPath(newPath); + if (!dir.exists()) + return false; + + *this = dir; return true; } @@ -951,7 +926,6 @@ bool QDir::cd(const QString &dirName) \sa cd(), isReadable(), exists(), path() */ - bool QDir::cdUp() { return cd(QString::fromLatin1("..")); @@ -960,7 +934,6 @@ bool QDir::cdUp() /*! Returns the string list set by setNameFilters() */ - QStringList QDir::nameFilters() const { Q_D(const QDir); @@ -983,11 +956,11 @@ QStringList QDir::nameFilters() const \sa nameFilters(), setFilter() */ - void QDir::setNameFilters(const QStringList &nameFilters) { Q_D(QDir); - d->detach(); + + d->reset(); d->data->nameFilters = nameFilters; } @@ -1001,7 +974,6 @@ void QDir::setNameFilters(const QStringList &nameFilters) \sa {The Qt Resource System}, QResource::addSearchPath() */ - void QDir::addResourceSearchPath(const QString &path) { #ifdef QT_BUILD_CORE_LIB @@ -1039,7 +1011,7 @@ void QDir::setSearchPaths(const QString &prefix, const QStringList &searchPaths) return; } - for (int i = 0; i < prefix.count(); i++) { + for (int i = 0; i < prefix.count(); ++i) { if (!prefix.at(i).isLetterOrNumber()) { qWarning("QDir::setSearchPaths: Prefix can only contain letters or numbers"); return; @@ -1089,7 +1061,6 @@ QStringList QDir::searchPaths(const QString &prefix) /*! Returns the value set by setFilter() */ - QDir::Filters QDir::filter() const { Q_D(const QDir); @@ -1171,12 +1142,11 @@ QDir::Filters QDir::filter() const \sa filter(), setNameFilters() */ - void QDir::setFilter(Filters filters) { Q_D(QDir); - d->detach(); + d->reset(); d->data->filters = filters; } @@ -1185,7 +1155,6 @@ void QDir::setFilter(Filters filters) \sa setSorting() SortFlag */ - QDir::SortFlags QDir::sorting() const { Q_D(const QDir); @@ -1231,16 +1200,14 @@ QDir::SortFlags QDir::sorting() const \sa sorting() SortFlag */ - void QDir::setSorting(SortFlags sort) { Q_D(QDir); - d->detach(); + d->reset(); d->data->sort = sort; } - /*! Returns the total number of directories and files in the directory. @@ -1248,7 +1215,6 @@ void QDir::setSorting(SortFlags sort) \sa operator[](), entryList() */ - uint QDir::count() const { Q_D(const QDir); @@ -1260,13 +1226,10 @@ uint QDir::count() const /*! Returns the file name at position \a pos in the list of file names. Equivalent to entryList().at(index). - - Returns an empty string if \a pos is out of range or if the - entryList() function failed. + \a pos must be a valid index position in the list (i.e., 0 <= pos < count()). \sa count(), entryList() */ - QString QDir::operator[](int pos) const { Q_D(const QDir); @@ -1294,7 +1257,6 @@ QString QDir::operator[](int pos) const \sa entryInfoList(), setNameFilters(), setSorting(), setFilter() */ - QStringList QDir::entryList(Filters filters, SortFlags sort) const { Q_D(const QDir); @@ -1342,7 +1304,6 @@ QFileInfoList QDir::entryInfoList(Filters filters, SortFlags sort) const \sa entryInfoList(), setNameFilters(), setSorting(), setFilter() */ - QStringList QDir::entryList(const QStringList &nameFilters, Filters filters, SortFlags sort) const { @@ -1356,10 +1317,12 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters, #endif if (sort == NoSort) sort = d->data->sort; - if (filters == NoFilter && sort == NoSort && nameFilters == d->data->nameFilters) { + + if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) { d->updateFileLists(); return d->data->files; } + QFileInfoList l; QDirIterator it(d->data->path, nameFilters, filters); while (it.hasNext()) { @@ -1387,7 +1350,6 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters, \sa entryList(), setNameFilters(), setSorting(), setFilter(), isReadable(), exists() */ - QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filters, SortFlags sort) const { @@ -1401,10 +1363,12 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter #endif if (sort == NoSort) sort = d->data->sort; - if (filters == NoFilter && sort == NoSort && nameFilters == d->data->nameFilters) { + + if (filters == d->data->filters && sort == d->data->sort && nameFilters == d->data->nameFilters) { d->updateFileLists(); return d->data->fileInfos; } + QFileInfoList l; QDirIterator it(d->data->path, nameFilters, filters); while (it.hasNext()) { @@ -1423,7 +1387,6 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter \sa rmdir() */ - bool QDir::mkdir(const QString &dirName) const { Q_D(const QDir); @@ -1432,7 +1395,7 @@ bool QDir::mkdir(const QString &dirName) const qWarning("QDir::mkdir: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString fn = filePath(dirName); @@ -1448,7 +1411,6 @@ bool QDir::mkdir(const QString &dirName) const \sa mkdir() */ - bool QDir::rmdir(const QString &dirName) const { Q_D(const QDir); @@ -1457,7 +1419,7 @@ bool QDir::rmdir(const QString &dirName) const qWarning("QDir::rmdir: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString fn = filePath(dirName); @@ -1474,7 +1436,6 @@ bool QDir::rmdir(const QString &dirName) const \sa rmpath() */ - bool QDir::mkpath(const QString &dirPath) const { Q_D(const QDir); @@ -1483,7 +1444,7 @@ bool QDir::mkpath(const QString &dirPath) const qWarning("QDir::mkpath: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString fn = filePath(dirPath); @@ -1509,7 +1470,7 @@ bool QDir::rmpath(const QString &dirPath) const qWarning("QDir::rmpath: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString fn = filePath(dirPath); @@ -1525,17 +1486,16 @@ bool QDir::rmpath(const QString &dirPath) const \sa QFileInfo::isReadable() */ - - bool QDir::isReadable() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; - const QAbstractFileEngine::FileFlags info = d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType - |QAbstractFileEngine::PermsMask); - if(!(info & QAbstractFileEngine::DirectoryType)) + const QAbstractFileEngine::FileFlags info = + d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType + | QAbstractFileEngine::PermsMask); + if (!(info & QAbstractFileEngine::DirectoryType)) return false; return info & QAbstractFileEngine::ReadUserPerm; } @@ -1551,19 +1511,17 @@ bool QDir::isReadable() const \sa QFileInfo::exists(), QFile::exists() */ - bool QDir::exists() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; const QAbstractFileEngine::FileFlags info = - d->data->fileEngine->fileFlags( - QAbstractFileEngine::DirectoryType - | QAbstractFileEngine::ExistsFlag - | QAbstractFileEngine::Refresh); - if(!(info & QAbstractFileEngine::DirectoryType)) + d->data->fileEngine->fileFlags(QAbstractFileEngine::DirectoryType + | QAbstractFileEngine::ExistsFlag + | QAbstractFileEngine::Refresh); + if (!(info & QAbstractFileEngine::DirectoryType)) return false; return info & QAbstractFileEngine::ExistsFlag; } @@ -1580,12 +1538,11 @@ bool QDir::exists() const \sa root(), rootPath() */ - bool QDir::isRoot() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return true; return d->data->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag; } @@ -1615,12 +1572,11 @@ bool QDir::isRoot() const \sa makeAbsolute() isAbsolute() isAbsolutePath() cleanPath() */ - bool QDir::isRelative() const { Q_D(const QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->data->fileEngine->isRelativePath(); } @@ -1633,20 +1589,19 @@ bool QDir::isRelative() const \sa isAbsolute() isAbsolutePath() isRelative() cleanPath() */ - bool QDir::makeAbsolute() // ### What do the return values signify? { Q_D(QDir); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QString absolutePath = d->data->fileEngine->fileName(QAbstractFileEngine::AbsoluteName); - if(QDir::isRelativePath(absolutePath)) + if (QDir::isRelativePath(absolutePath)) return false; d->detach(); d->data->path = absolutePath; d->data->fileEngine->setFileName(absolutePath); - if(!(d->data->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType)) + if (!(d->data->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType)) return false; return true; } @@ -1660,22 +1615,21 @@ bool QDir::makeAbsolute() // ### What do the return values signify? \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 10 */ - bool QDir::operator==(const QDir &dir) const { const QDirPrivate *d = d_func(); const QDirPrivate *other = dir.d_func(); - if(d->data == other->data) + if (d->data == other->data) return true; Q_ASSERT(d->data->fileEngine && other->data->fileEngine); - if(d->data->fileEngine->caseSensitive() != other->data->fileEngine->caseSensitive()) + if (d->data->fileEngine->caseSensitive() != other->data->fileEngine->caseSensitive()) return false; - if(d->data->filters == other->data->filters + if (d->data->filters == other->data->filters && d->data->sort == other->data->sort && d->data->nameFilters == other->data->nameFilters) { QString dir1 = absolutePath(), dir2 = dir.absolutePath(); - if(!other->data->fileEngine->caseSensitive()) + if (!other->data->fileEngine->caseSensitive()) return (dir1.toLower() == dir2.toLower()); return (dir1 == dir2); @@ -1688,7 +1642,6 @@ bool QDir::operator==(const QDir &dir) const Makes a copy of the \a dir object and assigns it to this QDir object. */ - QDir &QDir::operator=(const QDir &dir) { if (this == &dir) @@ -1707,7 +1660,6 @@ QDir &QDir::operator=(const QDir &dir) Use setPath() instead. */ - QDir &QDir::operator=(const QString &path) { Q_D(QDir); @@ -1728,22 +1680,19 @@ QDir &QDir::operator=(const QString &path) \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 11 */ - /*! Removes the file, \a fileName. Returns true if the file is removed successfully; otherwise returns false. */ - bool QDir::remove(const QString &fileName) { if (fileName.isEmpty()) { qWarning("QDir::remove: Empty or null file name"); return false; } - QString p = filePath(fileName); - return QFile::remove(p); + return QFile::remove(filePath(fileName)); } /*! @@ -1757,7 +1706,6 @@ bool QDir::remove(const QString &fileName) fail. For example, on at least one file system rename() fails if \a newName points to an open file. */ - bool QDir::rename(const QString &oldName, const QString &newName) { Q_D(QDir); @@ -1766,11 +1714,11 @@ bool QDir::rename(const QString &oldName, const QString &newName) qWarning("QDir::rename: Empty or null file name(s)"); return false; } - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; QFile file(filePath(oldName)); - if(!file.exists()) + if (!file.exists()) return false; return file.rename(filePath(newName)); } @@ -1785,15 +1733,13 @@ bool QDir::rename(const QString &oldName, const QString &newName) \sa QFileInfo::exists(), QFile::exists() */ - bool QDir::exists(const QString &name) const { if (name.isEmpty()) { qWarning("QDir::exists: Empty or null file name"); return false; } - QString tmp = filePath(name); - return QFile::exists(tmp); + return QFile::exists(filePath(name)); } /*! @@ -1805,7 +1751,6 @@ bool QDir::exists(const QString &name) const \sa root(), rootPath() */ - QFileInfoList QDir::drives() { #ifdef QT_NO_FSFILEENGINE @@ -1825,7 +1770,6 @@ QFileInfoList QDir::drives() user using their operating system's separator use toNativeSeparators(). */ - QChar QDir::separator() { #if defined (Q_FS_FAT) || defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) @@ -1844,9 +1788,8 @@ QChar QDir::separator() Returns true if the directory was successfully changed; otherwise returns false. - \sa current() currentPath() home() root() temp() + \sa current(), currentPath(), home(), root(), temp() */ - bool QDir::setCurrent(const QString &path) { #ifdef QT_NO_FSFILEENGINE @@ -1865,13 +1808,13 @@ bool QDir::setCurrent(const QString &path) The directory is constructed using the absolute path of the current directory, ensuring that its path() will be the same as its absolutePath(). - \sa currentPath(), home(), root(), temp() + \sa currentPath(), setCurrent(), home(), root(), temp() */ /*! Returns the absolute path of the application's current directory. - \sa current(), homePath(), rootPath(), tempPath() + \sa current(), setCurrent(), homePath(), rootPath(), tempPath() */ QString QDir::currentPath() { @@ -1888,7 +1831,7 @@ QString QDir::currentPath() Use currentPath() instead. - \sa currentPath() + \sa currentPath(), setCurrent() */ /*! @@ -1945,14 +1888,14 @@ QString QDir::homePath() } /*! - \fn QString QDir::homeDirPath() + \fn QString QDir::homeDirPath() - Returns the absolute path of the user's home directory. + Returns the absolute path of the user's home directory. - Use homePath() instead. + Use homePath() instead. - \sa homePath() - */ + \sa homePath() +*/ /*! \fn QDir QDir::temp() @@ -2018,13 +1961,13 @@ QString QDir::rootPath() } /*! - \fn QString QDir::rootDirPath() + \fn QString QDir::rootDirPath() - Returns the absolute path of the root directory. + Returns the absolute path of the root directory. - Use rootPath() instead. + Use rootPath() instead. - \sa rootPath() + \sa rootPath() */ #ifndef QT_NO_REGEXP @@ -2037,11 +1980,9 @@ QString QDir::rootPath() \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList() */ - - bool QDir::match(const QStringList &filters, const QString &fileName) { - for(QStringList::ConstIterator sit = filters.begin(); sit != filters.end(); ++sit) { + for (QStringList::ConstIterator sit = filters.constBegin(); sit != filters.constEnd(); ++sit) { QRegExp rx(*sit, Qt::CaseInsensitive, QRegExp::Wildcard); if (rx.exactMatch(fileName)) return true; @@ -2057,12 +1998,11 @@ bool QDir::match(const QStringList &filters, const QString &fileName) \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList() */ - bool QDir::match(const QString &filter, const QString &fileName) { return match(nameFiltersFromString(filter), fileName); } -#endif +#endif // QT_NO_REGEXP /*! Removes all multiple directory separators "/" and resolves any @@ -2075,15 +2015,14 @@ bool QDir::match(const QString &filter, const QString &fileName) \sa absolutePath() canonicalPath() */ - QString QDir::cleanPath(const QString &path) { if (path.isEmpty()) return path; QString name = path; QChar dir_separator = separator(); - if(dir_separator != QLatin1Char('/')) - name.replace(dir_separator, QLatin1Char('/')); + if (dir_separator != QLatin1Char('/')) + name.replace(dir_separator, QLatin1Char('/')); int used = 0, levels = 0; const int len = name.length(); @@ -2091,27 +2030,27 @@ QString QDir::cleanPath(const QString &path) QChar *out = outVector.data(); const QChar *p = name.unicode(); - for(int i = 0, last = -1, iwrite = 0; i < len; i++) { - if(p[i] == QLatin1Char('/')) { - while(i < len-1 && p[i+1] == QLatin1Char('/')) { + for (int i = 0, last = -1, iwrite = 0; i < len; ++i) { + if (p[i] == QLatin1Char('/')) { + while (i < len-1 && p[i+1] == QLatin1Char('/')) { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) //allow unc paths - if(!i) + if (!i) break; #endif i++; } bool eaten = false; - if(i < len - 1 && p[i+1] == QLatin1Char('.')) { + if (i < len - 1 && p[i+1] == QLatin1Char('.')) { int dotcount = 1; - if(i < len - 2 && p[i+2] == QLatin1Char('.')) + if (i < len - 2 && p[i+2] == QLatin1Char('.')) dotcount++; - if(i == len - dotcount - 1) { - if(dotcount == 1) { + if (i == len - dotcount - 1) { + if (dotcount == 1) { break; - } else if(levels) { - if(last == -1) { - for(int i2 = iwrite-1; i2 >= 0; i2--) { - if(out[i2] == QLatin1Char('/')) { + } else if (levels) { + if (last == -1) { + for (int i2 = iwrite-1; i2 >= 0; i2--) { + if (out[i2] == QLatin1Char('/')) { last = i2; break; } @@ -2120,11 +2059,11 @@ QString QDir::cleanPath(const QString &path) used -= iwrite - last - 1; break; } - } else if(p[i+dotcount+1] == QLatin1Char('/')) { - if(dotcount == 2 && levels) { - if(last == -1 || iwrite - last == 1) { - for(int i2 = (last == -1) ? (iwrite-1) : (last-1); i2 >= 0; i2--) { - if(out[i2] == QLatin1Char('/')) { + } else if (p[i+dotcount+1] == QLatin1Char('/')) { + if (dotcount == 2 && levels) { + if (last == -1 || iwrite - last == 1) { + for (int i2 = (last == -1) ? (iwrite-1) : (last-1); i2 >= 0; i2--) { + if (out[i2] == QLatin1Char('/')) { eaten = true; last = i2; break; @@ -2133,7 +2072,7 @@ QString QDir::cleanPath(const QString &path) } else { eaten = true; } - if(eaten) { + if (eaten) { levels--; used -= iwrite - last; iwrite = last; @@ -2145,38 +2084,38 @@ QString QDir::cleanPath(const QString &path) iwrite = qMax(0, last); last = -1; ++i; - } else if(dotcount == 1) { + } else if (dotcount == 1) { eaten = true; } - if(eaten) + if (eaten) i += dotcount; } else { levels++; } - } else if(last != -1 && iwrite - last == 1) { + } else if (last != -1 && iwrite - last == 1) { #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) eaten = (iwrite > 2); #else eaten = true; #endif last = -1; - } else if(last != -1 && i == len-1) { + } else if (last != -1 && i == len-1) { eaten = true; } else { levels++; } - if(!eaten) + if (!eaten) last = i - (i - iwrite); else continue; - } else if(!i && p[i] == QLatin1Char('.')) { + } else if (!i && p[i] == QLatin1Char('.')) { int dotcount = 1; - if(len >= 1 && p[1] == QLatin1Char('.')) + if (len >= 1 && p[1] == QLatin1Char('.')) dotcount++; - if(len >= dotcount && p[dotcount] == QLatin1Char('/')) { - if(dotcount == 1) { + if (len >= dotcount && p[dotcount] == QLatin1Char('/')) { + if (dotcount == 1) { i++; - while(i+1 < len-1 && p[i+1] == QLatin1Char('/')) + while (i+1 < len-1 && p[i+1] == QLatin1Char('/')) i++; continue; } @@ -2185,16 +2124,15 @@ QString QDir::cleanPath(const QString &path) out[iwrite++] = p[i]; used++; } - QString ret; - if(used == len) - ret = name; - else - ret = QString(out, used); + QString ret = (used == len ? name : QString(out, used)); // Strip away last slash except for root directories - if (ret.endsWith(QLatin1Char('/')) - && !(ret.size() == 1 || (ret.size() == 3 && ret.at(1) == QLatin1Char(':')))) - ret = ret.left(ret.length() - 1); + if (ret.length() > 1 && ret.endsWith(QLatin1Char('/'))) { +#ifdef Q_OS_WIN + if (!(ret.length() == 3 && ret.at(1) == QLatin1Char(':'))) +#endif + ret.chop(1); + } return ret; } @@ -2205,7 +2143,6 @@ QString QDir::cleanPath(const QString &path) \sa isRelative() isAbsolutePath() makeAbsolute() */ - bool QDir::isRelativePath(const QString &path) { return QFileInfo(path).isRelative(); @@ -2214,12 +2151,11 @@ bool QDir::isRelativePath(const QString &path) /*! Refreshes the directory information. */ - void QDir::refresh() const { Q_D(const QDir); - d->data->clear(); + const_cast<QDirPrivate *>(d)->reset(); } /*! @@ -2229,7 +2165,6 @@ void QDir::refresh() const there is more than one filter, each pair of filters is separated by a space or by a semicolon.) */ - QStringList QDir::nameFiltersFromString(const QString &nameFilter) { return QDirPrivate::splitFilters(nameFilter); @@ -2309,6 +2244,8 @@ bool QDir::matchAllDirs() const void QDir::setMatchAllDirs(bool on) { Q_D(QDir); + + d->reset(); d->matchAllDirs = on; } @@ -2421,7 +2358,8 @@ void QDir::setNameFilter(const QString &nameFilter) Use QDir::SortFlags instead. */ -#endif +#endif // QT3_SUPPORT + #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug debug, QDir::Filters filters) { @@ -2484,9 +2422,6 @@ QDebug operator<<(QDebug debug, const QDir &dir) << ')'; return debug.space(); } - - - -#endif +#endif // QT_NO_DEBUG_STREAM QT_END_NAMESPACE diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h index 6be4922..186dd2f 100644 --- a/src/corelib/io/qdir.h +++ b/src/corelib/io/qdir.h @@ -83,7 +83,7 @@ public: Modified = 0x080, Hidden = 0x100, System = 0x200, - + AccessMask = 0x3F0, AllDirs = 0x400, @@ -215,6 +215,7 @@ public: static bool match(const QStringList &filters, const QString &fileName); static bool match(const QString &filter, const QString &fileName); #endif + static QString cleanPath(const QString &path); void refresh() const; @@ -246,7 +247,7 @@ public: inline QT3_SUPPORT static QString homeDirPath() { return homePath(); } inline QT3_SUPPORT static QString rootDirPath() { return rootPath(); } inline QT3_SUPPORT static QString cleanDirPath(const QString &name) { return cleanPath(name); } -#endif +#endif // QT3_SUPPORT }; Q_DECLARE_OPERATORS_FOR_FLAGS(QDir::Filters) diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index e90529e..625098e 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -41,12 +41,8 @@ #include "qplatformdefs.h" #include "qfileinfo.h" -#include "qdatetime.h" -#include "qabstractfileengine.h" #include "qfsfileengine_p.h" #include "qglobal.h" -#include "qatomic.h" -#include "qhash.h" #include "qdir.h" #include "qfileinfo_p.h" @@ -54,7 +50,7 @@ QT_BEGIN_NAMESPACE QFileInfoPrivate::QFileInfoPrivate(const QFileInfo *copy) { - if(copy) { + if (copy) { copy->d_func()->data->ref.ref(); data = copy->d_func()->data; } else { @@ -81,7 +77,8 @@ void QFileInfoPrivate::initFileEngine(const QString &file) bool QFileInfoPrivate::hasAccess(Access access) const { - if (!(getFileFlags(QAbstractFileEngine::FileInfoAll) & QAbstractFileEngine::LocalDiskFlag)) { + if (!(getFileFlags(QAbstractFileEngine::PermsMask + | QAbstractFileEngine::LocalDiskFlag) & QAbstractFileEngine::LocalDiskFlag)) { switch (access) { case ReadAccess: return getFileFlags(QAbstractFileEngine::ReadUserPerm); @@ -129,86 +126,104 @@ void QFileInfoPrivate::detach() QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const { - if(data->cache_enabled && !data->fileNames[(int)name].isNull()) + if (data->cache_enabled && !data->fileNames[(int)name].isNull()) return data->fileNames[(int)name]; QString ret = data->fileEngine->fileName(name); - if(data->cache_enabled) + if (ret.isNull()) + ret = QLatin1String(""); + if (data->cache_enabled) data->fileNames[(int)name] = ret; return ret; } +QString QFileInfoPrivate::getFileOwner(QAbstractFileEngine::FileOwner own) const +{ + if (data->cache_enabled && !data->fileOwners[(int)own].isNull()) + return data->fileOwners[(int)own]; + QString ret = data->fileEngine->owner(own); + if (ret.isNull()) + ret = QLatin1String(""); + if (data->cache_enabled) + data->fileOwners[(int)own] = ret; + return ret; +} + uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) const { - // We split the testing into tests for for LinkType, BundleType and the rest. + // We split the testing into tests for for LinkType, BundleType, PermsMask + // and the rest. + // Tests for file permissions on Windows can be slow, expecially on network + // paths and NTFS drives. // In order to determine if a file is a symlink or not, we have to lstat(). // If we're not interested in that information, we might as well avoid one // extra syscall. Bundle detecton on Mac can be slow, expecially on network // paths, so we separate out that as well. - QAbstractFileEngine::FileFlags flags; - if (!data->getCachedFlag(CachedFileFlags)) { - QAbstractFileEngine::FileFlags req = QAbstractFileEngine::FileInfoAll; - req &= (~QAbstractFileEngine::LinkType); - req &= (~QAbstractFileEngine::BundleType); + QAbstractFileEngine::FileFlags req = 0; + uint cachedFlags = 0; - flags = data->fileEngine->fileFlags(req); - data->setCachedFlag(CachedFileFlags); - data->fileFlags |= uint(flags); - } else { - flags = QAbstractFileEngine::FileFlags(data->fileFlags & request); - } + if (request & (QAbstractFileEngine::FlagsMask | QAbstractFileEngine::TypesMask)) { + if (!data->getCachedFlag(CachedFileFlags)) { + req |= QAbstractFileEngine::FlagsMask; + req |= QAbstractFileEngine::TypesMask; + req &= (~QAbstractFileEngine::LinkType); + req &= (~QAbstractFileEngine::BundleType); - if (request & QAbstractFileEngine::LinkType) { - if (!data->getCachedFlag(CachedLinkTypeFlag)) { - QAbstractFileEngine::FileFlags linkflag; - linkflag = data->fileEngine->fileFlags(QAbstractFileEngine::LinkType); + cachedFlags |= CachedFileFlags; + } - data->setCachedFlag(CachedLinkTypeFlag); - data->fileFlags |= uint(linkflag); - flags |= linkflag; + if (request & QAbstractFileEngine::LinkType) { + if (!data->getCachedFlag(CachedLinkTypeFlag)) { + req |= QAbstractFileEngine::LinkType; + cachedFlags |= CachedLinkTypeFlag; + } } - } - if (request & QAbstractFileEngine::BundleType) { - if (!data->getCachedFlag(CachedBundleTypeFlag)) { - QAbstractFileEngine::FileFlags bundleflag; - bundleflag = data->fileEngine->fileFlags(QAbstractFileEngine::BundleType); + if (request & QAbstractFileEngine::BundleType) { + if (!data->getCachedFlag(CachedBundleTypeFlag)) { + req |= QAbstractFileEngine::BundleType; + cachedFlags |= CachedBundleTypeFlag; + } + } + } - data->setCachedFlag(CachedBundleTypeFlag); - data->fileFlags |= uint(bundleflag); - flags |= bundleflag; + if (request & QAbstractFileEngine::PermsMask) { + if (!data->getCachedFlag(CachedPerms)) { + req |= QAbstractFileEngine::PermsMask; + cachedFlags |= CachedPerms; } } - // no else branch - // if we had it cached, it was caught in the previous else branch + if (req) { + if (data->cache_enabled) + req &= (~QAbstractFileEngine::Refresh); + else + req |= QAbstractFileEngine::Refresh; - return flags & request; + QAbstractFileEngine::FileFlags flags = data->fileEngine->fileFlags(req); + data->fileFlags |= uint(flags); + data->setCachedFlag(cachedFlags); + } + + return data->fileFlags & request; } QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) const { if (!data->cache_enabled) data->clearFlags(); - if(request == QAbstractFileEngine::CreationTime) { - if(data->getCachedFlag(CachedCTime)) - return data->fileTimes[request]; - data->setCachedFlag(CachedCTime); - return (data->fileTimes[request] = data->fileEngine->fileTime(request)); + uint cf; + if (request == QAbstractFileEngine::CreationTime) + cf = CachedCTime; + else if (request == QAbstractFileEngine::ModificationTime) + cf = CachedMTime; + else + cf = CachedATime; + if (!data->getCachedFlag(cf)) { + data->fileTimes[request] = data->fileEngine->fileTime(request); + data->setCachedFlag(cf); } - if(request == QAbstractFileEngine::ModificationTime) { - if(data->getCachedFlag(CachedMTime)) - return data->fileTimes[request]; - data->setCachedFlag(CachedMTime); - return (data->fileTimes[request] = data->fileEngine->fileTime(request)); - } - if(request == QAbstractFileEngine::AccessTime) { - if(data->getCachedFlag(CachedATime)) - return data->fileTimes[request]; - data->setCachedFlag(CachedATime); - return (data->fileTimes[request] = data->fileEngine->fileTime(request)); - } - return data->fileTimes[0]; //cannot really happen + return data->fileTimes[request]; } //************* QFileInfo @@ -305,7 +320,6 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) \sa setFile() */ - QFileInfo::QFileInfo() : d_ptr(new QFileInfoPrivate()) { } @@ -316,7 +330,6 @@ QFileInfo::QFileInfo() : d_ptr(new QFileInfoPrivate()) \sa setFile(), isRelative(), QDir::setCurrent(), QDir::isRelativePath() */ - QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate()) { d_ptr->initFileEngine(file); @@ -331,7 +344,6 @@ QFileInfo::QFileInfo(const QString &file) : d_ptr(new QFileInfoPrivate()) \sa isRelative() */ - QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate()) { d_ptr->initFileEngine(file.fileName()); @@ -349,7 +361,6 @@ QFileInfo::QFileInfo(const QFile &file) : d_ptr(new QFileInfoPrivate()) \sa isRelative() */ - QFileInfo::QFileInfo(const QDir &dir, const QString &file) : d_ptr(new QFileInfoPrivate()) { d_ptr->initFileEngine(dir.filePath(file)); @@ -358,7 +369,6 @@ QFileInfo::QFileInfo(const QDir &dir, const QString &file) : d_ptr(new QFileInfo /*! Constructs a new QFileInfo that is a copy of the given \a fileinfo. */ - QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fileinfo)) { @@ -368,7 +378,6 @@ QFileInfo::QFileInfo(const QFileInfo &fileinfo) : d_ptr(new QFileInfoPrivate(&fi Destroys the QFileInfo and frees its resources. */ - QFileInfo::~QFileInfo() { } @@ -395,19 +404,19 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const Q_D(const QFileInfo); // ### Qt 5: understand long and short file names on Windows // ### (GetFullPathName()). - if(fileinfo.d_func()->data == d->data) + if (fileinfo.d_func()->data == d->data) return true; - if(!d->data->fileEngine || !fileinfo.d_func()->data->fileEngine) + if (!d->data->fileEngine || !fileinfo.d_func()->data->fileEngine) return false; - if(d->data->fileEngine->caseSensitive() != fileinfo.d_func()->data->fileEngine->caseSensitive()) + if (d->data->fileEngine->caseSensitive() != fileinfo.d_func()->data->fileEngine->caseSensitive()) return false; - if(fileinfo.size() == size()) { //if the size isn't the same... + if (fileinfo.size() == size()) { //if the size isn't the same... QString file1 = canonicalFilePath(), file2 = fileinfo.canonicalFilePath(); - if(file1.length() == file2.length()) { - if(!fileinfo.d_func()->data->fileEngine->caseSensitive()) { - for(int i = 0; i < file1.length(); i++) { - if(file1.at(i).toLower() != file2.at(i).toLower()) + if (file1.length() == file2.length()) { + if (!fileinfo.d_func()->data->fileEngine->caseSensitive()) { + for (int i = 0; i < file1.length(); i++) { + if (file1.at(i).toLower() != file2.at(i).toLower()) return false; } return true; @@ -441,7 +450,6 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) /*! Makes a copy of the given \a fileinfo and assigns it to this QFileInfo. */ - QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo) { Q_D(QFileInfo); @@ -464,7 +472,6 @@ QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo) \sa isRelative(), QDir::setCurrent(), QDir::isRelativePath() */ - void QFileInfo::setFile(const QString &file) { *this = QFileInfo(file); @@ -481,7 +488,6 @@ void QFileInfo::setFile(const QString &file) \sa isRelative() */ - void QFileInfo::setFile(const QFile &file) { *this = QFileInfo(file.fileName()); @@ -498,7 +504,6 @@ void QFileInfo::setFile(const QFile &file) \sa isRelative() */ - void QFileInfo::setFile(const QDir &dir, const QString &file) { *this = QFileInfo(dir.filePath(file)); @@ -528,25 +533,24 @@ void QFileInfo::setFile(const QDir &dir, const QString &file) QString QFileInfo::absoluteFilePath() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::AbsoluteName); } /*! - Returns the canonical path including the file name, i.e. an absolute - path without symbolic links or redundant "." or ".." elements. + Returns the canonical path including the file name, i.e. an absolute + path without symbolic links or redundant "." or ".." elements. - If the file does not exist, canonicalFilePath() returns an empty - string. + If the file does not exist, canonicalFilePath() returns an empty + string. - \sa filePath(), absoluteFilePath(), dir() + \sa filePath(), absoluteFilePath(), dir() */ - QString QFileInfo::canonicalFilePath() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::CanonicalName); } @@ -569,7 +573,6 @@ QString QFileInfo::canonicalFilePath() const \sa absoluteFilePath(), path(), canonicalPath(), fileName(), isRelative() */ - QString QFileInfo::absolutePath() const { Q_D(const QFileInfo); @@ -591,16 +594,14 @@ QString QFileInfo::absolutePath() const \sa path(), absolutePath() */ - QString QFileInfo::canonicalPath() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::CanonicalPathName); } - /*! Returns the file's path. This doesn't include the file name. @@ -610,11 +611,10 @@ QString QFileInfo::canonicalPath() const \sa filePath(), absolutePath(), canonicalPath(), dir(), fileName(), isRelative() */ - QString QFileInfo::path() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::PathName); } @@ -635,16 +635,14 @@ QString QFileInfo::path() const \sa isAbsolute() */ - bool QFileInfo::isRelative() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return true; return d->data->fileEngine->isRelativePath(); } - /*! Converts the file's path to an absolute path if it is not already in that form. Returns true to indicate that the path was converted; otherwise returns false @@ -652,11 +650,10 @@ bool QFileInfo::isRelative() const \sa filePath(), isRelative() */ - bool QFileInfo::makeAbsolute() { Q_D(QFileInfo); - if(!d->data->fileEngine || !d->data->fileEngine->isRelativePath()) + if (!d->data->fileEngine || !d->data->fileEngine->isRelativePath()) return false; QString absFileName = d->getFileName(QAbstractFileEngine::AbsoluteName); d->initFileEngine(absFileName); @@ -669,11 +666,10 @@ bool QFileInfo::makeAbsolute() \note If the file is a symlink that points to a non existing file, false is returned. */ - bool QFileInfo::exists() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::ExistsFlag); } @@ -685,7 +681,6 @@ bool QFileInfo::exists() const \note On Windows CE, there might be a delay for the file system driver to detect changes on the file. */ - void QFileInfo::refresh() { Q_D(QFileInfo); @@ -698,11 +693,10 @@ void QFileInfo::refresh() \sa absoluteFilePath(), canonicalFilePath(), isRelative() */ - QString QFileInfo::filePath() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::DefaultName); } @@ -718,11 +712,10 @@ QString QFileInfo::filePath() const \sa isRelative(), filePath(), baseName(), extension() */ - QString QFileInfo::fileName() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::BaseName); } @@ -739,11 +732,10 @@ QString QFileInfo::fileName() const \sa isBundle(), filePath(), baseName(), extension() */ - QString QFileInfo::bundleName() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::BundleName); } @@ -764,11 +756,10 @@ QString QFileInfo::bundleName() const \sa fileName(), suffix(), completeSuffix(), completeBaseName() */ - QString QFileInfo::baseName() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::BaseName).section(QLatin1Char('.'), 0, 0); } @@ -784,11 +775,10 @@ QString QFileInfo::baseName() const \sa fileName(), suffix(), completeSuffix(), baseName() */ - QString QFileInfo::completeBaseName() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); QString name = d->getFileName(QAbstractFileEngine::BaseName); int index = name.lastIndexOf(QLatin1Char('.')); @@ -806,11 +796,10 @@ QString QFileInfo::completeBaseName() const \sa fileName(), suffix(), baseName(), completeBaseName() */ - QString QFileInfo::completeSuffix() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); QString fileName = d->getFileName(QAbstractFileEngine::BaseName); int firstDot = fileName.indexOf(QLatin1Char('.')); @@ -834,11 +823,10 @@ QString QFileInfo::completeSuffix() const \sa fileName(), completeSuffix(), baseName(), completeBaseName() */ - QString QFileInfo::suffix() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); QString fileName = d->getFileName(QAbstractFileEngine::BaseName); int lastDot = fileName.lastIndexOf(QLatin1Char('.')); @@ -849,24 +837,23 @@ QString QFileInfo::suffix() const /*! - Returns the path of the object's parent directory as a QDir object. + Returns the path of the object's parent directory as a QDir object. - \bold{Note:} The QDir returned always corresponds to the object's - parent directory, even if the QFileInfo represents a directory. + \bold{Note:} The QDir returned always corresponds to the object's + parent directory, even if the QFileInfo represents a directory. - For each of the follwing, dir() returns a QDir for - \c{"~/examples/191697"}. + For each of the follwing, dir() returns a QDir for + \c{"~/examples/191697"}. - \snippet doc/src/snippets/fileinfo/main.cpp 0 + \snippet doc/src/snippets/fileinfo/main.cpp 0 - For each of the follwing, dir() returns a QDir for - \c{"."}. + For each of the follwing, dir() returns a QDir for + \c{"."}. - \snippet doc/src/snippets/fileinfo/main.cpp 1 + \snippet doc/src/snippets/fileinfo/main.cpp 1 - \sa absolutePath(), filePath(), fileName(), isRelative(), absoluteDir() + \sa absolutePath(), filePath(), fileName(), isRelative(), absoluteDir() */ - QDir QFileInfo::dir() const { // ### Qt5: Maybe rename this to parentDirectory(), considering what it actually do? @@ -878,7 +865,6 @@ QDir QFileInfo::dir() const \sa dir(), filePath(), fileName(), isRelative() */ - QDir QFileInfo::absoluteDir() const { return QDir(absolutePath()); @@ -891,7 +877,7 @@ QDir QFileInfo::absoluteDir() const */ QDir QFileInfo::dir(bool absPath) const { - if(absPath) + if (absPath) return absoluteDir(); return dir(); } @@ -902,11 +888,10 @@ QDir QFileInfo::dir(bool absPath) const \sa isWritable(), isExecutable(), permission() */ - bool QFileInfo::isReadable() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->hasAccess(QFileInfoPrivate::ReadAccess); } @@ -916,11 +901,10 @@ bool QFileInfo::isReadable() const \sa isReadable(), isExecutable(), permission() */ - bool QFileInfo::isWritable() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->hasAccess(QFileInfoPrivate::WriteAccess); } @@ -930,11 +914,10 @@ bool QFileInfo::isWritable() const \sa isReadable(), isWritable(), permission() */ - bool QFileInfo::isExecutable() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->hasAccess(QFileInfoPrivate::ExecuteAccess); } @@ -948,7 +931,7 @@ bool QFileInfo::isExecutable() const bool QFileInfo::isHidden() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::HiddenFlag); } @@ -960,11 +943,10 @@ bool QFileInfo::isHidden() const \sa isDir(), isSymLink(), isBundle() */ - bool QFileInfo::isFile() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::FileType); } @@ -975,11 +957,10 @@ bool QFileInfo::isFile() const \sa isFile(), isSymLink(), isBundle() */ - bool QFileInfo::isDir() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::DirectoryType); } @@ -992,11 +973,10 @@ bool QFileInfo::isDir() const \sa isDir(), isSymLink(), isFile() */ - bool QFileInfo::isBundle() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::BundleType); } @@ -1018,21 +998,19 @@ bool QFileInfo::isBundle() const \sa isFile(), isDir(), symLinkTarget() */ - bool QFileInfo::isSymLink() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::LinkType); } /*! - Returns true if the object points to a directory or to a symbolic - link to a directory, and that directory is the root directory; otherwise - returns false. + Returns true if the object points to a directory or to a symbolic + link to a directory, and that directory is the root directory; otherwise + returns false. */ - bool QFileInfo::isRoot() const { Q_D(const QFileInfo); @@ -1064,7 +1042,7 @@ bool QFileInfo::isRoot() const QString QFileInfo::readLink() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); return d->getFileName(QAbstractFileEngine::LinkName); } @@ -1079,13 +1057,12 @@ QString QFileInfo::readLink() const \sa ownerId(), group(), groupId() */ - QString QFileInfo::owner() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); - return d->data->fileEngine->owner(QAbstractFileEngine::OwnerUser); + return d->getFileOwner(QAbstractFileEngine::OwnerUser); } /*! @@ -1096,11 +1073,10 @@ QString QFileInfo::owner() const \sa owner(), group(), groupId() */ - uint QFileInfo::ownerId() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return 0; return d->data->fileEngine->ownerId(QAbstractFileEngine::OwnerUser); } @@ -1115,13 +1091,12 @@ uint QFileInfo::ownerId() const \sa groupId(), owner(), ownerId() */ - QString QFileInfo::group() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QLatin1String(""); - return d->data->fileEngine->owner(QAbstractFileEngine::OwnerGroup); + return d->getFileOwner(QAbstractFileEngine::OwnerGroup); } /*! @@ -1132,11 +1107,10 @@ QString QFileInfo::group() const \sa group(), owner(), ownerId() */ - uint QFileInfo::groupId() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return 0; return d->data->fileEngine->ownerId(QAbstractFileEngine::OwnerGroup); } @@ -1154,11 +1128,10 @@ uint QFileInfo::groupId() const \sa isReadable(), isWritable(), isExecutable() */ - bool QFileInfo::permission(QFile::Permissions permissions) const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return false; return d->getFileFlags(QAbstractFileEngine::FileFlags((int)permissions)) == (uint)permissions; } @@ -1167,11 +1140,10 @@ bool QFileInfo::permission(QFile::Permissions permissions) const Returns the complete OR-ed together combination of QFile::Permissions for the file. */ - QFile::Permissions QFileInfo::permissions() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return 0; return QFile::Permissions(d->getFileFlags(QAbstractFileEngine::PermsMask) & QAbstractFileEngine::PermsMask); } @@ -1183,13 +1155,12 @@ QFile::Permissions QFileInfo::permissions() const \sa exists() */ - qint64 QFileInfo::size() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return 0; - if(!d->data->getCachedFlag(QFileInfoPrivate::CachedSize)) { + if (!d->data->getCachedFlag(QFileInfoPrivate::CachedSize)) { d->data->setCachedFlag(QFileInfoPrivate::CachedSize); d->data->fileSize = d->data->fileEngine->size(); } @@ -1209,11 +1180,10 @@ qint64 QFileInfo::size() const \sa lastModified() lastRead() */ - QDateTime QFileInfo::created() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QDateTime(); return d->getFileTime(QAbstractFileEngine::CreationTime); } @@ -1223,11 +1193,10 @@ QDateTime QFileInfo::created() const \sa created() lastRead() */ - QDateTime QFileInfo::lastModified() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QDateTime(); return d->getFileTime(QAbstractFileEngine::ModificationTime); } @@ -1240,11 +1209,10 @@ QDateTime QFileInfo::lastModified() const \sa created() lastModified() */ - QDateTime QFileInfo::lastRead() const { Q_D(const QFileInfo); - if(!d->data->fileEngine) + if (!d->data->fileEngine) return QDateTime(); return d->getFileTime(QAbstractFileEngine::AccessTime); } @@ -1252,7 +1220,6 @@ QDateTime QFileInfo::lastRead() const /*! \internal Detaches all internal data. */ - void QFileInfo::detach() { Q_D(QFileInfo); @@ -1264,7 +1231,6 @@ void QFileInfo::detach() \sa setCaching(), refresh() */ - bool QFileInfo::caching() const { Q_D(const QFileInfo); @@ -1283,7 +1249,6 @@ bool QFileInfo::caching() const \sa refresh(), caching() */ - void QFileInfo::setCaching(bool enable) { Q_D(QFileInfo); diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h index 065f860..d97a0cf 100644 --- a/src/corelib/io/qfileinfo_p.h +++ b/src/corelib/io/qfileinfo_p.h @@ -54,6 +54,9 @@ // #include "qfileinfo.h" +#include "qabstractfileengine.h" +#include "qdatetime.h" +#include "qatomic.h" QT_BEGIN_NAMESPACE @@ -75,35 +78,41 @@ public: uint getFileFlags(QAbstractFileEngine::FileFlags) const; QDateTime &getFileTime(QAbstractFileEngine::FileTime) const; QString getFileName(QAbstractFileEngine::FileName) const; + QString getFileOwner(QAbstractFileEngine::FileOwner own) const; enum { CachedFileFlags=0x01, CachedLinkTypeFlag=0x02, CachedBundleTypeFlag=0x04, CachedMTime=0x10, CachedCTime=0x20, CachedATime=0x40, - CachedSize =0x08 }; + CachedSize =0x08, CachedPerms=0x80 }; struct Data { inline Data() - : ref(1), fileEngine(0), cache_enabled(1), fileSize(0) - { clear(); } + : ref(1), fileEngine(0), + cachedFlags(0), cache_enabled(1), fileFlags(0), fileSize(0) + {} inline Data(const Data ©) : ref(1), fileEngine(QAbstractFileEngine::create(copy.fileName)), - fileName(copy.fileName), cache_enabled(copy.cache_enabled), fileSize(copy.fileSize) - { clear(); } + fileName(copy.fileName), + cachedFlags(0), cache_enabled(copy.cache_enabled), fileFlags(0), fileSize(0) + {} inline ~Data() { delete fileEngine; } inline void clearFlags() { fileFlags = 0; cachedFlags = 0; if (fileEngine) - (void)fileEngine->fileFlags(QFSFileEngine::Refresh); + (void)fileEngine->fileFlags(QAbstractFileEngine::Refresh); } inline void clear() { clearFlags(); for (int i = QAbstractFileEngine::NFileNames - 1 ; i >= 0 ; --i) fileNames[i].clear(); + fileOwners[1].clear(); + fileOwners[0].clear(); } mutable QAtomicInt ref; QAbstractFileEngine *fileEngine; mutable QString fileName; mutable QString fileNames[QAbstractFileEngine::NFileNames]; + mutable QString fileOwners[2]; mutable uint cachedFlags : 31; mutable uint cache_enabled : 1; diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index 451fbd4..7223e49 100644 --- a/src/corelib/io/qfilesystemwatcher.cpp +++ b/src/corelib/io/qfilesystemwatcher.cpp @@ -248,7 +248,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine() eng = QDnotifyFileSystemWatcherEngine::create(); return eng; #elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) -# if 0 && (defined Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +# if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) return QFSEventsFileSystemWatcherEngine::create(); else diff --git a/src/corelib/io/qfilesystemwatcher_dnotify.cpp b/src/corelib/io/qfilesystemwatcher_dnotify.cpp index 1a218c7..82470c8 100644 --- a/src/corelib/io/qfilesystemwatcher_dnotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_dnotify.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "qplatformdefs.h" #include "qfilesystemwatcher.h" #include "qfilesystemwatcher_dnotify_p.h" @@ -255,16 +256,16 @@ QStringList QDnotifyFileSystemWatcherEngine::addPaths(const QStringList &paths, if(fd == 0) { - DIR *d = ::opendir(path.toUtf8().constData()); + QT_DIR *d = QT_OPENDIR(path.toUtf8().constData()); if(!d) continue; // Could not open directory - DIR *parent = 0; + QT_DIR *parent = 0; QDir parentDir(path); if(!parentDir.isRoot()) { parentDir.cdUp(); - parent = ::opendir(parentDir.path().toUtf8().constData()); + parent = QT_OPENDIR(parentDir.path().toUtf8().constData()); if(!parent) { - ::closedir(d); + QT_CLOSEDIR(d); continue; } } @@ -272,8 +273,8 @@ QStringList QDnotifyFileSystemWatcherEngine::addPaths(const QStringList &paths, fd = qt_safe_dup(::dirfd(d)); int parentFd = parent ? qt_safe_dup(::dirfd(parent)) : 0; - ::closedir(d); - if(parent) ::closedir(parent); + QT_CLOSEDIR(d); + if(parent) QT_CLOSEDIR(parent); Q_ASSERT(fd); if(::fcntl(fd, F_SETSIG, SIGIO) || diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp index 046377e..54ae24e 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp +++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp @@ -94,7 +94,7 @@ static void addPathToHash(PathHash &pathHash, const QString &key, const QFileInf { PathInfoList &list = pathHash[key]; list.push_back(PathInfo(path, - fileInfo.absoluteFilePath().normalized(QString::NormalizationForm_D).toUtf8())); + fileInfo.canonicalFilePath().normalized(QString::NormalizationForm_D).toUtf8())); pathHash.insert(key, list); } @@ -206,7 +206,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths, } else { directories->append(path); // Full file path for dirs. - QCFString cfpath(createFSStreamPath(fileInfo.absoluteFilePath())); + QCFString cfpath(createFSStreamPath(fileInfo.canonicalFilePath())); addPathToHash(dirPathInfoHash, cfpath, fileInfo, path); CFArrayAppendValue(tmpArray, cfpath); } @@ -216,7 +216,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths, continue; } else { // Just the absolute path (minus it's filename) for files. - QCFString cfpath(createFSStreamPath(fileInfo.absolutePath())); + QCFString cfpath(createFSStreamPath(fileInfo.canonicalPath())); files->append(path); addPathToHash(filePathInfoHash, cfpath, fileInfo, path); CFArrayAppendValue(tmpArray, cfpath); @@ -293,7 +293,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat itemCount = CFArrayGetCount(tmpArray); const QString &path = paths.at(i); QFileInfo fi(path); - QCFString cfpath(createFSStreamPath(fi.absolutePath())); + QCFString cfpath(createFSStreamPath(fi.canonicalPath())); CFIndex index = CFArrayGetFirstIndexOfValue(tmpArray, CFRangeMake(0, itemCount), cfpath); if (index != -1) { @@ -302,7 +302,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat removePathFromHash(filePathInfoHash, cfpath, path); } else { // Could be a directory we are watching instead. - QCFString cfdirpath(createFSStreamPath(fi.absoluteFilePath())); + QCFString cfdirpath(createFSStreamPath(fi.canonicalFilePath())); index = CFArrayGetFirstIndexOfValue(tmpArray, CFRangeMake(0, itemCount), cfdirpath); if (index != -1) { CFArrayRemoveValueAtIndex(tmpArray, index); diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index a7dc8fa..4740a89 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -235,7 +235,7 @@ QInotifyFileSystemWatcherEngine::QInotifyFileSystemWatcherEngine(int fd) QInotifyFileSystemWatcherEngine::~QInotifyFileSystemWatcherEngine() { - foreach (int id, pathToID.values()) + foreach (int id, pathToID) inotify_rm_watch(inotifyFd, id < 0 ? -id : id); ::close(inotifyFd); diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp index f088ded..8396481 100644 --- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp +++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp @@ -109,7 +109,7 @@ QKqueueFileSystemWatcherEngine::~QKqueueFileSystemWatcherEngine() close(kqpipe[0]); close(kqpipe[1]); - foreach (int id, pathToID.values()) + foreach (int id, pathToID) ::close(id < 0 ? -id : id); } diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index c842e49..1672dfc 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -56,6 +56,9 @@ #endif #include <stdio.h> #include <stdlib.h> +#if defined(Q_OS_MAC) +# include <private/qcore_mac_p.h> +#endif QT_BEGIN_NAMESPACE @@ -143,9 +146,27 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path) if (path.size() == 1 && path.at(0) == QLatin1Char('/')) return path; #endif - // Mac OS X 10.5.x doesn't support the realpath(X,0) extenstion we use here. -#if defined(Q_OS_LINUX) || defined(Q_OS_SYMBIAN) - char *ret = realpath(path.toLocal8Bit().constData(), (char*)0); +#if defined(Q_OS_LINUX) || defined(Q_OS_SYMBIAN) || defined(Q_OS_MAC) + char *ret = 0; +#if defined(Q_OS_MAC) + // Mac OS X 10.5.x doesn't support the realpath(X,0) extension we use here. + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) { + ret = realpath(path.toLocal8Bit().constData(), (char*)0); + } else { + // on 10.5 we can use FSRef to resolve the file path. + FSRef fsref; + if (FSPathMakeRef((const UInt8 *)QDir::cleanPath(path).toUtf8().data(), &fsref, 0) == noErr) { + CFURLRef urlref = CFURLCreateFromFSRef(NULL, &fsref); + CFStringRef canonicalPath = CFURLCopyFileSystemPath(urlref, kCFURLPOSIXPathStyle); + QString ret = QCFString::toQString(canonicalPath); + CFRelease(canonicalPath); + CFRelease(urlref); + return ret; + } + } +#else + ret = realpath(path.toLocal8Bit().constData(), (char*)0); +#endif if (ret) { QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret)); free(ret); diff --git a/src/corelib/io/qfsfileengine_iterator_unix.cpp b/src/corelib/io/qfsfileengine_iterator_unix.cpp index b68b1a1..bfdb03e 100644 --- a/src/corelib/io/qfsfileengine_iterator_unix.cpp +++ b/src/corelib/io/qfsfileengine_iterator_unix.cpp @@ -58,13 +58,13 @@ public: #endif {} - DIR *dir; - dirent *dirEntry; + QT_DIR *dir; + QT_DIRENT *dirEntry; bool done; #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) // for readdir_r - dirent *mt_file; + QT_DIRENT *mt_file; #endif }; @@ -76,14 +76,14 @@ void QFSFileEngineIterator::advance() return; #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) - if (::readdir_r(platform->dir, platform->mt_file, &platform->dirEntry) != 0) + if (QT_READDIR_R(platform->dir, platform->mt_file, &platform->dirEntry) != 0) platform->done = true; #else // ### add local lock to prevent breaking reentrancy - platform->dirEntry = ::readdir(platform->dir); + platform->dirEntry = QT_READDIR(platform->dir); #endif // _POSIX_THREAD_SAFE_FUNCTIONS if (!platform->dirEntry) { - ::closedir(platform->dir); + QT_CLOSEDIR(platform->dir); platform->dir = 0; platform->done = true; #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) @@ -101,7 +101,7 @@ void QFSFileEngineIterator::newPlatformSpecifics() void QFSFileEngineIterator::deletePlatformSpecifics() { if (platform->dir) { - ::closedir(platform->dir); + QT_CLOSEDIR(platform->dir); #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) delete [] platform->mt_file; platform->mt_file = 0; @@ -115,18 +115,18 @@ bool QFSFileEngineIterator::hasNext() const { if (!platform->done && !platform->dir) { QFSFileEngineIterator *that = const_cast<QFSFileEngineIterator *>(this); - if ((that->platform->dir = ::opendir(QFile::encodeName(path()).data())) == 0) { + if ((that->platform->dir = QT_OPENDIR(QFile::encodeName(path()).data())) == 0) { that->platform->done = true; } else { // ### Race condition; we should use fpathconf and dirfd(). long maxPathName = ::pathconf(QFile::encodeName(path()).data(), _PC_NAME_MAX); if ((int) maxPathName == -1) maxPathName = FILENAME_MAX; - maxPathName += sizeof(dirent) + 1; + maxPathName += sizeof(QT_DIRENT) + 1; #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) && !defined(Q_OS_SYMBIAN) if (that->platform->mt_file) delete [] that->platform->mt_file; - that->platform->mt_file = (dirent *)new char[maxPathName]; + that->platform->mt_file = (QT_DIRENT *)new char[maxPathName]; #endif that->advance(); diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index bec0075..eb99f27 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -66,10 +66,6 @@ #include <ctype.h> #include <limits.h> #define SECURITY_WIN32 -#ifdef Q_CC_MINGW -// A workaround for a certain version of MinGW, the define UNICODE_STRING. -#include <subauth.h> -#endif #include <security.h> #ifndef _INTPTR_T_DEFINED @@ -181,7 +177,7 @@ void QFSFileEnginePrivate::resolveLibs() triedResolve = true; #if !defined(Q_OS_WINCE) - HINSTANCE advapiHnd = LoadLibraryW(L"advapi32"); + HINSTANCE advapiHnd = LoadLibrary(L"advapi32"); if (advapiHnd) { ptrGetNamedSecurityInfoW = (PtrGetNamedSecurityInfoW)GetProcAddress(advapiHnd, "GetNamedSecurityInfoW"); ptrLookupAccountSidW = (PtrLookupAccountSidW)GetProcAddress(advapiHnd, "LookupAccountSidW"); @@ -213,7 +209,7 @@ void QFSFileEnginePrivate::resolveLibs() ptrFreeSid(pWorld); } } - HINSTANCE userenvHnd = LoadLibraryW(L"userenv"); + HINSTANCE userenvHnd = LoadLibrary(L"userenv"); if (userenvHnd) ptrGetUserProfileDirectoryW = (PtrGetUserProfileDirectoryW)GetProcAddress(userenvHnd, "GetUserProfileDirectoryW"); #endif @@ -221,7 +217,6 @@ void QFSFileEnginePrivate::resolveLibs() } #endif // QT_NO_LIBRARY -// UNC functions NT typedef DWORD (WINAPI *PtrNetShareEnum)(LPWSTR, DWORD, LPBYTE*, DWORD, LPDWORD, LPDWORD, LPDWORD); static PtrNetShareEnum ptrNetShareEnum = 0; typedef DWORD (WINAPI *PtrNetApiBufferFree)(LPVOID); @@ -245,7 +240,7 @@ bool QFSFileEnginePrivate::resolveUNCLibs() #endif triedResolve = true; #if !defined(Q_OS_WINCE) - HINSTANCE hLib = LoadLibraryW(L"Netapi32"); + HINSTANCE hLib = LoadLibrary(L"netapi32"); if (hLib) { ptrNetShareEnum = (PtrNetShareEnum)GetProcAddress(hLib, "NetShareEnum"); if (ptrNetShareEnum) @@ -1042,11 +1037,11 @@ QString QFSFileEngine::homePath() if (ok) { DWORD dwBufferSize = 0; // First call, to determine size of the strings (with '\0'). - ok = ::ptrGetUserProfileDirectoryW(token, NULL, &dwBufferSize); + ok = ptrGetUserProfileDirectoryW(token, NULL, &dwBufferSize); if (!ok && dwBufferSize != 0) { // We got the required buffer size wchar_t *userDirectory = new wchar_t[dwBufferSize]; // Second call, now we can fill the allocated buffer. - ok = ::ptrGetUserProfileDirectoryW(token, userDirectory, &dwBufferSize); + ok = ptrGetUserProfileDirectoryW(token, userDirectory, &dwBufferSize); if (ok) ret = QString::fromWCharArray(userDirectory); @@ -1418,7 +1413,7 @@ QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions() const QAbstractFileEngine::FileFlags ret = 0; #if !defined(QT_NO_LIBRARY) - if((qt_ntfs_permission_lookup > 0) && ((QSysInfo::WindowsVersion&QSysInfo::WV_NT_based) > QSysInfo::WV_NT)) { + if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) { resolveLibs(); if(ptrGetNamedSecurityInfoW && ptrBuildTrusteeWithSidW && ptrGetEffectiveRightsFromAclW) { enum { ReadMask = 0x00000001, WriteMask = 0x00000002, ExecMask = 0x00000020 }; @@ -1721,8 +1716,7 @@ QString QFSFileEngine::owner(FileOwner own) const QString name; #if !defined(QT_NO_LIBRARY) Q_D(const QFSFileEngine); - - if ((qt_ntfs_permission_lookup > 0) && ((QSysInfo::WindowsVersion&QSysInfo::WV_NT_based) > QSysInfo::WV_NT)) { + if((qt_ntfs_permission_lookup > 0) && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) { QFSFileEnginePrivate::resolveLibs(); if (ptrGetNamedSecurityInfoW && ptrLookupAccountSidW) { PSID pOwner = 0; diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 0aa534a..906979c 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -46,6 +46,7 @@ #include <QtCore/qobjectdefs.h> #include <QtCore/qpair.h> #include <QtCore/qstring.h> +#include <QtCore/qhash.h> QT_BEGIN_HEADER @@ -75,6 +76,7 @@ public: RemovePath = 0x20, RemoveQuery = 0x40, RemoveFragment = 0x80, + // 0x100: private: normalized StripTrailingSlash = 0x10000 }; @@ -268,6 +270,11 @@ public: inline DataPtr &data_ptr() { return d; } }; +inline uint qHash(const QUrl &uri) +{ + return qHash(uri.toEncoded(QUrl::FormattingOption(0x100))); +} + Q_DECLARE_TYPEINFO(QUrl, Q_MOVABLE_TYPE); Q_DECLARE_SHARED(QUrl) Q_DECLARE_OPERATORS_FOR_FLAGS(QUrl::FormattingOptions) diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index 36e4af9..b0503be 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -1248,7 +1248,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, /*! \fn QModelIndex QAbstractItemModel::parent(const QModelIndex &index) const = 0 - Returns the parent of the model item with the given \a index. If the model + Returns the parent of the model item with the given \a index. If the item has no parent, an invalid QModelIndex is returned. A common convention used in models that expose tree data structures is that diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 3500b63..d23ea4c 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -272,7 +272,6 @@ QT_BEGIN_NAMESPACE \omitvalue MacGLClearDrawable \omitvalue NetworkReplyUpdated \omitvalue FutureCallOut - \omitvalue CocoaRequestModal \omitvalue UpdateSoftKeys \omitvalue NativeGesture */ @@ -331,7 +330,7 @@ QEvent::~QEvent() equivalent of calling setAccepted(false). Clearing the accept parameter indicates that the event receiver - does not want the event. Unwanted events might be propgated to the + does not want the event. Unwanted events might be propagated to the parent widget. \sa accept() diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h index c76e81b..a20d171 100644 --- a/src/corelib/kernel/qcoreevent.h +++ b/src/corelib/kernel/qcoreevent.h @@ -266,7 +266,6 @@ public: UngrabMouse = 187, GrabKeyboard = 188, UngrabKeyboard = 189, - CocoaRequestModal = 190, // Internal for requesting an application modal Cocoa Window MacGLClearDrawable = 191, // Internal Cocoa, the window has changed, so we must clear StateMachineSignal = 192, diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index cbc87f3..7c8fb3d 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -341,6 +341,9 @@ public: // for controlling when to send posted events QAtomicInt serialNumber; int lastSerialNumber; +#ifndef Q_OS_WINCE + int lastMessageTime; +#endif QAtomicInt wakeUps; // timers @@ -364,7 +367,12 @@ public: }; QEventDispatcherWin32Private::QEventDispatcherWin32Private() - : threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0), serialNumber(0), lastSerialNumber(0), wakeUps(0) + : threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0), getMessageHook(0), + serialNumber(0), lastSerialNumber(0), +#ifndef Q_OS_WINCE + lastMessageTime(0), +#endif + wakeUps(0) { resolveTimerAPI(); } @@ -479,6 +487,9 @@ LRESULT CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp) int localSerialNumber = d->serialNumber; if (localSerialNumber != d->lastSerialNumber) { d->lastSerialNumber = localSerialNumber; +#ifndef Q_OS_WINCE + d->lastMessageTime = GetMessageTime(); +#endif QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); } return 0; @@ -495,9 +506,13 @@ LRESULT CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp) if (q) { QEventDispatcherWin32Private *d = q->d_func(); int localSerialNumber = d->serialNumber; - if (HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT | QS_TIMER)) == 0) { - // no more input or timer events in the message queue, we can allow posted events to be - // sent now + if (HIWORD(GetQueueStatus(QS_INPUT | QS_RAWINPUT | QS_TIMER)) == 0 +#ifndef Q_OS_WINCE + || GetMessageTime() - d->lastMessageTime >= 10 +#endif + ) { + // no more input or timer events in the message queue or more than 10ms has elapsed since + // we send posted events, we can allow posted events to be sent now (void) d->wakeUps.fetchAndStoreRelease(0); MSG *msg = (MSG *) lp; if (localSerialNumber != d->lastSerialNumber @@ -744,6 +759,8 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags) if (d->internalHwnd == msg.hwnd && msg.message == WM_QT_SENDPOSTEDEVENTS) { if (seenWM_QT_SENDPOSTEDEVENTS) { + // when calling processEvents() "manually", we only want to send posted + // events once needWM_QT_SENDPOSTEDEVENTS = true; continue; } diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index cd7418a..be1b2ae 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -482,6 +482,46 @@ int QMetaObject::classInfoCount() const return n; } +/** \internal +* helper class for indexOf{Method,Slot,Signal}, returns the relative index of the method within +* the baseObject +* \a MethodType might be MethodSignal or MethodSlot, or 0 to match everything. +*/ +template<int MethodType> +static inline int indexOfMethodRelative(const QMetaObject **baseObject, + const char *method, + bool normalizeStringData) +{ + const QMetaObject *m; + for (m = *baseObject; m; m = *baseObject = m->d.superdata) { + const QMetaObject *const m = *baseObject; + int i = (MethodType == MethodSignal && priv(m->d.data)->revision >= 4) + ? (priv(m->d.data)->signalCount - 1) : (priv(m->d.data)->methodCount - 1); + if (i < 0) + continue; + + const int end = (MethodType == MethodSlot && priv(m->d.data)->revision >= 4) + ? (priv(m->d.data)->signalCount) : 0; + if (!normalizeStringData) { + for (; i >= end; --i) { + if ((MethodType == 0 || (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) + && strcmp(method, m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) + return i; + } + } else if (priv(m->d.data)->revision < 5) { + const char *stringdata = (m->d.stringdata + m->d.data[priv(m->d.data)->methodData + 5 * i]); + const QByteArray normalizedSignature = QMetaObject::normalizedSignature(stringdata); + for (; i >= end; --i) { + if ((MethodType == 0|| (m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodType) + && normalizedSignature == method) + return i; + } + } + } + return -1; +} + + /*! \since 4.5 @@ -515,17 +555,14 @@ int QMetaObject::indexOfConstructor(const char *constructor) const */ int QMetaObject::indexOfMethod(const char *method) const { - int i = -1; const QMetaObject *m = this; - while (m && i < 0) { - for (i = priv(m->d.data)->methodCount-1; i >= 0; --i) - if (strcmp(method, m->d.stringdata - + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) { - i += m->methodOffset(); - break; - } - m = m->d.superdata; + int i = indexOfMethodRelative<0>(&m, method, false); + if (i < 0) { + m = this; + i = indexOfMethodRelative<0>(&m, method, true); } + if (i >= 0) + i += m->methodOffset(); return i; } @@ -543,7 +580,11 @@ int QMetaObject::indexOfMethod(const char *method) const int QMetaObject::indexOfSignal(const char *signal) const { const QMetaObject *m = this; - int i = QMetaObjectPrivate::indexOfSignalRelative(&m, signal); + int i = QMetaObjectPrivate::indexOfSignalRelative(&m, signal, false); + if (i < 0) { + m = this; + i = QMetaObjectPrivate::indexOfSignalRelative(&m, signal, true); + } if (i >= 0) i += m->methodOffset(); return i; @@ -554,21 +595,11 @@ int QMetaObject::indexOfSignal(const char *signal) const \a baseObject will be adjusted to the enclosing QMetaObject, or 0 if the signal is not found */ -int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, const char *signal) +int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, + const char *signal, + bool normalizeStringData) { - int i = -1; - while (*baseObject) { - const QMetaObject *const m = *baseObject; - for (i = priv(m->d.data)->methodCount-1; i >= 0; --i) - if ((m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodSignal - && strcmp(signal, m->d.stringdata - + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) { - break; - } - if (i >= 0) - break; - *baseObject = m->d.superdata; - } + int i = indexOfMethodRelative<MethodSignal>(baseObject, signal, normalizeStringData); #ifndef QT_NO_DEBUG const QMetaObject *m = *baseObject; if (i >= 0 && m && m->d.superdata) { @@ -581,7 +612,6 @@ int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, co return i; } - /*! Finds \a slot and returns its index; otherwise returns -1. @@ -592,18 +622,19 @@ int QMetaObjectPrivate::indexOfSignalRelative(const QMetaObject **baseObject, co */ int QMetaObject::indexOfSlot(const char *slot) const { - int i = -1; - const QMetaObject *m = this; - while (m && i < 0) { - for (i = priv(m->d.data)->methodCount-1; i >= 0; --i) - if ((m->d.data[priv(m->d.data)->methodData + 5*i + 4] & MethodTypeMask) == MethodSlot - && strcmp(slot, m->d.stringdata - + m->d.data[priv(m->d.data)->methodData + 5*i]) == 0) { - i += m->methodOffset(); - break; - } - m = m->d.superdata; - } + int i = QMetaObjectPrivate::indexOfSlot(this, slot, false); + if (i < 0) + i = QMetaObjectPrivate::indexOfSlot(this, slot, true); + return i; +} + +int QMetaObjectPrivate::indexOfSlot(const QMetaObject *m, + const char *slot, + bool normalizeStringData) +{ + int i = indexOfMethodRelative<MethodSlot>(&m, slot, normalizeStringData); + if (i >= 0) + i += m->methodOffset(); return i; } diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h index 3bbb050..a176149 100644 --- a/src/corelib/kernel/qmetaobject_p.h +++ b/src/corelib/kernel/qmetaobject_p.h @@ -115,11 +115,17 @@ struct QMetaObjectPrivate int constructorCount, constructorData; //since revision 2 int flags; //since revision 3 int signalCount; //since revision 4 + // revision 5 introduces changes in normalized signatures, no new members static inline const QMetaObjectPrivate *get(const QMetaObject *metaobject) { return reinterpret_cast<const QMetaObjectPrivate*>(metaobject->d.data); } - static int indexOfSignalRelative(const QMetaObject **baseObject, const char* name); + static int indexOfSignalRelative(const QMetaObject **baseObject, + const char* name, + bool normalizeStringData); + static int indexOfSlot(const QMetaObject *m, + const char *slot, + bool normalizeStringData); static int originalClone(const QMetaObject *obj, int local_method_index); #ifndef QT_NO_QOBJECT @@ -247,6 +253,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc } while (optional[++i].keyword != 0); } + bool star = false; while (t != e) { char c = *t++; if (fixScope && c == ':' && *t == ':' ) { @@ -257,6 +264,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc --i; result.resize(i + 1); } + star = star || c == '*'; result += c; if (c == '<') { //template recursion @@ -277,6 +285,23 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc } } } + + // cv qualifers can appear after the type as well + if (t != e && (e - t >= 5 && strncmp("const", t, 5) == 0)) { + t += 5; + while (t != e && is_space(*t)) + ++t; + if (adjustConst && t != e && *t == '&') { + // treat const ref as value + ++t; + } else if (!star) { + // move const to the front (but not if const comes after a *) + result.prepend("const "); + } else { + // keep const after a * + result += "const"; + } + } } return result; diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index e304290..870baab 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -361,7 +361,14 @@ void QMetaType::registerStreamOperators(const char *typeName, SaveOperator saveO int idx = type(typeName); if (!idx) return; + registerStreamOperators(idx, saveOp, loadOp); +} +/*! \internal +*/ +void QMetaType::registerStreamOperators(int idx, SaveOperator saveOp, + LoadOperator loadOp) +{ QVector<QCustomTypeInfo> *ct = customTypes(); if (!ct) return; diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index c0dd288..c23caed 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -108,6 +108,8 @@ public: typedef void (*LoadOperator)(QDataStream &, void *); static void registerStreamOperators(const char *typeName, SaveOperator saveOp, LoadOperator loadOp); + static void registerStreamOperators(int type, SaveOperator saveOp, + LoadOperator loadOp); #endif static int registerType(const char *typeName, Destructor destructor, Constructor constructor); @@ -224,6 +226,24 @@ inline int qRegisterMetaType( #endif } +#ifndef QT_NO_DATASTREAM +template <typename T> +inline int qRegisterMetaTypeStreamOperators() +{ + typedef void(*SavePtr)(QDataStream &, const T *); + typedef void(*LoadPtr)(QDataStream &, T *); + SavePtr sptr = qMetaTypeSaveHelper<T>; + LoadPtr lptr = qMetaTypeLoadHelper<T>; + + register int id = qMetaTypeId<T>(); + QMetaType::registerStreamOperators(id, + reinterpret_cast<QMetaType::SaveOperator>(sptr), + reinterpret_cast<QMetaType::LoadOperator>(lptr)); + + return id; +} +#endif + #define Q_DECLARE_METATYPE(TYPE) \ QT_BEGIN_NAMESPACE \ template <> \ diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 5298fff..761b31f 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -871,7 +871,7 @@ QObject::~QObject() // all the signal/slots connections are still in place - if we don't // quit now, we will crash pretty soon. qWarning("Detected an unexpected exception in ~QObject while emitting destroyed()."); -#if defined(Q_AUTOTEST_EXPORT) && !defined(QT_NO_EXCEPTIONS) +#if defined(Q_BUILD_INTERNAL) && !defined(QT_NO_EXCEPTIONS) struct AutotestException : public std::exception { const char *what() const throw() { return "autotest swallow"; } @@ -903,7 +903,8 @@ QObject::~QObject() // disconnect all receivers if (d->connectionLists) { ++d->connectionLists->inUse; - for (int signal = -1; signal < d->connectionLists->count(); ++signal) { + int connectionListsCount = d->connectionLists->count(); + for (int signal = -1; signal < connectionListsCount; ++signal) { QObjectPrivate::ConnectionList &connectionList = (*d->connectionLists)[signal]; @@ -940,16 +941,17 @@ QObject::~QObject() // disconnect all senders QObjectPrivate::Connection *node = d->senders; while (node) { - QMutex *m = signalSlotLock(node->sender); + QObject *sender = node->sender; + QMutex *m = signalSlotLock(sender); node->prev = &node; bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); //the node has maybe been removed while the mutex was unlocked in relock? - if (!node || signalSlotLock(node->sender) != m) { + if (!node || node->sender != sender) { m->unlock(); continue; } node->receiver = 0; - QObjectConnectionListVector *senderLists = node->sender->d_func()->connectionLists; + QObjectConnectionListVector *senderLists = sender->d_func()->connectionLists; if (senderLists) senderLists->dirty = true; @@ -2510,20 +2512,25 @@ bool QObject::connect(const QObject *sender, const char *signal, const QMetaObject *smeta = sender->metaObject(); const char *signal_arg = signal; ++signal; //skip code - int signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); + int signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, false); if (signal_index < 0) { // check for normalized signatures tmp_signal_name = QMetaObject::normalizedSignature(signal - 1); signal = tmp_signal_name.constData() + 1; smeta = sender->metaObject(); - signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, false); + } + if (signal_index < 0) { + // re-use tmp_signal_name and signal from above - if (signal_index < 0) { - err_method_notfound(sender, signal_arg, "connect"); - err_info_about_objects("connect", sender, receiver); - return false; - } + smeta = sender->metaObject(); + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, true); + } + if (signal_index < 0) { + err_method_notfound(sender, signal_arg, "connect"); + err_info_about_objects("connect", sender, receiver); + return false; } signal_index = QMetaObjectPrivate::originalClone(smeta, signal_index); int signalOffset, methodOffset; @@ -2543,16 +2550,21 @@ bool QObject::connect(const QObject *sender, const char *signal, int method_index = -1; switch (membcode) { case QSLOT_CODE: - method_index = rmeta->indexOfSlot(method); + method_index = QMetaObjectPrivate::indexOfSlot(rmeta, method, false); break; case QSIGNAL_CODE: - method_index = rmeta->indexOfSignal(method); + method_index = QMetaObjectPrivate::indexOfSignalRelative(&rmeta, method, false); + if (method_index >= 0) + method_index += rmeta->methodOffset(); break; } if (method_index < 0) { // check for normalized methods tmp_method_name = QMetaObject::normalizedSignature(method); method = tmp_method_name.constData(); + + // rmeta may have been modified above + rmeta = receiver->metaObject(); switch (membcode) { case QSLOT_CODE: method_index = rmeta->indexOfSlot(method); @@ -2740,7 +2752,9 @@ bool QObject::disconnect(const QObject *sender, const char *signal, do { int signal_index = -1; if (signal) { - signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal); + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, false); + if (signal_index < 0) + signal_index = QMetaObjectPrivate::indexOfSignalRelative(&smeta, signal, true); if (signal_index < 0) break; signal_index = QMetaObjectPrivate::originalClone(smeta, signal_index); @@ -3360,7 +3374,9 @@ int QObjectPrivate::signalIndex(const char *signalName) const { Q_Q(const QObject); const QMetaObject *base = q->metaObject(); - int relative_index = QMetaObjectPrivate::indexOfSignalRelative(&base, signalName); + int relative_index = QMetaObjectPrivate::indexOfSignalRelative(&base, signalName, false); + if (relative_index < 0) + relative_index = QMetaObjectPrivate::indexOfSignalRelative(&base, signalName, true); if (relative_index < 0) return relative_index; relative_index = QMetaObjectPrivate::originalClone(base, relative_index); diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 27ab105..cc5bf97 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -189,8 +189,8 @@ public: QList<QObject *> pendingChildInsertedEvents; #else // preserve binary compatibility with code compiled without Qt 3 support - // ### why? - QList<QObject *> unused; + // keeping the binary layout stable helps the Qt Creator debugger + void *unused; #endif QList<QPointer<QObject> > eventFilters; diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index f2c2384..a2c575a 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -630,6 +630,22 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) .arg((QT_VERSION & 0xff00) >> 8) .arg(QLIBRARY_AS_DEBUG ? QLatin1String("debug") : QLatin1String("false")) .arg(fileName); +#ifdef Q_WS_MAC + // On Mac, add the application arch to the reg key in order to + // cache plugin information separately for each arch. This prevents + // Qt from wrongly caching plugin load failures when the archs + // don't match. +#if defined(__x86_64__) + regkey += QLatin1String("-x86_64"); +#elif defined(__i386__) + regkey += QLatin1String("-i386"); +#elif defined(__ppc64__) + regkey += QLatin1String("-ppc64"); +#elif defined(__ppc__) + regkey += QLatin1String("-ppc"); +#endif +#endif // Q_WS_MAC + QStringList reg; #ifndef QT_NO_SETTINGS if (!settings) { diff --git a/src/corelib/thread/qorderedmutexlocker_p.h b/src/corelib/thread/qorderedmutexlocker_p.h index 7d52a29..702125c 100644 --- a/src/corelib/thread/qorderedmutexlocker_p.h +++ b/src/corelib/thread/qorderedmutexlocker_p.h @@ -103,9 +103,11 @@ public: mtx2->lock(); return true; } - mtx1->unlock(); - mtx2->lock(); - mtx1->lock(); + if (!mtx2->tryLock()) { + mtx1->unlock(); + mtx2->lock(); + mtx1->lock(); + } return true; } diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 556093f..a27e488 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1061,6 +1061,11 @@ QByteArray &QByteArray::operator=(const char *str) \internal */ +/*! \fn bool QByteArray::isSharedWith(const QByteArray &other) const + + \internal +*/ + /*! \fn char QByteArray::at(int i) const Returns the character at index position \a i in the byte array. diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index ef97716..ec592f5f 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -164,6 +164,7 @@ public: inline const char *constData() const; inline void detach(); bool isDetached() const; + inline bool isSharedWith(const QByteArray &other) const { return d == other.d; } void clear(); #ifdef Q_COMPILER_MANGLES_RETURN_TYPE diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 6231471..285f4c9 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -847,6 +847,11 @@ void QHashData::checkSanity() \internal */ +/*! \fn bool QHash::isSharedWith(const QHash<Key, T> &other) const + + \internal +*/ + /*! \fn void QHash::clear() Removes all items from the hash. diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 5e93523..2832ca2 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -299,6 +299,7 @@ public: inline void detach() { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QHash<Key, T> &other) const { return d == other.d; } void clear(); diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp index 5a53c32..909d940 100644 --- a/src/corelib/tools/qlinkedlist.cpp +++ b/src/corelib/tools/qlinkedlist.cpp @@ -197,6 +197,11 @@ QLinkedListData QLinkedListData::shared_null = { \internal */ +/*! \fn bool QLinkedList::isSharedWith(const QLinkedList<T> &other) const + + \internal +*/ + /*! \fn bool QLinkedList::isEmpty() const Returns true if the list contains no items; otherwise returns diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index f6de966..fe586a4 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -93,6 +93,7 @@ public: { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QLinkedList<T> &other) const { return d == other.d; } inline bool isEmpty() const { return d->size == 0; } diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index c302857..ce62016 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -599,6 +599,11 @@ void **QListData::erase(void **xi) \internal */ +/*! \fn bool QList::isSharedWith(const QList<T> &other) const + + \internal +*/ + /*! \fn bool QList::isEmpty() const Returns true if the list contains no items; otherwise returns diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 120442d..1d08c41 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -130,6 +130,7 @@ public: inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QList<T> &other) const { return d == other.d; } inline bool isEmpty() const { return p.isEmpty(); } diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 8d79cb3..ff10fa1 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -4293,6 +4293,7 @@ bool QLocalePrivate::validateChars(const QString &str, NumberMode numMode, QByte const bool scientific = numMode == DoubleScientificMode; bool lastWasE = false; + bool lastWasDigit = false; int eCnt = 0; int decPointCnt = 0; bool dec = false; @@ -4307,6 +4308,7 @@ bool QLocalePrivate::validateChars(const QString &str, NumberMode numMode, QByte if (dec && decDigits != -1 && decDigits < ++decDigitCnt) return false; } + lastWasDigit = true; } else { switch (c) { case '.': @@ -4344,7 +4346,10 @@ bool QLocalePrivate::validateChars(const QString &str, NumberMode numMode, QByte break; case ',': - return false; + //it can only be placed after a digit which is before the decimal point + if (!lastWasDigit || decPointCnt > 0) + return false; + break; case 'e': if (scientific) { @@ -4362,10 +4367,12 @@ bool QLocalePrivate::validateChars(const QString &str, NumberMode numMode, QByte // If it's not a valid digit, it shall be Invalid. return false; } + lastWasDigit = false; } lastWasE = c == 'e'; - buff->append(c); + if (c != ',') + buff->append(c); } return true; diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 82cbe78..3143ee4 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -473,6 +473,11 @@ void QMapData::dump() \internal */ +/*! \fn bool QMap::isSharedWith(const QMap<Key, T> &other) const + + \internal +*/ + /*! \fn void QMap::setInsertInOrder(bool sharable) \internal diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index e71064c..9ba9ca5 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -182,6 +182,7 @@ public: inline void detach() { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QMap<Key, T> &other) const { return d == other.d; } inline void setInsertInOrder(bool ordered) { d->insertInOrder = ordered; } void clear(); diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3ef0e66..dec59b7 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -55,6 +55,7 @@ #include "qtools_p.h" #include "qhash.h" #include "qdebug.h" +#include "qendian.h" #ifdef Q_OS_MAC #include <private/qcore_mac_p.h> @@ -1091,7 +1092,12 @@ QString::QString(QChar ch) \internal */ -/*! \fn void QString::isDetached() const +/*! \fn bool QString::isDetached() const + + \internal +*/ + +/*! \fn bool QString::isSharedWith(const QString &other) const \internal */ @@ -7317,7 +7323,7 @@ QDataStream &operator>>(QDataStream &in, QString &str) != (QSysInfo::ByteOrder == QSysInfo::BigEndian)) { ushort *data = reinterpret_cast<ushort *>(str.data()); while (len--) { - *data = (*data >> 8) | (*data << 8); + *data = qbswap(*data); ++data; } } diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index c1def0f..5e3b0fd 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -122,6 +122,7 @@ public: inline void detach(); inline bool isDetached() const; + inline bool isSharedWith(const QString &other) const { return d == other.d; } void clear(); inline const QChar at(int i) const; diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index 4b0f488..e9bdf57 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -404,7 +404,17 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegExp &r */ QString QtPrivate::QStringList_join(const QStringList *that, const QString &sep) { + int totalLength = 0; + const int size = that->size(); + + for (int i = 0; i < size; ++i) + totalLength += that->at(i).size(); + + if(size > 0) + totalLength += sep.size() * (size - 1); + QString res; + res.reserve(totalLength); for (int i = 0; i < that->size(); ++i) { if (i) res += sep; diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 48b52d2..3a13540 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -392,6 +392,11 @@ int QVectorData::grow(int sizeofTypedData, int size, int sizeofT, bool excessive \internal */ +/*! \fn bool QVector::isSharedWith(const QVector<T> &other) const + + \internal +*/ + /*! \fn T *QVector::data() Returns a pointer to the data stored in the vector. The pointer diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 90b7442..61b22fd 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -134,6 +134,7 @@ public: inline void detach() { if (d->ref != 1) detach_helper(); } inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } + inline bool isSharedWith(const QVector<T> &other) const { return d == other.d; } inline T *data() { detach(); return p->array; } inline const T *data() const { return p->array; } diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 5717ca2..1bf00b8 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -3003,8 +3003,7 @@ QXmlStreamWriterPrivate::QXmlStreamWriterPrivate(QXmlStreamWriter *q) deleteDevice = false; #ifndef QT_NO_TEXTCODEC codec = QTextCodec::codecForMib(106); // utf8 - encoder = codec->makeEncoder(); - encoder->state.flags |= QTextCodec::IgnoreHeader; // no byte order mark for utf8 + encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); // no byte order mark for utf8 #endif inStartElement = inEmptyElement = false; wroteSomething = false; @@ -3278,9 +3277,7 @@ void QXmlStreamWriter::setCodec(QTextCodec *codec) if (codec) { d->codec = codec; delete d->encoder; - d->encoder = codec->makeEncoder(); - if (codec->mibEnum() == 106) - d->encoder->state.flags |= QTextCodec::IgnoreHeader; // no byte order mark for utf8 + d->encoder = codec->makeEncoder(QTextCodec::IgnoreHeader); // no byte order mark for utf8 } } diff --git a/src/gui/dialogs/dialogs.pri b/src/gui/dialogs/dialogs.pri index 63f64a2..4e1b9a7 100644 --- a/src/gui/dialogs/dialogs.pri +++ b/src/gui/dialogs/dialogs.pri @@ -50,7 +50,8 @@ HEADERS += \ } win32 { - HEADERS += dialogs/qwizard_win_p.h + HEADERS += dialogs/qwizard_win_p.h \ + dialogs/qfiledialog_win_p.h SOURCES += dialogs/qdialogsbinarycompat_win.cpp \ dialogs/qfiledialog_win.cpp \ dialogs/qpagesetupdialog_win.cpp \ diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp index 5a7ace9..3120938 100644 --- a/src/gui/dialogs/qfiledialog_win.cpp +++ b/src/gui/dialogs/qfiledialog_win.cpp @@ -53,53 +53,27 @@ #include <qdir.h> #include <qstringlist.h> #include <qlibrary.h> +#include "qfiledialog_win_p.h" #ifndef QT_NO_THREAD # include <private/qmutexpool_p.h> #endif -#include <shlobj.h> -//At some point we can hope that mingw will support that interface -#if !defined(Q_WS_WINCE) && !defined(Q_CC_MINGW) -#include <shobjidl.h> -#endif - -#include <objbase.h> - -#if defined(__IFileDialog_INTERFACE_DEFINED__) \ - && defined(__IFileOpenDialog_INTERFACE_DEFINED__) -#define USE_COMMON_ITEM_DIALOG -#endif - #ifdef Q_WS_WINCE +#include <shlobj.h> #include <commdlg.h> -# ifndef BFFM_SETSELECTION -# define BFFM_SETSELECTION (WM_USER + 102) -# endif -// Windows Mobile has a broken definition for BROWSEINFO -// Only compile fix -typedef struct qt_priv_browseinfo { - HWND hwndOwner; - LPCITEMIDLIST pidlRoot; - LPWSTR pszDisplayName; - LPCWSTR lpszTitle; - UINT ulFlags; - BFFCALLBACK lpfn; - LPARAM lParam; - int iImage; -} qt_BROWSEINFO; bool qt_priv_ptr_valid = false; +#else +//we have to declare them here because they're not present for all SDK/compilers +static const IID QT_IID_IFileOpenDialog = {0xd57c7288, 0xd4ad, 0x4768, {0xbe, 0x02, 0x9d, 0x96, 0x95, 0x32, 0xd9, 0x60} }; +static const IID QT_IID_IShellItem = {0x43826d1e, 0xe718, 0x42ee, {0xbc, 0x55, 0xa1, 0xe2, 0x61, 0xc3, 0x7b, 0xfe} }; +static const CLSID QT_CLSID_FileOpenDialog = {0xdc1c5a9c, 0xe88a, 0x4dde, {0xa5, 0xa1, 0x60, 0xf8, 0x2a, 0x20, 0xae, 0xf7} }; #endif -// Don't remove the lines below! -// -// resolving the W methods manually is needed, because Windows 95 doesn't include -// these methods in Shell32.lib (not even stubs!), so you'd get an unresolved symbol -// when Qt calls getExistingDirectory(), etc. -typedef LPITEMIDLIST (WINAPI *PtrSHBrowseForFolder)(BROWSEINFO*); +typedef qt_LPITEMIDLIST (WINAPI *PtrSHBrowseForFolder)(qt_BROWSEINFO*); static PtrSHBrowseForFolder ptrSHBrowseForFolder = 0; -typedef BOOL (WINAPI *PtrSHGetPathFromIDList)(LPITEMIDLIST,LPWSTR); +typedef BOOL (WINAPI *PtrSHGetPathFromIDList)(qt_LPITEMIDLIST, LPWSTR); static PtrSHGetPathFromIDList ptrSHGetPathFromIDList = 0; typedef HRESULT (WINAPI *PtrSHGetMalloc)(LPMALLOC *); static PtrSHGetMalloc ptrSHGetMalloc = 0; @@ -132,7 +106,7 @@ static void qt_win_resolve_libs() ptrSHGetMalloc = (PtrSHGetMalloc) lib.resolve("SHGetMalloc"); #else // CE stores them in a different lib and does not use unicode version - HINSTANCE handle = LoadLibraryW(L"Ceshell"); + HINSTANCE handle = LoadLibrary(L"Ceshell"); ptrSHBrowseForFolder = (PtrSHBrowseForFolder)GetProcAddress(handle, L"SHBrowseForFolder"); ptrSHGetPathFromIDList = (PtrSHGetPathFromIDList)GetProcAddress(handle, L"SHGetPathFromIDList"); ptrSHGetMalloc = (PtrSHGetMalloc)GetProcAddress(handle, L"SHGetMalloc"); @@ -421,7 +395,7 @@ QString qt_win_get_save_file_name(const QFileDialogArgs &args, } -#if defined(USE_COMMON_ITEM_DIALOG) +#ifndef Q_WS_WINCE typedef HRESULT (WINAPI *PtrSHCreateItemFromParsingName)(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv); static PtrSHCreateItemFromParsingName pSHCreateItemFromParsingName = 0; @@ -469,7 +443,7 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd, // Add the filters to the file dialog. if (numFilters) { wchar_t *szData = (wchar_t*)winfilters.utf16(); - COMDLG_FILTERSPEC *filterSpec = new COMDLG_FILTERSPEC[numFilters]; + qt_COMDLG_FILTERSPEC *filterSpec = new qt_COMDLG_FILTERSPEC[numFilters]; for(int i = 0; i<numFilters; i++) { filterSpec[i].pszName = szData+offsets[i*2]; filterSpec[i].pszSpec = szData+offsets[(i*2)+1]; @@ -481,9 +455,8 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd, tInitDir = QDir::toNativeSeparators(initialDirectory); if (!tInitDir.isEmpty()) { IShellItem *psiDefaultFolder; - hr = pSHCreateItemFromParsingName((wchar_t*)tInitDir.utf16(), - NULL, - IID_PPV_ARGS(&psiDefaultFolder)); + hr = pSHCreateItemFromParsingName((wchar_t*)tInitDir.utf16(), NULL, QT_IID_IShellItem, + reinterpret_cast<void**>(&psiDefaultFolder)); if (SUCCEEDED(hr)) { hr = pfd->SetFolder(psiDefaultFolder); @@ -522,7 +495,7 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd, return SUCCEEDED(hr); } -QStringList qt_win_CID_get_open_file_names(const QFileDialogArgs &args, +static QStringList qt_win_CID_get_open_file_names(const QFileDialogArgs &args, QString *initialDirectory, const QStringList &filterList, QString *selectedFilter, @@ -535,10 +508,8 @@ QStringList qt_win_CID_get_open_file_names(const QFileDialogArgs &args, QApplicationPrivate::enterModal(&modal_widget); // Multiple selection is allowed only in IFileOpenDialog. IFileOpenDialog *pfd = 0; - HRESULT hr = CoCreateInstance(CLSID_FileOpenDialog, - NULL, - CLSCTX_INPROC_SERVER, - IID_PPV_ARGS(&pfd)); + HRESULT hr = CoCreateInstance(QT_CLSID_FileOpenDialog, NULL, CLSCTX_INPROC_SERVER, QT_IID_IFileOpenDialog, + reinterpret_cast<void**>(&pfd)); if (SUCCEEDED(hr)) { qt_win_set_IFileDialogOptions(pfd, args.selection, @@ -643,7 +614,7 @@ QStringList qt_win_get_open_file_names(const QFileDialogArgs &args, // multiple files belonging to different folders from these search results, the // GetOpenFileName() will return only one folder name for all the files. To retrieve // the correct path for all selected files, we have to use Common Item Dialog interfaces. -#if defined(USE_COMMON_ITEM_DIALOG) +#ifndef Q_WS_WINCE if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) return qt_win_CID_get_open_file_names(args, initialDirectory, filterLst, selectedFilter, idx); #endif @@ -716,7 +687,7 @@ static int __stdcall winGetExistDirCallbackProc(HWND hwnd, qt_win_resolve_libs(); if (ptrSHGetPathFromIDList) { wchar_t path[MAX_PATH]; - ptrSHGetPathFromIDList(LPITEMIDLIST(lParam), path); + ptrSHGetPathFromIDList(qt_LPITEMIDLIST(lParam), path); QString tmpStr = QString::fromWCharArray(path); if (!tmpStr.isEmpty()) SendMessage(hwnd, BFFM_ENABLEOK, 1, 1); @@ -728,11 +699,6 @@ static int __stdcall winGetExistDirCallbackProc(HWND hwnd, return 0; } -#ifndef BIF_NEWDIALOGSTYLE -#define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize -#endif - - QString qt_win_get_existing_directory(const QFileDialogArgs &args) { QString currentDir = QDir::currentPath(); @@ -757,11 +723,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) path[0] = 0; tTitle = args.caption; -#if !defined(Q_WS_WINCE) - BROWSEINFO bi; -#else qt_BROWSEINFO bi; -#endif Q_ASSERT(!parent ||parent->testAttribute(Qt::WA_WState_Created)); bi.hwndOwner = (parent ? parent->winId() : 0); @@ -775,7 +737,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args) qt_win_resolve_libs(); if (ptrSHBrowseForFolder) { - LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder((BROWSEINFO*)&bi); + qt_LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi); if (pItemIDList) { ptrSHGetPathFromIDList(pItemIDList, path); IMalloc *pMalloc; diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h new file mode 100644 index 0000000..527ab3f --- /dev/null +++ b/src/gui/dialogs/qfiledialog_win_p.h @@ -0,0 +1,243 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <objbase.h> +#ifndef QFILEDIAG_WIN_P_H +#define QFILEDIAG_WIN_P_H + +//these are the interface declarations needed for the file dialog on Vista and up + +//At some point we can hope that all compilers/sdk will support that interface +//and we won't have to declare it ourselves + +//declarations +#define FOS_OVERWRITEPROMPT 0x2 +#define FOS_STRICTFILETYPES 0x4 +#define FOS_NOCHANGEDIR 0x8 +#define FOS_PICKFOLDERS 0x20 +#define FOS_FORCEFILESYSTEM 0x40 +#define FOS_ALLNONSTORAGEITEMS 0x80 +#define FOS_NOVALIDATE 0x100 +#define FOS_ALLOWMULTISELECT 0x200 +#define FOS_PATHMUSTEXIST 0x800 +#define FOS_FILEMUSTEXIST 0x1000 +#define FOS_CREATEPROMPT 0x2000 +#define FOS_SHAREAWARE 0x4000 +#define FOS_NOREADONLYRETURN 0x8000 +#define FOS_NOTESTFILECREATE 0x10000 +#define FOS_HIDEMRUPLACES 0x20000 +#define FOS_HIDEPINNEDPLACES 0x40000 +#define FOS_NODEREFERENCELINKS 0x100000 +#define FOS_DONTADDTORECENT 0x2000000 +#define FOS_FORCESHOWHIDDEN 0x10000000 +#define FOS_DEFAULTNOMINIMODE 0x20000000 +#define FOS_FORCEPREVIEWPANEON 0x40000000 + +typedef int GETPROPERTYSTOREFLAGS; +#define GPS_DEFAULT 0x00000000 +#define GPS_HANDLERPROPERTIESONLY 0x00000001 +#define GPS_READWRITE 0x00000002 +#define GPS_TEMPORARY 0x00000004 +#define GPS_FASTPROPERTIESONLY 0x00000008 +#define GPS_OPENSLOWITEM 0x00000010 +#define GPS_DELAYCREATION 0x00000020 +#define GPS_BESTEFFORT 0x00000040 +#define GPS_MASK_VALID 0x0000007F + +typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData); +// message from browser +#define BFFM_INITIALIZED 1 +#define BFFM_SELCHANGED 2 +#define BFFM_ENABLEOK (WM_USER + 101) +#define BFFM_SETSELECTION (WM_USER + 103) +#define BFFM_SETSTATUSTEXT (WM_USER + 104) + +// Browsing for directory. +#define BIF_RETURNONLYFSDIRS 0x0001 +#define BIF_DONTGOBELOWDOMAIN 0x0002 +#define BIF_STATUSTEXT 0x0004 +#define BIF_RETURNFSANCESTORS 0x0008 +#define BIF_EDITBOX 0x0010 +#define BIF_VALIDATE 0x0020 +#define BIF_NEWDIALOGSTYLE 0x0040 +#define BIF_BROWSEINCLUDEURLS 0x0080 +#define BIF_UAHINT 0x0100 +#define BIF_NONEWFOLDERBUTTON 0x0200 +#define BIF_NOTRANSLATETARGETS 0x0400 +#define BIF_BROWSEFORCOMPUTER 0x1000 +#define BIF_BROWSEFORPRINTER 0x2000 +#define BIF_BROWSEINCLUDEFILES 0x4000 +#define BIF_SHAREABLE 0x8000 + +//the enums +typedef enum { + SIATTRIBFLAGS_AND = 0x1, + SIATTRIBFLAGS_OR = 0x2, + SIATTRIBFLAGS_APPCOMPAT = 0x3, + SIATTRIBFLAGS_MASK = 0x3 +} SIATTRIBFLAGS; +typedef enum { + SIGDN_NORMALDISPLAY = 0x00000000, + SIGDN_PARENTRELATIVEPARSING = 0x80018001, + SIGDN_PARENTRELATIVEFORADDRESSBAR = 0x8001c001, + SIGDN_DESKTOPABSOLUTEPARSING = 0x80028000, + SIGDN_PARENTRELATIVEEDITING = 0x80031001, + SIGDN_DESKTOPABSOLUTEEDITING = 0x8004c000, + SIGDN_FILESYSPATH = 0x80058000, + SIGDN_URL = 0x80068000 +} SIGDN; +typedef enum { + FDAP_BOTTOM = 0x00000000, + FDAP_TOP = 0x00000001 +} FDAP; +typedef enum { + FDESVR_DEFAULT = 0x00000000, + FDESVR_ACCEPT = 0x00000001, + FDESVR_REFUSE = 0x00000002 +} FDE_SHAREVIOLATION_RESPONSE; +typedef FDE_SHAREVIOLATION_RESPONSE FDE_OVERWRITE_RESPONSE; + +//the structs +typedef struct { + LPCWSTR pszName; + LPCWSTR pszSpec; +} qt_COMDLG_FILTERSPEC; +typedef struct { + GUID fmtid; + DWORD pid; +} qt_PROPERTYKEY; + +typedef struct { + USHORT cb; + BYTE abID[1]; +} qt_SHITEMID, *qt_LPSHITEMID; +typedef struct { + qt_SHITEMID mkid; +} qt_ITEMIDLIST, *qt_LPITEMIDLIST; +typedef const qt_ITEMIDLIST *qt_LPCITEMIDLIST; +typedef struct { + HWND hwndOwner; + qt_LPCITEMIDLIST pidlRoot; + LPWSTR pszDisplayName; + LPCWSTR lpszTitle; + UINT ulFlags; + BFFCALLBACK lpfn; + LPARAM lParam; + int iImage; +} qt_BROWSEINFO; + +DECLARE_INTERFACE(IFileDialogEvents); +DECLARE_INTERFACE_(IShellItem, IUnknown) +{ + STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID bhid, REFIID riid, void **ppv) PURE; + STDMETHOD(GetParent)(THIS_ IShellItem **ppsi) PURE; + STDMETHOD(GetDisplayName)(THIS_ SIGDN sigdnName, LPWSTR *ppszName) PURE; + STDMETHOD(GetAttributes)(THIS_ ULONG sfgaoMask, ULONG *psfgaoAttribs) PURE; + STDMETHOD(Compare)(THIS_ IShellItem *psi, DWORD hint, int *piOrder) PURE; +}; +DECLARE_INTERFACE_(IShellItemFilter, IUnknown) +{ + STDMETHOD(IncludeItem)(THIS_ IShellItem *psi) PURE; + STDMETHOD(GetEnumFlagsForItem)(THIS_ IShellItem *psi, DWORD *pgrfFlags) PURE; +}; +DECLARE_INTERFACE_(IEnumShellItems, IUnknown) +{ + STDMETHOD(Next)(THIS_ ULONG celt, IShellItem **rgelt, ULONG *pceltFetched) PURE; + STDMETHOD(Skip)(THIS_ ULONG celt) PURE; + STDMETHOD(Reset)(THIS_) PURE; + STDMETHOD(Clone)(THIS_ IEnumShellItems **ppenum) PURE; +}; +DECLARE_INTERFACE_(IShellItemArray, IUnknown) +{ + STDMETHOD(BindToHandler)(THIS_ IBindCtx *pbc, REFGUID rbhid, REFIID riid, void **ppvOut) PURE; + STDMETHOD(GetPropertyStore)(THIS_ GETPROPERTYSTOREFLAGS flags, REFIID riid, void **ppv) PURE; + STDMETHOD(GetPropertyDescriptionList)(THIS_ const qt_PROPERTYKEY *keyType, REFIID riid, void **ppv) PURE; + STDMETHOD(GetAttributes)(THIS_ SIATTRIBFLAGS dwAttribFlags, ULONG sfgaoMask, ULONG *psfgaoAttribs) PURE; + STDMETHOD(GetCount)(THIS_ DWORD *pdwNumItems) PURE; + STDMETHOD(GetItemAt)(THIS_ DWORD dwIndex, IShellItem **ppsi) PURE; + STDMETHOD(EnumItems)(THIS_ IEnumShellItems **ppenumShellItems) PURE; +}; +DECLARE_INTERFACE_(IModalWindow, IUnknown) +{ + STDMETHOD(Show)(THIS_ HWND hwndParent) PURE; +}; +DECLARE_INTERFACE_(IFileDialog, IModalWindow) +{ + STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const qt_COMDLG_FILTERSPEC *rgFilterSpec) PURE; + STDMETHOD(SetFileTypeIndex)(THIS_ UINT iFileType) PURE; + STDMETHOD(GetFileTypeIndex)(THIS_ UINT *piFileType) PURE; + STDMETHOD(Advise)(THIS_ IFileDialogEvents *pfde, DWORD *pdwCookie) PURE; + STDMETHOD(Unadvise)(THIS_ DWORD dwCookie) PURE; + STDMETHOD(SetOptions)(THIS_ DWORD fos) PURE; + STDMETHOD(GetOptions)(THIS_ DWORD *pfos) PURE; + STDMETHOD(SetDefaultFolder)(THIS_ IShellItem *psi) PURE; + STDMETHOD(SetFolder)(THIS_ IShellItem *psi) PURE; + STDMETHOD(GetFolder)(THIS_ IShellItem **ppsi) PURE; + STDMETHOD(GetCurrentSelection)(THIS_ IShellItem **ppsi) PURE; + STDMETHOD(SetFileName)(THIS_ LPCWSTR pszName) PURE; + STDMETHOD(GetFileName)(THIS_ LPWSTR *pszName) PURE; + STDMETHOD(SetTitle)(THIS_ LPCWSTR pszTitle) PURE; + STDMETHOD(SetOkButtonLabel)(THIS_ LPCWSTR pszText) PURE; + STDMETHOD(SetFileNameLabel)(THIS_ LPCWSTR pszLabel) PURE; + STDMETHOD(GetResult)(THIS_ IShellItem **ppsi) PURE; + STDMETHOD(AddPlace)(THIS_ IShellItem *psi, FDAP fdap) PURE; + STDMETHOD(SetDefaultExtension)(THIS_ LPCWSTR pszDefaultExtension) PURE; + STDMETHOD(Close)(THIS_ HRESULT hr) PURE; + STDMETHOD(SetClientGuid)(THIS_ REFGUID guid) PURE; + STDMETHOD(ClearClientData)(THIS_) PURE; + STDMETHOD(SetFilter)(THIS_ IShellItemFilter *pFilter) PURE; +}; +DECLARE_INTERFACE_(IFileDialogEvents, IUnknown) +{ + STDMETHOD(OnFileOk)(THIS_ IFileDialog *pfd) PURE; + STDMETHOD(OnFolderChanging)(THIS_ IFileDialog *pfd, IShellItem *psiFolder) PURE; + STDMETHOD(OnFolderChange)(THIS_ IFileDialog *pfd) PURE; + STDMETHOD(OnSelectionChange)(THIS_ IFileDialog *pfd) PURE; + STDMETHOD(OnShareViolation)(THIS_ IFileDialog *pfd, IShellItem *psi, FDE_SHAREVIOLATION_RESPONSE *pResponse) PURE; + STDMETHOD(OnTypeChange)(THIS_ IFileDialog *pfd) PURE; + STDMETHOD(OnOverwrite)(THIS_ IFileDialog *pfd, IShellItem *psi, FDE_OVERWRITE_RESPONSE *pResponse) PURE; +}; +DECLARE_INTERFACE_(IFileOpenDialog, IFileDialog) +{ + STDMETHOD(GetResults)(THIS_ IShellItemArray **ppenum) PURE; + STDMETHOD(GetSelectedItems)(THIS_ IShellItemArray **ppsai) PURE; +}; +#endif
\ No newline at end of file diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp index 1f61957..c75cdfd 100644 --- a/src/gui/dialogs/qfileinfogatherer.cpp +++ b/src/gui/dialogs/qfileinfogatherer.cpp @@ -354,6 +354,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil } if (!updatedFiles.isEmpty()) emit updates(path, updatedFiles); + emit directoryLoaded(path); } void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QTime &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) { diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h index 0242178..b8b58a2 100644 --- a/src/gui/dialogs/qfileinfogatherer_p.h +++ b/src/gui/dialogs/qfileinfogatherer_p.h @@ -155,6 +155,7 @@ Q_SIGNALS: void updates(const QString &directory, const QList<QPair<QString, QFileInfo> > &updates); void newListOfFiles(const QString &directory, const QStringList &listOfFiles) const; void nameResolved(const QString &fileName, const QString &resolvedName) const; + void directoryLoaded(const QString &path); public: QFileInfoGatherer(QObject *parent = 0); diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 6fd947c..ba0a560 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -51,6 +51,9 @@ #ifdef Q_OS_WIN #include <qt_windows.h> #endif +#ifdef Q_OS_WIN32 +#include <QtCore/QVarLengthArray> +#endif QT_BEGIN_NAMESPACE @@ -150,6 +153,14 @@ QT_BEGIN_NAMESPACE */ /*! + \since 4.7 + \fn void QFileSystemModel::directoryLoaded(const QString &path) + + This signal is emitted when the gatherer thread has finished to load the \a path. + +*/ + +/*! \fn bool QFileSystemModel::remove(const QModelIndex &index) const Removes the model item \a index from the file system model and \bold{deletes the @@ -270,53 +281,38 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QM return indexNode; } -#ifdef Q_OS_WIN +#ifdef Q_OS_WIN32 static QString qt_GetLongPathName(const QString &strShortPath) { - QString longPath; - int i = 0; - if (strShortPath == QLatin1String(".") - || (strShortPath.startsWith(QLatin1String("//"))) - || (strShortPath.startsWith(QLatin1String("\\\\")))) // unc + if (strShortPath.isEmpty() + || strShortPath == QLatin1String(".") || strShortPath == QLatin1String("..")) return strShortPath; - QString::const_iterator it = strShortPath.constBegin(); - QString::const_iterator constEnd = strShortPath.constEnd(); - do { - bool isSep = (*it == QLatin1Char('\\') || *it == QLatin1Char('/')); - if (isSep || it == constEnd) { - QString section = (it == constEnd ? strShortPath : strShortPath.left(i)); - // FindFirstFile does not handle volumes ("C:"), so we have to catch that ourselves. - if (section.endsWith(QLatin1Char(':'))) { - longPath.append(section.toUpper()); - } else { - HANDLE h; -#ifndef Q_OS_WINCE - //We add the extend length prefix to handle long path - QString longSection = QLatin1String("\\\\?\\")+QDir::toNativeSeparators(section); -#else - QString longSection = QDir::toNativeSeparators(section); -#endif - WIN32_FIND_DATA findData; - h = ::FindFirstFile((wchar_t*)longSection.utf16(), &findData); - if (h != INVALID_HANDLE_VALUE) { - longPath.append(QString::fromWCharArray(findData.cFileName)); - ::FindClose(h); - } else { - longPath.append(section); - break; - } - } - if (it != constEnd) - longPath.append(*it); - else - break; - } - ++it; - if (isSep && it == constEnd) // break out if the last character is a separator - break; - ++i; - } while (true); - return longPath; + if (strShortPath.length() == 2 && strShortPath.endsWith(QLatin1Char(':'))) + return strShortPath.toUpper(); + const QString absPath = QDir(strShortPath).absolutePath(); + if (absPath.startsWith(QLatin1String("//")) + || absPath.startsWith(QLatin1String("\\\\"))) // unc + return QDir::fromNativeSeparators(absPath); + if (absPath.startsWith(QLatin1Char('/'))) + return QString(); + const QString inputString = QLatin1String("\\\\?\\") + QDir::toNativeSeparators(absPath); + QVarLengthArray<TCHAR, MAX_PATH> buffer(MAX_PATH); + DWORD result = ::GetLongPathName((wchar_t*)inputString.utf16(), + buffer.data(), + buffer.size()); + if (result > DWORD(buffer.size())) { + buffer.resize(result); + result = ::GetLongPathName((wchar_t*)inputString.utf16(), + buffer.data(), + buffer.size()); + } + if (result > 4) { + QString longPath = QString::fromWCharArray(buffer.data() + 4); // ignoring prefix + longPath[0] = longPath.at(0).toUpper(); // capital drive letters + return QDir::fromNativeSeparators(longPath); + } else { + return QDir::fromNativeSeparators(strShortPath); + } } #endif @@ -334,7 +330,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS // Construct the nodes up to the new root path if they need to be built QString absolutePath; -#ifdef Q_OS_WIN +#ifdef Q_OS_WIN32 QString longPath = qt_GetLongPathName(path); #else QString longPath = path; @@ -673,7 +669,7 @@ QVariant QFileSystemModel::data(const QModelIndex &index, int role) const case Qt::EditRole: case Qt::DisplayRole: switch (index.column()) { - case 0: return d->name(index); + case 0: return d->displayName(index); case 1: return d->size(index); case 2: return d->type(index); case 3: return d->time(index); @@ -789,13 +785,25 @@ QString QFileSystemModelPrivate::name(const QModelIndex &index) const if (resolvedSymLinks.contains(fullPath)) return resolvedSymLinks[fullPath]; } - // ### TODO it would be nice to grab the volume name if dirNode->parent == root return dirNode->fileName; } /*! \internal */ +QString QFileSystemModelPrivate::displayName(const QModelIndex &index) const +{ +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + QFileSystemNode *dirNode = node(index); + if (!dirNode->volumeName.isNull()) + return dirNode->volumeName + QLatin1String(" (") + name(index) + QLatin1Char(')'); +#endif + return name(index); +} + +/*! + \internal +*/ QIcon QFileSystemModelPrivate::icon(const QModelIndex &index) const { if (!index.isValid()) @@ -1337,7 +1345,11 @@ QModelIndex QFileSystemModel::setRootPath(const QString &newPath) { Q_D(QFileSystemModel); #ifdef Q_OS_WIN - QString longNewPath = QDir::fromNativeSeparators(qt_GetLongPathName(newPath)); +#ifdef Q_OS_WIN32 + QString longNewPath = qt_GetLongPathName(newPath); +#else + QString longNewPath = QDir::fromNativeSeparators(newPath); +#endif #else QString longNewPath = newPath; #endif @@ -1640,6 +1652,18 @@ QFileSystemModelPrivate::QFileSystemNode* QFileSystemModelPrivate::addNode(QFile #ifndef QT_NO_FILESYSTEMWATCHER node->populate(info); #endif +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + //The parentNode is "" so we are listing the drives + if (parentNode->fileName.isEmpty()) { + wchar_t name[MAX_PATH + 1]; + //GetVolumeInformation requires to add trailing backslash + const QString nodeName = fileName + QLatin1String("\\"); + BOOL success = ::GetVolumeInformation((wchar_t *)(nodeName.utf16()), + name, MAX_PATH + 1, NULL, 0, NULL, NULL, 0); + if (success && name[0]) + node->volumeName = QString::fromWCharArray(name); + } +#endif parentNode->children.insert(fileName, node); return node; } @@ -1869,6 +1893,8 @@ void QFileSystemModelPrivate::init() q, SLOT(_q_fileSystemChanged(QString,QList<QPair<QString,QFileInfo> >))); q->connect(&fileInfoGatherer, SIGNAL(nameResolved(QString,QString)), q, SLOT(_q_resolvedName(QString,QString))); + q->connect(&fileInfoGatherer, SIGNAL(directoryLoaded(QString)), + q, SIGNAL(directoryLoaded(QString))); q->connect(&delayedSortTimer, SIGNAL(timeout()), q, SLOT(_q_performDelayedSort()), Qt::QueuedConnection); } diff --git a/src/gui/dialogs/qfilesystemmodel.h b/src/gui/dialogs/qfilesystemmodel.h index 4dcfe26..d8178c7 100644 --- a/src/gui/dialogs/qfilesystemmodel.h +++ b/src/gui/dialogs/qfilesystemmodel.h @@ -70,6 +70,7 @@ class Q_GUI_EXPORT QFileSystemModel : public QAbstractItemModel Q_SIGNALS: void rootPathChanged(const QString &newPath); void fileRenamed(const QString &path, const QString &oldName, const QString &newName); + void directoryLoaded(const QString &path); public: enum Roles { diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h index 6c85a7c..03e0bfb 100644 --- a/src/gui/dialogs/qfilesystemmodel_p.h +++ b/src/gui/dialogs/qfilesystemmodel_p.h @@ -97,6 +97,9 @@ public: } QString fileName; +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + QString volumeName; +#endif inline qint64 size() const { if (info && !info->isDir()) return info->size(); return 0; } inline QString type() const { if (info) return info->displayType; return QLatin1String(""); } @@ -278,6 +281,7 @@ public: QIcon icon(const QModelIndex &index) const; QString name(const QModelIndex &index) const; + QString displayName(const QModelIndex &index) const; QString filePath(const QModelIndex &index) const; QString size(const QModelIndex &index) const; static QString size(qint64 bytes); diff --git a/src/gui/dialogs/qprintdialog_win.cpp b/src/gui/dialogs/qprintdialog_win.cpp index 5ccd33d..fa0c99f 100644 --- a/src/gui/dialogs/qprintdialog_win.cpp +++ b/src/gui/dialogs/qprintdialog_win.cpp @@ -52,7 +52,7 @@ #include <private/qprintengine_win_p.h> #include <private/qprinter_p.h> -#if defined(Q_CC_MINGW) && !defined(PD_NOCURRENTPAGE) +#if !defined(PD_NOCURRENTPAGE) #define PD_NOCURRENTPAGE 0x00800000 #define PD_RESULT_PRINT 1 #define PD_RESULT_APPLY 2 diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp index 8eb8123..65a3fb5 100644 --- a/src/gui/embedded/qscreen_qws.cpp +++ b/src/gui/embedded/qscreen_qws.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "qplatformdefs.h" #include "qscreen_qws.h" #include "qcolormap.h" @@ -3223,13 +3224,13 @@ QScreen * qt_probe_bus() return qt_dodriver("unaccel.so",0,0); } - DIR * dirptr=opendir("/proc/bus/pci"); + QT_DIR *dirptr = QT_OPENDIR("/proc/bus/pci"); if(!dirptr) return qt_dodriver("unaccel.so",0,0); - DIR * dirptr2; - dirent * cards; + QT_DIR * dirptr2; + QT_DIRENT *cards; - dirent * busses=readdir(dirptr); + QT_DIRENT *busses = QT_READDIR(dirptr); while(busses) { if(busses->d_name[0]!='.') { @@ -3237,9 +3238,9 @@ QScreen * qt_probe_bus() strcpy(buf,"/proc/bus/pci/"); qstrcpy(buf+14,busses->d_name); int p=strlen(buf); - dirptr2=opendir(buf); + dirptr2 = QT_OPENDIR(buf); if(dirptr2) { - cards=readdir(dirptr2); + cards = QT_READDIR(dirptr2); while(cards) { if(cards->d_name[0]!='.') { buf[p]='/'; @@ -3248,14 +3249,14 @@ QScreen * qt_probe_bus() if(ret) return ret; } - cards=readdir(dirptr2); + cards = QT_READDIR(dirptr2); } - closedir(dirptr2); + QT_CLOSEDIR(dirptr2); } } - busses=readdir(dirptr); + busses = QT_READDIR(dirptr); } - closedir(dirptr); + QT_CLOSEDIR(dirptr); return qt_dodriver("unaccel.so",0,0); } diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 66707fc..9a36d46 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4238,6 +4238,8 @@ static void _q_paintItem(QGraphicsItem *item, QPainter *painter, widgetItem->paintWindowFrame(painter, option, widget); if (painterStateProtection) painter->restore(); + } else if (widgetItem->autoFillBackground()) { + painter->fillRect(option->exposedRect, widgetItem->palette().window()); } widgetItem->paint(painter, option, widget); diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 5e01785..87416b4 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -967,6 +967,36 @@ void QGraphicsWidget::setPalette(const QPalette &palette) } /*! + \property QGraphicsWidget::autoFillBackground + \brief whether the widget background is filled automatically + \since 4.7 + + If enabled, this property will cause Qt to fill the background of the + widget before invoking the paint() method. The color used is defined by the + QPalette::Window color role from the widget's \l{QPalette}{palette}. + + In addition, Windows are always filled with QPalette::Window, unless the + WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set. + + By default, this property is false. + + \sa Qt::WA_OpaquePaintEvent, Qt::WA_NoSystemBackground, +*/ +bool QGraphicsWidget::autoFillBackground() const +{ + Q_D(const QGraphicsWidget); + return d->autoFillBackground; +} +void QGraphicsWidget::setAutoFillBackground(bool enabled) +{ + Q_D(QGraphicsWidget); + if (d->autoFillBackground != enabled) { + d->autoFillBackground = enabled; + update(); + } +} + +/*! If this widget is currently managed by a layout, this function notifies the layout that the widget's size hints have changed and the layout may need to resize and reposition the widget accordingly. diff --git a/src/gui/graphicsview/qgraphicswidget.h b/src/gui/graphicsview/qgraphicswidget.h index f1d382b..4bea5be 100644 --- a/src/gui/graphicsview/qgraphicswidget.h +++ b/src/gui/graphicsview/qgraphicswidget.h @@ -82,6 +82,7 @@ class Q_GUI_EXPORT QGraphicsWidget : public QGraphicsObject, public QGraphicsLay Q_PROPERTY(Qt::WindowFlags windowFlags READ windowFlags WRITE setWindowFlags) Q_PROPERTY(QString windowTitle READ windowTitle WRITE setWindowTitle) Q_PROPERTY(QRectF geometry READ geometry WRITE setGeometry) + Q_PROPERTY(bool autoFillBackground READ autoFillBackground WRITE setAutoFillBackground) public: QGraphicsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0); ~QGraphicsWidget(); @@ -103,6 +104,9 @@ public: QPalette palette() const; void setPalette(const QPalette &palette); + bool autoFillBackground() const; + void setAutoFillBackground(bool enabled); + void resize(const QSizeF &size); inline void resize(qreal w, qreal h) { resize(QSizeF(w, h)); } QSizeF size() const; diff --git a/src/gui/graphicsview/qgraphicswidget_p.h b/src/gui/graphicsview/qgraphicswidget_p.h index 2c5b3bf..3ab8737 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.h +++ b/src/gui/graphicsview/qgraphicswidget_p.h @@ -80,6 +80,7 @@ public: inSetGeometry(0), polished(0), inSetPos(0), + autoFillBackground(0), focusPolicy(Qt::NoFocus), focusNext(0), focusPrev(0), @@ -172,6 +173,7 @@ public: quint32 inSetGeometry : 1; quint32 polished: 1; quint32 inSetPos : 1; + quint32 autoFillBackground : 1; // Focus Qt::FocusPolicy focusPolicy; diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 4f5efa1..6bcf72b 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1835,7 +1835,7 @@ void QImage::setColor(int i, QRgb c) qAlpha() to access the pixels. \sa bytesPerLine(), bits(), {QImage#Pixel Manipulation}{Pixel - Manipulation} + Manipulation}, constScanLine() */ uchar *QImage::scanLine(int i) { @@ -1865,6 +1865,28 @@ const uchar *QImage::scanLine(int i) const /*! + Returns a pointer to the pixel data at the scanline with index \a + i. The first scanline is at index 0. + + The scanline data is aligned on a 32-bit boundary. + + Note that QImage uses \l{Implicit Data Sharing} {implicit data + sharing}, but this function does \e not perform a deep copy of the + shared pixel data, because the returned data is const. + + \sa scanLine(), constBits() + \since 4.7 +*/ +const uchar *QImage::constScanLine(int i) const +{ + if (!d) + return 0; + + Q_ASSERT(i >= 0 && i < height()); + return d->data + i * d->bytes_per_line; +} + +/*! Returns a pointer to the first pixel data. This is equivalent to scanLine(0). @@ -1873,7 +1895,7 @@ const uchar *QImage::scanLine(int i) const data, thus ensuring that this QImage is the only one using the current return value. - \sa scanLine(), byteCount() + \sa scanLine(), byteCount(), constBits() */ uchar *QImage::bits() { @@ -1901,6 +1923,20 @@ const uchar *QImage::bits() const } +/*! + Returns a pointer to the first pixel data. + + Note that QImage uses \l{Implicit Data Sharing} {implicit data + sharing}, but this function does \e not perform a deep copy of the + shared pixel data, because the returned data is const. + + \sa bits(), constScanLine() + \since 4.7 +*/ +const uchar *QImage::constBits() const +{ + return d ? d->data : 0; +} /*! \fn void QImage::reset() diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index ac973a1..dd13782 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -182,6 +182,7 @@ public: uchar *bits(); const uchar *bits() const; + const uchar *constBits() const; #ifdef QT_DEPRECATED QT_DEPRECATED int numBytes() const; #endif @@ -189,6 +190,7 @@ public: uchar *scanLine(int); const uchar *scanLine(int) const; + const uchar *constScanLine(int) const; int bytesPerLine() const; bool valid(int x, int y) const; diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index fb70e36..3220a67 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -440,36 +440,6 @@ bool QPicture::play(QPainter *painter) return true; // no end-command } - -// -// QFakeDevice is used to create fonts with a custom DPI -// -class QFakeDevice : public QPaintDevice -{ -public: - QFakeDevice() { dpi_x = qt_defaultDpiX(); dpi_y = qt_defaultDpiY(); } - void setDpiX(int dpi) { dpi_x = dpi; } - void setDpiY(int dpi) { dpi_y = dpi; } - QPaintEngine *paintEngine() const { return 0; } - int metric(PaintDeviceMetric m) const - { - switch(m) { - case PdmPhysicalDpiX: - case PdmDpiX: - return dpi_x; - case PdmPhysicalDpiY: - case PdmDpiY: - return dpi_y; - default: - return QPaintDevice::metric(m); - } - } - -private: - int dpi_x; - int dpi_y; -}; - /*! \internal Iterates over the internal picture data and draws the picture using @@ -679,30 +649,29 @@ bool QPicture::exec(QPainter *painter, QDataStream &s, int nrecords) if (d->formatMajor >= 9) { s >> dbl; - QFont fnt(font); - if (dbl != 1.0) { - QFakeDevice fake; - fake.setDpiX(qRound(dbl*qt_defaultDpiX())); - fake.setDpiY(qRound(dbl*qt_defaultDpiY())); - fnt = QFont(font, &fake); - } + QFont fnt(font, painter->device()); + + qreal scale = painter->device()->logicalDpiY() / (dbl*qt_defaultDpiY()); + painter->save(); + painter->scale(1/scale, 1/scale); qreal justificationWidth; s >> justificationWidth; int flags = Qt::TextSingleLine | Qt::TextDontClip | Qt::TextForceLeftToRight; - QSizeF size(1, 1); + QSizeF size(scale, scale); if (justificationWidth > 0) { - size.setWidth(justificationWidth); + size.setWidth(justificationWidth*scale); flags |= Qt::TextJustificationForced; flags |= Qt::AlignJustify; } QFontMetrics fm(fnt); - QPointF pt(p.x(), p.y() - fm.ascent()); + QPointF pt(p.x()*scale, p.y()*scale - fm.ascent()); qt_format_text(fnt, QRectF(pt, size), flags, /*opt*/0, str, /*brect=*/0, /*tabstops=*/0, /*...*/0, /*tabarraylen=*/0, painter); + painter->restore(); } else { qt_format_text(font, QRectF(p, QSizeF(1, 1)), Qt::TextSingleLine | Qt::TextDontClip, /*opt*/0, str, /*brect=*/0, /*tabstops=*/0, /*...*/0, /*tabarraylen=*/0, painter); diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index d1e5c40..7cafbd0 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1078,6 +1078,9 @@ QPixmap QPixmap::grabWidget(QWidget * widget, const QRect &rect) if (widget->testAttribute(Qt::WA_PendingResizeEvent) || !widget->testAttribute(Qt::WA_WState_Created)) sendResizeEvents(widget); + widget->d_func()->prepareToRender(QRegion(), + QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask); + QRect r(rect); if (r.width() < 0) r.setWidth(widget->width() - rect.x()); @@ -1088,8 +1091,8 @@ QPixmap QPixmap::grabWidget(QWidget * widget, const QRect &rect) return QPixmap(); QPixmap res(r.size()); - widget->render(&res, QPoint(), r, - QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask); + widget->d_func()->render(&res, QPoint(), r, QWidget::DrawWindowBackground + | QWidget::DrawChildren | QWidget::IgnoreMask, true); return res; } @@ -1370,10 +1373,27 @@ void QPixmap::deref() */ /*! - \fn bool QPixmap::convertFromImage(const QImage &image, Qt::ImageConversionFlags flags) + Replaces this pixmap's data with the given \a image using the + specified \a flags to control the conversion. The \a flags + argument is a bitwise-OR of the \l{Qt::ImageConversionFlags}. + Passing 0 for \a flags sets all the default options. Returns true + if the result is that this pixmap is not null. - Use the static fromImage() function instead. + Note: this function was part of Qt 3 support in Qt 4.6 and earlier. + It has been promoted to official API status in 4.7 to support updating + the pixmap's image without creating a new QPixmap as fromImage() would. + + \sa fromImage() + \since 4.7 */ +bool QPixmap::convertFromImage(const QImage &image, Qt::ImageConversionFlags flags) +{ + if (image.isNull() || !data) + *this = QPixmap::fromImage(image, flags); + else + data->fromImage(image, flags); + return !isNull(); +} /*! \fn QPixmap QPixmap::xForm(const QMatrix &matrix) const diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index 46363f0..180af3b 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -141,6 +141,8 @@ public: bool save(const QString& fileName, const char* format = 0, int quality = -1) const; bool save(QIODevice* device, const char* format = 0, int quality = -1) const; + bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor); + #if defined(Q_WS_WIN) enum HBitmapFormat { NoAlpha, @@ -224,8 +226,6 @@ public: QT3_SUPPORT QPixmap &operator=(const QImage &); inline QT3_SUPPORT QImage convertToImage() const { return toImage(); } QT3_SUPPORT bool convertFromImage(const QImage &, ColorMode mode); - QT3_SUPPORT bool convertFromImage(const QImage &img, Qt::ImageConversionFlags flags = Qt::AutoColor) - { (*this) = fromImage(img, flags); return !isNull(); } inline QT3_SUPPORT operator QImage() const { return toImage(); } inline QT3_SUPPORT QPixmap xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); } inline QT3_SUPPORT bool selfMask() const { return false; } diff --git a/src/gui/inputmethod/qwininputcontext_p.h b/src/gui/inputmethod/qwininputcontext_p.h index 08cc3d2..d5bedf4 100644 --- a/src/gui/inputmethod/qwininputcontext_p.h +++ b/src/gui/inputmethod/qwininputcontext_p.h @@ -56,7 +56,7 @@ #include "QtGui/qinputcontext.h" #include "QtCore/qt_windows.h" -#if defined(Q_CC_MINGW) && !defined(IMR_RECONVERTSTRING) +#if !defined(IMR_RECONVERTSTRING) typedef struct tagRECONVERTSTRING { DWORD dwSize; DWORD dwVersion; diff --git a/src/gui/itemviews/qdirmodel.cpp b/src/gui/itemviews/qdirmodel.cpp index ea608c1..378a238 100644 --- a/src/gui/itemviews/qdirmodel.cpp +++ b/src/gui/itemviews/qdirmodel.cpp @@ -185,12 +185,12 @@ void QDirModelPrivate::invalidate() /*! \class QDirModel - + \obsolete \brief The QDirModel class provides a data model for the local filesystem. \ingroup model-view - \note The usage of QDirModel is not recommended anymore. The + The usage of QDirModel is not recommended anymore. The QFileSystemModel class is a more performant alternative. This class provides access to the local filesystem, providing functions diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index fcc61e5..f321ab3 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE /*! \class QFileIconProvider - \brief The QFileIconProvider class provides file icons for the QDirModel class. + \brief The QFileIconProvider class provides file icons for the QDirModel and the QFileSystemModel classes. */ /*! diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 8a456e6..1c26e51 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -1853,11 +1853,9 @@ void QHeaderViewPrivate::_q_layoutChanged() persistentHiddenSections.clear(); return; } + + QBitArray oldSectionHidden = sectionHidden; bool sectionCountChanged = false; - for (int i = 0; i < sectionHidden.count(); ++i) { - if (sectionHidden.testBit(i)) - q->setSectionHidden(logicalIndex(i), false); - } for (int i = 0; i < persistentHiddenSections.count(); ++i) { QModelIndex index = persistentHiddenSections.at(i); @@ -1866,6 +1864,7 @@ void QHeaderViewPrivate::_q_layoutChanged() ? index.column() : index.row()); q->setSectionHidden(logical, true); + oldSectionHidden.setBit(logical, false); } else if (!sectionCountChanged && (modelSectionCount() != sectionCount)) { sectionCountChanged = true; break; @@ -1873,6 +1872,11 @@ void QHeaderViewPrivate::_q_layoutChanged() } persistentHiddenSections.clear(); + for (int i = 0; i < oldSectionHidden.count(); ++i) { + if (oldSectionHidden.testBit(i)) + q->setSectionHidden(logicalIndex(i), false); + } + // the number of sections changed; we need to reread the state of the model if (sectionCountChanged) q->initializeSections(); @@ -2300,7 +2304,7 @@ void QHeaderView::mouseReleaseEvent(QMouseEvent *e) int section = logicalIndexAt(pos); if (section != -1 && section == d->pressed) { d->flipSortIndicator(section); - emit sectionClicked(logicalIndexAt(pos)); + emit sectionClicked(section); } if (d->pressed != -1) updateSection(d->pressed); diff --git a/src/gui/itemviews/qsortfilterproxymodel.cpp b/src/gui/itemviews/qsortfilterproxymodel.cpp index 41c984e..e73013c 100644 --- a/src/gui/itemviews/qsortfilterproxymodel.cpp +++ b/src/gui/itemviews/qsortfilterproxymodel.cpp @@ -270,6 +270,11 @@ void QSortFilterProxyModelPrivate::clear_mapping() qDeleteAll(source_index_mapping); source_index_mapping.clear(); + if (dynamic_sortfilter && update_source_sort_column()) { + //update_source_sort_column might have created wrong mapping so we have to clear it again + qDeleteAll(source_index_mapping); + source_index_mapping.clear(); + } // update the persistent indexes update_persistent_indexes(source_indexes); @@ -1208,11 +1213,6 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged() void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged() { Q_Q(QSortFilterProxyModel); - if (saved_persistent_indexes.isEmpty()) { - clear_mapping(); - emit q->layoutChanged(); - return; - } qDeleteAll(source_index_mapping); source_index_mapping.clear(); @@ -1220,7 +1220,11 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged() update_persistent_indexes(saved_persistent_indexes); saved_persistent_indexes.clear(); - update_source_sort_column(); + if (dynamic_sortfilter && update_source_sort_column()) { + //update_source_sort_column might have created wrong mapping so we have to clear it again + qDeleteAll(source_index_mapping); + source_index_mapping.clear(); + } emit q->layoutChanged(); } @@ -1481,7 +1485,6 @@ QSortFilterProxyModel::QSortFilterProxyModel(QObject *parent) d->filter_column = 0; d->filter_role = Qt::DisplayRole; d->dynamic_sortfilter = false; - connect(this, SIGNAL(modelReset()), this, SLOT(invalidate())); } /*! diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri index 0993b86..6fd45ad 100644 --- a/src/gui/kernel/kernel.pri +++ b/src/gui/kernel/kernel.pri @@ -206,6 +206,7 @@ embedded { OBJECTIVE_HEADERS += \ qcocoawindow_mac_p.h \ + qcocoapanel_mac_p.h \ qcocoawindowdelegate_mac_p.h \ qcocoaview_mac_p.h \ qcocoaapplication_mac_p.h \ diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index 4341367..538b04f 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -246,6 +246,9 @@ private: friend class QMenuBar; friend class QShortcutMap; friend class QToolButton; +#ifdef Q_WS_MAC + friend void qt_mac_clear_status_text(QAction *action); +#endif }; QT_BEGIN_INCLUDE_NAMESPACE diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 4fe3900..b9ea540 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -925,7 +925,7 @@ void QApplicationPrivate::initialize() // Set up which span functions should be used in raster engine... qInitDrawhelperAsm(); - + #if !defined(Q_WS_X11) && !defined(Q_WS_QWS) // initialize the graphics system - on X11 this is initialized inside // qt_init() in qapplication_x11.cpp because of several reasons. diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm index e8b821af..3fba833 100644 --- a/src/gui/kernel/qapplication_mac.mm +++ b/src/gui/kernel/qapplication_mac.mm @@ -1258,10 +1258,6 @@ void qt_init(QApplicationPrivate *priv, int) [cocoaApp setMenu:[qtMenuLoader menu]]; [newDelegate setMenuLoader:qtMenuLoader]; [qtMenuLoader release]; - - NSAppleEventManager *eventManager = [NSAppleEventManager sharedAppleEventManager]; - [eventManager setEventHandler:newDelegate andSelector:@selector(getUrl:withReplyEvent:) - forEventClass:kInternetEventClass andEventID:kAEGetURL]; } #endif // Register for Carbon tablet proximity events on the event monitor target. @@ -1361,12 +1357,39 @@ void QApplication::setMainWidget(QWidget *mainWidget) /***************************************************************************** QApplication cursor stack *****************************************************************************/ +#ifdef QT_MAC_USE_COCOA +void QApplicationPrivate::disableUsageOfCursorRects(bool disable) +{ + // In Cocoa there are two competing ways of setting the cursor; either + // by using cursor rects (see qcocoaview_mac.mm), or by pushing/popping + // the cursor manually. When we use override cursors, it makes most sense + // to use the latter. But then we need to tell cocoa to stop using the + // first approach so it doesn't change the cursor back when hovering over + // a cursor rect: + QWidgetList topLevels = qApp->topLevelWidgets(); + for (int i=0; i<topLevels.size(); ++i) { + if (NSWindow *window = qt_mac_window_for(topLevels.at(i))) + disable ? [window disableCursorRects] : [window enableCursorRects]; + } +} + +void QApplicationPrivate::updateOverrideCursor() +{ + // Sometimes Cocoa forgets that we have set a Cursor + // manually. In those cases, remind it again: + if (QCursor *override = qApp->overrideCursor()) + [static_cast<NSCursor *>(qt_mac_nsCursorForQCursor(*override)) set]; +} +#endif + void QApplication::setOverrideCursor(const QCursor &cursor) { qApp->d_func()->cursor_list.prepend(cursor); #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; + if (qApp->d_func()->cursor_list.size() == 1) + qApp->d_func()->disableUsageOfCursorRects(true); [static_cast<NSCursor *>(qt_mac_nsCursorForQCursor(cursor)) push]; #else if (qApp && qApp->activeWindow()) @@ -1383,6 +1406,8 @@ void QApplication::restoreOverrideCursor() #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; [NSCursor pop]; + if (qApp->d_func()->cursor_list.isEmpty()) + qApp->d_func()->disableUsageOfCursorRects(false); #else if (qApp && qApp->activeWindow()) { const QCursor def(Qt::ArrowCursor); @@ -2455,6 +2480,28 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event #endif } +#ifdef QT_MAC_USE_COCOA +void QApplicationPrivate::qt_initAfterNSAppStarted() +{ + setupAppleEvents(); + updateOverrideCursor(); +} + +void QApplicationPrivate::setupAppleEvents() +{ + // This function is called from the event dispatcher when NSApplication has + // finished initialization, which appears to be just after [NSApplication run] has + // started to execute. By setting up our apple events handlers this late, we override + // the ones set up by NSApplication. + QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) *newDelegate = [QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) sharedDelegate]; + NSAppleEventManager *eventManager = [NSAppleEventManager sharedAppleEventManager]; + [eventManager setEventHandler:newDelegate andSelector:@selector(appleEventQuit:withReplyEvent:) + forEventClass:kCoreEventClass andEventID:kAEQuitApplication]; + [eventManager setEventHandler:newDelegate andSelector:@selector(getUrl:withReplyEvent:) + forEventClass:kInternetEventClass andEventID:kAEGetURL]; +} +#endif + // In Carbon this is your one stop for apple events. // In Cocoa, it ISN'T. This is the catch-all Apple Event handler that exists // for the time between instantiating the NSApplication, but before the @@ -3002,7 +3049,7 @@ void onApplicationWindowChangedActivation(QWidget *widget, bool activated) } QMenuBar::macUpdateMenuBar(); - + QApplicationPrivate::updateOverrideCursor(); #else Q_UNUSED(widget); Q_UNUSED(activated); diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 9c001ab..59565d4 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -457,6 +457,12 @@ public: static OSStatus globalEventProcessor(EventHandlerCallRef, EventRef, void *); static OSStatus globalAppleEventProcessor(const AppleEvent *, AppleEvent *, long); static OSStatus tabletProximityCallback(EventHandlerCallRef, EventRef, void *); +#ifdef QT_MAC_USE_COCOA + static void qt_initAfterNSAppStarted(); + static void setupAppleEvents(); + static void updateOverrideCursor(); + static void disableUsageOfCursorRects(bool disable); +#endif static bool qt_mac_apply_settings(); #endif diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 4a137ee..87de602 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -63,7 +63,7 @@ #include "private/qsoftkeymanager_p.h" #include "apgwgnam.h" // For CApaWindowGroupName -#include <MdaAudioTonePlayer.h> // For CMdaAudioToneUtility +#include <mdaaudiotoneplayer.h> // For CMdaAudioToneUtility #if defined(Q_WS_S60) # if !defined(QT_NO_IM) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 2a1f655..667db39 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -614,6 +614,11 @@ static int (*original_xio_errhandler)(Display *dpy); static int qt_x_errhandler(Display *dpy, XErrorEvent *err) { + if (X11->display != dpy) { + // only handle X errors for our display + return 0; + } + switch (err->error_code) { case BadAtom: if (err->request_code == 20 /* X_GetProperty */ diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index 47a8026..ab71a05 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -317,5 +317,12 @@ static void cleanupCocoaApplicationDelegate() qt_sendSpontaneousEvent(qAppInstance(), &qtEvent); } +- (void)appleEventQuit:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent +{ + Q_UNUSED(event); + Q_UNUSED(replyEvent); + [NSApp terminate:self]; +} + @end #endif diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm index 5e24c84..0b48efd 100644 --- a/src/gui/kernel/qcocoapanel_mac.mm +++ b/src/gui/kernel/qcocoapanel_mac.mm @@ -46,6 +46,7 @@ #import <private/qcocoawindowdelegate_mac_p.h> #import <private/qcocoaview_mac_p.h> #import <private/qcocoawindowcustomthemeframe_mac_p.h> +#import <private/qcocoaapplication_mac_p.h> #include <private/qapplication_p.h> #include <private/qbackingstore_p.h> diff --git a/src/gui/kernel/qcocoapanel_mac_p.h b/src/gui/kernel/qcocoapanel_mac_p.h index fc83bd8..3678f81 100644 --- a/src/gui/kernel/qcocoapanel_mac_p.h +++ b/src/gui/kernel/qcocoapanel_mac_p.h @@ -54,10 +54,16 @@ #ifdef QT_MAC_USE_COCOA #import <Cocoa/Cocoa.h> +QT_FORWARD_DECLARE_CLASS(QStringList); + @interface QT_MANGLE_NAMESPACE(QCocoaPanel) : NSPanel { bool leftButtonIsRightButton; + QStringList *currentCustomDragTypes; } + (Class)frameViewClassForStyleMask:(NSUInteger)styleMask; +- (void)registerDragTypes; + @end #endif + diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index d2b74d7..a1d2c61 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -57,8 +57,32 @@ QT_BEGIN_NAMESPACE extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview.mm extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp +extern const QStringList& qEnabledDraggedTypes(); // qmime_mac.cpp +extern bool qt_blockCocoaSettingModalWindowLevel; // qeventdispatcher_mac_p.h + +Q_GLOBAL_STATIC(QPointer<QWidget>, currentDragTarget); + QT_END_NAMESPACE +- (id)initWithContentRect:(NSRect)contentRect + styleMask:(NSUInteger)windowStyle + backing:(NSBackingStoreType)bufferingType + defer:(BOOL)deferCreation +{ + self = [super initWithContentRect:contentRect styleMask:windowStyle + backing:bufferingType defer:deferCreation]; + if (self) { + currentCustomDragTypes = 0; + } + return self; +} + +- (void)dealloc +{ + delete currentCustomDragTypes; + [super dealloc]; +} + - (BOOL)canBecomeKeyWindow { QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)]; @@ -68,6 +92,40 @@ QT_END_NAMESPACE return !(isPopup || isToolTip); } +- (BOOL)canBecomeMainWindow +{ + QWidget *widget = [self QT_MANGLE_NAMESPACE(qt_qwidget)]; + + bool isToolTip = (widget->windowType() == Qt::ToolTip); + bool isPopup = (widget->windowType() == Qt::Popup); + bool isTool = (widget->windowType() == Qt::Tool); + return !(isPopup || isToolTip || isTool); +} + +- (void)orderWindow:(NSWindowOrderingMode)orderingMode relativeTo:(NSInteger)otherWindowNumber +{ + if (qt_blockCocoaSettingModalWindowLevel) { + // To avoid windows popping in front while restoring modal sessions + // in the event dispatcher, we block cocoa from ordering this window + // to front. The result of not doing this can be seen if executing + // a native color dialog on top of another executing dialog. + return; + } + [super orderWindow:orderingMode relativeTo:otherWindowNumber]; +} + +- (void)setLevel:(NSInteger)windowLevel +{ + if (qt_blockCocoaSettingModalWindowLevel) { + // To avoid windows popping in front while restoring modal sessions + // in the event dispatcher, we block cocoa from ordering this window + // to front. The result of not doing this can be seen if executing + // a native color dialog on top of another executing dialog. + return; + } + [super setLevel:windowLevel]; +} + - (void)toggleToolbarShown:(id)sender { macSendToolbarChangeEvent([self QT_MANGLE_NAMESPACE(qt_qwidget)]); @@ -106,6 +164,23 @@ QT_END_NAMESPACE qt_dispatchTabletProximityEvent(tabletEvent); } +- (void)qtDispatcherToQAction:(id)sender +{ + // If this window is modal, the menu bar will be modally shaddowed. + // In that case, since the window will be in the first responder chain, + // we can still catch the trigger here and forward it to the menu bar. + // This is needed as a single modal dialog on Qt should be able to access + // the application menu (e.g. quit). + [[NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)] qtDispatcherToQAction:sender]; +} + +- (void)terminate:(id)sender +{ + // This function is called from the quit item in the menubar when this window + // is in the first responder chain (see also qtDispatcherToQAction above) + [NSApp terminate:sender]; +} + - (void)sendEvent:(NSEvent *)event { QWidget *widget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self]; @@ -133,7 +208,7 @@ QT_END_NAMESPACE qt_button_down = widget; handled = qt_mac_handleMouseEvent(view, event, QEvent::MouseButtonPress, mouseButton); // Don't call super here. This prevents us from getting the mouseUp event, - // which we need to send even if the mouseDown event was not accepted. + // which we need to send even if the mouseDown event was not accepted. // (this is standard Qt behavior.) break; case NSRightMouseDown: @@ -188,6 +263,115 @@ QT_END_NAMESPACE return [super frameViewClassForStyleMask:styleMask]; } +-(void)registerDragTypes +{ + // Calling registerForDraggedTypes below is slow, so only do + // it once for each window, or when the custom types change. + QMacCocoaAutoReleasePool pool; + const QStringList& customTypes = qEnabledDraggedTypes(); + if (currentCustomDragTypes == 0 || *currentCustomDragTypes != customTypes) { + if (currentCustomDragTypes == 0) + currentCustomDragTypes = new QStringList(); + *currentCustomDragTypes = customTypes; + const NSString* mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; + NSMutableArray *supportedTypes = [NSMutableArray arrayWithObjects:NSColorPboardType, + NSFilenamesPboardType, NSStringPboardType, + NSFilenamesPboardType, NSPostScriptPboardType, NSTIFFPboardType, + NSRTFPboardType, NSTabularTextPboardType, NSFontPboardType, + NSRulerPboardType, NSFileContentsPboardType, NSColorPboardType, + NSRTFDPboardType, NSHTMLPboardType, NSPICTPboardType, + NSURLPboardType, NSPDFPboardType, NSVCardPboardType, + NSFilesPromisePboardType, NSInkTextPboardType, + NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil]; + // Add custom types supported by the application. + for (int i = 0; i < customTypes.size(); i++) { + [supportedTypes addObject:reinterpret_cast<const NSString *>(QCFString::toCFStringRef(customTypes[i]))]; + } + [self registerForDraggedTypes:supportedTypes]; + } +} + +- (QWidget *)dragTargetHitTest:(id <NSDraggingInfo>)sender +{ + // Do a hittest to find the NSView under the + // mouse, and return the corresponding QWidget: + NSPoint windowPoint = [sender draggingLocation]; + NSView *candidateView = [[self contentView] hitTest:windowPoint]; + if (![candidateView isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) + return 0; + return [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(candidateView) qt_qwidget]; +} + +- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender +{ + // The user dragged something into the window. Send a draggingEntered message + // to the QWidget under the mouse. As the drag moves over the window, and over + // different widgets, we will handle enter and leave events from within + // draggingUpdated below. The reason why we handle this ourselves rather than + // subscribing for drag events directly in QCocoaView is that calling + // registerForDraggedTypes on the views will severly degrade initialization time + // for an application that uses a lot of drag subscribing widgets. + + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) + return [super draggingEntered:sender]; + if (target->testAttribute(Qt::WA_DropSiteRegistered) == false) + return NSDragOperationNone; + + *currentDragTarget() = target; + return [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) draggingEntered:sender]; + } + +- (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender +{ + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) + return [super draggingUpdated:sender]; + + if (target == *currentDragTarget()) { + // The drag continues to move over the widget that we have sendt + // a draggingEntered message to. So just update the view: + return [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) draggingUpdated:sender]; + } else { + // The widget under the mouse has changed. + // So we need to fake enter/leave events: + if (*currentDragTarget()) + [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) draggingExited:sender]; + if (target->testAttribute(Qt::WA_DropSiteRegistered) == false) { + *currentDragTarget() = 0; + return NSDragOperationNone; + } + *currentDragTarget() = target; + return [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) draggingEntered:sender]; + } +} + +- (void)draggingExited:(id < NSDraggingInfo >)sender +{ + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) + return [super draggingExited:sender]; + + if (*currentDragTarget()) { + [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) draggingExited:sender]; + *currentDragTarget() = 0; + } +} + +- (BOOL)performDragOperation:(id < NSDraggingInfo >)sender +{ + QWidget *target = [self dragTargetHitTest:sender]; + if (!target) + return [super performDragOperation:sender]; + + BOOL dropResult = NO; + if (*currentDragTarget()) { + dropResult = [reinterpret_cast<NSView *>((*currentDragTarget())->winId()) performDragOperation:sender]; + *currentDragTarget() = 0; + } + return dropResult; +} + - (void)displayIfNeeded { @@ -203,5 +387,3 @@ QT_END_NAMESPACE } [super displayIfNeeded]; } - - diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 2c35be2..70c78c8 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -81,7 +81,6 @@ Q_GLOBAL_STATIC(DnDParams, qMacDnDParams); extern void qt_mac_update_cursor_at_global_pos(const QPoint &globalPos); // qcursor_mac.mm extern bool qt_sendSpontaneousEvent(QObject *, QEvent *); // qapplication.cpp extern OSViewRef qt_mac_nativeview_for(const QWidget *w); // qwidget_mac.mm -extern const QStringList& qEnabledDraggedTypes(); // qmime_mac.cpp extern QPointer<QWidget> qt_mouseover; //qapplication_mac.mm extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp @@ -212,7 +211,6 @@ extern "C" { composingText = new QString(); composing = false; sendKeyEvents = true; - currentCustomTypes = 0; [self setHidden:YES]; return self; } @@ -227,36 +225,12 @@ extern "C" { object:self]; } --(void)registerDragTypes -{ - QMacCocoaAutoReleasePool pool; - // Calling registerForDraggedTypes is slow, so only do it once for each widget - // or when the custom types change. - const QStringList& customTypes = qEnabledDraggedTypes(); - if (currentCustomTypes == 0 || *currentCustomTypes != customTypes) { - if (currentCustomTypes == 0) - currentCustomTypes = new QStringList(); - *currentCustomTypes = customTypes; - const NSString* mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; - NSMutableArray *supportedTypes = [NSMutableArray arrayWithObjects:NSColorPboardType, - NSFilenamesPboardType, NSStringPboardType, - NSFilenamesPboardType, NSPostScriptPboardType, NSTIFFPboardType, - NSRTFPboardType, NSTabularTextPboardType, NSFontPboardType, - NSRulerPboardType, NSFileContentsPboardType, NSColorPboardType, - NSRTFDPboardType, NSHTMLPboardType, NSPICTPboardType, - NSURLPboardType, NSPDFPboardType, NSVCardPboardType, - NSFilesPromisePboardType, NSInkTextPboardType, - NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil]; - // Add custom types supported by the application. - for (int i = 0; i < customTypes.size(); i++) { - [supportedTypes addObject:reinterpret_cast<const NSString *>(QCFString::toCFStringRef(customTypes[i]))]; - } - [self registerForDraggedTypes:supportedTypes]; - } -} - - (void)resetCursorRects { + // [NSView addCursorRect] is slow, so bail out early if we can: + if (NSIsEmptyRect([self visibleRect])) + return; + QWidget *cursorWidget = qwidget; if (cursorWidget->testAttribute(Qt::WA_TransparentForMouseEvents)) @@ -300,15 +274,9 @@ extern "C" { - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { - if (qwidget->testAttribute(Qt::WA_DropSiteRegistered) == false) - return NSDragOperationNone; + // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly + // from Cocoa. They modify the drag target, and might fake enter/leave events. NSPoint windowPoint = [sender draggingLocation]; - if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) { - // pass the drag enter event to the view underneath. - NSView *candidateView = [[[self window] contentView] hitTest:windowPoint]; - if (candidateView && candidateView != self) - return [candidateView draggingEntered:sender]; - } dragEnterSequence = [sender draggingSequenceNumber]; [self addDropData:sender]; QMimeData *mimeData = dropData; @@ -361,13 +329,9 @@ extern "C" { } - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender { + // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly + // from Cocoa. They modify the drag target, and might fake enter/leave events. NSPoint windowPoint = [sender draggingLocation]; - if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) { - // pass the drag move event to the view underneath. - NSView *candidateView = [[[self window] contentView] hitTest:windowPoint]; - if (candidateView && candidateView != self) - return [candidateView draggingUpdated:sender]; - } // in cases like QFocusFrame, the view under the mouse might // not have received the drag enter. Generate a synthetic // drag enter event for that view. @@ -417,14 +381,10 @@ extern "C" { - (void)draggingExited:(id < NSDraggingInfo >)sender { + // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly + // from Cocoa. They modify the drag target, and might fake enter/leave events. + Q_UNUSED(sender); dragEnterSequence = -1; - if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) { - // try sending the leave event to the last view which accepted drag enter. - DnDParams *dndParams = [QT_MANGLE_NAMESPACE(QCocoaView) currentMouseEvent]; - NSView *candidateView = [[[self window] contentView] hitTest:dndParams->activeDragEnterPos]; - if (candidateView && candidateView != self) - return [candidateView draggingExited:sender]; - } // drag enter event was rejected, so ignore the move event. if (dropData) { QDragLeaveEvent de; @@ -435,14 +395,10 @@ extern "C" { - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender { + // NB: This function is called from QCoocaWindow/QCocoaPanel rather than directly + // from Cocoa. They modify the drag target, and might fake enter/leave events. NSPoint windowPoint = [sender draggingLocation]; dragEnterSequence = -1; - if (qwidget->testAttribute(Qt::WA_TransparentForMouseEvents)) { - // pass the drop event to the view underneath. - NSView *candidateView = [[[self window] contentView] hitTest:windowPoint]; - if (candidateView && candidateView != self) - return [candidateView performDragOperation:sender]; - } [self addDropData:sender]; NSPoint globalPoint = [[sender draggingDestinationWindow] convertBaseToScreen:windowPoint]; @@ -472,8 +428,6 @@ extern "C" { { delete composingText; [[NSNotificationCenter defaultCenter] removeObserver:self]; - delete currentCustomTypes; - [self unregisterDraggedTypes]; [super dealloc]; } @@ -616,6 +570,10 @@ extern "C" { - (void)updateTrackingAreas { + // [NSView addTrackingArea] is slow, so bail out early if we can: + if (NSIsEmptyRect([self visibleRect])) + return; + QMacCocoaAutoReleasePool pool; if (NSArray *trackingArray = [self trackingAreas]) { NSUInteger size = [trackingArray count]; diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h index 797b4d5..4bb10c5 100644 --- a/src/gui/kernel/qcocoaview_mac_p.h +++ b/src/gui/kernel/qcocoaview_mac_p.h @@ -87,7 +87,6 @@ Q_GUI_EXPORT int composingLength; bool sendKeyEvents; QString *composingText; - QStringList *currentCustomTypes; NSInteger dragEnterSequence; } - (id)initWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; @@ -97,7 +96,6 @@ Q_GUI_EXPORT - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender; - (void)draggingExited:(id < NSDraggingInfo >)sender; - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender; -- (void)registerDragTypes; - (void)removeDropData; - (void)addDropData:(id <NSDraggingInfo>)sender; - (void)setSupportedActions:(NSDragOperation)actions; diff --git a/src/gui/kernel/qcocoawindow_mac.mm b/src/gui/kernel/qcocoawindow_mac.mm index a644dfe..f1b642b 100644 --- a/src/gui/kernel/qcocoawindow_mac.mm +++ b/src/gui/kernel/qcocoawindow_mac.mm @@ -46,6 +46,7 @@ #import <private/qcocoaview_mac_p.h> #import <private/qt_cocoa_helpers_mac_p.h> #import <private/qcocoawindowcustomthemeframe_mac_p.h> +#import <private/qcocoaapplication_mac_p.h> #include <QtGui/QWidget> diff --git a/src/gui/kernel/qcocoawindow_mac_p.h b/src/gui/kernel/qcocoawindow_mac_p.h index 0474882..21f82df 100644 --- a/src/gui/kernel/qcocoawindow_mac_p.h +++ b/src/gui/kernel/qcocoawindow_mac_p.h @@ -73,9 +73,12 @@ QT_FORWARD_DECLARE_CLASS(QStringList); @interface QT_MANGLE_NAMESPACE(QCocoaWindow) : NSWindow { bool leftButtonIsRightButton; + QStringList *currentCustomDragTypes; } + (Class)frameViewClassForStyleMask:(NSUInteger)styleMask; +- (void)registerDragTypes; + @end #endif diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm index db87491..24498f8 100644 --- a/src/gui/kernel/qcocoawindowdelegate_mac.mm +++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm @@ -269,9 +269,6 @@ static void cleanupCocoaWindowDelegate() { QWidget *qwidget = m_windowHash->value([notification object]); Q_ASSERT(qwidget); - if (qwidget->isActiveWindow()) - return; // Widget is already active, no need to go through re-activation. - onApplicationWindowChangedActivation(qwidget, true); } @@ -288,10 +285,6 @@ static void cleanupCocoaWindowDelegate() { QWidget *qwidget = m_windowHash->value([notification object]); Q_ASSERT(qwidget); - if (qwidget->isActiveWindow()) - return; // Widget is already active, no need to go through re-activation - - onApplicationWindowChangedActivation(qwidget, true); } diff --git a/src/gui/kernel/qdnd_s60.cpp b/src/gui/kernel/qdnd_s60.cpp index 24f0090..1aa30af 100644 --- a/src/gui/kernel/qdnd_s60.cpp +++ b/src/gui/kernel/qdnd_s60.cpp @@ -52,7 +52,7 @@ #include "qdnd_p.h" #include "qt_s60_p.h" -#include <COECNTRL.H> +#include <coecntrl.h> // pointer cursor #include <w32std.h> #include <gdi.h> diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm index c7c7caf..c7d042d 100644 --- a/src/gui/kernel/qeventdispatcher_mac.mm +++ b/src/gui/kernel/qeventdispatcher_mac.mm @@ -90,11 +90,16 @@ #ifndef QT_NO_THREAD # include "qmutex.h" +#endif QT_BEGIN_NAMESPACE QT_USE_NAMESPACE -#endif + +/***************************************************************************** + Internal variables and functions + *****************************************************************************/ +bool qt_blockCocoaSettingModalWindowLevel = false; /***************************************************************************** Externals @@ -540,6 +545,12 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) { Q_D(QEventDispatcherMac); d->interrupt = false; + +#ifdef QT_MAC_USE_COCOA + bool interruptLater = false; + QtMacInterruptDispatcherHelp::cancelInterruptLater(); +#endif + // In case we end up recursing while we now process events, make sure // that we send remaining posted Qt events before this call returns: wakeUp(); @@ -554,25 +565,25 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) QMacCocoaAutoReleasePool pool; NSEvent* event = 0; - // If Qt is used as a plugin, or just added into a native cocoa - // application, we should not run or stop NSApplication; - // This will be done from outside Qt. - // And if processEvents is called manually (rather than from QEventLoop), we - // cannot enter a tight loop and block the call, but instead return after one flush: - bool canExec_3rdParty = d->nsAppRunCalledByQt || ![NSApp isRunning]; - bool canExec_Qt = flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec; + // If Qt is used as a plugin, or as an extension in a native cocoa + // application, we should not run or stop NSApplication; This will be + // done from the application itself. And if processEvents is called + // manually (rather than from a QEventLoop), we cannot enter a tight + // loop and block this call, but instead we need to return after one flush: + const bool canExec_3rdParty = d->nsAppRunCalledByQt || ![NSApp isRunning]; + const bool canExec_Qt = flags & QEventLoop::DialogExec || flags & QEventLoop::EventLoopExec; if (canExec_Qt && canExec_3rdParty) { // We can use exec-mode, meaning that we can stay in a tight loop until - // interrupted. This is mostly an optimization, but it also allow us - // to use [NSApp run], which is the recommended way of running applications - // in cocoa. [NSApp run] should be called at least once for any cocoa app. + // interrupted. This is mostly an optimization, but it allow us to use + // [NSApp run], which is the normal code path for cocoa applications. if (NSModalSession session = d->currentModalSession()) { QBoolBlocker execGuard(d->currentExecIsNSAppRun, false); while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt) qt_mac_waitForMoreModalSessionEvents(); + if (!d->interrupt && session == d->currentModalSessionCached) { - // INVARIANT: Someone called e.g. [NSApp stopModal:] from outside the event + // Someone called [NSApp stopModal:] from outside the event // dispatcher (e.g to stop a native dialog). But that call wrongly stopped // 'session' as well. As a result, we need to restart all internal sessions: d->temporarilyStopAllModalSessions(); @@ -583,54 +594,63 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) [NSApp run]; } retVal = true; - } else do { - // INVARIANT: We cannot block the thread (and run in a tight loop). + } else { + // We cannot block the thread (and run in a tight loop). // Instead we will process all current pending events and return. - bool mustRelease = false; - - if (!(flags & QEventLoop::ExcludeUserInputEvents) && !d->queuedUserInputEvents.isEmpty()) { - // Process a pending user input event - mustRelease = true; - event = static_cast<NSEvent *>(d->queuedUserInputEvents.takeFirst()); - } else { - if (NSModalSession session = d->currentModalSession()) { - if (flags & QEventLoop::WaitForMoreEvents) - qt_mac_waitForMoreModalSessionEvents(); - NSInteger status = [NSApp runModalSession:session]; - if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) { - // INVARIANT: Someone called e.g. [NSApp stopModal:] from outside the event - // dispatcher (e.g to stop a native dialog). But that call wrongly stopped - // 'session' as well. As a result, we need to restart all internal sessions: - d->temporarilyStopAllModalSessions(); - } - retVal = true; - break; + d->ensureNSAppInitialized(); + do { + bool releaseEvent = false; + + if (!(flags & QEventLoop::ExcludeUserInputEvents) + && !d->queuedUserInputEvents.isEmpty()) { + // Process a pending user input event + releaseEvent = true; + event = static_cast<NSEvent *>(d->queuedUserInputEvents.takeFirst()); } else { - event = [NSApp nextEventMatchingMask:NSAnyEventMask - untilDate:nil - inMode:NSDefaultRunLoopMode - dequeue: YES]; - - if (event != nil) { - if (flags & QEventLoop::ExcludeUserInputEvents) { - if (IsMouseOrKeyEvent(event)) { - // retain event here? - [event retain]; - d->queuedUserInputEvents.append(event); - continue; + if (NSModalSession session = d->currentModalSession()) { + if (flags & QEventLoop::WaitForMoreEvents) + qt_mac_waitForMoreModalSessionEvents(); + NSInteger status = [NSApp runModalSession:session]; + if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) { + // INVARIANT: Someone called [NSApp stopModal:] from outside the event + // dispatcher (e.g to stop a native dialog). But that call wrongly stopped + // 'session' as well. As a result, we need to restart all internal sessions: + d->temporarilyStopAllModalSessions(); + } + retVal = true; + break; + } else { + event = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:nil + inMode:NSDefaultRunLoopMode + dequeue: YES]; + + if (event != nil) { + if (flags & QEventLoop::ExcludeUserInputEvents) { + if (IsMouseOrKeyEvent(event)) { + [event retain]; + d->queuedUserInputEvents.append(event); + continue; + } } } } } - } - if (event) { - if (!filterEvent(event) && qt_mac_send_event(flags, event, 0)) - retVal = true; - if (mustRelease) - [event release]; - } - } while(!d->interrupt && event != nil); - + if (event) { + if (!filterEvent(event) && qt_mac_send_event(flags, event, 0)) + retVal = true; + if (releaseEvent) + [event release]; + } + } while (!d->interrupt && event != nil); + + // Since the window that holds modality might have changed while processing + // events, we we need to interrupt when we return back the previous process + // event recursion to ensure that we spin the correct modal session. + // We do the interruptLater at the end of the function to ensure that we don't + // disturb the 'wait for more events' below (as deleteLater will post an event): + interruptLater = true; + } #else do { EventRef event; @@ -682,25 +702,19 @@ bool QEventDispatcherMac::processEvents(QEventLoop::ProcessEventsFlags flags) } } + // If we're interrupted, we need to interrupt the _current_ + // recursion as well to check if it is still supposed to be + // executing. This way we wind down the stack until we land + // on a recursion that again calls processEvents (typically + // from QEventLoop), and set interrupt to false: + if (d->interrupt) + interrupt(); + #ifdef QT_MAC_USE_COCOA - // In case we _now_ process events using [NSApp run], we need to stop it to - // ensure that: - // 1. the QEventLoop that called us is still executing, or - // 2. we have a modal session that needs to be spun instead. - // In case this is a plain call to processEvents (perhaps from a loop) - // from the application (rather than from a QEventLoop), we delay the - // interrupting until we/ actually enter a lower loop level (hence the - // deffered delete of the object below): - QtMacInterruptDispatcherHelp::interruptLater(); + if (interruptLater) + QtMacInterruptDispatcherHelp::interruptLater(); #endif - if (d->interrupt) { - // We should continue to leave all recursion to processEvents until - // processEvents is called again (e.g. from a QEventLoop that - // was not yet told to quit: - interrupt(); - } - return retVal; } @@ -729,39 +743,60 @@ void QEventDispatcherMac::flush() *****************************************************************************/ MacTimerHash QEventDispatcherMacPrivate::macTimerHash; bool QEventDispatcherMacPrivate::blockSendPostedEvents = false; +bool QEventDispatcherMacPrivate::interrupt = false; #ifdef QT_MAC_USE_COCOA QStack<QCocoaModalSessionInfo> QEventDispatcherMacPrivate::cocoaModalSessionStack; bool QEventDispatcherMacPrivate::currentExecIsNSAppRun = false; +bool QEventDispatcherMacPrivate::modalSessionsTemporarilyStopped = false; bool QEventDispatcherMacPrivate::nsAppRunCalledByQt = false; +bool QEventDispatcherMacPrivate::cleanupModalSessionsNeeded = false; NSModalSession QEventDispatcherMacPrivate::currentModalSessionCached = 0; -int QEventDispatcherMacPrivate::activeModalSessionCount() +void QEventDispatcherMacPrivate::ensureNSAppInitialized() { - // Returns the number of modal sessions created - // (and not just pushed onto the stack, pending to be created) - int count = 0; - for (int i=cocoaModalSessionStack.size()-1; i>=0; --i) { - QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; - if (info.session) - ++count; - } - return count; + // Some elements in Cocoa require NSApplication to be running before + // they get fully initialized, in particular the menu bar. This + // function is intended for cases where a dialog is told to execute before + // QApplication::exec is called, or the application spins the events loop + // manually rather than calling QApplication:exec. + // The function makes sure that NSApplication starts running, but stops + // it again as soon as the send posted events callback is called. That way + // we let Cocoa finish the initialization it seems to need. We'll only + // apply this trick at most once for any application, and we avoid doing it + // for the common case where main just starts QApplication::exec. + if (nsAppRunCalledByQt || [NSApp isRunning]) + return; + nsAppRunCalledByQt = true; + QBoolBlocker block1(interrupt, true); + QBoolBlocker block2(currentExecIsNSAppRun, true); + [NSApp run]; } void QEventDispatcherMacPrivate::temporarilyStopAllModalSessions() { - // Stop all created modal session, and as such, make then - // pending again. The next call to currentModalSession will - // recreate the session on top again: + // Flush, and Stop, all created modal session, and as + // such, make them pending again. The next call to + // currentModalSession will recreate them again. The + // reason to stop all session like this is that otherwise + // a call [NSApp stop] would not stop NSApp, but rather + // the current modal session. So if we need to stop NSApp + // we need to stop all the modal session first. To avoid changing + // the stacking order of the windows while doing so, we put + // up a block that is used in QCocoaWindow and QCocoaPanel: + QBoolBlocker block1(blockSendPostedEvents, true); + QBoolBlocker block2(qt_blockCocoaSettingModalWindowLevel, true); + int stackSize = cocoaModalSessionStack.size(); for (int i=stackSize-1; i>=0; --i) { QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; if (info.session) { + [NSApp runModalSession:info.session]; [NSApp endModalSession:info.session]; info.session = 0; } } + modalSessionsTemporarilyStopped = true; currentModalSessionCached = 0; } @@ -775,23 +810,6 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession() if (cocoaModalSessionStack.isEmpty()) return 0; - // Since this code will end up calling our Qt event handler - // (also from beginModalSessionForWindow), we need to block - // that to avoid side effects of events beeing delivered: - QBoolBlocker block(blockSendPostedEvents, true); - - if (![NSApp isRunning]) { - // Sadly, we need to introduce this little event flush - // to stop dialogs from blinking/poping in front if a - // modal session restart was needed: - while (NSEvent *event = [NSApp nextEventMatchingMask:0 - untilDate:nil - inMode:NSDefaultRunLoopMode - dequeue: YES]) { - qt_mac_send_event(0, event, 0); - } - } - int sessionCount = cocoaModalSessionStack.size(); for (int i=0; i<sessionCount; ++i) { QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; @@ -804,11 +822,28 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession() NSWindow *window = qt_mac_window_for(info.widget); if (!window) continue; + + ensureNSAppInitialized(); + QBoolBlocker block1(blockSendPostedEvents, true); info.session = [NSApp beginModalSessionForWindow:window]; } currentModalSessionCached = info.session; } + if (modalSessionsTemporarilyStopped && currentModalSessionCached) { + // After a call to temporarilyStopAllModalSessions, cocoa have + // now posted events to restore ended modal session windows to + // the correct window level. Those events will be processed + // _after_ our new calls to beginModalSessionForWindow have + // taken effect, which will end up stacking the windows wrong on + // screen. To work around this, we block cocoa from changing the + // stacking order of the windows, and flush out the pending events + // (the block is used in QCocoaWindow and QCocoaPanel): + QBoolBlocker block1(blockSendPostedEvents, true); + QBoolBlocker block2(qt_blockCocoaSettingModalWindowLevel, true); + [NSApp runModalSession:currentModalSessionCached]; + } + modalSessionsTemporarilyStopped = false; return currentModalSessionCached; } @@ -844,6 +879,34 @@ void QEventDispatcherMacPrivate::updateChildrenWorksWhenModal() } } +void QEventDispatcherMacPrivate::cleanupModalSessions() +{ + // Go through the list of modal sessions, and end those + // that no longer has a widget assosiated; no widget means + // the the session has logically ended. The reason we wait like + // this to actually end the sessions for real (rather than at the + // point they were marked as stopped), is that ending a session + // when no other session runs below it on the stack will make cocoa + // drop some events on the floor. + QMacCocoaAutoReleasePool pool; + int stackSize = cocoaModalSessionStack.size(); + + for (int i=stackSize-1; i>=0; --i) { + QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; + if (info.widget) { + currentModalSessionCached = info.session; + break; + } + cocoaModalSessionStack.remove(i); + currentModalSessionCached = 0; + if (info.session) + [NSApp endModalSession:info.session]; + } + + updateChildrenWorksWhenModal(); + cleanupModalSessionsNeeded = false; +} + void QEventDispatcherMacPrivate::beginModalSession(QWidget *widget) { // Add a new, empty (null), NSModalSession to the stack. @@ -852,7 +915,7 @@ void QEventDispatcherMacPrivate::beginModalSession(QWidget *widget) // is non-zero, and the session pointer is zero (it will become active upon a call to // currentModalSession). A QCocoaModalSessionInfo is considered pending to be stopped if // the widget pointer is zero, and the session pointer is non-zero (it will be fully - // stopped in endModalSession(). + // stopped in cleanupModalSessions()). QCocoaModalSessionInfo info = {widget, 0}; cocoaModalSessionStack.push(info); updateChildrenWorksWhenModal(); @@ -869,38 +932,21 @@ void QEventDispatcherMacPrivate::endModalSession(QWidget *widget) int stackSize = cocoaModalSessionStack.size(); for (int i=stackSize-1; i>=0; --i) { QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; - if (info.widget == widget) + if (info.widget == widget) { info.widget = 0; - } - - // Now we stop, and remove, all sessions marked as pending - // to be stopped on _top_ of the stack, if any: - bool needToInterruptEventDispatcher = false; - bool needToUpdateChildrenWorksWhenModal = false; - - for (int i=stackSize-1; i>=0; --i) { - QCocoaModalSessionInfo &info = cocoaModalSessionStack[i]; - if (info.widget) - break; - cocoaModalSessionStack.remove(i); - needToUpdateChildrenWorksWhenModal = true; - currentModalSessionCached = 0; - if (info.session) { - [NSApp endModalSession:info.session]; - needToInterruptEventDispatcher = true; + if (i == stackSize-1) { + // The top sessions ended. Interrupt the event dispatcher + // to start spinning the correct session immidiatly: + cleanupModalSessionsNeeded = true; + QEventDispatcherMac::instance()->interrupt(); + } } } - - if (needToUpdateChildrenWorksWhenModal) - updateChildrenWorksWhenModal(); - if (needToInterruptEventDispatcher) - QEventDispatcherMac::instance()->interrupt(); } #endif QEventDispatcherMacPrivate::QEventDispatcherMacPrivate() - : interrupt(false) { } @@ -959,13 +1005,39 @@ Boolean QEventDispatcherMacPrivate::postedEventSourceEqualCallback(const void *i inline static void processPostedEvents(QEventDispatcherMacPrivate *const d, const bool blockSendPostedEvents) { - if (blockSendPostedEvents || d->interrupt) { + if (blockSendPostedEvents) { + // We're told to not send posted events (because the event dispatcher + // is currently working on setting up the correct session to run). But + // we still need to make sure that we don't fall asleep until pending events + // are sendt, so we just signal this need, and return: CFRunLoopSourceSignal(d->postedEventsSource); - } else { - if (!d->threadData->canWait || (d->serialNumber != d->lastSerial)) { - d->lastSerial = d->serialNumber; - QApplicationPrivate::sendPostedEvents(0, 0, d->threadData); + return; + } + +#ifdef QT_MAC_USE_COCOA + if (d->cleanupModalSessionsNeeded) + d->cleanupModalSessions(); +#endif + + if (d->interrupt) { +#ifdef QT_MAC_USE_COCOA + if (d->currentExecIsNSAppRun) { + // The event dispatcher has been interrupted. But since + // [NSApplication run] is running the event loop, we + // delayed stopping it until now (to let cocoa process + // pending cocoa events first). + if (d->currentModalSessionCached) + d->temporarilyStopAllModalSessions(); + [NSApp stop:NSApp]; + d->cancelWaitForMoreEvents(); } +#endif + return; + } + + if (!d->threadData->canWait || (d->serialNumber != d->lastSerial)) { + d->lastSerial = d->serialNumber; + QApplicationPrivate::sendPostedEvents(0, 0, d->threadData); } } @@ -975,6 +1047,9 @@ void QEventDispatcherMacPrivate::firstLoopEntry(CFRunLoopObserverRef ref, { Q_UNUSED(ref); Q_UNUSED(activity); +#ifdef QT_MAC_USE_COCOA + QApplicationPrivate::qt_initAfterNSAppStarted(); +#endif processPostedEvents(static_cast<QEventDispatcherMacPrivate *>(info), blockSendPostedEvents); } @@ -983,6 +1058,19 @@ void QEventDispatcherMacPrivate::postedEventsSourcePerformCallback(void *info) processPostedEvents(static_cast<QEventDispatcherMacPrivate *>(info), blockSendPostedEvents); } +#ifdef QT_MAC_USE_COCOA +void QEventDispatcherMacPrivate::cancelWaitForMoreEvents() +{ + // In case the event dispatcher is waiting for more + // events somewhere, we post a dummy event to wake it up: + QMacCocoaAutoReleasePool pool; + static const short NSAppShouldStopForQt = SHRT_MAX; + [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint + modifierFlags:0 timestamp:0. windowNumber:0 context:0 + subtype:NSAppShouldStopForQt data1:0 data2:0] atStart:NO]; +} +#endif + void QEventDispatcherMac::interrupt() { Q_D(QEventDispatcherMac); @@ -992,20 +1080,14 @@ void QEventDispatcherMac::interrupt() #ifndef QT_MAC_USE_COCOA CFRunLoopStop(mainRunLoop()); #else - QMacCocoaAutoReleasePool pool; - // In case we wait for more events inside - // processEvents (or NSApp run), post a dummy to wake it up: - static const short NSAppShouldStopForQt = SHRT_MAX; - [NSApp postEvent:[NSEvent otherEventWithType:NSApplicationDefined location:NSZeroPoint - modifierFlags:0 timestamp:0. windowNumber:0 context:0 - subtype:NSAppShouldStopForQt data1:0 data2:0] atStart:NO]; - - if (d->activeModalSessionCount() == 0) { - // We should only stop NSApp if we actually started it (and - // not some 3rd party application, e.g. if we are a plugin). - if (d->nsAppRunCalledByQt) - [NSApp stop:NSApp]; - } + // We do nothing more here than setting d->interrupt = true, and + // poke the event loop if it is sleeping. Actually stopping + // NSApp, or the current modal session, is done inside the send + // posted events callback. We do this to ensure that all current pending + // cocoa events gets delivered before we stop. Otherwise, if we now stop + // the last event loop recursion, cocoa will just drop pending posted + // events on the floor before we get a chance to reestablish a new session. + d->cancelWaitForMoreEvents(); #endif } @@ -1046,17 +1128,18 @@ QEventDispatcherMac::~QEventDispatcherMac() CFRelease(d->firstTimeObserver); } -///////////////////////////////////////////////////////////////////////////// - #ifdef QT_MAC_USE_COCOA QtMacInterruptDispatcherHelp* QtMacInterruptDispatcherHelp::instance = 0; QtMacInterruptDispatcherHelp::QtMacInterruptDispatcherHelp() : cancelled(false) { - // This is the whole point of encapsulation this code - // inside a class; we can make the code (inside destructor) - // execute on lower loop level: + // The whole point of this class is that we enable a way to interrupt + // the event dispatcher when returning back to a lower recursion level + // than where interruptLater was called. This is needed to detect if + // [NSApp run] should still be running at the recursion level it is at. + // Since the interrupt is canceled if processEvents is called before + // this object gets deleted, we also avoid interrupting unnecessary. deleteLater(); } @@ -1064,34 +1147,26 @@ QtMacInterruptDispatcherHelp::~QtMacInterruptDispatcherHelp() { if (cancelled) return; - instance = 0; - - if (QEventDispatcherMacPrivate::currentExecIsNSAppRun) { - int activeCount = QEventDispatcherMacPrivate::activeModalSessionCount(); - if (activeCount > 0) { - // The problem we now have hit: [NSApp stop] will not stop NSApp - // if a session is active; it will stop the session instead. - // So to stop NSApp, we need to temporarily stop all the - // sessions, then stop NSApp, then restart the session on top again. - // We need to do this to ensure that we're not stuck inside - // [NSApp run] when we really should be running a modal session: - QEventDispatcherMacPrivate::temporarilyStopAllModalSessions(); - } - } - // Always interrupt once more in case the modal session stack changed - // while processEvents was called manually from within the application: QEventDispatcherMac::instance()->interrupt(); } -void QtMacInterruptDispatcherHelp::interruptLater() { - if (instance) { - instance->cancelled = true; - delete instance; - } +void QtMacInterruptDispatcherHelp::cancelInterruptLater() +{ + if (!instance) + return; + instance->cancelled = true; + delete instance; + instance = 0; +} + +void QtMacInterruptDispatcherHelp::interruptLater() +{ + cancelInterruptLater(); instance = new QtMacInterruptDispatcherHelp; } #endif QT_END_NAMESPACE + diff --git a/src/gui/kernel/qeventdispatcher_mac_p.h b/src/gui/kernel/qeventdispatcher_mac_p.h index a335f16..e932532 100644 --- a/src/gui/kernel/qeventdispatcher_mac_p.h +++ b/src/gui/kernel/qeventdispatcher_mac_p.h @@ -174,13 +174,17 @@ public: static QStack<QCocoaModalSessionInfo> cocoaModalSessionStack; static bool currentExecIsNSAppRun; static bool nsAppRunCalledByQt; + static bool cleanupModalSessionsNeeded; + static bool modalSessionsTemporarilyStopped; static NSModalSession currentModalSessionCached; - static void updateChildrenWorksWhenModal(); static NSModalSession currentModalSession(); - static int activeModalSessionCount(); + static void updateChildrenWorksWhenModal(); static void temporarilyStopAllModalSessions(); static void beginModalSession(QWidget *widget); static void endModalSession(QWidget *widget); + static void cancelWaitForMoreEvents(); + static void cleanupModalSessions(); + static void ensureNSAppInitialized(); #endif MacSocketHash macSockets; @@ -190,7 +194,7 @@ public: CFRunLoopObserverRef firstTimeObserver; QAtomicInt serialNumber; int lastSerial; - bool interrupt; + static bool interrupt; private: static Boolean postedEventSourceEqualCallback(const void *info1, const void *info2); static void postedEventsSourcePerformCallback(void *info); @@ -211,6 +215,7 @@ class QtMacInterruptDispatcherHelp : public QObject public: static void interruptLater(); + static void cancelInterruptLater(); }; #endif diff --git a/src/gui/kernel/qguieventdispatcher_glib.cpp b/src/gui/kernel/qguieventdispatcher_glib.cpp index 7b30741..ac2b5f7 100644 --- a/src/gui/kernel/qguieventdispatcher_glib.cpp +++ b/src/gui/kernel/qguieventdispatcher_glib.cpp @@ -216,4 +216,9 @@ void QGuiEventDispatcherGlib::startingUp() g_source_add_poll(&d->x11EventSource->source, &d->x11EventSource->pollfd); } +void QGuiEventDispatcherGlib::flush() +{ + XFlush(X11->display); +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qguieventdispatcher_glib_p.h b/src/gui/kernel/qguieventdispatcher_glib_p.h index ff778cc..758650b 100644 --- a/src/gui/kernel/qguieventdispatcher_glib_p.h +++ b/src/gui/kernel/qguieventdispatcher_glib_p.h @@ -71,6 +71,7 @@ public: bool processEvents(QEventLoop::ProcessEventsFlags flags); void startingUp(); + void flush(); }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 2a13546..99bf971 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -861,6 +861,8 @@ QKeySequence::QKeySequence() Up to four key codes may be entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q". + \a key should be in NativeText format. + This constructor is typically used with \link QObject::tr() tr \endlink(), so that shortcut keys can be replaced in translations: @@ -877,6 +879,16 @@ QKeySequence::QKeySequence(const QString &key) } /*! + \since 4.x + Creates a key sequence from the \a key string based on \a format. +*/ +QKeySequence::QKeySequence(const QString &key, QKeySequence::SequenceFormat format) +{ + d = new QKeySequencePrivate(); + assign(key, format); +} + +/*! Constructs a key sequence with up to 4 keys \a k1, \a k2, \a k3 and \a k4. @@ -1055,9 +1067,24 @@ QKeySequence QKeySequence::mnemonic(const QString &text) contain up to four key codes, provided they are separated by a comma; for example, "Alt+X,Ctrl+S,Z". The return value is the number of key codes added. + \a keys should be in NativeText format. */ int QKeySequence::assign(const QString &ks) { + return assign(ks, NativeText); +} + +/*! + \fn int QKeySequence::assign(const QString &keys, QKeySequence::SequenceFormat format) + \since 4.x + + Adds the given \a keys to the key sequence (based on \a format). + \a keys may contain up to four key codes, provided they are + separated by a comma; for example, "Alt+X,Ctrl+S,Z". The return + value is the number of key codes added. +*/ +int QKeySequence::assign(const QString &ks, QKeySequence::SequenceFormat format) +{ QString keyseq = ks; QString part; int n = 0; @@ -1086,7 +1113,7 @@ int QKeySequence::assign(const QString &ks) } part = keyseq.left(-1 == p ? keyseq.length() : p - diff); keyseq = keyseq.right(-1 == p ? 0 : keyseq.length() - (p + 1)); - d->key[n] = decodeString(part); + d->key[n] = QKeySequencePrivate::decodeString(part, format); ++n; } return n; @@ -1557,12 +1584,7 @@ QString QKeySequence::toString(SequenceFormat format) const */ QKeySequence QKeySequence::fromString(const QString &str, SequenceFormat format) { - QStringList sl = str.split(QLatin1String(", ")); - int keys[4] = {0, 0, 0, 0}; - int total = qMin(sl.count(), 4); - for (int i = 0; i < total; ++i) - keys[i] = QKeySequencePrivate::decodeString(sl[i], format); - return QKeySequence(keys[0], keys[1], keys[2], keys[3]); + return QKeySequence(str, format); } /***************************************************************************** diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h index 1409e28..5a973e3 100644 --- a/src/gui/kernel/qkeysequence.h +++ b/src/gui/kernel/qkeysequence.h @@ -141,8 +141,14 @@ public: Quit }; + enum SequenceFormat { + NativeText, + PortableText + }; + QKeySequence(); QKeySequence(const QString &key); + QKeySequence(const QString &key, SequenceFormat format); QKeySequence(int k1, int k2 = 0, int k3 = 0, int k4 = 0); QKeySequence(const QKeySequence &ks); QKeySequence(StandardKey key); @@ -160,11 +166,6 @@ public: #endif }; - enum SequenceFormat { - NativeText, - PortableText - }; - QString toString(SequenceFormat format = PortableText) const; static QKeySequence fromString(const QString &str, SequenceFormat format = PortableText); @@ -194,6 +195,7 @@ private: static int decodeString(const QString &ks); static QString encodeString(int key); int assign(const QString &str); + int assign(const QString &str, SequenceFormat format); void setKey(int key, int index); QKeySequencePrivate *d; diff --git a/src/gui/kernel/qmime_mac.cpp b/src/gui/kernel/qmime_mac.cpp index 071f80d..c6fd184 100644 --- a/src/gui/kernel/qmime_mac.cpp +++ b/src/gui/kernel/qmime_mac.cpp @@ -154,6 +154,7 @@ CFStringRef qt_mac_mime_typeUTI = CFSTR("com.pasteboard.trolltech.marker"); \i public.url - converts to "text/uri-list" \i public.file-url - converts to "text/uri-list" \i public.tiff - converts to "application/x-qt-image" + \i public.vcard - converts to "text/plain" \i com.apple.traditional-mac-plain-text - converts to "text/plain" \i com.apple.pict - converts to "application/x-qt-image" \endlist @@ -909,6 +910,61 @@ QList<QByteArray> QMacPasteboardMimeUrl::convertFromMime(const QString &mime, QV return ret; } +class QMacPasteboardMimeVCard : public QMacPasteboardMime +{ +public: + QMacPasteboardMimeVCard() : QMacPasteboardMime(MIME_ALL){ } + QString convertorName(); + + QString flavorFor(const QString &mime); + QString mimeFor(QString flav); + bool canConvert(const QString &mime, QString flav); + QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav); + QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav); +}; + +QString QMacPasteboardMimeVCard::convertorName() +{ + return QString("VCard"); +} + +bool QMacPasteboardMimeVCard::canConvert(const QString &mime, QString flav) +{ + return mimeFor(flav) == mime; +} + +QString QMacPasteboardMimeVCard::flavorFor(const QString &mime) +{ + if(mime.startsWith(QLatin1String("text/plain"))) + return QLatin1String("public.vcard"); + return QString(); +} + +QString QMacPasteboardMimeVCard::mimeFor(QString flav) +{ + if (flav == QLatin1String("public.vcard")) + return QLatin1String("text/plain"); + return QString(); +} + +QVariant QMacPasteboardMimeVCard::convertToMime(const QString &mime, QList<QByteArray> data, QString) +{ + QByteArray cards; + if (mime == QLatin1String("text/plain")) { + for (int i=0; i<data.size(); ++i) + cards += data[i]; + } + return QVariant(cards); +} + +QList<QByteArray> QMacPasteboardMimeVCard::convertFromMime(const QString &mime, QVariant data, QString) +{ + QList<QByteArray> ret; + if (mime == QLatin1String("text/plain")) + ret.append(data.toString().toUtf8()); + return ret; +} + #ifdef QT3_SUPPORT class QMacPasteboardMimeQt3Any : public QMacPasteboardMime { private: @@ -1116,6 +1172,7 @@ void QMacPasteboardMime::initialize() new QMacPasteboardMimeFileUri; new QMacPasteboardMimeUrl; new QMacPasteboardMimeTypeName; + new QMacPasteboardMimeVCard; //make sure our "non-standard" types are always last! --Sam new QMacPasteboardMimeAny; #ifdef QT3_SUPPORT diff --git a/src/gui/kernel/qnsthemeframe_mac_p.h b/src/gui/kernel/qnsthemeframe_mac_p.h index 77a6963..d061b1b 100644 --- a/src/gui/kernel/qnsthemeframe_mac_p.h +++ b/src/gui/kernel/qnsthemeframe_mac_p.h @@ -157,7 +157,7 @@ - (void)resetCursorRects; - (char)shouldBeTreatedAsInkEvent:fp8; - (char)_shouldBeTreatedAsInkEventInInactiveWindow:fp8; -- hitTest:(struct _NSPoint)fp8; +//- hitTest:(struct _NSPoint)fp8; // collides with hittest in qcocoasharedwindowmethods_mac_p.h - (NSRect)_leftGroupRect; - (NSRect)_rightGroupRect; - (void)_updateWidgets; diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp index 1832b85..df2830b 100644 --- a/src/gui/kernel/qsound_s60.cpp +++ b/src/gui/kernel/qsound_s60.cpp @@ -51,7 +51,7 @@ #include <private/qcore_symbian_p.h> #include <e32std.h> -#include <MdaAudioSamplePlayer.h> +#include <mdaaudiosampleplayer.h> QT_BEGIN_NAMESPACE diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 65c04e5..4e51cf4 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1281,6 +1281,21 @@ void qt_cocoaChangeOverrideCursor(const QCursor &cursor) } #endif +@implementation DebugNSApplication { +} +- (void)sendEvent:(NSEvent *)event +{ + NSLog(@"NSAppDebug: sendEvent: %@", event); + return [super sendEvent:event]; +} + +- (BOOL)sendAction:(SEL)anAction to:(id)aTarget from:(id)sender +{ + NSLog(@"NSAppDebug: sendAction: %s to %@ from %@", anAction, aTarget, sender); + return [super sendAction:anAction to:aTarget from:sender]; +} +@end + QMacCocoaAutoReleasePool::QMacCocoaAutoReleasePool() { #ifndef QT_MAC_USE_COCOA diff --git a/src/gui/kernel/qt_cocoa_helpers_mac_p.h b/src/gui/kernel/qt_cocoa_helpers_mac_p.h index 6f0c4ce..ace8255 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac_p.h +++ b/src/gui/kernel/qt_cocoa_helpers_mac_p.h @@ -181,6 +181,10 @@ inline QString qt_mac_NSStringToQString(const NSString *nsstr) inline NSString *qt_mac_QStringToNSString(const QString &qstr) { return [reinterpret_cast<const NSString *>(QCFString::toCFStringRef(qstr)) autorelease]; } + +@interface DebugNSApplication : NSApplication {} +@end + #endif QT_END_NAMESPACE diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index d110084..b2ce754 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -331,7 +331,7 @@ struct QXdndDropTransaction class QMimeData; struct QX11Data; -extern QX11Data *qt_x11Data; +extern Q_GUI_EXPORT QX11Data *qt_x11Data; enum DesktopEnvironment { DE_UNKNOWN, diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index c072d9d..2e951b6 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -4876,90 +4876,7 @@ void QWidget::unsetCursor() void QWidget::render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, RenderFlags renderFlags) { - Q_D(QWidget); - if (!target) { - qWarning("QWidget::render: null pointer to paint device"); - return; - } - - const bool inRenderWithPainter = d->extra && d->extra->inRenderWithPainter; - QRegion paintRegion = !inRenderWithPainter ? d->prepareToRender(sourceRegion, renderFlags) - : sourceRegion; - if (paintRegion.isEmpty()) - return; - -#ifndef Q_WS_MAC - QPainter *oldSharedPainter = inRenderWithPainter ? d->sharedPainter() : 0; - - // Use the target's shared painter if set (typically set when doing - // "other->render(widget);" in the widget's paintEvent. - if (target->devType() == QInternal::Widget) { - QWidgetPrivate *targetPrivate = static_cast<QWidget *>(target)->d_func(); - if (targetPrivate->extra && targetPrivate->extra->inRenderWithPainter) { - QPainter *targetPainter = targetPrivate->sharedPainter(); - if (targetPainter && targetPainter->isActive()) - d->setSharedPainter(targetPainter); - } - } -#endif - - // Use the target's redirected device if set and adjust offset and paint - // region accordingly. This is typically the case when people call render - // from the paintEvent. - QPoint offset = targetOffset; - offset -= paintRegion.boundingRect().topLeft(); - QPoint redirectionOffset; - QPaintDevice *redirected = 0; - - if (target->devType() == QInternal::Widget) - redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset); - if (!redirected) - redirected = QPainter::redirected(target, &redirectionOffset); - - if (redirected) { - target = redirected; - offset -= redirectionOffset; - } - - if (!inRenderWithPainter) { // Clip handled by shared painter (in qpainter.cpp). - if (QPaintEngine *targetEngine = target->paintEngine()) { - const QRegion targetSystemClip = targetEngine->systemClip(); - if (!targetSystemClip.isEmpty()) - paintRegion &= targetSystemClip.translated(-offset); - } - } - - // Set backingstore flags. - int flags = QWidgetPrivate::DrawPaintOnScreen | QWidgetPrivate::DrawInvisible; - if (renderFlags & DrawWindowBackground) - flags |= QWidgetPrivate::DrawAsRoot; - - if (renderFlags & DrawChildren) - flags |= QWidgetPrivate::DrawRecursive; - else - flags |= QWidgetPrivate::DontSubtractOpaqueChildren; - -#ifdef Q_WS_QWS - flags |= QWidgetPrivate::DontSetCompositionMode; -#endif - - if (target->devType() == QInternal::Printer) { - QPainter p(target); - d->render_helper(&p, targetOffset, paintRegion, renderFlags); - return; - } - -#ifndef Q_WS_MAC - // Render via backingstore. - d->drawWidget(target, paintRegion, offset, flags, d->sharedPainter()); - - // Restore shared painter. - if (oldSharedPainter) - d->setSharedPainter(oldSharedPainter); -#else - // Render via backingstore (no shared painter). - d->drawWidget(target, paintRegion, offset, flags, 0); -#endif + d_func()->render(target, targetOffset, sourceRegion, renderFlags, false); } /*! @@ -5405,6 +5322,97 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP } } +void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, + const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, + bool readyToRender) +{ + Q_Q(QWidget); + if (!target) { + qWarning("QWidget::render: null pointer to paint device"); + return; + } + + const bool inRenderWithPainter = extra && extra->inRenderWithPainter; + QRegion paintRegion = !inRenderWithPainter && !readyToRender + ? prepareToRender(sourceRegion, renderFlags) + : sourceRegion; + if (paintRegion.isEmpty()) + return; + +#ifndef Q_WS_MAC + QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0; + + // Use the target's shared painter if set (typically set when doing + // "other->render(widget);" in the widget's paintEvent. + if (target->devType() == QInternal::Widget) { + QWidgetPrivate *targetPrivate = static_cast<QWidget *>(target)->d_func(); + if (targetPrivate->extra && targetPrivate->extra->inRenderWithPainter) { + QPainter *targetPainter = targetPrivate->sharedPainter(); + if (targetPainter && targetPainter->isActive()) + setSharedPainter(targetPainter); + } + } +#endif + + // Use the target's redirected device if set and adjust offset and paint + // region accordingly. This is typically the case when people call render + // from the paintEvent. + QPoint offset = targetOffset; + offset -= paintRegion.boundingRect().topLeft(); + QPoint redirectionOffset; + QPaintDevice *redirected = 0; + + if (target->devType() == QInternal::Widget) + redirected = static_cast<QWidget *>(target)->d_func()->redirected(&redirectionOffset); + if (!redirected) + redirected = QPainter::redirected(target, &redirectionOffset); + + if (redirected) { + target = redirected; + offset -= redirectionOffset; + } + + if (!inRenderWithPainter) { // Clip handled by shared painter (in qpainter.cpp). + if (QPaintEngine *targetEngine = target->paintEngine()) { + const QRegion targetSystemClip = targetEngine->systemClip(); + if (!targetSystemClip.isEmpty()) + paintRegion &= targetSystemClip.translated(-offset); + } + } + + // Set backingstore flags. + int flags = DrawPaintOnScreen | DrawInvisible; + if (renderFlags & QWidget::DrawWindowBackground) + flags |= DrawAsRoot; + + if (renderFlags & QWidget::DrawChildren) + flags |= DrawRecursive; + else + flags |= DontSubtractOpaqueChildren; + +#ifdef Q_WS_QWS + flags |= DontSetCompositionMode; +#endif + + if (target->devType() == QInternal::Printer) { + QPainter p(target); + render_helper(&p, targetOffset, paintRegion, renderFlags); + return; + } + +#ifndef Q_WS_MAC + // Render via backingstore. + drawWidget(target, paintRegion, offset, flags, sharedPainter()); + + // Restore shared painter. + if (oldSharedPainter) + setSharedPainter(oldSharedPainter); +#else + // Render via backingstore (no shared painter). + drawWidget(target, paintRegion, offset, flags, 0); +#endif +} + void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectList& siblings, int index, const QRegion &rgn, const QPoint &offset, int flags #ifdef Q_BACKINGSTORE_SUBSURFACES @@ -7592,23 +7600,21 @@ bool QWidgetPrivate::close_helper(CloseMode mode) if (isMain) QApplication::quit(); #endif - // Attempt to close the application only if this widget has the - // WA_QuitOnClose flag set set and has a non-visible parent - quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible() || parentWidget->testAttribute(Qt::WA_DontShowOnScreen)); + // Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent + quitOnClose = quitOnClose && (parentWidget.isNull() || !parentWidget->isVisible()); if (quitOnClose) { - // If there is no non-withdrawn primary window left (except - // the ones without QuitOnClose or with WA_DontShowOnScreen), - // we emit the lastWindowClosed signal + /* if there is no non-withdrawn primary window left (except + the ones without QuitOnClose), we emit the lastWindowClosed + signal */ QWidgetList list = QApplication::topLevelWidgets(); bool lastWindowClosed = true; for (int i = 0; i < list.size(); ++i) { QWidget *w = list.at(i); - if ((w->isVisible() && !w->testAttribute(Qt::WA_DontShowOnScreen)) - && !w->parentWidget() && w->testAttribute(Qt::WA_QuitOnClose)) { - lastWindowClosed = false; - break; - } + if (!w->isVisible() || w->parentWidget() || !w->testAttribute(Qt::WA_QuitOnClose)) + continue; + lastWindowClosed = false; + break; } if (lastWindowClosed) QApplicationPrivate::emitLastWindowClosed(); diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 9e7517f..a5633d3 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1917,13 +1917,15 @@ void QWidgetPrivate::determineWindowClass() wclass = kDocumentWindowClass; else if(popup || (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5 && type == Qt::SplashScreen)) wclass = kModalWindowClass; - else if(q->testAttribute(Qt::WA_ShowModal) || type == Qt::Dialog) + else if(type == Qt::Dialog) wclass = kMovableModalWindowClass; else if(type == Qt::ToolTip) wclass = kHelpWindowClass; else if(type == Qt::Tool || (QSysInfo::MacintoshVersion < QSysInfo::MV_10_5 && type == Qt::SplashScreen)) wclass = kFloatingWindowClass; + else if(q->testAttribute(Qt::WA_ShowModal)) + wclass = kMovableModalWindowClass; else wclass = kDocumentWindowClass; @@ -2027,8 +2029,6 @@ void QWidgetPrivate::determineWindowClass() for(int i = 0; tmp_wattr && known_attribs[i].name; i++) { if((tmp_wattr & known_attribs[i].tag) == known_attribs[i].tag) { tmp_wattr ^= known_attribs[i].tag; - qDebug("Qt: internal: * %s %s", known_attribs[i].name, - (GetAvailableWindowAttributes(wclass) & known_attribs[i].tag) ? "" : "(*)"); } } if(tmp_wattr) @@ -2223,6 +2223,41 @@ void QWidgetPrivate::finishCreateWindow_sys_Carbon(OSWindowRef windowRef) applyMaxAndMinSizeOnWindow(); } #else // QT_MAC_USE_COCOA + +void QWidgetPrivate::setWindowLevel() +{ + Q_Q(QWidget); + const QWidget * const windowParent = q->window()->parentWidget(); + const QWidget * const primaryWindow = windowParent ? windowParent->window() : 0; + NSInteger winLevel = -1; + + if (q->windowType() == Qt::Popup) { + winLevel = NSPopUpMenuWindowLevel; + // Popup should be in at least the same level as its parent. + if (primaryWindow) { + OSWindowRef parentRef = qt_mac_window_for(primaryWindow); + winLevel = qMax([parentRef level], winLevel); + } + } else if (q->windowType() == Qt::Tool) { + winLevel = NSFloatingWindowLevel; + } else if (q->windowType() == Qt::Dialog) { + // Correct modality level (NSModalPanelWindowLevel) will be + // set by cocoa when creating a modal session later. + winLevel = NSNormalWindowLevel; + } + + // StayOnTop window should appear above Tool windows. + if (data.window_flags & Qt::WindowStaysOnTopHint) + winLevel = NSPopUpMenuWindowLevel; + // Tooltips should appear above StayOnTop windows. + if (q->windowType() == Qt::ToolTip) + winLevel = NSScreenSaverWindowLevel; + // All other types are Normal level. + if (winLevel == -1) + winLevel = NSNormalWindowLevel; + [qt_mac_window_for(q) setLevel:winLevel]; +} + void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWindowRef) { Q_Q(QWidget); @@ -2295,6 +2330,10 @@ void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWin q->setAttribute(Qt::WA_WState_WindowOpacitySet, false); } + if (qApp->overrideCursor()) + [windowRef disableCursorRects]; + + setWindowLevel(); macUpdateHideOnSuspend(); macUpdateOpaqueSizeGrip(); macUpdateIgnoreMouseEvents(); @@ -2725,6 +2764,35 @@ void QWidgetPrivate::transferChildren() } } +#ifdef QT_MAC_USE_COCOA +void QWidgetPrivate::setSubWindowStacking(bool set) +{ + Q_Q(QWidget); + if (!q->isWindow() || !q->testAttribute(Qt::WA_WState_Created)) + return; + + if (QWidget *parent = q->parentWidget()) { + if (parent->testAttribute(Qt::WA_WState_Created)) { + if (set) + [qt_mac_window_for(parent) addChildWindow:qt_mac_window_for(q) ordered:NSWindowAbove]; + else + [qt_mac_window_for(parent) removeChildWindow:qt_mac_window_for(q)]; + } + } + + QList<QWidget *> widgets = q->findChildren<QWidget *>(); + for (int i=0; i<widgets.size(); ++i) { + QWidget *child = widgets.at(i); + if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created)) { + if (set) + [qt_mac_window_for(q) addChildWindow:qt_mac_window_for(child) ordered:NSWindowAbove]; + else + [qt_mac_window_for(q) removeChildWindow:qt_mac_window_for(child)]; + } + } +} +#endif + void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) { Q_Q(QWidget); @@ -2879,7 +2947,6 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) current = current->parentWidget(); } } - invalidateBuffer(q->rect()); qt_event_request_window_change(q); } @@ -3185,10 +3252,10 @@ void QWidget::activateWindow() || windowActive) { #ifndef QT_MAC_USE_COCOA ActivateWindow(win, true); + qApp->setActiveWindow(tlw); #else [win makeKeyWindow]; #endif - qApp->setActiveWindow(tlw); } else if(!isMinimized()) { #ifndef QT_MAC_USE_COCOA SelectWindow(win); @@ -3341,13 +3408,23 @@ void QWidgetPrivate::show_sys() #else // sync the opacity value back (in case of a fade). [window setAlphaValue:q->windowOpacity()]; - [window makeKeyAndOrderFront:window]; - - // If this window is app modal, we need to start spinning - // a modal session for it. Interrupting - // the event dispatcher will make this happend: - if (data.window_modality == Qt::ApplicationModal) - QEventDispatcherMac::instance()->interrupt(); + setSubWindowStacking(true); + + QWidget *top = 0; + if (QApplicationPrivate::tryModalHelper(q, &top)) { + [window makeKeyAndOrderFront:window]; + // If this window is app modal, we need to start spinning + // a modal session for it. Interrupting + // the event dispatcher will make this happend: + if (data.window_modality == Qt::ApplicationModal) + QEventDispatcherMac::instance()->interrupt(); + } else { + // The window is modally shaddowed, so we need to make + // sure that we don't pop in front of the modal window: + [window orderFront:window]; + if (NSWindow *modalWin = qt_mac_window_for(top)) + [modalWin orderFront:window]; + } #endif if (q->windowType() == Qt::Popup) { if (q->focusWidget()) @@ -3366,8 +3443,6 @@ void QWidgetPrivate::show_sys() } else if (!q->testAttribute(Qt::WA_ShowWithoutActivating)) { #ifndef QT_MAC_USE_COCOA qt_event_request_activate(q); -#else - [qt_mac_window_for(q) makeKeyWindow]; #endif } } else if(topData()->embedded || !q->parentWidget() || q->parentWidget()->isVisible()) { @@ -3410,6 +3485,9 @@ void QWidgetPrivate::hide_sys() QMacCocoaAutoReleasePool pool; if(q->isWindow()) { +#ifdef QT_MAC_USE_COCOA + setSubWindowStacking(false); +#endif OSWindowRef window = qt_mac_window_for(q); if(qt_mac_is_macsheet(q)) { #ifndef QT_MAC_USE_COCOA @@ -3475,12 +3553,15 @@ void QWidgetPrivate::hide_sys() } #endif } - if(q->isActiveWindow() && !(q->windowType() == Qt::Popup)) { +#ifndef QT_MAC_USE_COCOA + // If the window we now hide was the active window, we need + // to find, and activate another window on screen. NB: Cocoa takes care of this + // logic for us (and distinquishes between main windows and key windows) + if (q->isActiveWindow() && !(q->windowType() == Qt::Popup)) { QWidget *w = 0; if(q->parentWidget()) w = q->parentWidget()->window(); if(!w || (!w->isVisible() && !w->isMinimized())) { -#ifndef QT_MAC_USE_COCOA for (WindowPtr wp = GetFrontWindowOfClass(kMovableModalWindowClass, true); wp; wp = GetNextWindowOfClass(wp, kMovableModalWindowClass, true)) { if((w = qt_mac_find_window(wp))) @@ -3500,24 +3581,12 @@ void QWidgetPrivate::hide_sys() break; } } -#else - NSArray *windows = [NSApp windows]; - NSUInteger totalWindows = [windows count]; - for (NSUInteger i = 0; i < totalWindows; ++i) { - OSWindowRef wp = [windows objectAtIndex:i]; - if ((w = qt_mac_find_window(wp))) - break; - } -#endif } if(w && w->isVisible() && !w->isMinimized()) { -#ifndef QT_MAC_USE_COCOA - qt_event_request_activate(w); -#else - [qt_mac_window_for(w) makeKeyWindow]; -#endif + qt_event_request_activate(w); } } +#endif } else { invalidateBuffer(q->rect()); #ifndef QT_MAC_USE_COCOA @@ -4605,9 +4674,12 @@ void QWidgetPrivate::registerDropSite(bool on) #ifndef QT_MAC_USE_COCOA SetControlDragTrackingEnabled(qt_mac_nativeview_for(q), on); #else - NSView *view = qt_mac_nativeview_for(q); - if (on && [view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { - [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes]; + NSWindow *win = qt_mac_window_for(q); + if (on) { + if ([win isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaWindow) class]]) + [static_cast<QT_MANGLE_NAMESPACE(QCocoaWindow) *>(win) registerDragTypes]; + else if ([win isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaPanel) class]]) + [static_cast<QT_MANGLE_NAMESPACE(QCocoaPanel) *>(win) registerDragTypes]; } #endif } @@ -4761,7 +4833,7 @@ void QWidgetPrivate::setModal_sys() bool alreadySheet = [windowRef styleMask] & NSDocModalWindowMask; if (windowParent && q->windowModality() == Qt::WindowModal){ - // Window should be window-modal, which implies a sheet. + // INVARIANT: Window should be window-modal (which implies a sheet). if (!alreadySheet) { // NB: the following call will call setModal_sys recursivly: recreateMacWindow(); @@ -4778,47 +4850,19 @@ void QWidgetPrivate::setModal_sys() [static_cast<NSPanel *>(windowRef) setWorksWhenModal:YES]; } } else { - // Window shold not be window-modal, and as such, not a sheet. + // INVARIANT: Window shold _not_ be window-modal (and as such, not a sheet). if (alreadySheet){ // NB: the following call will call setModal_sys recursivly: recreateMacWindow(); windowRef = qt_mac_window_for(q); } - if (q->windowModality() == Qt::ApplicationModal) { - [windowRef setLevel:NSModalPanelWindowLevel]; - } else if (primaryWindow && primaryWindow->windowModality() == Qt::ApplicationModal) { - // INVARIANT: Our window is a dialog that has a dialog parent that is - // application modal, or . This means that q is supposed to be on top of this - // dialog and not be modally shaddowed: - [windowRef setLevel:NSModalPanelWindowLevel]; + if (q->windowModality() == Qt::NonModal + && primaryWindow && primaryWindow->windowModality() == Qt::ApplicationModal) { + // INVARIANT: Our window has a parent that is application modal. + // This means that q is supposed to be on top of this window and + // not be modally shaddowed: if ([windowRef isKindOfClass:[NSPanel class]]) [static_cast<NSPanel *>(windowRef) setWorksWhenModal:YES]; - } else { - // INVARIANT: q should not be modal. - NSInteger winLevel = -1; - if (q->windowType() == Qt::Popup) { - winLevel = NSPopUpMenuWindowLevel; - // Popup should be in at least the same level as its parent. - if (primaryWindow) { - OSWindowRef parentRef = qt_mac_window_for(primaryWindow); - winLevel = qMax([parentRef level], winLevel); - } - } else if (q->windowType() == Qt::Tool) { - winLevel = NSFloatingWindowLevel; - } else if (q->windowType() == Qt::Dialog) { - winLevel = NSModalPanelWindowLevel; - } - - // StayOnTop window should appear above Tool windows. - if (data.window_flags & Qt::WindowStaysOnTopHint) - winLevel = NSPopUpMenuWindowLevel; - // Tooltips should appear above StayOnTop windows. - if (q->windowType() == Qt::ToolTip) - winLevel = NSScreenSaverWindowLevel; - // All other types are Normal level. - if (winLevel == -1) - winLevel = NSNormalWindowLevel; - [windowRef setLevel:winLevel]; } } diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index b1eb3c3..ff8f276 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -158,6 +158,7 @@ struct QTLWExtra { quint32 newCounterValueLo; #endif #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN + uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered. HICON winIconBig; // internal big Windows icon HICON winIconSmall; // internal small Windows icon #elif defined(Q_WS_MAC) // <--------------------------------------------------------- MAC @@ -384,6 +385,8 @@ public: QRegion prepareToRender(const QRegion ®ion, QWidget::RenderFlags renderFlags); void render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags); + void render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, + QWidget::RenderFlags renderFlags, bool readyToRender); void drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter = 0, QWidgetBackingStore *backingStore = 0); @@ -760,6 +763,8 @@ public: void initWindowPtr(); void finishCreateWindow_sys_Carbon(OSWindowRef windowRef); #else + void setSubWindowStacking(bool set); + void setWindowLevel(); void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef); void syncCocoaMask(); void finishCocoaMaskSetup(); diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 10522ed..6a36293 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1094,6 +1094,21 @@ void QWidgetPrivate::show_sys() return; } + if (data.window_flags & Qt::Window) { + QTLWExtra *extra = topData(); + if (!extra->hotkeyRegistered) { + // Try to set the hotkey using information from STARTUPINFO + STARTUPINFO startupInfo; + GetStartupInfo(&startupInfo); + // If STARTF_USEHOTKEY is set, hStdInput is the virtual keycode + if (startupInfo.dwFlags & 0x00000200) { + WPARAM hotKey = (WPARAM)startupInfo.hStdInput; + SendMessage(data.winid, WM_SETHOTKEY, hotKey, 0); + } + extra->hotkeyRegistered = 1; + } + } + int sm = SW_SHOWNORMAL; bool fakedMaximize = false; if (q->isWindow()) { @@ -1141,6 +1156,8 @@ void QWidgetPrivate::show_sys() data.window_state |= Qt::WindowMinimized; if (IsZoomed(q->internalWinId())) data.window_state |= Qt::WindowMaximized; + if (q->windowType() == Qt::Popup) + q->activateWindow(); } winSetupGestures(); @@ -1687,6 +1704,7 @@ void QWidgetPrivate::deleteSysExtra() void QWidgetPrivate::createTLSysExtra() { + extra->topextra->hotkeyRegistered = 0; extra->topextra->savedFlags = 0; extra->topextra->winIconBig = 0; extra->topextra->winIconSmall = 0; diff --git a/src/gui/mac/qt_menu.nib/classes.nib b/src/gui/mac/qt_menu.nib/classes.nib index fed50a3..0031e0e 100644 --- a/src/gui/mac/qt_menu.nib/classes.nib +++ b/src/gui/mac/qt_menu.nib/classes.nib @@ -5,14 +5,6 @@ <key>IBClasses</key> <array> <dict> - <key>CLASS</key> - <string>FirstResponder</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>SUPERCLASS</key> - <string>NSObject</string> - </dict> - <dict> <key>ACTIONS</key> <dict> <key>hide</key> @@ -52,6 +44,14 @@ <key>SUPERCLASS</key> <string>NSResponder</string> </dict> + <dict> + <key>CLASS</key> + <string>FirstResponder</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSObject</string> + </dict> </array> <key>IBVersion</key> <string>1</string> diff --git a/src/gui/mac/qt_menu.nib/info.nib b/src/gui/mac/qt_menu.nib/info.nib index 768cb8b..02e5cca 100644 --- a/src/gui/mac/qt_menu.nib/info.nib +++ b/src/gui/mac/qt_menu.nib/info.nib @@ -3,7 +3,7 @@ <plist version="1.0"> <dict> <key>IBFramework Version</key> - <string>670</string> + <string>672</string> <key>IBOldestOS</key> <integer>5</integer> <key>IBOpenObjects</key> @@ -11,7 +11,7 @@ <integer>57</integer> </array> <key>IBSystem Version</key> - <string>9G55</string> + <string>9L31a</string> <key>targetFramework</key> <string>IBCocoaFramework</string> </dict> diff --git a/src/gui/mac/qt_menu.nib/keyedobjects.nib b/src/gui/mac/qt_menu.nib/keyedobjects.nib Binary files differindex 18a6648..3edb0ed 100644 --- a/src/gui/mac/qt_menu.nib/keyedobjects.nib +++ b/src/gui/mac/qt_menu.nib/keyedobjects.nib diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h index f9902d7..0671fa8 100644 --- a/src/gui/math3d/qmatrix4x4.h +++ b/src/gui/math3d/qmatrix4x4.h @@ -208,6 +208,8 @@ private: friend class QGraphicsRotation; }; +Q_DECLARE_TYPEINFO(QMatrix4x4, Q_MOVABLE_TYPE); + inline QMatrix4x4::QMatrix4x4 (qreal m11, qreal m12, qreal m13, qreal m14, qreal m21, qreal m22, qreal m23, qreal m24, diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index a446f28..16aa5d0 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -136,6 +136,8 @@ private: qreal wp, xp, yp, zp; }; +Q_DECLARE_TYPEINFO(QQuaternion, Q_MOVABLE_TYPE); + inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {} inline QQuaternion::QQuaternion(qreal aScalar, qreal xpos, qreal ypos, qreal zpos) : wp(aScalar), xp(xpos), yp(ypos), zp(zpos) {} diff --git a/src/gui/math3d/qvector2d.h b/src/gui/math3d/qvector2d.h index d76f35a..c92c5e0 100644 --- a/src/gui/math3d/qvector2d.h +++ b/src/gui/math3d/qvector2d.h @@ -126,6 +126,8 @@ private: friend class QVector4D; }; +Q_DECLARE_TYPEINFO(QVector2D, Q_MOVABLE_TYPE); + inline QVector2D::QVector2D() : xp(0.0f), yp(0.0f) {} inline QVector2D::QVector2D(float xpos, float ypos, int) : xp(xpos), yp(ypos) {} diff --git a/src/gui/math3d/qvector3d.h b/src/gui/math3d/qvector3d.h index 80c7152..2fdd1d3 100644 --- a/src/gui/math3d/qvector3d.h +++ b/src/gui/math3d/qvector3d.h @@ -141,6 +141,8 @@ private: #endif }; +Q_DECLARE_TYPEINFO(QVector3D, Q_MOVABLE_TYPE); + inline QVector3D::QVector3D() : xp(0.0f), yp(0.0f), zp(0.0f) {} inline QVector3D::QVector3D(qreal xpos, qreal ypos, qreal zpos) : xp(xpos), yp(ypos), zp(zpos) {} diff --git a/src/gui/math3d/qvector4d.h b/src/gui/math3d/qvector4d.h index 4af2961..a383fbb 100644 --- a/src/gui/math3d/qvector4d.h +++ b/src/gui/math3d/qvector4d.h @@ -138,6 +138,8 @@ private: #endif }; +Q_DECLARE_TYPEINFO(QVector4D, Q_MOVABLE_TYPE); + inline QVector4D::QVector4D() : xp(0.0f), yp(0.0f), zp(0.0f), wp(0.0f) {} inline QVector4D::QVector4D(qreal xpos, qreal ypos, qreal zpos, qreal wpos) : xp(xpos), yp(ypos), zp(zpos), wp(wpos) {} diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index 1a83b1d..a82d0f9 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -912,7 +912,7 @@ void QBrush::setTransform(const QTransform &matrix) otherwise returns false. Two brushes are different if they have different styles, colors or - pixmaps. + transforms or different pixmaps or gradients depending on the style. \sa operator==() */ @@ -924,7 +924,7 @@ void QBrush::setTransform(const QTransform &matrix) otherwise returns false. Two brushes are equal if they have equal styles, colors and - pixmaps. + transforms and equal pixmaps or gradients depending on the style. \sa operator!=() */ @@ -933,26 +933,26 @@ bool QBrush::operator==(const QBrush &b) const { if (b.d == d) return true; - if (b.d->style == d->style && b.d->color == d->color) { - switch (d->style) { - case Qt::TexturePattern: { - QPixmap &us = (static_cast<QTexturedBrushData *>(d.data()))->pixmap(); - QPixmap &them = (static_cast<QTexturedBrushData *>(b.d.data()))->pixmap(); + if (b.d->style != d->style || b.d->color != d->color || b.d->transform != d->transform) + return false; + switch (d->style) { + case Qt::TexturePattern: + { + const QPixmap &us = (static_cast<QTexturedBrushData *>(d.data()))->pixmap(); + const QPixmap &them = (static_cast<QTexturedBrushData *>(b.d.data()))->pixmap(); return ((us.isNull() && them.isNull()) || us.cacheKey() == them.cacheKey()); } - case Qt::LinearGradientPattern: - case Qt::RadialGradientPattern: - case Qt::ConicalGradientPattern: - { - QGradientBrushData *d1 = static_cast<QGradientBrushData *>(d.data()); - QGradientBrushData *d2 = static_cast<QGradientBrushData *>(b.d.data()); - return d1->gradient == d2->gradient; - } - default: - return true; + case Qt::LinearGradientPattern: + case Qt::RadialGradientPattern: + case Qt::ConicalGradientPattern: + { + const QGradientBrushData *d1 = static_cast<QGradientBrushData *>(d.data()); + const QGradientBrushData *d2 = static_cast<QGradientBrushData *>(b.d.data()); + return d1->gradient == d2->gradient; } + default: + return true; } - return false; } /*! diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h index a7834ea..bc5f1ef 100644 --- a/src/gui/painting/qdatabuffer_p.h +++ b/src/gui/painting/qdatabuffer_p.h @@ -81,7 +81,9 @@ public: inline Type &at(int i) { Q_ASSERT(i >= 0 && i < siz); return buffer[i]; } inline const Type &at(int i) const { Q_ASSERT(i >= 0 && i < siz); return buffer[i]; } + inline Type &last() { Q_ASSERT(!isEmpty()); return buffer[siz-1]; } inline const Type &last() const { Q_ASSERT(!isEmpty()); return buffer[siz-1]; } + inline Type &first() { Q_ASSERT(!isEmpty()); return buffer[0]; } inline const Type &first() const { Q_ASSERT(!isEmpty()); return buffer[0]; } inline void add(const Type &t) { @@ -90,6 +92,11 @@ public: ++siz; } + inline void pop_back() { + Q_ASSERT(siz > 0); + --siz; + } + inline void resize(int size) { reserve(size); siz = size; diff --git a/src/gui/painting/qemulationpaintengine.cpp b/src/gui/painting/qemulationpaintengine.cpp index f2f0c73..fd42736 100644 --- a/src/gui/painting/qemulationpaintengine.cpp +++ b/src/gui/painting/qemulationpaintengine.cpp @@ -172,6 +172,36 @@ void QEmulationPaintEngine::drawTextItem(const QPointF &p, const QTextItem &text QRectF rect(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal()); fillBGRect(rect); } + + QPainterState *s = state(); + Qt::BrushStyle style = qbrush_style(s->pen.brush()); + if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) + { + QPen savedPen = s->pen; + QGradient g = *s->pen.brush().gradient(); + + if (g.coordinateMode() > QGradient::LogicalMode) { + QTransform mat = s->pen.brush().transform(); + if (g.coordinateMode() == QGradient::StretchToDeviceMode) { + mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height()); + } else if (g.coordinateMode() == QGradient::ObjectBoundingMode) { + const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem); + QRectF r(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal()); + mat.translate(r.x(), r.y()); + mat.scale(r.width(), r.height()); + } + g.setCoordinateMode(QGradient::LogicalMode); + QBrush brush(g); + brush.setTransform(mat); + s->pen.setBrush(brush); + penChanged(); + real_engine->drawTextItem(p, textItem); + s->pen = savedPen; + penChanged(); + return; + } + } + real_engine->drawTextItem(p, textItem); } diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index fba3595..f78de34 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1257,6 +1257,8 @@ Qt::FillRule QPainterPath::fillRule() const void QPainterPath::setFillRule(Qt::FillRule fillRule) { ensureData(); + if (d_func()->fillRule == fillRule) + return; detach(); d_func()->fillRule = fillRule; diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp index 70f152d..63ad94e 100644 --- a/src/gui/statemachine/qguistatemachine.cpp +++ b/src/gui/statemachine/qguistatemachine.cpp @@ -469,12 +469,6 @@ static QEvent *cloneEvent(QEvent *e) case QEvent::UngrabKeyboard: return new QEvent(*e); -#ifdef QT_MAC_USE_COCOA - case QEvent::CocoaRequestModal: - Q_ASSERT_X(false, "cloneEvent()", "not implemented"); - break; -#endif - case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index b1924e7..7f9b058 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -5662,10 +5662,16 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons OSType iconType = 0; switch (standardIcon) { case QStyle::SP_MessageBoxQuestion: + iconType = kQuestionMarkIcon; + break; case QStyle::SP_MessageBoxInformation: + iconType = kAlertNoteIcon; + break; case QStyle::SP_MessageBoxWarning: + iconType = kAlertCautionIcon; + break; case QStyle::SP_MessageBoxCritical: - iconType = kGenericApplicationIcon; + iconType = kAlertStopIcon; break; case SP_DesktopIcon: iconType = kDesktopIcon; diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 78074c7..40ee31d 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3146,6 +3146,18 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai break; case PE_PanelLineEdit: QWindowsStyle::drawPrimitive(pe, opt, p, w); + // Draw the focus frame for widgets other than QLineEdit (e.g. for line edits in Webkit). + // Focus frame is drawn outside the rectangle passed in the option-rect. + if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) { + if ((opt->state & State_HasFocus) && !qobject_cast<const QLineEdit*>(w)) { + int vmargin = pixelMetric(QStyle::PM_FocusFrameVMargin); + int hmargin = pixelMetric(QStyle::PM_FocusFrameHMargin); + QStyleOptionFrame focusFrame = *panel; + focusFrame.rect = panel->rect.adjusted(-hmargin, -vmargin, hmargin, vmargin); + drawControl(CE_FocusFrame, &focusFrame, p, w); + } + } + break; case PE_FrameTabWidget: if (const QStyleOptionTabWidgetFrame *twf @@ -3169,7 +3181,6 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai p->drawLine(opt->rect.topLeft(), opt->rect.bottomLeft()); } break; case PE_FrameStatusBarItem: - QCommonStyle::drawPrimitive(pe, opt, p, w); break; case PE_IndicatorTabClose: { bool hover = (opt->state & State_MouseOver); diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 872bc2b..6d9ba05 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -58,8 +58,8 @@ #include <aknsskininstance.h> #include <aknsbasicbackgroundcontrolcontext.h> #include <avkon.mbg> -#include <AknFontAccess.h> -#include <AknLayoutFont.h> +#include <aknfontaccess.h> +#include <aknlayoutfont.h> #include <aknutils.h> #include <aknnavi.h> #include <gulicon.h> diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index f87cf28..3f09ebc 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -94,12 +94,12 @@ bool saveThemeToBlob(const QString &themeBlob, dataOut << color; } - const int picturesCount = partPictures.count(); - dataOut << picturesCount; - foreach (const QString &key, partPictures.keys()) { - const QPicture picture = partPictures.value(key); - dataOut << key; - dataOut << picture; + dataOut << partPictures.count(); + QHashIterator<QString, QPicture> i(partPictures); + while (i.hasNext()) { + i.next(); + dataOut << i.key(); + dataOut << i.value(); // the QPicture } QDataStream blobOut(&blob); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index b36294a..1f9fc32 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1065,7 +1065,7 @@ QRect QRenderRule::boxRect(const QRect& cr, int flags) const r.adjust(-p[LeftEdge], -p[TopEdge], p[RightEdge], p[BottomEdge]); } } - if (!hasNativeBorder() && (flags & Border)) { + if (hasBorder() && (flags & Border)) { const int *b = border()->borders; r.adjust(-b[LeftEdge], -b[TopEdge], b[RightEdge], b[BottomEdge]); } @@ -1352,6 +1352,12 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorRole fr, QPalette if (br != QPalette::NoRole) p->setBrush(br, bg->brush); p->setBrush(QPalette::Window, bg->brush); + if (bg->brush.style() == Qt::SolidPattern) { + p->setBrush(QPalette::Light, bg->brush.color().lighter(115)); + p->setBrush(QPalette::Midlight, bg->brush.color().lighter(107)); + p->setBrush(QPalette::Dark, bg->brush.color().darker(150)); + p->setBrush(QPalette::Shadow, bg->brush.color().darker(300)); + } } if (!hasPalette()) diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 7e5397d..87a73df 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -50,7 +50,7 @@ #include "qendian.h" #include <private/qcore_symbian_p.h> #if defined(QT_NO_FREETYPE) -#include <OPENFONT.H> +#include <openfont.h> #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include <graphics/openfontrasterizer.h> // COpenFontRasterizer has moved to a new header file #endif // SYMBIAN_ENABLE_SPLIT_HEADERS diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp index 05c8f08..b30a6c3 100644 --- a/src/gui/text/qfontdatabase_win.cpp +++ b/src/gui/text/qfontdatabase_win.cpp @@ -1101,7 +1101,6 @@ static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt) if (AddFontResource((LPCWSTR)fnt->fileName.utf16()) == 0) return; #else - // supported from 2000 on, so no need to deal with the *A variant PtrAddFontResourceExW ptrAddFontResourceExW = (PtrAddFontResourceExW)QLibrary::resolve(QLatin1String("gdi32"), "AddFontResourceExW"); if (!ptrAddFontResourceExW diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index 78f8a9a..5834cc4 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -56,7 +56,7 @@ #include "qconfig.h" #include "qfontengine_p.h" #include "qsize.h" -#include <OPENFONT.H> +#include <openfont.h> class CFont; diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 21f3189..b8c9b94 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -61,6 +61,7 @@ #include <qapplication.h> #include "qtextcontrol_p.h" #include "private/qtextedit_p.h" +#include "private/qdataurl_p.h" #include "qtextdocument_p.h" #include <private/qprinter_p.h> @@ -1924,6 +1925,10 @@ QVariant QTextDocument::loadResource(int type, const QUrl &name) } #endif + // handle data: URLs + if (r.isNull() && name.scheme() == QLatin1String("data")) + r = qDecodeDataUrl(name).second; + // if resource was not loaded try to load it here if (!doc && r.isNull() && name.isRelative()) { QUrl currentURL = d->url; diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index cefdb27..b7be967 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -62,7 +62,7 @@ \snippet doc/src/snippets/code/src_gui_util_qcompleter.cpp 0 - A QDirModel can be used to provide auto completion of file names. + A QFileSystemModel can be used to provide auto completion of file names. For example: \snippet doc/src/snippets/code/src_gui_util_qcompleter.cpp 1 @@ -120,7 +120,7 @@ completion is then performed one level at a time. Let's take the example of a user typing in a file system path. - The model is a (hierarchical) QDirModel. The completion + The model is a (hierarchical) QFileSystemModel. The completion occurs for every element in the path. For example, if the current text is \c C:\Wind, QCompleter might suggest \c Windows to complete the current path element. Similarly, if the current text @@ -130,12 +130,12 @@ split the path into a list of strings that are matched at each level. For \c C:\Windows\Sy, it needs to be split as "C:", "Windows" and "Sy". The default implementation of splitPath(), splits the completionPrefix - using QDir::separator() if the model is a QDirModel. + using QDir::separator() if the model is a QFileSystemModel. To provide completions, QCompleter needs to know the path from an index. This is provided by pathFromIndex(). The default implementation of pathFromIndex(), returns the data for the \l{Qt::EditRole}{edit role} - for list models and the absolute file path if the mode is a QDirModel. + for list models and the absolute file path if the mode is a QFileSystemModel. \sa QAbstractItemModel, QLineEdit, QComboBox, {Completer Example} */ @@ -147,6 +147,7 @@ #include "QtGui/qscrollbar.h" #include "QtGui/qstringlistmodel.h" #include "QtGui/qdirmodel.h" +#include "QtGui/qfilesystemmodel.h" #include "QtGui/qheaderview.h" #include "QtGui/qlistview.h" #include "QtGui/qapplication.h" @@ -470,9 +471,13 @@ QMatchData QCompletionEngine::filterHistory() QAbstractItemModel *source = c->proxy->sourceModel(); if (curParts.count() <= 1 || c->proxy->showAll || !source) return QMatchData(); - bool dirModel = false; + bool isDirModel = false; + bool isFsModel = false; #ifndef QT_NO_DIRMODEL - dirModel = (qobject_cast<QDirModel *>(source) != 0); + isDirModel = (qobject_cast<QDirModel *>(source) != 0); +#endif +#ifndef QT_NO_FILESYSTEMMODEL + isFsModel = (qobject_cast<QFileSystemModel *>(source) != 0); #endif QVector<int> v; QIndexMapper im(v); @@ -482,7 +487,7 @@ QMatchData QCompletionEngine::filterHistory() QString str = source->index(i, c->column).data().toString(); if (str.startsWith(c->prefix, c->cs) #if (!defined(Q_OS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_OS_SYMBIAN) - && (!dirModel || QDir::toNativeSeparators(str) != QDir::separator()) + && ((!isFsModel && !isDirModel) || QDir::toNativeSeparators(str) != QDir::separator()) #endif ) m.indices.append(i); @@ -838,6 +843,13 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) completion += QDir::separator(); } #endif +#ifndef QT_NO_FILESYSTEMMODEL + // add a trailing separator in inline + if (mode == QCompleter::InlineCompletion) { + if (qobject_cast<QFileSystemModel *>(proxy->sourceModel()) && QFileInfo(completion).isDir()) + completion += QDir::separator(); + } +#endif } if (highlighted) { @@ -891,6 +903,14 @@ void QCompleterPrivate::showPopup(const QRect& rect) popup->show(); } +void QCompleterPrivate::_q_fileSystemModelDirectoryLoaded(const QString &path) +{ + Q_Q(QCompleter); + //the path given by QFileSystemModel does not end with / + if (q->completionPrefix() != path + QLatin1Char('/')) + q->complete(); +} + /*! Constructs a completer object with the given \a parent. */ @@ -971,7 +991,7 @@ QWidget *QCompleter::widget() const be list model or a tree model. If a model has been already previously set and it has the QCompleter as its parent, it is deleted. - For convenience, if \a model is a QDirModel, QCompleter switches its + For convenience, if \a model is a QFileSystemModel, QCompleter switches its caseSensitivity to Qt::CaseInsensitive on Windows and Qt::CaseSensitive on other platforms. @@ -995,6 +1015,18 @@ void QCompleter::setModel(QAbstractItemModel *model) #endif } #endif // QT_NO_DIRMODEL +#ifndef QT_NO_FILESYSTEMMODEL + QFileSystemModel *fsModel = qobject_cast<QFileSystemModel *>(model); + if (fsModel) { +#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE)) || defined(Q_OS_SYMBIAN) + setCaseSensitivity(Qt::CaseInsensitive); +#else + setCaseSensitivity(Qt::CaseSensitive); +#endif + setCompletionRole(QFileSystemModel::FileNameRole); + connect(fsModel, SIGNAL(directoryLoaded(QString)), this, SLOT(_q_fileSystemModelDirectoryLoaded(QString))); + } +#endif // QT_NO_FILESYSTEMMODEL } /*! @@ -1626,10 +1658,11 @@ QAbstractItemModel *QCompleter::completionModel() const The default implementation returns the \l{Qt::EditRole}{edit role} of the item for list models. It returns the absolute file path if the model is a - QDirModel. + QFileSystemModel. \sa splitPath() */ + QString QCompleter::pathFromIndex(const QModelIndex& index) const { Q_D(const QCompleter); @@ -1639,16 +1672,25 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const QAbstractItemModel *sourceModel = d->proxy->sourceModel(); if (!sourceModel) return QString(); + bool isDirModel = false; + bool isFsModel = false; #ifndef QT_NO_DIRMODEL - QDirModel *dirModel = qobject_cast<QDirModel *>(sourceModel); - if (!dirModel) + isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0; +#endif +#ifndef QT_NO_FILESYSTEMMODEL + isFsModel = qobject_cast<QFileSystemModel *>(d->proxy->sourceModel()) != 0; #endif + if (!isDirModel && !isFsModel) return sourceModel->data(index, d->role).toString(); QModelIndex idx = index; QStringList list; do { - QString t = sourceModel->data(idx, Qt::EditRole).toString(); + QString t; + if (isDirModel) + t = sourceModel->data(idx, Qt::EditRole).toString(); + else + t = sourceModel->data(idx, QFileSystemModel::FileNameRole).toString(); list.prepend(t); QModelIndex parent = idx.parent(); idx = parent.sibling(parent.row(), index.column()); @@ -1668,7 +1710,7 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const in the model(). The default implementation of splitPath() splits a file system path based on - QDir::separator() when the sourceModel() is a QDirModel. + QDir::separator() when the sourceModel() is a QFileSystemModel. When used with list models, the first item in the returned list is used for matching. @@ -1678,12 +1720,19 @@ QString QCompleter::pathFromIndex(const QModelIndex& index) const QStringList QCompleter::splitPath(const QString& path) const { bool isDirModel = false; + bool isFsModel = false; #ifndef QT_NO_DIRMODEL Q_D(const QCompleter); isDirModel = qobject_cast<QDirModel *>(d->proxy->sourceModel()) != 0; #endif +#ifndef QT_NO_FILESYSTEMMODEL +#ifdef QT_NO_DIRMODEL + Q_D(const QCompleter); +#endif + isFsModel = qobject_cast<QFileSystemModel *>(d->proxy->sourceModel()) != 0; +#endif - if (!isDirModel || path.isEmpty()) + if ((!isDirModel && !isFsModel) || path.isEmpty()) return QStringList(completionPrefix()); QString pathCopy = QDir::toNativeSeparators(path); diff --git a/src/gui/util/qcompleter.h b/src/gui/util/qcompleter.h index 5123a40..0cef9be 100644 --- a/src/gui/util/qcompleter.h +++ b/src/gui/util/qcompleter.h @@ -159,6 +159,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_complete(QModelIndex)) Q_PRIVATE_SLOT(d_func(), void _q_completionSelected(const QItemSelection&)) Q_PRIVATE_SLOT(d_func(), void _q_autoResizePopup()) + Q_PRIVATE_SLOT(d_func(), void _q_fileSystemModelDirectoryLoaded(const QString&)) }; #endif // QT_NO_COMPLETER diff --git a/src/gui/util/qcompleter_p.h b/src/gui/util/qcompleter_p.h index 44be4c0..8f00793 100644 --- a/src/gui/util/qcompleter_p.h +++ b/src/gui/util/qcompleter_p.h @@ -98,6 +98,7 @@ public: void _q_complete(QModelIndex, bool = false); void _q_completionSelected(const QItemSelection&); void _q_autoResizePopup(); + void _q_fileSystemModelDirectoryLoaded(const QString &path); void setCurrentIndex(QModelIndex, bool = true); }; diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp index 9f3b6e1..aab7e16 100644 --- a/src/gui/util/qdesktopservices_win.cpp +++ b/src/gui/util/qdesktopservices_win.cpp @@ -59,7 +59,7 @@ # endif #endif -#if defined(Q_CC_MINGW) && !defined(CSIDL_MYMUSIC) +#ifndef CSIDL_MYMUSIC #define CSIDL_MYMUSIC 13 #define CSIDL_MYVIDEO 14 #endif @@ -97,19 +97,19 @@ static bool launchWebBrowser(const QUrl &url) if (url.scheme() == QLatin1String("mailto")) { //Retrieve the commandline for the default mail client //the default key used below is the command line for the mailto: shell command - DWORD bufferSize = 2 * MAX_PATH; + DWORD bufferSize = sizeof(wchar_t) * MAX_PATH; long returnValue = -1; QString command; HKEY handle; LONG res; - wchar_t keyValue[2 * MAX_PATH] = {0}; + wchar_t keyValue[MAX_PATH] = {0}; QString keyName(QLatin1String("mailto")); //Check if user has set preference, otherwise use default. - res = RegOpenKeyExW(HKEY_CURRENT_USER, - L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice", - 0, KEY_READ, &handle); + res = RegOpenKeyEx(HKEY_CURRENT_USER, + L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice", + 0, KEY_READ, &handle); if (res == ERROR_SUCCESS) { returnValue = RegQueryValueEx(handle, L"Progid", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize); if (!returnValue) @@ -121,8 +121,8 @@ static bool launchWebBrowser(const QUrl &url) if (res != ERROR_SUCCESS) return false; - bufferSize = 2 * MAX_PATH; - returnValue = RegQueryValueExW(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize); + bufferSize = sizeof(wchar_t) * MAX_PATH; + returnValue = RegQueryValueEx(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize); if (!returnValue) command = QString::fromRawData((QChar*)keyValue, bufferSize); RegCloseKey(handle); diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp index 6db158e..8e482e0 100644 --- a/src/gui/util/qsystemtrayicon_win.cpp +++ b/src/gui/util/qsystemtrayicon_win.cpp @@ -53,7 +53,6 @@ #include <qt_windows.h> #include <commctrl.h> -#include <shlwapi.h> #include <QBitmap> #include <QLibrary> #include <QApplication> @@ -326,8 +325,6 @@ bool QSystemTrayIconSys::winEvent( MSG *m, long *result ) q->contextMenu()->move(gpos); } #endif - q->contextMenu()->activateWindow(); - //Must be activated for proper keyboardfocus and menu closing on windows: } emit q->activated(QSystemTrayIcon::Context); break; diff --git a/src/gui/widgets/qcocoamenu_mac.mm b/src/gui/widgets/qcocoamenu_mac.mm index a7e0b79..ce85919 100644 --- a/src/gui/widgets/qcocoamenu_mac.mm +++ b/src/gui/widgets/qcocoamenu_mac.mm @@ -46,6 +46,7 @@ #import <private/qcocoamenuloader_mac_p.h> #include <private/qt_cocoa_helpers_mac_p.h> #include <private/qapplication_p.h> +#include <private/qaction_p.h> #include <QtGui/QMenu> @@ -70,6 +71,7 @@ QT_USE_NAMESPACE self = [super init]; if (self) { qmenu = menu; + previousAction = 0; [self setAutoenablesItems:NO]; [self setDelegate:self]; } @@ -81,13 +83,20 @@ QT_USE_NAMESPACE Q_UNUSED(menu); if (!item) { - // ### According to the docs everything will be highlighted. Not sure what we should do in - // Qt, so just return. + if (previousAction) { + qt_mac_clear_status_text(previousAction); + previousAction = 0; + } return; } - if (QAction *action = reinterpret_cast<QAction *>([item tag])) + if (QAction *action = reinterpret_cast<QAction *>([item tag])) { + QMenu *qtmenu = static_cast<QT_MANGLE_NAMESPACE(QCocoaMenu) *>(menu)->qmenu; + previousAction = action; action->activate(QAction::Hover); + qt_mac_menu_emit_hovered(qtmenu, action); + action->showStatusText(0); // 0 widget -> action's parent + } } - (void)menuWillOpen:(NSMenu*)menu; @@ -100,9 +109,13 @@ QT_USE_NAMESPACE qt_mac_menu_collapseSeparators(menu, qtmenu->separatorsCollapsible()); } -- (void)menuWillClose:(NSMenu*)menu; +- (void)menuDidClose:(NSMenu*)menu; { qt_mac_emit_menuSignals(((QT_MANGLE_NAMESPACE(QCocoaMenu) *)menu)->qmenu, false); + if (previousAction) { + qt_mac_clear_status_text(previousAction); + previousAction = 0; + } } - (BOOL)hasShortcut:(NSMenu *)menu forKey:(NSString *)key forModifiers:(NSUInteger)modifier @@ -194,6 +207,18 @@ void qt_mac_emit_menuSignals(QMenu *menu, bool show) } qt_mac_menus_open_count += delta; } + +void qt_mac_clear_status_text(QAction *action) +{ + action->d_func()->showStatusText(0, QString()); +} + +void qt_mac_menu_emit_hovered(QMenu *menu, QAction *action) +{ + emit menu->hovered(action); +} + + QT_END_NAMESPACE #endif diff --git a/src/gui/widgets/qcocoamenu_mac_p.h b/src/gui/widgets/qcocoamenu_mac_p.h index 9f50c40..d6ac8c5 100644 --- a/src/gui/widgets/qcocoamenu_mac_p.h +++ b/src/gui/widgets/qcocoamenu_mac_p.h @@ -55,13 +55,14 @@ #import <Cocoa/Cocoa.h> QT_FORWARD_DECLARE_CLASS(QMenu) +QT_FORWARD_DECLARE_CLASS(QAction) #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 @protocol NSMenuDelegate <NSObject> - (void)menu:(NSMenu*)menu willHighlightItem:(NSMenuItem*)item; - (void)menuWillOpen:(NSMenu*)menu; -- (void)menuWillClose:(NSMenu*)menu; +- (void)menuDidClose:(NSMenu*)menu; - (BOOL)hasShortcut:(NSMenu *)menu forKey:(NSString *)key forModifiers:(NSUInteger)modifier whichItem:(NSMenuItem**)outItem; @end @@ -71,6 +72,7 @@ QT_FORWARD_DECLARE_CLASS(QMenu) @interface QT_MANGLE_NAMESPACE(QCocoaMenu) : NSMenu <NSMenuDelegate> { QMenu *qmenu; + QAction *previousAction; } - (id)initWithQMenu:(QMenu*)menu; - (BOOL)menuHasKeyEquivalent:(NSMenu *)menu forEvent:(NSEvent *)event target:(id *)target action:(SEL *)action; diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 72f32dc..be20a38 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -1268,7 +1268,8 @@ QComboBox::~QComboBox() By default, this property has a value of 10. - \note This property is ignored for non-editable comboboxes in Mac style. + \note This property is ignored for non-editable comboboxes in styles that returns + false for QStyle::SH_ComboBox_Popup such as the Mac style or the Gtk+ Style. */ int QComboBox::maxVisibleItems() const { @@ -2348,7 +2349,7 @@ void QComboBox::showPopup() toCheck.push(idx); #endif ++count; - if (!usePopup && count > d->maxVisibleItems) { + if (!usePopup && count >= d->maxVisibleItems) { toCheck.clear(); break; } diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp index 762db86..50fa9c9 100644 --- a/src/gui/widgets/qdatetimeedit.cpp +++ b/src/gui/widgets/qdatetimeedit.cpp @@ -1175,7 +1175,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) return; } } QAbstractSpinBox::keyPressEvent(event); - if (select && !(event->modifiers() & Qt::ShiftModifier) && !d->edit->hasSelectedText()) { + if (select && !d->edit->hasSelectedText()) { if (inserted && d->sectionAt(d->edit->cursorPosition()) == QDateTimeParser::NoSectionIndex) { QString str = d->displayText(); int pos = d->edit->cursorPosition(); diff --git a/src/gui/widgets/qfocusframe.cpp b/src/gui/widgets/qfocusframe.cpp index d9cd5bb..4f20bce0 100644 --- a/src/gui/widgets/qfocusframe.cpp +++ b/src/gui/widgets/qfocusframe.cpp @@ -53,11 +53,14 @@ class QFocusFramePrivate : public QWidgetPrivate { Q_DECLARE_PUBLIC(QFocusFrame) QWidget *widget; - + QWidget *frameParent; + bool showFrameAboveWidget; public: QFocusFramePrivate() { widget = 0; + frameParent = 0; sendChildEvents = false; + showFrameAboveWidget = false; } void updateSize(); void update(); @@ -66,10 +69,10 @@ public: void QFocusFramePrivate::update() { Q_Q(QFocusFrame); - q->setParent(widget->parentWidget()); + q->setParent(frameParent); updateSize(); if (q->parentWidget()->rect().intersects(q->geometry())) { - if (q->style()->styleHint(QStyle::SH_FocusFrame_AboveWidget, 0, q)) + if (showFrameAboveWidget) q->raise(); else q->stackUnder(widget); @@ -84,7 +87,10 @@ void QFocusFramePrivate::updateSize() Q_Q(QFocusFrame); int vmargin = q->style()->pixelMetric(QStyle::PM_FocusFrameVMargin), hmargin = q->style()->pixelMetric(QStyle::PM_FocusFrameHMargin); - QRect geom(widget->x()-hmargin, widget->y()-vmargin, + QPoint pos(widget->x(), widget->y()); + if (q->parentWidget() != widget->parentWidget()) + pos = widget->parentWidget()->mapTo(q->parentWidget(), pos); + QRect geom(pos.x()-hmargin, pos.y()-vmargin, widget->width()+(hmargin*2), widget->height()+(vmargin*2)); if(q->geometry() == geom) return; @@ -176,14 +182,52 @@ void QFocusFrame::setWidget(QWidget *widget) { Q_D(QFocusFrame); - if(widget == d->widget) - return; - if(d->widget) - d->widget->removeEventFilter(this); - if(widget && !widget->isWindow() && widget->parentWidget()->windowType() != Qt::SubWindow) { + if (style()->styleHint(QStyle::SH_FocusFrame_AboveWidget, 0, this)) + d->showFrameAboveWidget = true; + else + d->showFrameAboveWidget = false; + + if (widget == d->widget) + return; + if (d->widget) { + // Remove event filters from the widget hierarchy. + QWidget *p = d->widget; + do { + p->removeEventFilter(this); + if (!d->showFrameAboveWidget || p == d->frameParent) + break; + p = p->parentWidget(); + }while (p); + } + if (widget && !widget->isWindow() && widget->parentWidget()->windowType() != Qt::SubWindow) { d->widget = widget; - widget->installEventFilter(this); + d->widget->installEventFilter(this); + QWidget *p = widget->parentWidget(); + QWidget *prev = 0; + if (d->showFrameAboveWidget) { + // Find the right parent for the focus frame. + while (p) { + // Traverse the hirerarchy of the 'widget' for setting event filter. + // During this if come across toolbar or a top level, use that + // as the parent for the focus frame. If we find a scroll area + // use its viewport as the parent. + bool isScrollArea = false; + if (p->isWindow() || p->inherits("QToolBar") || (isScrollArea = p->inherits("QAbstractScrollArea"))) { + d->frameParent = p; + // The previous one in the hierarchy will be the viewport. + if (prev && isScrollArea) + d->frameParent = prev; + break; + } else { + p->installEventFilter(this); + prev = p; + p = p->parentWidget(); + } + } + } else { + d->frameParent = p; + } d->update(); } else { d->widget = 0; @@ -210,9 +254,15 @@ QFocusFrame::widget() const void QFocusFrame::paintEvent(QPaintEvent *) { + Q_D(QFocusFrame); QStylePainter p(this); QStyleOption option; initStyleOption(&option); + int vmargin = style()->pixelMetric(QStyle::PM_FocusFrameVMargin); + int hmargin = style()->pixelMetric(QStyle::PM_FocusFrameHMargin); + QWidgetPrivate *wd = qt_widget_private(d->widget); + QRect rect = wd->clipRect().adjusted(0, 0, hmargin*2, vmargin*2); + p.setClipRect(rect); p.drawControl(QStyle::CE_FocusFrame, option); } @@ -233,7 +283,13 @@ QFocusFrame::eventFilter(QObject *o, QEvent *e) hide(); break; case QEvent::ParentChange: - d->update(); + if (d->showFrameAboveWidget) { + QWidget *w = d->widget; + setWidget(0); + setWidget(w); + } else { + d->update(); + } break; case QEvent::Show: d->update(); @@ -254,6 +310,19 @@ QFocusFrame::eventFilter(QObject *o, QEvent *e) default: break; } + } else if (d->showFrameAboveWidget) { + // Handle changes in the parent widgets we are monitoring. + switch(e->type()) { + case QEvent::Move: + case QEvent::Resize: + d->updateSize(); + break; + case QEvent::ZOrderChange: + raise(); + break; + default: + break; + } } return false; } diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index 8428ad7..c779312 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -781,6 +781,95 @@ Qt::TextInteractionFlags QLabel::textInteractionFlags() const return d->textInteractionFlags; } +/*! + Selects text from position \a start and for \a length characters. + + \sa selectedText() + + \bold{Note:} The textInteractionFlags set on the label need to include + either TextSelectableByMouse or TextSelectableByKeyboard. + + \since 4.7 +*/ +void QLabel::setSelection(int start, int length) +{ + Q_D(QLabel); + if (d->control) { + d->ensureTextPopulated(); + QTextCursor cursor = d->control->textCursor(); + cursor.setPosition(start); + cursor.setPosition(start + length, QTextCursor::KeepAnchor); + d->control->setTextCursor(cursor); + } +} + +/*! + \property QLabel::hasSelectedText + \brief whether there is any text selected + + hasSelectedText() returns true if some or all of the text has been + selected by the user; otherwise returns false. + + By default, this property is false. + + \sa selectedText() + + \bold{Note:} The textInteractionFlags set on the label need to include + either TextSelectableByMouse or TextSelectableByKeyboard. + + \since 4.7 +*/ +bool QLabel::hasSelectedText() const +{ + Q_D(const QLabel); + if (d->control) + return d->control->textCursor().hasSelection(); + return false; +} + +/*! + \property QLabel::selectedText + \brief the selected text + + If there is no selected text this property's value is + an empty string. + + By default, this property contains an empty string. + + \sa hasSelectedText() + + \bold{Note:} The textInteractionFlags set on the label need to include + either TextSelectableByMouse or TextSelectableByKeyboard. + + \since 4.7 +*/ +QString QLabel::selectedText() const +{ + Q_D(const QLabel); + if (d->control) + return d->control->textCursor().selectedText(); + return QString(); +} + +/*! + selectionStart() returns the index of the first selected character in the + label or -1 if no text is selected. + + \sa selectedText() + + \bold{Note:} The textInteractionFlags set on the label need to include + either TextSelectableByMouse or TextSelectableByKeyboard. + + \since 4.7 +*/ +int QLabel::selectionStart() const +{ + Q_D(const QLabel); + if (d->control && d->control->textCursor().hasSelection()) + return d->control->textCursor().selectionStart(); + return -1; +} + /*!\reimp */ QSize QLabel::sizeHint() const diff --git a/src/gui/widgets/qlabel.h b/src/gui/widgets/qlabel.h index d916078..54babb1 100644 --- a/src/gui/widgets/qlabel.h +++ b/src/gui/widgets/qlabel.h @@ -65,6 +65,8 @@ class Q_GUI_EXPORT QLabel : public QFrame Q_PROPERTY(int indent READ indent WRITE setIndent) Q_PROPERTY(bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks) Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags) + Q_PROPERTY(bool hasSelectedText READ hasSelectedText) + Q_PROPERTY(QString selectedText READ selectedText) public: explicit QLabel(QWidget *parent=0, Qt::WindowFlags f=0); @@ -111,6 +113,11 @@ public: void setTextInteractionFlags(Qt::TextInteractionFlags flags); Qt::TextInteractionFlags textInteractionFlags() const; + void setSelection(int, int); + bool hasSelectedText() const; + QString selectedText() const; + int selectionStart() const; + public Q_SLOTS: void setText(const QString &); void setPixmap(const QPixmap &); diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 8ce7cc0..08960da 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -2302,9 +2302,7 @@ void QMenu::mouseReleaseEvent(QMouseEvent *e) QAction *action = d->actionAt(e->pos()); if (action && action == d->currentAction) { - if (action->menu()) - action->menu()->d_func()->setFirstActionActive(); - else { + if (!action->menu()){ #if defined(Q_WS_WIN) //On Windows only context menus can be activated with the right button if (e->button() == Qt::LeftButton || d->topCausedWidget() == 0) diff --git a/src/gui/widgets/qmenu.h b/src/gui/widgets/qmenu.h index 5a6a5c7..28bd859 100644 --- a/src/gui/widgets/qmenu.h +++ b/src/gui/widgets/qmenu.h @@ -415,6 +415,7 @@ private: friend OSStatus qt_mac_menu_event(EventHandlerCallRef, EventRef, void *); friend bool qt_mac_activate_action(OSMenuRef, uint, QAction::ActionEvent, bool); friend void qt_mac_emit_menuSignals(QMenu *, bool); + friend void qt_mac_menu_emit_hovered(QMenu *menu, QAction *action); #endif }; diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 7e4bbb5..658a020 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -247,7 +247,7 @@ bool qt_mac_activate_action(MenuRef menu, uint command, QAction::ActionEvent act //now walk up firing for each "caused" widget (like in the platform independent menu) QWidget *caused = 0; - if (GetMenuItemProperty(menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), 0, &caused) == noErr) { + if (action_e == QAction::Hover && GetMenuItemProperty(menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), 0, &caused) == noErr) { MenuRef caused_menu = 0; if (QMenu *qmenu2 = qobject_cast<QMenu*>(caused)) caused_menu = qmenu2->macMenu(); @@ -260,25 +260,17 @@ bool qt_mac_activate_action(MenuRef menu, uint command, QAction::ActionEvent act QWidget *widget = 0; GetMenuItemProperty(caused_menu, 0, kMenuCreatorQt, kMenuPropertyQWidget, sizeof(widget), 0, &widget); if (QMenu *qmenu = qobject_cast<QMenu*>(widget)) { - if (action_e == QAction::Trigger) { - emit qmenu->triggered(action->action); - } else if (action_e == QAction::Hover) { - action->action->showStatusText(widget); - emit qmenu->hovered(action->action); - } + action->action->showStatusText(widget); + emit qmenu->hovered(action->action); } else if (QMenuBar *qmenubar = qobject_cast<QMenuBar*>(widget)) { - if (action_e == QAction::Trigger) { - emit qmenubar->triggered(action->action); - } else if (action_e == QAction::Hover) { - action->action->showStatusText(widget); - emit qmenubar->hovered(action->action); - } + action->action->showStatusText(widget); + emit qmenubar->hovered(action->action); break; //nothing more.. } //walk up if (GetMenuItemProperty(caused_menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, - sizeof(caused), 0, &caused) != noErr) + sizeof(caused), 0, &caused) != noErr) break; if (QMenu *qmenu2 = qobject_cast<QMenu*>(caused)) caused_menu = qmenu2->macMenu(); @@ -649,7 +641,7 @@ static NSMenuItem *createNSMenuItem(const QString &title) NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:qt_mac_QStringToNSString(title) action:@selector(qtDispatcherToQAction:) keyEquivalent:@""]; - [item setTarget:getMenuLoader()]; + [item setTarget:nil]; return item; } #endif @@ -749,32 +741,6 @@ bool qt_mac_menubar_is_open() return qt_mac_menus_open_count > 0; } -void qt_mac_clear_menubar() -{ - if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) - return; - -#ifndef QT_MAC_USE_COCOA - MenuRef clear_menu = 0; - if (CreateNewMenu(0, 0, &clear_menu) == noErr) { - SetRootMenu(clear_menu); - ReleaseMenu(clear_menu); - } else { - qWarning("QMenu: Internal error at %s:%d", __FILE__, __LINE__); - } - ClearMenuBar(); - qt_mac_command_set_enabled(0, kHICommandPreferences, false); - InvalMenuBar(); -#else - QMacCocoaAutoReleasePool pool; - QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); - NSMenu *menu = [loader menu]; - [loader ensureAppMenuInMenu:menu]; - [NSApp setMainMenu:menu]; -#endif -} - - QMacMenuAction::~QMacMenuAction() { #ifdef QT_MAC_USE_COCOA @@ -1130,7 +1096,7 @@ QMenuPrivate::QMacMenuPrivate::addAction(QMacMenuAction *action, QMacMenuAction action->menu = merge; [cmd retain]; [cmd setAction:@selector(qtDispatcherToQAction:)]; - [cmd setTarget:getMenuLoader()]; + [cmd setTarget:nil]; [action->menuItem release]; action->menuItem = cmd; QMenuMergeList *list = QMenuPrivate::mergeMenuItemsHash.value(merge); @@ -1936,43 +1902,53 @@ static bool qt_mac_is_ancestor(QWidget* possibleAncestor, QWidget *child) Returns true if the entries of menuBar should be disabled, based on the modality type of modalWidget. */ -static bool qt_mac_should_disable_menu(QMenuBar *menuBar, QWidget *modalWidget) +static bool qt_mac_should_disable_menu(QMenuBar *menuBar) { - if (modalWidget == 0 || menuBar == 0) + QWidget *modalWidget = qApp->activeModalWidget(); + if (!modalWidget) + return false; + + if (menuBar && menuBar == menubars()->value(modalWidget)) + // The menu bar is owned by the modal widget. + // In that case we should enable it: return false; - // If there is an application modal window on - // screen, the entries of the menubar should be disabled: + // When there is an application modal window on screen, the entries of + // the menubar should be disabled. The exception in Qt is that if the + // modal window is the only window on screen, then we enable the menu bar. QWidget *w = modalWidget; + QWidgetList topLevelWidgets = QApplication::topLevelWidgets(); while (w) { - if (w->isVisible() && w->windowModality() == Qt::ApplicationModal) - return true; + if (w->isVisible() && w->windowModality() == Qt::ApplicationModal) { + for (int i=0; i<topLevelWidgets.size(); ++i) { + QWidget *top = topLevelWidgets.at(i); + if (w != top && [qt_mac_window_for(top) isVisible]) { + // INVARIANT: we found another visible window + // on screen other than our modalWidget. We therefore + // disable the menu bar to follow normal modality logic: + return true; + } + } + // INVARIANT: We have only one window on screen that happends + // to be application modal. We choose to enable the menu bar + // in that case to e.g. enable the quit menu item. + return false; + } w = w->parentWidget(); } // INVARIANT: modalWidget is window modal. Disable menu entries - // if the menu bar belongs to an ancestor of modalWidget: - return qt_mac_is_ancestor(menuBar->parentWidget(), modalWidget); + // if the menu bar belongs to an ancestor of modalWidget. If menuBar + // is nil, we understand it as the default menu bar set by the nib: + return menuBar ? qt_mac_is_ancestor(menuBar->parentWidget(), modalWidget) : false; } -/*! - \internal - - This function will update the current menu bar and set it as the - active menu bar in the Menu Manager. - - \warning This function is not portable. - - \sa QMenu::macMenu(), QMenuBar::macMenu() -*/ -bool QMenuBar::macUpdateMenuBar() +static QWidget *findWindowThatShouldDisplayMenubar() { - cancelAllMenuTracking(); - QMenuBar *mb = 0; - //find a menu bar QWidget *w = qApp->activeWindow(); - if (!w) { + // We have no active window on screen. Try to + // find a window from the list of top levels: QWidgetList tlws = QApplication::topLevelWidgets(); for(int i = 0; i < tlws.size(); ++i) { QWidget *tlw = tlws.at(i); @@ -1983,6 +1959,12 @@ bool QMenuBar::macUpdateMenuBar() } } } + return w; +} + +static QMenuBar *findMenubarForWindow(QWidget *w) +{ + QMenuBar *mb = 0; if (w) { mb = menubars()->value(w); #ifndef QT_NO_MAINWINDOW @@ -1996,11 +1978,65 @@ bool QMenuBar::macUpdateMenuBar() while(w && !mb) mb = menubars()->value((w = w->parentWidget())); } - if (!mb) + + if (!mb) { + // We could not find a menu bar for the window. Lets + // check if we have a global (parentless) menu bar instead: mb = fallback; - //now set it + } + + return mb; +} + +void qt_mac_clear_menubar() +{ + if (QApplication::testAttribute(Qt::AA_MacPluginApplication)) + return; + +#ifndef QT_MAC_USE_COCOA + MenuRef clear_menu = 0; + if (CreateNewMenu(0, 0, &clear_menu) == noErr) { + SetRootMenu(clear_menu); + ReleaseMenu(clear_menu); + } else { + qWarning("QMenu: Internal error at %s:%d", __FILE__, __LINE__); + } + ClearMenuBar(); + qt_mac_command_set_enabled(0, kHICommandPreferences, false); + InvalMenuBar(); +#else + QMacCocoaAutoReleasePool pool; + QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = getMenuLoader(); + NSMenu *menu = [loader menu]; + [loader ensureAppMenuInMenu:menu]; + [NSApp setMainMenu:menu]; + const bool modal = qt_mac_should_disable_menu(0); + if (qt_mac_current_menubar.qmenubar || modal != qt_mac_current_menubar.modal) + qt_mac_set_modal_state(menu, modal); + qt_mac_current_menubar.qmenubar = 0; + qt_mac_current_menubar.modal = modal; +#endif +} + +/*! + \internal + + This function will update the current menu bar and set it as the + active menu bar in the Menu Manager. + + \warning This function is not portable. + + \sa QMenu::macMenu(), QMenuBar::macMenu() +*/ +bool QMenuBar::macUpdateMenuBar() +{ bool ret = false; + cancelAllMenuTracking(); + QWidget *w = findWindowThatShouldDisplayMenubar(); + QMenuBar *mb = findMenubarForWindow(w); + if (mb && mb->isNativeMenuBar()) { + bool modal = QApplicationPrivate::modalState(); #ifdef QT_MAC_USE_COCOA QMacCocoaAutoReleasePool pool; #endif @@ -2030,16 +2066,18 @@ bool QMenuBar::macUpdateMenuBar() } } #endif - QWidget *modalWidget = qApp->activeModalWidget(); - if (mb != menubars()->value(modalWidget)) { - qt_mac_set_modal_state(menu, qt_mac_should_disable_menu(mb, modalWidget)); - } + // Check if menu is modally shaddowed and should be disabled: + modal = qt_mac_should_disable_menu(mb); + if (mb != qt_mac_current_menubar.qmenubar || modal != qt_mac_current_menubar.modal) + qt_mac_set_modal_state(menu, modal); } qt_mac_current_menubar.qmenubar = mb; - qt_mac_current_menubar.modal = QApplicationPrivate::modalState(); + qt_mac_current_menubar.modal = modal; ret = true; } else if (qt_mac_current_menubar.qmenubar && qt_mac_current_menubar.qmenubar->isNativeMenuBar()) { - const bool modal = QApplicationPrivate::modalState(); + // INVARIANT: The currently active menu bar (if any) is not native. But we do have a + // native menu bar from before. So we need to decide whether or not is should be enabled: + const bool modal = qt_mac_should_disable_menu(qt_mac_current_menubar.qmenubar); if (modal != qt_mac_current_menubar.modal) { ret = true; if (OSMenuRef menu = qt_mac_current_menubar.qmenubar->macMenu()) { @@ -2051,14 +2089,12 @@ bool QMenuBar::macUpdateMenuBar() [NSApp setMainMenu:menu]; syncMenuBarItemsVisiblity(qt_mac_current_menubar.qmenubar->d_func()->mac_menubar); #endif - QWidget *modalWidget = qApp->activeModalWidget(); - if (qt_mac_current_menubar.qmenubar != menubars()->value(modalWidget)) { - qt_mac_set_modal_state(menu, qt_mac_should_disable_menu(mb, modalWidget)); - } + qt_mac_set_modal_state(menu, modal); } qt_mac_current_menubar.modal = modal; } } + if(!ret) qt_mac_clear_menubar(); return ret; diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index ab598d9..02ffe13 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -911,6 +911,7 @@ void QPlainTextEditPrivate::pageUpDown(QTextCursor::MoveOperation op, QTextCurso setTopBlock(block.blockNumber(), line); if (moveCursor) { + cursor.setVisualNavigation(true); // move using movePosition to keep the cursor's x lastY += verticalOffset(); bool moved = false; diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index 22e8255..7559311 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1947,7 +1947,8 @@ void QTabBar::changeEvent(QEvent *event) { Q_D(QTabBar); if (event->type() == QEvent::StyleChange) { - d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this)); + if (!d->elideModeSetByUser) + d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this)); if (!d->useScrollButtonsSetByUser) d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this); d->refresh(); @@ -1980,6 +1981,7 @@ void QTabBar::setElideMode(Qt::TextElideMode mode) { Q_D(QTabBar); d->elideMode = mode; + d->elideModeSetByUser = true; d->refresh(); } diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h index 7588035..83636e6 100644 --- a/src/gui/widgets/qtabbar_p.h +++ b/src/gui/widgets/qtabbar_p.h @@ -75,7 +75,7 @@ class QTabBarPrivate : public QWidgetPrivate public: QTabBarPrivate() :currentIndex(-1), pressedIndex(-1), shape(QTabBar::RoundedNorth), layoutDirty(false), - drawBase(true), scrollOffset(0), useScrollButtonsSetByUser(false) , expanding(true), closeButtonOnTabs(false), + drawBase(true), scrollOffset(0), elideModeSetByUser(false), useScrollButtonsSetByUser(false), expanding(true), closeButtonOnTabs(false), selectionBehaviorOnRemove(QTabBar::SelectRightTab), paintWithOffsets(true), movable(false), dragInProgress(false), documentMode(false), movingTab(0) #ifdef Q_WS_MAC @@ -186,6 +186,7 @@ public: void makeVisible(int index); QSize iconSize; Qt::TextElideMode elideMode; + bool elideModeSetByUser; bool useScrollButtons; bool useScrollButtonsSetByUser; diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 8beda55..7ed27ea 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -533,6 +533,14 @@ void QToolBarPrivate::plug(const QRect &r) /*! + \fn void QToolBar::visibilityChanged(bool visible) + \since 4.7 + + This signal is emitted when the toolbar becomes \a visible (or + invisible). This happens when the widget is hidden or shown. +*/ + +/*! Constructs a QToolBar with the given \a parent. */ QToolBar::QToolBar(QWidget *parent) @@ -1122,6 +1130,7 @@ bool QToolBar::event(QEvent *event) // fallthrough intended case QEvent::Show: d->toggleViewAction->setChecked(event->type() == QEvent::Show); + emit visibilityChanged(event->type() == QEvent::Show); #if defined(Q_WS_MAC) if (toolbarInUnifiedToolBar(this)) { // I can static_cast because I did the qobject_cast in the if above, therefore diff --git a/src/gui/widgets/qtoolbar.h b/src/gui/widgets/qtoolbar.h index 90f20dd..b733477 100644 --- a/src/gui/widgets/qtoolbar.h +++ b/src/gui/widgets/qtoolbar.h @@ -143,6 +143,7 @@ Q_SIGNALS: void iconSizeChanged(const QSize &iconSize); void toolButtonStyleChanged(Qt::ToolButtonStyle toolButtonStyle); void topLevelChanged(bool topLevel); + void visibilityChanged(bool visible); protected: void actionEvent(QActionEvent *event); diff --git a/src/gui/widgets/qvalidator.cpp b/src/gui/widgets/qvalidator.cpp index a5276d3..0b5cc5a 100644 --- a/src/gui/widgets/qvalidator.cpp +++ b/src/gui/widgets/qvalidator.cpp @@ -400,8 +400,10 @@ QValidator::State QIntValidator::validate(QString & input, int&) const qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow); if (overflow || !ok) return Invalid; - if (entered >= b && entered <= t) - return Acceptable; + if (entered >= b && entered <= t) { + locale().toInt(input, &ok); + return ok ? Acceptable : Intermediate; + } if (entered >= 0) { // the -entered < b condition is necessary to allow people to type @@ -412,6 +414,20 @@ QValidator::State QIntValidator::validate(QString & input, int&) const } } +/*! \reimp */ +void QIntValidator::fixup(QString &input) const +{ + QByteArray buff; + if (!locale().d()->validateChars(input, QLocalePrivate::IntegerMode, &buff)) { + QLocale cl(QLocale::C); + if (!cl.d()->validateChars(input, QLocalePrivate::IntegerMode, &buff)) + return; + } + bool ok, overflow; + qlonglong entered = QLocalePrivate::bytearrayToLongLong(buff.constData(), 10, &ok, &overflow); + if (ok && !overflow) + input = locale().toString(entered); +} /*! Sets the range of the validator to only accept integers between \a diff --git a/src/gui/widgets/qvalidator.h b/src/gui/widgets/qvalidator.h index 30afbd6..e996a01 100644 --- a/src/gui/widgets/qvalidator.h +++ b/src/gui/widgets/qvalidator.h @@ -105,6 +105,7 @@ public: ~QIntValidator(); QValidator::State validate(QString &, int &) const; + void fixup(QString &input) const; void setBottom(int); void setTop(int); diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp index 092efc5..19b4669 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo.cpp @@ -105,8 +105,8 @@ public: The values supported by the the device for each of these parameters can be fetched with - supportedByteOrders(), supportedChannels(), supportedCodecs(), - supportedFrequencies(), supportedSampleSizes(), and + supportedByteOrders(), supportedChannelCounts(), supportedCodecs(), + supportedSampleRates(), supportedSampleSizes(), and supportedSampleTypes(). The combinations supported are dependent on the platform, audio plugins installed and the audio device capabilities. If you need a specific format, you can check if the device supports it with isFormatSupported(), or fetch a @@ -259,7 +259,18 @@ QStringList QAudioDeviceInfo::supportedCodecs() const } /*! - Returns a list of supported frequencies. + Returns a list of supported sample rates. +*/ + +QList<int> QAudioDeviceInfo::supportedSampleRates() const +{ + return supportedFrequencies(); +} + +/*! + \obsolete + + Use supportedSampleRates() instead. */ QList<int> QAudioDeviceInfo::supportedFrequencies() const @@ -268,7 +279,18 @@ QList<int> QAudioDeviceInfo::supportedFrequencies() const } /*! - Returns a list of supported channels. + Returns a list of supported channel counts. +*/ + +QList<int> QAudioDeviceInfo::supportedChannelCounts() const +{ + return supportedChannels(); +} + +/*! + \obsolete + + Use supportedChannelCount() instead. */ QList<int> QAudioDeviceInfo::supportedChannels() const diff --git a/src/multimedia/audio/qaudiodeviceinfo.h b/src/multimedia/audio/qaudiodeviceinfo.h index 62dc8a2..1cc0731 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.h +++ b/src/multimedia/audio/qaudiodeviceinfo.h @@ -84,7 +84,9 @@ public: QStringList supportedCodecs() const; QList<int> supportedFrequencies() const; + QList<int> supportedSampleRates() const; QList<int> supportedChannels() const; + QList<int> supportedChannelCounts() const; QList<int> supportedSampleSizes() const; QList<QAudioFormat::Endian> supportedByteOrders() const; QList<QAudioFormat::SampleType> supportedSampleTypes() const; diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp index f6b8154..955a880 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp @@ -95,14 +95,14 @@ QAudioFormat QAudioDeviceInfoInternal::preferredFormat() const QAudioFormat nearest; if(mode == QAudio::AudioOutput) { nearest.setFrequency(44100); - nearest.setChannels(2); + nearest.setChannelCount(2); nearest.setByteOrder(QAudioFormat::LittleEndian); nearest.setSampleType(QAudioFormat::SignedInt); nearest.setSampleSize(16); nearest.setCodec(QLatin1String("audio/pcm")); } else { nearest.setFrequency(11025); - nearest.setChannels(1); + nearest.setChannelCount(1); nearest.setByteOrder(QAudioFormat::LittleEndian); nearest.setSampleType(QAudioFormat::SignedInt); nearest.setSampleSize(8); diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp index 89ae0ff..e349b9e 100644 --- a/src/multimedia/audio/qaudioformat.cpp +++ b/src/multimedia/audio/qaudioformat.cpp @@ -111,7 +111,7 @@ public: \o Parameter \o Description \row - \o Frequency + \o Sample Rate \o Samples per second of audio data in Hertz. \row \o Number of channels @@ -143,8 +143,8 @@ public: Values are initialized as follows: \list - \o frequency() = -1 - \o channels() = -1 + \o sampleRate() = -1 + \o channelCount() = -1 \o sampleSize() = -1 \o byteOrder() = QAudioFormat::Endian(QSysInfo::ByteOrder) \o sampleType() = QAudioFormat::Unknown @@ -224,7 +224,18 @@ bool QAudioFormat::isValid() const } /*! - Sets the frequency to \a frequency. + Sets the sample rate to \a samplerate Hertz. +*/ + +void QAudioFormat::setSampleRate(int samplerate) +{ + d->frequency = samplerate; +} + +/*! + \obsolete + + Use setSampleRate() instead. */ void QAudioFormat::setFrequency(int frequency) @@ -233,7 +244,18 @@ void QAudioFormat::setFrequency(int frequency) } /*! - Returns the current frequency value. + Returns the current sample rate in Hertz. +*/ + +int QAudioFormat::sampleRate() const +{ + return d->frequency; +} + +/*! + \obsolete + + Use sampleRate() instead. */ int QAudioFormat::frequency() const @@ -242,7 +264,18 @@ int QAudioFormat::frequency() const } /*! - Sets the channels to \a channels. + Sets the channel count to \a channels. +*/ + +void QAudioFormat::setChannelCount(int channels) +{ + d->channels = channels; +} + +/*! + \obsolete + + Use setChannelCount() instead. */ void QAudioFormat::setChannels(int channels) @@ -251,7 +284,18 @@ void QAudioFormat::setChannels(int channels) } /*! - Returns the current channel value. + Returns the current channel count value. +*/ + +int QAudioFormat::channelCount() const +{ + return d->channels; +} + +/*! + \obsolete + + Use channelCount() instead. */ int QAudioFormat::channels() const diff --git a/src/multimedia/audio/qaudioformat.h b/src/multimedia/audio/qaudioformat.h index cb58d1c..6c835b7 100644 --- a/src/multimedia/audio/qaudioformat.h +++ b/src/multimedia/audio/qaudioformat.h @@ -75,9 +75,13 @@ public: void setFrequency(int frequency); int frequency() const; + void setSampleRate(int sampleRate); + int sampleRate() const; void setChannels(int channels); int channels() const; + void setChannelCount(int channelCount); + int channelCount() const; void setSampleSize(int sampleSize); int sampleSize() const; diff --git a/src/multimedia/audio/qaudioinput_win32_p.cpp b/src/multimedia/audio/qaudioinput_win32_p.cpp index 17e8bfb..84fd2a5 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.cpp +++ b/src/multimedia/audio/qaudioinput_win32_p.cpp @@ -230,6 +230,11 @@ bool QAudioInputPrivate::open() } else { period_size = buffer_size/5; } +#ifdef Q_OS_WINCE + // For wince reduce size to 40ms for buffer size and 20ms period + buffer_size = settings.sampleRate()*settings.channelCount()*(settings.sampleSize()/8)*0.04; + period_size = buffer_size/2; +#endif timeStamp.restart(); elapsedTimeOffset = 0; wfx.nSamplesPerSec = settings.frequency(); diff --git a/src/network/access/qnetworkaccessdatabackend.cpp b/src/network/access/qnetworkaccessdatabackend.cpp index 52c554f..a2e7ef5 100644 --- a/src/network/access/qnetworkaccessdatabackend.cpp +++ b/src/network/access/qnetworkaccessdatabackend.cpp @@ -43,6 +43,7 @@ #include "qnetworkrequest.h" #include "qnetworkreply.h" #include "qurlinfo.h" +#include "private/qdataurl_p.h" QT_BEGIN_NAMESPACE @@ -78,53 +79,20 @@ void QNetworkAccessDataBackend::open() return; } - if (uri.host().isEmpty()) { - setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("text/plain;charset=US-ASCII")); - - // the following would have been the correct thing, but - // reality often differs from the specification. People have - // data: URIs with ? and # - //QByteArray data = QByteArray::fromPercentEncoding(uri.encodedPath()); - QByteArray data = QByteArray::fromPercentEncoding(uri.toEncoded()); - - // remove the data: scheme - data.remove(0, 5); - - // parse it: - int pos = data.indexOf(','); - if (pos != -1) { - QByteArray payload = data.mid(pos + 1); - data.truncate(pos); - data = data.trimmed(); - - // find out if the payload is encoded in Base64 - if (data.endsWith(";base64")) { - payload = QByteArray::fromBase64(payload); - data.chop(7); - } - - if (data.toLower().startsWith("charset")) { - int i = 7; // strlen("charset") - while (data.at(i) == ' ') - ++i; - if (data.at(i) == '=') - data.prepend("text/plain;"); - } - - if (!data.isEmpty()) - setHeader(QNetworkRequest::ContentTypeHeader, data.trimmed()); - - setHeader(QNetworkRequest::ContentLengthHeader, payload.size()); - emit metaDataChanged(); - - QByteDataBuffer list; - list.append(payload); - payload.clear(); // important because of implicit sharing! - writeDownstreamData(list); - - finished(); - return; - } + QPair<QString, QByteArray> decoded = qDecodeDataUrl(uri); + + if (! decoded.first.isNull()) { + setHeader(QNetworkRequest::ContentTypeHeader, decoded.first); + setHeader(QNetworkRequest::ContentLengthHeader, decoded.second.size()); + emit metaDataChanged(); + + QByteDataBuffer list; + list.append(decoded.second); + decoded.second.clear(); // important because of implicit sharing! + writeDownstreamData(list); + + finished(); + return; } // something wrong with this URI diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 61a95fe..8e02723 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -480,10 +480,24 @@ void QNetworkAccessHttpBackend::validateCache(QHttpNetworkRequest &httpRequest, loadedFromCache = false; } +static QHttpNetworkRequest::Priority convert(const QNetworkRequest::Priority& prio) +{ + switch (prio) { + case QNetworkRequest::LowPriority: + return QHttpNetworkRequest::LowPriority; + case QNetworkRequest::HighPriority: + return QHttpNetworkRequest::HighPriority; + case QNetworkRequest::NormalPriority: + default: + return QHttpNetworkRequest::NormalPriority; + } +} + void QNetworkAccessHttpBackend::postRequest() { bool loadedFromCache = false; QHttpNetworkRequest httpRequest; + httpRequest.setPriority(convert(request().priority())); switch (operation()) { case QNetworkAccessManager::GetOperation: httpRequest.setOperation(QHttpNetworkRequest::Get); diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index 0a8ea5d..15748fe 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -533,6 +533,21 @@ QByteArray QNetworkReply::rawHeader(const QByteArray &headerName) const return QByteArray(); } +/*! \typedef QNetworkReply::RawHeaderPair + + RawHeaderPair is a QPair<QByteArray, QByteArray> where the first + QByteArray is the header name and the second is the header. + */ + +/*! + Returns a list of raw header pairs. + */ +const QList<QNetworkReply::RawHeaderPair>& QNetworkReply::rawHeaderPairs() const +{ + Q_D(const QNetworkReply); + return d->rawHeaders; +} + /*! Returns a list of headers fields that were sent by the remote server, in the order that they were sent. Duplicate headers are diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h index 5be4cce..5db4985 100644 --- a/src/network/access/qnetworkreply.h +++ b/src/network/access/qnetworkreply.h @@ -128,6 +128,9 @@ public: QList<QByteArray> rawHeaderList() const; QByteArray rawHeader(const QByteArray &headerName) const; + typedef QPair<QByteArray, QByteArray> RawHeaderPair; + const QList<RawHeaderPair>& rawHeaderPairs() const; + // attributes QVariant attribute(QNetworkRequest::Attribute code) const; diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index a2bef67..b8438a2 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -218,8 +218,9 @@ class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate { public: inline QNetworkRequestPrivate() + : priority(QNetworkRequest::NormalPriority) #ifndef QT_NO_OPENSSL - : sslConfiguration(0) + , sslConfiguration(0) #endif { qRegisterMetaType<QNetworkRequest>(); } ~QNetworkRequestPrivate() @@ -234,6 +235,7 @@ public: : QSharedData(other), QNetworkHeadersPrivate(other) { url = other.url; + priority = other.priority; #ifndef QT_NO_OPENSSL sslConfiguration = 0; @@ -245,12 +247,14 @@ public: inline bool operator==(const QNetworkRequestPrivate &other) const { return url == other.url && + priority == other.priority && rawHeaders == other.rawHeaders && attributes == other.attributes; // don't compare cookedHeaders } QUrl url; + QNetworkRequest::Priority priority; #ifndef QT_NO_OPENSSL mutable QSslConfiguration *sslConfiguration; #endif @@ -516,6 +520,45 @@ QObject *QNetworkRequest::originatingObject() const return d->originatingObject.data(); } +/*! + \since 4.7 + + Return the priority of this request. + + \sa setPriority() +*/ +QNetworkRequest::Priority QNetworkRequest::priority() const +{ + return d->priority; +} + +/*! \enum QNetworkRequest::Priority + + \since 4.7 + + This enum lists the possible network request priorities. + + \value HighPriority High priority + \value NormalPriority Normal priority + \value LowPriority Low priority + */ + +/*! + \since 4.7 + + Set the priority of this request to \a priority. + + \note The \a priority is only a hint to the network access + manager. It can use it or not. Currently it is used for HTTP to + decide which request should be sent first to a server. + + \sa priority() +*/ +void QNetworkRequest::setPriority(Priority priority) +{ + d->priority = priority; +} + static QByteArray headerName(QNetworkRequest::KnownHeaders header) { switch (header) { diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index fe01f8c..bc2d9da 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -89,6 +89,12 @@ public: AlwaysCache }; + enum Priority { + HighPriority = 1, + NormalPriority = 3, + LowPriority = 5 + }; + explicit QNetworkRequest(const QUrl &url = QUrl()); QNetworkRequest(const QNetworkRequest &other); ~QNetworkRequest(); @@ -123,6 +129,9 @@ public: void setOriginatingObject(QObject *object); QObject *originatingObject() const; + Priority priority() const; + void setPriority(Priority priority); + private: QSharedDataPointer<QNetworkRequestPrivate> d; friend class QNetworkRequestPrivate; diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp index 516b847..03b1bf0 100644 --- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp +++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp @@ -145,7 +145,7 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc // threshold based on same algorithm as in qtriangulatingstroker.cpp int threshold = qMin<float>(64, qMax(bounds.width(), bounds.height()) * 3.14f / (curveInverseScale * 6)); if (threshold < 3) threshold = 3; - qreal one_over_threshold_minus_1 = 1.f / (threshold - 1); + qreal one_over_threshold_minus_1 = qreal(1) / (threshold - 1); for (int t=0; t<threshold; ++t) { QPointF pt = b.pointAt(t * one_over_threshold_minus_1); lineToArray(pt.x(), pt.y()); diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 07f3159..b17e3a1 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -77,6 +77,7 @@ #include <private/qfontengine_p.h> #include <private/qpixmapdata_gl_p.h> #include <private/qdatabuffer_p.h> +#include <private/qtriangulator_p.h> #include "qglgradientcache_p.h" #include "qglengineshadermanager_p.h" @@ -608,10 +609,13 @@ struct QGL2PEVectorPathCache { #ifdef QT_OPENGL_CACHE_AS_VBOS GLuint vbo; + GLuint ibo; #else float *vertices; + quint32 *indices; #endif int vertexCount; + int indexCount; GLenum primitiveType; qreal iscale; }; @@ -622,9 +626,12 @@ void QGL2PaintEngineExPrivate::cleanupVectorPath(QPaintEngineEx *engine, void *d #ifdef QT_OPENGL_CACHE_AS_VBOS Q_ASSERT(engine->type() == QPaintEngine::OpenGL2); static_cast<QGL2PaintEngineEx *>(engine)->d_func()->unusedVBOSToClean << c->vbo; + if (c->ibo) + d->unusedIBOSToClean << c->ibo; #else Q_UNUSED(engine); qFree(c->vertices); + qFree(c->indices); #endif delete c; } @@ -655,6 +662,9 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) const QPointF* const points = reinterpret_cast<const QPointF*>(path.points()); + // ### Remove before release... + static bool do_vectorpath_cache = qgetenv("QT_OPENGL_NO_PATH_CACHE").isEmpty(); + // Check to see if there's any hints if (path.shape() == QVectorPath::RectangleHint) { QGLRect rect(points[0].x(), points[0].y(), points[2].x(), points[2].y()); @@ -666,6 +676,8 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) QVectorPath::CacheEntry *data = path.lookupCacheData(q); QGL2PEVectorPathCache *cache; + bool updateCache = false; + if (data) { cache = (QGL2PEVectorPathCache *) data->data; // Check if scale factor is exceeded for curved paths and generate curves if so... @@ -675,34 +687,39 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) #ifdef QT_OPENGL_CACHE_AS_VBOS glDeleteBuffers(1, &cache->vbo); cache->vbo = 0; + Q_ASSERT(cache->ibo == 0); #else qFree(cache->vertices); + Q_ASSERT(cache->indices == 0); #endif - cache->vertexCount = 0; + updateCache = true; } } } else { cache = new QGL2PEVectorPathCache; - cache->vertexCount = 0; data = const_cast<QVectorPath &>(path).addCacheData(q, cache, cleanupVectorPath); + updateCache = true; } // Flatten the path at the current scale factor and fill it into the cache struct. - if (!cache->vertexCount) { + if (updateCache) { vertexCoordinateArray.clear(); vertexCoordinateArray.addPath(path, inverseScale, false); int vertexCount = vertexCoordinateArray.vertexCount(); int floatSizeInBytes = vertexCount * 2 * sizeof(float); cache->vertexCount = vertexCount; + cache->indexCount = 0; cache->primitiveType = GL_TRIANGLE_FAN; cache->iscale = inverseScale; #ifdef QT_OPENGL_CACHE_AS_VBOS glGenBuffers(1, &cache->vbo); glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBufferData(GL_ARRAY_BUFFER, floatSizeInBytes, vertexCoordinateArray.data(), GL_STATIC_DRAW); + cache->ibo = 0; #else cache->vertices = (float *) qMalloc(floatSizeInBytes); memcpy(cache->vertices, vertexCoordinateArray.data(), floatSizeInBytes); + cache->indices = 0; #endif } @@ -718,8 +735,6 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } else { // printf(" - Marking path as cachable...\n"); // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable - // ### Remove before release... - static bool do_vectorpath_cache = qgetenv("QT_OPENGL_NO_PATH_CACHE").isEmpty(); if (do_vectorpath_cache) path.makeCacheable(); vertexCoordinateArray.clear(); @@ -729,31 +744,117 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) } } else { - // The path is too complicated & needs the stencil technique - vertexCoordinateArray.clear(); - vertexCoordinateArray.addPath(path, inverseScale, false); + bool useCache = path.isCacheable(); + if (useCache) { + QRectF bbox = path.controlPointRect(); + // If the path doesn't fit within these limits, it is possible that the triangulation will fail. + useCache &= (bbox.left() > -0x8000 * inverseScale) + && (bbox.right() < 0x8000 * inverseScale) + && (bbox.top() > -0x8000 * inverseScale) + && (bbox.bottom() < 0x8000 * inverseScale); + } - fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill()); + if (useCache) { + QVectorPath::CacheEntry *data = path.lookupCacheData(q); + QGL2PEVectorPathCache *cache; - glStencilMask(0xff); - glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE); + bool updateCache = false; + + if (data) { + cache = (QGL2PEVectorPathCache *) data->data; + // Check if scale factor is exceeded for curved paths and generate curves if so... + if (path.isCurved()) { + qreal scaleFactor = cache->iscale / inverseScale; + if (scaleFactor < 0.5 || scaleFactor > 2.0) { +#ifdef QT_OPENGL_CACHE_AS_VBOS + glDeleteBuffers(1, &cache->vbo); + glDeleteBuffers(1, &cache->ibo); +#else + qFree(cache->vertices); + qFree(cache->indices); +#endif + updateCache = true; + } + } + } else { + cache = new QGL2PEVectorPathCache; + data = const_cast<QVectorPath &>(path).addCacheData(q, cache, cleanupVectorPath); + updateCache = true; + } + + // Flatten the path at the current scale factor and fill it into the cache struct. + if (updateCache) { + QTriangleSet polys = qTriangulate(path, QTransform().scale(1 / inverseScale, 1 / inverseScale)); + cache->vertexCount = polys.vertices.size() / 2; + cache->indexCount = polys.indices.size(); + cache->primitiveType = GL_TRIANGLES; + cache->iscale = inverseScale; + +#ifdef QT_OPENGL_CACHE_AS_VBOS + glGenBuffers(1, &cache->vbo); + glGenBuffers(1, &cache->ibo); + glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint32) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); + + QVarLengthArray<float> vertices(polys.vertices.size()); + for (int i = 0; i < polys.vertices.size(); ++i) + vertices[i] = float(inverseScale * polys.vertices.at(i)); + glBufferData(GL_ARRAY_BUFFER, sizeof(float) * vertices.size(), vertices.data(), GL_STATIC_DRAW); +#else + cache->vertices = (float *) qMalloc(sizeof(float) * polys.vertices.size()); + cache->indices = (quint32 *) qMalloc(sizeof(quint32) * polys.indices.size()); + memcpy(cache->indices, polys.indices.data(), sizeof(quint32) * polys.indices.size()); + for (int i = 0; i < polys.vertices.size(); ++i) + cache->vertices[i] = float(inverseScale * polys.vertices.at(i)); +#endif + } + + prepareForDraw(currentBrush.isOpaque()); +#ifdef QT_OPENGL_CACHE_AS_VBOS + glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, 0); + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBuffer(GL_ARRAY_BUFFER, 0); +#else + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, cache->vertices); + glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, cache->indices); +#endif - if (q->state()->clipTestEnabled) { - // Pass when high bit is set, replace stencil value with current clip - glStencilFunc(GL_NOTEQUAL, q->state()->currentClip, GL_STENCIL_HIGH_BIT); - } else if (path.hasWindingFill()) { - // Pass when any bit is set, replace stencil value with 0 - glStencilFunc(GL_NOTEQUAL, 0, 0xff); } else { - // Pass when high bit is set, replace stencil value with 0 - glStencilFunc(GL_NOTEQUAL, 0, GL_STENCIL_HIGH_BIT); - } - prepareForDraw(currentBrush.isOpaque()); + // printf(" - Marking path as cachable...\n"); + // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable + if (do_vectorpath_cache) + path.makeCacheable(); - // Stencil the brush onto the dest buffer - composite(vertexCoordinateArray.boundingRect()); - glStencilMask(0); - updateClipScissorTest(); + // The path is too complicated & needs the stencil technique + vertexCoordinateArray.clear(); + vertexCoordinateArray.addPath(path, inverseScale, false); + + fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill()); + + glStencilMask(0xff); + glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE); + + if (q->state()->clipTestEnabled) { + // Pass when high bit is set, replace stencil value with current clip + glStencilFunc(GL_NOTEQUAL, q->state()->currentClip, GL_STENCIL_HIGH_BIT); + } else if (path.hasWindingFill()) { + // Pass when any bit is set, replace stencil value with 0 + glStencilFunc(GL_NOTEQUAL, 0, 0xff); + } else { + // Pass when high bit is set, replace stencil value with 0 + glStencilFunc(GL_NOTEQUAL, 0, GL_STENCIL_HIGH_BIT); + } + prepareForDraw(currentBrush.isOpaque()); + + // Stencil the brush onto the dest buffer + composite(vertexCoordinateArray.boundingRect()); + glStencilMask(0); + updateClipScissorTest(); + } } } @@ -1601,6 +1702,10 @@ bool QGL2PaintEngineEx::end() glDeleteBuffers(d->unusedVBOSToClean.size(), d->unusedVBOSToClean.constData()); d->unusedVBOSToClean.clear(); } + if (!d->unusedIBOSToClean.isEmpty()) { + glDeleteBuffers(d->unusedIBOSToClean.size(), d->unusedIBOSToClean.constData()); + d->unusedIBOSToClean.clear(); + } #endif return false; diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 8fa0eff..35c88f4 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -293,6 +293,7 @@ public: QSet<QVectorPath::CacheEntry *> pathCaches; QVector<GLuint> unusedVBOSToClean; + QVector<GLuint> unusedIBOSToClean; const GLfloat *vertexAttribPointers[3]; }; diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp new file mode 100644 index 0000000..115f31b --- /dev/null +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -0,0 +1,2983 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qtriangulator_p.h" + +#include <QtGui/qdialog.h> +#include <QtGui/qevent.h> +#include <QtGui/qpainter.h> +#include <QtGui/qpainterpath.h> +#include <QtGui/private/qbezier_p.h> +#include <QtGui/private/qdatabuffer_p.h> +#include <QtCore/qbitarray.h> +#include <QtCore/qvarlengtharray.h> +#include <QtCore/qqueue.h> +#include <QtCore/qglobal.h> +#include <QtCore/qpoint.h> +#include <QtCore/qalgorithms.h> +#include <QtDebug> + +#include <math.h> + +QT_BEGIN_NAMESPACE + +//#define Q_TRIANGULATOR_DEBUG + +#define Q_FIXED_POINT_SCALE 32 + +// Quick sort. +template <class T, class LessThan> +static void sort(T *array, int count, LessThan lessThan) +{ + // If the number of elements fall below some threshold, use insertion sort. + const int INSERTION_SORT_LIMIT = 7; // About 7 is fastest on my computer... + if (count <= INSERTION_SORT_LIMIT) { + for (int i = 1; i < count; ++i) { + T temp = array[i]; + int j = i; + while (j > 0 && lessThan(temp, array[j - 1])) { + array[j] = array[j - 1]; + --j; + } + array[j] = temp; + } + return; + } + + int high = count - 1; + int low = 0; + int mid = high / 2; + if (lessThan(array[mid], array[low])) + qSwap(array[mid], array[low]); + if (lessThan(array[high], array[mid])) + qSwap(array[high], array[mid]); + if (lessThan(array[mid], array[low])) + qSwap(array[mid], array[low]); + + --high; + ++low; + qSwap(array[mid], array[high]); + int pivot = high; + --high; + + while (low <= high) { + while (!lessThan(array[pivot], array[low])) { + ++low; + if (low > high) + goto sort_loop_end; + } + while (!lessThan(array[high], array[pivot])) { + --high; + if (low > high) + goto sort_loop_end; + } + qSwap(array[low], array[high]); + ++low; + --high; + } +sort_loop_end: + if (low != pivot) + qSwap(array[pivot], array[low]); + sort(array, low, lessThan); + sort(array + low + 1, count - low - 1, lessThan); +} + +// Quick sort. +template <class T> +static void sort(T *array, int count) +{ + // If the number of elements fall below some threshold, use insertion sort. + const int INSERTION_SORT_LIMIT = 25; // About 25 is fastest on my computer... + if (count <= INSERTION_SORT_LIMIT) { + for (int i = 1; i < count; ++i) { + T temp = array[i]; + int j = i; + while (j > 0 && (temp < array[j - 1])) { + array[j] = array[j - 1]; + --j; + } + array[j] = temp; + } + return; + } + + int high = count - 1; + int low = 0; + int mid = high / 2; + if ((array[mid] < array[low])) + qSwap(array[mid], array[low]); + if ((array[high] < array[mid])) + qSwap(array[high], array[mid]); + if ((array[mid] < array[low])) + qSwap(array[mid], array[low]); + + --high; + ++low; + qSwap(array[mid], array[high]); + int pivot = high; + --high; + + while (low <= high) { + while (!(array[pivot] < array[low])) { + ++low; + if (low > high) + goto sort_loop_end; + } + while (!(array[high] < array[pivot])) { + --high; + if (low > high) + goto sort_loop_end; + } + qSwap(array[low], array[high]); + ++low; + --high; + } +sort_loop_end: + if (low != pivot) + qSwap(array[pivot], array[low]); + sort(array, low); + sort(array + low + 1, count - low - 1); +} + +//============================================================================// +// QFraction // +//============================================================================// + +// Fraction must be in the range [0, 1) +struct QFraction +{ + // Comparison operators must not be called on invalid fractions. + inline bool operator < (const QFraction &other) const; + inline bool operator == (const QFraction &other) const; + inline bool operator != (const QFraction &other) const {return !(*this == other);} + inline bool operator > (const QFraction &other) const {return other < *this;} + inline bool operator >= (const QFraction &other) const {return !(*this < other);} + inline bool operator <= (const QFraction &other) const {return !(*this > other);} + + inline bool isValid() const {return denominator != 0;} + + // numerator and denominator must not have common denominators. + quint64 numerator, denominator; +}; + +static inline quint64 gcd(quint64 x, quint64 y) +{ + while (y != 0) { + quint64 z = y; + y = x % y; + x = z; + } + return x; +} + +static inline int compare(quint64 a, quint64 b) +{ + return (a > b) - (a < b); +} + +// Compare a/b with c/d. +// Return negative if less, 0 if equal, positive if greater. +// a < b, c < d +static int qCompareFractions(quint64 a, quint64 b, quint64 c, quint64 d) +{ + const quint64 LIMIT = Q_UINT64_C(0x100000000); + for (;;) { + // If the products 'ad' and 'bc' fit into 64 bits, they can be directly compared. + if (b < LIMIT && d < LIMIT) + return compare(a * d, b * c); + + if (a == 0 || c == 0) + return compare(a, c); + + // a/b < c/d <=> d/c < b/a + quint64 b_div_a = b / a; + quint64 d_div_c = d / c; + if (b_div_a != d_div_c) + return compare(d_div_c, b_div_a); + + // floor(d/c) == floor(b/a) + // frac(d/c) < frac(b/a) ? + // frac(x/y) = (x%y)/y + d -= d_div_c * c; //d %= c; + b -= b_div_a * a; //b %= a; + qSwap(a, d); + qSwap(b, c); + } +} + +// Fraction must be in the range [0, 1) +// Assume input is valid. +static QFraction qFraction(quint64 n, quint64 d) { + QFraction result; + if (n == 0) { + result.numerator = 0; + result.denominator = 1; + } else { + quint64 g = gcd(n, d); + result.numerator = n / g; + result.denominator = d / g; + } + return result; +} + +inline bool QFraction::operator < (const QFraction &other) const +{ + return qCompareFractions(numerator, denominator, other.numerator, other.denominator) < 0; +} + +inline bool QFraction::operator == (const QFraction &other) const +{ + return numerator == other.numerator && denominator == other.denominator; +} + +//============================================================================// +// QPodPoint // +//============================================================================// + +struct QPodPoint +{ + inline bool operator < (const QPodPoint &other) const + { + if (y != other.y) + return y < other.y; + return x < other.x; + } + + inline bool operator > (const QPodPoint &other) const {return other < *this;} + inline bool operator <= (const QPodPoint &other) const {return !(*this > other);} + inline bool operator >= (const QPodPoint &other) const {return !(*this < other);} + inline bool operator == (const QPodPoint &other) const {return x == other.x && y == other.y;} + inline bool operator != (const QPodPoint &other) const {return x != other.x || y != other.y;} + + inline QPodPoint &operator += (const QPodPoint &other) {x += other.x; y += other.y; return *this;} + inline QPodPoint &operator -= (const QPodPoint &other) {x -= other.x; y -= other.y; return *this;} + inline QPodPoint operator + (const QPodPoint &other) const {QPodPoint result = {x + other.x, y + other.y}; return result;} + inline QPodPoint operator - (const QPodPoint &other) const {QPodPoint result = {x - other.x, y - other.y}; return result;} + + int x; + int y; +}; + +static inline qint64 qCross(const QPodPoint &u, const QPodPoint &v) +{ + return qint64(u.x) * qint64(v.y) - qint64(u.y) * qint64(v.x); +} + +static inline qint64 qDot(const QPodPoint &u, const QPodPoint &v) +{ + return qint64(u.x) * qint64(v.x) + qint64(u.y) * qint64(v.y); +} + +// Return positive value if 'p' is to the right of the line 'v1'->'v2', negative if left of the +// line and zero if exactly on the line. +// The returned value is the z-component of the qCross product between 'v2-v1' and 'p-v1', +// which is twice the signed area of the triangle 'p'->'v1'->'v2' (positive for CW order). +static inline qint64 qPointDistanceFromLine(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2) +{ + return qCross(v2 - v1, p - v1); +} + +static inline bool qPointIsLeftOfLine(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2) +{ + return qPointDistanceFromLine(p, v1, v2) < 0; +} + +// Return: +// -1 if u < v +// 0 if u == v +// 1 if u > v +static int comparePoints(const QPodPoint &u, const QPodPoint &v) +{ + if (u.y < v.y) + return -1; + if (u.y > v.y) + return 1; + if (u.x < v.x) + return -1; + if (u.x > v.x) + return 1; + return 0; +} + +//============================================================================// +// QIntersectionPoint // +//============================================================================// + +struct QIntersectionPoint +{ + inline bool isValid() const {return xOffset.isValid() && yOffset.isValid();} + QPodPoint round() const; + inline bool isAccurate() const {return xOffset.numerator == 0 && yOffset.numerator == 0;} + bool operator < (const QIntersectionPoint &other) const; + bool operator == (const QIntersectionPoint &other) const; + inline bool operator != (const QIntersectionPoint &other) const {return !(*this == other);} + inline bool operator > (const QIntersectionPoint &other) const {return other < *this;} + inline bool operator >= (const QIntersectionPoint &other) const {return !(*this < other);} + inline bool operator <= (const QIntersectionPoint &other) const {return !(*this > other);} + bool isOnLine(const QPodPoint &u, const QPodPoint &v) const; + + QPodPoint upperLeft; + QFraction xOffset; + QFraction yOffset; +}; + +static inline QIntersectionPoint qIntersectionPoint(const QPodPoint &point) +{ + // upperLeft = point, xOffset = 0/1, yOffset = 0/1. + QIntersectionPoint p = {{point.x, point.y}, {0, 1}, {0, 1}}; + return p; +} + +static inline QIntersectionPoint qIntersectionPoint(int x, int y) +{ + // upperLeft = (x, y), xOffset = 0/1, yOffset = 0/1. + QIntersectionPoint p = {{x, y}, {0, 1}, {0, 1}}; + return p; +} + +static QIntersectionPoint qIntersectionPoint(const QPodPoint &u1, const QPodPoint &u2, const QPodPoint &v1, const QPodPoint &v2) +{ + QIntersectionPoint result = {{0, 0}, {0, 0}, {0, 0}}; + + QPodPoint u = u2 - u1; + QPodPoint v = v2 - v1; + qint64 d1 = qCross(u, v1 - u1); + qint64 d2 = qCross(u, v2 - u1); + qint64 det = d2 - d1; + qint64 d3 = qCross(v, u1 - v1); + qint64 d4 = d3 - det; //qCross(v, u2 - v1); + + // Check that the math is correct. + Q_ASSERT(d4 == qCross(v, u2 - v1)); + + // The intersection point can be expressed as: + // v1 - v * d1/det + // v2 - v * d2/det + // u1 + u * d3/det + // u2 + u * d4/det + + // I'm only interested in lines that are crossing, so ignore parallel lines even if they overlap. + if (det == 0) + return result; + + if (det < 0) { + det = -det; + d1 = -d1; + d2 = -d2; + d3 = -d3; + d4 = -d4; + } + + // I'm only interested in lines intersecting at their interior, not at their end points. + // The lines intersect at their interior if and only if 'd1 < 0', 'd2 > 0', 'd3 < 0' and 'd4 > 0'. + if (d1 >= 0 || d2 <= 0 || d3 <= 0 || d4 >= 0) + return result; + + // Calculate the intersection point as follows: + // v1 - v * d1/det | v1 <= v2 (component-wise) + // v2 - v * d2/det | v2 < v1 (component-wise) + + // Assuming 21 bits per vector component. + // TODO: Make code path for 31 bits per vector component. + if (v.x >= 0) { + result.upperLeft.x = v1.x + (-v.x * d1) / det; + result.xOffset = qFraction(quint64(-v.x * d1) % quint64(det), quint64(det)); + } else { + result.upperLeft.x = v2.x + (-v.x * d2) / det; + result.xOffset = qFraction(quint64(-v.x * d2) % quint64(det), quint64(det)); + } + + if (v.y >= 0) { + result.upperLeft.y = v1.y + (-v.y * d1) / det; + result.yOffset = qFraction(quint64(-v.y * d1) % quint64(det), quint64(det)); + } else { + result.upperLeft.y = v2.y + (-v.y * d2) / det; + result.yOffset = qFraction(quint64(-v.y * d2) % quint64(det), quint64(det)); + } + + Q_ASSERT(result.xOffset.isValid()); + Q_ASSERT(result.yOffset.isValid()); + return result; +} + +QPodPoint QIntersectionPoint::round() const +{ + QPodPoint result = upperLeft; + if (2 * xOffset.numerator >= xOffset.denominator) + ++result.x; + if (2 * yOffset.numerator >= yOffset.denominator) + ++result.y; + return result; +} + +bool QIntersectionPoint::operator < (const QIntersectionPoint &other) const +{ + if (upperLeft.y != other.upperLeft.y) + return upperLeft.y < other.upperLeft.y; + if (yOffset != other.yOffset) + return yOffset < other.yOffset; + if (upperLeft.x != other.upperLeft.x) + return upperLeft.x < other.upperLeft.x; + return xOffset < other.xOffset; +} + +bool QIntersectionPoint::operator == (const QIntersectionPoint &other) const +{ + return upperLeft == other.upperLeft && xOffset == other.xOffset && yOffset == other.yOffset; +} + +// Returns true if this point is on the infinite line passing through 'u' and 'v'. +bool QIntersectionPoint::isOnLine(const QPodPoint &u, const QPodPoint &v) const +{ + // TODO: Make code path for coordinates with more than 21 bits. + const QPodPoint p = upperLeft - u; + const QPodPoint q = v - u; + bool isHorizontal = p.y == 0 && yOffset.numerator == 0; + bool isVertical = p.x == 0 && xOffset.numerator == 0; + if (isHorizontal && isVertical) + return true; + if (isHorizontal) + return q.y == 0; + if (q.y == 0) + return false; + if (isVertical) + return q.x == 0; + if (q.x == 0) + return false; + + // At this point, 'p+offset' and 'q' cannot lie on the x or y axis. + + if (((q.x < 0) == (q.y < 0)) != ((p.x < 0) == (p.y < 0))) + return false; // 'p + offset' and 'q' pass through different quadrants. + + // Move all coordinates into the first quadrant. + quint64 nx, ny; + if (p.x < 0) + nx = quint64(-p.x) * xOffset.denominator - xOffset.numerator; + else + nx = quint64(p.x) * xOffset.denominator + xOffset.numerator; + if (p.y < 0) + ny = quint64(-p.y) * yOffset.denominator - yOffset.numerator; + else + ny = quint64(p.y) * yOffset.denominator + yOffset.numerator; + + return qFraction(quint64(qAbs(q.x)) * xOffset.denominator, quint64(qAbs(q.y)) * yOffset.denominator) == qFraction(nx, ny); +} + +//============================================================================// +// QMaxHeap // +//============================================================================// + +template <class T> +class QMaxHeap +{ +public: + inline int size() const {return m_data.size();} + inline bool empty() const {return m_data.isEmpty();} + inline bool isEmpty() const {return m_data.isEmpty();} + void push(const T &x); + T pop(); + inline const T &top() const {return m_data.first();} +private: + static inline int parent(int i) {return (i - 1) / 2;} + static inline int left(int i) {return 2 * i + 1;} + static inline int right(int i) {return 2 * i + 2;} + + QDataBuffer<T> m_data; +}; + +template <class T> +void QMaxHeap<T>::push(const T &x) +{ + int current = m_data.size(); + int parent = QMaxHeap::parent(current); + m_data.add(x); + while (current != 0 && m_data.at(parent) < x) { + m_data.at(current) = m_data.at(parent); + current = parent; + parent = QMaxHeap::parent(current); + } + m_data.at(current) = x; +} + +template <class T> +T QMaxHeap<T>::pop() +{ + T result = m_data.first(); + T back = m_data.last(); + m_data.pop_back(); + if (!m_data.isEmpty()) { + int current = 0; + for (;;) { + int left = QMaxHeap::left(current); + int right = QMaxHeap::right(current); + if (left >= m_data.size()) + break; + int greater = left; + if (right < m_data.size() && m_data.at(left) < m_data.at(right)) + greater = right; + if (m_data.at(greater) < back) + break; + m_data.at(current) = m_data.at(greater); + current = greater; + } + m_data.at(current) = back; + } + return result; +} + +//============================================================================// +// QRBTree // +//============================================================================// + +template <class T> +struct QRBTree +{ + struct Node + { + inline Node() : parent(0), left(0), right(0), red(true) { } + inline ~Node() {if (left) delete left; if (right) delete right;} + T data; + Node *parent; + Node *left; + Node *right; + bool red; + }; + + inline QRBTree() : root(0), freeList(0) { } + inline ~QRBTree(); + + inline void clear(); + + void attachBefore(Node *parent, Node *child); + void attachAfter(Node *parent, Node *child); + + inline Node *front(Node *node) const; + inline Node *back(Node *node) const; + Node *next(Node *node) const; + Node *previous(Node *node) const; + + inline void deleteNode(Node *&node); + inline Node *newNode(); + + // Return 1 if 'left' comes after 'right', 0 if equal, and -1 otherwise. + // 'left' and 'right' cannot be null. + int order(Node *left, Node *right); + inline bool verify() const; + +private: + void rotateLeft(Node *node); + void rotateRight(Node *node); + void update(Node *node); + + inline void attachLeft(Node *parent, Node *child); + inline void attachRight(Node *parent, Node *child); + + int blackDepth(Node *top) const; + bool checkRedBlackProperty(Node *top) const; + + void swapNodes(Node *n1, Node *n2); + void detach(Node *node); + + // 'node' must be black. rebalance will reduce the depth of black nodes by one in the sibling tree. + void rebalance(Node *node); + +public: + Node *root; +private: + Node *freeList; +}; + +template <class T> +inline QRBTree<T>::~QRBTree() +{ + clear(); + while (freeList) { + // Avoid recursively calling the destructor, as this list may become large. + Node *next = freeList->right; + freeList->right = 0; + delete freeList; + freeList = next; + } +} + +template <class T> +inline void QRBTree<T>::clear() +{ + if (root) + delete root; + root = 0; +} + +template <class T> +void QRBTree<T>::rotateLeft(Node *node) +{ + // | | // + // N B // + // / \ / \ // + // A B ---> N D // + // / \ / \ // + // C D A C // + + Node *&ref = (node->parent ? (node == node->parent->left ? node->parent->left : node->parent->right) : root); + ref = node->right; + node->right->parent = node->parent; + + // : // + // N // + // / :| // + // A B // + // / \ // + // C D // + + node->right = ref->left; + if (ref->left) + ref->left->parent = node; + + // : | // + // N B // + // / \ : \ // + // A C D // + + ref->left = node; + node->parent = ref; + + // | // + // B // + // / \ // + // N D // + // / \ // + // A C // +} + +template <class T> +void QRBTree<T>::rotateRight(Node *node) +{ + // | | // + // N A // + // / \ / \ // + // A B ---> C N // + // / \ / \ // + // C D D B // + + Node *&ref = (node->parent ? (node == node->parent->left ? node->parent->left : node->parent->right) : root); + ref = node->left; + node->left->parent = node->parent; + + node->left = ref->right; + if (ref->right) + ref->right->parent = node; + + ref->right = node; + node->parent = ref; +} + +template <class T> +void QRBTree<T>::update(Node *node) // call this after inserting a node +{ + for (;;) { + Node *parent = node->parent; + + // if the node is the root, color it black + if (!parent) { + node->red = false; + return; + } + + // if the parent is black, the node can be left red + if (!parent->red) + return; + + // at this point, the parent is red and cannot be the root + Node *grandpa = parent->parent; + Q_ASSERT(grandpa); + + Node *uncle = (parent == grandpa->left ? grandpa->right : grandpa->left); + if (uncle && uncle->red) { + // grandpa's black, parent and uncle are red. + // let parent and uncle be black, grandpa red and recursively update grandpa. + Q_ASSERT(!grandpa->red); + parent->red = false; + uncle->red = false; + grandpa->red = true; + node = grandpa; + continue; + } + + // at this point, uncle is black + if (node == parent->right && parent == grandpa->left) + rotateLeft(node = parent); + else if (node == parent->left && parent == grandpa->right) + rotateRight(node = parent); + parent = node->parent; + + if (parent == grandpa->left) { + rotateRight(grandpa); + parent->red = false; + grandpa->red = true; + } else { + rotateLeft(grandpa); + parent->red = false; + grandpa->red = true; + } + return; + } +} + +template <class T> +inline void QRBTree<T>::attachLeft(Node *parent, Node *child) +{ + Q_ASSERT(!parent->left); + parent->left = child; + child->parent = parent; + update(child); +} + +template <class T> +inline void QRBTree<T>::attachRight(Node *parent, Node *child) +{ + Q_ASSERT(!parent->right); + parent->right = child; + child->parent = parent; + update(child); +} + +template <class T> +void QRBTree<T>::attachBefore(Node *parent, Node *child) +{ + if (!root) + update(root = child); + else if (!parent) + attachRight(back(root), child); + else if (parent->left) + attachRight(back(parent->left), child); + else + attachLeft(parent, child); +} + +template <class T> +void QRBTree<T>::attachAfter(Node *parent, Node *child) +{ + if (!root) + update(root = child); + else if (!parent) + attachLeft(front(root), child); + else if (parent->right) + attachLeft(front(parent->right), child); + else + attachRight(parent, child); +} + +template <class T> +void QRBTree<T>::swapNodes(Node *n1, Node *n2) +{ + // Since iterators must not be invalidated, it is not sufficient to only swap the data. + if (n1->parent == n2) { + n1->parent = n2->parent; + n2->parent = n1; + } else if (n2->parent == n1) { + n2->parent = n1->parent; + n1->parent = n2; + } else { + qSwap(n1->parent, n2->parent); + } + + qSwap(n1->left, n2->left); + qSwap(n1->right, n2->right); + qSwap(n1->red, n2->red); + + if (n1->parent) { + if (n1->parent->left == n2) + n1->parent->left = n1; + else + n1->parent->right = n1; + } else { + root = n1; + } + + if (n2->parent) { + if (n2->parent->left == n1) + n2->parent->left = n2; + else + n2->parent->right = n2; + } else { + root = n2; + } + + if (n1->left) + n1->left->parent = n1; + if (n1->right) + n1->right->parent = n1; + + if (n2->left) + n2->left->parent = n2; + if (n2->right) + n2->right->parent = n2; +} + +template <class T> +void QRBTree<T>::detach(Node *node) // call this before removing a node. +{ + if (node->right) + swapNodes(node, front(node->right)); + + Node *child = (node->left ? node->left : node->right); + + if (!node->red) { + if (child && child->red) + child->red = false; + else + rebalance(node); + } + + Node *&ref = (node->parent ? (node == node->parent->left ? node->parent->left : node->parent->right) : root); + ref = child; + if (child) + child->parent = node->parent; + node->left = node->right = node->parent = 0; +} + +// 'node' must be black. rebalance will reduce the depth of black nodes by one in the sibling tree. +template <class T> +void QRBTree<T>::rebalance(Node *node) +{ + Q_ASSERT(!node->red); + for (;;) { + if (!node->parent) + return; + + // at this point, node is not a parent, it is black, thus it must have a sibling. + Node *sibling = (node == node->parent->left ? node->parent->right : node->parent->left); + Q_ASSERT(sibling); + + if (sibling->red) { + sibling->red = false; + node->parent->red = true; + if (node == node->parent->left) + rotateLeft(node->parent); + else + rotateRight(node->parent); + sibling = (node == node->parent->left ? node->parent->right : node->parent->left); + Q_ASSERT(sibling); + } + + // at this point, the sibling is black. + Q_ASSERT(!sibling->red); + + if ((!sibling->left || !sibling->left->red) && (!sibling->right || !sibling->right->red)) { + bool parentWasRed = node->parent->red; + sibling->red = true; + node->parent->red = false; + if (parentWasRed) + return; + node = node->parent; + continue; + } + + // at this point, at least one of the sibling's children is red. + + if (node == node->parent->left) { + if (!sibling->right || !sibling->right->red) { + Q_ASSERT(sibling->left); + sibling->red = true; + sibling->left->red = false; + rotateRight(sibling); + + sibling = sibling->parent; + Q_ASSERT(sibling); + } + sibling->red = node->parent->red; + node->parent->red = false; + + Q_ASSERT(sibling->right->red); + sibling->right->red = false; + rotateLeft(node->parent); + } else { + if (!sibling->left || !sibling->left->red) { + Q_ASSERT(sibling->right); + sibling->red = true; + sibling->right->red = false; + rotateLeft(sibling); + + sibling = sibling->parent; + Q_ASSERT(sibling); + } + sibling->red = node->parent->red; + node->parent->red = false; + + Q_ASSERT(sibling->left->red); + sibling->left->red = false; + rotateRight(node->parent); + } + return; + } +} + +template <class T> +inline typename QRBTree<T>::Node *QRBTree<T>::front(Node *node) const +{ + while (node->left) + node = node->left; + return node; +} + +template <class T> +inline typename QRBTree<T>::Node *QRBTree<T>::back(Node *node) const +{ + while (node->right) + node = node->right; + return node; +} + +template <class T> +typename QRBTree<T>::Node *QRBTree<T>::next(Node *node) const +{ + if (node->right) + return front(node->right); + while (node->parent && node == node->parent->right) + node = node->parent; + return node->parent; +} + +template <class T> +typename QRBTree<T>::Node *QRBTree<T>::previous(Node *node) const +{ + if (node->left) + return back(node->left); + while (node->parent && node == node->parent->left) + node = node->parent; + return node->parent; +} + +template <class T> +int QRBTree<T>::blackDepth(Node *top) const +{ + if (!top) + return 0; + int leftDepth = blackDepth(top->left); + int rightDepth = blackDepth(top->right); + if (leftDepth != rightDepth) + return -1; + if (!top->red) + ++leftDepth; + return leftDepth; +} + +template <class T> +bool QRBTree<T>::checkRedBlackProperty(Node *top) const +{ + if (!top) + return true; + if (top->left && !checkRedBlackProperty(top->left)) + return false; + if (top->right && !checkRedBlackProperty(top->right)) + return false; + return !(top->red && ((top->left && top->left->red) || (top->right && top->right->red))); +} + +template <class T> +inline bool QRBTree<T>::verify() const +{ + return checkRedBlackProperty(root) && blackDepth(root) != -1; +} + +template <class T> +inline void QRBTree<T>::deleteNode(Node *&node) +{ + Q_ASSERT(node); + detach(node); + node->right = freeList; + freeList = node; + node = 0; +} + +template <class T> +inline typename QRBTree<T>::Node *QRBTree<T>::newNode() +{ + if (freeList) { + Node *node = freeList; + freeList = freeList->right; + node->parent = node->left = node->right = 0; + node->red = true; + return node; + } + return new Node; +} + +// Return 1 if 'left' comes after 'right', 0 if equal, and -1 otherwise. +// 'left' and 'right' cannot be null. +template <class T> +int QRBTree<T>::order(Node *left, Node *right) +{ + Q_ASSERT(left && right); + if (left == right) + return 0; + + QVector<Node *> leftAncestors; + QVector<Node *> rightAncestors; + while (left) { + leftAncestors.push_back(left); + left = left->parent; + } + while (right) { + rightAncestors.push_back(right); + right = right->parent; + } + Q_ASSERT(leftAncestors.back() == root && rightAncestors.back() == root); + + while (!leftAncestors.empty() && !rightAncestors.empty() && leftAncestors.back() == rightAncestors.back()) { + leftAncestors.pop_back(); + rightAncestors.pop_back(); + } + + if (!leftAncestors.empty()) + return (leftAncestors.back() == leftAncestors.back()->parent->left ? -1 : 1); + + if (!rightAncestors.empty()) + return (rightAncestors.back() == rightAncestors.back()->parent->right ? -1 : 1); + + // The code should never reach this point. + Q_ASSERT(!leftAncestors.empty() || !rightAncestors.empty()); + return 0; +} + +//============================================================================// +// QInt64Hash // +//============================================================================// + +// Copied from qhash.cpp +static const uchar prime_deltas[] = { + 0, 0, 1, 3, 1, 5, 3, 3, 1, 9, 7, 5, 3, 9, 25, 3, + 1, 21, 3, 21, 7, 15, 9, 5, 3, 29, 15, 0, 0, 0, 0, 0 +}; + +// Copied from qhash.cpp +static inline int primeForNumBits(int numBits) +{ + return (1 << numBits) + prime_deltas[numBits]; +} + +static inline int primeForCount(int count) +{ + int low = 0; + int high = 32; + for (int i = 0; i < 5; ++i) { + int mid = (high + low) / 2; + if (count >= 1 << mid) + low = mid; + else + high = mid; + } + return primeForNumBits(high); +} + +// Hash set of quint64s. Elements cannot be removed without clearing the +// entire set. A value of -1 is used to mark unused entries. +class QInt64Set +{ +public: + inline QInt64Set(int capacity = 64); + inline ~QInt64Set() {if (m_array) delete[] m_array;} + inline bool isValid() const {return m_array;} + void insert(quint64 key); + bool contains(quint64 key) const; + inline void clear(); +private: + bool rehash(int capacity); + + static const quint64 UNUSED; + + quint64 *m_array; + int m_capacity; + int m_count; +}; + +const quint64 QInt64Set::UNUSED = quint64(-1); + +inline QInt64Set::QInt64Set(int capacity) +{ + m_capacity = primeForCount(capacity); + m_array = new quint64[m_capacity]; + if (m_array) + clear(); + else + m_capacity = 0; +} + +bool QInt64Set::rehash(int capacity) +{ + quint64 *oldArray = m_array; + int oldCapacity = m_capacity; + + m_capacity = capacity; + m_array = new quint64[m_capacity]; + if (m_array) { + clear(); + if (oldArray) { + for (int i = 0; i < oldCapacity; ++i) { + if (oldArray[i] != UNUSED) + insert(oldArray[i]); + } + delete[] oldArray; + } + return true; + } else { + m_capacity = oldCapacity; + m_array = oldArray; + return false; + } +} + +void QInt64Set::insert(quint64 key) +{ + if (m_count > 3 * m_capacity / 4) + rehash(primeForCount(2 * m_capacity)); + Q_ASSERT_X(m_array, "QInt64Hash<T>::insert", "Hash set not allocated."); + int index = int(key % m_capacity); + for (int i = 0; i < m_capacity; ++i) { + index += i; + if (index >= m_capacity) + index -= m_capacity; + if (m_array[index] == key) + return; + if (m_array[index] == UNUSED) { + ++m_count; + m_array[index] = key; + return; + } + } + Q_ASSERT_X(0, "QInt64Hash<T>::insert", "Hash set full."); +} + +bool QInt64Set::contains(quint64 key) const +{ + Q_ASSERT_X(m_array, "QInt64Hash<T>::contains", "Hash set not allocated."); + int index = int(key % m_capacity); + for (int i = 0; i < m_capacity; ++i) { + index += i; + if (index >= m_capacity) + index -= m_capacity; + if (m_array[index] == key) + return true; + if (m_array[index] == UNUSED) + return false; + } + return false; +} + +inline void QInt64Set::clear() +{ + Q_ASSERT_X(m_array, "QInt64Hash<T>::clear", "Hash set not allocated."); + for (int i = 0; i < m_capacity; ++i) + m_array[i] = UNUSED; + m_count = 0; +} + +//============================================================================// +// QRingBuffer // +//============================================================================// + +// T must be POD. +template <class T> +class QRingBuffer +{ +public: + inline QRingBuffer() : m_array(0), m_head(0), m_size(0), m_capacity(0) { } + inline ~QRingBuffer() {if (m_array) delete[] m_array;} + bool reallocate(int capacity); + inline const T &head() const {Q_ASSERT(m_size > 0); return m_array[m_head];} + inline const T &dequeue(); + inline void enqueue(const T &x); + inline bool isEmpty() const {return m_size == 0;} +private: + T *m_array; + int m_head; + int m_size; + int m_capacity; +}; + +template <class T> +bool QRingBuffer<T>::reallocate(int capacity) +{ + T *oldArray = m_array; + m_array = new T[capacity]; + if (m_array) { + if (oldArray) { + if (m_head + m_size > m_capacity) { + memcpy(m_array, oldArray + m_head, (m_capacity - m_head) * sizeof(T)); + memcpy(m_array + (m_capacity - m_head), oldArray, (m_head + m_size - m_capacity) * sizeof(T)); + } else { + memcpy(m_array, oldArray + m_head, m_size * sizeof(T)); + } + delete[] oldArray; + } + m_capacity = capacity; + m_head = 0; + return true; + } else { + m_array = oldArray; + return false; + } +} + +template <class T> +inline const T &QRingBuffer<T>::dequeue() +{ + Q_ASSERT(m_size > 0); + Q_ASSERT(m_array); + Q_ASSERT(m_capacity >= m_size); + int index = m_head; + if (++m_head >= m_capacity) + m_head -= m_capacity; + --m_size; + return m_array[index]; +} + +template <class T> +inline void QRingBuffer<T>::enqueue(const T &x) +{ + if (m_size == m_capacity) + reallocate(qMax(2 * m_capacity, 64)); + int index = m_head + m_size; + if (index >= m_capacity) + index -= m_capacity; + m_array[index] = x; + ++m_size; +} + +//============================================================================// +// QTriangulator // +//============================================================================// + +class QTriangulator +{ +public: + typedef QVarLengthArray<int, 6> ShortArray; + + //================================// + // QTriangulator::ComplexToSimple // + //================================// + friend class ComplexToSimple; + class ComplexToSimple + { + public: + inline ComplexToSimple(QTriangulator *parent) : m_parent(parent) { } + void decompose(); + private: + struct Edge + { + inline int &upper() {return pointingUp ? to : from;} + inline int &lower() {return pointingUp ? from : to;} + inline int upper() const {return pointingUp ? to : from;} + inline int lower() const {return pointingUp ? from : to;} + + QRBTree<int>::Node *node; + int from, to; // vertex + int next, previous; // edge + int winding; + bool mayIntersect; + bool pointingUp, originallyPointingUp; + }; + + friend class CompareEdges; + class CompareEdges + { + public: + inline CompareEdges(ComplexToSimple *parent) : m_parent(parent) { } + bool operator () (int i, int j) const; + private: + ComplexToSimple *m_parent; + }; + + struct Intersection + { + bool operator < (const Intersection &other) const {return other.intersectionPoint < intersectionPoint;} + + QIntersectionPoint intersectionPoint; + int vertex; + int leftEdge; + int rightEdge; + }; + + struct Split + { + int vertex; + int edge; + bool accurate; + }; + + struct Event + { + enum Type {Upper, Lower}; + inline bool operator < (const Event &other) const; + + QPodPoint point; + Type type; + int edge; + }; + +#ifdef Q_TRIANGULATOR_DEBUG + friend class DebugDialog; + friend class QTriangulator; + class DebugDialog : public QDialog + { + public: + DebugDialog(ComplexToSimple *parent, int currentVertex); + protected: + void paintEvent(QPaintEvent *); + void wheelEvent(QWheelEvent *); + void mouseMoveEvent(QMouseEvent *); + void mousePressEvent(QMouseEvent *); + private: + ComplexToSimple *m_parent; + QRectF m_window; + QPoint m_lastMousePos; + int m_vertex; + }; +#endif + + void initEdges(); + bool calculateIntersection(int left, int right); + bool edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const; + QRBTree<int>::Node *searchEdgeLeftOf(int edgeIndex) const; + QRBTree<int>::Node *searchEdgeLeftOf(int edgeIndex, QRBTree<int>::Node *after) const; + QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> bounds(const QPodPoint &point) const; + QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> outerBounds(const QPodPoint &point) const; + void splitEdgeListRange(QRBTree<int>::Node *leftmost, QRBTree<int>::Node *rightmost, int vertex, const QIntersectionPoint &intersectionPoint); + void reorderEdgeListRange(QRBTree<int>::Node *leftmost, QRBTree<int>::Node *rightmost); + void sortEdgeList(const QPodPoint eventPoint); + void fillPriorityQueue(); + void calculateIntersections(); + int splitEdge(int splitIndex); + bool splitEdgesAtIntersections(); + void insertEdgeIntoVectorIfWanted(ShortArray &orderedEdges, int i); + void removeUnwantedEdgesAndConnect(); + void removeUnusedPoints(); + + QTriangulator *m_parent; + QDataBuffer<Edge> m_edges; + QRBTree<int> m_edgeList; + QDataBuffer<Event> m_events; + QDataBuffer<Split> m_splits; + QMaxHeap<Intersection> m_topIntersection; + QInt64Set m_processedEdgePairs; + int m_initialPointCount; + }; +#ifdef Q_TRIANGULATOR_DEBUG + friend class ComplexToSimple::DebugDialog; +#endif + + //=================================// + // QTriangulator::SimpleToMonotone // + //=================================// + friend class SimpleToMonotone; + class SimpleToMonotone + { + public: + inline SimpleToMonotone(QTriangulator *parent) : m_parent(parent) { } + void decompose(); + private: + enum VertexType {MergeVertex, EndVertex, RegularVertex, StartVertex, SplitVertex}; + + struct Edge + { + QRBTree<int>::Node *node; + int helper, twin, next, previous; + quint32 from, to; + VertexType type; + bool pointingUp; + int upper() const {return (pointingUp ? to : from);} + int lower() const {return (pointingUp ? from : to);} + }; + + friend class CompareVertices; + class CompareVertices + { + public: + CompareVertices(SimpleToMonotone *parent) : m_parent(parent) { } + bool operator () (int i, int j) const; + private: + SimpleToMonotone *m_parent; + }; + + void setupDataStructures(); + void removeZeroLengthEdges(); + void fillPriorityQueue(); + bool edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const; + // Returns the rightmost edge not to the right of the given edge. + QRBTree<int>::Node *searchEdgeLeftOfEdge(int edgeIndex) const; + // Returns the rightmost edge left of the given point. + QRBTree<int>::Node *searchEdgeLeftOfPoint(int pointIndex) const; + void classifyVertex(int i); + void classifyVertices(); + bool pointIsInSector(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2, const QPodPoint &v3); + bool pointIsInSector(int vertex, int sector); + int findSector(int edge, int vertex); + void createDiagonal(int lower, int upper); + void monotoneDecomposition(); + + QTriangulator *m_parent; + QRBTree<int> m_edgeList; + QDataBuffer<Edge> m_edges; + QDataBuffer<int> m_upperVertex; + bool m_clockwiseOrder; + }; + + //====================================// + // QTriangulator::MonotoneToTriangles // + //====================================// + friend class MonotoneToTriangles; + class MonotoneToTriangles + { + public: + inline MonotoneToTriangles(QTriangulator *parent) : m_parent(parent) { } + void decompose(); + private: + inline quint32 indices(int index) const {return m_parent->m_indices.at(index + m_first);} + inline int next(int index) const {return (index + 1) % m_length;} + inline int previous(int index) const {return (index + m_length - 1) % m_length;} + inline bool less(int i, int j) const {return m_parent->m_vertices.at(indices(i)) < m_parent->m_vertices.at(indices(j));} + inline bool leftOfEdge(int i, int j, int k) const + { + return qPointIsLeftOfLine(m_parent->m_vertices.at(indices(i)), + m_parent->m_vertices.at(indices(j)), m_parent->m_vertices.at(indices(k))); + } + + QTriangulator *m_parent; + int m_first; + int m_length; + }; + + inline QTriangulator() { } + + // Call this only once. + void initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix); + // Call this only once. + void initialize(const QVectorPath &path, const QTransform &matrix, qreal lod); + // Call this only once. + void initialize(const QPainterPath &path, const QTransform &matrix, qreal lod); + // Call either triangulate() or polyline() only once. + QTriangleSet triangulate(); + QPolylineSet polyline(); +private: + QDataBuffer<QPodPoint> m_vertices; + QVector<quint32> m_indices; + uint m_hint; +}; + +//============================================================================// +// QTriangulator // +//============================================================================// + +QTriangleSet QTriangulator::triangulate() +{ + for (int i = 0; i < m_vertices.size(); ++i) { + Q_ASSERT(qAbs(m_vertices.at(i).x) < (1 << 21)); + Q_ASSERT(qAbs(m_vertices.at(i).y) < (1 << 21)); + } + + if (!(m_hint & (QVectorPath::OddEvenFill | QVectorPath::WindingFill))) + m_hint |= QVectorPath::OddEvenFill; + + if (m_hint & QVectorPath::NonConvexShapeMask) { + ComplexToSimple c2s(this); + c2s.decompose(); + SimpleToMonotone s2m(this); + s2m.decompose(); + } + MonotoneToTriangles m2t(this); + m2t.decompose(); + + QTriangleSet result; + result.indices = m_indices; + result.vertices.resize(2 * m_vertices.size()); + for (int i = 0; i < m_vertices.size(); ++i) { + result.vertices[2 * i + 0] = qreal(m_vertices.at(i).x) / Q_FIXED_POINT_SCALE; + result.vertices[2 * i + 1] = qreal(m_vertices.at(i).y) / Q_FIXED_POINT_SCALE; + } + return result; +} + +QPolylineSet QTriangulator::polyline() +{ + QPolylineSet result; + result.indices = m_indices; + result.vertices.resize(2 * m_vertices.size()); + for (int i = 0; i < m_vertices.size(); ++i) { + result.vertices[2 * i + 0] = qreal(m_vertices.at(i).x) / Q_FIXED_POINT_SCALE; + result.vertices[2 * i + 1] = qreal(m_vertices.at(i).y) / Q_FIXED_POINT_SCALE; + } + return result; +} + +void QTriangulator::initialize(const qreal *polygon, int count, uint hint, const QTransform &matrix) +{ + m_hint = hint; + m_vertices.resize(count); + m_indices.resize(count + 1); + for (int i = 0; i < count; ++i) { + qreal x, y; + matrix.map(polygon[2 * i + 0], polygon[2 * i + 1], &x, &y); + m_vertices.at(i).x = qRound(x * Q_FIXED_POINT_SCALE); + m_vertices.at(i).y = qRound(y * Q_FIXED_POINT_SCALE); + m_indices[i] = i; + } + m_indices[count] = Q_TRIANGULATE_END_OF_POLYGON; +} + +void QTriangulator::initialize(const QVectorPath &path, const QTransform &matrix, qreal lod) +{ + m_hint = path.hints(); + // Curved paths will be converted to complex polygons. + m_hint &= ~QVectorPath::CurvedShapeMask; + + const qreal *p = path.points(); + const QPainterPath::ElementType *e = path.elements(); + if (e) { + for (int i = 0; i < path.elementCount(); ++i, ++e, p += 2) { + switch (*e) { + case QPainterPath::MoveToElement: + if (!m_indices.isEmpty()) + m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + // Fall through. + case QPainterPath::LineToElement: + m_indices.push_back(quint32(m_vertices.size())); + m_vertices.resize(m_vertices.size() + 1); + qreal x, y; + matrix.map(p[0], p[1], &x, &y); + m_vertices.last().x = qRound(x * Q_FIXED_POINT_SCALE); + m_vertices.last().y = qRound(y * Q_FIXED_POINT_SCALE); + break; + case QPainterPath::CurveToElement: + { + qreal pts[8]; + for (int i = 0; i < 4; ++i) + matrix.map(p[2 * i - 2], p[2 * i - 1], &pts[2 * i + 0], &pts[2 * i + 1]); + for (int i = 0; i < 8; ++i) + pts[i] *= lod; + QBezier bezier = QBezier::fromPoints(QPointF(pts[0], pts[1]), QPointF(pts[2], pts[3]), QPointF(pts[4], pts[5]), QPointF(pts[6], pts[7])); + QPolygonF poly = bezier.toPolygon(); + // Skip first point, it already exists in 'm_vertices'. + for (int j = 1; j < poly.size(); ++j) { + m_indices.push_back(quint32(m_vertices.size())); + m_vertices.resize(m_vertices.size() + 1); + m_vertices.last().x = qRound(poly.at(j).x() * Q_FIXED_POINT_SCALE / lod); + m_vertices.last().y = qRound(poly.at(j).y() * Q_FIXED_POINT_SCALE / lod); + } + } + i += 2; + e += 2; + p += 4; + break; + default: + Q_ASSERT_X(0, "QTriangulator::triangulate", "Unexpected element type."); + break; + } + } + } else { + for (int i = 0; i < path.elementCount(); ++i, p += 2) { + m_indices.push_back(quint32(m_vertices.size())); + m_vertices.resize(m_vertices.size() + 1); + qreal x, y; + matrix.map(p[0], p[1], &x, &y); + m_vertices.last().x = qRound(x * Q_FIXED_POINT_SCALE); + m_vertices.last().y = qRound(y * Q_FIXED_POINT_SCALE); + } + } + m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); +} + +void QTriangulator::initialize(const QPainterPath &path, const QTransform &matrix, qreal lod) +{ + initialize(qtVectorPathForPath(path), matrix, lod); +} + +//============================================================================// +// QTriangulator::ComplexToSimple // +//============================================================================// + +void QTriangulator::ComplexToSimple::decompose() +{ + m_initialPointCount = m_parent->m_vertices.size(); + initEdges(); + do { + calculateIntersections(); + } while (splitEdgesAtIntersections()); + + removeUnwantedEdgesAndConnect(); + removeUnusedPoints(); + + m_parent->m_indices.clear(); + QBitArray processed(m_edges.size(), false); + for (int first = 0; first < m_edges.size(); ++first) { + // If already processed, or if unused path, skip. + if (processed.at(first) || m_edges.at(first).next == -1) + continue; + + int i = first; + do { + Q_ASSERT(!processed.at(i)); + Q_ASSERT(m_edges.at(m_edges.at(i).next).previous == i); + m_parent->m_indices.push_back(m_edges.at(i).from); + processed.setBit(i); + i = m_edges.at(i).next; // CCW order + } while (i != first); + m_parent->m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + } +} + +void QTriangulator::ComplexToSimple::initEdges() +{ + // Initialize edge structure. + // 'next' and 'previous' are not being initialized at this point. + int first = 0; + for (int i = 0; i < m_parent->m_indices.size(); ++i) { + if (m_parent->m_indices.at(i) == Q_TRIANGULATE_END_OF_POLYGON) { + if (m_edges.size() != first) + m_edges.last().to = m_edges.at(first).from; + first = m_edges.size(); + } else { + Q_ASSERT(i + 1 < m_parent->m_indices.size()); + // {node, from, to, next, previous, winding, mayIntersect, pointingUp, originallyPointingUp} + Edge edge = {0, m_parent->m_indices.at(i), m_parent->m_indices.at(i + 1), -1, -1, 0, true, false, false}; + m_edges.add(edge); + } + } + if (first != m_edges.size()) + m_edges.last().to = m_edges.at(first).from; + for (int i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).originallyPointingUp = m_edges.at(i).pointingUp = + m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from); + } +} + +// Return true if new intersection was found +bool QTriangulator::ComplexToSimple::calculateIntersection(int left, int right) +{ + const Edge &e1 = m_edges.at(left); + const Edge &e2 = m_edges.at(right); + + const QPodPoint &u1 = m_parent->m_vertices.at(e1.from); + const QPodPoint &u2 = m_parent->m_vertices.at(e1.to); + const QPodPoint &v1 = m_parent->m_vertices.at(e2.from); + const QPodPoint &v2 = m_parent->m_vertices.at(e2.to); + if (qMax(u1.x, u2.x) <= qMin(v1.x, v2.x)) + return false; + + quint64 key = (left > right ? (quint64(right) << 32) | quint64(left) : (quint64(left) << 32) | quint64(right)); + if (m_processedEdgePairs.contains(key)) + return false; + m_processedEdgePairs.insert(key); + + Intersection intersection; + intersection.leftEdge = left; + intersection.rightEdge = right; + intersection.intersectionPoint = qIntersectionPoint(u1, u2, v1, v2); + + if (!intersection.intersectionPoint.isValid()) + return false; + + Q_ASSERT(intersection.intersectionPoint.isOnLine(u1, u2)); + Q_ASSERT(intersection.intersectionPoint.isOnLine(v1, v2)); + + intersection.vertex = m_parent->m_vertices.size(); + m_topIntersection.push(intersection); + m_parent->m_vertices.add(intersection.intersectionPoint.round()); + return true; +} + +bool QTriangulator::ComplexToSimple::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const +{ + const Edge &leftEdge = m_edges.at(leftEdgeIndex); + const Edge &rightEdge = m_edges.at(rightEdgeIndex); + const QPodPoint &u = m_parent->m_vertices.at(rightEdge.upper()); + const QPodPoint &l = m_parent->m_vertices.at(rightEdge.lower()); + const QPodPoint &upper = m_parent->m_vertices.at(leftEdge.upper()); + if (upper.x < qMin(l.x, u.x)) + return true; + if (upper.x > qMax(l.x, u.x)) + return false; + qint64 d = qPointDistanceFromLine(upper, l, u); + // d < 0: left, d > 0: right, d == 0: on top + if (d == 0) + d = qPointDistanceFromLine(m_parent->m_vertices.at(leftEdge.lower()), l, u); + return d < 0; +} + +QRBTree<int>::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex) const +{ + QRBTree<int>::Node *current = m_edgeList.root; + QRBTree<int>::Node *result = 0; + while (current) { + if (edgeIsLeftOfEdge(edgeIndex, current->data)) { + current = current->left; + } else { + result = current; + current = current->right; + } + } + return result; +} + +QRBTree<int>::Node *QTriangulator::ComplexToSimple::searchEdgeLeftOf(int edgeIndex, QRBTree<int>::Node *after) const +{ + if (!m_edgeList.root) + return after; + QRBTree<int>::Node *result = after; + QRBTree<int>::Node *current = (after ? m_edgeList.next(after) : m_edgeList.front(m_edgeList.root)); + while (current) { + if (edgeIsLeftOfEdge(edgeIndex, current->data)) + return result; + result = current; + current = m_edgeList.next(current); + } + return result; +} + +QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> QTriangulator::ComplexToSimple::bounds(const QPodPoint &point) const +{ + QRBTree<int>::Node *current = m_edgeList.root; + QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> result(0, 0); + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + qint64 d = qPointDistanceFromLine(point, v1, v2); + if (d == 0) { + result.first = result.second = current; + break; + } + current = (d < 0 ? current->left : current->right); + } + if (current == 0) + return result; + + current = result.first->left; + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + qint64 d = qPointDistanceFromLine(point, v1, v2); + Q_ASSERT(d >= 0); + if (d == 0) { + result.first = current; + current = current->left; + } else { + current = current->right; + } + } + + current = result.second->right; + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + qint64 d = qPointDistanceFromLine(point, v1, v2); + Q_ASSERT(d <= 0); + if (d == 0) { + result.second = current; + current = current->right; + } else { + current = current->left; + } + } + + return result; +} + +QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> QTriangulator::ComplexToSimple::outerBounds(const QPodPoint &point) const +{ + QRBTree<int>::Node *current = m_edgeList.root; + QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> result(0, 0); + + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + qint64 d = qPointDistanceFromLine(point, v1, v2); + if (d == 0) + break; + if (d < 0) { + result.second = current; + current = current->left; + } else { + result.first = current; + current = current->right; + } + } + + if (!current) + return result; + + QRBTree<int>::Node *mid = current; + + current = mid->left; + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + qint64 d = qPointDistanceFromLine(point, v1, v2); + Q_ASSERT(d >= 0); + if (d == 0) { + current = current->left; + } else { + result.first = current; + current = current->right; + } + } + + current = mid->right; + while (current) { + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &v2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + qint64 d = qPointDistanceFromLine(point, v1, v2); + Q_ASSERT(d <= 0); + if (d == 0) { + current = current->right; + } else { + result.second = current; + current = current->left; + } + } + + return result; +} + +void QTriangulator::ComplexToSimple::splitEdgeListRange(QRBTree<int>::Node *leftmost, QRBTree<int>::Node *rightmost, int vertex, const QIntersectionPoint &intersectionPoint) +{ + Q_ASSERT(leftmost && rightmost); + + // Split. + for (;;) { + const QPodPoint &u = m_parent->m_vertices.at(m_edges.at(leftmost->data).from); + const QPodPoint &v = m_parent->m_vertices.at(m_edges.at(leftmost->data).to); + Q_ASSERT(intersectionPoint.isOnLine(u, v)); + const Split split = {vertex, leftmost->data, intersectionPoint.isAccurate()}; + if (intersectionPoint.xOffset.numerator != 0 || intersectionPoint.yOffset.numerator != 0 || (intersectionPoint.upperLeft != u && intersectionPoint.upperLeft != v)) + m_splits.add(split); + if (leftmost == rightmost) + break; + leftmost = m_edgeList.next(leftmost); + } +} + + +void QTriangulator::ComplexToSimple::reorderEdgeListRange(QRBTree<int>::Node *leftmost, QRBTree<int>::Node *rightmost) +{ + Q_ASSERT(leftmost && rightmost); + + QRBTree<int>::Node *storeLeftmost = leftmost; + QRBTree<int>::Node *storeRightmost = rightmost; + + // Reorder. + while (leftmost != rightmost) { + Edge &left = m_edges.at(leftmost->data); + Edge &right = m_edges.at(rightmost->data); + qSwap(left.node, right.node); + qSwap(leftmost->data, rightmost->data); + leftmost = m_edgeList.next(leftmost); + if (leftmost == rightmost) + break; + rightmost = m_edgeList.previous(rightmost); + } + + rightmost = m_edgeList.next(storeRightmost); + leftmost = m_edgeList.previous(storeLeftmost); + if (leftmost) + calculateIntersection(leftmost->data, storeLeftmost->data); + if (rightmost) + calculateIntersection(storeRightmost->data, rightmost->data); +} + +void QTriangulator::ComplexToSimple::sortEdgeList(const QPodPoint eventPoint) +{ + QIntersectionPoint eventPoint2 = qIntersectionPoint(eventPoint); + while (!m_topIntersection.isEmpty() && m_topIntersection.top().intersectionPoint < eventPoint2) { + Intersection intersection = m_topIntersection.pop(); + + QIntersectionPoint currentIntersectionPoint = intersection.intersectionPoint; + int currentVertex = intersection.vertex; + + QRBTree<int>::Node *leftmost = m_edges.at(intersection.leftEdge).node; + QRBTree<int>::Node *rightmost = m_edges.at(intersection.rightEdge).node; + + for (;;) { + QRBTree<int>::Node *previous = m_edgeList.previous(leftmost); + if (!previous) + break; + const Edge &edge = m_edges.at(previous->data); + const QPodPoint &u = m_parent->m_vertices.at(edge.from); + const QPodPoint &v = m_parent->m_vertices.at(edge.to); + if (!currentIntersectionPoint.isOnLine(u, v)) { + Q_ASSERT(!currentIntersectionPoint.isAccurate() || qCross(currentIntersectionPoint.upperLeft - u, v - u) != 0); + break; + } + leftmost = previous; + } + + for (;;) { + QRBTree<int>::Node *next = m_edgeList.next(rightmost); + if (!next) + break; + const Edge &edge = m_edges.at(next->data); + const QPodPoint &u = m_parent->m_vertices.at(edge.from); + const QPodPoint &v = m_parent->m_vertices.at(edge.to); + if (!currentIntersectionPoint.isOnLine(u, v)) { + Q_ASSERT(!currentIntersectionPoint.isAccurate() || qCross(currentIntersectionPoint.upperLeft - u, v - u) != 0); + break; + } + rightmost = next; + } + + Q_ASSERT(leftmost && rightmost); + splitEdgeListRange(leftmost, rightmost, currentVertex, currentIntersectionPoint); + reorderEdgeListRange(leftmost, rightmost); + + while (!m_topIntersection.isEmpty() && m_topIntersection.top().intersectionPoint <= currentIntersectionPoint) + m_topIntersection.pop(); + +#ifdef Q_TRIANGULATOR_DEBUG + DebugDialog dialog(this, intersection.vertex); + dialog.exec(); +#endif + + } +} + +void QTriangulator::ComplexToSimple::fillPriorityQueue() +{ + m_events.reset(); + m_events.reserve(m_edges.size() * 2); + for (int i = 0; i < m_edges.size(); ++i) { + Q_ASSERT(m_edges.at(i).previous == -1 && m_edges.at(i).next == -1); + Q_ASSERT(m_edges.at(i).node == 0); + Q_ASSERT(m_edges.at(i).pointingUp == m_edges.at(i).originallyPointingUp); + Q_ASSERT(m_edges.at(i).pointingUp == (m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from))); + // Ignore zero-length edges. + if (m_parent->m_vertices.at(m_edges.at(i).to) != m_parent->m_vertices.at(m_edges.at(i).from)) { + QPodPoint upper = m_parent->m_vertices.at(m_edges.at(i).upper()); + QPodPoint lower = m_parent->m_vertices.at(m_edges.at(i).lower()); + Event upperEvent = {{upper.x, upper.y}, Event::Upper, i}; + Event lowerEvent = {{lower.x, lower.y}, Event::Lower, i}; + m_events.add(upperEvent); + m_events.add(lowerEvent); + } + } + //qSort(m_events.data(), m_events.data() + m_events.size()); + sort(m_events.data(), m_events.size()); +} + +void QTriangulator::ComplexToSimple::calculateIntersections() +{ + fillPriorityQueue(); + + Q_ASSERT(m_topIntersection.empty()); + Q_ASSERT(m_edgeList.root == 0); + + // Find all intersection points. + while (!m_events.isEmpty()) { + Event event = m_events.last(); + sortEdgeList(event.point); + + // Find all edges in the edge list that contain the current vertex and mark them to be split later. + QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> range = bounds(event.point); + QRBTree<int>::Node *leftNode = range.first ? m_edgeList.previous(range.first) : 0; + int vertex = (event.type == Event::Upper ? m_edges.at(event.edge).upper() : m_edges.at(event.edge).lower()); + QIntersectionPoint eventPoint = qIntersectionPoint(event.point); + + if (range.first != 0) { + splitEdgeListRange(range.first, range.second, vertex, eventPoint); + reorderEdgeListRange(range.first, range.second); + } + + // Handle the edges with start or end point in the current vertex. + while (!m_events.isEmpty() && m_events.last().point == event.point) { + event = m_events.last(); + m_events.pop_back(); + int i = event.edge; + + if (m_edges.at(i).node) { + // Remove edge from edge list. + Q_ASSERT(event.type == Event::Lower); + QRBTree<int>::Node *left = m_edgeList.previous(m_edges.at(i).node); + QRBTree<int>::Node *right = m_edgeList.next(m_edges.at(i).node); + m_edgeList.deleteNode(m_edges.at(i).node); + if (!left || !right) + continue; + calculateIntersection(left->data, right->data); + } else { + // Insert edge into edge list. + Q_ASSERT(event.type == Event::Upper); + QRBTree<int>::Node *left = searchEdgeLeftOf(i, leftNode); + m_edgeList.attachAfter(left, m_edges.at(i).node = m_edgeList.newNode()); + m_edges.at(i).node->data = i; + QRBTree<int>::Node *right = m_edgeList.next(m_edges.at(i).node); + if (left) + calculateIntersection(left->data, i); + if (right) + calculateIntersection(i, right->data); + } + } + while (!m_topIntersection.isEmpty() && m_topIntersection.top().intersectionPoint <= eventPoint) + m_topIntersection.pop(); +#ifdef Q_TRIANGULATOR_DEBUG + DebugDialog dialog(this, vertex); + dialog.exec(); +#endif + } + m_processedEdgePairs.clear(); +} + +// Split an edge into two pieces at the given point. +// The upper piece is pushed to the end of the 'm_edges' vector. +// The lower piece replaces the old edge. +// Return the edge whose 'from' is 'pointIndex'. +int QTriangulator::ComplexToSimple::splitEdge(int splitIndex) +{ + const Split &split = m_splits.at(splitIndex); + Edge &lowerEdge = m_edges.at(split.edge); + Q_ASSERT(lowerEdge.node == 0); + Q_ASSERT(lowerEdge.previous == -1 && lowerEdge.next == -1); + + if (lowerEdge.from == split.vertex) + return split.edge; + if (lowerEdge.to == split.vertex) + return lowerEdge.next; + + // Check that angle >= 90 degrees. + //Q_ASSERT(qDot(m_points.at(m_edges.at(edgeIndex).from) - m_points.at(pointIndex), + // m_points.at(m_edges.at(edgeIndex).to) - m_points.at(pointIndex)) <= 0); + + Edge upperEdge = lowerEdge; + upperEdge.mayIntersect |= !split.accurate; // The edge may have been split before at an inaccurate split point. + lowerEdge.mayIntersect = !split.accurate; + if (lowerEdge.pointingUp) { + lowerEdge.to = upperEdge.from = split.vertex; + m_edges.add(upperEdge); + return m_edges.size() - 1; + } else { + lowerEdge.from = upperEdge.to = split.vertex; + m_edges.add(upperEdge); + return split.edge; + } +} + +bool QTriangulator::ComplexToSimple::splitEdgesAtIntersections() +{ + for (int i = 0; i < m_edges.size(); ++i) + m_edges.at(i).mayIntersect = false; + bool checkForNewIntersections = false; + for (int i = 0; i < m_splits.size(); ++i) { + splitEdge(i); + checkForNewIntersections |= !m_splits.at(i).accurate; + } + for (int i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).originallyPointingUp = m_edges.at(i).pointingUp = + m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from); + } + m_splits.reset(); + return checkForNewIntersections; +} + +void QTriangulator::ComplexToSimple::insertEdgeIntoVectorIfWanted(ShortArray &orderedEdges, int i) +{ + // Edges with zero length should not reach this part. + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(i).from) != m_parent->m_vertices.at(m_edges.at(i).to)); + + // Skip edges with unwanted winding number. + int windingNumber = m_edges.at(i).winding; + if (m_edges.at(i).originallyPointingUp) + ++windingNumber; + + // Make sure exactly one fill rule is specified. + Q_ASSERT(((m_parent->m_hint & QVectorPath::WindingFill) != 0) != ((m_parent->m_hint & QVectorPath::OddEvenFill) != 0)); + + if ((m_parent->m_hint & QVectorPath::WindingFill) && windingNumber != 0 && windingNumber != 1) + return; + + // Skip cancelling edges. + if (!orderedEdges.isEmpty()) { + int j = orderedEdges[orderedEdges.size() - 1]; + // If the last edge is already connected in one end, it should not be cancelled. + if (m_edges.at(j).next == -1 && m_edges.at(j).previous == -1 + && (m_parent->m_vertices.at(m_edges.at(i).from) == m_parent->m_vertices.at(m_edges.at(j).to)) + && (m_parent->m_vertices.at(m_edges.at(i).to) == m_parent->m_vertices.at(m_edges.at(j).from))) { + orderedEdges.removeLast(); + return; + } + } + orderedEdges.append(i); +} + +void QTriangulator::ComplexToSimple::removeUnwantedEdgesAndConnect() +{ + Q_ASSERT(m_edgeList.root == 0); + // Initialize priority queue. + fillPriorityQueue(); + + ShortArray orderedEdges; + + while (!m_events.isEmpty()) { + Event event = m_events.last(); + int edgeIndex = event.edge; + + // Check that all the edges in the list crosses the current scanline + //if (m_edgeList.root) { + // for (QRBTree<int>::Node *node = m_edgeList.front(m_edgeList.root); node; node = m_edgeList.next(node)) { + // Q_ASSERT(event.point <= m_points.at(m_edges.at(node->data).lower())); + // } + //} + + orderedEdges.clear(); + QPair<QRBTree<int>::Node *, QRBTree<int>::Node *> b = outerBounds(event.point); + if (m_edgeList.root) { + QRBTree<int>::Node *current = (b.first ? m_edgeList.next(b.first) : m_edgeList.front(m_edgeList.root)); + // Process edges that are going to be removed from the edge list at the current event point. + while (current != b.second) { + Q_ASSERT(current); + Q_ASSERT(m_edges.at(current->data).node == current); + Q_ASSERT(qIntersectionPoint(event.point).isOnLine(m_parent->m_vertices.at(m_edges.at(current->data).from), m_parent->m_vertices.at(m_edges.at(current->data).to))); + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(current->data).from) == event.point || m_parent->m_vertices.at(m_edges.at(current->data).to) == event.point); + insertEdgeIntoVectorIfWanted(orderedEdges, current->data); + current = m_edgeList.next(current); + } + } + + // Remove edges above the event point, insert edges below the event point. + do { + event = m_events.last(); + m_events.pop_back(); + edgeIndex = event.edge; + + // Edges with zero length should not reach this part. + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(edgeIndex).from) != m_parent->m_vertices.at(m_edges.at(edgeIndex).to)); + + if (m_edges.at(edgeIndex).node) { + Q_ASSERT(event.type == Event::Lower); + Q_ASSERT(event.point == m_parent->m_vertices.at(m_edges.at(event.edge).lower())); + m_edgeList.deleteNode(m_edges.at(edgeIndex).node); + } else { + Q_ASSERT(event.type == Event::Upper); + Q_ASSERT(event.point == m_parent->m_vertices.at(m_edges.at(event.edge).upper())); + QRBTree<int>::Node *left = searchEdgeLeftOf(edgeIndex, b.first); + m_edgeList.attachAfter(left, m_edges.at(edgeIndex).node = m_edgeList.newNode()); + m_edges.at(edgeIndex).node->data = edgeIndex; + } + } while (!m_events.isEmpty() && m_events.last().point == event.point); + + if (m_edgeList.root) { + QRBTree<int>::Node *current = (b.first ? m_edgeList.next(b.first) : m_edgeList.front(m_edgeList.root)); + + // Calculate winding number and turn counter-clockwise. + int currentWindingNumber = (b.first ? m_edges.at(b.first->data).winding : 0); + while (current != b.second) { + Q_ASSERT(current); + //Q_ASSERT(b.second == 0 || m_edgeList.order(current, b.second) < 0); + int i = current->data; + Q_ASSERT(m_edges.at(i).node == current); + + // Winding number. + int ccwWindingNumber = m_edges.at(i).winding = currentWindingNumber; + if (m_edges.at(i).originallyPointingUp) { + --m_edges.at(i).winding; + } else { + ++m_edges.at(i).winding; + ++ccwWindingNumber; + } + currentWindingNumber = m_edges.at(i).winding; + + // Turn counter-clockwise. + if ((ccwWindingNumber & 1) == 0) { + Q_ASSERT(m_edges.at(i).previous == -1 && m_edges.at(i).next == -1); + qSwap(m_edges.at(i).from, m_edges.at(i).to); + m_edges.at(i).pointingUp = !m_edges.at(i).pointingUp; + } + + current = m_edgeList.next(current); + } + + // Process edges that were inserted into the edge list at the current event point. + current = (b.second ? m_edgeList.previous(b.second) : m_edgeList.back(m_edgeList.root)); + while (current != b.first) { + Q_ASSERT(current); + Q_ASSERT(m_edges.at(current->data).node == current); + insertEdgeIntoVectorIfWanted(orderedEdges, current->data); + current = m_edgeList.previous(current); + } + } + if (orderedEdges.isEmpty()) + continue; + + Q_ASSERT((orderedEdges.size() & 1) == 0); + + // Connect edges. + // First make sure the first edge point towards the current point. + int i; + if (m_parent->m_vertices.at(m_edges.at(orderedEdges[0]).from) == event.point) { + i = 1; + int copy = orderedEdges[0]; // Make copy in case the append() will cause a reallocation. + orderedEdges.append(copy); + } else { + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(orderedEdges[0]).to) == event.point); + i = 0; + } + + // Remove references to duplicate points. First find the point with lowest index. + int pointIndex = INT_MAX; + for (int j = i; j < orderedEdges.size(); j += 2) { + Q_ASSERT(j + 1 < orderedEdges.size()); + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(orderedEdges[j]).to) == event.point); + Q_ASSERT(m_parent->m_vertices.at(m_edges.at(orderedEdges[j + 1]).from) == event.point); + if (m_edges.at(orderedEdges[j]).to < pointIndex) + pointIndex = m_edges.at(orderedEdges[j]).to; + if (m_edges.at(orderedEdges[j + 1]).from < pointIndex) + pointIndex = m_edges.at(orderedEdges[j + 1]).from; + } + + for (; i < orderedEdges.size(); i += 2) { + // Remove references to duplicate points by making all edges reference one common point. + m_edges.at(orderedEdges[i]).to = m_edges.at(orderedEdges[i + 1]).from = pointIndex; + + Q_ASSERT(m_edges.at(orderedEdges[i]).pointingUp || m_edges.at(orderedEdges[i]).previous != -1); + Q_ASSERT(!m_edges.at(orderedEdges[i + 1]).pointingUp || m_edges.at(orderedEdges[i + 1]).next != -1); + + m_edges.at(orderedEdges[i]).next = orderedEdges[i + 1]; + m_edges.at(orderedEdges[i + 1]).previous = orderedEdges[i]; + } + } // end while +} + +void QTriangulator::ComplexToSimple::removeUnusedPoints() { + QBitArray used(m_parent->m_vertices.size(), false); + for (int i = 0; i < m_edges.size(); ++i) { + Q_ASSERT((m_edges.at(i).previous == -1) == (m_edges.at(i).next == -1)); + if (m_edges.at(i).next != -1) + used.setBit(m_edges.at(i).from); + } + QDataBuffer<quint32> newMapping(m_parent->m_vertices.size()); + newMapping.resize(m_parent->m_vertices.size()); + int count = 0; + for (int i = 0; i < m_parent->m_vertices.size(); ++i) { + if (used.at(i)) { + m_parent->m_vertices.at(count) = m_parent->m_vertices.at(i); + newMapping.at(i) = count; + ++count; + } + } + m_parent->m_vertices.resize(count); + for (int i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).from = newMapping.at(m_edges.at(i).from); + m_edges.at(i).to = newMapping.at(m_edges.at(i).to); + } +} + +bool QTriangulator::ComplexToSimple::CompareEdges::operator () (int i, int j) const +{ + int cmp = comparePoints(m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).from), + m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).from)); + if (cmp == 0) { + cmp = comparePoints(m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).to), + m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).to)); + } + return cmp > 0; +} + +inline bool QTriangulator::ComplexToSimple::Event::operator < (const Event &other) const +{ + if (point == other.point) + return type < other.type; // 'Lower' has higher priority than 'Upper'. + return other.point < point; +} + +//============================================================================// +// QTriangulator::ComplexToSimple::DebugDialog // +//============================================================================// + +#ifdef Q_TRIANGULATOR_DEBUG + +QTriangulator::ComplexToSimple::DebugDialog::DebugDialog(ComplexToSimple *parent, int currentVertex) + : m_parent(parent), m_vertex(currentVertex) +{ + QDataBuffer<QPodPoint> &vertices = m_parent->m_parent->m_vertices; + if (vertices.isEmpty()) + return; + + int minX, maxX, minY, maxY; + minX = maxX = vertices.at(0).x; + minY = maxY = vertices.at(0).y; + for (int i = 1; i < vertices.size(); ++i) { + minX = qMin(minX, vertices.at(i).x); + maxX = qMax(maxX, vertices.at(i).x); + minY = qMin(minY, vertices.at(i).y); + maxY = qMax(maxY, vertices.at(i).y); + } + int w = maxX - minX; + int h = maxY - minY; + qreal border = qMin(w, h) / 10.0; + m_window = QRectF(minX - border, minY - border, (maxX - minX + 2 * border), (maxY - minY + 2 * border)); +} + +void QTriangulator::ComplexToSimple::DebugDialog::paintEvent(QPaintEvent *) +{ + QPainter p(this); + p.setRenderHint(QPainter::Antialiasing, true); + p.fillRect(rect(), Qt::black); + QDataBuffer<QPodPoint> &vertices = m_parent->m_parent->m_vertices; + if (vertices.isEmpty()) + return; + + qreal halfPointSize = qMin(m_window.width(), m_window.height()) / 300.0; + p.setWindow(m_window.toRect()); + + p.setPen(Qt::white); + + QDataBuffer<Edge> &edges = m_parent->m_edges; + for (int i = 0; i < edges.size(); ++i) { + QPodPoint u = vertices.at(edges.at(i).from); + QPodPoint v = vertices.at(edges.at(i).to); + p.drawLine(u.x, u.y, v.x, v.y); + } + + for (int i = 0; i < vertices.size(); ++i) { + QPodPoint q = vertices.at(i); + p.fillRect(QRectF(q.x - halfPointSize, q.y - halfPointSize, 2 * halfPointSize, 2 * halfPointSize), Qt::red); + } + + Qt::GlobalColor colors[6] = {Qt::red, Qt::green, Qt::blue, Qt::cyan, Qt::magenta, Qt::yellow}; + p.setOpacity(0.5); + int count = 0; + if (m_parent->m_edgeList.root) { + QRBTree<int>::Node *current = m_parent->m_edgeList.front(m_parent->m_edgeList.root); + while (current) { + p.setPen(colors[count++ % 6]); + QPodPoint u = vertices.at(edges.at(current->data).from); + QPodPoint v = vertices.at(edges.at(current->data).to); + p.drawLine(u.x, u.y, v.x, v.y); + current = m_parent->m_edgeList.next(current); + } + } + + p.setOpacity(1.0); + QPodPoint q = vertices.at(m_vertex); + p.fillRect(QRectF(q.x - halfPointSize, q.y - halfPointSize, 2 * halfPointSize, 2 * halfPointSize), Qt::green); + + p.setPen(Qt::gray); + QDataBuffer<Split> &splits = m_parent->m_splits; + for (int i = 0; i < splits.size(); ++i) { + QPodPoint q = vertices.at(splits.at(i).vertex); + QPodPoint u = vertices.at(edges.at(splits.at(i).edge).from) - q; + QPodPoint v = vertices.at(edges.at(splits.at(i).edge).to) - q; + qreal uLen = sqrt(qreal(qDot(u, u))); + qreal vLen = sqrt(qreal(qDot(v, v))); + if (uLen) { + u.x *= 2 * halfPointSize / uLen; + u.y *= 2 * halfPointSize / uLen; + } + if (vLen) { + v.x *= 2 * halfPointSize / vLen; + v.y *= 2 * halfPointSize / vLen; + } + u += q; + v += q; + p.drawLine(u.x, u.y, v.x, v.y); + } +} + +void QTriangulator::ComplexToSimple::DebugDialog::wheelEvent(QWheelEvent *event) +{ + qreal scale = exp(-0.001 * event->delta()); + QPointF center = m_window.center(); + QPointF delta = scale * (m_window.bottomRight() - center); + m_window = QRectF(center - delta, center + delta); + event->accept(); + update(); +} + +void QTriangulator::ComplexToSimple::DebugDialog::mouseMoveEvent(QMouseEvent *event) +{ + if (event->buttons() & Qt::LeftButton) { + QPointF delta = event->pos() - m_lastMousePos; + delta.setX(delta.x() * m_window.width() / width()); + delta.setY(delta.y() * m_window.height() / height()); + m_window.translate(-delta.x(), -delta.y()); + m_lastMousePos = event->pos(); + event->accept(); + update(); + } +} + +void QTriangulator::ComplexToSimple::DebugDialog::mousePressEvent(QMouseEvent *event) +{ + if (event->button() == Qt::LeftButton) + m_lastMousePos = event->pos(); + event->accept(); +} + + +#endif + +//============================================================================// +// QTriangulator::SimpleToMonotone // +//============================================================================// + +void QTriangulator::SimpleToMonotone::decompose() +{ + setupDataStructures(); + removeZeroLengthEdges(); + monotoneDecomposition(); + + m_parent->m_indices.clear(); + QBitArray processed(m_edges.size(), false); + for (int first = 0; first < m_edges.size(); ++first) { + if (processed.at(first)) + continue; + int i = first; + do { + Q_ASSERT(!processed.at(i)); + Q_ASSERT(m_edges.at(m_edges.at(i).next).previous == i); + m_parent->m_indices.push_back(m_edges.at(i).from); + processed.setBit(i); + i = m_edges.at(i).next; + } while (i != first); + if (m_parent->m_indices.size() > 0 && m_parent->m_indices.back() != Q_TRIANGULATE_END_OF_POLYGON) + m_parent->m_indices.push_back(Q_TRIANGULATE_END_OF_POLYGON); + } +} + +void QTriangulator::SimpleToMonotone::setupDataStructures() +{ + int i = 0; + Edge e; + e.node = 0; + e.twin = -1; + + while (i + 3 <= m_parent->m_indices.size()) { + int start = m_edges.size(); + + do { + e.from = m_parent->m_indices.at(i); + e.type = RegularVertex; + e.next = m_edges.size() + 1; + e.previous = m_edges.size() - 1; + m_edges.add(e); + ++i; + Q_ASSERT(i < m_parent->m_indices.size()); + } while (m_parent->m_indices.at(i) != Q_TRIANGULATE_END_OF_POLYGON); + + m_edges.last().next = start; + m_edges.at(start).previous = m_edges.size() - 1; + ++i; // Skip Q_TRIANGULATE_END_OF_POLYGON. + } + + for (i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).to = m_edges.at(m_edges.at(i).next).from; + m_edges.at(i).pointingUp = m_parent->m_vertices.at(m_edges.at(i).to) < m_parent->m_vertices.at(m_edges.at(i).from); + m_edges.at(i).helper = -1; // Not initialized here. + } +} + +void QTriangulator::SimpleToMonotone::removeZeroLengthEdges() +{ + for (int i = 0; i < m_edges.size(); ++i) { + if (m_parent->m_vertices.at(m_edges.at(i).from) == m_parent->m_vertices.at(m_edges.at(i).to)) { + m_edges.at(m_edges.at(i).previous).next = m_edges.at(i).next; + m_edges.at(m_edges.at(i).next).previous = m_edges.at(i).previous; + m_edges.at(m_edges.at(i).next).from = m_edges.at(i).from; + m_edges.at(i).next = -1; // Mark as removed. + } + } + + QDataBuffer<int> newMapping(m_edges.size()); + newMapping.resize(m_edges.size()); + int count = 0; + for (int i = 0; i < m_edges.size(); ++i) { + if (m_edges.at(i).next != -1) { + m_edges.at(count) = m_edges.at(i); + newMapping.at(i) = count; + ++count; + } + } + m_edges.resize(count); + for (int i = 0; i < m_edges.size(); ++i) { + m_edges.at(i).next = newMapping.at(m_edges.at(i).next); + m_edges.at(i).previous = newMapping.at(m_edges.at(i).previous); + } +} + +void QTriangulator::SimpleToMonotone::fillPriorityQueue() +{ + m_upperVertex.reset(); + m_upperVertex.reserve(m_edges.size()); + for (int i = 0; i < m_edges.size(); ++i) + m_upperVertex.add(i); + CompareVertices cmp(this); + //qSort(m_upperVertex.data(), m_upperVertex.data() + m_upperVertex.size(), cmp); + sort(m_upperVertex.data(), m_upperVertex.size(), cmp); + //for (int i = 1; i < m_upperVertex.size(); ++i) { + // Q_ASSERT(!cmp(m_upperVertex.at(i), m_upperVertex.at(i - 1))); + //} +} + +bool QTriangulator::SimpleToMonotone::edgeIsLeftOfEdge(int leftEdgeIndex, int rightEdgeIndex) const +{ + const Edge &leftEdge = m_edges.at(leftEdgeIndex); + const Edge &rightEdge = m_edges.at(rightEdgeIndex); + const QPodPoint &u = m_parent->m_vertices.at(rightEdge.upper()); + const QPodPoint &l = m_parent->m_vertices.at(rightEdge.lower()); + qint64 d = qPointDistanceFromLine(m_parent->m_vertices.at(leftEdge.upper()), l, u); + // d < 0: left, d > 0: right, d == 0: on top + if (d == 0) + d = qPointDistanceFromLine(m_parent->m_vertices.at(leftEdge.lower()), l, u); + return d < 0; +} + +// Returns the rightmost edge not to the right of the given edge. +QRBTree<int>::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfEdge(int edgeIndex) const +{ + QRBTree<int>::Node *current = m_edgeList.root; + QRBTree<int>::Node *result = 0; + while (current) { + if (edgeIsLeftOfEdge(edgeIndex, current->data)) { + current = current->left; + } else { + result = current; + current = current->right; + } + } + return result; +} + +// Returns the rightmost edge left of the given point. +QRBTree<int>::Node *QTriangulator::SimpleToMonotone::searchEdgeLeftOfPoint(int pointIndex) const +{ + QRBTree<int>::Node *current = m_edgeList.root; + QRBTree<int>::Node *result = 0; + while (current) { + const QPodPoint &p1 = m_parent->m_vertices.at(m_edges.at(current->data).lower()); + const QPodPoint &p2 = m_parent->m_vertices.at(m_edges.at(current->data).upper()); + qint64 d = qPointDistanceFromLine(m_parent->m_vertices.at(pointIndex), p1, p2); + if (d <= 0) { + current = current->left; + } else { + result = current; + current = current->right; + } + } + return result; +} + +void QTriangulator::SimpleToMonotone::classifyVertex(int i) +{ + Edge &e2 = m_edges.at(i); + const Edge &e1 = m_edges.at(e2.previous); + + bool startOrSplit = (e1.pointingUp && !e2.pointingUp); + bool endOrMerge = (!e1.pointingUp && e2.pointingUp); + + const QPodPoint &p1 = m_parent->m_vertices.at(e1.from); + const QPodPoint &p2 = m_parent->m_vertices.at(e2.from); + const QPodPoint &p3 = m_parent->m_vertices.at(e2.to); + qint64 d = qPointDistanceFromLine(p1, p2, p3); + Q_ASSERT(d != 0 || (!startOrSplit && !endOrMerge)); + + e2.type = RegularVertex; + + if (m_clockwiseOrder) { + if (startOrSplit) + e2.type = (d < 0 ? SplitVertex : StartVertex); + else if (endOrMerge) + e2.type = (d < 0 ? MergeVertex : EndVertex); + } else { + if (startOrSplit) + e2.type = (d > 0 ? SplitVertex : StartVertex); + else if (endOrMerge) + e2.type = (d > 0 ? MergeVertex : EndVertex); + } +} + +void QTriangulator::SimpleToMonotone::classifyVertices() +{ + for (int i = 0; i < m_edges.size(); ++i) + classifyVertex(i); +} + +bool QTriangulator::SimpleToMonotone::pointIsInSector(const QPodPoint &p, const QPodPoint &v1, const QPodPoint &v2, const QPodPoint &v3) +{ + bool leftOfPreviousEdge = !qPointIsLeftOfLine(p, v2, v1); + bool leftOfNextEdge = !qPointIsLeftOfLine(p, v3, v2); + + if (qPointIsLeftOfLine(v1, v2, v3)) + return leftOfPreviousEdge && leftOfNextEdge; + else + return leftOfPreviousEdge || leftOfNextEdge; +} + +bool QTriangulator::SimpleToMonotone::pointIsInSector(int vertex, int sector) +{ + const QPodPoint ¢er = m_parent->m_vertices.at(m_edges.at(sector).from); + // Handle degenerate edges. + while (m_parent->m_vertices.at(m_edges.at(vertex).from) == center) + vertex = m_edges.at(vertex).next; + int next = m_edges.at(sector).next; + while (m_parent->m_vertices.at(m_edges.at(next).from) == center) + next = m_edges.at(next).next; + int previous = m_edges.at(sector).previous; + while (m_parent->m_vertices.at(m_edges.at(previous).from) == center) + previous = m_edges.at(previous).previous; + + const QPodPoint &p = m_parent->m_vertices.at(m_edges.at(vertex).from); + const QPodPoint &v1 = m_parent->m_vertices.at(m_edges.at(previous).from); + const QPodPoint &v3 = m_parent->m_vertices.at(m_edges.at(next).from); + if (m_clockwiseOrder) + return pointIsInSector(p, v3, center, v1); + else + return pointIsInSector(p, v1, center, v3); +} + +int QTriangulator::SimpleToMonotone::findSector(int edge, int vertex) +{ + while (!pointIsInSector(vertex, edge)) { + edge = m_edges.at(m_edges.at(edge).previous).twin; + Q_ASSERT(edge != -1); + } + return edge; +} + +void QTriangulator::SimpleToMonotone::createDiagonal(int lower, int upper) +{ + lower = findSector(lower, upper); + upper = findSector(upper, lower); + + int prevLower = m_edges.at(lower).previous; + int prevUpper = m_edges.at(upper).previous; + + Edge e; + + e.twin = m_edges.size() + 1; + e.next = upper; + e.previous = prevLower; + e.from = m_edges.at(lower).from; + e.to = m_edges.at(upper).from; + m_edges.at(upper).previous = m_edges.at(prevLower).next = int(m_edges.size()); + m_edges.add(e); + + e.twin = m_edges.size() - 1; + e.next = lower; + e.previous = prevUpper; + e.from = m_edges.at(upper).from; + e.to = m_edges.at(lower).from; + m_edges.at(lower).previous = m_edges.at(prevUpper).next = int(m_edges.size()); + m_edges.add(e); +} + +void QTriangulator::SimpleToMonotone::monotoneDecomposition() +{ + if (m_edges.isEmpty()) + return; + + Q_ASSERT(!m_edgeList.root); + QDataBuffer<QPair<int, int> > diagonals; + + int i = 0; + for (int index = 1; index < m_edges.size(); ++index) { + if (m_parent->m_vertices.at(m_edges.at(index).from) < m_parent->m_vertices.at(m_edges.at(i).from)) + i = index; + } + Q_ASSERT(i < m_edges.size()); + int j = m_edges.at(i).previous; + Q_ASSERT(j < m_edges.size()); + m_clockwiseOrder = qPointIsLeftOfLine(m_parent->m_vertices.at(m_edges.at(i).from), + m_parent->m_vertices.at(m_edges.at(j).from), m_parent->m_vertices.at(m_edges.at(i).to)); + + classifyVertices(); + fillPriorityQueue(); + + // debug: set helpers explicitly (shouldn't be necessary) + //for (int i = 0; i < m_edges.size(); ++i) + // m_edges.at(i).helper = m_edges.at(i).upper(); + + while (!m_upperVertex.isEmpty()) { + i = m_upperVertex.last(); + Q_ASSERT(i < m_edges.size()); + m_upperVertex.pop_back(); + j = m_edges.at(i).previous; + Q_ASSERT(j < m_edges.size()); + + QRBTree<int>::Node *leftEdgeNode = 0; + + switch (m_edges.at(i).type) { + case RegularVertex: + // If polygon interior is to the right of the vertex... + if (m_edges.at(i).pointingUp == m_clockwiseOrder) { + if (m_edges.at(i).node) { + Q_ASSERT(!m_edges.at(j).node); + if (m_edges.at(m_edges.at(i).helper).type == MergeVertex) + diagonals.add(QPair<int, int>(i, m_edges.at(i).helper)); + m_edges.at(j).node = m_edges.at(i).node; + m_edges.at(i).node = 0; + m_edges.at(j).node->data = j; + m_edges.at(j).helper = i; + } else if (m_edges.at(j).node) { + Q_ASSERT(!m_edges.at(i).node); + if (m_edges.at(m_edges.at(j).helper).type == MergeVertex) + diagonals.add(QPair<int, int>(i, m_edges.at(j).helper)); + m_edges.at(i).node = m_edges.at(j).node; + m_edges.at(j).node = 0; + m_edges.at(i).node->data = i; + m_edges.at(i).helper = i; + } else { + qWarning("Inconsistent polygon. (#1)"); + } + } else { + leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); + if (leftEdgeNode) { + if (m_edges.at(m_edges.at(leftEdgeNode->data).helper).type == MergeVertex) + diagonals.add(QPair<int, int>(i, m_edges.at(leftEdgeNode->data).helper)); + m_edges.at(leftEdgeNode->data).helper = i; + } else { + qWarning("Inconsistent polygon. (#2)"); + } + } + break; + case SplitVertex: + leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); + if (leftEdgeNode) { + diagonals.add(QPair<int, int>(i, m_edges.at(leftEdgeNode->data).helper)); + m_edges.at(leftEdgeNode->data).helper = i; + } else { + qWarning("Inconsistent polygon. (#3)"); + } + // Fall through. + case StartVertex: + if (m_clockwiseOrder) { + leftEdgeNode = searchEdgeLeftOfEdge(j); + QRBTree<int>::Node *node = m_edgeList.newNode(); + node->data = j; + m_edges.at(j).node = node; + m_edges.at(j).helper = i; + m_edgeList.attachAfter(leftEdgeNode, node); + Q_ASSERT(m_edgeList.verify()); + } else { + leftEdgeNode = searchEdgeLeftOfEdge(i); + QRBTree<int>::Node *node = m_edgeList.newNode(); + node->data = i; + m_edges.at(i).node = node; + m_edges.at(i).helper = i; + m_edgeList.attachAfter(leftEdgeNode, node); + Q_ASSERT(m_edgeList.verify()); + } + break; + case MergeVertex: + leftEdgeNode = searchEdgeLeftOfPoint(m_edges.at(i).from); + if (leftEdgeNode) { + if (m_edges.at(m_edges.at(leftEdgeNode->data).helper).type == MergeVertex) + diagonals.add(QPair<int, int>(i, m_edges.at(leftEdgeNode->data).helper)); + m_edges.at(leftEdgeNode->data).helper = i; + } else { + qWarning("Inconsistent polygon. (#4)"); + } + // Fall through. + case EndVertex: + if (m_clockwiseOrder) { + if (m_edges.at(m_edges.at(i).helper).type == MergeVertex) + diagonals.add(QPair<int, int>(i, m_edges.at(i).helper)); + if (m_edges.at(i).node) { + m_edgeList.deleteNode(m_edges.at(i).node); + Q_ASSERT(m_edgeList.verify()); + } else { + qWarning("Inconsistent polygon. (#5)"); + } + } else { + if (m_edges.at(m_edges.at(j).helper).type == MergeVertex) + diagonals.add(QPair<int, int>(i, m_edges.at(j).helper)); + if (m_edges.at(j).node) { + m_edgeList.deleteNode(m_edges.at(j).node); + Q_ASSERT(m_edgeList.verify()); + } else { + qWarning("Inconsistent polygon. (#6)"); + } + } + break; + } + } + + for (int i = 0; i < diagonals.size(); ++i) + createDiagonal(diagonals.at(i).first, diagonals.at(i).second); +} + +bool QTriangulator::SimpleToMonotone::CompareVertices::operator () (int i, int j) const +{ + if (m_parent->m_edges.at(i).from == m_parent->m_edges.at(j).from) + return m_parent->m_edges.at(i).type > m_parent->m_edges.at(j).type; + return m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).from) > + m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).from); +} + +//============================================================================// +// QTriangulator::MonotoneToTriangles // +//============================================================================// + +void QTriangulator::MonotoneToTriangles::decompose() +{ + QVector<quint32> result; + QDataBuffer<int> stack; + m_first = 0; + // Require at least three more indices. + while (m_first + 3 <= m_parent->m_indices.size()) { + m_length = 0; + while (m_parent->m_indices.at(m_first + m_length) != Q_TRIANGULATE_END_OF_POLYGON) { + ++m_length; + Q_ASSERT(m_first + m_length < m_parent->m_indices.size()); + } + if (m_length < 3) { + m_first += m_length + 1; + continue; + } + + int minimum = 0; + while (less(next(minimum), minimum)) + minimum = next(minimum); + while (less(previous(minimum), minimum)) + minimum = previous(minimum); + + stack.reset(); + stack.add(minimum); + int left = previous(minimum); + int right = next(minimum); + bool stackIsOnLeftSide; + bool clockwiseOrder = leftOfEdge(minimum, left, right); + + if (less(left, right)) { + stack.add(left); + left = previous(left); + stackIsOnLeftSide = true; + } else { + stack.add(right); + right = next(right); + stackIsOnLeftSide = false; + } + + for (int count = 0; count + 2 < m_length; ++count) + { + Q_ASSERT(stack.size() >= 2); + if (less(left, right)) { + if (stackIsOnLeftSide == false) { + for (int i = 0; i + 1 < stack.size(); ++i) { + result.push_back(indices(stack.at(i + 1))); + result.push_back(indices(left)); + result.push_back(indices(stack.at(i))); + } + stack.first() = stack.last(); + stack.resize(1); + } else { + while (stack.size() >= 2 && (clockwiseOrder ^ !leftOfEdge(left, stack.at(stack.size() - 2), stack.last()))) { + result.push_back(indices(stack.at(stack.size() - 2))); + result.push_back(indices(left)); + result.push_back(indices(stack.last())); + stack.pop_back(); + } + } + stack.add(left); + left = previous(left); + stackIsOnLeftSide = true; + } else { + if (stackIsOnLeftSide == true) { + for (int i = 0; i + 1 < stack.size(); ++i) { + result.push_back(indices(stack.at(i))); + result.push_back(indices(right)); + result.push_back(indices(stack.at(i + 1))); + } + stack.first() = stack.last(); + stack.resize(1); + } else { + while (stack.size() >= 2 && (clockwiseOrder ^ !leftOfEdge(right, stack.last(), stack.at(stack.size() - 2)))) { + result.push_back(indices(stack.last())); + result.push_back(indices(right)); + result.push_back(indices(stack.at(stack.size() - 2))); + stack.pop_back(); + } + } + stack.add(right); + right = next(right); + stackIsOnLeftSide = false; + } + } + + m_first += m_length + 1; + } + m_parent->m_indices = result; +} + +//============================================================================// +// qTriangulate // +//============================================================================// + +QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint, const QTransform &matrix) +{ + QTriangulator triangulator; + triangulator.initialize(polygon, count, hint, matrix); + return triangulator.triangulate(); +} + +QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix, qreal lod) +{ + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + return triangulator.triangulate(); +} + +QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix, qreal lod) +{ + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + return triangulator.triangulate(); +} + +QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix, qreal lod) +{ + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + return triangulator.polyline(); +} + +QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix, qreal lod) +{ + QTriangulator triangulator; + triangulator.initialize(path, matrix, lod); + return triangulator.polyline(); +} + +QT_END_NAMESPACE diff --git a/src/opengl/gl2paintengineex/qtriangulator_p.h b/src/opengl/gl2paintengineex/qtriangulator_p.h new file mode 100644 index 0000000..da47666 --- /dev/null +++ b/src/opengl/gl2paintengineex/qtriangulator_p.h @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTRIANGULATOR_P_H +#define QTRIANGULATOR_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtCore/qvector.h> +#include <QtGui/private/qvectorpath_p.h> + +QT_BEGIN_NAMESPACE + +#define Q_TRIANGULATE_END_OF_POLYGON quint32(-1) + +struct QTriangleSet +{ + inline QTriangleSet() { } + inline QTriangleSet(const QTriangleSet &other) : vertices(other.vertices), indices(other.indices) { } + QTriangleSet &operator = (const QTriangleSet &other) {vertices = other.vertices; indices = other.indices; return *this;} + + // The vertices of a triangle are given by: (x[i[n]], y[i[n]]), (x[j[n]], y[j[n]]), (x[k[n]], y[k[n]]), n = 0, 1, ... + QVector<qreal> vertices; // [x[0], y[0], x[1], y[1], x[2], ...] + QVector<quint32> indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...] +}; + +struct QPolylineSet +{ + inline QPolylineSet() { } + inline QPolylineSet(const QPolylineSet &other) : vertices(other.vertices), indices(other.indices) { } + QPolylineSet &operator = (const QPolylineSet &other) {vertices = other.vertices; indices = other.indices; return *this;} + + QVector<qreal> vertices; // [x[0], y[0], x[1], y[1], x[2], ...] + QVector<quint32> indices; + +}; + +// The vertex coordinates of the returned triangle set will be rounded to a grid with a mesh size +// of 1/32. The polygon is first transformed, then scaled by 32, the coordinates are rounded to +// integers, the polygon is triangulated, and then scaled back by 1/32. +// 'hint' should be a combination of QVectorPath::Hints. +// 'lod' is the level of detail. Default is 1. Curves are split into more lines when 'lod' is higher. +QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint = QVectorPath::PolygonHint | QVectorPath::OddEvenFill, const QTransform &matrix = QTransform()); +QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); +QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); +QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); +QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix = QTransform(), qreal lod = 1); + +QT_END_NAMESPACE + +#endif diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 6076891..ff42a49 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -13,7 +13,6 @@ include(../qbase.pri) !win32:!embedded:!mac:CONFIG += x11 contains(QT_CONFIG, opengl):CONFIG += opengl contains(QT_CONFIG, opengles1):CONFIG += opengles1 -contains(QT_CONFIG, opengles1cl):CONFIG += opengles1cl contains(QT_CONFIG, opengles2):CONFIG += opengles2 contains(QT_CONFIG, egl):CONFIG += egl @@ -26,6 +25,7 @@ HEADERS += qgl.h \ qglframebufferobject_p.h \ qglextensions_p.h \ qglpaintdevice_p.h \ + qglbuffer.h \ SOURCES += qgl.cpp \ @@ -34,6 +34,7 @@ SOURCES += qgl.cpp \ qglframebufferobject.cpp \ qglextensions.cpp \ qglpaintdevice.cpp \ + qglbuffer.cpp \ !contains(QT_CONFIG, opengles2) { @@ -41,7 +42,7 @@ SOURCES += qgl.cpp \ SOURCES += qpaintengine_opengl.cpp } -!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl) { +!contains(QT_CONFIG, opengles1) { HEADERS += qglshaderprogram.h \ qglpixmapfilter_p.h \ qgraphicsshadereffect_p.h \ @@ -55,6 +56,7 @@ SOURCES += qgl.cpp \ gl2paintengineex/qglengineshadersource_p.h \ gl2paintengineex/qglcustomshaderstage_p.h \ gl2paintengineex/qtriangulatingstroker_p.h \ + gl2paintengineex/qtriangulator_p.h \ gl2paintengineex/qtextureglyphcache_gl_p.h SOURCES += qglshaderprogram.cpp \ @@ -69,12 +71,13 @@ SOURCES += qgl.cpp \ gl2paintengineex/qpaintengineex_opengl2.cpp \ gl2paintengineex/qglcustomshaderstage.cpp \ gl2paintengineex/qtriangulatingstroker.cpp \ + gl2paintengineex/qtriangulator.cpp \ gl2paintengineex/qtextureglyphcache_gl.cpp } x11 { - contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles1cl)|contains(QT_CONFIG, opengles2) { + contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { SOURCES += qgl_x11egl.cpp \ qglpixelbuffer_egl.cpp \ qgl_egl.cpp \ @@ -121,8 +124,7 @@ wince*: { qglpixelbuffer_egl.cpp \ qgl_egl.cpp - HEADERS += qgl_cl_p.h \ - qgl_egl_p.h \ + HEADERS += qgl_egl_p.h } embedded { diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index fce9fdb..3e5c4fc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -67,7 +67,7 @@ #include "qimage.h" #include "qgl_p.h" -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include "gl2paintengineex/qpaintengineex_opengl2_p.h" #endif @@ -95,11 +95,6 @@ QT_BEGIN_NAMESPACE -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - - #if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs; #endif @@ -222,6 +217,9 @@ bool qt_gl_preferGL2Engine() \value DirectRendering Specifies that the context is used for direct rendering to a display. \value HasOverlay Enables the use of an overlay. \value SampleBuffers Enables the use of sample buffers. + \value DeprecatedFunctions Enables the use of deprecated functionality for OpenGL 3.x + contexts. A context with deprecated functionality enabled is + called a full context in the OpenGL specification. \value SingleBuffer Specifies the use of a single buffer, as opposed to double buffers. \value NoDepthBuffer Disables the use of a depth buffer. \value ColorIndex Specifies that the context should use a color index as its pixel format. @@ -232,6 +230,9 @@ bool qt_gl_preferGL2Engine() \value IndirectRendering Specifies that the context is used for indirect rendering to a buffer. \value NoOverlay Disables the use of an overlay. \value NoSampleBuffers Disables the use of sample buffers. + \value NoDeprecatedFunctions Disables the use of deprecated functionality for OpenGL 3.x + contexts. A context with deprecated functionality disabled is + called a forward compatible context in the OpenGL specification. \sa {Sample Buffers Example} */ @@ -1077,6 +1078,90 @@ int QGLFormat::stencilBufferSize() const } /*! + \since 4.7 + + Set the OpenGL version to the \a major and \a minor numbers. If a + context compatible with the requested OpenGL version cannot be + created, a context compatible with version 1.x is created instead. + + \sa majorVersion(), minorVersion() +*/ +void QGLFormat::setVersion(int major, int minor) +{ + if (major < 1 || minor < 0) { + qWarning("QGLFormat::setVersion: Cannot set zero or negative version number %d.%d", major, minor); + return; + } + detach(); + d->majorVersion = major; + d->minorVersion = minor; +} + +/*! + \since 4.7 + + Returns the OpenGL major version. + + \sa setVersion(), minorVersion() +*/ +int QGLFormat::majorVersion() const +{ + return d->majorVersion; +} + +/*! + \since 4.7 + + Returns the OpenGL minor version. + + \sa setVersion(), majorVersion() +*/ +int QGLFormat::minorVersion() const +{ + return d->minorVersion; +} + +/*! + \enum QGLFormat::OpenGLContextProfile + \since 4.7 + + This enum describes the OpenGL context profiles that can be + specified for contexts implementing OpenGL version 3.2 or + higher. These profiles are different from OpenGL ES profiles. + + \value NoProfile OpenGL version is lower than 3.2. + \value CoreProfile Functionality deprecated in OpenGL version 3.0 is not available. + \value CompatibilityProfile Functionality from earlier OpenGL versions is available. +*/ + +/*! + \since 4.7 + + Set the OpenGL context profile to \a profile. The \a profile is + ignored if the requested OpenGL version is less than 3.2. + + \sa profile() +*/ +void QGLFormat::setProfile(OpenGLContextProfile profile) +{ + detach(); + d->profile = profile; +} + +/*! + \since 4.7 + + Returns the OpenGL context profile. + + \sa setProfile() +*/ +QGLFormat::OpenGLContextProfile QGLFormat::profile() const +{ + return d->profile; +} + + +/*! \fn bool QGLFormat::hasOpenGL() Returns true if the window system has any OpenGL support; @@ -1112,25 +1197,21 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co if (parts[2].startsWith(QLatin1String("1.1"))) versionFlags |= QGLFormat::OpenGL_ES_Common_Version_1_1 | QGLFormat::OpenGL_ES_CommonLite_Version_1_1; - } - else { + } else { // Not -CM, must be CL, CommonLite versionFlags |= QGLFormat::OpenGL_ES_CommonLite_Version_1_0; if (parts[2].startsWith(QLatin1String("1.1"))) versionFlags |= QGLFormat::OpenGL_ES_CommonLite_Version_1_1; } - } - else { + } else { // OpenGL ES version 2.0 or higher versionFlags |= QGLFormat::OpenGL_ES_Version_2_0; } - } - else { + } else { // if < 3 parts to the name, it is an unrecognised OpenGL ES qWarning("Unrecognised OpenGL ES version"); } - } - else { + } else { // not ES, regular OpenGL, the version numbers are first in the string if (versionString.startsWith(QLatin1String("1."))) { switch (versionString[2].toAscii()) { @@ -1147,30 +1228,35 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co default: break; } - } - else if (versionString.startsWith(QLatin1String("2."))) { + } else if (versionString.startsWith(QLatin1String("2."))) { versionFlags |= QGLFormat::OpenGL_Version_1_1 | QGLFormat::OpenGL_Version_1_2 | QGLFormat::OpenGL_Version_1_3 | QGLFormat::OpenGL_Version_1_4 | QGLFormat::OpenGL_Version_1_5 | QGLFormat::OpenGL_Version_2_0; - QString minorVersion = versionString.section(QLatin1Char(' '), 0, 0).section(QLatin1Char('.'), 1, 1); - if (minorVersion == QChar(QLatin1Char('1'))) + if (versionString[2].toAscii() == '1') versionFlags |= QGLFormat::OpenGL_Version_2_1; - } - else if (versionString.startsWith(QLatin1String("3."))) { - versionFlags |= QGLFormat::OpenGL_Version_1_1 | - QGLFormat::OpenGL_Version_1_2 | - QGLFormat::OpenGL_Version_1_3 | - QGLFormat::OpenGL_Version_1_4 | - QGLFormat::OpenGL_Version_1_5 | - QGLFormat::OpenGL_Version_2_0 | - QGLFormat::OpenGL_Version_2_1 | - QGLFormat::OpenGL_Version_3_0; - } - else + } else if (versionString.startsWith(QLatin1String("3."))) { + versionFlags |= QGLFormat::OpenGL_Version_1_1 | + QGLFormat::OpenGL_Version_1_2 | + QGLFormat::OpenGL_Version_1_3 | + QGLFormat::OpenGL_Version_1_4 | + QGLFormat::OpenGL_Version_1_5 | + QGLFormat::OpenGL_Version_2_0 | + QGLFormat::OpenGL_Version_2_1 | + QGLFormat::OpenGL_Version_3_0; + switch (versionString[2].toAscii()) { + case '2': + versionFlags |= QGLFormat::OpenGL_Version_3_2; + case '1': + versionFlags |= QGLFormat::OpenGL_Version_3_1; + default: + break; + } + } else { qWarning("Unrecognised OpenGL version"); + } } return versionFlags; } @@ -1202,6 +1288,12 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co \value OpenGL_Version_3_0 OpenGL version 3.0 or higher is present. + \value OpenGL_Version_3_1 OpenGL version 3.1 or higher is present. + Note that OpenGL version 3.1 or higher does not necessarily support all the features of + version 3.0 and lower. + + \value OpenGL_Version_3_2 OpenGL version 3.2 or higher is present. + \value OpenGL_ES_CommonLite_Version_1_0 OpenGL ES version 1.0 Common Lite or higher is present. \value OpenGL_ES_Common_Version_1_0 OpenGL ES version 1.0 Common or higher is present. @@ -1373,14 +1465,20 @@ void QGLFormat::setDefaultOverlayFormat(const QGLFormat &f) bool operator==(const QGLFormat& a, const QGLFormat& b) { - return (int) a.d->opts == (int) b.d->opts && a.d->pln == b.d->pln && a.d->alphaSize == b.d->alphaSize - && a.d->accumSize == b.d->accumSize && a.d->stencilSize == b.d->stencilSize + return (a.d == b.d) || ((int) a.d->opts == (int) b.d->opts + && a.d->pln == b.d->pln + && a.d->alphaSize == b.d->alphaSize + && a.d->accumSize == b.d->accumSize + && a.d->stencilSize == b.d->stencilSize && a.d->depthSize == b.d->depthSize && a.d->redSize == b.d->redSize && a.d->greenSize == b.d->greenSize && a.d->blueSize == b.d->blueSize && a.d->numSamples == b.d->numSamples - && a.d->swapInterval == b.d->swapInterval; + && a.d->swapInterval == b.d->swapInterval + && a.d->majorVersion == b.d->majorVersion + && a.d->minorVersion == b.d->minorVersion + && a.d->profile == b.d->profile); } @@ -1554,7 +1652,7 @@ QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alp QImage img(size, alpha_format ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); int w = size.width(); int h = size.height(); -#if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) //### glGetTexImage not in GL ES 2.0, need to do something else here! glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits()); #endif @@ -2327,7 +2425,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, { Q_Q(QGLContext); QPixmapData *pd = pixmap.pixmapData(); -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) if (target == GL_TEXTURE_2D && pd->classId() == QPixmapData::OpenGLClass) { const QGLPixmapData *data = static_cast<const QGLPixmapData *>(pd); @@ -2574,41 +2672,41 @@ void QGLContext::deleteTexture(QMacCompatGLuint id) } #endif -void qt_add_rect_to_array(const QRectF &r, q_vertexType *array) +void qt_add_rect_to_array(const QRectF &r, GLfloat *array) { qreal left = r.left(); qreal right = r.right(); qreal top = r.top(); qreal bottom = r.bottom(); - array[0] = f2vt(left); - array[1] = f2vt(top); - array[2] = f2vt(right); - array[3] = f2vt(top); - array[4] = f2vt(right); - array[5] = f2vt(bottom); - array[6] = f2vt(left); - array[7] = f2vt(bottom); + array[0] = left; + array[1] = top; + array[2] = right; + array[3] = top; + array[4] = right; + array[5] = bottom; + array[6] = left; + array[7] = bottom; } -void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array) +void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, GLfloat *array) { - array[0] = f2vt(x1); - array[1] = f2vt(y1); - array[2] = f2vt(x2); - array[3] = f2vt(y1); - array[4] = f2vt(x2); - array[5] = f2vt(y2); - array[6] = f2vt(x1); - array[7] = f2vt(y2); + array[0] = x1; + array[1] = y1; + array[2] = x2; + array[3] = y1; + array[4] = x2; + array[5] = y2; + array[6] = x1; + array[7] = y2; } #if !defined(QT_OPENGL_ES_2) static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint textureHeight, GLenum textureTarget) { - q_vertexType tx = f2vt(1); - q_vertexType ty = f2vt(1); + GLfloat tx = 1.0f; + GLfloat ty = 1.0f; #ifdef QT_OPENGL_ES Q_UNUSED(textureWidth); @@ -2621,20 +2719,20 @@ static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint tex glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_HEIGHT, &textureHeight); } - tx = f2vt(textureWidth); - ty = f2vt(textureHeight); + tx = GLfloat(textureWidth); + ty = GLfloat(textureHeight); } #endif - q_vertexType texCoordArray[4*2] = { + GLfloat texCoordArray[4*2] = { 0, ty, tx, ty, tx, 0, 0, 0 }; - q_vertexType vertexArray[4*2]; + GLfloat vertexArray[4*2]; qt_add_rect_to_array(target, vertexArray); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); - glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); + glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -4796,7 +4894,7 @@ void QGLWidget::drawTexture(const QPointF &point, QMacCompatGLuint textureId, QM } #endif -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_2_engine) #endif @@ -4806,7 +4904,7 @@ Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_engine) Q_OPENGL_EXPORT QPaintEngine* qt_qgl_paint_engine() { -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) return qt_gl_engine(); #elif defined(QT_OPENGL_ES_2) return qt_gl_2_engine(); @@ -4929,7 +5027,7 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions() glExtensions |= GenerateMipmap; glExtensions |= FragmentShader; #endif -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) if (extensions.match("GL_OES_framebuffer_object")) glExtensions |= FramebufferObject; #endif diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 1a04ff9..64f54a3 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -57,7 +57,7 @@ QT_BEGIN_HEADER #if defined(Q_WS_MAC) # include <OpenGL/gl.h> # include <OpenGL/glu.h> -#elif defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#elif defined(QT_OPENGL_ES_1) # include <GLES/gl.h> #ifndef GL_DOUBLE # define GL_DOUBLE GL_FLOAT @@ -144,6 +144,7 @@ namespace QGL DirectRendering = 0x0080, HasOverlay = 0x0100, SampleBuffers = 0x0200, + DeprecatedFunctions = 0x0400, SingleBuffer = DoubleBuffer << 16, NoDepthBuffer = DepthBuffer << 16, ColorIndex = Rgba << 16, @@ -153,7 +154,8 @@ namespace QGL NoStereoBuffers = StereoBuffers << 16, IndirectRendering = DirectRendering << 16, NoOverlay = HasOverlay << 16, - NoSampleBuffers = SampleBuffers << 16 + NoSampleBuffers = SampleBuffers << 16, + NoDeprecatedFunctions = DeprecatedFunctions << 16 }; Q_DECLARE_FLAGS(FormatOptions, FormatOption) } @@ -235,7 +237,20 @@ public: static bool hasOpenGL(); static bool hasOpenGLOverlays(); - enum OpenGLVersionFlag { + void setVersion(int major, int minor); + int majorVersion() const; + int minorVersion() const; + + enum OpenGLContextProfile { + NoProfile, + CoreProfile, + CompatibilityProfile + }; + + void setProfile(OpenGLContextProfile profile); + OpenGLContextProfile profile() const; + + enum OpenGLVersionFlag { OpenGL_Version_None = 0x00000000, OpenGL_Version_1_1 = 0x00000001, OpenGL_Version_1_2 = 0x00000002, @@ -249,7 +264,9 @@ public: OpenGL_ES_Common_Version_1_1 = 0x00000200, OpenGL_ES_CommonLite_Version_1_1 = 0x00000400, OpenGL_ES_Version_2_0 = 0x00000800, - OpenGL_Version_3_0 = 0x00001000 + OpenGL_Version_3_0 = 0x00001000, + OpenGL_Version_3_1 = 0x00002000, + OpenGL_Version_3_2 = 0x00004000 }; Q_DECLARE_FLAGS(OpenGLVersionFlags, OpenGLVersionFlag) diff --git a/src/opengl/qgl_cl_p.h b/src/opengl/qgl_cl_p.h deleted file mode 100644 index 82b492b..0000000 --- a/src/opengl/qgl_cl_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtOpenGL module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifdef QT_OPENGL_ES_1_CL - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of the QGLWidget class. This header file may change from -// version to version without notice, or even be removed. -// -// We mean it. -// - -QT_BEGIN_NAMESPACE - -inline void glTexParameterf (GLenum target, GLenum pname, GLfloat param) -{ - glTexParameterx(target, pname, FLOAT2X(param)); -} -inline void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) -{ - glClearColorx(FLOAT2X(red) ,FLOAT2X(green), FLOAT2X(blue), FLOAT2X(alpha)); -} -inline void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) -{ - glColor4x(FLOAT2X(red) ,FLOAT2X(green), FLOAT2X(blue), FLOAT2X(alpha)); -} - -inline void glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) -{ - glOrthox(FLOAT2X(left), FLOAT2X(right), FLOAT2X(bottom), FLOAT2X(top), FLOAT2X(zNear), FLOAT2X(zFar)); -} - -inline void glPointSize (GLfloat size) -{ - glPointSizex(FLOAT2X(size)); -} - -inline void glPolygonOffset (GLfloat factor, GLfloat units) -{ - glPolygonOffsetx (FLOAT2X(factor), FLOAT2X(units)); -} - -inline void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z) -{ - glRotatex(FLOAT2X(angle), FLOAT2X(x), FLOAT2X(y), FLOAT2X(z)); -} - -inline void glTranslatef (GLfloat x, GLfloat y, GLfloat z) -{ - glTranslatex(FLOAT2X(x) ,FLOAT2X(y) ,FLOAT2X(z)); -} - -inline void glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz) -{ - glNormal3x(FLOAT2X(nx), FLOAT2X(ny), FLOAT2X(nz)); -} - -inline void glScalef(GLfloat x, GLfloat y, GLfloat z) -{ - glScalex(FLOAT2X(x), FLOAT2X(y), FLOAT2X(z)); -} - -inline void glClearDepthf (GLclampf depth) -{ - glClearDepthx(FLOAT2X(depth)); -} - -inline void glAlphaFunc (GLenum func, GLclampf ref) -{ - glAlphaFuncx(func, FLOAT2X(ref)); -} - -inline void glLoadMatrixf (const GLfloat *_m) -{ - GLfixed m[16]; - for (int i =0; i < 16; i++) - m[i] = FLOAT2X(_m[i]); - glLoadMatrixx(m); -} - -inline void glMultMatrixf (const GLfloat *_m) -{ - GLfixed m[16]; - for (int i =0; i < 16; i++) - m[i] = FLOAT2X(_m[i]); - glMultMatrixx (m); -} - - -inline void glLineWidth (GLfloat width) -{ - glLineWidthx(FLOAT2X(width)); -} - -QT_END_NAMESPACE - -#endif //QT_OPENGL_ES_1_CL - diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 713b067..18fc9c2 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -64,22 +64,6 @@ #include "qcache.h" #include "qglpaintdevice_p.h" -#ifndef QT_OPENGL_ES_1_CL -#define q_vertexType float -#define q_vertexTypeEnum GL_FLOAT -#define f2vt(f) (f) -#define vt2f(x) (x) -#define i2vt(i) (float(i)) -#else -#define FLOAT2X(f) (int( (f) * (65536))) -#define X2FLOAT(x) (float(x) / 65536.0f) -#define f2vt(f) FLOAT2X(f) -#define i2vt(i) ((i)*65536) -#define vt2f(x) X2FLOAT(x) -#define q_vertexType GLfixed -#define q_vertexTypeEnum GL_FIXED -#endif //QT_OPENGL_ES_1_CL - #ifdef QT_OPENGL_ES QT_BEGIN_INCLUDE_NAMESPACE #if defined(QT_OPENGL_ES_2) @@ -132,11 +116,15 @@ public: QGLFormatPrivate() : ref(1) { - opts = QGL::DoubleBuffer | QGL::DepthBuffer | QGL::Rgba | QGL::DirectRendering | QGL::StencilBuffer; + opts = QGL::DoubleBuffer | QGL::DepthBuffer | QGL::Rgba | QGL::DirectRendering + | QGL::StencilBuffer | QGL::DeprecatedFunctions; pln = 0; depthSize = accumSize = stencilSize = redSize = greenSize = blueSize = alphaSize = -1; numSamples = -1; swapInterval = -1; + majorVersion = 1; + minorVersion = 0; + profile = QGLFormat::NoProfile; } QGLFormatPrivate(const QGLFormatPrivate *other) : ref(1), @@ -150,7 +138,10 @@ public: blueSize(other->blueSize), alphaSize(other->alphaSize), numSamples(other->numSamples), - swapInterval(other->swapInterval) + swapInterval(other->swapInterval), + majorVersion(other->majorVersion), + minorVersion(other->minorVersion), + profile(other->profile) { } QAtomicInt ref; @@ -165,6 +156,9 @@ public: int alphaSize; int numSamples; int swapInterval; + int majorVersion; + int minorVersion; + QGLFormat::OpenGLContextProfile profile; }; class QGLWidgetPrivate : public QWidgetPrivate @@ -344,6 +338,10 @@ public: void syncGlState(); // Makes sure the GL context's state is what we think it is #if defined(Q_WS_WIN) + void updateFormatVersion(); +#endif + +#if defined(Q_WS_WIN) HGLRC rc; HDC dc; WId win; diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp index ed4814f..b5f952e 100644 --- a/src/opengl/qgl_win.cpp +++ b/src/opengl/qgl_win.cpp @@ -122,6 +122,30 @@ typedef bool (APIENTRY *PFNWGLCHOOSEPIXELFORMATARB)(HDC hdc, #define WGL_TYPE_COLORINDEX_ARB 0x202C #endif +#ifndef WGL_ARB_create_context +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x0001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x0002 +// Error codes returned by GetLastError(). +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 +#endif + +#ifndef GL_VERSION_3_2 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#endif + QT_BEGIN_NAMESPACE class QGLCmapPrivate @@ -682,8 +706,118 @@ QGLTemporaryContext::~QGLTemporaryContext() wglMakeCurrent(d->old_dc, d->old_context); } +static bool qgl_create_context(HDC hdc, QGLContextPrivate *d, QGLContextPrivate *shareContext) +{ + d->rc = 0; + + typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTATTRIBSARB)(HDC, HGLRC, const int *); + PFNWGLCREATECONTEXTATTRIBSARB wglCreateContextAttribsARB = + (PFNWGLCREATECONTEXTATTRIBSARB) wglGetProcAddress("wglCreateContextAttribsARB"); + if (wglCreateContextAttribsARB) { + int attributes[11]; + int attribIndex = 0; + const int major = d->reqFormat.majorVersion(); + const int minor = d->reqFormat.minorVersion(); + attributes[attribIndex++] = WGL_CONTEXT_MAJOR_VERSION_ARB; + attributes[attribIndex++] = major; + attributes[attribIndex++] = WGL_CONTEXT_MINOR_VERSION_ARB; + attributes[attribIndex++] = minor; + + if (major >= 3 && !d->reqFormat.testOption(QGL::DeprecatedFunctions)) { + attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB; + attributes[attribIndex++] = WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + } + + if ((major == 3 && minor >= 2) || major > 3) { + switch (d->reqFormat.profile()) { + case QGLFormat::NoProfile: + break; + case QGLFormat::CoreProfile: + attributes[attribIndex++] = WGL_CONTEXT_PROFILE_MASK_ARB; + attributes[attribIndex++] = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; + break; + case QGLFormat::CompatibilityProfile: + attributes[attribIndex++] = WGL_CONTEXT_PROFILE_MASK_ARB; + attributes[attribIndex++] = WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; + break; + default: + qWarning("QGLContext::chooseContext(): Context profile not supported."); + return false; + } + } + + if (d->reqFormat.plane() != 0) { + attributes[attribIndex++] = WGL_CONTEXT_LAYER_PLANE_ARB; + attributes[attribIndex++] = d->reqFormat.plane(); + } + + attributes[attribIndex++] = 0; // Terminate list. + d->rc = wglCreateContextAttribsARB(hdc, shareContext && shareContext->valid + ? shareContext->rc : 0, attributes); + if (d->rc) { + if (shareContext) + shareContext->sharing = d->sharing = true; + return true; + } + } + + d->rc = wglCreateLayerContext(hdc, d->reqFormat.plane()); + if (d->rc && shareContext && shareContext->valid) + shareContext->sharing = d->sharing = wglShareLists(shareContext->rc, d->rc); + return d->rc != 0; +} + +void QGLContextPrivate::updateFormatVersion() +{ + const GLubyte *s = glGetString(GL_VERSION); + + if (!(s && s[0] >= '0' && s[0] <= '9' && s[1] == '.' && s[2] >= '0' && s[2] <= '9')) { + if (!s) + qWarning("QGLContext::chooseContext(): OpenGL version string is null."); + else + qWarning("QGLContext::chooseContext(): Unexpected OpenGL version string format."); + glFormat.setVersion(0, 0); + glFormat.setProfile(QGLFormat::NoProfile); + glFormat.setOption(QGL::DeprecatedFunctions); + return; + } + + int major = s[0] - '0'; + int minor = s[2] - '0'; + glFormat.setVersion(major, minor); + + if (major < 3) { + glFormat.setProfile(QGLFormat::NoProfile); + glFormat.setOption(QGL::DeprecatedFunctions); + } else { + GLint value = 0; + if (major > 3 || minor >= 2) + glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &value); + + switch (value) { + case WGL_CONTEXT_CORE_PROFILE_BIT_ARB: + glFormat.setProfile(QGLFormat::CoreProfile); + break; + case WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB: + glFormat.setProfile(QGLFormat::CompatibilityProfile); + break; + default: + glFormat.setProfile(QGLFormat::NoProfile); + break; + } + + glGetIntegerv(GL_CONTEXT_FLAGS, &value); + if (value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) + glFormat.setOption(QGL::NoDeprecatedFunctions); + else + glFormat.setOption(QGL::DeprecatedFunctions); + } +} + bool QGLContext::chooseContext(const QGLContext* shareContext) { + QGLContextPrivate *share = shareContext ? const_cast<QGLContext *>(shareContext)->d_func() : 0; + Q_D(QGLContext); // workaround for matrox driver: // make a cheap call to opengl to force loading of DLL @@ -741,8 +875,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) goto end; } - d->rc = wglCreateLayerContext(myDc, d->glFormat.plane()); - if (!d->rc) { + if (!qgl_create_context(myDc, d, share)) { qwglError("QGLContext::chooseContext()", "CreateLayerContext"); result = false; goto end; @@ -792,16 +925,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) d->cmap = new QGLCmap(1 << lpfd.cColorBits); d->cmap->setEntry(lpfd.crTransparent, qRgb(1, 2, 3));//, QGLCmap::Reserved); } - - if (shareContext && shareContext->isValid()) { - QGLContext *share = const_cast<QGLContext *>(shareContext); - d->sharing = (wglShareLists(shareContext->d_func()->rc, d->rc) != 0); - share->d_func()->sharing = d->sharing; - } - - goto end; - } - { + } else { PIXELFORMATDESCRIPTOR pfd; PIXELFORMATDESCRIPTOR realPfd; d->pixelFormatId = choosePixelFormat(&pfd, myDc); @@ -840,17 +964,12 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) goto end; } - if (!(d->rc = wglCreateLayerContext(myDc, 0))) { + if (!qgl_create_context(myDc, d, share)) { qwglError("QGLContext::chooseContext()", "wglCreateContext"); result = false; goto end; } - if (shareContext && shareContext->isValid()) { - d->sharing = (wglShareLists(shareContext->d_func()->rc, d->rc) != 0); - const_cast<QGLContext *>(shareContext)->d_func()->sharing = d->sharing; - } - if(!deviceIsPixmap()) { QRgb* pal = qgl_create_rgb_palette(&realPfd); if (pal) { @@ -865,6 +984,9 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) end: // vblanking wglMakeCurrent(myDc, d->rc); + if (d->rc) + d->updateFormatVersion(); + typedef BOOL (APIENTRYP PFNWGLSWAPINTERVALEXT) (int interval); typedef int (APIENTRYP PFNWGLGETSWAPINTERVALEXT) (void); PFNWGLSWAPINTERVALEXT wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXT) wglGetProcAddress("wglSwapIntervalEXT"); diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp new file mode 100644 index 0000000..7022a53 --- /dev/null +++ b/src/opengl/qglbuffer.cpp @@ -0,0 +1,454 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtOpenGL/qgl.h> +#include <QtOpenGL/private/qgl_p.h> +#include <QtOpenGL/private/qglextensions_p.h> +#include "qglbuffer.h" + +QT_BEGIN_NAMESPACE + +/*! + \class QGLBuffer + \brief The QGLBuffer class provides functions for creating and managing GL buffer objects. + \since 4.7 + \ingroup painting-3D + + Buffer objects are created in the GL server so that the + client application can avoid uploading vertices, indices, + texture image data, etc every time they are needed. +*/ + +/*! + \enum QGLBuffer::Type + This enum defines the type of GL buffer object to create with QGLBuffer. + + \value VertexBuffer Vertex buffer object for use when specifying + vertex arrays. + \value IndexBuffer Index buffer object for use with \c{glDrawElements()}. + \value PixelPackBuffer Pixel pack buffer object for reading pixel + data from the GL server (for example, with \c{glReadPixels()}). + Not supported under OpenGL/ES. + \value PixelUnpackBuffer Pixel unpack buffer object for writing pixel + data to the GL server (for example, with \c{glTexImage2D()}). + Not supported under OpenGL/ES. +*/ + +/*! + \enum QGLBuffer::UsagePattern + This enum defines the usage pattern of a QGLBuffer object. + + \value StreamDraw The data will be set once and used a few times + for drawing operations. Under OpenGL/ES 1.1 this is identical + to StaticDraw. + \value StreamRead The data will be set once and used a few times + for reading data back from the GL server. Not supported + under OpenGL/ES. + \value StreamCopy The data will be set once and used a few times + for reading data back from the GL server for use in further + drawing operations. Not supported under OpenGL/ES. + \value StaticDraw The data will be set once and used many times + for drawing operations. + \value StaticRead The data will be set once and used many times + for reading data back from the GL server. Not supported + under OpenGL/ES. + \value StaticCopy The data will be set once and used many times + for reading data back from the GL server for use in further + drawing operations. Not supported under OpenGL/ES. + \value DynamicDraw The data will be modified repeatedly and used + many times for drawing operations. + \value DynamicRead The data will be modified repeatedly and used + many times for reading data back from the GL server. + Not supported under OpenGL/ES. + \value DynamicCopy The data will be modified repeatedly and used + many times for reading data back from the GL server for + use in further drawing operations. Not supported under OpenGL/ES. +*/ + +/*! + \enum QGLBuffer::Access + This enum defines the access mode for QGLBuffer::map(). + + \value ReadOnly The buffer will be mapped for reading only. + \value WriteOnly The buffer will be mapped for writing only. + \value ReadWrite The buffer will be mapped for reading and writing. +*/ + +class QGLBufferPrivate +{ +public: + QGLBufferPrivate(QGLBuffer::Type t) + : type(t), + guard(0), + usagePattern(QGLBuffer::StaticDraw), + actualUsagePattern(QGLBuffer::StaticDraw) + { + } + + QGLBuffer::Type type; + QGLSharedResourceGuard guard; + QGLBuffer::UsagePattern usagePattern; + QGLBuffer::UsagePattern actualUsagePattern; +}; + +/*! + Constructs a new buffer object of \a type. + + Note: this constructor just creates the QGLBuffer instance. The actual + buffer object in the GL server is not created until create() is called. + + \sa create() +*/ +QGLBuffer::QGLBuffer(QGLBuffer::Type type) + : d_ptr(new QGLBufferPrivate(type)) +{ +} + +#define ctx d->guard.context() + +/*! + Destroys this buffer object, including the storage being + used in the GL server. +*/ +QGLBuffer::~QGLBuffer() +{ + Q_D(QGLBuffer); + GLuint bufferId = d->guard.id(); + if (bufferId) { + // Switch to the original creating context to destroy it. + QGLShareContextScope scope(d->guard.context()); + glDeleteBuffers(1, &bufferId); + } +} + +/*! + Returns the type of buffer represented by this object. +*/ +QGLBuffer::Type QGLBuffer::type() const +{ + Q_D(const QGLBuffer); + return d->type; +} + +/*! + Returns the usage pattern for this buffer object. + The default value is StaticDraw. + + \sa setUsagePattern() +*/ +QGLBuffer::UsagePattern QGLBuffer::usagePattern() const +{ + Q_D(const QGLBuffer); + return d->usagePattern; +} + +/*! + Sets the usage pattern for this buffer object to \a value. + This function must be called before allocate() or write(). + + \sa usagePattern(), allocate(), write() +*/ +void QGLBuffer::setUsagePattern(QGLBuffer::UsagePattern value) +{ + Q_D(QGLBuffer); +#if defined(QT_OPENGL_ES_1) + // OpenGL/ES 1.1 does not support GL_STREAM_DRAW, so use GL_STATIC_DRAW. + // OpenGL/ES 2.0 does support GL_STREAM_DRAW. + d->usagePattern = value; + if (value == StreamDraw) + d->actualUsagePattern = StaticDraw; + else + d->actualUsagePattern = value; +#else + d->usagePattern = d->actualUsagePattern = value; +#endif +} + +#undef ctx + +/*! + Creates the buffer object in the GL server. Returns true if + the object was created; false otherwise. + + This function must be called with a current QGLContext. + The buffer will be bound to and can only be used in + that context (or any other context that is shared with it). + + This function will return false if the GL implementation + does not support buffers, or there is no current QGLContext. + + \sa isCreated(), allocate(), write() +*/ +bool QGLBuffer::create() +{ + Q_D(QGLBuffer); + if (d->guard.id()) + return true; + const QGLContext *ctx = QGLContext::currentContext(); + if (ctx) { + if (!qt_resolve_buffer_extensions(const_cast<QGLContext *>(ctx))) + return false; + GLuint bufferId = 0; + glGenBuffers(1, &bufferId); + if (bufferId) { + d->guard.setContext(ctx); + d->guard.setId(bufferId); + return true; + } + } + return false; +} + +#define ctx d->guard.context() + +/*! + Returns true if this buffer has been created; false otherwise. + + \sa create() +*/ +bool QGLBuffer::isCreated() const +{ + Q_D(const QGLBuffer); + return d->guard.id() != 0; +} + +/*! + Reads the \a count bytes in this buffer starting at \a offset + into \a data. Returns true on success; false if reading from + the buffer is not supported. Buffer reading is not supported + under OpenGL/ES. + + It is assumed that this buffer has been bound to the current context. + + \sa write(), bind() +*/ +bool QGLBuffer::read(int offset, void *data, int count) +{ +#if !defined(QT_OPENGL_ES) + Q_D(QGLBuffer); + if (!glGetBufferSubData || !d->guard.id()) + return false; + while (glGetError() != GL_NO_ERROR) ; // Clear error state. + glGetBufferSubData(d->type, offset, count, data); + return glGetError() == GL_NO_ERROR; +#else + Q_UNUSED(offset); + Q_UNUSED(data); + Q_UNUSED(count); + return false; +#endif +} + +/*! + Replaces the \a count bytes of this buffer starting at \a offset + with the contents of \a data. Any other bytes in the buffer + will be left unmodified. + + It is assumed that create() has been called on this buffer and that + it has been bound to the current context. + + \sa create(), read(), allocate() +*/ +void QGLBuffer::write(int offset, const void *data, int count) +{ + Q_D(QGLBuffer); + if (d->guard.id()) + glBufferSubData(d->type, offset, count, data); +} + +/*! + Allocates \a count bytes of space to the buffer, initialized to + the contents of \a data. Any previous contents will be removed. + + It is assumed that create() has been called on this buffer and that + it has been bound to the current context. + + \sa create(), read(), write() +*/ +void QGLBuffer::allocate(const void *data, int count) +{ + Q_D(QGLBuffer); + if (d->guard.id()) + glBufferData(d->type, count, data, d->actualUsagePattern); +} + +/*! + \fn void QGLBuffer::allocate(int count) + \overload + + Allocates \a count bytes of space to the buffer. Any previous + contents will be removed. + + It is assumed that create() has been called on this buffer and that + it has been bound to the current context. + + \sa create(), write() +*/ + +/*! + Binds the buffer associated with this object to the current + GL context. Returns false if binding was not possible, usually because + type() is not supported on this GL implementation. + + The buffer must be bound to the same QGLContext current when create() + was called, or to another QGLContext that is sharing with it. + Otherwise, false will be returned from this function. + + \sa release(), create() +*/ +bool QGLBuffer::bind() const +{ + Q_D(const QGLBuffer); + GLuint bufferId = d->guard.id(); + if (bufferId) { + if (!QGLContext::areSharing(QGLContext::currentContext(), + d->guard.context())) { +#ifndef QT_NO_DEBUG + qWarning("QGLBuffer::bind: buffer is not valid in the current context"); +#endif + return false; + } + glBindBuffer(d->type, bufferId); + return true; + } else { + return false; + } +} + +/*! + Releases the buffer associated with this object from the + current GL context. + + This function must be called with the same QGLContext current + as when bind() was called on the buffer. + + \sa bind() +*/ +void QGLBuffer::release() const +{ + Q_D(const QGLBuffer); + if (d->guard.id()) + glBindBuffer(d->type, 0); +} + +/*! + Returns the GL identifier associated with this buffer; zero if + the buffer has not been created. + + \sa isCreated() +*/ +uint QGLBuffer::bufferId() const +{ + Q_D(const QGLBuffer); + return d->guard.id(); +} + +#ifndef GL_BUFFER_SIZE +#define GL_BUFFER_SIZE 0x8764 +#endif + +/*! + Returns the size of the data in this buffer, for reading operations. + Returns -1 if fetching the buffer size is not supported, or the + buffer has not been created. + + It is assumed that this buffer has been bound to the current context. + + \sa isCreated(), bind() +*/ +int QGLBuffer::size() const +{ + Q_D(const QGLBuffer); + if (!d->guard.id()) + return -1; + GLint value = -1; + glGetBufferParameteriv(d->type, GL_BUFFER_SIZE, &value); + return value; +} + +/*! + Maps the contents of this buffer into the application's memory + space and returns a pointer to it. Returns null if memory + mapping is not possible. The \a access parameter indicates the + type of access to be performed. + + It is assumed that create() has been called on this buffer and that + it has been bound to the current context. + + This function is only supported under OpenGL/ES if the + \c{GL_OES_mapbuffer} extension is present. + + \sa unmap(), create(), bind() +*/ +void *QGLBuffer::map(QGLBuffer::Access access) +{ + Q_D(QGLBuffer); + if (!d->guard.id()) + return 0; + if (!glMapBufferARB) + return 0; + return glMapBufferARB(d->type, access); +} + +/*! + Unmaps the buffer after it was mapped into the application's + memory space with a previous call to map(). Returns true if + the unmap succeeded; false otherwise. + + It is assumed that this buffer has been bound to the current context, + and that it was previously mapped with map(). + + This function is only supported under OpenGL/ES if the + \c{GL_OES_mapbuffer} extension is present. + + \sa map() +*/ +bool QGLBuffer::unmap() +{ + Q_D(QGLBuffer); + if (!d->guard.id()) + return false; + if (!glUnmapBufferARB) + return false; + return glUnmapBufferARB(d->type) == GL_TRUE; +} + +QT_END_NAMESPACE diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h new file mode 100644 index 0000000..ecb86e2 --- /dev/null +++ b/src/opengl/qglbuffer.h @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGLBUFFER_H +#define QGLBUFFER_H + +#include <QtCore/qscopedpointer.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(OpenGL) + +class QGLBufferPrivate; + +class Q_OPENGL_EXPORT QGLBuffer +{ +public: + enum Type + { + VertexBuffer = 0x8892, // GL_ARRAY_BUFFER + IndexBuffer = 0x8893, // GL_ELEMENT_ARRAY_BUFFER + PixelPackBuffer = 0x88EB, // GL_PIXEL_PACK_BUFFER + PixelUnpackBuffer = 0x88EC // GL_PIXEL_UNPACK_BUFFER + }; + + explicit QGLBuffer(QGLBuffer::Type type); + ~QGLBuffer(); + + enum UsagePattern + { + StreamDraw = 0x88E0, // GL_STREAM_DRAW + StreamRead = 0x88E1, // GL_STREAM_READ + StreamCopy = 0x88E2, // GL_STREAM_COPY + StaticDraw = 0x88E4, // GL_STATIC_DRAW + StaticRead = 0x88E5, // GL_STATIC_READ + StaticCopy = 0x88E6, // GL_STATIC_COPY + DynamicDraw = 0x88E8, // GL_DYNAMIC_DRAW + DynamicRead = 0x88E9, // GL_DYNAMIC_READ + DynamicCopy = 0x88EA // GL_DYNAMIC_COPY + }; + + enum Access + { + ReadOnly = 0x88B8, // GL_READ_ONLY + WriteOnly = 0x88B9, // GL_WRITE_ONLY + ReadWrite = 0x88BA // GL_READ_WRITE + }; + + QGLBuffer::Type type() const; + + QGLBuffer::UsagePattern usagePattern() const; + void setUsagePattern(QGLBuffer::UsagePattern value); + + bool create(); + bool isCreated() const; + + bool bind() const; + void release() const; + + uint bufferId() const; + + int size() const; + + bool read(int offset, void *data, int count); + void write(int offset, const void *data, int count); + + void allocate(const void *data, int count); + inline void allocate(int count) { allocate(0, count); } + + void *map(QGLBuffer::Access access); + bool unmap(); + +private: + QScopedPointer<QGLBufferPrivate> d_ptr; + + Q_DISABLE_COPY(QGLBuffer) + Q_DECLARE_PRIVATE(QGLBuffer) +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif diff --git a/src/opengl/qglextensions.cpp b/src/opengl/qglextensions.cpp index c091191..03fca39 100644 --- a/src/opengl/qglextensions.cpp +++ b/src/opengl/qglextensions.cpp @@ -191,31 +191,35 @@ bool qt_resolve_frag_program_extensions(QGLContext *ctx) bool qt_resolve_buffer_extensions(QGLContext *ctx) { - if (glMapBufferARB && glUnmapBufferARB -#if !defined(QT_OPENGL_ES_2) - && glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData -#endif - ) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) + if (glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData + && glBufferSubData && glGetBufferParameteriv) return true; +#endif -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) glBindBuffer = (_glBindBuffer) qt_gl_getProcAddressARB(ctx, "glBindBuffer"); glDeleteBuffers = (_glDeleteBuffers) qt_gl_getProcAddressARB(ctx, "glDeleteBuffers"); glGenBuffers = (_glGenBuffers) qt_gl_getProcAddressARB(ctx, "glGenBuffers"); glBufferData = (_glBufferData) qt_gl_getProcAddressARB(ctx, "glBufferData"); + glBufferSubData = (_glBufferSubData) qt_gl_getProcAddressARB(ctx, "glBufferSubData"); + glGetBufferSubData = (_glGetBufferSubData) qt_gl_getProcAddressARB(ctx, "glGetBufferSubData"); + glGetBufferParameteriv = (_glGetBufferParameteriv) qt_gl_getProcAddressARB(ctx, "glGetBufferParameteriv"); #endif glMapBufferARB = (_glMapBufferARB) qt_gl_getProcAddressARB(ctx, "glMapBuffer"); glUnmapBufferARB = (_glUnmapBufferARB) qt_gl_getProcAddressARB(ctx, "glUnmapBuffer"); - return glMapBufferARB - && glUnmapBufferARB -#if !defined(QT_OPENGL_ES_2) - && glBindBuffer +#if defined(QGL_RESOLVE_BUFFER_FUNCS) + return glBindBuffer && glDeleteBuffers && glGenBuffers && glBufferData + && glBufferSubData + && glGetBufferParameteriv; + // glGetBufferSubData() is optional +#else + return true; #endif - ; } bool qt_resolve_glsl_extensions(QGLContext *ctx) diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index b0cb429..116dfa6 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -71,6 +71,7 @@ #include <QtCore/qglobal.h> #ifndef GL_ARB_vertex_buffer_object +typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; #endif @@ -78,13 +79,25 @@ typedef ptrdiff_t GLsizeiptrARB; typedef char GLchar; #endif -// ARB_pixel_buffer_object +// ARB_vertex_buffer_object typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint); typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *); typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *); typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +typedef void (APIENTRY *_glBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +typedef void (APIENTRY *_glGetBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +typedef void (APIENTRY *_glGetBufferParameteriv) (GLenum, GLenum, GLint *); typedef GLvoid* (APIENTRY *_glMapBufferARB) (GLenum, GLenum); typedef GLboolean (APIENTRY *_glUnmapBufferARB) (GLenum); +// We can call the buffer functions directly in OpenGL/ES 1.1 or higher, +// but all other platforms need to resolve the extensions. +#if defined(QT_OPENGL_ES) +#if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1) +#define QGL_RESOLVE_BUFFER_FUNCS 1 +#endif +#else +#define QGL_RESOLVE_BUFFER_FUNCS 1 +#endif // ARB_fragment_program typedef void (APIENTRY *_glProgramStringARB) (GLenum, GLenum, GLsizei, const GLvoid *); @@ -285,11 +298,14 @@ struct QGLExtensionFuncs qt_glRenderbufferStorageMultisampleEXT = 0; // Buffer objects: -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) qt_glBindBuffer = 0; qt_glDeleteBuffers = 0; qt_glGenBuffers = 0; qt_glBufferData = 0; + qt_glBufferSubData = 0; + qt_glGetBufferSubData = 0; + qt_glGetBufferParameteriv = 0; #endif qt_glMapBufferARB = 0; qt_glUnmapBufferARB = 0; @@ -397,11 +413,14 @@ struct QGLExtensionFuncs _glRenderbufferStorageMultisampleEXT qt_glRenderbufferStorageMultisampleEXT; // Buffer objects -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) _glBindBuffer qt_glBindBuffer; _glDeleteBuffers qt_glDeleteBuffers; _glGenBuffers qt_glGenBuffers; _glBufferData qt_glBufferData; + _glBufferSubData qt_glBufferSubData; + _glGetBufferSubData qt_glGetBufferSubData; + _glGetBufferParameteriv qt_glGetBufferParameteriv; #endif _glMapBufferARB qt_glMapBufferARB; _glUnmapBufferARB qt_glUnmapBufferARB; @@ -599,6 +618,20 @@ struct QGLExtensionFuncs #define GL_DECR_WRAP 0x8508 #endif +#ifndef GL_VERSION_1_5 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#endif + #ifndef GL_VERSION_2_0 #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 @@ -667,11 +700,14 @@ struct QGLExtensionFuncs // Buffer objects -#if !defined(QT_OPENGL_ES_2) +#if defined(QGL_RESOLVE_BUFFER_FUNCS) #define glBindBuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindBuffer #define glDeleteBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteBuffers #define glGenBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenBuffers #define glBufferData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferData +#define glBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferSubData +#define glGetBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferSubData +#define glGetBufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferParameteriv #endif #define glMapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glMapBufferARB #define glUnmapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glUnmapBufferARB diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index ce80796..f1d2325 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -44,7 +44,7 @@ #include <qdebug.h> #include <private/qgl_p.h> -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include <private/qpaintengineex_opengl2_p.h> #endif @@ -56,10 +56,6 @@ #include <qlibrary.h> #include <qimage.h> -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - QT_BEGIN_NAMESPACE extern QImage qt_gl_read_framebuffer(const QSize&, bool, bool); @@ -980,7 +976,7 @@ QImage QGLFramebufferObject::toImage() const return image; } -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine) #endif @@ -995,7 +991,7 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const if (d->engine) return d->engine; -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #if !defined (QT_OPENGL_ES_2) if (qt_gl_preferGL2Engine()) { #endif diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp index 7697570..a0b1a79 100644 --- a/src/opengl/qglpaintdevice.cpp +++ b/src/opengl/qglpaintdevice.cpp @@ -48,14 +48,10 @@ #include <private/qpixmapdata_x11gl_p.h> #endif -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include <private/qpixmapdata_gl_p.h> #endif -#if defined(QT_OPENGL_ES_1_CL) -#include "qgl_cl_p.h" -#endif - QT_BEGIN_NAMESPACE QGLPaintDevice::QGLPaintDevice() @@ -198,7 +194,7 @@ QGLPaintDevice* QGLPaintDevice::getDevice(QPaintDevice* pd) glpd = &(static_cast<QGLFramebufferObject*>(pd)->d_func()->glDevice); break; case QInternal::Pixmap: { -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) QPixmapData* pmd = static_cast<QPixmap*>(pd)->pixmapData(); if (pmd->classId() == QPixmapData::OpenGLClass) glpd = static_cast<QGLPixmapData*>(pmd)->glDevice(); diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 46f7697..eca9550 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -78,7 +78,7 @@ #include <QtCore/qglobal.h> -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include <private/qpaintengineex_opengl2_p.h> #endif @@ -387,7 +387,7 @@ bool QGLPixelBuffer::isValid() const return !d->invalid; } -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_buffer_2_engine) #endif @@ -398,7 +398,7 @@ Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_buffer_engine) /*! \reimp */ QPaintEngine *QGLPixelBuffer::paintEngine() const { -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) return qt_buffer_engine(); #elif defined(QT_OPENGL_ES_2) return qt_buffer_2_engine(); diff --git a/src/opengl/qglpixelbuffer_egl.cpp b/src/opengl/qglpixelbuffer_egl.cpp index ca19011..1e3223e 100644 --- a/src/opengl/qglpixelbuffer_egl.cpp +++ b/src/opengl/qglpixelbuffer_egl.cpp @@ -47,10 +47,6 @@ #include <qimage.h> #include <private/qgl_p.h> -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - QT_BEGIN_NAMESPACE #ifdef EGL_BIND_TO_TEXTURE_RGBA diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 79484fa..8fd4acf 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if !defined(QT_OPENGL_ES_1) /*! \class QGLShaderProgram @@ -1426,6 +1426,38 @@ void QGLShaderProgram::setAttributeArray } /*! + Sets an array of vertex \a values on the attribute at \a location + in this shader program. The \a stride indicates the number of bytes + between vertices. A default \a stride value of zero indicates that + the vertices are densely packed in \a values. + + The \a type indicates the type of elements in the \a values array, + usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a tupleSize + indicates the number of components per vertex: 1, 2, 3, or 4. + + The array will become active when enableAttributeArray() is called + on the \a location. Otherwise the value specified with + setAttributeValue() for \a location will be used. + + The setAttributeBuffer() function can be used to set the attribute + array to an offset within a vertex buffer. + + \sa setAttributeValue(), setUniformValue(), enableAttributeArray() + \sa disableAttributeArray(), setAttributeBuffer() + \since 4.7 +*/ +void QGLShaderProgram::setAttributeArray + (int location, GLenum type, const void *values, int tupleSize, int stride) +{ + Q_D(QGLShaderProgram); + Q_UNUSED(d); + if (location != -1) { + glVertexAttribPointer(location, tupleSize, type, GL_FALSE, + stride, values); + } +} + +/*! \overload Sets an array of vertex \a values on the attribute called \a name @@ -1511,6 +1543,92 @@ void QGLShaderProgram::setAttributeArray } /*! + \overload + + Sets an array of vertex \a values on the attribute called \a name + in this shader program. The \a stride indicates the number of bytes + between vertices. A default \a stride value of zero indicates that + the vertices are densely packed in \a values. + + The \a type indicates the type of elements in the \a values array, + usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a tupleSize + indicates the number of components per vertex: 1, 2, 3, or 4. + + The array will become active when enableAttributeArray() is called + on the \a name. Otherwise the value specified with + setAttributeValue() for \a name will be used. + + The setAttributeBuffer() function can be used to set the attribute + array to an offset within a vertex buffer. + + \sa setAttributeValue(), setUniformValue(), enableAttributeArray() + \sa disableAttributeArray(), setAttributeBuffer() + \since 4.7 +*/ +void QGLShaderProgram::setAttributeArray + (const char *name, GLenum type, const void *values, int tupleSize, int stride) +{ + setAttributeArray(attributeLocation(name), type, values, tupleSize, stride); +} + +/*! + Sets an array of vertex values on the attribute at \a location in + this shader program, starting at a specific \a offset in the + currently bound vertex buffer. The \a stride indicates the number + of bytes between vertices. A default \a stride value of zero + indicates that the vertices are densely packed in the value array. + + The \a type indicates the type of elements in the vertex value + array, usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a + tupleSize indicates the number of components per vertex: 1, 2, 3, + or 4. + + The array will become active when enableAttributeArray() is called + on the \a location. Otherwise the value specified with + setAttributeValue() for \a location will be used. + + \sa setAttributeArray() + \since 4.7 +*/ +void QGLShaderProgram::setAttributeBuffer + (int location, GLenum type, int offset, int tupleSize, int stride) +{ + Q_D(QGLShaderProgram); + Q_UNUSED(d); + if (location != -1) { + glVertexAttribPointer(location, tupleSize, type, GL_FALSE, stride, + reinterpret_cast<const void *>(offset)); + } +} + +/*! + \overload + + Sets an array of vertex values on the attribute called \a name + in this shader program, starting at a specific \a offset in the + currently bound vertex buffer. The \a stride indicates the number + of bytes between vertices. A default \a stride value of zero + indicates that the vertices are densely packed in the value array. + + The \a type indicates the type of elements in the vertex value + array, usually \c{GL_FLOAT}, \c{GL_UNSIGNED_BYTE}, etc. The \a + tupleSize indicates the number of components per vertex: 1, 2, 3, + or 4. + + The array will become active when enableAttributeArray() is called + on the \a name. Otherwise the value specified with + setAttributeValue() for \a name will be used. + + \sa setAttributeArray() + \since 4.7 +*/ +void QGLShaderProgram::setAttributeBuffer + (const char *name, GLenum type, int offset, int tupleSize, int stride) +{ + setAttributeBuffer(attributeLocation(name), type, offset, tupleSize, stride); +} + +/*! Enables the vertex array at \a location in this shader program so that the value set by setAttributeArray() on \a location will be used by the shader program. @@ -2307,6 +2425,42 @@ void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x4& value \overload Sets the uniform variable at \a location in the current context + to a 2x2 matrix \a value. The matrix elements must be specified + in column-major order. + + \sa setAttributeValue() + \since 4.7 +*/ +void QGLShaderProgram::setUniformValue(int location, const GLfloat value[2][2]) +{ + Q_D(QGLShaderProgram); + Q_UNUSED(d); + if (location != -1) + glUniformMatrix2fv(location, 1, GL_FALSE, value[0]); +} + +/*! + \overload + + Sets the uniform variable at \a location in the current context + to a 3x3 matrix \a value. The matrix elements must be specified + in column-major order. + + \sa setAttributeValue() + \since 4.7 +*/ +void QGLShaderProgram::setUniformValue(int location, const GLfloat value[3][3]) +{ + Q_D(QGLShaderProgram); + Q_UNUSED(d); + if (location != -1) + glUniformMatrix3fv(location, 1, GL_FALSE, value[0]); +} + +/*! + \overload + + Sets the uniform variable at \a location in the current context to a 4x4 matrix \a value. The matrix elements must be specified in column-major order. @@ -2320,6 +2474,37 @@ void QGLShaderProgram::setUniformValue(int location, const GLfloat value[4][4]) glUniformMatrix4fv(location, 1, GL_FALSE, value[0]); } + +/*! + \overload + + Sets the uniform variable called \a name in the current context + to a 2x2 matrix \a value. The matrix elements must be specified + in column-major order. + + \sa setAttributeValue() + \since 4.7 +*/ +void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[2][2]) +{ + setUniformValue(uniformLocation(name), value); +} + +/*! + \overload + + Sets the uniform variable called \a name in the current context + to a 3x3 matrix \a value. The matrix elements must be specified + in column-major order. + + \sa setAttributeValue() + \since 4.7 +*/ +void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[3][3]) +{ + setUniformValue(uniformLocation(name), value); +} + /*! \overload @@ -2895,6 +3080,34 @@ void QGLShaderProgram::shaderDestroyed() #ifdef Q_MAC_COMPAT_GL_FUNCTIONS /*! \internal */ +void QGLShaderProgram::setAttributeArray + (int location, QMacCompatGLenum type, const void *values, int tupleSize, int stride) +{ + setAttributeArray(location, GLenum(type), values, tupleSize, stride); +} + +/*! \internal */ +void QGLShaderProgram::setAttributeArray + (const char *name, QMacCompatGLenum type, const void *values, int tupleSize, int stride) +{ + setAttributeArray(name, GLenum(type), values, tupleSize, stride); +} + +/*! \internal */ +void QGLShaderProgram::setAttributeBuffer + (int location, QMacCompatGLenum type, int offset, int tupleSize, int stride) +{ + setAttributeBuffer(location, GLenum(type), offset, tupleSize, stride); +} + +/*! \internal */ +void QGLShaderProgram::setAttributeBuffer + (const char *name, QMacCompatGLenum type, int offset, int tupleSize, int stride) +{ + setAttributeBuffer(name, GLenum(type), offset, tupleSize, stride); +} + +/*! \internal */ void QGLShaderProgram::setUniformValue(int location, QMacCompatGLint value) { setUniformValue(location, GLint(value)); @@ -2943,6 +3156,6 @@ void QGLShaderProgram::setUniformValueArray(const char *name, const QMacCompatGL } #endif -#endif // !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#endif // !defined(QT_OPENGL_ES_1) QT_END_NAMESPACE diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 24ab986..19ce9f2 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(OpenGL) -#if !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1) +#if !defined(QT_OPENGL_ES_1) class QGLShaderProgram; class QGLShaderPrivate; @@ -165,6 +165,8 @@ public: void setAttributeArray (int location, const QVector4D *values, int stride = 0); void setAttributeArray + (int location, GLenum type, const void *values, int tupleSize, int stride = 0); + void setAttributeArray (const char *name, const GLfloat *values, int tupleSize, int stride = 0); void setAttributeArray (const char *name, const QVector2D *values, int stride = 0); @@ -172,6 +174,24 @@ public: (const char *name, const QVector3D *values, int stride = 0); void setAttributeArray (const char *name, const QVector4D *values, int stride = 0); + void setAttributeArray + (const char *name, GLenum type, const void *values, int tupleSize, int stride = 0); + + void setAttributeBuffer + (int location, GLenum type, int offset, int tupleSize, int stride = 0); + void setAttributeBuffer + (const char *name, GLenum type, int offset, int tupleSize, int stride = 0); + +#ifdef Q_MAC_COMPAT_GL_FUNCTIONS + void setAttributeArray + (int location, QMacCompatGLenum type, const void *values, int tupleSize, int stride = 0); + void setAttributeArray + (const char *name, QMacCompatGLenum type, const void *values, int tupleSize, int stride = 0); + void setAttributeBuffer + (int location, QMacCompatGLenum type, int offset, int tupleSize, int stride = 0); + void setAttributeBuffer + (const char *name, QMacCompatGLenum type, int offset, int tupleSize, int stride = 0); +#endif void enableAttributeArray(int location); void enableAttributeArray(const char *name); @@ -216,6 +236,8 @@ public: void setUniformValue(int location, const QMatrix4x2& value); void setUniformValue(int location, const QMatrix4x3& value); void setUniformValue(int location, const QMatrix4x4& value); + void setUniformValue(int location, const GLfloat value[2][2]); + void setUniformValue(int location, const GLfloat value[3][3]); void setUniformValue(int location, const GLfloat value[4][4]); void setUniformValue(int location, const QTransform& value); @@ -242,6 +264,8 @@ public: void setUniformValue(const char *name, const QMatrix4x2& value); void setUniformValue(const char *name, const QMatrix4x3& value); void setUniformValue(const char *name, const QMatrix4x4& value); + void setUniformValue(const char *name, const GLfloat value[2][2]); + void setUniformValue(const char *name, const GLfloat value[3][3]); void setUniformValue(const char *name, const GLfloat value[4][4]); void setUniformValue(const char *name, const QTransform& value); diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp index dddc85d..f53ef54 100644 --- a/src/opengl/qgraphicsshadereffect.cpp +++ b/src/opengl/qgraphicsshadereffect.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qgraphicsshadereffect_p.h" -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include "qglshaderprogram.h" #include "gl2paintengineex/qglcustomshaderstage_p.h" #define QGL_HAVE_CUSTOM_SHADERS 1 diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 57918d0..3845e43 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -71,10 +71,6 @@ #include "private/qwsmanager_p.h" #endif -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - #define QGL_FUNC_CONTEXT QGLContext *ctx = const_cast<QGLContext *>(device->context()); #include <stdlib.h> @@ -780,7 +776,7 @@ public: void drawOffscreenPath(const QPainterPath &path); void composite(const QRectF &rect, const QPoint &maskOffset = QPoint()); - void composite(GLuint primitive, const q_vertexType *vertexArray, int vertexCount, const QPoint &maskOffset = QPoint()); + void composite(GLuint primitive, const GLfloat *vertexArray, int vertexCount, const QPoint &maskOffset = QPoint()); bool createFragmentPrograms(); void deleteFragmentPrograms(); @@ -1787,7 +1783,7 @@ class QOpenGLTrapezoidToArrayTessellator : public QOpenGLTessellator public: QOpenGLTrapezoidToArrayTessellator() : vertices(0), allocated(0), size(0) {} ~QOpenGLTrapezoidToArrayTessellator() { free(vertices); } - q_vertexType *vertices; + GLfloat *vertices; int allocated; int size; QRectF bounds; @@ -1808,36 +1804,36 @@ void QOpenGLTrapezoidToArrayTessellator::addTrap(const Trapezoid &trap) if (size > allocated - 12) { #endif allocated = qMax(2*allocated, 512); - vertices = (q_vertexType *)realloc(vertices, allocated * sizeof(q_vertexType)); + vertices = (GLfloat *)realloc(vertices, allocated * sizeof(GLfloat)); } QGLTrapezoid t = toGLTrapezoid(trap); #ifndef QT_OPENGL_ES - vertices[size++] = f2vt(t.topLeftX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.topRightX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.bottomRightX); - vertices[size++] = f2vt(t.bottom); - vertices[size++] = f2vt(t.bottomLeftX); - vertices[size++] = f2vt(t.bottom); + vertices[size++] = t.topLeftX; + vertices[size++] = t.top; + vertices[size++] = t.topRightX; + vertices[size++] = t.top; + vertices[size++] = t.bottomRightX; + vertices[size++] = t.bottom; + vertices[size++] = t.bottomLeftX; + vertices[size++] = t.bottom; #else // First triangle - vertices[size++] = f2vt(t.topLeftX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.topRightX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.bottomRightX); - vertices[size++] = f2vt(t.bottom); + vertices[size++] = t.topLeftX; + vertices[size++] = t.top; + vertices[size++] = t.topRightX; + vertices[size++] = t.top; + vertices[size++] = t.bottomRightX; + vertices[size++] = t.bottom; // Second triangle - vertices[size++] = f2vt(t.bottomLeftX); - vertices[size++] = f2vt(t.bottom); - vertices[size++] = f2vt(t.topLeftX); - vertices[size++] = f2vt(t.top); - vertices[size++] = f2vt(t.bottomRightX); - vertices[size++] = f2vt(t.bottom); + vertices[size++] = t.bottomLeftX; + vertices[size++] = t.bottom; + vertices[size++] = t.topLeftX; + vertices[size++] = t.top; + vertices[size++] = t.bottomRightX; + vertices[size++] = t.bottom; #endif } @@ -1864,7 +1860,7 @@ void QOpenGLPaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, in if (use_fragment_programs && !(fast_style && has_fast_composition_mode)) { composite(geometry_mode, tessellator.vertices, tessellator.size / 2); } else { - glVertexPointer(2, q_vertexTypeEnum, 0, tessellator.vertices); + glVertexPointer(2, GL_FLOAT, 0, tessellator.vertices); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(geometry_mode, 0, tessellator.size/2); glDisableClientState(GL_VERTEX_ARRAY); @@ -2265,7 +2261,7 @@ void QOpenGLPaintEnginePrivate::updateDepthClip() return; } -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_2) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_2) glClearDepthf(0.0f); #else glClearDepth(0.0f); @@ -2281,12 +2277,12 @@ void QOpenGLPaintEnginePrivate::updateDepthClip() const QVector<QRect> rects = q->state()->clipEnabled ? q->state()->clipRegion.rects() : q->systemClip().rects(); // rectangle count * 2 (triangles) * vertex count * component count (Z omitted) - QDataBuffer<q_vertexType> clipVertex(rects.size()*2*3*2); + QDataBuffer<GLfloat> clipVertex(rects.size()*2*3*2); for (int i = 0; i < rects.size(); ++i) { - q_vertexType x = i2vt(rects.at(i).left()); - q_vertexType w = i2vt(rects.at(i).width()); - q_vertexType h = i2vt(rects.at(i).height()); - q_vertexType y = i2vt(rects.at(i).top()); + GLfloat x = GLfloat(rects.at(i).left()); + GLfloat w = GLfloat(rects.at(i).width()); + GLfloat h = GLfloat(rects.at(i).height()); + GLfloat y = GLfloat(rects.at(i).top()); // First triangle clipVertex.add(x); @@ -2314,7 +2310,7 @@ void QOpenGLPaintEnginePrivate::updateDepthClip() glLoadIdentity(); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, clipVertex.data()); + glVertexPointer(2, GL_FLOAT, 0, clipVertex.data()); glDrawArrays(GL_TRIANGLES, 0, rects.size()*2*3); glDisableClientState(GL_VERTEX_ARRAY); @@ -3106,8 +3102,8 @@ QGLTrapezoidMaskGenerator::QGLTrapezoidMaskGenerator(const QPainterPath &path, c { } -extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array); -extern void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array); +extern void qt_add_rect_to_array(const QRectF &r, GLfloat *array); +extern void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, GLfloat *array); void QGLTrapezoidMaskGenerator::drawMask(const QRect &rect) { @@ -3138,7 +3134,7 @@ void QGLTrapezoidMaskGenerator::drawMask(const QRect &rect) // clear mask glBlendFunc(GL_ZERO, GL_ZERO); // clear - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); @@ -3369,7 +3365,7 @@ void QGLEllipseMaskGenerator::drawMask(const QRect &rect) glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, maskVariableLocations[VAR_ELLIPSE_OFFSET], ellipse_offset); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); glDisable(GL_FRAGMENT_PROGRAM_ARB); @@ -3399,7 +3395,7 @@ void QOpenGLPaintEnginePrivate::drawFastRect(const QRectF &r) Q_Q(QOpenGLPaintEngine); DEBUG_ONCE_STR("QOpenGLPaintEngine::drawRects(): drawing fast rect"); - q_vertexType vertexArray[10]; + GLfloat vertexArray[10]; qt_add_rect_to_array(r, vertexArray); if (has_pen) @@ -3420,7 +3416,7 @@ void QOpenGLPaintEnginePrivate::drawFastRect(const QRectF &r) if (fast_style && has_fast_composition_mode) { glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); } else { @@ -3439,7 +3435,7 @@ void QOpenGLPaintEnginePrivate::drawFastRect(const QRectF &r) vertexArray[8] = vertexArray[0]; vertexArray[9] = vertexArray[1]; - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glEnableClientState(GL_VERTEX_ARRAY); glDrawArrays(GL_LINE_STRIP, 0, 5); glDisableClientState(GL_VERTEX_ARRAY); @@ -3546,7 +3542,7 @@ void QOpenGLPaintEngine::drawRects(const QRectF *rects, int rectCount) } } -static void addQuadAsTriangle(q_vertexType *quad, q_vertexType *triangle) +static void addQuadAsTriangle(GLfloat *quad, GLfloat *triangle) { triangle[0] = quad[0]; triangle[1] = quad[1]; @@ -3607,7 +3603,7 @@ void QOpenGLPaintEngine::drawPoints(const QPointF *points, int pointCount) d->flushDrawQueue(); if (d->has_fast_pen) { - QVarLengthArray<q_vertexType> vertexArray(6 * pointCount); + QVarLengthArray<GLfloat> vertexArray(6 * pointCount); glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -3617,25 +3613,22 @@ void QOpenGLPaintEngine::drawPoints(const QPointF *points, int pointCount) for (int i = 0; i < pointCount; ++i) { QPointF mapped = d->matrix.map(points[i]); - qreal xf = qRound(mapped.x()); - qreal yf = qRound(mapped.y()); - - q_vertexType x = f2vt(xf); - q_vertexType y = f2vt(yf); + GLfloat x = GLfloat(qRound(mapped.x())); + GLfloat y = GLfloat(qRound(mapped.y())); vertexArray[j++] = x; - vertexArray[j++] = y - f2vt(0.5); + vertexArray[j++] = y - 0.5f; - vertexArray[j++] = x + f2vt(1.5); - vertexArray[j++] = y + f2vt(1.0); + vertexArray[j++] = x + 1.5f; + vertexArray[j++] = y + 1.0f; vertexArray[j++] = x; - vertexArray[j++] = y + f2vt(1.0); + vertexArray[j++] = y + 1.0f; } glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray.constData()); + glVertexPointer(2, GL_FLOAT, 0, vertexArray.constData()); glDrawArrays(GL_TRIANGLES, 0, pointCount*3); glDisableClientState(GL_VERTEX_ARRAY); @@ -3652,7 +3645,7 @@ void QOpenGLPaintEngine::drawPoints(const QPointF *points, int pointCount) } else { Q_ASSERT(sizeof(QPointF) == 8); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); } glEnableClientState(GL_VERTEX_ARRAY); @@ -3720,47 +3713,47 @@ void QOpenGLPaintEngine::drawLines(const QLineF *lines, int lineCount) } } - q_vertexType endCap = f2vt(d->cpen.capStyle() == Qt::FlatCap ? 0 : 0.5); + GLfloat endCap = d->cpen.capStyle() == Qt::FlatCap ? 0.0f : 0.5f; if (useRects) { - QVarLengthArray<q_vertexType> vertexArray(12 * lineCount); + QVarLengthArray<GLfloat> vertexArray(12 * lineCount); - q_vertexType quad[8]; + GLfloat quad[8]; for (int i = 0; i < lineCount; ++i) { - q_vertexType x1 = f2vt(lines[i].x1()); - q_vertexType x2 = f2vt(lines[i].x2()); - q_vertexType y1 = f2vt(lines[i].y1()); - q_vertexType y2 = f2vt(lines[i].y2()); + GLfloat x1 = lines[i].x1(); + GLfloat x2 = lines[i].x2(); + GLfloat y1 = lines[i].y1(); + GLfloat y2 = lines[i].y2(); if (x1 == x2) { if (y1 > y2) qSwap(y1, y2); - quad[0] = x1 - f2vt(0.5); + quad[0] = x1 - 0.5f; quad[1] = y1 - endCap; - quad[2] = x1 + f2vt(0.5); + quad[2] = x1 + 0.5f; quad[3] = y1 - endCap; - quad[4] = x1 + f2vt(0.5); + quad[4] = x1 + 0.5f; quad[5] = y2 + endCap; - quad[6] = x1 - f2vt(0.5); + quad[6] = x1 - 0.5f; quad[7] = y2 + endCap; } else { if (x1 > x2) qSwap(x1, x2); quad[0] = x1 - endCap; - quad[1] = y1 + f2vt(0.5); + quad[1] = y1 + 0.5f; quad[2] = x1 - endCap; - quad[3] = y1 - f2vt(0.5); + quad[3] = y1 - 0.5f; quad[4] = x2 + endCap; - quad[5] = y1 - f2vt(0.5); + quad[5] = y1 - 0.5f; quad[6] = x2 + endCap; - quad[7] = y1 + f2vt(0.5); + quad[7] = y1 + 0.5f; } addQuadAsTriangle(quad, &vertexArray[12*i]); @@ -3768,26 +3761,26 @@ void QOpenGLPaintEngine::drawLines(const QLineF *lines, int lineCount) glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray.constData()); + glVertexPointer(2, GL_FLOAT, 0, vertexArray.constData()); glDrawArrays(GL_TRIANGLES, 0, lineCount*6); glDisableClientState(GL_VERTEX_ARRAY); } else { - QVarLengthArray<q_vertexType> vertexArray(4 * lineCount); + QVarLengthArray<GLfloat> vertexArray(4 * lineCount); for (int i = 0; i < lineCount; ++i) { const QPointF a = lines[i].p1(); - vertexArray[4*i] = f2vt(lines[i].x1()); - vertexArray[4*i+1] = f2vt(lines[i].y1()); - vertexArray[4*i+2] = f2vt(lines[i].x2()); - vertexArray[4*i+3] = f2vt(lines[i].y2()); + vertexArray[4*i] = lines[i].x1(); + vertexArray[4*i+1] = lines[i].y1(); + vertexArray[4*i+2] = lines[i].x2(); + vertexArray[4*i+3] = lines[i].y2(); } glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray.constData()); + glVertexPointer(2, GL_FLOAT, 0, vertexArray.constData()); glDrawArrays(GL_LINES, 0, lineCount*2); - glVertexPointer(2, q_vertexTypeEnum, 4*sizeof(q_vertexType), vertexArray.constData() + 2); + glVertexPointer(2, GL_FLOAT, 4*sizeof(GLfloat), vertexArray.constData() + 2); glDrawArrays(GL_POINTS, 0, lineCount); glDisableClientState(GL_VERTEX_ARRAY); @@ -3874,7 +3867,7 @@ void QOpenGLPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly } else { Q_ASSERT(sizeof(QPointF) == 8); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); } glEnableClientState(GL_VERTEX_ARRAY); @@ -3893,12 +3886,12 @@ void QOpenGLPaintEngine::drawPolygon(const QPointF *points, int pointCount, Poly if (d->has_pen) { if (d->has_fast_pen && !d->high_quality_antialiasing) { d->setGradientOps(d->cpen.brush(), bounds); - QVarLengthArray<q_vertexType> vertexArray(pointCount*2 + 2); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray.constData()); + QVarLengthArray<GLfloat> vertexArray(pointCount*2 + 2); + glVertexPointer(2, GL_FLOAT, 0, vertexArray.constData()); int i; for (i=0; i<pointCount; ++i) { - vertexArray[i*2] = f2vt(points[i].x()); - vertexArray[i*2+1] = f2vt(points[i].y()); + vertexArray[i*2] = points[i].x(); + vertexArray[i*2+1] = points[i].y(); } glEnableClientState(GL_VERTEX_ARRAY); @@ -4074,7 +4067,7 @@ void QOpenGLPaintEnginePrivate::strokePathFastPen(const QPainterPath &path, bool switch (e.type) { case QPainterPath::MoveToElement: if (i != 0) { - glVertexPointer(2, q_vertexTypeEnum, 0, tess_points.data()); + glVertexPointer(2, GL_FLOAT, 0, tess_points.data()); glDrawArrays(GL_LINE_STRIP, 0, tess_points.size()); tess_points.reset(); } @@ -4124,7 +4117,7 @@ void QOpenGLPaintEnginePrivate::strokePathFastPen(const QPainterPath &path, bool break; } // end of switch } - glVertexPointer(2, q_vertexTypeEnum, 0, tess_points.data()); + glVertexPointer(2, GL_FLOAT, 0, tess_points.data()); glDrawArrays(GL_LINE_STRIP, 0, tess_points.size()); glDisableClientState(GL_VERTEX_ARRAY); #endif @@ -4391,8 +4384,8 @@ void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, con glRotatef(180.0, 0.0, 0.0, 1.0); } - q_vertexType vertexArray[4*2]; - q_vertexType texCoordArray[4*2]; + GLfloat vertexArray[4*2]; + GLfloat texCoordArray[4*2]; double offset_x = offset.x() / pm.width(); double offset_y = offset.y() / pm.height(); @@ -4401,8 +4394,8 @@ void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, con qt_add_texcoords_to_array(offset_x, offset_y, tc_w + offset_x, tc_h + offset_y, texCoordArray); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); - glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); + glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -4483,14 +4476,14 @@ void QOpenGLPaintEngine::drawTextureRect(int tx_width, int tx_height, const QRec y2 = sr.y(); } - q_vertexType vertexArray[4*2]; - q_vertexType texCoordArray[4*2]; + GLfloat vertexArray[4*2]; + GLfloat texCoordArray[4*2]; qt_add_rect_to_array(r, vertexArray); qt_add_texcoords_to_array(x1, y2, x2, y1, texCoordArray); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); - glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); + glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -4943,11 +4936,11 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte #endif // do the actual drawing - q_vertexType vertexArray[4*2]; - q_vertexType texCoordArray[4*2]; + GLfloat vertexArray[4*2]; + GLfloat texCoordArray[4*2]; - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); - glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); + glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -5160,7 +5153,7 @@ void QOpenGLPaintEnginePrivate::composite(const QRectF &rect, const QPoint &mask Q_UNUSED(rect); Q_UNUSED(maskOffset); #else - q_vertexType vertexArray[8]; + GLfloat vertexArray[8]; qt_add_rect_to_array(rect, vertexArray); composite(GL_TRIANGLE_FAN, vertexArray, 4, maskOffset); @@ -5168,7 +5161,7 @@ void QOpenGLPaintEnginePrivate::composite(const QRectF &rect, const QPoint &mask } -void QOpenGLPaintEnginePrivate::composite(GLuint primitive, const q_vertexType *vertexArray, int vertexCount, const QPoint &maskOffset) +void QOpenGLPaintEnginePrivate::composite(GLuint primitive, const GLfloat *vertexArray, int vertexCount, const QPoint &maskOffset) { #ifdef QT_OPENGL_ES Q_UNUSED(primitive); @@ -5191,8 +5184,8 @@ void QOpenGLPaintEnginePrivate::composite(GLuint primitive, const q_vertexType * qreal minX = 1e9, minY = 1e9, maxX = -1e9, maxY = -1e9; for (int i = 0; i < vertexCount; ++i) { - qreal x = vt2f(vertexArray[2 * i]); - qreal y = vt2f(vertexArray[2 * i + 1]); + qreal x = vertexArray[2 * i]; + qreal y = vertexArray[2 * i + 1]; qreal tx, ty; matrix.map(x, y, &tx, &ty); @@ -5251,7 +5244,7 @@ void QOpenGLPaintEnginePrivate::composite(GLuint primitive, const q_vertexType * } glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); glEnable(GL_FRAGMENT_PROGRAM_ARB); GLuint program = qt_gl_program_cache()->getProgram(device->context(), fragment_brush, diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp index 55aa1d0..edce56a 100644 --- a/src/opengl/qpixmapdata_x11gl_egl.cpp +++ b/src/opengl/qpixmapdata_x11gl_egl.cpp @@ -45,7 +45,7 @@ #include <private/qegl_p.h> #include <private/qeglproperties_p.h> -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include <private/qpaintengineex_opengl2_p.h> #endif @@ -196,7 +196,7 @@ QX11GLPixmapData::~QX11GLPixmapData() { } -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_pixmap_2_engine) #endif @@ -220,7 +220,7 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const QPaintEngine* engine; -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) engine = qt_gl_pixmap_engine(); #elif defined(QT_OPENGL_ES_2) engine = qt_gl_pixmap_2_engine(); @@ -237,7 +237,7 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const if (engine->isActive()) { qWarning("Pixmap paint engine already active"); -#if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_1_CL) +#if defined(QT_OPENGL_ES_1) engine = new QOpenGLPaintEngine; #elif defined(QT_OPENGL_ES_2) engine = new QGL2PaintEngineEx; diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 7a565e6..4ac4a3a 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -82,10 +82,6 @@ #define GLX_SAMPLES_ARB 100001 #endif -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - #ifdef QT_OPENGL_ES #include <private/qegl_p.h> #endif @@ -838,22 +834,22 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, src.setBottom(src.bottom() / height); } - const q_vertexType tx1 = f2vt(src.left()); - const q_vertexType tx2 = f2vt(src.right()); - const q_vertexType ty1 = f2vt(src.top()); - const q_vertexType ty2 = f2vt(src.bottom()); + const GLfloat tx1 = src.left(); + const GLfloat tx2 = src.right(); + const GLfloat ty1 = src.top(); + const GLfloat ty2 = src.bottom(); - q_vertexType texCoordArray[4*2] = { + GLfloat texCoordArray[4*2] = { tx1, ty2, tx2, ty2, tx2, ty1, tx1, ty1 }; - q_vertexType vertexArray[4*2]; - extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array); // qpaintengine_opengl.cpp + GLfloat vertexArray[4*2]; + extern void qt_add_rect_to_array(const QRectF &r, GLfloat *array); // qpaintengine_opengl.cpp qt_add_rect_to_array(rect, vertexArray); #if !defined(QT_OPENGL_ES_2) - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); - glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); + glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray); glBindTexture(target, tex_id); glEnable(target); diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 6813d2f..18d6b0a 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -980,7 +980,7 @@ static QImage colorizeBitmap(const QImage &image, const QColor &color) int height = sourceImage.height(); int width = sourceImage.width(); for (int y=0; y<height; ++y) { - uchar *source = sourceImage.scanLine(y); + const uchar *source = sourceImage.constScanLine(y); QRgb *target = reinterpret_cast<QRgb *>(dest.scanLine(y)); for (int x=0; x < width; ++x) target[x] = (source[x>>3] >> (x&7)) & 1 ? fg : bg; @@ -988,9 +988,6 @@ static QImage colorizeBitmap(const QImage &image, const QColor &color) return dest; } -// defined in qpixmapdata_vg.cpp. -const uchar *qt_vg_imageBits(const QImage& image); - static VGImage toVGImage (const QImage & image, Qt::ImageConversionFlags flags = Qt::AutoColor) { @@ -1024,7 +1021,7 @@ static VGImage toVGImage break; } - const uchar *pixels = qt_vg_imageBits(img); + const uchar *pixels = img.constBits(); VGImage vgImg = QVGImagePool::instance()->createPermanentImage (format, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); @@ -1068,7 +1065,7 @@ static VGImage toVGImageSubRect break; } - const uchar *pixels = qt_vg_imageBits(img) + bpp * sr.x() + + const uchar *pixels = img.constBits() + bpp * sr.x() + img.bytesPerLine() * sr.y(); VGImage vgImg = QVGImagePool::instance()->createPermanentImage @@ -1090,7 +1087,7 @@ static VGImage toVGImageWithOpacity(const QImage & image, qreal opacity) painter.drawImage(0, 0, image); painter.end(); - const uchar *pixels = qt_vg_imageBits(img); + const uchar *pixels = img.constBits(); VGImage vgImg = QVGImagePool::instance()->createPermanentImage (VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); @@ -1112,7 +1109,7 @@ static VGImage toVGImageWithOpacitySubRect painter.drawImage(QPoint(0, 0), image, sr); painter.end(); - const uchar *pixels = qt_vg_imageBits(img); + const uchar *pixels = img.constBits(); VGImage vgImg = QVGImagePool::instance()->createPermanentImage (VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); @@ -3228,15 +3225,15 @@ void QVGFontGlyphCache::cacheGlyphs if (!scaledImage.isNull()) { // Not a space character if (scaledImage.format() == QImage::Format_Indexed8) { vgImage = vgCreateImage(VG_A_8, scaledImage.width(), scaledImage.height(), VG_IMAGE_QUALITY_FASTER); - vgImageSubData(vgImage, qt_vg_imageBits(scaledImage), scaledImage.bytesPerLine(), VG_A_8, 0, 0, scaledImage.width(), scaledImage.height()); + vgImageSubData(vgImage, scaledImage.constBits(), scaledImage.bytesPerLine(), VG_A_8, 0, 0, scaledImage.width(), scaledImage.height()); } else if (scaledImage.format() == QImage::Format_Mono) { QImage img = scaledImage.convertToFormat(QImage::Format_Indexed8); vgImage = vgCreateImage(VG_A_8, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); - vgImageSubData(vgImage, qt_vg_imageBits(img), img.bytesPerLine(), VG_A_8, 0, 0, img.width(), img.height()); + vgImageSubData(vgImage, img.constBits(), img.bytesPerLine(), VG_A_8, 0, 0, img.width(), img.height()); } else { QImage img = scaledImage.convertToFormat(QImage::Format_ARGB32_Premultiplied); vgImage = vgCreateImage(VG_sARGB_8888_PRE, img.width(), img.height(), VG_IMAGE_QUALITY_FASTER); - vgImageSubData(vgImage, qt_vg_imageBits(img), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height()); + vgImageSubData(vgImage, img.constBits(), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height()); } } origin[0] = -metrics.x.toReal() + 0.5f; @@ -3704,7 +3701,7 @@ void QVGCompositionHelper::drawCursorPixmap if (vgImage == VG_INVALID_HANDLE) return; vgImageSubData - (vgImage, qt_vg_imageBits(img) + img.bytesPerLine() * (img.height() - 1), + (vgImage, img.constBits() + img.bytesPerLine() * (img.height() - 1), -(img.bytesPerLine()), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height()); diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index 3087b77..44814cc 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -231,14 +231,6 @@ QPaintEngine* QVGPixmapData::paintEngine() const return source.paintEngine(); } -// This function works around QImage::bits() making a deep copy if the -// QImage is not const. We force it to be const and then get the bits. -// XXX: Should add a QImage::constBits() in the future to replace this. -const uchar *qt_vg_imageBits(const QImage& image) -{ - return image.bits(); -} - VGImage QVGPixmapData::toVGImage() { if (!isValid()) @@ -271,7 +263,7 @@ VGImage QVGPixmapData::toVGImage() if (!source.isNull() && recreate) { vgImageSubData (vgImage, - qt_vg_imageBits(source), source.bytesPerLine(), + source.constBits(), source.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, w, h); } @@ -670,7 +662,7 @@ void* QVGPixmapData::toNativeType(NativeType type) if (bitmap) { if (bitmap->Create(TSize(source.width(), source.height()), EColor16MAP) == KErrNone) { - const uchar *sptr = qt_vg_imageBits(source); + const uchar *sptr = source.constBits(); bitmap->BeginDataAccess(); uchar *dptr = (uchar*)bitmap->DataAddress(); diff --git a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp index ad33d0b..499eb1d 100644 --- a/src/plugins/accessible/widgets/qaccessiblewidgets.cpp +++ b/src/plugins/accessible/widgets/qaccessiblewidgets.cpp @@ -176,7 +176,7 @@ static inline QWidget *mdiAreaNavigate(QWidget *area, int minimumDistance = INT_MAX; QWidget *target = 0; - foreach (QWidget *candidate, candidates.values()) { + foreach (QWidget *candidate, candidates) { switch (relation) { case QAccessible::Up: case QAccessible::Down: diff --git a/src/plugins/graphicssystems/opengl/main.cpp b/src/plugins/graphicssystems/opengl/main.cpp index 19631b6..abcfb7f 100644 --- a/src/plugins/graphicssystems/opengl/main.cpp +++ b/src/plugins/graphicssystems/opengl/main.cpp @@ -56,7 +56,7 @@ QStringList QGLGraphicsSystemPlugin::keys() const { QStringList list; list << QLatin1String("OpenGL") << QLatin1String("OpenGL1"); -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) list << QLatin1String("OpenGL2"); #endif return list; @@ -69,7 +69,7 @@ QGraphicsSystem* QGLGraphicsSystemPlugin::create(const QString& system) return new QGLGraphicsSystem; } -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) if (system.toLower() == QLatin1String("opengl2")) { QGL::setPreferredPaintEngine(QPaintEngine::OpenGL2); return new QGLGraphicsSystem; diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 6cb93ad..4b4712c 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -52,8 +52,6 @@ #undef FAR #endif -// hw: optimize smoothscaler for returning 24-bit images - // including jpeglib.h seems to be a little messy extern "C" { // mingw includes rpcndr.h but does not define boolean @@ -76,433 +74,6 @@ extern "C" { QT_BEGIN_NAMESPACE -//#define QT_NO_IMAGE_SMOOTHSCALE -#ifndef QT_NO_IMAGE_SMOOTHSCALE -class QImageSmoothScalerPrivate; -class QImageSmoothScaler -{ -public: - QImageSmoothScaler(const int w, const int h, const QImage &src); - QImageSmoothScaler(const int srcWidth, const int srcHeight, - const int dstWidth, const int dstHeight); - - virtual ~QImageSmoothScaler(void); - - QImage scale(); - -private: - QImageSmoothScalerPrivate *d; - virtual QRgb *scanLine(const int line = 0, const QImage *src = 0); -}; - -class QImageSmoothScalerPrivate -{ -public: - int cols; - int newcols; - int rows; - int newrows; - bool hasAlpha; - - const QImage *src; - - void setup(const int srcWidth, const int srcHeight, const int dstWidth, - const int dstHeight, bool hasAlphaChannel); -}; - -QImageSmoothScaler::QImageSmoothScaler(const int w, const int h, - const QImage &src) -{ - d = new QImageSmoothScalerPrivate; - - d->setup(src.width(), src.height(), w, h, src.hasAlphaChannel() ); - this->d->src = &src; -} - -QImageSmoothScaler::QImageSmoothScaler(const int srcWidth, const int srcHeight, - const int dstWidth, const int dstHeight) -{ - d = new QImageSmoothScalerPrivate; - d->setup(srcWidth, srcHeight, dstWidth, dstHeight, 0); -} - -void QImageSmoothScalerPrivate::setup(const int srcWidth, const int srcHeight, - const int dstWidth, const int dstHeight, - bool hasAlphaChannel) -{ - cols = srcWidth; - rows = srcHeight; - newcols = dstWidth; - newrows = dstHeight; - hasAlpha = hasAlphaChannel; -} - -QImageSmoothScaler::~QImageSmoothScaler() -{ - delete d; -} - -inline QRgb *QImageSmoothScaler::scanLine(const int line, const QImage *src) -{ - return (QRgb*)src->scanLine(line); -} - -/* - This function uses code based on pnmscale.c by Jef Poskanzer. - - pnmscale.c - read a portable anymap and scale it - - Copyright (C) 1989, 1991 by Jef Poskanzer. - - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, provided - that the above copyright notice appear in all copies and that both that - copyright notice and this permission notice appear in supporting - documentation. This software is provided "as is" without express or - implied warranty. -*/ - -QImage QImageSmoothScaler::scale() -{ - long SCALE; - long HALFSCALE; - QRgb *xelrow = 0; - QRgb *tempxelrow = 0; - QRgb *xP; - QRgb *nxP; - int row, rowsread; - int col, needtoreadrow; - uchar maxval = 255; - qreal xscale, yscale; - long sxscale, syscale; - long fracrowtofill, fracrowleft; - long *as; - long *rs; - long *gs; - long *bs; - int rowswritten = 0; - QImage dst; - - if (d->cols > 4096) { - SCALE = 4096; - HALFSCALE = 2048; - } else { - int fac = 4096; - while (d->cols * fac > 4096) - fac /= 2; - - SCALE = fac * d->cols; - HALFSCALE = fac * d->cols / 2; - } - - xscale = (qreal)d->newcols / (qreal)d->cols; - yscale = (qreal)d->newrows / (qreal)d->rows; - sxscale = (long)(xscale * SCALE); - syscale = (long)(yscale * SCALE); - - // shortcut Y scaling if possible - if (d->newrows != d->rows) - tempxelrow = new QRgb[d->cols]; - - if (d->hasAlpha) { - as = new long[d->cols]; - for (col = 0; col < d->cols; ++col) - as[col] = HALFSCALE; - } else { - as = 0; - } - rs = new long[d->cols]; - gs = new long[d->cols]; - bs = new long[d->cols]; - rowsread = 0; - fracrowleft = syscale; - needtoreadrow = 1; - for (col = 0; col < d->cols; ++col) - rs[col] = gs[col] = bs[col] = HALFSCALE; - fracrowtofill = SCALE; - - dst = QImage(d->newcols, d->newrows, d->hasAlpha ? QImage::Format_ARGB32 : QImage::Format_RGB32); - - for (row = 0; row < d->newrows; ++row) { - // First scale Y from xelrow into tempxelrow. - if (d->newrows == d->rows) { - // shortcut Y scaling if possible - tempxelrow = xelrow = scanLine(rowsread++, d->src); - } else { - while (fracrowleft < fracrowtofill) { - if (needtoreadrow && rowsread < d->rows) - xelrow = scanLine(rowsread++, d->src); - for (col = 0, xP = xelrow; col < d->cols; ++col, ++xP) { - if (as) { - as[col] += fracrowleft * qAlpha(*xP); - rs[col] += fracrowleft * qRed(*xP) * qAlpha(*xP) / 255; - gs[col] += fracrowleft * qGreen(*xP) * qAlpha(*xP) / 255; - bs[col] += fracrowleft * qBlue(*xP) * qAlpha(*xP) / 255; - } else { - rs[col] += fracrowleft * qRed(*xP); - gs[col] += fracrowleft * qGreen(*xP); - bs[col] += fracrowleft * qBlue(*xP); - } - } - fracrowtofill -= fracrowleft; - fracrowleft = syscale; - needtoreadrow = 1; - } - // Now fracrowleft is >= fracrowtofill, so we can produce a row. - if (needtoreadrow && rowsread < d->rows) { - xelrow = scanLine(rowsread++, d->src); - needtoreadrow = 0; - } - for (col = 0, xP = xelrow, nxP = tempxelrow; col < d->cols; ++col, ++xP, ++nxP) { - register long a, r, g, b; - - if (as) { - r = rs[col] + fracrowtofill * qRed(*xP) * qAlpha(*xP) / 255; - g = gs[col] + fracrowtofill * qGreen(*xP) * qAlpha(*xP) / 255; - b = bs[col] + fracrowtofill * qBlue(*xP) * qAlpha(*xP) / 255; - a = as[col] + fracrowtofill * qAlpha(*xP); - if (a) { - r = r * 255 / a * SCALE; - g = g * 255 / a * SCALE; - b = b * 255 / a * SCALE; - } - } else { - r = rs[col] + fracrowtofill * qRed(*xP); - g = gs[col] + fracrowtofill * qGreen(*xP); - b = bs[col] + fracrowtofill * qBlue(*xP); - a = 0; // unwarn - } - r /= SCALE; - if (r > maxval) - r = maxval; - g /= SCALE; - if (g > maxval) - g = maxval; - b /= SCALE; - if (b > maxval) - b = maxval; - if (as) { - a /= SCALE; - if (a > maxval) - a = maxval; - *nxP = qRgba((int)r, (int)g, (int)b, (int)a); - as[col] = HALFSCALE; - } else { - *nxP = qRgb((int)r, (int)g, (int)b); - } - rs[col] = gs[col] = bs[col] = HALFSCALE; - } - fracrowleft -= fracrowtofill; - if (fracrowleft == 0) { - fracrowleft = syscale; - needtoreadrow = 1; - } - fracrowtofill = SCALE; - } - - // Now scale X from tempxelrow into dst and write it out. - if (d->newcols == d->cols) { - // shortcut X scaling if possible - memcpy(dst.scanLine(rowswritten++), tempxelrow, d->newcols * 4); - } else { - register long a, r, g, b; - register long fraccoltofill, fraccolleft = 0; - register int needcol; - - nxP = (QRgb *)dst.scanLine(rowswritten++); - QRgb *nxPEnd = nxP + d->newcols; - fraccoltofill = SCALE; - a = r = g = b = HALFSCALE; - needcol = 0; - for (col = 0, xP = tempxelrow; col < d->cols; ++col, ++xP) { - fraccolleft = sxscale; - while (fraccolleft >= fraccoltofill) { - if (needcol) { - ++nxP; - a = r = g = b = HALFSCALE; - } - if (as) { - r += fraccoltofill * qRed(*xP) * qAlpha(*xP) / 255; - g += fraccoltofill * qGreen(*xP) * qAlpha(*xP) / 255; - b += fraccoltofill * qBlue(*xP) * qAlpha(*xP) / 255; - a += fraccoltofill * qAlpha(*xP); - if (a) { - r = r * 255 / a * SCALE; - g = g * 255 / a * SCALE; - b = b * 255 / a * SCALE; - } - } else { - r += fraccoltofill * qRed(*xP); - g += fraccoltofill * qGreen(*xP); - b += fraccoltofill * qBlue(*xP); - } - r /= SCALE; - if (r > maxval) - r = maxval; - g /= SCALE; - if (g > maxval) - g = maxval; - b /= SCALE; - if (b > maxval) - b = maxval; - if (as) { - a /= SCALE; - if (a > maxval) - a = maxval; - *nxP = qRgba((int)r, (int)g, (int)b, (int)a); - } else { - *nxP = qRgb((int)r, (int)g, (int)b); - } - fraccolleft -= fraccoltofill; - fraccoltofill = SCALE; - needcol = 1; - } - if (fraccolleft > 0) { - if (needcol) { - ++nxP; - a = r = g = b = HALFSCALE; - needcol = 0; - } - if (as) { - a += fraccolleft * qAlpha(*xP); - r += fraccolleft * qRed(*xP) * qAlpha(*xP) / 255; - g += fraccolleft * qGreen(*xP) * qAlpha(*xP) / 255; - b += fraccolleft * qBlue(*xP) * qAlpha(*xP) / 255; - } else { - r += fraccolleft * qRed(*xP); - g += fraccolleft * qGreen(*xP); - b += fraccolleft * qBlue(*xP); - } - fraccoltofill -= fraccolleft; - } - } - if (fraccoltofill > 0) { - --xP; - if (as) { - a += fraccolleft * qAlpha(*xP); - r += fraccoltofill * qRed(*xP) * qAlpha(*xP) / 255; - g += fraccoltofill * qGreen(*xP) * qAlpha(*xP) / 255; - b += fraccoltofill * qBlue(*xP) * qAlpha(*xP) / 255; - if (a) { - r = r * 255 / a * SCALE; - g = g * 255 / a * SCALE; - b = b * 255 / a * SCALE; - } - } else { - r += fraccoltofill * qRed(*xP); - g += fraccoltofill * qGreen(*xP); - b += fraccoltofill * qBlue(*xP); - } - } - if (nxP < nxPEnd) { - r /= SCALE; - if (r > maxval) - r = maxval; - g /= SCALE; - if (g > maxval) - g = maxval; - b /= SCALE; - if (b > maxval) - b = maxval; - if (as) { - a /= SCALE; - if (a > maxval) - a = maxval; - *nxP = qRgba((int)r, (int)g, (int)b, (int)a); - } else { - *nxP = qRgb((int)r, (int)g, (int)b); - } - while (++nxP != nxPEnd) - nxP[0] = nxP[-1]; - } - } - } - - if (d->newrows != d->rows && tempxelrow)// Robust, tempxelrow might be 0 1 day - delete [] tempxelrow; - if (as) // Avoid purify complaint - delete [] as; - if (rs) // Robust, rs might be 0 one day - delete [] rs; - if (gs) // Robust, gs might be 0 one day - delete [] gs; - if (bs) // Robust, bs might be 0 one day - delete [] bs; - - return dst; -} - -class jpegSmoothScaler : public QImageSmoothScaler -{ -public: - jpegSmoothScaler(struct jpeg_decompress_struct *info, const QSize& dstSize, const QRect& clipRect) - : QImageSmoothScaler(clipRect.width(), clipRect.height(), - dstSize.width(), dstSize.height()) - { - cinfo = info; - clip = clipRect; - imageCache = QImage(info->output_width, 1, QImage::Format_RGB32); - } - -private: - QRect clip; - QImage imageCache; - struct jpeg_decompress_struct *cinfo; - - QRgb *scanLine(const int line = 0, const QImage *src = 0) - { - QRgb *out; - uchar *in; - - Q_UNUSED(line); - Q_UNUSED(src); - - uchar* data = imageCache.bits(); - - // Read ahead if we haven't reached the first clipped scanline yet. - while (int(cinfo->output_scanline) < clip.y() && - cinfo->output_scanline < cinfo->output_height) - jpeg_read_scanlines(cinfo, &data, 1); - - // Read the next scanline. We assume that "line" - // will never be >= clip.height(). - jpeg_read_scanlines(cinfo, &data, 1); - if (cinfo->output_scanline == cinfo->output_height) - jpeg_finish_decompress(cinfo); - - out = ((QRgb*)data) + clip.x(); - - // - // The smooth scale algorithm only works on 32-bit images; - // convert from (8|24) bits to 32. - // - if (cinfo->output_components == 1) { - in = data + clip.right(); - for (int i = clip.width(); i--; ) { - out[i] = qRgb(*in, *in, *in); - in--; - } - } else if (cinfo->out_color_space == JCS_CMYK) { - in = data + clip.right() * 4; - for (int i = clip.width(); i--; ) { - int k = in[3]; - out[i] = qRgb(k * in[0] / 255, k * in[1] / 255, k * in[2] / 255); - in -= 4; - } - } else { - in = data + clip.right() * 3; - for (int i = clip.width(); i--; ) { - out[i] = qRgb(in[0], in[1], in[2]); - in -= 3; - } - } - - return out; - } - -}; -#endif - struct my_error_mgr : public jpeg_error_mgr { jmp_buf setjmp_buffer; }; @@ -844,93 +415,82 @@ static bool read_jpeg_image(QIODevice *device, QImage *outImage, clip = clip.intersected(imageRect); } -#ifndef QT_NO_IMAGE_SMOOTHSCALE - if (scaledSize.isValid() && scaledSize != clip.size() - && quality >= HIGH_QUALITY_THRESHOLD) { + // Allocate memory for the clipped QImage. + if (!ensureValidImage(outImage, &cinfo, clip.size())) + longjmp(jerr.setjmp_buffer, 1); + + // Avoid memcpy() overhead if grayscale with no clipping. + bool quickGray = (cinfo.output_components == 1 && + clip == imageRect); + if (!quickGray) { + // Ask the jpeg library to allocate a temporary row. + // The library will automatically delete it for us later. + // The libjpeg docs say we should do this before calling + // jpeg_start_decompress(). We can't use "new" here + // because we are inside the setjmp() block and an error + // in the jpeg input stream would cause a memory leak. + JSAMPARRAY rows = (cinfo.mem->alloc_sarray) + ((j_common_ptr)&cinfo, JPOOL_IMAGE, + cinfo.output_width * cinfo.output_components, 1); (void) jpeg_start_decompress(&cinfo); - jpegSmoothScaler scaler(&cinfo, scaledSize, clip); - *outImage = scaler.scale(); - } else -#endif - { - // Allocate memory for the clipped QImage. - if (!ensureValidImage(outImage, &cinfo, clip.size())) - longjmp(jerr.setjmp_buffer, 1); - - // Avoid memcpy() overhead if grayscale with no clipping. - bool quickGray = (cinfo.output_components == 1 && - clip == imageRect); - if (!quickGray) { - // Ask the jpeg library to allocate a temporary row. - // The library will automatically delete it for us later. - // The libjpeg docs say we should do this before calling - // jpeg_start_decompress(). We can't use "new" here - // because we are inside the setjmp() block and an error - // in the jpeg input stream would cause a memory leak. - JSAMPARRAY rows = (cinfo.mem->alloc_sarray) - ((j_common_ptr)&cinfo, JPOOL_IMAGE, - cinfo.output_width * cinfo.output_components, 1); - - (void) jpeg_start_decompress(&cinfo); - - while (cinfo.output_scanline < cinfo.output_height) { - int y = int(cinfo.output_scanline) - clip.y(); - if (y >= clip.height()) - break; // We've read the entire clip region, so abort. - - (void) jpeg_read_scanlines(&cinfo, rows, 1); - - if (y < 0) - continue; // Haven't reached the starting line yet. - - if (cinfo.output_components == 3) { - // Expand 24->32 bpp. - uchar *in = rows[0] + clip.x() * 3; - QRgb *out = (QRgb*)outImage->scanLine(y); - for (int i = 0; i < clip.width(); ++i) { - *out++ = qRgb(in[0], in[1], in[2]); - in += 3; - } - } else if (cinfo.out_color_space == JCS_CMYK) { - // Convert CMYK->RGB. - uchar *in = rows[0] + clip.x() * 4; - QRgb *out = (QRgb*)outImage->scanLine(y); - for (int i = 0; i < clip.width(); ++i) { - int k = in[3]; - *out++ = qRgb(k * in[0] / 255, k * in[1] / 255, - k * in[2] / 255); - in += 4; - } - } else if (cinfo.output_components == 1) { - // Grayscale. - memcpy(outImage->scanLine(y), - rows[0] + clip.x(), clip.width()); + while (cinfo.output_scanline < cinfo.output_height) { + int y = int(cinfo.output_scanline) - clip.y(); + if (y >= clip.height()) + break; // We've read the entire clip region, so abort. + + (void) jpeg_read_scanlines(&cinfo, rows, 1); + + if (y < 0) + continue; // Haven't reached the starting line yet. + + if (cinfo.output_components == 3) { + // Expand 24->32 bpp. + uchar *in = rows[0] + clip.x() * 3; + QRgb *out = (QRgb*)outImage->scanLine(y); + for (int i = 0; i < clip.width(); ++i) { + *out++ = qRgb(in[0], in[1], in[2]); + in += 3; } - } - } else { - // Load unclipped grayscale data directly into the QImage. - (void) jpeg_start_decompress(&cinfo); - while (cinfo.output_scanline < cinfo.output_height) { - uchar *row = outImage->scanLine(cinfo.output_scanline); - (void) jpeg_read_scanlines(&cinfo, &row, 1); + } else if (cinfo.out_color_space == JCS_CMYK) { + // Convert CMYK->RGB. + uchar *in = rows[0] + clip.x() * 4; + QRgb *out = (QRgb*)outImage->scanLine(y); + for (int i = 0; i < clip.width(); ++i) { + int k = in[3]; + *out++ = qRgb(k * in[0] / 255, k * in[1] / 255, + k * in[2] / 255); + in += 4; + } + } else if (cinfo.output_components == 1) { + // Grayscale. + memcpy(outImage->scanLine(y), + rows[0] + clip.x(), clip.width()); } } + } else { + // Load unclipped grayscale data directly into the QImage. + (void) jpeg_start_decompress(&cinfo); + while (cinfo.output_scanline < cinfo.output_height) { + uchar *row = outImage->scanLine(cinfo.output_scanline); + (void) jpeg_read_scanlines(&cinfo, &row, 1); + } + } - if (cinfo.output_scanline == cinfo.output_height) - (void) jpeg_finish_decompress(&cinfo); + if (cinfo.output_scanline == cinfo.output_height) + (void) jpeg_finish_decompress(&cinfo); - if (cinfo.density_unit == 1) { - outImage->setDotsPerMeterX(int(100. * cinfo.X_density / 2.54)); - outImage->setDotsPerMeterY(int(100. * cinfo.Y_density / 2.54)); - } else if (cinfo.density_unit == 2) { - outImage->setDotsPerMeterX(int(100. * cinfo.X_density)); - outImage->setDotsPerMeterY(int(100. * cinfo.Y_density)); - } + if (cinfo.density_unit == 1) { + outImage->setDotsPerMeterX(int(100. * cinfo.X_density / 2.54)); + outImage->setDotsPerMeterY(int(100. * cinfo.Y_density / 2.54)); + } else if (cinfo.density_unit == 2) { + outImage->setDotsPerMeterX(int(100. * cinfo.X_density)); + outImage->setDotsPerMeterY(int(100. * cinfo.Y_density)); + } - if (scaledSize.isValid() && scaledSize != clip.size()) - *outImage = outImage->scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::FastTransformation); + if (scaledSize.isValid() && scaledSize != clip.size()) { + *outImage = outImage->scaled(scaledSize, Qt::IgnoreAspectRatio, quality >= HIGH_QUALITY_THRESHOLD ? Qt::SmoothTransformation : Qt::FastTransformation); } } diff --git a/src/plugins/phonon/ds9/ds9.pro b/src/plugins/phonon/ds9/ds9.pro index 786338a..301808e 100644 --- a/src/plugins/phonon/ds9/ds9.pro +++ b/src/plugins/phonon/ds9/ds9.pro @@ -22,7 +22,6 @@ HEADERS += \ $$PHONON_DS9_DIR/mediaobject.h \ $$PHONON_DS9_DIR/videowidget.h \ $$PHONON_DS9_DIR/videorenderer_soft.h \ - $$PHONON_DS9_DIR/videorenderer_vmr9.h \ $$PHONON_DS9_DIR/volumeeffect.h \ $$PHONON_DS9_DIR/qbasefilter.h \ $$PHONON_DS9_DIR/qpin.h \ @@ -45,7 +44,6 @@ SOURCES += \ $$PHONON_DS9_DIR/mediaobject.cpp \ $$PHONON_DS9_DIR/videowidget.cpp \ $$PHONON_DS9_DIR/videorenderer_soft.cpp \ - $$PHONON_DS9_DIR/videorenderer_vmr9.cpp \ $$PHONON_DS9_DIR/volumeeffect.cpp \ $$PHONON_DS9_DIR/qbasefilter.cpp \ $$PHONON_DS9_DIR/qpin.cpp \ @@ -53,6 +51,14 @@ SOURCES += \ $$PHONON_DS9_DIR/qaudiocdreader.cpp \ $$PHONON_DS9_DIR/qmeminputpin.cpp +#the EVR renderer (only available on desktop) +!wince*:SOURCES += $$PHONON_DS9_DIR/videorenderer_evr.cpp \ + $$PHONON_DS9_DIR/videorenderer_vmr9.cpp +!wince*:HEADERS += $$PHONON_DS9_DIR/qevr9.h \ + $$PHONON_DS9_DIR/videorenderer_evr.h \ + $$PHONON_DS9_DIR/videorenderer_vmr9.h +wince*:SOURCES += $$PHONON_DS9_DIR/videorenderer_default.cpp +wince*:HEADERS += $$PHONON_DS9_DIR/videorenderer_default.h target.path = $$[QT_INSTALL_PLUGINS]/phonon_backend INSTALLS += target diff --git a/src/plugins/qpluginbase.pri b/src/plugins/qpluginbase.pri index 3af8b40..3dd3d2e 100644 --- a/src/plugins/qpluginbase.pri +++ b/src/plugins/qpluginbase.pri @@ -1,6 +1,6 @@ TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.6.2 + VERSION=4.7.0 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/src/qbase.pri b/src/qbase.pri index 710a2b6..58bb6d4 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -4,7 +4,7 @@ INCLUDEPATH *= $$QMAKE_INCDIR_QT/$$TARGET #just for today to have some compat isEmpty(QT_ARCH):!isEmpty(ARCH):QT_ARCH=$$ARCH #another compat that will rot for change #215700 TEMPLATE = lib isEmpty(QT_MAJOR_VERSION) { - VERSION=4.6.2 + VERSION=4.7.0 } else { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} } diff --git a/src/script/api/qscriptprogram.cpp b/src/script/api/qscriptprogram.cpp index c452052..d4a32f4 100644 --- a/src/script/api/qscriptprogram.cpp +++ b/src/script/api/qscriptprogram.cpp @@ -63,7 +63,6 @@ QScriptProgramPrivate::QScriptProgramPrivate(const QString &src, QScriptProgramPrivate::~QScriptProgramPrivate() { - delete _executable; } QScriptProgramPrivate *QScriptProgramPrivate::get(const QScriptProgram &q) @@ -76,17 +75,17 @@ JSC::EvalExecutable *QScriptProgramPrivate::executable(JSC::ExecState *exec, { if (_executable) { if (eng == engine) - return _executable; - delete _executable; + return _executable.get(); + _executable = 0; } WTF::PassRefPtr<QScript::UStringSourceProviderWithFeedback> provider = QScript::UStringSourceProviderWithFeedback::create(sourceCode, fileName, firstLineNumber, eng); sourceId = provider->asID(); JSC::SourceCode source(provider, firstLineNumber); //after construction of SourceCode provider variable will be null. - _executable = new JSC::EvalExecutable(exec, source); + _executable = JSC::EvalExecutable::create(exec, source); engine = eng; isCompiled = false; - return _executable; + return _executable.get(); } /*! diff --git a/src/script/api/qscriptprogram_p.h b/src/script/api/qscriptprogram_p.h index 427ab34..95e75fd 100644 --- a/src/script/api/qscriptprogram_p.h +++ b/src/script/api/qscriptprogram_p.h @@ -37,6 +37,8 @@ #include <QtCore/qobjectdefs.h> +#include "RefPtr.h" + namespace JSC { class EvalExecutable; @@ -67,7 +69,7 @@ public: int firstLineNumber; QScriptEnginePrivate *engine; - JSC::EvalExecutable *_executable; + WTF::RefPtr<JSC::EvalExecutable> _executable; intptr_t sourceId; bool isCompiled; }; diff --git a/src/scripttools/debugging/qscriptdebuggerconsole.cpp b/src/scripttools/debugging/qscriptdebuggerconsole.cpp index 7fd80f0..2f7a998 100644 --- a/src/scripttools/debugging/qscriptdebuggerconsole.cpp +++ b/src/scripttools/debugging/qscriptdebuggerconsole.cpp @@ -44,16 +44,216 @@ #include "qscriptdebuggerconsolecommandmanager_p.h" #include "qscriptdebuggerscriptedconsolecommand_p.h" #include "qscriptmessagehandlerinterface_p.h" +#include "qscriptbreakpointdata_p.h" +#include "qscriptdebuggerresponse_p.h" +#include "qscriptdebuggervalueproperty_p.h" +#include "qscriptscriptdata_p.h" #include <QtCore/qdir.h> #include <QtCore/qfileinfo.h> #include <QtCore/qstring.h> #include <QtCore/qstringlist.h> #include <QtCore/qdebug.h> +#include <QtScript/qscriptcontextinfo.h> #include <QtScript/qscriptengine.h> +Q_DECLARE_METATYPE(QScriptDebuggerResponse) +Q_DECLARE_METATYPE(QScriptBreakpointData) +Q_DECLARE_METATYPE(QScriptBreakpointMap) +Q_DECLARE_METATYPE(QScriptScriptData) +Q_DECLARE_METATYPE(QScriptScriptMap) +Q_DECLARE_METATYPE(QScriptContextInfo) +Q_DECLARE_METATYPE(QScriptDebuggerValue) +Q_DECLARE_METATYPE(QScriptDebuggerValueProperty) +Q_DECLARE_METATYPE(QScriptDebuggerValuePropertyList) +Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommand*) +Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandList) +Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandGroupData) +Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandGroupMap) + QT_BEGIN_NAMESPACE +static QScriptValue debuggerResponseToScriptValue(QScriptEngine *eng, const QScriptDebuggerResponse &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("result"), qScriptValueFromValue(eng, in.result())); + out.setProperty(QString::fromLatin1("error"), QScriptValue(eng, in.error())); + out.setProperty(QString::fromLatin1("async"), QScriptValue(eng, in.async())); + return out; +} + +static void debuggerResponseFromScriptValue(const QScriptValue &, QScriptDebuggerResponse &) +{ + Q_ASSERT(0); +} + +static QScriptValue breakpointDataToScriptValue(QScriptEngine *eng, const QScriptBreakpointData &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId()))); + out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); + out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber())); + out.setProperty(QString::fromLatin1("enabled"), QScriptValue(eng, in.isEnabled())); + out.setProperty(QString::fromLatin1("singleShot"), QScriptValue(eng, in.isSingleShot())); + out.setProperty(QString::fromLatin1("ignoreCount"), QScriptValue(eng, in.ignoreCount())); + out.setProperty(QString::fromLatin1("condition"), QScriptValue(eng, in.condition())); + return out; +} + +static void breakpointDataFromScriptValue(const QScriptValue &in, QScriptBreakpointData &out) +{ + QScriptValue scriptId = in.property(QString::fromLatin1("scriptId")); + if (scriptId.isValid()) + out.setScriptId((qint64)scriptId.toNumber()); + out.setFileName(in.property(QString::fromLatin1("fileName")).toString()); + out.setLineNumber(in.property(QString::fromLatin1("lineNumber")).toInt32()); + QScriptValue enabled = in.property(QString::fromLatin1("enabled")); + if (enabled.isValid()) + out.setEnabled(enabled.toBoolean()); + QScriptValue singleShot = in.property(QString::fromLatin1("singleShot")); + if (singleShot.isValid()) + out.setSingleShot(singleShot.toBoolean()); + out.setIgnoreCount(in.property(QString::fromLatin1("ignoreCount")).toInt32()); + out.setCondition(in.property(QString::fromLatin1("condition")).toString()); +} + +static QScriptValue breakpointMapToScriptValue(QScriptEngine *eng, const QScriptBreakpointMap &in) +{ + QScriptValue out = eng->newObject(); + QScriptBreakpointMap::const_iterator it; + for (it = in.constBegin(); it != in.constEnd(); ++it) { + out.setProperty(QString::number(it.key()), qScriptValueFromValue(eng, it.value())); + } + return out; +} + +static void breakpointMapFromScriptValue(const QScriptValue &, QScriptBreakpointMap &) +{ + Q_ASSERT(0); +} + +static QScriptValue scriptDataToScriptValue(QScriptEngine *eng, const QScriptScriptData &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("contents"), QScriptValue(eng, in.contents())); + out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); + out.setProperty(QString::fromLatin1("baseLineNumber"), QScriptValue(eng, in.baseLineNumber())); + return out; +} + +static void scriptDataFromScriptValue(const QScriptValue &in, QScriptScriptData &out) +{ + QString contents = in.property(QString::fromLatin1("contents")).toString(); + QString fileName = in.property(QString::fromLatin1("fileName")).toString(); + int baseLineNumber = in.property(QString::fromLatin1("baseLineNumber")).toInt32(); + QScriptScriptData tmp(contents, fileName, baseLineNumber); + out = tmp; +} + +static QScriptValue scriptMapToScriptValue(QScriptEngine *eng, const QScriptScriptMap &in) +{ + QScriptValue out = eng->newObject(); + QScriptScriptMap::const_iterator it; + for (it = in.constBegin(); it != in.constEnd(); ++it) { + out.setProperty(QString::number(it.key()), qScriptValueFromValue(eng, it.value())); + } + return out; +} + +static void scriptMapFromScriptValue(const QScriptValue &, QScriptScriptMap &) +{ + Q_ASSERT(0); +} + +static QScriptValue consoleCommandToScriptValue( + QScriptEngine *eng, QScriptDebuggerConsoleCommand* const &in) +{ + if (!in) + return eng->undefinedValue(); + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("name"), QScriptValue(eng, in->name())); + out.setProperty(QString::fromLatin1("group"), QScriptValue(eng, in->group())); + out.setProperty(QString::fromLatin1("shortDescription"), QScriptValue(eng, in->shortDescription())); + out.setProperty(QString::fromLatin1("longDescription"), QScriptValue(eng, in->longDescription())); + out.setProperty(QString::fromLatin1("aliases"), qScriptValueFromValue(eng, in->aliases())); + out.setProperty(QString::fromLatin1("seeAlso"), qScriptValueFromValue(eng, in->seeAlso())); + return out; +} + +static void consoleCommandFromScriptValue( + const QScriptValue &, QScriptDebuggerConsoleCommand* &) +{ + Q_ASSERT(0); +} + +static QScriptValue consoleCommandGroupDataToScriptValue( + QScriptEngine *eng, const QScriptDebuggerConsoleCommandGroupData &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("longDescription"), QScriptValue(eng, in.longDescription())); + out.setProperty(QString::fromLatin1("shortDescription"), QScriptValue(eng, in.shortDescription())); + return out; +} + +static void consoleCommandGroupDataFromScriptValue( + const QScriptValue &, QScriptDebuggerConsoleCommandGroupData &) +{ + Q_ASSERT(0); +} + +static QScriptValue consoleCommandGroupMapToScriptValue( + QScriptEngine *eng, const QScriptDebuggerConsoleCommandGroupMap &in) +{ + QScriptValue out = eng->newObject(); + QScriptDebuggerConsoleCommandGroupMap::const_iterator it; + for (it = in.constBegin(); it != in.constEnd(); ++it) { + out.setProperty(it.key(), qScriptValueFromValue(eng, it.value())); + } + return out; +} + +static void consoleCommandGroupMapFromScriptValue( + const QScriptValue &, QScriptDebuggerConsoleCommandGroupMap &) +{ + Q_ASSERT(0); +} + +static QScriptValue contextInfoToScriptValue(QScriptEngine *eng, const QScriptContextInfo &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId()))); + out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); + out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber())); + out.setProperty(QString::fromLatin1("columnNumber"), QScriptValue(eng, in.columnNumber())); + out.setProperty(QString::fromLatin1("functionName"), QScriptValue(eng, in.functionName())); + return out; +} + +static void contextInfoFromScriptValue(const QScriptValue &, QScriptContextInfo &) +{ + Q_ASSERT(0); +} + +static QScriptValue debuggerScriptValuePropertyToScriptValue(QScriptEngine *eng, const QScriptDebuggerValueProperty &in) +{ + QScriptValue out = eng->newObject(); + out.setProperty(QString::fromLatin1("name"), QScriptValue(eng, in.name())); + out.setProperty(QString::fromLatin1("value"), qScriptValueFromValue(eng, in.value())); + out.setProperty(QString::fromLatin1("valueAsString"), QScriptValue(eng, in.valueAsString())); + out.setProperty(QString::fromLatin1("flags"), QScriptValue(eng, static_cast<int>(in.flags()))); + return out; +} + +static void debuggerScriptValuePropertyFromScriptValue(const QScriptValue &in, QScriptDebuggerValueProperty &out) +{ + QString name = in.property(QString::fromLatin1("name")).toString(); + QScriptDebuggerValue value = qscriptvalue_cast<QScriptDebuggerValue>(in.property(QString::fromLatin1("value"))); + QString valueAsString = in.property(QString::fromLatin1("valueAsString")).toString(); + int flags = in.property(QString::fromLatin1("flags")).toInt32(); + QScriptDebuggerValueProperty tmp(name, value, valueAsString, QScriptValue::PropertyFlags(flags)); + out = tmp; +} + /*! \since 4.5 \class QScriptDebuggerConsole @@ -76,6 +276,7 @@ public: QScriptMessageHandlerInterface *messageHandler, QScriptDebuggerCommandSchedulerInterface *commandScheduler); + QScriptEngine *commandEngine; QScriptDebuggerConsoleCommandManager *commandManager; QString commandPrefix; QString input; @@ -99,11 +300,29 @@ QScriptDebuggerConsolePrivate::QScriptDebuggerConsolePrivate(QScriptDebuggerCons evaluateAction = 0; commandPrefix = QLatin1String("."); commandManager = new QScriptDebuggerConsoleCommandManager(); + + commandEngine = new QScriptEngine; + qScriptRegisterMetaType<QScriptBreakpointData>(commandEngine, breakpointDataToScriptValue, breakpointDataFromScriptValue); + qScriptRegisterMetaType<QScriptBreakpointMap>(commandEngine, breakpointMapToScriptValue, breakpointMapFromScriptValue); + qScriptRegisterMetaType<QScriptScriptData>(commandEngine, scriptDataToScriptValue, scriptDataFromScriptValue); + qScriptRegisterMetaType<QScriptScriptMap>(commandEngine, scriptMapToScriptValue, scriptMapFromScriptValue); + qScriptRegisterMetaType<QScriptContextInfo>(commandEngine, contextInfoToScriptValue, contextInfoFromScriptValue); + qScriptRegisterMetaType<QScriptDebuggerValueProperty>(commandEngine, debuggerScriptValuePropertyToScriptValue, debuggerScriptValuePropertyFromScriptValue); + qScriptRegisterSequenceMetaType<QScriptDebuggerValuePropertyList>(commandEngine); + qScriptRegisterMetaType<QScriptDebuggerResponse>(commandEngine, debuggerResponseToScriptValue, debuggerResponseFromScriptValue); + qScriptRegisterMetaType<QScriptDebuggerConsoleCommand*>(commandEngine, consoleCommandToScriptValue, consoleCommandFromScriptValue); + qScriptRegisterSequenceMetaType<QScriptDebuggerConsoleCommandList>(commandEngine); + qScriptRegisterMetaType<QScriptDebuggerConsoleCommandGroupData>(commandEngine, consoleCommandGroupDataToScriptValue, consoleCommandGroupDataFromScriptValue); + qScriptRegisterMetaType<QScriptDebuggerConsoleCommandGroupMap>(commandEngine, consoleCommandGroupMapToScriptValue, consoleCommandGroupMapFromScriptValue); +// ### can't do this, if it's an object ID the conversion will be incorrect since +// ### the object ID refers to an object in a different engine! +// qScriptRegisterMetaType(commandEngine, debuggerScriptValueToScriptValue, debuggerScriptValueFromScriptValue); } QScriptDebuggerConsolePrivate::~QScriptDebuggerConsolePrivate() { delete commandManager; + delete commandEngine; } /*! @@ -126,7 +345,7 @@ void QScriptDebuggerConsolePrivate::loadScriptedCommands( QString program = stream.readAll(); QScriptDebuggerScriptedConsoleCommand *command; command = QScriptDebuggerScriptedConsoleCommand::parse( - program, fileName, messageHandler); + program, fileName, commandEngine, messageHandler); if (!command) continue; commandManager->addCommand(command); diff --git a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp index 068de42..ec6230b 100644 --- a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp +++ b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp @@ -54,6 +54,7 @@ #include <QtCore/qdebug.h> #include <QtCore/qcoreapplication.h> +#include <QtCore/qpointer.h> #include <QtGui/qbrush.h> #include <QtGui/qfont.h> @@ -370,6 +371,7 @@ public: { if (!m_index.isValid()) { // nothing to do, the node has been removed + finish(); return; } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); @@ -475,7 +477,7 @@ namespace { class InitModelJob : public QScriptDebuggerCommandSchedulerJob { public: - InitModelJob(QScriptDebuggerLocalsModelPrivate *model, + InitModelJob(QScriptDebuggerLocalsModel *model, int frameIndex, QScriptDebuggerCommandSchedulerInterface *scheduler) : QScriptDebuggerCommandSchedulerJob(scheduler), @@ -484,6 +486,11 @@ public: void start() { + if (!m_model) { + // Model has been deleted. + finish(); + return; + } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); frontend.scheduleGetScopeChain(m_frameIndex); } @@ -491,7 +498,13 @@ public: void handleResponse(const QScriptDebuggerResponse &response, int) { + if (!m_model) { + // Model has been deleted. + finish(); + return; + } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); + QScriptDebuggerLocalsModelPrivate *model_d = QScriptDebuggerLocalsModelPrivate::get(m_model); switch (m_state) { case 0: { QScriptDebuggerValueList scopeChain = response.resultAsScriptValueList(); @@ -500,23 +513,23 @@ public: QString name = QString::fromLatin1("Scope"); if (i > 0) name.append(QString::fromLatin1(" (%0)").arg(i)); - QModelIndex index = m_model->addTopLevelObject(name, scopeObject); + QModelIndex index = model_d->addTopLevelObject(name, scopeObject); if (i == 0) - m_model->emitScopeObjectAvailable(index); + model_d->emitScopeObjectAvailable(index); } frontend.scheduleGetThisObject(m_frameIndex); ++m_state; } break; case 1: { QScriptDebuggerValue thisObject = response.resultAsScriptValue(); - m_model->addTopLevelObject(QLatin1String("this"), thisObject); + model_d->addTopLevelObject(QLatin1String("this"), thisObject); finish(); } break; } } private: - QScriptDebuggerLocalsModelPrivate *m_model; + QPointer<QScriptDebuggerLocalsModel> m_model; int m_frameIndex; int m_state; }; @@ -527,7 +540,7 @@ void QScriptDebuggerLocalsModel::init(int frameIndex) { Q_D(QScriptDebuggerLocalsModel); d->frameIndex = frameIndex; - QScriptDebuggerJob *job = new InitModelJob(d, frameIndex, d->commandScheduler); + QScriptDebuggerJob *job = new InitModelJob(this, frameIndex, d->commandScheduler); d->jobScheduler->scheduleJob(job); } @@ -536,7 +549,7 @@ namespace { class SyncModelJob : public QScriptDebuggerCommandSchedulerJob { public: - SyncModelJob(QScriptDebuggerLocalsModelPrivate *model, + SyncModelJob(QScriptDebuggerLocalsModel *model, int frameIndex, QScriptDebuggerCommandSchedulerInterface *scheduler) : QScriptDebuggerCommandSchedulerJob(scheduler), @@ -545,6 +558,11 @@ public: void start() { + if (!m_model) { + // Model has been deleted. + finish(); + return; + } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); frontend.scheduleGetScopeChain(m_frameIndex); } @@ -552,6 +570,11 @@ public: void handleResponse(const QScriptDebuggerResponse &response, int) { + if (!m_model) { + // Model has been deleted. + finish(); + return; + } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); switch (m_state) { case 0: { @@ -561,18 +584,19 @@ public: ++m_state; } break; case 1: { + QScriptDebuggerLocalsModelPrivate *model_d = QScriptDebuggerLocalsModelPrivate::get(m_model); QScriptDebuggerValue thisObject = response.resultAsScriptValue(); m_topLevelObjects.append(thisObject); - bool equal = (m_topLevelObjects.size() == m_model->invisibleRootNode->children.size()); + bool equal = (m_topLevelObjects.size() == model_d->invisibleRootNode->children.size()); for (int i = 0; equal && (i < m_topLevelObjects.size()); ++i) { const QScriptDebuggerValue &object = m_topLevelObjects.at(i); - equal = (object == m_model->invisibleRootNode->children.at(i)->property.value()); + equal = (object == model_d->invisibleRootNode->children.at(i)->property.value()); } if (!equal) { // the scope chain and/or this-object changed, so invalidate the model. // we could try to be more clever, i.e. figure out // exactly which objects were popped/pushed - m_model->removeTopLevelNodes(); + model_d->removeTopLevelNodes(); for (int j = 0; j < m_topLevelObjects.size(); ++j) { const QScriptDebuggerValue &object = m_topLevelObjects.at(j); QString name; @@ -583,12 +607,12 @@ public: if (j > 0) name.append(QString::fromLatin1(" (%0)").arg(j)); } - QModelIndex index = m_model->addTopLevelObject(name, object); + QModelIndex index = model_d->addTopLevelObject(name, object); if (j == 0) - m_model->emitScopeObjectAvailable(index); + model_d->emitScopeObjectAvailable(index); } } else { - m_model->syncTopLevelNodes(); + model_d->syncTopLevelNodes(); } finish(); } break; @@ -596,7 +620,7 @@ public: } private: - QScriptDebuggerLocalsModelPrivate *m_model; + QPointer<QScriptDebuggerLocalsModel> m_model; int m_frameIndex; int m_state; QScriptDebuggerValueList m_topLevelObjects; @@ -608,7 +632,7 @@ void QScriptDebuggerLocalsModel::sync(int frameIndex) { Q_D(QScriptDebuggerLocalsModel); d->frameIndex = frameIndex; - QScriptDebuggerJob *job = new SyncModelJob(d, frameIndex, d->commandScheduler); + QScriptDebuggerJob *job = new SyncModelJob(this, frameIndex, d->commandScheduler); d->jobScheduler->scheduleJob(job); } @@ -636,6 +660,7 @@ public: { if (!m_index.isValid()) { // nothing to do, the node has been removed + finish(); return; } QScriptDebuggerCommandSchedulerFrontend frontend(commandScheduler(), this); diff --git a/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp b/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp index 516a200..bbced5f 100644 --- a/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp +++ b/src/scripttools/debugging/qscriptdebuggerlocalswidget.cpp @@ -70,6 +70,8 @@ public: bool hasChildren(const QModelIndex &parent) const { + if (!sourceModel()) + return false; QModelIndex sourceParent = mapToSource(parent); if (parent.isValid() && !sourceParent.isValid()) return false; @@ -184,7 +186,8 @@ void QScriptDebuggerLocalsWidgetPrivate::_q_insertCompletion(const QString &text void QScriptDebuggerLocalsWidgetPrivate::_q_expandIndex(const QModelIndex &index) { - view->expand(proxy->mapFromSource(index)); + if (view->model() == index.model()) + view->expand(proxy->mapFromSource(index)); } class QScriptDebuggerLocalsItemDelegate diff --git a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp index 8d6a579..117c2d6 100644 --- a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp +++ b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand.cpp @@ -46,8 +46,6 @@ #include "qscriptmessagehandlerinterface_p.h" #include "qscriptdebuggerconsoleglobalobject_p.h" #include "qscriptdebuggerresponse_p.h" -#include "qscriptdebuggervalue_p.h" -#include "qscriptdebuggervalueproperty_p.h" #include "qscriptdebuggercommandschedulerinterface_p.h" #include <QtCore/qstring.h> @@ -59,202 +57,9 @@ #include <QtCore/qdebug.h> Q_DECLARE_METATYPE(QScriptDebuggerResponse) -Q_DECLARE_METATYPE(QScriptBreakpointData) -Q_DECLARE_METATYPE(QScriptBreakpointMap) -Q_DECLARE_METATYPE(QScriptScriptData) -Q_DECLARE_METATYPE(QScriptScriptMap) -Q_DECLARE_METATYPE(QScriptContextInfo) -Q_DECLARE_METATYPE(QScriptDebuggerValue) -Q_DECLARE_METATYPE(QScriptDebuggerValueProperty) -Q_DECLARE_METATYPE(QScriptDebuggerValuePropertyList) -Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommand*) -Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandList) -Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandGroupData) -Q_DECLARE_METATYPE(QScriptDebuggerConsoleCommandGroupMap) QT_BEGIN_NAMESPACE -static QScriptValue debuggerResponseToScriptValue(QScriptEngine *eng, const QScriptDebuggerResponse &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("result"), qScriptValueFromValue(eng, in.result())); - out.setProperty(QString::fromLatin1("error"), QScriptValue(eng, in.error())); - out.setProperty(QString::fromLatin1("async"), QScriptValue(eng, in.async())); - return out; -} - -static void debuggerResponseFromScriptValue(const QScriptValue &, QScriptDebuggerResponse &) -{ - Q_ASSERT(0); -} - -static QScriptValue breakpointDataToScriptValue(QScriptEngine *eng, const QScriptBreakpointData &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId()))); - out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); - out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber())); - out.setProperty(QString::fromLatin1("enabled"), QScriptValue(eng, in.isEnabled())); - out.setProperty(QString::fromLatin1("singleShot"), QScriptValue(eng, in.isSingleShot())); - out.setProperty(QString::fromLatin1("ignoreCount"), QScriptValue(eng, in.ignoreCount())); - out.setProperty(QString::fromLatin1("condition"), QScriptValue(eng, in.condition())); - return out; -} - -static void breakpointDataFromScriptValue(const QScriptValue &in, QScriptBreakpointData &out) -{ - QScriptValue scriptId = in.property(QString::fromLatin1("scriptId")); - if (scriptId.isValid()) - out.setScriptId((qint64)scriptId.toNumber()); - out.setFileName(in.property(QString::fromLatin1("fileName")).toString()); - out.setLineNumber(in.property(QString::fromLatin1("lineNumber")).toInt32()); - QScriptValue enabled = in.property(QString::fromLatin1("enabled")); - if (enabled.isValid()) - out.setEnabled(enabled.toBoolean()); - QScriptValue singleShot = in.property(QString::fromLatin1("singleShot")); - if (singleShot.isValid()) - out.setSingleShot(singleShot.toBoolean()); - out.setIgnoreCount(in.property(QString::fromLatin1("ignoreCount")).toInt32()); - out.setCondition(in.property(QString::fromLatin1("condition")).toString()); -} - -static QScriptValue breakpointMapToScriptValue(QScriptEngine *eng, const QScriptBreakpointMap &in) -{ - QScriptValue out = eng->newObject(); - QScriptBreakpointMap::const_iterator it; - for (it = in.constBegin(); it != in.constEnd(); ++it) { - out.setProperty(QString::number(it.key()), qScriptValueFromValue(eng, it.value())); - } - return out; -} - -static void breakpointMapFromScriptValue(const QScriptValue &, QScriptBreakpointMap &) -{ - Q_ASSERT(0); -} - -static QScriptValue scriptDataToScriptValue(QScriptEngine *eng, const QScriptScriptData &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("contents"), QScriptValue(eng, in.contents())); - out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); - out.setProperty(QString::fromLatin1("baseLineNumber"), QScriptValue(eng, in.baseLineNumber())); - return out; -} - -static void scriptDataFromScriptValue(const QScriptValue &in, QScriptScriptData &out) -{ - QString contents = in.property(QString::fromLatin1("contents")).toString(); - QString fileName = in.property(QString::fromLatin1("fileName")).toString(); - int baseLineNumber = in.property(QString::fromLatin1("baseLineNumber")).toInt32(); - QScriptScriptData tmp(contents, fileName, baseLineNumber); - out = tmp; -} - -static QScriptValue scriptMapToScriptValue(QScriptEngine *eng, const QScriptScriptMap &in) -{ - QScriptValue out = eng->newObject(); - QScriptScriptMap::const_iterator it; - for (it = in.constBegin(); it != in.constEnd(); ++it) { - out.setProperty(QString::number(it.key()), qScriptValueFromValue(eng, it.value())); - } - return out; -} - -static void scriptMapFromScriptValue(const QScriptValue &, QScriptScriptMap &) -{ - Q_ASSERT(0); -} - -static QScriptValue consoleCommandToScriptValue( - QScriptEngine *eng, QScriptDebuggerConsoleCommand* const &in) -{ - if (!in) - return eng->undefinedValue(); - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("name"), QScriptValue(eng, in->name())); - out.setProperty(QString::fromLatin1("group"), QScriptValue(eng, in->group())); - out.setProperty(QString::fromLatin1("shortDescription"), QScriptValue(eng, in->shortDescription())); - out.setProperty(QString::fromLatin1("longDescription"), QScriptValue(eng, in->longDescription())); - out.setProperty(QString::fromLatin1("aliases"), qScriptValueFromValue(eng, in->aliases())); - out.setProperty(QString::fromLatin1("seeAlso"), qScriptValueFromValue(eng, in->seeAlso())); - return out; -} - -static void consoleCommandFromScriptValue( - const QScriptValue &, QScriptDebuggerConsoleCommand* &) -{ - Q_ASSERT(0); -} - -static QScriptValue consoleCommandGroupDataToScriptValue( - QScriptEngine *eng, const QScriptDebuggerConsoleCommandGroupData &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("longDescription"), QScriptValue(eng, in.longDescription())); - out.setProperty(QString::fromLatin1("shortDescription"), QScriptValue(eng, in.shortDescription())); - return out; -} - -static void consoleCommandGroupDataFromScriptValue( - const QScriptValue &, QScriptDebuggerConsoleCommandGroupData &) -{ - Q_ASSERT(0); -} - -static QScriptValue consoleCommandGroupMapToScriptValue( - QScriptEngine *eng, const QScriptDebuggerConsoleCommandGroupMap &in) -{ - QScriptValue out = eng->newObject(); - QScriptDebuggerConsoleCommandGroupMap::const_iterator it; - for (it = in.constBegin(); it != in.constEnd(); ++it) { - out.setProperty(it.key(), qScriptValueFromValue(eng, it.value())); - } - return out; -} - -static void consoleCommandGroupMapFromScriptValue( - const QScriptValue &, QScriptDebuggerConsoleCommandGroupMap &) -{ - Q_ASSERT(0); -} - -static QScriptValue contextInfoToScriptValue(QScriptEngine *eng, const QScriptContextInfo &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("scriptId"), QScriptValue(eng, qsreal(in.scriptId()))); - out.setProperty(QString::fromLatin1("fileName"), QScriptValue(eng, in.fileName())); - out.setProperty(QString::fromLatin1("lineNumber"), QScriptValue(eng, in.lineNumber())); - out.setProperty(QString::fromLatin1("columnNumber"), QScriptValue(eng, in.columnNumber())); - out.setProperty(QString::fromLatin1("functionName"), QScriptValue(eng, in.functionName())); - return out; -} - -static void contextInfoFromScriptValue(const QScriptValue &, QScriptContextInfo &) -{ - Q_ASSERT(0); -} - -static QScriptValue debuggerScriptValuePropertyToScriptValue(QScriptEngine *eng, const QScriptDebuggerValueProperty &in) -{ - QScriptValue out = eng->newObject(); - out.setProperty(QString::fromLatin1("name"), QScriptValue(eng, in.name())); - out.setProperty(QString::fromLatin1("value"), qScriptValueFromValue(eng, in.value())); - out.setProperty(QString::fromLatin1("valueAsString"), QScriptValue(eng, in.valueAsString())); - out.setProperty(QString::fromLatin1("flags"), QScriptValue(eng, static_cast<int>(in.flags()))); - return out; -} - -static void debuggerScriptValuePropertyFromScriptValue(const QScriptValue &in, QScriptDebuggerValueProperty &out) -{ - QString name = in.property(QString::fromLatin1("name")).toString(); - QScriptDebuggerValue value = qscriptvalue_cast<QScriptDebuggerValue>(in.property(QString::fromLatin1("value"))); - QString valueAsString = in.property(QString::fromLatin1("valueAsString")).toString(); - int flags = in.property(QString::fromLatin1("flags")).toInt32(); - QScriptDebuggerValueProperty tmp(name, value, valueAsString, QScriptValue::PropertyFlags(flags)); - out = tmp; -} - /*! \since 4.5 \class QScriptDebuggerScriptedConsoleCommand @@ -279,19 +84,17 @@ public: QStringList seeAlso; QStringList argumentTypes; QStringList subCommands; - QScriptEngine *engine; + QScriptValue globalObject; QScriptValue execFunction; QScriptValue responseFunction; }; QScriptDebuggerScriptedConsoleCommandPrivate::QScriptDebuggerScriptedConsoleCommandPrivate() { - engine = 0; } QScriptDebuggerScriptedConsoleCommandPrivate::~QScriptDebuggerScriptedConsoleCommandPrivate() { - delete engine; } QScriptDebuggerScriptedConsoleCommand::QScriptDebuggerScriptedConsoleCommand( @@ -299,6 +102,7 @@ QScriptDebuggerScriptedConsoleCommand::QScriptDebuggerScriptedConsoleCommand( const QString &shortDescription, const QString &longDescription, const QStringList &aliases, const QStringList &seeAlso, const QStringList &argumentTypes, const QStringList &subCommands, + const QScriptValue &globalObject, const QScriptValue &execFunction, const QScriptValue &responseFunction) : QScriptDebuggerConsoleCommand(*new QScriptDebuggerScriptedConsoleCommandPrivate) { @@ -311,25 +115,9 @@ QScriptDebuggerScriptedConsoleCommand::QScriptDebuggerScriptedConsoleCommand( d->seeAlso = seeAlso; d->argumentTypes = argumentTypes; d->subCommands = subCommands; + d->globalObject = globalObject; d->execFunction = execFunction; d->responseFunction = responseFunction; - d->engine = execFunction.engine(); - - qScriptRegisterMetaType<QScriptBreakpointData>(d->engine, breakpointDataToScriptValue, breakpointDataFromScriptValue); - qScriptRegisterMetaType<QScriptBreakpointMap>(d->engine, breakpointMapToScriptValue, breakpointMapFromScriptValue); - qScriptRegisterMetaType<QScriptScriptData>(d->engine, scriptDataToScriptValue, scriptDataFromScriptValue); - qScriptRegisterMetaType<QScriptScriptMap>(d->engine, scriptMapToScriptValue, scriptMapFromScriptValue); - qScriptRegisterMetaType<QScriptContextInfo>(d->engine, contextInfoToScriptValue, contextInfoFromScriptValue); - qScriptRegisterMetaType<QScriptDebuggerValueProperty>(d->engine, debuggerScriptValuePropertyToScriptValue, debuggerScriptValuePropertyFromScriptValue); - qScriptRegisterSequenceMetaType<QScriptDebuggerValuePropertyList>(d->engine); - qScriptRegisterMetaType<QScriptDebuggerResponse>(d->engine, debuggerResponseToScriptValue, debuggerResponseFromScriptValue); - qScriptRegisterMetaType<QScriptDebuggerConsoleCommand*>(d->engine, consoleCommandToScriptValue, consoleCommandFromScriptValue); - qScriptRegisterSequenceMetaType<QScriptDebuggerConsoleCommandList>(d->engine); - qScriptRegisterMetaType<QScriptDebuggerConsoleCommandGroupData>(d->engine, consoleCommandGroupDataToScriptValue, consoleCommandGroupDataFromScriptValue); - qScriptRegisterMetaType<QScriptDebuggerConsoleCommandGroupMap>(d->engine, consoleCommandGroupMapToScriptValue, consoleCommandGroupMapFromScriptValue); -// ### can't do this, if it's an object ID the conversion will be incorrect since -// ### the object ID refers to an object in a different engine! -// qScriptRegisterMetaType(d->engine, debuggerScriptValueToScriptValue, debuggerScriptValueFromScriptValue); } QScriptDebuggerScriptedConsoleCommand::~QScriptDebuggerScriptedConsoleCommand() @@ -405,7 +193,8 @@ int QScriptDebuggerScriptedConsoleCommandJob::scheduleCommand( void QScriptDebuggerScriptedConsoleCommandJob::start() { Q_D(QScriptDebuggerScriptedConsoleCommandJob); - QScriptEngine *engine = d->command->engine; + QScriptEngine *engine = d->command->globalObject.engine(); + engine->setGlobalObject(d->command->globalObject); QScriptValueList args; for (int i = 0; i < d->arguments.size(); ++i) args.append(QScriptValue(engine, d->arguments.at(i))); @@ -435,12 +224,13 @@ void QScriptDebuggerScriptedConsoleCommandJob::handleResponse( { Q_D(QScriptDebuggerScriptedConsoleCommandJob); // ### generalize - QScriptEngine *engine = d->command->engine; + QScriptEngine *engine = d->command->globalObject.engine(); + engine->setGlobalObject(d->command->globalObject); QScriptValueList args; args.append(qScriptValueFromValue(engine, response)); args.append(QScriptValue(engine, commandId)); QScriptDebuggerConsoleGlobalObject *global; - global = qobject_cast<QScriptDebuggerConsoleGlobalObject*>(engine->globalObject().toQObject()); + global = qobject_cast<QScriptDebuggerConsoleGlobalObject*>(d->command->globalObject.toQObject()); Q_ASSERT(global != 0); global->setScheduler(this); global->setResponseHandler(this); @@ -551,9 +341,8 @@ QScriptDebuggerConsoleCommandJob *QScriptDebuggerScriptedConsoleCommand::createJ */ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::parse( const QString &program, const QString &fileName, - QScriptMessageHandlerInterface *messageHandler) + QScriptEngine *engine, QScriptMessageHandlerInterface *messageHandler) { - QScriptEngine *engine = new QScriptEngine(); // create a custom global object QScriptDebuggerConsoleGlobalObject *cppGlobal = new QScriptDebuggerConsoleGlobalObject(); QScriptValue global = engine->newQObject(cppGlobal, @@ -574,14 +363,12 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (engine->hasUncaughtException()) { messageHandler->message(QtCriticalMsg, ret.toString(), fileName, engine->uncaughtExceptionLineNumber()); - delete engine; return 0; } QScriptValue name = global.property(QLatin1String("name")); if (!name.isString()) { messageHandler->message(QtCriticalMsg, QLatin1String("command definition lacks a name"), fileName); - delete engine; return 0; } QString nameStr = name.toString(); @@ -590,7 +377,6 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (!group.isString()) { messageHandler->message(QtCriticalMsg, QString::fromLatin1("definition of command \"%0\" lacks a group name") .arg(nameStr), fileName); - delete engine; return 0; } QString groupStr = group.toString(); @@ -599,7 +385,6 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (!shortDesc.isString()) { messageHandler->message(QtCriticalMsg, QString::fromLatin1("definition of command \"%0\" lacks shortDescription") .arg(nameStr), fileName); - delete engine; return 0; } QString shortDescStr = shortDesc.toString(); @@ -608,7 +393,6 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (!longDesc.isString()) { messageHandler->message(QtCriticalMsg, QString::fromLatin1("definition of command \"%0\" lacks longDescription") .arg(nameStr), fileName); - delete engine; return 0; } QString longDescStr = longDesc.toString(); @@ -629,7 +413,6 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa if (!execFunction.isFunction()) { messageHandler->message(QtCriticalMsg, QString::fromLatin1("definition of command \"%0\" lacks execute() function") .arg(nameStr), fileName); - delete engine; return 0; } @@ -640,7 +423,7 @@ QScriptDebuggerScriptedConsoleCommand *QScriptDebuggerScriptedConsoleCommand::pa shortDescStr, longDescStr, aliases, seeAlso, argTypes, subCommands, - execFunction, responseFunction); + global, execFunction, responseFunction); return result; } diff --git a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h index 1536de2..2b2b3f8 100644 --- a/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h +++ b/src/scripttools/debugging/qscriptdebuggerscriptedconsolecommand_p.h @@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE +class QScriptEngine; class QScriptValue; class QScriptDebuggerScriptedConsoleCommandPrivate; @@ -72,6 +73,7 @@ protected: const QStringList &seeAlso, const QStringList &argumentTypes, const QStringList &subCommands, + const QScriptValue &globalObject, const QScriptValue &execFunction, const QScriptValue &responseFunction); public: @@ -79,7 +81,7 @@ public: static QScriptDebuggerScriptedConsoleCommand *parse( const QString &program, const QString &fileName, - QScriptMessageHandlerInterface *messageHandler); + QScriptEngine *engine, QScriptMessageHandlerInterface *messageHandler); QString name() const; QString group() const; diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 2049a76..18bc743 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -62,13 +62,6 @@ QT_BEGIN_NAMESPACE // undefine this to prevent initial check of the ODBC driver #define ODBC_CHECK_DRIVER -#if defined(Q_ODBC_VERSION_2) -//crude hack to get non-unicode capable driver managers to work -# undef UNICODE -# define SQLTCHAR SQLCHAR -# define SQL_C_WCHAR SQL_C_CHAR -#endif - // newer platform SDKs use SQLLEN instead of SQLINTEGER #if defined(WIN32) && (_MSC_VER < 1300) # define QSQLLEN SQLINTEGER @@ -298,13 +291,11 @@ static QVariant::Type qDecodeODBCType(SQLSMALLINT sqltype, const T* p, bool isSi case SQL_TYPE_TIMESTAMP: type = QVariant::DateTime; break; -#ifndef Q_ODBC_VERSION_2 case SQL_WCHAR: case SQL_WVARCHAR: case SQL_WLONGVARCHAR: type = QVariant::String; break; -#endif case SQL_CHAR: case SQL_VARCHAR: case SQL_GUID: @@ -577,10 +568,8 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i ) static int qGetODBCVersion(const QString &connOpts) { -#ifndef Q_ODBC_VERSION_2 if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"), Qt::CaseInsensitive)) return SQL_OV_ODBC3; -#endif return SQL_OV_ODBC2; } @@ -679,7 +668,6 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) continue; } r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACE, (SQLPOINTER) v, 0); -#ifndef Q_ODBC_VERSION_2 } else if (opt.toUpper() == QLatin1String("SQL_ATTR_CONNECTION_POOLING")) { if (val == QLatin1String("SQL_CP_OFF")) v = SQL_CP_OFF; @@ -706,7 +694,6 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) continue; } r = SQLSetConnectAttr(hDbc, SQL_ATTR_CP_MATCH, (SQLPOINTER)v, 0); -#endif } else if (opt.toUpper() == QLatin1String("SQL_ATTR_ODBC_VERSION")) { // Already handled in QODBCDriver::open() continue; @@ -1432,7 +1419,6 @@ bool QODBCResult::exec() *ind == SQL_NULL_DATA ? ind : NULL); break; case QVariant::String: -#ifndef Q_ODBC_VERSION_2 if (d->unicode) { QString str = val.toString(); str.utf16(); @@ -1469,7 +1455,6 @@ bool QODBCResult::exec() break; } else -#endif { QByteArray str = val.toString().toAscii(); if (*ind != SQL_NULL_DATA) @@ -1870,11 +1855,6 @@ void QODBCDriver::cleanup() // as two byte unicode characters void QODBCDriverPrivate::checkUnicode() { -#if defined(Q_ODBC_VERSION_2) - unicode = false; - return; -#endif - SQLRETURN r; SQLUINTEGER fFunc; diff --git a/src/sql/drivers/odbc/qsql_odbc.h b/src/sql/drivers/odbc/qsql_odbc.h index 145a902..836dbd6 100644 --- a/src/sql/drivers/odbc/qsql_odbc.h +++ b/src/sql/drivers/odbc/qsql_odbc.h @@ -49,13 +49,6 @@ #include <QtCore/qt_windows.h> #endif -#if defined (Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3) -// assume we use iodbc on MACX -// comment next line out if you use a -// unicode compatible manager -# define Q_ODBC_VERSION_2 -#endif - #ifdef QT_PLUGIN #define Q_EXPORT_SQLDRIVER_ODBC #else @@ -75,10 +68,7 @@ # undef _MSC_VER #endif -#ifndef Q_ODBC_VERSION_2 #include <sqlucode.h> -#endif - #include <sqlext.h> QT_BEGIN_HEADER diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 4ccbee6..95e2658 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -41,6 +41,7 @@ #include "QtTest/qbenchmark.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #ifdef QT_GUI_LIB #include <QtGui/qapplication.h> @@ -138,7 +139,7 @@ void QBenchmarkTestMethodData::endDataRun() int QBenchmarkTestMethodData::adjustIterationCount(int suggestion) { - // Let the -iteration-count option override the measurer. + // Let the -iterations option override the measurer. if (QBenchmarkGlobalData::current->iterationCount != -1) { iterationCount = QBenchmarkGlobalData::current->iterationCount; } else { @@ -148,12 +149,13 @@ int QBenchmarkTestMethodData::adjustIterationCount(int suggestion) return iterationCount; } -void QBenchmarkTestMethodData::setResult(qint64 value) +void QBenchmarkTestMethodData::setResult( + qreal value, QTest::QBenchmarkMetric metric, bool setByMacro) { bool accepted = false; // Always accept the result if the iteration count has been - // specified on the command line with -iteartion-count. + // specified on the command line with -iterations. if (QBenchmarkGlobalData::current->iterationCount != -1) accepted = true; @@ -161,7 +163,7 @@ void QBenchmarkTestMethodData::setResult(qint64 value) iterationCount = 1; accepted = true; } - + // Test the result directly without calling the measurer if the minimum time // has been specifed on the command line with -minimumvalue. else if (QBenchmarkGlobalData::current->walltimeMinimum != -1) @@ -175,8 +177,8 @@ void QBenchmarkTestMethodData::setResult(qint64 value) else iterationCount *= 2; - this->result = - QBenchmarkResult(QBenchmarkGlobalData::current->context, value, iterationCount); + this->result = QBenchmarkResult( + QBenchmarkGlobalData::current->context, value, iterationCount, metric, setByMacro); } /*! @@ -208,7 +210,8 @@ QTest::QBenchmarkIterationController::QBenchmarkIterationController() */ QTest::QBenchmarkIterationController::~QBenchmarkIterationController() { - QBenchmarkTestMethodData::current->setResult(QTest::endBenchmarkMeasurement()); + const qreal result = QTest::endBenchmarkMeasurement(); + QBenchmarkTestMethodData::current->setResult(result, QBenchmarkGlobalData::current->measurer->metricType()); } /*! \internal @@ -259,28 +262,30 @@ void QTest::beginBenchmarkMeasurement() /*! \internal */ -qint64 QTest::endBenchmarkMeasurement() +quint64 QTest::endBenchmarkMeasurement() { // the clock is ticking before the line below, don't add code here. return QBenchmarkGlobalData::current->measurer->stop(); } -/*! \internal -*/ -void QTest::setResult(qint64 result) -{ - QBenchmarkTestMethodData::current->setResult(result); -} - -/*! \internal +/*! + Sets the benchmark result for this test function to \a result. + + Use this function if you want to report benchmark results without + using the QBENCHMARK macro. Use \a metric to specify how QTestLib + should interpret the results. + + The context for the result will be the test function name and any + data tag from the _data function. This function can only be called + once in each test function, subsequent calls will replace the + earlier reported results. + + Note that the -iterations command line argument has no effect + on test functions without the QBENCHMARK macro. */ -void QTest::setResult(const QString &tag, qint64 result) +void QTest::setBenchmarkResult(qreal result, QTest::QBenchmarkMetric metric) { - QBenchmarkContext context = QBenchmarkGlobalData::current->context; - context.tag = tag; - QBenchmarkTestMethodData::current->result = - QBenchmarkResult( context, result, - QBenchmarkTestMethodData::current->iterationCount); + QBenchmarkTestMethodData::current->setResult(result, metric, false); } template <typename T> @@ -298,6 +303,4 @@ Q_TYPENAME T::value_type qAverage(const T &container) return acc / count; } - QT_END_NAMESPACE - diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h index 0207b5b..38a0e52 100644 --- a/src/testlib/qbenchmark.h +++ b/src/testlib/qbenchmark.h @@ -43,6 +43,7 @@ #define QBENCHMARK_H #include <QtTest/qtest_global.h> +#include <QtTest/private/qbenchmarkmetric_p.h> QT_BEGIN_HEADER @@ -75,6 +76,8 @@ public: } +// --- BEGIN public API --- + #define QBENCHMARK \ for (QTest::QBenchmarkIterationController __iteration_controller; \ __iteration_controller.isDone() == false; __iteration_controller.next()) @@ -83,6 +86,13 @@ public: for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RunOnce); \ __iteration_controller.isDone() == false; __iteration_controller.next()) +namespace QTest +{ + void Q_TESTLIB_EXPORT setBenchmarkResult(qreal result, QBenchmarkMetric metric); +} + +// --- END public API --- + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h index 0d6542f..50329e1 100644 --- a/src/testlib/qbenchmark_p.h +++ b/src/testlib/qbenchmark_p.h @@ -42,6 +42,8 @@ #ifndef QBENCHMARK_P_H #define QBENCHMARK_P_H +#include <stdlib.h> + // // W A R N I N G // ------------- @@ -68,6 +70,7 @@ #include "QtTest/private/qbenchmarkvalgrind_p.h" #endif #include "QtTest/private/qbenchmarkevent_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" QT_BEGIN_NAMESPACE @@ -92,23 +95,29 @@ class QBenchmarkResult { public: QBenchmarkContext context; - qint64 value; + qreal value; int iterations; + QTest::QBenchmarkMetric metric; + bool setByMacro; bool valid; QBenchmarkResult() : value(-1) , iterations(-1) + , setByMacro(true) , valid(false) - { } + { } - QBenchmarkResult(const QBenchmarkContext &context, const qint64 value, const int iterations) + QBenchmarkResult( + const QBenchmarkContext &context, const qreal value, const int iterations, + QTest::QBenchmarkMetric metric, bool setByMacro) : context(context) , value(value) , iterations(iterations) + , metric(metric) + , setByMacro(setByMacro) , valid(true) - { - } + { } bool operator<(const QBenchmarkResult &other) const { @@ -167,7 +176,7 @@ public: bool isBenchmark() const { return result.valid; } bool resultsAccepted() const { return resultAccepted; } int adjustIterationCount(int suggestion); - void setResult(qint64 value); + void setResult(qreal value, QTest::QBenchmarkMetric metric, bool setByMacro = true); QBenchmarkResult result; bool resultAccepted; @@ -183,10 +192,7 @@ namespace QTest void setIterationCount(int count); Q_TESTLIB_EXPORT void beginBenchmarkMeasurement(); - Q_TESTLIB_EXPORT qint64 endBenchmarkMeasurement(); - - void setResult(qint64 result); - void setResult(const QString &tag, qint64 result); + Q_TESTLIB_EXPORT quint64 endBenchmarkMeasurement(); } QT_END_NAMESPACE diff --git a/src/testlib/qbenchmarkevent.cpp b/src/testlib/qbenchmarkevent.cpp index 9c67096..39eb1c5 100644 --- a/src/testlib/qbenchmarkevent.cpp +++ b/src/testlib/qbenchmarkevent.cpp @@ -41,6 +41,7 @@ #include "QtTest/private/qbenchmarkevent_p.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #include <qdebug.h> QT_BEGIN_NAMESPACE @@ -91,14 +92,9 @@ int QBenchmarkEvent::adjustMedianCount(int suggestion) return 1; } -QString QBenchmarkEvent::unitText() +QTest::QBenchmarkMetric QBenchmarkEvent::metricType() { - return QLatin1String("events"); -} - -QString QBenchmarkEvent::metricText() -{ - return QLatin1String("events"); + return QTest::Events; } // This could be done in a much better way, this is just the beginning. diff --git a/src/testlib/qbenchmarkevent_p.h b/src/testlib/qbenchmarkevent_p.h index 1a48964..5e13b9f 100644 --- a/src/testlib/qbenchmarkevent_p.h +++ b/src/testlib/qbenchmarkevent_p.h @@ -70,8 +70,7 @@ public: int adjustIterationCount(int suggestion); int adjustMedianCount(int suggestion); bool repeatCount() { return 1; } - QString unitText(); - QString metricText(); + QTest::QBenchmarkMetric metricType(); static bool eventCountingMechanism(void *message); static qint64 eventCounter; }; diff --git a/src/testlib/qbenchmarkmeasurement.cpp b/src/testlib/qbenchmarkmeasurement.cpp index 836d85f..c03cbff 100644 --- a/src/testlib/qbenchmarkmeasurement.cpp +++ b/src/testlib/qbenchmarkmeasurement.cpp @@ -41,6 +41,8 @@ #include "QtTest/private/qbenchmarkmeasurement_p.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" +#include "qbenchmark.h" #include <qdebug.h> QT_BEGIN_NAMESPACE @@ -77,14 +79,9 @@ int QBenchmarkTimeMeasurer::adjustMedianCount(int) return 1; } -QString QBenchmarkTimeMeasurer::unitText() +QTest::QBenchmarkMetric QBenchmarkTimeMeasurer::metricType() { - return QLatin1String("msec"); -} - -QString QBenchmarkTimeMeasurer::metricText() -{ - return QLatin1String("walltime"); + return QTest::WalltimeMilliseconds; } #ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h @@ -126,14 +123,9 @@ bool QBenchmarkTickMeasurer::needsWarmupIteration() return true; } -QString QBenchmarkTickMeasurer::unitText() -{ - return QLatin1String("ticks"); -} - -QString QBenchmarkTickMeasurer::metricText() +QTest::QBenchmarkMetric QBenchmarkTickMeasurer::metricType() { - return QLatin1String("cputicks"); + return QTest::CPUTicks; } #endif diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h index 6f3c034..8ad3613 100644 --- a/src/testlib/qbenchmarkmeasurement_p.h +++ b/src/testlib/qbenchmarkmeasurement_p.h @@ -55,6 +55,7 @@ #include <QtCore/qdatetime.h> #include "3rdparty/cycle_p.h" +#include "qbenchmark.h" QT_BEGIN_NAMESPACE @@ -71,8 +72,7 @@ public: virtual int adjustMedianCount(int suggestion) = 0; virtual bool repeatCount() { return 1; } virtual bool needsWarmupIteration() { return false; } - virtual QString unitText() = 0; - virtual QString metricText() = 0; + virtual QTest::QBenchmarkMetric metricType() = 0; }; class QBenchmarkTimeMeasurer : public QBenchmarkMeasurerBase @@ -84,8 +84,7 @@ public: bool isMeasurementAccepted(qint64 measurement); int adjustIterationCount(int sugestion); int adjustMedianCount(int suggestion); - QString unitText(); - QString metricText(); + QTest::QBenchmarkMetric metricType(); private: QTime time; }; @@ -102,8 +101,7 @@ public: int adjustIterationCount(int); int adjustMedianCount(int suggestion); bool needsWarmupIteration(); - QString unitText(); - QString metricText(); + QTest::QBenchmarkMetric metricType(); private: CycleCounterTicks startTicks; }; diff --git a/src/testlib/qbenchmarkmetric.cpp b/src/testlib/qbenchmarkmetric.cpp new file mode 100644 index 0000000..7356134 --- /dev/null +++ b/src/testlib/qbenchmarkmetric.cpp @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/private/qbenchmarkmetric_p.h> + +/*! + \enum QTest::QBenchmarkMetric + \since 4.7 + + This enum lists all the things that can be benchmarked. + + \value FramesPerSecond Frames per second + \value BitsPerSecond Bits per second + \value BytesPerSecond Bytes per second + \value WalltimeMilliseconds Clock time in milliseconds + \value CPUTicks CPU time + \value InstructionReads Instruction reads + \value Events Event count + + \sa QTest::benchmarkMetricName(), QTest::benchmarkMetricUnit() + + */ + +/*! + \relates QTest + \since 4.7 + Returns the enum value \a metric as a character string. + */ +const char * QTest::benchmarkMetricName(QBenchmarkMetric metric) +{ + switch (metric) { + case FramesPerSecond: + return "FramesPerSecond"; + case BitsPerSecond: + return "BitsPerSecond"; + case BytesPerSecond: + return "BytesPerSecond"; + case WalltimeMilliseconds: + return "WalltimeMilliseconds"; + case CPUTicks: + return "CPUTicks"; + case InstructionReads: + return "InstructionReads"; + case Events: + return "Events"; + default: + return ""; + } +}; + +/*! + \relates QTest + \since 4.7 + Retuns the units of measure for the specified \a metric. + */ +const char * QTest::benchmarkMetricUnit(QBenchmarkMetric metric) +{ + switch (metric) { + case FramesPerSecond: + return "fps"; + case BitsPerSecond: + return "bits/s"; + case BytesPerSecond: + return "bytes/s"; + case WalltimeMilliseconds: + return "msecs"; + case CPUTicks: + return "CPU ticks"; + case InstructionReads: + return "instruction reads"; + case Events: + return "events"; + default: + return ""; + } +} + diff --git a/src/testlib/qbenchmarkmetric.h b/src/testlib/qbenchmarkmetric.h new file mode 100644 index 0000000..302c1aa --- /dev/null +++ b/src/testlib/qbenchmarkmetric.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBENCHMARKMETRIC_H +#define QBENCHMARKMETRIC_H + +#include <QtTest/qtest_global.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Test) + +namespace QTest { + +enum QBenchmarkMetric { + FramesPerSecond, + BitsPerSecond, + BytesPerSecond, + WalltimeMilliseconds, + CPUTicks, + InstructionReads, + Events +}; + +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBENCHMARK_H diff --git a/src/testlib/qbenchmarkmetric_p.h b/src/testlib/qbenchmarkmetric_p.h new file mode 100644 index 0000000..c919d2e --- /dev/null +++ b/src/testlib/qbenchmarkmetric_p.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QBENCHMARKMETRIC_P_H +#define QBENCHMARKMETRIC_P_H + +#include <QtTest/qtest_global.h> +#include <QtTest/qbenchmarkmetric.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Test) + +namespace QTest { + const char * benchmarkMetricName(QBenchmarkMetric metric); + const char * benchmarkMetricUnit(QBenchmarkMetric metric); +} + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QBENCHMARK_H diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp index 264774e..8c64c0b 100644 --- a/src/testlib/qbenchmarkvalgrind.cpp +++ b/src/testlib/qbenchmarkvalgrind.cpp @@ -263,14 +263,9 @@ bool QBenchmarkCallgrindMeasurer::needsWarmupIteration() return true; } -QString QBenchmarkCallgrindMeasurer::unitText() +QTest::QBenchmarkMetric QBenchmarkCallgrindMeasurer::metricType() { - return QLatin1String("instr. loads"); -} - -QString QBenchmarkCallgrindMeasurer::metricText() -{ - return QLatin1String("callgrind"); + return QTest::InstructionReads; } QT_END_NAMESPACE diff --git a/src/testlib/qbenchmarkvalgrind_p.h b/src/testlib/qbenchmarkvalgrind_p.h index 754fe3d..7b6893b 100644 --- a/src/testlib/qbenchmarkvalgrind_p.h +++ b/src/testlib/qbenchmarkvalgrind_p.h @@ -54,6 +54,7 @@ // #include "QtTest/private/qbenchmarkmeasurement_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #include <QtCore/qmap.h> #include <QtCore/qstring.h> @@ -84,8 +85,7 @@ public: int adjustIterationCount(int); int adjustMedianCount(int); bool needsWarmupIteration(); - QString unitText(); - QString metricText(); + QTest::QBenchmarkMetric metricType(); }; QT_END_NAMESPACE diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index 0888cfc..46431a8 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -44,6 +44,7 @@ #include "QtTest/private/qtestlog_p.h" #include "QtTest/private/qplaintestlogger_p.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #include <stdarg.h> #include <stdio.h> @@ -324,7 +325,6 @@ namespace QTest { QTestResult::currentTestObjectName(), result.context.slotName.toAscii().data()); - char bufTag[1024]; bufTag[0] = 0; QByteArray tag = result.context.tag.toAscii(); @@ -340,32 +340,43 @@ namespace QTest { char fill[1024]; QTest::qt_snprintf(fill, sizeof(fill), fillFormat, ""); - - QByteArray unitText = QBenchmarkGlobalData::current->measurer->unitText().toAscii(); + const char * unitText = QTest::benchmarkMetricUnit(result.metric); qreal valuePerIteration = qreal(result.value) / qreal(result.iterations); char resultBuffer[100] = ""; formatResult(resultBuffer, 100, valuePerIteration, countSignificantDigits(result.value)); - QByteArray iterationText = "per iteration"; - char buf2[1024]; - Q_ASSERT(result.iterations > 0); QTest::qt_snprintf( - buf2, sizeof(buf2), "%s %s %s", + buf2, sizeof(buf2), "%s %s", resultBuffer, - unitText.data(), + unitText); + + char buf2_[1024]; + QByteArray iterationText = " per iteration"; + Q_ASSERT(result.iterations > 0); + QTest::qt_snprintf( + buf2_, + sizeof(buf2_), "%s", iterationText.data()); char buf3[1024]; Q_ASSERT(result.iterations > 0); + formatResult(resultBuffer, 100, result.value, countSignificantDigits(result.value)); QTest::qt_snprintf( - buf3, sizeof(buf3), " (total: %s, iterations: %d)\n", - QByteArray::number(result.value).constData(), // no 64-bit qt_snprintf support + buf3, sizeof(buf3), " (total: %s, iterations: %d)", + resultBuffer, result.iterations); char buf[1024]; - QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s%s", buf1, bufTag, fill, buf2, buf3); + + if (result.setByMacro) { + QTest::qt_snprintf( + buf, sizeof(buf), "%s%s%s%s%s%s\n", buf1, bufTag, fill, buf2, buf2_, buf3); + } else { + QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s\n", buf1, bufTag, fill, buf2); + } + memcpy(buf, bmtag, strlen(bmtag)); outputMessage(buf); } diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index ecdcca8..40daecb 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -846,6 +846,9 @@ namespace QTest static int mouseDelay = -1; static int eventDelay = -1; static int keyVerbose = -1; +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + static bool noCrashHandler = false; +#endif void filter_unprintable(char *str) { @@ -976,6 +979,9 @@ static void qParseArgs(int argc, char *argv[]) " -keyevent-verbose : Turn on verbose messages for keyboard simulation\n" " -maxwarnings n : Sets the maximum amount of messages to output.\n" " 0 means unlimited, default: 2000\n" +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + " -nocrashhandler : Disables the crash handler\n" +#endif "\n" " Benchmark related options:\n" #ifdef QTESTLIB_USE_VALGRIND @@ -1056,6 +1062,10 @@ static void qParseArgs(int argc, char *argv[]) } else { QTestLog::setMaxWarnings(qToInt(argv[++i])); } +#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) + } else if (strcmp(argv[i], "-nocrashhandler") == 0) { + QTest::noCrashHandler = true; +#endif } else if (strcmp(argv[i], "-keyevent-verbose") == 0) { QTest::keyVerbose = 1; #ifdef QTESTLIB_USE_VALGRIND @@ -1661,7 +1671,9 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #endif { #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) - FatalSignalHandler handler; + QScopedPointer<FatalSignalHandler> handler; + if (!noCrashHandler) + handler.reset(new FatalSignalHandler); #endif qInvokeTestMethods(testObject); } diff --git a/src/testlib/qtestcoreelement.h b/src/testlib/qtestcoreelement.h index e1ad44a..4738f7d 100644 --- a/src/testlib/qtestcoreelement.h +++ b/src/testlib/qtestcoreelement.h @@ -45,6 +45,8 @@ #include <QtTest/qtestcorelist.h> #include <QtTest/qtestelementattribute.h> +#include <cstdlib> + QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -93,6 +95,9 @@ void QTestCoreElement<ElementType>::addAttribute(const QTest::AttributeIndex att if (attribute(attributeIndex)) return; + // if (attributeIndex == QTest::AI_Metric) + // abort(); + QTestElementAttribute *testAttribute = new QTestElementAttribute; testAttribute->setPair(attributeIndex, value); testAttribute->addToList(&listOfAttributes); diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index c0bc26c..6c76388 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -267,7 +267,9 @@ void QTestLogger::addBenchmarkResult(const QBenchmarkResult &result) QTestElement *benchmarkElement = new QTestElement(QTest::LET_Benchmark); // printf("element %i", benchmarkElement->elementType()); - benchmarkElement->addAttribute(QTest::AI_Metric, QBenchmarkGlobalData::current->measurer->metricText().toAscii().data()); + benchmarkElement->addAttribute( + QTest::AI_Metric, + QTest::benchmarkMetricName(QBenchmarkTestMethodData::current->result.metric)); benchmarkElement->addAttribute(QTest::AI_Tag, result.context.tag.toAscii().data()); benchmarkElement->addAttribute(QTest::AI_Value, QByteArray::number(result.value).constData()); diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp index 13103f3..2236666 100644 --- a/src/testlib/qxmltestlogger.cpp +++ b/src/testlib/qxmltestlogger.cpp @@ -46,6 +46,7 @@ #include "QtTest/private/qxmltestlogger_p.h" #include "QtTest/private/qtestresult_p.h" #include "QtTest/private/qbenchmark_p.h" +#include "QtTest/private/qbenchmarkmetric_p.h" #include "QtTest/qtestcase.h" QT_BEGIN_NAMESPACE @@ -243,7 +244,7 @@ void QXmlTestLogger::addBenchmarkResult(const QBenchmarkResult &result) QTestCharBuffer quotedTag; xmlQuote("edMetric, - QBenchmarkGlobalData::current->measurer->metricText().toAscii().constData()); + benchmarkMetricUnit(result.metric)); xmlQuote("edTag, result.context.tag.toAscii().constData()); QTest::qt_asprintf( diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro index f68ff35..a8186d8 100644 --- a/src/testlib/testlib.pro +++ b/src/testlib/testlib.pro @@ -47,6 +47,7 @@ SOURCES = qtestcase.cpp \ qbenchmarkmeasurement.cpp \ qbenchmarkvalgrind.cpp \ qbenchmarkevent.cpp \ + qbenchmarkmetric.cpp \ qtestelement.cpp \ qtestelementattribute.cpp \ qtestbasicstreamer.cpp \ diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 982d95f5..6729c62 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -173,7 +173,7 @@ void Generator::generateCode() int index = 14; fprintf(out, "static const uint qt_meta_data_%s[] = {\n", qualifiedClassNameIdentifier.constData()); fprintf(out, "\n // content:\n"); - fprintf(out, " %4d, // revision\n", 4); + fprintf(out, " %4d, // revision\n", 5); fprintf(out, " %4d, // classname\n", strreg(cdef->qualified)); fprintf(out, " %4d, %4d, // classinfo\n", cdef->classInfoList.count(), cdef->classInfoList.count() ? index : 0); index += cdef->classInfoList.count() * 2; diff --git a/src/xmlpatterns/type/qprimitives_p.h b/src/xmlpatterns/type/qprimitives_p.h index 1090f7f..c378a66 100644 --- a/src/xmlpatterns/type/qprimitives_p.h +++ b/src/xmlpatterns/type/qprimitives_p.h @@ -79,18 +79,6 @@ class QString; */ namespace QPatternist { - - /** - * @internal - * - * A method to allow a QHash or QSet with QUrl - * as key type. - */ - inline uint qHash(const QUrl &uri) - { - return qHash(uri.toString()); - } - /** * @defgroup Patternist_cppWXSTypes C++ Primitives for W3C XML Schema Number Types * @@ -208,8 +196,6 @@ namespace QPatternist QString Q_AUTOTEST_EXPORT escape(const QString &input); } -using QPatternist::qHash; - QT_END_NAMESPACE QT_END_HEADER diff --git a/tests/arthur/lance/widgets.h b/tests/arthur/lance/widgets.h index 88e0726..f7d3268 100644 --- a/tests/arthur/lance/widgets.h +++ b/tests/arthur/lance/widgets.h @@ -236,7 +236,12 @@ public: } if (m_render_view.isNull()) { - m_render_view = T::window()->windowSurface()->grabWidget(this); + + if (T::window()->windowSurface()) + m_render_view = T::window()->windowSurface()->grabWidget(this); + else + m_render_view = QPixmap::grabWidget(this); + m_render_view.save("renderView.png"); } } diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 022b19a..9c4b4f0 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -462,7 +462,7 @@ SUBDIRS += \ rcc \ windowsmobile -contains(QT_CONFIG,opengl):SUBDIRS += qgl +contains(QT_CONFIG,opengl):SUBDIRS += qgl qglbuffer contains(QT_CONFIG,qt3support):!wince*:SUBDIRS += $$Q3SUBDIRS diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd new file mode 100644 index 0000000..6f198ab --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/lupdatecmd @@ -0,0 +1,2 @@ +# Add the command that lupdate should run here. If it can't find anything it will default to +lupdate -silent @sources.lst -ts @tsfiles.lst diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result new file mode 100644 index 0000000..3a864a2 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/project.ts.result @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>Dialog2</name> + <message> + <location filename="source1.cpp" line="47"/> + <source>func1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="source2.cpp" line="47"/> + <source>func2</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/examples/assistant/simpletextviewer/main.cpp b/tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp index 6e38406..33642c4 100644 --- a/examples/assistant/simpletextviewer/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/source1.cpp @@ -1,10 +1,10 @@ /**************************************************************************** ** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the examples of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,14 +39,11 @@ ** ****************************************************************************/ -#include <QApplication> +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! -#include "mainwindow.h" - -int main(int argc, char *argv[]) +void Dialog2::func3() { - QApplication app(argc, argv); - MainWindow window; - window.show(); - return app.exec(); + tr("func1"); } + diff --git a/config.tests/unix/opengles1cl/opengles1cl.cpp b/tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp index 4f27c75..f284a61 100644 --- a/config.tests/unix/opengles1cl/opengles1cl.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/source2.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the config.tests of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,13 +39,11 @@ ** ****************************************************************************/ -#include <GLES/gl.h> +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! -int main(int, char **) +void Dialog2::func3() { - GLfixed a = 0; - glColor4x(a, a, a, a); - glClear(GL_COLOR_BUFFER_BIT); - - return 0; + tr("func2"); } + diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst b/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst new file mode 100644 index 0000000..430937e --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/sources.lst @@ -0,0 +1,2 @@ +source1.cpp +source2.cpp diff --git a/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst b/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst new file mode 100644 index 0000000..f3eb71f --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/respfile/tsfiles.lst @@ -0,0 +1 @@ +project.ts diff --git a/tests/auto/modeltest/dynamictreemodel.cpp b/tests/auto/modeltest/dynamictreemodel.cpp index 24d3ab3..b572eb1 100644 --- a/tests/auto/modeltest/dynamictreemodel.cpp +++ b/tests/auto/modeltest/dynamictreemodel.cpp @@ -160,10 +160,11 @@ QVariant DynamicTreeModel::data(const QModelIndex &index, int role) const void DynamicTreeModel::clear() { + beginResetModel(); m_items.clear(); m_childItems.clear(); nextId = 1; - reset(); + endResetModel(); } diff --git a/tests/auto/modeltest/tst_modeltest.cpp b/tests/auto/modeltest/tst_modeltest.cpp index 95326d4..da5cd6a 100644 --- a/tests/auto/modeltest/tst_modeltest.cpp +++ b/tests/auto/modeltest/tst_modeltest.cpp @@ -67,6 +67,7 @@ private slots: void standardItemModel(); void testInsertThroughProxy(); void moveSourceItems(); + void testResetThroughProxy(); }; @@ -225,8 +226,9 @@ public slots: void storePersistent() { - m_persistentSourceIndexes.clear(); - m_persistentProxyIndexes.clear(); + foreach(const QModelIndex &idx, m_persistentProxyIndexes) + Q_ASSERT(idx.isValid()); // This is called from layoutAboutToBeChanged. Persistent indexes should be valid + Q_ASSERT(m_proxy->persistent().isEmpty()); storePersistent(QModelIndex()); Q_ASSERT(!m_proxy->persistent().isEmpty()); @@ -243,6 +245,8 @@ public slots: QModelIndex updatedSource = m_persistentSourceIndexes.at(row); QCOMPARE(m_proxy->mapToSource(updatedProxy), updatedSource); } + m_persistentSourceIndexes.clear(); + m_persistentProxyIndexes.clear(); } private: @@ -278,6 +282,28 @@ void tst_ModelTest::moveSourceItems() moveCommand->doCommand(); } +void tst_ModelTest::testResetThroughProxy() +{ + DynamicTreeModel *model = new DynamicTreeModel(this); + + ModelInsertCommand *insertCommand = new ModelInsertCommand(model, this); + insertCommand->setStartRow(0); + insertCommand->setEndRow(2); + insertCommand->doCommand(); + + QPersistentModelIndex persistent = model->index(0, 0); + + AccessibleProxyModel *proxy = new AccessibleProxyModel(this); + proxy->setSourceModel(model); + + ObservingObject observer(proxy); + observer.storePersistent(); + + ModelResetCommand *resetCommand = new ModelResetCommand(model, this); + resetCommand->setNumCols(0); + resetCommand->doCommand(); +} + QTEST_MAIN(tst_ModelTest) #include "tst_modeltest.moc" diff --git a/tests/auto/qapplication/tst_qapplication.cpp b/tests/auto/qapplication/tst_qapplication.cpp index b464867..459ac2b 100644 --- a/tests/auto/qapplication/tst_qapplication.cpp +++ b/tests/auto/qapplication/tst_qapplication.cpp @@ -706,36 +706,6 @@ void tst_QApplication::quitOnLastWindowClosed() QSignalSpy spy(&app, SIGNAL(aboutToQuit())); QSignalSpy spy2(&timer, SIGNAL(timeout())); - QPointer<QMainWindow> mainWindow = new QMainWindow; - QPointer<QWidget> invisibleTopLevelWidget = new QWidget; - invisibleTopLevelWidget->setAttribute(Qt::WA_DontShowOnScreen); - - QVERIFY(app.quitOnLastWindowClosed()); - QVERIFY(mainWindow->testAttribute(Qt::WA_QuitOnClose)); - QVERIFY(invisibleTopLevelWidget->testAttribute(Qt::WA_QuitOnClose)); - QVERIFY(invisibleTopLevelWidget->testAttribute(Qt::WA_DontShowOnScreen)); - - mainWindow->show(); - invisibleTopLevelWidget->show(); - - timer.start(); - QTimer::singleShot(1000, mainWindow, SLOT(close())); // This should quit the application - QTimer::singleShot(2000, &app, SLOT(quit())); // This makes sure we quit even if it didn't - - app.exec(); - - QCOMPARE(spy.count(), 1); - QVERIFY(spy2.count() < 15); // Should be around 10 if closing caused the quit - } - { - int argc = 0; - QApplication app(argc, 0, QApplication::GuiServer); - QTimer timer; - timer.setInterval(100); - - QSignalSpy spy(&app, SIGNAL(aboutToQuit())); - QSignalSpy spy2(&timer, SIGNAL(timeout())); - QPointer<CloseEventTestWindow> mainWindow = new CloseEventTestWindow; QVERIFY(app.quitOnLastWindowClosed()); diff --git a/tests/auto/qbrush/tst_qbrush.cpp b/tests/auto/qbrush/tst_qbrush.cpp index bc2bc60..628e859 100644 --- a/tests/auto/qbrush/tst_qbrush.cpp +++ b/tests/auto/qbrush/tst_qbrush.cpp @@ -108,6 +108,15 @@ void tst_QBrush::operator_eq_eq_data() << false; QTest::newRow("rad vs con") << QBrush(QRadialGradient(0, 0, 0, 0, 0)) << QBrush(QConicalGradient(0, 0, 0)) << false; + + QBrush b1(lg); + QBrush b2(lg); + b1.setTransform(QTransform().scale(2, 2)); + QTest::newRow("lg with transform vs same lg") << b1 << b2 << false; + + b2.setTransform(QTransform().scale(2, 2)); + QTest::newRow("lg w/transform vs same lg w/same transform") << b1 << b2 << true; + } void tst_QBrush::operator_eq_eq() diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index fbaa824..1fcea9e 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -156,6 +156,7 @@ private slots: void resetModel(); void keyBoardNavigationWithMouse(); void task_QTBUG_1071_changingFocusEmitsActivated(); + void maxVisibleItems(); protected slots: void onEditTextChanged( const QString &newString ); @@ -2529,5 +2530,34 @@ void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated() QTRY_COMPARE(spy.count(), 1); } +void tst_QComboBox::maxVisibleItems() +{ + QComboBox comboBox; + QCOMPARE(comboBox.maxVisibleItems(), 10); //default value. + + QStringList content; + for(int i = 1; i < 50; i++) + content += QString::number(i); + + comboBox.addItems(content); + comboBox.show(); + comboBox.resize(200, comboBox.height()); + QTRY_VERIFY(comboBox.isVisible()); + + comboBox.setMaxVisibleItems(5); + QCOMPARE(comboBox.maxVisibleItems(), 5); + + comboBox.showPopup(); + QTRY_VERIFY(comboBox.view()); + QTRY_VERIFY(comboBox.view()->isVisible()); + + QAbstractItemView *v = comboBox.view(); + int itemHeight = v->visualRect(v->model()->index(0,0)).height(); + if (v->style()->styleHint(QStyle::SH_ComboBox_Popup)) + QCOMPARE(v->viewport()->height(), itemHeight * comboBox.maxVisibleItems()); + // QCombobox without a popup does not work, see QTBUG-760 +} + + QTEST_MAIN(tst_QComboBox) #include "tst_qcombobox.moc" diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp index b92b873..558d4de 100644 --- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp @@ -3357,6 +3357,8 @@ void tst_QDateTimeEdit::keypadAutoAdvance_data() QTest::addColumn<Qt::KeyboardModifiers>("modifiers"); QTest::newRow("None") << (Qt::KeyboardModifiers)Qt::NoModifier; QTest::newRow("Keypad") << (Qt::KeyboardModifiers)Qt::KeypadModifier; + // QTBUG-7842: Using KeyPad with shift (numlock off) + QTest::newRow("Keypad+Shift") << (Qt::KeyboardModifiers)(Qt::KeypadModifier|Qt::ShiftModifier); } diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index c7f9b6b..ba18bbb 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -49,6 +49,7 @@ #include <qregexp.h> #include <qstringlist.h> #include "../network-settings.h" +#include "../../shared/filesystem.h" #if defined(Q_OS_SYMBIAN) # define STRINGIFY(x) #x @@ -164,6 +165,8 @@ private slots: void longFileName_data(); void longFileName(); + + void updateFileLists(); }; // Testing get/set functions @@ -982,6 +985,13 @@ tst_QDir::cleanPath_data() QTest::newRow("data7") << ".//file1.txt" << "file1.txt"; QTest::newRow("data8") << "/foo/bar/..//file1.txt" << "/foo/file1.txt"; QTest::newRow("data9") << "//" << "/"; +#if !defined(Q_OS_WINCE) +#if defined Q_OS_WIN + QTest::newRow("data10") << "c:\\" << "c:/"; +#else + QTest::newRow("data10") << "/:/" << "/:"; +#endif +#endif } @@ -1435,6 +1445,95 @@ void tst_QDir::longFileName() QFile::remove(fileName); } +void tst_QDir::updateFileLists() +{ + // Test setup + + FileSystem fs; + + QVERIFY( fs.createDirectory("update-file-lists") ); + QVERIFY( fs.createFile("update-file-lists/file1.txt") ); + QVERIFY( fs.createFile("update-file-lists/file2.doc") ); + + QVERIFY( fs.createDirectory("update-file-lists/sub-dir1") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir1/file3.txt") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir1/file4.doc") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir1/file5.txt") ); + + QVERIFY( fs.createDirectory("update-file-lists/sub-dir2") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir2/file6.txt") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir2/file7.txt") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir2/file8.doc") ); + QVERIFY( fs.createFile("update-file-lists/sub-dir2/file9.doc") ); + + // Actual test + + QDir dir("update-file-lists"); + + QCOMPARE(dir.count(), uint(6)); + QCOMPARE(dir.entryList().size(), 6); + QCOMPARE(dir.entryInfoList().size(), 6); + + dir.setFilter(QDir::AllEntries | QDir::NoDotAndDotDot); + + QCOMPARE(dir.entryList().size(), 4); + QCOMPARE(dir.count(), uint(4)); + QCOMPARE(dir.entryInfoList().size(), 4); + + dir.setPath("update-file-lists/sub-dir1"); + + QCOMPARE(dir.entryInfoList().size(), 3); + QCOMPARE(dir.count(), uint(3)); + QCOMPARE(dir.entryList().size(), 3); + + dir.setNameFilters(QStringList("*.txt")); + + QCOMPARE(dir.entryInfoList().size(), 2); + QCOMPARE(dir.entryList().size(), 2); + QCOMPARE(dir.count(), uint(2)); + + dir.setPath("update-file-lists"); + dir = QDir(dir.path(), + "*.txt", + QDir::Name | QDir::DirsLast, + QDir::AllEntries | QDir::AllDirs | QDir::NoDotAndDotDot); + + QCOMPARE(dir.count(), uint(3)); + QCOMPARE(dir.entryList().size(), 3); + QCOMPARE(dir.entryInfoList().size(), 3); + QCOMPARE(dir.entryList(), QStringList() << "file1.txt" << "sub-dir1" << "sub-dir2"); + + dir.setSorting(QDir::Name | QDir::DirsFirst); + + QCOMPARE(dir.count(), uint(3)); + QCOMPARE(dir.entryList().size(), 3); + QCOMPARE(dir.entryInfoList().size(), 3); + QCOMPARE(dir.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "file1.txt"); + + { + QVERIFY( fs.createFile("update-file-lists/extra-file.txt") ); + + QDir dir2(dir); + + QCOMPARE(dir2.count(), uint(3)); + QCOMPARE(dir2.entryList().size(), 3); + QCOMPARE(dir2.entryInfoList().size(), 3); + QCOMPARE(dir2.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "file1.txt"); + + dir2.refresh(); + + QCOMPARE(dir2.count(), uint(4)); + QCOMPARE(dir2.entryList().size(), 4); + QCOMPARE(dir2.entryInfoList().size(), 4); + QCOMPARE(dir2.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "extra-file.txt" << "file1.txt"); + } + + QCOMPARE(dir.count(), uint(3)); + QCOMPARE(dir.entryList().size(), 3); + QCOMPARE(dir.entryInfoList().size(), 3); + QCOMPARE(dir.entryList(), QStringList() << "sub-dir1" << "sub-dir2" << "file1.txt"); +} + QTEST_MAIN(tst_QDir) #include "tst_qdir.moc" diff --git a/tests/auto/qdiriterator/foo/bar/readme.txt b/tests/auto/qdiriterator/foo/bar/readme.txt deleted file mode 100644 index e69de29..0000000 --- a/tests/auto/qdiriterator/foo/bar/readme.txt +++ /dev/null diff --git a/tests/auto/qdiriterator/recursiveDirs/dir1/aPage.html b/tests/auto/qdiriterator/recursiveDirs/dir1/aPage.html deleted file mode 100644 index 51a2261..0000000 --- a/tests/auto/qdiriterator/recursiveDirs/dir1/aPage.html +++ /dev/null @@ -1,8 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml/"> - <head> - <title>A title</title> - </head> - <body> - <p>Some text</p> - </body> -</html> diff --git a/tests/auto/qdiriterator/recursiveDirs/dir1/textFileB.txt b/tests/auto/qdiriterator/recursiveDirs/dir1/textFileB.txt deleted file mode 100644 index 5b1dd02..0000000 --- a/tests/auto/qdiriterator/recursiveDirs/dir1/textFileB.txt +++ /dev/null @@ -1 +0,0 @@ -Some Text diff --git a/tests/auto/qdiriterator/recursiveDirs/textFileA.txt b/tests/auto/qdiriterator/recursiveDirs/textFileA.txt deleted file mode 100644 index 5b1dd02..0000000 --- a/tests/auto/qdiriterator/recursiveDirs/textFileA.txt +++ /dev/null @@ -1 +0,0 @@ -Some Text diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp index 6cdd1f7..f6fce32 100644 --- a/tests/auto/qdiriterator/tst_qdiriterator.cpp +++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp @@ -71,6 +71,39 @@ public: tst_QDirIterator(); virtual ~tst_QDirIterator(); +private: // convenience functions + QStringList createdDirectories; + QStringList createdFiles; + + QDir currentDir; + bool createDirectory(const QString &dirName) + { + if (currentDir.mkdir(dirName)) { + createdDirectories.prepend(dirName); + return true; + } + return false; + } + + bool createFile(const QString &fileName) + { + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + createdFiles << fileName; + return true; + } + return false; + } + + bool createLink(const QString &destination, const QString &linkName) + { + if (QFile::link(destination, linkName)) { + createdFiles << linkName; + return true; + } + return false; + } + private slots: void iterateRelativeDirectory_data(); void iterateRelativeDirectory(); @@ -96,41 +129,47 @@ tst_QDirIterator::tst_QDirIterator() QFile::remove("entrylist/directory/entrylist3.lnk"); QFile::remove("entrylist/directory/entrylist4.lnk"); + createDirectory("entrylist"); + createDirectory("entrylist/directory"); + createFile("entrylist/file"); + createFile("entrylist/writable"); + createFile("entrylist/directory/dummy"); + + createDirectory("recursiveDirs"); + createDirectory("recursiveDirs/dir1"); + createFile("recursiveDirs/textFileA.txt"); + createFile("recursiveDirs/dir1/aPage.html"); + createFile("recursiveDirs/dir1/textFileB.txt"); + + createDirectory("foo"); + createDirectory("foo/bar"); + createFile("foo/bar/readme.txt"); + #ifndef Q_NO_SYMLINKS # if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) // ### Sadly, this is a platform difference right now. - QFile::link("entrylist/file", "entrylist/linktofile.lnk"); + createLink("entrylist/file", "entrylist/linktofile.lnk"); # ifndef Q_NO_SYMLINKS_TO_DIRS - QFile::link("entrylist/directory", "entrylist/linktodirectory.lnk"); + createLink("entrylist/directory", "entrylist/linktodirectory.lnk"); # endif - QFile::link("entrylist/nothing", "entrylist/brokenlink.lnk"); + createLink("entrylist/nothing", "entrylist/brokenlink.lnk"); # else - QFile::link("file", "entrylist/linktofile.lnk"); + createLink("file", "entrylist/linktofile.lnk"); # ifndef Q_NO_SYMLINKS_TO_DIRS - QFile::link("directory", "entrylist/linktodirectory.lnk"); + createLink("directory", "entrylist/linktodirectory.lnk"); # endif - QFile::link("nothing", "entrylist/brokenlink.lnk"); + createLink("nothing", "entrylist/brokenlink.lnk"); # endif #endif - QFile("entrylist/writable").open(QIODevice::ReadWrite); } tst_QDirIterator::~tst_QDirIterator() { - QFile::remove("entrylist/directory"); - QFile::remove("entrylist/linktofile.lnk"); - QFile::remove("entrylist/linktodirectory.lnk"); - QFile::remove("entrylist/brokenlink.lnk"); - QFile::remove("entrylist/brokenlink"); - QFile::remove("entrylist/writable"); - QFile::remove("entrylist/entrylist1.lnk"); - QFile::remove("entrylist/entrylist2.lnk"); - QFile::remove("entrylist/entrylist3.lnk"); - QFile::remove("entrylist/entrylist4.lnk"); - QFile::remove("entrylist/directory/entrylist1.lnk"); - QFile::remove("entrylist/directory/entrylist2.lnk"); - QFile::remove("entrylist/directory/entrylist3.lnk"); - QFile::remove("entrylist/directory/entrylist4.lnk"); + Q_FOREACH(QString fileName, createdFiles) + QFile::remove(fileName); + + Q_FOREACH(QString dirName, createdDirectories) + currentDir.rmdir(dirName); } void tst_QDirIterator::iterateRelativeDirectory_data() @@ -298,23 +337,23 @@ void tst_QDirIterator::stopLinkLoop() { #ifdef Q_OS_WIN // ### Sadly, this is a platform difference right now. - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); - QFile::link("entrylist/.", "entrylist/entrylist2.lnk"); - QFile::link("entrylist/../entrylist/.", "entrylist/entrylist3.lnk"); - QFile::link("entrylist/..", "entrylist/entrylist4.lnk"); - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/directory/entrylist1.lnk"); - QFile::link("entrylist/.", "entrylist/directory/entrylist2.lnk"); - QFile::link("entrylist/../directory/.", "entrylist/directory/entrylist3.lnk"); - QFile::link("entrylist/..", "entrylist/directory/entrylist4.lnk"); + createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); + createLink("entrylist/.", "entrylist/entrylist2.lnk"); + createLink("entrylist/../entrylist/.", "entrylist/entrylist3.lnk"); + createLink("entrylist/..", "entrylist/entrylist4.lnk"); + createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/directory/entrylist1.lnk"); + createLink("entrylist/.", "entrylist/directory/entrylist2.lnk"); + createLink("entrylist/../directory/.", "entrylist/directory/entrylist3.lnk"); + createLink("entrylist/..", "entrylist/directory/entrylist4.lnk"); #else - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); - QFile::link(".", "entrylist/entrylist2.lnk"); - QFile::link("../entrylist/.", "entrylist/entrylist3.lnk"); - QFile::link("..", "entrylist/entrylist4.lnk"); - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/directory/entrylist1.lnk"); - QFile::link(".", "entrylist/directory/entrylist2.lnk"); - QFile::link("../directory/.", "entrylist/directory/entrylist3.lnk"); - QFile::link("..", "entrylist/directory/entrylist4.lnk"); + createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); + createLink(".", "entrylist/entrylist2.lnk"); + createLink("../entrylist/.", "entrylist/entrylist3.lnk"); + createLink("..", "entrylist/entrylist4.lnk"); + createLink(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/directory/entrylist1.lnk"); + createLink(".", "entrylist/directory/entrylist2.lnk"); + createLink("../directory/.", "entrylist/directory/entrylist3.lnk"); + createLink("..", "entrylist/directory/entrylist4.lnk"); #endif QDirIterator it(QLatin1String("entrylist"), QDirIterator::Subdirectories | QDirIterator::FollowSymlinks); @@ -325,22 +364,6 @@ void tst_QDirIterator::stopLinkLoop() QVERIFY(max); // The goal of this test is only to ensure that the test above don't malfunction - -#ifdef Q_OS_WIN - // ### Sadly, this is a platform difference right now. - QFile::link(QDir::currentPath() + QLatin1String("/entrylist"), "entrylist/entrylist1.lnk"); - QFile::link("../../entrylist/.", "entrylist/entrylist2.lnk"); - QFile::link("entrylist/..", "entrylist/entrylist3.lnk"); -#else - QFile::remove("entrylist/entrylist1.lnk"); - QFile::remove("entrylist/entrylist2.lnk"); - QFile::remove("entrylist/entrylist3.lnk"); - QFile::remove("entrylist/entrylist4.lnk"); - QFile::remove("entrylist/directory/entrylist1.lnk"); - QFile::remove("entrylist/directory/entrylist2.lnk"); - QFile::remove("entrylist/directory/entrylist3.lnk"); - QFile::remove("entrylist/directory/entrylist4.lnk"); -#endif } class EngineWithNoIterator : public QFSFileEngine diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index d1b2ea5..76903e5 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -476,10 +476,6 @@ void tst_QDom::save() void tst_QDom::initTestCase() { -#ifdef Q_CC_MINGW - QSKIP("Our current test machine, arsia, is too slow for this auto test.", SkipAll); -#endif - QFile file(SRCDIR "testdata/excludedCodecs.txt"); QVERIFY(file.open(QIODevice::ReadOnly|QIODevice::Text)); @@ -1676,7 +1672,7 @@ void tst_QDom::appendDocumentNode() const doc.appendChild(elem); - Q_ASSERT(!xml.isNull()); + QVERIFY(!xml.isNull()); const QString expected(QLatin1String("<document>\n<test_elem name=\"value\"/>\n</document>\n")); elem.appendChild(xml); diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 0122d43..12ddff1 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -193,186 +193,208 @@ void tst_QEasingCurve::valueForProgress_data() // integer values and avoid fp inaccuracies QTest::newRow("Linear") << int(QEasingCurve::Linear) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1 << 0.2 << 0.3 << 0.4 << 0.5 << 0.6 << 0.7 << 0.8 << 0.9 << 1); + << (RealList() << 0.0000 << 0.1000 << 0.2000 << 0.3000 << 0.4000 << 0.5000 << 0.6000 << 0.7000 << 0.8000 << 0.9000 << 1.0000); QTest::newRow("InQuad") << int(QEasingCurve::InQuad) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.01 << 0.04 << 0.09 << 0.16 << 0.25 << 0.36 << 0.49 << 0.64 << 0.81 << 1); + << (RealList() << 0.0000 << 0.0100 << 0.0400 << 0.0900 << 0.1600 << 0.2500 << 0.3600 << 0.4900 << 0.6400 << 0.8100 << 1.0000); QTest::newRow("OutQuad") << int(QEasingCurve::OutQuad) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.19 << 0.36 << 0.51 << 0.64 << 0.75 << 0.84 << 0.91 << 0.96 << 0.99 << 1); + << (RealList() << 0.0000 << 0.1900 << 0.3600 << 0.5100 << 0.6400 << 0.7500 << 0.8400 << 0.9100 << 0.9600 << 0.9900 << 1.0000); QTest::newRow("InOutQuad") << int(QEasingCurve::InOutQuad) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.02 << 0.08 << 0.18 << 0.32 << 0.5 << 0.68 << 0.82 << 0.92 << 0.98 << 1); + << (RealList() << 0.0000 << 0.0200 << 0.0800 << 0.1800 << 0.3200 << 0.5000 << 0.6800 << 0.8200 << 0.9200 << 0.9800 << 1.0000); QTest::newRow("OutInQuad") << int(QEasingCurve::OutInQuad) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.18 << 0.32 << 0.42 << 0.48 << 0.5 << 0.52 << 0.58 << 0.68 << 0.82 << 1); + << (RealList() << 0.0000 << 0.1800 << 0.3200 << 0.4200 << 0.4800 << 0.5000 << 0.5200 << 0.5800 << 0.6800 << 0.8200 << 1.0000); QTest::newRow("InCubic") << int(QEasingCurve::InCubic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.001 << 0.008 << 0.027 << 0.064 << 0.125 << 0.216 << 0.343 << 0.512 << 0.729 << 1); + << (RealList() << 0.0000 << 0.0010 << 0.0080 << 0.0270 << 0.0640 << 0.1250 << 0.2160 << 0.3430 << 0.5120 << 0.7290 << 1.0000); QTest::newRow("OutCubic") << int(QEasingCurve::OutCubic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.271 << 0.488 << 0.657 << 0.784 << 0.875 << 0.936 << 0.973 << 0.992 << 0.999 << 1); + << (RealList() << 0.0000 << 0.2710 << 0.4880 << 0.6570 << 0.7840 << 0.8750 << 0.9360 << 0.9730 << 0.9920 << 0.9990 << 1.0000); QTest::newRow("InOutCubic") << int(QEasingCurve::InOutCubic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.004 << 0.032 << 0.108 << 0.256 << 0.5 << 0.744 << 0.892 << 0.968 << 0.996 << 1); + << (RealList() << 0.0000 << 0.0040 << 0.0320 << 0.1080 << 0.2560 << 0.5000 << 0.7440 << 0.8920 << 0.9680 << 0.9960 << 1.0000); QTest::newRow("OutInCubic") << int(QEasingCurve::OutInCubic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.244 << 0.392 << 0.468 << 0.496 << 0.5 << 0.504 << 0.532 << 0.608 << 0.756 << 1); + << (RealList() << 0.0000 << 0.2440 << 0.3920 << 0.4680 << 0.4960 << 0.5000 << 0.5040 << 0.5320 << 0.6080 << 0.7560 << 1.0000); QTest::newRow("InQuart") << int(QEasingCurve::InQuart) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.0001 << 0.0016 << 0.0081 << 0.0256 << 0.0625 << 0.1296 << 0.2401 << 0.4096 << 0.6561 << 1); + << (RealList() << 0.0000 << 0.0001 << 0.0016 << 0.0081 << 0.0256 << 0.0625 << 0.1296 << 0.2401 << 0.4096 << 0.6561 << 1.0000); QTest::newRow("OutQuart") << int(QEasingCurve::OutQuart) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3439 << 0.5904 << 0.7599 << 0.8704 << 0.9375 << 0.9744 << 0.9919 << 0.9984 << 0.9999 << 1); + << (RealList() << 0.0000 << 0.3439 << 0.5904 << 0.7599 << 0.8704 << 0.9375 << 0.9744 << 0.9919 << 0.9984 << 0.9999 << 1.0000); QTest::newRow("InOutQuart") << int(QEasingCurve::InOutQuart) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.0008 << 0.0128 << 0.0648 << 0.2048 << 0.5 << 0.7952 << 0.9352 << 0.9872 << 0.9992 << 1); + << (RealList() << 0.0000 << 0.0008 << 0.0128 << 0.0648 << 0.2048 << 0.5000 << 0.7952 << 0.9352 << 0.9872 << 0.9992 << 1.0000); QTest::newRow("OutInQuart") << int(QEasingCurve::OutInQuart) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.2952 << 0.4352 << 0.4872 << 0.4992 << 0.5 << 0.5008 << 0.5128 << 0.5648 << 0.7048 << 1); + << (RealList() << 0.0000 << 0.2952 << 0.4352 << 0.4872 << 0.4992 << 0.5000 << 0.5008 << 0.5128 << 0.5648 << 0.7048 << 1.0000); QTest::newRow("InQuint") << int(QEasingCurve::InQuint) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 1e-05 << 0.00032 << 0.00243 << 0.01024 << 0.03125 << 0.07776 << 0.1681 << 0.3277 << 0.5905 << 1); + << (RealList() << 0.0000 << 0.0000 << 0.0003 << 0.0024 << 0.0102 << 0.0313 << 0.0778 << 0.1681 << 0.3277 << 0.5905 << 1.0000); QTest::newRow("OutQuint") << int(QEasingCurve::OutQuint) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.4095 << 0.6723 << 0.8319 << 0.9222 << 0.9688 << 0.9898 << 0.9976 << 0.9997 << 1 << 1); + << (RealList() << 0.0000 << 0.4095 << 0.6723 << 0.8319 << 0.9222 << 0.9688 << 0.9898 << 0.9976 << 0.9997 << 1.0000 << 1.0000); QTest::newRow("InOutQuint") << int(QEasingCurve::InOutQuint) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.00016 << 0.00512 << 0.03888 << 0.1638 << 0.5 << 0.8362 << 0.9611 << 0.9949 << 0.9998 << 1); + << (RealList() << 0.0000 << 0.0002 << 0.0051 << 0.0389 << 0.1638 << 0.5000 << 0.8362 << 0.9611 << 0.9949 << 0.9998 << 1.0000); QTest::newRow("OutInQuint") << int(QEasingCurve::OutInQuint) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3362 << 0.4611 << 0.4949 << 0.4998 << 0.5 << 0.5002 << 0.5051 << 0.5389 << 0.6638 << 1); + << (RealList() << 0.0000 << 0.3362 << 0.4611 << 0.4949 << 0.4998 << 0.5000 << 0.5002 << 0.5051 << 0.5389 << 0.6638 << 1.0000); QTest::newRow("InSine") << int(QEasingCurve::InSine) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.01231 << 0.04894 << 0.109 << 0.191 << 0.2929 << 0.4122 << 0.546 << 0.691 << 0.8436 << 1); + << (RealList() << 0.0000 << 0.0123 << 0.0489 << 0.1090 << 0.1910 << 0.2929 << 0.4122 << 0.5460 << 0.6910 << 0.8436 << 1.0000); QTest::newRow("OutSine") << int(QEasingCurve::OutSine) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1564 << 0.309 << 0.454 << 0.5878 << 0.7071 << 0.809 << 0.891 << 0.9511 << 0.9877 << 1); + << (RealList() << 0.0000 << 0.1564 << 0.3090 << 0.4540 << 0.5878 << 0.7071 << 0.8090 << 0.8910 << 0.9511 << 0.9877 << 1.0000); QTest::newRow("InOutSine") << int(QEasingCurve::InOutSine) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.02447 << 0.09549 << 0.2061 << 0.3455 << 0.5 << 0.6545 << 0.7939 << 0.9045 << 0.9755 << 1); + << (RealList() << 0.0000 << 0.0245 << 0.0955 << 0.2061 << 0.3455 << 0.5000 << 0.6545 << 0.7939 << 0.9045 << 0.9755 << 1.0000); QTest::newRow("OutInSine") << int(QEasingCurve::OutInSine) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1545 << 0.2939 << 0.4045 << 0.4755 << 0.5 << 0.5245 << 0.5955 << 0.7061 << 0.8455 << 1); + << (RealList() << 0.0000 << 0.1545 << 0.2939 << 0.4045 << 0.4755 << 0.5000 << 0.5245 << 0.5955 << 0.7061 << 0.8455 << 1.0000); QTest::newRow("InExpo") << int(QEasingCurve::InExpo) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.0009531 << 0.002906 << 0.006812 << 0.01462 << 0.03025 << 0.0615 << 0.124 << 0.249 << 0.499 << 1); + << (RealList() << 0.0000 << 0.0010 << 0.0029 << 0.0068 << 0.0146 << 0.0303 << 0.0615 << 0.1240 << 0.2490 << 0.4990 << 1.0000); QTest::newRow("OutExpo") << int(QEasingCurve::OutExpo) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.5005 << 0.7507 << 0.8759 << 0.9384 << 0.9697 << 0.9854 << 0.9932 << 0.9971 << 0.999 << 1); + << (RealList() << 0.0000 << 0.5005 << 0.7507 << 0.8759 << 0.9384 << 0.9697 << 0.9854 << 0.9932 << 0.9971 << 0.9990 << 1.0000); QTest::newRow("InOutExpo") << int(QEasingCurve::InOutExpo) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.001453 << 0.007312 << 0.03075 << 0.1245 << 0.5002 << 0.8754 << 0.9692 << 0.9927 << 0.9985 << 1); + << (RealList() << 0.0000 << 0.0015 << 0.0073 << 0.0308 << 0.1245 << 0.5003 << 0.8754 << 0.9692 << 0.9927 << 0.9985 << 1.0000); QTest::newRow("OutInExpo") << int(QEasingCurve::OutInExpo) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3754 << 0.4692 << 0.4927 << 0.4985 << 0.5 << 0.5015 << 0.5073 << 0.5308 << 0.6245 << 1); + << (RealList() << 0.0000 << 0.3754 << 0.4692 << 0.4927 << 0.4985 << 0.5000 << 0.5015 << 0.5073 << 0.5308 << 0.6245 << 1.0000); QTest::newRow("InCirc") << int(QEasingCurve::InCirc) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.005013 << 0.0202 << 0.04606 << 0.08348 << 0.134 << 0.2 << 0.2859 << 0.4 << 0.5641 << 1); + << (RealList() << 0.0000 << 0.0050 << 0.0202 << 0.0461 << 0.0835 << 0.1340 << 0.2000 << 0.2859 << 0.4000 << 0.5641 << 1.0000); QTest::newRow("OutCirc") << int(QEasingCurve::OutCirc) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.4359 << 0.6 << 0.7141 << 0.8 << 0.866 << 0.9165 << 0.9539 << 0.9798 << 0.995 << 1); + << (RealList() << 0.0000 << 0.4359 << 0.6000 << 0.7141 << 0.8000 << 0.8660 << 0.9165 << 0.9539 << 0.9798 << 0.9950 << 1.0000); QTest::newRow("InOutCirc") << int(QEasingCurve::InOutCirc) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.0101 << 0.04174 << 0.1 << 0.2 << 0.5 << 0.8 << 0.9 << 0.9583 << 0.9899 << 1); + << (RealList() << 0.0000 << 0.0101 << 0.0417 << 0.1000 << 0.2000 << 0.5000 << 0.8000 << 0.9000 << 0.9583 << 0.9899 << 1.0000); QTest::newRow("OutInCirc") << int(QEasingCurve::OutInCirc) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3 << 0.4 << 0.4583 << 0.4899 << 0.5 << 0.5101 << 0.5417 << 0.6 << 0.7 << 1); + << (RealList() << 0.0000 << 0.3000 << 0.4000 << 0.4583 << 0.4899 << 0.5000 << 0.5101 << 0.5417 << 0.6000 << 0.7000 << 1.0000); QTest::newRow("InElastic") << int(QEasingCurve::InElastic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.001953 << -0.001953 << -0.003906 << 0.01562 << -0.01562 << -0.03125 << 0.125 << -0.125 << -0.25 << 1); + << (RealList() << 0.0000 << 0.0020 << -0.0020 << -0.0039 << 0.0156 << -0.0156 << -0.0313 << 0.1250 << -0.1250 << -0.2500 << 1.0000); QTest::newRow("OutElastic") << int(QEasingCurve::OutElastic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 1.25 << 1.125 << 0.875 << 1.031 << 1.016 << 0.9844 << 1.004 << 1.002 << 0.998 << 1); + << (RealList() << 0.0000 << 1.2500 << 1.1250 << 0.8750 << 1.0313 << 1.0156 << 0.9844 << 1.0039 << 1.0020 << 0.9980 << 1.0000); QTest::newRow("InOutElastic") << int(QEasingCurve::InOutElastic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << -0.0009766 << 0.007812 << -0.01563 << -0.0625 << 0.5 << 1.062 << 1.016 << 0.9922 << 1.001 << 1); + << (RealList() << 0.0000 << -0.0010 << 0.0078 << -0.0156 << -0.0625 << 0.5000 << 1.0625 << 1.0156 << 0.9922 << 1.0010 << 1.0000); QTest::newRow("OutInElastic") << int(QEasingCurve::OutInElastic) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.375 << 0.5625 << 0.4922 << 0.498 << 0.5 << 0.4961 << 0.5078 << 0.5313 << 0.25 << 1); + << (RealList() << 0.0000 << 0.3750 << 0.5625 << 0.4922 << 0.4980 << 0.5000 << 0.4961 << 0.5078 << 0.5313 << 0.2500 << 1.0000); QTest::newRow("InBack") << int(QEasingCurve::InBack) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << -0.01431 << -0.04645 << -0.0802 << -0.09935 << -0.0877 << -0.02903 << 0.09287 << 0.2942 << 0.5912 << 1); + << (RealList() << 0.0000 << -0.0143 << -0.0465 << -0.0802 << -0.0994 << -0.0877 << -0.0290 << 0.0929 << 0.2942 << 0.5912 << 1.0000); QTest::newRow("OutBack") << int(QEasingCurve::OutBack) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.4088 << 0.7058 << 0.9071 << 1.029 << 1.088 << 1.099 << 1.08 << 1.046 << 1.014 << 1); + << (RealList() << 0.0000 << 0.4088 << 0.7058 << 0.9071 << 1.0290 << 1.0877 << 1.0994 << 1.0802 << 1.0465 << 1.0143 << 1.0000); QTest::newRow("InOutBack") << int(QEasingCurve::InOutBack) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << -0.03752 << -0.09256 << -0.07883 << 0.08993 << 0.5 << 0.9101 << 1.079 << 1.093 << 1.038 << 1); + << (RealList() << 0.0000 << -0.0375 << -0.0926 << -0.0788 << 0.0899 << 0.5000 << 0.9101 << 1.0788 << 1.0926 << 1.0375 << 1.0000); QTest::newRow("OutInBack") << int(QEasingCurve::OutInBack) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.3529 << 0.5145 << 0.5497 << 0.5232 << 0.5 << 0.4768 << 0.4503 << 0.4855 << 0.6471 << 1); + << (RealList() << 0.0000 << 0.3529 << 0.5145 << 0.5497 << 0.5232 << 0.5000 << 0.4768 << 0.4503 << 0.4855 << 0.6471 << 1.0000); QTest::newRow("InBounce") << int(QEasingCurve::InBounce) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.01188 << 0.06 << 0.06937 << 0.2275 << 0.2344 << 0.09 << 0.3194 << 0.6975 << 0.9244 << 1); + << (RealList() << 0.0000 << 0.0119 << 0.0600 << 0.0694 << 0.2275 << 0.2344 << 0.0900 << 0.3194 << 0.6975 << 0.9244 << 1.0000); QTest::newRow("OutBounce") << int(QEasingCurve::OutBounce) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.07563 << 0.3025 << 0.6806 << 0.91 << 0.7656 << 0.7725 << 0.9306 << 0.94 << 0.9881 << 1); + << (RealList() << 0.0000 << 0.0756 << 0.3025 << 0.6806 << 0.9100 << 0.7656 << 0.7725 << 0.9306 << 0.9400 << 0.9881 << 1.0000); QTest::newRow("InOutBounce") << int(QEasingCurve::InOutBounce) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.03 << 0.1138 << 0.045 << 0.3488 << 0.5 << 0.6512 << 0.955 << 0.8862 << 0.97 << 1); + << (RealList() << 0.0000 << 0.0300 << 0.1138 << 0.0450 << 0.3488 << 0.5000 << 0.6512 << 0.9550 << 0.8863 << 0.9700 << 1.0000); QTest::newRow("OutInBounce") << int(QEasingCurve::OutInBounce) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1513 << 0.41 << 0.2725 << 0.44 << 0.5 << 0.56 << 0.7275 << 0.59 << 0.8488 << 1); + << (RealList() << 0.0000 << 0.1513 << 0.4100 << 0.2725 << 0.4400 << 0.5000 << 0.5600 << 0.7275 << 0.5900 << 0.8488 << 1.0000); QTest::newRow("InCurve") << int(QEasingCurve::InCurve) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.02447 << 0.1059 << 0.2343 << 0.3727 << 0.5 << 0.6055 << 0.7 << 0.8 << 0.9 << 1); + << (RealList() << 0.0000 << 0.0245 << 0.1059 << 0.2343 << 0.3727 << 0.5000 << 0.6055 << 0.7000 << 0.8000 << 0.9000 << 1.0000); QTest::newRow("OutCurve") << int(QEasingCurve::OutCurve) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.1 << 0.2 << 0.3 << 0.3945 << 0.5 << 0.6273 << 0.7657 << 0.8941 << 0.9755 << 1); + << (RealList() << 0.0000 << 0.1000 << 0.2000 << 0.3000 << 0.3945 << 0.5000 << 0.6273 << 0.7657 << 0.8941 << 0.9755 << 1.0000); QTest::newRow("SineCurve") << int(QEasingCurve::SineCurve) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0 << 0.09549 << 0.3455 << 0.6545 << 0.9045 << 1 << 0.9045 << 0.6545 << 0.3455 << 0.09549 << 0); + << (RealList() << 0.0000 << 0.0955 << 0.3455 << 0.6545 << 0.9045 << 1.0000 << 0.9045 << 0.6545 << 0.3455 << 0.0955 << 0.0000); QTest::newRow("CosineCurve") << int(QEasingCurve::CosineCurve) << (IntList() << 0 << 10 << 20 << 30 << 40 << 50 << 60 << 70 << 80 << 90 << 100) - << (RealList() << 0.5 << 0.7939 << 0.9755 << 0.9755 << 0.7939 << 0.5 << 0.2061 << 0.02447 << 0.02447 << 0.2061 << 0.5); + << (RealList() << 0.5000 << 0.7939 << 0.9755 << 0.9755 << 0.7939 << 0.5000 << 0.2061 << 0.0245 << 0.0245 << 0.2061 << 0.5000); } +/* + "fixedpoint" number that is scaled up by 10000. + This is to work around two bugs (precision and rounding error) in QString::setNum(). + It does not trim off trailing zeros. This is good, just to emphasize the precision. +*/ +QString fixedToString(int value) +{ + QString str; + if (value < 0) { + str+= QLatin1Char('-'); + value = -value; + } + + QString digitArg(QLatin1String("%1.")); + for (int i = 10000; i >= 1; i/=10) { + int digit = value/i; + value -= digit*i; + str.append(digitArg.arg(digit)); + digitArg = QLatin1String("%1"); + } + return str; +} void tst_QEasingCurve::valueForProgress() { @@ -390,7 +412,7 @@ void tst_QEasingCurve::valueForProgress() for (int t = 0; t <= 100; t+= 10) { qreal ease = curve.valueForProgress(t/qreal(100)); strInputs += QString::fromAscii(" << %1").arg(t); - strOutputs += " << " + QString().setNum(ease, 'g', 4); + strOutputs += " << " + fixedToString(qRound(ease*10000)); } QString str = QString::fromAscii(" QTest::newRow(\"%1\") << int(QEasingCurve::%2)\n" " << (IntList() %3)\n" @@ -409,26 +431,13 @@ void tst_QEasingCurve::valueForProgress() QFETCH(RealList, expected); QEasingCurve curve((QEasingCurve::Type)type); + // in theory the baseline should't have an error of more than 0.00005 due to how its rounded, + // but due to FP imprecision, we have to adjust the error a bit more. + const qreal errorBound = 0.00006; for (int i = 0; i < at.count(); ++i) { - qreal ease = curve.valueForProgress(at.at(i)/qreal(100)); - // converting ease to 4 precision qreal to match the generated samples - qreal easeConv = qreal(QString().setNum(ease, 'g', 4).toDouble()); - qreal ex = expected.at(i); - - // the least significant digit it is still subject to rounding errors - qreal error = easeConv - ex; - qreal errorbound = 0.00001; -#if defined( Q_OS_WINCE ) || defined( Q_OS_SYMBIAN ) - // exception values for WINCE(this test should be rewritten, as it only freezes the status quo of QEasingCurve - // The failing (2) values are explicitly excepted here: - // The source values for the comparison table should remain untruncated double and the - // error bound checking function dynamic. Also the source values should come from a "trusted" source and not - // from QEasingCurve itself. - if ((type == int(QEasingCurve::InOutBounce) && (i == 8 || i == 6) ) || (type == int(QEasingCurve::OutExpo) && i == 2)) - errorbound = 0.0002; -#endif - // accept the potential rounding error in the least significant digit - QVERIFY(error <= errorbound ); + const qreal ex = expected.at(i); + const qreal error = qAbs(ex - curve.valueForProgress(at.at(i)/qreal(100))); + QVERIFY(error <= errorBound); } #endif } diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index fdc629a..42e7250 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -828,6 +828,17 @@ void tst_QFileInfo::compare_data() QTest::addColumn<QString>("file2"); QTest::addColumn<bool>("same"); +#if defined(Q_OS_MAC) + // Since 10.6 we use realpath() in qfsfileengine, and it properly handles + // file system case sensitivity. However here in the autotest we don't + // check if the file system is case sensitive, so to make it pass in the + // default OS X installation we assume we are running on a case insensitive + // file system if on 10.6 and on a case sensitive file system if on 10.5 + bool caseSensitiveOnMac = true; + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) + caseSensitiveOnMac = false; +#endif + QTest::newRow("data0") << QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp") << QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp") @@ -845,6 +856,8 @@ void tst_QFileInfo::compare_data() << QString::fromLatin1(SRCDIR "tst_qfileinfo.cpp") #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) << true; +#elif defined(Q_OS_MAC) + << !caseSensitiveOnMac; #else << false; #endif @@ -856,7 +869,7 @@ void tst_QFileInfo::compare() QFETCH(QString, file2); QFETCH(bool, same); QFileInfo fi1(file1), fi2(file2); - QCOMPARE(same, fi1 == fi2); + QCOMPARE(fi1 == fi2, same); } void tst_QFileInfo::consistent_data() diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index 287f472..9f67a5e 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -236,6 +236,26 @@ void tst_QFileSystemModel::rootPath() QCOMPARE(model->rootPath(), QString(QDir::homePath())); QCOMPARE(rootChanged.count(), oldRootPath == model->rootPath() ? 0 : 1); QCOMPARE(model->rootDirectory().absolutePath(), QDir::homePath()); + + model->setRootPath(QDir::rootPath()); + int oldCount = rootChanged.count(); + oldRootPath = model->rootPath(); + root = model->setRootPath(QDir::homePath() + QLatin1String("/.")); + QTRY_VERIFY(model->rowCount(root) >= 0); + QCOMPARE(model->rootPath(), QDir::homePath()); + QCOMPARE(rootChanged.count(), oldRootPath == model->rootPath() ? oldCount : oldCount + 1); + QCOMPARE(model->rootDirectory().absolutePath(), QDir::homePath()); + + QDir newdir = QDir::home(); + if (newdir.cdUp()) { + oldCount = rootChanged.count(); + oldRootPath = model->rootPath(); + root = model->setRootPath(QDir::homePath() + QLatin1String("/..")); + QTRY_VERIFY(model->rowCount(root) >= 0); + QCOMPARE(model->rootPath(), newdir.path()); + QCOMPARE(rootChanged.count(), oldCount + 1); + QCOMPARE(model->rootDirectory().absolutePath(), newdir.path()); + } } void tst_QFileSystemModel::naturalCompare_data() diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index d37d727..eeccc9a 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -428,6 +428,26 @@ void tst_QGL::getSetCheck() obj1.setPlane(TEST_INT_MAX); QCOMPARE(TEST_INT_MAX, obj1.plane()); + // int QGLFormat::major/minorVersion() + // void QGLFormat::setVersion(int, int) + QCOMPARE(obj1.majorVersion(), 1); + QCOMPARE(obj1.minorVersion(), 0); + obj1.setVersion(3, 2); + QCOMPARE(obj1.majorVersion(), 3); + QCOMPARE(obj1.minorVersion(), 2); + QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setVersion: Cannot set zero or negative version number 0.1"); + obj1.setVersion(0, 1); + QCOMPARE(obj1.majorVersion(), 3); + QCOMPARE(obj1.minorVersion(), 2); + QTest::ignoreMessage(QtWarningMsg, "QGLFormat::setVersion: Cannot set zero or negative version number 3.-1"); + obj1.setVersion(3, -1); + QCOMPARE(obj1.majorVersion(), 3); + QCOMPARE(obj1.minorVersion(), 2); + obj1.setVersion(TEST_INT_MAX, TEST_INT_MAX - 1); + QCOMPARE(obj1.majorVersion(), TEST_INT_MAX); + QCOMPARE(obj1.minorVersion(), TEST_INT_MAX - 1); + + // operator== and operator!= for QGLFormat QGLFormat format1; QGLFormat format2; @@ -511,6 +531,27 @@ void tst_QGL::getSetCheck() QVERIFY(format1 == format2); QVERIFY(!(format1 != format2)); + format1.setVersion(3, 2); + QVERIFY(!(format1 == format2)); + QVERIFY(format1 != format2); + format2.setVersion(3, 2); + QVERIFY(format1 == format2); + QVERIFY(!(format1 != format2)); + + format1.setProfile(QGLFormat::CoreProfile); + QVERIFY(!(format1 == format2)); + QVERIFY(format1 != format2); + format2.setProfile(QGLFormat::CoreProfile); + QVERIFY(format1 == format2); + QVERIFY(!(format1 != format2)); + + format1.setOption(QGL::NoDeprecatedFunctions); + QVERIFY(!(format1 == format2)); + QVERIFY(format1 != format2); + format2.setOption(QGL::NoDeprecatedFunctions); + QVERIFY(format1 == format2); + QVERIFY(!(format1 != format2)); + // Copy constructor and assignment for QGLFormat. QGLFormat format3(format1); QGLFormat format4; @@ -701,8 +742,6 @@ void tst_QGL::openGLVersionCheck() #if defined(QT_OPENGL_ES_1) QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Common_Version_1_0); -#elif defined(QT_OPENGL_ES_1_CL) - QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_CommonLite_Version_1_0); #elif defined(QT_OPENGL_ES_2) QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0); #else diff --git a/tests/auto/qglbuffer/qglbuffer.pro b/tests/auto/qglbuffer/qglbuffer.pro new file mode 100644 index 0000000..07d05bb --- /dev/null +++ b/tests/auto/qglbuffer/qglbuffer.pro @@ -0,0 +1,9 @@ +############################################################ +# Project file for autotest for file qglbuffer.h +############################################################ + +load(qttest_p4) +requires(contains(QT_CONFIG,opengl)) +QT += opengl + +SOURCES += tst_qglbuffer.cpp diff --git a/tests/auto/qglbuffer/tst_qglbuffer.cpp b/tests/auto/qglbuffer/tst_qglbuffer.cpp new file mode 100644 index 0000000..b7d5821 --- /dev/null +++ b/tests/auto/qglbuffer/tst_qglbuffer.cpp @@ -0,0 +1,261 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtOpenGL module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtTest/QtTest> +#include <QtOpenGL/qgl.h> +#include <QtOpenGL/qglbuffer.h> + +class tst_QGLBuffer : public QObject +{ + Q_OBJECT +public: + tst_QGLBuffer() {} + ~tst_QGLBuffer() {} + +private slots: + void vertexBuffer_data(); + void vertexBuffer(); + void indexBuffer_data(); + void indexBuffer(); + void bufferSharing(); + +private: + void testBuffer(QGLBuffer::Type type); +}; + +void tst_QGLBuffer::vertexBuffer_data() +{ + QTest::addColumn<int>("usagePattern"); + + QTest::newRow("StreamDraw") << int(QGLBuffer::StreamDraw); + QTest::newRow("StaticDraw") << int(QGLBuffer::StaticDraw); + QTest::newRow("DynamicDraw") << int(QGLBuffer::DynamicDraw); +} + +void tst_QGLBuffer::vertexBuffer() +{ + testBuffer(QGLBuffer::VertexBuffer); +} + +void tst_QGLBuffer::indexBuffer_data() +{ + vertexBuffer_data(); +} + +void tst_QGLBuffer::indexBuffer() +{ + testBuffer(QGLBuffer::IndexBuffer); +} + +void tst_QGLBuffer::testBuffer(QGLBuffer::Type type) +{ + QFETCH(int, usagePattern); + + QGLWidget w; + w.makeCurrent(); + + // Create the local object, but not the buffer in the server. + QGLBuffer buffer(type); + QVERIFY(buffer.usagePattern() == QGLBuffer::StaticDraw); + buffer.setUsagePattern(QGLBuffer::UsagePattern(usagePattern)); + + // Check the initial state. + QVERIFY(buffer.type() == type); + QVERIFY(!buffer.isCreated()); + QVERIFY(buffer.bufferId() == 0); + QVERIFY(buffer.usagePattern() == QGLBuffer::UsagePattern(usagePattern)); + QCOMPARE(buffer.size(), -1); + + // Should not be able to bind it yet because it isn't created. + QVERIFY(!buffer.bind()); + + // Create the buffer - if this fails, then assume that the + // GL implementation does not support buffers at all. + if (!buffer.create()) + QSKIP("Buffers are not supported on this platform", SkipAll); + + // Should now have a buffer id. + QVERIFY(buffer.bufferId() != 0); + + // Bind the buffer and upload some data. + QVERIFY(buffer.bind()); + static GLfloat const data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + buffer.allocate(data, sizeof(data)); + + // Check the buffer size. + QCOMPARE(buffer.size(), int(sizeof(data))); + + // Map the buffer and read back its contents. + bool haveMap = false; + GLfloat *mapped = reinterpret_cast<GLfloat *> + (buffer.map(QGLBuffer::ReadOnly)); + if (mapped) { + for (int index = 0; index < 9; ++index) + QCOMPARE(mapped[index], data[index]); + buffer.unmap(); + haveMap = true; + } else { + qWarning("QGLBuffer::map() is not supported on this platform"); + } + + // Read back the buffer contents using read(). + bool haveRead = false; + GLfloat readdata[9]; + if (buffer.read(0, readdata, sizeof(readdata))) { + for (int index = 0; index < 9; ++index) + QCOMPARE(readdata[index], data[index]); + haveRead = true; + } else { + qWarning("QGLBuffer::read() is not supported on this platform"); + } + + // Write some different data to a specific location and check it. + static GLfloat const diffdata[] = {11, 12, 13}; + buffer.write(sizeof(GLfloat) * 3, diffdata, sizeof(diffdata)); + if (haveMap) { + mapped = reinterpret_cast<GLfloat *>(buffer.map(QGLBuffer::ReadOnly)); + QVERIFY(mapped != 0); + for (int index = 0; index < 9; ++index) { + if (index >= 3 && index <= 5) + QCOMPARE(mapped[index], diffdata[index - 3]); + else + QCOMPARE(mapped[index], data[index]); + } + buffer.unmap(); + } + if (haveRead) { + QVERIFY(buffer.read(0, readdata, sizeof(readdata))); + for (int index = 0; index < 9; ++index) { + if (index >= 3 && index <= 5) + QCOMPARE(readdata[index], diffdata[index - 3]); + else + QCOMPARE(readdata[index], data[index]); + } + } + + // Write to the buffer using the return value from map. + if (haveMap) { + mapped = reinterpret_cast<GLfloat *>(buffer.map(QGLBuffer::WriteOnly)); + QVERIFY(mapped != 0); + mapped[6] = 14; + buffer.unmap(); + + mapped = reinterpret_cast<GLfloat *>(buffer.map(QGLBuffer::ReadOnly)); + QVERIFY(mapped != 0); + static GLfloat const diff2data[] = {11, 12, 13, 14}; + for (int index = 0; index < 9; ++index) { + if (index >= 3 && index <= 6) + QCOMPARE(mapped[index], diff2data[index - 3]); + else + QCOMPARE(mapped[index], data[index]); + } + buffer.unmap(); + } + + // Resize the buffer. + buffer.allocate(sizeof(GLfloat) * 20); + QCOMPARE(buffer.size(), int(sizeof(GLfloat) * 20)); + buffer.allocate(0, sizeof(GLfloat) * 32); + QCOMPARE(buffer.size(), int(sizeof(GLfloat) * 32)); + + // Release the buffer. + buffer.release(); +} + +void tst_QGLBuffer::bufferSharing() +{ + QGLWidget *w1 = new QGLWidget(); + w1->makeCurrent(); + + QGLWidget *w2 = new QGLWidget(0, w1); + if (!w2->isSharing()) { + delete w2; + delete w1; + QSKIP("Context sharing is not supported on this platform", SkipSingle); + } + + // Bind the buffer in the first context and write some data to it. + QGLBuffer buffer(QGLBuffer::VertexBuffer); + if (!buffer.create()) + QSKIP("Buffers are not supported on this platform", SkipSingle); + QVERIFY(buffer.isCreated()); + QVERIFY(buffer.bind()); + static GLfloat const data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + buffer.allocate(data, sizeof(data)); + QCOMPARE(buffer.size(), int(sizeof(data))); + buffer.release(); + + // Bind the buffer in the second context and read back the data. + w2->makeCurrent(); + QVERIFY(buffer.bind()); + QCOMPARE(buffer.size(), int(sizeof(data))); + GLfloat readdata[9]; + if (buffer.read(0, readdata, sizeof(readdata))) { + for (int index = 0; index < 9; ++index) + QCOMPARE(readdata[index], data[index]); + } + buffer.release(); + + // Delete the first context. + delete w1; + + // Make the second context current again because deleting the first + // one will call doneCurrent() even though it wasn't current! + w2->makeCurrent(); + + // The buffer should still be valid in the second context. + QVERIFY(buffer.bufferId() != 0); + QVERIFY(buffer.isCreated()); + QVERIFY(buffer.bind()); + QCOMPARE(buffer.size(), int(sizeof(data))); + buffer.release(); + + // Delete the second context. + delete w2; + + // The buffer should now be invalid. + QVERIFY(buffer.bufferId() == 0); + QVERIFY(!buffer.isCreated()); +} + +QTEST_MAIN(tst_QGLBuffer) + +#include "tst_qglbuffer.moc" diff --git a/tests/auto/qgraphicsitem/nestedClipping_reference.png b/tests/auto/qgraphicsitem/nestedClipping_reference.png Binary files differdeleted file mode 100644 index 3bd4fe7..0000000 --- a/tests/auto/qgraphicsitem/nestedClipping_reference.png +++ /dev/null diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp index 00bf144..6941d23 100644 --- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp +++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp @@ -163,6 +163,7 @@ private slots: void addChildInpolishEvent(); void polishEvent(); void polishEvent2(); + void autoFillBackground(); void initialShow(); void initialShow2(); @@ -2858,6 +2859,32 @@ void tst_QGraphicsWidget::polishEvent2() QVERIFY(widget->events.contains(QEvent::Polish)); } +void tst_QGraphicsWidget::autoFillBackground() +{ + QGraphicsWidget *widget = new QGraphicsWidget; + QCOMPARE(widget->autoFillBackground(), false); + widget->setAutoFillBackground(true); + QCOMPARE(widget->autoFillBackground(), true); + + const QColor color(Qt::red); + const QRect rect(0, 0, 1, 1); + + QGraphicsScene scene; + scene.addItem(widget); + widget->setGeometry(rect); + + QPalette palette = widget->palette(); + palette.setColor(QPalette::Window, color); + widget->setPalette(palette); + + QImage image(rect.size(), QImage::Format_RGB32); + QPainter painter; + painter.begin(&image); + scene.render(&painter, rect, rect); + painter.end(); + QCOMPARE(image.pixel(0, 0), color.rgb()); +} + void tst_QGraphicsWidget::initialShow() { class MyGraphicsWidget : public QGraphicsWidget diff --git a/tests/auto/qheaderview/tst_qheaderview.cpp b/tests/auto/qheaderview/tst_qheaderview.cpp index 857e7e3..4642830 100644 --- a/tests/auto/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/qheaderview/tst_qheaderview.cpp @@ -44,6 +44,7 @@ #include <QStandardItemModel> #include <QStringListModel> #include <QSortFilterProxyModel> +#include <QTableView> #include <qabstractitemmodel.h> #include <qapplication.h> @@ -190,6 +191,7 @@ private slots: void task236450_hidden(); void task248050_hideRow(); void QTBUG6058_reset(); + void QTBUG7833_sectionClicked(); protected: QHeaderView *view; @@ -1992,6 +1994,68 @@ void tst_QHeaderView::QTBUG6058_reset() QCOMPARE(checkHeaderViewOrder(&view, QVector<int>() << 2 << 0 << 1 << 3 << 4 << 5 ) , 0); } +void tst_QHeaderView::QTBUG7833_sectionClicked() +{ + + + + + QTableView tv; + QStandardItemModel *sim = new QStandardItemModel(&tv); + QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(&tv); + proxyModel->setSourceModel(sim); + proxyModel->setDynamicSortFilter(true); + proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); + + QList<QStandardItem *> row; + for (int i = 0; i < 12; i++) + row.append(new QStandardItem(QString(QLatin1Char('A' + i)))); + sim->appendRow(row); + row.clear(); + for (int i = 12; i > 0; i--) + row.append(new QStandardItem(QString(QLatin1Char('A' + i)))); + sim->appendRow(row); + + tv.setSortingEnabled(true); + tv.horizontalHeader()->setSortIndicatorShown(true); + tv.horizontalHeader()->setClickable(true); + tv.horizontalHeader()->setStretchLastSection(true); + tv.horizontalHeader()->setResizeMode(QHeaderView::Interactive); + + tv.setModel(proxyModel); + tv.setColumnHidden(5, true); + tv.setColumnHidden(6, true); + tv.horizontalHeader()->swapSections(8, 10); + tv.sortByColumn(1, Qt::AscendingOrder); + + QSignalSpy clickedSpy(tv.horizontalHeader(), SIGNAL(sectionClicked(int))); + QSignalSpy pressedSpy(tv.horizontalHeader(), SIGNAL(sectionPressed(int))); + + + QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, + QPoint(tv.horizontalHeader()->sectionViewportPosition(11) + 5, 5)); + QCOMPARE(clickedSpy.count(), 1); + QCOMPARE(pressedSpy.count(), 1); + QCOMPARE(clickedSpy.at(0).at(0).toInt(), 11); + QCOMPARE(pressedSpy.at(0).at(0).toInt(), 11); + + QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, + QPoint(tv.horizontalHeader()->sectionViewportPosition(8) + 5, 5)); + + QCOMPARE(clickedSpy.count(), 2); + QCOMPARE(pressedSpy.count(), 2); + QCOMPARE(clickedSpy.at(1).at(0).toInt(), 8); + QCOMPARE(pressedSpy.at(1).at(0).toInt(), 8); + + QTest::mouseClick(tv.horizontalHeader()->viewport(), Qt::LeftButton, Qt::NoModifier, + QPoint(tv.horizontalHeader()->sectionViewportPosition(0) + 5, 5)); + + QCOMPARE(clickedSpy.count(), 3); + QCOMPARE(pressedSpy.count(), 3); + QCOMPARE(clickedSpy.at(2).at(0).toInt(), 0); + QCOMPARE(pressedSpy.at(2).at(0).toInt(), 0); +} + QTEST_MAIN(tst_QHeaderView) #include "tst_qheaderview.moc" diff --git a/tests/auto/qhttp/tst_qhttp.cpp b/tests/auto/qhttp/tst_qhttp.cpp index 59bfb15..320225d 100644 --- a/tests/auto/qhttp/tst_qhttp.cpp +++ b/tests/auto/qhttp/tst_qhttp.cpp @@ -114,9 +114,6 @@ private slots: void abortInReadyRead(); void abortInResponseHeaderReceived(); void nestedEventLoop(); - - - // manual tests void connectionClose(); protected slots: @@ -175,6 +172,23 @@ private: bool proxyAuthCalled; }; +class ClosingServer: public QTcpServer +{ + Q_OBJECT +public: + ClosingServer() + { + connect(this, SIGNAL(newConnection()), SLOT(handleConnection())); + listen(); + } + +public slots: + void handleConnection() + { + delete nextPendingConnection(); + } +}; + //#define DUMP_SIGNALS const int bytesTotal_init = -10; @@ -1491,20 +1505,14 @@ void tst_QHttp::abortInResponseHeaderReceived() void tst_QHttp::connectionClose() { - // This test tries to connect to a client's server, so it is disabled. - // Every now and then, someone please run it to make sure it's not broken. - // Note: the servers might change too... - // // This was added in response to bug 176822 -#ifndef Q_OS_SYMBIAN - QSKIP("This test is manual - read comments in the source code", SkipAll); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; QHttp http; - http.setHost("www.fon.com", QHttp::ConnectionModeHttps); + ClosingServer server; + http.setHost("localhost", QHttp::ConnectionModeHttps, server.serverPort()); http.get("/login/gateway/processLogin"); // another possibility: diff --git a/tests/auto/qintvalidator/tst_qintvalidator.cpp b/tests/auto/qintvalidator/tst_qintvalidator.cpp index 72e7f7a..46ad0dd 100644 --- a/tests/auto/qintvalidator/tst_qintvalidator.cpp +++ b/tests/auto/qintvalidator/tst_qintvalidator.cpp @@ -50,6 +50,7 @@ private slots: void validate_data(); void validate(); void validateArabic(); + void validateFrench(); }; Q_DECLARE_METATYPE(QValidator::State); @@ -182,6 +183,30 @@ void tst_QIntValidator::validateArabic() } + +void tst_QIntValidator::validateFrench() +{ + QIntValidator validator(-2000, 2000, 0); + validator.setLocale(QLocale::French); + int i; + + QString s = QLatin1String("1 "); + QCOMPARE(validator.validate(s, i), QValidator::Acceptable); + validator.fixup(s); + QCOMPARE(s, s); + + s = QLatin1String("1 000"); + QCOMPARE(validator.validate(s, i), QValidator::Acceptable); + validator.fixup(s); + QCOMPARE(s, s); + + + s = QLatin1String("1 0 00"); + QCOMPARE(validator.validate(s, i), QValidator::Intermediate); + validator.fixup(s); + QCOMPARE(s, validator.locale().toString(1000)); +} + void tst_QIntValidator::validate() { QFETCH(int, minimum); @@ -190,6 +215,7 @@ void tst_QIntValidator::validate() QFETCH(QValidator::State, state); QIntValidator iv(minimum, maximum, 0); + iv.setLocale(QLocale::C); int dummy; QCOMPARE((int)iv.validate(value, dummy), (int)state); } diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp index 3e3f202..b1ef223 100644 --- a/tests/auto/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp @@ -119,6 +119,7 @@ private slots: void symetricConstructors_data(); void symetricConstructors(); void checkMultipleNames(); + void checkMultipleCodes(); void mnemonic_data(); void mnemonic(); void toString_data(); @@ -265,6 +266,18 @@ void tst_QKeySequence::checkMultipleNames() QVERIFY( oldK == newK ); } +//TODO: could test third constructor, or test fromString on all constructor-data +void tst_QKeySequence::checkMultipleCodes() +{ + QKeySequence seq1("Alt+d, l"); + QKeySequence seq2 = QKeySequence::fromString("Alt+d, l"); + QVERIFY( seq1 == seq2 ); + + QKeySequence seq3("Alt+d,l"); + QKeySequence seq4 = QKeySequence::fromString("Alt+d,l"); + QVERIFY( seq3 == seq4 ); +} + /* * We must ensure that the keyBindings data is allways sorted * so that we can safely perform binary searches. diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp index c3af495..7099917 100644 --- a/tests/auto/qlabel/tst_qlabel.cpp +++ b/tests/auto/qlabel/tst_qlabel.cpp @@ -119,6 +119,7 @@ private slots: void mnemonic_data(); void mnemonic(); + void selection(); private: QLabel *testWidget; @@ -559,6 +560,27 @@ void tst_QLabel::mnemonic() QCOMPARE(d->shortcutCursor.selectedText(), expectedShortcutCursor); } +void tst_QLabel::selection() +{ + QLabel label; + label.setText("Hello world"); + + label.setTextInteractionFlags(Qt::TextSelectableByMouse); + + QVERIFY(!label.hasSelectedText()); + QCOMPARE(label.selectedText(), QString()); + QCOMPARE(label.selectionStart(), -1); + + label.setSelection(0, 4); + QVERIFY(label.hasSelectedText()); + QCOMPARE(label.selectedText(), QString::fromLatin1("Hell")); + QCOMPARE(label.selectionStart(), 0); + + label.setSelection(6, 5); + QVERIFY(label.hasSelectedText()); + QCOMPARE(label.selectedText(), QString::fromLatin1("world")); + QCOMPARE(label.selectionStart(), 6); +} QTEST_MAIN(tst_QLabel) #include "tst_qlabel.moc" diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index 9dc18e0..3559b15 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -104,6 +104,7 @@ private slots: void setFixedWidth(); void deleteActionInTriggered(); void pushButtonPopulateOnAboutToShow(); + void QTBUG7907_submenus_autoselect(); protected slots: void onActivated(QAction*); void onHighlighted(QAction*); @@ -930,6 +931,22 @@ void tst_QMenu::pushButtonPopulateOnAboutToShow() QVERIFY(!lastMenu->geometry().intersects(b.geometry())); } +void tst_QMenu::QTBUG7907_submenus_autoselect() +{ + QMenu menu("Test Menu"); + QMenu set1("Setting1"); + QMenu set2("Setting2"); + QMenu subset("Subsetting"); + subset.addAction("Values"); + set1.addMenu(&subset); + menu.addMenu(&set1); + menu.addMenu(&set2); + menu.show(); + QTest::qWaitForWindowShown(&menu); + QTest::mouseClick(&menu, Qt::LeftButton, Qt::NoModifier, QPoint(5,5) ); + QTest::qWait(500); + QVERIFY(!subset.isVisible()); +} QTEST_MAIN(tst_QMenu) diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp index 286e793..15b6204 100644 --- a/tests/auto/qmetaobject/tst_qmetaobject.cpp +++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp @@ -664,7 +664,7 @@ void tst_QMetaObject::normalizedSignature_data() QTest::newRow("const rettype") << "const QString *foo()" << "const QString*foo()"; QTest::newRow("const ref") << "const QString &foo()" << "const QString&foo()"; QTest::newRow("reference") << "QString &foo()" << "QString&foo()"; - QTest::newRow("const2") << "void foo(QString const *)" << "void foo(const QString*)"; + QTest::newRow("const1") << "void foo(QString const *)" << "void foo(const QString*)"; QTest::newRow("const2") << "void foo(QString * const)" << "void foo(QString*const)"; QTest::newRow("const3") << "void foo(QString const &)" << "void foo(QString)"; QTest::newRow("const4") << "void foo(const int)" << "void foo(int)"; @@ -672,7 +672,7 @@ void tst_QMetaObject::normalizedSignature_data() << "void foo(int,int,int,int)"; QTest::newRow("const6") << "void foo(QList<const int>)" << "void foo(QList<const int>)"; QTest::newRow("const7") << "void foo(QList<const int*>)" << "void foo(QList<const int*>)"; - QTest::newRow("const7") << "void foo(QList<int const*>)" << "void foo(QList<const int*>)"; + QTest::newRow("const8") << "void foo(QList<int const*>)" << "void foo(QList<const int*>)"; } void tst_QMetaObject::normalizedSignature() diff --git a/tests/auto/qobject/moc_oldnormalizeobject.cpp b/tests/auto/qobject/moc_oldnormalizeobject.cpp new file mode 100644 index 0000000..bde9c39 --- /dev/null +++ b/tests/auto/qobject/moc_oldnormalizeobject.cpp @@ -0,0 +1,113 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'oldnormalizeobject.h' +** +** Created: Wed Nov 18 11:43:05 2009 +** by: The Qt Meta Object Compiler version 62 (Qt 4.6.0) +** +*****************************************************************************/ + +// Yhis file was generated from moc version 4.6 to test binary compatibility +// It should *not* be generated by the current moc + +#include "oldnormalizeobject.h" + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_OldNormalizeObject[] = { + + // content: + 4, // revision + 0, // classname + 0, 0, // classinfo + 6, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 3, // signalCount + + // signals: signature, parameters, type, tag, flags + 24, 20, 19, 19, 0x05, + 57, 20, 19, 19, 0x05, + 100, 20, 19, 19, 0x05, + + // slots: signature, parameters, type, tag, flags + 149, 20, 19, 19, 0x0a, + 180, 20, 19, 19, 0x0a, + 221, 20, 19, 19, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_OldNormalizeObject[] = { + "OldNormalizeObject\0\0ref\0" + "typeRefSignal(Template<Class&>&)\0" + "constTypeRefSignal(Template<const Class&>)\0" + "typeConstRefSignal(Template<const Class&>const&)\0" + "typeRefSlot(Template<Class&>&)\0" + "constTypeRefSlot(Template<const Class&>)\0" + "typeConstRefSlot(Template<const Class&>const&)\0" +}; + +const QMetaObject OldNormalizeObject::staticMetaObject = { + { &QObject::staticMetaObject, qt_meta_stringdata_OldNormalizeObject, + qt_meta_data_OldNormalizeObject, 0 } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &OldNormalizeObject::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *OldNormalizeObject::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *OldNormalizeObject::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_OldNormalizeObject)) + return static_cast<void*>(const_cast< OldNormalizeObject*>(this)); + return QObject::qt_metacast(_clname); +} + +int OldNormalizeObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QObject::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + switch (_id) { + case 0: typeRefSignal((*reinterpret_cast< Template<Class&>(*)>(_a[1]))); break; + case 1: constTypeRefSignal((*reinterpret_cast< const Template<const Class&>(*)>(_a[1]))); break; + case 2: typeConstRefSignal((*reinterpret_cast< Template<const Class&>const(*)>(_a[1]))); break; + case 3: typeRefSlot((*reinterpret_cast< Template<Class&>(*)>(_a[1]))); break; + case 4: constTypeRefSlot((*reinterpret_cast< const Template<const Class&>(*)>(_a[1]))); break; + case 5: typeConstRefSlot((*reinterpret_cast< Template<const Class&>const(*)>(_a[1]))); break; + default: ; + } + _id -= 6; + } + return _id; +} + +// SIGNAL 0 +void OldNormalizeObject::typeRefSignal(Template<Class&> & _t1) +{ + void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void OldNormalizeObject::constTypeRefSignal(const Template<const Class&> & _t1) +{ + void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 1, _a); +} + +// SIGNAL 2 +void OldNormalizeObject::typeConstRefSignal(Template<Class const&> const & _t1) +{ + void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 2, _a); +} +QT_END_MOC_NAMESPACE diff --git a/examples/assistant/simpletextviewer/mainwindow.h b/tests/auto/qobject/oldnormalizeobject.h index 14f0679..3adf04d 100644 --- a/examples/assistant/simpletextviewer/mainwindow.h +++ b/tests/auto/qobject/oldnormalizeobject.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the examples of the Qt Toolkit. +** This file is part of the QtTest module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,53 +39,31 @@ ** ****************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#ifndef OLDNORMALIZEOBJECT_H +#define OLDNORMALIZEOBJECT_H -#include <QAssistantClient> -#include <QMainWindow> -#include <QTextEdit> +#include <QObject> -class MainWindow : public QMainWindow +struct Struct; +class Class; +template <typename T> class Template; + +// An object with old moc output that incorrectly normalizes 'T<C> const &' in the function +// signatures +class OldNormalizeObject : public QObject { + /* tmake ignore Q_OBJECT */ Q_OBJECT -public: - MainWindow(); - -private slots: - void about(); -//! [0] - void assistant(); -//! [0] - void open(); - -protected: -//! [1] - void closeEvent(QCloseEvent *event); -//! [1] - -private: - void createActions(); - void createMenus(); -//! [2] - void initializeAssistant(); -//! [2] - -//! [3] - QAssistantClient *assistantClient; -//! [3] - QTextEdit *textViewer; - - QMenu *fileMenu; - QMenu *helpMenu; +signals: + void typeRefSignal(Template<Class &> &ref); + void constTypeRefSignal(const Template<const Class &> &ref); + void typeConstRefSignal(Template<Class const &> const &ref); - QAction *assistantAct; - QAction *clearAct; - QAction *openAct; - QAction *exitAct; - QAction *aboutAct; - QAction *aboutQtAct; +public slots: + void typeRefSlot(Template<Class &> &) {} + void constTypeRefSlot(const Template<const Class &> &) {} + void typeConstRefSlot(Template<Class const &> const &) {} }; -#endif +#endif // OLDNORMALIZEOBJECT_H diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 4fa6aaa..3896d70 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -2024,6 +2024,7 @@ enum Enum { }; struct Struct { }; class Class { }; +template <typename T> class Template { }; class NormalizeObject : public QObject { @@ -2061,6 +2062,12 @@ signals: void unsignedshortSignal(unsigned short); void unsignedcharSignal(unsigned char); + void typeRefSignal(Template<Class &> &ref); + void constTypeRefSignal(const Template<Class const &> &ref); + void typeConstRefSignal(Template<Class const &> const &ref); + + void typePointerConstRefSignal(Class * const &); + public slots: void uintPointerSlot(uint *) { } void ulongPointerSlot(ulong *) { } @@ -2092,8 +2099,15 @@ public slots: void unsignedshortSlot(unsigned short) {}; void unsignedcharSlot(unsigned char) {}; + void typeRefSlot(Template<Class &> &) {} + void constTypeRefSlot(const Template<const Class &> &) {} + void typeConstRefSlot(Template<Class const &> const &) {} + + void typePointerConstRefSlot(Class * const &) {} }; +#include "oldnormalizeobject.h" + void tst_QObject::normalize() { NormalizeObject object; @@ -2333,7 +2347,165 @@ void tst_QObject::normalize() SIGNAL(unsignedcharSignal(unsigned char)), SLOT(unsignedcharSlot(unsigned char)))); + // connect when original template signature and mixed usage of 'T<C const &> const &', + // 'const T<const C &> &', and 'T<const C &>' + + QVERIFY(object.connect(&object, + SIGNAL(typeRefSignal(Template<Class &> &)), + SLOT(typeRefSlot(Template<Class &> &)))); + + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(const Template<const Class &> &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(const Template<Class const &> &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(Template<const Class &> const &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(Template<Class const &> const &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(const Template<const Class &> &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(const Template<Class const &> &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(Template<const Class &> const &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(constTypeRefSignal(Template<Class const &> const &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(const Template<const Class &> &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(const Template<Class const &> &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(Template<const Class &> const &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(Template<Class const &> const &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(const Template<const Class &> &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(const Template<Class const &> &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(Template<const Class &> const &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + QVERIFY(object.connect(&object, + SIGNAL(typeConstRefSignal(Template<Class const &> const &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + + // same test again, this time with an object compiled with old moc output... we know that + // it is not possible to connect everything, whic is the purpose for this test + OldNormalizeObject oldobject; + + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(const Template<const Class &> &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(const Template<Class const &> &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(Template<const Class &> const &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(Template<Class const &> const &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + + // these fail in older Qt versions, but pass now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(const Template<const Class &> &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(const Template<Class const &> &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(Template<const Class &> const &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(constTypeRefSignal(Template<Class const &> const &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + + // these also fail in older Qt versions, but pass now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(const Template<const Class &> &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(const Template<Class const &> &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(Template<const Class &> const &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(Template<Class const &> const &)), + SLOT(constTypeRefSlot(Template<Class const &> const &)))); + + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(const Template<const Class &> &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(const Template<Class const &> &)))); + // this fails in older versions, but passes now due to proper normalizing + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(const Template<const Class &> &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(Template<const Class &> const &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + QVERIFY(oldobject.connect(&oldobject, + SIGNAL(typeConstRefSignal(Template<Class const &> const &)), + SLOT(typeConstRefSlot(Template<Class const &> const &)))); + + QVERIFY(object.connect(&object, + SIGNAL(typePointerConstRefSignal(Class*const&)), + SLOT(typePointerConstRefSlot(Class*const&)))); + QVERIFY(object.connect(&object, + SIGNAL(typePointerConstRefSignal(Class*const&)), + SLOT(typePointerConstRefSlot(Class*)))); + QVERIFY(object.connect(&object, + SIGNAL(typePointerConstRefSignal(Class*)), + SLOT(typePointerConstRefSlot(Class*const&)))); + QVERIFY(object.connect(&object, + SIGNAL(typePointerConstRefSignal(Class*)), + SLOT(typePointerConstRefSlot(Class*)))); } class SiblingDeleter : public QObject diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro index 003ee98..0200f3e 100644 --- a/tests/auto/qobject/tst_qobject.pro +++ b/tests/auto/qobject/tst_qobject.pro @@ -1,16 +1,20 @@ load(qttest_p4) -SOURCES += tst_qobject.cpp +SOURCES += tst_qobject.cpp -QT = core network gui -contains(QT_CONFIG, qt3support):DEFINES+=QT_HAS_QT3SUPPORT +# this is here for a reason, moc_oldnormalizedobject.cpp is not auto-generated, it was generated by +# moc from Qt 4.6, and should *not* be generated by the current moc +SOURCES += moc_oldnormalizeobject.cpp -wince*: { - addFiles.sources = signalbug.exe - addFiles.path = . - DEPLOYMENT += addFiles +QT = core \ + network \ + gui +contains(QT_CONFIG, qt3support):DEFINES += QT_HAS_QT3SUPPORT +wince*: { + addFiles.sources = signalbug.exe + addFiles.path = . + DEPLOYMENT += addFiles } - -symbian: { +symbian: { addFiles.sources = signalbug.exe addFiles.path = \sys\bin DEPLOYMENT += addFiles diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index d7c6ad3..49b1e52 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -47,6 +47,7 @@ #include <qmatrix.h> #include <qdesktopwidget.h> #include <qpaintengine.h> +#include <qtreewidget.h> #include <qsplashscreen.h> #include <private/qpixmapdata_p.h> @@ -797,14 +798,32 @@ void tst_QPixmap::drawBitmap() void tst_QPixmap::grabWidget() { QWidget widget; - widget.setPalette(Qt::green); - widget.resize(128, 128); + QImage image(128, 128, QImage::Format_ARGB32_Premultiplied); + for (int row = 0; row < image.height(); ++row) { + QRgb *line = reinterpret_cast<QRgb *>(image.scanLine(row)); + for (int col = 0; col < image.width(); ++col) + line[col] = qRgb(rand() & 255, row, col); + } - QPixmap expected(64, 64); - expected.fill(Qt::green); + QPalette pal = widget.palette(); + pal.setBrush(QPalette::Window, QBrush(image)); + widget.setPalette(pal); + widget.resize(128, 128); + QPixmap expected = QPixmap::fromImage(QImage(image.scanLine(64) + 64 * 4, 64, 64, image.bytesPerLine(), image.format())); QPixmap actual = QPixmap::grabWidget(&widget, QRect(64, 64, 64, 64)); QVERIFY(lenientCompare(actual, expected)); + + actual = QPixmap::grabWidget(&widget, 64, 64); + QVERIFY(lenientCompare(actual, expected)); + + // Make sure a widget that is not yet shown is grabbed correctly. + QTreeWidget widget2; + actual = QPixmap::grabWidget(&widget2); + widget2.show(); + expected = QPixmap::grabWidget(&widget2); + + QVERIFY(lenientCompare(actual, expected)); } void tst_QPixmap::grabWindow() diff --git a/tests/auto/qsharedpointer/externaltests.cpp b/tests/auto/qsharedpointer/externaltests.cpp index eb2f27d..7eae3c1 100644 --- a/tests/auto/qsharedpointer/externaltests.cpp +++ b/tests/auto/qsharedpointer/externaltests.cpp @@ -671,14 +671,9 @@ namespace QTest { make.setProcessChannelMode(channelMode); -#if defined(Q_OS_WIN) && !defined(Q_CC_MINGW) - make.start(QLatin1String("nmake.exe"), args); - make.waitForStarted(); -#else static const char makes[] = -# ifdef Q_CC_MINGW - "mingw32-make.exe\0" -# endif + "nmake.exe\0" //for visual c++ + "mingw32-make.exe\0" //for mingw "gmake\0" "make\0"; for (const char *p = makes; *p; p += strlen(p) + 1) { @@ -686,7 +681,6 @@ namespace QTest { if (make.waitForStarted()) break; } -#endif if (make.state() != QProcess::Running) { exitCode = 255; diff --git a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp index 8abf3c0..5b2b0cf 100644 --- a/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp @@ -136,6 +136,7 @@ private slots: void task252507_mapFromToSource(); void task255652_removeRowsRecursive(); void taskQTBUG_6205_doubleProxySelectionSetSourceModel(); + void taskQTBUG_7537_appearsAndSort(); protected: void buildHierarchy(const QStringList &data, QAbstractItemModel *model); @@ -2852,5 +2853,73 @@ void tst_QSortFilterProxyModel::taskQTBUG_6205_doubleProxySelectionSetSourceMode QVERIFY(ism.selection().isEmpty()); } +void tst_QSortFilterProxyModel::taskQTBUG_7537_appearsAndSort() +{ + class PModel : public QSortFilterProxyModel + { + public: + PModel() : mVisible(false) {}; + protected: + bool filterAcceptsRow(int, const QModelIndex &) const + { + return mVisible; + } + + public: + void updateXX() + { + mVisible = true; + invalidate(); + } + private: + bool mVisible; + } proxyModel; + + + QStringListModel sourceModel; + QStringList list; + list << "b" << "a" << "c"; + sourceModel.setStringList(list); + + proxyModel.setSourceModel(&sourceModel); + proxyModel.setDynamicSortFilter(true); + proxyModel.sort(0, Qt::AscendingOrder); + + QApplication::processEvents(); + QCOMPARE(sourceModel.rowCount(), 3); + QCOMPARE(proxyModel.rowCount(), 0); //all rows are hidden at first; + + QSignalSpy spyAbout1(&proxyModel, SIGNAL(layoutAboutToBeChanged())); + QSignalSpy spyChanged1(&proxyModel, SIGNAL(layoutChanged())); + + //introducing secondProxyModel to test the layoutChange when many items appears at once + QSortFilterProxyModel secondProxyModel; + secondProxyModel.setSourceModel(&proxyModel); + secondProxyModel.setDynamicSortFilter(true); + secondProxyModel.sort(0, Qt::DescendingOrder); + QCOMPARE(secondProxyModel.rowCount(), 0); //all rows are hidden at first; + QSignalSpy spyAbout2(&secondProxyModel, SIGNAL(layoutAboutToBeChanged())); + QSignalSpy spyChanged2(&secondProxyModel, SIGNAL(layoutChanged())); + + proxyModel.updateXX(); + QApplication::processEvents(); + //now rows should be visible, and sorted + QCOMPARE(proxyModel.rowCount(), 3); + QCOMPARE(proxyModel.data(proxyModel.index(0,0), Qt::DisplayRole).toString(), QString::fromLatin1("a")); + QCOMPARE(proxyModel.data(proxyModel.index(1,0), Qt::DisplayRole).toString(), QString::fromLatin1("b")); + QCOMPARE(proxyModel.data(proxyModel.index(2,0), Qt::DisplayRole).toString(), QString::fromLatin1("c")); + + //now rows should be visible, and sorted + QCOMPARE(secondProxyModel.rowCount(), 3); + QCOMPARE(secondProxyModel.data(secondProxyModel.index(0,0), Qt::DisplayRole).toString(), QString::fromLatin1("c")); + QCOMPARE(secondProxyModel.data(secondProxyModel.index(1,0), Qt::DisplayRole).toString(), QString::fromLatin1("b")); + QCOMPARE(secondProxyModel.data(secondProxyModel.index(2,0), Qt::DisplayRole).toString(), QString::fromLatin1("a")); + + QCOMPARE(spyAbout1.count(), 1); + QCOMPARE(spyChanged1.count(), 1); + QCOMPARE(spyAbout2.count(), 1); + QCOMPARE(spyChanged2.count(), 1); +} + QTEST_MAIN(tst_QSortFilterProxyModel) #include "tst_qsortfilterproxymodel.moc" diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp index d980efa..72f9dd3 100644 --- a/tests/auto/qtabbar/tst_qtabbar.cpp +++ b/tests/auto/qtabbar/tst_qtabbar.cpp @@ -273,6 +273,9 @@ void tst_QTabBar::setElideMode() if (tabElideMode != -128) tabBar.setElideMode(Qt::TextElideMode(tabElideMode)); QTEST(int(tabBar.elideMode()), "expectedMode"); + // Make sure style sheet does not override user set mode + tabBar.setStyleSheet("QWidget { background-color: #ABA8A6;}"); + QTEST(int(tabBar.elideMode()), "expectedMode"); } void tst_QTabBar::setUsesScrollButtons_data() diff --git a/tests/auto/qtoolbar/tst_qtoolbar.cpp b/tests/auto/qtoolbar/tst_qtoolbar.cpp index e00597d..07e81c1 100644 --- a/tests/auto/qtoolbar/tst_qtoolbar.cpp +++ b/tests/auto/qtoolbar/tst_qtoolbar.cpp @@ -102,6 +102,7 @@ private slots: void orientationChanged(); void iconSizeChanged(); void toolButtonStyleChanged(); + void visibilityChanged(); void actionOwnership(); void widgetAction(); void accel(); @@ -998,6 +999,36 @@ void tst_QToolBar::iconSizeChanged() void tst_QToolBar::toolButtonStyleChanged() { DEPENDS_ON("toolButtonStyle()"); } +void tst_QToolBar::visibilityChanged() +{ + QMainWindow mw; + QToolBar tb; + QSignalSpy spy(&tb, SIGNAL(visibilityChanged(bool))); + + mw.addToolBar(&tb); + mw.show(); + + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), true); + spy.clear(); + + tb.hide(); + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), false); + spy.clear(); + + tb.hide(); + QCOMPARE(spy.count(), 0); + + tb.show(); + QCOMPARE(spy.count(), 1); + QCOMPARE(spy.at(0).at(0).toBool(), true); + spy.clear(); + + tb.show(); + QCOMPARE(spy.count(), 0); +} + void tst_QToolBar::actionOwnership() { { diff --git a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp index e38a2bc..0e57306 100644 --- a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp +++ b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp @@ -580,7 +580,7 @@ void tst_QXmlSimpleReader::inputFromSocket() QSKIP("Symbian: Skipped due to problems in Open C and QtNetwork", SkipAll); #endif -#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MINGW) || defined(Q_CC_MSVC_NET)) +#if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MSVC_NET)) QSKIP("Regression caused by QHOstInfo change 294548, see task 202231.", SkipAll); #endif QTcpSocket sock; diff --git a/tests/auto/selftests/expected_benchlibcallgrind.txt b/tests/auto/selftests/expected_benchlibcallgrind.txt index caf2424..f172711 100644 --- a/tests/auto/selftests/expected_benchlibcallgrind.txt +++ b/tests/auto/selftests/expected_benchlibcallgrind.txt @@ -2,7 +2,7 @@ Config: Using QTest library 4.5.0, Qt 4.5.0 PASS : tst_BenchlibCallgrind::initTestCase() RESULT : tst_BenchlibCallgrind::twoHundredMillionInstructions(): - 200,000,000 instr. loads per iteration (total: 200000000, iterations: 1) + 200,000,000 instruction reads per iteration (total: 200000000, iterations: 1) PASS : tst_BenchlibCallgrind::twoHundredMillionInstructions() PASS : tst_BenchlibCallgrind::cleanupTestCase() Totals: 3 passed, 0 failed, 0 skipped diff --git a/tests/auto/selftests/expected_cmptest.txt b/tests/auto/selftests/expected_cmptest.txt index 1b65adf..e9f94c9 100644 --- a/tests/auto/selftests/expected_cmptest.txt +++ b/tests/auto/selftests/expected_cmptest.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Cmptest ********* -Config: Using QTest library 4.6.2, Qt 4.6.2 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : tst_Cmptest::initTestCase() PASS : tst_Cmptest::compare_boolfuncs() PASS : tst_Cmptest::compare_pointerfuncs() diff --git a/tests/auto/selftests/expected_crashes_3.txt b/tests/auto/selftests/expected_crashes_3.txt index aabe83d..3aced25 100644 --- a/tests/auto/selftests/expected_crashes_3.txt +++ b/tests/auto/selftests/expected_crashes_3.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Crashes ********* -Config: Using QTest library 4.6.2, Qt 4.6.2 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : tst_Crashes::initTestCase() QFATAL : tst_Crashes::crash() Received signal 11 FAIL! : tst_Crashes::crash() Received a fatal error. diff --git a/tests/auto/selftests/expected_longstring.txt b/tests/auto/selftests/expected_longstring.txt index 3fe237a..a6ad5d0 100644 --- a/tests/auto/selftests/expected_longstring.txt +++ b/tests/auto/selftests/expected_longstring.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_LongString ********* -Config: Using QTest library 4.6.2, Qt 4.6.2 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : tst_LongString::initTestCase() FAIL! : tst_LongString::failWithLongString() Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. diff --git a/tests/auto/selftests/expected_maxwarnings.txt b/tests/auto/selftests/expected_maxwarnings.txt index 8bafeff..908bd5d 100644 --- a/tests/auto/selftests/expected_maxwarnings.txt +++ b/tests/auto/selftests/expected_maxwarnings.txt @@ -1,5 +1,5 @@ ********* Start testing of MaxWarnings ********* -Config: Using QTest library 4.6.2, Qt 4.6.2 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : MaxWarnings::initTestCase() QWARN : MaxWarnings::warn() 0 QWARN : MaxWarnings::warn() 1 diff --git a/tests/auto/selftests/expected_skip.txt b/tests/auto/selftests/expected_skip.txt index c4ef92d..4345a6c 100644 --- a/tests/auto/selftests/expected_skip.txt +++ b/tests/auto/selftests/expected_skip.txt @@ -1,5 +1,5 @@ ********* Start testing of tst_Skip ********* -Config: Using QTest library 4.6.2, Qt 4.6.2 +Config: Using QTest library 4.7.0, Qt 4.7.0 PASS : tst_Skip::initTestCase() SKIP : tst_Skip::test() skipping all Loc: [/home/rmcgover/depot/qt-git/mainline/tests/auto/selftests/skip/tst_skip.cpp(68)] diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp index 0b9cee0..3d58c15 100644 --- a/tests/auto/selftests/tst_selftests.cpp +++ b/tests/auto/selftests/tst_selftests.cpp @@ -97,7 +97,7 @@ inline bool qCompare if (r1.unit == "msec") { variance = 0.1; } - else if (r1.unit == "instr. loads") { + else if (r1.unit == "instruction reads") { variance = 0.001; } else if (r1.unit == "ticks") { @@ -434,7 +434,7 @@ BenchmarkResult BenchmarkResult::parse(QString const& line, QString* error) /* This code avoids using a QRegExp because QRegExp might be broken. */ - /* Sample format: 4,000 msec per iteration (total: 4000, iterations: 1) */ + /* Sample format: 4,000 msec per iteration (total: 4,000, iterations: 1) */ QString sFirstNumber; while (!remaining.isEmpty() && !remaining.at(0).isSpace()) { @@ -468,7 +468,7 @@ BenchmarkResult BenchmarkResult::parse(QString const& line, QString* error) remaining = remaining.mid(sizeof(periterbit)-1); - /* Remaining: 4000, iterations: 1) */ + /* Remaining: 4,000, iterations: 1) */ static const char itersbit[] = ", iterations: "; QString sTotal; while (!remaining.startsWith(itersbit) && !remaining.isEmpty()) { @@ -482,9 +482,12 @@ BenchmarkResult BenchmarkResult::parse(QString const& line, QString* error) remaining = remaining.mid(sizeof(itersbit)-1); - qint64 total = sTotal.toLongLong(&ok); + /* 4,000 -> 4000 */ + sTotal.remove(','); + + double total = sTotal.toDouble(&ok); if (!ok) { - if (error) *error = sTotal + " (total) is not a valid integer"; + if (error) *error = sTotal + " (total) is not a valid number"; return out; } diff --git a/tests/auto/selftests/xunit/tst_xunit b/tests/auto/selftests/xunit/tst_xunit Binary files differdeleted file mode 100755 index 31d03a8..0000000 --- a/tests/auto/selftests/xunit/tst_xunit +++ /dev/null diff --git a/tests/auto/symbols/tst_symbols.cpp b/tests/auto/symbols/tst_symbols.cpp index e30481a..70abc43 100644 --- a/tests/auto/symbols/tst_symbols.cpp +++ b/tests/auto/symbols/tst_symbols.cpp @@ -100,7 +100,6 @@ void tst_Symbols::globalObjects() #ifndef Q_OS_LINUX QSKIP("Linux-specific test", SkipAll); #endif - QSKIP("Test disabled, we're not fixing these issues in this Qt version", SkipAll); // these are regexps for global objects that are allowed in Qt QStringList whitelist = QStringList() diff --git a/tests/auto/uiloader/baseline/css_buttons_background.ui b/tests/auto/uiloader/baseline/css_buttons_background.ui index f1fa0bc..3d80aeb 100644 --- a/tests/auto/uiloader/baseline/css_buttons_background.ui +++ b/tests/auto/uiloader/baseline/css_buttons_background.ui @@ -89,6 +89,19 @@ color: yellow; </property> </widget> </item> + <item row="5" column="0"> + <widget class="QPushButton" name="pushButton_4"> + <property name="text"> + <string>Checked</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> </layout> </widget> </item> @@ -149,6 +162,19 @@ color: yellow; </property> </widget> </item> + <item row="5" column="0"> + <widget class="QPushButton" name="pushButton_5"> + <property name="text"> + <string>Checked</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> </layout> </widget> </item> @@ -209,6 +235,19 @@ color: yellow; </property> </widget> </item> + <item row="5" column="0"> + <widget class="QPushButton" name="pushButton_6"> + <property name="text"> + <string>Checked</string> + </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> </layout> </widget> </item> diff --git a/tests/auto/uiloader/baseline/css_qtbug6855.ui b/tests/auto/uiloader/baseline/css_qtbug6855.ui new file mode 100644 index 0000000..0727f6b --- /dev/null +++ b/tests/auto/uiloader/baseline/css_qtbug6855.ui @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>Form</class> + <widget class="QWidget" name="Form"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>212</width> + <height>108</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { padding: 20px; }</string> + </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QPushButton" name="pushButton"> + <property name="text"> + <string>Text not cropped</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>258</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>218</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index faacec4..01285d1 100644 --- a/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/benchmarks/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the documentation of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage diff --git a/tests/benchmarks/qmetaobject/main.cpp b/tests/benchmarks/qmetaobject/main.cpp index c375a16..eef6020 100644 --- a/tests/benchmarks/qmetaobject/main.cpp +++ b/tests/benchmarks/qmetaobject/main.cpp @@ -42,6 +42,84 @@ #include <QtGui> #include <qtest.h> +class LotsOfSignals : public QObject +{ + Q_OBJECT +public: + LotsOfSignals() {} + +signals: + void extraSignal1(); + void extraSignal2(); + void extraSignal3(); + void extraSignal4(); + void extraSignal5(); + void extraSignal6(); + void extraSignal7(); + void extraSignal8(); + void extraSignal9(); + void extraSignal10(); + void extraSignal12(); + void extraSignal13(); + void extraSignal14(); + void extraSignal15(); + void extraSignal16(); + void extraSignal17(); + void extraSignal18(); + void extraSignal19(); + void extraSignal20(); + void extraSignal21(); + void extraSignal22(); + void extraSignal23(); + void extraSignal24(); + void extraSignal25(); + void extraSignal26(); + void extraSignal27(); + void extraSignal28(); + void extraSignal29(); + void extraSignal30(); + void extraSignal31(); + void extraSignal32(); + void extraSignal33(); + void extraSignal34(); + void extraSignal35(); + void extraSignal36(); + void extraSignal37(); + void extraSignal38(); + void extraSignal39(); + void extraSignal40(); + void extraSignal41(); + void extraSignal42(); + void extraSignal43(); + void extraSignal44(); + void extraSignal45(); + void extraSignal46(); + void extraSignal47(); + void extraSignal48(); + void extraSignal49(); + void extraSignal50(); + void extraSignal51(); + void extraSignal52(); + void extraSignal53(); + void extraSignal54(); + void extraSignal55(); + void extraSignal56(); + void extraSignal57(); + void extraSignal58(); + void extraSignal59(); + void extraSignal60(); + void extraSignal61(); + void extraSignal62(); + void extraSignal63(); + void extraSignal64(); + void extraSignal65(); + void extraSignal66(); + void extraSignal67(); + void extraSignal68(); + void extraSignal69(); + void extraSignal70(); +}; + class tst_qmetaobject: public QObject { Q_OBJECT @@ -57,6 +135,9 @@ private slots: void indexOfSignal(); void indexOfSlot_data(); void indexOfSlot(); + + void unconnected_data(); + void unconnected(); }; void tst_qmetaobject::initTestCase() @@ -154,6 +235,30 @@ void tst_qmetaobject::indexOfSlot() } } +void tst_qmetaobject::unconnected_data() +{ + QTest::addColumn<int>("signal_index"); + QTest::newRow("signal--9") << 9; + QTest::newRow("signal--32") << 32; + QTest::newRow("signal--33") << 33; + QTest::newRow("signal--64") << 64; + QTest::newRow("signal--65") << 65; + QTest::newRow("signal--70") << 70; +} + +void tst_qmetaobject::unconnected() +{ + LotsOfSignals *obj = new LotsOfSignals; + QFETCH(int, signal_index); + QVERIFY(obj->metaObject()->methodCount() == 73); + void *v; + QBENCHMARK { + //+1 because QObject has one slot + QMetaObject::metacall(obj, QMetaObject::InvokeMetaMethod, signal_index+1, &v); + } + delete obj; +} + QTEST_MAIN(tst_qmetaobject) #include "main.moc" diff --git a/tests/benchmarks/qstringlist/main.cpp b/tests/benchmarks/qstringlist/main.cpp index 3fac598..1717b88 100644 --- a/tests/benchmarks/qstringlist/main.cpp +++ b/tests/benchmarks/qstringlist/main.cpp @@ -54,17 +54,21 @@ private slots: void join() const; void join_data() const; - void split() const; + void split_qlist_qbytearray() const; + void split_qlist_qbytearray_data() const { return split_data(); } + void split_data() const; + void split_qlist_qstring() const; + void split_qlist_qstring_data() const { return split_data(); } - void split_std() const; - void split_std_data() const { return split_data(); } + void split_stdvector_stdstring() const; + void split_stdvector_stdstring_data() const { return split_data(); } - void split_stdw() const; - void split_stdw_data() const { return split_data(); } + void split_stdvector_stdwstring() const; + void split_stdvector_stdwstring_data() const { return split_data(); } - void split_ba() const; - void split_ba_data() const { return split_data(); } + void split_stdlist_stdstring() const; + void split_stdlist_stdstring_data() const { return split_data(); } private: static QStringList populateList(const int count, const QString &unit); @@ -125,27 +129,39 @@ void tst_QStringList::join_data() const << QString(); } -void tst_QStringList::split() const +void tst_QStringList::split_data() const +{ + QTest::addColumn<QString>("input"); + QString unit = QLatin1String("unit") + QString(100, QLatin1Char('s')); + //QTest::newRow("") << populateString(10, unit); + QTest::newRow("") << populateString(100, unit); + //QTest::newRow("") << populateString(100, unit); + //QTest::newRow("") << populateString(1000, unit); + //QTest::newRow("") << populateString(10000, unit); +} + +void tst_QStringList::split_qlist_qbytearray() const { QFETCH(QString, input); - const QChar splitChar = ':'; + const char splitChar = ':'; + QByteArray ba = input.toLatin1(); QBENCHMARK { - input.split(splitChar); + ba.split(splitChar); } } -void tst_QStringList::split_data() const +void tst_QStringList::split_qlist_qstring() const { - QTest::addColumn<QString>("input"); - QString unit = QLatin1String("unit"); - QTest::newRow("") << populateString(10, unit); - QTest::newRow("") << populateString(100, unit); - QTest::newRow("") << populateString(1000, unit); - QTest::newRow("") << populateString(10000, unit); + QFETCH(QString, input); + const QChar splitChar = ':'; + + QBENCHMARK { + input.split(splitChar); + } } -void tst_QStringList::split_std() const +void tst_QStringList::split_stdvector_stdstring() const { QFETCH(QString, input); const char split_char = ':'; @@ -161,7 +177,7 @@ void tst_QStringList::split_std() const } } -void tst_QStringList::split_stdw() const +void tst_QStringList::split_stdvector_stdwstring() const { QFETCH(QString, input); const wchar_t split_char = ':'; @@ -177,14 +193,19 @@ void tst_QStringList::split_stdw() const } } -void tst_QStringList::split_ba() const +void tst_QStringList::split_stdlist_stdstring() const { QFETCH(QString, input); - const char splitChar = ':'; - QByteArray ba = input.toLatin1(); + const char split_char = ':'; + std::string stdinput = input.toStdString(); QBENCHMARK { - ba.split(splitChar); + std::istringstream split(stdinput); + std::list<std::string> token; + for (std::string each; + std::getline(split, each, split_char); + token.push_back(each)) + ; } } diff --git a/tests/benchmarks/qstringlist/qstringlist.pro b/tests/benchmarks/qstringlist/qstringlist.pro index 11cceb0..5c64b34 100644 --- a/tests/benchmarks/qstringlist/qstringlist.pro +++ b/tests/benchmarks/qstringlist/qstringlist.pro @@ -1,5 +1,7 @@ load(qttest_p4) TARGET = tst_qstringlist +CONFIG -= debug +CONFIG += release QT -= gui SOURCES += main.cpp diff --git a/tests/benchmarks/qvector/main.cpp b/tests/benchmarks/qvector/main.cpp new file mode 100644 index 0000000..65e7609 --- /dev/null +++ b/tests/benchmarks/qvector/main.cpp @@ -0,0 +1,426 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QVector> +#include <QDebug> +#include <QtTest> + +#include "qrawvector.h" + +#include <vector> + +/* + +Code generated by g++ 4.3.3. The lines marked with '!' are the ones that get +executed inside the loop. Using the external 's' causes some load making the +loop resembling a 'simple inner loop' in 'real' applications. + + +qvector_mutable_read_access: + +.L166: +! movl -16(%ebp), %edx +! movl (%edx), %eax +! subl $1, %eax +! je .L165 + movl 4(%edx), %eax + movl %eax, 8(%esp) + movl 8(%edx), %eax + movl %esi, (%esp) + movl %eax, 4(%esp) + call _ZN4myns7QVectorIdE7reallocEii +.L165: +! movl -16(%ebp), %eax +! fldl s +! faddl 16(%eax,%ebx,8) +! addl $1, %ebx +! cmpl $10000, %ebx +! fstpl s +! jne .L166 + + +qvector_const_read_access: + + movl -16(%ebp), %edx + xorl %eax, %eax +.L183: +! fldl s +! faddl 16(%edx,%eax,8) +! addl $1, %eax +! cmpl $10000, %eax +! fstpl s +! jne .L183 + + +stdvector_const_read_access and stdvector_mutable_read_access and +qrawvector_const_read_access and qrawvector_mutable_read_access: + + xorl %eax, %eax +.L64: +! fldl s +! faddl (%ebx,%eax,8) +! addl $1, %eax +! cmpl $10000, %eax +! fstpl s +! jne .L64 + + + +Behaviour varies with small modifications, but total is more or +less stable: + +qrawvector_mutable_read_access, using size() instead of N: + +.L145: +! faddl (%edx,%eax,8) +! addl $1, %eax +! cmpl %ecx, %eax +! fstl s +! jne .L145 +! fstp %st(0) + + +qrawvector_mutable_read_access, counting backward: + +.L145: +! faddl (%edx,%eax,8) +! subl $1, %eax +! cmpl $-1, %eax +! fstl s +! jne .L145 + + +qrawvector_mutable_read_access, counting backward, using size(): + +.L146: +! faddl (%edx) +! addl $1, %eax +! subl $8, %edx +! cmpl %ecx, %eax +! fstl s +! jne .L146 + + + +*/ + + +/* + +//////////////////////////////////////////////////////////////////// + +time ./tst_vector qvector_const_read_access +real 0m12.912s +user 0m12.401s +sys 0m0.016s + +time ./tst_vector qvector_mutable_read_access +real 0m38.566s +user 0m36.754s +sys 0m0.008s + + +time ./tst_vector stdvector_mutable_read_access +real 0m12.736s +user 0m12.665s +sys 0m0.004s + + +//////////////////////////////////////////////////////////////////// + +time ./tst_vector qvector_fill_and_return +real 0m28.778s +user 0m28.522s +sys 0m0.012s + +time ./tst_vector stdvector_fill_and_return +real 0m26.675s +user 0m26.558s +sys 0m0.012s + +time ./tst_vector qrawvector_fill_and_return +real 0m23.370s +user 0m23.269s +sys 0m0.008s + + + +*/ + + + +#define TEST_RETURN 1 + +// For some reason, both 'plain' and '-callgrind' create strange results +// (like varying instruction count for the same assembly code) +// So replace it by a plain loop and measure wall clock time. +//#undef QBENCHMARK +//#define QBENCHMARK for (int j = 0; j != 10000; ++j) + +class tst_QVector: public QObject +{ + Q_OBJECT + +private slots: + void calibration(); + + // Pure Qt solution + void qvector_separator() { qWarning() << "QVector results: "; } + void qvector_const_read_access(); + void qvector_mutable_read_access(); + #ifdef TEST_RETURN + void qvector_fill_and_return(); + void qvector_fill_and_return2(); + #endif + + // Purre Standard solution + void stdvector() { qWarning() << "std::vector results: "; } + void stdvector_const_read_access(); + void stdvector_mutable_read_access(); + #ifdef TEST_RETURN + void stdvector_fill_and_return(); + void stdvector_fill_and_return2(); + #endif + + // Build using std, pass as QVector + void mixedvector() { qWarning() << "mixed results: "; } + #ifdef TEST_RETURN + void mixedvector_fill_and_return(); + void mixedvector_fill_and_return2(); + #endif + + // Alternative implementation + void qrawvector_separator() { qWarning() << "QRawVector results: "; } + void qrawvector_const_read_access(); + void qrawvector_mutable_read_access(); + #ifdef TEST_RETURN + void qrawvector_fill_and_return(); + void qrawvector_fill_and_return2(); + #endif +}; + +const int N = 1000000; +extern double s; + +void tst_QVector::calibration() +{ + QVector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += i; + } +} + +///////////////////// QVector ///////////////////// + +void tst_QVector::qvector_const_read_access() +{ + QVector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + const QVector<double> &vc = v; + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += vc[i]; + } +} + +void tst_QVector::qvector_mutable_read_access() +{ + QVector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += v[i]; + } +} + +#ifdef TEST_RETURN +extern QVector<double> qvector_fill_and_return_helper(); +extern QVector<double> qvector_fill_and_return_helper2(); + +void tst_QVector::qvector_fill_and_return() +{ + QBENCHMARK { + QVector<double> v = qvector_fill_and_return_helper(); + s += v[1]; + } +} + +void tst_QVector::qvector_fill_and_return2() +{ + QBENCHMARK { + QVector<double> v = qvector_fill_and_return_helper2(); + s += v[1]; + } +} +#endif + + +///////////////////// QRawVector ///////////////////// + +void tst_QVector::qrawvector_const_read_access() +{ + QRawVector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + const QRawVector<double> &vc = v; + QBENCHMARK { + for (int i = vc.size(); --i >= 0;) + s += vc[i]; + } +} + +void tst_QVector::qrawvector_mutable_read_access() +{ + QRawVector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += v[i]; + } +} + +#ifdef TEST_RETURN +extern QVector<double> qrawvector_fill_and_return_helper(); +extern QVector<double> qrawvector_fill_and_return_helper2(); + +void tst_QVector::qrawvector_fill_and_return() +{ + QBENCHMARK { + QVector<double> v = qrawvector_fill_and_return_helper(); + s += v[1]; + } +} + +void tst_QVector::qrawvector_fill_and_return2() +{ + QBENCHMARK { + QVector<double> v = qrawvector_fill_and_return_helper(); + s += v[1]; + } +} +#endif + + +///////////////////// std::vector ///////////////////// + +void tst_QVector::stdvector_const_read_access() +{ + std::vector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + const std::vector<double> &vc = v; + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += vc[i]; + } +} + +void tst_QVector::stdvector_mutable_read_access() +{ + std::vector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + + QBENCHMARK { + for (int i = 0; i != N; ++i) + s += v[i]; + } +} + +#ifdef TEST_RETURN +extern std::vector<double> stdvector_fill_and_return_helper(); +extern std::vector<double> stdvector_fill_and_return_helper2(); + +void tst_QVector::stdvector_fill_and_return() +{ + QBENCHMARK { + std::vector<double> v = stdvector_fill_and_return_helper(); + s += v[1]; + } +} + +void tst_QVector::stdvector_fill_and_return2() +{ + QBENCHMARK { + std::vector<double> v = stdvector_fill_and_return_helper2(); + s += v[1]; + } +} +#endif + +///////////////////// mixed vector ///////////////////// + + +#ifdef TEST_RETURN +extern QVector<double> mixedvector_fill_and_return_helper(); +extern QVector<double> mixedvector_fill_and_return_helper2(); + +void tst_QVector::mixedvector_fill_and_return() +{ + QBENCHMARK { + std::vector<double> v = stdvector_fill_and_return_helper(); + s += v[1]; + } +} + +void tst_QVector::mixedvector_fill_and_return2() +{ + QBENCHMARK { + std::vector<double> v = stdvector_fill_and_return_helper2(); + s += v[1]; + } +} +#endif + +QTEST_MAIN(tst_QVector) + +#include "main.moc" diff --git a/tests/benchmarks/qvector/outofline.cpp b/tests/benchmarks/qvector/outofline.cpp new file mode 100644 index 0000000..e8d036e --- /dev/null +++ b/tests/benchmarks/qvector/outofline.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtTest module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QVector> +#include <vector> +#include "qrawvector.h" + +const int N = 1000000; +double s = 0; + +QVector<double> qvector_fill_and_return_helper() +{ + QVector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + return v; +} + +QVector<double> qrawvector_fill_and_return_helper() +{ + QRawVector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + return v.mutateToVector(); +} + +QVector<double> mixedvector_fill_and_return_helper() +{ + std::vector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + return QVector<double>::fromStdVector(v); +} + + +std::vector<double> stdvector_fill_and_return_helper() +{ + std::vector<double> v(N); + for (int i = 0; i != N; ++i) + v[i] = i; + return v; +} + diff --git a/tests/benchmarks/qvector/qrawvector.h b/tests/benchmarks/qvector/qrawvector.h new file mode 100644 index 0000000..15421eb --- /dev/null +++ b/tests/benchmarks/qvector/qrawvector.h @@ -0,0 +1,742 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QRAWVECTOR_H +#define QRAWVECTOR_H + +#include <QtCore/qiterator.h> +#include <QtCore/qdebug.h> +#include <QtCore/qatomic.h> +#include <QtCore/qalgorithms.h> +#include <QtCore/qlist.h> + +#ifndef QT_NO_STL +#include <iterator> +#include <vector> +#endif +#include <stddef.h> +#include <stdlib.h> +#include <string.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + + + +template <typename T> +class QRawVector +{ + struct Data : QVectorData { T array[1]; }; + + T *m_begin; + int m_size; + int m_alloc; + +public: + //static Data dummy; + //int headerOffset() { return (char*)&dummy.array - (char*)&dummy; } + inline int headerOffset() const { + // gcc complains about: return offsetof(Data, array); and also + // does not like '0' in the expression below. + return (char *)&(((Data *)(1))->array) - (char *)1; + } + inline Data *toBase(T *begin) const + { return (Data*)((char*)begin - headerOffset()); } + inline T *fromBase(void *d) const + { return (T*)((char*)d + headerOffset()); } + inline QRawVector() + { m_begin = fromBase(0); m_alloc = m_size = 0; realloc(m_size, m_alloc, true); } + explicit QRawVector(int size); + QRawVector(int size, const T &t); + inline QRawVector(const QRawVector<T> &v) + { m_begin = v.m_begin; m_alloc = v.m_alloc; m_size = v.m_size; realloc(m_size, m_alloc, true); } + inline ~QRawVector() { free(m_begin, m_size); } + QRawVector<T> &operator=(const QRawVector<T> &v); + bool operator==(const QRawVector<T> &v) const; + inline bool operator!=(const QRawVector<T> &v) const { return !(*this == v); } + + inline int size() const { return m_size; } + + inline bool isEmpty() const { return m_size == 0; } + + void resize(int size); + + inline int capacity() const { return m_alloc; } + void reserve(int size); + inline void squeeze() { realloc(m_size, m_size, false); } + + inline T *data() { return m_begin; } + inline const T *data() const { return m_begin; } + inline const T *constData() const { return m_begin; } + void clear(); + + const T &at(int i) const; + T &operator[](int i); + const T &operator[](int i) const; + void append(const T &t); + void prepend(const T &t); + void insert(int i, const T &t); + void insert(int i, int n, const T &t); + void replace(int i, const T &t); + void remove(int i); + void remove(int i, int n); + + QRawVector<T> &fill(const T &t, int size = -1); + + int indexOf(const T &t, int from = 0) const; + int lastIndexOf(const T &t, int from = -1) const; + bool contains(const T &t) const; + int count(const T &t) const; + +#ifdef QT_STRICT_ITERATORS + class iterator { + public: + T *i; + typedef std::random_access_iterator_tag iterator_category; + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef T *pointer; + typedef T &reference; + + inline iterator() : i(0) {} + inline iterator(T *n) : i(n) {} + inline iterator(const iterator &o): i(o.i){} + inline T &operator*() const { return *i; } + inline T *operator->() const { return i; } + inline T &operator[](int j) const { return *(i + j); } + inline bool operator==(const iterator &o) const { return i == o.i; } + inline bool operator!=(const iterator &o) const { return i != o.i; } + inline bool operator<(const iterator& other) const { return i < other.i; } + inline bool operator<=(const iterator& other) const { return i <= other.i; } + inline bool operator>(const iterator& other) const { return i > other.i; } + inline bool operator>=(const iterator& other) const { return i >= other.i; } + inline iterator &operator++() { ++i; return *this; } + inline iterator operator++(int) { T *n = i; ++i; return n; } + inline iterator &operator--() { i--; return *this; } + inline iterator operator--(int) { T *n = i; i--; return n; } + inline iterator &operator+=(int j) { i+=j; return *this; } + inline iterator &operator-=(int j) { i-=j; return *this; } + inline iterator operator+(int j) const { return iterator(i+j); } + inline iterator operator-(int j) const { return iterator(i-j); } + inline int operator-(iterator j) const { return i - j.i; } + }; + friend class iterator; + + class const_iterator { + public: + T *i; + typedef std::random_access_iterator_tag iterator_category; + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef const T *pointer; + typedef const T &reference; + + inline const_iterator() : i(0) {} + inline const_iterator(T *n) : i(n) {} + inline const_iterator(const const_iterator &o): i(o.i) {} + inline explicit const_iterator(const iterator &o): i(o.i) {} + inline const T &operator*() const { return *i; } + inline const T *operator->() const { return i; } + inline const T &operator[](int j) const { return *(i + j); } + inline bool operator==(const const_iterator &o) const { return i == o.i; } + inline bool operator!=(const const_iterator &o) const { return i != o.i; } + inline bool operator<(const const_iterator& other) const { return i < other.i; } + inline bool operator<=(const const_iterator& other) const { return i <= other.i; } + inline bool operator>(const const_iterator& other) const { return i > other.i; } + inline bool operator>=(const const_iterator& other) const { return i >= other.i; } + inline const_iterator &operator++() { ++i; return *this; } + inline const_iterator operator++(int) { T *n = i; ++i; return n; } + inline const_iterator &operator--() { i--; return *this; } + inline const_iterator operator--(int) { T *n = i; i--; return n; } + inline const_iterator &operator+=(int j) { i+=j; return *this; } + inline const_iterator &operator-=(int j) { i+=j; return *this; } + inline const_iterator operator+(int j) const { return const_iterator(i+j); } + inline const_iterator operator-(int j) const { return const_iterator(i-j); } + inline int operator-(const_iterator j) const { return i - j.i; } + }; + friend class const_iterator; +#else + // STL-style + typedef T *iterator; + typedef const T *const_iterator; +#endif + inline iterator begin() { return m_begin; } + inline const_iterator begin() const { return m_begin; } + inline const_iterator constBegin() const { return m_begin; } + inline iterator end() { return m_begin + m_size; } + inline const_iterator end() const { return m_begin + m_size; } + inline const_iterator constEnd() const { return m_begin + m_size; } + iterator insert(iterator before, int n, const T &x); + inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); } + iterator erase(iterator begin, iterator end); + inline iterator erase(iterator pos) { return erase(pos, pos+1); } + + // more Qt + inline int count() const { return m_size; } + inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); } + inline const T &first() const { Q_ASSERT(!isEmpty()); return *begin(); } + inline T& last() { Q_ASSERT(!isEmpty()); return *(end()-1); } + inline const T &last() const { Q_ASSERT(!isEmpty()); return *(end()-1); } + inline bool startsWith(const T &t) const { return !isEmpty() && first() == t; } + inline bool endsWith(const T &t) const { return !isEmpty() && last() == t; } + QRawVector<T> mid(int pos, int length = -1) const; + + T value(int i) const; + T value(int i, const T &defaultValue) const; + + // STL compatibility + typedef T value_type; + typedef value_type *pointer; + typedef const value_type *const_pointer; + typedef value_type &reference; + typedef const value_type &const_reference; + typedef ptrdiff_t difference_type; + typedef iterator Iterator; + typedef const_iterator ConstIterator; + typedef int size_type; + inline void push_back(const T &t) { append(t); } + inline void push_front(const T &t) { prepend(t); } + void pop_back() { Q_ASSERT(!isEmpty()); erase(end()-1); } + void pop_front() { Q_ASSERT(!isEmpty()); erase(begin()); } + inline bool empty() const { return m_size == 0; } + inline T &front() { return first(); } + inline const_reference front() const { return first(); } + inline reference back() { return last(); } + inline const_reference back() const { return last(); } + + // comfort + QRawVector<T> &operator+=(const QRawVector<T> &l); + inline QRawVector<T> operator+(const QRawVector<T> &l) const + { QRawVector n = *this; n += l; return n; } + inline QRawVector<T> &operator+=(const T &t) + { append(t); return *this; } + inline QRawVector<T> &operator<< (const T &t) + { append(t); return *this; } + inline QRawVector<T> &operator<<(const QRawVector<T> &l) + { *this += l; return *this; } + + QList<T> toList() const; + + //static QRawVector<T> fromList(const QList<T> &list); + +#ifndef QT_NO_STL + static inline QRawVector<T> fromStdVector(const std::vector<T> &vector) + { QRawVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; } + inline std::vector<T> toStdVector() const + { std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; } +#endif + +private: + T *allocate(int alloc); + void realloc(int size, int alloc, bool ref); + void free(T *begin, int size); + int sizeOfTypedData() { + // this is more or less the same as sizeof(Data), except that it doesn't + // count the padding at the end + return reinterpret_cast<const char *>(&(reinterpret_cast<const Data *>(this))->array[1]) - reinterpret_cast<const char *>(this); + } + static inline int alignOfTypedData() + { +#ifdef Q_ALIGNOF + return qMax<int>(sizeof(void*), Q_ALIGNOF(Data)); +#else + return 0; +#endif + } + +public: + QVector<T> mutateToVector() + { + Data *d = toBase(m_begin); + d->ref = 1; + d->alloc = m_alloc; + d->size = m_size; + d->sharable = 0; + d->capacity = 0; + + QVector<T> v; + *reinterpret_cast<QVectorData **>(&v) = d; + m_begin = fromBase(0); + m_size = m_alloc = 0; + return v; + } +}; + + +template <typename T> +void QRawVector<T>::reserve(int asize) +{ if (asize > m_alloc) realloc(m_size, asize, false); } +template <typename T> +void QRawVector<T>::resize(int asize) +{ realloc(asize, (asize > m_alloc || (asize < m_size && asize < (m_alloc >> 1))) + ? QVectorData::grow(sizeOfTypedData(), asize, sizeof(T), QTypeInfo<T>::isStatic) + : m_alloc, false); } +template <typename T> +inline void QRawVector<T>::clear() +{ *this = QRawVector<T>(); } +template <typename T> +inline const T &QRawVector<T>::at(int i) const +{ Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector<T>::at", "index out of range"); + return m_begin[i]; } +template <typename T> +inline const T &QRawVector<T>::operator[](int i) const +{ Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector<T>::operator[]", "index out of range"); + return m_begin[i]; } +template <typename T> +inline T &QRawVector<T>::operator[](int i) +{ Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector<T>::operator[]", "index out of range"); + return data()[i]; } +template <typename T> +inline void QRawVector<T>::insert(int i, const T &t) +{ Q_ASSERT_X(i >= 0 && i <= m_size, "QRawVector<T>::insert", "index out of range"); + insert(begin() + i, 1, t); } +template <typename T> +inline void QRawVector<T>::insert(int i, int n, const T &t) +{ Q_ASSERT_X(i >= 0 && i <= m_size, "QRawVector<T>::insert", "index out of range"); + insert(begin() + i, n, t); } +template <typename T> +inline void QRawVector<T>::remove(int i, int n) +{ Q_ASSERT_X(i >= 0 && n >= 0 && i + n <= m_size, "QRawVector<T>::remove", "index out of range"); + erase(begin() + i, begin() + i + n); } +template <typename T> +inline void QRawVector<T>::remove(int i) +{ Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector<T>::remove", "index out of range"); + erase(begin() + i, begin() + i + 1); } +template <typename T> +inline void QRawVector<T>::prepend(const T &t) +{ insert(begin(), 1, t); } + +template <typename T> +inline void QRawVector<T>::replace(int i, const T &t) +{ + Q_ASSERT_X(i >= 0 && i < m_size, "QRawVector<T>::replace", "index out of range"); + const T copy(t); + data()[i] = copy; +} + +template <typename T> +QRawVector<T> &QRawVector<T>::operator=(const QRawVector<T> &v) +{ + if (this != &v) { + free(m_begin, m_size); + m_alloc = v.m_alloc; + m_size = v.m_size; + m_begin = v.m_begin; + realloc(m_size, m_alloc, true); + } + return *this; +} + +template <typename T> +inline T *QRawVector<T>::allocate(int aalloc) +{ + QVectorData *d = QVectorData::allocate(sizeOfTypedData() + (aalloc - 1) * sizeof(T), alignOfTypedData()); + Q_CHECK_PTR(d); + return fromBase(d); +} + +template <typename T> +QRawVector<T>::QRawVector(int asize) +{ + m_size = m_alloc = asize; + m_begin = allocate(asize); + if (QTypeInfo<T>::isComplex) { + T *b = m_begin; + T *i = m_begin + m_size; + while (i != b) + new (--i) T; + } else { + qMemSet(m_begin, 0, asize * sizeof(T)); + } +} + +template <typename T> +QRawVector<T>::QRawVector(int asize, const T &t) +{ + m_size = m_alloc = asize; + m_begin = allocate(asize); + T *i = m_begin + m_size; + while (i != m_begin) + new (--i) T(t); +} + +template <typename T> +void QRawVector<T>::free(T *begin, int size) +{ + if (QTypeInfo<T>::isComplex) { + T *i = begin + size; + while (i-- != begin) + i->~T(); + } + Data *x = toBase(begin); + x->free(x, alignOfTypedData()); +} + +template <typename T> +void QRawVector<T>::realloc(int asize, int aalloc, bool ref) +{ + if (QTypeInfo<T>::isComplex && asize < m_size && !ref) { + // call the destructor on all objects that need to be + // destroyed when shrinking + T *pOld = m_begin + m_size; + while (asize < m_size) { + (--pOld)->~T(); + --m_size; + } + } + + int xalloc = m_alloc; + int xsize = m_size; + bool changed = false; + T *xbegin = m_begin; + if (aalloc != xalloc || ref) { + // (re)allocate memory + if (QTypeInfo<T>::isStatic) { + xbegin = allocate(aalloc); + xsize = 0; + changed = true; + } else if (ref) { + xbegin = allocate(aalloc); + if (QTypeInfo<T>::isComplex) { + xsize = 0; + } else { + ::memcpy(xbegin, m_begin, qMin(aalloc, xalloc) * sizeof(T)); + xsize = m_size; + } + changed = true; + } else { + QT_TRY { + QVectorData *mem = QVectorData::reallocate( + toBase(m_begin), sizeOfTypedData() + (aalloc - 1) * sizeof(T), + sizeOfTypedData() ++ (xalloc - 1) * sizeof(T), alignOfTypedData()); + Q_CHECK_PTR(mem); + xbegin = fromBase(mem); + xsize = m_size; + } QT_CATCH (const std::bad_alloc &) { + if (aalloc > xalloc) // ignore the error in case we are just shrinking. + QT_RETHROW; + } + } + xalloc = aalloc; + } + + if (QTypeInfo<T>::isComplex) { + QT_TRY { + T *pOld = m_begin + xsize; + T *pNew = xbegin + xsize; + // copy objects from the old array into the new array + while (xsize < qMin(asize, m_size)) { + new (pNew++) T(*pOld++); + ++xsize; + } + // construct all new objects when growing + while (xsize < asize) { + new (pNew++) T; + ++xsize; + } + } QT_CATCH (...) { + free(xbegin, xsize); + QT_RETHROW; + } + + } else if (asize > xsize) { + // initialize newly allocated memory to 0 + qMemSet(xbegin + xsize, 0, (asize - xsize) * sizeof(T)); + } + xsize = asize; + + if (changed) { + if (!ref) + free(m_begin, m_size); + } + m_alloc = xalloc; + m_size = xsize; + m_begin = xbegin; +} + +template<typename T> +Q_OUTOFLINE_TEMPLATE T QRawVector<T>::value(int i) const +{ + return (i < 0 || i >= m_size) ? T() : m_begin[i]; +} +template<typename T> +Q_OUTOFLINE_TEMPLATE T QRawVector<T>::value(int i, const T &defaultValue) const +{ + return (i < 0 || i >= m_size) ? defaultValue : m_begin[i]; +} + +template <typename T> +void QRawVector<T>::append(const T &t) +{ + if (m_size + 1 > m_alloc) { + const T copy(t); + realloc(m_size, QVectorData::grow(sizeOfTypedData(), m_size + 1, sizeof(T), + QTypeInfo<T>::isStatic), false); + if (QTypeInfo<T>::isComplex) + new (m_begin + m_size) T(copy); + else + m_begin[m_size] = copy; + } else { + if (QTypeInfo<T>::isComplex) + new (m_begin + m_size) T(t); + else + m_begin[m_size] = t; + } + ++m_size; +} + +template <typename T> +Q_TYPENAME QRawVector<T>::iterator QRawVector<T>::insert(iterator before, size_type n, const T &t) +{ + int offset = int(before - m_begin); + if (n != 0) { + const T copy(t); + if (m_size + n > m_alloc) + realloc(m_size, QVectorData::grow(sizeOfTypedData(), m_size + n, sizeof(T), + QTypeInfo<T>::isStatic), false); + if (QTypeInfo<T>::isStatic) { + T *b = m_begin + m_size; + T *i = m_begin + m_size + n; + while (i != b) + new (--i) T; + i = m_begin + m_size; + T *j = i + n; + b = m_begin + offset; + while (i != b) + *--j = *--i; + i = b+n; + while (i != b) + *--i = copy; + } else { + T *b = m_begin + offset; + T *i = b + n; + memmove(i, b, (m_size - offset) * sizeof(T)); + while (i != b) + new (--i) T(copy); + } + m_size += n; + } + return m_begin + offset; +} + +template <typename T> +Q_TYPENAME QRawVector<T>::iterator QRawVector<T>::erase(iterator abegin, iterator aend) +{ + int f = int(abegin - m_begin); + int l = int(aend - m_begin); + int n = l - f; + if (QTypeInfo<T>::isComplex) { + qCopy(m_begin + l, m_begin + m_size, m_begin + f); + T *i = m_begin + m_size; + T *b = m_begin + m_size - n; + while (i != b) { + --i; + i->~T(); + } + } else { + memmove(m_begin + f, m_begin + l, (m_size - l) * sizeof(T)); + } + m_size -= n; + return m_begin + f; +} + +template <typename T> +bool QRawVector<T>::operator==(const QRawVector<T> &v) const +{ + if (m_size != v.m_size) + return false; + T* b = m_begin; + T* i = b + m_size; + T* j = v.m_begin + m_size; + while (i != b) + if (!(*--i == *--j)) + return false; + return true; +} + +template <typename T> +QRawVector<T> &QRawVector<T>::fill(const T &from, int asize) +{ + const T copy(from); + resize(asize < 0 ? m_size : asize); + if (m_size) { + T *i = m_begin + m_size; + T *b = m_begin; + while (i != b) + *--i = copy; + } + return *this; +} + +template <typename T> +QRawVector<T> &QRawVector<T>::operator+=(const QRawVector &l) +{ + int newSize = m_size + l.m_size; + realloc(m_size, newSize, false); + + T *w = m_begin + newSize; + T *i = l.m_begin + l.m_size; + T *b = l.m_begin; + while (i != b) { + if (QTypeInfo<T>::isComplex) + new (--w) T(*--i); + else + *--w = *--i; + } + m_size = newSize; + return *this; +} + +template <typename T> +int QRawVector<T>::indexOf(const T &t, int from) const +{ + if (from < 0) + from = qMax(from + m_size, 0); + if (from < m_size) { + T* n = m_begin + from - 1; + T* e = m_begin + m_size; + while (++n != e) + if (*n == t) + return n - m_begin; + } + return -1; +} + +template <typename T> +int QRawVector<T>::lastIndexOf(const T &t, int from) const +{ + if (from < 0) + from += m_size; + else if (from >= m_size) + from = m_size-1; + if (from >= 0) { + T* b = m_begin; + T* n = m_begin + from + 1; + while (n != b) { + if (*--n == t) + return n - b; + } + } + return -1; +} + +template <typename T> +bool QRawVector<T>::contains(const T &t) const +{ + T* b = m_begin; + T* i = m_begin + m_size; + while (i != b) + if (*--i == t) + return true; + return false; +} + +template <typename T> +int QRawVector<T>::count(const T &t) const +{ + int c = 0; + T* b = m_begin; + T* i = m_begin + m_size; + while (i != b) + if (*--i == t) + ++c; + return c; +} + +template <typename T> +Q_OUTOFLINE_TEMPLATE QRawVector<T> QRawVector<T>::mid(int pos, int length) const +{ + if (length < 0) + length = size() - pos; + if (pos == 0 && length == size()) + return *this; + QRawVector<T> copy; + if (pos + length > size()) + length = size() - pos; + for (int i = pos; i < pos + length; ++i) + copy += at(i); + return copy; +} + +template <typename T> +Q_OUTOFLINE_TEMPLATE QList<T> QRawVector<T>::toList() const +{ + QList<T> result; + for (int i = 0; i < size(); ++i) + result.append(at(i)); + return result; +} + + +/*template <typename T> +Q_OUTOFLINE_TEMPLATE QRawVector<T> QList<T>::toVector() const +{ + QRawVector<T> result(size()); + for (int i = 0; i < size(); ++i) + result[i] = at(i); + return result; +} + +template <typename T> +QRawVector<T> QRawVector<T>::fromList(const QList<T> &list) +{ + return list.toVector(); +} + +template <typename T> +QList<T> QList<T>::fromVector(const QRawVector<T> &vector) +{ + return vector.toList(); +} +*/ + +Q_DECLARE_SEQUENTIAL_ITERATOR(RawVector) +Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(RawVector) + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QRAWVECTOR_H diff --git a/tests/benchmarks/qvector/qvector.pro b/tests/benchmarks/qvector/qvector.pro new file mode 100644 index 0000000..adb30c9 --- /dev/null +++ b/tests/benchmarks/qvector/qvector.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +TARGET = tst_vector +QT = core +INCLUDEPATH += . +SOURCES += main.cpp outofline.cpp outofline2.cpp +CONFIG += release diff --git a/examples/assistant/simpletextviewer/findfiledialog.h b/tests/shared/filesystem.h index aac27f1..2d46c0d 100644 --- a/examples/assistant/simpletextviewer/findfiledialog.h +++ b/tests/shared/filesystem.h @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the examples of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -38,62 +38,60 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +// Helper functions for creating file-system hierarchies and cleaning up. -#ifndef FINDFILEDIALOG_H -#define FINDFILEDIALOG_H +#ifndef QT_TESTS_SHARED_FILESYSTEM_H_INCLUDED +#define QT_TESTS_SHARED_FILESYSTEM_H_INCLUDED -#include <QAssistantClient> -#include <QDialog> +#include <QString> +#include <QStringList> +#include <QDir> +#include <QFile> -QT_BEGIN_NAMESPACE -class QComboBox; -class QDialogButtonBox; -class QLabel; -class QTextEdit; -class QToolButton; -class QTreeWidget; -class QTreeWidgetItem; -QT_END_NAMESPACE - -//! [0] -class FindFileDialog : public QDialog +struct FileSystem { - Q_OBJECT - -public: - FindFileDialog(QTextEdit *editor, QAssistantClient *assistant, - QWidget *parent = 0); - -private slots: - void browse(); - void help(); - void openFile(QTreeWidgetItem *item = 0); - void update(); + ~FileSystem() + { + Q_FOREACH(QString fileName, createdFiles) + QFile::remove(fileName); -private: - void findFiles(); - void showFiles(const QStringList &files); - - void createButtons(); - void createComboBoxes(); - void createFilesTree(); - void createLabels(); - void createLayout(); + Q_FOREACH(QString dirName, createdDirectories) + currentDir.rmdir(dirName); + } - QAssistantClient *currentAssistantClient; - QTextEdit *currentEditor; - QTreeWidget *foundFilesTree; + bool createDirectory(const QString &dirName) + { + if (currentDir.mkdir(dirName)) { + createdDirectories.prepend(dirName); + return true; + } + return false; + } - QComboBox *directoryComboBox; - QComboBox *fileNameComboBox; + bool createFile(const QString &fileName) + { + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + createdFiles << fileName; + return true; + } + return false; + } - QLabel *directoryLabel; - QLabel *fileNameLabel; + bool createLink(const QString &destination, const QString &linkName) + { + if (QFile::link(destination, linkName)) { + createdFiles << linkName; + return true; + } + return false; + } - QDialogButtonBox *buttonBox; +private: + QDir currentDir; - QToolButton *browseButton; + QStringList createdDirectories; + QStringList createdFiles; }; -//! [0] -#endif +#endif // include guard diff --git a/tools/assistant/assistant.pro b/tools/assistant/assistant.pro index 08d0d4b..97196b2 100644 --- a/tools/assistant/assistant.pro +++ b/tools/assistant/assistant.pro @@ -3,6 +3,4 @@ CONFIG += ordered SUBDIRS += lib/fulltextsearch \ lib \ - tools \ - compat \ - compat/lib \
\ No newline at end of file + tools diff --git a/tools/assistant/compat/Info_mac.plist b/tools/assistant/compat/Info_mac.plist deleted file mode 100644 index b1e6336..0000000 --- a/tools/assistant/compat/Info_mac.plist +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd"> -<plist version="0.9"> -<dict> - <key>CFBundleIconFile</key> - <string>@ICON@</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleGetInfoString</key> - <string>Created by Qt/QMake</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleIdentifier</key> - <string>com.trolltech.assistant-compat</string> - <key>CFBundleExecutable</key> - <string>@EXECUTABLE@</string> -</dict> -</plist> diff --git a/tools/assistant/compat/assistant.icns b/tools/assistant/compat/assistant.icns Binary files differdeleted file mode 100644 index 6291dd3..0000000 --- a/tools/assistant/compat/assistant.icns +++ /dev/null diff --git a/tools/assistant/compat/assistant.ico b/tools/assistant/compat/assistant.ico Binary files differdeleted file mode 100644 index 9e1b83f..0000000 --- a/tools/assistant/compat/assistant.ico +++ /dev/null diff --git a/tools/assistant/compat/assistant.pro b/tools/assistant/compat/assistant.pro deleted file mode 100644 index e865d6b..0000000 --- a/tools/assistant/compat/assistant.pro +++ /dev/null @@ -1,84 +0,0 @@ -include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri) - -TEMPLATE = app -LANGUAGE = C++ -TARGET = assistant_adp - -CONFIG += qt warn_on - -unix:contains(QT_CONFIG, dbus):QT += dbus - -build_all:!build_pass { - CONFIG -= build_all - CONFIG += release -} -QT += xml network - -PROJECTNAME = Assistant -DESTDIR = ../../../bin - -FORMS += helpdialog.ui \ - mainwindow.ui \ - tabbedbrowser.ui \ - topicchooser.ui - -SOURCES += main.cpp \ - helpwindow.cpp \ - topicchooser.cpp \ - docuparser.cpp \ - index.cpp \ - profile.cpp \ - config.cpp \ - helpdialog.cpp \ - mainwindow.cpp \ - tabbedbrowser.cpp \ - fontsettingsdialog.cpp - -HEADERS += helpwindow.h \ - topicchooser.h \ - docuparser.h \ - index.h \ - profile.h \ - helpdialog.h \ - mainwindow.h \ - tabbedbrowser.h \ - config.h \ - fontsettingsdialog.h - -RESOURCES += assistant.qrc - -contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE -DEFINES += QT_KEYWORDS -#DEFINES += QT_PALMTOPCENTER_DOCS - -win32 { - !wince*:LIBS += -lshell32 - RC_FILE = assistant.rc -} - -mac { - ICON = assistant.icns - TARGET = Assistant_adp - QMAKE_INFO_PLIST = Info_mac.plist -} - -target.path=$$[QT_INSTALL_BINS] -INSTALLS += target - -TRANSLATIONS = assistant_de.ts - -unix:!contains(QT_CONFIG, zlib):LIBS += -lz - -contains(CONFIG, static): { - win32 { - exists($$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.lib) { - QTPLUGIN += qjpeg - DEFINES += USE_STATIC_JPEG_PLUGIN - } - } else { - exists($$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.a) { - QTPLUGIN += qjpeg - DEFINES += USE_STATIC_JPEG_PLUGIN - } - } -} diff --git a/tools/assistant/compat/assistant.qrc b/tools/assistant/compat/assistant.qrc deleted file mode 100644 index dae1f48..0000000 --- a/tools/assistant/compat/assistant.qrc +++ /dev/null @@ -1,37 +0,0 @@ -<RCC> - <qresource prefix="/trolltech/assistant" > - <file>images/assistant-128.png</file> - <file>images/assistant.png</file> - <file>images/close.png</file> - <file>images/designer.png</file> - <file>images/linguist.png</file> - <file>images/mac/addtab.png</file> - <file>images/mac/book.png</file> - <file>images/mac/closetab.png</file> - <file>images/mac/editcopy.png</file> - <file>images/mac/find.png</file> - <file>images/mac/home.png</file> - <file>images/mac/next.png</file> - <file>images/mac/prev.png</file> - <file>images/mac/print.png</file> - <file>images/mac/synctoc.png</file> - <file>images/mac/whatsthis.png</file> - <file>images/mac/zoomin.png</file> - <file>images/mac/zoomout.png</file> - <file>images/qt.png</file> - <file>images/win/addtab.png</file> - <file>images/win/book.png</file> - <file>images/win/closetab.png</file> - <file>images/win/editcopy.png</file> - <file>images/win/find.png</file> - <file>images/win/home.png</file> - <file>images/win/next.png</file> - <file>images/win/previous.png</file> - <file>images/win/print.png</file> - <file>images/win/synctoc.png</file> - <file>images/win/whatsthis.png</file> - <file>images/win/zoomin.png</file> - <file>images/win/zoomout.png</file> - <file>images/wrap.png</file> - </qresource> -</RCC> diff --git a/tools/assistant/compat/assistant.rc b/tools/assistant/compat/assistant.rc deleted file mode 100644 index b4786ce..0000000 --- a/tools/assistant/compat/assistant.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "assistant.ico" diff --git a/tools/assistant/compat/compat.pro b/tools/assistant/compat/compat.pro deleted file mode 100644 index 1086f4c..0000000 --- a/tools/assistant/compat/compat.pro +++ /dev/null @@ -1,84 +0,0 @@ -include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri) - -TEMPLATE = app -LANGUAGE = C++ -TARGET = assistant_adp - -CONFIG += qt warn_on - -unix:contains(QT_CONFIG, dbus):QT += dbus - -build_all:!build_pass { - CONFIG -= build_all - CONFIG += release -} -QT += xml network - -PROJECTNAME = Assistant -DESTDIR = ../../../bin - -FORMS += helpdialog.ui \ - mainwindow.ui \ - tabbedbrowser.ui \ - topicchooser.ui - -SOURCES += main.cpp \ - helpwindow.cpp \ - topicchooser.cpp \ - docuparser.cpp \ - index.cpp \ - profile.cpp \ - config.cpp \ - helpdialog.cpp \ - mainwindow.cpp \ - tabbedbrowser.cpp \ - fontsettingsdialog.cpp - -HEADERS += helpwindow.h \ - topicchooser.h \ - docuparser.h \ - index.h \ - profile.h \ - helpdialog.h \ - mainwindow.h \ - tabbedbrowser.h \ - config.h \ - fontsettingsdialog.h - -RESOURCES += assistant.qrc - -contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE -DEFINES += QT_KEYWORDS -#DEFINES += QT_PALMTOPCENTER_DOCS - -win32 { - LIBS += -lshell32 - RC_FILE = assistant.rc -} - -mac { - ICON = assistant.icns - TARGET = Assistant_adp -# QMAKE_INFO_PLIST = Info_mac.plist -} - -target.path=$$[QT_INSTALL_BINS] -INSTALLS += target - -TRANSLATIONS = assistant_de.ts - -unix:!contains(QT_CONFIG, zlib):LIBS += -lz - -contains(CONFIG, static): { - win32 { - exists($$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.lib) { - QTPLUGIN += qjpeg - DEFINES += USE_STATIC_JPEG_PLUGIN - } - } else { - exists($$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.a) { - QTPLUGIN += qjpeg - DEFINES += USE_STATIC_JPEG_PLUGIN - } - } -} diff --git a/tools/assistant/compat/config.cpp b/tools/assistant/compat/config.cpp deleted file mode 100644 index 1faef42..0000000 --- a/tools/assistant/compat/config.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "config.h" -#include "profile.h" -#include "docuparser.h" - -#include <QApplication> -#include <QDesktopWidget> -#include <QLibraryInfo> -#include <QFont> -#include <QFontInfo> -#include <QDir> -#include <QFile> -#include <QFileInfo> -#include <QSettings> -#include <QList> - -QT_BEGIN_NAMESPACE - -static Config *static_configuration = 0; - -inline QString getVersionString() -{ - return QString::number( (QT_VERSION >> 16) & 0xff ) - + QLatin1String(".") + QString::number( (QT_VERSION >> 8) & 0xff ); -} - -Config::Config() - : profil( 0 ), hideSidebar( false ), rebuildDocs(true) -{ - if( !static_configuration ) { - static_configuration = this; - } else { - qWarning( "Multiple configurations not allowed!" ); - } -} - -Config *Config::loadConfig(const QString &profileFileName) -{ - Config *config = new Config(); - - if (profileFileName.isEmpty()) { // no profile - if (!config->defaultProfileExists()) { - config->profil = Profile::createDefaultProfile(); - config->saveProfile(config->profil); - } else { - config->profil = new Profile(); - } - config->loadDefaultProfile(); - config->load(); - return config; - } - - QFile file(profileFileName); - if (!file.exists()) { - qWarning( "File does not exist: %s", qPrintable(profileFileName) ); - return 0; - } - DocuParser *parser = DocuParser::createParser( profileFileName ); - if (!parser) { - qWarning( "Failed to create parser for file: %s", qPrintable(profileFileName) ); - return 0; - } - if (parser->parserVersion() < DocuParser::Qt320) { - qWarning( "File does not contain profile information" ); - return 0; - } - DocuParser320 *profileParser = static_cast<DocuParser320*>(parser); - parser->parse(&file); - config->profil = profileParser->profile(); - if (!config->profil) { - qWarning( "Config::loadConfig(), no profile in: %s", qPrintable(profileFileName) ); - return 0; - } - config->profil->setProfileType(Profile::UserProfile); - config->profil->setDocuParser(profileParser); - config->load(); - return config; -} - -Config *Config::configuration() -{ - Q_ASSERT( static_configuration ); - return static_configuration; -} - -void Config::load() -{ - const QString key = getVersionString() + QLatin1String("/"); - - bool isDefaultProfile = profil->props[QLatin1String("name")] == QLatin1String("default"); - const QString pKey = isDefaultProfile ? QString::fromLatin1(QT_VERSION_STR) - : getVersionString(); - - const QString profkey = pKey + QLatin1String("/Profile/") + profil->props[QLatin1String("name")] + QLatin1String("/"); - - QSettings settings; - - home = profil->props[QLatin1String("startpage")];; - if (home.isEmpty() && isDefaultProfile) - home = QLibraryInfo::location(QLibraryInfo::DocumentationPath) + QLatin1String("/html/index.html"); - src = settings.value( profkey + QLatin1String("Source") ).toStringList(); - sideBar = settings.value( key + QLatin1String("SideBarPage") ).toInt(); - if (qApp->type() != QApplication::Tty) - winGeometry = settings.value(key + QLatin1String("windowGeometry")).toByteArray(); - - mainWinState = settings.value(key + QLatin1String("MainWindowState")).toByteArray(); - pointFntSize = settings.value(key + QLatin1String("FontSize"), qApp->font().pointSizeF()).toDouble(); - rebuildDocs = settings.value( key + QLatin1String("RebuildDocDB"), true ).toBool(); - - profileNames = settings.value( key + QLatin1String("Profile") ).toStringList(); - - m_fontSettings.windowFont = qVariantValue<QFont>(settings.value(key + QLatin1String("windowfont"), qApp->font())); - m_fontSettings.browserFont = qVariantValue<QFont>(settings.value(key + QLatin1String("browserfont"), qApp->font())); - m_fontSettings.useWindowFont = settings.value(key + QLatin1String("usewindowfont"), false).toBool(); - m_fontSettings.useBrowserFont = settings.value(key + QLatin1String("usebrowserfont"), false).toBool(); - m_fontSettings.windowWritingSystem = static_cast<QFontDatabase::WritingSystem>( - settings.value(key + QLatin1String("windowwritingsystem"), QFontDatabase::Latin).toInt()); - m_fontSettings.browserWritingSystem = static_cast<QFontDatabase::WritingSystem>( - settings.value(key + QLatin1String("browserwritingsystem"), QFontDatabase::Latin).toInt()); - - m_fontSettings.browserFont.setPointSizeF(pointFntSize); -} - -void Config::save() -{ - saveSettings(); - saveProfile( profil ); -} - -void Config::saveSettings() -{ - const QString key = getVersionString() + QLatin1String("/"); - - const QString pKey = (profil->props[QLatin1String("name")] == QLatin1String("default")) - ? QString::fromLatin1(QT_VERSION_STR) - : getVersionString(); - - const QString profkey = pKey + QLatin1String("/Profile/") + profil->props[QLatin1String("name")] + QLatin1String("/"); - - QSettings settings; - - settings.setValue( profkey + QLatin1String("Source"), src ); - settings.setValue( key + QLatin1String("SideBarPage"), sideBarPage() ); - if (qApp->type() != QApplication::Tty) - settings.setValue(key + QLatin1String("windowGeometry"), winGeometry); - - settings.setValue( key + QLatin1String("MainWindowState"), mainWinState ); - settings.setValue( key + QLatin1String("FontSize"), pointFntSize); - settings.setValue( key + QLatin1String("RebuildDocDB"), rebuildDocs ); - - settings.setValue(key + QLatin1String("windowfont"), m_fontSettings.windowFont); - settings.setValue(key + QLatin1String("browserfont"), m_fontSettings.browserFont); - settings.setValue(key + QLatin1String("usewindowfont"), m_fontSettings.useWindowFont); - settings.setValue(key + QLatin1String("usebrowserfont"), m_fontSettings.useBrowserFont); - settings.setValue(key + QLatin1String("windowwritingsystem"), m_fontSettings.windowWritingSystem); - settings.setValue(key + QLatin1String("browserwritingsystem"), m_fontSettings.browserWritingSystem); -} - -#ifdef ASSISTANT_DEBUG -static void dumpmap( const QMap<QString,QString> &m, const QString &header ) -{ - qDebug( header ); - QMap<QString,QString>::ConstIterator it = m.begin(); - while (it != m.end()) { - qDebug( " " + it.key() + ":\t\t" + *it ); - ++it; - } -} -#endif - -bool Config::defaultProfileExists() -{ - QSettings settings; - const QString profKey = QLatin1String(QT_VERSION_STR) + QLatin1String("/Profile/default/"); - - if (settings.contains(profKey + QLatin1String("DocFiles")) - && settings.contains(profKey + QLatin1String("Titles")) - && settings.contains(profKey + QLatin1String("ImageDirs"))) { - QStringList dcfs = settings.value(profKey + QLatin1String("DocFiles") ).toStringList(); - foreach (QString file, dcfs) { - if (file == Profile::storableFilePath(file)) - return true; - } - } - return false; -} - -void Config::loadDefaultProfile() -{ - QSettings settings; - const QString profKey = QLatin1String(QT_VERSION_STR) + QLatin1String("/Profile/default/"); - - if (!defaultProfileExists()) - return; - - // Override the defaults with settings in registry. - profil->icons.clear(); - profil->indexPages.clear(); - profil->imageDirs.clear(); - profil->docs.clear(); - profil->dcfTitles.clear(); - - QStringList titles = settings.value( profKey + QLatin1String("Titles") ).toStringList(); - QStringList iconLst = settings.value( profKey + QLatin1String("DocIcons") ).toStringList(); - QStringList indexLst = settings.value( profKey + QLatin1String("IndexPages") ).toStringList(); - QStringList imgDirLst = settings.value( profKey + QLatin1String("ImageDirs") ).toStringList(); - QStringList dcfs = settings.value( profKey + QLatin1String("DocFiles") ).toStringList(); - profil->props[QLatin1String("name")] = QLatin1String("default"); - - QString filePath; - QStringList::ConstIterator it = titles.constBegin(); - QStringList::ConstIterator iconIt = iconLst.constBegin(); - QStringList::ConstIterator indexIt = indexLst.constBegin(); - QStringList::ConstIterator imageIt = imgDirLst.constBegin(); - QStringList::ConstIterator dcfIt = dcfs.constBegin(); - while((it != titles.constEnd()) - && (iconIt != iconLst.constEnd()) - && (indexIt != indexLst.constEnd()) - && (imageIt != imgDirLst.constEnd()) - && (dcfIt != dcfs.constEnd())) { - profil->addDCFIcon( *it, *iconIt ); - profil->addDCFIndexPage(*it, Profile::loadableFilePath(*indexIt)); - profil->addDCFImageDir( *it, *imageIt ); - profil->addDCFTitle(Profile::loadableFilePath(*dcfIt), *it); - ++it, ++iconIt, ++indexIt, ++imageIt, ++dcfIt; - } -#if ASSISTANT_DEBUG - dumpmap( profil->icons, QLatin1String("Icons") ); - dumpmap( profil->indexPages, QLatin1String("IndexPages") ); - dumpmap( profil->imageDirs, QLatin1String("ImageDirs") ); - dumpmap( profil->dcfTitles, QLatin1String("dcfTitles") ); - qDebug( "Docfiles: \n " + profil->docs.join( "\n " ) ); -#endif -} - -void Config::saveProfile( Profile *profile ) -{ - if (profil->profileType() == Profile::UserProfile) - return; - - const QString key = (profile->props[QLatin1String("name")] == QLatin1String("default")) - ? QString::fromLatin1(QT_VERSION_STR) - : getVersionString(); - - const QString profKey = key + QLatin1String("/Profile/") + profile->props[QLatin1String("name")] + QLatin1String("/"); - - QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath).replace(QLatin1String("\\"), QLatin1String("/")); - QStringList indexes, icons, imgDirs, dcfs; - QStringList titles = profile->dcfTitles.keys(); - QStringList::ConstIterator it = titles.constBegin(); - QString filePath; - for ( ; it != titles.constEnd(); ++it ) { - - indexes << Profile::storableFilePath(profile->indexPages[*it]); - icons << profile->icons[*it]; - imgDirs << profile->imageDirs[*it]; - dcfs << Profile::storableFilePath(profile->dcfTitles[*it]); - } - - QSettings settings; - settings.setValue( profKey + QLatin1String("Titles"), titles ); - settings.setValue( profKey + QLatin1String("DocFiles"), dcfs ); - settings.setValue( profKey + QLatin1String("IndexPages"), indexes ); - settings.setValue( profKey + QLatin1String("DocIcons"), icons ); - settings.setValue( profKey + QLatin1String("ImageDirs"), imgDirs ); - -#if ASSISTANT_DEBUG - qDebug() << "Titles:\n - " << ((QStringList*)&titles)->join("\n - "); - qDebug() << "Docfiles:\n - " << dcfs.join("\n - " ); - qDebug() << "IndexPages:\n - " << indexes.join("\n - "); - qDebug() << "DocIcons:\n - " << icons.join("\n - " ); - qDebug() << "ImageDirs:\n - " << imgDirs.join("\n - " ); -#endif -} - -QStringList Config::mimePaths() -{ - static QStringList lst; - - if( lst.count() > 0 ) - return lst; - - for (QMap<QString,QString>::ConstIterator it = profil->dcfTitles.constBegin(); - it != profil->dcfTitles.constEnd(); ++it ) { - - // Mime source for .dcf file path - QFileInfo info( *it ); - QString dcfPath = info.absolutePath(); - if (!lst.contains(dcfPath)) - lst << dcfPath; - - // Image dir for .dcf - QString imgDir = QDir::toNativeSeparators( dcfPath + QDir::separator() - + profil->imageDirs[it.key()] ); - if (!lst.contains(imgDir)) - lst << imgDir; - } - return lst; -} - -QStringList Config::profiles() const -{ - return profileNames; -} - -QString Config::title() const -{ - QString s = profil->props[QLatin1String("title")]; - if (s.isEmpty()) - s = QObject::tr("Qt Assistant by Nokia"); - return s; -} - -QString Config::aboutApplicationMenuText() const -{ - return profil->props[QLatin1String("aboutmenutext")]; -} - -QString Config::aboutURL() const -{ - return profil->props[QLatin1String("abouturl")]; -} - -QString Config::homePage() const -{ - return home.isEmpty() ? profil->props[QLatin1String("startpage")] : home; -} - -QStringList Config::source() const -{ - return src.size() == 0 ? QStringList(profil->props[QLatin1String("startpage")]) : src; -} - -QStringList Config::docFiles() const -{ - return profil->docs; -} - -QPixmap Config::docIcon( const QString &title ) const -{ - // ### To allow qdoc generated dcf files to reference the doc icons from qmake_image_col - QString name = profil->icons[title]; - QString resName = QLatin1String(":/trolltech/assistant/images/") + name; - - if (QFile::exists(resName)) - return QPixmap(resName); - - if (name.startsWith(QLatin1String("file:"))) - name = name.mid(5); - return QPixmap(name); -} - -QPixmap Config::applicationIcon() const -{ - QString name = profil->props[QLatin1String("applicationicon")]; - QString resName = QLatin1String(":/trolltech/assistant/images/") + name; - - if (QFile::exists(resName)) - return QPixmap(resName); - - if (name.startsWith(QLatin1String("file:"))) - name = name.mid(5); - return QPixmap(name); -} - -QStringList Config::docTitles() const -{ - return QStringList(profil->indexPages.keys()); -} - -QString Config::docImageDir( const QString &docfile ) const -{ - return profil->imageDirs[docfile]; -} - -QString Config::indexPage( const QString &title ) const -{ - return profil->indexPages[title]; -} - -void Config::hideSideBar( bool b ) -{ - hideSidebar = b; -} - -bool Config::sideBarHidden() const -{ - return hideSidebar; -} - -QString Config::assistantDocPath() const -{ - return profil->props[QLatin1String("assistantdocs")].isEmpty() - ? QLibraryInfo::location(QLibraryInfo::DocumentationPath) + QLatin1String("/html") - : profil->props[QLatin1String("assistantdocs")]; -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/config.h b/tools/assistant/compat/config.h deleted file mode 100644 index 498e6bb..0000000 --- a/tools/assistant/compat/config.h +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "profile.h" - -#include <QString> -#include <QStringList> -#include <QPixmap> -#include <QMap> - -#include <QtGui/QFont> -#include <QtGui/QFontDatabase> - -QT_BEGIN_NAMESPACE - -class Profile; - -struct FontSettings -{ - FontSettings() : useWindowFont(false), useBrowserFont(false), - windowWritingSystem(QFontDatabase::Latin), browserWritingSystem(QFontDatabase::Latin) - { } - - QFont windowFont; - QFont browserFont; - - bool useWindowFont; - bool useBrowserFont; - - QFontDatabase::WritingSystem windowWritingSystem; - QFontDatabase::WritingSystem browserWritingSystem; -}; - -class Config -{ -public: - - Config(); - - void load(); - void save(); - Profile *profile() const { return profil; } - QString profileName() const { return profil->props[QLatin1String("name")]; } - bool validProfileName() const; - void hideSideBar( bool b ); - bool sideBarHidden() const; - QStringList mimePaths(); - - // From profile, read only - QStringList docFiles() const; - QStringList docTitles() const; - QString indexPage( const QString &title ) const; - QString docImageDir( const QString &title ) const; - QPixmap docIcon( const QString &title ) const; - - QStringList profiles() const; - QString title() const; - QString aboutApplicationMenuText() const; - QString aboutURL() const; - QPixmap applicationIcon() const; - - // From QSettings, read / write - QString homePage() const; - void setHomePage( const QString &hom ) { home = hom; } - - QStringList source() const; - void setSource( const QStringList &s ) { src = s; } - - int sideBarPage() const { return sideBar; } - void setSideBarPage( int sbp ) { sideBar = sbp; } - - QByteArray windowGeometry() const { return winGeometry; } - void setWindowGeometry( const QByteArray &geometry ) { winGeometry = geometry; } - - QByteArray mainWindowState() const { return mainWinState; } - void setMainWindowState( const QByteArray &state ) { mainWinState = state; } - - qreal fontPointSize() const { return pointFntSize; } - void setFontPointSize(qreal size) - { - pointFntSize = size; - m_fontSettings.useBrowserFont = true; - m_fontSettings.browserFont.setPointSizeF(size); - } - - FontSettings fontSettings() { return m_fontSettings; } - void setFontSettings(const FontSettings &settings) { m_fontSettings = settings; } - - QString assistantDocPath() const; - - bool docRebuild() const { return rebuildDocs; } - void setDocRebuild( bool rb ) { rebuildDocs = rb; } - - void saveProfile( Profile *profile ); - void loadDefaultProfile(); - bool defaultProfileExists(); - - static Config *configuration(); - static Config *loadConfig(const QString &profileFileName); - -private: - Config( const Config &c ); - Config& operator=( const Config &c ); - - void saveSettings(); - -private: - Profile *profil; - - QStringList profileNames; - QString home; - QStringList src; - QByteArray mainWinState; - QByteArray winGeometry; - qreal pointFntSize; - int sideBar; - bool hideSidebar; - bool rebuildDocs; - FontSettings m_fontSettings; -}; - -QT_END_NAMESPACE - -#endif // CONFIG_H diff --git a/tools/assistant/compat/docuparser.cpp b/tools/assistant/compat/docuparser.cpp deleted file mode 100644 index db2f824..0000000 --- a/tools/assistant/compat/docuparser.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "docuparser.h" -#include "profile.h" - -#include <QDir> -#include <QFile> -#include <QFileInfo> -#include <QRegExp> -#include <QString> -#include <QDataStream> - -QT_BEGIN_NAMESPACE - -QDataStream &operator>>(QDataStream &s, ContentItem &ci) -{ - s >> ci.title; - s >> ci.reference; - s >> ci.depth; - return s; -} - -QDataStream &operator<<(QDataStream &s, const ContentItem &ci) -{ - s << ci.title; - s << ci.reference; - s << ci.depth; - return s; -} - -const QString DocuParser::DocumentKey = QLatin1String("/Qt Assistant/") + QLatin1String(QT_VERSION_STR) + QLatin1String("/"); - -DocuParser *DocuParser::createParser(const QString &fileName) -{ - QFile file(fileName); - if(!file.open(QFile::ReadOnly)) { - return 0; - } - - QString str; - int maxlen = 1024; - int majVer = 0, minVer = 0, serVer = 0; - static QRegExp re(QLatin1String("assistantconfig +version=\"(\\d)\\.(\\d)\\.(\\d)\""), Qt::CaseInsensitive); - Q_ASSERT(re.isValid()); - while(!(str = QLatin1String(file.readLine(maxlen))).isEmpty()) { - if(re.indexIn(str) >= 0) { - majVer = re.cap(1).toInt(); - minVer = re.cap(2).toInt(); - serVer = re.cap(3).toInt(); - break; - } - } - - if (majVer < 3 || (majVer == 3 && minVer < 2)) { - return new DocuParser310; - } - - return new DocuParser320; -} - - -bool DocuParser::parse(QFile *file) -{ - QXmlInputSource source(file); - QXmlSimpleReader reader; - reader.setContentHandler(this); - reader.setErrorHandler(this); - setFileName(QFileInfo(*file).absoluteFilePath()); - return reader.parse(source); -} - - -QString DocuParser::errorProtocol() const -{ - return errorProt; -} - - -QList<ContentItem> DocuParser::getContentItems() -{ - return contentList; -} - - -QList<IndexItem*> DocuParser::getIndexItems() -{ - return indexList; -} - -QString DocuParser::absolutify(const QString &name, bool makeUrl) const -{ - if (!name.isEmpty()) { - QString s = name; - s.replace(QLatin1String("\\"), QLatin1String("/")); - QFileInfo orgPath(name); - if(orgPath.isRelative()) - s = QFileInfo(fname).path() + QLatin1Char('/') + name; - if (makeUrl) - s.prepend(QLatin1String("file:")); - return s; - } - return name; -} - - -void DocuParser310::addTo(Profile *p) -{ - p->addDCFTitle(fname, docTitle); - p->addDCFIcon(docTitle, iconName); - p->addDCFIndexPage(docTitle, conURL); -} - - -bool DocuParser310::startDocument() -{ - state = StateInit; - errorProt = QLatin1String(""); - - contentRef = QLatin1String(""); - indexRef = QLatin1String(""); - depth = 0; - - contentList.clear(); - qDeleteAll(indexList); - indexList.clear(); - - return true; -} - - -bool DocuParser310::startElement(const QString &, const QString &, - const QString &qname, - const QXmlAttributes &attr) -{ - if (qname == QLatin1String("DCF") && state == StateInit) { - state = StateContent; - contentRef = absolutify(attr.value(QLatin1String("ref")), false); - conURL = contentRef; - docTitle = attr.value(QLatin1String("title")); - iconName = absolutify(attr.value(QLatin1String("icon")), false); - contentList.append(ContentItem(docTitle, absolutify(contentRef), depth)); - } else if (qname == QLatin1String("section") && (state == StateContent || state == StateSect)) { - state = StateSect; - contentRef = absolutify(attr.value(QLatin1String("ref"))); - title = attr.value(QLatin1String("title")); - depth++; - contentList.append(ContentItem(title, contentRef, depth)); - } else if (qname == QLatin1String("keyword") && state == StateSect) { - state = StateKeyword; - indexRef = absolutify(attr.value(QLatin1String("ref"))); - } else - return false; - return true; -} - -bool DocuParser310::endElement(const QString &nameSpace, const QString &localName, - const QString &qName) -{ - Q_UNUSED(nameSpace); - Q_UNUSED(localName); - Q_UNUSED(qName); - - switch(state) { - case StateInit: - break; - case StateContent: - state = StateInit; - break; - case StateSect: - state = --depth ? StateSect : StateContent; - break; - case StateKeyword: - state = StateSect; - break; - default: - break; - } - return true; -} - - -bool DocuParser310::characters(const QString& ch) -{ - QString str = ch.simplified(); - if (str.isEmpty()) - return true; - - switch (state) { - case StateInit: - case StateContent: - case StateSect: - return false; - break; - case StateKeyword: - indexList.append(new IndexItem(str, indexRef)); - break; - default: - return false; - } - return true; -} - - -bool DocuParser310::fatalError(const QXmlParseException& exception) -{ - errorProt += QString::fromLatin1("fatal parsing error: %1 in line %2, column %3\n") - .arg(exception.message()) - .arg(exception.lineNumber()) - .arg(exception.columnNumber()); - - return QXmlDefaultHandler::fatalError(exception); -} - - -DocuParser320::DocuParser320() - : prof(new Profile) -{ -} - - -void DocuParser320::addTo(Profile *p) -{ - QMap<QString,QString>::ConstIterator it; - - for (it = prof->dcfTitles.constBegin(); it != prof->dcfTitles.constEnd(); ++it) - p->dcfTitles[it.key()] = *it; - - for (it = prof->icons.constBegin(); it != prof->icons.constEnd(); ++it) - p->icons[it.key()] = *it; - - for (it = prof->indexPages.constBegin(); it != prof->indexPages.constEnd(); ++it) - p->indexPages[it.key()] = *it; -} - - -bool DocuParser320::startDocument() -{ - state = StateInit; - errorProt = QLatin1String(""); - - contentRef = QLatin1String(""); - indexRef = QLatin1String(""); - depth = 0; - contentList.clear(); - indexList.clear(); - - prof->addDCF(fname); - - return true; -} - -bool DocuParser320::startElement(const QString &, const QString &, - const QString &qname, - const QXmlAttributes &attr) -{ - QString lower = qname.toLower(); - - switch(state) { - - case StateInit: - if(lower == QLatin1String("assistantconfig")) - state = StateDocRoot; - break; - - case StateDocRoot: - if(lower == QLatin1String("dcf")) { - state = StateContent; - contentRef = absolutify(attr.value(QLatin1String("ref"))); - conURL = contentRef; - docTitle = attr.value(QLatin1String("title")); - iconName = absolutify(attr.value(QLatin1String("icon"))); - contentList.append(ContentItem(docTitle, contentRef, depth)); - } else if(lower == QLatin1String("profile")) { - state = StateProfile; - } - break; - - case StateSect: - if (lower == QLatin1String("keyword") && state == StateSect) { - state = StateKeyword; - indexRef = absolutify(attr.value(QLatin1String("ref"))); - break; - } // else if (lower == "section") - case StateContent: - if(lower == QLatin1String("section")) { - state = StateSect; - contentRef = absolutify(attr.value(QLatin1String("ref"))); - title = attr.value(QLatin1String("title")); - depth++; - contentList.append(ContentItem(title, contentRef, depth)); - } - break; - - case StateProfile: - if(lower == QLatin1String("property")) { - state = StateProperty; - propertyName = attr.value(QLatin1String("name")); - } - break; - - case StateProperty: - break; - - default: - break; - } - - return true; -} - -bool DocuParser320::endElement(const QString &nameSpace, - const QString &localName, - const QString &qName) -{ - Q_UNUSED(nameSpace); - Q_UNUSED(localName); - Q_UNUSED(qName); - - switch(state) { - case StateInit: - break; - case StateDocRoot: - state = StateInit; - break; - case StateProfile: - state = StateDocRoot; - break; - case StateProperty: - state = StateProfile; - if(propertyName.isEmpty() || propertyValue.isEmpty()) - return false; - { - static const QStringList lst = QStringList() - << QLatin1String("startpage") << QLatin1String("abouturl") - << QLatin1String("applicationicon") << QLatin1String("assistantdocs"); - - if (lst.contains(propertyName)) - propertyValue = absolutify(propertyValue); - } - prof->addProperty(propertyName, propertyValue); - break; - case StateContent: - if(!iconName.isEmpty()) - prof->addDCFIcon(docTitle, iconName); - if(contentRef.isEmpty()) - return false; - prof->addDCFIndexPage(docTitle, conURL); - prof->addDCFTitle(fname, docTitle); - state = StateDocRoot; - break; - case StateSect: - state = --depth ? StateSect : StateContent; - break; - case StateKeyword: - state = StateSect; - break; - } - return true; -} - -bool DocuParser320::characters(const QString& ch) -{ - QString str = ch.simplified(); - if (str.isEmpty()) - return true; - - switch (state) { - case StateInit: - case StateContent: - case StateSect: - return false; - break; - case StateKeyword: - indexList.append(new IndexItem(str, indexRef)); - break; - case StateProperty: - propertyValue = ch; - break; - default: - return false; - } - return true; -} - -bool DocuParser320::fatalError(const QXmlParseException& exception) -{ - errorProt += QString::fromLatin1("fatal parsing error: %1 in line %2, column %3\n") - .arg(exception.message()) - .arg(exception.lineNumber()) - .arg(exception.columnNumber()); - return QXmlDefaultHandler::fatalError(exception); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/docuparser.h b/tools/assistant/compat/docuparser.h deleted file mode 100644 index 7c7692e..0000000 --- a/tools/assistant/compat/docuparser.h +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DOCUPARSER_H -#define DOCUPARSER_H - -#include <QList> -#include <QMap> -#include <QXmlDefaultHandler> -#include <QXmlAttributes> -#include <QXmlParseException> - -QT_BEGIN_NAMESPACE - -class Profile; - -struct ContentItem { - ContentItem() - : title( QString() ), reference( QString() ), depth( 0 ) {} - ContentItem( const QString &t, const QString &r, int d ) - : title( t ), reference( r ), depth( d ) {} - QString title; - QString reference; - int depth; - Q_DUMMY_COMPARISON_OPERATOR(ContentItem) -}; - -QDataStream &operator>>( QDataStream &s, ContentItem &ci ); -QDataStream &operator<<( QDataStream &s, const ContentItem &ci ); - -struct IndexItem { - IndexItem( const QString &k, const QString &r ) - : keyword( k ), reference( r ) {} - QString keyword; - QString reference; -}; - - - -class DocuParser : public QXmlDefaultHandler -{ -public: - enum ParserVersion { Qt310, Qt320 }; - // Since We don't want problems with documentation - // from version to version, this string stores the correct - // version string to save documents. - static const QString DocumentKey; - - static DocuParser *createParser( const QString &fileName ); - - virtual bool parse( QFile *file ); - - QList<ContentItem> getContentItems(); - QList<IndexItem*> getIndexItems(); - - QString errorProtocol() const; - QString contentsURL() const { return conURL; } - - virtual ParserVersion parserVersion() const = 0; - virtual void addTo( Profile *p ) = 0; - - QString fileName() const { return fname; } - void setFileName( const QString &file ) { fname = file; } - -protected: - QString absolutify( const QString &input, bool makeUrl = true ) const; - - QString contentRef, indexRef, errorProt, conURL; - QString docTitle, title, iconName; - QList<ContentItem> contentList; - QList<IndexItem*> indexList; - QString fname; -}; - - -class DocuParser310 : public DocuParser -{ -public: - enum States{ StateInit, StateContent, StateSect, StateKeyword }; - - bool startDocument(); - bool startElement( const QString&, const QString&, const QString& , - const QXmlAttributes& ); - bool endElement( const QString&, const QString&, const QString& ); - bool characters( const QString & ); - bool fatalError( const QXmlParseException& exception ); - - virtual ParserVersion parserVersion() const { return Qt310; } - virtual void addTo( Profile *p ); - -private: - States state; - int depth; -}; - - -class DocuParser320 : public DocuParser -{ -public: - enum States { StateInit, StateDocRoot, StateProfile, StateProperty, - StateContent, StateSect, StateKeyword }; - - DocuParser320(); - - bool startDocument(); - bool startElement( const QString&, const QString&, const QString& , - const QXmlAttributes& ); - bool endElement( const QString&, const QString&, const QString& ); - bool characters( const QString & ); - bool fatalError( const QXmlParseException& exception ); - - virtual ParserVersion parserVersion() const { return Qt320; } - virtual void addTo( Profile *p ); - Profile *profile() const { return prof; } - -private: - - States state; - int depth; - int docfileCounter; - QString propertyValue; - QString propertyName; - Profile *prof; -}; - -QT_END_NAMESPACE - -#endif // DOCUPARSER_H diff --git a/tools/assistant/compat/fontsettingsdialog.cpp b/tools/assistant/compat/fontsettingsdialog.cpp deleted file mode 100644 index 31a3241..0000000 --- a/tools/assistant/compat/fontsettingsdialog.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "fontsettingsdialog.h" -#include "fontpanel.h" -#include "config.h" - -#include <QtGui/QLabel> -#include <QtGui/QComboBox> -#include <QtGui/QHBoxLayout> -#include <QtGui/QVBoxLayout> -#include <QtGui/QApplication> -#include <QtGui/QStackedWidget> -#include <QtGui/QDialogButtonBox> - -QT_BEGIN_NAMESPACE - -FontSettingsDialog::FontSettingsDialog(QWidget *parent) - : QDialog(parent) - , m_windowFontPanel(new FontPanel(this)) - , m_browserFontPanel(new FontPanel(this)) - , m_dialogButtonBox(new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel)) -{ - setModal(true); - setWindowTitle(tr("Font Settings")); - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - - QVBoxLayout *mainVLayout = new QVBoxLayout(this); - QHBoxLayout *hboxLayout = new QHBoxLayout; - mainVLayout->addLayout(hboxLayout); - - QLabel *label = new QLabel(tr("Font settings for:"), this); - label->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - hboxLayout->addWidget(label); - QComboBox *comboBox = new QComboBox(this); - comboBox->addItem(tr("Browser")); - comboBox->addItem(tr("Application")); - hboxLayout->addWidget(comboBox); - - m_windowFontPanel->setCheckable(true); - m_browserFontPanel->setCheckable(true); - - const QString customSettings(tr("Use custom settings")); - m_windowFontPanel->setTitle(customSettings); - m_browserFontPanel->setTitle(customSettings); - - QStackedWidget *stackWidget = new QStackedWidget(this); - stackWidget->addWidget(m_browserFontPanel); - stackWidget->addWidget(m_windowFontPanel); - - mainVLayout->addWidget(stackWidget); - mainVLayout->addWidget(m_dialogButtonBox); - - connect(m_dialogButtonBox , SIGNAL(rejected()), this, SLOT(reject())); - connect(m_dialogButtonBox , SIGNAL(accepted()), this, SLOT(accept())); - connect(comboBox, SIGNAL(activated(int)), stackWidget, SLOT(setCurrentIndex(int))); -} - -FontSettingsDialog::~FontSettingsDialog() -{ - // nothing todo -} - -bool FontSettingsDialog::showDialog(FontSettings *settings) -{ - setupFontSettingsDialog(settings); - - if (exec() != Accepted) - return false; - - updateFontSettings(settings); - return true; -} - -void FontSettingsDialog::updateFontSettings(FontSettings *settings) -{ - settings->useWindowFont = m_windowFontPanel->isChecked(); - settings->useBrowserFont = m_browserFontPanel->isChecked(); - - settings->windowFont = settings->useWindowFont ? m_windowFontPanel->selectedFont() : qApp->font(); - settings->browserFont = settings->useBrowserFont ? m_browserFontPanel->selectedFont() : qApp->font(); - - settings->windowWritingSystem = settings->useWindowFont ? m_windowFontPanel->writingSystem() : QFontDatabase::Latin; - settings->browserWritingSystem = settings->useBrowserFont ? m_browserFontPanel->writingSystem() : QFontDatabase::Latin; -} - -void FontSettingsDialog::setupFontSettingsDialog(const FontSettings *settings) -{ - m_windowFontPanel->setSelectedFont(settings->windowFont); - m_browserFontPanel->setSelectedFont(settings->browserFont); - - m_windowFontPanel->setWritingSystem(settings->windowWritingSystem); - m_browserFontPanel->setWritingSystem(settings->browserWritingSystem); - - m_windowFontPanel->setChecked(settings->useWindowFont); - m_browserFontPanel->setChecked(settings->useBrowserFont); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/helpdialog.cpp b/tools/assistant/compat/helpdialog.cpp deleted file mode 100644 index 23c1bfc..0000000 --- a/tools/assistant/compat/helpdialog.cpp +++ /dev/null @@ -1,1331 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "helpdialog.h" -#include "helpwindow.h" -#include "topicchooser.h" -#include "docuparser.h" -#include "mainwindow.h" -#include "config.h" -#include "tabbedbrowser.h" - -#include <QtGui> -#include <QtDebug> -#include <QtCore/QVarLengthArray> - -#include <stdlib.h> -#include <limits.h> - -QT_BEGIN_NAMESPACE - -enum -{ - LinkRole = Qt::UserRole + 1000 -}; - -static bool verifyDirectory(const QString &str) -{ - QFileInfo dirInfo(str); - if (!dirInfo.exists()) - return QDir().mkdir(str); - if (!dirInfo.isDir()) { - qWarning("'%s' exists but is not a directory", str.toLatin1().constData()); - return false; - } - return true; -} - -struct IndexKeyword { - IndexKeyword(const QString &kw, const QString &l) - : keyword(kw), link(l) {} - IndexKeyword() : keyword(QString()), link(QString()) {} - bool operator<(const IndexKeyword &ik) const { - return keyword.toLower() < ik.keyword.toLower(); - } - bool operator<=(const IndexKeyword &ik) const { - return keyword.toLower() <= ik.keyword.toLower(); - } - bool operator>(const IndexKeyword &ik) const { - return keyword.toLower() > ik.keyword.toLower(); - } - Q_DUMMY_COMPARISON_OPERATOR(IndexKeyword) - QString keyword; - QString link; -}; - -QDataStream &operator>>(QDataStream &s, IndexKeyword &ik) -{ - s >> ik.keyword; - s >> ik.link; - return s; -} - -QDataStream &operator<<(QDataStream &s, const IndexKeyword &ik) -{ - s << ik.keyword; - s << ik.link; - return s; -} - -QValidator::State SearchValidator::validate(QString &str, int &) const -{ - for (int i = 0; i < (int) str.length(); ++i) { - QChar c = str[i]; - if (!c.isLetterOrNumber() && c != QLatin1Char('\'') && c != QLatin1Char('`') - && c != QLatin1Char('\"') && c != QLatin1Char(' ') && c != QLatin1Char('-') && c != QLatin1Char('_') - && c!= QLatin1Char('*')) - return QValidator::Invalid; - } - return QValidator::Acceptable; -} - -class IndexListModel: public QStringListModel -{ -public: - IndexListModel(QObject *parent = 0) - : QStringListModel(parent) {} - - void clear() { contents.clear(); setStringList(QStringList()); } - - QString description(int index) const { return stringList().at(index); } - QStringList links(int index) const { return contents.values(stringList().at(index)); } - void addLink(const QString &description, const QString &link) { contents.insert(description, link); } - - void publish() { filter(QString(), QString()); } - - QModelIndex filter(const QString &s, const QString &real); - - virtual Qt::ItemFlags flags(const QModelIndex &index) const - { return QStringListModel::flags(index) & ~Qt::ItemIsEditable; } - -private: - QMultiMap<QString, QString> contents; -}; - -bool caseInsensitiveLessThan(const QString &as, const QString &bs) -{ - const QChar *a = as.unicode(); - const QChar *b = bs.unicode(); - if (a == 0) - return true; - if (b == 0) - return false; - if (a == b) - return false; - int l=qMin(as.length(),bs.length()); - while (l-- && QChar::toLower(a->unicode()) == QChar::toLower(b->unicode())) - a++,b++; - if (l==-1) - return (as.length() < bs.length()); - return QChar::toLower(a->unicode()) < QChar::toLower(b->unicode()); -} - -/** - * \a real is kinda a hack for the smart search, need a way to match a regexp to an item - * How would you say the best match for Q.*Wiget is QWidget? - */ -QModelIndex IndexListModel::filter(const QString &s, const QString &real) -{ - QStringList list; - - int goodMatch = -1; - int perfectMatch = -1; - if (s.isEmpty()) - perfectMatch = 0; - - const QRegExp regExp(s, Qt::CaseInsensitive); - QMultiMap<QString, QString>::iterator it = contents.begin(); - QString lastKey; - for (; it != contents.end(); ++it) { - if (it.key() == lastKey) - continue; - lastKey = it.key(); - const QString key = it.key(); - if (key.contains(regExp) || key.contains(s, Qt::CaseInsensitive)) { - list.append(key); - if (perfectMatch == -1 && (key.startsWith(real, Qt::CaseInsensitive))) { - if (goodMatch == -1) - goodMatch = list.count() - 1; - if (real.length() == key.length()){ - perfectMatch = list.count() - 1; - } - } else if (perfectMatch > -1 && s == key) { - perfectMatch = list.count() - 1; - } - } - } - - int bestMatch = perfectMatch; - if (bestMatch == -1) - bestMatch = goodMatch; - bestMatch = qMax(0, bestMatch); - - // sort the new list - QString match; - if (bestMatch >= 0 && list.count() > bestMatch) - match = list[bestMatch]; - qSort(list.begin(), list.end(), caseInsensitiveLessThan); - setStringList(list); - for (int i = 0; i < list.size(); ++i) { - if (list.at(i) == match){ - bestMatch = i; - break; - } - } - return index(bestMatch, 0, QModelIndex()); -} - -HelpNavigationListItem::HelpNavigationListItem(QListWidget *ls, const QString &txt) - : QListWidgetItem(txt, ls) -{ -} - -void HelpNavigationListItem::addLink(const QString &link) -{ - QString lnk = HelpDialog::removeAnchorFromLink(link); - if (linkList.filter(lnk, Qt::CaseInsensitive).count() > 0) - return; - linkList << link; -} - -HelpDialog::HelpDialog(QWidget *parent, MainWindow *h) - : QWidget(parent), lwClosed(false), help(h) -{ - ui.setupUi(this); - ui.listContents->setUniformRowHeights(true); - ui.listContents->header()->setStretchLastSection(false); - ui.listContents->header()->setResizeMode(QHeaderView::ResizeToContents); - ui.listBookmarks->setUniformRowHeights(true); - ui.listBookmarks->header()->setStretchLastSection(false); - ui.listBookmarks->header()->setResizeMode(QHeaderView::ResizeToContents); - - indexModel = new IndexListModel(this); - ui.listIndex->setModel(indexModel); - ui.listIndex->setLayoutMode(QListView::Batched); - ui.listBookmarks->setItemHidden(ui.listBookmarks->headerItem(), true); - ui.listContents->setItemHidden(ui.listContents->headerItem(), true); - ui.searchButton->setShortcut(QKeySequence(Qt::ALT|Qt::SHIFT|Qt::Key_S)); -} - -void HelpDialog::initialize() -{ - connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); - - connect(ui.listContents, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(showTopic(QTreeWidgetItem*))); - connect(ui.listContents, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTreeItemMenu(QPoint))); - ui.listContents->viewport()->installEventFilter(this); - - connect(ui.editIndex, SIGNAL(returnPressed()), this, SLOT(showTopic())); - connect(ui.editIndex, SIGNAL(textEdited(QString)), this, SLOT(searchInIndex(QString))); - - connect(ui.listIndex, SIGNAL(activated(QModelIndex)), this, SLOT(showTopic())); - connect(ui.listIndex, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showIndexItemMenu(QPoint))); - - connect(ui.listBookmarks, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(showTopic(QTreeWidgetItem*))); - connect(ui.listBookmarks, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTreeItemMenu(QPoint))); - - connect(ui.termsEdit, SIGNAL(textChanged(QString)), this, SLOT(updateSearchButton(QString))); - - connect(ui.resultBox, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showListItemMenu(QPoint))); - - cacheFilesPath = QDir::homePath() + QLatin1String("/.assistant"); //### Find a better location for the dbs - - ui.editIndex->installEventFilter(this); - - ui.framePrepare->hide(); - connect(qApp, SIGNAL(lastWindowClosed()), SLOT(lastWinClosed())); - - ui.termsEdit->setValidator(new SearchValidator(ui.termsEdit)); - - actionOpenCurrentTab = new QAction(this); - actionOpenCurrentTab->setText(tr("Open Link in Current Tab")); - - actionOpenLinkInNewWindow = new QAction(this); - actionOpenLinkInNewWindow->setText(tr("Open Link in New Window")); - - actionOpenLinkInNewTab = new QAction(this); - actionOpenLinkInNewTab->setText(tr("Open Link in New Tab")); - - itemPopup = new QMenu(this); - itemPopup->addAction(actionOpenCurrentTab); - itemPopup->addAction(actionOpenLinkInNewWindow); - itemPopup->addAction(actionOpenLinkInNewTab); - - ui.tabWidget->setElideMode(Qt::ElideNone); - - contentList.clear(); - - initDoneMsgShown = false; - fullTextIndex = 0; - indexDone = false; - titleMapDone = false; - contentsInserted = false; - bookmarksInserted = false; - setupTitleMap(); - -} - -void HelpDialog::processEvents() -{ - qApp->processEvents(QEventLoop::ExcludeUserInputEvents); -} - - -void HelpDialog::lastWinClosed() -{ - lwClosed = true; -} - -void HelpDialog::removeOldCacheFiles(bool onlyFulltextSearchIndex) -{ - if (!verifyDirectory(cacheFilesPath)) { - qWarning("Failed to created assistant directory"); - return; - } - QString pname = QLatin1String(".") + Config::configuration()->profileName(); - - QStringList fileList; - fileList << QLatin1String("indexdb40.dict") - << QLatin1String("indexdb40.doc"); - - if (!onlyFulltextSearchIndex) - fileList << QLatin1String("indexdb40") << QLatin1String("contentdb40"); - - QStringList::iterator it = fileList.begin(); - for (; it != fileList.end(); ++it) { - if (QFile::exists(cacheFilesPath + QDir::separator() + *it + pname)) { - QFile f(cacheFilesPath + QDir::separator() + *it + pname); - f.remove(); - } - } -} - -void HelpDialog::timerEvent(QTimerEvent *e) -{ - Q_UNUSED(e); - static int opacity = 255; - help->setWindowOpacity((opacity-=4)/255.0); - if (opacity<=0) - qApp->quit(); -} - - -void HelpDialog::loadIndexFile() -{ - if (indexDone) - return; - - setCursor(Qt::WaitCursor); - indexDone = true; - ui.labelPrepare->setText(tr("Prepare...")); - ui.framePrepare->show(); - processEvents(); - - QProgressBar *bar = ui.progressPrepare; - bar->setMaximum(100); - bar->setValue(0); - - keywordDocuments.clear(); - QList<IndexKeyword> lst; - QFile indexFile(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.") + - Config::configuration()->profileName()); - if (!indexFile.open(QFile::ReadOnly)) { - buildKeywordDB(); - processEvents(); - if (lwClosed) - return; - if (!indexFile.open(QFile::ReadOnly)) { - QMessageBox::warning(help, tr("Qt Assistant"), tr("Failed to load keyword index file\n" - "Assistant will not work!")); -#if defined Q_WS_WIN || defined Q_WS_MACX - startTimer(50); -#endif - return; - } - } - - QDataStream ds(&indexFile); - quint32 fileAges; - ds >> fileAges; - if (fileAges != getFileAges()) { - indexFile.close(); - buildKeywordDB(); - if (!indexFile.open(QFile::ReadOnly)) { - QMessageBox::warning(help, tr("Qt Assistant"), - tr("Cannot open the index file %1").arg(QFileInfo(indexFile).absoluteFilePath())); - return; - } - ds.setDevice(&indexFile); - ds >> fileAges; - } - ds >> lst; - indexFile.close(); - - bar->setValue(bar->maximum()); - processEvents(); - - for (int i=0; i<lst.count(); ++i) { - const IndexKeyword &idx = lst.at(i); - indexModel->addLink(idx.keyword, idx.link); - - keywordDocuments << HelpDialog::removeAnchorFromLink(idx.link); - } - - indexModel->publish(); - - ui.framePrepare->hide(); - showInitDoneMessage(); - setCursor(Qt::ArrowCursor); -} - -quint32 HelpDialog::getFileAges() -{ - QStringList addDocuFiles = Config::configuration()->docFiles(); - QStringList::const_iterator i = addDocuFiles.constBegin(); - - quint32 fileAges = 0; - for (; i != addDocuFiles.constEnd(); ++i) { - QFileInfo fi(*i); - if (fi.exists()) - fileAges += fi.lastModified().toTime_t(); - } - - return fileAges; -} - -void HelpDialog::buildKeywordDB() -{ - QStringList addDocuFiles = Config::configuration()->docFiles(); - QStringList::iterator i = addDocuFiles.begin(); - - // Set up an indeterminate progress bar. - ui.labelPrepare->setText(tr("Prepare...")); - ui.progressPrepare->setMaximum(0); - ui.progressPrepare->setMinimum(0); - ui.progressPrepare->setValue(0); - processEvents(); - - QList<IndexKeyword> lst; - quint32 fileAges = 0; - for (i = addDocuFiles.begin(); i != addDocuFiles.end(); ++i) { - QFile file(*i); - if (!file.exists()) { - QMessageBox::warning(this, tr("Warning"), - tr("Documentation file %1 does not exist!\n" - "Skipping file.").arg(QFileInfo(file).absoluteFilePath())); - continue; - } - fileAges += QFileInfo(file).lastModified().toTime_t(); - DocuParser *handler = DocuParser::createParser(*i); - bool ok = handler->parse(&file); - file.close(); - if (!ok){ - QString msg = QString::fromLatin1("In file %1:\n%2") - .arg(QFileInfo(file).absoluteFilePath()) - .arg(handler->errorProtocol()); - QMessageBox::critical(this, tr("Parse Error"), tr(msg.toUtf8())); - delete handler; - continue; - } - - QList<IndexItem*> indLst = handler->getIndexItems(); - int counter = 0; - foreach (IndexItem *indItem, indLst) { - QFileInfo fi(indItem->reference); - lst.append(IndexKeyword(indItem->keyword, indItem->reference)); - - if (++counter%100 == 0) { - if (ui.progressPrepare) - ui.progressPrepare->setValue(counter); - processEvents(); - if (lwClosed) { - return; - } - } - } - delete handler; - } - if (!lst.isEmpty()) - qSort(lst); - - QFile indexout(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.") - + Config::configuration()->profileName()); - if (verifyDirectory(cacheFilesPath) && indexout.open(QFile::WriteOnly)) { - QDataStream s(&indexout); - s << fileAges; - s << lst; - indexout.close(); - } -} - -void HelpDialog::setupTitleMap() -{ - if (titleMapDone) - return; - - bool needRebuild = false; - if (Config::configuration()->profileName() == QLatin1String("default")) { - const QStringList docuFiles = Config::configuration()->docFiles(); - for (QStringList::ConstIterator it = docuFiles.begin(); it != docuFiles.end(); ++it) { - if (!QFile::exists(*it)) { - Config::configuration()->saveProfile(Profile::createDefaultProfile()); - Config::configuration()->loadDefaultProfile(); - needRebuild = true; - break; - } - } - } - - if (Config::configuration()->docRebuild() || needRebuild) { - removeOldCacheFiles(); - Config::configuration()->setDocRebuild(false); - Config::configuration()->saveProfile(Config::configuration()->profile()); - } - if (contentList.isEmpty()) - getAllContents(); - - titleMapDone = true; - titleMap.clear(); - for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { - ContentList lst = (*it).second; - foreach (ContentItem item, lst) { - titleMap[item.reference] = item.title.trimmed(); - } - } - processEvents(); -} - -void HelpDialog::getAllContents() -{ - QFile contentFile(cacheFilesPath + QDir::separator() + QLatin1String("contentdb40.") - + Config::configuration()->profileName()); - contentList.clear(); - if (!contentFile.open(QFile::ReadOnly)) { - buildContentDict(); - return; - } - - QDataStream ds(&contentFile); - quint32 fileAges; - ds >> fileAges; - if (fileAges != getFileAges()) { - contentFile.close(); - removeOldCacheFiles(true); - buildContentDict(); - return; - } - QString key; - QList<ContentItem> lst; - while (!ds.atEnd()) { - ds >> key; - ds >> lst; - contentList += qMakePair(key, QList<ContentItem>(lst)); - } - contentFile.close(); - processEvents(); - -} - -void HelpDialog::buildContentDict() -{ - QStringList docuFiles = Config::configuration()->docFiles(); - - quint32 fileAges = 0; - for (QStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); ++it) { - QFile file(*it); - if (!file.exists()) { - QMessageBox::warning(this, tr("Warning"), - tr("Documentation file %1 does not exist!\n" - "Skipping file.").arg(QFileInfo(file).absoluteFilePath())); - continue; - } - fileAges += QFileInfo(file).lastModified().toTime_t(); - DocuParser *handler = DocuParser::createParser(*it); - if (!handler) { - QMessageBox::warning(this, tr("Warning"), - tr("Documentation file %1 is not compatible!\n" - "Skipping file.").arg(QFileInfo(file).absoluteFilePath())); - continue; - } - bool ok = handler->parse(&file); - file.close(); - if (ok) { - contentList += qMakePair(*it, QList<ContentItem>(handler->getContentItems())); - delete handler; - } else { - QString msg = QString::fromLatin1("In file %1:\n%2") - .arg(QFileInfo(file).absoluteFilePath()) - .arg(handler->errorProtocol()); - QMessageBox::critical(this, tr("Parse Error"), tr(msg.toUtf8())); - continue; - } - } - - QFile contentOut(cacheFilesPath + QDir::separator() + QLatin1String("contentdb40.") - + Config::configuration()->profileName()); - if (contentOut.open(QFile::WriteOnly)) { - QDataStream s(&contentOut); - s << fileAges; - for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { - s << *it; - } - contentOut.close(); - } -} - -void HelpDialog::currentTabChanged(int index) -{ - QString s = ui.tabWidget->widget(index)->objectName(); - if (s == QLatin1String("indexPage")) - QTimer::singleShot(0, this, SLOT(loadIndexFile())); - else if (s == QLatin1String("bookmarkPage")) - insertBookmarks(); - else if (s == QLatin1String("contentPage")) - QTimer::singleShot(0, this, SLOT(insertContents())); - else if (s == QLatin1String("searchPage")) - QTimer::singleShot(0, this, SLOT(setupFullTextIndex())); -} - -void HelpDialog::showInitDoneMessage() -{ - if (initDoneMsgShown) - return; - initDoneMsgShown = true; - help->statusBar()->showMessage(tr("Done"), 3000); -} - -void HelpDialog::showTopic(QTreeWidgetItem *item) -{ - if (item) - showTopic(); -} - -void HelpDialog::showTopic() -{ - QString tabName = ui.tabWidget->currentWidget()->objectName(); - - if (tabName == QLatin1String("indexPage")) - showIndexTopic(); - else if (tabName == QLatin1String("bookmarkPage")) - showBookmarkTopic(); - else if (tabName == QLatin1String("contentPage")) - showContentsTopic(); -} - -void HelpDialog::showIndexTopic() -{ - int row = ui.listIndex->currentIndex().row(); - if (row == -1 || row >= indexModel->rowCount()) - return; - - QString description = indexModel->description(row); - QStringList links = indexModel->links(row); - - bool blocked = ui.editIndex->blockSignals(true); - ui.editIndex->setText(description); - ui.editIndex->blockSignals(blocked); - - if (links.count() == 1) { - emit showLink(links.first()); - } else { - qSort(links); - QStringList::Iterator it = links.begin(); - QStringList linkList; - QStringList linkNames; - for (; it != links.end(); ++it) { - linkList << *it; - linkNames << titleOfLink(*it); - } - QString link = TopicChooser::getLink(this, linkNames, linkList, description); - if (!link.isEmpty()) - emit showLink(link); - } - - ui.listIndex->setCurrentIndex(indexModel->index(indexModel->stringList().indexOf(description))); - ui.listIndex->scrollTo(ui.listIndex->currentIndex(), QAbstractItemView::PositionAtTop); -} - -void HelpDialog::searchInIndex(const QString &searchString) -{ - QRegExp atoz(QLatin1String("[A-Z]")); - int matches = searchString.count(atoz); - if (matches > 0 && !searchString.contains(QLatin1String(".*"))) - { - int start = 0; - QString newSearch; - for (; matches > 0; --matches) { - int match = searchString.indexOf(atoz, start+1); - if (match <= start) - continue; - newSearch += searchString.mid(start, match-start); - newSearch += QLatin1String(".*"); - start = match; - } - newSearch += searchString.mid(start); - ui.listIndex->setCurrentIndex(indexModel->filter(newSearch, searchString)); - } - else - ui.listIndex->setCurrentIndex(indexModel->filter(searchString, searchString)); -} - -QString HelpDialog::titleOfLink(const QString &link) -{ - QString s = HelpDialog::removeAnchorFromLink(link); - s = titleMap[s]; - if (s.isEmpty()) - return link; - return s; -} - -bool HelpDialog::eventFilter(QObject * o, QEvent * e) -{ - if (o == ui.editIndex && e->type() == QEvent::KeyPress) { - switch (static_cast<QKeyEvent*>(e)->key()) { - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_PageDown: - case Qt::Key_PageUp: - QApplication::sendEvent(ui.listIndex, e); - break; - - default: - break; - } - } else if (o == ui.listContents->viewport()) { - if (e->type() == QEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast<QMouseEvent*>(e); - if (me->button() == Qt::LeftButton) { - QTreeWidgetItem *item = ui.listContents->itemAt(me->pos()); - QRect vRect = ui.listContents->visualItemRect(item); - - // only show topic if we clicked an item - if (item && vRect.contains(me->pos())) - showTopic(item); - } - } - } - - return QWidget::eventFilter(o, e); -} - -void HelpDialog::addBookmark() -{ - if (!bookmarksInserted) - insertBookmarks(); - QString link = help->browsers()->currentBrowser()->source().toString(); - QString title = help->browsers()->currentBrowser()->documentTitle(); - if (title.isEmpty()) - title = titleOfLink(link); - - QTreeWidgetItem *i = new QTreeWidgetItem(ui.listBookmarks, 0); - i->setText(0, title); - i->setData(0, LinkRole, link); - ui.buttonRemove->setEnabled(true); - saveBookmarks(); - help->updateBookmarkMenu(); -} - -void HelpDialog::on_buttonAdd_clicked() -{ - addBookmark(); -} - -void HelpDialog::on_buttonRemove_clicked() -{ - if (!ui.listBookmarks->currentItem()) - return; - - delete ui.listBookmarks->currentItem(); - saveBookmarks(); - if (ui.listBookmarks->topLevelItemCount() != 0) { - ui.listBookmarks->setCurrentItem(ui.listBookmarks->topLevelItem(0)); - } - ui.buttonRemove->setEnabled(ui.listBookmarks->topLevelItemCount() > 0); - help->updateBookmarkMenu(); -} - -void HelpDialog::insertBookmarks() -{ - if (bookmarksInserted) - return; - bookmarksInserted = true; - ui.listBookmarks->clear(); - QFile f(cacheFilesPath + QDir::separator() + QLatin1String("bookmarks.") - + Config::configuration()->profileName()); - if (!f.open(QFile::ReadOnly)) - return; - QTextStream ts(&f); - while (!ts.atEnd()) { - QTreeWidgetItem *i = new QTreeWidgetItem(ui.listBookmarks, 0); - i->setText(0, ts.readLine()); - i->setData(0, LinkRole, ts.readLine()); - } - ui.buttonRemove->setEnabled(ui.listBookmarks->topLevelItemCount() > 0); - help->updateBookmarkMenu(); - showInitDoneMessage(); -} - -void HelpDialog::showBookmarkTopic() -{ - if (!ui.listBookmarks->currentItem()) - return; - - QTreeWidgetItem *i = (QTreeWidgetItem*)ui.listBookmarks->currentItem(); - emit showLink(i->data(0, LinkRole).toString()); -} - -static void store(QTreeWidgetItem *i, QTextStream &ts) -{ - ts << i->text(0) << endl; - ts << i->data(0, LinkRole).toString() << endl; - - for (int index = 0; index < i->childCount(); ++index) - store(i->child(index), ts); -} - -static void store(QTreeWidget *tw, QTextStream &ts) -{ - for (int index = 0; index < tw->topLevelItemCount(); ++index) - store(tw->topLevelItem(index), ts); -} - -void HelpDialog::saveBookmarks() -{ - QFile f(cacheFilesPath + QDir::separator() + QLatin1String("bookmarks.") - + Config::configuration()->profileName()); - if (!f.open(QFile::WriteOnly)) - return; - - QTextStream ts(&f); - store(ui.listBookmarks, ts); - f.close(); -} - -void HelpDialog::insertContents() -{ -#ifdef Q_WS_MAC - static const QLatin1String IconPath(":/trolltech/assistant/images/mac/book.png"); -#else - static const QLatin1String IconPath(":/trolltech/assistant/images/win/book.png"); -#endif - if (contentsInserted) - return; - - if (contentList.isEmpty()) - getAllContents(); - - contentsInserted = true; - ui.listContents->clear(); - setCursor(Qt::WaitCursor); - if (!titleMapDone) - setupTitleMap(); - -#if 0 // ### port me - ui.listContents->setSorting(-1); -#endif - - for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) { - QTreeWidgetItem *newEntry = 0; - - QTreeWidgetItem *contentEntry = 0; - QStack<QTreeWidgetItem*> stack; - stack.clear(); - int depth = 0; - bool root = false; - - const int depthSize = 32; - QVarLengthArray<QTreeWidgetItem*, depthSize> lastItem(depthSize); - - ContentList lst = (*it).second; - for (ContentList::ConstIterator it = lst.constBegin(); it != lst.constEnd(); ++it) { - ContentItem item = *it; - if (item.depth == 0) { - lastItem[0] = 0; - newEntry = new QTreeWidgetItem(ui.listContents, 0); - newEntry->setIcon(0, QIcon(IconPath)); - newEntry->setText(0, item.title); - newEntry->setData(0, LinkRole, item.reference); - stack.push(newEntry); - depth = 1; - root = true; - } - else{ - if ((item.depth > depth) && root) { - depth = item.depth; - stack.push(contentEntry); - } - if (item.depth == depth) { - if (lastItem.capacity() == depth) - lastItem.resize(depth + depthSize); - contentEntry = new QTreeWidgetItem(stack.top(), lastItem[ depth ]); - lastItem[ depth ] = contentEntry; - contentEntry->setText(0, item.title); - contentEntry->setData(0, LinkRole, item.reference); - } - else if (item.depth < depth) { - stack.pop(); - depth--; - item = *(--it); - } - } - } - processEvents(); - } - setCursor(Qt::ArrowCursor); - showInitDoneMessage(); -} - -void HelpDialog::showContentsTopic() -{ - QTreeWidgetItem *i = (QTreeWidgetItem*)ui.listContents->currentItem(); - if (!i) - return; - emit showLink(i->data(0, LinkRole).toString()); -} - -QTreeWidgetItem * HelpDialog::locateLink(QTreeWidgetItem *item, const QString &link) -{ - QTreeWidgetItem *child = 0; -#ifdef Q_OS_WIN - Qt::CaseSensitivity checkCase = Qt::CaseInsensitive; -#else - Qt::CaseSensitivity checkCase = Qt::CaseSensitive; -#endif - for (int i = 0, childCount = item->childCount(); i<childCount; i++) { - child = item->child(i); - ///check whether it is this item - if (link.startsWith(child->data(0, LinkRole).toString(), checkCase)) - break; - //check if the link is a child of this item - else if (child->childCount()) { - child = locateLink(child, link); - if (child) - break; - } - child = 0; - } - return child; -} - -void HelpDialog::locateContents(const QString &link) -{ - //ensure the TOC is filled - if (!contentsInserted) - insertContents(); -#ifdef Q_OS_WIN - Qt::CaseSensitivity checkCase = Qt::CaseInsensitive; -#else - Qt::CaseSensitivity checkCase = Qt::CaseSensitive; -#endif - QString findLink(link); - //Installations on a windows local drive will give the 'link' as <file:///C:/xxx> - //and the contents in the TOC will be <file:C:/xxx>. - //But on others the 'link' of format <file:///root/xxx> - //and the contents in the TOC will be <file:/root/xxx>. - if (findLink.contains(QLatin1String("file:///"))) { - if (findLink[9] == QLatin1Char(':')) //on windows drives - findLink.replace(0, 8, QLatin1String("file:")); - else - findLink.replace(0, 8, QLatin1String("file:/")); - } - - bool topLevel = false; - QTreeWidgetItem *item = 0; - int totalItems = ui.listContents->topLevelItemCount(); - - for (int i = 0; i < totalItems; i++ ) { - // first see if we are one of the top level items - item = (QTreeWidgetItem*)ui.listContents->topLevelItem(i); - if (findLink.startsWith(item->data(0, LinkRole).toString(), checkCase)) { - topLevel = true; - break; - } - } - - if (!topLevel) { - // now try to find it in the sublevel items - for (int n = 0; n < totalItems; ++n) { - item = (QTreeWidgetItem*)ui.listContents->topLevelItem(n); - item = locateLink(item, findLink); - if (item) - break; - } - } - - //remove the old selection - QList<QTreeWidgetItem *> selected = ui.listContents->selectedItems(); - foreach(QTreeWidgetItem *sel, selected) - ui.listContents->setItemSelected(sel, false); - - //set the TOC item and show - ui.listContents->setCurrentItem(item); - ui.listContents->setItemSelected(item, true); - ui.listContents->scrollToItem(item); -} - -void HelpDialog::toggleContents() -{ - if (!isVisible() || ui.tabWidget->currentIndex() != 0) { - ui.tabWidget->setCurrentIndex(0); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleIndex() -{ - if (!isVisible() || ui.tabWidget->currentIndex() != 1 || !ui.editIndex->hasFocus()) { - ui.tabWidget->setCurrentIndex(1); - parentWidget()->show(); - ui.editIndex->setFocus(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleBookmarks() -{ - if (!isVisible() || ui.tabWidget->currentIndex() != 2) { - ui.tabWidget->setCurrentIndex(2); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::toggleSearch() -{ - if (!isVisible() || ui.tabWidget->currentIndex() != 3) { - ui.tabWidget->setCurrentIndex(3); - parentWidget()->show(); - } - else - parentWidget()->hide(); -} - -void HelpDialog::setupFullTextIndex() -{ - if (fullTextIndex) - return; - - QString pname = Config::configuration()->profileName(); - fullTextIndex = new Index(QStringList(), QDir::homePath()); // ### Is this correct ? - if (!verifyDirectory(cacheFilesPath)) { - QMessageBox::warning(help, tr("Qt Assistant"), - tr("Failed to save fulltext search index\n" - "Assistant will not work!")); - return; - } - fullTextIndex->setDictionaryFile(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.dict.") + pname); - fullTextIndex->setDocListFile(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.doc.") + pname); - processEvents(); - - connect(fullTextIndex, SIGNAL(indexingProgress(int)), - this, SLOT(setIndexingProgress(int))); - QFile f(cacheFilesPath + QDir::separator() + QLatin1String("indexdb40.dict.") + pname); - if (!f.exists()) { - QString doc; - QSet<QString> documentSet; - QMap<QString, QString>::ConstIterator it = titleMap.constBegin(); - for (; it != titleMap.constEnd(); ++it) { - doc = HelpDialog::removeAnchorFromLink(it.key()); - if (!doc.isEmpty()) - documentSet.insert(doc); - } - loadIndexFile(); - for ( QStringList::Iterator it = keywordDocuments.begin(); it != keywordDocuments.end(); ++it ) { - if (!(*it).isEmpty()) - documentSet.insert(*it); - } - fullTextIndex->setDocList( documentSet.toList() ); - - help->statusBar()->clearMessage(); - setCursor(Qt::WaitCursor); - ui.labelPrepare->setText(tr("Indexing files...")); - ui.progressPrepare->setMaximum(100); - ui.progressPrepare->reset(); - ui.progressPrepare->show(); - ui.framePrepare->show(); - processEvents(); - if (fullTextIndex->makeIndex() == -1) - return; - fullTextIndex->writeDict(); - ui.progressPrepare->setValue(100); - ui.framePrepare->hide(); - setCursor(Qt::ArrowCursor); - showInitDoneMessage(); - } else { - setCursor(Qt::WaitCursor); - help->statusBar()->showMessage(tr("Reading dictionary...")); - processEvents(); - fullTextIndex->readDict(); - help->statusBar()->showMessage(tr("Done"), 3000); - setCursor(Qt::ArrowCursor); - } - keywordDocuments.clear(); -} - -void HelpDialog::setIndexingProgress(int prog) -{ - ui.progressPrepare->setValue(prog); - processEvents(); -} - -void HelpDialog::startSearch() -{ - QString str = ui.termsEdit->text(); - str = str.simplified(); - str = str.replace(QLatin1String("\'"), QLatin1String("\"")); - str = str.replace(QLatin1String("`"), QLatin1String("\"")); - QString buf = str; - str = str.replace(QLatin1String("-"), QLatin1String(" ")); - str = str.replace(QRegExp(QLatin1String("\\s[\\S]?\\s")), QLatin1String(" ")); - terms = str.split(QLatin1Char(' ')); - QStringList termSeq; - QStringList seqWords; - QStringList::iterator it = terms.begin(); - for (; it != terms.end(); ++it) { - (*it) = (*it).simplified(); - (*it) = (*it).toLower(); - (*it) = (*it).replace(QLatin1String("\""), QLatin1String("")); - } - if (str.contains(QLatin1Char('\"'))) { - if ((str.count(QLatin1Char('\"')))%2 == 0) { - int beg = 0; - int end = 0; - QString s; - beg = str.indexOf(QLatin1Char('\"'), beg); - while (beg != -1) { - beg++; - end = str.indexOf(QLatin1Char('\"'), beg); - s = str.mid(beg, end - beg); - s = s.toLower(); - s = s.simplified(); - if (s.contains(QLatin1Char('*'))) { - QMessageBox::warning(this, tr("Full Text Search"), - tr("Using a wildcard within phrases is not allowed.")); - return; - } - seqWords += s.split(QLatin1Char(' ')); - termSeq << s; - beg = str.indexOf(QLatin1Char('\"'), end + 1); - } - } else { - QMessageBox::warning(this, tr("Full Text Search"), - tr("The closing quotation mark is missing.")); - return; - } - } - setCursor(Qt::WaitCursor); - foundDocs.clear(); - foundDocs = fullTextIndex->query(terms, termSeq, seqWords); - QString msg = tr("%n document(s) found.", "", foundDocs.count()); - help->statusBar()->showMessage(tr(msg.toUtf8()), 3000); - ui.resultBox->clear(); - for (it = foundDocs.begin(); it != foundDocs.end(); ++it) - ui.resultBox->addItem(fullTextIndex->getDocumentTitle(*it)); - - terms.clear(); - bool isPhrase = false; - QString s; - for (int i = 0; i < (int)buf.length(); ++i) { - if (buf[i] == QLatin1Char('\"')) { - isPhrase = !isPhrase; - s = s.simplified(); - if (!s.isEmpty()) - terms << s; - s = QLatin1String(""); - } else if (buf[i] == QLatin1Char(' ') && !isPhrase) { - s = s.simplified(); - if (!s.isEmpty()) - terms << s; - s = QLatin1String(""); - } else - s += buf[i]; - } - if (!s.isEmpty()) - terms << s; - - setCursor(Qt::ArrowCursor); -} - -void HelpDialog::on_helpButton_clicked() -{ - emit showLink(MainWindow::urlifyFileName( - Config::configuration()->assistantDocPath() + - QLatin1String("/assistant-manual.html#full-text-searching"))); -} - -void HelpDialog::on_resultBox_itemActivated(QListWidgetItem *item) -{ - showResultPage(item); -} - -void HelpDialog::showResultPage(QListWidgetItem *item) -{ - if (item) - emit showSearchLink(foundDocs[ui.resultBox->row(item)], terms); -} - -void HelpDialog::showIndexItemMenu(const QPoint &pos) -{ - QListView *listView = qobject_cast<QListView*>(sender()); - if (!listView) - return; - - QModelIndex idx = listView->indexAt(pos); - if (!idx.isValid()) - return; - - QAction *action = itemPopup->exec(listView->viewport()->mapToGlobal(pos)); - if (action == actionOpenCurrentTab) { - showTopic(); - } else if (action) { - HelpWindow *hw = help->browsers()->currentBrowser(); - QString itemName = idx.data().toString(); - ui.editIndex->setText(itemName); - QStringList links = indexModel->links(idx.row()); - if (links.count() == 1) { - if (action == actionOpenLinkInNewWindow) - hw->openLinkInNewWindow(links.first()); - else - hw->openLinkInNewPage(links.first()); - } else { - QStringList::Iterator it = links.begin(); - QStringList linkList; - QStringList linkNames; - for (; it != links.end(); ++it) { - linkList << *it; - linkNames << titleOfLink(*it); - } - QString link = TopicChooser::getLink(this, linkNames, linkList, itemName); - if (!link.isEmpty()) { - if (action == actionOpenLinkInNewWindow) - hw->openLinkInNewWindow(link); - else - hw->openLinkInNewPage(link); - } - } - } -} - -void HelpDialog::showListItemMenu(const QPoint &pos) -{ - QListWidget *listWidget = qobject_cast<QListWidget*>(sender()); - if (!listWidget) - return; - QListWidgetItem *item = listWidget->itemAt(pos); - if (!item) - return; - - QAction *action = itemPopup->exec(listWidget->viewport()->mapToGlobal(pos)); - if (action == actionOpenCurrentTab) { - showResultPage(item); - } else if (action) { - HelpWindow *hw = help->browsers()->currentBrowser(); - QString link = foundDocs[ui.resultBox->row(item)]; - if (action == actionOpenLinkInNewWindow) - hw->openLinkInNewWindow(link); - else - hw->openLinkInNewPage(link); - } -} - -void HelpDialog::showTreeItemMenu(const QPoint &pos) -{ - QTreeWidget *treeWidget = qobject_cast<QTreeWidget*>(sender()); - - if (!treeWidget) - return; - - QTreeWidgetItem *item = treeWidget->itemAt(pos); - - if (!item) - return; - - QAction *action = itemPopup->exec(treeWidget->viewport()->mapToGlobal(pos)); - if (action == actionOpenCurrentTab) { - if (ui.tabWidget->currentWidget()->objectName() == QLatin1String("contentPage")) - showContentsTopic(); - else - showBookmarkTopic(); - } else if (action) { - QTreeWidgetItem *i = (QTreeWidgetItem*)item; - if (action == actionOpenLinkInNewWindow) - help->browsers()->currentBrowser()->openLinkInNewWindow(i->data(0, LinkRole).toString()); - else - help->browsers()->currentBrowser()->openLinkInNewPage(i->data(0, LinkRole).toString()); - } -} - -void HelpDialog::on_termsEdit_returnPressed() -{ - startSearch(); -} - -void HelpDialog::updateSearchButton(const QString &txt) -{ - ui.searchButton->setDisabled(txt.isEmpty()); -} - -void HelpDialog::on_searchButton_clicked() -{ - startSearch(); -} - -QString HelpDialog::removeAnchorFromLink(const QString &link) -{ - int i = link.length(); - int j = link.lastIndexOf(QLatin1Char('/')); - int l = link.lastIndexOf(QDir::separator()); - if (l > j) - j = l; - if (j > -1) { - QString fileName = link.mid(j+1); - int k = fileName.lastIndexOf(QLatin1Char('#')); - if (k > -1) - i = j + k + 1; - } - return link.left(i); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/helpdialog.h b/tools/assistant/compat/helpdialog.h deleted file mode 100644 index 4e1bac2..0000000 --- a/tools/assistant/compat/helpdialog.h +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELPDIALOG_H -#define HELPDIALOG_H - -#include "ui_helpdialog.h" -#include "index.h" -#include "helpwindow.h" -#include "docuparser.h" - -#include <QList> -#include <QPair> -#include <QListWidget> -#include <QTreeWidget> -#include <QMap> -#include <QStringList> -#include <QValidator> -#include <qmenu.h> -#include <QHash> - -QT_BEGIN_NAMESPACE - -class QProgressBar; -class MainWindow; -class QTextBrowser; -class IndexListModel; - -class HelpNavigationListItem : public QListWidgetItem -{ -public: - HelpNavigationListItem(QListWidget *ls, const QString &txt); - - void addLink(const QString &link); - QStringList links() const { return linkList; } -private: - QStringList linkList; - -}; - -class SearchValidator : public QValidator -{ - Q_OBJECT -public: - SearchValidator(QObject *parent) - : QValidator(parent) {} - ~SearchValidator() {} - QValidator::State validate(QString &str, int &) const; -}; - -class HelpDialog : public QWidget -{ - Q_OBJECT -public: - HelpDialog(QWidget *parent, MainWindow *h); - - inline QTabWidget *tabWidget() const - { return ui.tabWidget; } - - QString titleOfLink(const QString &link); - bool eventFilter(QObject *, QEvent *); - bool lastWindowClosed() { return lwClosed; } - - void timerEvent(QTimerEvent *e); - static QString removeAnchorFromLink(const QString &link); - -signals: - void showLink(const QString &s); - void showSearchLink(const QString &s, const QStringList &terms); - -public slots: - void initialize(); - void startSearch(); - void addBookmark(); - void currentTabChanged(int index); - void locateContents(const QString &link); - -private slots: - void on_buttonAdd_clicked(); - void on_buttonRemove_clicked(); - void on_termsEdit_returnPressed(); - void on_helpButton_clicked(); - void on_searchButton_clicked(); - void on_resultBox_itemActivated(QListWidgetItem*); - void updateSearchButton(const QString &txt); - - void showResultPage(QListWidgetItem *); - - void showTopic(QTreeWidgetItem *); - void loadIndexFile(); - void insertContents(); - void setupFullTextIndex(); - void showTopic(); - void searchInIndex(const QString &s); - void toggleContents(); - void toggleIndex(); - void toggleBookmarks(); - void toggleSearch(); - void lastWinClosed(); - void setIndexingProgress(int prog); - void showListItemMenu(const QPoint &pos); - void showIndexItemMenu(const QPoint &pos); - void showTreeItemMenu(const QPoint &pos); - void insertBookmarks(); - void processEvents(); - -private: - typedef QList<ContentItem> ContentList; - void removeOldCacheFiles(bool onlyFulltextSearchIndex = false); - void buildKeywordDB(); - quint32 getFileAges(); - void showIndexTopic(); - void showBookmarkTopic(); - void setupTitleMap(); - void saveBookmarks(); - void showContentsTopic(); - void showInitDoneMessage(); - void buildContentDict(); - QTreeWidgetItem * locateLink(QTreeWidgetItem *item, const QString &link); - -private: - Ui::HelpDialog ui; - - IndexListModel *indexModel; - QMap<QString, QString> titleMap; - bool indexDone, bookmarksInserted, titleMapDone, contentsInserted; - bool lwClosed; - MainWindow *help; - QString documentationPath; - Index *fullTextIndex; - QStringList terms, foundDocs; - bool initDoneMsgShown; - void getAllContents(); - QList<QPair<QString, ContentList> > contentList; - QMenu *itemPopup; - QString cacheFilesPath; - QStringList keywordDocuments; - - QAction *actionOpenCurrentTab; - QAction *actionOpenLinkInNewWindow; - QAction *actionOpenLinkInNewTab; -}; - -QT_END_NAMESPACE - -#endif // HELPDIALOG_H diff --git a/tools/assistant/compat/helpdialog.ui b/tools/assistant/compat/helpdialog.ui deleted file mode 100644 index 0fc8817..0000000 --- a/tools/assistant/compat/helpdialog.ui +++ /dev/null @@ -1,404 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment>********************************************************************* -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -*********************************************************************</comment> - <exportmacro></exportmacro> - <class>HelpDialog</class> - <widget class="QWidget" name="HelpDialog" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>274</width> - <height>417</height> - </rect> - </property> - <property name="windowTitle" > - <string>Help</string> - </property> - <property name="whatsThis" > - <string><b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p></string> - </property> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QTabWidget" name="tabWidget" > - <property name="whatsThis" > - <string>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</string> - </property> - <widget class="QWidget" name="contentPage" > - <attribute name="title" > - <string>Con&tents</string> - </attribute> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>5</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QTreeWidget" name="listContents" > - <property name="contextMenuPolicy" > - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="whatsThis" > - <string><b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p></string> - </property> - <property name="rootIsDecorated" > - <bool>true</bool> - </property> - <property name="uniformRowHeights" > - <bool>true</bool> - </property> - <column> - <property name="text" > - <string>column 1</string> - </property> - </column> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="indexPage" > - <attribute name="title" > - <string>&Index</string> - </attribute> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>5</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="TextLabel1" > - <property name="text" > - <string>&Look For:</string> - </property> - <property name="buddy" > - <cstring>editIndex</cstring> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="editIndex" > - <property name="toolTip" > - <string>Enter keyword</string> - </property> - <property name="whatsThis" > - <string><b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p></string> - </property> - </widget> - </item> - <item> - <widget class="QListView" name="listIndex" > - <property name="contextMenuPolicy" > - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="whatsThis" > - <string><b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p></string> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="bookmarkPage" > - <attribute name="title" > - <string>&Bookmarks</string> - </attribute> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>5</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QTreeWidget" name="listBookmarks" > - <property name="contextMenuPolicy" > - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="whatsThis" > - <string>Displays the list of bookmarks.</string> - </property> - <property name="uniformRowHeights" > - <bool>true</bool> - </property> - <column> - <property name="text" > - <string>column 1</string> - </property> - </column> - </widget> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="buttonAdd" > - <property name="toolTip" > - <string>Add new bookmark</string> - </property> - <property name="whatsThis" > - <string>Add the currently displayed page as a new bookmark.</string> - </property> - <property name="text" > - <string>&New</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonRemove" > - <property name="toolTip" > - <string>Delete bookmark</string> - </property> - <property name="whatsThis" > - <string>Delete the selected bookmark.</string> - </property> - <property name="text" > - <string>&Delete</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="searchPage" > - <attribute name="title" > - <string>&Search</string> - </attribute> - <layout class="QGridLayout" > - <property name="margin" > - <number>5</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item row="3" column="0" > - <spacer> - <property name="orientation" > - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="0" > - <widget class="QLabel" name="TextLabel1_2" > - <property name="text" > - <string>Searching f&or:</string> - </property> - <property name="buddy" > - <cstring>termsEdit</cstring> - </property> - </widget> - </item> - <item row="1" column="0" > - <widget class="QLineEdit" name="termsEdit" > - <property name="toolTip" > - <string>Enter searchword(s)</string> - </property> - <property name="whatsThis" > - <string><b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p></string> - </property> - </widget> - </item> - <item row="5" column="0" > - <widget class="QListWidget" name="resultBox" > - <property name="contextMenuPolicy" > - <enum>Qt::CustomContextMenu</enum> - </property> - <property name="whatsThis" > - <string><b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p></string> - </property> - </widget> - </item> - <item row="4" column="0" > - <widget class="QLabel" name="TextLabel2" > - <property name="text" > - <string>Found &Documents:</string> - </property> - <property name="buddy" > - <cstring>resultBox</cstring> - </property> - </widget> - </item> - <item row="2" column="0" > - <layout class="QHBoxLayout" > - <property name="margin" > - <number>1</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QPushButton" name="helpButton" > - <property name="toolTip" > - <string>Display the help page</string> - </property> - <property name="whatsThis" > - <string>Display the help page for the full text search.</string> - </property> - <property name="text" > - <string>He&lp</string> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>61</width> - <height>21</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="searchButton" > - <property name="toolTip" > - <string>Start searching</string> - </property> - <property name="whatsThis" > - <string>Pressing this button starts the search.</string> - </property> - <property name="text" > - <string>&Search</string> - </property> - <property name="enabled" > - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </widget> - </item> - <item> - <widget class="QFrame" name="framePrepare" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow" > - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>3</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QLabel" name="labelPrepare" > - <property name="text" > - <string>Preparing...</string> - </property> - </widget> - </item> - <item> - <widget class="QProgressBar" name="progressPrepare" /> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <pixmapfunction></pixmapfunction> - <tabstops> - <tabstop>tabWidget</tabstop> - <tabstop>listContents</tabstop> - <tabstop>editIndex</tabstop> - <tabstop>listIndex</tabstop> - <tabstop>listBookmarks</tabstop> - <tabstop>buttonAdd</tabstop> - <tabstop>buttonRemove</tabstop> - <tabstop>termsEdit</tabstop> - <tabstop>searchButton</tabstop> - <tabstop>helpButton</tabstop> - <tabstop>resultBox</tabstop> - </tabstops> - <resources/> - <connections/> -</ui> diff --git a/tools/assistant/compat/helpwindow.cpp b/tools/assistant/compat/helpwindow.cpp deleted file mode 100644 index 6674342..0000000 --- a/tools/assistant/compat/helpwindow.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "helpwindow.h" -#include "mainwindow.h" -#include "tabbedbrowser.h" -#include "helpdialog.h" -#include "config.h" - -#include <QApplication> -#include <QClipboard> -#include <QUrl> -#include <QMessageBox> -#include <QDir> -#include <QFile> -#include <QProcess> -#include <QAction> -#include <QFileInfo> -#include <QFont> -#include <QtEvents> -#include <QTextStream> -#include <QTextCodec> -#include <QStatusBar> -#include <QTextCursor> -#include <QTextObject> -#include <QTextLayout> -#include <QtDebug> -#include <qdesktopservices.h> - -#include <QtGui/QClipboard> -#include <QtGui/QApplication> - -#if defined(Q_OS_WIN32) -# include <windows.h> -#endif - -QT_BEGIN_NAMESPACE - -HelpWindow::HelpWindow(MainWindow *w, QWidget *parent) - : QTextBrowser(parent) - , mw(w) - , blockScroll(false) - , shiftPressed(false) - , newWindow(false) -{ - FontSettings settings = Config::configuration()->fontSettings(); - setFont(settings.browserFont); - - connect(this, SIGNAL(copyAvailable(bool)), w, SLOT(copyAvailable(bool))); -} - -void HelpWindow::setSource(const QUrl &name) -{ - if (name.isValid()) { - if (name.scheme() == QLatin1String("http") || name.scheme() == QLatin1String("ftp") - || name.scheme() == QLatin1String("mailto") || name.path().endsWith(QLatin1String("pdf"))) { - bool launched = QDesktopServices::openUrl(name); - if (!launched) { - QMessageBox::information(mw, tr("Help"), - tr("Unable to launch web browser.\n"), - tr("OK")); - } - return; - } - - QFileInfo fi(name.toLocalFile()); - if (name.scheme() == QLatin1String("file") && fi.exists()) { - if (newWindow || (shiftPressed && hasFocus())) { - shiftPressed = false; - mw->saveSettings(); - MainWindow *nmw = new MainWindow; - nmw->move(mw->geometry().topLeft()); - nmw->show(); - - if (mw->isMaximized()) - nmw->showMaximized(); - - nmw->setup(); - nmw->showLink(name.toString()); - } else { - QTextBrowser::setSource(name); - QTextBrowser::scrollToAnchor(name.fragment()); - } - return; - } - } - - mw->statusBar()->showMessage(tr("Failed to open link: '%1'").arg(name.toString()), 5000); - setHtml(tr("<div align=\"center\"><h1>The page could not be found</h1><br>" - "<h3>'%1'</h3></div>").arg(name.toString())); - mw->browsers()->updateTitle(tr("Error...")); -} - -void HelpWindow::openLinkInNewWindow() -{ - if (lastAnchor.isEmpty()) - return; - newWindow = true; - setSource(lastAnchor); - newWindow = false; -} - -void HelpWindow::openLinkInNewWindow(const QString &link) -{ - lastAnchor = link; - openLinkInNewWindow(); -} - -void HelpWindow::openLinkInNewPage() -{ - if(lastAnchor.isEmpty()) - return; - mw->browsers()->newTab(lastAnchor); - lastAnchor.clear(); -} - -void HelpWindow::openLinkInNewPage(const QString &link) -{ - lastAnchor = link; - openLinkInNewPage(); -} - -bool HelpWindow::hasAnchorAt(const QPoint& pos) -{ - lastAnchor = anchorAt(pos); - if (lastAnchor.isEmpty()) - return false; - lastAnchor = source().resolved(lastAnchor).toString(); - if (lastAnchor.at(0) == QLatin1Char('#')) { - QString src = source().toString(); - int hsh = src.indexOf(QLatin1Char('#')); - lastAnchor = (hsh>=0 ? src.left(hsh) : src) + lastAnchor; - } - return true; -} - -void HelpWindow::contextMenuEvent(QContextMenuEvent *e) -{ - QMenu menu(QLatin1String(""), 0); - - QUrl link; - QAction *copyAnchorAction = 0; - if (hasAnchorAt(e->pos())) { - link = anchorAt(e->pos()); - if (link.isRelative()) - link = source().resolved(link); - copyAnchorAction = menu.addAction(tr("Copy &Link Location")); - copyAnchorAction->setEnabled(!link.isEmpty() && link.isValid()); - - menu.addAction(tr("Open Link in New Tab"), - this, SLOT(openLinkInNewPage())); - menu.addAction(tr("Open Link in New Window\tShift+LMB"), - this, SLOT(openLinkInNewWindow())); - } - mw->setupPopupMenu(&menu); - QAction *action = menu.exec(e->globalPos()); - if (action == copyAnchorAction) - QApplication::clipboard()->setText(link.toString()); -} - -void HelpWindow::mouseReleaseEvent(QMouseEvent *e) -{ - if (e->button() == Qt::XButton1) { - QTextBrowser::backward(); - return; - } - - if (e->button() == Qt::XButton2) { - QTextBrowser::forward(); - return; - } - - if (e->button() == Qt::MidButton && hasAnchorAt(e->pos())) { - openLinkInNewPage(); - return; - } - QTextBrowser::mouseReleaseEvent(e); -} - -void HelpWindow::blockScrolling(bool b) -{ - blockScroll = b; -} - -void HelpWindow::ensureCursorVisible() -{ - if (!blockScroll) - QTextBrowser::ensureCursorVisible(); -} - -void HelpWindow::mousePressEvent(QMouseEvent *e) -{ - shiftPressed = e->modifiers() & Qt::ShiftModifier; - if (!(shiftPressed && hasAnchorAt(e->pos()))) - QTextBrowser::mousePressEvent(e); -} - -void HelpWindow::keyPressEvent(QKeyEvent *e) -{ - shiftPressed = e->modifiers() & Qt::ShiftModifier; - QTextBrowser::keyPressEvent(e); -} - -bool HelpWindow::isKDERunning() const -{ - return !qgetenv("KDE_FULL_SESSION").isEmpty(); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/images/assistant-128.png b/tools/assistant/compat/images/assistant-128.png Binary files differdeleted file mode 100644 index f05949f..0000000 --- a/tools/assistant/compat/images/assistant-128.png +++ /dev/null diff --git a/tools/assistant/compat/images/assistant.png b/tools/assistant/compat/images/assistant.png Binary files differdeleted file mode 100644 index ea4d1e7..0000000 --- a/tools/assistant/compat/images/assistant.png +++ /dev/null diff --git a/tools/assistant/compat/images/close.png b/tools/assistant/compat/images/close.png Binary files differdeleted file mode 100644 index 540694e..0000000 --- a/tools/assistant/compat/images/close.png +++ /dev/null diff --git a/tools/assistant/compat/images/designer.png b/tools/assistant/compat/images/designer.png Binary files differdeleted file mode 100644 index 72c42e7..0000000 --- a/tools/assistant/compat/images/designer.png +++ /dev/null diff --git a/tools/assistant/compat/images/linguist.png b/tools/assistant/compat/images/linguist.png Binary files differdeleted file mode 100644 index d388cbd..0000000 --- a/tools/assistant/compat/images/linguist.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/addtab.png b/tools/assistant/compat/images/mac/addtab.png Binary files differdeleted file mode 100644 index 20928fb..0000000 --- a/tools/assistant/compat/images/mac/addtab.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/book.png b/tools/assistant/compat/images/mac/book.png Binary files differdeleted file mode 100644 index 7a3204c..0000000 --- a/tools/assistant/compat/images/mac/book.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/closetab.png b/tools/assistant/compat/images/mac/closetab.png Binary files differdeleted file mode 100644 index ab9d669..0000000 --- a/tools/assistant/compat/images/mac/closetab.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/editcopy.png b/tools/assistant/compat/images/mac/editcopy.png Binary files differdeleted file mode 100644 index f551364..0000000 --- a/tools/assistant/compat/images/mac/editcopy.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/find.png b/tools/assistant/compat/images/mac/find.png Binary files differdeleted file mode 100644 index 3561745..0000000 --- a/tools/assistant/compat/images/mac/find.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/home.png b/tools/assistant/compat/images/mac/home.png Binary files differdeleted file mode 100644 index 78d94da..0000000 --- a/tools/assistant/compat/images/mac/home.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/next.png b/tools/assistant/compat/images/mac/next.png Binary files differdeleted file mode 100644 index a585cab..0000000 --- a/tools/assistant/compat/images/mac/next.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/prev.png b/tools/assistant/compat/images/mac/prev.png Binary files differdeleted file mode 100644 index 612fb34..0000000 --- a/tools/assistant/compat/images/mac/prev.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/print.png b/tools/assistant/compat/images/mac/print.png Binary files differdeleted file mode 100644 index 10ca56c..0000000 --- a/tools/assistant/compat/images/mac/print.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/synctoc.png b/tools/assistant/compat/images/mac/synctoc.png Binary files differdeleted file mode 100644 index 067fa94..0000000 --- a/tools/assistant/compat/images/mac/synctoc.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/whatsthis.png b/tools/assistant/compat/images/mac/whatsthis.png Binary files differdeleted file mode 100644 index 5b7078f..0000000 --- a/tools/assistant/compat/images/mac/whatsthis.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/zoomin.png b/tools/assistant/compat/images/mac/zoomin.png Binary files differdeleted file mode 100644 index d46f5af..0000000 --- a/tools/assistant/compat/images/mac/zoomin.png +++ /dev/null diff --git a/tools/assistant/compat/images/mac/zoomout.png b/tools/assistant/compat/images/mac/zoomout.png Binary files differdeleted file mode 100644 index 4632656..0000000 --- a/tools/assistant/compat/images/mac/zoomout.png +++ /dev/null diff --git a/tools/assistant/compat/images/qt.png b/tools/assistant/compat/images/qt.png Binary files differdeleted file mode 100644 index 2dc6716..0000000 --- a/tools/assistant/compat/images/qt.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/addtab.png b/tools/assistant/compat/images/win/addtab.png Binary files differdeleted file mode 100644 index 4bb0feb..0000000 --- a/tools/assistant/compat/images/win/addtab.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/book.png b/tools/assistant/compat/images/win/book.png Binary files differdeleted file mode 100644 index 09ec4d3..0000000 --- a/tools/assistant/compat/images/win/book.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/closetab.png b/tools/assistant/compat/images/win/closetab.png Binary files differdeleted file mode 100644 index ef9e020..0000000 --- a/tools/assistant/compat/images/win/closetab.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/editcopy.png b/tools/assistant/compat/images/win/editcopy.png Binary files differdeleted file mode 100644 index 1121b47..0000000 --- a/tools/assistant/compat/images/win/editcopy.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/find.png b/tools/assistant/compat/images/win/find.png Binary files differdeleted file mode 100644 index 6ea35e9..0000000 --- a/tools/assistant/compat/images/win/find.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/home.png b/tools/assistant/compat/images/win/home.png Binary files differdeleted file mode 100644 index b1c6ae1..0000000 --- a/tools/assistant/compat/images/win/home.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/next.png b/tools/assistant/compat/images/win/next.png Binary files differdeleted file mode 100644 index 8df4127..0000000 --- a/tools/assistant/compat/images/win/next.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/previous.png b/tools/assistant/compat/images/win/previous.png Binary files differdeleted file mode 100644 index 0780bc2..0000000 --- a/tools/assistant/compat/images/win/previous.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/print.png b/tools/assistant/compat/images/win/print.png Binary files differdeleted file mode 100644 index ba7c02d..0000000 --- a/tools/assistant/compat/images/win/print.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/synctoc.png b/tools/assistant/compat/images/win/synctoc.png Binary files differdeleted file mode 100644 index da301bc..0000000 --- a/tools/assistant/compat/images/win/synctoc.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/whatsthis.png b/tools/assistant/compat/images/win/whatsthis.png Binary files differdeleted file mode 100644 index 623cad6..0000000 --- a/tools/assistant/compat/images/win/whatsthis.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/zoomin.png b/tools/assistant/compat/images/win/zoomin.png Binary files differdeleted file mode 100644 index 2e586fc..0000000 --- a/tools/assistant/compat/images/win/zoomin.png +++ /dev/null diff --git a/tools/assistant/compat/images/win/zoomout.png b/tools/assistant/compat/images/win/zoomout.png Binary files differdeleted file mode 100644 index a736d39..0000000 --- a/tools/assistant/compat/images/win/zoomout.png +++ /dev/null diff --git a/tools/assistant/compat/images/wrap.png b/tools/assistant/compat/images/wrap.png Binary files differdeleted file mode 100644 index 90f18d9..0000000 --- a/tools/assistant/compat/images/wrap.png +++ /dev/null diff --git a/tools/assistant/compat/index.cpp b/tools/assistant/compat/index.cpp deleted file mode 100644 index ff54626..0000000 --- a/tools/assistant/compat/index.cpp +++ /dev/null @@ -1,581 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "index.h" - -#include <QFile> -#include <QDir> -#include <QStringList> -#include <QApplication> -#include <QByteArray> -#include <QTextStream> -#include <QtAlgorithms> -#include <QUrl> -#include <QTextCodec> -#include <ctype.h> -#include <QTextDocument> - -QT_BEGIN_NAMESPACE - -struct Term { - Term() : frequency(-1) {} - Term( const QString &t, int f, QVector<Document> l ) : term( t ), frequency( f ), documents( l ) {} - QString term; - int frequency; - QVector<Document>documents; - bool operator<( const Term &i2 ) const { return frequency < i2.frequency; } -}; - -QDataStream &operator>>( QDataStream &s, Document &l ) -{ - s >> l.docNumber; - s >> l.frequency; - return s; -} - -QDataStream &operator<<( QDataStream &s, const Document &l ) -{ - s << (qint16)l.docNumber; - s << (qint16)l.frequency; - return s; -} - -Index::Index( const QString &dp, const QString &hp ) - : QObject( 0 ), docPath( dp ) -{ - Q_UNUSED(hp); - - alreadyHaveDocList = false; - lastWindowClosed = false; - connect( qApp, SIGNAL(lastWindowClosed()), - this, SLOT(setLastWinClosed()) ); -} - -Index::Index( const QStringList &dl, const QString &hp ) - : QObject( 0 ) -{ - Q_UNUSED(hp); - docList = dl; - alreadyHaveDocList = true; - lastWindowClosed = false; - connect( qApp, SIGNAL(lastWindowClosed()), - this, SLOT(setLastWinClosed()) ); -} - -void Index::setLastWinClosed() -{ - lastWindowClosed = true; -} - -void Index::setDictionaryFile( const QString &f ) -{ - dictFile = f; -} - -void Index::setDocListFile( const QString &f ) -{ - docListFile = f; -} - -void Index::setDocList( const QStringList &lst ) -{ - docList = lst; -} - -int Index::makeIndex() -{ - if ( !alreadyHaveDocList ) - setupDocumentList(); - if ( docList.isEmpty() ) - return 1; - QStringList::Iterator it = docList.begin(); - int steps = docList.count() / 100; - if ( !steps ) - steps++; - int prog = 0; - for ( int i = 0; it != docList.end(); ++it, ++i ) { - if ( lastWindowClosed ) { - return -1; - } - QUrl url(*it); - parseDocument( url.toLocalFile(), i ); - if ( i%steps == 0 ) { - prog++; - emit indexingProgress( prog ); - } - } - return 0; -} - -void Index::setupDocumentList() -{ - QDir d( docPath ); - QStringList filters; - filters.append(QLatin1String("*.html")); - QStringList lst = d.entryList(filters); - QStringList::ConstIterator it = lst.constBegin(); - for ( ; it != lst.constEnd(); ++it ) - docList.append( QLatin1String("file:") + docPath + QLatin1String("/") + *it ); -} - -void Index::insertInDict( const QString &str, int docNum ) -{ - if ( str == QLatin1String("amp") || str == QLatin1String("nbsp")) - return; - Entry *e = 0; - if ( dict.count() ) - e = dict[ str ]; - - if ( e ) { - if ( e->documents.last().docNumber != docNum ) - e->documents.append( Document(docNum, 1 ) ); - else - e->documents.last().frequency++; - } else { - dict.insert( str, new Entry( docNum ) ); - } -} - -QString Index::getCharsetForDocument(QFile *file) -{ - QTextStream s(file); - QString contents = s.readAll(); - - QString encoding; - int start = contents.indexOf(QLatin1String("<meta"), 0, Qt::CaseInsensitive); - if (start > 0) { - int end = contents.indexOf(QLatin1String(">"), start); - QString meta = contents.mid(start+5, end-start); - meta = meta.toLower(); - QRegExp r(QLatin1String("charset=([^\"\\s]+)")); - if (r.indexIn(meta) != -1) { - encoding = r.cap(1); - } - } - - file->seek(0); - if (encoding.isEmpty()) - return QLatin1String("utf-8"); - return encoding; -} - -void Index::parseDocument( const QString &filename, int docNum ) -{ - QFile file( filename ); - if ( !file.open(QFile::ReadOnly) ) { - qWarning( "can not open file %s", qPrintable(filename) ); - return; - } - - QTextStream s(&file); - QString en = getCharsetForDocument(&file); - s.setCodec(QTextCodec::codecForName(en.toLatin1().constData())); - - QString text = s.readAll(); - if (text.isNull()) - return; - - bool valid = true; - const QChar *buf = text.unicode(); - QChar str[64]; - QChar c = buf[0]; - int j = 0; - int i = 0; - while ( j < text.length() ) { - if ( c == QLatin1Char('<') || c == QLatin1Char('&') ) { - valid = false; - if ( i > 1 ) - insertInDict( QString(str,i), docNum ); - i = 0; - c = buf[++j]; - continue; - } - if ( ( c == QLatin1Char('>') || c == QLatin1Char(';') ) && !valid ) { - valid = true; - c = buf[++j]; - continue; - } - if ( !valid ) { - c = buf[++j]; - continue; - } - if ( ( c.isLetterOrNumber() || c == QLatin1Char('_') ) && i < 63 ) { - str[i] = c.toLower(); - ++i; - } else { - if ( i > 1 ) - insertInDict( QString(str,i), docNum ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - insertInDict( QString(str,i), docNum ); - file.close(); -} - -void Index::writeDict() -{ - QFile f( dictFile ); - if ( !f.open(QFile::WriteOnly ) ) - return; - QDataStream s( &f ); - for(QHash<QString, Entry *>::Iterator it = dict.begin(); it != dict.end(); ++it) { - s << it.key(); - s << it.value()->documents.count(); - s << it.value()->documents; - } - f.close(); - writeDocumentList(); -} - -void Index::writeDocumentList() -{ - QFile f( docListFile ); - if ( !f.open(QFile::WriteOnly ) ) - return; - QDataStream s( &f ); - s << docList; -} - -void Index::readDict() -{ - QFile f( dictFile ); - if ( !f.open(QFile::ReadOnly ) ) - return; - - dict.clear(); - QDataStream s( &f ); - QString key; - int numOfDocs; - QVector<Document> docs; - while ( !s.atEnd() ) { - s >> key; - s >> numOfDocs; - docs.resize(numOfDocs); - s >> docs; - dict.insert( key, new Entry( docs ) ); - } - f.close(); - readDocumentList(); -} - -void Index::readDocumentList() -{ - QFile f( docListFile ); - if ( !f.open(QFile::ReadOnly ) ) - return; - QDataStream s( &f ); - s >> docList; -} - -QStringList Index::query( const QStringList &terms, const QStringList &termSeq, const QStringList &seqWords ) -{ - QList<Term> termList; - for (QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it ) { - Entry *e = 0; - if ( (*it).contains(QLatin1Char('*')) ) { - QVector<Document> wcts = setupDummyTerm( getWildcardTerms( *it ) ); - termList.append( Term(QLatin1String("dummy"), wcts.count(), wcts ) ); - } else if ( dict[ *it ] ) { - e = dict[ *it ]; - termList.append( Term( *it, e->documents.count(), e->documents ) ); - } else { - return QStringList(); - } - } - if ( !termList.count() ) - return QStringList(); - qSort(termList); - - QVector<Document> minDocs = termList.takeFirst().documents; - for(QList<Term>::Iterator it = termList.begin(); it != termList.end(); ++it) { - Term *t = &(*it); - QVector<Document> docs = t->documents; - for(QVector<Document>::Iterator minDoc_it = minDocs.begin(); minDoc_it != minDocs.end(); ) { - bool found = false; - for (QVector<Document>::ConstIterator doc_it = docs.constBegin(); doc_it != docs.constEnd(); ++doc_it ) { - if ( (*minDoc_it).docNumber == (*doc_it).docNumber ) { - (*minDoc_it).frequency += (*doc_it).frequency; - found = true; - break; - } - } - if ( !found ) - minDoc_it = minDocs.erase( minDoc_it ); - else - ++minDoc_it; - } - } - - QStringList results; - qSort( minDocs ); - if ( termSeq.isEmpty() ) { - for(QVector<Document>::Iterator it = minDocs.begin(); it != minDocs.end(); ++it) - results << docList.at((int)(*it).docNumber); - return results; - } - - QString fileName; - for(QVector<Document>::Iterator it = minDocs.begin(); it != minDocs.end(); ++it) { - fileName = docList[ (int)(*it).docNumber ]; - if ( searchForPattern( termSeq, seqWords, fileName ) ) - results << fileName; - } - return results; -} - -QString Index::getDocumentTitle( const QString &fullFileName ) -{ - QUrl url(fullFileName); - QString fileName = url.toLocalFile(); - - if (documentTitleCache.contains(fileName)) - return documentTitleCache.value(fileName); - - QFile file( fileName ); - if ( !file.open( QFile::ReadOnly ) ) { - qWarning( "cannot open file %s", qPrintable(fileName) ); - return fileName; - } - QTextStream s( &file ); - QString text = s.readAll(); - - int start = text.indexOf(QLatin1String("<title>"), 0, Qt::CaseInsensitive) + 7; - int end = text.indexOf(QLatin1String("</title>"), 0, Qt::CaseInsensitive); - - QString title = tr("Untitled"); - if (end - start > 0) { - title = text.mid(start, end - start); - if (Qt::mightBeRichText(title)) { - QTextDocument doc; - doc.setHtml(title); - title = doc.toPlainText(); - } - } - documentTitleCache.insert(fileName, title); - return title; -} - -QStringList Index::getWildcardTerms( const QString &term ) -{ - QStringList lst; - QStringList terms = split( term ); - QStringList::Iterator iter; - - for(QHash<QString, Entry*>::Iterator it = dict.begin(); it != dict.end(); ++it) { - int index = 0; - bool found = false; - QString text( it.key() ); - for ( iter = terms.begin(); iter != terms.end(); ++iter ) { - if ( *iter == QLatin1String("*") ) { - found = true; - continue; - } - if ( iter == terms.begin() && (*iter)[0] != text[0] ) { - found = false; - break; - } - index = text.indexOf( *iter, index ); - if ( *iter == terms.last() && index != (int)text.length()-1 ) { - index = text.lastIndexOf( *iter ); - if ( index != (int)text.length() - (int)(*iter).length() ) { - found = false; - break; - } - } - if ( index != -1 ) { - found = true; - index += (*iter).length(); - continue; - } else { - found = false; - break; - } - } - if ( found ) - lst << text; - } - - return lst; -} - -QStringList Index::split( const QString &str ) -{ - QStringList lst; - int j = 0; - int i = str.indexOf(QLatin1Char('*'), j ); - - if (str.startsWith(QLatin1String("*"))) - lst << QLatin1String("*"); - - while ( i != -1 ) { - if ( i > j && i <= (int)str.length() ) { - lst << str.mid( j, i - j ); - lst << QLatin1String("*"); - } - j = i + 1; - i = str.indexOf(QLatin1Char('*'), j ); - } - - int l = str.length() - 1; - if ( str.mid( j, l - j + 1 ).length() > 0 ) - lst << str.mid( j, l - j + 1 ); - - return lst; -} - -QVector<Document> Index::setupDummyTerm( const QStringList &terms ) -{ - QList<Term> termList; - for (QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it) { - Entry *e = 0; - if ( dict[ *it ] ) { - e = dict[ *it ]; - termList.append( Term( *it, e->documents.count(), e->documents ) ); - } - } - QVector<Document> maxList(0); - if ( !termList.count() ) - return maxList; - qSort(termList); - - maxList = termList.takeLast().documents; - for(QList<Term>::Iterator it = termList.begin(); it != termList.end(); ++it) { - Term *t = &(*it); - QVector<Document> docs = t->documents; - for (QVector<Document>::iterator docIt = docs.begin(); docIt != docs.end(); ++docIt ) { - if ( maxList.indexOf( *docIt ) == -1 ) - maxList.append( *docIt ); - } - } - return maxList; -} - -void Index::buildMiniDict( const QString &str ) -{ - if ( miniDict[ str ] ) - miniDict[ str ]->positions.append( wordNum ); - ++wordNum; -} - -bool Index::searchForPattern( const QStringList &patterns, const QStringList &words, const QString &fileName ) -{ - QUrl url(fileName); - QString fName = url.toLocalFile(); - QFile file( fName ); - if ( !file.open( QFile::ReadOnly ) ) { - qWarning( "cannot open file %s", qPrintable(fName) ); - return false; - } - - wordNum = 3; - miniDict.clear(); - QStringList::ConstIterator cIt = words.begin(); - for ( ; cIt != words.end(); ++cIt ) - miniDict.insert( *cIt, new PosEntry( 0 ) ); - - QTextStream s( &file ); - QString text = s.readAll(); - bool valid = true; - const QChar *buf = text.unicode(); - QChar str[64]; - QChar c = buf[0]; - int j = 0; - int i = 0; - while ( j < text.length() ) { - if ( c == QLatin1Char('<') || c == QLatin1Char('&') ) { - valid = false; - if ( i > 1 ) - buildMiniDict( QString(str,i) ); - i = 0; - c = buf[++j]; - continue; - } - if ( ( c == QLatin1Char('>') || c == QLatin1Char(';') ) && !valid ) { - valid = true; - c = buf[++j]; - continue; - } - if ( !valid ) { - c = buf[++j]; - continue; - } - if ( ( c.isLetterOrNumber() || c == QLatin1Char('_') ) && i < 63 ) { - str[i] = c.toLower(); - ++i; - } else { - if ( i > 1 ) - buildMiniDict( QString(str,i) ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - buildMiniDict( QString(str,i) ); - file.close(); - - QStringList::ConstIterator patIt = patterns.begin(); - QStringList wordLst; - QList<uint> a, b; - QList<uint>::iterator aIt; - for ( ; patIt != patterns.end(); ++patIt ) { - wordLst = (*patIt).split(QLatin1Char(' ')); - a = miniDict[ wordLst[0] ]->positions; - for ( int j = 1; j < (int)wordLst.count(); ++j ) { - b = miniDict[ wordLst[j] ]->positions; - aIt = a.begin(); - while ( aIt != a.end() ) { - if ( b.contains( *aIt + 1 )) { - (*aIt)++; - ++aIt; - } else { - aIt = a.erase( aIt ); - } - } - } - } - if ( a.count() ) - return true; - return false; -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/index.h b/tools/assistant/compat/index.h deleted file mode 100644 index 9dd6d54..0000000 --- a/tools/assistant/compat/index.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef INDEX_H -#define INDEX_H - -#include <QStringList> -#include <QHash> -#include <QDataStream> -#include <QObject> -#include <QList> -#include <QFile> -#include <QVector> - -QT_BEGIN_NAMESPACE - -struct Document { - Document( int d, int f ) : docNumber( d ), frequency( f ) {} - Document() : docNumber( -1 ), frequency( 0 ) {} - bool operator==( const Document &doc ) const { - return docNumber == doc.docNumber; - } - bool operator<( const Document &doc ) const { - return frequency > doc.frequency; - } - bool operator<=( const Document &doc ) const { - return frequency >= doc.frequency; - } - bool operator>( const Document &doc ) const { - return frequency < doc.frequency; - } - qint16 docNumber; - qint16 frequency; -}; - -QDataStream &operator>>( QDataStream &s, Document &l ); -QDataStream &operator<<( QDataStream &s, const Document &l ); - -class Index : public QObject -{ - Q_OBJECT -public: - struct Entry { - Entry( int d ) { documents.append( Document( d, 1 ) ); } - Entry( QVector<Document> l ) : documents( l ) {} - QVector<Document> documents; - }; - struct PosEntry { - PosEntry( int p ) { positions.append( p ); } - QList<uint> positions; - }; - - Index( const QString &dp, const QString &hp ); - Index( const QStringList &dl, const QString &hp ); - void writeDict(); - void readDict(); - int makeIndex(); - QStringList query( const QStringList&, const QStringList&, const QStringList& ); - QString getDocumentTitle( const QString& ); - void setDictionaryFile( const QString& ); - void setDocListFile( const QString& ); - void setDocList( const QStringList & ); - -signals: - void indexingProgress( int ); - -private slots: - void setLastWinClosed(); - -private: - void setupDocumentList(); - void parseDocument( const QString&, int ); - void insertInDict( const QString&, int ); - void writeDocumentList(); - void readDocumentList(); - QStringList getWildcardTerms( const QString& ); - QStringList split( const QString& ); - QVector<Document> setupDummyTerm( const QStringList& ); - bool searchForPattern( const QStringList&, const QStringList&, const QString& ); - void buildMiniDict( const QString& ); - QString getCharsetForDocument(QFile *); - QStringList docList; - QHash<QString, Entry*> dict; - QHash<QString, PosEntry*> miniDict; - uint wordNum; - QString docPath; - QString dictFile, docListFile; - bool alreadyHaveDocList; - bool lastWindowClosed; - QHash<QString, QString> documentTitleCache; -}; - -#endif - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/lib/lib.pro b/tools/assistant/compat/lib/lib.pro deleted file mode 100644 index e50d470..0000000 --- a/tools/assistant/compat/lib/lib.pro +++ /dev/null @@ -1,78 +0,0 @@ -TEMPLATE = lib -QT += network -TARGET = QtAssistantClient -isEmpty(QT_MAJOR_VERSION) { - VERSION=4.3.0 -} else { - VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} -} - -CONFIG += qt warn_on -mac|win32:CONFIG += debug_and_release -mac:unix:CONFIG += explicitlib -CONFIG -= dll - -HEADERS = qassistantclient.h \ - qassistantclient_global.h -SOURCES = qassistantclient.cpp - -DESTDIR = ../../../../lib -DLLDESTDIR = ../../../../bin - -unix { - QMAKE_CFLAGS += $$QMAKE_CFLAGS_SHLIB - QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_SHLIB -} - -DEFINES += QT_ASSISTANT_CLIENT_LIBRARY -contains(CONFIG, static) { - DEFINES += QT_ASSISTANT_CLIENT_STATIC -} - -#load up the headers info -CONFIG += qt_install_headers -HEADERS_PRI = $$QT_BUILD_TREE/include/QtAssistant/headers.pri -include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) - -#mac frameworks -mac:!static:contains(QT_CONFIG, qt_framework) { - TARGET = QtAssistant # Change the name to match the headers - QMAKE_FRAMEWORK_BUNDLE_NAME = $$TARGET - CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework - CONFIG(debug, debug|release) { - !build_pass:CONFIG += build_all - } else { #release - !debug_and_release|build_pass { - CONFIG -= qt_install_headers #no need to install these as well - FRAMEWORK_HEADERS.version = Versions - FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - FRAMEWORK_HEADERS.path = Headers - } - QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS - } -} - -TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #done towards the end - -target.path=$$[QT_INSTALL_LIBS] -INSTALLS += target -win32 { - dlltarget.path=$$[QT_INSTALL_BINS] - INSTALLS += dlltarget -} - -qt_install_headers { - assistant_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES - assistant_headers.path = $$[QT_INSTALL_HEADERS]/QtAssistant - INSTALLS += assistant_headers -} - -unix { - CONFIG += create_pc - QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] - QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/QtAssistant - QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] - QMAKE_PKGCONFIG_DESTDIR = pkgconfig - QMAKE_PKGCONFIG_REQUIRES += QtNetwork -} - diff --git a/tools/assistant/compat/lib/qassistantclient.cpp b/tools/assistant/compat/lib/qassistantclient.cpp deleted file mode 100644 index 72d0a92..0000000 --- a/tools/assistant/compat/lib/qassistantclient.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qassistantclient.h" - -#include <qtcpsocket.h> -#include <qtextstream.h> -#include <qtimer.h> -#include <qfileinfo.h> -#include <qmap.h> - -QT_BEGIN_NAMESPACE - -class QAssistantClientPrivate -{ - friend class QAssistantClient; - QStringList arguments; -}; - -static QMap<const QAssistantClient*,QAssistantClientPrivate*> *dpointers = 0; - -static QAssistantClientPrivate *data( const QAssistantClient *client, bool create=false ) -{ - if( !dpointers ) - dpointers = new QMap<const QAssistantClient*,QAssistantClientPrivate*>; - QAssistantClientPrivate *d = (*dpointers)[client]; - if( !d && create ) { - d = new QAssistantClientPrivate; - dpointers->insert( client, d ); - } - return d; -} - -/*! - \class QAssistantClient - \obsolete - \brief The QAssistantClient class provides a means of using Qt - Assistant as an application's help tool. - - \ingroup helpsystem - - \bold{Note:} \e{This class is obsolete and only required when using - the old Qt Assistant, now called assistant_adp. If you want to use - the new Qt Assistant as a remote help viewer, simple create a - QProcess instance and specify \tt{assistant} as its executable. - The following code shows how to start Qt Assistant and request a - certain page to be shown:} - - \snippet doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp 0 - - \e{For a complete example using the Qt Assistant remotely, see the \l - {help/remotecontrol}{Remote Control} example.} - - In order to make Qt Assistant act as a customized help tool for - your application, you must provide your application with a - QAssistantClient object in addition to a \l - {assistant-manual.html} {Qt Assistant Document Profile} (\c .adp - file) and the associated documentation. - - Note that the QAssistantClient class is not included in the Qt - library. To use it you must add the following line to your pro - file: - - \snippet doc/src/snippets/code/tools_assistant_compat_lib_qassistantclient.cpp 1 - - A QAssistantClient instance can open or close Qt Assistant - whenever it is required. - - Once you have created a QAssistantClient instance, specifying the - path to the Qt Assistant executable, using Qt Assistant is - simple: You can either call the openAssistant() slot to show the - defined start page of the documentation, or you can call the - showPage() slot to show a particular help page. When you call - openAssistant() and showPage(), Qt Assistant will be launched if - it isn't already running. When Qt Assistant is running, the - isOpen() function returns true. - - When calling showPage() the Qt Assistant instance will also be - brought to the foreground if its hidden. The showPage() slot can - be called multiple times, while calling openAssistant() several - times without closing the application in between, will have no - effect. - - You can close Qt Assistant at any time using the closeAssistant() - slot. When you call openAssistant(), or you call showPage() - without a previous call to openAssistant(), the assistantOpened() - signal is emitted. Similarly when closeAssistant() is called, - assistantClosed() is emitted. In either case, if an error occurs, - error() is emitted. - - One QAssistantClient instance interacts with one Qt Assistant - instance, so every time you call openAssistant(), showPage() or - closeAssistant() they are applied to the particular Qt Assistant - instance associated with the QAssistantClient. - - Qt Assistant's documentation set can be altered using the command - line arguments that are passed to the application when it is - launched. When started without any options, Qt Assistant displays - a default set of documentation. When Qt is installed, the default - documentation set in Qt Assistant contains the Qt reference - documentation as well as the tools that come with Qt, such as \QD - and \c qmake. - - Use the setArguments() function to specify the command line - arguments. You can add or remove documentation from Qt Assistant - by adding and removing the relevant content files: The command - line arguments are \c {-addContentFile file.dcf} and \c - {-removeContentFile file.dcf} respectively. You can make Qt - Assistant run customized documentation sets that are separate from - the Qt documentation, by specifying a profile: \c {-profile - myapplication.adp}. The profile format can also be used to alter - several of Qt Assistant's properties such as its title and - startpage. - - The Documentation Content File (\c .dcf) and Qt Assistant - Documentation Profile (\c .adp) formats are documented in the \l - {assistant-manual.html}{Qt Assistant Manual}. - - For a complete example using the QAssistantClient class, see the - \e{Simple Text Viewer} example. The example shows how you can make - Qt Assistant act as a customized help tool for your application - using the QAssistantClient class combined with a Qt Assistant - Document Profile. - - \sa {Qt Assistant Manual}, {Simple Text Viewer Example} -*/ - -/*! - \fn void QAssistantClient::assistantOpened() - - This signal is emitted when Qt Assistant is opened and the - client-server communication is set up. - - \sa openAssistant(), showPage() -*/ - -/*! - \fn void QAssistantClient::assistantClosed() - - This signal is emitted when the connection to Qt Assistant is - closed. This happens when the user exits Qt Assistant, if an - error in the server or client occurs, or if closeAssistant() is - called. - - \sa closeAssistant() -*/ - -/*! - \fn void QAssistantClient::error( const QString &message ) - - This signal is emitted if Qt Assistant cannot be started, or if an - error occurs during the initialization of the connection between - Qt Assistant and the calling application. The \a message provides an - explanation of the error. -*/ - -/*! - Constructs an assistant client with the specified \a parent. For - systems other than Mac OS, \a path specifies the path to the Qt - Assistant executable. For Mac OS, \a path specifies a directory - containing a valid assistant.app bundle. If \a path is the empty - string, the system path (\c{%PATH%} or \c $PATH) is used. -*/ -QAssistantClient::QAssistantClient( const QString &path, QObject *parent ) - : QObject( parent ), host ( QLatin1String("localhost") ) -{ -#if defined(Q_OS_MAC) - const QString assistant = QLatin1String("Assistant_adp"); -#else - const QString assistant = QLatin1String("assistant_adp"); -#endif - - if ( path.isEmpty() ) - assistantCommand = assistant; - else { - QFileInfo fi( path ); - if ( fi.isDir() ) - assistantCommand = path + QLatin1String("/") + assistant; - else - assistantCommand = path; - } - -#if defined(Q_OS_MAC) - assistantCommand += QLatin1String(".app/Contents/MacOS/Assistant_adp"); -#endif - - socket = new QTcpSocket( this ); - connect( socket, SIGNAL(connected()), - SLOT(socketConnected()) ); - connect( socket, SIGNAL(disconnected()), - SLOT(socketConnectionClosed()) ); - connect( socket, SIGNAL(error(QAbstractSocket::SocketError)), - SLOT(socketError()) ); - opened = false; - proc = new QProcess( this ); - port = 0; - pageBuffer = QLatin1String(""); - connect( proc, SIGNAL(readyReadStandardError()), - this, SLOT(readStdError()) ); - connect( proc, SIGNAL(error(QProcess::ProcessError)), - this, SLOT(procError(QProcess::ProcessError)) ); -} - -/*! - Destroys the assistant client object. -*/ -QAssistantClient::~QAssistantClient() -{ - if ( proc->state() == QProcess::Running ) - proc->terminate(); - - if( dpointers ) { - QAssistantClientPrivate *d = (*dpointers)[ this ]; - if ( d ) { - dpointers->remove(this); - delete d; - if( dpointers->isEmpty() ) { - delete dpointers; - dpointers = 0; - } - } - } -} - -/*! - Opens Qt Assistant, i.e. sets up the client-server communication - between the application and Qt Assistant, and shows the start page - specified by the current \l {assistant-manual.html} - {Qt Assistant Document Profile}. If there is no specfied profile, - and Qt is installed, the default start page is the Qt Reference - Documentation's index page. - - If the connection is already established, this function does - nothing. Use the showPage() function to show another page. If an - error occurs, the error() signal is emitted. - - \sa showPage(), assistantOpened() -*/ -void QAssistantClient::openAssistant() -{ - if ( proc->state() == QProcess::Running ) - return; - - QStringList args; - args.append(QLatin1String("-server")); - if( !pageBuffer.isEmpty() ) { - args.append( QLatin1String("-file") ); - args.append( pageBuffer ); - } - - QAssistantClientPrivate *d = data( this ); - if( d ) { - QStringList::ConstIterator it = d->arguments.constBegin(); - while( it!=d->arguments.constEnd() ) { - args.append( *it ); - ++it; - } - } - - connect( proc, SIGNAL(readyReadStandardOutput()), - this, SLOT(readPort()) ); - - proc->start(assistantCommand, args); -} - -void QAssistantClient::procError(QProcess::ProcessError err) -{ - switch (err) - { - case QProcess::FailedToStart: - emit error( tr( "Failed to start Qt Assistant." ) ); - break; - case QProcess::Crashed: - emit error( tr( "Qt Assistant crashed." ) ); - break; - default: - emit error( tr( "Error while running Qt Assistant." ) ); - } -} - -void QAssistantClient::readPort() -{ - QString p(QString::fromLatin1(proc->readAllStandardOutput())); - quint16 port = p.toUShort(); - if ( port == 0 ) { - emit error( tr( "Cannot connect to Qt Assistant." ) ); - return; - } - socket->connectToHost( host, port ); - disconnect( proc, SIGNAL(readyReadStandardOutput()), - this, SLOT(readPort()) ); -} - -/*! - Closes the Qt Assistant instance. - - \sa openAssistant(), assistantClosed() -*/ -void QAssistantClient::closeAssistant() -{ - if ( !opened ) - return; - - bool blocked = proc->blockSignals(true); - proc->terminate(); - if (!proc->waitForFinished(2000)) { - // If the process hasn't died after 2 seconds, - // we kill it, causing it to exit immediately. - proc->kill(); - } - proc->blockSignals(blocked); -} - -/*! - Brings Qt Assistant to the foreground showing the given \a page. - The \a page parameter is a path to an HTML file - (e.g., QLatin1String("/home/pasquale/superproduct/docs/html/intro.html")). - - If Qt Assistant hasn't been opened yet, this function will call - the openAssistant() slot with the specified page as the start - page. - - \note The first time Qt Assistant is started, its window will open - in front of the application's windows. Subsequent calls to this function - will only load the specified pages in Qt Assistant and will not display - its window in front of the application's windows. - - \sa openAssistant() -*/ -void QAssistantClient::showPage( const QString &page ) -{ - if (opened) { - QTextStream os( socket ); - os << page << QLatin1String("\n"); - } else { - pageBuffer = page; - - if (proc->state() == QProcess::NotRunning) { - openAssistant(); - pageBuffer.clear(); - return; - } - } -} - -/*! - \property QAssistantClient::open - \brief whether Qt Assistant is open - -*/ -bool QAssistantClient::isOpen() const -{ - return opened; -} - -void QAssistantClient::socketConnected() -{ - opened = true; - if ( !pageBuffer.isEmpty() ) - showPage( pageBuffer ); - emit assistantOpened(); -} - -void QAssistantClient::socketConnectionClosed() -{ - opened = false; - emit assistantClosed(); -} - -void QAssistantClient::socketError() -{ - QAbstractSocket::SocketError err = socket->error(); - if (err == QTcpSocket::ConnectionRefusedError) - emit error( tr( "Could not connect to Assistant: Connection refused" ) ); - else if (err == QTcpSocket::HostNotFoundError) - emit error( tr( "Could not connect to Assistant: Host not found" ) ); - else if (err != QTcpSocket::RemoteHostClosedError) - emit error( tr( "Communication error" ) ); -} - -void QAssistantClient::readStdError() -{ - QString errmsg = QString::fromLatin1(proc->readAllStandardError()); - - if (!errmsg.isEmpty()) - emit error( errmsg.simplified() ); -} - -/*! - \fn void QAssistantClient::setArguments(const QStringList &arguments) - - Sets the command line \a arguments that are passed to Qt Assistant - when it is launched. - - The command line arguments can be used to alter Qt Assistant's - documentation set. When started without any options, Qt Assistant - displays a default set of documentation. When Qt is installed, the - default documentation set in Qt Assistant contains the Qt - reference documentation as well as the tools that come with Qt, - such as Qt Designer and qmake. -*/ -void QAssistantClient::setArguments( const QStringList &args ) -{ - QAssistantClientPrivate *d = data( this, true ); - d->arguments = args; -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/lib/qassistantclient.h b/tools/assistant/compat/lib/qassistantclient.h deleted file mode 100644 index fc8bb5b..0000000 --- a/tools/assistant/compat/lib/qassistantclient.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QASSISTANTCLIENT_H -#define QASSISTANTCLIENT_H - -#include <QtCore/QObject> -#include <QtCore/QStringList> -#include <QtCore/QProcess> -#include <QtCore/qglobal.h> -#include <QtAssistant/qassistantclient_global.h> - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QTcpSocket; - -class QT_ASSISTANT_CLIENT_EXPORT QAssistantClient : public QObject -{ - Q_OBJECT - Q_PROPERTY( bool open READ isOpen ) - -public: - QAssistantClient( const QString &path, QObject *parent = 0); - ~QAssistantClient(); - - bool isOpen() const; - - void setArguments( const QStringList &args ); - -public Q_SLOTS: - virtual void openAssistant(); - virtual void closeAssistant(); - virtual void showPage( const QString &page ); - -Q_SIGNALS: - void assistantOpened(); - void assistantClosed(); - void error( const QString &msg ); - -private Q_SLOTS: - void socketConnected(); - void socketConnectionClosed(); - void readPort(); - void procError(QProcess::ProcessError err); - void socketError(); - void readStdError(); - -private: - QTcpSocket *socket; - QProcess *proc; - quint16 port; - QString host, assistantCommand, pageBuffer; - bool opened; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/tools/assistant/compat/main.cpp b/tools/assistant/compat/main.cpp deleted file mode 100644 index c16c52e..0000000 --- a/tools/assistant/compat/main.cpp +++ /dev/null @@ -1,465 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" -#include "helpdialog.h" -#include "config.h" - -#include <QTcpServer> -#include <QTcpSocket> -#include <QApplication> -#include <QPixmap> -#include <QStringList> -#include <QDir> -#include <QMessageBox> -#include <QPointer> -#include <QTranslator> -#include <QLibraryInfo> -#include <QLocale> -#include <stdlib.h> -#include <stdio.h> - -#if defined(USE_STATIC_JPEG_PLUGIN) - #include <QtPlugin> - Q_IMPORT_PLUGIN(qjpeg) -#endif - -#define INDEX_CHECK( text ) if( i+1 >= argc ) { fprintf(stderr, "%s\n", text); return 1; } - -QT_BEGIN_NAMESPACE - -#if !defined(QT_NO_DBUS) && defined(Q_OS_UNIX) -QT_BEGIN_INCLUDE_NAMESPACE -#include <QtDBus/QDBusConnection> -#include <QtDBus/QDBusAbstractAdaptor> -#include <QtDBus/QDBusObjectPath> -#include "tabbedbrowser.h" -QT_END_INCLUDE_NAMESPACE - -class HelpWindowAdaptor : public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.Assistant.HelpWindow") - - Q_PROPERTY(QString source READ source WRITE setSource) - -public: - HelpWindowAdaptor(HelpWindow *w) : QDBusAbstractAdaptor(w), helpWindow(w) - { - setAutoRelaySignals(true); - } - -public Q_SLOTS: - inline QString source() const { return helpWindow->source().toString(); } - inline void setSource(const QString &src) { helpWindow->setSource(src); } - - inline void clearHistory() { helpWindow->clearHistory(); } - inline void backward() { helpWindow->backward(); } - inline void forward() { helpWindow->forward(); } - inline void reload() { helpWindow->reload(); } - inline void home() { helpWindow->home(); } - -private: - HelpWindow *helpWindow; -}; - -class AssistantAdaptor : public QDBusAbstractAdaptor -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "com.trolltech.Assistant.HelpViewer") - -public: - AssistantAdaptor(MainWindow *mw) : QDBusAbstractAdaptor(mw), mw(mw) - { - QDBusConnection connection = QDBusConnection::sessionBus(); - connection.registerService(QLatin1String("com.trolltech.Assistant")); - connection.registerObject(QLatin1String("/Assistant"), mw); - } - -public slots: - void showLink(const QString &link) { mw->showLink(link); } - QDBusObjectPath createNewTab(); - QDBusObjectPath currentTab(); - -private: - QDBusObjectPath pathForBrowser(HelpWindow *window); - MainWindow *mw; -}; - -QDBusObjectPath AssistantAdaptor::createNewTab() -{ - HelpWindow *window = mw->browsers()->newBackgroundTab(); - return pathForBrowser(window); -} - -QDBusObjectPath AssistantAdaptor::currentTab() -{ - HelpWindow *window = mw->browsers()->currentBrowser(); - return pathForBrowser(window); -} - -QDBusObjectPath AssistantAdaptor::pathForBrowser(HelpWindow *window) -{ - int index = mw->browsers()->browsers().indexOf(window); - if (index == -1) - return QDBusObjectPath(); - - QString name(QLatin1String("/Assistant/Tabs/")); - name += QString::number(index); - QDBusObjectPath path(name); - - if (!window->findChild<HelpWindowAdaptor *>()) { - (void)new HelpWindowAdaptor(window); - QDBusConnection::sessionBus().registerObject(name, window); - } - - return path; -} - -#endif // QT_NO_DBUS - -class AssistantSocket : public QTcpSocket -{ - Q_OBJECT -public: - AssistantSocket( int sock, QObject *parent = 0 ); - ~AssistantSocket() {} - -signals: - void showLinkRequest( const QString& ); - -private slots: - void readClient(); - void connectionClosed(); -}; - - -class AssistantServer : public QTcpServer -{ - Q_OBJECT -public: - AssistantServer( QObject* parent = 0 ); - quint16 getPort() const; - -signals: - void showLinkRequest( const QString& ); - void newConnect(); - -public slots: - virtual void incomingConnection( int socket ); - -private: - quint16 p; -}; - -AssistantSocket::AssistantSocket( int sock, QObject *parent ) - : QTcpSocket( parent ) -{ - connect( this, SIGNAL(readyRead()), SLOT(readClient()) ); - connect( this, SIGNAL(disconnected()), SLOT(connectionClosed()) ); - setSocketDescriptor( sock ); -} - -void AssistantSocket::readClient() -{ - QString link = QString(); - while ( canReadLine() ) - link = QLatin1String(readLine()); - if ( !link.isNull() ) { - link = link.replace(QLatin1String("\n"), QLatin1String("")); - link = link.replace(QLatin1String("\r"), QLatin1String("")); - QFileInfo fi(link); - link = fi.absoluteFilePath(); - emit showLinkRequest( link ); - } -} - -void AssistantSocket::connectionClosed() -{ - deleteLater(); -} - -AssistantServer::AssistantServer( QObject *parent ) - : QTcpServer( parent ) -{ - listen(QHostAddress::LocalHost, 0); - if ( !isListening() ) { - QMessageBox::critical( 0, tr( "Qt Assistant" ), - tr( "Failed to bind to port %1" ).arg( serverPort() ) ); - exit( 1 ); - } - p = serverPort(); -} - -quint16 AssistantServer::getPort() const -{ - return p; -} - -void AssistantServer::incomingConnection( int socket ) -{ - AssistantSocket *as = new AssistantSocket( socket, this ); - connect( as, SIGNAL(showLinkRequest(QString)), - this, SIGNAL(showLinkRequest(QString)) ); - emit newConnect(); -} - -int runAssistant( int argc, char ** argv ) -{ - bool withGUI = true; -#ifndef Q_WS_WIN - if ( argc > 1 ) { - QString arg = QString::fromLocal8Bit(argv[1]); - arg = arg.toLower(); - if ( arg == QLatin1String("-addcontentfile") - || arg == QLatin1String("-removecontentfile") - || arg == QLatin1String("-help") - || arg == QLatin1String("/?") - ) - withGUI = false; - } -#endif - QApplication a(argc, argv, withGUI); - a.setOrganizationName(QLatin1String("Trolltech")); - a.setApplicationName(QLatin1String("Assistant")); - - QString resourceDir; - AssistantServer *as = 0; - QStringList catlist; - QString file, profileName, aDocPath; - bool server = false; - bool hideSidebar = false; - bool configLoaded = false; - if ( argc == 2 ) { - file = QString::fromLocal8Bit(argv[1]); - if (file.startsWith(QLatin1String("-")) || file == QLatin1String("/?")) { - file.clear(); - } else { - QFileInfo fi(file); - file = fi.absoluteFilePath(); - file = MainWindow::urlifyFileName(file); - } - } - if ( file.isEmpty() ) { - for ( int i = 1; i < argc; i++ ) { - QString opt = QString::fromLocal8Bit(argv[i]).toLower(); - if ( opt == QLatin1String("-file") ) { - INDEX_CHECK( "Missing file argument!" ); - i++; - file = QFile::decodeName(argv[i]); - } else if ( opt == QLatin1String("-server") ) { - server = true; - } else if ( opt == QLatin1String("-profile") ) { - INDEX_CHECK( "Missing profile argument!" ); - profileName = QFile::decodeName(argv[++i]); - } else if ( opt == QLatin1String("-addcontentfile") ) { - INDEX_CHECK( "Missing content file!" ); - Config *c = Config::loadConfig(QString()); - QFileInfo file( QFile::decodeName(argv[i+1]) ); - if( !file.exists() ) { - fprintf(stderr, "Could not locate content file: %s\n", qPrintable(file.absoluteFilePath())); - return 1; - } - DocuParser *parser = DocuParser::createParser( file.absoluteFilePath() ); - if( parser ) { - QFile f( QFile::decodeName(argv[i+1]) ); - if( !parser->parse( &f ) ) { - fprintf(stderr, "Failed to parse file: %s\n", qPrintable(file.absoluteFilePath())); - return 1; - } - parser->addTo( c->profile() ); - c->setDocRebuild( true ); - c->save(); - } - return 0; - } else if ( opt == QLatin1String("-removecontentfile") ) { - INDEX_CHECK("Missing content file!"); - Config *c = Config::loadConfig(QString()); - Profile *profile = c->profile(); - QString contentFile = QString::fromLocal8Bit(argv[i+i]); - QStringList entries; -#ifdef Q_WS_WIN - contentFile.replace(QLatin1Char('\\'), QLatin1Char('/')); - entries = profile->docs.filter(contentFile, Qt::CaseInsensitive); -#else - entries = profile->docs.filter(contentFile); -#endif - if (entries.count() == 0) { - fprintf(stderr, "Could not locate content file: %s\n", qPrintable(contentFile)); - return 1; - } else if (entries.count() > 1) { - fprintf(stderr, "More than one entry matching file name found, " - "please specify full path to file"); - return 1; - } else { - QFileInfo file(entries[0]); - if( !file.exists() ) { - fprintf(stderr, "Could not locate content file: %s\n", qPrintable(file.absoluteFilePath())); - return 1; - } - profile->removeDocFileEntry( file.absoluteFilePath() ); - c->setDocRebuild( true ); - c->save(); - } - return 0; - } else if ( QString( QLatin1String(argv[i]) ).toLower() == QLatin1String("-docpath") ) { - INDEX_CHECK( "Missing path!" ); - QDir dir(QString::fromLocal8Bit(argv[i+1])); - if ( dir.exists() ) { - Config *c = Config::loadConfig(QString()); - c->saveProfile(Profile::createDefaultProfile(dir.absolutePath())); - c->loadDefaultProfile(); - c->setDocRebuild(true); - c->save(); - configLoaded = true; - ++i; - } else { - fprintf(stderr, "The specified path does not exist!\n"); - return 1; - } - } else if ( opt == QLatin1String("-hidesidebar") ) { - hideSidebar = true; - } else if ( opt == QLatin1String("-help") || opt == QLatin1String("/?") ) { - QString helpText = QLatin1String( "Usage: assistant [option]\n" - "Options:\n" - " -file Filename assistant opens the specified file\n" - " -server reads commands from a socket after\n" - " assistant has started\n" - " -profile fileName starts assistant and displays the\n" - " profile specified in the file fileName.\n" - " -addContentFile file adds the content file 'file' to the set of\n" - " documentation available by default\n" - " -removeContentFile file removes the content file 'file' from the\n" - " documentation available by default\n" - " -docPath path sets the Qt documentation root path to\n" - " 'path' and starts assistant\n" - " -hideSidebar assistant will hide the sidebar.\n" - " -resourceDir assistant will load translations from\n" - " this directory.\n" - " -help shows this help."); -#ifdef Q_WS_WIN - QMessageBox::information( 0, QLatin1String("Qt Assistant"), - QLatin1String("<pre>") + helpText + QLatin1String("</pre>") ); -#else - fprintf(stdout, "%s\n", qPrintable(helpText)); -#endif - exit( 0 ); - } else if ( opt == QLatin1String("-resourcedir") ) { - INDEX_CHECK( "Missing resource directory argument!" ); - resourceDir = QFile::decodeName( argv[++i] ); - } else { - fprintf(stderr, "Unrecognized option %s. Try -help to get help.\n", qPrintable(opt)); - return 1; - } - } - } - - if( resourceDir.isNull() ) - resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - - QTranslator translator( 0 ); - translator.load( QLatin1String("assistant_adp_") + QLocale::system().name(), resourceDir ); - a.installTranslator( &translator ); - - QTranslator qtTranslator( 0 ); - qtTranslator.load( QLatin1String("qt_") + QLocale::system().name(), resourceDir ); - a.installTranslator( &qtTranslator ); - - Config *conf = 0; - if (configLoaded) - conf = Config::configuration(); - else - conf = Config::loadConfig( profileName ); - if (!conf) { - fprintf( stderr, "Profile '%s' does not exist!\n", profileName.toLatin1().constData() ); - fflush( stderr ); - return -1; - } - - QStringList links = conf->source(); - conf->hideSideBar( hideSidebar ); - - QPointer<MainWindow> mw = new MainWindow(); - mw->setObjectName(QLatin1String("Assistant")); - - if ( server ) { - as = new AssistantServer(); - printf("%d\n", as->serverPort() ); - fflush( stdout ); - as->connect( as, SIGNAL(showLinkRequest(QString)), - mw, SLOT(showLinkFromClient(QString)) ); - } - -#if !defined(QT_NO_DBUS) && defined(Q_OS_UNIX) - new AssistantAdaptor(mw); -#endif // QT_NO_DBUS - - FontSettings settings = conf->fontSettings(); - if (mw->font() != settings.windowFont) - a.setFont(settings.windowFont, "QWidget"); - -#ifdef Q_WS_MAC - // Make sure AssitantClient shows the window in front. - mw->raise(); -#endif - mw->show(); - - if (!file.isEmpty()) - mw->showLink( MainWindow::urlifyFileName(file) ); - else if (file.isEmpty()) - mw->showLinks( links ); - - a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); - - int appExec = a.exec(); - delete (MainWindow*)mw; - return appExec; -} - -QT_END_NAMESPACE - -int main( int argc, char ** argv ) -{ - Q_INIT_RESOURCE(assistant); - return QT_PREPEND_NAMESPACE(runAssistant)(argc, argv); -} - -#include "main.moc" diff --git a/tools/assistant/compat/mainwindow.cpp b/tools/assistant/compat/mainwindow.cpp deleted file mode 100644 index 76143a5..0000000 --- a/tools/assistant/compat/mainwindow.cpp +++ /dev/null @@ -1,885 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "mainwindow.h" -#include "tabbedbrowser.h" -#include "helpdialog.h" -#include "config.h" -#include "fontsettingsdialog.h" - -#include <QDockWidget> -#include <QDir> -#include <QTimer> -#include <QStatusBar> -#include <QShortcut> -#include <QMessageBox> -#include <QPainter> -#include <QEventLoop> -#include <QtEvents> -#include <QFontDatabase> -#include <QWhatsThis> -#include <QTextDocumentFragment> -#include <QLibraryInfo> -#include <QPrinter> -#include <QPrintDialog> -#include <QAbstractTextDocumentLayout> -#include <QTextDocument> -#include <QTextObject> -#include <QFileDialog> -#include <QThread> - -QT_BEGIN_NAMESPACE - -QList<MainWindow*> MainWindow::windows; - -#if defined(Q_WS_WIN) -extern Q_CORE_EXPORT int qt_ntfs_permission_lookup; -#endif - -MainWindow::MainWindow() -{ - setUnifiedTitleAndToolBarOnMac(true); - ui.setupUi(this); - -#if defined(Q_WS_WIN) - // Workaround for QMimeSourceFactory failing in QFileInfo::isReadable() for - // certain user configs. See task: 34372 - qt_ntfs_permission_lookup = 0; -#endif - setupCompleted = false; - - goActions = QList<QAction*>(); - goActionDocFiles = new QMap<QAction*,QString>; - - windows.append(this); - tabs = new TabbedBrowser(this); - connect(tabs, SIGNAL(tabCountChanged(int)), this, SLOT(updateTabActions(int))); - setCentralWidget(tabs); - - Config *config = Config::configuration(); - - updateProfileSettings(); - - dw = new QDockWidget(this); - dw->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - dw->setWindowTitle(tr("Sidebar")); - dw->setObjectName(QLatin1String("sidebar")); - helpDock = new HelpDialog(dw, this); - dw->setWidget(helpDock); - - addDockWidget(Qt::LeftDockWidgetArea, dw); - - // read geometry configuration - setupGoActions(); - - restoreGeometry(config->windowGeometry()); - restoreState(config->mainWindowState()); - if (config->sideBarHidden()) - dw->hide(); - - tabs->setup(); - QTimer::singleShot(0, this, SLOT(setup())); -#if defined(Q_WS_MAC) - QMenu *windowMenu = new QMenu(tr("&Window"), this); - menuBar()->insertMenu(ui.helpMenu->menuAction(), windowMenu); - windowMenu->addAction(tr("Minimize"), this, - SLOT(showMinimized()), QKeySequence(tr("Ctrl+M"))); - // Use the same forward and backward browser shortcuts as Safari and Internet Explorer do - // on the Mac. This means that if you have access to one of those cool Intellimice, the thing - // works just fine, since that's how Microsoft hacked it. - ui.actionGoPrevious->setShortcut(QKeySequence(Qt::CTRL|Qt::Key_Left)); - ui.actionGoNext->setShortcut(QKeySequence(Qt::CTRL|Qt::Key_Right)); - - static const QLatin1String MacIconPath(":/trolltech/assistant/images/mac"); - ui.actionGoNext->setIcon(QIcon(MacIconPath + QLatin1String("/next.png"))); - ui.actionGoPrevious->setIcon(QIcon(MacIconPath + QLatin1String("/prev.png"))); - ui.actionGoHome->setIcon(QIcon(MacIconPath + QLatin1String("/home.png"))); - ui.actionEditCopy->setIcon(QIcon(MacIconPath + QLatin1String("/editcopy.png"))); - ui.actionEditCopy->setIcon(QIcon(MacIconPath + QLatin1String("/editcopy.png"))); - ui.actionEditFind->setIcon(QIcon(MacIconPath + QLatin1String("/find.png"))); - ui.actionFilePrint->setIcon(QIcon(MacIconPath + QLatin1String("/print.png"))); - ui.actionZoomOut->setIcon(QIcon(MacIconPath + QLatin1String("/zoomout.png"))); - ui.actionZoomIn->setIcon(QIcon(MacIconPath + QLatin1String("/zoomin.png"))); - ui.actionSyncToc->setIcon(QIcon(MacIconPath + QLatin1String("/synctoc.png"))); - ui.actionHelpWhatsThis->setIcon(QIcon(MacIconPath + QLatin1String("/whatsthis.png"))); -#elif defined(Q_WS_X11) - ui.actionGoNext->setIcon(QIcon::fromTheme("go-next" , ui.actionGoNext->icon())); - ui.actionGoPrevious->setIcon(QIcon::fromTheme("go-previous" , ui.actionGoPrevious->icon())); - ui.actionGoHome->setIcon(QIcon::fromTheme("user-home" , ui.actionGoHome->icon())); - ui.actionEditCopy->setIcon(QIcon::fromTheme("edit-copy" , ui.actionEditCopy->icon())); - ui.actionEditFind->setIcon(QIcon::fromTheme("edit-find" , ui.actionEditFind->icon())); - ui.actionFilePrint->setIcon(QIcon::fromTheme("document-print" , ui.actionFilePrint->icon())); - ui.actionZoomOut->setIcon(QIcon::fromTheme("zoom-out" , ui.actionZoomOut->icon())); - ui.actionZoomIn->setIcon(QIcon::fromTheme("zoom-in" , ui.actionZoomIn->icon())); - ui.actionSyncToc->setIcon(QIcon::fromTheme("view-refresh" , ui.actionSyncToc->icon())); -#endif -} - -MainWindow::~MainWindow() -{ - windows.removeAll(this); - delete goActionDocFiles; -} - -void MainWindow::setup() -{ - if(setupCompleted) - return; - - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); - statusBar()->showMessage(tr("Initializing Qt Assistant...")); - setupCompleted = true; - helpDock->initialize(); - connect(ui.actionGoPrevious, SIGNAL(triggered()), tabs, SLOT(backward())); - connect(ui.actionGoNext, SIGNAL(triggered()), tabs, SLOT(forward())); - connect(ui.actionEditCopy, SIGNAL(triggered()), tabs, SLOT(copy())); - connect(ui.actionFileExit, SIGNAL(triggered()), qApp, SLOT(closeAllWindows())); - connect(ui.actionAddBookmark, SIGNAL(triggered()), - helpDock, SLOT(addBookmark())); - connect(helpDock, SIGNAL(showLink(QString)), - this, SLOT(showLink(QString))); - connect(helpDock, SIGNAL(showSearchLink(QString,QStringList)), - this, SLOT(showSearchLink(QString,QStringList))); - - connect(ui.bookmarkMenu, SIGNAL(triggered(QAction*)), - this, SLOT(showBookmark(QAction*))); - connect(ui.actionZoomIn, SIGNAL(triggered()), tabs, SLOT(zoomIn())); - connect(ui.actionZoomOut, SIGNAL(triggered()), tabs, SLOT(zoomOut())); - - connect(ui.actionOpenPage, SIGNAL(triggered()), tabs, SLOT(newTab())); - connect(ui.actionClosePage, SIGNAL(triggered()), tabs, SLOT(closeTab())); - connect(ui.actionNextPage, SIGNAL(triggered()), tabs, SLOT(nextTab())); - connect(ui.actionPrevPage, SIGNAL(triggered()), tabs, SLOT(previousTab())); - - -#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) - QShortcut *acc = new QShortcut(tr("SHIFT+CTRL+="), this); - connect(acc, SIGNAL(activated()), ui.actionZoomIn, SIGNAL(triggered())); -#endif - - connect(new QShortcut(tr("Ctrl+T"), this), SIGNAL(activated()), helpDock, SLOT(toggleContents())); - connect(new QShortcut(tr("Ctrl+I"), this), SIGNAL(activated()), helpDock, SLOT(toggleIndex())); - connect(new QShortcut(tr("Ctrl+B"), this), SIGNAL(activated()), helpDock, SLOT(toggleBookmarks())); - connect(new QShortcut(tr("Ctrl+S"), this), SIGNAL(activated()), helpDock, SLOT(toggleSearch())); - connect(new QShortcut(tr("Ctrl+]"), this), SIGNAL(activated()), tabs, SLOT(nextTab())); - connect(new QShortcut(tr("Ctrl+["), this), SIGNAL(activated()), tabs, SLOT(previousTab())); - - Config *config = Config::configuration(); - - setupBookmarkMenu(); - - QAction *viewsAction = createPopupMenu()->menuAction(); - viewsAction->setText(tr("Views")); - ui.viewMenu->addAction(viewsAction); - - const int tabIndex = config->sideBarPage(); - helpDock->tabWidget()->setCurrentIndex(tabIndex); - // The tab index is 0 by default, so we need to force an upate - // to poulate the contents in this case. - if (tabIndex == 0) - helpDock->currentTabChanged(tabIndex); - - ui.actionEditFind->setShortcut(QKeySequence::Find); - ui.actionEditFindNext->setShortcut(QKeySequence::FindNext); - ui.actionEditFindPrev->setShortcut(QKeySequence::FindPrevious); - - QObject::connect(ui.actionEditFind, SIGNAL(triggered()), tabs, SLOT(find())); - QObject::connect(ui.actionEditFindNext, SIGNAL(triggered()), tabs, SLOT(findNext())); - QObject::connect(ui.actionEditFindPrev, SIGNAL(triggered()), tabs, SLOT(findPrevious())); - connect(ui.actionEditFont_Settings, SIGNAL(triggered()), this, SLOT(showFontSettingsDialog())); - - qApp->restoreOverrideCursor(); - ui.actionGoPrevious->setEnabled(false); - ui.actionGoNext->setEnabled(false); - ui.actionEditCopy->setEnabled(false); - - // set the current selected item in the treeview - helpDialog()->locateContents(tabs->currentBrowser()->source().toString()); - connect(tabs, SIGNAL(browserUrlChanged(QString)), helpDock, SLOT(locateContents(QString))); -} - -void MainWindow::browserTabChanged() -{ - HelpWindow *win = tabs->currentBrowser(); - if (win) { - QTextCursor cursor(win->textCursor()); - ui.actionEditCopy->setEnabled(cursor.hasSelection()); - ui.actionGoPrevious->setEnabled(win->isBackwardAvailable()); - ui.actionGoNext->setEnabled(win->isForwardAvailable()); - } -} - -void MainWindow::copyAvailable(bool yes) -{ - ui.actionEditCopy->setEnabled(yes); -} - -void MainWindow::updateTabActions(int index) -{ - bool enabled = (index > 1) ? true : false; - ui.actionPrevPage->setEnabled(enabled); - ui.actionNextPage->setEnabled(enabled); - ui.actionClosePage->setEnabled(enabled); -} - -void MainWindow::setupGoActions() -{ - Config *config = Config::configuration(); - QStringList titles = config->docTitles(); - QAction *action = 0; - - static bool separatorInserted = false; - - foreach (QAction *a, goActions) { - ui.goMenu->removeAction(a); - ui.goActionToolbar->removeAction(a); - } - qDeleteAll(goActions); - goActions.clear(); - goActionDocFiles->clear(); - - int addCount = 0; - - foreach (QString title, titles) { - QPixmap pix = config->docIcon(title); - if(!pix.isNull()) { - if(!separatorInserted) { - ui.goMenu->addSeparator(); - separatorInserted = true; - } - action = new QAction(this); - action->setText(title); - action->setWhatsThis(tr("Displays the main page of a specific documentation set.")); - action->setIcon(QIcon(pix)); - ui.goMenu->addAction(action); - ui.goActionToolbar->addAction(action); - goActions.append(action); - goActionDocFiles->insert(action, config->indexPage(title)); - connect(action, SIGNAL(triggered()), - this, SLOT(showGoActionLink())); - ++addCount; - } - } - if(!addCount) - ui.goActionToolbar->hide(); - else - ui.goActionToolbar->show(); - -} - -bool MainWindow::insertActionSeparator() -{ - ui.goMenu->addSeparator(); - ui.Toolbar->addSeparator(); - return true; -} - -void MainWindow::closeEvent(QCloseEvent *e) -{ - saveSettings(); - e->accept(); -} - -void MainWindow::about() -{ - QMessageBox box(this); - - box.setText(QString::fromLatin1("<center><img src=\":/trolltech/assistant/images/assistant-128.png\">" - "<h3>%1</h3>" - "<p>Version %2</p></center>" - "<p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p>") - .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR))); - box.setWindowTitle(tr("Qt Assistant")); - box.setIcon(QMessageBox::NoIcon); - box.exec(); -} - -void MainWindow::on_actionAboutApplication_triggered() -{ - QString url = Config::configuration()->aboutURL(); - if (url == QLatin1String("about_qt")) { - QMessageBox::aboutQt(this, QLatin1String("Qt Assistant")); - return; - } - QString text; - if (url.startsWith(QLatin1String("file:"))) - url = url.mid(5); - QFile file(url); - if(file.exists() && file.open(QFile::ReadOnly)) - text = QString::fromUtf8(file.readAll()); - if(text.isNull()) - text = tr("Failed to open about application contents in file: '%1'").arg(url); - - QFileInfo fi(file); - QString path = QDir::cleanPath(fi.absolutePath()); - if (!QDir::searchPaths(QLatin1String("aboutImages")).contains(path)) - QDir::addSearchPath(QLatin1String("aboutImages"), path); - - QMessageBox box(this); - box.setText(text); - box.setWindowTitle(Config::configuration()->aboutApplicationMenuText()); - box.setIcon(QMessageBox::NoIcon); - box.exec(); -} - -void MainWindow::on_actionAboutAssistant_triggered() -{ - about(); -} - -void MainWindow::on_actionGoHome_triggered() -{ - QString home = MainWindow::urlifyFileName(Config::configuration()->homePage()); - showLink(home); -} - -QString MainWindow::urlifyFileName(const QString &fileName) -{ - QString name = fileName; - QUrl url(name); - -#if defined(Q_OS_WIN32) - if (!url.isValid() || url.scheme().isEmpty() || url.scheme().toLower() != QLatin1String("file:")) { - int i = name.indexOf(QLatin1Char('#')); - QString anchor = name.mid(i); - name = name.toLower(); - if (i > -1) - name.replace(i, anchor.length(), anchor); - name.replace(QLatin1Char('\\'), QLatin1Char('/')); - foreach (QFileInfo drive, QDir::drives()) { - if (name.startsWith(drive.absolutePath().toLower())) { - name = QLatin1String("file:") + name; - break; - } - } - } -#else - if (!url.isValid() || url.scheme().isEmpty()) - name.prepend(QLatin1String("file:")); -#endif - return name; -} - -#ifndef QT_NO_PRINTER -class PrintThread : public QThread -{ - QPrinter _printer; - QTextDocument *_document; - -public: - PrintThread(QObject *parent) - : QThread(parent), _printer(QPrinter::HighResolution), _document(0) - { - } - ~PrintThread() - { - wait(); - } - - QPrinter *printer() - { - return &_printer; - } - - void start(QTextDocument *document) - { - _document = document->clone(); - _document->moveToThread(this); - QThread::start(); - } - -protected: - void run() - { - _document->print(printer()); - delete _document; - _document = 0; - } -}; -#endif //QT_NO_PRINTER - -void MainWindow::on_actionFilePrint_triggered() -{ -#ifndef QT_NO_PRINTER - if (!QFontDatabase::supportsThreadedFontRendering()) { - QPrinter printer(QPrinter::HighResolution); - - QPrintDialog dlg(&printer, this); - if (dlg.exec() == QDialog::Accepted) { - qApp->setOverrideCursor(Qt::WaitCursor); - tabs->currentBrowser()->document()->print(&printer); - qApp->restoreOverrideCursor(); - } - return; - } - - PrintThread *thread = new PrintThread(this); - - QPrintDialog dlg(thread->printer(), this); - if (dlg.exec() == QDialog::Accepted) { - connect(thread, SIGNAL(finished()), SLOT(printingFinished())); - connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); - - qApp->setOverrideCursor(Qt::BusyCursor); - thread->start(tabs->currentBrowser()->document()); - } else { - delete thread; - } -#else - Q_ASSERT("No printing support"); -#endif -} - -void MainWindow::printingFinished() -{ - qApp->restoreOverrideCursor(); -} - -void MainWindow::updateBookmarkMenu() -{ - for(QList<MainWindow*>::Iterator it = windows.begin(); it != windows.end(); ++it) - (*it)->setupBookmarkMenu(); -} - -void MainWindow::setupBookmarkMenu() -{ - ui.bookmarkMenu->clear(); - bookmarks.clear(); - ui.bookmarkMenu->addAction(ui.actionAddBookmark); - - QFile f(QDir::homePath() + QLatin1String("/.assistant/bookmarks.") + - Config::configuration()->profileName()); - if (!f.open(QFile::ReadOnly)) - return; - QTextStream ts(&f); - ui.bookmarkMenu->addSeparator(); - while (!ts.atEnd()) { - QString title = ts.readLine(); - QString link = ts.readLine(); - bookmarks.insert(ui.bookmarkMenu->addAction(title), link); - } -} - -void MainWindow::showBookmark(QAction *action) -{ - if (bookmarks.contains(action)) - showLink(bookmarks.value(action)); -} - -void MainWindow::showLinkFromClient(const QString &link) -{ - setWindowState(windowState() & ~Qt::WindowMinimized); - raise(); - activateWindow(); - QString l = MainWindow::urlifyFileName(link); - showLink(l); - if (isMinimized()) - showNormal(); -} - -void MainWindow::showLink(const QString &link) -{ - if(link.isEmpty()) - qWarning("The link is empty!"); - - // don't fill the history with the same url more then once - if (link == tabs->currentBrowser()->source().toString()) - return; - - QUrl url(link); - QFileInfo fi(url.toLocalFile()); - tabs->setSource(url.toString()); - tabs->currentBrowser()->setFocus(); -} - -void MainWindow::showLinks(const QStringList &links) -{ - if (links.size() == 0) { - qWarning("MainWindow::showLinks() - Empty link"); - return; - } - - if (links.size() == 1) { - showLink(MainWindow::urlifyFileName(links.first())); - return; - } - - QStringList::ConstIterator it = links.begin(); - // Initial showing, The tab is empty so update that without creating it first - if (!tabs->currentBrowser()->source().isValid()) { - QPair<HelpWindow*, QString> browser; - browser.first = tabs->currentBrowser(); - browser.second = links.first(); - pendingBrowsers.append(browser); - tabs->setTitle(tabs->currentBrowser(), tr("...")); - } - ++it; - - while(it != links.end()) { - QPair<HelpWindow*, QString> browser; - browser.first = tabs->newBackgroundTab(); - browser.second = *it; - pendingBrowsers.append(browser); - ++it; - } - - startTimer(50); - return; -} - -void MainWindow::removePendingBrowser(HelpWindow *win) -{ - if (!pendingBrowsers.count()) - return; - - QMutableListIterator<QPair<HelpWindow*, QString> > it(pendingBrowsers); - while (it.hasNext()) { - QPair<HelpWindow*, QString> browser = it.next(); - if (browser.first == win) { - it.remove(); - break; - } - } -} - -void MainWindow::timerEvent(QTimerEvent *e) -{ - QPair<HelpWindow*, QString> browser = pendingBrowsers.first(); - pendingBrowsers.pop_front(); - - if (pendingBrowsers.size() == 0) - killTimer(e->timerId()); - - browser.first->setSource(MainWindow::urlifyFileName(browser.second)); -} - -void MainWindow::showQtHelp() -{ - showLink(QLibraryInfo::location(QLibraryInfo::DocumentationPath) + - QLatin1String("/html/index.html")); -} - -MainWindow* MainWindow::newWindow() -{ - saveSettings(); - MainWindow *mw = new MainWindow; - mw->move(geometry().topLeft()); - if (isMaximized()) - mw->showMaximized(); - else - mw->show(); - mw->on_actionGoHome_triggered(); - return mw; -} - -void MainWindow::saveSettings() -{ - Config *config = Config::configuration(); - - config->setSideBarPage(helpDock->tabWidget()->currentIndex()); - config->setWindowGeometry(saveGeometry()); - config->setMainWindowState(saveState()); - - // Create list of the tab urls - QStringList lst; - QList<HelpWindow*> browsers = tabs->browsers(); - foreach (HelpWindow *browser, browsers) - lst << browser->source().toString(); - config->setSource(lst); - config->save(); -} - -TabbedBrowser* MainWindow::browsers() const -{ - return tabs; -} - -void MainWindow::showSearchLink(const QString &link, const QStringList &terms) -{ - HelpWindow * hw = tabs->currentBrowser(); - hw->blockScrolling(true); - hw->setCursor(Qt::WaitCursor); - if (hw->source() == link) - hw->reload(); - else - showLink(link); - hw->setCursor(Qt::ArrowCursor); - - hw->viewport()->setUpdatesEnabled(false); - - QTextCharFormat marker; - marker.setForeground(Qt::red); - - QTextCursor firstHit; - - QTextCursor c = hw->textCursor(); - c.beginEditBlock(); - foreach (QString term, terms) { - c.movePosition(QTextCursor::Start); - hw->setTextCursor(c); - - bool found = hw->find(term, QTextDocument::FindWholeWords); - while (found) { - QTextCursor hit = hw->textCursor(); - if (firstHit.isNull() || hit.position() < firstHit.position()) - firstHit = hit; - - hit.mergeCharFormat(marker); - found = hw->find(term, QTextDocument::FindWholeWords); - } - } - - if (firstHit.isNull()) { - firstHit = hw->textCursor(); - firstHit.movePosition(QTextCursor::Start); - } - firstHit.clearSelection(); - c.endEditBlock(); - hw->setTextCursor(firstHit); - - hw->blockScrolling(false); - hw->viewport()->setUpdatesEnabled(true); -} - - -void MainWindow::showGoActionLink() -{ - const QObject *origin = sender(); - if(!origin || - QString::fromLatin1(origin->metaObject()->className()) != QString::fromLatin1("QAction")) - return; - - QAction *action = (QAction*) origin; - QString docfile = *(goActionDocFiles->find(action)); - showLink(MainWindow::urlifyFileName(docfile)); -} - -void MainWindow::on_actionHelpAssistant_triggered() -{ - showLink(Config::configuration()->assistantDocPath() + QLatin1String("/assistant-manual.html")); -} - -HelpDialog* MainWindow::helpDialog() const -{ - return helpDock; -} - -void MainWindow::backwardAvailable(bool enable) -{ - ui.actionGoPrevious->setEnabled(enable); -} - -void MainWindow::forwardAvailable(bool enable) -{ - ui.actionGoNext->setEnabled(enable); -} - -void MainWindow::updateProfileSettings() -{ - Config *config = Config::configuration(); -#ifndef Q_WS_MAC - setWindowIcon(config->applicationIcon()); -#endif - ui.helpMenu->clear(); - //ui.helpMenu->addAction(ui.actionHelpAssistant); - //ui.helpMenu->addSeparator(); - ui.helpMenu->addAction(ui.actionAboutAssistant); - if (!config->aboutApplicationMenuText().isEmpty()) - ui.helpMenu->addAction(ui.actionAboutApplication); - ui.helpMenu->addSeparator(); - ui.helpMenu->addAction(ui.actionHelpWhatsThis); - - ui.actionAboutApplication->setText(config->aboutApplicationMenuText()); - - if(!config->title().isNull()) - setWindowTitle(config->title()); -} - -void MainWindow::setupPopupMenu(QMenu *m) -{ - m->addAction(ui.actionNewWindow); - m->addAction(ui.actionOpenPage); - m->addAction(ui.actionClosePage); - m->addSeparator(); - m->addAction(ui.actionSaveAs); - m->addSeparator(); - m->addAction(ui.actionGoPrevious); - m->addAction(ui.actionGoNext); - m->addAction(ui.actionGoHome); - m->addSeparator(); - m->addAction(ui.actionZoomIn); - m->addAction(ui.actionZoomOut); - m->addSeparator(); - m->addAction(ui.actionEditCopy); - m->addAction(ui.actionEditFind); -} - -void MainWindow::on_actionSyncToc_triggered() -{ - HelpWindow *w = tabs->currentBrowser(); - if(w) { - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); - QString link = w->source().toString(); - helpDock->locateContents(link); - helpDock->tabWidget()->setCurrentIndex(0); - qApp->restoreOverrideCursor(); - } -} - -void MainWindow::on_actionNewWindow_triggered() -{ - newWindow()->show(); -} - -void MainWindow::on_actionClose_triggered() -{ - close(); -} - -void MainWindow::on_actionHelpWhatsThis_triggered() -{ - QWhatsThis::enterWhatsThisMode(); -} - -void MainWindow::on_actionSaveAs_triggered() -{ - QString fileName; - QUrl url = tabs->currentBrowser()->source(); - if (url.isValid()) { - QFileInfo fi(url.toLocalFile()); - fileName = fi.fileName(); - } - fileName = QFileDialog::getSaveFileName(this, tr("Save Page"), fileName); - if (fileName.isEmpty()) - return; - - QFile file(fileName); - if (!file.open(QIODevice::WriteOnly)) { - QMessageBox::critical(this, tr("Save Page"), tr("Cannot open file for writing!")); - return; - } - - QFileInfo fi(fileName); - QString fn = fi.fileName(); - int i = fn.lastIndexOf(QLatin1Char('.')); - if (i > -1) - fn = fn.left(i); - QString relativeDestPath = fn + QLatin1String("_images"); - QDir destDir(fi.absolutePath() + QDir::separator() + relativeDestPath); - bool imgDirAvailable = destDir.exists(); - if (!imgDirAvailable) - imgDirAvailable = destDir.mkdir(destDir.absolutePath()); - - // save images - QTextDocument *doc = tabs->currentBrowser()->document()->clone(); - if (url.isValid() && imgDirAvailable) { - QTextBlock::iterator it; - for (QTextBlock block = doc->begin(); block != doc->end(); block = block.next()) { - for (it = block.begin(); !(it.atEnd()); ++it) { - QTextFragment fragment = it.fragment(); - if (fragment.isValid()) { - QTextImageFormat fm = fragment.charFormat().toImageFormat(); - if (fm.isValid() && !fm.name().isEmpty()) { - QUrl imagePath = tabs->currentBrowser()->source().resolved(fm.name()); - if (!imagePath.isValid()) - continue; - QString from = imagePath.toLocalFile(); - QString destName = fm.name(); - int j = destName.lastIndexOf(QLatin1Char('/')); - if (j > -1) - destName = destName.mid(j+1); - QFileInfo info(from); - if (info.exists()) { - if (!QFile::copy(from, destDir.absolutePath() - + QDir::separator() + destName)) - continue; - fm.setName(QLatin1String("./") + relativeDestPath + QLatin1String("/") + destName); - QTextCursor cursor(doc); - cursor.setPosition(fragment.position()); - cursor.setPosition(fragment.position() + fragment.length(), - QTextCursor::KeepAnchor); - cursor.setCharFormat(fm); - } - } - } - } - } - } - QString src = doc->toHtml(QByteArray("utf-8")); - QTextStream s(&file); - s.setCodec("utf-8"); - s << src; - s.flush(); - file.close(); -} - -void MainWindow::showFontSettingsDialog() -{ - Config *config = Config::configuration(); - FontSettings settings = config->fontSettings(); - - { // It is important that the dialog be deleted before UI mode changes. - FontSettingsDialog dialog; - if (!dialog.showDialog(&settings)) - return; - } - - config->setFontPointSize(settings.browserFont.pointSizeF()); - config->setFontSettings(settings); - - updateApplicationFontSettings(settings); -} - -void MainWindow::updateApplicationFontSettings(FontSettings &settings) -{ - QFont font = settings.windowFont; - if (this->font() != font) - qApp->setFont(font, "QWidget"); - - font = settings.browserFont; - QList<HelpWindow*> browsers = tabs->browsers(); - foreach (HelpWindow *browser, browsers) { - if (browser->font() != font) - browser->setFont(font); - } -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/mainwindow.h b/tools/assistant/compat/mainwindow.h deleted file mode 100644 index a08064d..0000000 --- a/tools/assistant/compat/mainwindow.h +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include "ui_mainwindow.h" -#include "config.h" - -#include <QPointer> -#include <QMap> - -QT_BEGIN_NAMESPACE - -class TabbedBrowser; -class HelpDialog; -class HelpWindow; -class QMenu; -class QDockWidget; - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - MainWindow(); - virtual ~MainWindow(); - - TabbedBrowser *browsers() const; - HelpDialog *helpDialog() const; - - void setupPopupMenu(QMenu *menu); - static QString urlifyFileName(const QString &fileName); - - void removePendingBrowser(HelpWindow *win); - -public slots: - MainWindow *newWindow(); - - void setup(); - void showLink(const QString &link); - void showLinks(const QStringList &links); - void saveSettings(); - void updateBookmarkMenu(); - void printingFinished(); - -private slots: - void on_actionNewWindow_triggered(); - void on_actionGoHome_triggered(); - void on_actionFilePrint_triggered(); - void on_actionClose_triggered(); - void on_actionHelpWhatsThis_triggered(); - void on_actionHelpAssistant_triggered(); - void on_actionAboutApplication_triggered(); - void on_actionAboutAssistant_triggered(); - void on_actionSaveAs_triggered(); - void on_actionSyncToc_triggered(); - - void about(); - void setupBookmarkMenu(); - void showBookmark(QAction *action); - void showLinkFromClient(const QString &link); - void showQtHelp(); - void showSearchLink(const QString &link, const QStringList &terms); - void showGoActionLink(); - void updateProfileSettings(); - void backwardAvailable(bool); - void forwardAvailable(bool); - - void browserTabChanged(); - void copyAvailable(bool yes); - void updateTabActions(int index); - void showFontSettingsDialog(); - -protected: - void closeEvent(QCloseEvent *); - void timerEvent(QTimerEvent *); - -private: - void setupGoActions(); - bool insertActionSeparator(); - void updateApplicationFontSettings(FontSettings &settings); - -private: - Ui::MainWindow ui; - - QList<QAction*> goActions; - uint setupCompleted:1; - TabbedBrowser *tabs; - QMap<QAction*, QString> bookmarks; - HelpDialog *helpDock; - QDockWidget *dw; - static QList<MainWindow*> windows; - QMap<QAction*,QString> *goActionDocFiles; - QList<QPair<HelpWindow*,QString> > pendingBrowsers; -}; - -#endif // MAINWINDOW_H - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/mainwindow.ui b/tools/assistant/compat/mainwindow.ui deleted file mode 100644 index 535e27e..0000000 --- a/tools/assistant/compat/mainwindow.ui +++ /dev/null @@ -1,457 +0,0 @@ -<ui version="4.0" > - <comment>********************************************************************* -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -*********************************************************************</comment> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>949</width> - <height>670</height> - </rect> - </property> - <property name="windowTitle" > - <string>Qt Assistant by Nokia</string> - </property> - <widget class="QWidget" name="__qt_central_widget" /> - <widget class="QToolBar" name="Toolbar" > - <property name="windowTitle" > - <string>Toolbar</string> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <attribute name="toolBarArea" > - <enum>TopToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak" > - <bool>false</bool> - </attribute> - <addaction name="actionGoPrevious" /> - <addaction name="actionGoNext" /> - <addaction name="actionGoHome" /> - <addaction name="actionSyncToc" /> - <addaction name="separator" /> - <addaction name="actionEditCopy" /> - <addaction name="actionEditFind" /> - <addaction name="actionFilePrint" /> - <addaction name="separator" /> - <addaction name="actionZoomIn" /> - <addaction name="actionZoomOut" /> - <addaction name="separator" /> - <addaction name="actionHelpWhatsThis" /> - </widget> - <widget class="QToolBar" name="goActionToolbar" > - <property name="windowTitle" > - <string>Go</string> - </property> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <attribute name="toolBarArea" > - <enum>TopToolBarArea</enum> - </attribute> - <attribute name="toolBarBreak" > - <bool>false</bool> - </attribute> - </widget> - <widget class="QMenuBar" name="menubar" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>949</width> - <height>29</height> - </rect> - </property> - <widget class="QMenu" name="helpMenu" > - <property name="title" > - <string>&Help</string> - </property> - <addaction name="actionHelpAssistant" /> - <addaction name="separator" /> - <addaction name="actionAboutAssistant" /> - <addaction name="actionAboutApplication" /> - <addaction name="separator" /> - <addaction name="actionHelpWhatsThis" /> - </widget> - <widget class="QMenu" name="fileMenu" > - <property name="title" > - <string>&File</string> - </property> - <addaction name="actionNewWindow" /> - <addaction name="actionOpenPage" /> - <addaction name="actionClosePage" /> - <addaction name="separator" /> - <addaction name="actionSaveAs" /> - <addaction name="separator" /> - <addaction name="actionFilePrint" /> - <addaction name="separator" /> - <addaction name="actionClose" /> - <addaction name="actionFileExit" /> - </widget> - <widget class="QMenu" name="bookmarkMenu" > - <property name="title" > - <string>Boo&kmarks</string> - </property> - </widget> - <widget class="QMenu" name="goMenu" > - <property name="title" > - <string>&Go</string> - </property> - <addaction name="actionGoPrevious" /> - <addaction name="actionGoNext" /> - <addaction name="actionGoHome" /> - <addaction name="actionSyncToc" /> - <addaction name="separator" /> - <addaction name="actionNextPage" /> - <addaction name="actionPrevPage" /> - </widget> - <widget class="QMenu" name="viewMenu" > - <property name="title" > - <string>&View</string> - </property> - <addaction name="actionZoomIn" /> - <addaction name="actionZoomOut" /> - </widget> - <widget class="QMenu" name="editMenu" > - <property name="title" > - <string>&Edit</string> - </property> - <addaction name="actionEditCopy" /> - <addaction name="actionEditFind" /> - <addaction name="actionEditFindNext" /> - <addaction name="actionEditFindPrev" /> - <addaction name="separator" /> - <addaction name="actionEditFont_Settings" /> - </widget> - <addaction name="fileMenu" /> - <addaction name="editMenu" /> - <addaction name="viewMenu" /> - <addaction name="goMenu" /> - <addaction name="bookmarkMenu" /> - <addaction name="helpMenu" /> - </widget> - <action name="actionFilePrint" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/print.png</iconset> - </property> - <property name="text" > - <string>&Print...</string> - </property> - <property name="whatsThis" > - <string>Print the currently displayed page.</string> - </property> - <property name="shortcut" > - <string>Ctrl+P</string> - </property> - </action> - <action name="actionFileExit" > - <property name="text" > - <string>E&xit</string> - </property> - <property name="whatsThis" > - <string>Quit Qt Assistant.</string> - </property> - <property name="shortcut" > - <string>Ctrl+Q</string> - </property> - <property name="menuRole" > - <enum>QAction::QuitRole</enum> - </property> - </action> - <action name="actionEditCopy" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/editcopy.png</iconset> - </property> - <property name="text" > - <string>&Copy</string> - </property> - <property name="whatsThis" > - <string>Copy the selected text to the clipboard.</string> - </property> - <property name="shortcut" > - <string>Ctrl+C</string> - </property> - </action> - <action name="actionEditFind" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/find.png</iconset> - </property> - <property name="text" > - <string>&Find in Text...</string> - </property> - <property name="whatsThis" > - <string>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</string> - </property> - <property name="shortcut" > - <string>Ctrl+F</string> - </property> - </action> - <action name="actionEditFindNext" > - <property name="text" > - <string>Find &Next</string> - </property> - <property name="shortcut" > - <string>F3</string> - </property> - </action> - <action name="actionEditFindPrev" > - <property name="text" > - <string>Find &Previous</string> - </property> - <property name="shortcut" > - <string>Shift+F3</string> - </property> - </action> - <action name="actionGoHome" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/home.png</iconset> - </property> - <property name="text" > - <string>&Home</string> - </property> - <property name="whatsThis" > - <string>Go to the home page. Qt Assistant's home page is the Qt Reference Documentation.</string> - </property> - <property name="shortcut" > - <string>Ctrl+Home</string> - </property> - </action> - <action name="actionGoPrevious" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/previous.png</iconset> - </property> - <property name="text" > - <string>&Previous</string> - </property> - <property name="whatsThis" > - <string>Go to the previous page.</string> - </property> - <property name="shortcut" > - <string>Alt+Left</string> - </property> - </action> - <action name="actionGoNext" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/next.png</iconset> - </property> - <property name="text" > - <string>&Next</string> - </property> - <property name="whatsThis" > - <string>Go to the next page.</string> - </property> - <property name="shortcut" > - <string>Alt+Right</string> - </property> - </action> - <action name="actionAboutAssistant" > - <property name="text" > - <string>About Qt Assistant</string> - </property> - <property name="whatsThis" > - <string>Display further information about Qt Assistant.</string> - </property> - <property name="menuRole" > - <enum>QAction::AboutRole</enum> - </property> - </action> - <action name="actionAboutApplication" > - <property name="text" > - <string>About Qt</string> - </property> - <property name="menuRole" > - <enum>QAction::AboutQtRole</enum> - </property> - </action> - <action name="actionZoomIn" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/zoomin.png</iconset> - </property> - <property name="text" > - <string>Zoom &in</string> - </property> - <property name="whatsThis" > - <string>Zoom in on the document, i.e. increase the font size.</string> - </property> - <property name="shortcut" > - <string>Ctrl++</string> - </property> - </action> - <action name="actionZoomOut" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/zoomout.png</iconset> - </property> - <property name="text" > - <string>Zoom &out</string> - </property> - <property name="whatsThis" > - <string>Zoom out on the document, i.e. decrease the font size.</string> - </property> - <property name="shortcut" > - <string>Ctrl+-</string> - </property> - </action> - <action name="actionNewWindow" > - <property name="text" > - <string>New Window</string> - </property> - <property name="whatsThis" > - <string>Open a new window.</string> - </property> - <property name="shortcut" > - <string>Ctrl+N</string> - </property> - </action> - <action name="actionClose" > - <property name="text" > - <string>&Close</string> - </property> - <property name="whatsThis" > - <string>Close the current window.</string> - </property> - <property name="shortcut" > - <string>Ctrl+W</string> - </property> - </action> - <action name="actionAddBookmark" > - <property name="text" > - <string>&Add Bookmark</string> - </property> - <property name="whatsThis" > - <string>Add the currently displayed page as a new bookmark.</string> - </property> - </action> - <action name="actionHelpWhatsThis" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/whatsthis.png</iconset> - </property> - <property name="text" > - <string>What's This?</string> - </property> - <property name="statusTip" > - <string>"What's This?" context sensitive help.</string> - </property> - <property name="whatsThis" > - <string>"What's This?" context sensitive help.</string> - </property> - <property name="shortcut" > - <string>Shift+F1</string> - </property> - </action> - <action name="actionOpenPage" > - <property name="text" > - <string>Add Tab</string> - </property> - <property name="shortcut" > - <string>Ctrl+Alt+N</string> - </property> - </action> - <action name="actionNextPage" > - <property name="text" > - <string>Next Tab</string> - </property> - <property name="shortcut" > - <string>Ctrl+Alt+Right</string> - </property> - </action> - <action name="actionPrevPage" > - <property name="text" > - <string>Previous Tab</string> - </property> - <property name="shortcut" > - <string>Ctrl+Alt+Left</string> - </property> - </action> - <action name="actionClosePage" > - <property name="text" > - <string>Close Tab</string> - </property> - <property name="shortcut" > - <string>Ctrl+Alt+Q</string> - </property> - </action> - <action name="actionHelpAssistant" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/assistant.png</iconset> - </property> - <property name="text" > - <string>Qt Assistant Manual</string> - </property> - <property name="shortcut" > - <string>F1</string> - </property> - </action> - <action name="actionSaveAs" > - <property name="text" > - <string>Save Page As...</string> - </property> - <property name="shortcut" > - <string>Ctrl+Alt+S</string> - </property> - </action> - <action name="actionSyncToc" > - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/synctoc.png</iconset> - </property> - <property name="text" > - <string>Sync with Table of Contents</string> - </property> - <property name="whatsThis" > - <string>Select the page in contents tab.</string> - </property> - </action> - <action name="actionEditFont_Settings" > - <property name="text" > - <string>Font Settings...</string> - </property> - <property name="menuRole" > - <enum>QAction::PreferencesRole</enum> - </property> - </action> - </widget> - <resources> - <include location="assistant.qrc" /> - </resources> - <connections/> -</ui> diff --git a/tools/assistant/compat/profile.cpp b/tools/assistant/compat/profile.cpp deleted file mode 100644 index 2878a20..0000000 --- a/tools/assistant/compat/profile.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "profile.h" -#include <QTextCodec> -#include <QFileInfo> -#include <QRegExp> -#include <QDir> -#include <QList> -#include <QLibraryInfo> - -QT_BEGIN_NAMESPACE - -#define QT_TITLE QLatin1String("Qt Reference Documentation") -#define DESIGNER_TITLE QLatin1String("Qt Designer Manual") -#define ASSISTANT_TITLE QLatin1String("Qt Assistant Manual") -#define LINGUIST_TITLE QLatin1String("Qt Linguist Manual") -#define QMAKE_TITLE QLatin1String("qmake Manual") - -Profile *Profile::createDefaultProfile(const QString &docPath) -{ - QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath); - if (!docPath.isEmpty()) - path = docPath; - path = QDir::cleanPath(path) + QLatin1String("/html/"); - - Profile *profile = new Profile; - profile->valid = true; - profile->type = DefaultProfile; - profile->props[QLatin1String("name")] = QLatin1String("default"); - profile->props[QLatin1String("applicationicon")] = QLatin1String("assistant.png"); - profile->props[QLatin1String("aboutmenutext")] = QLatin1String("About Qt"); - profile->props[QLatin1String("abouturl")] = QLatin1String("about_qt"); - profile->props[QLatin1String("basepath")] = path; - profile->props[QLatin1String("startpage")] = path + QLatin1String("index.html"); - - profile->addDCFTitle( path + QLatin1String("qt.dcf"), QT_TITLE ); - profile->addDCFTitle( path + QLatin1String("designer.dcf"), DESIGNER_TITLE ); - profile->addDCFTitle( path + QLatin1String("assistant.dcf"), ASSISTANT_TITLE ); - profile->addDCFTitle( path + QLatin1String("linguist.dcf"), LINGUIST_TITLE ); - profile->addDCFTitle( path + QLatin1String("qmake.dcf"), QMAKE_TITLE ); - - profile->addDCFIcon( QT_TITLE, QLatin1String("qt.png") ); - profile->addDCFIcon( DESIGNER_TITLE, QLatin1String("designer.png") ); - profile->addDCFIcon( ASSISTANT_TITLE, QLatin1String("assistant.png") ); - profile->addDCFIcon( LINGUIST_TITLE, QLatin1String("linguist.png") ); - - profile->addDCFIndexPage( QT_TITLE, path + QLatin1String("index.html") ); - profile->addDCFIndexPage( DESIGNER_TITLE, path + QLatin1String("designer-manual.html") ); - profile->addDCFIndexPage( ASSISTANT_TITLE, path + QLatin1String("assistant-manual.html") ); - profile->addDCFIndexPage( LINGUIST_TITLE, path + QLatin1String("linguist-manual.html") ); - profile->addDCFIndexPage( QMAKE_TITLE, path + QLatin1String("qmake-manual.html") ); - - profile->addDCFImageDir( QT_TITLE, QLatin1String("../../gif/") ); - profile->addDCFImageDir( DESIGNER_TITLE, QLatin1String("../../gif/") ); - profile->addDCFImageDir( ASSISTANT_TITLE, QLatin1String("../../gif/") ); - profile->addDCFImageDir( LINGUIST_TITLE, QLatin1String("../../gif/") ); - profile->addDCFImageDir( QMAKE_TITLE, QLatin1String("../../gif/") ); - - return profile; -} - -Profile::Profile() - : valid( true ), dparser( 0 ) -{ - type = DefaultProfile; -} - -bool Profile::isValid() const -{ - return valid; -} - -void Profile::addDCFTitle(const QString &dcf, const QString &title) -{ - QString absdcf = QFileInfo(dcf).absoluteFilePath(); - dcfTitles[title] = absdcf; - if (!docs.contains(absdcf)) - docs << absdcf; -} - -void Profile::addDCF(const QString &docfile) -{ - if( !docs.contains( docfile ) == 0 ) - docs << docfile; -} - -void Profile::addDCFIcon(const QString docfile, const QString &icon) -{ - icons[docfile] = icon; -} - -void Profile::addDCFIndexPage(const QString title, const QString &indexPage) -{ - indexPages[title] = indexPage; -} - -void Profile::addDCFImageDir(const QString docfile, const QString &imgDir) -{ - imageDirs[docfile] = imgDir; -} - -void Profile::addProperty(const QString &name, const QString &value) -{ - props[name] = value; -} - -bool Profile::hasDocFile(const QString &name) -{ - return docs.contains( name ); -} - -void Profile::removeDocFileEntry(const QString &docfile) -{ - docs.removeAll(docfile); - QStringList titles; - - for( QMap<QString,QString>::Iterator it = dcfTitles.begin(); - it != dcfTitles.end(); ++it ) { - if( (*it) == docfile ) { - indexPages.remove( *it ); - icons.remove( *it ); - imageDirs.remove( *it ); - titles << it.key(); - } - } - - for( QStringList::ConstIterator title = titles.constBegin(); - title != titles.constEnd(); ++title ) - dcfTitles.remove( *title ); - -#ifdef ASSISTANT_DEBUG - qDebug() << "docs:\n - " << docs.join("\n - "); - qDebug() << "titles:\n - " << titles.join("\n - "); - qDebug() << "keys:\n - " << ((QStringList*)&(dcfTitles.keys()))->join("\n - "); - qDebug() << "values:\n - " << ((QStringList*)&(dcfTitles.values()))->join("\n - "); -#endif -} - -QString Profile::storableFilePath(const QString &fileName) -{ - QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath).replace(QLatin1String("\\"), QLatin1String("/")); - QString fName = fileName; - if (fName.startsWith(path)) - fName.replace(0, path.length(), QLatin1String("$DOCPATH$")); - return fName; -} - -QString Profile::loadableFilePath(const QString &fileName) -{ - QString path = QLibraryInfo::location(QLibraryInfo::DocumentationPath).replace(QLatin1String("\\"), QLatin1String("/")); - QString fName = fileName; - if (fName.startsWith(QLatin1String("$DOCPATH$"))) - fName.replace(0, 9, path); - return fName; -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/profile.h b/tools/assistant/compat/profile.h deleted file mode 100644 index 1aa9719..0000000 --- a/tools/assistant/compat/profile.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef PROFILE_H -#define PROFILE_H - -#include <QFileInfo> -#include <QString> -#include <QStringList> -#include <QMap> - -QT_BEGIN_NAMESPACE - -class DocuParser; - -class Profile -{ -public: - enum ProfileType { DefaultProfile, UserProfile }; - Profile(); - - bool isValid() const; - - void addDCF( const QString &docfile ); - void addDCFIcon( const QString title, const QString &icon ); - void addDCFIndexPage( const QString title, const QString &indexPage ); - void addDCFImageDir( const QString title, const QString &imgDir ); - void addDCFTitle( const QString &dcf, const QString &title ); - void addProperty( const QString &name, const QString &value ); - bool hasDocFile( const QString &docFile ); - void removeDocFileEntry( const QString &title ); - - ProfileType profileType() const { return type; } - void setProfileType( ProfileType t ) { type = t; } - - DocuParser *docuParser() const { return dparser; } - void setDocuParser( DocuParser *dp ) { dparser = dp; } - - static Profile* createDefaultProfile(const QString &docPath = QString()); - static QString makeRelativePath(const QString &base, const QString &path); - static QString storableFilePath(const QString &fileName); - static QString loadableFilePath(const QString &fileName); - - uint valid:1; - ProfileType type; - DocuParser *dparser; - QMap<QString,QString> props; - QMap<QString,QString> icons; - QMap<QString,QString> indexPages; - QMap<QString,QString> imageDirs; - QMap<QString,QString> dcfTitles; - QStringList docs; -}; - -QT_END_NAMESPACE - -#endif // PROFILE_H diff --git a/tools/assistant/compat/tabbedbrowser.cpp b/tools/assistant/compat/tabbedbrowser.cpp deleted file mode 100644 index c3c1572..0000000 --- a/tools/assistant/compat/tabbedbrowser.cpp +++ /dev/null @@ -1,530 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "tabbedbrowser.h" -#include "mainwindow.h" -#include "helpwindow.h" -#include "config.h" - -#include <QStyleOptionTab> -#include <QToolTip> -#include <QFileInfo> -#include <QToolButton> -#include <QPixmap> -#include <QIcon> -#include <QStyle> -#include <QTimer> -#include <QStackedWidget> -#include <QTimer> -#include <QTextBlock> -#include <QKeyEvent> - -QT_BEGIN_NAMESPACE - -#ifdef Q_WS_MAC -const QLatin1String ImageLocation(":trolltech/assistant/images/mac/"); -#else -const QLatin1String ImageLocation(":trolltech/assistant/images/win/"); -#endif - -TabbedBrowser::TabbedBrowser(MainWindow *parent) - : QWidget(parent) -{ - ui.setupUi(this); - init(); - - QStackedWidget *stack = qFindChild<QStackedWidget*>(ui.tab); - Q_ASSERT(stack); - stack->setContentsMargins(0, 0, 0, 0); - connect(stack, SIGNAL(currentChanged(int)), parent, SLOT(browserTabChanged())); - - QPalette p = palette(); - p.setColor(QPalette::Inactive, QPalette::Highlight, - p.color(QPalette::Active, QPalette::Highlight)); - p.setColor(QPalette::Inactive, QPalette::HighlightedText, - p.color(QPalette::Active, QPalette::HighlightedText)); - setPalette(p); -} - -TabbedBrowser::~TabbedBrowser() -{ -} - -MainWindow *TabbedBrowser::mainWindow() const -{ - return static_cast<MainWindow*>(parentWidget()); -} - -void TabbedBrowser::forward() -{ - currentBrowser()->forward(); - emit browserUrlChanged(currentBrowser()->source().toString()); -} - -void TabbedBrowser::backward() -{ - currentBrowser()->backward(); - emit browserUrlChanged(currentBrowser()->source().toString()); -} - -void TabbedBrowser::setSource( const QString &ref ) -{ - HelpWindow * win = currentBrowser(); - win->setSource(ref); -} - -void TabbedBrowser::reload() -{ - currentBrowser()->reload(); -} - -void TabbedBrowser::home() -{ - currentBrowser()->home(); -} - -HelpWindow *TabbedBrowser::currentBrowser() const -{ - return static_cast<HelpWindow*>(ui.tab->currentWidget()); -} - -void TabbedBrowser::nextTab() -{ - if(ui.tab->currentIndex()<=ui.tab->count()-1) - ui.tab->setCurrentIndex(ui.tab->currentIndex()+1); -} - -void TabbedBrowser::previousTab() -{ - int idx = ui.tab->currentIndex()-1; - if(idx>=0) - ui.tab->setCurrentIndex(idx); -} - -HelpWindow *TabbedBrowser::createHelpWindow() -{ - MainWindow *mainWin = mainWindow(); - HelpWindow *win = new HelpWindow(mainWin, 0); - win->setFrameStyle(QFrame::NoFrame); - win->setPalette(palette()); - win->setSearchPaths(Config::configuration()->mimePaths()); - ui.tab->addTab(win, tr("...")); - connect(win, SIGNAL(highlighted(QString)), - (const QObject*) (mainWin->statusBar()), SLOT(showMessage(QString))); - connect(win, SIGNAL(backwardAvailable(bool)), - mainWin, SLOT(backwardAvailable(bool))); - connect(win, SIGNAL(forwardAvailable(bool)), - mainWin, SLOT(forwardAvailable(bool))); - connect(win, SIGNAL(sourceChanged(QUrl)), this, SLOT(sourceChanged())); - - ui.tab->cornerWidget(Qt::TopRightCorner)->setEnabled(ui.tab->count() > 1); - win->installEventFilter(this); - win->viewport()->installEventFilter(this); - ui.editFind->installEventFilter(this); - return win; -} - -HelpWindow *TabbedBrowser::newBackgroundTab() -{ - HelpWindow *win = createHelpWindow(); - emit tabCountChanged(ui.tab->count()); - return win; -} - -void TabbedBrowser::newTab(const QString &lnk) -{ - QString link(lnk); - if(link.isNull()) { - HelpWindow *w = currentBrowser(); - if(w) - link = w->source().toString(); - } - HelpWindow *win = createHelpWindow(); - ui.tab->setCurrentIndex(ui.tab->indexOf(win)); - if(!link.isNull()) { - win->setSource(link); - } - - emit tabCountChanged(ui.tab->count()); -} - -void TabbedBrowser::zoomIn() -{ - currentBrowser()->zoomIn(); - Config::configuration()->setFontPointSize(currentBrowser()->font().pointSizeF()); -} - -void TabbedBrowser::zoomOut() -{ - currentBrowser()->zoomOut(); - Config::configuration()->setFontPointSize(currentBrowser()->font().pointSizeF()); -} - -void TabbedBrowser::init() -{ - - lastCurrentTab = 0; - while(ui.tab->count()) { - QWidget *page = ui.tab->widget(0); - ui.tab->removeTab(0); - delete page; - } - - connect(ui.tab, SIGNAL(currentChanged(int)), - this, SLOT(transferFocus())); - - QTabBar *tabBar = qFindChild<QTabBar*>(ui.tab); - QStyleOptionTab opt; - if (tabBar) { - opt.init(tabBar); - opt.shape = tabBar->shape(); - tabBar->setContextMenuPolicy(Qt::CustomContextMenu); - connect(tabBar, SIGNAL(customContextMenuRequested(QPoint)), SLOT(openTabMenu(QPoint))); - } - - // workaround for sgi style - QPalette pal = palette(); - pal.setColor(QPalette::Active, QPalette::Button, pal.color(QPalette::Active, QPalette::Window)); - pal.setColor(QPalette::Disabled, QPalette::Button, pal.color(QPalette::Disabled, QPalette::Window)); - pal.setColor(QPalette::Inactive, QPalette::Button, pal.color(QPalette::Inactive, QPalette::Window)); - - QToolButton *newTabButton = new QToolButton(this); - ui.tab->setCornerWidget(newTabButton, Qt::TopLeftCorner); - newTabButton->setCursor(Qt::ArrowCursor); - newTabButton->setAutoRaise(true); - newTabButton->setIcon(QIcon(ImageLocation + QLatin1String("addtab.png"))); - QObject::connect(newTabButton, SIGNAL(clicked()), this, SLOT(newTab())); - newTabButton->setToolTip(tr("Add page")); - - QToolButton *closeTabButton = new QToolButton(this); - closeTabButton->setPalette(pal); - ui.tab->setCornerWidget(closeTabButton, Qt::TopRightCorner); - closeTabButton->setCursor(Qt::ArrowCursor); - closeTabButton->setAutoRaise(true); - closeTabButton->setIcon(QIcon(ImageLocation + QLatin1String("closetab.png"))); - QObject::connect(closeTabButton, SIGNAL(clicked()), this, SLOT(closeTab())); - closeTabButton->setToolTip(tr("Close page")); - closeTabButton->setEnabled(false); - - QObject::connect(ui.toolClose, SIGNAL(clicked()), ui.frameFind, SLOT(hide())); - QObject::connect(ui.toolPrevious, SIGNAL(clicked()), this, SLOT(findPrevious())); - QObject::connect(ui.toolNext, SIGNAL(clicked()), this, SLOT(findNext())); - QObject::connect(ui.editFind, SIGNAL(returnPressed()), this, SLOT(findNext())); - QObject::connect(ui.editFind, SIGNAL(textEdited(QString)), - this, SLOT(find(QString))); - ui.frameFind->setVisible(false); - ui.labelWrapped->setVisible(false); - autoHideTimer = new QTimer(this); - autoHideTimer->setInterval(5000); - autoHideTimer->setSingleShot(true); - QObject::connect(autoHideTimer, SIGNAL(timeout()), ui.frameFind, SLOT(hide())); -} - -void TabbedBrowser::updateTitle(const QString &title) -{ - ui.tab->setTabText(ui.tab->indexOf(currentBrowser()), title.trimmed()); -} - -void TabbedBrowser::newTab() -{ - newTab(QString()); -} - -void TabbedBrowser::transferFocus() -{ - if(currentBrowser()) { - currentBrowser()->setFocus(); - } - mainWindow()->setWindowTitle(Config::configuration()->title() - + QLatin1String(" - ") - + currentBrowser()->documentTitle()); -} - -void TabbedBrowser::initHelpWindow(HelpWindow * /*win*/) -{ -} - -void TabbedBrowser::setup() -{ - newTab(QString()); -} - -void TabbedBrowser::copy() -{ - currentBrowser()->copy(); -} - -void TabbedBrowser::closeTab() -{ - if(ui.tab->count()==1) - return; - HelpWindow *win = currentBrowser(); - mainWindow()->removePendingBrowser(win); - ui.tab->removeTab(ui.tab->indexOf(win)); - QTimer::singleShot(0, win, SLOT(deleteLater())); - ui.tab->cornerWidget(Qt::TopRightCorner)->setEnabled(ui.tab->count() > 1); - emit tabCountChanged(ui.tab->count()); -} - -QStringList TabbedBrowser::sources() const -{ - QStringList lst; - int cnt = ui.tab->count(); - for(int i=0; i<cnt; i++) { - lst.append(((QTextBrowser*) ui.tab->widget(i))->source().toString()); - } - return lst; -} - -QList<HelpWindow*> TabbedBrowser::browsers() const -{ - QList<HelpWindow*> list; - for (int i=0; i<ui.tab->count(); ++i) { - Q_ASSERT(qobject_cast<HelpWindow*>(ui.tab->widget(i))); - list.append(static_cast<HelpWindow*>(ui.tab->widget(i))); - } - return list; -} - -void TabbedBrowser::sourceChanged() -{ - HelpWindow *win = qobject_cast<HelpWindow *>(QObject::sender()); - Q_ASSERT(win); - QString docTitle(win->documentTitle()); - if (docTitle.isEmpty()) - docTitle = QLatin1String("..."); - // Make the classname in the title a bit more visible (otherwise - // we just see the "Qt 4.0 : Q..." which isn't really helpful ;-) - QString qtTitle = QLatin1String("Qt ") + QString::number( (QT_VERSION >> 16) & 0xff ) - + QLatin1String(".") + QString::number( (QT_VERSION >> 8) & 0xff ) - + QLatin1String(": "); - if (docTitle.startsWith(qtTitle)) - docTitle = docTitle.mid(qtTitle.length()); - setTitle(win, docTitle); - ui.frameFind->hide(); - ui.labelWrapped->hide(); - win->setTextCursor(win->cursorForPosition(QPoint(0, 0))); -} - -void TabbedBrowser::setTitle(HelpWindow *win, const QString &title) -{ - const QString tt = title.trimmed(); - ui.tab->setTabText(ui.tab->indexOf(win), tt); - if (win == currentBrowser()) - mainWindow()->setWindowTitle(Config::configuration()->title() + QLatin1String(" - ") + tt); -} - -void TabbedBrowser::keyPressEvent(QKeyEvent *e) -{ - int key = e->key(); - QString ttf = ui.editFind->text(); - QString text = e->text(); - - if (ui.frameFind->isVisible()) { - switch (key) { - case Qt::Key_Escape: - ui.frameFind->hide(); - ui.labelWrapped->hide(); - return; - case Qt::Key_Backspace: - ttf.chop(1); - break; - case Qt::Key_Return: - case Qt::Key_Enter: - // Return/Enter key events are not accepted by QLineEdit - return; - default: - if (text.isEmpty()) { - QWidget::keyPressEvent(e); - return; - } - ttf += text; - } - } else { - if (text.isEmpty() || text[0].isSpace() || !text[0].isPrint()) { - QWidget::keyPressEvent(e); - return; - } - if (text.startsWith(QLatin1Char('/'))) { - ui.editFind->clear(); - find(); - return; - } - ttf = text; - ui.frameFind->show(); - } - - ui.editFind->setText(ttf); - find(ttf, false, false); -} - -void TabbedBrowser::findNext() -{ - find(ui.editFind->text(), true, false); -} - -void TabbedBrowser::findPrevious() -{ - find(ui.editFind->text(), false, true); -} - -void TabbedBrowser::find() -{ - ui.frameFind->show(); - ui.editFind->setFocus(Qt::ShortcutFocusReason); - ui.editFind->selectAll(); - autoHideTimer->stop(); -} - -void TabbedBrowser::find(QString ttf, bool forward, bool backward) -{ - HelpWindow *browser = currentBrowser(); - QTextDocument *doc = browser->document(); - QString oldText = ui.editFind->text(); - QTextCursor c = browser->textCursor(); - QTextDocument::FindFlags options; - QPalette p = ui.editFind->palette(); - p.setColor(QPalette::Active, QPalette::Base, Qt::white); - - if (c.hasSelection()) - c.setPosition(forward ? c.position() : c.anchor(), QTextCursor::MoveAnchor); - - QTextCursor newCursor = c; - - if (!ttf.isEmpty()) { - if (backward) - options |= QTextDocument::FindBackward; - - if (ui.checkCase->isChecked()) - options |= QTextDocument::FindCaseSensitively; - - if (ui.checkWholeWords->isChecked()) - options |= QTextDocument::FindWholeWords; - - newCursor = doc->find(ttf, c, options); - ui.labelWrapped->hide(); - - if (newCursor.isNull()) { - QTextCursor ac(doc); - ac.movePosition(options & QTextDocument::FindBackward - ? QTextCursor::End : QTextCursor::Start); - newCursor = doc->find(ttf, ac, options); - if (newCursor.isNull()) { - p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); - newCursor = c; - } else - ui.labelWrapped->show(); - } - } - - if (!ui.frameFind->isVisible()) - ui.frameFind->show(); - browser->setTextCursor(newCursor); - ui.editFind->setPalette(p); - if (!ui.editFind->hasFocus()) - autoHideTimer->start(); -} - -bool TabbedBrowser::eventFilter(QObject *o, QEvent *e) -{ - if (o == ui.editFind) { - if (e->type() == QEvent::FocusIn && autoHideTimer->isActive()) - autoHideTimer->stop(); - } else if (e->type() == QEvent::KeyPress && ui.frameFind->isVisible()) { // assume textbrowser - QKeyEvent *ke = static_cast<QKeyEvent *>(e); - if (ke->key() == Qt::Key_Space) { - keyPressEvent(ke); - return true; - } - } - - return QWidget::eventFilter(o, e); -} - -void TabbedBrowser::openTabMenu(const QPoint& pos) -{ - QTabBar *tabBar = qFindChild<QTabBar*>(ui.tab); - - QMenu m(QLatin1String(""), tabBar); - QAction *new_action = m.addAction(tr("New Tab")); - QAction *close_action = m.addAction(tr("Close Tab")); - QAction *close_others_action = m.addAction(tr("Close Other Tabs")); - - if (tabBar->count() == 1) { - close_action->setEnabled(false); - close_others_action->setEnabled(false); - } - - QAction *action_picked = m.exec(tabBar->mapToGlobal(pos)); - if (!action_picked) - return; - - if (action_picked == new_action) { - newTab(); - return; - } - - QList<HelpWindow*> windowList = browsers(); - for (int i = 0; i < tabBar->count(); ++i) { - if (tabBar->tabRect(i).contains(pos)) { - HelpWindow *win = static_cast<HelpWindow*>(ui.tab->widget(i)); - if (action_picked == close_action) { - mainWindow()->removePendingBrowser(win); - QTimer::singleShot(0, win, SLOT(deleteLater())); - } - windowList.removeOne(win); - break; - } - } - - if (action_picked == close_others_action) { - foreach (HelpWindow* win, windowList) { - mainWindow()->removePendingBrowser(win); - QTimer::singleShot(0, win, SLOT(deleteLater())); - windowList.removeOne(win); - } - } - - ui.tab->cornerWidget(Qt::TopRightCorner)->setEnabled(windowList.count() > 1); - emit tabCountChanged(windowList.count()); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/tabbedbrowser.h b/tools/assistant/compat/tabbedbrowser.h deleted file mode 100644 index 0e32505..0000000 --- a/tools/assistant/compat/tabbedbrowser.h +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TABBEDBROWSER_H -#define TABBEDBROWSER_H - -#include "ui_tabbedbrowser.h" - -QT_BEGIN_NAMESPACE - -class MainWindow; -class HelpWindow; -class QStyleSheet; -class QMimeSourceFactory; -class QTimer; - -class TabbedBrowser : public QWidget -{ - Q_OBJECT -public: - TabbedBrowser(MainWindow *parent); - virtual ~TabbedBrowser(); - - MainWindow *mainWindow() const; - HelpWindow *currentBrowser() const; - QStringList sources() const; - QList<HelpWindow*> browsers() const; - - HelpWindow* newBackgroundTab(); - HelpWindow* createHelpWindow(); - - void setTitle(HelpWindow*, const QString &); - -signals: - void tabCountChanged(int count); - void browserUrlChanged(const QString &link); - -protected: - void keyPressEvent(QKeyEvent *); - bool eventFilter(QObject *o, QEvent *e); - -public slots: - void init(); - void forward(); - void backward(); - void setSource(const QString &ref); - void reload(); - void home(); - void nextTab(); - void previousTab(); - void newTab(const QString &lnk); - void zoomIn(); - void zoomOut(); - void updateTitle(const QString &title); - void newTab(); - void transferFocus(); - void initHelpWindow(HelpWindow *win); - void setup(); - void copy(); - void closeTab(); - void sourceChanged(); - - void find(); - void findNext(); - void findPrevious(); - -private slots: - void find(QString, bool forward = false, bool backward = false); - void openTabMenu(const QPoint& pos); - -private: - Ui::TabbedBrowser ui; - QWidget *lastCurrentTab; - QFont tabFont; - - QString fixedFontFam; - QColor lnkColor; - bool underlineLnk; - QTimer *autoHideTimer; -}; - -QT_END_NAMESPACE - -#endif // TABBEDBROWSER_H diff --git a/tools/assistant/compat/tabbedbrowser.ui b/tools/assistant/compat/tabbedbrowser.ui deleted file mode 100644 index 411f145..0000000 --- a/tools/assistant/compat/tabbedbrowser.ui +++ /dev/null @@ -1,233 +0,0 @@ -<ui version="4.0" > - <author></author> - <comment>********************************************************************* -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -*********************************************************************</comment> - <exportmacro></exportmacro> - <class>TabbedBrowser</class> - <widget class="QWidget" name="TabbedBrowser" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>710</width> - <height>664</height> - </rect> - </property> - <property name="windowTitle" > - <string>TabbedBrowser</string> - </property> - <layout class="QVBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>0</number> - </property> - <item> - <widget class="QTabWidget" name="tab" > - <widget class="QWidget" name="frontpage" > - <attribute name="title" > - <string>Untitled</string> - </attribute> - <layout class="QGridLayout" > - <property name="margin" > - <number>8</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - </layout> - </widget> - </widget> - </item> - <item> - <widget class="QFrame" name="frameFind" > - <property name="frameShape" > - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow" > - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>6</number> - </property> - <item> - <widget class="QToolButton" name="toolClose" > - <property name="text" > - <string/> - </property> - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/close.png</iconset> - </property> - <property name="autoRaise" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QLineEdit" name="editFind" > - <property name="sizePolicy" > - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize" > - <size> - <width>150</width> - <height>0</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolPrevious" > - <property name="text" > - <string>Previous</string> - </property> - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/previous.png</iconset> - </property> - <property name="toolButtonStyle" > - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="toolNext" > - <property name="minimumSize" > - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="text" > - <string>Next</string> - </property> - <property name="icon" > - <iconset resource="assistant.qrc" >:/trolltech/assistant/images/win/next.png</iconset> - </property> - <property name="toolButtonStyle" > - <enum>Qt::ToolButtonTextBesideIcon</enum> - </property> - <property name="autoRaise" > - <bool>true</bool> - </property> - <property name="arrowType" > - <enum>Qt::NoArrow</enum> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkCase" > - <property name="text" > - <string>Case Sensitive</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="checkWholeWords" > - <property name="text" > - <string>Whole words</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="labelWrapped" > - <property name="minimumSize" > - <size> - <width>0</width> - <height>20</height> - </size> - </property> - <property name="maximumSize" > - <size> - <width>105</width> - <height>20</height> - </size> - </property> - <property name="text" > - <string><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</string> - </property> - <property name="textFormat" > - <enum>Qt::RichText</enum> - </property> - <property name="scaledContents" > - <bool>true</bool> - </property> - <property name="alignment" > - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> - </property> - </widget> - </item> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" > - <size> - <width>81</width> - <height>21</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <pixmapfunction></pixmapfunction> - <resources> - <include location="assistant.qrc" /> - </resources> - <connections/> -</ui> diff --git a/tools/assistant/compat/topicchooser.cpp b/tools/assistant/compat/topicchooser.cpp deleted file mode 100644 index b2e7e98..0000000 --- a/tools/assistant/compat/topicchooser.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "topicchooser.h" - -#include <QLabel> -#include <QListWidget> -#include <QPushButton> - -QT_BEGIN_NAMESPACE - -TopicChooser::TopicChooser(QWidget *parent, const QStringList &lnkNames, - const QStringList &lnks, const QString &title) - : QDialog(parent), links(lnks), linkNames(lnkNames) -{ - ui.setupUi(this); - - ui.label->setText(tr("Choose a topic for <b>%1</b>").arg(title)); - ui.listbox->addItems(linkNames); - if (ui.listbox->count() != 0) - ui.listbox->setCurrentRow(0); - ui.listbox->setFocus(); -} - -QString TopicChooser::link() const -{ - if (ui.listbox->currentRow() == -1) - return QString(); - QString s = ui.listbox->item(ui.listbox->currentRow())->text(); - if (s.isEmpty()) - return s; - int i = linkNames.indexOf(s); - return links[i]; -} - -QString TopicChooser::getLink(QWidget *parent, const QStringList &lnkNames, - const QStringList &lnks, const QString &title) -{ - TopicChooser *dlg = new TopicChooser(parent, lnkNames, lnks, title); - QString lnk; - if (dlg->exec() == QDialog::Accepted) - lnk = dlg->link(); - delete dlg; - return lnk; -} - -void TopicChooser::on_buttonDisplay_clicked() -{ - accept(); -} - -void TopicChooser::on_buttonCancel_clicked() -{ - reject(); -} - -void TopicChooser::on_listbox_itemActivated(QListWidgetItem *item) -{ - Q_UNUSED(item); - accept(); -} - -QT_END_NAMESPACE diff --git a/tools/assistant/compat/topicchooser.ui b/tools/assistant/compat/topicchooser.ui deleted file mode 100644 index 18ff61b..0000000 --- a/tools/assistant/compat/topicchooser.ui +++ /dev/null @@ -1,162 +0,0 @@ -<ui version="4.0" > - <comment>********************************************************************* -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Assistant of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -*********************************************************************</comment> - <class>TopicChooser</class> - <widget class="QDialog" name="TopicChooser" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>391</width> - <height>223</height> - </rect> - </property> - <property name="windowTitle" > - <string>Choose Topic</string> - </property> - <property name="whatsThis" > - <string>Select a topic from the list and click the <b>Display</b>-button to open the online help.</string> - </property> - <property name="sizeGripEnabled" > - <bool>true</bool> - </property> - <layout class="QVBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="leftMargin" > - <number>11</number> - </property> - <property name="topMargin" > - <number>11</number> - </property> - <property name="rightMargin" > - <number>11</number> - </property> - <property name="bottomMargin" > - <number>11</number> - </property> - <item> - <widget class="QLabel" name="label" > - <property name="text" > - <string>&Topics</string> - </property> - <property name="buddy" > - <cstring>listbox</cstring> - </property> - </widget> - </item> - <item> - <widget class="QListWidget" name="listbox" > - <property name="whatsThis" > - <string>Displays a list of available help topics for the keyword.</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" > - <property name="spacing" > - <number>6</number> - </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <property name="bottomMargin" > - <number>0</number> - </property> - <item> - <spacer> - <property name="orientation" > - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType" > - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" > - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="buttonDisplay" > - <property name="whatsThis" > - <string>Open the topic selected in the list.</string> - </property> - <property name="text" > - <string>&Display</string> - </property> - <property name="autoDefault" > - <bool>true</bool> - </property> - <property name="default" > - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonCancel" > - <property name="whatsThis" > - <string>Close the Dialog.</string> - </property> - <property name="text" > - <string>&Close</string> - </property> - <property name="autoDefault" > - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/tools/assistant/lib/lib.pro b/tools/assistant/lib/lib.pro index 51933de..26d3456 100644 --- a/tools/assistant/lib/lib.pro +++ b/tools/assistant/lib/lib.pro @@ -23,7 +23,6 @@ unix:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \ QtSql \ QtXml LIBS_PRIVATE += -l$$qclucene - RESOURCES += helpsystem.qrc SOURCES += qhelpenginecore.cpp \ qhelpengine.cpp \ @@ -41,6 +40,7 @@ SOURCES += qhelpenginecore.cpp \ qhelpsearchindexwriter_default.cpp \ qhelpsearchindexreader_default.cpp \ qhelpsearchindexreader.cpp \ + qclucenefieldnames.cpp \ qhelp_global.cpp # access to clucene @@ -63,7 +63,8 @@ HEADERS += qhelpenginecore.h \ qhelpsearchindex_default_p.h \ qhelpsearchindexwriter_default_p.h \ qhelpsearchindexreader_default_p.h \ - qhelpsearchindexreader_p.h + qhelpsearchindexreader_p.h \ + qclucenefieldnames_p.h # access to clucene HEADERS += qhelpsearchindexwriter_clucene_p.h \ diff --git a/tools/assistant/lib/qclucenefieldnames.cpp b/tools/assistant/lib/qclucenefieldnames.cpp new file mode 100644 index 0000000..84e3a1a --- /dev/null +++ b/tools/assistant/lib/qclucenefieldnames.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qclucenefieldnames_p.h" + +QT_BEGIN_NAMESPACE + +namespace qt { +namespace fulltextsearch { +namespace clucene { +const QString AttributeField(QLatin1String("attribute")); +const QString ContentField(QLatin1String("content")); +const QString NamespaceField(QLatin1String("namespace")); +const QString PathField(QLatin1String("path")); +const QString TitleField(QLatin1String("title")); +const QString TitleTokenizedField(QLatin1String("titleTokenized")); +} // namespace clucene +} // namespace fulltextsearch +} // namespace qt + +QT_END_NAMESPACE diff --git a/tools/assistant/compat/fontsettingsdialog.h b/tools/assistant/lib/qclucenefieldnames_p.h index 6599d2a..ae13515 100644 --- a/tools/assistant/compat/fontsettingsdialog.h +++ b/tools/assistant/lib/qclucenefieldnames_p.h @@ -39,39 +39,27 @@ ** ****************************************************************************/ -#ifndef _FONT_SETTINGS_DIALOG_H_ -#define _FONT_SETTINGS_DIALOG_H_ +#ifndef QCLUCENEFIELDNAMES_P_H +#define QCLUCENEFIELDNAMES_P_H -#include <QtCore/QObject> -#include <QtGui/QDialog> +#include <QtCore/QtGlobal> +#include <QtCore/QString> QT_BEGIN_NAMESPACE -class FontPanel; -struct FontSettings; -class QDialogButtonBox; - -class FontSettingsDialog : public QDialog -{ - Q_OBJECT - -public: - FontSettingsDialog(QWidget *parent = 0); - ~FontSettingsDialog(); - - bool showDialog(FontSettings *settings); - -private: - void updateFontSettings(FontSettings *settings); - void setupFontSettingsDialog(const FontSettings *settings); - -private: - FontPanel *m_windowFontPanel; - FontPanel *m_browserFontPanel; - QDialogButtonBox *m_dialogButtonBox; -}; - -#endif // _FONT_SETTINGS_DIALOG_H_ - +namespace qt { +namespace fulltextsearch { +namespace clucene { + extern const QString AttributeField; + extern const QString ContentField; + extern const QString NamespaceField; + extern const QString PathField; + extern const QString TitleField; + extern const QString TitleTokenizedField; +} // namespace clucene +} // namespace fulltextsearch +} // namespace qt QT_END_NAMESPACE + +#endif // QCLUCENEFIELDNAMES_P_H diff --git a/tools/assistant/lib/qhelp_global.cpp b/tools/assistant/lib/qhelp_global.cpp index 539b504..d8a94d3 100644 --- a/tools/assistant/lib/qhelp_global.cpp +++ b/tools/assistant/lib/qhelp_global.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include <QtCore/QCoreApplication> #include <QtCore/QRegExp> #include <QtCore/QMutexLocker> #include <QtGui/QTextDocument> @@ -60,7 +61,7 @@ QString QHelpGlobal::uniquifyConnectionName(const QString &name, void *pointer) QString QHelpGlobal::documentTitle(const QString &content) { - QString title = QObject::tr("Untitled"); + QString title = QCoreApplication::translate("QHelp", "Untitled"); if (!content.isEmpty()) { int start = content.indexOf(QLatin1String("<title>"), 0, Qt::CaseInsensitive) + 7; int end = content.indexOf(QLatin1String("</title>"), 0, Qt::CaseInsensitive); @@ -86,17 +87,18 @@ QString QHelpGlobal::codecFromData(const QByteArray &data) QString QHelpGlobal::codecFromHtmlData(const QByteArray &data) { - QString content = QString::fromUtf8(data.constData(), data.size()); - int start = content.indexOf(QLatin1String("<meta"), 0, Qt::CaseInsensitive); + QString head = QString::fromUtf8(data.constData(), qMin(1000, data.size())); + int start = head.indexOf(QLatin1String("<meta"), 0, Qt::CaseInsensitive); if (start > 0) { - int end; QRegExp r(QLatin1String("charset=([^\"\\s]+)")); while (start != -1) { - end = content.indexOf(QLatin1Char('>'), start) + 1; - const QString &meta = content.mid(start, end - start).toLower(); + const int end = head.indexOf(QLatin1Char('>'), start) + 1; + if (end <= start) + break; + const QString &meta = head.mid(start, end - start).toLower(); if (r.indexIn(meta) != -1) return r.cap(1); - start = content.indexOf(QLatin1String("<meta"), end, + start = head.indexOf(QLatin1String("<meta"), end, Qt::CaseInsensitive); } } @@ -105,8 +107,8 @@ QString QHelpGlobal::codecFromHtmlData(const QByteArray &data) QString QHelpGlobal::codecFromXmlData(const QByteArray &data) { - QString content = QString::fromUtf8(data.constData(), data.size()); + QString head = QString::fromUtf8(data.constData(), qMin(1000, data.size())); const QRegExp encodingExp(QLatin1String("^\\s*<\\?xml version=" "\"\\d\\.\\d\" encoding=\"([^\"]+)\"\\?>.*")); - return encodingExp.exactMatch(content) ? encodingExp.cap(1) : QString(); + return encodingExp.exactMatch(head) ? encodingExp.cap(1) : QString(); } diff --git a/tools/assistant/lib/qhelpcollectionhandler.cpp b/tools/assistant/lib/qhelpcollectionhandler.cpp index cb7e457..235f737 100644 --- a/tools/assistant/lib/qhelpcollectionhandler.cpp +++ b/tools/assistant/lib/qhelpcollectionhandler.cpp @@ -308,10 +308,8 @@ bool QHelpCollectionHandler::addCustomFilter(const QString &filterName, m_query.prepare(QLatin1String("SELECT Id FROM FilterNameTable WHERE Name=?")); m_query.bindValue(0, filterName); m_query.exec(); - while (m_query.next()) { + if (m_query.next()) nameId = m_query.value(0).toInt(); - break; - } m_query.exec(QLatin1String("SELECT Id, Name FROM FilterAttributeTable")); QStringList idsToInsert = attributes; diff --git a/tools/assistant/lib/qhelpenginecore.cpp b/tools/assistant/lib/qhelpenginecore.cpp index 066e4d5..71306af 100644 --- a/tools/assistant/lib/qhelpenginecore.cpp +++ b/tools/assistant/lib/qhelpenginecore.cpp @@ -119,7 +119,7 @@ bool QHelpEngineCorePrivate::setup() QHelpDBReader *reader = new QHelpDBReader(absFileName, QHelpGlobal::uniquifyConnectionName(info.fileName, this), this); if (!reader->init()) { - emit q->warning(tr("Cannot open documentation file %1: %2!") + emit q->warning(QHelpEngineCore::tr("Cannot open documentation file %1: %2!") .arg(absFileName, reader->errorMessage())); continue; } @@ -406,8 +406,9 @@ QStringList QHelpEngineCore::customFilters() const /*! Adds the new custom filter \a filterName. The filter attributes - are specified by \a attributes. The function returns false if - the filter can not be added, e.g. when the filter already exists. + are specified by \a attributes. If the filter already exists, + its attribute set is replaced. The function returns true if + the operation succeeded, otherwise it returns false. \sa customFilters(), removeCustomFilter() */ diff --git a/tools/assistant/lib/qhelpgenerator.cpp b/tools/assistant/lib/qhelpgenerator.cpp index 4b94ebf..783f016 100644 --- a/tools/assistant/lib/qhelpgenerator.cpp +++ b/tools/assistant/lib/qhelpgenerator.cpp @@ -47,6 +47,7 @@ #include <QtCore/QFileInfo> #include <QtCore/QDir> #include <QtCore/QDebug> +#include <QtCore/QSet> #include <QtCore/QVariant> #include <QtCore/QDateTime> #include <QtCore/QTextCodec> @@ -537,7 +538,8 @@ bool QHelpGenerator::insertFiles(const QStringList &files, const QString &rootPa } int fileId = -1; - if (!d->fileMap.contains(fileName)) { + QMap<QString, int>::Iterator fileMapIt = d->fileMap.find(fileName); + if (fileMapIt == d->fileMap.end()) { fileDataList.append(qCompress(data)); fileNameData.name = fileName; @@ -551,18 +553,20 @@ bool QHelpGenerator::insertFiles(const QStringList &files, const QString &rootPa ++tableFileId; } else { - fileId = d->fileMap.value(fileName); + fileId = fileMapIt.value(); + QSet<int> &fileFilterSet = d->fileFilterMap[fileId]; + QSet<int> &tmpFileFilterSet = tmpFileFilterMap[fileId]; foreach (const int &filter, filterAtts) { - if (!d->fileFilterMap.value(fileId).contains(filter) - && !tmpFileFilterMap.value(fileId).contains(filter)) { - d->fileFilterMap[fileId].insert(filter); - tmpFileFilterMap[fileId].insert(filter); + if (!fileFilterSet.contains(filter) + && !tmpFileFilterSet.contains(filter)) { + fileFilterSet.insert(filter); + tmpFileFilterSet.insert(filter); } } } } - if (tmpFileFilterMap.count()) { + if (!tmpFileFilterMap.isEmpty()) { d->query->exec(QLatin1String("BEGIN")); QMap<int, QSet<int> >::const_iterator it = tmpFileFilterMap.constBegin(); while (it != tmpFileFilterMap.constEnd()) { @@ -625,8 +629,7 @@ bool QHelpGenerator::registerCustomFilter(const QString &filterName, while (d->query->next()) { attributeMap.insert(d->query->value(1).toString(), d->query->value(0).toInt()); - if (idsToInsert.contains(d->query->value(1).toString())) - idsToInsert.removeAll(d->query->value(1).toString()); + idsToInsert.removeAll(d->query->value(1).toString()); } foreach (const QString &id, idsToInsert) { @@ -674,7 +677,7 @@ bool QHelpGenerator::registerCustomFilter(const QString &filterName, return true; } -bool QHelpGenerator::insertKeywords(const QList<QHelpDataIndexItem> keywords, +bool QHelpGenerator::insertKeywords(const QList<QHelpDataIndexItem> &keywords, const QStringList &filterAttributes) { if (!d->query) @@ -704,7 +707,17 @@ bool QHelpGenerator::insertKeywords(const QList<QHelpDataIndexItem> keywords, int i = 0; d->query->exec(QLatin1String("BEGIN")); + QSet<QString> indices; foreach (const QHelpDataIndexItem &itm, keywords) { + + /* + * Identical ids make no sense and just confuse the Assistant user, + * so we ignore all repetitions. + */ + if (indices.contains(itm.identifier)) + continue; + indices.insert(itm.identifier); + pos = itm.reference.indexOf(QLatin1Char('#')); fileName = itm.reference.left(pos); if (pos > -1) @@ -716,8 +729,9 @@ bool QHelpGenerator::insertKeywords(const QList<QHelpDataIndexItem> keywords, if (fName.startsWith(QLatin1String("./"))) fName = fName.mid(2); - if (d->fileMap.contains(fName)) - fileId = d->fileMap.value(fName); + QMap<QString, int>::ConstIterator it = d->fileMap.find(fName); + if (it != d->fileMap.end()) + fileId = it.value(); else fileId = 1; @@ -749,7 +763,7 @@ bool QHelpGenerator::insertKeywords(const QList<QHelpDataIndexItem> keywords, d->query->exec(QLatin1String("COMMIT")); d->query->exec(QLatin1String("SELECT COUNT(Id) FROM IndexTable")); - if (d->query->next() && d->query->value(0).toInt() >= keywords.count()) + if (d->query->next() && d->query->value(0).toInt() >= indices.count()) return true; return false; } @@ -824,4 +838,68 @@ bool QHelpGenerator::insertMetaData(const QMap<QString, QVariant> &metaData) return true; } +bool QHelpGenerator::checkLinks(const QHelpDataInterface &helpData) +{ + /* + * Step 1: Gather the canoncal file paths of all files in the project. + * We use a set, because there will be a lot of look-ups. + */ + QSet<QString> files; + foreach (const QHelpDataFilterSection &filterSection, helpData.filterSections()) { + foreach (const QString &file, filterSection.files()) { + QFileInfo fileInfo(helpData.rootPath() + QDir::separator() + file); + const QString &canonicalFileName = fileInfo.canonicalFilePath(); + if (!fileInfo.exists()) + emit warning(tr("File '%1' does not exist.").arg(file)); + else + files.insert(canonicalFileName); + } + } + + /* + * Step 2: Check the hypertext and image references of all HTML files. + * Note that we don't parse the files, but simply grep for the + * respective HTML elements. Therefore. contents that are e.g. + * commented out can cause false warning. + */ + bool allLinksOk = true; + foreach (const QString &fileName, files) { + if (!fileName.endsWith(QLatin1String("html")) + && !fileName.endsWith(QLatin1String("htm"))) + continue; + QFile htmlFile(fileName); + if (!htmlFile.open(QIODevice::ReadOnly)) { + emit warning(tr("File '%1' cannot be opened.").arg(fileName)); + continue; + } + const QRegExp linkPattern(QLatin1String("<(?:a href|img src)=\"?([^#\">]+)[#\">]")); + QTextStream stream(&htmlFile); + const QString codec = QHelpGlobal::codecFromData(htmlFile.read(1000)); + stream.setCodec(QTextCodec::codecForName(codec.toLatin1().constData())); + const QString &content = stream.readAll(); + QStringList invalidLinks; + for (int pos = linkPattern.indexIn(content); pos != -1; + pos = linkPattern.indexIn(content, pos + 1)) { + const QString& linkedFileName = linkPattern.cap(1); + if (linkedFileName.contains(QLatin1String("://"))) + continue; + const QString curDir = QFileInfo(fileName).dir().path(); + const QString &canonicalLinkedFileName = + QFileInfo(curDir + QDir::separator() + linkedFileName).canonicalFilePath(); + if (!files.contains(canonicalLinkedFileName) + && !invalidLinks.contains(canonicalLinkedFileName)) { + emit warning(tr("File '%1' contains an invalid link to file '%2'"). + arg(fileName).arg(linkedFileName)); + allLinksOk = false; + invalidLinks.append(canonicalLinkedFileName); + } + } + } + + if (!allLinksOk) + d->error = tr("Invalid links in HTML files."); + return allLinksOk; +} + QT_END_NAMESPACE + diff --git a/tools/assistant/lib/qhelpgenerator_p.h b/tools/assistant/lib/qhelpgenerator_p.h index c589e25..823a07a 100644 --- a/tools/assistant/lib/qhelpgenerator_p.h +++ b/tools/assistant/lib/qhelpgenerator_p.h @@ -74,6 +74,7 @@ public: bool generate(QHelpDataInterface *helpData, const QString &outputFileName); + bool checkLinks(const QHelpDataInterface &helpData); QString error() const; Q_SIGNALS: @@ -96,7 +97,7 @@ private: const QStringList &filterAttribs, bool forceUpdate = false); bool registerVirtualFolder(const QString &folderName, const QString &ns); bool insertFilterAttributes(const QStringList &attributes); - bool insertKeywords(const QList<QHelpDataIndexItem> keywords, + bool insertKeywords(const QList<QHelpDataIndexItem> &keywords, const QStringList &filterAttributes); bool insertFiles(const QStringList &files, const QString &rootPath, const QStringList &filterAttributes); diff --git a/tools/assistant/lib/qhelpprojectdata.cpp b/tools/assistant/lib/qhelpprojectdata.cpp index 869a446..83491a0 100644 --- a/tools/assistant/lib/qhelpprojectdata.cpp +++ b/tools/assistant/lib/qhelpprojectdata.cpp @@ -41,6 +41,7 @@ #include "qhelpprojectdata_p.h" +#include <QtCore/QCoreApplication> #include <QtCore/QDir> #include <QtCore/QFileInfo> #include <QtCore/QStack> @@ -82,7 +83,7 @@ private: void QHelpProjectDataPrivate::raiseUnknownTokenError() { - raiseError(QObject::tr("Unknown token.")); + raiseError(QCoreApplication::translate("QHelpProject", "Unknown token.")); } void QHelpProjectDataPrivate::readData(const QByteArray &contents) @@ -95,12 +96,14 @@ void QHelpProjectDataPrivate::readData(const QByteArray &contents) && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) readProject(); else - raiseError(QObject::tr("Unknown token. Expected \"QtHelpProject\"!")); + raiseError(QCoreApplication::translate("QHelpProject", + "Unknown token. Expected \"QtHelpProject\"!")); } } if (hasError()) { - raiseError(QObject::tr("Error in line %1: %2").arg(lineNumber()) + raiseError(QCoreApplication::translate("QHelpProject", + "Error in line %1: %2").arg(lineNumber()) .arg(errorString())); } } @@ -113,11 +116,15 @@ void QHelpProjectDataPrivate::readProject() if (name() == QLatin1String("virtualFolder")) { virtualFolder = readElementText(); if (virtualFolder.contains(QLatin1String("/"))) - raiseError(QObject::tr("A virtual folder must not contain a \'/\' character!")); + raiseError(QCoreApplication::translate("QHelpProject", + "A virtual folder must not contain " + "a \'/\' character!")); } else if (name() == QLatin1String("namespace")) { namespaceName = readElementText(); if (namespaceName.contains(QLatin1String("/"))) - raiseError(QObject::tr("A namespace must not contain a \'/\' character!")); + raiseError(QCoreApplication::translate("QHelpProject", + "A namespace must not contain a " + "\'/\' character!")); } else if (name() == QLatin1String("customFilter")) { readCustomFilter(); } else if (name() == QLatin1String("filterSection")) { @@ -125,17 +132,21 @@ void QHelpProjectDataPrivate::readProject() } else if (name() == QLatin1String("metaData")) { QString n = attributes().value(QLatin1String("name")).toString(); if (!metaData.contains(n)) - metaData[n] = attributes().value(QLatin1String("value")).toString(); + metaData[n] + = attributes().value(QLatin1String("value")).toString(); else - metaData.insert(n, attributes().value(QLatin1String("value")).toString()); + metaData.insert(n, attributes(). + value(QLatin1String("value")).toString()); } else { raiseUnknownTokenError(); } } else if (isEndElement() && name() == QLatin1String("QtHelpProject")) { if (namespaceName.isEmpty()) - raiseError(QObject::tr("Missing namespace in QtHelpProject.")); + raiseError(QCoreApplication::translate("QHelpProject", + "Missing namespace in QtHelpProject.")); else if (virtualFolder.isEmpty()) - raiseError(QObject::tr("Missing virtual folder in QtHelpProject")); + raiseError(QCoreApplication::translate("QHelpProject", + "Missing virtual folder in QtHelpProject")); break; } } @@ -223,12 +234,14 @@ void QHelpProjectDataPrivate::readKeywords() if (attributes().value(QLatin1String("ref")).toString().isEmpty() || (attributes().value(QLatin1String("name")).toString().isEmpty() && attributes().value(QLatin1String("id")).toString().isEmpty())) - raiseError(QObject::tr("Missing attribute in keyword at line %1.") - .arg(lineNumber())); - filterSectionList.last().addIndex( - QHelpDataIndexItem(attributes().value(QLatin1String("name")).toString(), - attributes().value(QLatin1String("id")).toString(), - attributes().value(QLatin1String("ref")).toString())); + raiseError(QCoreApplication::translate("QHelpProject", + "Missing attribute in keyword at line %1.") + .arg(lineNumber())); + filterSectionList.last() + .addIndex(QHelpDataIndexItem(attributes(). + value(QLatin1String("name")).toString(), + attributes().value(QLatin1String("id")).toString(), + attributes().value(QLatin1String("ref")).toString())); } else { raiseUnknownTokenError(); } @@ -346,8 +359,8 @@ bool QHelpProjectData::readData(const QString &fileName) d->rootPath = QFileInfo(fileName).absolutePath(); QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { - d->errorMsg = QObject::tr("The input file %1 could not be opened!") - .arg(fileName); + d->errorMsg = QCoreApplication::translate("QHelpProject", + "The input file %1 could not be opened!").arg(fileName); return false; } diff --git a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp index b5bec44..ee6dcfb 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp @@ -39,16 +39,19 @@ ** ****************************************************************************/ -#include "qhelpenginecore.h" -#include "fulltextsearch/qsearchable_p.h" -#include "fulltextsearch/qqueryparser_p.h" #include "fulltextsearch/qindexreader_p.h" +#include "fulltextsearch/qqueryparser_p.h" +#include "fulltextsearch/qsearchable_p.h" +#include "qclucenefieldnames_p.h" +#include "qhelpenginecore.h" + #include "qhelpsearchindexreader_clucene_p.h" #include <QtCore/QDir> #include <QtCore/QSet> #include <QtCore/QString> #include <QtCore/QFileInfo> +#include <QtCore/QSharedPointer> #include <QtCore/QStringList> #include <QtCore/QTextStream> #include <QtCore/QMutexLocker> @@ -108,64 +111,88 @@ void QHelpSearchIndexReaderClucene::run() #if !defined(QT_NO_EXCEPTIONS) try { #endif - QCLuceneBooleanQuery booleanQuery; + QCLuceneBooleanQuery booleanQueryTitle; + QCLuceneBooleanQuery booleanQueryContent; QCLuceneStandardAnalyzer analyzer; - if (!buildQuery(booleanQuery, queryList, analyzer)) { + const QStringList& attribList = + engine.filterAttributes(engine.currentFilter()); + bool titleQueryIsValid = buildQuery(queryList, TitleTokenizedField, + attribList, booleanQueryTitle, analyzer); + bool contentQueryIsValid = buildQuery(queryList, ContentField, + attribList, booleanQueryContent, analyzer); + if (!titleQueryIsValid && !contentQueryIsValid) { emit searchingFinished(0); return; } - const QStringList attribList = engine.filterAttributes(engine.currentFilter()); - if (!attribList.isEmpty()) { - QCLuceneQuery* query = QCLuceneQueryParser::parse(QLatin1String("+") - + attribList.join(QLatin1String(" +")), QLatin1String("attribute"), analyzer); + QCLuceneIndexSearcher indexSearcher(indexPath); - if (!query) { + // QCLuceneHits object must be allocated on the heap, because + // there is no default constructor. + QSharedPointer<QCLuceneHits> titleHits; + QSharedPointer<QCLuceneHits> contentHits; + if (titleQueryIsValid) { + titleHits = QSharedPointer<QCLuceneHits>(new QCLuceneHits( + indexSearcher.search(booleanQueryTitle))); + } + if (contentQueryIsValid) { + contentHits = QSharedPointer<QCLuceneHits>(new QCLuceneHits( + indexSearcher.search(booleanQueryContent))); + } + bool boost = true; + if ((titleHits.isNull() || titleHits->length() == 0) + && (contentHits.isNull() || contentHits->length() == 0)) { + booleanQueryTitle = QCLuceneBooleanQuery(); + booleanQueryContent = QCLuceneBooleanQuery(); + titleQueryIsValid = + buildTryHarderQuery(queryList, TitleTokenizedField, + attribList, booleanQueryTitle, analyzer); + contentQueryIsValid = + buildTryHarderQuery(queryList, ContentField, attribList, + booleanQueryContent, analyzer); + if (!titleQueryIsValid && !contentQueryIsValid) { emit searchingFinished(0); return; } - booleanQuery.add(query, true, true, false); - } - - QCLuceneIndexSearcher indexSearcher(indexPath); - QCLuceneHits hits = indexSearcher.search(booleanQuery); - - bool boost = true; - QCLuceneBooleanQuery tryHarderQuery; - if (hits.length() == 0) { - if (buildTryHarderQuery(tryHarderQuery, queryList, analyzer)) { - if (!attribList.isEmpty()) { - QCLuceneQuery* query = QCLuceneQueryParser::parse(QLatin1String("+") - + attribList.join(QLatin1String(" +")), QLatin1String("attribute"), - analyzer); - tryHarderQuery.add(query, true, true, false); - } - hits = indexSearcher.search(tryHarderQuery); - boost = (hits.length() == 0); + if (titleQueryIsValid) { + titleHits = QSharedPointer<QCLuceneHits>(new QCLuceneHits( + indexSearcher.search(booleanQueryTitle))); + } + if (contentQueryIsValid) { + contentHits = QSharedPointer<QCLuceneHits>(new QCLuceneHits( + indexSearcher.search(booleanQueryContent))); } + boost = false; } + QList<QSharedPointer<QCLuceneHits> > cluceneHitsList; + if (!titleHits.isNull()) + cluceneHitsList.append(titleHits); + if (!contentHits.isNull()) + cluceneHitsList.append(contentHits); QSet<QString> pathSet; QCLuceneDocument document; const QStringList namespaceList = engine.registeredDocumentations(); - for (qint32 i = 0; i < hits.length(); i++) { - document = hits.document(i); - const QString path = document.get(QLatin1String("path")); - if (!pathSet.contains(path) && namespaceList.contains( - document.get(QLatin1String("namespace")), Qt::CaseInsensitive)) { - pathSet.insert(path); - hitList.append(qMakePair(path, document.get(QLatin1String("title")))); - } - document.clear(); + foreach (QSharedPointer<QCLuceneHits> hits, cluceneHitsList) { + for (qint32 i = 0; i < hits->length(); i++) { + document = hits->document(i); + const QString path = document.get(PathField); + if (!pathSet.contains(path) && namespaceList.contains( + document.get(NamespaceField), Qt::CaseInsensitive)) { + pathSet.insert(path); + hitList.append(qMakePair(path, document.get(TitleField))); + } + document.clear(); - mutex.lock(); - if (m_cancel) { + mutex.lock(); + if (m_cancel) { + mutex.unlock(); + emit searchingFinished(0); + return; + } mutex.unlock(); - emit searchingFinished(0); - return; } - mutex.unlock(); } indexSearcher.close(); @@ -185,144 +212,205 @@ void QHelpSearchIndexReaderClucene::run() } } -bool QHelpSearchIndexReaderClucene::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery, - QCLuceneStandardAnalyzer &analyzer) +bool QHelpSearchIndexReaderClucene::buildQuery( + const QList<QHelpSearchQuery> &queries, const QString &fieldName, + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) { - const QLatin1String c("content"); - const QLatin1String t("titleTokenized"); - - QCLuceneQuery *query = QCLuceneQueryParser::parse(term, c, analyzer); - QCLuceneQuery *query2 = QCLuceneQueryParser::parse(term, t, analyzer); - if (query && query2) { - booleanQuery.add(query, true, false, false); - booleanQuery.add(query2, true, false, false); - return true; + bool queryIsValid = false; + foreach (const QHelpSearchQuery &query, queries) { + if (fieldName != ContentField && isNegativeQuery(query)) { + queryIsValid = false; + break; + } + switch (query.fieldName) { + case QHelpSearchQuery::FUZZY: + if (addFuzzyQuery(query, fieldName, booleanQuery, analyzer)) + queryIsValid = true; + break; + case QHelpSearchQuery::WITHOUT: + if (fieldName != ContentField) + return false; + if (addWithoutQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::PHRASE: + if (addPhraseQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::ALL: + if (addAllQuery(query, fieldName, booleanQuery)) + queryIsValid = true; + break; + case QHelpSearchQuery::DEFAULT: + if (addDefaultQuery(query, fieldName, true, booleanQuery, analyzer)) + queryIsValid = true; + break; + case QHelpSearchQuery::ATLEAST: + if (addAtLeastQuery(query, fieldName, booleanQuery, analyzer)) + queryIsValid = true; + break; + default: + Q_ASSERT(!"Invalid field name"); + } } - return false; + if (queryIsValid && !filterAttributes.isEmpty()) { + queryIsValid = + addAttributesQuery(filterAttributes, booleanQuery, analyzer); + } + + return queryIsValid; } -bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuery, - const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer) +bool QHelpSearchIndexReaderClucene::buildTryHarderQuery( + const QList<QHelpSearchQuery> &queries, const QString &fieldName, + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) { - foreach (const QHelpSearchQuery query, queryList) { - switch (query.fieldName) { - case QHelpSearchQuery::FUZZY: { - const QLatin1String fuzzy("~"); - foreach (const QString &term, query.wordList) { - if (term.isEmpty() - || !defaultQuery(term.toLower() + fuzzy, booleanQuery, analyzer)) { - return false; - } - } - } break; - - case QHelpSearchQuery::WITHOUT: { - QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, query.wordList) { - if (stopWords.contains(term, Qt::CaseInsensitive)) - continue; - - QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("content"), term.toLower())); - QCLuceneQuery *query2 = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("titleTokenized"), term.toLower())); - - if (query && query2) { - booleanQuery.add(query, true, false, true); - booleanQuery.add(query2, true, false, true); - } else { - return false; - } - } - } break; - - case QHelpSearchQuery::PHRASE: { - const QString &term = query.wordList.at(0).toLower(); - if (term.contains(QLatin1Char(' '))) { - QStringList termList = term.split(QLatin1String(" ")); - QCLucenePhraseQuery *q = new QCLucenePhraseQuery(); - QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, termList) { - if (!stopWords.contains(term, Qt::CaseInsensitive)) - q->addTerm(QCLuceneTerm(QLatin1String("content"), term.toLower())); - } - booleanQuery.add(q, true, true, false); - } else { - QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("content"), term.toLower())); - QCLuceneQuery *query2 = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("titleTokenized"), term.toLower())); - - if (query && query2) { - booleanQuery.add(query, true, true, false); - booleanQuery.add(query2, true, false, false); - } else { - return false; - } - } - } break; + if (queries.isEmpty()) + return false; + const QHelpSearchQuery &query = queries.front(); + if (query.fieldName != QHelpSearchQuery::DEFAULT) + return false; + if (isNegativeQuery(query)) + return false; + if (!addDefaultQuery(query, fieldName, false, booleanQuery, analyzer)) + return false; + if (filterAttributes.isEmpty()) + return true; + return addAttributesQuery(filterAttributes, booleanQuery, analyzer); +} - case QHelpSearchQuery::ALL: { - QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); - foreach (const QString &term, query.wordList) { - if (stopWords.contains(term, Qt::CaseInsensitive)) - continue; +bool QHelpSearchIndexReaderClucene::isNegativeQuery(const QHelpSearchQuery &query) const +{ + const QString &search = query.wordList.join(" "); + return search.contains('!') || search.contains('-') + || search.contains(QLatin1String(" NOT ")); +} - QCLuceneQuery *query = new QCLuceneTermQuery(QCLuceneTerm( - QLatin1String("content"), term.toLower())); +bool QHelpSearchIndexReaderClucene::addFuzzyQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + bool queryIsValid = false; + const QLatin1String fuzzy("~"); + foreach (const QString &term, query.wordList) { + if (!term.isEmpty()) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term + fuzzy, fieldName, analyzer); + if (lQuery != 0) { + booleanQuery.add(lQuery, true, false, false); + queryIsValid = true; + } + } + } + return queryIsValid; +} - if (query) { - booleanQuery.add(query, true, true, false); - } else { - return false; - } - } - } break; +bool QHelpSearchIndexReaderClucene::addWithoutQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, query.wordList) { + if (stopWords.contains(term, Qt::CaseInsensitive)) + continue; + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, false, true); + queryIsValid = true; + } + return queryIsValid; +} - case QHelpSearchQuery::DEFAULT: { - foreach (const QString &term, query.wordList) { - QCLuceneQuery *query = QCLuceneQueryParser::parse(term.toLower(), - QLatin1String("content"), analyzer); +bool QHelpSearchIndexReaderClucene::addPhraseQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QString &term = query.wordList.at(0).toLower(); + if (term.contains(QLatin1Char(' '))) { + const QStringList termList = term.split(QLatin1String(" ")); + QCLucenePhraseQuery *q = new QCLucenePhraseQuery(); + const QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, termList) { + if (!stopWords.contains(term, Qt::CaseInsensitive)) + q->addTerm(QCLuceneTerm(fieldName, term.toLower())); + } + if (!q->getTerms().isEmpty()) { + booleanQuery.add(q, true, true, false); + queryIsValid = true; + } + } else { + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, true, false); + queryIsValid = true; + } + return queryIsValid; +} - if (query) - booleanQuery.add(query, true, true, false); - } - } break; +bool QHelpSearchIndexReaderClucene::addAllQuery(const QHelpSearchQuery &query, + const QString &fieldName, QCLuceneBooleanQuery &booleanQuery) +{ + bool queryIsValid = false; + const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords(); + foreach (const QString &term, query.wordList) { + if (stopWords.contains(term, Qt::CaseInsensitive)) + continue; + QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm( + fieldName, term.toLower())); + booleanQuery.add(lQuery, true, true, false); + queryIsValid = true; + } + return queryIsValid; +} - case QHelpSearchQuery::ATLEAST: { - foreach (const QString &term, query.wordList) { - if (term.isEmpty() || !defaultQuery(term.toLower(), booleanQuery, analyzer)) - return false; - } - } +bool QHelpSearchIndexReaderClucene::addDefaultQuery(const QHelpSearchQuery &query, + const QString &fieldName, bool allTermsRequired, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + bool queryIsValid = false; + foreach (const QString &term, query.wordList) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term.toLower(), fieldName, analyzer); + if (lQuery) { + booleanQuery.add(lQuery, true, allTermsRequired, false); + queryIsValid = true; } } - - return true; + return queryIsValid; } -bool QHelpSearchIndexReaderClucene::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery, - const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer) +bool QHelpSearchIndexReaderClucene::addAtLeastQuery( + const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer) { - bool retVal = false; - foreach (const QHelpSearchQuery query, queryList) { - switch (query.fieldName) { - default: break; - case QHelpSearchQuery::DEFAULT: { - foreach (const QString &term, query.wordList) { - QCLuceneQuery *query = QCLuceneQueryParser::parse(term.toLower(), - QLatin1String("content"), analyzer); - - if (query) { - retVal = true; - booleanQuery.add(query, true, false, false); - } - } - } break; + bool queryIsValid = false; + foreach (const QString &term, query.wordList) { + if (!term.isEmpty()) { + QCLuceneQuery *lQuery = + QCLuceneQueryParser::parse(term, fieldName, analyzer); + if (lQuery) { + booleanQuery.add(lQuery, true, false, false); + queryIsValid = true; + } } } - return retVal; + return queryIsValid; +} + +bool QHelpSearchIndexReaderClucene::addAttributesQuery( + const QStringList &filterAttributes, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer) +{ + QCLuceneQuery* lQuery = QCLuceneQueryParser::parse(QLatin1String("+") + + filterAttributes.join(QLatin1String(" +")), AttributeField, analyzer); + if (!lQuery) + return false; + booleanQuery.add(lQuery, true, true, false); + return true; } void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engine, @@ -336,21 +424,22 @@ void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engin QCLuceneStandardAnalyzer analyzer; QCLuceneQuery *parsedQuery = QCLuceneQueryParser::parse( - joinedQuery, QLatin1String("content"), analyzer); + joinedQuery, ContentField, analyzer); if (parsedQuery) { joinedQuery = parsedQuery->toString(); delete parsedQuery; } - int length = QString(QLatin1String("content:")).length(); - int index = joinedQuery.indexOf(QLatin1String("content:")); + const QString contentString(ContentField + QLatin1String(":")); + int length = contentString.length(); + int index = joinedQuery.indexOf(contentString); QString term; int nextIndex = 0; QStringList searchTerms; while (index != -1) { - nextIndex = joinedQuery.indexOf(QLatin1String("content:"), index + 1); + nextIndex = joinedQuery.indexOf(contentString, index + 1); term = joinedQuery.mid(index + length, nextIndex - (length + index)).simplified(); if (term.startsWith(QLatin1String("\"")) && term.endsWith(QLatin1String("\""))) { diff --git a/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h b/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h index 3e3b9dd..04c0088 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h +++ b/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h @@ -53,16 +53,19 @@ // We mean it. // -#include "qhelpsearchindexreader_p.h" +#include <QtCore/QList> +#include <QtCore/QString> +#include <QtCore/QStringList> #include "fulltextsearch/qanalyzer_p.h" #include "fulltextsearch/qquery_p.h" +#include "qhelpsearchindexreader_p.h" QT_BEGIN_NAMESPACE namespace qt { - namespace fulltextsearch { - namespace clucene { +namespace fulltextsearch { +namespace clucene { class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader { @@ -74,18 +77,38 @@ public: private: void run(); - bool defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery, - QCLuceneStandardAnalyzer &analyzer); - bool buildQuery(QCLuceneBooleanQuery &booleanQuery, const QList<QHelpSearchQuery> &queryList, - QCLuceneStandardAnalyzer &analyzer); - bool buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery, - const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer); void boostSearchHits(const QHelpEngineCore &engine, QList<QHelpSearchEngine::SearchHit> &hitList, const QList<QHelpSearchQuery> &queryList); + bool buildQuery(const QList<QHelpSearchQuery> &queries, + const QString &fieldName, + const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool buildTryHarderQuery(const QList<QHelpSearchQuery> &queries, + const QString &fieldName, + const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool addFuzzyQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool addWithoutQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addPhraseQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addAllQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery); + bool addDefaultQuery(const QHelpSearchQuery &query, const QString &fieldName, + bool allTermsRequired, QCLuceneBooleanQuery &booleanQuery, + QCLuceneAnalyzer &analyzer); + bool addAtLeastQuery(const QHelpSearchQuery &query, const QString &fieldName, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool addAttributesQuery(const QStringList &filterAttributes, + QCLuceneBooleanQuery &booleanQuery, QCLuceneAnalyzer &analyzer); + bool isNegativeQuery(const QHelpSearchQuery &query) const; }; - } // namespace clucene - } // namespace fulltextsearch +} // namespace clucene +} // namespace fulltextsearch } // namespace qt QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp index e3cc2b0..b65ba2a 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#include "qclucenefieldnames_p.h" #include "qhelpenginecore.h" #include "qhelp_global.h" #include "fulltextsearch/qhits_p.h" @@ -407,17 +408,17 @@ public: QString parsedTitle = QHelpGlobal::documentTitle(data); if(!parsedData.isEmpty()) { - document->add(new QCLuceneField(QLatin1String("content"), + document->add(new QCLuceneField(ContentField, parsedData,QCLuceneField::INDEX_TOKENIZED)); - document->add(new QCLuceneField(QLatin1String("path"), fileName, + document->add(new QCLuceneField(PathField, fileName, QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(QLatin1String("title"), parsedTitle, + document->add(new QCLuceneField(TitleField, parsedTitle, QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(QLatin1String("titleTokenized"), parsedTitle, + document->add(new QCLuceneField(TitleTokenizedField, parsedTitle, QCLuceneField::STORE_YES | QCLuceneField::INDEX_TOKENIZED)); - document->add(new QCLuceneField(QLatin1String("namespace"), namespaceName, + document->add(new QCLuceneField(NamespaceField, namespaceName, QCLuceneField::STORE_YES | QCLuceneField::INDEX_UNTOKENIZED)); - document->add(new QCLuceneField(QLatin1String("attribute"), attributes, + document->add(new QCLuceneField(AttributeField, attributes, QCLuceneField::STORE_YES | QCLuceneField::INDEX_TOKENIZED)); return true; } @@ -713,9 +714,7 @@ void QHelpSearchIndexWriter::run() if (indexMap.contains(namespaceName)) { // make sure we really have content indexed for namespace - // NOTE: Extra variable just for GCC 3.3.5 - QLatin1String key("namespace"); - QCLuceneTermQuery query(QCLuceneTerm(key, namespaceName)); + QCLuceneTermQuery query(QCLuceneTerm(NamespaceField, namespaceName)); QCLuceneIndexSearcher indexSearcher(indexPath); QCLuceneHits hits = indexSearcher.search(query); if (hits.length() <= 0) @@ -858,8 +857,7 @@ void QHelpSearchIndexWriter::removeDocuments(const QString &indexPath, return; QCLuceneIndexReader reader = QCLuceneIndexReader::open(indexPath); - reader.deleteDocuments(QCLuceneTerm(QLatin1String("namespace"), - namespaceName)); + reader.deleteDocuments(QCLuceneTerm(NamespaceField, namespaceName)); reader.close(); } diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp index 3c3919e..1634a0d 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.cpp +++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp @@ -41,8 +41,6 @@ #include "qhelpsearchquerywidget.h" -#include <QtCore/QDebug> - #include <QtCore/QAbstractListModel> #include <QtCore/QObject> #include <QtCore/QStringList> @@ -101,8 +99,9 @@ private: }; QHelpSearchQueryWidgetPrivate() - : QObject(), simpleSearch(true), - searchCompleter(new CompleterModel(this), this) + : QObject() + , simpleSearch(true) + , searchCompleter(new CompleterModel(this), this) { searchButton = 0; advancedSearchWidget = 0; @@ -136,33 +135,6 @@ private: #endif } - QString escapeString(const QString &text) - { - QString retValue = text; - const QString escape(QLatin1String("\\")); - QStringList escapableCharsList; - escapableCharsList << QLatin1String("\\") << QLatin1String("+") - << QLatin1String("-") << QLatin1String("!") << QLatin1String("(") - << QLatin1String(")") << QLatin1String(":") << QLatin1String("^") - << QLatin1String("[") << QLatin1String("]") << QLatin1String("{") - << QLatin1String("}") << QLatin1String("~"); - - // make sure we won't end up with an empty string - foreach (const QString &escapeChar, escapableCharsList) { - if (retValue.contains(escapeChar)) - retValue.replace(escapeChar, QLatin1String("")); - } - if (retValue.trimmed().isEmpty()) - return retValue; - - retValue = text; // now really escape the string... - foreach (const QString &escapeChar, escapableCharsList) { - if (retValue.contains(escapeChar)) - retValue.replace(escapeChar, escape + escapeChar); - } - return retValue; - } - QStringList buildTermList(const QString query) { bool s = false; @@ -222,8 +194,8 @@ private: } } - void nextOrPrevQuery(int maxOrMinIndex, int addend, - QToolButton *thisButton, QToolButton *otherButton) + void nextOrPrevQuery(int maxOrMinIndex, int addend, QToolButton *thisButton, + QToolButton *otherButton) { QueryHistory *queryHist; QList<QLineEdit *> lineEdits; @@ -233,7 +205,7 @@ private: } else { queryHist = &complexQueries; lineEdits << allQuery << atLeastQuery << similarQuery - << withoutQuery << exactQuery; + << withoutQuery << exactQuery; } foreach (QLineEdit *lineEdit, lineEdits) lineEdit->clear(); @@ -278,11 +250,11 @@ private: void enableOrDisableToolButtons() { - const QueryHistory &queryHist = - simpleSearch ? simpleQueries : complexQueries; + const QueryHistory &queryHist = simpleSearch ? simpleQueries + : complexQueries; prevQueryButton->setEnabled(queryHist.curQuery > 0); - nextQueryButton->setEnabled(queryHist.curQuery < - queryHist.queries.size() - 1); + nextQueryButton->setEnabled(queryHist.curQuery + < queryHist.queries.size() - 1); } private slots: @@ -306,41 +278,45 @@ private slots: QList<QHelpSearchQuery> queryList; #if !defined(QT_CLUCENE_SUPPORT) queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, - QStringList(defaultQuery->text()))); + QStringList(defaultQuery->text()))); #else if (defaultQuery->isEnabled()) { queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, - buildTermList(escapeString(defaultQuery->text())))); + buildTermList(defaultQuery->text()))); } else { const QRegExp exp(QLatin1String("\\s+")); - QStringList lst = similarQuery->text().split(exp, QString::SkipEmptyParts); + QStringList lst = similarQuery->text().split(exp, + QString::SkipEmptyParts); if (!lst.isEmpty()) { QStringList fuzzy; foreach (const QString &term, lst) - fuzzy += buildTermList(escapeString(term)); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, fuzzy)); + fuzzy += buildTermList(term); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, + fuzzy)); } lst = withoutQuery->text().split(exp, QString::SkipEmptyParts); if (!lst.isEmpty()) { QStringList without; foreach (const QString &term, lst) - without.append(escapeString(term)); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, without)); + without.append(term); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, + without)); } if (!exactQuery->text().isEmpty()) { QString phrase = exactQuery->text().remove(QLatin1Char('\"')); - phrase = escapeString(phrase.simplified()); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, QStringList(phrase))); + phrase = phrase.simplified(); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, + QStringList(phrase))); } lst = allQuery->text().split(exp, QString::SkipEmptyParts); if (!lst.isEmpty()) { QStringList all; foreach (const QString &term, lst) - all.append(escapeString(term)); + all.append(term); queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all)); } @@ -348,8 +324,9 @@ private slots: if (!lst.isEmpty()) { QStringList atLeast; foreach (const QString &term, lst) - atLeast += buildTermList(escapeString(term)); - queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, atLeast)); + atLeast += buildTermList(term); + queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, + atLeast)); } } #endif @@ -363,8 +340,9 @@ private slots: void nextQuery() { - nextOrPrevQuery((simpleSearch ? simpleQueries : complexQueries).queries.size() - 1, - 1, nextQueryButton, prevQueryButton); + nextOrPrevQuery((simpleSearch ? simpleQueries + : complexQueries).queries.size() - 1, 1, nextQueryButton, + prevQueryButton); } void prevQuery() @@ -415,8 +393,9 @@ private: \fn void QHelpSearchQueryWidget::search() This signal is emitted when a the user has the search button invoked. - After reciving the signal you can ask the QHelpSearchQueryWidget for the build list - of QHelpSearchQuery's that you may pass to the QHelpSearchEngine's search() function. + After reciving the signal you can ask the QHelpSearchQueryWidget for the + build list of QHelpSearchQuery's that you may pass to the QHelpSearchEngine's + search() function. */ /*! @@ -544,7 +523,8 @@ QList<QHelpSearchQuery> QHelpSearchQueryWidget::query() const QList<QHelpSearchQuery>() : queryHist.queries.last(); } -/*! \reimp +/*! + \reimp */ void QHelpSearchQueryWidget::focusInEvent(QFocusEvent *focusEvent) { diff --git a/tools/assistant/lib/qhelpsearchresultwidget.cpp b/tools/assistant/lib/qhelpsearchresultwidget.cpp index ad540c6..8e476d5 100644 --- a/tools/assistant/lib/qhelpsearchresultwidget.cpp +++ b/tools/assistant/lib/qhelpsearchresultwidget.cpp @@ -304,7 +304,7 @@ private: last = resultLastToShow > count ? count : resultLastToShow; } } - hitsLabel->setText(tr("%1 - %2 of %3 Hits").arg(first).arg(last).arg(count)); + hitsLabel->setText(QHelpSearchResultWidget::tr("%1 - %2 of %3 Hits").arg(first).arg(last).arg(count)); } private: diff --git a/tools/assistant/tools/assistant/aboutdialog.cpp b/tools/assistant/tools/assistant/aboutdialog.cpp index 0ab8659..26d488d 100644 --- a/tools/assistant/tools/assistant/aboutdialog.cpp +++ b/tools/assistant/tools/assistant/aboutdialog.cpp @@ -38,6 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "helpviewer.h" +#include "tracer.h" #include <QtCore/QBuffer> @@ -56,6 +58,7 @@ QT_BEGIN_NAMESPACE AboutLabel::AboutLabel(QWidget *parent) : QTextBrowser(parent) { + TRACE_OBJ setFrameStyle(QFrame::NoFrame); QPalette p; p.setColor(QPalette::Base, p.color(QPalette::Background)); @@ -64,6 +67,7 @@ AboutLabel::AboutLabel(QWidget *parent) void AboutLabel::setText(const QString &text, const QByteArray &resources) { + TRACE_OBJ QDataStream in(resources); in >> m_resourceMap; @@ -72,6 +76,7 @@ void AboutLabel::setText(const QString &text, const QByteArray &resources) QSize AboutLabel::minimumSizeHint() const { + TRACE_OBJ QTextDocument *doc = document(); doc->adjustSize(); return QSize(int(doc->size().width()), int(doc->size().height())); @@ -79,6 +84,7 @@ QSize AboutLabel::minimumSizeHint() const QVariant AboutLabel::loadResource(int type, const QUrl &name) { + TRACE_OBJ if (type == 2 || type == 3) { if (m_resourceMap.contains(name.toString())) { return m_resourceMap.value(name.toString()); @@ -89,9 +95,9 @@ QVariant AboutLabel::loadResource(int type, const QUrl &name) void AboutLabel::setSource(const QUrl &url) { - if (url.isValid() - && (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("ftp") - || url.scheme() == QLatin1String("mailto") || url.path().endsWith(QLatin1String("pdf")))) { + TRACE_OBJ + if (url.isValid() && (!HelpViewer::isLocalUrl(url) + || !HelpViewer::canOpenPage(url.path()))) { if (!QDesktopServices::openUrl(url)) { QMessageBox::warning(this, tr("Warning"), tr("Unable to launch external application.\n"), @@ -103,6 +109,7 @@ void AboutLabel::setSource(const QUrl &url) AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent, Qt::MSWindowsFixedSizeDialogHint|Qt::WindowTitleHint|Qt::WindowSystemMenuHint) { + TRACE_OBJ m_pixmapLabel = 0; m_aboutLabel = new AboutLabel(); @@ -121,12 +128,14 @@ AboutDialog::AboutDialog(QWidget *parent) void AboutDialog::setText(const QString &text, const QByteArray &resources) { + TRACE_OBJ m_aboutLabel->setText(text, resources); updateSize(); } void AboutDialog::setPixmap(const QPixmap &pixmap) { + TRACE_OBJ if (!m_pixmapLabel) { m_pixmapLabel = new QLabel(); m_layout->addWidget(m_pixmapLabel, 0, 0, 1, -1, Qt::AlignCenter); @@ -137,11 +146,13 @@ void AboutDialog::setPixmap(const QPixmap &pixmap) QString AboutDialog::documentTitle() const { + TRACE_OBJ return m_aboutLabel->documentTitle(); } void AboutDialog::updateSize() { + TRACE_OBJ QSize screenSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size(); int limit = qMin(screenSize.width()/2, 500); diff --git a/tools/assistant/tools/assistant/assistant.pro b/tools/assistant/tools/assistant/assistant.pro index 1a7e874..e62d30c 100644 --- a/tools/assistant/tools/assistant/assistant.pro +++ b/tools/assistant/tools/assistant/assistant.pro @@ -1,71 +1,79 @@ include($$QT_SOURCE_TREE/tools/shared/fontpanel/fontpanel.pri) - TEMPLATE = app LANGUAGE = C++ TARGET = assistant - -contains(QT_CONFIG, webkit) { - QT += webkit -} - -CONFIG += qt warn_on help - +contains(QT_CONFIG, webkit):QT += webkit +CONFIG += qt \ + warn_on \ + help QT += network - PROJECTNAME = Assistant DESTDIR = ../../../../bin - -target.path=$$[QT_INSTALL_BINS] +target.path = $$[QT_INSTALL_BINS] INSTALLS += target +DEPENDPATH += ../shared -### Work around a qmake issue when statically linking to -### not-yet-installed plugins +# ## Work around a qmake issue when statically linking to +# ## not-yet-installed plugins LIBS += -L$$QT_BUILD_TREE/plugins/sqldrivers +HEADERS += aboutdialog.h \ + bookmarkdialog.h \ + bookmarkfiltermodel.h \ + bookmarkitem.h \ + bookmarkmanager.h \ + bookmarkmodel.h \ + centralwidget.h \ + cmdlineparser.h \ + contentwindow.h \ + filternamedialog.h \ + helpenginewrapper.h \ + helpviewer.h \ + indexwindow.h \ + installdialog.h \ + mainwindow.h \ + preferencesdialog.h \ + qtdocinstaller.h \ + remotecontrol.h \ + searchwidget.h \ + topicchooser.h \ + tracer.h \ + xbelsupport.h \ + ../shared/collectionconfiguration.h +win32:HEADERS += remotecontrol_win.h -HEADERS += helpviewer.h \ - mainwindow.h \ - indexwindow.h \ - topicchooser.h \ - contentwindow.h \ - searchwidget.h \ - preferencesdialog.h \ - filternamedialog.h \ - centralwidget.h \ - installdialog.h \ - bookmarkmanager.h \ - remotecontrol.h \ - cmdlineparser.h \ - aboutdialog.h \ - qtdocinstaller.h - -win32 { - HEADERS += remotecontrol_win.h -} - -SOURCES += helpviewer.cpp \ - main.cpp \ - mainwindow.cpp \ - indexwindow.cpp \ - topicchooser.cpp \ - contentwindow.cpp \ - searchwidget.cpp \ - preferencesdialog.cpp \ - filternamedialog.cpp \ - centralwidget.cpp \ - installdialog.cpp \ - bookmarkmanager.cpp \ - remotecontrol.cpp \ - cmdlineparser.cpp \ - aboutdialog.cpp \ - qtdocinstaller.cpp +SOURCES += aboutdialog.cpp \ + bookmarkdialog.cpp \ + bookmarkfiltermodel.cpp \ + bookmarkitem.cpp \ + bookmarkmanager.cpp \ + bookmarkmodel.cpp \ + centralwidget.cpp \ + cmdlineparser.cpp \ + contentwindow.cpp \ + filternamedialog.cpp \ + helpenginewrapper.cpp \ + helpviewer.cpp \ + indexwindow.cpp \ + installdialog.cpp \ + main.cpp \ + mainwindow.cpp \ + preferencesdialog.cpp \ + qtdocinstaller.cpp \ + remotecontrol.cpp \ + searchwidget.cpp \ + topicchooser.cpp \ + xbelsupport.cpp \ + ../shared/collectionconfiguration.cpp \ -FORMS += topicchooser.ui \ - preferencesdialog.ui \ - filternamedialog.ui \ - installdialog.ui \ - bookmarkdialog.ui +FORMS += bookmarkdialog.ui \ + bookmarkwidget.ui \ + filternamedialog.ui \ + installdialog.ui \ + preferencesdialog.ui \ + topicchooser.ui -RESOURCES += assistant.qrc assistant_images.qrc +RESOURCES += assistant.qrc \ + assistant_images.qrc win32 { !wince*:LIBS += -lshell32 diff --git a/tools/assistant/tools/assistant/assistant.qch b/tools/assistant/tools/assistant/assistant.qch Binary files differindex 78fe9f3..e6d5299 100644 --- a/tools/assistant/tools/assistant/assistant.qch +++ b/tools/assistant/tools/assistant/assistant.qch diff --git a/tools/assistant/tools/assistant/assistant_images.qrc b/tools/assistant/tools/assistant/assistant_images.qrc index 58e03b5..34918c0 100644 --- a/tools/assistant/tools/assistant/assistant_images.qrc +++ b/tools/assistant/tools/assistant/assistant_images.qrc @@ -4,6 +4,7 @@ <file>images/assistant-128.png</file> <file>images/assistant.png</file> <file>images/wrap.png</file> + <file>images/bookmark.png</file> #mac <file>images/mac/addtab.png</file> <file>images/mac/book.png</file> diff --git a/tools/assistant/tools/assistant/bookmarkdialog.cpp b/tools/assistant/tools/assistant/bookmarkdialog.cpp new file mode 100644 index 0000000..f081c15 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkdialog.cpp @@ -0,0 +1,222 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "bookmarkdialog.h" +#include "bookmarkfiltermodel.h" +#include "bookmarkitem.h" +#include "bookmarkmodel.h" + +#include <QtGui/QKeyEvent> +#include <QtGui/QMenu> + +QT_BEGIN_NAMESPACE + +BookmarkDialog::BookmarkDialog(BookmarkModel *sourceModel, const QString &title, + const QString &url, QWidget *parent) + : QDialog(parent) + , m_url(url) + , m_title(title) + , bookmarkModel(sourceModel) +{ + TRACE_OBJ + ui.setupUi(this); + + ui.bookmarkEdit->setText(m_title); + ui.newFolderButton->setVisible(false); + ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); + + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(accepted())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(rejected())); + connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addFolder())); + connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); + connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + + bookmarkProxyModel = new BookmarkFilterModel(this); + bookmarkProxyModel->setSourceModel(bookmarkModel); + ui.bookmarkFolders->setModel(bookmarkProxyModel); + connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(int)), this, + SLOT(currentIndexChanged(int))); + + bookmarkTreeModel = new BookmarkTreeModel(this); + bookmarkTreeModel->setSourceModel(bookmarkModel); + ui.treeView->setModel(bookmarkTreeModel); + + ui.treeView->expandAll(); + ui.treeView->setVisible(false); + ui.treeView->installEventFilter(this); + ui.treeView->viewport()->installEventFilter(this); + ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); + + connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(customContextMenuRequested(QPoint))); + connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, + QModelIndex)), this, SLOT(currentIndexChanged(QModelIndex))); + + ui.bookmarkFolders->setCurrentIndex(0); + ui.treeView->setCurrentIndex(ui.treeView->indexAt(QPoint(2, 2))); +} + +BookmarkDialog::~BookmarkDialog() +{ + TRACE_OBJ +} + +bool BookmarkDialog::eventFilter(QObject *object, QEvent *event) +{ + TRACE_OBJ + if (object != ui.treeView && object != ui.treeView->viewport()) + return QWidget::eventFilter(object, event); + + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast<QKeyEvent*>(event); + switch (ke->key()) { + case Qt::Key_F2: { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(ui.treeView->currentIndex()); + bookmarkModel->setItemsEditable(false); + } break; + default: break; + } + } + + return QObject::eventFilter(object, event); +} + +void BookmarkDialog::currentIndexChanged(int row) +{ + TRACE_OBJ + QModelIndex next = bookmarkProxyModel->index(row, 0, QModelIndex()); + if (next.isValid()) { + next = bookmarkProxyModel->mapToSource(next); + ui.treeView->setCurrentIndex(bookmarkTreeModel->mapFromSource(next)); + } +} + +void BookmarkDialog::currentIndexChanged(const QModelIndex &index) +{ + TRACE_OBJ + const QModelIndex current = bookmarkTreeModel->mapToSource(index); + if (current.isValid()) { + const int row = bookmarkProxyModel->mapFromSource(current).row(); + ui.bookmarkFolders->setCurrentIndex(row); + } +} + +void BookmarkDialog::accepted() +{ + TRACE_OBJ + QModelIndex index = ui.treeView->currentIndex(); + if (index.isValid()) { + index = bookmarkModel->addItem(bookmarkTreeModel->mapToSource(index)); + if (BookmarkItem *item = bookmarkModel->itemFromIndex(index)) + item->setData(DataVector() << m_title << m_url << false); + } else + rejected(); + + accept(); +} + +void BookmarkDialog::rejected() +{ + TRACE_OBJ + foreach (const QPersistentModelIndex &index, cache) + bookmarkModel->removeItem(index); + reject(); +} + +void BookmarkDialog::addFolder() +{ + TRACE_OBJ + QModelIndex index = ui.treeView->currentIndex(); + if (index.isValid()) { + index = bookmarkModel->addItem(bookmarkTreeModel->mapToSource(index), + true); + cache.append(index); + + index = bookmarkTreeModel->mapFromSource(index); + if (index.isValid()) { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(index); + ui.treeView->expand(index); + ui.treeView->setCurrentIndex(index); + bookmarkModel->setItemsEditable(false); + } + } +} + +void BookmarkDialog::toolButtonClicked() +{ + TRACE_OBJ + const bool visible = !ui.treeView->isVisible(); + ui.treeView->setVisible(visible); + ui.newFolderButton->setVisible(visible); + + if (visible) { + resize(QSize(width(), 400)); + ui.toolButton->setText(QLatin1String("-")); + } else { + resize(width(), minimumHeight()); + ui.toolButton->setText(QLatin1String("+")); + } +} + +void BookmarkDialog::textChanged(const QString& text) +{ + m_title = text; +} + +void BookmarkDialog::customContextMenuRequested(const QPoint &point) +{ + TRACE_OBJ + QMenu menu(QLatin1String(""), this); + QAction *renameItem = menu.addAction(tr("Rename Folder")); + + QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); + if (picked == renameItem) { + bookmarkModel->setItemsEditable(true); + ui.treeView->edit(ui.treeView->currentIndex()); + bookmarkModel->setItemsEditable(false); + } +} + +QT_END_NAMESPACE diff --git a/tools/assistant/compat/helpwindow.h b/tools/assistant/tools/assistant/bookmarkdialog.h index c20a21f..ba38c7a 100644 --- a/tools/assistant/compat/helpwindow.h +++ b/tools/assistant/tools/assistant/bookmarkdialog.h @@ -38,63 +38,51 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#ifndef BOOKMARKDIALOG_H +#define BOOKMARKDIALOG_H -#ifndef HELPWINDOW_H -#define HELPWINDOW_H - -#include <QTextBrowser> +#include "ui_bookmarkdialog.h" QT_BEGIN_NAMESPACE -class MainWindow; -class QKeyEvent; -class QMime; -class QMouseEvent; -class QMenu; +class BookmarkModel; +class BookmarkFilterModel; +class BookmarkTreeModel; -class HelpWindow : public QTextBrowser +class BookmarkDialog : public QDialog { Q_OBJECT public: - HelpWindow( MainWindow *m, QWidget *parent = 0); - void setSource( const QUrl &name ); - void blockScrolling( bool b ); - void openLinkInNewWindow( const QString &link ); - void openLinkInNewPage( const QString &link ); - void addMimePath( const QString &path ); - - void mousePressEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *); - -signals: - void chooseWebBrowser(); - void choosePDFReader(); + BookmarkDialog(BookmarkModel *bookmarkModel, const QString &title, + const QString &url, QWidget *parent = 0); + ~BookmarkDialog(); -protected: - virtual void contextMenuEvent(QContextMenuEvent *e); - virtual void mouseReleaseEvent(QMouseEvent *e); - -protected slots: - void ensureCursorVisible(); +private: + bool eventFilter(QObject *object, QEvent *event); private slots: - void openLinkInNewWindow(); - void openLinkInNewPage(); + void currentIndexChanged(int index); + void currentIndexChanged(const QModelIndex &index); + + void accepted(); + void rejected(); - bool isKDERunning() const; + void addFolder(); + void toolButtonClicked(); + void textChanged(const QString& text); + void customContextMenuRequested(const QPoint &point); private: - bool hasAnchorAt(const QPoint& pos); + QString m_url; + QString m_title; + Ui::BookmarkDialog ui; + QList<QPersistentModelIndex> cache; - MainWindow *mw; - QString lastAnchor; - bool blockScroll; - bool shiftPressed; - bool newWindow; - bool fwdAvail; - bool backAvail; + BookmarkModel *bookmarkModel; + BookmarkTreeModel *bookmarkTreeModel; + BookmarkFilterModel *bookmarkProxyModel; }; QT_END_NAMESPACE -#endif // HELPWINDOW_H +#endif // BOOKMARKDIALOG_H diff --git a/tools/assistant/tools/assistant/bookmarkdialog.ui b/tools/assistant/tools/assistant/bookmarkdialog.ui index 7a878f9..5131531 100644 --- a/tools/assistant/tools/assistant/bookmarkdialog.ui +++ b/tools/assistant/tools/assistant/bookmarkdialog.ui @@ -1,38 +1,39 @@ -<ui version="4.0" > +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> <class>BookmarkDialog</class> - <widget class="QDialog" name="BookmarkDialog" > - <property name="geometry" > + <widget class="QDialog" name="BookmarkDialog"> + <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>450</width> - <height>135</height> + <height>133</height> </rect> </property> - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="windowTitle" > + <property name="windowTitle"> <string>Add Bookmark</string> </property> - <layout class="QVBoxLayout" name="verticalLayout_3" > + <layout class="QVBoxLayout" name="verticalLayout_3"> <item> - <layout class="QHBoxLayout" name="horizontalLayout" > + <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <layout class="QVBoxLayout" name="verticalLayout_2" > + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="QLabel" name="label" > - <property name="text" > + <widget class="QLabel" name="label"> + <property name="text"> <string>Bookmark:</string> </property> </widget> </item> <item> - <widget class="QLabel" name="label_2" > - <property name="text" > + <widget class="QLabel" name="label_2"> + <property name="text"> <string>Add in Folder:</string> </property> </widget> @@ -40,35 +41,35 @@ </layout> </item> <item> - <layout class="QVBoxLayout" name="verticalLayout" > + <layout class="QVBoxLayout" name="verticalLayout"> <item> - <widget class="QLineEdit" name="bookmarkEdit" /> + <widget class="QLineEdit" name="bookmarkEdit"/> </item> <item> - <widget class="QComboBox" name="bookmarkFolders" /> + <widget class="QComboBox" name="bookmarkFolders"/> </item> </layout> </item> </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_3" > + <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> - <widget class="QToolButton" name="toolButton" > - <property name="minimumSize" > + <widget class="QToolButton" name="toolButton"> + <property name="minimumSize"> <size> <width>25</width> <height>20</height> </size> </property> - <property name="text" > + <property name="text"> <string>+</string> </property> </widget> </item> <item> - <widget class="Line" name="line" > - <property name="orientation" > + <widget class="Line" name="line"> + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> </widget> @@ -76,30 +77,39 @@ </layout> </item> <item> - <widget class="QTreeView" name="treeView" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Ignored" hsizetype="Expanding" > + <widget class="QTreeView" name="treeView"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Ignored"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="uniformRowHeights"> + <bool>true</bool> + </property> + <property name="allColumnsShowFocus"> + <bool>true</bool> + </property> + <property name="headerHidden"> + <bool>true</bool> + </property> </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_4" > + <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <widget class="QPushButton" name="newFolderButton" > - <property name="text" > + <widget class="QPushButton" name="newFolderButton"> + <property name="text"> <string>New Folder</string> </property> </widget> </item> <item> - <widget class="QDialogButtonBox" name="buttonBox" > - <property name="orientation" > + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="standardButtons" > + <property name="standardButtons"> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property> </widget> @@ -116,11 +126,11 @@ <receiver>BookmarkDialog</receiver> <slot>accept()</slot> <hints> - <hint type="sourcelabel" > + <hint type="sourcelabel"> <x>248</x> <y>254</y> </hint> - <hint type="destinationlabel" > + <hint type="destinationlabel"> <x>157</x> <y>274</y> </hint> @@ -132,11 +142,11 @@ <receiver>BookmarkDialog</receiver> <slot>reject()</slot> <hints> - <hint type="sourcelabel" > + <hint type="sourcelabel"> <x>316</x> <y>260</y> </hint> - <hint type="destinationlabel" > + <hint type="destinationlabel"> <x>286</x> <y>274</y> </hint> diff --git a/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp b/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp new file mode 100644 index 0000000..5874493 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkfiltermodel.cpp @@ -0,0 +1,322 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bookmarkfiltermodel.h" + +#include "bookmarkitem.h" +#include "bookmarkmodel.h" + +BookmarkFilterModel::BookmarkFilterModel(QObject *parent) + : QAbstractProxyModel(parent) + , hideBookmarks(true) + , sourceModel(0) +{ +} + +void +BookmarkFilterModel::setSourceModel(QAbstractItemModel *_sourceModel) +{ + beginResetModel(); + + QAbstractProxyModel::setSourceModel(sourceModel); + sourceModel = qobject_cast<BookmarkModel*> (_sourceModel); + + connect(sourceModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + SLOT(changed(QModelIndex, QModelIndex))); + + connect(sourceModel, SIGNAL(rowsInserted(QModelIndex, int, int)), + this, SLOT(rowsInserted(QModelIndex, int, int))); + + connect(sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), + this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int))); + connect(sourceModel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, + SLOT(rowsRemoved(QModelIndex, int, int))); + + connect(sourceModel, SIGNAL(layoutAboutToBeChanged()), this, + SLOT(layoutAboutToBeChanged())); + connect(sourceModel, SIGNAL(layoutChanged()), this, + SLOT(layoutChanged())); + + connect(sourceModel, SIGNAL(modelAboutToBeReset()), this, + SLOT(modelAboutToBeReset())); + connect(sourceModel, SIGNAL(modelReset()), this, SLOT(modelReset())); + + if (sourceModel) + setupCache(sourceModel->index(0, 0, QModelIndex())); + + endResetModel(); +} + +int +BookmarkFilterModel::rowCount(const QModelIndex &index) const +{ + Q_UNUSED(index) + return cache.count(); +} + +int +BookmarkFilterModel::columnCount(const QModelIndex &index) const +{ + Q_UNUSED(index) + if (sourceModel) + return sourceModel->columnCount(); + return 0; +} + +QModelIndex +BookmarkFilterModel::mapToSource(const QModelIndex &proxyIndex) const +{ + const int row = proxyIndex.row(); + if (proxyIndex.isValid() && row >= 0 && row < cache.count()) + return cache[row]; + return QModelIndex(); +} + +QModelIndex +BookmarkFilterModel::mapFromSource(const QModelIndex &sourceIndex) const +{ + return index(cache.indexOf(sourceIndex), 0, QModelIndex()); +} + +QModelIndex +BookmarkFilterModel::parent(const QModelIndex &child) const +{ + Q_UNUSED(child) + return QModelIndex(); +} + +QModelIndex +BookmarkFilterModel::index(int row, int column, const QModelIndex &index) const +{ + Q_UNUSED(index) + if (row < 0 || column < 0 || cache.count() <= row + || !sourceModel || sourceModel->columnCount() <= column) { + return QModelIndex(); + } + return createIndex(row, 0); +} + +Qt::DropActions +BookmarkFilterModel::supportedDropActions () const +{ + if (sourceModel) + return sourceModel->supportedDropActions(); + return Qt::IgnoreAction; +} + +Qt::ItemFlags +BookmarkFilterModel::flags(const QModelIndex &index) const +{ + if (sourceModel) + return sourceModel->flags(index); + return Qt::NoItemFlags; +} + +QVariant +BookmarkFilterModel::data(const QModelIndex &index, int role) const +{ + if (sourceModel) + return sourceModel->data(mapToSource(index), role); + return QVariant(); +} + +bool +BookmarkFilterModel::setData(const QModelIndex &index, const QVariant &value, + int role) +{ + if (sourceModel) + return sourceModel->setData(mapToSource(index), value, role); + return false; +} + +void +BookmarkFilterModel::filterBookmarks() +{ + if (sourceModel) { + beginResetModel(); + hideBookmarks = true; + setupCache(sourceModel->index(0, 0, QModelIndex())); + endResetModel(); + } +} + +void +BookmarkFilterModel::filterBookmarkFolders() +{ + if (sourceModel) { + beginResetModel(); + hideBookmarks = false; + setupCache(sourceModel->index(0, 0, QModelIndex())); + endResetModel(); + } +} + +void +BookmarkFilterModel::changed(const QModelIndex &topLeft, + const QModelIndex &bottomRight) +{ + emit dataChanged(mapFromSource(topLeft), mapFromSource(bottomRight)); +} + +void +BookmarkFilterModel::rowsInserted(const QModelIndex &parent, int start, int end) +{ + if (!sourceModel) + return; + + QModelIndex cachePrevious = parent; + if (BookmarkItem *parentItem = sourceModel->itemFromIndex(parent)) { + BookmarkItem *newItem = parentItem->child(start); + + // iterate over tree hirarchie to find the previous folder + for (int i = 0; i < parentItem->childCount(); ++i) { + if (BookmarkItem *child = parentItem->child(i)) { + const QModelIndex &tmp = sourceModel->indexFromItem(child); + if (tmp.data(UserRoleFolder).toBool() && child != newItem) + cachePrevious = tmp; + } + } + + const QModelIndex &newIndex = sourceModel->indexFromItem(newItem); + const bool isFolder = newIndex.data(UserRoleFolder).toBool(); + if ((isFolder && hideBookmarks) || (!isFolder && !hideBookmarks)) { + beginInsertRows(mapFromSource(parent), start, end); + cache.insert(cache.indexOf(cachePrevious) + 1, newIndex); + endInsertRows(); + } + } +} + +void +BookmarkFilterModel::rowsAboutToBeRemoved(const QModelIndex &parent, int start, + int end) +{ + if (!sourceModel) + return; + + if (BookmarkItem *parentItem = sourceModel->itemFromIndex(parent)) { + if (BookmarkItem *child = parentItem->child(start)) { + indexToRemove = sourceModel->indexFromItem(child); + if (cache.contains(indexToRemove)) + beginRemoveRows(mapFromSource(parent), start, end); + } + } +} + +void +BookmarkFilterModel::rowsRemoved(const QModelIndex &/*parent*/, int, int) +{ + if (cache.contains(indexToRemove)) { + cache.removeAll(indexToRemove); + endRemoveRows(); + } +} + +void +BookmarkFilterModel::layoutAboutToBeChanged() +{ + // TODO: ??? +} + +void +BookmarkFilterModel::layoutChanged() +{ + // TODO: ??? +} + +void +BookmarkFilterModel::modelAboutToBeReset() +{ + beginResetModel(); +} + +void +BookmarkFilterModel::modelReset() +{ + if (sourceModel) + setupCache(sourceModel->index(0, 0, QModelIndex())); + endResetModel(); +} + +void +BookmarkFilterModel::setupCache(const QModelIndex &parent) +{ + cache.clear(); + collectItems(parent); +} + +void +BookmarkFilterModel::collectItems(const QModelIndex &parent) +{ + if (parent.isValid()) { + bool isFolder = sourceModel->data(parent, UserRoleFolder).toBool(); + if ((isFolder && hideBookmarks) || (!isFolder && !hideBookmarks)) + cache.append(parent); + + if (sourceModel->hasChildren(parent)) { + for (int i = 0; i < sourceModel->rowCount(parent); ++i) + collectItems(sourceModel->index(i, 0, parent)); + } + } +} + +// -- BookmarkTreeModel + +BookmarkTreeModel::BookmarkTreeModel(QObject *parent) + : QSortFilterProxyModel(parent) +{ +} + +int +BookmarkTreeModel::columnCount(const QModelIndex &parent) const +{ + return qMin(1, QSortFilterProxyModel::columnCount(parent)); +} + +bool +BookmarkTreeModel::filterAcceptsRow(int row, const QModelIndex &parent) const +{ + Q_UNUSED(row) + BookmarkModel *model = qobject_cast<BookmarkModel*> (sourceModel()); + if (model->rowCount(parent) > 0 + && model->data(model->index(row, 0, parent), UserRoleFolder).toBool()) + return true; + return false; +}
\ No newline at end of file diff --git a/tools/assistant/tools/assistant/bookmarkfiltermodel.h b/tools/assistant/tools/assistant/bookmarkfiltermodel.h new file mode 100644 index 0000000..4ea7ab9 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkfiltermodel.h @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKFILTERMODEL_H +#define BOOKMARKFILTERMODEL_H + +#include <QtCore/QPersistentModelIndex> + +#include <QtGui/QAbstractProxyModel> +#include <QtGui/QSortFilterProxyModel> + +QT_BEGIN_NAMESPACE + +class BookmarkItem; +class BookmarkModel; + +typedef QList<QPersistentModelIndex> PersistentModelIndexCache; + +class BookmarkFilterModel : public QAbstractProxyModel +{ + Q_OBJECT +public: + explicit BookmarkFilterModel(QObject *parent = 0); + + void setSourceModel(QAbstractItemModel *sourceModel); + + int rowCount(const QModelIndex &index) const; + int columnCount(const QModelIndex &index) const; + + QModelIndex mapToSource(const QModelIndex &proxyIndex) const; + QModelIndex mapFromSource(const QModelIndex &sourceIndex) const; + + QModelIndex parent(const QModelIndex &child) const; + QModelIndex index(int row, int column, const QModelIndex &parent) const; + + Qt::DropActions supportedDropActions () const; + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant data(const QModelIndex &index, int role) const; + bool setData(const QModelIndex &index, const QVariant &value, int role); + + void filterBookmarks(); + void filterBookmarkFolders(); + +private slots: + void changed(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void rowsInserted(const QModelIndex &parent, int start, int end); + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + void rowsRemoved(const QModelIndex &parent, int start, int end); + void layoutAboutToBeChanged(); + void layoutChanged(); + void modelAboutToBeReset(); + void modelReset(); + +private: + void setupCache(const QModelIndex &parent); + void collectItems(const QModelIndex &parent); + +private: + bool hideBookmarks; + BookmarkModel *sourceModel; + PersistentModelIndexCache cache; + QPersistentModelIndex indexToRemove; +}; + +// -- BookmarkTreeModel + +class BookmarkTreeModel : public QSortFilterProxyModel +{ + Q_OBJECT +public: + BookmarkTreeModel(QObject *parent = 0); + int columnCount(const QModelIndex &parent = QModelIndex()) const; + +protected: + bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKFILTERMODEL_H diff --git a/tools/assistant/tools/assistant/bookmarkitem.cpp b/tools/assistant/tools/assistant/bookmarkitem.cpp new file mode 100644 index 0000000..8036959 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkitem.cpp @@ -0,0 +1,174 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "bookmarkitem.h" + +#include <QtCore/QDebug> + +QT_BEGIN_NAMESPACE + +BookmarkItem::BookmarkItem(const DataVector &data, BookmarkItem *parent) + : m_data(data) + , m_parent(parent) +{ +} + +BookmarkItem::~BookmarkItem() +{ + qDeleteAll(m_children); +} + +BookmarkItem* +BookmarkItem::parent() const +{ + return m_parent; +} + +void +BookmarkItem::setParent(BookmarkItem *parent) +{ + m_parent = parent; +} + +void +BookmarkItem::addChild(BookmarkItem *child) +{ + child->setParent(this); + m_children.append(child); +} + +BookmarkItem* +BookmarkItem::child(int number) const +{ + if (number >= 0 && number < m_children.count()) + return m_children[number]; + return 0; +} + +int BookmarkItem::childCount() const +{ + return m_children.count(); +} + +int BookmarkItem::childNumber() const +{ + if (m_parent) + return m_parent->m_children.indexOf(const_cast<BookmarkItem*>(this)); + return 0; +} + +QVariant +BookmarkItem::data(int column) const +{ + if (column == 0) + return m_data[0]; + + if (column == 1 || column == UserRoleUrl) + return m_data[1]; + + if (column == UserRoleFolder) + return m_data[1].toString() == QLatin1String("Folder"); + + if (column == UserRoleExpanded) + return m_data[2]; + + return QVariant(); +} + +void +BookmarkItem::setData(const DataVector &data) +{ + m_data = data; +} + +bool +BookmarkItem::setData(int column, const QVariant &newValue) +{ + int index = -1; + if (column == 0 || column == 1) + index = column; + + if (column == UserRoleUrl || column == UserRoleFolder) + index = 1; + + if (column == UserRoleExpanded) + index = 2; + + if (index < 0) + return false; + + m_data[index] = newValue; + return true; +} + +bool +BookmarkItem::insertChildren(bool isFolder, int position, int count) +{ + if (position < 0 || position > m_children.size()) + return false; + + for (int row = 0; row < count; ++row) { + m_children.insert(position, new BookmarkItem(DataVector() + << QObject::tr(isFolder ? "New Folder" : "Untitled") + << (isFolder ? "Folder" : "about:blank") << false, this)); + } + + return true; +} + +bool +BookmarkItem::removeChildren(int position, int count) +{ + if (position < 0 || position > m_children.size()) + return false; + + for (int row = 0; row < count; ++row) + delete m_children.takeAt(position); + + return true; +} + +void +BookmarkItem::dumpTree(int indent) const +{ + const QString tree(indent, ' '); + qDebug() << tree + (data(UserRoleFolder).toBool() ? "Folder" : "Bookmark") + << "Label:" << data(0).toString() << "parent:" << m_parent << "this:" + << this; + + foreach (BookmarkItem *item, m_children) + item->dumpTree(indent + 4); +} + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/bookmarkitem.h b/tools/assistant/tools/assistant/bookmarkitem.h new file mode 100644 index 0000000..7acaf86 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkitem.h @@ -0,0 +1,83 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKITEM_H +#define BOOKMARKITEM_H + +#include <QtCore/QVariant> +#include <QtCore/QVector> + +QT_BEGIN_NAMESPACE + +enum { + UserRoleUrl = Qt::UserRole + 50, + UserRoleFolder = Qt::UserRole + 100, + UserRoleExpanded = Qt::UserRole + 150 +}; + +typedef QVector<QVariant> DataVector; + +class BookmarkItem +{ +public: + BookmarkItem(const DataVector &data, BookmarkItem *parent = 0); + ~BookmarkItem(); + + BookmarkItem *parent() const; + void setParent(BookmarkItem *parent); + + void addChild(BookmarkItem *child); + BookmarkItem *child(int number) const; + + int childCount() const; + int childNumber() const; + + QVariant data(int column) const; + void setData(const DataVector &data); + bool setData(int column, const QVariant &value); + + bool insertChildren(bool isFolder, int position, int count); + bool removeChildren(int position, int count); + + void dumpTree(int indent) const; + +private: + DataVector m_data; + + BookmarkItem *m_parent; + QList<BookmarkItem*> m_children; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKITEM_H diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 0ce1b9d..8fba811 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -38,549 +38,210 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "bookmarkmanager.h" +#include "bookmarkdialog.h" +#include "bookmarkfiltermodel.h" +#include "bookmarkitem.h" +#include "bookmarkmodel.h" #include "centralwidget.h" +#include "helpenginewrapper.h" +#include <QtGui/QFileDialog> #include <QtGui/QMenu> -#include <QtGui/QIcon> -#include <QtGui/QStyle> -#include <QtGui/QLabel> -#include <QtGui/QLayout> -#include <QtCore/QEvent> -#include <QtGui/QComboBox> #include <QtGui/QKeyEvent> -#include <QtGui/QLineEdit> #include <QtGui/QMessageBox> -#include <QtGui/QHeaderView> -#include <QtGui/QToolButton> -#include <QtGui/QPushButton> -#include <QtGui/QApplication> -#include <QtHelp/QHelpEngineCore> -#include <QtGui/QDialogButtonBox> #include <QtGui/QSortFilterProxyModel> -QT_BEGIN_NAMESPACE - -BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, - const QString &url, QWidget *parent) - : QDialog(parent) - , m_url(url) - , m_title(title) - , bookmarkManager(manager) -{ - ui.setupUi(this); - - installEventFilter(this); - ui.treeView->installEventFilter(this); - ui.treeView->viewport()->installEventFilter(this); - - ui.bookmarkEdit->setText(title); - ui.newFolderButton->setVisible(false); - ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - - proxyModel = new QSortFilterProxyModel(this); - proxyModel->setFilterKeyColumn(0); - proxyModel->setDynamicSortFilter(true); - proxyModel->setFilterRole(Qt::UserRole + 10); - proxyModel->setSourceModel(bookmarkManager->treeBookmarkModel()); - proxyModel->setFilterRegExp(QRegExp(QLatin1String("Folder"), - Qt::CaseSensitive, QRegExp::FixedString)); - ui.treeView->setModel(proxyModel); - - ui.treeView->expandAll(); - ui.treeView->setVisible(false); - ui.treeView->header()->setVisible(false); - ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu); - - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(addAccepted())); - connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addNewFolder())); - connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); - connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, - SLOT(textChanged(QString))); - - connect(bookmarkManager->treeBookmarkModel(), - SIGNAL(itemChanged(QStandardItem*)), - this, SLOT(itemChanged(QStandardItem*))); - - connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(QString)), this, - SLOT(selectBookmarkFolder(QString))); - - connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(customContextMenuRequested(QPoint))); - - connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, - QModelIndex)), this, SLOT(currentChanged(QModelIndex))); -} - -BookmarkDialog::~BookmarkDialog() -{ -} - -void BookmarkDialog::addAccepted() -{ - QItemSelectionModel *model = ui.treeView->selectionModel(); - const QModelIndexList &list = model->selection().indexes(); +#include <QFile> +#include "xbelsupport.h" - QModelIndex index; - if (!list.isEmpty()) - index = proxyModel->mapToSource(list.at(0)); +QT_BEGIN_NAMESPACE - bookmarkManager->addNewBookmark(index, ui.bookmarkEdit->text(), m_url); - accept(); -} +// -- BookmarkManager::BookmarkWidget -void BookmarkDialog::addNewFolder() +void BookmarkManager::BookmarkWidget::focusInEvent(QFocusEvent *event) { - QItemSelectionModel *model = ui.treeView->selectionModel(); - const QModelIndexList &list = model->selection().indexes(); + TRACE_OBJ + if (event->reason() != Qt::MouseFocusReason) { + ui.lineEdit->selectAll(); + ui.lineEdit->setFocus(); - QModelIndex index; - if (!list.isEmpty()) - index = list.at(0); - - QModelIndex newFolder = - bookmarkManager->addNewFolder(proxyModel->mapToSource(index)); - if (newFolder.isValid()) { - ui.treeView->expand(index); - const QModelIndex &index = proxyModel->mapFromSource(newFolder); - model->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect); - - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - - const QString &name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); + // force the focus in event on bookmark manager + emit focusInEvent(); } - ui.treeView->setFocus(); } -void BookmarkDialog::toolButtonClicked() -{ - bool visible = !ui.treeView->isVisible(); - ui.treeView->setVisible(visible); - ui.newFolderButton->setVisible(visible); - - if (visible) { - resize(QSize(width(), 400)); - ui.toolButton->setText(QLatin1String("-")); - } else { - resize(width(), minimumHeight()); - ui.toolButton->setText(QLatin1String("+")); - } -} +// -- BookmarkManager::BookmarkTreeView -void BookmarkDialog::itemChanged(QStandardItem *item) +BookmarkManager::BookmarkTreeView::BookmarkTreeView(QWidget *parent) + : QTreeView(parent) { - if (renameItem != item) { - renameItem = item; - oldText = item->text(); - return; - } + TRACE_OBJ + setAcceptDrops(true); + setDragEnabled(true); + setAutoExpandDelay(1000); + setUniformRowHeights(true); + setDropIndicatorShown(true); + setExpandsOnDoubleClick(true); - if (item->text() != oldText) { - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); + connect(this, SIGNAL(expanded(QModelIndex)), this, + SLOT(setExpandedData(QModelIndex))); + connect(this, SIGNAL(collapsed(QModelIndex)), this, + SLOT(setExpandedData(QModelIndex))); - QString name = tr("Bookmarks"); - const QModelIndex &index = ui.treeView->currentIndex(); - if (index.isValid()) - name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); - } } -void BookmarkDialog::textChanged(const QString &string) +void BookmarkManager::BookmarkTreeView::subclassKeyPressEvent(QKeyEvent *event) { - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!string.isEmpty()); + TRACE_OBJ + QTreeView::keyPressEvent(event); } -void BookmarkDialog::selectBookmarkFolder(const QString &folderName) +void BookmarkManager::BookmarkTreeView::setExpandedData(const QModelIndex &index) { - if (folderName.isEmpty()) - return; - - if (folderName == tr("Bookmarks")) { - ui.treeView->clearSelection(); - return; - } - - QStandardItemModel *model = bookmarkManager->treeBookmarkModel(); - QList<QStandardItem*> list = model->findItems(folderName, - Qt::MatchCaseSensitive | Qt::MatchRecursive, 0); - if (!list.isEmpty()) { - const QModelIndex &index = model->indexFromItem(list.at(0)); - QItemSelectionModel *model = ui.treeView->selectionModel(); - if (model) { - model->setCurrentIndex(proxyModel->mapFromSource(index), - QItemSelectionModel::ClearAndSelect); - } - } + TRACE_OBJ + if (BookmarkModel *treeModel = qobject_cast<BookmarkModel*> (model())) + treeModel->setData(index, isExpanded(index), UserRoleExpanded); } -void BookmarkDialog::customContextMenuRequested(const QPoint &point) -{ - QModelIndex index = ui.treeView->indexAt(point); - if (!index.isValid()) - return; +// -- BookmarkManager - QMenu menu(QLatin1String(""), this); +QMutex BookmarkManager::mutex; +BookmarkManager* BookmarkManager::bookmarkManager = 0; - QAction *removeItem = menu.addAction(tr("Delete Folder")); - QAction *renameItem = menu.addAction(tr("Rename Folder")); +// -- public - QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); - if (!picked) - return; - - const QModelIndex &proxyIndex = proxyModel->mapToSource(index); - if (picked == removeItem) { - bookmarkManager->removeBookmarkItem(ui.treeView, proxyIndex); - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - - QString name = tr("Bookmarks"); - index = ui.treeView->currentIndex(); - if (index.isValid()) - name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); - } - else if (picked == renameItem) { - BookmarkModel *model = bookmarkManager->treeBookmarkModel(); - if (QStandardItem *item = model->itemFromIndex(proxyIndex)) { - item->setEditable(true); - ui.treeView->edit(index); - item->setEditable(false); - } - } -} - -void BookmarkDialog::currentChanged(const QModelIndex ¤t) -{ - QString text = tr("Bookmarks"); - if (current.isValid()) - text = current.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(text)); -} - -bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) +BookmarkManager* BookmarkManager::instance() { - if (object != ui.treeView && object != ui.treeView->viewport()) - return QWidget::eventFilter(object, e); - - if (e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); - switch (ke->key()) { - case Qt::Key_F2: { - const QModelIndex &index = ui.treeView->currentIndex(); - const QModelIndex &source = proxyModel->mapToSource(index); - QStandardItem *item = - bookmarkManager->treeBookmarkModel()->itemFromIndex(source); - if (item) { - item->setEditable(true); - ui.treeView->edit(index); - item->setEditable(false); - } - } break; - - case Qt::Key_Delete: { - const QModelIndex &index = ui.treeView->currentIndex(); - bookmarkManager->removeBookmarkItem(ui.treeView, - proxyModel->mapToSource(index)); - ui.bookmarkFolders->clear(); - ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); - - QString name = tr("Bookmarks"); - if (index.isValid()) - name = index.data().toString(); - ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); - } break; - - default: - break; - } + TRACE_OBJ + if (!bookmarkManager) { + QMutexLocker _(&mutex); + if (!bookmarkManager) + bookmarkManager = new BookmarkManager(); } - - return QObject::eventFilter(object, e); + return bookmarkManager; } - -// #pragma mark -- BookmarkWidget - - -BookmarkWidget::BookmarkWidget(BookmarkManager *manager, QWidget *parent, - bool showButtons) - : QWidget(parent) - , addButton(0) - , removeButton(0) - , bookmarkManager(manager) +void BookmarkManager::destroy() { - setup(showButtons); - - installEventFilter(this); - treeView->installEventFilter(this); - treeView->viewport()->installEventFilter(this); + TRACE_OBJ + delete bookmarkManager; + bookmarkManager = 0; } -BookmarkWidget::~BookmarkWidget() +QWidget* BookmarkManager::bookmarkDockWidget() const { + TRACE_OBJ + if (bookmarkWidget) + return bookmarkWidget; + return 0; } -void BookmarkWidget::removeClicked() +void BookmarkManager::takeBookmarksMenu(QMenu* menu) { - const QModelIndex &index = treeView->currentIndex(); - if (searchField->text().isEmpty()) { - bookmarkManager->removeBookmarkItem(treeView, - filterBookmarkModel->mapToSource(index)); - } + TRACE_OBJ + bookmarkMenu = menu; + refeshBookmarkMenu(); } -void BookmarkWidget::filterChanged() -{ - bool searchBookmarks = searchField->text().isEmpty(); - if (!searchBookmarks) { - regExp.setPattern(searchField->text()); - filterBookmarkModel->setSourceModel(bookmarkManager->listBookmarkModel()); - } else { - regExp.setPattern(QLatin1String("")); - filterBookmarkModel->setSourceModel(bookmarkManager->treeBookmarkModel()); - } +// -- public slots - if (addButton) - addButton->setEnabled(searchBookmarks); - - if (removeButton) - removeButton->setEnabled(searchBookmarks); - - filterBookmarkModel->setFilterRegExp(regExp); - - const QModelIndex &index = treeView->indexAt(QPoint(1, 1)); - if (index.isValid()) - treeView->setCurrentIndex(index); - - if (searchBookmarks) - expandItems(); -} - -void BookmarkWidget::expand(const QModelIndex &index) +void BookmarkManager::addBookmark(const QString &title, const QString &url) { - const QModelIndex &source = filterBookmarkModel->mapToSource(index); - QStandardItem *item = - bookmarkManager->treeBookmarkModel()->itemFromIndex(source); - if (item) - item->setData(treeView->isExpanded(index), Qt::UserRole + 11); + TRACE_OBJ + showBookmarkDialog(title.isEmpty() ? tr("Untiled") : title, + url.isEmpty() ? QLatin1String("about:blank") : url); } -void BookmarkWidget::activated(const QModelIndex &index) -{ - if (!index.isValid()) - return; +// -- private - QString data = index.data(Qt::UserRole + 10).toString(); - if (data != QLatin1String("Folder")) - emit requestShowLink(data); -} - -void BookmarkWidget::customContextMenuRequested(const QPoint &point) +BookmarkManager::BookmarkManager() + : typeAndSearch(false) + , bookmarkMenu(0) + , bookmarkModel(new BookmarkModel) + , bookmarkWidget(new BookmarkWidget) + , bookmarkTreeView(new BookmarkTreeView) { - QModelIndex index = treeView->indexAt(point); - if (!index.isValid()) - return; + TRACE_OBJ + bookmarkWidget->installEventFilter(this); + connect(bookmarkWidget->ui.add, SIGNAL(clicked()), this, + SLOT(addBookmark())); + connect(bookmarkWidget->ui.remove, SIGNAL(clicked()), this, + SLOT(removeBookmark())); + connect(bookmarkWidget->ui.lineEdit, SIGNAL(textChanged(QString)), this, + SLOT(textChanged(QString))); + connect(bookmarkWidget, SIGNAL(focusInEvent()), this, SLOT(focusInEvent())); - QAction *showItem = 0; - QAction *removeItem = 0; - QAction *renameItem = 0; - QAction *showItemNewTab = 0; - - QMenu menu(QLatin1String(""), this); - QString data = index.data(Qt::UserRole + 10).toString(); - if (data == QLatin1String("Folder")) { - removeItem = menu.addAction(tr("Delete Folder")); - renameItem = menu.addAction(tr("Rename Folder")); - } else { - showItem = menu.addAction(tr("Show Bookmark")); - showItemNewTab = menu.addAction(tr("Show Bookmark in New Tab")); - if (searchField->text().isEmpty()) { - menu.addSeparator(); - removeItem = menu.addAction(tr("Delete Bookmark")); - renameItem = menu.addAction(tr("Rename Bookmark")); - } - } + bookmarkTreeView->setModel(bookmarkModel); + bookmarkTreeView->installEventFilter(this); + bookmarkTreeView->viewport()->installEventFilter(this); + bookmarkTreeView->setContextMenuPolicy(Qt::CustomContextMenu); + bookmarkWidget->ui.stackedWidget->addWidget(bookmarkTreeView); - QAction *pickedAction = menu.exec(treeView->mapToGlobal(point)); - if (!pickedAction) - return; + connect(bookmarkTreeView, SIGNAL(activated(QModelIndex)), this, + SLOT(setSourceFromIndex(QModelIndex))); + connect(bookmarkTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, + SLOT(customContextMenuRequested(QPoint))); - if (pickedAction == showItem) { - emit requestShowLink(data); - } - else if (pickedAction == showItemNewTab) { - CentralWidget::instance()->setSourceInNewTab(data); - } - else if (pickedAction == removeItem) { - bookmarkManager->removeBookmarkItem(treeView, - filterBookmarkModel->mapToSource(index)); - } - else if (pickedAction == renameItem) { - const QModelIndex &source = filterBookmarkModel->mapToSource(index); - QStandardItem *item = - bookmarkManager->treeBookmarkModel()->itemFromIndex(source); - if (item) { - item->setEditable(true); - treeView->edit(index); - item->setEditable(false); - } - } + connect(&HelpEngineWrapper::instance(), SIGNAL(setupFinished()), this, + SLOT(setupFinished())); + connect(bookmarkModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, + SLOT(refeshBookmarkMenu())); } -void BookmarkWidget::setup(bool showButtons) +BookmarkManager::~BookmarkManager() { - regExp.setPatternSyntax(QRegExp::FixedString); - regExp.setCaseSensitivity(Qt::CaseInsensitive); - - QLayout *vlayout = new QVBoxLayout(this); - vlayout->setMargin(4); - - QLabel *label = new QLabel(tr("Filter:"), this); - vlayout->addWidget(label); - - searchField = new QLineEdit(this); - vlayout->addWidget(searchField); - connect(searchField, SIGNAL(textChanged(QString)), this, - SLOT(filterChanged())); - - treeView = new TreeView(this); - vlayout->addWidget(treeView); - -#ifdef Q_OS_MAC -# define SYSTEM "mac" -#else -# define SYSTEM "win" -#endif - - if (showButtons) { - QLayout *hlayout = new QHBoxLayout(); - vlayout->addItem(hlayout); - - hlayout->addItem(new QSpacerItem(40, 20, QSizePolicy::Expanding)); - - addButton = new QToolButton(this); - addButton->setText(tr("Add")); - addButton->setIcon(QIcon(QLatin1String(":/trolltech/assistant/images/" - SYSTEM "/addtab.png"))); - addButton->setAutoRaise(true); - addButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - hlayout->addWidget(addButton); - connect(addButton, SIGNAL(clicked()), this, SIGNAL(addBookmark())); - - removeButton = new QToolButton(this); - removeButton->setText(tr("Remove")); - removeButton->setIcon(QIcon(QLatin1String(":/trolltech/assistant/images/" - SYSTEM "/closetab.png"))); - removeButton->setAutoRaise(true); - removeButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - hlayout->addWidget(removeButton); - connect(removeButton, SIGNAL(clicked()), this, SLOT(removeClicked())); - } - - filterBookmarkModel = new QSortFilterProxyModel(this); - treeView->setModel(filterBookmarkModel); - - treeView->setDragEnabled(true); - treeView->setAcceptDrops(true); - treeView->setAutoExpandDelay(1000); - treeView->setDropIndicatorShown(true); - treeView->header()->setVisible(false); - treeView->setContextMenuPolicy(Qt::CustomContextMenu); - - connect(treeView, SIGNAL(expanded(QModelIndex)), this, - SLOT(expand(QModelIndex))); - connect(treeView, SIGNAL(collapsed(QModelIndex)), this, - SLOT(expand(QModelIndex))); - connect(treeView, SIGNAL(activated(QModelIndex)), this, - SLOT(activated(QModelIndex))); - connect(treeView, SIGNAL(customContextMenuRequested(QPoint)), - this, SLOT(customContextMenuRequested(QPoint))); - - filterBookmarkModel->setFilterKeyColumn(0); - filterBookmarkModel->setDynamicSortFilter(true); - filterBookmarkModel->setSourceModel(bookmarkManager->treeBookmarkModel()); - - expandItems(); + TRACE_OBJ + HelpEngineWrapper::instance().setBookmarks(bookmarkModel->bookmarks()); } -void BookmarkWidget::expandItems() +void BookmarkManager::removeItem(const QModelIndex &index) { - QStandardItemModel *model = bookmarkManager->treeBookmarkModel(); - QList<QStandardItem*>list = model->findItems(QLatin1String("*"), - Qt::MatchWildcard | Qt::MatchRecursive, 0); - foreach (const QStandardItem *item, list) { - const QModelIndex &index = model->indexFromItem(item); - treeView->setExpanded(filterBookmarkModel->mapFromSource(index), - item->data(Qt::UserRole + 11).toBool()); + TRACE_OBJ + QModelIndex current = index; + if (typeAndSearch) { // need to map because of proxy + current = typeAndSearchModel->mapToSource(current); + current = bookmarkFilterModel->mapToSource(current); + } else if (!bookmarkModel->parent(index).isValid()) { + return; // check if we should delete the "Bookmarks Menu", bail } -} - -void BookmarkWidget::focusInEvent(QFocusEvent *e) -{ - if (e->reason() != Qt::MouseFocusReason) { - searchField->selectAll(); - searchField->setFocus(); - - QModelIndex index = treeView->indexAt(QPoint(1, 1)); - if (index.isValid()) - treeView->setCurrentIndex(index); + if (bookmarkModel->hasChildren(current)) { + int value = QMessageBox::question(bookmarkTreeView, tr("Remove"), + tr("You are going to delete a Folder, this will also<br>" + "remove it's content. Are you sure to continue?"), + QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); + if (value == QMessageBox::Cancel) + return; } + bookmarkModel->removeItem(current); } -bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) +bool BookmarkManager::eventFilter(QObject *object, QEvent *event) { - if (object != this && object != treeView - && object != treeView->viewport()) { - return QWidget::eventFilter(object, e); - } + if (object != bookmarkTreeView && object != bookmarkTreeView->viewport() + && object != bookmarkWidget) + return QObject::eventFilter(object, event); - if (e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast<QKeyEvent*>(e); - const bool tree = object == treeView || object == treeView->viewport(); + TRACE_OBJ + const bool isWidget = object == bookmarkWidget; + if (event->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast<QKeyEvent*>(event); switch (ke->key()) { case Qt::Key_F2: { - const QModelIndex &index = treeView->currentIndex(); - const QModelIndex &src = filterBookmarkModel->mapToSource(index); - if (tree && searchField->text().isEmpty()) { - if (QStandardItem *item = bookmarkManager->treeBookmarkModel() - ->itemFromIndex(src)) { - item->setEditable(true); - treeView->edit(index); - item->setEditable(false); - } - } - } break; - - case Qt::Key_Enter: { - case Qt::Key_Return: - if (tree) { - const QString &data = treeView->selectionModel()->currentIndex() - .data(Qt::UserRole + 10).toString(); - if (!data.isEmpty() && data != QLatin1String("Folder")) - emit requestShowLink(data); - } + renameBookmark(bookmarkTreeView->currentIndex()); } break; case Qt::Key_Delete: { - const QModelIndex &index = treeView->currentIndex(); - const QModelIndex &src = filterBookmarkModel->mapToSource(index); - if (tree && searchField->text().isEmpty()) - bookmarkManager->removeBookmarkItem(treeView, src); + removeItem(bookmarkTreeView->currentIndex()); } break; - case Qt::Key_Up: { + case Qt::Key_Up: { // needs event filter on widget case Qt::Key_Down: - if (!tree) - treeView->subclassKeyPressEvent(ke); + if (isWidget) + bookmarkTreeView->subclassKeyPressEvent(ke); } break; case Qt::Key_Escape: { @@ -591,324 +252,255 @@ bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) } } - if (e->type() == QEvent::MouseButtonRelease) { - QMouseEvent *me = static_cast<QMouseEvent*>(e); - bool controlPressed = me->modifiers() & Qt::ControlModifier; - if(((me->button() == Qt::LeftButton) && controlPressed) - || (me->button() == Qt::MidButton)) { - const QModelIndex &index = treeView->currentIndex(); - const QString &data = index.data(Qt::UserRole + 10).toString(); - if (!data.isEmpty() && data != QLatin1String("Folder")) - CentralWidget::instance()->setSourceInNewTab(data); + if (event->type() == QEvent::MouseButtonRelease && !isWidget) { + QMouseEvent *me = static_cast<QMouseEvent*>(event); + switch (me->button()) { + case Qt::LeftButton: { + if (me->modifiers() & Qt::ControlModifier) + setSourceFromIndex(bookmarkTreeView->currentIndex(), true); + } break; + + case Qt::MidButton: { + setSourceFromIndex(bookmarkTreeView->currentIndex(), true); + } break; + + default: break; } } - return QWidget::eventFilter(object, e); + return QObject::eventFilter(object, event); } - -// #pragma mark -- BookmarkModel - - -BookmarkModel::BookmarkModel(int rows, int columns, QObject *parent) - : QStandardItemModel(rows, columns, parent) +void BookmarkManager::buildBookmarksMenu(const QModelIndex &index, QMenu* menu) { -} + TRACE_OBJ + if (!index.isValid()) + return; -BookmarkModel::~BookmarkModel() -{ + const QString &text = index.data().toString(); + const QIcon &icon = qVariantValue<QIcon>(index.data(Qt::DecorationRole)); + if (index.data(UserRoleFolder).toBool()) { + if (QMenu* subMenu = menu->addMenu(icon, text)) { + for (int i = 0; i < bookmarkModel->rowCount(index); ++i) + buildBookmarksMenu(bookmarkModel->index(i, 0, index), subMenu); + } + } else { + QAction *action = menu->addAction(icon, text); + action->setData(index.data(UserRoleUrl).toString()); + } } -Qt::DropActions BookmarkModel::supportedDropActions() const +void BookmarkManager::showBookmarkDialog(const QString &name, const QString &url) { - return Qt::MoveAction; + TRACE_OBJ + BookmarkDialog dialog(bookmarkModel, name, url, bookmarkTreeView); + dialog.exec(); } -Qt::ItemFlags BookmarkModel::flags(const QModelIndex &index) const -{ - Qt::ItemFlags defaultFlags = QStandardItemModel::flags(index); - if ((!index.isValid()) // can only happen for the invisible root item - || index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) - return (Qt::ItemIsDropEnabled | defaultFlags) &~ Qt::ItemIsDragEnabled; +// -- private slots - return (Qt::ItemIsDragEnabled | defaultFlags) &~ Qt::ItemIsDropEnabled; -} +void BookmarkManager::setupFinished() +{ + TRACE_OBJ + bookmarkModel->setBookmarks(HelpEngineWrapper::instance().bookmarks()); + bookmarkModel->expandFoldersIfNeeeded(bookmarkTreeView); + refeshBookmarkMenu(); -// #pragma mark -- BookmarkManager + bookmarkTreeView->hideColumn(1); + bookmarkTreeView->header()->setVisible(false); + bookmarkTreeView->header()->setStretchLastSection(true); + bookmarkFilterModel = new BookmarkFilterModel(this); + bookmarkFilterModel->setSourceModel(bookmarkModel); + bookmarkFilterModel->filterBookmarkFolders(); -BookmarkManager::BookmarkManager(QHelpEngineCore *_helpEngine) - : treeModel(new BookmarkModel(0, 1, this)) - , listModel(new BookmarkModel(0, 1, this)) - , renameItem(0) - , helpEngine(_helpEngine) -{ - folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); - - connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this, - SLOT(itemChanged(QStandardItem*))); - connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this, - SIGNAL(bookmarksChanged())); - connect(treeModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SIGNAL(bookmarksChanged())); + typeAndSearchModel = new QSortFilterProxyModel(this); + typeAndSearchModel->setDynamicSortFilter(true); + typeAndSearchModel->setSourceModel(bookmarkFilterModel); } -BookmarkManager::~BookmarkManager() +void BookmarkManager::addBookmark() { - treeModel->clear(); - listModel->clear(); + TRACE_OBJ + if (CentralWidget *widget = CentralWidget::instance()) { + showBookmarkDialog(widget->currentTitle(), + widget->currentSource().toString()); + } } -BookmarkModel* BookmarkManager::treeBookmarkModel() +void BookmarkManager::removeBookmark() { - return treeModel; + TRACE_OBJ + removeItem(bookmarkTreeView->currentIndex()); } -BookmarkModel* BookmarkManager::listBookmarkModel() -{ - return listModel; -} +//void BookmarkManager::manageBookmarks() +//{ +// TRACE_OBJ +//} -void BookmarkManager::saveBookmarks() +void BookmarkManager::refeshBookmarkMenu() { - QByteArray bookmarks; - QDataStream stream(&bookmarks, QIODevice::WriteOnly); + TRACE_OBJ + if (!bookmarkMenu) + return; - readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0); - helpEngine->setCustomValue(QLatin1String("Bookmarks"), bookmarks); -} + bookmarkMenu->clear(); -QStringList BookmarkManager::bookmarkFolders() const -{ - QStringList folders(tr("Bookmarks")); + //bookmarkMenu->addAction(tr("Manage Bookmarks..."), this, + // SLOT(manageBookmarks())); + bookmarkMenu->addAction(tr("Import..."), this, SLOT(importBookmarks())); + bookmarkMenu->addAction(tr("Export..."), this, SLOT(exportBookmarks())); + bookmarkMenu->addAction(tr("Add Bookmark..."), this, SLOT(addBookmark()), + QKeySequence(tr("Ctrl+D"))); + bookmarkMenu->addSeparator(); - QList<QStandardItem*>list = treeModel->findItems(QLatin1String("*"), - Qt::MatchWildcard | Qt::MatchRecursive, 0); + const QModelIndex &root = bookmarkModel->index(0, 0, QModelIndex()); + for (int i = 0; i < bookmarkModel->rowCount(root); ++i) + buildBookmarksMenu(bookmarkModel->index(i, 0, root), bookmarkMenu); - QString data; - foreach (const QStandardItem *item, list) { - data = item->data(Qt::UserRole + 10).toString(); - if (data == QLatin1String("Folder")) - folders << item->data(Qt::DisplayRole).toString(); - } - return folders; + connect(bookmarkMenu, SIGNAL(triggered(QAction*)), this, + SLOT(setSourceFromAction(QAction*))); } -QModelIndex BookmarkManager::addNewFolder(const QModelIndex &index) +void BookmarkManager::renameBookmark(const QModelIndex &index) { - QStandardItem *item = new QStandardItem(uniqueFolderName()); - item->setEditable(false); - item->setData(false, Qt::UserRole + 11); - item->setData(QLatin1String("Folder"), Qt::UserRole + 10); - item->setIcon(QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon)); - - if (index.isValid()) { - treeModel->itemFromIndex(index)->appendRow(item); - } else { - treeModel->appendRow(item); - } - return treeModel->indexFromItem(item); + // check if we should rename the "Bookmarks Menu", bail + if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) + return; + + bookmarkModel->setItemsEditable(true); + bookmarkTreeView->edit(index); + bookmarkModel->setItemsEditable(false); } -void BookmarkManager::removeBookmarkItem(QTreeView *treeView, - const QModelIndex &index) +void BookmarkManager::importBookmarks() { - QStandardItem *item = treeModel->itemFromIndex(index); - if (item) { - QString data = index.data(Qt::UserRole + 10).toString(); - if (data == QLatin1String("Folder") && item->rowCount() > 0) { - int value = QMessageBox::question(treeView, tr("Remove"), - tr("You are going to delete a Folder, this will also<br>" - "remove it's content. Are you sure to continue?"), - QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); - - if (value == QMessageBox::Cancel) - return; - } + TRACE_OBJ + const QString &fileName = QFileDialog::getOpenFileName(0, tr("Open File"), + QDir::currentPath(), tr("Files (*.xbel)")); - if (data != QLatin1String("Folder")) { - QList<QStandardItem*>itemList = listModel->findItems(item->text()); - foreach (const QStandardItem *i, itemList) { - if (i->data(Qt::UserRole + 10) == data) { - listModel->removeRow(i->row()); - break; - } - } - } else { - removeBookmarkFolderItems(item); - } - treeModel->removeRow(item->row(), index.parent()); + if (fileName.isEmpty()) + return; + + QFile file(fileName); + if (file.open(QIODevice::ReadOnly)) { + XbelReader reader(bookmarkModel); + reader.readFromFile(&file); } } -void BookmarkManager::showBookmarkDialog(QWidget *parent, const QString &name, - const QString &url) +void BookmarkManager::exportBookmarks() { - BookmarkDialog dialog(this, name, url, parent); - dialog.exec(); -} + TRACE_OBJ + QString fileName = QFileDialog::getSaveFileName(0, tr("Save File"), + QLatin1String("untitled.xbel"), tr("Files (*.xbel)")); -void BookmarkManager::addNewBookmark(const QModelIndex &index, - const QString &name, const QString &url) -{ - QStandardItem *item = new QStandardItem(name); - item->setEditable(false); - item->setData(false, Qt::UserRole + 11); - item->setData(url, Qt::UserRole + 10); + const QLatin1String suffix(".xbel"); + if (!fileName.endsWith(suffix)) + fileName.append(suffix); - if (index.isValid()) - treeModel->itemFromIndex(index)->appendRow(item); - else - treeModel->appendRow(item); - listModel->appendRow(item->clone()); - emit bookmarksChanged(); + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + XbelWriter writer(bookmarkModel); + writer.writeToFile(&file); + } else { + QMessageBox::information(bookmarkTreeView, tr("Qt Assistant"), + tr("Unable to save bookmarks."), tr("OK")); + } } -void BookmarkManager::fillBookmarkMenu(QMenu *menu) +void BookmarkManager::setSourceFromAction(QAction *action) { - if (!menu || !treeModel) - return; + TRACE_OBJ + const QVariant &data = action->data(); - map.clear(); - fillBookmarkMenu(menu, treeModel->invisibleRootItem()); + if (data.canConvert<QUrl>()) + emit setSource(data.toUrl()); } -void BookmarkManager::fillBookmarkMenu(QMenu *menu, QStandardItem *root) +void BookmarkManager::setSourceFromIndex(const QModelIndex &index, bool newTab) { - for (int i = 0; i < root->rowCount(); ++i) { - QStandardItem *item = root->child(i); - if (item && item->data(Qt::UserRole + 10) - .toString() == QLatin1String("Folder")) { - QMenu* newMenu = menu->addMenu(folderIcon, item->text()); - if (item->rowCount() > 0) - fillBookmarkMenu(newMenu, item); - } else { - map.insert(menu->addAction(item->text()), item->index()); - } - } -} + TRACE_OBJ + QAbstractItemModel *base = bookmarkModel; + if (typeAndSearch) + base = typeAndSearchModel; -QUrl BookmarkManager::urlForAction(QAction* action) const -{ - if (map.contains(action)) { - const QModelIndex &index = map.value(action); - if (QStandardItem* item = treeModel->itemFromIndex(index)) - return QUrl(item->data(Qt::UserRole + 10).toString()); + if (base->data(index, UserRoleFolder).toBool()) + return; + + const QVariant &data = base->data(index, UserRoleUrl); + if (data.canConvert<QUrl>()) { + if (newTab) + emit setSourceInNewTab(data.toUrl()); + else + emit setSource(data.toUrl()); } - return QUrl(); } -void BookmarkManager::itemChanged(QStandardItem *item) +void BookmarkManager::customContextMenuRequested(const QPoint &point) { - if (renameItem != item) { - renameItem = item; - oldText = item->text(); + TRACE_OBJ + QModelIndex index = bookmarkTreeView->indexAt(point); + if (!index.isValid()) return; - } - if (item->text() != oldText) { - if (item->data(Qt::UserRole + 10).toString() != QLatin1String("Folder")) { - QList<QStandardItem*>itemList = listModel->findItems(oldText); - if (itemList.count() > 0) - itemList.at(0)->setText(item->text()); - } - } -} + // check if we should open the menu on "Bookmarks Menu", bail + if (!typeAndSearch && !bookmarkModel->parent(index).isValid()) + return; -void BookmarkManager::setupBookmarkModels() -{ - treeModel->clear(); - listModel->clear(); - - qint32 depth; - bool expanded; - QString name, type; - QList<int> lastDepths; - QList<QStandardItem*> parents; - - QByteArray ba = - helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray(); - QDataStream stream(ba); - while (!stream.atEnd()) { - stream >> depth >> name >> type >> expanded; - - QStandardItem *item = new QStandardItem(name); - item->setEditable(false); - item->setData(type, Qt::UserRole + 10); - item->setData(expanded, Qt::UserRole + 11); - if (depth == 0) { - parents.clear(); lastDepths.clear(); - treeModel->appendRow(item); - parents << item; lastDepths << depth; - } else { - if (depth <= lastDepths.last()) { - while (depth <= lastDepths.last() && parents.count() > 0) { - parents.pop_back(); lastDepths.pop_back(); - } - } - parents.last()->appendRow(item); - if (type == QLatin1String("Folder")) { - parents << item; lastDepths << depth; - } - } + QAction *remove = 0; + QAction *rename = 0; + QAction *showItem = 0; + QAction *showItemInNewTab = 0; - if (type == QLatin1String("Folder")) - item->setIcon(folderIcon); - else - listModel->appendRow(item->clone()); + QMenu menu(QLatin1String("")); + if (!typeAndSearch && bookmarkModel->data(index, UserRoleFolder).toBool()) { + remove = menu.addAction(tr("Delete Folder")); + rename = menu.addAction(tr("Rename Folder")); + } else { + showItem = menu.addAction(tr("Show Bookmark")); + showItemInNewTab = menu.addAction(tr("Show Bookmark in New Tab")); + menu.addSeparator(); + remove = menu.addAction(tr("Delete Bookmark")); + rename = menu.addAction(tr("Rename Bookmark")); } -} -QString BookmarkManager::uniqueFolderName() const -{ - QString folderName = tr("New Folder"); - QList<QStandardItem*> list = treeModel->findItems(folderName, - Qt::MatchContains | Qt::MatchRecursive, 0); - if (!list.isEmpty()) { - QStringList names; - foreach (const QStandardItem *item, list) - names << item->text(); - - for (int i = 1; i <= names.count(); ++i) { - folderName = (tr("New Folder") + QLatin1String(" %1")).arg(i); - if (!names.contains(folderName)) - break; - } - } - return folderName; + QAction *pickedAction = menu.exec(bookmarkTreeView->mapToGlobal(point)); + if (pickedAction == rename) + renameBookmark(index); + else if (pickedAction == remove) + removeItem(index); + else if (pickedAction == showItem || pickedAction == showItemInNewTab) + setSourceFromIndex(index, pickedAction == showItemInNewTab); } -void BookmarkManager::removeBookmarkFolderItems(QStandardItem *item) +void BookmarkManager::focusInEvent() { - for (int j = 0; j < item->rowCount(); ++j) { - QStandardItem *child = item->child(j); - if (child->rowCount() > 0) - removeBookmarkFolderItems(child); - - QString data = child->data(Qt::UserRole + 10).toString(); - QList<QStandardItem*>itemList = listModel->findItems(child->text()); - foreach (const QStandardItem *i, itemList) { - if (i->data(Qt::UserRole + 10) == data) { - listModel->removeRow(i->row()); - break; - } - } - } + TRACE_OBJ + const QModelIndex &index = bookmarkTreeView->indexAt(QPoint(2, 2)); + if (index.isValid()) + bookmarkTreeView->setCurrentIndex(index); } -void BookmarkManager::readBookmarksRecursive(const QStandardItem *item, - QDataStream &stream, const qint32 depth) const +void BookmarkManager::textChanged(const QString &text) { - for (int j = 0; j < item->rowCount(); ++j) { - const QStandardItem *child = item->child(j); - stream << depth; - stream << child->data(Qt::DisplayRole).toString(); - stream << child->data(Qt::UserRole + 10).toString(); - stream << child->data(Qt::UserRole + 11).toBool(); - - if (child->rowCount() > 0) - readBookmarksRecursive(child, stream, (depth +1)); + TRACE_OBJ + if (!bookmarkWidget->ui.lineEdit->text().isEmpty()) { + if (!typeAndSearch) { + typeAndSearch = true; + bookmarkTreeView->setItemsExpandable(false); + bookmarkTreeView->setRootIsDecorated(false); + bookmarkTreeView->setModel(typeAndSearchModel); + } + typeAndSearchModel->setFilterRegExp(QRegExp(text)); + } else { + typeAndSearch = false; + bookmarkTreeView->setModel(bookmarkModel); + bookmarkTreeView->setItemsExpandable(true); + bookmarkTreeView->setRootIsDecorated(true); + bookmarkModel->expandFoldersIfNeeeded(bookmarkTreeView); } } diff --git a/tools/assistant/tools/assistant/bookmarkmanager.h b/tools/assistant/tools/assistant/bookmarkmanager.h index da36833..88342d5 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.h +++ b/tools/assistant/tools/assistant/bookmarkmanager.h @@ -38,178 +38,118 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #ifndef BOOKMARKMANAGER_H #define BOOKMARKMANAGER_H -#include "ui_bookmarkdialog.h" - -#include <QtCore/QUrl> -#include <QtCore/QObject> -#include <QtCore/QString> -#include <QtCore/QByteArray> -#include <QtCore/QDataStream> - -#include <QtGui/QIcon> -#include <QtGui/QDialog> -#include <QtGui/QWidget> +#include <QtCore/QMutex> #include <QtGui/QTreeView> -#include <QtGui/QStandardItemModel> + +#include "ui_bookmarkwidget.h" QT_BEGIN_NAMESPACE -class QEvent; -class QLineEdit; -class QTreeView; -class QToolButton; -class QStandardItem; -class QHelpEngineCore; -class QAbstractItemModel; +class BookmarkModel; +class BookmarkFilterModel; +class QKeyEvent; class QSortFilterProxyModel; -class BookmarkManager; - -class BookmarkDialog : public QDialog +class BookmarkManager : public QObject { Q_OBJECT + class BookmarkWidget; + class BookmarkTreeView; + class BookmarkListView; + Q_DISABLE_COPY(BookmarkManager); public: - BookmarkDialog(BookmarkManager *manager, const QString &title, - const QString &url, QWidget *parent = 0); - ~BookmarkDialog(); + static BookmarkManager* instance(); + static void destroy(); -private slots: - void addAccepted(); - void addNewFolder(); - void toolButtonClicked(); - void itemChanged(QStandardItem *item); - void textChanged(const QString& string); - void selectBookmarkFolder(const QString &folderName); - void customContextMenuRequested(const QPoint &point); - void currentChanged(const QModelIndex& current); + QWidget* bookmarkDockWidget() const; + void takeBookmarksMenu(QMenu* menu); -private: - bool eventFilter(QObject *object, QEvent *e); +public slots: + void addBookmark(const QString &title, const QString &url); + +signals: + void escapePressed(); + void setSource(const QUrl &url); + void setSourceInNewTab(const QUrl &url); private: - QString m_url; - QString m_title; + BookmarkManager(); + ~BookmarkManager(); - QString oldText; - QStandardItem *renameItem; + void removeItem(const QModelIndex &index); + bool eventFilter(QObject *object, QEvent *event); + void buildBookmarksMenu(const QModelIndex &index, QMenu *menu); + void showBookmarkDialog(const QString &name, const QString &url); - Ui::BookmarkDialog ui; - BookmarkManager *bookmarkManager; - QSortFilterProxyModel *proxyModel; -}; +private slots: + void setupFinished(); -class TreeView : public QTreeView { - Q_OBJECT -public: - TreeView(QWidget* parent = 0) : QTreeView(parent) {} - void subclassKeyPressEvent(QKeyEvent* event) - { - QTreeView::keyPressEvent(event); - } -}; + void addBookmark(); + void removeBookmark(); +// void manageBookmarks(); + void refeshBookmarkMenu(); + void renameBookmark(const QModelIndex &index); -class BookmarkWidget : public QWidget -{ - Q_OBJECT + void importBookmarks(); + void exportBookmarks(); -public: - BookmarkWidget(BookmarkManager *manager, QWidget *parent = 0, - bool showButtons = true); - ~BookmarkWidget(); + void setSourceFromAction(QAction *action); + void setSourceFromIndex(const QModelIndex &index, bool newTab = false); -signals: - void addBookmark(); - void requestShowLink(const QUrl &url); - void escapePressed(); - -private slots: - void removeClicked(); - void filterChanged(); - void expand(const QModelIndex& index); - void activated(const QModelIndex &index); + void focusInEvent(); + void textChanged(const QString &text); void customContextMenuRequested(const QPoint &point); private: - void setup(bool showButtons); - void expandItems(); - void focusInEvent(QFocusEvent *e); - bool eventFilter(QObject *object, QEvent *event); + bool typeAndSearch; -private: - QRegExp regExp; - TreeView *treeView; - QLineEdit *searchField; - QToolButton *addButton; - QToolButton *removeButton; - BookmarkManager *bookmarkManager; - QSortFilterProxyModel* filterBookmarkModel; -}; + static QMutex mutex; + static BookmarkManager *bookmarkManager; -class BookmarkModel : public QStandardItemModel -{ - Q_OBJECT + QMenu *bookmarkMenu; -public: - BookmarkModel(int rows, int columns, QObject *parent = 0); - ~BookmarkModel(); + BookmarkModel *bookmarkModel; + BookmarkFilterModel *bookmarkFilterModel; + QSortFilterProxyModel *typeAndSearchModel; - Qt::DropActions supportedDropActions() const; - Qt::ItemFlags flags(const QModelIndex &index) const; + BookmarkWidget *bookmarkWidget; + BookmarkTreeView *bookmarkTreeView; }; -class BookmarkManager : public QObject +class BookmarkManager::BookmarkWidget : public QWidget { Q_OBJECT - public: - BookmarkManager(QHelpEngineCore* helpEngine); - ~BookmarkManager(); + BookmarkWidget(QWidget *parent = 0) + : QWidget(parent) { ui.setupUi(this); } + virtual ~BookmarkWidget() {} - BookmarkModel* treeBookmarkModel(); - BookmarkModel* listBookmarkModel(); - - void saveBookmarks(); - QStringList bookmarkFolders() const; - QModelIndex addNewFolder(const QModelIndex& index); - void removeBookmarkItem(QTreeView *treeView, const QModelIndex& index); - void showBookmarkDialog(QWidget* parent, const QString &name, - const QString &url); - void addNewBookmark(const QModelIndex& index, const QString &name, - const QString &url); - void setupBookmarkModels(); - - void fillBookmarkMenu(QMenu *menu); - QUrl urlForAction(QAction* action) const; + Ui::BookmarkWidget ui; signals: - void bookmarksChanged(); - -private slots: - void itemChanged(QStandardItem *item); + void focusInEvent(); private: - QString uniqueFolderName() const; - void removeBookmarkFolderItems(QStandardItem *item); - void readBookmarksRecursive(const QStandardItem *item, QDataStream &stream, - const qint32 depth) const; - void fillBookmarkMenu(QMenu *menu, QStandardItem *root); + void focusInEvent(QFocusEvent *event); +}; -private: - QString oldText; - QIcon folderIcon; - - BookmarkModel *treeModel; - BookmarkModel *listModel; - QStandardItem *renameItem; - QHelpEngineCore *helpEngine; - QMap<QAction*, QModelIndex> map; +class BookmarkManager::BookmarkTreeView : public QTreeView +{ + Q_OBJECT +public: + BookmarkTreeView(QWidget *parent = 0); + ~BookmarkTreeView() {} + + void subclassKeyPressEvent(QKeyEvent *event); + +private slots: + void setExpandedData(const QModelIndex &index); }; QT_END_NAMESPACE -#endif +#endif // BOOKMARKMANAGER_H diff --git a/tools/assistant/tools/assistant/bookmarkmodel.cpp b/tools/assistant/tools/assistant/bookmarkmodel.cpp new file mode 100644 index 0000000..c785f16 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkmodel.cpp @@ -0,0 +1,425 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bookmarkmodel.h" +#include "bookmarkitem.h" + +#include <QtCore/QMimeData> +#include <QtCore/QStack> + +#include <QtGui/QApplication> +#include <QtGui/QStyle> +#include <QtGui/QTreeView> + +const QLatin1String MIMETYPE("application/bookmarks.assistant"); + +BookmarkModel::BookmarkModel() + : QAbstractItemModel() + , m_folder(false) + , m_editable(false) + , rootItem(0) +{ +} + +BookmarkModel::~BookmarkModel() +{ + delete rootItem; +} + +QByteArray +BookmarkModel::bookmarks() const +{ + QByteArray ba; + QDataStream stream(&ba, QIODevice::WriteOnly); + + const QModelIndex &root = index(0,0, QModelIndex()); + for (int i = 0; i < rowCount(root); ++i) + collectItems(index(i, 0, root), 0, &stream); + + return ba; +} + +void +BookmarkModel::setBookmarks(const QByteArray &bookmarks) +{ + folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); + bookmarkIcon = QIcon(QLatin1String(":/trolltech/assistant/images/bookmark.png")); + + rootItem = new BookmarkItem(DataVector() << tr("Name") << tr("Address") + << true); + BookmarkItem* item = new BookmarkItem(DataVector() << tr("Bookmarks Menu") + << QLatin1String("Folder") << true); + rootItem->addChild(item); + + QStack<BookmarkItem*> parents; + parents.push(item); + + qint32 depth; + bool expanded; + QString name, url; + QDataStream stream(bookmarks); + while (!stream.atEnd()) { + stream >> depth >> name >> url >> expanded; + + while ((parents.count() - 1) != depth) + parents.pop(); + + item = new BookmarkItem(DataVector() << name << url << expanded); + if (url == QLatin1String("Folder")) { + parents.top()->addChild(item); + parents.push(item); + } else { + parents.top()->addChild(item); + } + } + + cache.clear(); + const QModelIndex &root = index(0,0, QModelIndex()); + + setupCache(root); + cache.insert(static_cast<BookmarkItem*> (root.internalPointer()), root); +} + +void +BookmarkModel::setItemsEditable(bool editable) +{ + m_editable = editable; +} + +void +BookmarkModel::expandFoldersIfNeeeded(QTreeView *treeView) +{ + foreach (const QModelIndex &index, cache) + treeView->setExpanded(index, index.data(UserRoleExpanded).toBool()); +} + +QModelIndex +BookmarkModel::addItem(const QModelIndex &parent, bool isFolder) +{ + m_folder = isFolder; + QModelIndex next; + if (insertRow(rowCount(parent), parent)) + next = index(rowCount(parent) - 1, 0, parent); + m_folder = false; + + return next; +} + +bool +BookmarkModel::removeItem(const QModelIndex &index) +{ + if (!index.isValid()) + return false; + + QModelIndexList indexes; + if (rowCount(index) > 0) + indexes = collectItems(index); + indexes.append(index); + + foreach (const QModelIndex &itemToRemove, indexes) { + if (!removeRow(itemToRemove.row(), itemToRemove.parent())) + return false; + cache.remove(itemFromIndex(itemToRemove)); + } + return true; +} + +int +BookmarkModel::rowCount(const QModelIndex &index) const +{ + if (BookmarkItem *item = itemFromIndex(index)) + return item->childCount(); + return 0; +} + +int +BookmarkModel::columnCount(const QModelIndex &/*index*/) const +{ + return 2; +} + +QModelIndex +BookmarkModel::parent(const QModelIndex &index) const +{ + if (!index.isValid()) + return QModelIndex(); + + if (BookmarkItem *childItem = itemFromIndex(index)) { + if (BookmarkItem *parent = childItem->parent()) { + if (parent != rootItem) + return createIndex(parent->childNumber(), 0, parent); + } + } + return QModelIndex(); +} + +QModelIndex +BookmarkModel::index(int row, int column, const QModelIndex &index) const +{ + if (index.isValid() && (index.column() != 0 && index.column() != 1)) + return QModelIndex(); + + if (BookmarkItem *parent = itemFromIndex(index)) { + if (BookmarkItem *childItem = parent->child(row)) + return createIndex(row, column, childItem); + } + return QModelIndex(); +} + +Qt::DropActions +BookmarkModel::supportedDropActions () const +{ + return /* Qt::CopyAction | */Qt::MoveAction; +} + +Qt::ItemFlags +BookmarkModel::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + return Qt::NoItemFlags; + + Qt::ItemFlags defaultFlags = Qt::ItemIsEnabled | Qt::ItemIsSelectable; + + if (m_editable) + defaultFlags |= Qt::ItemIsEditable; + + if (itemFromIndex(index) && index.data(UserRoleFolder).toBool() + && index.column() > 0) { + defaultFlags &= ~Qt::ItemIsEditable; + return defaultFlags | Qt::ItemIsDropEnabled; + } + + return defaultFlags | Qt::ItemIsDragEnabled; +} + +QVariant +BookmarkModel::data(const QModelIndex &index, int role) const +{ + if (index.isValid()) { + if (BookmarkItem *item = itemFromIndex(index)) { + switch (role) { + case Qt::EditRole: { + case Qt::DisplayRole: + if (index.data(UserRoleFolder).toBool() && index.column() == 1) + return QLatin1String(""); + return item->data(index.column()); + } break; + case Qt::DecorationRole: { + if (index.column() == 0) + return index.data(UserRoleFolder).toBool() + ? folderIcon : bookmarkIcon; + } break; + default:; + return item->data(role); + } + } + } + return QVariant(); +} + +bool +BookmarkModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + bool result = false; + if (role != Qt::EditRole && role != UserRoleExpanded) + return result; + + if (BookmarkItem *item = itemFromIndex(index)) { + if (role == Qt::EditRole) { + const bool isFolder = index.data(UserRoleFolder).toBool(); + if (!isFolder || (isFolder && index.column() == 0)) + result = item->setData(index.column(), value); + } else if (role == UserRoleExpanded) { + result = item->setData(UserRoleExpanded, value); + } + } + + if (result) + emit dataChanged(index, index); + return result; +} + +QVariant +BookmarkModel::headerData(int section, Qt::Orientation orientation, + int role) const +{ + if (rootItem && orientation == Qt::Horizontal && role == Qt::DisplayRole) + return rootItem->data(section); + return QVariant(); +} + +QModelIndex +BookmarkModel::indexFromItem(BookmarkItem *item) const +{ + return cache.value(item, QModelIndex()); +} + +BookmarkItem* +BookmarkModel::itemFromIndex(const QModelIndex &index) const +{ + if (index.isValid()) + return static_cast<BookmarkItem*>(index.internalPointer()); + return rootItem; +} + +bool +BookmarkModel::insertRows(int position, int rows, const QModelIndex &parent) +{ + if (!parent.data(UserRoleFolder).toBool()) + return false; + + bool success = false; + if (BookmarkItem *parentItem = itemFromIndex(parent)) { + beginInsertRows(parent, position, position + rows - 1); + success = parentItem->insertChildren(m_folder, position, rows); + if (success) { + const QModelIndex ¤t = index(position, 0, parent); + cache.insert(itemFromIndex(current), current); + } + endInsertRows(); + } + return success; +} + +bool +BookmarkModel::removeRows(int position, int rows, const QModelIndex &index) +{ + bool success = false; + if (BookmarkItem *parent = itemFromIndex(index)) { + beginRemoveRows(index, position, position + rows - 1); + success = parent->removeChildren(position, rows); + endRemoveRows(); + } + return success; +} + +QStringList +BookmarkModel::mimeTypes() const +{ + return QStringList() << MIMETYPE; +} + +QMimeData* +BookmarkModel::mimeData(const QModelIndexList &indexes) const +{ + if (indexes.isEmpty()) + return 0; + + QByteArray data; + QDataStream stream(&data, QIODevice::WriteOnly); + + foreach (const QModelIndex &index, indexes) { + if (index.column() == 0) + collectItems(index, 0, &stream); + } + + QMimeData *mimeData = new QMimeData(); + mimeData->setData(MIMETYPE, data); + return mimeData; +} + +bool +BookmarkModel::dropMimeData(const QMimeData *data, Qt::DropAction action, + int row, int column, const QModelIndex &parent) +{ + if (action == Qt::IgnoreAction) + return true; + + if (!data->hasFormat(MIMETYPE) || column > 0) + return false; + + QByteArray ba = data->data(MIMETYPE); + QDataStream stream(&ba, QIODevice::ReadOnly); + while (stream.atEnd()) + return false; + + qint32 depth; + bool expanded; + QString name, url; + while (!stream.atEnd()) { + stream >> depth >> name >> url >> expanded; + if (insertRow(qMax(0, row), parent)) { + const QModelIndex ¤t = index(qMax(0, row), 0, parent); + if (current.isValid()) { + BookmarkItem* item = itemFromIndex(current); + item->setData(DataVector() << name << url << expanded); + } + } + } + return true; +} + +void +BookmarkModel::setupCache(const QModelIndex &parent) +{ + const QModelIndexList &list = collectItems(parent); + foreach (const QModelIndex &index, list) + cache.insert(itemFromIndex(index), index); +} + +QModelIndexList +BookmarkModel::collectItems(const QModelIndex &parent) const +{ + QModelIndexList list; + for (int i = rowCount(parent) - 1; i >= 0 ; --i) { + const QModelIndex &next = index(i, 0, parent); + if (data(next, UserRoleFolder).toBool()) + list += collectItems(next); + list.append(next); + } + return list; +} + +void +BookmarkModel::collectItems(const QModelIndex &parent, qint32 depth, + QDataStream *stream) const +{ + if (parent.isValid()) { + *stream << depth; + *stream << parent.data().toString(); + *stream << parent.data(UserRoleUrl).toString(); + *stream << parent.data(UserRoleExpanded).toBool(); + + for (int i = 0; i < rowCount(parent); ++i) { + if (parent.data(UserRoleFolder).toBool()) + collectItems(index(i, 0 , parent), depth + 1, stream); + } + } +} diff --git a/tools/assistant/tools/assistant/bookmarkmodel.h b/tools/assistant/tools/assistant/bookmarkmodel.h new file mode 100644 index 0000000..6b2a0b8 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkmodel.h @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BOOKMARKMODEL_H +#define BOOKMARKMODEL_H + +#include <QtCore/QAbstractItemModel> + +#include <QtGui/QIcon> + +QT_BEGIN_NAMESPACE + +class BookmarkItem; +class QMimeData; +class QTreeView; + +typedef QMap<BookmarkItem*, QPersistentModelIndex> ItemModelIndexCache; + +class BookmarkModel : public QAbstractItemModel +{ + Q_OBJECT +public: + BookmarkModel(); + ~BookmarkModel(); + + QByteArray bookmarks() const; + void setBookmarks(const QByteArray &bookmarks); + + void setItemsEditable(bool editable); + void expandFoldersIfNeeeded(QTreeView *treeView); + + QModelIndex addItem(const QModelIndex &parent, bool isFolder = false); + bool removeItem(const QModelIndex &index); + + int rowCount(const QModelIndex &index = QModelIndex()) const; + int columnCount(const QModelIndex &index = QModelIndex()) const; + + QModelIndex parent(const QModelIndex &index) const; + QModelIndex index(int row, int column, const QModelIndex &index) const; + + Qt::DropActions supportedDropActions () const; + Qt::ItemFlags flags(const QModelIndex &index) const; + + QVariant data(const QModelIndex &index, int role) const; + bool setData(const QModelIndex &index, const QVariant &value, int role); + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + + QModelIndex indexFromItem(BookmarkItem *item) const; + BookmarkItem *itemFromIndex(const QModelIndex &index) const; + + bool insertRows(int position, int rows, const QModelIndex &parent); + bool removeRows(int position, int rows, const QModelIndex &parent); + + QStringList mimeTypes() const; + QMimeData* mimeData(const QModelIndexList &indexes) const; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, + int column, const QModelIndex &parent); + +private: + void setupCache(const QModelIndex &parent); + QModelIndexList collectItems(const QModelIndex &parent) const; + void collectItems(const QModelIndex &parent, qint32 depth, + QDataStream *stream) const; + +private: + int columns; + bool m_folder; + bool m_editable; + QIcon folderIcon; + QIcon bookmarkIcon; + QTreeView *treeView; + BookmarkItem *rootItem; + ItemModelIndexCache cache; +}; + +QT_END_NAMESPACE + +#endif // BOOKMARKMODEL_H diff --git a/tools/assistant/tools/assistant/bookmarkwidget.ui b/tools/assistant/tools/assistant/bookmarkwidget.ui new file mode 100644 index 0000000..3015740 --- /dev/null +++ b/tools/assistant/tools/assistant/bookmarkwidget.ui @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>BookmarkWidget</class> + <widget class="QWidget" name="BookmarkWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>235</width> + <height>606</height> + </rect> + </property> + <property name="windowTitle"> + <string>Bookmarks</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Filter:</string> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <widget class="QLineEdit" name="lineEdit"/> + </item> + <item> + <widget class="QStackedWidget" name="stackedWidget"/> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="add"> + <property name="text"> + <string>Add</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="remove"> + <property name="text"> + <string>Remove</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp index 0e4096b..8bb2ffe 100644 --- a/tools/assistant/tools/assistant/centralwidget.cpp +++ b/tools/assistant/tools/assistant/centralwidget.cpp @@ -38,12 +38,15 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "centralwidget.h" +#include "helpenginewrapper.h" #include "helpviewer.h" #include "searchwidget.h" #include "mainwindow.h" #include "preferencesdialog.h" +#include "../shared/collectionconfiguration.h" #include <QtCore/QDir> #include <QtCore/QEvent> @@ -67,7 +70,6 @@ #include <QtGui/QPrintPreviewDialog> #include <QtGui/QPageSetupDialog> -#include <QtHelp/QHelpEngine> #include <QtHelp/QHelpSearchEngine> QT_BEGIN_NAMESPACE @@ -90,6 +92,7 @@ FindWidget::FindWidget(QWidget *parent) : QWidget(parent) , appPalette(qApp->palette()) { + TRACE_OBJ QHBoxLayout *hboxLayout = new QHBoxLayout(this); QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); @@ -148,10 +151,12 @@ FindWidget::FindWidget(QWidget *parent) FindWidget::~FindWidget() { + TRACE_OBJ } void FindWidget::hideEvent(QHideEvent* event) { + TRACE_OBJ #if !defined(QT_NO_WEBKIT) // TODO: remove this once webkit supports setting the palette if (!event->spontaneous()) @@ -163,6 +168,7 @@ void FindWidget::hideEvent(QHideEvent* event) void FindWidget::showEvent(QShowEvent* event) { + TRACE_OBJ #if !defined(QT_NO_WEBKIT) // TODO: remove this once webkit supports setting the palette if (!event->spontaneous()) { @@ -180,6 +186,7 @@ void FindWidget::showEvent(QShowEvent* event) void FindWidget::updateButtons() { + TRACE_OBJ if (editFind->text().isEmpty()) { toolPrevious->setEnabled(false); toolNext->setEnabled(false); @@ -191,6 +198,7 @@ void FindWidget::updateButtons() QToolButton* FindWidget::setupToolButton(const QString &text, const QString &icon) { + TRACE_OBJ QToolButton *toolButton = new QToolButton(this); toolButton->setText(text); @@ -205,18 +213,17 @@ QToolButton* FindWidget::setupToolButton(const QString &text, const QString &ico // -- -CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent) +CentralWidget::CentralWidget(MainWindow *parent) : QWidget(parent) , lastTabPage(0) - , collectionFile(engine->collectionFile()) , findBar(0) , tabWidget(0) , findWidget(0) - , helpEngine(engine) , printer(0) , usesDefaultCollection(parent->usesDefaultCollection()) , m_searchWidget(0) { + TRACE_OBJ globalActionList.clear(); staticCentralWidget = this; QVBoxLayout *vboxLayout = new QVBoxLayout(this); @@ -288,45 +295,40 @@ CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent) CentralWidget::~CentralWidget() { + TRACE_OBJ #ifndef QT_NO_PRINTER delete printer; #endif - QHelpEngineCore engine(collectionFile, 0); - if (!engine.setupData()) - return; - - QString zoomCount; - QString currentPages; - QLatin1Char separator('|'); + QStringList zoomFactors; + QStringList currentPages; bool searchAttached = m_searchWidget->isAttached(); int i = searchAttached ? 1 : 0; for (; i < tabWidget->count(); ++i) { HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(i)); if (viewer && viewer->source().isValid()) { - currentPages += viewer->source().toString() + separator; - zoomCount += QString::number(viewer->zoom()) + separator; + currentPages << viewer->source().toString(); + zoomFactors << QString::number(viewer->zoom()); } } - engine.setCustomValue(QLatin1String("LastTabPage"), lastTabPage); - engine.setCustomValue(QLatin1String("LastShownPages"), currentPages); - engine.setCustomValue(QLatin1String("SearchWasAttached"), searchAttached); -#if !defined(QT_NO_WEBKIT) - engine.setCustomValue(QLatin1String("LastPagesZoomWebView"), zoomCount); -#else - engine.setCustomValue(QLatin1String("LastPagesZoomTextBrowser"), zoomCount); -#endif + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + helpEngine.setLastTabPage(tabWidget->currentIndex()); + helpEngine.setLastShownPages(currentPages); + helpEngine.setSearchWasAttached(searchAttached); + helpEngine.setLastZoomFactors(zoomFactors); } CentralWidget *CentralWidget::instance() { + TRACE_OBJ return staticCentralWidget; } void CentralWidget::newTab() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); #if !defined(QT_NO_WEBKIT) if (viewer && viewer->hasLoadFinished()) @@ -338,6 +340,7 @@ void CentralWidget::newTab() void CentralWidget::zoomIn() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->zoomIn(); @@ -348,6 +351,7 @@ void CentralWidget::zoomIn() void CentralWidget::zoomOut() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->zoomOut(); @@ -358,11 +362,13 @@ void CentralWidget::zoomOut() void CentralWidget::findNext() { + TRACE_OBJ find(findWidget->editFind->text(), true); } void CentralWidget::nextPage() { + TRACE_OBJ int index = tabWidget->currentIndex() + 1; if (index >= tabWidget->count()) index = 0; @@ -371,6 +377,7 @@ void CentralWidget::nextPage() void CentralWidget::resetZoom() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->resetZoom(); @@ -381,6 +388,7 @@ void CentralWidget::resetZoom() void CentralWidget::previousPage() { + TRACE_OBJ int index = tabWidget->currentIndex() -1; if (index < 0) index = tabWidget->count() -1; @@ -389,11 +397,13 @@ void CentralWidget::previousPage() void CentralWidget::findPrevious() { + TRACE_OBJ find(findWidget->editFind->text(), false); } void CentralWidget::closeTab() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (!viewer|| tabWidget->count() == 1) return; @@ -404,12 +414,13 @@ void CentralWidget::closeTab() void CentralWidget::setSource(const QUrl &url) { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); HelpViewer *lastViewer = qobject_cast<HelpViewer*>(tabWidget->widget(lastTabPage)); if (!viewer && !lastViewer) { - viewer = new HelpViewer(helpEngine, this); + viewer = new HelpViewer(this); viewer->installEventFilter(this); lastTabPage = tabWidget->addTab(viewer, QString()); tabWidget->setCurrentIndex(lastTabPage); @@ -427,18 +438,14 @@ void CentralWidget::setSource(const QUrl &url) void CentralWidget::setupWidget() { - int option = helpEngine->customValue(QLatin1String("StartOption"), - ShowLastPages).toInt(); - + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + int option = helpEngine.startOption(); if (option != ShowLastPages) { QString homePage; - if (option == ShowHomePage) { - homePage = helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - homePage = helpEngine->customValue(QLatin1String("homepage"), - homePage).toString(); - } - if (option == ShowBlankPage) + if (option == ShowHomePage) + homePage = helpEngine.homePage(); + else if (option == ShowBlankPage) homePage = QLatin1String("about:blank"); setSource(homePage); } else { @@ -448,11 +455,9 @@ void CentralWidget::setupWidget() void CentralWidget::setLastShownPages() { - const QLatin1String key("LastShownPages"); - QString value = helpEngine->customValue(key, QString()).toString(); - const QStringList lastShownPageList = value.split(QLatin1Char('|'), - QString::SkipEmptyParts); - + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + const QStringList lastShownPageList = helpEngine.lastShownPages(); const int pageCount = lastShownPageList.count(); if (pageCount == 0) { if (usesDefaultCollection) @@ -461,48 +466,39 @@ void CentralWidget::setLastShownPages() setSource(QUrl(QLatin1String("about:blank"))); return; } + QStringList zoomFactors = helpEngine.lastZoomFactors(); + while (zoomFactors.count() < pageCount) + zoomFactors.append(CollectionConfiguration::DefaultZoomFactor); -#if !defined(QT_NO_WEBKIT) - const QLatin1String zoom("LastPagesZoomWebView"); -#else - const QLatin1String zoom("LastPagesZoomTextBrowser"); -#endif - - value = helpEngine->customValue(zoom, QString()).toString(); - QVector<QString> zoomVector = value.split(QLatin1Char('|'), - QString::SkipEmptyParts).toVector(); - - const int zoomCount = zoomVector.count(); - zoomVector.insert(zoomCount, pageCount - zoomCount, QLatin1String("0.0")); - - QVector<QString>::const_iterator zIt = zoomVector.constBegin(); - QStringList::const_iterator it = lastShownPageList.constBegin(); - for (; it != lastShownPageList.constEnd(); ++it, ++zIt) - setSourceInNewTab((*it), (*zIt).toFloat()); - - const QLatin1String lastTab("LastTabPage"); - int tab = helpEngine->customValue(lastTab, 1).toInt(); - - const QLatin1String searchKey("SearchWasAttached"); const bool searchIsAttached = m_searchWidget->isAttached(); - const bool searchWasAttached = helpEngine->customValue(searchKey).toBool(); - - if (searchWasAttached && !searchIsAttached) - tabWidget->setCurrentIndex(--tab); + const bool searchWasAttached = helpEngine.searchWasAttached(); + int tabToShow = helpEngine.lastTabPage(); + if (searchWasAttached && !searchIsAttached && tabToShow != 0) + --tabToShow; else if (!searchWasAttached && searchIsAttached) - tabWidget->setCurrentIndex(++tab); - else - tabWidget->setCurrentIndex(tab); + ++tabToShow; + + for (int curTab = 0; curTab < pageCount; ++curTab) { + const QString &curFile = lastShownPageList.at(curTab); + if (helpEngine.findFile(curFile).isValid()) + setSourceInNewTab(curFile, zoomFactors.at(curTab).toFloat()); + else if (curTab + searchIsAttached <= tabToShow) + --tabToShow; + } + + tabWidget->setCurrentIndex(tabToShow); } bool CentralWidget::hasSelection() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); return viewer ? viewer->hasSelection() : false; } QUrl CentralWidget::currentSource() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) return viewer->source(); @@ -512,6 +508,7 @@ QUrl CentralWidget::currentSource() const QString CentralWidget::currentTitle() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) return viewer->documentTitle(); @@ -521,6 +518,7 @@ QString CentralWidget::currentTitle() const void CentralWidget::copySelection() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->copy(); @@ -528,6 +526,7 @@ void CentralWidget::copySelection() void CentralWidget::showTextSearch() { + TRACE_OBJ findBar->show(); findWidget->editFind->selectAll(); findWidget->editFind->setFocus(Qt::ShortcutFocusReason); @@ -535,6 +534,7 @@ void CentralWidget::showTextSearch() void CentralWidget::initPrinter() { + TRACE_OBJ #ifndef QT_NO_PRINTER if (!printer) printer = new QPrinter(QPrinter::HighResolution); @@ -543,6 +543,7 @@ void CentralWidget::initPrinter() void CentralWidget::print() { + TRACE_OBJ #ifndef QT_NO_PRINTER HelpViewer *viewer = currentHelpViewer(); if (!viewer) @@ -550,23 +551,23 @@ void CentralWidget::print() initPrinter(); - QPrintDialog *dlg = new QPrintDialog(printer, this); + QPrintDialog dlg(printer, this); #if defined(QT_NO_WEBKIT) if (viewer->textCursor().hasSelection()) - dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection); + dlg.addEnabledOption(QAbstractPrintDialog::PrintSelection); #endif - dlg->addEnabledOption(QAbstractPrintDialog::PrintPageRange); - dlg->addEnabledOption(QAbstractPrintDialog::PrintCollateCopies); - dlg->setWindowTitle(tr("Print Document")); - if (dlg->exec() == QDialog::Accepted) { + dlg.addEnabledOption(QAbstractPrintDialog::PrintPageRange); + dlg.addEnabledOption(QAbstractPrintDialog::PrintCollateCopies); + dlg.setWindowTitle(tr("Print Document")); + if (dlg.exec() == QDialog::Accepted) { viewer->print(printer); } - delete dlg; #endif } void CentralWidget::printPreview() { + TRACE_OBJ #ifndef QT_NO_PRINTER initPrinter(); QPrintPreviewDialog preview(printer, this); @@ -578,6 +579,7 @@ void CentralWidget::printPreview() void CentralWidget::printPreview(QPrinter *p) { + TRACE_OBJ #ifndef QT_NO_PRINTER HelpViewer *viewer = currentHelpViewer(); if (viewer) @@ -587,6 +589,7 @@ void CentralWidget::printPreview(QPrinter *p) void CentralWidget::pageSetup() { + TRACE_OBJ #ifndef QT_NO_PRINTER initPrinter(); QPageSetupDialog dlg(printer); @@ -596,11 +599,13 @@ void CentralWidget::pageSetup() bool CentralWidget::isHomeAvailable() const { + TRACE_OBJ return currentHelpViewer() ? true : false; } void CentralWidget::home() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->home(); @@ -608,6 +613,7 @@ void CentralWidget::home() bool CentralWidget::isForwardAvailable() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) return viewer->isForwardAvailable(); @@ -617,6 +623,7 @@ bool CentralWidget::isForwardAvailable() const void CentralWidget::forward() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->forward(); @@ -624,6 +631,7 @@ void CentralWidget::forward() bool CentralWidget::isBackwardAvailable() const { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) return viewer->isBackwardAvailable(); @@ -633,6 +641,7 @@ bool CentralWidget::isBackwardAvailable() const void CentralWidget::backward() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (viewer) viewer->backward(); @@ -641,16 +650,19 @@ void CentralWidget::backward() QList<QAction*> CentralWidget::globalActions() const { + TRACE_OBJ return globalActionList; } void CentralWidget::setGlobalActions(const QList<QAction*> &actions) { + TRACE_OBJ globalActionList = actions; } void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom) { + TRACE_OBJ HelpViewer *viewer; #if defined(QT_NO_WEBKIT) @@ -659,7 +671,7 @@ void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom) return; #endif - viewer = new HelpViewer(helpEngine, this); + viewer = new HelpViewer(this); viewer->installEventFilter(this); viewer->setSource(url); viewer->setFocus(Qt::OtherFocusReason); @@ -683,7 +695,8 @@ void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom) HelpViewer *CentralWidget::newEmptyTab() { - HelpViewer *viewer = new HelpViewer(helpEngine, this); + TRACE_OBJ + HelpViewer *viewer = new HelpViewer(this); viewer->installEventFilter(this); viewer->setFocus(Qt::OtherFocusReason); #if defined(QT_NO_WEBKIT) @@ -697,11 +710,13 @@ HelpViewer *CentralWidget::newEmptyTab() void CentralWidget::findCurrentText(const QString &text) { + TRACE_OBJ find(text, true); } void CentralWidget::connectSignals() { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) { connect(viewer, SIGNAL(copyAvailable(bool)), this, @@ -721,11 +736,13 @@ void CentralWidget::connectSignals() HelpViewer *CentralWidget::currentHelpViewer() const { + TRACE_OBJ return qobject_cast<HelpViewer*>(tabWidget->currentWidget()); } void CentralWidget::activateTab(bool onlyHelpViewer) { + TRACE_OBJ if (currentHelpViewer()) { currentHelpViewer()->setFocus(); } else { @@ -739,6 +756,7 @@ void CentralWidget::activateTab(bool onlyHelpViewer) void CentralWidget::setTabTitle(const QUrl &url) { + TRACE_OBJ Q_UNUSED(url) #if !defined(QT_NO_WEBKIT) QTabBar *tabBar = qFindChild<QTabBar*>(tabWidget); @@ -760,6 +778,7 @@ void CentralWidget::setTabTitle(const QUrl &url) void CentralWidget::currentPageChanged(int index) { + TRACE_OBJ const HelpViewer *viewer = currentHelpViewer(); if (viewer) lastTabPage = index; @@ -775,6 +794,7 @@ void CentralWidget::currentPageChanged(int index) void CentralWidget::showTabBarContextMenu(const QPoint &point) { + TRACE_OBJ HelpViewer *viewer = helpViewerFromTabPosition(tabWidget, point); if (!viewer) return; @@ -822,11 +842,12 @@ void CentralWidget::showTabBarContextMenu(const QPoint &point) } if (pickedAction == newBookmark) - emit addNewBookmark(viewer->documentTitle(), viewer->source().toString()); + emit addBookmark(viewer->documentTitle(), viewer->source().toString()); } bool CentralWidget::eventFilter(QObject *object, QEvent *e) { + TRACE_OBJ if (e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent*>(e); switch (ke->key()) { @@ -882,6 +903,7 @@ bool CentralWidget::eventFilter(QObject *object, QEvent *e) void CentralWidget::keyPressEvent(QKeyEvent *e) { + TRACE_OBJ const QString &text = e->text(); if (text.startsWith(QLatin1Char('/'))) { if (!findBar->isVisible()) { @@ -898,6 +920,7 @@ void CentralWidget::keyPressEvent(QKeyEvent *e) void CentralWidget::find(const QString &ttf, bool forward) { + TRACE_OBJ QPalette p = findWidget->editFind->palette(); p.setColor(QPalette::Active, QPalette::Base, Qt::white); @@ -919,6 +942,7 @@ void CentralWidget::find(const QString &ttf, bool forward) bool CentralWidget::findInWebPage(const QString &ttf, bool forward) { + TRACE_OBJ #if !defined(QT_NO_WEBKIT) if (HelpViewer *viewer = currentHelpViewer()) { bool found = false; @@ -949,12 +973,16 @@ bool CentralWidget::findInWebPage(const QString &ttf, bool forward) // this needs to stay, case for active search results page return findInTextBrowser(ttf, forward); +#else + Q_UNUSED(ttf); + Q_UNUSED(forward); #endif return false; } bool CentralWidget::findInTextBrowser(const QString &ttf, bool forward) { + TRACE_OBJ QTextBrowser *browser = qobject_cast<QTextBrowser*>(currentHelpViewer()); if (tabWidget->currentWidget() == m_searchWidget) browser = qFindChild<QTextBrowser*>(m_searchWidget); @@ -1006,6 +1034,7 @@ bool CentralWidget::findInTextBrowser(const QString &ttf, bool forward) void CentralWidget::updateBrowserFont() { + TRACE_OBJ QFont font; bool searchAttached = searchWidgetAttached(); if (searchAttached) { @@ -1021,6 +1050,7 @@ void CentralWidget::updateBrowserFont() void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) { + TRACE_OBJ if (m_searchWidget) return; @@ -1037,8 +1067,9 @@ void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) void CentralWidget::activateSearchWidget(bool updateLastTabPage) { + TRACE_OBJ if (!m_searchWidget) - createSearchWidget(helpEngine->searchEngine()); + createSearchWidget(HelpEngineWrapper::instance().searchEngine()); if (!m_searchWidget->isAttached()) { tabWidget->insertTab(0, m_searchWidget, tr("Search")); @@ -1054,6 +1085,7 @@ void CentralWidget::activateSearchWidget(bool updateLastTabPage) void CentralWidget::removeSearchWidget() { + TRACE_OBJ if (searchWidgetAttached()) { tabWidget->removeTab(0); m_searchWidget->setAttached(false); @@ -1062,6 +1094,7 @@ void CentralWidget::removeSearchWidget() int CentralWidget::availableHelpViewer() const { + TRACE_OBJ int count = tabWidget->count(); if (searchWidgetAttached()) count--; @@ -1070,6 +1103,7 @@ int CentralWidget::availableHelpViewer() const bool CentralWidget::enableTabCloseAction() const { + TRACE_OBJ int minTabCount = 1; if (searchWidgetAttached()) minTabCount = 2; @@ -1079,6 +1113,7 @@ bool CentralWidget::enableTabCloseAction() const QString CentralWidget::quoteTabTitle(const QString &title) const { + TRACE_OBJ QString s = title; return s.replace(QLatin1Char('&'), QLatin1String("&&")); } @@ -1086,6 +1121,7 @@ QString CentralWidget::quoteTabTitle(const QString &title) const void CentralWidget::setSourceFromSearch(const QUrl &url) { + TRACE_OBJ setSource(url); #if defined(QT_NO_WEBKIT) highlightSearchTerms(); @@ -1098,6 +1134,7 @@ CentralWidget::setSourceFromSearch(const QUrl &url) void CentralWidget::setSourceFromSearchInNewTab(const QUrl &url) { + TRACE_OBJ setSourceInNewTab(url); #if defined(QT_NO_WEBKIT) highlightSearchTerms(); @@ -1110,11 +1147,13 @@ CentralWidget::setSourceFromSearchInNewTab(const QUrl &url) void CentralWidget::highlightSearchTerms() { + TRACE_OBJ HelpViewer *viewer = currentHelpViewer(); if (!viewer) return; - QHelpSearchEngine *searchEngine = helpEngine->searchEngine(); + QHelpSearchEngine *searchEngine = + HelpEngineWrapper::instance().searchEngine(); QList<QHelpSearchQuery> queryList = searchEngine->query(); QStringList terms; @@ -1174,8 +1213,33 @@ CentralWidget::highlightSearchTerms() #endif } + +void CentralWidget::closeOrReloadTabs(const QList<int> &indices, bool tryReload) +{ + TRACE_OBJ + QList<int> sortedIndices = indices; + qSort(sortedIndices); + for (int i = sortedIndices.count(); --i >= 0;) { + const int tab = sortedIndices.at(i); + bool close = true; + if (tryReload) { + HelpViewer *viewer = + qobject_cast<HelpViewer*>(tabWidget->widget(tab)); + if (HelpEngineWrapper::instance().findFile(viewer->source()).isValid()) { + viewer->reload(); + close = false; + } + } + if (close) + closeTabAt(tab); + } + if (availableHelpViewer() == 0) + setSource(QUrl(QLatin1String("about:blank"))); +} + void CentralWidget::closeTabAt(int index) { + TRACE_OBJ HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(index)); tabWidget->removeTab(index); QTimer::singleShot(0, viewer, SLOT(deleteLater())); @@ -1183,8 +1247,9 @@ void CentralWidget::closeTabAt(int index) QMap<int, QString> CentralWidget::currentSourceFileList() const { + TRACE_OBJ QMap<int, QString> sourceList; - for (int i = 1; i < tabWidget->count(); ++i) { + for (int i = 0; i < tabWidget->count(); ++i) { HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(i)); if (viewer && viewer->source().isValid()) sourceList.insert(i, viewer->source().host()); @@ -1194,8 +1259,9 @@ QMap<int, QString> CentralWidget::currentSourceFileList() const void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) { - const QLatin1String key("useBrowserFont"); - if (!helpEngine->customValue(key, false).toBool()) { + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (!helpEngine.usesBrowserFont()) { *font = qApp->font(); // case for QTextBrowser and SearchWidget #if !defined(QT_NO_WEBKIT) QWebView *view = qobject_cast<QWebView*> (viewer); @@ -1206,13 +1272,13 @@ void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) } #endif } else { - *font = qVariantValue<QFont>(helpEngine->customValue( - QLatin1String("browserFont"))); + *font = helpEngine.browserFont(); } } void CentralWidget::setBrowserFontFor(QWidget *widget, const QFont &font) { + TRACE_OBJ #if !defined(QT_NO_WEBKIT) QWebView *view = qobject_cast<QWebView*> (widget); if (view) { diff --git a/tools/assistant/tools/assistant/centralwidget.h b/tools/assistant/tools/assistant/centralwidget.h index 9e32985..a7c0d6f 100644 --- a/tools/assistant/tools/assistant/centralwidget.h +++ b/tools/assistant/tools/assistant/centralwidget.h @@ -42,6 +42,7 @@ #ifndef CENTRALWIDGET_H #define CENTRALWIDGET_H +#include <QtCore/QList> #include <QtCore/QUrl> #include <QtCore/QPoint> #include <QtCore/QObject> @@ -109,7 +110,7 @@ class CentralWidget : public QWidget Q_OBJECT public: - CentralWidget(QHelpEngine *engine, MainWindow *parent); + CentralWidget(MainWindow *parent); ~CentralWidget(); void setupWidget(); @@ -134,6 +135,7 @@ public: int availableHelpViewer() const; bool enableTabCloseAction() const; + void closeOrReloadTabs(const QList<int> &indices, bool tryReload); void closeTabAt(int index); QMap<int, QString> currentSourceFileList() const; @@ -168,7 +170,7 @@ signals: void highlighted(const QString &link); void forwardAvailable(bool available); void backwardAvailable(bool available); - void addNewBookmark(const QString &title, const QString &url); + void addBookmark(const QString &title, const QString &url); protected: void keyPressEvent(QKeyEvent *); @@ -199,13 +201,11 @@ private: private: int lastTabPage; - QString collectionFile; QList<QAction*> globalActionList; QWidget *findBar; QTabWidget *tabWidget; FindWidget *findWidget; - QHelpEngine *helpEngine; QPrinter *printer; bool usesDefaultCollection; diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index 38814a5..bbc0c37 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -38,29 +38,17 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include <QtCore/QFileInfo> +#include <QtCore/QStringBuilder> #include <QtGui/QMessageBox> #include "cmdlineparser.h" QT_BEGIN_NAMESPACE -#define CHECK_NEXT_ARG \ - ++i < arguments.count() && !arguments.at(i).startsWith(QLatin1String("-")) - -CmdLineParser::CmdLineParser() - : m_enableRemoteControl(false), - m_contents(Untouched), - m_index(Untouched), - m_bookmarks(Untouched), - m_search(Untouched), - m_register(None), - m_removeSearchIndex(false), - m_copy(false), - m_quiet(false) -{ - m_helpMessage = QLatin1String( +const QString CmdLineParser::m_helpMessage = QLatin1String( "Usage: assistant [Options]\n\n" "-collectionFile file Uses the specified collection\n" " file instead of the default one\n" @@ -85,156 +73,72 @@ CmdLineParser::CmdLineParser() " file.\n" "-setCurrentFilter filter Set the filter as the active filter.\n" "-remove-search-index Removes the full text search index.\n" + "-rebuild-search-index Re-builds the full text search index (potentially slow).\n" "-quiet Does not display any error or\n" " status message.\n" "-help Displays this help.\n" ); -} -CmdLineParser::Result CmdLineParser::parse(const QStringList &arguments) -{ - QString error; - bool showHelp = false; - for (int j=1; j<arguments.count(); ++j) { - if (arguments.at(j).toLower() == QLatin1String("-quiet")) { +CmdLineParser::CmdLineParser(const QStringList &arguments) + : m_pos(0), + m_enableRemoteControl(false), + m_contents(Untouched), + m_index(Untouched), + m_bookmarks(Untouched), + m_search(Untouched), + m_register(None), + m_removeSearchIndex(false), + m_rebuildSearchIndex(false), + m_quiet(false) +{ + TRACE_OBJ + for (int i = 1; i < arguments.count(); ++i) { + const QString &arg = arguments.at(i); + if (arg.toLower() == "-quiet") m_quiet = true; - break; - } + else + m_arguments.append(arg); } +} - for (int i=1; i<arguments.count(); ++i) { - QString arg = arguments.at(i).toLower(); - if (arg == QLatin1String("-collectionfile")) { - if (CHECK_NEXT_ARG) { - m_collectionFile = getFileName(arguments.at(i)); - if (m_collectionFile.isEmpty()) { - error = QObject::tr("The specified collection file does not exist!"); - break; - } - } else { - error = QObject::tr("Missing collection file!"); - break; - } - } else if (arg == QLatin1String("-showurl")) { - if (CHECK_NEXT_ARG) { - QUrl url(arguments.at(i)); - if (url.isValid()) { - m_url = url; - } else { - error = QObject::tr("Invalid URL!"); - break; - } - } else { - error = QObject::tr("Missing URL!"); - break; - } - } else if (arg == QLatin1String("-enableremotecontrol")) { +CmdLineParser::Result CmdLineParser::parse() +{ + TRACE_OBJ + bool showHelp = false; + + while (m_error.isEmpty() && hasMoreArgs()) { + const QString &arg = nextArg().toLower(); + if (arg == QLatin1String("-collectionfile")) + handleCollectionFileOption(); + else if (arg == QLatin1String("-showurl")) + handleShowUrlOption(); + else if (arg == QLatin1String("-enableremotecontrol")) m_enableRemoteControl = true; - } else if (arg == QLatin1String("-show")) { - if (CHECK_NEXT_ARG) { - arg = arguments.at(i).toLower(); - if (arg == QLatin1String("contents")) { - m_contents = Show; - } else if (arg == QLatin1String("index")) { - m_index = Show; - } else if (arg == QLatin1String("bookmarks")) { - m_bookmarks = Show; - } else if (arg == QLatin1String("search")) { - m_search = Show; - } else { - error = QObject::tr("Unknown widget: %1").arg(arg); - break; - } - } else { - error = QObject::tr("Missing widget!"); - break; - } - } else if (arg == QLatin1String("-hide")) { - if (CHECK_NEXT_ARG) { - arg = arguments.at(i).toLower(); - if (arg == QLatin1String("contents")) { - m_contents = Hide; - } else if (arg == QLatin1String("index")) { - m_index = Hide; - } else if (arg == QLatin1String("bookmarks")) { - m_bookmarks = Hide; - } else if (arg == QLatin1String("search")) { - m_search = Hide; - } else { - error = QObject::tr("Unknown widget: %1").arg(arg); - break; - } - } else { - error = QObject::tr("Missing widget!"); - break; - } - } else if (arg == QLatin1String("-activate")) { - if (CHECK_NEXT_ARG) { - arg = arguments.at(i).toLower(); - if (arg == QLatin1String("contents")) { - m_contents = Activate; - } else if (arg == QLatin1String("index")) { - m_index = Activate; - } else if (arg == QLatin1String("bookmarks")) { - m_bookmarks = Activate; - } else if (arg == QLatin1String("search")) { - m_search = Activate; - } else { - error = QObject::tr("Unknown widget: %1").arg(arg); - break; - } - } else { - error = QObject::tr("Missing widget!"); - break; - } - } else if (arg == QLatin1String("-register")) { - if (CHECK_NEXT_ARG) { - m_helpFile = getFileName(arguments.at(i)); - if (m_helpFile.isEmpty()) { - error = QObject::tr("The specified Qt help file does not exist!"); - break; - } - m_register = Register; - } else { - error = QObject::tr("Missing help file!"); - break; - } - } else if (arg == QLatin1String("-unregister")) { - if (CHECK_NEXT_ARG) { - m_helpFile = getFileName(arguments.at(i)); - if (m_helpFile.isEmpty()) { - error = QObject::tr("The specified Qt help file does not exist!"); - break; - } - m_register = Unregister; - } else { - error = QObject::tr("Missing help file!"); - break; - } - } else if (arg == QLatin1String("-setcurrentfilter")) { - if (CHECK_NEXT_ARG) { - m_currentFilter = arguments.at(i); - } else { - error = QObject::tr("Missing filter argument!"); - break; - } - } else if (arg == QLatin1String("-remove-search-index")) { + else if (arg == QLatin1String("-show")) + handleShowOption(); + else if (arg == QLatin1String("-hide")) + handleHideOption(); + else if (arg == QLatin1String("-activate")) + handleActivateOption(); + else if (arg == QLatin1String("-register")) + handleRegisterOption(); + else if (arg == QLatin1String("-unregister")) + handleUnregisterOption(); + else if (arg == QLatin1String("-setcurrentfilter")) + handleSetCurrentFilterOption(); + else if (arg == QLatin1String("-remove-search-index")) m_removeSearchIndex = true; - } else if (arg == QLatin1String("-quiet")) { - continue; - } else if (arg == QLatin1String("-help")) { + else if (arg == QLatin1String("-rebuild-search-index")) + m_rebuildSearchIndex = true; + else if (arg == QLatin1String("-help")) showHelp = true; - } else if (arg == QLatin1String("-copy")) { - m_copy = true; - } else { - error = QObject::tr("Unknown option: %1").arg(arg); - break; - } + else + m_error = tr("Unknown option: %1").arg(arg); } - if (!error.isEmpty()) { - showMessage(error + QLatin1String("\n\n\n") + m_helpMessage, true); + if (!m_error.isEmpty()) { + showMessage(m_error + QLatin1String("\n\n\n") + m_helpMessage, true); return Error; } else if (showHelp) { showMessage(m_helpMessage, false); @@ -243,8 +147,125 @@ CmdLineParser::Result CmdLineParser::parse(const QStringList &arguments) return Ok; } +bool CmdLineParser::hasMoreArgs() const +{ + TRACE_OBJ + return m_pos < m_arguments.count(); +} + +const QString &CmdLineParser::nextArg() +{ + TRACE_OBJ + Q_ASSERT(hasMoreArgs()); + return m_arguments.at(m_pos++); +} + +void CmdLineParser::handleCollectionFileOption() +{ + TRACE_OBJ + if (hasMoreArgs()) { + const QString &fileName = nextArg(); + m_collectionFile = getFileName(fileName); + if (m_collectionFile.isEmpty()) + m_error = tr("The collection file '%1' does not exist!"). + arg(fileName); + } else { + m_error = tr("Missing collection file!"); + } +} + +void CmdLineParser::handleShowUrlOption() +{ + TRACE_OBJ + if (hasMoreArgs()) { + const QString &urlString = nextArg(); + QUrl url(urlString); + if (url.isValid()) { + m_url = url; + } else + m_error = tr("Invalid URL '%1'!").arg(urlString); + } else { + m_error = tr("Missing URL!"); + } +} + +void CmdLineParser::handleShowOption() +{ + TRACE_OBJ + handleShowOrHideOrActivateOption(Show); +} + +void CmdLineParser::handleHideOption() +{ + TRACE_OBJ + handleShowOrHideOrActivateOption(Hide); +} + +void CmdLineParser::handleActivateOption() +{ + TRACE_OBJ + handleShowOrHideOrActivateOption(Activate); +} + +void CmdLineParser::handleShowOrHideOrActivateOption(ShowState state) +{ + TRACE_OBJ + if (hasMoreArgs()) { + const QString &widget = nextArg().toLower(); + if (widget == QLatin1String("contents")) + m_contents = state; + else if (widget == QLatin1String("index")) + m_index = state; + else if (widget == QLatin1String("bookmarks")) + m_bookmarks = state; + else if (widget == QLatin1String("search")) + m_search = state; + else + m_error = tr("Unknown widget: %1").arg(widget); + } else { + m_error = tr("Missing widget!"); + } +} + +void CmdLineParser::handleRegisterOption() +{ + TRACE_OBJ + handleRegisterOrUnregisterOption(Register); +} + +void CmdLineParser::handleUnregisterOption() +{ + TRACE_OBJ + handleRegisterOrUnregisterOption(Unregister); +} + +void CmdLineParser::handleRegisterOrUnregisterOption(RegisterState state) +{ + TRACE_OBJ + if (hasMoreArgs()) { + const QString &fileName = nextArg(); + m_helpFile = getFileName(fileName); + if (m_helpFile.isEmpty()) + m_error = tr("The Qt help file '%1' does not exist!").arg(fileName); + else + m_register = state; + } else { + m_error = tr("Missing help file!"); + } +} + +void CmdLineParser::handleSetCurrentFilterOption() +{ + TRACE_OBJ + if (hasMoreArgs()) + m_currentFilter = nextArg(); + else + m_error = tr("Missing filter argument!"); +} + QString CmdLineParser::getFileName(const QString &fileName) { + TRACE_OBJ QFileInfo fi(fileName); if (!fi.exists()) return QString(); @@ -253,14 +274,15 @@ QString CmdLineParser::getFileName(const QString &fileName) void CmdLineParser::showMessage(const QString &msg, bool error) { + TRACE_OBJ if (m_quiet) return; #ifdef Q_OS_WIN - QString s = QLatin1String("<pre>") + msg + QLatin1String("</pre>"); + QString message = QLatin1String("<pre>") % msg % QLatin1String("</pre>"); if (error) - QMessageBox::critical(0, QObject::tr("Qt Assistant"), s); + QMessageBox::critical(0, tr("Error"), message); else - QMessageBox::information(0, QObject::tr("Qt Assistant"), s); + QMessageBox::information(0, tr("Notice"), message); #else fprintf(error ? stderr : stdout, "%s\n", qPrintable(msg)); #endif @@ -268,61 +290,79 @@ void CmdLineParser::showMessage(const QString &msg, bool error) void CmdLineParser::setCollectionFile(const QString &file) { + TRACE_OBJ m_collectionFile = file; } QString CmdLineParser::collectionFile() const { + TRACE_OBJ return m_collectionFile; } QUrl CmdLineParser::url() const { + TRACE_OBJ return m_url; } bool CmdLineParser::enableRemoteControl() const { + TRACE_OBJ return m_enableRemoteControl; } CmdLineParser::ShowState CmdLineParser::contents() const { + TRACE_OBJ return m_contents; } CmdLineParser::ShowState CmdLineParser::index() const { + TRACE_OBJ return m_index; } CmdLineParser::ShowState CmdLineParser::bookmarks() const { + TRACE_OBJ return m_bookmarks; } CmdLineParser::ShowState CmdLineParser::search() const { + TRACE_OBJ return m_search; } QString CmdLineParser::currentFilter() const { + TRACE_OBJ return m_currentFilter; } bool CmdLineParser::removeSearchIndex() const { + TRACE_OBJ return m_removeSearchIndex; } +bool CmdLineParser::rebuildSearchIndex() const +{ + TRACE_OBJ + return m_rebuildSearchIndex; +} + CmdLineParser::RegisterState CmdLineParser::registerRequest() const { + TRACE_OBJ return m_register; } QString CmdLineParser::helpFile() const { + TRACE_OBJ return m_helpFile; } diff --git a/tools/assistant/tools/assistant/cmdlineparser.h b/tools/assistant/tools/assistant/cmdlineparser.h index 17707cb..5573081 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.h +++ b/tools/assistant/tools/assistant/cmdlineparser.h @@ -42,6 +42,7 @@ #ifndef CMDLINEPARSER_H #define CMDLINEPARSER_H +#include <QtCore/QCoreApplication> #include <QtCore/QStringList> #include <QtCore/QUrl> @@ -49,13 +50,14 @@ QT_BEGIN_NAMESPACE class CmdLineParser { + Q_DECLARE_TR_FUNCTIONS(CmdLineParser) public: enum Result {Ok, Help, Error}; enum ShowState {Untouched, Show, Hide, Activate}; enum RegisterState {None, Register, Unregister}; - CmdLineParser(); - Result parse(const QStringList &arguments); + CmdLineParser(const QStringList &arguments); + Result parse(); void setCollectionFile(const QString &file); QString collectionFile() const; @@ -68,17 +70,30 @@ public: ShowState search() const; QString currentFilter() const; bool removeSearchIndex() const; + bool rebuildSearchIndex() const; RegisterState registerRequest() const; QString helpFile() const; - bool copy() const { return m_copy; } - void showMessage(const QString &msg, bool error); private: QString getFileName(const QString &fileName); + bool hasMoreArgs() const; + const QString &nextArg(); + void handleCollectionFileOption(); + void handleShowUrlOption(); + void handleShowOption(); + void handleHideOption(); + void handleActivateOption(); + void handleShowOrHideOrActivateOption(ShowState state); + void handleRegisterOption(); + void handleUnregisterOption(); + void handleRegisterOrUnregisterOption(RegisterState state); + void handleSetCurrentFilterOption(); - QString m_helpMessage; + QStringList m_arguments; + int m_pos; + static const QString m_helpMessage; QString m_collectionFile; QString m_cloneFile; QString m_helpFile; @@ -92,8 +107,9 @@ private: RegisterState m_register; QString m_currentFilter; bool m_removeSearchIndex; - bool m_copy; + bool m_rebuildSearchIndex; bool m_quiet; + QString m_error; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp index 4640673..976ed7a 100644 --- a/tools/assistant/tools/assistant/contentwindow.cpp +++ b/tools/assistant/tools/assistant/contentwindow.cpp @@ -38,25 +38,26 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "contentwindow.h" #include "centralwidget.h" +#include "helpenginewrapper.h" +#include "helpviewer.h" #include <QtGui/QLayout> #include <QtGui/QFocusEvent> #include <QtGui/QMenu> -#include <QtHelp/QHelpEngine> #include <QtHelp/QHelpContentWidget> QT_BEGIN_NAMESPACE -ContentWindow::ContentWindow(QHelpEngine *helpEngine) - : m_helpEngine(helpEngine) - , m_contentWidget(0) +ContentWindow::ContentWindow() + : m_contentWidget(HelpEngineWrapper::instance().contentWidget()) , m_expandDepth(-2) { - m_contentWidget = m_helpEngine->contentWidget(); + TRACE_OBJ m_contentWidget->viewport()->installEventFilter(this); m_contentWidget->setContextMenuPolicy(Qt::CustomContextMenu); @@ -76,10 +77,12 @@ ContentWindow::ContentWindow(QHelpEngine *helpEngine) ContentWindow::~ContentWindow() { + TRACE_OBJ } bool ContentWindow::syncToContent(const QUrl& url) { + TRACE_OBJ QModelIndex idx = m_contentWidget->indexOf(url); if (!idx.isValid()) return false; @@ -89,6 +92,8 @@ bool ContentWindow::syncToContent(const QUrl& url) void ContentWindow::expandTOC() { + TRACE_OBJ + Q_ASSERT(m_expandDepth >= -2); if (m_expandDepth > -2) { expandToDepth(m_expandDepth); m_expandDepth = -2; @@ -97,27 +102,34 @@ void ContentWindow::expandTOC() void ContentWindow::expandToDepth(int depth) { + TRACE_OBJ + Q_ASSERT(depth >= -2); m_expandDepth = depth; if (depth == -1) m_contentWidget->expandAll(); + else if (depth == 0) + m_contentWidget->collapseAll(); else - m_contentWidget->expandToDepth(depth); + m_contentWidget->expandToDepth(depth - 1); } void ContentWindow::focusInEvent(QFocusEvent *e) { + TRACE_OBJ if (e->reason() != Qt::MouseFocusReason) m_contentWidget->setFocus(); } void ContentWindow::keyPressEvent(QKeyEvent *e) { + TRACE_OBJ if (e->key() == Qt::Key_Escape) emit escapePressed(); } bool ContentWindow::eventFilter(QObject *o, QEvent *e) { + TRACE_OBJ if (m_contentWidget && o == m_contentWidget->viewport() && e->type() == QEvent::MouseButtonRelease) { QMouseEvent *me = static_cast<QMouseEvent*>(e); @@ -132,7 +144,7 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e) qobject_cast<QHelpContentModel*>(m_contentWidget->model()); if (contentModel) { QHelpContentItem *itm = contentModel->contentItemAt(index); - if (itm && !isPdfFile(itm)) + if (itm && HelpViewer::canOpenPage(itm->url().path())) CentralWidget::instance()->setSourceInNewTab(itm->url()); } } else if (button == Qt::LeftButton) { @@ -146,6 +158,7 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e) void ContentWindow::showContextMenu(const QPoint &pos) { + TRACE_OBJ if (!m_contentWidget->indexAt(pos).isValid()) return; @@ -157,7 +170,7 @@ void ContentWindow::showContextMenu(const QPoint &pos) QMenu menu; QAction *curTab = menu.addAction(tr("Open Link")); QAction *newTab = menu.addAction(tr("Open Link in New Tab")); - if (isPdfFile(itm)) + if (!HelpViewer::canOpenPage(itm->url().path())) newTab->setEnabled(false); menu.move(m_contentWidget->mapToGlobal(pos)); @@ -171,6 +184,7 @@ void ContentWindow::showContextMenu(const QPoint &pos) void ContentWindow::itemClicked(const QModelIndex &index) { + TRACE_OBJ QHelpContentModel *contentModel = qobject_cast<QHelpContentModel*>(m_contentWidget->model()); @@ -181,10 +195,4 @@ void ContentWindow::itemClicked(const QModelIndex &index) } } -bool ContentWindow::isPdfFile(QHelpContentItem *item) const -{ - const QString &path = item->url().path(); - return path.endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive); -} - QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/contentwindow.h b/tools/assistant/tools/assistant/contentwindow.h index f3bf060..62855dd 100644 --- a/tools/assistant/tools/assistant/contentwindow.h +++ b/tools/assistant/tools/assistant/contentwindow.h @@ -57,7 +57,7 @@ class ContentWindow : public QWidget Q_OBJECT public: - ContentWindow(QHelpEngine *helpEngine); + ContentWindow(); ~ContentWindow(); bool syncToContent(const QUrl &url); @@ -78,8 +78,7 @@ private: bool eventFilter(QObject *o, QEvent *e); bool isPdfFile(QHelpContentItem *item) const; - QHelpEngine *m_helpEngine; - QHelpContentWidget *m_contentWidget; + QHelpContentWidget * const m_contentWidget; int m_expandDepth; }; diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf index b8726a4..3b4b5f8 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdocconf +++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf @@ -12,5 +12,5 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ "<td width=\"30%\" align=\"left\">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ "<td width=\"40%\" align=\"center\">Trademarks</td>\n" \ - "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.2</div></td>\n" \ + "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.7.0</div></td>\n" \ "</tr></table></div></address>" diff --git a/tools/assistant/tools/assistant/filternamedialog.cpp b/tools/assistant/tools/assistant/filternamedialog.cpp index 1560e04..f75f999 100644 --- a/tools/assistant/tools/assistant/filternamedialog.cpp +++ b/tools/assistant/tools/assistant/filternamedialog.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include <QtGui/QPushButton> @@ -48,6 +49,7 @@ QT_BEGIN_NAMESPACE FilterNameDialog::FilterNameDialog(QWidget *parent) : QDialog(parent) { + TRACE_OBJ m_ui.setupUi(this); connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(accept())); @@ -61,11 +63,13 @@ FilterNameDialog::FilterNameDialog(QWidget *parent) QString FilterNameDialog::filterName() const { + TRACE_OBJ return m_ui.lineEdit->text(); } void FilterNameDialog::updateOkButton() { + TRACE_OBJ m_ui.buttonBox->button(QDialogButtonBox::Ok) ->setDisabled(m_ui.lineEdit->text().isEmpty()); } diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp new file mode 100644 index 0000000..ddc056a --- /dev/null +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -0,0 +1,804 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "helpenginewrapper.h" +#include "../shared/collectionconfiguration.h" + +#include <QtCore/QDateTime> +#include <QtCore/QFileInfo> +#include <QtCore/QFileSystemWatcher> +#include <QtCore/QPair> +#include <QtCore/QSharedPointer> +#include <QtCore/QTimer> +#include <QtHelp/QHelpContentModel> +#include <QtHelp/QHelpEngine> +#include <QtHelp/QHelpIndexModel> +#include <QtHelp/QHelpSearchEngine> + +QT_BEGIN_NAMESPACE + +namespace { + const QString Unfiltered; + const QString AppFontKey(QLatin1String("appFont")); + const QString AppWritingSystemKey(QLatin1String("appWritingSystem")); + const QString BookmarksKey(QLatin1String("Bookmarks")); + const QString BrowserFontKey(QLatin1String("browserFont")); + const QString BrowserWritingSystemKey(QLatin1String("browserWritingSystem")); + const QString HomePageKey(QLatin1String("homepage")); + const QString MainWindowKey(QLatin1String("MainWindow")); + const QString MainWindowGeometryKey(QLatin1String("MainWindowGeometry")); + const QString SearchWasAttachedKey(QLatin1String("SearchWasAttached")); + const QString StartOptionKey(QLatin1String("StartOption")); + const QString UseAppFontKey(QLatin1String("useAppFont")); + const QString UseBrowserFontKey(QLatin1String("useBrowserFont")); + const QString VersionKey(QString(QLatin1String("qtVersion%1$$$%2")). + arg(QLatin1String(QT_VERSION_STR))); +} // anonymous namespace + +class TimeoutForwarder : public QObject +{ + Q_OBJECT +public: + TimeoutForwarder(const QString &fileName); +private slots: + void forward(); +private: + friend class HelpEngineWrapperPrivate; + + const QString m_fileName; +}; + +class HelpEngineWrapperPrivate : public QObject +{ + Q_OBJECT + friend class HelpEngineWrapper; + friend class TimeoutForwarder; +private slots: + void qchFileChanged(const QString &fileName); + +signals: + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); + +private: + HelpEngineWrapperPrivate(const QString &collectionFile); + + void initFileSystemWatchers(); + void assertDocFilesWatched(); + void qchFileChanged(const QString &fileName, bool fromTimeout); + + static const int UpdateGracePeriod = 2000; + + QHelpEngine * const m_helpEngine; + QFileSystemWatcher * const m_qchWatcher; + typedef QPair<QDateTime, QSharedPointer<TimeoutForwarder> > RecentSignal; + QMap<QString, RecentSignal> m_recentQchUpdates; +}; + +const QString HelpEngineWrapper::TrUnfiltered = tr("Unfiltered"); + +HelpEngineWrapper *HelpEngineWrapper::helpEngineWrapper = 0; + +HelpEngineWrapper &HelpEngineWrapper::instance(const QString &collectionFile) +{ + TRACE_OBJ + /* + * Note that this Singleton cannot be static, because it has to be + * deleted before the QApplication. + */ + if (helpEngineWrapper == 0) + helpEngineWrapper = new HelpEngineWrapper(collectionFile); + return *helpEngineWrapper; +} + +void HelpEngineWrapper::removeInstance() +{ + TRACE_OBJ + delete helpEngineWrapper; + helpEngineWrapper = 0; +} + +HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) + : d(new HelpEngineWrapperPrivate(collectionFile)) +{ + TRACE_OBJ + connect(d, SIGNAL(documentationRemoved(QString)), + this, SIGNAL(documentationRemoved(QString))); + connect(d, SIGNAL(documentationUpdated(QString)), + this, SIGNAL(documentationUpdated(QString))); + connect(d->m_helpEngine, SIGNAL(currentFilterChanged(QString)), + this, SLOT(handleCurrentFilterChanged(QString))); + connect(d->m_helpEngine, SIGNAL(setupFinished()), + this, SIGNAL(setupFinished())); +} + +HelpEngineWrapper::~HelpEngineWrapper() +{ + TRACE_OBJ + delete d; +} + +QHelpSearchEngine *HelpEngineWrapper::searchEngine() const +{ + TRACE_OBJ + return d->m_helpEngine->searchEngine(); +} + +QHelpContentModel *HelpEngineWrapper::contentModel() const +{ + TRACE_OBJ + return d->m_helpEngine->contentModel(); +} + +QHelpIndexModel *HelpEngineWrapper::indexModel() const +{ + TRACE_OBJ + return d->m_helpEngine->indexModel(); +} + +QHelpContentWidget *HelpEngineWrapper::contentWidget() +{ + TRACE_OBJ + return d->m_helpEngine->contentWidget(); +} + +QHelpIndexWidget *HelpEngineWrapper::indexWidget() +{ + TRACE_OBJ + return d->m_helpEngine->indexWidget(); +} + +const QStringList HelpEngineWrapper::registeredDocumentations() const +{ + TRACE_OBJ + return d->m_helpEngine->registeredDocumentations(); +} + +const QString HelpEngineWrapper::collectionFile() const +{ + TRACE_OBJ + return d->m_helpEngine->collectionFile(); +} + +bool HelpEngineWrapper::registerDocumentation(const QString &docFile) +{ + TRACE_OBJ + d->assertDocFilesWatched(); + if (!d->m_helpEngine->registerDocumentation(docFile)) + return false; + d->m_qchWatcher->addPath(docFile); + d->assertDocFilesWatched(); + return true; +} + +bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName) +{ + TRACE_OBJ + d->assertDocFilesWatched(); + const QString &file = d->m_helpEngine->documentationFileName(namespaceName); + if (!d->m_helpEngine->unregisterDocumentation(namespaceName)) + return false; + d->m_qchWatcher->removePath(file); + d->assertDocFilesWatched(); + return true; +} + +bool HelpEngineWrapper::setupData() +{ + TRACE_OBJ + return d->m_helpEngine->setupData(); +} + +bool HelpEngineWrapper::addCustomFilter(const QString &filterName, + const QStringList &attributes) +{ + TRACE_OBJ + return d->m_helpEngine->addCustomFilter(filterName, attributes); +} + +bool HelpEngineWrapper::removeCustomFilter(const QString &filterName) +{ + TRACE_OBJ + return d->m_helpEngine->removeCustomFilter(filterName); +} + +void HelpEngineWrapper::setCurrentFilter(const QString ¤tFilter) +{ + TRACE_OBJ + const QString &filter + = currentFilter == TrUnfiltered ? Unfiltered : currentFilter; + d->m_helpEngine->setCurrentFilter(filter); +} + +const QString HelpEngineWrapper::currentFilter() const +{ + TRACE_OBJ + const QString &filter = d->m_helpEngine->currentFilter(); + return filter == Unfiltered ? TrUnfiltered : filter; +} + +const QStringList HelpEngineWrapper::customFilters() const +{ + TRACE_OBJ + QStringList filters = d->m_helpEngine->customFilters(); + filters.removeOne(Unfiltered); + filters.prepend(TrUnfiltered); + return filters; +} + +QUrl HelpEngineWrapper::findFile(const QUrl &url) const +{ + TRACE_OBJ + return d->m_helpEngine->findFile(url); +} + +QByteArray HelpEngineWrapper::fileData(const QUrl &url) const +{ + TRACE_OBJ + return d->m_helpEngine->fileData(url); +} + +QMap<QString, QUrl> HelpEngineWrapper::linksForIdentifier(const QString &id) const +{ + TRACE_OBJ + return d->m_helpEngine->linksForIdentifier(id); +} + +const QStringList HelpEngineWrapper::filterAttributes() const +{ + TRACE_OBJ + return d->m_helpEngine->filterAttributes(); +} + +const QStringList HelpEngineWrapper::filterAttributes(const QString &filterName) const +{ + TRACE_OBJ + return d->m_helpEngine->filterAttributes(filterName); +} + +QString HelpEngineWrapper::error() const +{ + TRACE_OBJ + return d->m_helpEngine->error(); +} + +const QStringList HelpEngineWrapper::qtDocInfo(const QString &component) const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(VersionKey.arg(component)).toString(). + split(CollectionConfiguration::ListSeparator); +} + +void HelpEngineWrapper::setQtDocInfo(const QString &component, + const QStringList &doc) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(VersionKey.arg(component), + doc.join(CollectionConfiguration::ListSeparator)); +} + +const QStringList HelpEngineWrapper::lastShownPages() const +{ + TRACE_OBJ + return CollectionConfiguration::lastShownPages(*d->m_helpEngine); +} + +void HelpEngineWrapper::setLastShownPages(const QStringList &lastShownPages) +{ + TRACE_OBJ + CollectionConfiguration::setLastShownPages(*d->m_helpEngine, lastShownPages); +} + +const QStringList HelpEngineWrapper::lastZoomFactors() const +{ + TRACE_OBJ + return CollectionConfiguration::lastZoomFactors(*d->m_helpEngine); +} + +void HelpEngineWrapper::setLastZoomFactors(const QStringList &lastZoomFactors) +{ + TRACE_OBJ + CollectionConfiguration::setLastZoomFactors(*d->m_helpEngine, lastZoomFactors); +} + +const QString HelpEngineWrapper::cacheDir() const +{ + TRACE_OBJ + return CollectionConfiguration::cacheDir(*d->m_helpEngine); +} + +bool HelpEngineWrapper::cacheDirIsRelativeToCollection() const +{ + TRACE_OBJ + return CollectionConfiguration::cacheDirIsRelativeToCollection(*d->m_helpEngine); +} + +void HelpEngineWrapper::setCacheDir(const QString &cacheDir, + bool relativeToCollection) +{ + TRACE_OBJ + CollectionConfiguration::setCacheDir(*d->m_helpEngine, cacheDir, + relativeToCollection); +} + +bool HelpEngineWrapper::filterFunctionalityEnabled() const +{ + TRACE_OBJ + return CollectionConfiguration::filterFunctionalityEnabled(*d->m_helpEngine); +} + +void HelpEngineWrapper::setFilterFunctionalityEnabled(bool enabled) +{ + TRACE_OBJ + CollectionConfiguration::setFilterFunctionalityEnabled(*d->m_helpEngine, + enabled); +} + +bool HelpEngineWrapper::filterToolbarVisible() const +{ + TRACE_OBJ + return CollectionConfiguration::filterToolbarVisible(*d->m_helpEngine); +} + +void HelpEngineWrapper::setFilterToolbarVisible(bool visible) +{ + TRACE_OBJ + CollectionConfiguration::setFilterToolbarVisible(*d->m_helpEngine, visible); +} + +bool HelpEngineWrapper::addressBarEnabled() const +{ + TRACE_OBJ + return CollectionConfiguration::addressBarEnabled(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAddressBarEnabled(bool enabled) +{ + TRACE_OBJ + CollectionConfiguration::setAddressBarEnabled(*d->m_helpEngine, enabled); +} + +bool HelpEngineWrapper::addressBarVisible() const +{ + TRACE_OBJ + return CollectionConfiguration::addressBarVisible(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAddressBarVisible(bool visible) +{ + TRACE_OBJ + CollectionConfiguration::setAddressBarVisible(*d->m_helpEngine, visible); +} + +bool HelpEngineWrapper::documentationManagerEnabled() const +{ + TRACE_OBJ + return CollectionConfiguration::documentationManagerEnabled(*d->m_helpEngine); +} + +void HelpEngineWrapper::setDocumentationManagerEnabled(bool enabled) +{ + TRACE_OBJ + CollectionConfiguration::setDocumentationManagerEnabled(*d->m_helpEngine, + enabled); +} + +const QByteArray HelpEngineWrapper::aboutMenuTexts() const +{ + TRACE_OBJ + return CollectionConfiguration::aboutMenuTexts(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAboutMenuTexts(const QByteArray &texts) +{ + TRACE_OBJ + CollectionConfiguration::setAboutMenuTexts(*d->m_helpEngine, texts); +} + +const QByteArray HelpEngineWrapper::aboutIcon() const +{ + TRACE_OBJ + return CollectionConfiguration::aboutIcon(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAboutIcon(const QByteArray &icon) +{ + TRACE_OBJ + CollectionConfiguration::setAboutIcon(*d->m_helpEngine, icon); +} + +const QByteArray HelpEngineWrapper::aboutImages() const +{ + TRACE_OBJ + return CollectionConfiguration::aboutImages(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAboutImages(const QByteArray &images) +{ + TRACE_OBJ + CollectionConfiguration::setAboutImages(*d->m_helpEngine, images); +} + +const QByteArray HelpEngineWrapper::aboutTexts() const +{ + TRACE_OBJ + return CollectionConfiguration::aboutTexts(*d->m_helpEngine); +} + +void HelpEngineWrapper::setAboutTexts(const QByteArray &texts) +{ + TRACE_OBJ + CollectionConfiguration::setAboutTexts(*d->m_helpEngine, texts); +} + +const QString HelpEngineWrapper::windowTitle() const +{ + TRACE_OBJ + return CollectionConfiguration::windowTitle(*d->m_helpEngine); +} + +void HelpEngineWrapper::setWindowTitle(const QString &windowTitle) +{ + TRACE_OBJ + CollectionConfiguration::setWindowTitle(*d->m_helpEngine, windowTitle); +} + +const QByteArray HelpEngineWrapper::applicationIcon() const +{ + TRACE_OBJ + return CollectionConfiguration::applicationIcon(*d->m_helpEngine); +} + +void HelpEngineWrapper::setApplicationIcon(const QByteArray &icon) +{ + TRACE_OBJ + CollectionConfiguration::setApplicationIcon(*d->m_helpEngine, icon); +} + +const QByteArray HelpEngineWrapper::mainWindow() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(MainWindowKey).toByteArray(); +} + +void HelpEngineWrapper::setMainWindow(const QByteArray &mainWindow) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(MainWindowKey, mainWindow); +} + +const QByteArray HelpEngineWrapper::mainWindowGeometry() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(MainWindowGeometryKey).toByteArray(); +} + +void HelpEngineWrapper::setMainWindowGeometry(const QByteArray &geometry) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(MainWindowGeometryKey, geometry); +} + +const QByteArray HelpEngineWrapper::bookmarks() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(BookmarksKey).toByteArray(); +} + +void HelpEngineWrapper::setBookmarks(const QByteArray &bookmarks) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(BookmarksKey, bookmarks); +} + +int HelpEngineWrapper::lastTabPage() const +{ + TRACE_OBJ + return CollectionConfiguration::lastTabPage(*d->m_helpEngine); +} + +void HelpEngineWrapper::setLastTabPage(int lastPage) +{ + TRACE_OBJ + CollectionConfiguration::setLastTabPage(*d->m_helpEngine, lastPage); +} + +bool HelpEngineWrapper::searchWasAttached() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(SearchWasAttachedKey).toBool(); +} + +void HelpEngineWrapper::setSearchWasAttached(bool attached) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(SearchWasAttachedKey, attached); +} + +int HelpEngineWrapper::startOption() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(StartOptionKey, ShowLastPages).toInt(); +} + +void HelpEngineWrapper::setStartOption(int option) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(StartOptionKey, option); +} + +const QString HelpEngineWrapper::homePage() const +{ + TRACE_OBJ + const QString &homePage + = d->m_helpEngine->customValue(HomePageKey).toString(); + if (!homePage.isEmpty()) + return homePage; + return defaultHomePage(); +} + +void HelpEngineWrapper::setHomePage(const QString &page) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(HomePageKey, page); + +} + +const QString HelpEngineWrapper::defaultHomePage() const +{ + TRACE_OBJ + return CollectionConfiguration::defaultHomePage(*d->m_helpEngine); +} + +void HelpEngineWrapper::setDefaultHomePage(const QString &page) +{ + TRACE_OBJ + CollectionConfiguration::setDefaultHomePage(*d->m_helpEngine, page); +} + +bool HelpEngineWrapper::hasFontSettings() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(UseAppFontKey).isValid(); +} + +bool HelpEngineWrapper::usesAppFont() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(UseAppFontKey).toBool(); +} + +void HelpEngineWrapper::setUseAppFont(bool useAppFont) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(UseAppFontKey, useAppFont); +} + +bool HelpEngineWrapper::usesBrowserFont() const +{ + TRACE_OBJ + return d->m_helpEngine->customValue(UseBrowserFontKey, false).toBool(); +} + +void HelpEngineWrapper::setUseBrowserFont(bool useBrowserFont) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(UseBrowserFontKey, useBrowserFont); +} + +const QFont HelpEngineWrapper::appFont() const +{ + TRACE_OBJ + return qVariantValue<QFont>(d->m_helpEngine->customValue(AppFontKey)); +} + +void HelpEngineWrapper::setAppFont(const QFont &font) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(AppFontKey, font); +} + +QFontDatabase::WritingSystem HelpEngineWrapper::appWritingSystem() const +{ + TRACE_OBJ + return static_cast<QFontDatabase::WritingSystem>( + d->m_helpEngine->customValue(AppWritingSystemKey).toInt()); +} + +void HelpEngineWrapper::setAppWritingSystem(QFontDatabase::WritingSystem system) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(AppWritingSystemKey, system); +} + +const QFont HelpEngineWrapper::browserFont() const +{ + TRACE_OBJ + return qVariantValue<QFont>(d->m_helpEngine->customValue(BrowserFontKey)); +} + +void HelpEngineWrapper::setBrowserFont(const QFont &font) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(BrowserFontKey, font); +} + +QFontDatabase::WritingSystem HelpEngineWrapper::browserWritingSystem() const +{ + TRACE_OBJ + return static_cast<QFontDatabase::WritingSystem>( + d->m_helpEngine->customValue(BrowserWritingSystemKey).toInt()); +} + +void HelpEngineWrapper::setBrowserWritingSystem(QFontDatabase::WritingSystem system) +{ + TRACE_OBJ + d->m_helpEngine->setCustomValue(BrowserWritingSystemKey, system); +} + +void HelpEngineWrapper::handleCurrentFilterChanged(const QString &filter) +{ + const QString &filterToReport + = filter == Unfiltered ? TrUnfiltered : filter; + emit currentFilterChanged(filterToReport); +} + + +TimeoutForwarder::TimeoutForwarder(const QString &fileName) + : m_fileName(fileName) +{ + TRACE_OBJ +} + +void TimeoutForwarder::forward() +{ + TRACE_OBJ + HelpEngineWrapper::instance().d->qchFileChanged(m_fileName, true); +} + + +HelpEngineWrapperPrivate::HelpEngineWrapperPrivate(const QString &collectionFile) + : m_helpEngine(new QHelpEngine(collectionFile, this)), + m_qchWatcher(new QFileSystemWatcher(this)) +{ + TRACE_OBJ + if (!m_helpEngine->customFilters().contains(Unfiltered)) + m_helpEngine->addCustomFilter(Unfiltered, QStringList()); + initFileSystemWatchers(); +} + +void HelpEngineWrapperPrivate::initFileSystemWatchers() +{ + TRACE_OBJ + foreach(const QString &ns, m_helpEngine->registeredDocumentations()) { + const QString &docFile = m_helpEngine->documentationFileName(ns); + m_qchWatcher->addPath(docFile); + connect(m_qchWatcher, SIGNAL(fileChanged(QString)), + this, SLOT(qchFileChanged(QString))); + } + assertDocFilesWatched(); +} + +void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName) +{ + TRACE_OBJ + qchFileChanged(fileName, false); +} + +void HelpEngineWrapperPrivate::assertDocFilesWatched() +{ + TRACE_OBJ + Q_ASSERT(m_qchWatcher->files().count() + == m_helpEngine->registeredDocumentations().count()); +} + +void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName, + bool fromTimeout) +{ + TRACE_OBJ + + /* + * We don't use QHelpEngineCore::namespaceName(fileName), because the file + * may not exist anymore or contain a different namespace. + */ + QString ns; + foreach (const QString &curNs, m_helpEngine->registeredDocumentations()) { + if (m_helpEngine->documentationFileName(curNs) == fileName) { + ns = curNs; + break; + } + } + + /* + * We can't do an assertion here, because QFileSystemWatcher may send the + * signal more than once. + */ + if (ns.isEmpty()) { + m_recentQchUpdates.remove(fileName); + return; + } + + /* + * Since the QFileSystemWatcher typically sends the signal more than once, + * we repeatedly delay our reaction a bit until we think the last signal + * was sent. + */ + + QMap<QString, RecentSignal>::Iterator it = m_recentQchUpdates.find(fileName); + const QDateTime &now = QDateTime::currentDateTime(); + + // Case 1: This is the first recent signal for the file. + if (it == m_recentQchUpdates.end()) { + QSharedPointer<TimeoutForwarder> forwarder(new TimeoutForwarder(fileName)); + m_recentQchUpdates.insert(fileName, RecentSignal(now, forwarder)); + QTimer::singleShot(UpdateGracePeriod, forwarder.data(), SLOT(forward())); + return; + } + + // Case 2: The last signal for this file has not expired yet. + if (it.value().first > now.addMSecs(-UpdateGracePeriod)) { + if (!fromTimeout) + it.value().first = now; + else + QTimer::singleShot(UpdateGracePeriod, it.value().second.data(), + SLOT(forward())); + return; + } + + // Case 3: The last signal for this file has expired. + if (m_helpEngine->unregisterDocumentation(ns)) { + if (!QFileInfo(fileName).exists() + || !m_helpEngine->registerDocumentation(fileName)) { + m_qchWatcher->removePath(fileName); + emit documentationRemoved(ns); + } else { + emit documentationUpdated(ns); + } + m_helpEngine->setupData(); + } + m_recentQchUpdates.erase(it); +} + + +QT_END_NAMESPACE + +#include "helpenginewrapper.moc" diff --git a/tools/assistant/tools/assistant/helpenginewrapper.h b/tools/assistant/tools/assistant/helpenginewrapper.h new file mode 100644 index 0000000..a30fab8 --- /dev/null +++ b/tools/assistant/tools/assistant/helpenginewrapper.h @@ -0,0 +1,210 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef HELPENGINEWRAPPER_H +#define HELPENGINEWRAPPER_H + +#include <QtCore/QMap> +#include <QtCore/QObject> +#include <QtCore/QString> +#include <QtCore/QStringList> +#include <QtCore/QUrl> +#include <QtGui/QFont> +#include <QtGui/QFontDatabase> + +QT_BEGIN_NAMESPACE + +class QFileSystemWatcher; +class QHelpContentModel; +class QHelpContentWidget; +class QHelpIndexModel; +class QHelpIndexWidget; +class QHelpSearchEngine; + +enum { + ShowHomePage = 0, + ShowBlankPage = 1, + ShowLastPages = 2 +}; + +class HelpEngineWrapperPrivate; +class TimeoutForwarder; + +class HelpEngineWrapper : public QObject +{ + Q_OBJECT + Q_DISABLE_COPY(HelpEngineWrapper) + friend class TimeoutForwarder; +public: + static HelpEngineWrapper &instance(const QString &collectionFile = QString()); + static void removeInstance(); + + // Forwarded help engine member functions, possibly enriched. + QHelpSearchEngine *searchEngine() const; + QHelpContentModel *contentModel() const; + QHelpIndexModel *indexModel() const; + QHelpContentWidget *contentWidget(); + QHelpIndexWidget *indexWidget(); + bool setupData(); + const QStringList registeredDocumentations() const; + const QString collectionFile() const; + bool registerDocumentation(const QString &docFile); + bool unregisterDocumentation(const QString &namespaceName); + bool addCustomFilter(const QString &filterName, + const QStringList &attributes); + bool removeCustomFilter(const QString &filterName); + void setCurrentFilter(const QString &filterName); + const QString currentFilter() const; + const QStringList customFilters() const; + QUrl findFile(const QUrl &url) const; + QByteArray fileData(const QUrl &url) const; + QMap<QString, QUrl> linksForIdentifier(const QString &id) const; + const QStringList filterAttributes() const; + const QStringList filterAttributes(const QString &filterName) const; + QString error() const; + + const QStringList qtDocInfo(const QString &component) const; + void setQtDocInfo(const QString &component, const QStringList &doc); + + const QString homePage() const; + void setHomePage(const QString &page); + const QString defaultHomePage() const; + void setDefaultHomePage(const QString &page); + + int lastTabPage() const; + void setLastTabPage(int lastPage); + + // TODO: Don't allow last pages and zoom factors to be set in isolation + // Perhaps also fill up missing elements automatically or assert. + const QStringList lastShownPages() const; + void setLastShownPages(const QStringList &lastShownPages); + const QStringList lastZoomFactors() const; + void setLastZoomFactors(const QStringList &lastZoomFactors); + + const QString cacheDir() const; + bool cacheDirIsRelativeToCollection() const; + void setCacheDir(const QString &cacheDir, bool relativeToCollection); + + bool filterFunctionalityEnabled() const; + void setFilterFunctionalityEnabled(bool enabled); + + bool filterToolbarVisible() const; + void setFilterToolbarVisible(bool visible); + + bool addressBarEnabled() const; + void setAddressBarEnabled(bool enabled); + + bool addressBarVisible() const; + void setAddressBarVisible(bool visible); + + bool documentationManagerEnabled() const; + void setDocumentationManagerEnabled(bool enabled); + + const QByteArray aboutMenuTexts() const; + void setAboutMenuTexts(const QByteArray &texts); + const QByteArray aboutTexts() const; + void setAboutTexts(const QByteArray &texts); + const QByteArray aboutIcon() const; + void setAboutIcon(const QByteArray &icon); + const QByteArray aboutImages() const; + void setAboutImages(const QByteArray &images); + + const QString windowTitle() const; + void setWindowTitle(const QString &windowTitle); + + const QByteArray applicationIcon() const; + void setApplicationIcon(const QByteArray &icon); + + const QByteArray mainWindow() const; + void setMainWindow(const QByteArray &mainWindow); + const QByteArray mainWindowGeometry() const; + void setMainWindowGeometry(const QByteArray &geometry); + + const QByteArray bookmarks() const; + void setBookmarks(const QByteArray &bookmarks); + + int startOption() const; + void setStartOption(int option); + + bool searchWasAttached() const; + void setSearchWasAttached(bool attached); + + bool hasFontSettings() const; + bool usesAppFont() const; + void setUseAppFont(bool useAppFont); + bool usesBrowserFont() const; + void setUseBrowserFont(bool useBrowserFont); + const QFont appFont() const; + void setAppFont(const QFont &font); + QFontDatabase::WritingSystem appWritingSystem() const; + void setAppWritingSystem(QFontDatabase::WritingSystem system); + const QFont browserFont() const; + void setBrowserFont(const QFont &font); + QFontDatabase::WritingSystem browserWritingSystem() const; + void setBrowserWritingSystem(QFontDatabase::WritingSystem system); + + static const QString TrUnfiltered; + +signals: + + // For asynchronous doc updates triggered by external actions. + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); + + // Forwarded from QHelpEngineCore. + void currentFilterChanged(const QString ¤tFilter); + void setupFinished(); + +private slots: + void handleCurrentFilterChanged(const QString &filter); + +private: + HelpEngineWrapper(const QString &collectionFile); + ~HelpEngineWrapper(); + + static HelpEngineWrapper *helpEngineWrapper; + + HelpEngineWrapperPrivate *d; +}; + +QT_END_NAMESPACE + +#endif // HELPENGINEWRAPPER_H diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index be6245a..8e4d3ed 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -38,14 +38,18 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "helpviewer.h" #include "centralwidget.h" +#include "helpenginewrapper.h" #include <QtCore/QDir> #include <QtCore/QEvent> #include <QtCore/QVariant> #include <QtCore/QByteArray> +#include <QtCore/QStringBuilder> +#include <QtCore/QTemporaryFile> #include <QtCore/QTimer> #include <QtGui/QMenu> @@ -55,14 +59,19 @@ #include <QtGui/QMessageBox> #include <QtGui/QDesktopServices> -#include <QtHelp/QHelpEngine> - #include <QNetworkAccessManager> #include <QNetworkReply> #include <QNetworkRequest> QT_BEGIN_NAMESPACE +namespace { + const QString PageNotFoundMessage = + QCoreApplication::translate("HelpViewer", + "<title>Error 404...</title><div align=\"center\"><br><br>" + "<h1>The page could not be found</h1><br><h3>'%1'</h3></div>"); +} + #if !defined(QT_NO_WEBKIT) class HelpNetworkReply : public QNetworkReply @@ -88,6 +97,7 @@ HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request, const QByteArray &fileData, const QString& mimeType) : data(fileData), origLen(fileData.length()) { + TRACE_OBJ setRequest(request); setOpenMode(QIODevice::ReadOnly); @@ -99,11 +109,13 @@ HelpNetworkReply::HelpNetworkReply(const QNetworkRequest &request, void HelpNetworkReply::abort() { + TRACE_OBJ // nothing to do } qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen) { + TRACE_OBJ qint64 len = qMin(qint64(data.length()), maxlen); if (len) { qMemCopy(buffer, data.constData(), len); @@ -117,25 +129,23 @@ qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen) class HelpNetworkAccessManager : public QNetworkAccessManager { public: - HelpNetworkAccessManager(QHelpEngine *engine, QObject *parent); + HelpNetworkAccessManager(QObject *parent); protected: virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData = 0); - -private: - QHelpEngine *helpEngine; }; -HelpNetworkAccessManager::HelpNetworkAccessManager(QHelpEngine *engine, - QObject *parent) - : QNetworkAccessManager(parent), helpEngine(engine) +HelpNetworkAccessManager::HelpNetworkAccessManager(QObject *parent) + : QNetworkAccessManager(parent) { + TRACE_OBJ } QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, const QNetworkRequest &request, QIODevice* /*outgoingData*/) { + TRACE_OBJ const QUrl& url = request.url(); QString mimeType = url.toString(); if (mimeType.endsWith(QLatin1String(".svg")) @@ -151,14 +161,17 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, mimeType = QLatin1String("text/html"); } - const QByteArray &ba = helpEngine->fileData(url); - return new HelpNetworkReply(request, ba.isEmpty() ? " " : ba, mimeType); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + const QByteArray &data = helpEngine.findFile(url).isValid() + ? helpEngine.fileData(url) + : PageNotFoundMessage.arg(url.toString()).toUtf8(); + return new HelpNetworkReply(request, data, mimeType); } class HelpPage : public QWebPage { public: - HelpPage(CentralWidget *central, QHelpEngine *engine, QObject *parent); + HelpPage(CentralWidget *central, QObject *parent); protected: virtual QWebPage *createWindow(QWebPage::WebWindowType); @@ -169,7 +182,6 @@ protected: private: CentralWidget *centralWidget; - QHelpEngine *helpEngine; bool closeNewTabIfNeeded; friend class HelpViewer; @@ -177,18 +189,19 @@ private: Qt::KeyboardModifiers m_keyboardModifiers; }; -HelpPage::HelpPage(CentralWidget *central, QHelpEngine *engine, QObject *parent) +HelpPage::HelpPage(CentralWidget *central, QObject *parent) : QWebPage(parent) , centralWidget(central) - , helpEngine(engine) , closeNewTabIfNeeded(false) , m_pressedButtons(Qt::NoButton) , m_keyboardModifiers(Qt::NoModifier) { + TRACE_OBJ } QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) { + TRACE_OBJ HelpPage* newPage = static_cast<HelpPage*>(centralWidget->newEmptyTab()->page()); if (newPage) newPage->closeNewTabIfNeeded = closeNewTabIfNeeded; @@ -196,21 +209,9 @@ QWebPage *HelpPage::createWindow(QWebPage::WebWindowType) return newPage; } -static bool isLocalUrl(const QUrl &url) -{ - const QString scheme = url.scheme(); - if (scheme.isEmpty() - || scheme == QLatin1String("file") - || scheme == QLatin1String("qrc") - || scheme == QLatin1String("data") - || scheme == QLatin1String("qthelp") - || scheme == QLatin1String("about")) - return true; - return false; -} - void HelpPage::triggerAction(WebAction action, bool checked) { + TRACE_OBJ switch (action) { case OpenLinkInNewWindow: closeNewTabIfNeeded = true; @@ -223,26 +224,25 @@ void HelpPage::triggerAction(WebAction action, bool checked) bool HelpPage::acceptNavigationRequest(QWebFrame *, const QNetworkRequest &request, QWebPage::NavigationType type) { + TRACE_OBJ const QUrl &url = request.url(); const bool closeNewTab = closeNewTabIfNeeded; closeNewTabIfNeeded = false; - if (isLocalUrl(url)) { + if (HelpViewer::isLocalUrl(url)) { const QString& path = url.path(); - if (path.endsWith(QLatin1String(".pdf"))) { - const int lastDash = path.lastIndexOf(QChar('/')); - QString fileName = QDir::tempPath() + QDir::separator(); - if (lastDash < 0) - fileName += path; - else - fileName += path.mid(lastDash + 1, path.length()); - - QFile tmpFile(QDir::cleanPath(fileName)); - if (tmpFile.open(QIODevice::ReadWrite)) { - tmpFile.write(helpEngine->fileData(url)); - tmpFile.close(); + if (!HelpViewer::canOpenPage(path)) { + QTemporaryFile tmpTmpFile; + if (!tmpTmpFile.open()) + return false; + const QString extension = QFileInfo(path).completeSuffix(); + QFile actualTmpFile(tmpTmpFile.fileName() % QLatin1String(".") + % extension); + if (actualTmpFile.open(QIODevice::ReadWrite | QIODevice::Truncate)) { + actualTmpFile.write(HelpEngineWrapper::instance().fileData(url)); + actualTmpFile.close(); + QDesktopServices::openUrl(QUrl(actualTmpFile.fileName())); } - QDesktopServices::openUrl(QUrl(tmpFile.fileName())); if (closeNewTab) QMetaObject::invokeMethod(CentralWidget::instance(), "closeTab"); @@ -266,17 +266,18 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *, return false; } -HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) +HelpViewer::HelpViewer(CentralWidget *parent) : QWebView(parent) - , helpEngine(engine) , parentWidget(parent) , loadFinished(false) + , helpEngine(HelpEngineWrapper::instance()) { + TRACE_OBJ setAcceptDrops(false); - setPage(new HelpPage(parent, helpEngine, this)); + setPage(new HelpPage(parent, this)); - page()->setNetworkAccessManager(new HelpNetworkAccessManager(engine, this)); + page()->setNetworkAccessManager(new HelpNetworkAccessManager(this)); QAction* action = pageAction(QWebPage::OpenLinkInNewWindow); action->setText(tr("Open Link in New Tab")); @@ -301,6 +302,7 @@ HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) void HelpViewer::setSource(const QUrl &url) { + TRACE_OBJ loadFinished = false; if (url.toString() == QLatin1String("help")) { load(QUrl(QLatin1String("qthelp://com.trolltech.com." @@ -312,34 +314,25 @@ void HelpViewer::setSource(const QUrl &url) void HelpViewer::resetZoom() { + TRACE_OBJ setTextSizeMultiplier(1.0); } void HelpViewer::zoomIn(qreal range) { + TRACE_OBJ setTextSizeMultiplier(textSizeMultiplier() + range / 10.0); } void HelpViewer::zoomOut(qreal range) { + TRACE_OBJ setTextSizeMultiplier(qMax(0.0, textSizeMultiplier() - range / 10.0)); } -void HelpViewer::home() -{ - QString homepage = helpEngine->customValue(QLatin1String("homepage"), - QLatin1String("")).toString(); - - if (homepage.isEmpty()) { - homepage = helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - } - - setSource(homepage); -} - void HelpViewer::wheelEvent(QWheelEvent *e) { + TRACE_OBJ if (e->modifiers() & Qt::ControlModifier) { const int delta = e->delta(); if (delta > 0) @@ -354,6 +347,7 @@ void HelpViewer::wheelEvent(QWheelEvent *e) void HelpViewer::mouseReleaseEvent(QMouseEvent *e) { + TRACE_OBJ if (e->button() == Qt::XButton1) { triggerPageAction(QWebPage::Back); return; @@ -369,6 +363,7 @@ void HelpViewer::mouseReleaseEvent(QMouseEvent *e) void HelpViewer::actionChanged() { + TRACE_OBJ QAction *a = qobject_cast<QAction *>(sender()); if (a == pageAction(QWebPage::Copy)) emit copyAvailable(a->isEnabled()); @@ -380,6 +375,7 @@ void HelpViewer::actionChanged() void HelpViewer::mousePressEvent(QMouseEvent *event) { + TRACE_OBJ HelpPage *currentPage = static_cast<HelpPage*>(page()); if (currentPage) { currentPage->m_pressedButtons = event->buttons(); @@ -390,31 +386,34 @@ void HelpViewer::mousePressEvent(QMouseEvent *event) void HelpViewer::setLoadFinished(bool ok) { + TRACE_OBJ loadFinished = ok; emit sourceChanged(url()); } #else // !defined(QT_NO_WEBKIT) -HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) +HelpViewer::HelpViewer(CentralWidget *parent) : QTextBrowser(parent) , zoomCount(0) , controlPressed(false) , lastAnchor(QString()) - , helpEngine(engine) , parentWidget(parent) + , helpEngine(HelpEngineWrapper::instance()) { + TRACE_OBJ document()->setDocumentMargin(8); } void HelpViewer::setSource(const QUrl &url) { + TRACE_OBJ bool help = url.toString() == QLatin1String("help"); if (url.isValid() && !help) { if (launchedWithExternalApp(url)) return; - QUrl u = helpEngine->findFile(url); + QUrl u = helpEngine.findFile(url); if (u.isValid()) { QTextBrowser::setSource(u); return; @@ -426,15 +425,14 @@ void HelpViewer::setSource(const QUrl &url) "assistantinternal-1.0.0/assistant/assistant.html"))); } else { QTextBrowser::setSource(url); - setHtml(tr("<title>Error 404...</title><div align=\"center\"><br><br>" - "<h1>The page could not be found</h1><br><h3>'%1'</h3></div>") - .arg(url.toString())); + setHtml(PageNotFoundMessage.arg(url.toString())); emit sourceChanged(url); } } void HelpViewer::resetZoom() { + TRACE_OBJ if (zoomCount == 0) return; @@ -444,6 +442,7 @@ void HelpViewer::resetZoom() void HelpViewer::zoomIn(int range) { + TRACE_OBJ if (zoomCount == 10) return; @@ -453,6 +452,7 @@ void HelpViewer::zoomIn(int range) void HelpViewer::zoomOut(int range) { + TRACE_OBJ if (zoomCount == -5) return; @@ -462,12 +462,11 @@ void HelpViewer::zoomOut(int range) bool HelpViewer::launchedWithExternalApp(const QUrl &url) { - bool isPdf = url.path().endsWith(QLatin1String(".pdf")); - if (url.scheme() == QLatin1String("http") - || url.scheme() == QLatin1String("ftp") - || url.scheme() == QLatin1String("mailto") || isPdf) { + TRACE_OBJ + const bool canOpen = canOpenPage(url.path()); + if (!isLocalUrl(url) || !canOpen) { bool launched = false; - if (isPdf && url.scheme() == QLatin1String("qthelp")) { + if (!canOpen && url.scheme() == QLatin1String("qthelp")) { const QString& path = url.path(); const int lastDash = path.lastIndexOf(QChar('/')); QString fileName = QDir::tempPath() + QDir::separator(); @@ -478,7 +477,7 @@ bool HelpViewer::launchedWithExternalApp(const QUrl &url) QFile tmpFile(QDir::cleanPath(fileName)); if (tmpFile.open(QIODevice::ReadWrite)) { - tmpFile.write(helpEngine->fileData(url)); + tmpFile.write(helpEngine.fileData(url)); tmpFile.close(); } launched = QDesktopServices::openUrl(QUrl(tmpFile.fileName())); @@ -497,9 +496,10 @@ bool HelpViewer::launchedWithExternalApp(const QUrl &url) QVariant HelpViewer::loadResource(int type, const QUrl &name) { + TRACE_OBJ QByteArray ba; if (type < 4) { - ba = helpEngine->fileData(name); + ba = helpEngine.fileData(name); if (name.toString().endsWith(QLatin1String(".svg"), Qt::CaseInsensitive)) { QImage image; image.loadFromData(ba, "svg"); @@ -512,6 +512,7 @@ QVariant HelpViewer::loadResource(int type, const QUrl &name) void HelpViewer::openLinkInNewTab() { + TRACE_OBJ if(lastAnchor.isEmpty()) return; @@ -521,12 +522,14 @@ void HelpViewer::openLinkInNewTab() void HelpViewer::openLinkInNewTab(const QString &link) { + TRACE_OBJ lastAnchor = link; openLinkInNewTab(); } bool HelpViewer::hasAnchorAt(const QPoint& pos) { + TRACE_OBJ lastAnchor = anchorAt(pos); if (lastAnchor.isEmpty()) return false; @@ -543,6 +546,7 @@ bool HelpViewer::hasAnchorAt(const QPoint& pos) void HelpViewer::contextMenuEvent(QContextMenuEvent *e) { + TRACE_OBJ QMenu menu(QLatin1String(""), 0); QUrl link; @@ -566,6 +570,7 @@ void HelpViewer::contextMenuEvent(QContextMenuEvent *e) void HelpViewer::mouseReleaseEvent(QMouseEvent *e) { + TRACE_OBJ if (e->button() == Qt::XButton1) { QTextBrowser::backward(); return; @@ -588,6 +593,7 @@ void HelpViewer::mouseReleaseEvent(QMouseEvent *e) void HelpViewer::keyPressEvent(QKeyEvent *e) { + TRACE_OBJ if ((e->key() == Qt::Key_Home && e->modifiers() != Qt::NoModifier) || (e->key() == Qt::Key_End && e->modifiers() != Qt::NoModifier)) { QKeyEvent* event = new QKeyEvent(e->type(), e->key(), Qt::NoModifier, @@ -597,21 +603,9 @@ void HelpViewer::keyPressEvent(QKeyEvent *e) QTextBrowser::keyPressEvent(e); } -void HelpViewer::home() -{ - QString homepage = helpEngine->customValue(QLatin1String("homepage"), - QLatin1String("")).toString(); - - if (homepage.isEmpty()) { - homepage = helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - } - - setSource(homepage); -} - void HelpViewer::wheelEvent(QWheelEvent *e) { + TRACE_OBJ if (e->modifiers() == Qt::CTRL) { e->accept(); (e->delta() > 0) ? zoomIn() : zoomOut(); @@ -623,4 +617,31 @@ void HelpViewer::wheelEvent(QWheelEvent *e) #endif // !defined(QT_NO_WEBKIT) +void HelpViewer::home() +{ + TRACE_OBJ + setSource(helpEngine.homePage()); +} + +bool HelpViewer::canOpenPage(const QString &url) +{ + TRACE_OBJ + return url.endsWith(QLatin1String(".html"), Qt::CaseInsensitive) + || url.endsWith(QLatin1String(".htm"), Qt::CaseInsensitive) + || url == QLatin1String("blank"); +} + +bool HelpViewer::isLocalUrl(const QUrl &url) +{ + TRACE_OBJ + const QString scheme = url.scheme(); + return scheme.isEmpty() + || scheme == QLatin1String("file") + || scheme == QLatin1String("qrc") + || scheme == QLatin1String("data") + || scheme == QLatin1String("qthelp") + || scheme == QLatin1String("about"); +} + + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 3618a73..4dd8064 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -53,8 +53,8 @@ QT_BEGIN_NAMESPACE -class QHelpEngine; class CentralWidget; +class HelpEngineWrapper; class QPoint; class QString; @@ -69,7 +69,7 @@ class HelpViewer : public QWebView Q_OBJECT public: - HelpViewer(QHelpEngine *helpEngine, CentralWidget *parent); + HelpViewer(CentralWidget *parent); void setSource(const QUrl &url); inline QUrl source() const @@ -97,6 +97,9 @@ public: inline qreal zoom() const { return textSizeMultiplier(); } + static bool canOpenPage(const QString &url); + static bool isLocalUrl(const QUrl &url); + public Q_SLOTS: void home(); void backward() { back(); } @@ -118,9 +121,9 @@ private Q_SLOTS: void setLoadFinished(bool ok); private: - QHelpEngine *helpEngine; CentralWidget* parentWidget; bool loadFinished; + HelpEngineWrapper &helpEngine; }; #else @@ -130,7 +133,7 @@ class HelpViewer : public QTextBrowser Q_OBJECT public: - HelpViewer(QHelpEngine *helpEngine, CentralWidget *parent); + HelpViewer(CentralWidget *parent); void setSource(const QUrl &url); void resetZoom(); @@ -143,6 +146,8 @@ public: { return textCursor().hasSelection(); } bool launchedWithExternalApp(const QUrl &url); + static bool canOpenPage(const QString &url); + static bool isLocalUrl(const QUrl &url); public Q_SLOTS: void home(); @@ -165,8 +170,8 @@ private: int zoomCount; bool controlPressed; QString lastAnchor; - QHelpEngine *helpEngine; CentralWidget* parentWidget; + HelpEngineWrapper &helpEngine; }; #endif diff --git a/tools/assistant/tools/assistant/images/bookmark.png b/tools/assistant/tools/assistant/images/bookmark.png Binary files differnew file mode 100644 index 0000000..57e57e3 --- /dev/null +++ b/tools/assistant/tools/assistant/images/bookmark.png diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp index 24a212e..82242e5 100644 --- a/tools/assistant/tools/assistant/indexwindow.cpp +++ b/tools/assistant/tools/assistant/indexwindow.cpp @@ -38,9 +38,12 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "indexwindow.h" #include "centralwidget.h" +#include "helpenginewrapper.h" +#include "helpviewer.h" #include "topicchooser.h" #include <QtGui/QLayout> @@ -51,22 +54,20 @@ #include <QtGui/QContextMenuEvent> #include <QtGui/QListWidgetItem> -#include <QtHelp/QHelpEngine> #include <QtHelp/QHelpIndexWidget> QT_BEGIN_NAMESPACE -IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent) +IndexWindow::IndexWindow(QWidget *parent) : QWidget(parent) - , m_searchLineEdit(0) - , m_indexWidget(0) - , m_helpEngine(helpEngine) + , m_searchLineEdit(new QLineEdit) + , m_indexWidget(HelpEngineWrapper::instance().indexWidget()) { + TRACE_OBJ QVBoxLayout *layout = new QVBoxLayout(this); QLabel *l = new QLabel(tr("&Look for:")); layout->addWidget(l); - m_searchLineEdit = new QLineEdit(); l->setBuddy(m_searchLineEdit); connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterIndices(QString))); @@ -74,11 +75,11 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent) layout->setMargin(4); layout->addWidget(m_searchLineEdit); - m_indexWidget = m_helpEngine->indexWidget(); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); m_indexWidget->installEventFilter(this); - connect(m_helpEngine->indexModel(), SIGNAL(indexCreationStarted()), this, + connect(helpEngine.indexModel(), SIGNAL(indexCreationStarted()), this, SLOT(disableSearchLineEdit())); - connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this, + connect(helpEngine.indexModel(), SIGNAL(indexCreated()), this, SLOT(enableSearchLineEdit())); connect(m_indexWidget, SIGNAL(linkActivated(QUrl,QString)), this, SIGNAL(linkActivated(QUrl))); @@ -93,10 +94,12 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent) IndexWindow::~IndexWindow() { + TRACE_OBJ } void IndexWindow::filterIndices(const QString &filter) { + TRACE_OBJ if (filter.contains(QLatin1Char('*'))) m_indexWidget->filterIndices(filter, filter); else @@ -105,6 +108,7 @@ void IndexWindow::filterIndices(const QString &filter) bool IndexWindow::eventFilter(QObject *obj, QEvent *e) { + TRACE_OBJ if (obj == m_searchLineEdit && e->type() == QEvent::KeyPress) { QKeyEvent *ke = static_cast<QKeyEvent*>(e); QModelIndex idx = m_indexWidget->currentIndex(); @@ -170,22 +174,26 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e) void IndexWindow::enableSearchLineEdit() { + TRACE_OBJ m_searchLineEdit->setDisabled(false); filterIndices(m_searchLineEdit->text()); } void IndexWindow::disableSearchLineEdit() { + TRACE_OBJ m_searchLineEdit->setDisabled(true); } void IndexWindow::setSearchLineEditText(const QString &text) { + TRACE_OBJ m_searchLineEdit->setText(text); } void IndexWindow::focusInEvent(QFocusEvent *e) { + TRACE_OBJ if (e->reason() != Qt::MouseFocusReason) { m_searchLineEdit->selectAll(); m_searchLineEdit->setFocus(); @@ -194,6 +202,7 @@ void IndexWindow::focusInEvent(QFocusEvent *e) void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) { + TRACE_OBJ QHelpIndexModel *model = qobject_cast<QHelpIndexModel*>(indexWidget->model()); if (model) { QString keyword = model->data(index, Qt::DisplayRole).toString(); @@ -210,7 +219,7 @@ void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) return; } - if (url.path().endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive)) + if (!HelpViewer::canOpenPage(url.path())) CentralWidget::instance()->setSource(url); else CentralWidget::instance()->setSourceInNewTab(url); diff --git a/tools/assistant/tools/assistant/indexwindow.h b/tools/assistant/tools/assistant/indexwindow.h index 4343d0e..eb587b1 100644 --- a/tools/assistant/tools/assistant/indexwindow.h +++ b/tools/assistant/tools/assistant/indexwindow.h @@ -49,7 +49,6 @@ QT_BEGIN_NAMESPACE class QHelpIndexWidget; -class QHelpEngine; class QModelIndex; class IndexWindow : public QWidget @@ -57,7 +56,7 @@ class IndexWindow : public QWidget Q_OBJECT public: - IndexWindow(QHelpEngine *helpEngine, QWidget *parent = 0); + IndexWindow(QWidget *parent = 0); ~IndexWindow(); void setSearchLineEditText(const QString &text); @@ -84,7 +83,6 @@ private: QLineEdit *m_searchLineEdit; QHelpIndexWidget *m_indexWidget; - QHelpEngine *m_helpEngine; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/installdialog.cpp b/tools/assistant/tools/assistant/installdialog.cpp index 95a1226..f3bf6f6 100644 --- a/tools/assistant/tools/assistant/installdialog.cpp +++ b/tools/assistant/tools/assistant/installdialog.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "installdialog.h" @@ -66,6 +67,7 @@ InstallDialog::InstallDialog(QHelpEngineCore *helpEngine, QWidget *parent, const QString &host, int port) : QDialog(parent), m_helpEngine(helpEngine), m_host(host), m_port(port) { + TRACE_OBJ m_ui.setupUi(this); m_ui.installButton->setEnabled(false); @@ -94,15 +96,18 @@ InstallDialog::InstallDialog(QHelpEngineCore *helpEngine, QWidget *parent, InstallDialog::~InstallDialog() { + TRACE_OBJ } QStringList InstallDialog::installedDocumentations() const { + TRACE_OBJ return m_installedDocumentations; } void InstallDialog::init() { + TRACE_OBJ m_ui.statusLabel->setText(tr("Downloading documentation info...")); m_ui.progressBar->show(); @@ -122,6 +127,7 @@ void InstallDialog::init() void InstallDialog::updateInstallButton() { + TRACE_OBJ QListWidgetItem *item = 0; for (int i=0; i<m_ui.listWidget->count(); ++i) { item = m_ui.listWidget->item(i); @@ -136,6 +142,7 @@ void InstallDialog::updateInstallButton() void InstallDialog::updateDocItemList() { + TRACE_OBJ QStringList registeredDocs = m_helpEngine->registeredDocumentations(); QListWidgetItem *item = 0; for (int i=0; i<m_ui.listWidget->count(); ++i) { @@ -151,6 +158,7 @@ void InstallDialog::updateDocItemList() void InstallDialog::cancelDownload() { + TRACE_OBJ m_ui.statusLabel->setText(tr("Download canceled.")); m_httpAborted = true; m_itemsToInstall.clear(); @@ -162,6 +170,7 @@ void InstallDialog::cancelDownload() void InstallDialog::install() { + TRACE_OBJ QListWidgetItem *item = 0; for (int i=0; i<m_ui.listWidget->count(); ++i) { item = m_ui.listWidget->item(i); @@ -174,6 +183,7 @@ void InstallDialog::install() void InstallDialog::downloadNextFile() { + TRACE_OBJ if (!m_itemsToInstall.count()) { m_ui.cancelButton->setEnabled(false); m_ui.closeButton->setEnabled(true); @@ -226,6 +236,7 @@ void InstallDialog::downloadNextFile() void InstallDialog::httpRequestFinished(int requestId, bool error) { + TRACE_OBJ if (requestId == m_docInfoId && m_buffer) { m_ui.progressBar->hide(); if (error) { @@ -296,6 +307,7 @@ void InstallDialog::httpRequestFinished(int requestId, bool error) void InstallDialog::installFile(const QString &fileName) { + TRACE_OBJ if (m_helpEngine->registerDocumentation(fileName)) { m_installedDocumentations .append(QHelpEngineCore::namespaceName(fileName)); @@ -308,6 +320,7 @@ void InstallDialog::installFile(const QString &fileName) void InstallDialog::readResponseHeader(const QHttpResponseHeader &responseHeader) { + TRACE_OBJ if (responseHeader.statusCode() != 200) { QMessageBox::information(this, m_windowTitle, tr("Download failed: %1.") @@ -321,6 +334,7 @@ void InstallDialog::readResponseHeader(const QHttpResponseHeader &responseHeader void InstallDialog::updateDataReadProgress(int bytesRead, int totalBytes) { + TRACE_OBJ if (m_httpAborted) return; @@ -330,6 +344,7 @@ void InstallDialog::updateDataReadProgress(int bytesRead, int totalBytes) void InstallDialog::browseDirectories() { + TRACE_OBJ QString dir = QFileDialog::getExistingDirectory(this, m_windowTitle, m_ui.pathLineEdit->text()); if (!dir.isEmpty()) diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index 7a957e2..77e5e7c 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -38,27 +38,34 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include <QtCore/QDir> #include <QtCore/QFileInfo> +#include <QtCore/QLibraryInfo> #include <QtCore/QLocale> +#include <QtCore/QScopedPointer> +#include <QtCore/QStringList> #include <QtCore/QTranslator> -#include <QtCore/QLibraryInfo> #include <QtCore/QUrl> -#include <QtCore/QStringList> #include <QtGui/QApplication> #include <QtGui/QDesktopServices> -#include <QtHelp/QHelpEngineCore> +#include <QtHelp/QHelpEngine> +#include <QtHelp/QHelpSearchEngine> #include <QtNetwork/QLocalSocket> #include <QtSql/QSqlDatabase> +#include "../shared/collectionconfiguration.h" +#include "helpenginewrapper.h" #include "mainwindow.h" #include "cmdlineparser.h" +// #define TRACING_REQUESTED + QT_USE_NAMESPACE #if defined(USE_STATIC_SQLITE_PLUGIN) @@ -66,118 +73,57 @@ QT_USE_NAMESPACE Q_IMPORT_PLUGIN(qsqlite) #endif +namespace { + void updateLastPagesOnUnregister(QHelpEngineCore& helpEngine, const QString& nsName) { - int lastPage = helpEngine.customValue(QLatin1String("LastTabPage")).toInt(); - - QLatin1String sep("|"); - QLatin1String pages("LastShownPages"); -#if !defined(QT_NO_WEBKIT) - QLatin1String zoom("LastPagesZoomWebView"); -#else - QLatin1String zoom("LastPagesZoomTextBrowser"); -#endif - - QStringList currentPages = - helpEngine.customValue(pages).toString(). - split(QLatin1Char('|'), QString::SkipEmptyParts); - + TRACE_OBJ + int lastPage = CollectionConfiguration::lastTabPage(helpEngine); + QStringList currentPages = CollectionConfiguration::lastShownPages(helpEngine); if (!currentPages.isEmpty()) { - QVector<QString>zoomList = helpEngine.customValue(zoom).toString(). - split(sep, QString::SkipEmptyParts).toVector(); - if (zoomList.isEmpty()) - zoomList.fill(QLatin1String("0.0"), currentPages.size()); - else if(zoomList.count() < currentPages.count()) { - zoomList.insert(zoomList.count(), - currentPages.count() - zoomList.count(), QLatin1String("0.0")); - } + QStringList zoomList = CollectionConfiguration::lastZoomFactors(helpEngine); + while (zoomList.count() < currentPages.count()) + zoomList.append(CollectionConfiguration::DefaultZoomFactor); for (int i = currentPages.count(); --i >= 0;) { if (QUrl(currentPages.at(i)).host() == nsName) { - zoomList.remove(i); + zoomList.removeAt(i); currentPages.removeAt(i); lastPage = (lastPage == (i + 1)) ? 1 : lastPage; } } - helpEngine.setCustomValue(pages, currentPages.join(sep)); - helpEngine.setCustomValue(QLatin1String("LastTabPage"), lastPage); - helpEngine.setCustomValue(zoom, QStringList(zoomList.toList()).join(sep)); + CollectionConfiguration::setLastShownPages(helpEngine, currentPages); + CollectionConfiguration::setLastTabPage(helpEngine, lastPage); + CollectionConfiguration::setLastZoomFactors(helpEngine, zoomList); } } bool updateUserCollection(QHelpEngineCore& user, const QHelpEngineCore& caller) { - const uint callerCollectionCreationTime = caller. - customValue(QLatin1String("CreationTime"), 0).toUInt(); - const uint userCollectionCreationTime = user. - customValue(QLatin1String("CreationTime"), 1).toUInt(); - - if (callerCollectionCreationTime <= userCollectionCreationTime) + TRACE_OBJ + if (!CollectionConfiguration::isNewer(caller, user)) return false; - - user.setCustomValue(QLatin1String("CreationTime"), - callerCollectionCreationTime); - user.setCustomValue(QLatin1String("WindowTitle"), - caller.customValue(QLatin1String("WindowTitle"))); - user.setCustomValue(QLatin1String("LastShownPages"), - caller.customValue(QLatin1String("LastShownPages"))); -#if !defined(QT_NO_WEBKIT) - const QLatin1String zoomKey("LastPagesZoomWebView"); -#else - const QLatin1String zoomKey("LastPagesZoomTextBrowser"); -#endif - user.setCustomValue(zoomKey, caller.customValue(zoomKey)); - user.setCustomValue(QLatin1String("CurrentFilter"), - caller.customValue(QLatin1String("CurrentFilter"))); - user.setCustomValue(QLatin1String("CacheDirectory"), - caller.customValue(QLatin1String("CacheDirectory"))); - user.setCustomValue(QLatin1String("EnableFilterFunctionality"), - caller.customValue(QLatin1String("EnableFilterFunctionality"))); - user.setCustomValue(QLatin1String("HideFilterFunctionality"), - caller.customValue(QLatin1String("HideFilterFunctionality"))); - user.setCustomValue(QLatin1String("EnableDocumentationManager"), - caller.customValue(QLatin1String("EnableDocumentationManager"))); - user.setCustomValue(QLatin1String("EnableAddressBar"), - caller.customValue(QLatin1String("EnableAddressBar"))); - user.setCustomValue(QLatin1String("HideAddressBar"), - caller.customValue(QLatin1String("HideAddressBar"))); - user.setCustomValue(QLatin1String("ApplicationIcon"), - caller.customValue(QLatin1String("ApplicationIcon"))); - user.setCustomValue(QLatin1String("AboutMenuTexts"), - caller.customValue(QLatin1String("AboutMenuTexts"))); - user.setCustomValue(QLatin1String("AboutIcon"), - caller.customValue(QLatin1String("AboutIcon"))); - user.setCustomValue(QLatin1String("AboutTexts"), - caller.customValue(QLatin1String("AboutTexts"))); - user.setCustomValue(QLatin1String("AboutImages"), - caller.customValue(QLatin1String("AboutImages"))); - user.setCustomValue(QLatin1String("defaultHomepage"), - caller.customValue(QLatin1String("defaultHomepage"))); - + CollectionConfiguration::copyConfiguration(caller, user); return true; } -bool -referencedHelpFilesExistAll(QHelpEngineCore& user, QStringList& nameSpaces) +void stripNonexistingDocs(QHelpEngineCore& collection) { - QFileInfo fi; - int counter = nameSpaces.count(); - for (int i = counter; --i >= 0;) { - const QString& nameSpace = nameSpaces.at(i); - fi.setFile(user.documentationFileName(nameSpace)); - if (!fi.exists() || !fi.isFile()) { - user.unregisterDocumentation(nameSpace); - nameSpaces.removeAll(nameSpace); - } + TRACE_OBJ + const QStringList &namespaces = collection.registeredDocumentations(); + foreach (const QString &ns, namespaces) { + QFileInfo fi(collection.documentationFileName(ns)); + if (!fi.exists() || !fi.isFile()) + collection.unregisterDocumentation(ns); } - return (counter != nameSpaces.count()) ? false : true; } QString indexFilesFolder(const QString &collectionFile) { + TRACE_OBJ QString indexFilesFolder = QLatin1String(".fulltextsearch"); if (!collectionFile.isEmpty()) { QFileInfo fi(collectionFile); @@ -187,192 +133,306 @@ QString indexFilesFolder(const QString &collectionFile) return indexFilesFolder; } -int main(int argc, char *argv[]) +/* + * Returns the expected absolute file path of the cached collection file + * correspondinging to the given collection's file. + * It may or may not exist yet. + */ +QString constructCachedCollectionFilePath(const QHelpEngineCore &collection) +{ + TRACE_OBJ + const QString &filePath = collection.collectionFile(); + const QString &fileName = QFileInfo(filePath).fileName(); + const QString &cacheDir = CollectionConfiguration::cacheDir(collection); + const QString &dir = !cacheDir.isEmpty() + && CollectionConfiguration::cacheDirIsRelativeToCollection(collection) + ? QFileInfo(filePath).dir().absolutePath() + + QDir::separator() + cacheDir + : MainWindow::collectionFileDirectory(false, cacheDir); + return dir + QDir::separator() + fileName; +} + +bool synchronizeDocs(QHelpEngineCore &collection, + QHelpEngineCore &cachedCollection, + CmdLineParser &cmd) { -#ifndef Q_OS_WIN - // First do a quick search for arguments that imply command-line mode. + TRACE_OBJ + const QDateTime &lastCollectionRegisterTime = + CollectionConfiguration::lastRegisterTime(collection); + if (!lastCollectionRegisterTime.isValid() || lastCollectionRegisterTime + < CollectionConfiguration::lastRegisterTime(cachedCollection)) + return true; + + const QStringList &docs = collection.registeredDocumentations(); + const QStringList &cachedDocs = cachedCollection.registeredDocumentations(); + + /* + * Ensure that the cached collection contains all docs that + * the collection contains. + */ + foreach (const QString &doc, docs) { + if (!cachedDocs.contains(doc)) { + const QString &docFile = collection.documentationFileName(doc); + if (!cachedCollection.registerDocumentation(docFile)) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error registering documentation file '%1': %2"). + arg(docFile).arg(cachedCollection.error()), true); + return false; + } + } + } + + CollectionConfiguration::updateLastRegisterTime(cachedCollection); + + return true; +} + +bool removeSearchIndex(const QString &collectionFile) +{ + TRACE_OBJ + QString path = QFileInfo(collectionFile).path(); + path += QLatin1Char('/') + indexFilesFolder(collectionFile); + + QLocalSocket localSocket; + localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) + .arg(QLatin1String(QT_VERSION_STR))); + + QDir dir(path); // check if there is no other instance ruinning + if (!dir.exists() || localSocket.waitForConnected()) + return false; + + QStringList lst = dir.entryList(QDir::Files | QDir::Hidden); + foreach (const QString &item, lst) + dir.remove(item); + return true; +} + +bool rebuildSearchIndex(QCoreApplication &app, const QString &collectionFile, + CmdLineParser &cmd) +{ + TRACE_OBJ + QHelpEngine engine(collectionFile); + if (!engine.setupData()) { + cmd.showMessage(QCoreApplication::translate("Assistant", "Error: %1") + .arg(engine.error()), true); + return false; + } + + QHelpSearchEngine * const searchEngine = engine.searchEngine(); + QObject::connect(searchEngine, SIGNAL(indexingFinished()), &app, + SLOT(quit())); + searchEngine->reindexDocumentation(); + return app.exec() == 0; +} + +bool useGui(int argc, char *argv[]) +{ + TRACE_OBJ + bool gui = true; +#ifndef Q_OS_WIN + // Look for arguments that imply command-line mode. const char * cmdModeArgs[] = { - "-help", "-register", "-unregister", "-remove-search-index" + "-help", "-register", "-unregister", "-remove-search-index", + "-rebuild-search-index" }; - bool useGui = true; for (int i = 1; i < argc; ++i) { for (size_t j = 0; j < sizeof cmdModeArgs/sizeof *cmdModeArgs; ++j) { if(strcmp(argv[i], cmdModeArgs[j]) == 0) { - useGui = false; + gui = false; break; } } } - QApplication a(argc, argv, useGui); #else - QApplication a(argc, argv); + Q_UNUSED(argc) + Q_UNUSED(argv) #endif + return gui; +} + +bool registerDocumentation(QHelpEngineCore &collection, CmdLineParser &cmd, + bool printSuccess) +{ + TRACE_OBJ + if (!collection.registerDocumentation(cmd.helpFile())) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Could not register documentation file\n%1\n\nReason:\n%2") + .arg(cmd.helpFile()).arg(collection.error()), true); + return false; + } + if (printSuccess) + cmd.showMessage(QCoreApplication::translate("Assistant", + "Documentation successfully registered."), + false); + CollectionConfiguration::updateLastRegisterTime(collection); + return true; +} + +bool unregisterDocumentation(QHelpEngineCore &collection, + const QString &namespaceName, CmdLineParser &cmd, bool printSuccess) +{ + TRACE_OBJ + if (!collection.unregisterDocumentation(namespaceName)) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Could not unregister documentation" + " file\n%1\n\nReason:\n%2"). + arg(cmd.helpFile()).arg(collection.error()), true); + return false; + } + updateLastPagesOnUnregister(collection, namespaceName); + if (printSuccess) + cmd.showMessage(QCoreApplication::translate("Assistant", + "Documentation successfully unregistered."), + false); + return true; +} + +void setupTranslation(const QString &fileName, const QString &dir) +{ + QTranslator *translator = new QTranslator(QCoreApplication::instance()); + if (translator->load(fileName, dir)) { + QCoreApplication::installTranslator(translator); + } else { + qWarning("Could not load translation file %s in directory %s.", + qPrintable(fileName), qPrintable(dir)); + } +} + +void setupTranslations() +{ + TRACE_OBJ + const QString& locale = QLocale::system().name(); + const QString &resourceDir + = QLibraryInfo::location(QLibraryInfo::TranslationsPath); + setupTranslation(QLatin1String("assistant_") + locale, resourceDir); + setupTranslation(QLatin1String("qt_") + locale, resourceDir); + setupTranslation(QLatin1String("qt_help_") + locale, resourceDir); +} + +} // Anonymous namespace. + +int main(int argc, char *argv[]) +{ + TRACE_OBJ + QApplication a(argc, argv, useGui(argc, argv)); a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins")); - CmdLineParser cmd; - CmdLineParser::Result res = cmd.parse(a.arguments()); + // Parse arguments. + CmdLineParser cmd(a.arguments()); + CmdLineParser::Result res = cmd.parse(); if (res == CmdLineParser::Help) return 0; else if (res == CmdLineParser::Error) return -1; - QString cmdCollectionFile = cmd.collectionFile(); - if (cmd.registerRequest() != CmdLineParser::None) { - if (cmdCollectionFile.isEmpty()) - cmdCollectionFile = MainWindow::defaultHelpCollectionFileName(); - QHelpEngineCore help(cmdCollectionFile); - help.setupData(); - if (cmd.registerRequest() == CmdLineParser::Register) { - if (!help.registerDocumentation(cmd.helpFile())) { - cmd.showMessage( - QObject::tr("Could not register documentation file\n%1\n\nReason:\n%2") - .arg(cmd.helpFile()).arg(help.error()), true); - return -1; - } else { - cmd.showMessage(QObject::tr("Documentation successfully registered."), - false); - } - } else { - QString nsName = QHelpEngineCore::namespaceName(cmd.helpFile()); - if (help.unregisterDocumentation(nsName)) { - updateLastPagesOnUnregister(help, nsName); - cmd.showMessage( - QObject::tr("Documentation successfully unregistered."), - false); - } else { - cmd.showMessage(QObject::tr("Could not unregister documentation" - " file\n%1\n\nReason:\n%2").arg(cmd.helpFile()). - arg(help.error()), true); - return -1; - } + /* + * Create the collection objects that we need. We always have the + * cached collection file. Depending on whether the user specified + * one, we also may have an input collection file. + */ + const QString collectionFile = cmd.collectionFile(); + const bool collectionFileGiven = !collectionFile.isEmpty(); + QScopedPointer<QHelpEngineCore> collection; + if (collectionFileGiven) { + collection.reset(new QHelpEngineCore(collectionFile)); + if (!collection->setupData()) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error reading collection file '%1': %2."). + arg(collectionFile).arg(collection->error()), true); + return EXIT_FAILURE; } - help.setCustomValue(QLatin1String("DocUpdate"), true); - return 0; } - - if (cmd.removeSearchIndex()) { - QString file = cmdCollectionFile; - if (file.isEmpty()) - file = MainWindow::defaultHelpCollectionFileName(); - QString path = QFileInfo(file).path(); - path += QLatin1Char('/') + indexFilesFolder(file); - - QLocalSocket localSocket; - localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) - .arg(QLatin1String(QT_VERSION_STR))); - - QDir dir(path); // check if there is no other instance ruinning - if (!localSocket.waitForConnected() && dir.exists()) { - QStringList lst = dir.entryList(QDir::Files | QDir::Hidden); - foreach (const QString &item, lst) - dir.remove(item); - return 0; - } else { - return -1; - } + const QString &cachedCollectionFile = collectionFileGiven + ? constructCachedCollectionFilePath(*collection) + : MainWindow::defaultHelpCollectionFileName(); + if (collectionFileGiven && !QFileInfo(cachedCollectionFile).exists() + && !collection->copyCollectionFile(cachedCollectionFile)) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error creating collection file '%1': %2."). + arg(cachedCollectionFile).arg(collection->error()), true); + return EXIT_FAILURE; } - - { - QSqlDatabase db; - QStringList sqlDrivers(db.drivers()); - if (sqlDrivers.isEmpty() - || !sqlDrivers.contains(QLatin1String("QSQLITE"))) { - cmd.showMessage(QObject::tr("Cannot load sqlite database driver!"), - true); - return -1; - } + QHelpEngineCore cachedCollection(cachedCollectionFile); + if (!cachedCollection.setupData()) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Error reading collection file '%1': %2"). + arg(cachedCollectionFile). + arg(cachedCollection.error()), true); + return EXIT_FAILURE; } - if (!cmdCollectionFile.isEmpty()) { - QHelpEngineCore caller(cmdCollectionFile); - if (!caller.setupData()) { - cmd.showMessage(QObject::tr("The specified collection file could " - "not be read!"), true); - return -1; - } + stripNonexistingDocs(cachedCollection); + if (collectionFileGiven) { + if (CollectionConfiguration::isNewer(*collection, cachedCollection)) + CollectionConfiguration::copyConfiguration(*collection, + cachedCollection); + if (!synchronizeDocs(*collection, cachedCollection, cmd)) + return EXIT_FAILURE; + } - QString fileName = QFileInfo(cmdCollectionFile).fileName(); - QString dir = MainWindow::collectionFileDirectory(false, - caller.customValue(QLatin1String("CacheDirectory"), - QString()).toString()); - - bool collectionFileExists = true; - QFileInfo fi(dir + QDir::separator() + fileName); - if (!fi.exists()) { - collectionFileExists = false; - if (!caller.copyCollectionFile(fi.absoluteFilePath())) { - cmd.showMessage(caller.error(), true); - return -1; - } + if (cmd.registerRequest() != CmdLineParser::None) { + const QStringList &cachedDocs = + cachedCollection.registeredDocumentations(); + const QString &namespaceName = + QHelpEngineCore::namespaceName(cmd.helpFile()); + if (cmd.registerRequest() == CmdLineParser::Register) { + if (collectionFileGiven + && !registerDocumentation(*collection, cmd, true)) + return EXIT_FAILURE; + if (!cachedDocs.contains(namespaceName) + && !registerDocumentation(cachedCollection, cmd, !collectionFileGiven)) + return EXIT_FAILURE; + return EXIT_SUCCESS; } - - if (collectionFileExists) { - QHelpEngineCore user(fi.absoluteFilePath()); - if (user.setupData()) { - // some docs might have been un/registered - bool docUpdate = caller. - customValue(QLatin1String("DocUpdate"), false).toBool(); - - // update in case the passed collection file changed - if (updateUserCollection(user, caller)) - docUpdate = true; - - QStringList userDocs = user.registeredDocumentations(); - // update user collection file, docs might have been (re)moved - if (!referencedHelpFilesExistAll(user, userDocs)) - docUpdate = true; - - if (docUpdate) { - QStringList callerDocs = caller.registeredDocumentations(); - foreach (const QString &doc, callerDocs) { - if (!userDocs.contains(doc)) { - user.registerDocumentation( - caller.documentationFileName(doc)); - } - } - - QLatin1String intern("com.trolltech.com.assistantinternal-"); - foreach (const QString &doc, userDocs) { - if (!callerDocs.contains(doc) && !doc.startsWith(intern)) - user.unregisterDocumentation(doc); - } - - caller.setCustomValue(QLatin1String("DocUpdate"), false); - } - } + if (cmd.registerRequest() == CmdLineParser::Unregister) { + if (collectionFileGiven + && !unregisterDocumentation(*collection, namespaceName, cmd, true)) + return EXIT_FAILURE; + if (cachedDocs.contains(namespaceName) + && !unregisterDocumentation(cachedCollection, namespaceName, + cmd, !collectionFileGiven)) + return EXIT_FAILURE; + return EXIT_SUCCESS; } - cmd.setCollectionFile(fi.absoluteFilePath()); } - if (!cmd.currentFilter().isEmpty()) { - QString collectionFile; - if (cmdCollectionFile.isEmpty()) { - MainWindow::collectionFileDirectory(true); - cmdCollectionFile = MainWindow::defaultHelpCollectionFileName(); - } - - QHelpEngineCore user(cmdCollectionFile); - if (user.setupData()) - user.setCurrentFilter(cmd.currentFilter()); + if (cmd.removeSearchIndex()) { + return removeSearchIndex(cachedCollectionFile) + ? EXIT_SUCCESS : EXIT_FAILURE; } - const QString& locale = QLocale::system().name(); - QString resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); - - QTranslator translator(0); - translator.load(QLatin1String("assistant_") + locale, resourceDir); - a.installTranslator(&translator); + if (cmd.rebuildSearchIndex()) { + return rebuildSearchIndex(a, cachedCollectionFile, cmd) + ? EXIT_SUCCESS : EXIT_FAILURE; + } - QTranslator qtTranslator(0); - qtTranslator.load(QLatin1String("qt_") + locale, resourceDir); - a.installTranslator(&qtTranslator); + if (!QSqlDatabase::isDriverAvailable(QLatin1String("QSQLITE"))) { + cmd.showMessage(QCoreApplication::translate("Assistant", + "Cannot load sqlite database driver!"), + true); + return EXIT_FAILURE; + } - QTranslator qtHelpTranslator(0); - qtHelpTranslator.load(QLatin1String("qt_help_") + locale, resourceDir); - a.installTranslator(&qtHelpTranslator); + if (!cmd.currentFilter().isEmpty()) { + if (collectionFileGiven) + collection->setCurrentFilter(cmd.currentFilter()); + cachedCollection.setCurrentFilter(cmd.currentFilter()); + } - MainWindow w(&cmd); - w.show(); + setupTranslations(); + + /* + * We need to be careful here: The main window has to be deleted before + * the help engine wrapper, which has to be deleted before the + * QApplication. + */ + if (collectionFileGiven) + cmd.setCollectionFile(cachedCollectionFile); + MainWindow *w = new MainWindow(&cmd); + w->show(); a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); - return a.exec(); + const int retval = a.exec(); + delete w; + HelpEngineWrapper::removeInstance(); + return retval; } diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 0dbf813..2ff6b5e 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -38,24 +38,32 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "mainwindow.h" + +#include "bookmarkmanager.h" #include "centralwidget.h" #include "helpviewer.h" #include "indexwindow.h" #include "topicchooser.h" #include "contentwindow.h" #include "preferencesdialog.h" -#include "bookmarkmanager.h" +#include "helpenginewrapper.h" #include "remotecontrol.h" #include "cmdlineparser.h" #include "aboutdialog.h" #include "searchwidget.h" #include "qtdocinstaller.h" +// #define TRACING_REQUESTED + #include <QtCore/QDir> #include <QtCore/QTimer> +#include <QtCore/QDateTime> #include <QtCore/QDebug> +#include <QtCore/QFileSystemWatcher> +#include <QtCore/QPair> #include <QtCore/QResource> #include <QtCore/QByteArray> #include <QtCore/QTextStream> @@ -76,8 +84,9 @@ #include <QtGui/QProgressBar> #include <QtGui/QDesktopServices> #include <QtGui/QToolButton> +#include <QtGui/QFileDialog> -#include <QtHelp/QHelpEngine> +#include <QtHelp/QHelpEngineCore> #include <QtHelp/QHelpSearchEngine> #include <QtHelp/QHelpContentModel> #include <QtHelp/QHelpIndexModel> @@ -86,6 +95,7 @@ QT_BEGIN_NAMESPACE MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) : QMainWindow(parent) + , m_bookmarkWidget(0) , m_filterCombo(0) , m_toolBarMenu(0) , m_cmdLine(cmdLine) @@ -93,37 +103,53 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) , m_qtDocInstaller(0) , m_connectedInitSignals(false) { + TRACE_OBJ + setToolButtonStyle(Qt::ToolButtonFollowStyle); + QString collectionFile; if (usesDefaultCollection()) { MainWindow::collectionFileDirectory(true); - m_helpEngine = new QHelpEngine(MainWindow::defaultHelpCollectionFileName(), - this); + collectionFile = MainWindow::defaultHelpCollectionFileName(); } else { - m_helpEngine = new QHelpEngine(cmdLine->collectionFile(), this); + collectionFile = cmdLine->collectionFile(); } + HelpEngineWrapper &helpEngineWrapper = + HelpEngineWrapper::instance(collectionFile); - m_centralWidget = new CentralWidget(m_helpEngine, this); + m_centralWidget = new CentralWidget(this); setCentralWidget(m_centralWidget); - m_indexWindow = new IndexWindow(m_helpEngine); + m_indexWindow = new IndexWindow(this); QDockWidget *indexDock = new QDockWidget(tr("Index"), this); indexDock->setObjectName(QLatin1String("IndexWindow")); indexDock->setWidget(m_indexWindow); addDockWidget(Qt::LeftDockWidgetArea, indexDock); - m_contentWindow = new ContentWindow(m_helpEngine); + m_contentWindow = new ContentWindow; QDockWidget *contentDock = new QDockWidget(tr("Contents"), this); contentDock->setObjectName(QLatin1String("ContentWindow")); contentDock->setWidget(m_contentWindow); addDockWidget(Qt::LeftDockWidgetArea, contentDock); - QDockWidget *bookmarkDock = new QDockWidget(tr("Bookmarks"), this); - bookmarkDock->setObjectName(QLatin1String("BookmarkWindow")); - bookmarkDock->setWidget(setupBookmarkWidget()); - addDockWidget(Qt::LeftDockWidgetArea, bookmarkDock); + QDockWidget *bookmarkDock = 0; + if (BookmarkManager *manager = BookmarkManager::instance()) { + bookmarkDock = new QDockWidget(tr("Bookmarks"), this); + bookmarkDock->setObjectName(QLatin1String("BookmarkWindow")); + bookmarkDock->setWidget(m_bookmarkWidget = manager->bookmarkDockWidget()); + addDockWidget(Qt::LeftDockWidgetArea, bookmarkDock); + + connect(manager, SIGNAL(escapePressed()), this, + SLOT(activateCurrentCentralWidgetTab())); + connect(manager, SIGNAL(setSource(QUrl)), m_centralWidget, + SLOT(setSource(QUrl))); + connect(manager, SIGNAL(setSourceInNewTab(QUrl)), m_centralWidget, + SLOT(setSourceInNewTab(QUrl))); + connect(m_centralWidget, SIGNAL(addBookmark(QString, QString)), manager, + SLOT(addBookmark(QString, QString))); + } - QHelpSearchEngine *searchEngine = m_helpEngine->searchEngine(); + QHelpSearchEngine *searchEngine = helpEngineWrapper.searchEngine(); connect(searchEngine, SIGNAL(indexingStarted()), this, SLOT(indexingStarted())); connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished())); @@ -140,18 +166,9 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) setupFilterToolbar(); setupAddressToolbar(); - m_bookmarkManager->setupBookmarkModels(); - m_bookmarkMenu->addSeparator(); - m_bookmarkManager->fillBookmarkMenu(m_bookmarkMenu); - connect(m_bookmarkMenu, SIGNAL(triggered(QAction*)), this, - SLOT(showBookmark(QAction*))); - connect(m_bookmarkManager, SIGNAL(bookmarksChanged()), this, - SLOT(updateBookmarkMenu())); - - setWindowTitle(m_helpEngine->customValue(QLatin1String("WindowTitle"), - defWindowTitle).toString()); - QByteArray iconArray = m_helpEngine->customValue(QLatin1String("ApplicationIcon"), - QByteArray()).toByteArray(); + const QString windowTitle = helpEngineWrapper.windowTitle(); + setWindowTitle(windowTitle.isEmpty() ? defWindowTitle : windowTitle); + QByteArray iconArray = helpEngineWrapper.applicationIcon(); if (iconArray.size() > 0) { QPixmap pix; pix.loadFromData(iconArray); @@ -165,29 +182,28 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) // Show the widget here, otherwise the restore geometry and state won't work // on x11. show(); - QByteArray ba(m_helpEngine->customValue(QLatin1String("MainWindow")).toByteArray()); + QByteArray ba(helpEngineWrapper.mainWindow()); if (!ba.isEmpty()) restoreState(ba); - ba = m_helpEngine->customValue(QLatin1String("MainWindowGeometry")).toByteArray(); + ba = helpEngineWrapper.mainWindowGeometry(); if (!ba.isEmpty()) { restoreGeometry(ba); } else { tabifyDockWidget(contentDock, indexDock); - tabifyDockWidget(indexDock, bookmarkDock); + if (bookmarkDock) + tabifyDockWidget(indexDock, bookmarkDock); contentDock->raise(); resize(QSize(800, 600)); } - if (!m_helpEngine->customValue(QLatin1String("useAppFont")).isValid()) { - m_helpEngine->setCustomValue(QLatin1String("useAppFont"), false); - m_helpEngine->setCustomValue(QLatin1String("useBrowserFont"), false); - m_helpEngine->setCustomValue(QLatin1String("appFont"), qApp->font()); - m_helpEngine->setCustomValue(QLatin1String("appWritingSystem"), - QFontDatabase::Latin); - m_helpEngine->setCustomValue(QLatin1String("browserFont"), qApp->font()); - m_helpEngine->setCustomValue(QLatin1String("browserWritingSystem"), - QFontDatabase::Latin); + if (!helpEngineWrapper.hasFontSettings()) { + helpEngineWrapper.setUseAppFont(false); + helpEngineWrapper.setUseBrowserFont(false); + helpEngineWrapper.setAppFont(qApp->font()); + helpEngineWrapper.setAppWritingSystem(QFontDatabase::Latin); + helpEngineWrapper.setBrowserFont(qApp->font()); + helpEngineWrapper.setBrowserWritingSystem(QFontDatabase::Latin); } else { updateApplicationFont(); } @@ -196,7 +212,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) QTimer::singleShot(0, this, SLOT(insertLastPages())); if (m_cmdLine->enableRemoteControl()) - (void)new RemoteControl(this, m_helpEngine); + (void)new RemoteControl(this); if (m_cmdLine->contents() == CmdLineParser::Show) showContents(); @@ -209,9 +225,9 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) hideIndex(); if (m_cmdLine->bookmarks() == CmdLineParser::Show) - showBookmarks(); + showBookmarksDockWidget(); else if (m_cmdLine->bookmarks() == CmdLineParser::Hide) - hideBookmarks(); + hideBookmarksDockWidget(); if (m_cmdLine->search() == CmdLineParser::Show) showSearch(); @@ -223,51 +239,59 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) else if (m_cmdLine->index() == CmdLineParser::Activate) showIndex(); else if (m_cmdLine->bookmarks() == CmdLineParser::Activate) - showBookmarks(); + showBookmarksDockWidget(); if (!m_cmdLine->currentFilter().isEmpty()) { const QString &curFilter = m_cmdLine->currentFilter(); - if (m_helpEngine->customFilters().contains(curFilter)) - m_helpEngine->setCurrentFilter(curFilter); + if (helpEngineWrapper.customFilters().contains(curFilter)) + helpEngineWrapper.setCurrentFilter(curFilter); } if (usesDefaultCollection()) QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation())); else checkInitState(); + + connect(&helpEngineWrapper, SIGNAL(documentationRemoved(QString)), + this, SLOT(documentationRemoved(QString))); + connect(&helpEngineWrapper, SIGNAL(documentationUpdated(QString)), + this, SLOT(documentationUpdated(QString))); } setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); } MainWindow::~MainWindow() { + TRACE_OBJ if (m_qtDocInstaller) delete m_qtDocInstaller; } bool MainWindow::usesDefaultCollection() const { + TRACE_OBJ return m_cmdLine->collectionFile().isEmpty(); } void MainWindow::closeEvent(QCloseEvent *e) { - m_bookmarkManager->saveBookmarks(); - m_helpEngine->setCustomValue(QLatin1String("MainWindow"), saveState()); - m_helpEngine->setCustomValue(QLatin1String("MainWindowGeometry"), - saveGeometry()); - + TRACE_OBJ + BookmarkManager::destroy(); + HelpEngineWrapper::instance().setMainWindow(saveState()); + HelpEngineWrapper::instance().setMainWindowGeometry(saveGeometry()); QMainWindow::closeEvent(e); } bool MainWindow::initHelpDB() { - if (!m_helpEngine->setupData()) + TRACE_OBJ + HelpEngineWrapper &helpEngineWrapper = HelpEngineWrapper::instance(); + if (!helpEngineWrapper.setupData()) return false; bool assistantInternalDocRegistered = false; QString intern(QLatin1String("com.trolltech.com.assistantinternal-")); - foreach (const QString &ns, m_helpEngine->registeredDocumentations()) { + foreach (const QString &ns, helpEngineWrapper.registeredDocumentations()) { if (ns.startsWith(intern)) { intern = ns; assistantInternalDocRegistered = true; @@ -275,8 +299,7 @@ bool MainWindow::initHelpDB() } } - const QString &collectionFile = m_helpEngine->collectionFile(); - + const QString &collectionFile = helpEngineWrapper.collectionFile(); QFileInfo fi(collectionFile); QString helpFile; QTextStream(&helpFile) << fi.absolutePath() << QDir::separator() @@ -293,109 +316,79 @@ bool MainWindow::initHelpDB() file.close(); } - QHelpEngineCore hc(fi.absoluteFilePath()); - hc.setupData(); - hc.unregisterDocumentation(intern); - hc.registerDocumentation(helpFile); - needsSetup = true; - } - - const QLatin1String unfiltered("UnfilteredFilterInserted"); - if (1 != m_helpEngine->customValue(unfiltered).toInt()) { - { - QHelpEngineCore hc(collectionFile); - hc.setupData(); - hc.addCustomFilter(tr("Unfiltered"), QStringList()); - hc.setCustomValue(unfiltered, 1); - } - - m_helpEngine->blockSignals(true); - m_helpEngine->setCurrentFilter(tr("Unfiltered")); - m_helpEngine->blockSignals(false); + helpEngineWrapper.unregisterDocumentation(intern); + helpEngineWrapper.registerDocumentation(helpFile); needsSetup = true; } if (needsSetup) - m_helpEngine->setupData(); + helpEngineWrapper.setupData(); return true; } void MainWindow::lookForNewQtDocumentation() { - m_qtDocInstaller = new QtDocInstaller(m_helpEngine->collectionFile()); - connect(m_qtDocInstaller, SIGNAL(errorMessage(QString)), this, - SLOT(displayInstallationError(QString))); + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + QStringList docs; + docs << QLatin1String("assistant") + << QLatin1String("designer") + << QLatin1String("linguist") + << QLatin1String("qmake") + << QLatin1String("qt"); + QList<QtDocInstaller::DocInfo> qtDocInfos; + foreach (const QString &doc, docs) + qtDocInfos.append(QtDocInstaller::DocInfo(doc, helpEngine.qtDocInfo(doc))); + + m_qtDocInstaller = new QtDocInstaller(qtDocInfos); connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, SLOT(qtDocumentationInstalled(bool))); - - QString versionKey = QString(QLatin1String("qtVersion%1$$$qt")). - arg(QLatin1String(QT_VERSION_STR)); - if (m_helpEngine->customValue(versionKey, 0).toInt() != 1) + connect(m_qtDocInstaller, SIGNAL(qchFileNotFound(QString)), this, + SLOT(resetQtDocInfo(QString))); + connect(m_qtDocInstaller, SIGNAL(registerDocumentation(QString, QString)), + this, SLOT(registerDocumentation(QString, QString))); + if (helpEngine.qtDocInfo(QLatin1String("qt")).count() != 2) statusBar()->showMessage(tr("Looking for Qt Documentation...")); m_qtDocInstaller->installDocs(); } -void MainWindow::displayInstallationError(const QString &errorMessage) -{ - QMessageBox::warning(this, tr("Qt Assistant"), errorMessage); -} - void MainWindow::qtDocumentationInstalled(bool newDocsInstalled) { + TRACE_OBJ if (newDocsInstalled) - m_helpEngine->setupData(); + HelpEngineWrapper::instance().setupData(); statusBar()->clearMessage(); checkInitState(); } void MainWindow::checkInitState() { + TRACE_OBJ if (!m_cmdLine->enableRemoteControl()) return; - if (m_helpEngine->contentModel()->isCreatingContents() - || m_helpEngine->indexModel()->isCreatingIndex()) { + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (helpEngine.contentModel()->isCreatingContents() + || helpEngine.indexModel()->isCreatingIndex()) { if (!m_connectedInitSignals) { - connect(m_helpEngine->contentModel(), SIGNAL(contentsCreated()), + connect(helpEngine.contentModel(), SIGNAL(contentsCreated()), this, SLOT(checkInitState())); - connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this, + connect(helpEngine.indexModel(), SIGNAL(indexCreated()), this, SLOT(checkInitState())); m_connectedInitSignals = true; } } else { if (m_connectedInitSignals) { - disconnect(m_helpEngine->contentModel(), 0, this, 0); - disconnect(m_helpEngine->indexModel(), 0, this, 0); + disconnect(helpEngine.contentModel(), 0, this, 0); + disconnect(helpEngine.indexModel(), 0, this, 0); } emit initDone(); } } -void MainWindow::updateBookmarkMenu() -{ - if (m_bookmarkManager) { - m_bookmarkMenu->removeAction(m_bookmarkMenuAction); - - m_bookmarkMenu->clear(); - - m_bookmarkMenu->addAction(m_bookmarkMenuAction); - m_bookmarkMenu->addSeparator(); - - m_bookmarkManager->fillBookmarkMenu(m_bookmarkMenu); - } -} - -void MainWindow::showBookmark(QAction *action) -{ - if (m_bookmarkManager) { - const QUrl &url = m_bookmarkManager->urlForAction(action); - if (url.isValid()) - m_centralWidget->setSource(url); - } -} - void MainWindow::insertLastPages() { + TRACE_OBJ if (m_cmdLine->url().isValid()) m_centralWidget->setSource(m_cmdLine->url()); else @@ -407,6 +400,7 @@ void MainWindow::insertLastPages() void MainWindow::setupActions() { + TRACE_OBJ QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); #ifdef Q_OS_MAC setUnifiedTitleAndToolBarOnMac(true); @@ -437,8 +431,12 @@ void MainWindow::setupActions() m_closeTabAction->setShortcuts(QKeySequence::Close); QAction *tmp = menu->addAction(tr("&Quit"), this, SLOT(close())); - tmp->setShortcut(QKeySequence::Quit); tmp->setMenuRole(QAction::QuitRole); +#ifdef Q_OS_WIN + tmp->setShortcut(QKeySequence(tr("CTRL+Q"))); +#else + tmp->setShortcut(QKeySequence::Quit); +#endif menu = menuBar()->addMenu(tr("&Edit")); m_copyAction = menu->addAction(tr("&Copy selected Text"), m_centralWidget, @@ -492,7 +490,7 @@ void MainWindow::setupActions() QKeySequence(tr("ALT+C"))); m_viewMenu->addAction(tr("Index"), this, SLOT(showIndex()), QKeySequence(tr("ALT+I"))); - m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarks()), + m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarksDockWidget()), QKeySequence(tr("ALT+O"))); m_viewMenu->addAction(tr("Search"), this, SLOT(showSearchWidget()), QKeySequence(tr("ALT+S"))); @@ -528,10 +526,8 @@ void MainWindow::setupActions() tmp->setShortcuts(QList<QKeySequence>() << QKeySequence(tr("Ctrl+Alt+Left")) << QKeySequence(Qt::CTRL + Qt::Key_PageUp)); - m_bookmarkMenu = menuBar()->addMenu(tr("&Bookmarks")); - m_bookmarkMenuAction = m_bookmarkMenu->addAction(tr("Add Bookmark..."), - this, SLOT(addBookmark())); - m_bookmarkMenuAction->setShortcut(tr("CTRL+D")); + if (BookmarkManager *manager = BookmarkManager::instance()) + manager->takeBookmarksMenu(menuBar()->addMenu(tr("&Bookmarks"))); menu = menuBar()->addMenu(tr("&Help")); m_aboutAction = menu->addAction(tr("About..."), this, SLOT(showAboutDialog())); @@ -592,14 +588,6 @@ void MainWindow::setupActions() SLOT(updateNavigationItems())); connect(m_centralWidget, SIGNAL(highlighted(QString)), statusBar(), SLOT(showMessage(QString))); - connect(m_centralWidget, SIGNAL(addNewBookmark(QString,QString)), this, - SLOT(addNewBookmark(QString,QString))); - - // bookmarks - connect(m_bookmarkWidget, SIGNAL(requestShowLink(QUrl)), m_centralWidget, - SLOT(setSource(QUrl))); - connect(m_bookmarkWidget, SIGNAL(escapePressed()), this, - SLOT(activateCurrentCentralWidgetTab())); // index window connect(m_indexWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget, @@ -624,6 +612,7 @@ void MainWindow::setupActions() QMenu *MainWindow::toolBarMenu() { + TRACE_OBJ if (!m_toolBarMenu) { m_viewMenu->addSeparator(); m_toolBarMenu = m_viewMenu->addMenu(tr("Toolbars")); @@ -633,8 +622,9 @@ QMenu *MainWindow::toolBarMenu() void MainWindow::setupFilterToolbar() { - if (!m_helpEngine-> - customValue(QLatin1String("EnableFilterFunctionality"), true).toBool()) + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (!helpEngine.filterFunctionalityEnabled()) return; m_filterCombo = new QComboBox(this); @@ -647,16 +637,15 @@ void MainWindow::setupFilterToolbar() this)); filterToolBar->addWidget(m_filterCombo); - const QLatin1String hideFilter("HideFilterFunctionality"); - if (m_helpEngine->customValue(hideFilter, true).toBool()) + if (!helpEngine.filterToolbarVisible()) filterToolBar->hide(); toolBarMenu()->addAction(filterToolBar->toggleViewAction()); - connect(m_helpEngine, SIGNAL(setupFinished()), this, - SLOT(setupFilterCombo())); + connect(&helpEngine, SIGNAL(setupFinished()), this, + SLOT(setupFilterCombo()), Qt::QueuedConnection); connect(m_filterCombo, SIGNAL(activated(QString)), this, SLOT(filterDocumentation(QString))); - connect(m_helpEngine, SIGNAL(currentFilterChanged(QString)), this, + connect(&helpEngine, SIGNAL(currentFilterChanged(QString)), this, SLOT(currentFilterChanged(QString))); setupFilterCombo(); @@ -664,7 +653,9 @@ void MainWindow::setupFilterToolbar() void MainWindow::setupAddressToolbar() { - if (!m_helpEngine->customValue(QLatin1String("EnableAddressBar"), true).toBool()) + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (!helpEngine.addressBarEnabled()) return; m_addressLineEdit = new QLineEdit(this); @@ -676,7 +667,7 @@ void MainWindow::setupAddressToolbar() this)); addressToolBar->addWidget(m_addressLineEdit); - if (m_helpEngine->customValue(QLatin1String("HideAddressBar"), true).toBool()) + if (!helpEngine.addressBarVisible()) addressToolBar->hide(); toolBarMenu()->addAction(addressToolBar->toggleViewAction()); @@ -691,57 +682,53 @@ void MainWindow::setupAddressToolbar() void MainWindow::updateAboutMenuText() { - if (m_helpEngine) { - QByteArray ba = m_helpEngine->customValue(QLatin1String("AboutMenuTexts"), - QByteArray()).toByteArray(); - if (ba.size() > 0) { - QString lang; - QString str; - QString trStr; - QString currentLang = QLocale::system().name(); - int i = currentLang.indexOf(QLatin1Char('_')); - if (i > -1) - currentLang = currentLang.left(i); - QDataStream s(&ba, QIODevice::ReadOnly); - while (!s.atEnd()) { - s >> lang; - s >> str; - if (lang == QLatin1String("default") && trStr.isEmpty()) { - trStr = str; - } else if (lang == currentLang) { - trStr = str; - break; - } + TRACE_OBJ + QByteArray ba = HelpEngineWrapper::instance().aboutMenuTexts(); + if (ba.size() > 0) { + QString lang; + QString str; + QString trStr; + QString currentLang = QLocale::system().name(); + int i = currentLang.indexOf(QLatin1Char('_')); + if (i > -1) + currentLang = currentLang.left(i); + QDataStream s(&ba, QIODevice::ReadOnly); + while (!s.atEnd()) { + s >> lang; + s >> str; + if (lang == QLatin1String("default") && trStr.isEmpty()) { + trStr = str; + } else if (lang == currentLang) { + trStr = str; + break; } - if (!trStr.isEmpty()) - m_aboutAction->setText(trStr); } + if (!trStr.isEmpty()) + m_aboutAction->setText(trStr); } } void MainWindow::showNewAddress() { + TRACE_OBJ showNewAddress(m_centralWidget->currentSource()); } void MainWindow::showNewAddress(const QUrl &url) { + TRACE_OBJ m_addressLineEdit->setText(url.toString()); } -void MainWindow::addBookmark() -{ - addNewBookmark(m_centralWidget->currentTitle(), - m_centralWidget->currentSource().toString()); -} - void MainWindow::gotoAddress() { + TRACE_OBJ m_centralWidget->setSource(m_addressLineEdit->text()); } void MainWindow::updateNavigationItems() { + TRACE_OBJ bool hasCurrentViewer = m_centralWidget->isHomeAvailable(); m_copyAction->setEnabled(m_centralWidget->hasSelection()); m_homeAction->setEnabled(hasCurrentViewer); @@ -755,12 +742,14 @@ void MainWindow::updateNavigationItems() void MainWindow::updateTabCloseAction() { + TRACE_OBJ m_closeTabAction->setEnabled(m_centralWidget->enableTabCloseAction()); } void MainWindow::showTopicChooser(const QMap<QString, QUrl> &links, const QString &keyword) { + TRACE_OBJ TopicChooser tc(this, keyword, links); if (tc.exec() == QDialog::Accepted) { m_centralWidget->setSource(tc.link()); @@ -769,7 +758,8 @@ void MainWindow::showTopicChooser(const QMap<QString, QUrl> &links, void MainWindow::showPreferences() { - PreferencesDialog dia(m_helpEngine, this); + TRACE_OBJ + PreferencesDialog dia(this); connect(&dia, SIGNAL(updateApplicationFont()), this, SLOT(updateApplicationFont())); @@ -781,6 +771,7 @@ void MainWindow::showPreferences() void MainWindow::syncContents() { + TRACE_OBJ qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); const QUrl url = m_centralWidget->currentSource(); showContents(); @@ -792,40 +783,32 @@ void MainWindow::syncContents() void MainWindow::copyAvailable(bool yes) { + TRACE_OBJ m_copyAction->setEnabled(yes); } -void MainWindow::addNewBookmark(const QString &title, const QString &url) -{ - if (url.isEmpty() || url == QLatin1String("about:blank")) - return; - - m_bookmarkManager->showBookmarkDialog(this, title, url); -} - void MainWindow::showAboutDialog() { + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QByteArray contents; - if (m_helpEngine) { - QByteArray ba = m_helpEngine->customValue(QLatin1String("AboutTexts"), - QByteArray()).toByteArray(); - if (!ba.isEmpty()) { - QString lang; - QByteArray cba; - QString currentLang = QLocale::system().name(); - int i = currentLang.indexOf(QLatin1Char('_')); - if (i > -1) - currentLang = currentLang.left(i); - QDataStream s(&ba, QIODevice::ReadOnly); - while (!s.atEnd()) { - s >> lang; - s >> cba; - if (lang == QLatin1String("default") && contents.isEmpty()) { - contents = cba; - } else if (lang == currentLang) { - contents = cba; - break; - } + QByteArray ba = helpEngine.aboutTexts(); + if (!ba.isEmpty()) { + QString lang; + QByteArray cba; + QString currentLang = QLocale::system().name(); + int i = currentLang.indexOf(QLatin1Char('_')); + if (i > -1) + currentLang = currentLang.left(i); + QDataStream s(&ba, QIODevice::ReadOnly); + while (!s.atEnd()) { + s >> lang; + s >> cba; + if (lang == QLatin1String("default") && contents.isEmpty()) { + contents = cba; + } else if (lang == currentLang) { + contents = cba; + break; } } } @@ -834,11 +817,8 @@ void MainWindow::showAboutDialog() QByteArray iconArray; if (!contents.isEmpty()) { - iconArray = m_helpEngine->customValue(QLatin1String("AboutIcon"), - QByteArray()).toByteArray(); - QByteArray resources = - m_helpEngine->customValue(QLatin1String("AboutImages"), - QByteArray()).toByteArray(); + iconArray = helpEngine.aboutIcon(); + QByteArray resources = helpEngine.aboutImages(); QPixmap pix; pix.loadFromData(iconArray); aboutDia.setText(QString::fromUtf8(contents), resources); @@ -861,50 +841,109 @@ void MainWindow::showAboutDialog() aboutDia.exec(); } +void MainWindow::setContentsVisible(bool visible) +{ + TRACE_OBJ + if (visible) + showContents(); + else + hideContents(); +} + void MainWindow::showContents() { + TRACE_OBJ activateDockWidget(m_contentWindow); } +void MainWindow::hideContents() +{ + TRACE_OBJ + m_contentWindow->parentWidget()->hide(); +} + +void MainWindow::setIndexVisible(bool visible) +{ + TRACE_OBJ + if (visible) + showIndex(); + else + hideIndex(); +} + void MainWindow::showIndex() { + TRACE_OBJ activateDockWidget(m_indexWindow); } -void MainWindow::showBookmarks() +void MainWindow::hideIndex() { - activateDockWidget(m_bookmarkWidget); + TRACE_OBJ + m_indexWindow->parentWidget()->hide(); } -void MainWindow::activateDockWidget(QWidget *w) +void MainWindow::setBookmarksVisible(bool visible) { - w->parentWidget()->show(); - w->parentWidget()->raise(); - w->setFocus(); + TRACE_OBJ + if (visible) + showBookmarksDockWidget(); + else + hideBookmarksDockWidget(); } -void MainWindow::hideContents() +void MainWindow::showBookmarksDockWidget() { - m_contentWindow->parentWidget()->hide(); + TRACE_OBJ + if (m_bookmarkWidget) + activateDockWidget(m_bookmarkWidget); } -void MainWindow::hideIndex() +void MainWindow::hideBookmarksDockWidget() { - m_indexWindow->parentWidget()->hide(); + TRACE_OBJ + if (m_bookmarkWidget) + m_bookmarkWidget->parentWidget()->hide(); } -void MainWindow::hideBookmarks() +void MainWindow::setSearchVisible(bool visible) { - m_bookmarkWidget->parentWidget()->hide(); + TRACE_OBJ + if (visible) + showSearch(); + else + hideSearch(); +} + +void MainWindow::showSearch() +{ + TRACE_OBJ + m_centralWidget->activateSearchWidget(); +} + +void MainWindow::hideSearch() +{ + TRACE_OBJ + m_centralWidget->removeSearchWidget(); +} + +void MainWindow::activateDockWidget(QWidget *w) +{ + TRACE_OBJ + w->parentWidget()->show(); + w->parentWidget()->raise(); + w->setFocus(); } void MainWindow::setIndexString(const QString &str) { + TRACE_OBJ m_indexWindow->setSearchLineEditText(str); } void MainWindow::activateCurrentBrowser() { + TRACE_OBJ CentralWidget *cw = CentralWidget::instance(); if (cw) { cw->activateTab(true); @@ -913,40 +952,36 @@ void MainWindow::activateCurrentBrowser() void MainWindow::activateCurrentCentralWidgetTab() { + TRACE_OBJ m_centralWidget->activateTab(); } -void MainWindow::showSearch() -{ - m_centralWidget->activateSearchWidget(); -} - void MainWindow::showSearchWidget() { + TRACE_OBJ m_centralWidget->activateSearchWidget(true); } -void MainWindow::hideSearch() -{ - m_centralWidget->removeSearchWidget(); -} - void MainWindow::updateApplicationFont() { + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QFont font = qApp->font(); - if (m_helpEngine->customValue(QLatin1String("useAppFont")).toBool()) - font = qVariantValue<QFont>(m_helpEngine->customValue(QLatin1String("appFont"))); + if (helpEngine.usesAppFont()) + font = helpEngine.appFont(); qApp->setFont(font, "QWidget"); } void MainWindow::setupFilterCombo() { + TRACE_OBJ + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); QString curFilter = m_filterCombo->currentText(); if (curFilter.isEmpty()) - curFilter = m_helpEngine->currentFilter(); + curFilter = helpEngine.currentFilter(); m_filterCombo->clear(); - m_filterCombo->addItems(m_helpEngine->customFilters()); + m_filterCombo->addItems(helpEngine.customFilters()); int idx = m_filterCombo->findText(curFilter); if (idx < 0) idx = 0; @@ -955,16 +990,20 @@ void MainWindow::setupFilterCombo() void MainWindow::filterDocumentation(const QString &customFilter) { - m_helpEngine->setCurrentFilter(customFilter); + TRACE_OBJ + HelpEngineWrapper::instance().setCurrentFilter(customFilter); } void MainWindow::expandTOC(int depth) { + TRACE_OBJ + Q_ASSERT(depth >= -1); m_contentWindow->expandToDepth(depth); } void MainWindow::indexingStarted() { + TRACE_OBJ if (!m_progressWidget) { m_progressWidget = new QWidget(); QLayout* hlayout = new QHBoxLayout(m_progressWidget); @@ -990,21 +1029,15 @@ void MainWindow::indexingStarted() void MainWindow::indexingFinished() { + TRACE_OBJ statusBar()->removeWidget(m_progressWidget); delete m_progressWidget; m_progressWidget = 0; } -QWidget* MainWindow::setupBookmarkWidget() -{ - m_bookmarkManager = new BookmarkManager(m_helpEngine); - m_bookmarkWidget = new BookmarkWidget(m_bookmarkManager, this); - connect(m_bookmarkWidget, SIGNAL(addBookmark()), this, SLOT(addBookmark())); - return m_bookmarkWidget; -} - QString MainWindow::collectionFileDirectory(bool createDir, const QString &cacheDir) { + TRACE_OBJ QString collectionPath = QDesktopServices::storageLocation(QDesktopServices::DataLocation); if (collectionPath.isEmpty()) { @@ -1030,16 +1063,65 @@ QString MainWindow::collectionFileDirectory(bool createDir, const QString &cache QString MainWindow::defaultHelpCollectionFileName() { - return collectionFileDirectory() + QDir::separator() + + TRACE_OBJ + // forces creation of the default collection file path + return collectionFileDirectory(true) + QDir::separator() + QString(QLatin1String("qthelpcollection_%1.qhc")). arg(QLatin1String(QT_VERSION_STR)); } void MainWindow::currentFilterChanged(const QString &filter) { + TRACE_OBJ const int index = m_filterCombo->findText(filter); Q_ASSERT(index != -1); m_filterCombo->setCurrentIndex(index); } +void MainWindow::documentationRemoved(const QString &namespaceName) +{ + TRACE_OBJ + CentralWidget* widget = CentralWidget::instance(); + widget->closeOrReloadTabs(widget->currentSourceFileList(). + keys(namespaceName), false); +} + +void MainWindow::documentationUpdated(const QString &namespaceName) +{ + TRACE_OBJ + CentralWidget* widget = CentralWidget::instance(); + widget->closeOrReloadTabs(widget->currentSourceFileList(). + keys(namespaceName), true); +} + +void MainWindow::resetQtDocInfo(const QString &component) +{ + TRACE_OBJ + HelpEngineWrapper::instance().setQtDocInfo(component, + QStringList(QDateTime().toString(Qt::ISODate))); +} + +void MainWindow::registerDocumentation(const QString &component, + const QString &absFileName) +{ + TRACE_OBJ + QString ns = QHelpEngineCore::namespaceName(absFileName); + if (ns.isEmpty()) + return; + + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); + if (helpEngine.registeredDocumentations().contains(ns)) + helpEngine.unregisterDocumentation(ns); + if (!helpEngine.registerDocumentation(absFileName)) { + QMessageBox::warning(this, tr("Qt Assistant"), + tr("Could not register file '%1': %2"). + arg(absFileName).arg(helpEngine.error())); + } else { + QStringList docInfo; + docInfo << QFileInfo(absFileName).lastModified().toString(Qt::ISODate) + << absFileName; + helpEngine.setQtDocInfo(component, docInfo); + } +} + QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 8a9b572..40ca624 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE class QAction; +class QFileSystemWatcher; class QLineEdit; class QComboBox; class QMenu; @@ -57,8 +58,6 @@ class QHelpEngineCore; class QHelpEngine; class CentralWidget; class ContentWindow; -class BookmarkManager; -class BookmarkWidget; class CmdLineParser; class QtDocInstaller; @@ -76,10 +75,6 @@ public: static QString defaultHelpCollectionFileName(); public: - void hideContents(); - void hideIndex(); - void hideBookmarks(); - void hideSearch(); void setIndexString(const QString &str); void expandTOC(int depth); bool usesDefaultCollection() const; @@ -88,18 +83,20 @@ signals: void initDone(); public slots: - void showContents(); - void showIndex(); - void showBookmarks(); - void showSearch(); + void setContentsVisible(bool visible); + void setIndexVisible(bool visible); + void setBookmarksVisible(bool visible); + void setSearchVisible(bool visible); void showSearchWidget(); void syncContents(); void activateCurrentCentralWidgetTab(); void currentFilterChanged(const QString &filter); private slots: + void showContents(); + void showIndex(); + void showSearch(); void insertLastPages(); - void addBookmark(); void gotoAddress(); void showPreferences(); void showNewAddress(); @@ -108,7 +105,6 @@ private slots: void updateNavigationItems(); void updateTabCloseAction(); void showNewAddress(const QUrl &url); - void addNewBookmark(const QString &title, const QString &url); void showTopicChooser(const QMap<QString, QUrl> &links, const QString &keyword); void updateApplicationFont(); void filterDocumentation(const QString &customFilter); @@ -116,12 +112,13 @@ private slots: void lookForNewQtDocumentation(); void indexingStarted(); void indexingFinished(); - void displayInstallationError(const QString &errorMessage); void qtDocumentationInstalled(bool newDocsInstalled); + void registerDocumentation(const QString &component, + const QString &absFileName); + void resetQtDocInfo(const QString &component); void checkInitState(); - - void updateBookmarkMenu(); - void showBookmark(QAction *action); + void documentationRemoved(const QString &namespaceName); + void documentationUpdated(const QString &namespaceName); private: bool initHelpDB(); @@ -132,14 +129,21 @@ private: void setupFilterToolbar(); void setupAddressToolbar(); QMenu *toolBarMenu(); - QWidget *setupBookmarkWidget(); + void hideContents(); + void hideIndex(); + void hideSearch(); - QHelpEngine *m_helpEngine; +private slots: + void showBookmarksDockWidget(); + void hideBookmarksDockWidget(); + +private: + QWidget *m_bookmarkWidget; + +private: CentralWidget *m_centralWidget; IndexWindow *m_indexWindow; ContentWindow *m_contentWindow; - BookmarkWidget *m_bookmarkWidget; - BookmarkManager *m_bookmarkManager; QLineEdit *m_addressLineEdit; QComboBox *m_filterCombo; @@ -161,8 +165,6 @@ private: QMenu *m_viewMenu; QMenu *m_toolBarMenu; - QMenu *m_bookmarkMenu; - QAction *m_bookmarkMenuAction; CmdLineParser *m_cmdLine; diff --git a/tools/assistant/tools/assistant/preferencesdialog.cpp b/tools/assistant/tools/assistant/preferencesdialog.cpp index ca12d8f..f0ef054 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.cpp +++ b/tools/assistant/tools/assistant/preferencesdialog.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "preferencesdialog.h" #include "filternamedialog.h" @@ -45,8 +46,10 @@ #include "fontpanel.h" #include "centralwidget.h" #include "aboutdialog.h" +#include "helpenginewrapper.h" -#include <QtAlgorithms> +#include <QtCore/QtAlgorithms> +#include <QtCore/QFileSystemWatcher> #include <QtGui/QHeaderView> #include <QtGui/QFileDialog> @@ -60,12 +63,13 @@ QT_BEGIN_NAMESPACE -PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *parent) +PreferencesDialog::PreferencesDialog(QWidget *parent) : QDialog(parent) - , m_helpEngine(helpEngine) , m_appFontChanged(false) , m_browserFontChanged(false) + , helpEngine(HelpEngineWrapper::instance()) { + TRACE_OBJ m_ui.setupUi(this); connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), @@ -73,11 +77,8 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *paren connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject())); - QLatin1String key("EnableFilterFunctionality"); - m_hideFiltersTab = !m_helpEngine->customValue(key, true).toBool(); - - key = QLatin1String("EnableDocumentationManager"); - m_hideDocsTab = !m_helpEngine->customValue(key, true).toBool(); + m_hideFiltersTab = !helpEngine.filterFunctionalityEnabled(); + m_hideDocsTab = !helpEngine.documentationManagerEnabled(); if (!m_hideFiltersTab) { m_ui.attributeWidget->header()->hide(); @@ -106,7 +107,7 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *paren connect(m_ui.docRemoveButton, SIGNAL(clicked()), this, SLOT(removeDocumentation())); - m_docsBackup = m_helpEngine->registeredDocumentations(); + m_docsBackup = helpEngine.registeredDocumentations(); m_ui.registeredDocsListWidget->addItems(m_docsBackup); } else { m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.docsTab)); @@ -118,27 +119,17 @@ PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *paren PreferencesDialog::~PreferencesDialog() { - QLatin1String key(""); + TRACE_OBJ if (m_appFontChanged) { - key = QLatin1String("appFont"); - m_helpEngine->setCustomValue(key, m_appFontPanel->selectedFont()); - - key = QLatin1String("useAppFont"); - m_helpEngine->setCustomValue(key, m_appFontPanel->isChecked()); - - key = QLatin1String("appWritingSystem"); - m_helpEngine->setCustomValue(key, m_appFontPanel->writingSystem()); + helpEngine.setAppFont(m_appFontPanel->selectedFont()); + helpEngine.setUseAppFont(m_appFontPanel->isChecked()); + helpEngine.setAppWritingSystem(m_appFontPanel->writingSystem()); } if (m_browserFontChanged) { - key = QLatin1String("browserFont"); - m_helpEngine->setCustomValue(key, m_browserFontPanel->selectedFont()); - - key = QLatin1String("useBrowserFont"); - m_helpEngine->setCustomValue(key, m_browserFontPanel->isChecked()); - - key = QLatin1String("browserWritingSystem"); - m_helpEngine->setCustomValue(key, m_browserFontPanel->writingSystem()); + helpEngine.setBrowserFont(m_browserFontPanel->selectedFont()); + helpEngine.setUseBrowserFont(m_browserFontPanel->isChecked()); + helpEngine.setBrowserWritingSystem(m_browserFontPanel->writingSystem()); } if (m_appFontChanged || m_browserFontChanged) { @@ -149,32 +140,31 @@ PreferencesDialog::~PreferencesDialog() QString homePage = m_ui.homePageLineEdit->text(); if (homePage.isEmpty()) homePage = QLatin1String("help"); - m_helpEngine->setCustomValue(QLatin1String("homepage"), homePage); + helpEngine.setHomePage(homePage); int option = m_ui.helpStartComboBox->currentIndex(); - m_helpEngine->setCustomValue(QLatin1String("StartOption"), option); + helpEngine.setStartOption(option); } void PreferencesDialog::showDialog() { + TRACE_OBJ if (exec() != Accepted) m_appFontChanged = m_browserFontChanged = false; } void PreferencesDialog::updateFilterPage() { - if (!m_helpEngine) - return; - + TRACE_OBJ m_ui.filterWidget->clear(); m_ui.attributeWidget->clear(); - QHelpEngineCore help(m_helpEngine->collectionFile(), 0); - help.setupData(); m_filterMapBackup.clear(); - const QStringList filters = help.customFilters(); + const QStringList &filters = helpEngine.customFilters(); foreach (const QString &filter, filters) { - QStringList atts = help.filterAttributes(filter); + if (filter == HelpEngineWrapper::TrUnfiltered) + continue; + QStringList atts = helpEngine.filterAttributes(filter); m_filterMapBackup.insert(filter, atts); if (!m_filterMap.contains(filter)) m_filterMap.insert(filter, atts); @@ -182,15 +172,16 @@ void PreferencesDialog::updateFilterPage() m_ui.filterWidget->addItems(m_filterMap.keys()); - foreach (const QString &a, help.filterAttributes()) + foreach (const QString &a, helpEngine.filterAttributes()) new QTreeWidgetItem(m_ui.attributeWidget, QStringList() << a); - if (m_filterMap.keys().count()) + if (!m_filterMap.keys().isEmpty()) m_ui.filterWidget->setCurrentRow(0); } void PreferencesDialog::updateAttributes(QListWidgetItem *item) { + TRACE_OBJ QStringList checkedList; if (item) checkedList = m_filterMap.value(item->text()); @@ -206,6 +197,7 @@ void PreferencesDialog::updateAttributes(QListWidgetItem *item) void PreferencesDialog::updateFilterMap() { + TRACE_OBJ if (!m_ui.filterWidget->currentItem()) return; QString filter = m_ui.filterWidget->currentItem()->text(); @@ -224,6 +216,7 @@ void PreferencesDialog::updateFilterMap() void PreferencesDialog::addFilter() { + TRACE_OBJ FilterNameDialog dia(this); if (dia.exec() == QDialog::Rejected) return; @@ -241,6 +234,7 @@ void PreferencesDialog::addFilter() void PreferencesDialog::removeFilter() { + TRACE_OBJ QListWidgetItem *item = m_ui.filterWidget ->takeItem(m_ui.filterWidget->currentRow()); if (!item) @@ -255,6 +249,7 @@ void PreferencesDialog::removeFilter() void PreferencesDialog::addDocumentationLocal() { + TRACE_OBJ const QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Add Documentation"), QString(), tr("Qt Compressed Help Files (*.qch)")); if (fileNames.isEmpty()) @@ -275,10 +270,11 @@ void PreferencesDialog::addDocumentationLocal() continue; } - m_helpEngine->registerDocumentation(fileName); - m_ui.registeredDocsListWidget->addItem(nameSpace); - m_regDocs.append(nameSpace); - m_unregDocs.removeAll(nameSpace); + if (helpEngine.registerDocumentation(fileName)) { + m_ui.registeredDocsListWidget->addItem(nameSpace); + m_regDocs.append(nameSpace); + m_unregDocs.removeAll(nameSpace); + } } if (!invalidFiles.isEmpty() || !alreadyRegistered.isEmpty()) { @@ -307,6 +303,7 @@ void PreferencesDialog::addDocumentationLocal() void PreferencesDialog::removeDocumentation() { + TRACE_OBJ bool foundBefore = false; CentralWidget* widget = CentralWidget::instance(); QMap<int, QString> openedDocList = widget->currentSourceFileList(); @@ -338,6 +335,7 @@ void PreferencesDialog::removeDocumentation() void PreferencesDialog::applyChanges() { + TRACE_OBJ bool filtersWereChanged = false; if (!m_hideFiltersTab) { if (m_filterMap.count() != m_filterMapBackup.count()) { @@ -370,34 +368,28 @@ void PreferencesDialog::applyChanges() if (filtersWereChanged) { foreach (const QString &filter, m_removedFilters) - m_helpEngine->removeCustomFilter(filter); + helpEngine.removeCustomFilter(filter); QMapIterator<QString, QStringList> it(m_filterMap); while (it.hasNext()) { it.next(); - m_helpEngine->addCustomFilter(it.key(), it.value()); + helpEngine.addCustomFilter(it.key(), it.value()); } } - qSort(m_TabsToClose); - CentralWidget* widget = CentralWidget::instance(); - for (int i = m_TabsToClose.count(); --i >= 0;) - widget->closeTabAt(m_TabsToClose.at(i)); - if (widget->availableHelpViewer()== 0) - widget->setSource(QUrl(QLatin1String("about:blank"))); - - if (m_unregDocs.count()) { - foreach (const QString &doc, m_unregDocs) - m_helpEngine->unregisterDocumentation(doc); - } + CentralWidget::instance()->closeOrReloadTabs(m_TabsToClose, false); + + foreach (const QString &doc, m_unregDocs) + helpEngine.unregisterDocumentation(doc); - if (filtersWereChanged || m_regDocs.count() || m_unregDocs.count()) - m_helpEngine->setupData(); + if (filtersWereChanged || !m_regDocs.isEmpty() || !m_unregDocs.isEmpty()) + helpEngine.setupData(); accept(); } void PreferencesDialog::updateFontSettingsPage() { + TRACE_OBJ m_browserFontPanel = new FontPanel(this); m_browserFontPanel->setCheckable(true); m_ui.stackedWidget_2->insertWidget(0, m_browserFontPanel); @@ -411,31 +403,23 @@ void PreferencesDialog::updateFontSettingsPage() const QString customSettings(tr("Use custom settings")); m_appFontPanel->setTitle(customSettings); - QLatin1String key = QLatin1String("appFont"); - QFont font = qVariantValue<QFont>(m_helpEngine->customValue(key)); + QFont font = helpEngine.appFont(); m_appFontPanel->setSelectedFont(font); - key = QLatin1String("appWritingSystem"); - QFontDatabase::WritingSystem system = static_cast<QFontDatabase::WritingSystem> - (m_helpEngine->customValue(key).toInt()); + QFontDatabase::WritingSystem system = helpEngine.appWritingSystem(); m_appFontPanel->setWritingSystem(system); - key = QLatin1String("useAppFont"); - m_appFontPanel->setChecked(m_helpEngine->customValue(key).toBool()); + m_appFontPanel->setChecked(helpEngine.usesAppFont()); m_browserFontPanel->setTitle(customSettings); - key = QLatin1String("browserFont"); - font = qVariantValue<QFont>(m_helpEngine->customValue(key)); + font = helpEngine.browserFont(); m_browserFontPanel->setSelectedFont(font); - key = QLatin1String("browserWritingSystem"); - system = static_cast<QFontDatabase::WritingSystem> - (m_helpEngine->customValue(key).toInt()); + system = helpEngine.browserWritingSystem(); m_browserFontPanel->setWritingSystem(system); - key = QLatin1String("useBrowserFont"); - m_browserFontPanel->setChecked(m_helpEngine->customValue(key).toBool()); + m_browserFontPanel->setChecked(helpEngine.usesBrowserFont()); connect(m_appFontPanel, SIGNAL(toggled(bool)), this, SLOT(appFontSettingToggled(bool))); @@ -457,41 +441,38 @@ void PreferencesDialog::updateFontSettingsPage() void PreferencesDialog::appFontSettingToggled(bool on) { + TRACE_OBJ Q_UNUSED(on) m_appFontChanged = true; } void PreferencesDialog::appFontSettingChanged(int index) { + TRACE_OBJ Q_UNUSED(index) m_appFontChanged = true; } void PreferencesDialog::browserFontSettingToggled(bool on) { + TRACE_OBJ Q_UNUSED(on) m_browserFontChanged = true; } void PreferencesDialog::browserFontSettingChanged(int index) { + TRACE_OBJ Q_UNUSED(index) m_browserFontChanged = true; } void PreferencesDialog::updateOptionsPage() { - QString homepage = m_helpEngine->customValue(QLatin1String("homepage"), - QLatin1String("")).toString(); + TRACE_OBJ + m_ui.homePageLineEdit->setText(helpEngine.homePage()); - if (homepage.isEmpty()) { - homepage = m_helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - } - m_ui.homePageLineEdit->setText(homepage); - - int option = m_helpEngine->customValue(QLatin1String("StartOption"), - ShowLastPages).toInt(); + int option = helpEngine.startOption(); m_ui.helpStartComboBox->setCurrentIndex(option); connect(m_ui.blankPageButton, SIGNAL(clicked()), this, SLOT(setBlankPage())); @@ -501,11 +482,13 @@ void PreferencesDialog::updateOptionsPage() void PreferencesDialog::setBlankPage() { + TRACE_OBJ m_ui.homePageLineEdit->setText(QLatin1String("about:blank")); } void PreferencesDialog::setCurrentPage() { + TRACE_OBJ QString homepage = CentralWidget::instance()->currentSource().toString(); if (homepage.isEmpty()) homepage = QLatin1String("help"); @@ -515,9 +498,8 @@ void PreferencesDialog::setCurrentPage() void PreferencesDialog::setDefaultPage() { - QString homepage = m_helpEngine->customValue(QLatin1String("defaultHomepage"), - QLatin1String("help")).toString(); - m_ui.homePageLineEdit->setText(homepage); + TRACE_OBJ + m_ui.homePageLineEdit->setText(helpEngine.defaultHomePage()); } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/preferencesdialog.h b/tools/assistant/tools/assistant/preferencesdialog.h index 9ad6b6a..2894494 100644 --- a/tools/assistant/tools/assistant/preferencesdialog.h +++ b/tools/assistant/tools/assistant/preferencesdialog.h @@ -48,20 +48,15 @@ QT_BEGIN_NAMESPACE class FontPanel; -class QHelpEngineCore; - -enum { - ShowHomePage = 0, - ShowBlankPage = 1, - ShowLastPages = 2 -}; +class HelpEngineWrapper; +class QFileSystemWatcher; class PreferencesDialog : public QDialog { Q_OBJECT public: - PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *parent = 0); + PreferencesDialog(QWidget *parent = 0); ~PreferencesDialog(); void showDialog(); @@ -93,7 +88,6 @@ private: void updateOptionsPage(); Ui::PreferencesDialogClass m_ui; - QHelpEngineCore *m_helpEngine; bool m_hideFiltersTab; bool m_hideDocsTab; QMap<QString, QStringList> m_filterMapBackup; @@ -107,6 +101,7 @@ private: FontPanel *m_browserFontPanel; bool m_appFontChanged; bool m_browserFontChanged; + HelpEngineWrapper &helpEngine; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/qtdocinstaller.cpp b/tools/assistant/tools/assistant/qtdocinstaller.cpp index 652f630..5a501bf 100644 --- a/tools/assistant/tools/assistant/qtdocinstaller.cpp +++ b/tools/assistant/tools/assistant/qtdocinstaller.cpp @@ -38,23 +38,27 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include <QtCore/QDir> #include <QtCore/QLibraryInfo> #include <QtCore/QDateTime> +#include <QtCore/QFileSystemWatcher> #include <QtHelp/QHelpEngineCore> +#include "helpenginewrapper.h" #include "qtdocinstaller.h" QT_BEGIN_NAMESPACE -QtDocInstaller::QtDocInstaller(const QString &collectionFile) +QtDocInstaller::QtDocInstaller(const QList<DocInfo> &docInfos) + : m_abort(false), m_docInfos(docInfos) { - m_abort = false; - m_collectionFile = collectionFile; + TRACE_OBJ } QtDocInstaller::~QtDocInstaller() { + TRACE_OBJ if (!isRunning()) return; m_mutex.lock(); @@ -65,86 +69,59 @@ QtDocInstaller::~QtDocInstaller() void QtDocInstaller::installDocs() { + TRACE_OBJ start(LowPriority); } void QtDocInstaller::run() { - QHelpEngineCore *helpEngine = new QHelpEngineCore(m_collectionFile); - helpEngine->setupData(); - bool changes = false; - - QStringList docs; - docs << QLatin1String("assistant") - << QLatin1String("designer") - << QLatin1String("linguist") - << QLatin1String("qmake") - << QLatin1String("qt"); + TRACE_OBJ + m_qchDir = QLibraryInfo::location(QLibraryInfo::DocumentationPath) + + QDir::separator() + QLatin1String("qch"); + m_qchFiles = m_qchDir.entryList(QStringList() << QLatin1String("*.qch")); - foreach (const QString &doc, docs) { - changes |= installDoc(doc, helpEngine); + bool changes = false; + foreach (const DocInfo &docInfo, m_docInfos) { + changes |= installDoc(docInfo); m_mutex.lock(); if (m_abort) { - delete helpEngine; m_mutex.unlock(); return; } m_mutex.unlock(); } - delete helpEngine; emit docsInstalled(changes); } -bool QtDocInstaller::installDoc(const QString &name, QHelpEngineCore *helpEngine) +bool QtDocInstaller::installDoc(const DocInfo &docInfo) { - QString versionKey = QString(QLatin1String("qtVersion%1$$$%2")). - arg(QLatin1String(QT_VERSION_STR)).arg(name); - - QString info = helpEngine->customValue(versionKey, QString()).toString(); - QStringList lst = info.split(QLatin1String("|")); - + TRACE_OBJ + const QString &component = docInfo.first; + const QStringList &info = docInfo.second; QDateTime dt; - if (lst.count() && !lst.first().isEmpty()) - dt = QDateTime::fromString(lst.first(), Qt::ISODate); + if (!info.isEmpty() && !info.first().isEmpty()) + dt = QDateTime::fromString(info.first(), Qt::ISODate); QString qchFile; - if (lst.count() == 2) - qchFile = lst.last(); - - QDir dir(QLibraryInfo::location(QLibraryInfo::DocumentationPath) - + QDir::separator() + QLatin1String("qch")); + if (info.count() == 2) + qchFile = info.last(); - const QStringList files = dir.entryList(QStringList() << QLatin1String("*.qch")); - if (files.isEmpty()) { - helpEngine->setCustomValue(versionKey, QDateTime().toString(Qt::ISODate) - + QLatin1String("|")); + if (m_qchFiles.isEmpty()) { + emit qchFileNotFound(component); return false; } - foreach (const QString &f, files) { - if (f.startsWith(name)) { - QFileInfo fi(dir.absolutePath() + QDir::separator() + f); - if (dt.isValid() && fi.lastModified().toString(Qt::ISODate) == dt.toString(Qt::ISODate) + foreach (const QString &f, m_qchFiles) { + if (f.startsWith(component)) { + QFileInfo fi(m_qchDir.absolutePath() + QDir::separator() + f); + if (dt.isValid() && fi.lastModified().toTime_t() == dt.toTime_t() && qchFile == fi.absoluteFilePath()) return false; - - QString namespaceName = QHelpEngineCore::namespaceName(fi.absoluteFilePath()); - if (namespaceName.isEmpty()) - continue; - - if (helpEngine->registeredDocumentations().contains(namespaceName)) - helpEngine->unregisterDocumentation(namespaceName); - - if (!helpEngine->registerDocumentation(fi.absoluteFilePath())) { - emit errorMessage( - tr("The file %1 could not be registered successfully!\n\nReason: %2") - .arg(fi.absoluteFilePath()).arg(helpEngine->error())); - } - - helpEngine->setCustomValue(versionKey, fi.lastModified().toString(Qt::ISODate) - + QLatin1String("|") + fi.absoluteFilePath()); + emit registerDocumentation(component, fi.absoluteFilePath()); return true; } } + + emit qchFileNotFound(component); return false; } diff --git a/tools/assistant/tools/assistant/qtdocinstaller.h b/tools/assistant/tools/assistant/qtdocinstaller.h index 05606f9..92a707b 100644 --- a/tools/assistant/tools/assistant/qtdocinstaller.h +++ b/tools/assistant/tools/assistant/qtdocinstaller.h @@ -42,34 +42,41 @@ #ifndef QTDOCINSTALLER #define QTDOCINSTALLER -#include <QtCore/QThread> +#include <QtCore/QDir> #include <QtCore/QMutex> +#include <QtCore/QPair> +#include <QtCore/QStringList> +#include <QtCore/QThread> QT_BEGIN_NAMESPACE -class QHelpEngineCore; +class HelpEngineWrapper; class QtDocInstaller : public QThread { Q_OBJECT public: - QtDocInstaller(const QString &collectionFile); + typedef QPair<QString, QStringList> DocInfo; + QtDocInstaller(const QList<DocInfo> &docInfos); ~QtDocInstaller(); void installDocs(); signals: - void errorMessage(const QString &msg); + void qchFileNotFound(const QString &component); + void registerDocumentation(const QString &component, + const QString &absFileName); void docsInstalled(bool newDocsInstalled); private: void run(); - bool installDoc(const QString &name, - QHelpEngineCore *helpEngine); + bool installDoc(const DocInfo &docInfo); bool m_abort; - QString m_collectionFile; QMutex m_mutex; + QStringList m_qchFiles; + QDir m_qchDir; + QList<DocInfo> m_docInfos; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/remotecontrol.cpp b/tools/assistant/tools/assistant/remotecontrol.cpp index 5fa7432..5ecdd69 100644 --- a/tools/assistant/tools/assistant/remotecontrol.cpp +++ b/tools/assistant/tools/assistant/remotecontrol.cpp @@ -38,12 +38,16 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "remotecontrol.h" #include "mainwindow.h" #include "centralwidget.h" +#include "helpenginewrapper.h" #include <QtCore/QFile> +#include <QtCore/QFileInfo> +#include <QtCore/QFileSystemWatcher> #include <QtCore/QThread> #include <QtCore/QTextStream> #include <QtCore/QSocketNotifier> @@ -65,16 +69,19 @@ QT_BEGIN_NAMESPACE StdInListenerWin::StdInListenerWin(QObject *parent) : QThread(parent) { + TRACE_OBJ } StdInListenerWin::~StdInListenerWin() { + TRACE_OBJ terminate(); wait(); } void StdInListenerWin::run() { + TRACE_OBJ bool ok = true; char chBuf[4096]; DWORD dwRead; @@ -97,23 +104,24 @@ void StdInListenerWin::run() #endif while (ok) { - ok = ReadFile(hStdinDup, chBuf, 4096, &dwRead, NULL); + ok = ReadFile(hStdinDup, chBuf, sizeof(chBuf), &dwRead, NULL); if (ok && dwRead != 0) - emit receivedCommand(QString::fromLocal8Bit(chBuf)); + emit receivedCommand(QString::fromLocal8Bit(chBuf, dwRead)); } } #endif -RemoteControl::RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine) +RemoteControl::RemoteControl(MainWindow *mainWindow) : QObject(mainWindow) , m_mainWindow(mainWindow) - , m_helpEngine(helpEngine) , m_debug(false) , m_caching(true) , m_syncContents(false) - , m_expandTOC(-3) + , m_expandTOC(-2) + , helpEngine(HelpEngineWrapper::instance()) { + TRACE_OBJ connect(m_mainWindow, SIGNAL(initDone()), this, SLOT(applyCache())); #ifdef Q_OS_WIN StdInListenerWin *l = new StdInListenerWin(this); @@ -130,6 +138,7 @@ RemoteControl::RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine) void RemoteControl::receivedData() { + TRACE_OBJ QByteArray ba; while (true) { char c = getc(stdin); @@ -145,135 +154,204 @@ void RemoteControl::receivedData() void RemoteControl::handleCommandString(const QString &cmdString) { + TRACE_OBJ QStringList cmds = cmdString.split(QLatin1Char(';')); QStringList::const_iterator it = cmds.constBegin(); - QString cmdLine, cmd, arg; while (it != cmds.constEnd()) { - cmdLine = (*it).trimmed(); - cmd = cmdLine; - arg.clear(); - int i = cmdLine.indexOf(QLatin1Char(' ')); - if (i > 0) { - cmd = cmdLine.left(i); - arg = cmdLine.mid(i+1); - } - cmd = cmd.toLower(); + QString cmd, arg; + splitInputString(*it, cmd, arg); if (m_debug) QMessageBox::information(0, tr("Debugging Remote Control"), tr("Received Command: %1 %2").arg(cmd).arg(arg)); - if (cmd == QLatin1String("debug")) { - if (arg == QLatin1String("on")) - m_debug = true; - else - m_debug = false; - } else if (cmd == QLatin1String("show")) { - if (arg.toLower() == QLatin1String("contents")) { - m_mainWindow->showContents(); - } else if (arg.toLower() == QLatin1String("index")) { - m_mainWindow->showIndex(); - } else if (arg.toLower() == QLatin1String("bookmarks")) { - m_mainWindow->showBookmarks(); - } else if (arg.toLower() == QLatin1String("search")) { - m_mainWindow->showSearch(); - } - } else if (cmd == QLatin1String("hide")) { - if (arg.toLower() == QLatin1String("contents")) { - m_mainWindow->hideContents(); - } else if (arg.toLower() == QLatin1String("index")) { - m_mainWindow->hideIndex(); - } else if (arg.toLower() == QLatin1String("bookmarks")) { - m_mainWindow->hideBookmarks(); - } else if (arg.toLower() == QLatin1String("search")) { - m_mainWindow->hideSearch(); - } - } else if (cmd == QLatin1String("setsource")) { - QUrl url(arg); - if (url.isValid()) { - if (url.isRelative()) - url = CentralWidget::instance()->currentSource().resolved(url); - if (m_caching) { - clearCache(); - m_setSource = url; - } else { - CentralWidget::instance()->setSource(url); - } - } - } else if (cmd == QLatin1String("synccontents")) { - if (m_caching) - m_syncContents = true; - else - m_mainWindow->syncContents(); - } else if (cmd == QLatin1String("activatekeyword")) { - if (m_caching) { - clearCache(); - m_activateKeyword = arg; - } else { - m_mainWindow->setIndexString(arg); - if (!arg.isEmpty()) - m_helpEngine->indexWidget()->activateCurrentItem(); - } - } else if (cmd == QLatin1String("activateidentifier")) { - if (m_caching) { - clearCache(); - m_activateIdentifier = arg; - } else { - QMap<QString, QUrl> links = - m_helpEngine->linksForIdentifier(arg); - if (links.count()) - CentralWidget::instance()->setSource(links.constBegin().value()); - } - } else if (cmd == QLatin1String("expandtoc")) { - bool ok = false; - int depth = -1; - if (!arg.isEmpty()) - depth = arg.toInt(&ok); - if (!ok) - depth = -1; - - if (m_caching) - m_expandTOC = depth; - else - m_mainWindow->expandTOC(depth); - } else if (cmd == QLatin1String("setcurrentfilter")) { - if (!m_helpEngine->customFilters().contains(arg)) - return; - if (m_caching) { - clearCache(); - m_currentFilter = arg; - } else { - m_helpEngine->setCurrentFilter(arg); - } - } else { + if (cmd == QLatin1String("debug")) + handleDebugCommand(arg); + else if (cmd == QLatin1String("show")) + handleShowOrHideCommand(arg, true); + else if (cmd == QLatin1String("hide")) + handleShowOrHideCommand(arg, false); + else if (cmd == QLatin1String("setsource")) + handleSetSourceCommand(arg); + else if (cmd == QLatin1String("synccontents")) + handleSyncContentsCommand(); + else if (cmd == QLatin1String("activatekeyword")) + handleActivateKeywordCommand(arg); + else if (cmd == QLatin1String("activateidentifier")) + handleActivateIdentifierCommand(arg); + else if (cmd == QLatin1String("expandtoc")) + handleExpandTocCommand(arg); + else if (cmd == QLatin1String("setcurrentfilter")) + handleSetCurrentFilterCommand(arg); + else if (cmd == QLatin1String("register")) + handleRegisterCommand(arg); + else if (cmd == QLatin1String("unregister")) + handleUnregisterCommand(arg); + else return; - } + ++it; } m_mainWindow->raise(); m_mainWindow->activateWindow(); } +void RemoteControl::splitInputString(const QString &input, QString &cmd, + QString &arg) +{ + TRACE_OBJ + QString cmdLine = input.trimmed(); + int i = cmdLine.indexOf(QLatin1Char(' ')); + cmd = cmdLine.left(i); + arg = cmdLine.mid(i+1); + cmd = cmd.toLower(); +} + +void RemoteControl::handleDebugCommand(const QString &arg) +{ + TRACE_OBJ + m_debug = arg == QLatin1String("on"); +} + +void RemoteControl::handleShowOrHideCommand(const QString &arg, bool show) +{ + TRACE_OBJ + if (arg.toLower() == QLatin1String("contents")) + m_mainWindow->setContentsVisible(show); + else if (arg.toLower() == QLatin1String("index")) + m_mainWindow->setIndexVisible(show); + else if (arg.toLower() == QLatin1String("bookmarks")) + m_mainWindow->setBookmarksVisible(show); + else if (arg.toLower() == QLatin1String("search")) + m_mainWindow->setSearchVisible(show); +} + +void RemoteControl::handleSetSourceCommand(const QString &arg) +{ + TRACE_OBJ + QUrl url(arg); + if (url.isValid()) { + if (url.isRelative()) + url = CentralWidget::instance()->currentSource().resolved(url); + if (m_caching) { + clearCache(); + m_setSource = url; + } else { + CentralWidget::instance()->setSource(url); + } + } +} + +void RemoteControl::handleSyncContentsCommand() +{ + TRACE_OBJ + if (m_caching) + m_syncContents = true; + else + m_mainWindow->syncContents(); +} + +void RemoteControl::handleActivateKeywordCommand(const QString &arg) +{ + TRACE_OBJ + if (m_caching) { + clearCache(); + m_activateKeyword = arg; + } else { + m_mainWindow->setIndexString(arg); + if (!arg.isEmpty()) + helpEngine.indexWidget()->activateCurrentItem(); + } +} + +void RemoteControl::handleActivateIdentifierCommand(const QString &arg) +{ + TRACE_OBJ + if (m_caching) { + clearCache(); + m_activateIdentifier = arg; + } else { + const QMap<QString, QUrl> &links = helpEngine.linksForIdentifier(arg); + if (!links.isEmpty()) + CentralWidget::instance()->setSource(links.constBegin().value()); + } +} + +void RemoteControl::handleExpandTocCommand(const QString &arg) +{ + TRACE_OBJ + bool ok = false; + int depth = -2; + if (!arg.isEmpty()) + depth = arg.toInt(&ok); + if (!ok || depth < -2) + depth = -2; + + if (m_caching) + m_expandTOC = depth; + else if (depth != -2) + m_mainWindow->expandTOC(depth); +} + +void RemoteControl::handleSetCurrentFilterCommand(const QString &arg) +{ + TRACE_OBJ + if (helpEngine.customFilters().contains(arg)) { + if (m_caching) { + clearCache(); + m_currentFilter = arg; + } else { + helpEngine.setCurrentFilter(arg); + } + } +} + +void RemoteControl::handleRegisterCommand(const QString &arg) +{ + TRACE_OBJ + const QString &absFileName = QFileInfo(arg).absoluteFilePath(); + if (helpEngine.registeredDocumentations(). + contains(QHelpEngineCore::namespaceName(absFileName))) + return; + if (helpEngine.registerDocumentation(absFileName)) + helpEngine.setupData(); +} + +void RemoteControl::handleUnregisterCommand(const QString &arg) +{ + TRACE_OBJ + const QString &absFileName = QFileInfo(arg).absoluteFilePath(); + const QString &ns = QHelpEngineCore::namespaceName(absFileName); + if (helpEngine.registeredDocumentations().contains(ns)) { + CentralWidget* widget = CentralWidget::instance(); + widget->closeOrReloadTabs(widget->currentSourceFileList().keys(ns), false); + if (helpEngine.unregisterDocumentation(ns)) + helpEngine.setupData(); + } +} + void RemoteControl::applyCache() { + TRACE_OBJ if (m_setSource.isValid()) { CentralWidget::instance()->setSource(m_setSource); } else if (!m_activateKeyword.isEmpty()) { m_mainWindow->setIndexString(m_activateKeyword); - m_helpEngine->indexWidget()->activateCurrentItem(); + helpEngine.indexWidget()->activateCurrentItem(); } else if (!m_activateIdentifier.isEmpty()) { QMap<QString, QUrl> links = - m_helpEngine->linksForIdentifier(m_activateIdentifier); - if (links.count()) + helpEngine.linksForIdentifier(m_activateIdentifier); + if (!links.isEmpty()) CentralWidget::instance()->setSource(links.constBegin().value()); } else if (!m_currentFilter.isEmpty()) { - m_helpEngine->setCurrentFilter(m_currentFilter); + helpEngine.setCurrentFilter(m_currentFilter); } if (m_syncContents) m_mainWindow->syncContents(); - if (m_expandTOC != -3) + Q_ASSERT(m_expandTOC >= -2); + if (m_expandTOC != -2) m_mainWindow->expandTOC(m_expandTOC); m_caching = false; @@ -281,6 +359,7 @@ void RemoteControl::applyCache() void RemoteControl::clearCache() { + TRACE_OBJ m_currentFilter.clear(); m_setSource.clear(); m_syncContents = false; diff --git a/tools/assistant/tools/assistant/remotecontrol.h b/tools/assistant/tools/assistant/remotecontrol.h index b888b40..0777878 100644 --- a/tools/assistant/tools/assistant/remotecontrol.h +++ b/tools/assistant/tools/assistant/remotecontrol.h @@ -43,19 +43,20 @@ #define REMOTECONTROL_H #include <QtCore/QObject> +#include <QtCore/QString> #include <QtCore/QUrl> QT_BEGIN_NAMESPACE +class HelpEngineWrapper; class MainWindow; -class QHelpEngine; class RemoteControl : public QObject { Q_OBJECT public: - RemoteControl(MainWindow *mainWindow, QHelpEngine *helpEngine); + RemoteControl(MainWindow *mainWindow); private slots: void receivedData(); @@ -64,10 +65,20 @@ private slots: private: void clearCache(); + void splitInputString(const QString &input, QString &cmd, QString &arg); + void handleDebugCommand(const QString &arg); + void handleShowOrHideCommand(const QString &arg, bool show); + void handleSetSourceCommand(const QString &arg); + void handleSyncContentsCommand(); + void handleActivateKeywordCommand(const QString &arg); + void handleActivateIdentifierCommand(const QString &arg); + void handleExpandTocCommand(const QString &arg); + void handleSetCurrentFilterCommand(const QString &arg); + void handleRegisterCommand(const QString &arg); + void handleUnregisterCommand(const QString &arg); private: MainWindow *m_mainWindow; - QHelpEngine *m_helpEngine; bool m_debug; bool m_caching; @@ -77,6 +88,7 @@ private: QString m_activateIdentifier; int m_expandTOC; QString m_currentFilter; + HelpEngineWrapper &helpEngine; }; QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/searchwidget.cpp b/tools/assistant/tools/assistant/searchwidget.cpp index ad24231..d83790d 100644 --- a/tools/assistant/tools/assistant/searchwidget.cpp +++ b/tools/assistant/tools/assistant/searchwidget.cpp @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "tracer.h" #include "mainwindow.h" #include "searchwidget.h" @@ -65,6 +66,7 @@ SearchWidget::SearchWidget(QHelpSearchEngine *engine, QWidget *parent) , attached(false) , searchEngine(engine) { + TRACE_OBJ QVBoxLayout *vLayout = new QVBoxLayout(this); resultWidget = searchEngine->resultWidget(); @@ -91,11 +93,13 @@ SearchWidget::SearchWidget(QHelpSearchEngine *engine, QWidget *parent) SearchWidget::~SearchWidget() { + TRACE_OBJ // nothing todo } void SearchWidget::zoomIn() { + TRACE_OBJ QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); if (browser && zoomCount != 10) { zoomCount++; @@ -105,6 +109,7 @@ void SearchWidget::zoomIn() void SearchWidget::zoomOut() { + TRACE_OBJ QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); if (browser && zoomCount != -5) { zoomCount--; @@ -114,6 +119,7 @@ void SearchWidget::zoomOut() void SearchWidget::resetZoom() { + TRACE_OBJ if (zoomCount == 0) return; @@ -126,33 +132,39 @@ void SearchWidget::resetZoom() bool SearchWidget::isAttached() const { + TRACE_OBJ return attached; } void SearchWidget::setAttached(bool state) { + TRACE_OBJ attached = state; } void SearchWidget::search() const { + TRACE_OBJ QList<QHelpSearchQuery> query = searchEngine->queryWidget()->query(); searchEngine->search(query); } void SearchWidget::searchingStarted() { + TRACE_OBJ qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); } void SearchWidget::searchingFinished(int hits) { + TRACE_OBJ Q_UNUSED(hits) qApp->restoreOverrideCursor(); } bool SearchWidget::eventFilter(QObject* o, QEvent *e) { + TRACE_OBJ QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); if (browser && o == browser->viewport() && e->type() == QEvent::MouseButtonRelease){ @@ -171,6 +183,7 @@ bool SearchWidget::eventFilter(QObject* o, QEvent *e) void SearchWidget::keyPressEvent(QKeyEvent *keyEvent) { + TRACE_OBJ if (keyEvent->key() == Qt::Key_Escape) MainWindow::activateCurrentBrowser(); else @@ -179,6 +192,7 @@ void SearchWidget::keyPressEvent(QKeyEvent *keyEvent) void SearchWidget::contextMenuEvent(QContextMenuEvent *contextMenuEvent) { + TRACE_OBJ QMenu menu; QPoint point = contextMenuEvent->globalPos(); diff --git a/tools/assistant/tools/assistant/topicchooser.cpp b/tools/assistant/tools/assistant/topicchooser.cpp index 5c04244..262fea8 100644 --- a/tools/assistant/tools/assistant/topicchooser.cpp +++ b/tools/assistant/tools/assistant/topicchooser.cpp @@ -38,9 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -#include <QtCore/QMap> -#include <QtCore/QUrl> +#include "tracer.h" #include "topicchooser.h" @@ -50,37 +48,40 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, const QMap<QString, QUrl> &links) : QDialog(parent) { + TRACE_OBJ ui.setupUi(this); ui.label->setText(tr("Choose a topic for <b>%1</b>:").arg(keyword)); - m_links = links; - QMap<QString, QUrl>::const_iterator it = m_links.constBegin(); - for (; it != m_links.constEnd(); ++it) + QMap<QString, QUrl>::const_iterator it = links.constBegin(); + for (; it != links.constEnd(); ++it) { ui.listWidget->addItem(it.key()); + m_links.append(it.value()); + } if (ui.listWidget->count() != 0) ui.listWidget->setCurrentRow(0); ui.listWidget->setFocus(); - connect(ui.buttonDisplay, SIGNAL(clicked()), - this, SLOT(accept())); - connect(ui.buttonCancel, SIGNAL(clicked()), - this, SLOT(reject())); - connect(ui.listWidget, SIGNAL(itemActivated(QListWidgetItem*)), - this, SLOT(accept())); + connect(ui.buttonDisplay, SIGNAL(clicked()), this, SLOT(accept())); + connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(ui.listWidget, SIGNAL(itemActivated(QListWidgetItem*)), this, + SLOT(accept())); } QUrl TopicChooser::link() const { + TRACE_OBJ QListWidgetItem *item = ui.listWidget->currentItem(); if (!item) return QUrl(); QString title = item->text(); - if (title.isEmpty() || !m_links.contains(title)) + if (title.isEmpty()) return QUrl(); - return m_links.value(title); + const int row = ui.listWidget->row(item); + Q_ASSERT(row < m_links.count()); + return m_links.at(row); } QT_END_NAMESPACE diff --git a/tools/assistant/tools/assistant/topicchooser.h b/tools/assistant/tools/assistant/topicchooser.h index 4dba726..4113cee 100644 --- a/tools/assistant/tools/assistant/topicchooser.h +++ b/tools/assistant/tools/assistant/topicchooser.h @@ -44,9 +44,10 @@ #include "ui_topicchooser.h" -#include <QUrl> -#include <QMap> -#include <QString> +#include <QtCore/QList> +#include <QtCore/QMap> +#include <QtCore/QString> +#include <QtCore/QUrl> #include <QtGui/QDialog> @@ -64,7 +65,7 @@ public: private: Ui::TopicChooser ui; - QMap<QString, QUrl> m_links; + QList<QUrl> m_links; }; QT_END_NAMESPACE diff --git a/tools/assistant/compat/lib/qassistantclient_global.h b/tools/assistant/tools/assistant/tracer.h index 6b58736..66d450a 100644 --- a/tools/assistant/compat/lib/qassistantclient_global.h +++ b/tools/assistant/tools/assistant/tracer.h @@ -39,25 +39,37 @@ ** ****************************************************************************/ -#ifndef QASSISTANTCLIENT_GLOBAL_H -#define QASSISTANTCLIENT_GLOBAL_H +#ifndef TRACER_H +#define TRACER_H -#include <QtCore/qglobal.h> - -QT_BEGIN_HEADER +#include <QtCore/QtGlobal> QT_BEGIN_NAMESPACE -#if defined(QT_ASSISTANT_CLIENT_STATIC) || (!defined(QT_SHARED) && !defined(QT_DLL)) -# define QT_ASSISTANT_CLIENT_EXPORT -#elif defined(QT_ASSISTANT_CLIENT_LIBRARY) -# define QT_ASSISTANT_CLIENT_EXPORT Q_DECL_EXPORT -#else -# define QT_ASSISTANT_CLIENT_EXPORT Q_DECL_IMPORT -#endif +class Tracer +{ +public: + Tracer(const char *func) : m_func(func) + { + qDebug("Entering function %s.", m_func); + } -QT_END_NAMESPACE + ~Tracer() + { + qDebug("Leaving function %s.", m_func); + } -QT_END_HEADER +private: + const char * const m_func; +}; +QT_END_NAMESPACE + +// #define TRACING_REQUESTED +#ifdef TRACING_REQUESTED +#define TRACE_OBJ Tracer traceObj__(Q_FUNC_INFO); +#else +#define TRACE_OBJ #endif + +#endif // TRACER_H diff --git a/tools/assistant/tools/assistant/xbelsupport.cpp b/tools/assistant/tools/assistant/xbelsupport.cpp new file mode 100644 index 0000000..7d5a08b --- /dev/null +++ b/tools/assistant/tools/assistant/xbelsupport.cpp @@ -0,0 +1,233 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "tracer.h" + +#include "xbelsupport.h" + +#include "bookmarkitem.h" +#include "bookmarkmodel.h" + +#include <QtCore/QDate> +#include <QtCore/QModelIndex> + +QT_BEGIN_NAMESPACE + +struct Bookmark { + QString title; + QString url; + bool folded; +}; + +XbelWriter::XbelWriter(BookmarkModel *model) + : QXmlStreamWriter() + , bookmarkModel(model) +{ + TRACE_OBJ + setAutoFormatting(true); +} + +void XbelWriter::writeToFile(QIODevice *device) +{ + TRACE_OBJ + setDevice(device); + + writeStartDocument(); + writeDTD(QLatin1String("<!DOCTYPE xbel>")); + writeStartElement(QLatin1String("xbel")); + writeAttribute(QLatin1String("version"), QLatin1String("1.0")); + + const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); + for (int i = 0; i < bookmarkModel->rowCount(root); ++i) + writeData(bookmarkModel->index(i, 0, root)); + writeEndDocument(); +} + +void XbelWriter::writeData(const QModelIndex &index) +{ + TRACE_OBJ + if (index.isValid()) { + Bookmark entry; + entry.title = index.data().toString(); + entry.url = index.data(UserRoleUrl).toString(); + + if (index.data(UserRoleFolder).toBool()) { + writeStartElement(QLatin1String("folder")); + entry.folded = !index.data(UserRoleExpanded).toBool(); + writeAttribute(QLatin1String("folded"), entry.folded + ? QLatin1String("yes") : QLatin1String("no")); + writeTextElement(QLatin1String("title"), entry.title); + + for (int i = 0; i < bookmarkModel->rowCount(index); ++i) + writeData(bookmarkModel->index(i, 0 , index)); + writeEndElement(); + } else { + writeStartElement(QLatin1String("bookmark")); + writeAttribute(QLatin1String("href"), entry.url); + writeTextElement(QLatin1String("title"), entry.title); + writeEndElement(); + } + } +} + +// -- XbelReader + +XbelReader::XbelReader(BookmarkModel *model) + : QXmlStreamReader() + , bookmarkModel(model) +{ + TRACE_OBJ +} + +bool XbelReader::readFromFile(QIODevice *device) +{ + TRACE_OBJ + setDevice(device); + + while (!atEnd()) { + readNext(); + + if (isStartElement()) { + if (name() == QLatin1String("xbel") + && attributes().value(QLatin1String("version")) + == QLatin1String("1.0")) { + const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); + parents.append(bookmarkModel->addItem(root, true)); + readXBEL(); + bookmarkModel->setData(parents.first(), + QDate::currentDate().toString(Qt::ISODate), Qt::EditRole); + } else { + raiseError(QLatin1String("The file is not an XBEL version 1.0 file.")); + } + } + } + + return !error(); +} + +void XbelReader::readXBEL() +{ + TRACE_OBJ + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("folder")) + readFolder(); + else if (name() == QLatin1String("bookmark")) + readBookmark(); + else + readUnknownElement(); + } + } +} + +void XbelReader::readFolder() +{ + TRACE_OBJ + parents.append(bookmarkModel->addItem(parents.last(), true)); + bookmarkModel->setData(parents.last(), + attributes().value(QLatin1String("folded")) == QLatin1String("no"), + UserRoleExpanded); + + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("title")) { + bookmarkModel->setData(parents.last(), readElementText(), + Qt::EditRole); + } else if (name() == QLatin1String("folder")) + readFolder(); + else if (name() == QLatin1String("bookmark")) + readBookmark(); + else + readUnknownElement(); + } + } + + parents.removeLast(); +} + +void XbelReader::readBookmark() +{ + TRACE_OBJ + const QModelIndex &index = bookmarkModel->addItem(parents.last(), false); + if (BookmarkItem* item = bookmarkModel->itemFromIndex(index)) { + item->setData(UserRoleUrl, attributes().value(QLatin1String("href")) + .toString()); + } + + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) { + if (name() == QLatin1String("title")) + bookmarkModel->setData(index, readElementText(), Qt::EditRole); + else + readUnknownElement(); + } + } +} + +void XbelReader::readUnknownElement() +{ + TRACE_OBJ + while (!atEnd()) { + readNext(); + + if (isEndElement()) + break; + + if (isStartElement()) + readUnknownElement(); + } +} + +QT_END_NAMESPACE diff --git a/tools/assistant/compat/topicchooser.h b/tools/assistant/tools/assistant/xbelsupport.h index fef57df..037415f 100644 --- a/tools/assistant/compat/topicchooser.h +++ b/tools/assistant/tools/assistant/xbelsupport.h @@ -39,39 +39,49 @@ ** ****************************************************************************/ -#ifndef TOPICCHOOSER_H -#define TOPICCHOOSER_H +#ifndef XBELSUPPORT_H +#define XBELSUPPORT_H -#include "ui_topicchooser.h" +#include <QtXml/QXmlStreamReader> +#include <QtCore/QPersistentModelIndex> -#include <QDialog> -#include <QStringList> +QT_FORWARD_DECLARE_CLASS(QIODevice) +QT_FORWARD_DECLARE_CLASS(QModelIndex) QT_BEGIN_NAMESPACE -class TopicChooser : public QDialog +class BookmarkModel; + +class XbelWriter : public QXmlStreamWriter { - Q_OBJECT public: - TopicChooser(QWidget *parent, const QStringList &lnkNames, - const QStringList &lnks, const QString &title); + XbelWriter(BookmarkModel *model); + void writeToFile(QIODevice *device); + +private: + void writeData(const QModelIndex &index); - QString link() const; +private: + BookmarkModel *bookmarkModel; +}; - static QString getLink(QWidget *parent, const QStringList &lnkNames, - const QStringList &lnks, const QString &title); +class XbelReader : public QXmlStreamReader +{ +public: + XbelReader(BookmarkModel *model); + bool readFromFile(QIODevice *device); -private slots: - void on_buttonDisplay_clicked(); - void on_buttonCancel_clicked(); - void on_listbox_itemActivated(QListWidgetItem *item); +private: + void readXBEL(); + void readFolder(); + void readBookmark(); + void readUnknownElement(); private: - Ui::TopicChooser ui; - QString theLink; - QStringList links, linkNames; + BookmarkModel *bookmarkModel; + QList<QPersistentModelIndex> parents; }; -#endif // TOPICCHOOSER_H - QT_END_NAMESPACE + +#endif // XBELSUPPORT_H diff --git a/tools/assistant/tools/qcollectiongenerator/main.cpp b/tools/assistant/tools/qcollectiongenerator/main.cpp index 2339c50..7fcb4e1 100644 --- a/tools/assistant/tools/qcollectiongenerator/main.cpp +++ b/tools/assistant/tools/qcollectiongenerator/main.cpp @@ -39,21 +39,23 @@ ** ****************************************************************************/ +#include "../shared/collectionconfiguration.h" #include "../shared/helpgenerator.h" +#include <private/qhelpgenerator_p.h> +#include <private/qhelpprojectdata_p.h> + +#include <QtCore/QCoreApplication> #include <QtCore/QDir> #include <QtCore/QMap> #include <QtCore/QFileInfo> #include <QtCore/QCoreApplication> #include <QtCore/QDateTime> #include <QtCore/QBuffer> - -#include <private/qhelpgenerator_p.h> -#include <private/qhelpprojectdata_p.h> #include <QtHelp/QHelpEngineCore> - #include <QtXml/QXmlStreamReader> + QT_USE_NAMESPACE class CollectionConfigReader : public QXmlStreamReader @@ -87,6 +89,7 @@ public: QStringList filesToRegister() const { return m_filesToRegister; } QString cacheDirectory() const { return m_cacheDirectory; } + bool cacheDirRelativeToCollection() const { return m_cacheDirRelativeToCollection; } private: void raiseErrorWithLine(); @@ -115,11 +118,13 @@ private: QMap<QString, QString> m_filesToGenerate; QStringList m_filesToRegister; QString m_cacheDirectory; + bool m_cacheDirRelativeToCollection; }; void CollectionConfigReader::raiseErrorWithLine() { - raiseError(QObject::tr("Unknown token at line %1.") + raiseError(QCoreApplication::translate("QCollectionGenerator", + "Unknown token at line %1.") .arg(lineNumber())); } @@ -139,8 +144,10 @@ void CollectionConfigReader::readData(const QByteArray &contents) && attributes().value(QLatin1String("version")) == QLatin1String("1.0")) readConfig(); else - raiseError(QObject::tr("Unknown token at line %1. Expected \"QtHelpCollectionProject\"!") - .arg(lineNumber())); + raiseError(QCoreApplication::translate("QCollectionGenerator", + "Unknown token at line %1. " + "Expected \"QtHelpCollectionProject\"!") + .arg(lineNumber())); } } } @@ -198,6 +205,9 @@ void CollectionConfigReader::readAssistantSettings() } else if (name() == QLatin1String("aboutDialog")) { readAboutDialog(); } else if (name() == "cacheDirectory") { + m_cacheDirRelativeToCollection = + attributes().value(QLatin1String("base")) + == QLatin1String("collection"); m_cacheDirectory = readElementText(); } else { raiseErrorWithLine(); @@ -322,6 +332,14 @@ void CollectionConfigReader::readRegister() } } +namespace { + QString absoluteFileName(const QString &basePath, const QString &fileName) + { + return QFileInfo(fileName).isAbsolute() ? + fileName : basePath + QDir::separator() + fileName; + } +} + int main(int argc, char *argv[]) { QString error; @@ -339,7 +357,8 @@ int main(int argc, char *argv[]) QFileInfo fi(QString::fromLocal8Bit(argv[i])); collectionFile = fi.absoluteFilePath(); } else { - error = QObject::tr("Missing output file name!"); + error = QCoreApplication::translate("QCollectionGenerator", + "Missing output file name!"); } } else if (arg == QLatin1String("-h")) { showHelp = true; @@ -353,14 +372,16 @@ int main(int argc, char *argv[]) } if (showVersion) { - fprintf(stdout, "Qt Collection Generator version 1.0 (Qt %s)\n", QT_VERSION_STR); + fprintf(stdout, "Qt Collection Generator version 1.0 (Qt %s)\n", + QT_VERSION_STR); return 0; } if (configFile.isEmpty() && !showHelp) - error = QObject::tr("Missing collection config file!"); + error = QCoreApplication::translate("QCollectionGenerator", + "Missing collection config file!"); - QString help = QObject::tr("\nUsage:\n\n" + QString help = QCoreApplication::translate("QCollectionGenerator", "\nUsage:\n\n" "qcollectiongenerator <collection-config-file> [options]\n\n" " -o <collection-file> Generates a collection file\n" " called <collection-file>. If\n" @@ -403,13 +424,13 @@ int main(int argc, char *argv[]) while (it != config.filesToGenerate().constEnd()) { fprintf(stdout, "Generating help for %s...\n", qPrintable(it.key())); QHelpProjectData helpData; - if (!helpData.readData(basePath + QDir::separator() + it.key())) { + if (!helpData.readData(absoluteFileName(basePath, it.key()))) { fprintf(stderr, "%s\n", qPrintable(helpData.errorMessage())); return -1; } HelpGenerator helpGenerator; - if (!helpGenerator.generate(&helpData, basePath + QDir::separator() + it.value())) { + if (!helpGenerator.generate(&helpData, absoluteFileName(basePath, it.value()))) { fprintf(stderr, "%s\n", qPrintable(helpGenerator.error())); return -1; } @@ -433,49 +454,54 @@ int main(int argc, char *argv[]) } foreach (const QString &file, config.filesToRegister()) { - if (!helpEngine.registerDocumentation(basePath + QDir::separator() + file)) { + if (!helpEngine.registerDocumentation(absoluteFileName(basePath, file))) { fprintf(stderr, "%s\n", qPrintable(helpEngine.error())); return -1; } } if (!config.title().isEmpty()) - helpEngine.setCustomValue(QLatin1String("WindowTitle"), config.title()); + CollectionConfiguration::setWindowTitle(helpEngine, config.title()); if (!config.homePage().isEmpty()) { - helpEngine.setCustomValue(QLatin1String("defaultHomepage"), - config.homePage()); + CollectionConfiguration::setDefaultHomePage(helpEngine, + config.homePage()); } - if (!config.startPage().isEmpty()) - helpEngine.setCustomValue(QLatin1String("LastShownPages"), config.startPage()); + if (!config.startPage().isEmpty()) { + CollectionConfiguration::setLastShownPages(helpEngine, + QStringList(config.startPage())); + } - if (!config.currentFilter().isEmpty()) - helpEngine.setCustomValue(QLatin1String("CurrentFilter"), config.currentFilter()); + if (!config.currentFilter().isEmpty()) { + helpEngine.setCurrentFilter(config.currentFilter()); + } - if (!config.cacheDirectory().isEmpty()) - helpEngine.setCustomValue(QLatin1String("CacheDirectory"), config.cacheDirectory()); + if (!config.cacheDirectory().isEmpty()) { + CollectionConfiguration::setCacheDir(helpEngine, config.cacheDirectory(), + config.cacheDirRelativeToCollection()); + } - helpEngine.setCustomValue(QLatin1String("EnableFilterFunctionality"), + CollectionConfiguration::setFilterFunctionalityEnabled(helpEngine, config.enableFilterFunctionality()); - helpEngine.setCustomValue(QLatin1String("HideFilterFunctionality"), - config.hideFilterFunctionality()); - helpEngine.setCustomValue(QLatin1String("EnableDocumentationManager"), + CollectionConfiguration::setFilterToolbarVisible(helpEngine, + !config.hideFilterFunctionality()); + CollectionConfiguration::setDocumentationManagerEnabled(helpEngine, config.enableDocumentationManager()); - helpEngine.setCustomValue(QLatin1String("EnableAddressBar"), + CollectionConfiguration::setAddressBarEnabled(helpEngine, config.enableAddressBar()); - helpEngine.setCustomValue(QLatin1String("HideAddressBar"), - config.hideAddressBar()); - helpEngine.setCustomValue(QLatin1String("CreationTime"), + CollectionConfiguration::setAddressBarVisible(helpEngine, + !config.hideAddressBar()); + CollectionConfiguration::setCreationTime(helpEngine, QDateTime::currentDateTime().toTime_t()); if (!config.applicationIcon().isEmpty()) { - QFile icon(basePath + QDir::separator() + config.applicationIcon()); + QFile icon(absoluteFileName(basePath, config.applicationIcon())); if (!icon.open(QIODevice::ReadOnly)) { fprintf(stderr, "Cannot open %s!\n", qPrintable(icon.fileName())); return -1; } - helpEngine.setCustomValue(QLatin1String("ApplicationIcon"), icon.readAll()); + CollectionConfiguration::setApplicationIcon(helpEngine, icon.readAll()); } if (config.aboutMenuTexts().count()) { @@ -487,16 +513,16 @@ int main(int argc, char *argv[]) s << it.value(); ++it; } - helpEngine.setCustomValue(QLatin1String("AboutMenuTexts"), ba); + CollectionConfiguration::setAboutMenuTexts(helpEngine, ba); } if (!config.aboutIcon().isEmpty()) { - QFile icon(basePath + QDir::separator() + config.aboutIcon()); + QFile icon(absoluteFileName(basePath, config.aboutIcon())); if (!icon.open(QIODevice::ReadOnly)) { fprintf(stderr, "Cannot open %s!\n", qPrintable(icon.fileName())); return -1; } - helpEngine.setCustomValue(QLatin1String("AboutIcon"), icon.readAll()); + CollectionConfiguration::setAboutIcon(helpEngine, icon.readAll()); } if (config.aboutTextFiles().count()) { @@ -512,7 +538,7 @@ int main(int argc, char *argv[]) while (it != config.aboutTextFiles().constEnd()) { s << it.key(); - QFileInfo fi(basePath + QDir::separator() + it.value()); + QFileInfo fi(absoluteFileName(basePath, it.value())); QFile f(fi.absoluteFilePath()); if (!f.open(QIODevice::ReadOnly)) { fprintf(stderr, "Cannot open %s!\n", qPrintable(f.fileName())); @@ -544,14 +570,14 @@ int main(int argc, char *argv[]) } ++it; } - helpEngine.setCustomValue(QLatin1String("AboutTexts"), ba); + CollectionConfiguration::setAboutTexts(helpEngine, ba); if (imgData.count()) { QByteArray imageData; QBuffer buffer(&imageData); buffer.open(QIODevice::WriteOnly); QDataStream out(&buffer); out << imgData; - helpEngine.setCustomValue(QLatin1String("AboutImages"), imageData); + CollectionConfiguration::setAboutImages(helpEngine, imageData); } } diff --git a/tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro b/tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro index cf70e48..98e6a31 100644 --- a/tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro +++ b/tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro @@ -1,14 +1,17 @@ -QT += xml network +QT += xml \ + network TEMPLATE = app DESTDIR = ../../../../bin TARGET = qcollectiongenerator -CONFIG += qt warn_on help console +CONFIG += qt \ + warn_on \ + help \ + console CONFIG -= app_bundle - -target.path=$$[QT_INSTALL_BINS] +target.path = $$[QT_INSTALL_BINS] INSTALLS += target - SOURCES += ../shared/helpgenerator.cpp \ - main.cpp - -HEADERS += ../shared/helpgenerator.h + main.cpp \ + ../shared/collectionconfiguration.cpp +HEADERS += ../shared/helpgenerator.h \ + ../shared/collectionconfiguration.h diff --git a/tools/assistant/tools/qhelpgenerator/main.cpp b/tools/assistant/tools/qhelpgenerator/main.cpp index 6245e33..a309f42 100644 --- a/tools/assistant/tools/qhelpgenerator/main.cpp +++ b/tools/assistant/tools/qhelpgenerator/main.cpp @@ -58,6 +58,7 @@ int main(int argc, char *argv[]) QString basePath; bool showHelp = false; bool showVersion = false; + bool checkLinks = false; for (int i = 1; i < argc; ++i) { arg = QString::fromLocal8Bit(argv[i]); @@ -66,12 +67,15 @@ int main(int argc, char *argv[]) QFileInfo fi(QString::fromLocal8Bit(argv[i])); compressedFile = fi.absoluteFilePath(); } else { - error = QObject::tr("Missing output file name!"); + error = QCoreApplication::translate("QHelpGenerator", + "Missing output file name!"); } } else if (arg == QLatin1String("-v")) { showVersion = true; } else if (arg == QLatin1String("-h")) { showHelp = true; + } else if (arg == QLatin1String("-c")) { + checkLinks = true; } else { QFileInfo fi(arg); projectFile = fi.absoluteFilePath(); @@ -80,19 +84,23 @@ int main(int argc, char *argv[]) } if (showVersion) { - fprintf(stdout, "Qt Help Generator version 1.0 (Qt %s)\n", QT_VERSION_STR); + fprintf(stdout, "Qt Help Generator version 1.0 (Qt %s)\n", + QT_VERSION_STR); return 0; } if (projectFile.isEmpty() && !showHelp) - error = QObject::tr("Missing Qt help project file!"); + error = QCoreApplication::translate("QHelpGenerator", + "Missing Qt help project file!"); - QString help = QObject::tr("\nUsage:\n\n" + QString help = QCoreApplication::translate("QHelpGenerator", "\nUsage:\n\n" "qhelpgenerator <help-project-file> [options]\n\n" " -o <compressed-file> Generates a Qt compressed help\n" " file called <compressed-file>.\n" " If this option is not specified\n" " a default name will be used.\n" + " -c Checks whether all links in HTML files\n" + " point to files in this help project.\n" " -v Displays the version of \n" " qhelpgenerator.\n\n"); @@ -111,9 +119,11 @@ int main(int argc, char *argv[]) } if (compressedFile.isEmpty()) { - QFileInfo fi(projectFile); - compressedFile = basePath + QDir::separator() - + fi.baseName() + QLatin1String(".qch"); + if (!checkLinks) { + QFileInfo fi(projectFile); + compressedFile = basePath + QDir::separator() + + fi.baseName() + QLatin1String(".qch"); + } } else { // check if the output dir exists -- create if it doesn't QFileInfo fi(compressedFile); @@ -134,7 +144,11 @@ int main(int argc, char *argv[]) QCoreApplication app(argc, argv); HelpGenerator generator; - bool success = generator.generate(helpData, compressedFile); + bool success = true; + if (checkLinks) + success = generator.checkLinks(*helpData); + if (success && !compressedFile.isEmpty()) + success = generator.generate(helpData, compressedFile); delete helpData; if (!success) { fprintf(stderr, "%s\n", qPrintable(generator.error())); diff --git a/tools/assistant/tools/shared/collectionconfiguration.cpp b/tools/assistant/tools/shared/collectionconfiguration.cpp new file mode 100644 index 0000000..896afaf --- /dev/null +++ b/tools/assistant/tools/shared/collectionconfiguration.cpp @@ -0,0 +1,313 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "collectionconfiguration.h" + +#include <QtHelp/QHelpEngineCore> + +QT_BEGIN_NAMESPACE + +namespace { + const QString AboutIconKey(QLatin1String("AboutIcon")); + const QString AboutImagesKey(QLatin1String("AboutImages")); + const QString AboutMenuTextsKey(QLatin1String("AboutMenuTexts")); + const QString AboutTextsKey(QLatin1String("AboutTexts")); + const QString ApplicationIconKey(QLatin1String("ApplicationIcon")); + const QString CacheDirKey(QLatin1String("CacheDirectory")); + const QString CacheDirRelativeToCollectionKey(QLatin1String("CacheDirRelativeToCollection")); + const QString CreationTimeKey(QLatin1String("CreationTime")); + const QString DefaultHomePageKey(QLatin1String("defaultHomepage")); + const QString EnableAddressBarKey(QLatin1String("EnableAddressBar")); + const QString EnableDocManagerKey(QLatin1String("EnableDocumentationManager")); + const QString EnableFilterKey(QLatin1String("EnableFilterFunctionality")); + const QString HideAddressBarKey(QLatin1String("HideAddressBar")); + const QString FilterToolbarHiddenKey(QLatin1String("HideFilterFunctionality")); + const QString LastPageKey(QLatin1String("LastTabPage")); + const QString LastRegisterTime(QLatin1String("LastRegisterTime")); + const QString LastShownPagesKey(QLatin1String("LastShownPages")); + const QString LastZoomFactorsKey(QLatin1String( +#if !defined(QT_NO_WEBKIT) + "LastPagesZoomWebView" +#else + "LastPagesZoomTextBrowser" +#endif + )); + const QString WindowTitleKey(QLatin1String("WindowTitle")); +} // anonymous namespace + +const QString CollectionConfiguration::DefaultZoomFactor(QLatin1String("0.0")); +const QString CollectionConfiguration::ListSeparator(QLatin1String("|")); + +uint CollectionConfiguration::creationTime(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CreationTimeKey, 0).toUInt(); +} + +void CollectionConfiguration::setCreationTime(QHelpEngineCore &helpEngine, uint time) +{ + helpEngine.setCustomValue(CreationTimeKey, time); +} + +const QString CollectionConfiguration::windowTitle(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(WindowTitleKey).toString(); +} + +void CollectionConfiguration::setWindowTitle(QHelpEngineCore &helpEngine, + const QString &windowTitle) +{ + helpEngine.setCustomValue(WindowTitleKey, windowTitle); +} + +bool CollectionConfiguration::filterFunctionalityEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableFilterKey, true).toBool(); +} + +void CollectionConfiguration::setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableFilterKey, enabled); +} + +bool CollectionConfiguration::filterToolbarVisible(const QHelpEngineCore &helpEngine) +{ + return !helpEngine.customValue(FilterToolbarHiddenKey, true).toBool(); +} + +void CollectionConfiguration::setFilterToolbarVisible(QHelpEngineCore &helpEngine, + bool visible) +{ + helpEngine.setCustomValue(FilterToolbarHiddenKey, !visible); +} + +bool CollectionConfiguration::addressBarEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableAddressBarKey, true).toBool(); +} + +void CollectionConfiguration::setAddressBarEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableAddressBarKey, enabled); +} + +bool CollectionConfiguration::addressBarVisible(const QHelpEngineCore &helpEngine) +{ + return !helpEngine.customValue(HideAddressBarKey, true).toBool(); +} + +void CollectionConfiguration::setAddressBarVisible(QHelpEngineCore &helpEngine, + bool visible) +{ + helpEngine.setCustomValue(HideAddressBarKey, !visible); +} + +const QString CollectionConfiguration::cacheDir(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CacheDirKey).toString(); +} + +bool CollectionConfiguration::cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(CacheDirRelativeToCollectionKey).toBool(); +} + +void CollectionConfiguration::setCacheDir(QHelpEngineCore &helpEngine, + const QString &cacheDir, bool relativeToCollection) +{ + helpEngine.setCustomValue(CacheDirKey, cacheDir); + helpEngine.setCustomValue(CacheDirRelativeToCollectionKey, + relativeToCollection); +} + +bool CollectionConfiguration::documentationManagerEnabled(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(EnableDocManagerKey, true).toBool(); +} + +void CollectionConfiguration::setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, + bool enabled) +{ + helpEngine.setCustomValue(EnableDocManagerKey, enabled); +} + +const QByteArray CollectionConfiguration::applicationIcon(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(ApplicationIconKey).toByteArray(); +} + +void CollectionConfiguration::setApplicationIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon) +{ + helpEngine.setCustomValue(ApplicationIconKey, icon); +} + +const QByteArray CollectionConfiguration::aboutMenuTexts(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutMenuTextsKey).toByteArray(); +} + +void CollectionConfiguration::setAboutMenuTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts) +{ + helpEngine.setCustomValue(AboutMenuTextsKey, texts); +} + +const QByteArray CollectionConfiguration::aboutIcon(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutIconKey).toByteArray(); +} + +void CollectionConfiguration::setAboutIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon) +{ + helpEngine.setCustomValue(AboutIconKey, icon); +} + +const QByteArray CollectionConfiguration::aboutTexts(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutTextsKey).toByteArray(); +} + +void CollectionConfiguration::setAboutTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts) +{ + helpEngine.setCustomValue(AboutTextsKey, texts); +} + +const QByteArray CollectionConfiguration::aboutImages(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(AboutImagesKey).toByteArray(); +} + +void CollectionConfiguration::setAboutImages(QHelpEngineCore &helpEngine, + const QByteArray &images) +{ + helpEngine.setCustomValue(AboutImagesKey, images); +} + +const QString CollectionConfiguration::defaultHomePage(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(DefaultHomePageKey, QLatin1String("help")). + toString(); +} + +void CollectionConfiguration::setDefaultHomePage(QHelpEngineCore &helpEngine, + const QString &page) +{ + helpEngine.setCustomValue(DefaultHomePageKey, page); +} + +const QStringList CollectionConfiguration::lastShownPages(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastShownPagesKey).toString(). + split(ListSeparator, QString::SkipEmptyParts); +} + +void CollectionConfiguration::setLastShownPages(QHelpEngineCore &helpEngine, + const QStringList &lastShownPages) +{ + helpEngine.setCustomValue(LastShownPagesKey, + lastShownPages.join(ListSeparator)); +} + +const QStringList CollectionConfiguration::lastZoomFactors(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastZoomFactorsKey).toString(). + split(ListSeparator, QString::SkipEmptyParts); +} + +void CollectionConfiguration::setLastZoomFactors(QHelpEngineCore &helpEngine, + const QStringList &lastZoomFactors) +{ + helpEngine.setCustomValue(LastZoomFactorsKey, + lastZoomFactors.join(ListSeparator)); +} + +int CollectionConfiguration::lastTabPage(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastPageKey, 1).toInt(); +} + +void CollectionConfiguration::setLastTabPage(QHelpEngineCore &helpEngine, + int lastPage) +{ + helpEngine.setCustomValue(LastPageKey, lastPage); +} + +const QDateTime CollectionConfiguration::lastRegisterTime(const QHelpEngineCore &helpEngine) +{ + return helpEngine.customValue(LastRegisterTime, QDateTime()).toDateTime(); +} + +void CollectionConfiguration::updateLastRegisterTime(QHelpEngineCore &helpEngine) +{ + helpEngine.setCustomValue(LastRegisterTime, QDateTime::currentDateTime()); +} + +bool CollectionConfiguration::isNewer(const QHelpEngineCore &newer, + const QHelpEngineCore &older) +{ + return creationTime(newer) > creationTime(older); +} + +void CollectionConfiguration::copyConfiguration(const QHelpEngineCore &source, + QHelpEngineCore &target) +{ + setCreationTime(target, creationTime(source)); + setWindowTitle(target, windowTitle(source)); + target.setCurrentFilter(source.currentFilter()); + setCacheDir(target, cacheDir(source), cacheDirIsRelativeToCollection(source)); + setFilterFunctionalityEnabled(target, filterFunctionalityEnabled(source)); + setFilterToolbarVisible(target, filterToolbarVisible(source)); + setAddressBarEnabled(target, addressBarEnabled(source)); + setAddressBarVisible(target, addressBarVisible(source)); + setDocumentationManagerEnabled(target, documentationManagerEnabled(source)); + setApplicationIcon(target, applicationIcon(source)); + setAboutMenuTexts(target, aboutMenuTexts(source)); + setAboutIcon(target, aboutIcon(source)); + setAboutTexts(target, aboutTexts(source)); + setAboutImages(target, aboutImages(source)); + setDefaultHomePage(target, defaultHomePage(source)); +} + +QT_END_NAMESPACE diff --git a/tools/assistant/tools/shared/collectionconfiguration.h b/tools/assistant/tools/shared/collectionconfiguration.h new file mode 100644 index 0000000..d897adb --- /dev/null +++ b/tools/assistant/tools/shared/collectionconfiguration.h @@ -0,0 +1,145 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Qt Assistant of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef COLLECTIONCONFIGURATION_H +#define COLLECTIONCONFIGURATION_H + +#include <QtCore/QByteArray> +#include <QtCore/QCoreApplication> +#include <QtCore/QDateTime> +#include <QtCore/QString> +#include <QtCore/QStringList> + +QT_BEGIN_NAMESPACE + +class QHelpEngineCore; + +class CollectionConfiguration +{ +public: + static const QString windowTitle(const QHelpEngineCore &helpEngine); + static void setWindowTitle(QHelpEngineCore &helpEngine, + const QString &windowTitle); + + static const QString cacheDir(const QHelpEngineCore &helpEngine); + static bool cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine); + static void setCacheDir(QHelpEngineCore &helpEngine, + const QString &cacheDir, bool relativeToCollection); + + static uint creationTime(const QHelpEngineCore &helpEngine); + static void setCreationTime(QHelpEngineCore &helpEngine, uint time); + + static bool filterFunctionalityEnabled(const QHelpEngineCore &helpEngine); + static void setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, + bool enabled); + + static bool filterToolbarVisible(const QHelpEngineCore &helpEngine); + static void setFilterToolbarVisible(QHelpEngineCore &helpEngine, + bool visible); + + static bool addressBarEnabled(const QHelpEngineCore &helpEngine); + static void setAddressBarEnabled(QHelpEngineCore &helpEngine, bool enabled); + + static bool addressBarVisible(const QHelpEngineCore &helpEngine); + static void setAddressBarVisible(QHelpEngineCore &helpEngine, bool visible); + + + static bool documentationManagerEnabled(const QHelpEngineCore &helpEngine); + static void setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, + bool enabled); + + static const QByteArray applicationIcon(const QHelpEngineCore &helpEngine); + static void setApplicationIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon); + + // TODO: Encapsulate encoding from/to QByteArray here + static const QByteArray aboutMenuTexts(const QHelpEngineCore &helpEngine); + static void setAboutMenuTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts); + + static const QByteArray aboutIcon(const QHelpEngineCore &helpEngine); + static void setAboutIcon(QHelpEngineCore &helpEngine, + const QByteArray &icon); + + // TODO: Encapsulate encoding from/to QByteArray here + static const QByteArray aboutTexts(const QHelpEngineCore &helpEngine); + static void setAboutTexts(QHelpEngineCore &helpEngine, + const QByteArray &texts); + + static const QByteArray aboutImages(const QHelpEngineCore &helpEngine); + static void setAboutImages(QHelpEngineCore &helpEngine, + const QByteArray &images); + + static const QString defaultHomePage(const QHelpEngineCore &helpEngine); + static void setDefaultHomePage(QHelpEngineCore &helpEngine, + const QString &page); + + // TODO: Don't allow last pages and zoom factors to be set in isolation + // Perhaps also fill up missing elements automatically or assert. + static const QStringList lastShownPages(const QHelpEngineCore &helpEngine); + static void setLastShownPages(QHelpEngineCore &helpEngine, + const QStringList &lastShownPages); + static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine); + static void setLastZoomFactors(QHelpEngineCore &helPEngine, + const QStringList &lastZoomFactors); + + static int lastTabPage(const QHelpEngineCore &helpEngine); + static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage); + + static bool isNewer(const QHelpEngineCore &newer, + const QHelpEngineCore &older); + static void copyConfiguration(const QHelpEngineCore &source, + QHelpEngineCore &target); + + /* + * Note that this only reflects register actions caused by the + * "-register" command line switch, not GUI or remote control actions. + */ + static const QDateTime lastRegisterTime(const QHelpEngineCore &helpEngine); + static void updateLastRegisterTime(QHelpEngineCore &helpEngine); + + static const QString DefaultZoomFactor; + static const QString ListSeparator; +}; + +QT_END_NAMESPACE + +#endif // COLLECTIONCONFIGURATION_H diff --git a/tools/assistant/tools/shared/helpgenerator.cpp b/tools/assistant/tools/shared/helpgenerator.cpp index fa183cd..12008e6 100644 --- a/tools/assistant/tools/shared/helpgenerator.cpp +++ b/tools/assistant/tools/shared/helpgenerator.cpp @@ -61,6 +61,11 @@ bool HelpGenerator::generate(QHelpDataInterface *helpData, return generator->generate(helpData, outputFileName); } +bool HelpGenerator::checkLinks(const QHelpDataInterface &helpData) +{ + return generator->checkLinks(helpData); +} + QString HelpGenerator::error() const { return generator->error(); diff --git a/tools/assistant/tools/shared/helpgenerator.h b/tools/assistant/tools/shared/helpgenerator.h index 903d588..6da1c2b 100644 --- a/tools/assistant/tools/shared/helpgenerator.h +++ b/tools/assistant/tools/shared/helpgenerator.h @@ -57,6 +57,7 @@ public: HelpGenerator(); bool generate(QHelpDataInterface *helpData, const QString &outputFileName); + bool checkLinks(const QHelpDataInterface &helpData); QString error() const; private slots: diff --git a/tools/assistant/translations/qt_help.pro b/tools/assistant/translations/qt_help.pro index 1012f3f..6f66876 100644 --- a/tools/assistant/translations/qt_help.pro +++ b/tools/assistant/translations/qt_help.pro @@ -44,6 +44,7 @@ TRANSLATIONS = \ $$TR_DIR/qt_help_cs.ts \ $$TR_DIR/qt_help_da.ts \ $$TR_DIR/qt_help_de.ts \ + $$TR_DIR/qt_help_hu.ts \ $$TR_DIR/qt_help_ja.ts \ $$TR_DIR/qt_help_pl.ts \ $$TR_DIR/qt_help_ru.ts \ diff --git a/tools/assistant/translations/translations.pro b/tools/assistant/translations/translations.pro index d29ffc3..c692262 100644 --- a/tools/assistant/translations/translations.pro +++ b/tools/assistant/translations/translations.pro @@ -46,6 +46,7 @@ TRANSLATIONS = \ $$TR_DIR/assistant_da.ts \ $$TR_DIR/assistant_de.ts \ $$TR_DIR/assistant_fr.ts \ + $$TR_DIR/assistant_hu.ts \ $$TR_DIR/assistant_ja.ts \ $$TR_DIR/assistant_pl.ts \ $$TR_DIR/assistant_ru.ts \ diff --git a/tools/assistant/translations/translations_adp.pro b/tools/assistant/translations/translations_adp.pro deleted file mode 100644 index f8da2e3..0000000 --- a/tools/assistant/translations/translations_adp.pro +++ /dev/null @@ -1,41 +0,0 @@ -# Include those manually as they do not contain any directory specification - -FORMS += ../compat/helpdialog.ui \ - ../compat/mainwindow.ui \ - ../compat/tabbedbrowser.ui \ - ../compat/topicchooser.ui - -SOURCES += ../compat/main.cpp \ - ../compat/helpwindow.cpp \ - ../compat/topicchooser.cpp \ - ../compat/docuparser.cpp \ - ../compat/index.cpp \ - ../compat/profile.cpp \ - ../compat/config.cpp \ - ../compat/helpdialog.cpp \ - ../compat/mainwindow.cpp \ - ../compat/tabbedbrowser.cpp \ - ../compat/fontsettingsdialog.cpp - -SOURCES += ../../shared/fontpanel/fontpanel.cpp - -HEADERS += ../compat/helpwindow.h \ - ../compat/topicchooser.h \ - ../compat/docuparser.h \ - ../compat/index.h \ - ../compat/profile.h \ - ../compat/helpdialog.h \ - ../compat/mainwindow.h \ - ../compat/tabbedbrowser.h \ - ../compat/config.h \ - ../compat/fontsettingsdialog.h - - -TR_DIR = $$PWD/../../../translations -TRANSLATIONS = \ - $$TR_DIR/assistant_adp_de.ts \ - $$TR_DIR/assistant_adp_ja.ts \ - $$TR_DIR/assistant_adp_pl.ts \ - $$TR_DIR/assistant_adp_ru.ts \ - $$TR_DIR/assistant_adp_zh_CN.ts \ - $$TR_DIR/assistant_adp_zh_TW.ts diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 83b4d9c..7154fd4 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -701,9 +701,6 @@ void Configure::parseCmdLine() } else if ( configCmdLine.at(i) == "-opengl-es-cm" ) { dictionary[ "OPENGL" ] = "yes"; dictionary[ "OPENGL_ES_CM" ] = "yes"; - } else if ( configCmdLine.at(i) == "-opengl-es-cl" ) { - dictionary[ "OPENGL" ] = "yes"; - dictionary[ "OPENGL_ES_CL" ] = "yes"; } else if ( configCmdLine.at(i) == "-opengl-es-2" ) { dictionary[ "OPENGL" ] = "yes"; dictionary[ "OPENGL_ES_2" ] = "yes"; @@ -1821,7 +1818,6 @@ bool Configure::displayHelp() desc("CETEST", "yes", "-cetest", "Compile Windows CE remote test application"); desc( "-signature <file>", "Use file for signing the target project"); desc("OPENGL_ES_CM", "no", "-opengl-es-cm", "Enable support for OpenGL ES Common"); - desc("OPENGL_ES_CL", "no", "-opengl-es-cl", "Enable support for OpenGL ES Common Lite"); desc("OPENGL_ES_2", "no", "-opengl-es-2", "Enable support for OpenGL ES 2.0"); desc("DIRECTSHOW", "no", "-phonon-wince-ds9", "Enable Phonon Direct Show 9 backend for Windows CE"); @@ -1871,8 +1867,16 @@ bool Configure::findFile( const QString &fileName ) QString paths; if (file.endsWith(".h")) { - if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) - return true; + if (!mingwPath.isNull()) { + if (!findFileInPaths(file, mingwPath + QLatin1String("/../include")).isNull()) + return true; + //now let's try the additional compiler path + QDir mingwLibDir = mingwPath + QLatin1String("/../lib/gcc/mingw32"); + foreach(const QFileInfo &version, mingwLibDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) { + if (!findFileInPaths(file, version.absoluteFilePath() + QLatin1String("/include")).isNull()) + return true; + } + } paths = QString::fromLocal8Bit(getenv("INCLUDE")); } else if ( file.endsWith( ".lib" ) || file.endsWith( ".a" ) ) { if (!mingwPath.isNull() && !findFileInPaths(file, mingwPath + QLatin1String("/../lib")).isNull()) @@ -2002,18 +2006,16 @@ bool Configure::checkAvailability(const QString &part) available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "OPENGL_ES_CM") available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); - else if (part == "OPENGL_ES_CL") - available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "OPENGL_ES_2") available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "DIRECTSHOW") available = (dictionary[ "ARCHITECTURE" ] == "windowsce"); else if (part == "SSE2") - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc"); else if (part == "3DNOW" ) - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-icc") && findFile("mm3dnow.h"); else if (part == "MMX" || part == "SSE") - available = (dictionary.value("QMAKESPEC") != "win32-msvc") && (dictionary.value("QMAKESPEC") != "win32-g++"); + available = (dictionary.value("QMAKESPEC") != "win32-msvc"); else if (part == "OPENSSL") available = findFile("openssl\\ssl.h"); else if (part == "DBUS") @@ -2481,11 +2483,6 @@ void Configure::generateOutputVars() qtConfig += "egl"; } - if ( dictionary["OPENGL_ES_CL"] == "yes" ) { - qtConfig += "opengles1cl"; - qtConfig += "egl"; - } - if ( dictionary["OPENVG"] == "yes" ) { qtConfig += "openvg"; qtConfig += "egl"; @@ -2939,13 +2936,10 @@ void Configure::generateConfigfiles() if(dictionary["NATIVE_GESTURES"] == "no") qconfigList += "QT_NO_NATIVE_GESTURES"; if(dictionary["OPENGL_ES_CM"] == "yes" || - dictionary["OPENGL_ES_CL"] == "yes" || dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES"; if(dictionary["OPENGL_ES_CM"] == "yes") qconfigList += "QT_OPENGL_ES_1"; if(dictionary["OPENGL_ES_2"] == "yes") qconfigList += "QT_OPENGL_ES_2"; - if(dictionary["OPENGL_ES_CL"] == "yes") qconfigList += "QT_OPENGL_ES_1_CL"; - if(dictionary["SQL_MYSQL"] == "yes") qconfigList += "QT_SQL_MYSQL"; if(dictionary["SQL_ODBC"] == "yes") qconfigList += "QT_SQL_ODBC"; if(dictionary["SQL_OCI"] == "yes") qconfigList += "QT_SQL_OCI"; diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp index 9fd084d..3a7cd83 100644 --- a/tools/designer/src/components/formeditor/formwindow.cpp +++ b/tools/designer/src/components/formeditor/formwindow.cpp @@ -484,6 +484,7 @@ void FormWindow::setMainContainer(QWidget *w) sheet->setVisible(sheet->indexOf(QLatin1String("windowTitle")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowIcon")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowModality")), true); + sheet->setVisible(sheet->indexOf(QLatin1String("windowOpacity")), true); sheet->setVisible(sheet->indexOf(QLatin1String("windowFilePath")), true); // ### generalize } diff --git a/tools/designer/src/components/propertyeditor/propertyeditor.cpp b/tools/designer/src/components/propertyeditor/propertyeditor.cpp index b171ddc..512cc82 100644 --- a/tools/designer/src/components/propertyeditor/propertyeditor.cpp +++ b/tools/designer/src/components/propertyeditor/propertyeditor.cpp @@ -1175,11 +1175,11 @@ void PropertyEditor::slotValueChanged(QtProperty *property, const QVariant &valu Q_ASSERT(ok); QVariant v; qVariantSetValue(v, e); - emit propertyValueChanged(property->propertyName(), v, true); + emitPropertyValueChanged(property->propertyName(), v, true); return; } - emit propertyValueChanged(property->propertyName(), value, enableSubPropertyHandling); + emitPropertyValueChanged(property->propertyName(), value, enableSubPropertyHandling); } bool PropertyEditor::isDynamicProperty(const QtBrowserItem* item) const diff --git a/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp b/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp index 674c3a8..1a8611c 100644 --- a/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp +++ b/tools/designer/src/components/widgetbox/widgetboxcategorylistview.cpp @@ -88,11 +88,15 @@ namespace qdesigner_internal { struct WidgetBoxCategoryEntry { WidgetBoxCategoryEntry(); - explicit WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &widget, const QIcon &icon, bool editable); + explicit WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &widget, + const QString &filter, + const QIcon &icon, + bool editable); QDesignerWidgetBoxInterface::Widget widget; QString toolTip; QString whatsThis; + QString filter; QIcon icon; bool editable; }; @@ -103,8 +107,11 @@ WidgetBoxCategoryEntry::WidgetBoxCategoryEntry() : { } -WidgetBoxCategoryEntry::WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &w, const QIcon &i, bool e) : +WidgetBoxCategoryEntry::WidgetBoxCategoryEntry(const QDesignerWidgetBoxInterface::Widget &w, + const QString &filterIn, + const QIcon &i, bool e) : widget(w), + filter(filterIn), icon(i), editable(e) { @@ -142,6 +149,7 @@ public: private: typedef QList<WidgetBoxCategoryEntry> WidgetBoxCategoryEntrys; + QRegExp m_classNameRegExp; QDesignerFormEditorInterface *m_core; WidgetBoxCategoryEntrys m_items; QListView::ViewMode m_viewMode; @@ -149,9 +157,11 @@ private: WidgetBoxCategoryModel::WidgetBoxCategoryModel(QDesignerFormEditorInterface *core, QObject *parent) : QAbstractListModel(parent), + m_classNameRegExp(QLatin1String("<widget +class *= *\"([^\"]+)\"")), m_core(core), m_viewMode(QListView::ListMode) { + Q_ASSERT(m_classNameRegExp.isValid()); } QListView::ViewMode WidgetBoxCategoryModel::viewMode() const @@ -205,8 +215,14 @@ bool WidgetBoxCategoryModel::removeCustomWidgets() void WidgetBoxCategoryModel::addWidget(const QDesignerWidgetBoxInterface::Widget &widget, const QIcon &icon,bool editable) { - // build item - WidgetBoxCategoryEntry item(widget, icon, editable); + // build item. Filter on name + class name if it is different and not a layout. + QString filter = widget.name(); + if (!filter.contains(QLatin1String("Layout")) && m_classNameRegExp.indexIn(widget.domXml()) != -1) { + const QString className = m_classNameRegExp.cap(1); + if (!filter.contains(className)) + filter += className; + } + WidgetBoxCategoryEntry item(widget, filter, icon, editable); const QDesignerWidgetDataBaseInterface *db = m_core->widgetDataBase(); const int dbIndex = db->indexOfClassName(widget.name()); if (dbIndex != -1) { @@ -255,7 +271,7 @@ QVariant WidgetBoxCategoryModel::data(const QModelIndex &index, int role) const case Qt::WhatsThisRole: return QVariant(item.whatsThis); case FilterRole: - return item.widget.name(); + return item.filter; } return QVariant(); } diff --git a/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp index e89c47c..9a1739e 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertyeditor.cpp @@ -92,7 +92,8 @@ static const PropertyNameTypeMap &stringPropertyTypes() } QDesignerPropertyEditor::QDesignerPropertyEditor(QWidget *parent, Qt::WindowFlags flags) : - QDesignerPropertyEditorInterface(parent, flags) + QDesignerPropertyEditorInterface(parent, flags), + m_propertyChangedForwardingBlocked(false) { // Make old signal work for compatibility connect(this, SIGNAL(propertyChanged(QString,QVariant)), this, SLOT(slotPropertyChanged(QString,QVariant))); @@ -147,9 +148,20 @@ QDesignerPropertyEditor::StringPropertyParameters QDesignerPropertyEditor::textP return StringPropertyParameters(ValidationSingleLine, true); } +void QDesignerPropertyEditor::emitPropertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling) +{ + // Avoid duplicate signal emission - see below + m_propertyChangedForwardingBlocked = true; + emit propertyValueChanged(name, value, enableSubPropertyHandling); + emit propertyChanged(name, value); + m_propertyChangedForwardingBlocked = false; +} + void QDesignerPropertyEditor::slotPropertyChanged(const QString &name, const QVariant &value) { - emit propertyValueChanged(name, value, true); + // Forward signal from Integration using the old interfaces. + if (!m_propertyChangedForwardingBlocked) + emit propertyValueChanged(name, value, true); } } diff --git a/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h b/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h index cdd53f0..27078f2 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h +++ b/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h @@ -79,7 +79,6 @@ public: static StringPropertyParameters textPropertyValidationMode(QDesignerFormEditorInterface *core, const QObject *object, const QString &propertyName, bool isMainContainer); - Q_SIGNALS: void propertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling); void resetProperty(const QString &name); @@ -97,6 +96,13 @@ public Q_SLOTS: private Q_SLOTS: void slotPropertyChanged(const QString &name, const QVariant &value); + +protected: + void emitPropertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling); + +private: + bool m_propertyChangedForwardingBlocked; + }; } // namespace qdesigner_internal diff --git a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp index b4b962c..13bb1d7 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -610,8 +610,9 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent) createFakeProperty(QLatin1String("whatsThis")); createFakeProperty(QLatin1String("acceptDrops")); createFakeProperty(QLatin1String("dragEnabled")); - // windowModality is visible only for the main container, in which case the form windows enables it on loading + // windowModality/Opacity is visible only for the main container, in which case the form windows enables it on loading setVisible(createFakeProperty(QLatin1String("windowModality")), false); + setVisible(createFakeProperty(QLatin1String("windowOpacity"), double(1.0)), false); if (qobject_cast<const QToolBar *>(d->m_object)) { // prevent toolbars from being dragged off createFakeProperty(QLatin1String("floatable"), QVariant(true)); } else { @@ -1451,8 +1452,13 @@ bool QDesignerPropertySheet::isVisible(int index) const } if (isFakeProperty(index)) { - if (type == PropertyWindowModality) // Hidden for child widgets + switch (type) { + case PropertyWindowModality: // Hidden for child widgets + case PropertyWindowOpacity: return d->m_info.value(index).visible; + default: + break; + } return true; } diff --git a/tools/designer/translations/translations.pro b/tools/designer/translations/translations.pro index a1b99fd..103c1fe 100644 --- a/tools/designer/translations/translations.pro +++ b/tools/designer/translations/translations.pro @@ -132,6 +132,7 @@ TRANSLATIONS = \ $$TR_DIR/designer_cs.ts \ $$TR_DIR/designer_de.ts \ $$TR_DIR/designer_fr.ts \ + $$TR_DIR/designer_hu.ts \ $$TR_DIR/designer_ja.ts \ $$TR_DIR/designer_pl.ts \ $$TR_DIR/designer_ru.ts \ diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro index 693bc71..4f7ed8a 100644 --- a/tools/linguist/linguist/linguist.pro +++ b/tools/linguist/linguist/linguist.pro @@ -9,7 +9,7 @@ CONFIG += qt \ uitools DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII -build_all:!build_pass { +build_all:!build_pass { CONFIG -= build_all CONFIG += release } @@ -42,7 +42,7 @@ SOURCES += \ statistics.cpp \ translatedialog.cpp \ translationsettingsdialog.cpp \ - ../shared/simtexth.cpp + ../shared/simtexth.cpp HEADERS += \ batchtranslationdialog.h \ @@ -71,7 +71,7 @@ contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE DEFINES += QT_KEYWORDS TARGET = linguist win32:RC_FILE = linguist.rc -mac { +mac { static:CONFIG -= global_init_link_order ICON = linguist.icns TARGET = Linguist @@ -100,6 +100,7 @@ TRANSLATIONS = \ $$TR_DIR/linguist_cs.ts \ $$TR_DIR/linguist_de.ts \ $$TR_DIR/linguist_fr.ts \ + $$TR_DIR/linguist_hu.ts \ $$TR_DIR/linguist_ja.ts \ $$TR_DIR/linguist_pl.ts \ $$TR_DIR/linguist_ru.ts \ diff --git a/tools/linguist/linguist/mainwindow.ui b/tools/linguist/linguist/mainwindow.ui index 450ce89..4edde5e 100644 --- a/tools/linguist/linguist/mainwindow.ui +++ b/tools/linguist/linguist/mainwindow.ui @@ -679,7 +679,7 @@ <string>About Qt</string> </property> <property name="whatsThis"> - <string>Display information about the Qt toolkit by Trolltech.</string> + <string>Display information about the Qt toolkit by Nokia.</string> </property> <property name="menuRole"> <enum>QAction::AboutQtRole</enum> diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index b2bfd7c..c9f4a05 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -83,7 +83,7 @@ static void printUsage() printOut(QObject::tr( "Usage:\n" " lupdate [options] [project-file]...\n" - " lupdate [options] [source-file|path]... -ts ts-files\n\n" + " lupdate [options] [source-file|path|@lst-file]... -ts ts-files|@lst-file\n\n" "lupdate is part of Qt's Linguist tool chain. It extracts translatable\n" "messages from Qt UI files, C++, Java and JavaScript/QtScript source code.\n" "Extracted messages are stored in textual translation source files (typically\n" @@ -132,6 +132,8 @@ static void printUsage() " Specify the codec assumed for tr() calls. Effective only with -ts.\n" " -version\n" " Display the version of lupdate and exit.\n" + " @lst-file\n" + " Read additional file names (one per line) from lst-file.\n" ).arg(m_defaultExtensions)); } @@ -560,73 +562,91 @@ int main(int argc, char **argv) return 1; } + QStringList files; + if (arg.startsWith(QLatin1String("@"))) { + QFile lstFile(arg.mid(1)); + if (!lstFile.open(QIODevice::ReadOnly)) { + qWarning("lupdate error: List file '%s' is not readable", + qPrintable(lstFile.fileName())); + return 1; + } + while (!lstFile.atEnd()) + files << QString::fromLocal8Bit(lstFile.readLine().trimmed()); + } else { + files << arg; + } if (metTsFlag) { - bool found = false; - foreach (const Translator::FileFormat &fmt, Translator::registeredFileFormats()) { - if (arg.endsWith(QLatin1Char('.') + fmt.extension, Qt::CaseInsensitive)) { - QFileInfo fi(arg); - if (!fi.exists() || fi.isWritable()) { - tsFileNames.append(QFileInfo(arg).absoluteFilePath()); - } else { - qWarning("lupdate warning: For some reason, '%s' is not writable.\n", - qPrintable(arg)); + foreach (const QString &file, files) { + bool found = false; + foreach (const Translator::FileFormat &fmt, Translator::registeredFileFormats()) { + if (file.endsWith(QLatin1Char('.') + fmt.extension, Qt::CaseInsensitive)) { + QFileInfo fi(file); + if (!fi.exists() || fi.isWritable()) { + tsFileNames.append(QFileInfo(file).absoluteFilePath()); + } else { + qWarning("lupdate warning: For some reason, '%s' is not writable.\n", + qPrintable(file)); + } + found = true; + break; } - found = true; - break; + } + if (!found) { + qWarning("lupdate error: File '%s' has no recognized extension\n", + qPrintable(file)); + return 1; } } - if (!found) { - qWarning("lupdate error: File '%s' has no recognized extension\n", - qPrintable(arg)); - return 1; - } - } else if (arg.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive) - || arg.endsWith(QLatin1String(".pri"), Qt::CaseInsensitive)) { - proFiles << arg; numFiles++; } else { - QFileInfo fi(arg); - if (!fi.exists()) { - qWarning("lupdate error: File '%s' does not exists\n", qPrintable(arg)); - return 1; - } else if (fi.isDir()) { - if (options & Verbose) - printOut(QObject::tr("Scanning directory '%1'...").arg(arg)); - QDir dir = QDir(fi.filePath()); - projectRoots.insert(dir.absolutePath() + QLatin1Char('/')); - if (extensionsNameFilters.isEmpty()) { - foreach (QString ext, extensions.split(QLatin1Char(','))) { - ext = ext.trimmed(); - if (ext.startsWith(QLatin1Char('.'))) - ext.remove(0, 1); - extensionsNameFilters.insert(ext); - } + foreach (const QString &file, files) { + QFileInfo fi(file); + if (!fi.exists()) { + qWarning("lupdate error: File '%s' does not exists\n", qPrintable(file)); + return 1; } - QDir::Filters filters = QDir::Files | QDir::NoSymLinks; - if (recursiveScan) - filters |= QDir::AllDirs | QDir::NoDotAndDotDot; - QFileInfoList fileinfolist; - recursiveFileInfoList(dir, extensionsNameFilters, filters, &fileinfolist); - int scanRootLen = dir.absolutePath().length(); - foreach (const QFileInfo &fi, fileinfolist) { - QString fn = QDir::cleanPath(fi.absoluteFilePath()); - sourceFiles << fn; - - if (!fn.endsWith(QLatin1String(".java")) - && !fn.endsWith(QLatin1String(".ui")) - && !fn.endsWith(QLatin1String(".js")) - && !fn.endsWith(QLatin1String(".qs"))) { - int offset = 0; - int depth = 0; - do { - offset = fn.lastIndexOf(QLatin1Char('/'), offset - 1); - QString ffn = fn.mid(offset + 1); - allCSources.insert(ffn, fn); - } while (++depth < 3 && offset > scanRootLen); + if (file.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive) + || file.endsWith(QLatin1String(".pri"), Qt::CaseInsensitive)) { + proFiles << file; + } else if (fi.isDir()) { + if (options & Verbose) + printOut(QObject::tr("Scanning directory '%1'...").arg(file)); + QDir dir = QDir(fi.filePath()); + projectRoots.insert(dir.absolutePath() + QLatin1Char('/')); + if (extensionsNameFilters.isEmpty()) { + foreach (QString ext, extensions.split(QLatin1Char(','))) { + ext = ext.trimmed(); + if (ext.startsWith(QLatin1Char('.'))) + ext.remove(0, 1); + extensionsNameFilters.insert(ext); + } + } + QDir::Filters filters = QDir::Files | QDir::NoSymLinks; + if (recursiveScan) + filters |= QDir::AllDirs | QDir::NoDotAndDotDot; + QFileInfoList fileinfolist; + recursiveFileInfoList(dir, extensionsNameFilters, filters, &fileinfolist); + int scanRootLen = dir.absolutePath().length(); + foreach (const QFileInfo &fi, fileinfolist) { + QString fn = QDir::cleanPath(fi.absoluteFilePath()); + sourceFiles << fn; + + if (!fn.endsWith(QLatin1String(".java")) + && !fn.endsWith(QLatin1String(".ui")) + && !fn.endsWith(QLatin1String(".js")) + && !fn.endsWith(QLatin1String(".qs"))) { + int offset = 0; + int depth = 0; + do { + offset = fn.lastIndexOf(QLatin1Char('/'), offset - 1); + QString ffn = fn.mid(offset + 1); + allCSources.insert(ffn, fn); + } while (++depth < 3 && offset > scanRootLen); + } } + } else { + sourceFiles << QDir::cleanPath(fi.absoluteFilePath());; } - } else { - sourceFiles << QDir::cleanPath(fi.absoluteFilePath());; } numFiles++; } diff --git a/tools/porting/src/q3porting.xml b/tools/porting/src/q3porting.xml index 7a31d6e..39f341f 100644 --- a/tools/porting/src/q3porting.xml +++ b/tools/porting/src/q3porting.xml @@ -1626,10 +1626,6 @@ <Name>Q3Wizard</Name> </item> <item Type="Qt4Class" > - <Library>QtAssistant</Library> - <Name>QAssistantClient</Name> - </item> - <item Type="Qt4Class" > <Library>QtCore</Library> <Name>QAbstractEventDispatcher</Name> </item> diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp index 48b0dad..b08910a 100644 --- a/tools/qdbus/qdbus/qdbus.cpp +++ b/tools/qdbus/qdbus/qdbus.cpp @@ -248,8 +248,8 @@ static QStringList readList(QStringList &args) return retval; } -static void placeCall(const QString &service, const QString &path, const QString &interface, - const QString &member, QStringList args) +static int placeCall(const QString &service, const QString &path, const QString &interface, + const QString &member, QStringList args, bool try_prop=true) { QDBusInterface iface(service, path, interface, connection); @@ -273,10 +273,22 @@ static void placeCall(const QString &service, const QString &path, const QString } if (midx == -1) { + // Failed to set property after falling back? + // Bail out without displaying an error + if (!try_prop) + return 1; + if (try_prop && args.size() == 1) { + QStringList proparg; + proparg += interface; + proparg += member; + proparg += args.first(); + if (!placeCall(service, path, "org.freedesktop.DBus.Properties", "Set", proparg, false)) + return 0; + } fprintf(stderr, "Cannot find '%s.%s' in object %s at %s\n", qPrintable(interface), qPrintable(member), qPrintable(path), qPrintable(service)); - exit(1); + return 1; } QMetaMethod mm = mo->method(midx); @@ -314,7 +326,7 @@ static void placeCall(const QString &service, const QString &path, const QString if (p.type() == QVariant::Invalid) { fprintf(stderr, "Could not convert '%s' to type '%s'.\n", qPrintable(argument), types.at(i).constData()); - exit(1); + return 1 ; } } else if (id == qMetaTypeId<QDBusVariant>()) { QDBusVariant tmp(p); @@ -324,7 +336,7 @@ static void placeCall(const QString &service, const QString &path, const QString if (path.path().isNull()) { fprintf(stderr, "Cannot pass argument '%s' because it is not a valid object path.\n", qPrintable(argument)); - exit(1); + return 1; } p = qVariantFromValue(path); } else if (id == qMetaTypeId<QDBusSignature>()) { @@ -332,39 +344,50 @@ static void placeCall(const QString &service, const QString &path, const QString if (sig.signature().isNull()) { fprintf(stderr, "Cannot pass argument '%s' because it is not a valid signature.\n", qPrintable(argument)); - exit(1); + return 1; } p = qVariantFromValue(sig); } else { fprintf(stderr, "Sorry, can't pass arg of type '%s'.\n", types.at(i).constData()); - exit(1); + return 1; } params += p; } if (params.count() != types.count() || !args.isEmpty()) { fprintf(stderr, "Invalid number of parameters\n"); - exit(1); + return 1; } } QDBusMessage reply = iface.callWithArgumentList(QDBus::Block, member, params); if (reply.type() == QDBusMessage::ErrorMessage) { QDBusError err = reply; + // Failed to retrieve property after falling back? + // Bail out without displaying an error + if (!try_prop) + return 1; + if (err.type() == QDBusError::UnknownMethod && try_prop) { + QStringList proparg; + proparg += interface; + proparg += member; + if (!placeCall(service, path, "org.freedesktop.DBus.Properties", "Get", proparg, false)) + return 0; + } if (err.type() == QDBusError::ServiceUnknown) fprintf(stderr, "Service '%s' does not exist.\n", qPrintable(service)); else printf("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); - exit(2); + return 2; } else if (reply.type() != QDBusMessage::ReplyMessage) { fprintf(stderr, "Invalid reply type %d\n", int(reply.type())); - exit(1); + return 1; } foreach (QVariant v, reply.arguments()) printArg(v); - exit(0); + return 0; } static bool globServices(QDBusConnectionInterface *bus, const QString &glob) @@ -483,6 +506,7 @@ int main(int argc, char **argv) exit(1); } - placeCall(service, path, interface, member, args); + int ret = placeCall(service, path, interface, member, args); + exit(ret); } diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 6c33054..2df7133 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -881,6 +881,7 @@ QString CppCodeMarker::addMarkUp(const QString& protectedCode, static QRegExp globalX("[\n{()=] *([a-zA-Z_][a-zA-Z_0-9]*)[ \n]*\\("); static QRegExp multiLineComment("/(?:( )?\\*(?:[^*]+|\\*(?! /))*\\*\\1/)"); multiLineComment.setMinimal(true); + static QRegExp singleLineCommentLine("(?:^|\n)(?:[^&]|&(?!quot;)|"(?:[^&\\\\]|&(?!quot;)|\\\\"|\\\\(?!"))*")*//(?!!)[^!\n]*"); static QRegExp singleLineComment("//(?!!)[^!\n]*"); static QRegExp preprocessor("(?:^|\n)(#[ \t]*(?:include|if|elif|endif|error|pragma|define" "|warning)(?:(?:\\\\\n|\\n#)[^\n]*)*)"); @@ -1056,7 +1057,8 @@ QString CppCodeMarker::addMarkUp(const QString& protectedCode, int mlpos; int slpos; int len; - slpos = singleLineComment.indexIn(result, pos); + int sllpos = singleLineCommentLine.indexIn(result, pos); + slpos = sllpos == -1 ? -1 : singleLineComment.indexIn(result, sllpos); mlpos = multiLineComment.indexIn(result, pos); if (slpos == -1 && mlpos == -1) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 9b6a516..7d08c77 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -95,6 +95,7 @@ QT_BEGIN_NAMESPACE #define COMMAND_QMLMETHOD Doc::alias("qmlmethod") #define COMMAND_QMLATTACHEDMETHOD Doc::alias("qmlattachedmethod") #define COMMAND_QMLDEFAULT Doc::alias("default") +#define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype") #endif QStringList CppCodeParser::exampleFiles; @@ -536,7 +537,8 @@ QSet<QString> CppCodeParser::topicCommands() << COMMAND_QMLSIGNAL << COMMAND_QMLATTACHEDSIGNAL << COMMAND_QMLMETHOD - << COMMAND_QMLATTACHEDMETHOD; + << COMMAND_QMLATTACHEDMETHOD + << COMMAND_QMLBASICTYPE; #else << COMMAND_VARIABLE; #endif @@ -728,6 +730,20 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, } return new QmlClassNode(tre->root(), names[0], classNode); } + else if (command == COMMAND_QMLBASICTYPE) { +#if 0 + QStringList parts = arg.split(" "); + qDebug() << command << parts; + if (parts.size() > 1) { + FakeNode* pageNode = static_cast<FakeNode*>(tre->root()->findNode(parts[1], Node::Fake)); + if (pageNode) { + qDebug() << "FOUND"; + return new QmlBasicTypeNode(pageNode, parts[0]); + } + } +#endif + return new QmlBasicTypeNode(tre->root(), arg); + } else if ((command == COMMAND_QMLSIGNAL) || (command == COMMAND_QMLMETHOD) || (command == COMMAND_QMLATTACHEDSIGNAL) || diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index a3cdae6..15386f1 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1428,14 +1428,19 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) QList<Section> sections; QList<Section>::const_iterator s; - QString htmlTitle = fake->fullTitle(); + QString fullTitle = fake->fullTitle(); + QString htmlTitle = fullTitle; if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) { subTitleSize = SmallSubTitle; htmlTitle += " (" + fake->subTitle() + ")"; } + else if (fake->subType() == Node::QmlBasicType) { + fullTitle = "QML Basic Type: " + fullTitle; + htmlTitle = fullTitle; + } generateHeader(htmlTitle, fake, marker, true); - generateTitle(fake->fullTitle(), + generateTitle(fullTitle, Text() << fake->subTitle(), subTitleSize, fake, diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 5796ea4..9357671 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -85,6 +85,9 @@ void Node::setDoc(const Doc& doc, bool replace) } /*! + Construct a node with the given \a type and having the + given \a parent and \a name. The new node is added to the + parent's child list. */ Node::Node(Type type, InnerNode *parent, const QString& name) : typ(type), @@ -490,6 +493,8 @@ NodeList InnerNode::overloads(const QString &funcName) const } /*! + Construct an inner node (i.e., not a leaf node) of the + given \a type and having the given \a parent and \a name. */ InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name) : Node(type, parent, name) @@ -547,6 +552,7 @@ bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2) } /*! + Adds the \a child to this node's child list. */ void InnerNode::addChild(Node *child) { @@ -564,7 +570,7 @@ void InnerNode::addChild(Node *child) else { if (child->type() == Enum) enumChildren.append(child); - childMap.insert(child->name(), child); + childMap.insert(child->name(), child); } } @@ -1207,7 +1213,11 @@ bool TargetNode::isInnerNode() const bool QmlClassNode::qmlOnly = false; /*! - Constructor for the Qml class node. + Constructs a Qml class node (i.e. a Fake node with the + subtype QmlClass. The new node has the given \a parent + and \a name and is associated with the C++ class node + specified by \a cn which may be null if the the Qml + class node is not associated with a C++ class node. */ QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name, @@ -1234,6 +1244,18 @@ QString QmlClassNode::fileBase() const } /*! + Constructs a Qml basic type node (i.e. a Fake node with + the subtype QmlBasicType. The new node has the given + \a parent and \a name. + */ +QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent, + const QString& name) + : FakeNode(parent, name, QmlBasicType) +{ + setTitle(name); +} + +/*! Constructor for the Qml property group node. \a parent is always a QmlClassNode. */ diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index c77fbeb..077aeb8 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -96,7 +96,8 @@ class Node #ifdef QDOC_QML ExternalPage, QmlClass, - QmlPropertyGroup + QmlPropertyGroup, + QmlBasicType #else ExternalPage #endif @@ -373,6 +374,14 @@ class QmlClassNode : public FakeNode const ClassNode* cnode; }; +class QmlBasicTypeNode : public FakeNode +{ + public: + QmlBasicTypeNode(InnerNode *parent, + const QString& name); + virtual ~QmlBasicTypeNode() { } +}; + class QmlPropGroupNode : public FakeNode { public: diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index a001c10..07edcc4 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -104,7 +104,8 @@ QString PageGenerator::fileBase(const Node *node) we prepend "qml-" to the file name of QML element doc files. */ - if (p->subType() == Node::QmlClass) { + if ((p->subType() == Node::QmlClass) || + (p->subType() == Node::QmlBasicType)) { base.prepend("qml-"); } #endif @@ -209,6 +210,10 @@ void PageGenerator::generateInnerNode(const InnerNode *node, if (fakeNode->subType() == Node::QmlPropertyGroup) return; #endif + if (fakeNode->subType() == Node::Page) { + if (node->count() > 0) + qDebug() << "PAGE" << fakeNode->title() << "HAS CHILDREN"; + } } if (node->parent() != 0) { diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 38da552..63455f1 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -6,18 +6,18 @@ include(qt-defines.qdocconf) project = Qt Assistant description = Qt Assistant Manual -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Assistant qhp.Assistant.file = assistant.qhp -qhp.Assistant.namespace = com.trolltech.assistant.460 +qhp.Assistant.namespace = com.trolltech.assistant.470 qhp.Assistant.virtualFolder = qdoc qhp.Assistant.indexTitle = Qt Assistant Manual qhp.Assistant.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Assistant.filterAttributes = qt 4.6.2 tools assistant +qhp.Assistant.filterAttributes = qt 4.7.0 tools assistant qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant qhp.Assistant.subprojects = manual examples diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index 57d21a9..b0c88f1 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -6,18 +6,18 @@ include(qt-defines.qdocconf) project = Qt Designer description = Qt Designer Manual -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Designer qhp.Designer.file = designer.qhp -qhp.Designer.namespace = com.trolltech.designer.460 +qhp.Designer.namespace = com.trolltech.designer.470 qhp.Designer.virtualFolder = qdoc qhp.Designer.indexTitle = Qt Designer Manual qhp.Designer.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Designer.filterAttributes = qt 4.6.2 tools designer +qhp.Designer.filterAttributes = qt 4.7.0 tools designer qhp.Designer.customFilters.Designer.name = Qt Designer Manual qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer qhp.Designer.subprojects = manual examples diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 5860b33..6acd2c6 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -6,18 +6,18 @@ include(qt-defines.qdocconf) project = Qt Linguist description = Qt Linguist Manual -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = Linguist qhp.Linguist.file = linguist.qhp -qhp.Linguist.namespace = com.trolltech.linguist.460 +qhp.Linguist.namespace = com.trolltech.linguist.470 qhp.Linguist.virtualFolder = qdoc qhp.Linguist.indexTitle = Qt Linguist Manual qhp.Linguist.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.Linguist.filterAttributes = qt 4.6.2 tools linguist +qhp.Linguist.filterAttributes = qt 4.7.0 tools linguist qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist qhp.Linguist.subprojects = manual examples diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index 0e7d960..76e7012 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -6,18 +6,18 @@ include(qt-defines.qdocconf) project = QMake description = QMake Manual -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index qhp.projects = qmake qhp.qmake.file = qmake.qhp -qhp.qmake.namespace = com.trolltech.qmake.460 +qhp.qmake.namespace = com.trolltech.qmake.470 qhp.qmake.virtualFolder = qdoc qhp.qmake.indexTitle = QMake Manual qhp.qmake.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png -qhp.qmake.filterAttributes = qt 4.6.2 tools qmake +qhp.qmake.filterAttributes = qt 4.7.0 tools qmake qhp.qmake.customFilters.qmake.name = qmake Manual qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake qhp.qmake.subprojects = manual diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index def4e67..e8595f6 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -6,19 +6,20 @@ include(qt-defines.qdocconf) project = Qt description = Qt Reference Documentation -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \ QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ QtDesigner QtAssistant QAxContainer Phonon \ QAxServer QtUiTools QtTest QtDBus + edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest edition.DesktopLight.groups = -graphicsview-api qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.460 +qhp.Qt.namespace = com.trolltech.qt.470 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = @@ -32,9 +33,9 @@ qhp.Qt.extraFiles = classic.css \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png -qhp.Qt.filterAttributes = qt 4.6.2 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.6.2 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.2 +qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.0 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index 1aefa98..a066021 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -8,11 +8,11 @@ project = Qt versionsym = version = %VERSION% description = Qt Reference Documentation -url = http://qt.nokia.com/doc/4.6 +url = http://qt.nokia.com/doc/4.7 -edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \ - QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ - QtDesigner QtAssistant QAxContainer Phonon \ +edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript \ + QtScriptTools QtSql QtSvg QtWebKit QtXml QtXmlPatterns \ + Qt3Support QtHelp QtDesigner QAxContainer Phonon \ QAxServer QtUiTools QtTest QtDBus edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest edition.DesktopLight.groups = -graphicsview-api @@ -20,7 +20,7 @@ edition.DesktopLight.groups = -graphicsview-api qhp.projects = Qt qhp.Qt.file = qt.qhp -qhp.Qt.namespace = com.trolltech.qt.460 +qhp.Qt.namespace = com.trolltech.qt.470 qhp.Qt.virtualFolder = qdoc qhp.Qt.indexTitle = Qt Reference Documentation qhp.Qt.indexRoot = @@ -34,9 +34,9 @@ qhp.Qt.extraFiles = classic.css \ images/dynamiclayouts-example.png \ images/stylesheet-coffee-plastique.png -qhp.Qt.filterAttributes = qt 4.6.2 qtrefdoc -qhp.Qt.customFilters.Qt.name = Qt 4.6.2 -qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.2 +qhp.Qt.filterAttributes = qt 4.7.0 qtrefdoc +qhp.Qt.customFilters.Qt.name = Qt 4.7.0 +qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 qhp.Qt.subprojects = classes overviews examples qhp.Qt.subprojects.classes.title = Classes qhp.Qt.subprojects.classes.indexTitle = Qt's Classes diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index d46da95..6c2502d 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1914,7 +1914,8 @@ QString Tree::fullDocumentLocation(const Node *node) const } else if (node->type() == Node::Fake) { #ifdef QDOC_QML - if (node->subType() == Node::QmlClass) + if ((node->subType() == Node::QmlClass) || + (node->subType() == Node::QmlBasicType)) return "qml-" + node->fileBase() + ".html"; else #endif diff --git a/tools/qtconfig/translations/translations.pro b/tools/qtconfig/translations/translations.pro index bf8a1da..5d35b6a 100644 --- a/tools/qtconfig/translations/translations.pro +++ b/tools/qtconfig/translations/translations.pro @@ -9,6 +9,7 @@ FORMS = ../mainwindowbase.ui ../paletteeditoradvancedbase.ui ../previewwi TR_DIR = $$PWD/../../../translations TRANSLATIONS = \ + $$TR_DIR/qtconfig_hu.ts \ $$TR_DIR/qtconfig_pl.ts \ $$TR_DIR/qtconfig_ru.ts \ $$TR_DIR/qtconfig_zh_CN.ts \ diff --git a/tools/qvfb/translations/translations.pro b/tools/qvfb/translations/translations.pro index ef42063..b0b1af4 100644 --- a/tools/qvfb/translations/translations.pro +++ b/tools/qvfb/translations/translations.pro @@ -28,6 +28,7 @@ SOURCES = ../qvfb.cpp \ TR_DIR = $$PWD/../../../translations TRANSLATIONS = \ + $$TR_DIR/qvfb_hu.ts \ $$TR_DIR/qvfb_pl.ts \ $$TR_DIR/qvfb_ru.ts \ $$TR_DIR/qvfb_zh_CN.ts \ diff --git a/tools/shared/fontpanel/fontpanel.cpp b/tools/shared/fontpanel/fontpanel.cpp index ad297df..fe221fd 100644 --- a/tools/shared/fontpanel/fontpanel.cpp +++ b/tools/shared/fontpanel/fontpanel.cpp @@ -96,8 +96,12 @@ QFont FontPanel::selectedFont() const const QString family = rc.family(); rc.setPointSize(pointSize()); const QString styleDescription = styleString(); - rc.setItalic(m_fontDatabase.italic(family, styleDescription)); - + if (styleDescription.contains(QLatin1String("Italic"))) + rc.setStyle(QFont::StyleItalic); + else if (styleDescription.contains(QLatin1String("Oblique"))) + rc.setStyle(QFont::StyleOblique); + else + rc.setStyle(QFont::StyleNormal); rc.setBold(m_fontDatabase.bold(family, styleDescription)); // Weight < 0 asserts... diff --git a/translations/assistant_adp_de.ts b/translations/assistant_adp_de.ts deleted file mode 100644 index 79c9c76..0000000 --- a/translations/assistant_adp_de.ts +++ /dev/null @@ -1,973 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.0" language="de"> -<context> - <name>AssistantServer</name> - <message> - <location filename="../tools/assistant/compat/main.cpp" line="+225"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="+1"/> - <source>Failed to bind to port %1</source> - <translation>Kann Port %1 nicht binden</translation> - </message> -</context> -<context> - <name>FontPanel</name> - <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/> - <source>Font</source> - <translation>Schrift</translation> - </message> - <message> - <location line="+11"/> - <source>&Writing system</source> - <translation>S&kript</translation> - </message> - <message> - <location line="+3"/> - <source>&Family</source> - <translation>&Schriftart</translation> - </message> - <message> - <location line="+4"/> - <source>&Style</source> - <translation>S&chriftschnitt</translation> - </message> - <message> - <location line="+4"/> - <source>&Point size</source> - <translation>Schriftg&rad</translation> - </message> -</context> -<context> - <name>FontSettingsDialog</name> - <message> - <location filename="../tools/assistant/compat/fontsettingsdialog.cpp" line="+63"/> - <source>Font Settings</source> - <translation>Schriftart</translation> - </message> - <message> - <location line="+7"/> - <source>Font settings for:</source> - <translation>Schriftart für:</translation> - </message> - <message> - <location line="+4"/> - <source>Browser</source> - <translation>Hilfeseiten</translation> - </message> - <message> - <location line="+1"/> - <source>Application</source> - <translation>Anwendung</translation> - </message> - <message> - <location line="+6"/> - <source>Use custom settings</source> - <translation>Erweitere Einstellungen nutzen</translation> - </message> -</context> -<context> - <name>HelpDialog</name> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui"/> - <source>Con&tents</source> - <translation>Inhal&t</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+376"/> - <location line="+16"/> - <location line="+661"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="-771"/> - <source>Open Link in New Window</source> - <translation>Öffne Link in neuem Fenster</translation> - </message> - <message> - <location line="+76"/> - <location line="+82"/> - <source>Prepare...</source> - <translation>Initialisiere...</translation> - </message> - <message> - <location line="-47"/> - <source>Cannot open the index file %1</source> - <translation>Kann Indexdatei %1 nicht öffnen</translation> - </message> - <message> - <location line="+58"/> - <location line="+124"/> - <location line="+8"/> - <source>Warning</source> - <translation>Warnung</translation> - </message> - <message> - <location line="-131"/> - <location line="+124"/> - <source>Documentation file %1 does not exist! -Skipping file.</source> - <translation>Dokumentation %1 existiert nicht! -Überspringe Datei.</translation> - </message> - <message> - <location line="-112"/> - <location line="+133"/> - <source>Parse Error</source> - <translation>Syntaxfehler</translation> - </message> - <message> - <location line="+35"/> - <location line="+469"/> - <source>Done</source> - <translation>Fertig</translation> - </message> - <message> - <location line="-18"/> - <source>Indexing files...</source> - <translation>Indiziere Dokumentation...</translation> - </message> - <message> - <location line="+15"/> - <source>Reading dictionary...</source> - <translation>Lese Suchindex...</translation> - </message> - <message> - <location line="+46"/> - <location line="+9"/> - <source>Full Text Search</source> - <translation>Volltextsuche</translation> - </message> - <message> - <location line="-8"/> - <source>Using a wildcard within phrases is not allowed.</source> - <translation>Wildcards innerhalb von Phrasen sind nicht zugelassen.</translation> - </message> - <message> - <location line="+9"/> - <source>The closing quotation mark is missing.</source> - <translation>Das schließende Anführungszeichen fehlt.</translation> - </message> - <message numerus="yes"> - <location line="+7"/> - <source>%n document(s) found.</source> - <translation> - <numerusform>%n Dokumente gefunden.</numerusform> - <numerusform></numerusform> - </translation> - </message> - <message> - <location line="-882"/> - <source>Open Link in Current Tab</source> - <translation>Link im Aktuellen Tab öffnen</translation> - </message> - <message> - <location line="+6"/> - <source>Open Link in New Tab</source> - <translation>Link in einem neuen Tab öffnen</translation> - </message> - <message> - <location line="+91"/> - <source>Failed to load keyword index file -Assistant will not work!</source> - <translation>Die Indexdatei konnte nicht geladen werden. -Der Assistent ist nicht einsatzbereit!</translation> - </message> - <message> - <location line="+208"/> - <source>Documentation file %1 is not compatible! -Skipping file.</source> - <translation>Dokumentation %1 ist nicht kompatibel! Datei wird übersprungen.</translation> - </message> - <message> - <location line="+470"/> - <source>Failed to save fulltext search index -Assistant will not work!</source> - <translation>Der Index für die Volltextsuche konnte nicht gespeichert werden. -Assistent ist nicht einsatzbereit!</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui"/> - <source>Help</source> - <translation>Hilfe</translation> - </message> - <message> - <location/> - <source><b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p></source> - <translation><b>Hilfe</b><p>Wählen Sie ein Hilfethema aus dem Inhalt oder suchen Sie im Index nach Schlüsselwörtern.</p></translation> - </message> - <message> - <location/> - <source>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</source> - <translation>Zeigt Hilfethemen geordnet nach Kategorie, Index oder Lesezeichen an. Ein weiterer Abschnitt enthält die Volltextsuche.</translation> - </message> - <message> - <location/> - <source><b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p></source> - <translation><b>Hilfethemen geordnet nach Kategorie.</b><p>Doppelklicken Sie einen Eintrag, um die Themen dieser Kategorie zu sehen. Doppelklicken Sie ein Thema, um es angezeigt zu bekommen.</p></translation> - </message> - <message> - <location/> - <source>column 1</source> - <translation>Spalte 1</translation> - </message> - <message> - <location/> - <source>&Index</source> - <translation>&Index</translation> - </message> - <message> - <location/> - <source>&Look For:</source> - <translation>Suchen &nach:</translation> - </message> - <message> - <location/> - <source>Enter keyword</source> - <translation>Geben Sie ein Schlüsselwort ein</translation> - </message> - <message> - <location/> - <source><b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p></source> - <translation><b>Geben Sie ein Schlüsselwort ein.</b><p>Es wird dann der Eintrag aus der Liste ausgewählt, der am besten mit dem eingegebenen Begriff übereinstimmt.</p></translation> - </message> - <message> - <location/> - <source><b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p></source> - <translation><b>Liste aller verfügbaren Hilfethemen.</b><p>Doppelklicken Sie auf einen Eintrag, um die Hilfe zu öffnen. Wenn mehr als eine Seite gefunden wurde, wählen Sie die gewünschte Seite aus.</p></translation> - </message> - <message> - <location/> - <source>&Bookmarks</source> - <translation>L&esezeichen</translation> - </message> - <message> - <location/> - <source>Displays the list of bookmarks.</source> - <translation>Zeigt alle Lesezeichen an.</translation> - </message> - <message> - <location/> - <source>Add new bookmark</source> - <translation>Füge neues Lesezeichen hinzu</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>Füge aktuelle Seite zu den Lesezeichen hinzu.</translation> - </message> - <message> - <location/> - <source>&New</source> - <translation>&Neu</translation> - </message> - <message> - <location/> - <source>Delete bookmark</source> - <translation>Lösche Lesezeichen</translation> - </message> - <message> - <location/> - <source>Delete the selected bookmark.</source> - <translation>Lösche markiertes Lesezeichen.</translation> - </message> - <message> - <location/> - <source>&Delete</source> - <translation>&Löschen</translation> - </message> - <message> - <location/> - <source>&Search</source> - <translation>&Suche</translation> - </message> - <message> - <location/> - <source>Searching f&or:</source> - <translation>Suche &nach:</translation> - </message> - <message> - <location/> - <source><b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p></source> - <translation><b>Geben Sie Suchbegriffe ein.</b><p>Geben Sie hier die gesuchten Begriffe ein. Die Begriffe können Wildcards (*) enthalten. Eine Phrase muß in Anführungszeichen stehen.</p></translation> - </message> - <message> - <location/> - <source><b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p></source> - <translation><b>Gefundene Dokumente</b><p>Diese Liste beinhaltet alle gefundenen Dokumente der letzten Suche. Die Dokumente sind nach der Häufigkeit der Treffer geordnet.</p></translation> - </message> - <message> - <location/> - <source>Found &Documents:</source> - <translation>Gefundene &Dokumente:</translation> - </message> - <message> - <location/> - <source>Display the help page for the full text search.</source> - <translation>Zeigt die Hilfeseite für die Volltextsuche an.</translation> - </message> - <message> - <location/> - <source>He&lp</source> - <translation>Hi&lfe</translation> - </message> - <message> - <location/> - <source>Pressing this button starts the search.</source> - <translation>Startet die Suche.</translation> - </message> - <message> - <location/> - <source>Preparing...</source> - <translation>Initialisiere...</translation> - </message> - <message> - <location/> - <source>Enter searchword(s)</source> - <translation>Geben Sie Suchbegriffe ein</translation> - </message> - <message> - <location/> - <source>Display the help page</source> - <translation>Hilfeseite anzeigen</translation> - </message> - <message> - <location/> - <source>Start searching</source> - <translation>Suche beginnen</translation> - </message> -</context> -<context> - <name>HelpWindow</name> - <message> - <location filename="../tools/assistant/compat/helpwindow.cpp" line="+97"/> - <source>Help</source> - <translation>Hilfe</translation> - </message> - <message> - <location line="+93"/> - <source>Open Link in New Window Shift+LMB</source> - <translation>Öffne Link in neuem Fenster</translation> - </message> - <message> - <location line="-2"/> - <source>Open Link in New Tab</source> - <translation>Link in einem neuen Tab öffnen</translation> - </message> - <message> - <location line="-90"/> - <source>Unable to launch web browser. -</source> - <translation>Der Webbrowser konnte nicht gestartet werden. -</translation> - </message> - <message> - <location line="+1"/> - <source>OK</source> - <translation>OK</translation> - </message> - <message> - <location line="+27"/> - <source>Failed to open link: '%1'</source> - <translation>Der Link '%1' konnte nicht geöffnet werden</translation> - </message> - <message> - <location line="+1"/> - <source><div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div></source> - <translation><div align="center"><h1>Die Seite wurde nicht gefunden</h1><br><h3>'%1'</h3></div></translation> - </message> - <message> - <location line="+2"/> - <source>Error...</source> - <translation>Fehler ...</translation> - </message> - <message> - <location line="+56"/> - <source>Copy &Link Location</source> - <translation>Link-Adresse kopieren</translation> - </message> -</context> -<context> - <name>Index</name> - <message> - <location filename="../tools/assistant/compat/index.cpp" line="+385"/> - <source>Untitled</source> - <translation>Unbenannt</translation> - </message> -</context> -<context> - <name>MainWindow</name> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Toolbar</source> - <translation>Werkzeugleiste</translation> - </message> - <message> - <location/> - <source>&Print...</source> - <translation>&Drucken...</translation> - </message> - <message> - <location/> - <source>E&xit</source> - <translation>&Beenden</translation> - </message> - <message> - <location/> - <source>&Copy</source> - <translation>&Kopieren</translation> - </message> - <message> - <location/> - <source>&Find in Text...</source> - <translation>Text&suche...</translation> - </message> - <message> - <location/> - <source>&Home</source> - <translation>St&artseite</translation> - </message> - <message> - <location/> - <source>&Previous</source> - <translation>&Vorherige</translation> - </message> - <message> - <location/> - <source>&Next</source> - <translation>&Nächste</translation> - </message> - <message> - <location/> - <source>About Qt</source> - <translation>Über Qt</translation> - </message> - <message> - <location/> - <source>Zoom &in</source> - <translation>Vergrößern</translation> - </message> - <message> - <location/> - <source>Zoom &out</source> - <translation>Ver&kleinern</translation> - </message> - <message> - <location/> - <source>New Window</source> - <translation>Neues Fenster...</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+198"/> - <source>Ctrl+T</source> - <translation>Strg+T -</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+I</source> - <translation>Strg+I</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+B</source> - <translation>Strg+E</translation> - </message> - <message> - <location line="+129"/> - <location line="+1"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>&Add Bookmark</source> - <translation>&Füge Lesezeichen hinzu</translation> - </message> - <message> - <location/> - <source>&File</source> - <translation>&Datei</translation> - </message> - <message> - <location/> - <source>&Edit</source> - <translation>&Bearbeiten</translation> - </message> - <message> - <location/> - <source>&View</source> - <translation>&Ansicht</translation> - </message> - <message> - <location/> - <source>&Go</source> - <translation>&Gehe zu</translation> - </message> - <message> - <location/> - <source>Boo&kmarks</source> - <translation>&Lesezeichen</translation> - </message> - <message> - <location/> - <source>Qt Assistant by Nokia</source> - <translation>Qt Assistant von Nokia</translation> - </message> - <message> - <location/> - <source>&Help</source> - <translation>&Hilfe</translation> - </message> - <message> - <location/> - <source>Print the currently displayed page.</source> - <translation>Drucke aktuelle Seite.</translation> - </message> - <message> - <location/> - <source>Ctrl+P</source> - <translation>Strg+P</translation> - </message> - <message> - <location/> - <source>Quit Qt Assistant.</source> - <translation>Qt Assistant beenden.</translation> - </message> - <message> - <location/> - <source>Ctrl+Q</source> - <translation>Strg+Q</translation> - </message> - <message> - <location/> - <source>Copy the selected text to the clipboard.</source> - <translation>Den markierten Text in die Zwischenablage kopieren.</translation> - </message> - <message> - <location/> - <source>Ctrl+C</source> - <translation>Strg+C</translation> - </message> - <message> - <location/> - <source>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</source> - <translation>Den Suchdialog öffnen. Qt Assistant sucht in der aktuellen Seite nach dem eingegebenen Text.</translation> - </message> - <message> - <location/> - <source>Ctrl+F</source> - <translation>Strg+F</translation> - </message> - <message> - <location/> - <source>Go to the home page. Qt Assistant's home page is the Qt Reference Documentation.</source> - <translation>Zur Startseite gehen. Startseite im Qt Assistant ist die Qt-Referenzdokumentation.</translation> - </message> - <message> - <location/> - <source>Ctrl+Home</source> - <translation>Strg+Pos1</translation> - </message> - <message> - <location/> - <source>Go to the previous page.</source> - <translation>Gehe zur vorherigen Seite.</translation> - </message> - <message> - <location/> - <source>Alt+Left</source> - <translation>Alt+Links</translation> - </message> - <message> - <location/> - <source>Go to the next page.</source> - <translation>Gehe zur nächsten Seite.</translation> - </message> - <message> - <location/> - <source>Alt+Right</source> - <translation>Alt+Rechts</translation> - </message> - <message> - <location/> - <source>Display further information about Qt Assistant.</source> - <translation>Zeigt das Handbuch zum Qt Designer an.</translation> - </message> - <message> - <location/> - <source>Zoom in on the document, i.e. increase the font size.</source> - <translation>Vergrößert die Schrift.</translation> - </message> - <message> - <location/> - <source>Ctrl++</source> - <translation>Strg++</translation> - </message> - <message> - <location/> - <source>Zoom out on the document, i.e. decrease the font size.</source> - <translation>Verkleinert die Schrift.</translation> - </message> - <message> - <location/> - <source>Ctrl+-</source> - <translation>Strg+-</translation> - </message> - <message> - <location/> - <source>Open a new window.</source> - <translation>Öffnet ein neues Fenster.</translation> - </message> - <message> - <location/> - <source>Ctrl+N</source> - <translation>Strg+N</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>&Schließen</translation> - </message> - <message> - <location/> - <source>Close the current window.</source> - <translation>Schließt das aktuelle Fenster.</translation> - </message> - <message> - <location/> - <source>Qt Assistant Manual</source> - <translation>Handbuch zu Qt Assistant</translation> - </message> - <message> - <location/> - <source>F1</source> - <translation>F1</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>Aktuelle Seite zu den Lesezeichen hinzufügen.</translation> - </message> - <message> - <location/> - <source>What's This?</source> - <translation>Direkthilfe</translation> - </message> - <message> - <location/> - <source>"What's This?" context sensitive help.</source> - <translation>Kontextbezogene Direkthilfe.</translation> - </message> - <message> - <location/> - <source>Shift+F1</source> - <translation>Umschalt+F1</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="-129"/> - <source>Ctrl+S</source> - <translation>Strg+S</translation> - </message> - <message> - <location line="-33"/> - <source>Initializing Qt Assistant...</source> - <translation>Qt Assistant wird initialisiert...</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Go</source> - <translation>Gehe zu</translation> - </message> - <message> - <location/> - <source>Find &Next</source> - <translation>Weitersuchen</translation> - </message> - <message> - <location/> - <source>F3</source> - <translation>F3</translation> - </message> - <message> - <location/> - <source>Find &Previous</source> - <translation>Vorheriges suchen</translation> - </message> - <message> - <location/> - <source>Shift+F3</source> - <translation>Umschalt+F3</translation> - </message> - <message> - <location/> - <source>About Qt Assistant</source> - <translation>Über Qt Assistent</translation> - </message> - <message> - <location/> - <source>Add Tab</source> - <translation>Tab einfügen</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+N</source> - <translation></translation> - </message> - <message> - <location/> - <source>Next Tab</source> - <translation>Nächster Tab</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Right</source> - <translation></translation> - </message> - <message> - <location/> - <source>Previous Tab</source> - <translation>Voriger Tab</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Left</source> - <translation></translation> - </message> - <message> - <location/> - <source>Close Tab</source> - <translation>Tab schließen</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Q</source> - <translation></translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+181"/> - <source>Failed to open about application contents in file: '%1'</source> - <translation>Fehler beim Öffnen des Inhalts in Datei: '%1'</translation> - </message> - <message> - <location line="-246"/> - <source>Sidebar</source> - <translation>Sidebar</translation> - </message> - <message> - <location line="+18"/> - <source>&Window</source> - <translation>&Fenster</translation> - </message> - <message> - <location line="+2"/> - <source>Minimize</source> - <translation>Minimieren</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+M</source> - <translation>Strg+M</translation> - </message> - <message> - <location line="+70"/> - <source>SHIFT+CTRL+=</source> - <translation>Umschalt+Strg+=</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Ctrl+W</source> - <translation>Strg+W</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+8"/> - <source>Ctrl+]</source> - <translation>Strg+AltGr+]</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+[</source> - <translation>Strg+AltGr+[</translation> - </message> - <message> - <location line="+7"/> - <source>Views</source> - <translation>Menüleisten/Sidebar</translation> - </message> - <message> - <location line="+80"/> - <source>Displays the main page of a specific documentation set.</source> - <translation>Zeigt die Hauptseite eines Dokumentensets an.</translation> - </message> - <message> - <location line="+262"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+238"/> - <location line="+6"/> - <source>Save Page</source> - <translation>Seite speichern</translation> - </message> - <message> - <location line="+0"/> - <source>Cannot open file for writing!</source> - <translation>Die Datei konnte nicht zum Schreiben geöffnet werden.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Save Page As...</source> - <translation>Seite speichern als...</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+S</source> - <translation>Strg+Alt+S</translation> - </message> - <message> - <location/> - <source>Sync with Table of Contents</source> - <translation>Seite mit Inhalt-Tab syncronisieren</translation> - </message> - <message> - <location/> - <source>Select the page in contents tab.</source> - <translation>Wählt die Seite im Inhalt-Tab aus.</translation> - </message> - <message> - <location/> - <source>Font Settings...</source> - <translation>Schriftart...</translation> - </message> -</context> -<context> - <name>QObject</name> - <message> - <location filename="../tools/assistant/compat/config.cpp" line="+350"/> - <source>Qt Assistant by Nokia</source> - <translation>Qt Assistant von Nokia</translation> - </message> -</context> -<context> - <name>TabbedBrowser</name> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui"/> - <source>TabbedBrowser</source> - <translation></translation> - </message> - <message> - <location/> - <source>Untitled</source> - <translation>Unbenannt</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+235"/> - <source>Add page</source> - <translation>Seite einfügen</translation> - </message> - <message> - <location line="+9"/> - <source>Close page</source> - <translation>Seite schließen</translation> - </message> - <message> - <location line="-95"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+338"/> - <source>New Tab</source> - <translation>Neuer Tab</translation> - </message> - <message> - <location line="+1"/> - <source>Close Tab</source> - <translation>Tab schließen</translation> - </message> - <message> - <location line="+1"/> - <source>Close Other Tabs</source> - <translation>Andere Tabs schließen</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui"/> - <source>Previous</source> - <translation>Vorheriger</translation> - </message> - <message> - <location/> - <source>Next</source> - <translation>Nächster</translation> - </message> - <message> - <location/> - <source>Case Sensitive</source> - <translation>Groß-/Kleinschreibung beachten</translation> - </message> - <message> - <location/> - <source>Whole words</source> - <translation>Ganze Wörter</translation> - </message> - <message> - <location/> - <source><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</source> - <translation><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Seitenende</translation> - </message> -</context> -<context> - <name>TopicChooser</name> - <message> - <location filename="../tools/assistant/compat/topicchooser.cpp" line="+56"/> - <source>Choose a topic for <b>%1</b></source> - <translation>Wählen Sie ein Thema für <b>%1</b></translation> - </message> - <message> - <location filename="../tools/assistant/compat/topicchooser.ui"/> - <source>Choose Topic</source> - <translation>Thema wählen</translation> - </message> - <message> - <location/> - <source>Select a topic from the list and click the <b>Display</b>-button to open the online help.</source> - <translation>Wählen Sie ein Thema aus der Liste aus und klicken Sie <b>Anzeigen</b> um die Hilfe zu öffnen.</translation> - </message> - <message> - <location/> - <source>&Topics</source> - <translation>&Themen</translation> - </message> - <message> - <location/> - <source>Displays a list of available help topics for the keyword.</source> - <translation>Zeigt eine Liste der verfügbaren Hilfethemen für diesen Begriff an.</translation> - </message> - <message> - <location/> - <source>&Display</source> - <translation>&Anzeigen</translation> - </message> - <message> - <location/> - <source>Open the topic selected in the list.</source> - <translation>Öffne das gewählte Thema aus der Liste.</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>&Schließen</translation> - </message> - <message> - <location/> - <source>Close the Dialog.</source> - <translation>Schließt den Dialog.</translation> - </message> -</context> -</TS> diff --git a/translations/assistant_adp_ja.ts b/translations/assistant_adp_ja.ts deleted file mode 100644 index f87beab..0000000 --- a/translations/assistant_adp_ja.ts +++ /dev/null @@ -1,1047 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.0" language="ja"> -<context> - <name>AssistantServer</name> - <message> - <location filename="../tools/assistant/compat/main.cpp" line="+225"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="+1"/> - <source>Failed to bind to port %1</source> - <translation>ポート %1 のバインドに失敗しました</translation> - </message> -</context> -<context> - <name>FontPanel</name> - <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/> - <source>Font</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> - <source>&Writing system</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+3"/> - <source>&Family</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> - <source>&Style</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> - <source>&Point size</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>FontSettingsDialog</name> - <message> - <location filename="../tools/assistant/compat/fontsettingsdialog.cpp" line="+63"/> - <source>Font Settings</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+7"/> - <source>Font settings for:</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> - <source>Browser</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Application</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+6"/> - <source>Use custom settings</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>HelpDialog</name> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+279"/> - <source>Open Link in Current Tab</source> - <translation>リンクを現在のタブに開く</translation> - </message> - <message> - <location line="+3"/> - <source>Open Link in New Window</source> - <translation>リンクを新しいウィンドウで開く</translation> - </message> - <message> - <location line="+3"/> - <source>Open Link in New Tab</source> - <translation>リンクを新しいタブで開く</translation> - </message> - <message> - <location line="+73"/> - <location line="+82"/> - <source>Prepare...</source> - <translation>準備中...</translation> - </message> - <message> - <location line="-64"/> - <location line="+16"/> - <location line="+661"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="-677"/> - <source>Failed to load keyword index file -Assistant will not work!</source> - <translation>キーワードインデックスファイルのロードに失敗しました -Assistant は動きません!</translation> - </message> - <message> - <location line="+17"/> - <source>Cannot open the index file %1</source> - <translation>インデックスファイル %1 をオープンできません</translation> - </message> - <message> - <location line="+58"/> - <location line="+124"/> - <location line="+8"/> - <source>Warning</source> - <translation>警告</translation> - </message> - <message> - <location line="-131"/> - <location line="+124"/> - <source>Documentation file %1 does not exist! -Skipping file.</source> - <translation>ドキュメンテーションファイル %1 は存在しません! -スキップします。</translation> - </message> - <message> - <location line="-112"/> - <location line="+133"/> - <source>Parse Error</source> - <translation>パースエラー</translation> - </message> - <message> - <location line="-13"/> - <source>Documentation file %1 is not compatible! -Skipping file.</source> - <translation>ドキュメンテーションファイル %1 は互換性がありません! -スキップします。</translation> - </message> - <message numerus="yes"> - <location line="+577"/> - <source>%n document(s) found.</source> - <translation type="unfinished"> - <numerusform></numerusform> - </translation> - </message> - <message> - <source>Index</source> - <translation type="obsolete">インデックス</translation> - </message> - <message> - <source>Bookmarks</source> - <translation type="obsolete">ブックマーク</translation> - </message> - <message> - <source>Contents</source> - <translation type="obsolete">目次</translation> - </message> - <message> - <source>Search</source> - <translation type="obsolete">検索</translation> - </message> - <message> - <location line="-529"/> - <location line="+469"/> - <source>Done</source> - <translation>完了</translation> - </message> - <message> - <location line="-47"/> - <source>Failed to save fulltext search index -Assistant will not work!</source> - <translation>全文検索インデックスのセーブに失敗しました -Assistant は動きません!</translation> - </message> - <message> - <location line="+29"/> - <source>Indexing files...</source> - <translation>インデックス作成中...</translation> - </message> - <message> - <location line="+15"/> - <source>Reading dictionary...</source> - <translation>ディレクトリを読み込んでいます...</translation> - </message> - <message> - <location line="+46"/> - <location line="+9"/> - <source>Full Text Search</source> - <translation>全文検索</translation> - </message> - <message> - <location line="-8"/> - <source>Using a wildcard within phrases is not allowed.</source> - <translation>フレーズ中のワイルドカードの使用は認められていません。</translation> - </message> - <message> - <location line="+9"/> - <source>The closing quotation mark is missing.</source> - <translation>閉じ引用符がありません。</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui"/> - <source>Help</source> - <translation>ヘルプ</translation> - </message> - <message> - <location/> - <source><b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p></source> - <translation><b>ヘルプ</b><p>目次のリストからヘルプを希望するトピックを選択します、あるいはキーワードをインデックスから検索します。</p></translation> - </message> - <message> - <location/> - <source>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</source> - <translation>カテゴリ、インデックス、ブックマークで編成したヘルプトピックを表示します。もう一つのタブは全文検索を引き継いでいます。</translation> - </message> - <message> - <location/> - <source>Con&tents</source> - <translation>目次(&T)</translation> - </message> - <message> - <location/> - <source><b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p></source> - <translation><b>カテゴリで編成したヘルプトピックです。</b><p>カテゴリ内のトピックを見るには、項目をダブルクリックしてください。</p></translation> - </message> - <message> - <location/> - <source>column 1</source> - <translation>コラム 1</translation> - </message> - <message> - <location/> - <source>&Index</source> - <translation>インデックス(&I)</translation> - </message> - <message> - <location/> - <source>&Look For:</source> - <translation>以下を検索(&L):</translation> - </message> - <message> - <location/> - <source>Enter keyword</source> - <translation>キーワードを入力してください</translation> - </message> - <message> - <location/> - <source><b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p></source> - <translation><b>キーワードを入力してください。</b><p>入力された文字列に一番近いものを選択します。</p></translation> - </message> - <message> - <location/> - <source><b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p></source> - <translation><b>ヘルプトピック一覧</b><p>ヘルプページをオープンするには、項目をダブルクリックしてください。複数見つかった場合は、その中から選んでください。</p></translation> - </message> - <message> - <location/> - <source>&Bookmarks</source> - <translation>ブックマーク(&B)</translation> - </message> - <message> - <location/> - <source>Displays the list of bookmarks.</source> - <translation>ブックマーク一覧を表示します。</translation> - </message> - <message> - <location/> - <source>Add new bookmark</source> - <translation>新しいブックマークを追加</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>現在表示されているページを新しいブックマークとして追加します。</translation> - </message> - <message> - <location/> - <source>&New</source> - <translation>新規(&N)</translation> - </message> - <message> - <location/> - <source>Delete bookmark</source> - <translation>ブックマークを削除</translation> - </message> - <message> - <location/> - <source>Delete the selected bookmark.</source> - <translation>選択されたブックマークを削除します。</translation> - </message> - <message> - <location/> - <source>&Delete</source> - <translation>削除(&D)</translation> - </message> - <message> - <location/> - <source>&Search</source> - <translation>検索(&S)</translation> - </message> - <message> - <location/> - <source>Searching f&or:</source> - <translation>以下を検索(&O):</translation> - </message> - <message> - <location/> - <source>Enter searchword(s).</source> - <translation>検索する語(フレーズ)を入力してください。</translation> - </message> - <message> - <location/> - <source><b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p></source> - <translation><b>検索する語(フレーズ)を入力してください。</b><p>検索する語(フレーズ)を入力してください。ワイルドカード(*)を含めることもできます。連続する語を入力する場合は引用符で囲んでください。</p></translation> - </message> - <message> - <location/> - <source><b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p></source> - <translation><b>見つかったドキュメント</b><p>この一覧は最新の検索で見つかったドキュメントを全て含んでいます。該当項目が多い順に並んでいます。</p></translation> - </message> - <message> - <location/> - <source>Found &Documents:</source> - <translation>見つかったドキュメント(&D):</translation> - </message> - <message> - <location/> - <source>Display the help page.</source> - <translation>ヘルプページを表示します。</translation> - </message> - <message> - <location/> - <source>Display the help page for the full text search.</source> - <translation>全文検索用にヘルプページを表示します。</translation> - </message> - <message> - <location/> - <source>He&lp</source> - <translation>ヘルプ(&L)</translation> - </message> - <message> - <location/> - <source>Start searching.</source> - <translation>検索を開始します。</translation> - </message> - <message> - <location/> - <source>Pressing this button starts the search.</source> - <translation>このボタンを押すと検索が始まります。</translation> - </message> - <message> - <location/> - <source>Preparing...</source> - <translation>準備中...</translation> - </message> -</context> -<context> - <name>HelpWindow</name> - <message> - <location filename="../tools/assistant/compat/helpwindow.cpp" line="+97"/> - <source>Help</source> - <translation>ヘルプ</translation> - </message> - <message> - <location line="+2"/> - <source>OK</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+27"/> - <source>Failed to open link: '%1'</source> - <translation>リンク開けませんでした: '%1'</translation> - </message> - <message> - <location line="+1"/> - <source><div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div></source> - <translation><div align="center"><h1>ページが見つかりませんでした</h1><br><h3>'%1'</h3></div></translation> - </message> - <message> - <location line="+2"/> - <source>Error...</source> - <translation>エラー...</translation> - </message> - <message> - <location line="+56"/> - <source>Copy &Link Location</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+5"/> - <source>Open Link in New Window Shift+LMB</source> - <translation>リンクを新しいウィンドウで開く Shift+LMB</translation> - </message> - <message> - <location line="-2"/> - <source>Open Link in New Tab</source> - <translation>リンクを新しいタブで開く</translation> - </message> - <message> - <location line="-90"/> - <source>Unable to launch web browser. -</source> - <translation>ブラウザを起動できません。 -</translation> - </message> - <message> - <source>Ok</source> - <translation type="obsolete">Ok</translation> - </message> -</context> -<context> - <name>Index</name> - <message> - <location filename="../tools/assistant/compat/index.cpp" line="+385"/> - <source>Untitled</source> - <translation>タイトルなし</translation> - </message> -</context> -<context> - <name>MainWindow</name> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+103"/> - <source>Sidebar</source> - <translation>サイドバー</translation> - </message> - <message> - <location line="+55"/> - <source>Initializing Qt Assistant...</source> - <translation>Qt Assistant を初期化中...</translation> - </message> - <message> - <location line="+26"/> - <source>SHIFT+CTRL+=</source> - <translation>SHIFT+CTRL+=</translation> - </message> - <message> - <location line="+4"/> - <source>Ctrl+T</source> - <translation>Ctrl+T</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+I</source> - <translation>Ctrl+I</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+B</source> - <translation>Ctrl+B</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+S</source> - <translation>Ctrl+S</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Ctrl+W</source> - <translation>Ctrl+W</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+1"/> - <source>Ctrl+]</source> - <translation>Ctrl+]</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+[</source> - <translation>Ctrl+[</translation> - </message> - <message> - <location line="+7"/> - <source>Views</source> - <translation>表示</translation> - </message> - <message> - <location line="+80"/> - <source>Displays the main page of a specific documentation set.</source> - <translation>指定されたドキュメントセットのメインページを表示します。</translation> - </message> - <message> - <location line="+49"/> - <location line="+1"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="+19"/> - <source>Failed to open about application contents in file: '%1'</source> - <translation>'%1' というファイル内の、アプリケーションについての説明内容を開けませんでした</translation> - </message> - <message> - <location line="+201"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+238"/> - <location line="+6"/> - <source>Save Page</source> - <translation>ページを保存</translation> - </message> - <message> - <location line="+0"/> - <source>Cannot open file for writing!</source> - <translation>書き込みのためにファイルが開けません!</translation> - </message> - <message> - <source>Qt Assistant by Trolltech</source> - <translation type="obsolete">Trolltech の Qt Assistant</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Toolbar</source> - <translation>ツールバー</translation> - </message> - <message> - <location/> - <source>Go</source> - <translation>移動</translation> - </message> - <message> - <location/> - <source>&File</source> - <translation>ファイル(&F)</translation> - </message> - <message> - <location/> - <source>&Edit</source> - <translation>編集(&E)</translation> - </message> - <message> - <location/> - <source>Font Settings...</source> - <translation type="unfinished"></translation> - </message> - <message> - <location/> - <source>&View</source> - <translation>表示(&V)</translation> - </message> - <message> - <location/> - <source>&Go</source> - <translation>移動(&G)</translation> - </message> - <message> - <location/> - <source>Boo&kmarks</source> - <translation>ブックマーク(&K)</translation> - </message> - <message> - <location/> - <source>Qt Assistant by Nokia</source> - <translation type="unfinished"></translation> - </message> - <message> - <location/> - <source>&Help</source> - <translation>ヘルプ(&H)</translation> - </message> - <message> - <location/> - <source>Print the currently displayed page.</source> - <translation>現在表示されているページを印刷します。</translation> - </message> - <message> - <location/> - <source>Ctrl+P</source> - <translation>Ctrl+P</translation> - </message> - <message> - <location/> - <source>&Print...</source> - <translation>印刷(&P)...</translation> - </message> - <message> - <location/> - <source>Quit Qt Assistant.</source> - <translation>Qt Assistant を終了します。</translation> - </message> - <message> - <location/> - <source>Ctrl+Q</source> - <translation>Ctrl+Q</translation> - </message> - <message> - <location/> - <source>E&xit</source> - <translation>終了(&X)</translation> - </message> - <message> - <location/> - <source>Copy the selected text to the clipboard.</source> - <translation>選択されているテキストをクリップボードにコピーします。</translation> - </message> - <message> - <location/> - <source>Ctrl+C</source> - <translation>Ctrl+C</translation> - </message> - <message> - <location/> - <source>&Copy</source> - <translation>コピー(&C)</translation> - </message> - <message> - <location/> - <source>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</source> - <translation>検索ダイアログを開きます。Qt Assistant は入力されたテキストを現在表示されているページから検索します。</translation> - </message> - <message> - <location/> - <source>Ctrl+F</source> - <translation>Ctrl+F</translation> - </message> - <message> - <location/> - <source>&Find in Text...</source> - <translation>テキスト内を検索(&F)...</translation> - </message> - <message> - <location/> - <source>F3</source> - <translation>F3</translation> - </message> - <message> - <location/> - <source>Find &Next</source> - <translation>次を検索(&N)</translation> - </message> - <message> - <location/> - <source>Shift+F3</source> - <translation>Shift+F3</translation> - </message> - <message> - <location/> - <source>Find &Previous</source> - <translation>前を検索(&P)</translation> - </message> - <message> - <location/> - <source>Go to the home page. Qt Assistant's home page is the Qt Reference Documentation.</source> - <translation>ホームページへ移動します。Qt Assistant のホームページは Qt Reference Documentation です。</translation> - </message> - <message> - <location/> - <source>Ctrl+Home</source> - <translation>Ctrl+Home</translation> - </message> - <message> - <location/> - <source>&Home</source> - <translation>ホーム(&H)</translation> - </message> - <message> - <location/> - <source>Go to the previous page.</source> - <translation>一つ前のページへ戻ります。</translation> - </message> - <message> - <location/> - <source>Alt+Left</source> - <translation>Alt+左矢印</translation> - </message> - <message> - <location/> - <source>&Previous</source> - <translation>戻る(&P)</translation> - </message> - <message> - <location/> - <source>Go to the next page.</source> - <translation>一つ先のページへ進みます。</translation> - </message> - <message> - <location/> - <source>Alt+Right</source> - <translation>Alt+右矢印</translation> - </message> - <message> - <location/> - <source>&Next</source> - <translation>進む(&N)</translation> - </message> - <message> - <location/> - <source>Display further information about Qt Assistant.</source> - <translation>Qt Assistant について、さらに詳しい情報を表示します。</translation> - </message> - <message> - <location/> - <source>About Qt Assistant</source> - <translation>Qt Assistant について</translation> - </message> - <message> - <location/> - <source>About Qt</source> - <translation>Qt について</translation> - </message> - <message> - <location/> - <source>Zoom in on the document, i.e. increase the font size.</source> - <translation>文書をズームイン(フォントサイズを拡大)します。</translation> - </message> - <message> - <location/> - <source>Ctrl++</source> - <translation>Ctrl++</translation> - </message> - <message> - <location/> - <source>Zoom &in</source> - <translation>拡大(&I)</translation> - </message> - <message> - <location/> - <source>Zoom out on the document, i.e. decrease the font size.</source> - <translation>文書をズームアウト(フォントサイズを縮小)します。</translation> - </message> - <message> - <location/> - <source>Ctrl+-</source> - <translation>Ctrl+-</translation> - </message> - <message> - <location/> - <source>Zoom &out</source> - <translation>縮小(&O)</translation> - </message> - <message> - <location/> - <source>Open a new window.</source> - <translation>新規ウィンドウを開きます。</translation> - </message> - <message> - <location/> - <source>Ctrl+N</source> - <translation>Ctrl+N</translation> - </message> - <message> - <location/> - <source>New Window</source> - <translation>新しいウィンドウ</translation> - </message> - <message> - <location/> - <source>Close the current window.</source> - <translation>現在のウィンドウを閉じます。</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>閉じる(&C)</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>現在表示されているページを新規ブックマークとして追加します。</translation> - </message> - <message> - <location/> - <source>&Add Bookmark</source> - <translation>ブックマークに追加(&A)</translation> - </message> - <message> - <location/> - <source>"What's This?" context sensitive help.</source> - <translation>文脈依存のヘルプ、ヒントです。</translation> - </message> - <message> - <location/> - <source>Shift+F1</source> - <translation>Shift+F1</translation> - </message> - <message> - <location/> - <source>What's This?</source> - <translation>ヒント</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+N</source> - <translation>Ctrl+Alt+N</translation> - </message> - <message> - <location/> - <source>Add Tab</source> - <translation>タブを追加</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Right</source> - <translation>Ctrl+Alt+右矢印</translation> - </message> - <message> - <location/> - <source>Next Tab</source> - <translation>次のタブ</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Left</source> - <translation>Ctrl+Alt+左矢印</translation> - </message> - <message> - <location/> - <source>Previous Tab</source> - <translation>前のタブ</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Q</source> - <translation>Ctrl+Alt+Q</translation> - </message> - <message> - <location/> - <source>Close Tab</source> - <translation>タブを閉じる</translation> - </message> - <message> - <location/> - <source>F1</source> - <translation>F1</translation> - </message> - <message> - <location/> - <source>Qt Assistant Manual</source> - <translation>Qt Assistant マニュアル</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+S</source> - <translation>Ctrl+Alt+S</translation> - </message> - <message> - <location/> - <source>Save Page As...</source> - <translation>名前をつけてページを保存...</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="-673"/> - <source>&Window</source> - <translation>ウィンドウ(&W)</translation> - </message> - <message> - <location line="+2"/> - <source>Minimize</source> - <translation>最小化</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+M</source> - <translation>Ctrl+M</translation> - </message> - <message> - <source>Open Source Edition</source> - <translation type="obsolete">オープンソース版</translation> - </message> - <message> - <source>This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development.</source> - <translation type="obsolete">この Qt Assistant は Qt オープンソース版の一部であり、オープンソースのアプリケーションの開発を目的としたものです。Qt は、複数のプラットフォームに対応するアプリケーションを開発するための C++ のわかりやすいフレームワークです。</translation> - </message> - <message> - <source>You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qt.nokia.com/company/model.html">qt.nokia.com/company/model.html</a> for an overview of Qt licensing.</source> - <translation type="obsolete">著作権のある(ソースを公開しない)アプリケーションを開発するには、Qt の商用ライセンスが必要です。Qt のライセンスの概要については <a href="http://qt.nokia.com/company/model.html">qt.nokia.com/company/model.html</a> をご覧ください。</translation> - </message> - <message> - <source>This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.</source> - <translation type="obsolete">このプログラムは Qt 商用版ライセンス規約の定める条件の下で、あなたにライセンスされています。詳細はこのソフトウェアとともに配布される LICENSE ファイルをご覧ください。</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Sync with Table of Contents</source> - <translation>目次の該当箇所を表示</translation> - </message> - <message> - <location/> - <source>Select the page in contents tab.</source> - <translation>「目次」タブからそのページを選択します。</translation> - </message> -</context> -<context> - <name>QAssistantClient</name> - <message> - <source>Failed to start Qt Assistant.</source> - <translation type="obsolete">Qt Assistant の起動に失敗しました。</translation> - </message> - <message> - <source>Qt Assistant crashed.</source> - <translation type="obsolete">Qt Assistant がクラッシュしました。</translation> - </message> - <message> - <source>Error while running Qt Assistant.</source> - <translation type="obsolete">Qt Assistant 実行中にエラーが発生しました。</translation> - </message> - <message> - <source>Cannot connect to Qt Assistant.</source> - <translation type="obsolete">Qt Assistant に接続できません。</translation> - </message> - <message> - <source>Could not connect to Assistant: Connection refused</source> - <translation type="obsolete">Assistant に接続できませんでした: 接続を拒否されました</translation> - </message> - <message> - <source>Could not connect to Assistant: Host not found</source> - <translation type="obsolete">Assistant に接続できませんでした: ホストが見つかりませんでした</translation> - </message> - <message> - <source>Communication error</source> - <translation type="obsolete">通信エラー</translation> - </message> -</context> -<context> - <name>QObject</name> - <message> - <source>Qt Assistant by Trolltech</source> - <translation type="obsolete">Trolltech の Qt Assistant</translation> - </message> - <message> - <location filename="../tools/assistant/compat/config.cpp" line="+350"/> - <source>Qt Assistant by Nokia</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>TabbedBrowser</name> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+149"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+86"/> - <source>Add page</source> - <translation>ページを追加</translation> - </message> - <message> - <location line="+9"/> - <source>Close page</source> - <translation>ページを閉じる</translation> - </message> - <message> - <location line="+243"/> - <source>New Tab</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Close Tab</source> - <translation type="unfinished">タブを閉じる</translation> - </message> - <message> - <location line="+1"/> - <source>Close Other Tabs</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui"/> - <source>TabbedBrowser</source> - <translation>タブブラウザ</translation> - </message> - <message> - <location/> - <source>Untitled</source> - <translation>タイトルなし</translation> - </message> - <message> - <location/> - <source>Previous</source> - <translation>前</translation> - </message> - <message> - <location/> - <source>Next</source> - <translation>次</translation> - </message> - <message> - <location/> - <source>Case Sensitive</source> - <translation>大文字と小文字を区別する</translation> - </message> - <message> - <location/> - <source>Whole words</source> - <translation>完全に一致する単語だけを検索する</translation> - </message> - <message> - <location/> - <source><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</source> - <translation><img src=":/trolltech/assistant/images/wrap.png">&nbsp;検索が一通り終わりました</translation> - </message> -</context> -<context> - <name>TopicChooser</name> - <message> - <location filename="../tools/assistant/compat/topicchooser.cpp" line="+56"/> - <source>Choose a topic for <b>%1</b></source> - <translation><b>%1</b> のトピックを選択</translation> - </message> - <message> - <location filename="../tools/assistant/compat/topicchooser.ui"/> - <source>Choose Topic</source> - <translation>トピックを選択</translation> - </message> - <message> - <location/> - <source>Select a topic from the list and click the <b>Display</b>-button to open the online help.</source> - <translation>一覧からトピックを選択し、<b>表示</b>ボタンをクリックしてオンラインヘルプを開いてください。</translation> - </message> - <message> - <location/> - <source>&Topics</source> - <translation>トピック(&T)</translation> - </message> - <message> - <location/> - <source>Displays a list of available help topics for the keyword.</source> - <translation>指定されたキーワードの使用できるヘルプトピックの一覧を表示します。</translation> - </message> - <message> - <location/> - <source>&Display</source> - <translation>表示(&D)</translation> - </message> - <message> - <location/> - <source>Open the topic selected in the list.</source> - <translation>一覧から選択されたトピックを開きます。</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>閉じる(&C)</translation> - </message> - <message> - <location/> - <source>Close the Dialog.</source> - <translation>ダイアログを閉じます。</translation> - </message> -</context> -</TS> diff --git a/translations/assistant_adp_pl.ts b/translations/assistant_adp_pl.ts deleted file mode 100644 index 17c2c5c..0000000 --- a/translations/assistant_adp_pl.ts +++ /dev/null @@ -1,974 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.0" language="pl"> -<context> - <name>AssistantServer</name> - <message> - <location filename="../tools/assistant/compat/main.cpp" line="+225"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="+1"/> - <source>Failed to bind to port %1</source> - <translation>Błąd podłączenia do portu %1</translation> - </message> -</context> -<context> - <name>FontPanel</name> - <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/> - <source>Font</source> - <translation>Czcionka</translation> - </message> - <message> - <location line="+11"/> - <source>&Writing system</source> - <translation>Sys&tem pisania</translation> - </message> - <message> - <location line="+3"/> - <source>&Family</source> - <translation>&Rodzina</translation> - </message> - <message> - <location line="+4"/> - <source>&Style</source> - <translation>&Styl</translation> - </message> - <message> - <location line="+4"/> - <source>&Point size</source> - <translation>&Wielkość punktu</translation> - </message> -</context> -<context> - <name>FontSettingsDialog</name> - <message> - <location filename="../tools/assistant/compat/fontsettingsdialog.cpp" line="+63"/> - <source>Font Settings</source> - <translation>Ustawienia czcionki</translation> - </message> - <message> - <location line="+7"/> - <source>Font settings for:</source> - <translation>Ustawienia czcionki</translation> - </message> - <message> - <location line="+4"/> - <source>Browser</source> - <translation>przeglądarki</translation> - </message> - <message> - <location line="+1"/> - <source>Application</source> - <translation>aplikacji</translation> - </message> - <message> - <location line="+6"/> - <source>Use custom settings</source> - <translation>Użyj własnych ustawień</translation> - </message> -</context> -<context> - <name>HelpDialog</name> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+279"/> - <source>Open Link in Current Tab</source> - <translation>Otwórz odsyłacz w bieżącej karcie</translation> - </message> - <message> - <location line="+3"/> - <source>Open Link in New Window</source> - <translation>Otwórz odsyłacz w nowym oknie</translation> - </message> - <message> - <location line="+3"/> - <source>Open Link in New Tab</source> - <translation>Otwórz odsyłacz w nowej karcie</translation> - </message> - <message> - <location line="+73"/> - <location line="+82"/> - <source>Prepare...</source> - <translation>Przygotuj...</translation> - </message> - <message> - <location line="-64"/> - <location line="+16"/> - <location line="+661"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="-677"/> - <source>Failed to load keyword index file -Assistant will not work!</source> - <translation>Nie można wczytać indeksu słów kluczowych -Assistant nie będzie działał!</translation> - </message> - <message> - <location line="+17"/> - <source>Cannot open the index file %1</source> - <translation>Nie można otworzyć indeksu %1</translation> - </message> - <message> - <location line="+58"/> - <location line="+124"/> - <location line="+8"/> - <source>Warning</source> - <translation>Ostrzeżenie</translation> - </message> - <message> - <location line="-131"/> - <location line="+124"/> - <source>Documentation file %1 does not exist! -Skipping file.</source> - <translation>Plik dokumentacji %1 nie istnieje! -Plik zostaje pominięty.</translation> - </message> - <message> - <location line="-112"/> - <location line="+133"/> - <source>Parse Error</source> - <translation>Błąd parsowania</translation> - </message> - <message> - <location line="-13"/> - <source>Documentation file %1 is not compatible! -Skipping file.</source> - <translation>Plik dokumentacji %1 jest nieodpowiedni! -Plik zostaje pominięty.</translation> - </message> - <message> - <location line="+48"/> - <location line="+469"/> - <source>Done</source> - <translation>Zrobione</translation> - </message> - <message> - <location line="-47"/> - <source>Failed to save fulltext search index -Assistant will not work!</source> - <translation>Nie można zapisać indeksu dla pełnego wyszukiwania -Assistant nie będzie działał!</translation> - </message> - <message> - <location line="+29"/> - <source>Indexing files...</source> - <translation>Indeksowanie plików...</translation> - </message> - <message> - <location line="+15"/> - <source>Reading dictionary...</source> - <translation>Czytanie katalogu...</translation> - </message> - <message> - <location line="+46"/> - <location line="+9"/> - <source>Full Text Search</source> - <translation>Pełne wyszukiwanie</translation> - </message> - <message> - <location line="-8"/> - <source>Using a wildcard within phrases is not allowed.</source> - <translation>Używanie znacznika w wyrażeniu nie jest dozwolone.</translation> - </message> - <message> - <location line="+9"/> - <source>The closing quotation mark is missing.</source> - <translation>Brakuje kończącego znaku cudzysłowu.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui"/> - <source>Help</source> - <translation>Pomoc</translation> - </message> - <message> - <location/> - <source><b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p></source> - <translation><b>Pomoc</b><p>Wybierz temat pomocy z listy dostępnych tematów bądź poszukaj słowa kluczowego w indeksie.</p></translation> - </message> - <message> - <location/> - <source>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</source> - <translation>Pokazuje listę tematów pomocy zorganizowaną w kategorie, indeks lub zakładki. Kolejna karta pozwala na pełne wyszukiwanie.</translation> - </message> - <message> - <location/> - <source>Con&tents</source> - <translation>&Spis treści</translation> - </message> - <message> - <location/> - <source><b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p></source> - <translation><b>Tematy pomocy zorganizowane w kategorie.</b><p>Kliknij dwukrotnie na wybraną kategorię aby otworzyć listę jej tematów. Aby obejrzeć temat dwukrotnie kliknij go.</p></translation> - </message> - <message> - <location/> - <source>column 1</source> - <translation>kolumna 1</translation> - </message> - <message> - <location/> - <source>&Index</source> - <translation>&Indeks</translation> - </message> - <message> - <location/> - <source>&Look For:</source> - <translation>&Szukaj wyrażenia:</translation> - </message> - <message> - <location/> - <source>Enter keyword</source> - <translation>Wprowadź słowo kluczowe</translation> - </message> - <message> - <location/> - <source><b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p></source> - <translation><b>Wprowadź słowo kluczowe.</b><p>Lista wybierze temat który najbardziej odpowiada szukanemu wyrażeniu.</p></translation> - </message> - <message> - <location/> - <source><b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p></source> - <translation><b>Lista dostępnych tematów pomocy</b><p>Kliknij dwukrotnie na wybranym temacie aby otworzyć jego treść. Jeśli temat występuje w kilku kontekstach, dodatkowo należy wybrać kontekst z listy.</p></translation> - </message> - <message> - <location/> - <source>&Bookmarks</source> - <translation>&Zakładki</translation> - </message> - <message> - <location/> - <source>Displays the list of bookmarks.</source> - <translation>Pokazuje listę zakładek.</translation> - </message> - <message> - <location/> - <source>Add new bookmark</source> - <translation>Dodaj nową zakładkę</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>Dodaj bieżącą stronę jako nową zakładkę.</translation> - </message> - <message> - <location/> - <source>&New</source> - <translation>&Nowa</translation> - </message> - <message> - <location/> - <source>Delete bookmark</source> - <translation>Usuń zakładkę</translation> - </message> - <message> - <location/> - <source>Delete the selected bookmark.</source> - <translation>Usuń zaznaczoną zakładkę.</translation> - </message> - <message> - <location/> - <source>&Delete</source> - <translation>&Usuń</translation> - </message> - <message> - <location/> - <source>&Search</source> - <translation>&Szukaj</translation> - </message> - <message> - <location/> - <source>Searching f&or:</source> - <translation>&Szukanie:</translation> - </message> - <message> - <location/> - <source><b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p></source> - <translation><b>Wprowadź wyrażenie(a) do szukania.<b><p>Wprowadź w tym okienku wyrażenia, których szukasz. Wyrażenia mogą zawierać znaczniki (*). Dla wyszukania ciągu wyrażeń umieść całość w cudzysłowie.</p></translation> - </message> - <message> - <location/> - <source><b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p></source> - <translation><b>Znalezione dokumenty</b><p>Lista zawiera wszystkie znalezione dokumenty związane z ostatnim wyszukiwaniem. Dokumenty są poukładane w kolejności pod względem ilości trafień szukanego wyrażenia.</p></translation> - </message> - <message> - <location/> - <source>Found &Documents:</source> - <translation>Znalezione &dokumenty:</translation> - </message> - <message> - <location/> - <source>Display the help page for the full text search.</source> - <translation>Pokaż stronę pomocy dla pełnego wyszukiwania.</translation> - </message> - <message> - <location/> - <source>He&lp</source> - <translation>&Pomoc</translation> - </message> - <message> - <location/> - <source>Pressing this button starts the search.</source> - <translation>Naciśnięcie tego przycisku powoduje rozpoczęcie wyszukiwania.</translation> - </message> - <message> - <location/> - <source>Preparing...</source> - <translation>Przygotowywanie...</translation> - </message> - <message numerus="yes"> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+7"/> - <source>%n document(s) found.</source> - <translation> - <numerusform>Znaleziono %n dokument.</numerusform> - <numerusform>Znaleziono %n dokumenty.</numerusform> - <numerusform>Znaleziono %n dokumentów.</numerusform> - </translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui"/> - <source>Enter searchword(s)</source> - <translation>Wprowadź wyrażenie(a) do szukania</translation> - </message> - <message> - <location/> - <source>Display the help page</source> - <translation>Pokaż stronę pomocy</translation> - </message> - <message> - <location/> - <source>Start searching</source> - <translation>Rozpocznij wyszukiwanie</translation> - </message> -</context> -<context> - <name>HelpWindow</name> - <message> - <location filename="../tools/assistant/compat/helpwindow.cpp" line="+97"/> - <source>Help</source> - <translation>Pomoc</translation> - </message> - <message> - <location line="+1"/> - <source>Unable to launch web browser. -</source> - <translation>Nie można uruchomić przeglądarki internetowej. -</translation> - </message> - <message> - <location line="+28"/> - <source>Failed to open link: '%1'</source> - <translation>Nie można otworzyć odsyłacza: '%1'</translation> - </message> - <message> - <location line="+1"/> - <source><div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div></source> - <translation><div align="center"><h1>Strona nie została znaleziona</h1><br><h3>'%1'</h3></div></translation> - </message> - <message> - <location line="+2"/> - <source>Error...</source> - <translation>Błąd...</translation> - </message> - <message> - <location line="+61"/> - <source>Open Link in New Window Shift+LMB</source> - <translation>Otwórz odsyłacz w nowym oknie Shift+LMB</translation> - </message> - <message> - <location line="-2"/> - <source>Open Link in New Tab</source> - <translation>Otwórz odsyłacz w nowej karcie</translation> - </message> - <message> - <location line="-89"/> - <source>OK</source> - <translation>OK</translation> - </message> - <message> - <location line="+86"/> - <source>Copy &Link Location</source> - <translation>Skopiuj &odsyłacz</translation> - </message> -</context> -<context> - <name>Index</name> - <message> - <location filename="../tools/assistant/compat/index.cpp" line="+385"/> - <source>Untitled</source> - <translation>Nienazwany</translation> - </message> -</context> -<context> - <name>MainWindow</name> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+103"/> - <source>Sidebar</source> - <translation>Panel</translation> - </message> - <message> - <location line="+18"/> - <source>&Window</source> - <translation>&Okno</translation> - </message> - <message> - <location line="+2"/> - <source>Minimize</source> - <translation>Minimalizuj</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+M</source> - <translation>Ctrl+M</translation> - </message> - <message> - <location line="+44"/> - <source>Initializing Qt Assistant...</source> - <translation>Inicjalizowanie Qt Assistant...</translation> - </message> - <message> - <location line="+26"/> - <source>SHIFT+CTRL+=</source> - <translation>SHIFT+CTRL+=</translation> - </message> - <message> - <location line="+4"/> - <source>Ctrl+T</source> - <translation>Ctrl+T</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+I</source> - <translation>Ctrl+I</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+B</source> - <translation>Ctrl+B</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+S</source> - <translation>Ctrl+S</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Ctrl+W</source> - <translation>Ctrl+W</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+1"/> - <source>Ctrl+]</source> - <translation>Ctrl+]</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+[</source> - <translation>Ctrl+[</translation> - </message> - <message> - <location line="+7"/> - <source>Views</source> - <translation>Widoki</translation> - </message> - <message> - <location line="+80"/> - <source>Displays the main page of a specific documentation set.</source> - <translation>Pokazuje główną stronę wybranego zestawu dokumentacji.</translation> - </message> - <message> - <location line="+39"/> - <location line="+1"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="+19"/> - <source>Failed to open about application contents in file: '%1'</source> - <translation>Nie można otworzyć pliku: '%1' z informacjami o aplikacji</translation> - </message> - <message> - <location line="+203"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+238"/> - <location line="+6"/> - <source>Save Page</source> - <translation>Zapisz stronę</translation> - </message> - <message> - <location line="+0"/> - <source>Cannot open file for writing!</source> - <translation>Nie można otworzyć pliku do zapisu!</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Qt Assistant by Nokia</source> - <translation>Qt Assistant Nokii</translation> - </message> - <message> - <location/> - <source>Toolbar</source> - <translation>Pasek główny</translation> - </message> - <message> - <location/> - <source>Go</source> - <translation>Pasek z odsyłaczami</translation> - </message> - <message> - <location/> - <source>&Help</source> - <translation>&Pomoc</translation> - </message> - <message> - <location/> - <source>&File</source> - <translation>&Plik</translation> - </message> - <message> - <location/> - <source>Boo&kmarks</source> - <translation>&Zakładki</translation> - </message> - <message> - <location/> - <source>&Go</source> - <translation>&Nawigacja</translation> - </message> - <message> - <location/> - <source>&View</source> - <translation>&Widok</translation> - </message> - <message> - <location/> - <source>&Edit</source> - <translation>&Edycja</translation> - </message> - <message> - <location/> - <source>&Print...</source> - <translation>Wy&drukuj...</translation> - </message> - <message> - <location/> - <source>Print the currently displayed page.</source> - <translation>Wydrukuj bieżącą stronę.</translation> - </message> - <message> - <location/> - <source>Ctrl+P</source> - <translation>Ctrl+P</translation> - </message> - <message> - <location/> - <source>E&xit</source> - <translation>&Zakończ</translation> - </message> - <message> - <location/> - <source>Quit Qt Assistant.</source> - <translation>Zakończ Qt Assistant.</translation> - </message> - <message> - <location/> - <source>Ctrl+Q</source> - <translation>Ctrl+Q</translation> - </message> - <message> - <location/> - <source>&Copy</source> - <translation>S&kopiuj</translation> - </message> - <message> - <location/> - <source>Copy the selected text to the clipboard.</source> - <translation>Skopiuj wybrany tekst do schowka.</translation> - </message> - <message> - <location/> - <source>Ctrl+C</source> - <translation>Ctrl+C</translation> - </message> - <message> - <location/> - <source>&Find in Text...</source> - <translation>&Znajdź w tekście...</translation> - </message> - <message> - <location/> - <source>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</source> - <translation>Otwórz okno szukania. Qt Assistant będzie przeszukiwał bieżącą stronę dla podanego tekstu.</translation> - </message> - <message> - <location/> - <source>Ctrl+F</source> - <translation>Ctrl+F</translation> - </message> - <message> - <location/> - <source>Find &Next</source> - <translation>Znajdź &następne</translation> - </message> - <message> - <location/> - <source>F3</source> - <translation>F3</translation> - </message> - <message> - <location/> - <source>Find &Previous</source> - <translation>Znajdź &poprzednie</translation> - </message> - <message> - <location/> - <source>Shift+F3</source> - <translation>Shift+F3</translation> - </message> - <message> - <location/> - <source>&Home</source> - <translation>Strona &startowa</translation> - </message> - <message> - <location/> - <source>Go to the home page. Qt Assistant's home page is the Qt Reference Documentation.</source> - <translation>Przejdź do strony startowej. Strona startowa Qt Assistant jest główną stroną dokumentacji Qt.</translation> - </message> - <message> - <location/> - <source>Ctrl+Home</source> - <translation>Ctrl+Home</translation> - </message> - <message> - <location/> - <source>&Previous</source> - <translation>&Poprzednia strona</translation> - </message> - <message> - <location/> - <source>Go to the previous page.</source> - <translation>Przejdź do poprzedniej strony.</translation> - </message> - <message> - <location/> - <source>Alt+Left</source> - <translation>Alt+Left</translation> - </message> - <message> - <location/> - <source>&Next</source> - <translation>&Następna strona</translation> - </message> - <message> - <location/> - <source>Go to the next page.</source> - <translation>Przejdź do następnej strony.</translation> - </message> - <message> - <location/> - <source>Alt+Right</source> - <translation>Alt+Right</translation> - </message> - <message> - <location/> - <source>About Qt Assistant</source> - <translation>Informacje o Qt Assistant</translation> - </message> - <message> - <location/> - <source>Display further information about Qt Assistant.</source> - <translation>Pokaż dalsze informacje o Qt Assistant.</translation> - </message> - <message> - <location/> - <source>About Qt</source> - <translation>Informacje o Qt</translation> - </message> - <message> - <location/> - <source>Zoom &in</source> - <translation>Po&większ</translation> - </message> - <message> - <location/> - <source>Zoom in on the document, i.e. increase the font size.</source> - <translation>Powiększ rozmiar czcionek w dokumencie.</translation> - </message> - <message> - <location/> - <source>Ctrl++</source> - <translation>Ctrl++</translation> - </message> - <message> - <location/> - <source>Zoom &out</source> - <translation>Po&mniejsz</translation> - </message> - <message> - <location/> - <source>Zoom out on the document, i.e. decrease the font size.</source> - <translation>Pomniejsz rozmiar czcionek w dokumencie.</translation> - </message> - <message> - <location/> - <source>Ctrl+-</source> - <translation>Ctrl+-</translation> - </message> - <message> - <location/> - <source>New Window</source> - <translation>Nowe okno</translation> - </message> - <message> - <location/> - <source>Open a new window.</source> - <translation>Otwórz nowe okno.</translation> - </message> - <message> - <location/> - <source>Ctrl+N</source> - <translation>Ctrl+N</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>Za&mknij</translation> - </message> - <message> - <location/> - <source>Close the current window.</source> - <translation>Zamknij bieżące okno.</translation> - </message> - <message> - <location/> - <source>&Add Bookmark</source> - <translation>&Dodaj zakładkę</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>Dodaj bieżącą stronę jako nową zakładkę.</translation> - </message> - <message> - <location/> - <source>What's This?</source> - <translation>Co to jest?</translation> - </message> - <message> - <location/> - <source>"What's This?" context sensitive help.</source> - <translation>"Co to jest?" jest pomocą kontekstową.</translation> - </message> - <message> - <location/> - <source>Shift+F1</source> - <translation>Shift+F1</translation> - </message> - <message> - <location/> - <source>Add Tab</source> - <translation>Dodaj kartę</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+N</source> - <translation>Ctrl+Alt+N</translation> - </message> - <message> - <location/> - <source>Next Tab</source> - <translation>Następna karta</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Right</source> - <translation>Ctrl+Alt+Right</translation> - </message> - <message> - <location/> - <source>Previous Tab</source> - <translation>Poprzednia karta</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Left</source> - <translation>Ctrl+Alt+Left</translation> - </message> - <message> - <location/> - <source>Close Tab</source> - <translation>Zamknij kartę</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Q</source> - <translation>Ctrl+Alt+Q</translation> - </message> - <message> - <location/> - <source>Qt Assistant Manual</source> - <translation>Podręcznik Qt Assistant</translation> - </message> - <message> - <location/> - <source>F1</source> - <translation>F1</translation> - </message> - <message> - <location/> - <source>Save Page As...</source> - <translation>Zapisz stronę jako...</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+S</source> - <translation>Ctrl+Alt+S</translation> - </message> - <message> - <location/> - <source>Sync with Table of Contents</source> - <translation>Znajdź bieżącą stronę w spisie treści</translation> - </message> - <message> - <location/> - <source>Select the page in contents tab.</source> - <translation>Wybierz stronę w karcie ze spisem treści.</translation> - </message> - <message> - <location/> - <source>Font Settings...</source> - <translation>Ustawienia czcionki...</translation> - </message> -</context> -<context> - <name>QObject</name> - <message> - <location filename="../tools/assistant/compat/config.cpp" line="+350"/> - <source>Qt Assistant by Nokia</source> - <translation>Qt Assistant Nokii</translation> - </message> -</context> -<context> - <name>TabbedBrowser</name> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+149"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+86"/> - <source>Add page</source> - <translation>Dodaj kartę</translation> - </message> - <message> - <location line="+9"/> - <source>Close page</source> - <translation>Zamknij kartę</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui"/> - <source>TabbedBrowser</source> - <translation>Przeglądarka z kartami</translation> - </message> - <message> - <location/> - <source>Untitled</source> - <translation>Nienazwany</translation> - </message> - <message> - <location/> - <source>Previous</source> - <translation>Poprzedni</translation> - </message> - <message> - <location/> - <source>Next</source> - <translation>Następny</translation> - </message> - <message> - <location/> - <source>Case Sensitive</source> - <translation>Uwzględniaj wielkość liter</translation> - </message> - <message> - <location/> - <source>Whole words</source> - <translation>Wszystkie wyrazy</translation> - </message> - <message> - <location/> - <source><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</source> - <translation><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Szukanie od początku</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+243"/> - <source>New Tab</source> - <translation>Nowa karta</translation> - </message> - <message> - <location line="+1"/> - <source>Close Tab</source> - <translation>Zamknij kartę</translation> - </message> - <message> - <location line="+1"/> - <source>Close Other Tabs</source> - <translation>Zamknij pozostałe karty</translation> - </message> -</context> -<context> - <name>TopicChooser</name> - <message> - <location filename="../tools/assistant/compat/topicchooser.cpp" line="+56"/> - <source>Choose a topic for <b>%1</b></source> - <translation>Wybierz temat dla <b>%1</b></translation> - </message> - <message> - <location filename="../tools/assistant/compat/topicchooser.ui"/> - <source>Choose Topic</source> - <translation>Wybierz temat</translation> - </message> - <message> - <location/> - <source>Select a topic from the list and click the <b>Display</b>-button to open the online help.</source> - <translation>Wybierz temat z listy i kliknij przycisk <b>Pokaż</b> aby otworzyć pomoc (online).</translation> - </message> - <message> - <location/> - <source>&Topics</source> - <translation>&Tematy</translation> - </message> - <message> - <location/> - <source>Displays a list of available help topics for the keyword.</source> - <translation>Pokazuje listę dostępnych tematów pomocy dla szukanego wyrażenia.</translation> - </message> - <message> - <location/> - <source>&Display</source> - <translation>Pok&aż</translation> - </message> - <message> - <location/> - <source>Open the topic selected in the list.</source> - <translation>Otwórz wybrany na liście temat.</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>Za&mknij</translation> - </message> - <message> - <location/> - <source>Close the Dialog.</source> - <translation>Zamknij okno.</translation> - </message> -</context> -</TS> diff --git a/translations/assistant_adp_ru.ts b/translations/assistant_adp_ru.ts deleted file mode 100644 index db0c9df..0000000 --- a/translations/assistant_adp_ru.ts +++ /dev/null @@ -1,977 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.0" language="ru"> -<context> - <name>AssistantServer</name> - <message> - <location filename="../tools/assistant/compat/main.cpp" line="+226"/> - <source>Failed to bind to port %1</source> - <translation>Не удалось открыть порт %1</translation> - </message> - <message> - <location line="-1"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> -</context> -<context> - <name>FontPanel</name> - <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+77"/> - <source>&Family</source> - <translation>&Шрифт</translation> - </message> - <message> - <location line="+4"/> - <source>&Style</source> - <translation>&Начертание</translation> - </message> - <message> - <location line="-18"/> - <source>Font</source> - <translation>Шрифт</translation> - </message> - <message> - <location line="+11"/> - <source>&Writing system</source> - <translation>Система &письма</translation> - </message> - <message> - <location line="+11"/> - <source>&Point size</source> - <translation>&Размер</translation> - </message> -</context> -<context> - <name>FontSettingsDialog</name> - <message> - <location filename="../tools/assistant/compat/fontsettingsdialog.cpp" line="+75"/> - <source>Application</source> - <translation>Приложение</translation> - </message> - <message> - <location line="-1"/> - <source>Browser</source> - <translation>Обозреватель</translation> - </message> - <message> - <location line="-4"/> - <source>Font settings for:</source> - <translation>Настройки шрифта для:</translation> - </message> - <message> - <location line="+11"/> - <source>Use custom settings</source> - <translation>Использование индивидуальных настроек</translation> - </message> - <message> - <location line="-18"/> - <source>Font Settings</source> - <translation>Настройки шрифта</translation> - </message> -</context> -<context> - <name>HelpDialog</name> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="+108"/> - <source>&Index</source> - <translation>&Указатель</translation> - </message> - <message> - <location line="+12"/> - <source>&Look For:</source> - <translation>&Искать:</translation> - </message> - <message> - <location line="+91"/> - <source>&New</source> - <translation>&Новая</translation> - </message> - <message> - <location line="+23"/> - <location line="+111"/> - <source>&Search</source> - <translation>&Поиск</translation> - </message> - <message> - <location line="-212"/> - <source><b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p></source> - <translation type="unfinished"><b>Указание ключевого слова.</b><p>Список заполняется элементами, лучше соответствующими указанному ключевому слову.</p></translation> - </message> - <message> - <location line="+142"/> - <source><b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p></source> - <translation type="unfinished"><b>Указание слов для поиска.</b><p>Введите одно или несколько слов, по которым требуется осуществить поиск. Слова могут содержкать символы-заменители (*). Если требуется найти сочетание слов, заключите искомую фразу в кавычки.</p></translation> - </message> - <message> - <location line="+10"/> - <source><b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p></source> - <translation type="unfinished"><b>Найденные документы</b><p>В данном списке представлены все найденные при последнем поиске документы. Документы упорядочены по релевантности, т.е. чем выше в списке, тем чаще в нём встречаются искомые слова.</p></translation> - </message> - <message> - <location line="-196"/> - <source><b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p></source> - <translation type="unfinished"><b>Разделы справки, распределённые по категориям.</b><p>Дважды щёлкните по одному из пунктов для отображения разделов в данной категории. Для открытия раздела дважды щёлкните по нему.</p></translation> - </message> - <message> - <location line="-31"/> - <source><b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p></source> - <translation type="unfinished"><b>Справка</b><p>Выберите раздел справки из оглавления или воспользуйтесь поиском по предметному указателю.</p></translation> - </message> - <message> - <location line="+85"/> - <source><b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p></source> - <translation type="unfinished"><b>Список доступных разделов справки.</b><p>Дважды щёлкните по одному из пунктов для открытия страницы справки. Если найдено более одной страницы, выберите желаемую.</p></translation> - </message> - <message> - <location line="+62"/> - <source>Add new bookmark</source> - <translation>Добавить закладку</translation> - </message> - <message> - <location line="+3"/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>Добавить отображаемую страницу в закладки.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+393"/> - <source>Cannot open the index file %1</source> - <translation>Не удаётся открыть файл индекса %1</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="-134"/> - <source>Con&tents</source> - <translation>&Оглавление</translation> - </message> - <message> - <location line="+144"/> - <source>Delete bookmark</source> - <translation>Удалить закладку</translation> - </message> - <message> - <location line="+3"/> - <source>Delete the selected bookmark.</source> - <translation>Удалить выбранную закладку.</translation> - </message> - <message> - <location line="+51"/> - <source>Enter searchword(s)</source> - <translation>Введите одно или несколько слов для поиска</translation> - </message> - <message> - <location line="+38"/> - <source>Display the help page</source> - <translation>Показать страницу справки</translation> - </message> - <message> - <location line="+3"/> - <source>Display the help page for the full text search.</source> - <translation>Показать справку по полнотекстовому поиску.</translation> - </message> - <message> - <location line="+26"/> - <source>Start searching</source> - <translation>Начать поиск</translation> - </message> - <message> - <location line="-269"/> - <source>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</source> - <translation>Отображает список разделов, распредёленных по категориям, указатель или закладки. Последняя вкладка содержит панель полнотекстового поиска.</translation> - </message> - <message> - <location line="+96"/> - <source>Displays the list of bookmarks.</source> - <translation>Отображает список закладок.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+59"/> - <location line="+124"/> - <source>Documentation file %1 does not exist! -Skipping file.</source> - <translation>Файл документации %1 не существует! -Пропущен.</translation> - </message> - <message> - <location line="+8"/> - <source>Documentation file %1 is not compatible! -Skipping file.</source> - <translation>Несовместимый файл документации %1! -Пропущен.</translation> - </message> - <message> - <location line="+48"/> - <location line="+469"/> - <source>Done</source> - <translation>Готово</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="-36"/> - <source>Enter keyword</source> - <translation>Введите ключевое слово</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="-725"/> - <source>Failed to load keyword index file -Assistant will not work!</source> - <translation>Не удалось загрузить файл индекса ключевых слов -Qt Assistant не будет работать!</translation> - </message> - <message> - <location line="+678"/> - <source>Failed to save fulltext search index -Assistant will not work!</source> - <translation>Не удалось сохранить индекс полнотекстового поиска -Qt Assistant не будет работать!</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="+162"/> - <source>Found &Documents:</source> - <translation>Найденные &документы:</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+90"/> - <location line="+9"/> - <source>Full Text Search</source> - <translation>Полнотекстовый поиск</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="+24"/> - <source>He&lp</source> - <translation>&Справка</translation> - </message> - <message> - <location line="-261"/> - <source>Help</source> - <translation>Справка</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="-70"/> - <source>Indexing files...</source> - <translation>Индексирование файлов...</translation> - </message> - <message> - <location line="-798"/> - <source>Open Link in New Tab</source> - <translation>Открыть ссылку в новой вкладке</translation> - </message> - <message> - <location line="-3"/> - <source>Open Link in New Window</source> - <translation>Открыть ссылку в новом окне</translation> - </message> - <message> - <location line="+182"/> - <location line="+133"/> - <source>Parse Error</source> - <translation>Ошибка обработки</translation> - </message> - <message> - <location line="-239"/> - <location line="+82"/> - <source>Prepare...</source> - <translation>Подготовка...</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="+321"/> - <source>Preparing...</source> - <translation>Подготовка...</translation> - </message> - <message> - <location line="-34"/> - <source>Pressing this button starts the search.</source> - <translation>Нажатие на эту кнопку запустит процесс поиска.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="-64"/> - <location line="+16"/> - <location line="+661"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location line="+45"/> - <source>Reading dictionary...</source> - <translation>Чтение каталога...</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="-80"/> - <source>Searching f&or:</source> - <translation>&Искать:</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+56"/> - <source>The closing quotation mark is missing.</source> - <translation>Пропущена закрывающая кавычка.</translation> - </message> - <message> - <location line="-9"/> - <source>Using a wildcard within phrases is not allowed.</source> - <translation>Использование символов-заменителей внутри фраз недопустимо.</translation> - </message> - <message> - <location line="-694"/> - <location line="+124"/> - <location line="+8"/> - <source>Warning</source> - <translation>Предупреждение</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="-163"/> - <location line="+74"/> - <source>column 1</source> - <translation>столбец 1</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="-304"/> - <source>Open Link in Current Tab</source> - <translation>Открыть ссылку в текущей вкладке</translation> - </message> - <message numerus="yes"> - <location line="+882"/> - <source>%n document(s) found.</source> - <translation> - <numerusform>Найден %n документ.</numerusform> - <numerusform>Найдено %n документа.</numerusform> - <numerusform>Найдено %n документов.</numerusform> - </translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui" line="-22"/> - <source>&Bookmarks</source> - <translation>&Закладки</translation> - </message> - <message> - <location line="+73"/> - <source>&Delete</source> - <translation>&Удалить</translation> - </message> -</context> -<context> - <name>HelpWindow</name> - <message> - <location filename="../tools/assistant/compat/helpwindow.cpp" line="+127"/> - <source><div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div></source> - <translation><div align="center"><h1>Страница не найдена</h1><br><h3>'%1'</h3></div></translation> - </message> - <message> - <location line="+58"/> - <source>Copy &Link Location</source> - <translation>Копировать &адрес ссылки</translation> - </message> - <message> - <location line="-56"/> - <source>Error...</source> - <translation>Ошибка...</translation> - </message> - <message> - <location line="-3"/> - <source>Failed to open link: '%1'</source> - <translation>Не удалось открыть ссылку: '%1'</translation> - </message> - <message> - <location line="-29"/> - <source>Help</source> - <translation>Справка</translation> - </message> - <message> - <location line="+2"/> - <source>OK</source> - <translation>Закрыть</translation> - </message> - <message> - <location line="+89"/> - <source>Open Link in New Tab</source> - <translation>Открыть ссылку в новой вкладке</translation> - </message> - <message> - <location line="+2"/> - <source>Open Link in New Window Shift+LMB</source> - <translation>Открыть ссылку в новом окне Shift+LMB</translation> - </message> - <message> - <location line="-92"/> - <source>Unable to launch web browser. -</source> - <translation>Невозможно запустить вэб-браузер. -</translation> - </message> -</context> -<context> - <name>Index</name> - <message> - <location filename="../tools/assistant/compat/index.cpp" line="+385"/> - <source>Untitled</source> - <translation>Неозаглавлено</translation> - </message> -</context> -<context> - <name>MainWindow</name> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="+373"/> - <location line="+3"/> - <source>"What's This?" context sensitive help.</source> - <translation>Контекстная справка "Что это?".</translation> - </message> - <message> - <location line="-17"/> - <source>&Add Bookmark</source> - <translation>&Добавить закладку</translation> - </message> - <message> - <location line="-11"/> - <source>&Close</source> - <translation>&Закрыть</translation> - </message> - <message> - <location line="-141"/> - <source>&Copy</source> - <translation>&Копировать</translation> - </message> - <message> - <location line="-49"/> - <source>&Edit</source> - <translation>&Правка</translation> - </message> - <message> - <location line="-39"/> - <source>&File</source> - <translation>&Файл</translation> - </message> - <message> - <location line="+102"/> - <source>&Find in Text...</source> - <translation>П&оиск по тексту...</translation> - </message> - <message> - <location line="-82"/> - <source>&Go</source> - <translation>&Перейти</translation> - </message> - <message> - <location line="-31"/> - <source>&Help</source> - <translation>&Справка</translation> - </message> - <message> - <location line="+143"/> - <source>&Home</source> - <translation>&Домой</translation> - </message> - <message> - <location line="+28"/> - <source>&Next</source> - <translation>Сл&едующий</translation> - </message> - <message> - <location line="-14"/> - <source>&Previous</source> - <translation>&Предыдущий</translation> - </message> - <message> - <location line="-86"/> - <source>&Print...</source> - <translation>&Печать...</translation> - </message> - <message> - <location line="-28"/> - <source>&View</source> - <translation>&Вид</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+121"/> - <source>&Window</source> - <translation>&Окно</translation> - </message> - <message> - <location line="+431"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="+150"/> - <source>About Qt</source> - <translation>О Qt</translation> - </message> - <message> - <location line="-11"/> - <source>About Qt Assistant</source> - <translation>О Qt Assistant</translation> - </message> - <message> - <location line="+94"/> - <source>Add Tab</source> - <translation>Добавить вкладку</translation> - </message> - <message> - <location line="-22"/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>Добавить отображаемую страницу в закладки.</translation> - </message> - <message> - <location line="-228"/> - <source>Boo&kmarks</source> - <translation>&Закладки</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+244"/> - <source>Cannot open file for writing!</source> - <translation>Не удалось открыть файл для записи!</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="+274"/> - <source>Close Tab</source> - <translation>Закрыть вкладку</translation> - </message> - <message> - <location line="-57"/> - <source>Close the current window.</source> - <translation>Закрыть текущее окно.</translation> - </message> - <message> - <location line="-58"/> - <source>Display further information about Qt Assistant.</source> - <translation>Показать дополнительную информацию о Qt Assistant.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="-506"/> - <source>Displays the main page of a specific documentation set.</source> - <translation>Открывает стартовую страницу выбранного набора документации.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="-103"/> - <source>E&xit</source> - <translation>В&ыход</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+59"/> - <source>Failed to open about application contents in file: '%1'</source> - <translation>Не удалось получить информацию о приложении из файла: '%1'</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="+42"/> - <source>Find &Next</source> - <translation>Найти &следующее</translation> - </message> - <message> - <location line="+8"/> - <source>Find &Previous</source> - <translation>Найти &предыдущее</translation> - </message> - <message> - <location line="+206"/> - <source>Font Settings...</source> - <translation>Настройки шрифта...</translation> - </message> - <message> - <location line="-361"/> - <source>Go</source> - <translation>Перейти</translation> - </message> - <message> - <location line="+169"/> - <source>Go to the home page. Qt Assistant's home page is the Qt Reference Documentation.</source> - <translation>Перейти на домашнюю страницу. Домашная страница Qt Assistant - Справочная документация по Qt.</translation> - </message> - <message> - <location line="+28"/> - <source>Go to the next page.</source> - <translation>Переход на следующую страницу.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="-181"/> - <source>Initializing Qt Assistant...</source> - <translation>Инициализация Qt Assistant...</translation> - </message> - <message> - <location line="-45"/> - <source>Minimize</source> - <translation>Свернуть</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="+55"/> - <source>New Window</source> - <translation>Новое окно</translation> - </message> - <message> - <location line="+55"/> - <source>Next Tab</source> - <translation>Следующая вкладка</translation> - </message> - <message> - <location line="-52"/> - <source>Open a new window.</source> - <translation>Открыть новое окно.</translation> - </message> - <message> - <location line="-116"/> - <source>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</source> - <translation>Открыть окно поиска. Qt Assistant произведёт поиск введённого текста на отображаемой странице.</translation> - </message> - <message> - <location line="+176"/> - <source>Previous Tab</source> - <translation>Предыдущая вкладка</translation> - </message> - <message> - <location line="-218"/> - <source>Print the currently displayed page.</source> - <translation>Печатать отображаемую страницу.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+206"/> - <location line="+1"/> - <source>Qt Assistant</source> - <translation>Qt Assistant</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="+237"/> - <source>Qt Assistant Manual</source> - <translation>Руководство по Qt Assistant</translation> - </message> - <message> - <location line="-366"/> - <source>Qt Assistant by Nokia</source> - <translation>Qt Assistant от Nokia</translation> - </message> - <message> - <location line="+140"/> - <source>Quit Qt Assistant.</source> - <translation>Выйти из Qt Assistant.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+460"/> - <location line="+6"/> - <source>Save Page</source> - <translation>Сохранить страницу</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="+234"/> - <source>Save Page As...</source> - <translation>Сохранить страницу как...</translation> - </message> - <message> - <location line="+14"/> - <source>Select the page in contents tab.</source> - <translation>Выбрать страницу во вкладке оглавления.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="-693"/> - <source>Sidebar</source> - <translation>Боковая панель</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="-3"/> - <source>Sync with Table of Contents</source> - <translation>Синхронизировать с оглавлением</translation> - </message> - <message> - <location line="-380"/> - <source>Toolbar</source> - <translation>Панель инструментов</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+107"/> - <source>Views</source> - <translation>Виды</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="+312"/> - <source>What's This?</source> - <translation>Что это?</translation> - </message> - <message> - <location line="-58"/> - <source>Zoom &in</source> - <translation>У&величить</translation> - </message> - <message> - <location line="+14"/> - <source>Zoom &out</source> - <translation>У&меньшить</translation> - </message> - <message> - <location line="-11"/> - <source>Zoom in on the document, i.e. increase the font size.</source> - <translation>Увеличить размер шрифта.</translation> - </message> - <message> - <location line="+14"/> - <source>Zoom out on the document, i.e. decrease the font size.</source> - <translation>Уменьшить размер шрифта.</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="-86"/> - <source>Ctrl+M</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+70"/> - <source>SHIFT+CTRL+=</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+4"/> - <source>Ctrl+T</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+I</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+B</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+S</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+]</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+[</source> - <translation type="unfinished"></translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui" line="-144"/> - <source>Ctrl+P</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> - <source>Ctrl+Q</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> - <source>Copy the selected text to the clipboard.</source> - <translation>Скопировать выделенный текст в буфер обмена.</translation> - </message> - <message> - <location line="+3"/> - <source>Ctrl+C</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> - <source>Ctrl+F</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> - <source>F3</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> - <source>Shift+F3</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> - <source>Ctrl+Home</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> - <source>Go to the previous page.</source> - <translation>Переход на предыдущую страницу.</translation> - </message> - <message> - <location line="+3"/> - <source>Alt+Left</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> - <source>Alt+Right</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+33"/> - <source>Ctrl++</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+14"/> - <source>Ctrl+-</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> - <source>Ctrl+N</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> - <source>Ctrl+W</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+25"/> - <source>Shift+F1</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> - <source>Ctrl+Alt+N</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> - <source>Ctrl+Alt+Right</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> - <source>Ctrl+Alt+Left</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> - <source>Ctrl+Alt+Q</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+11"/> - <source>F1</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+8"/> - <source>Ctrl+Alt+S</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>QObject</name> - <message> - <location filename="../tools/assistant/compat/config.cpp" line="+350"/> - <source>Qt Assistant by Nokia</source> - <translation>Qt Assistant от Nokia</translation> - </message> -</context> -<context> - <name>TabbedBrowser</name> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+149"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui" line="+197"/> - <source><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</source> - <translation><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Поиск с начала</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+86"/> - <source>Add page</source> - <translation>Добавить вкладку</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui" line="-26"/> - <source>Case Sensitive</source> - <translation>Учитывать регистр</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+254"/> - <source>Close Other Tabs</source> - <translation>Закрыть остальные вкладки</translation> - </message> - <message> - <location line="-1"/> - <source>Close Tab</source> - <translation>Закрыть вкладку</translation> - </message> - <message> - <location line="-244"/> - <source>Close page</source> - <translation>Закрыть вкладку</translation> - </message> - <message> - <location line="+243"/> - <source>New Tab</source> - <translation>Новая вкладка</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui" line="-19"/> - <source>Next</source> - <translation>Следующее</translation> - </message> - <message> - <location line="-22"/> - <source>Previous</source> - <translation>Предыдущее</translation> - </message> - <message> - <location line="-62"/> - <source>Untitled</source> - <translation>Безымянный</translation> - </message> - <message> - <location line="+110"/> - <source>Whole words</source> - <translation>Слова целиком</translation> - </message> - <message> - <location line="-123"/> - <source>TabbedBrowser</source> - <translation type="unfinished"></translation> - </message> -</context> -<context> - <name>TopicChooser</name> - <message> - <location filename="../tools/assistant/compat/topicchooser.ui" line="+149"/> - <source>&Close</source> - <translation>&Закрыть</translation> - </message> - <message> - <location line="-16"/> - <source>&Display</source> - <translation>&Показать</translation> - </message> - <message> - <location line="-53"/> - <source>&Topics</source> - <translation>&Разделы</translation> - </message> - <message> - <location line="-27"/> - <source>Choose Topic</source> - <translation>Выбор раздела</translation> - </message> - <message> - <location filename="../tools/assistant/compat/topicchooser.cpp" line="+56"/> - <source>Choose a topic for <b>%1</b></source> - <translation>Выберите раздел для <b>%1</b></translation> - </message> - <message> - <location filename="../tools/assistant/compat/topicchooser.ui" line="+93"/> - <source>Close the Dialog.</source> - <translation>Закрыть диалог.</translation> - </message> - <message> - <location line="-56"/> - <source>Displays a list of available help topics for the keyword.</source> - <translation>Показывает список доступных разделов справки, найденных по ключевому слову.</translation> - </message> - <message> - <location line="+40"/> - <source>Open the topic selected in the list.</source> - <translation>Открыть выбранный раздел.</translation> - </message> - <message> - <location line="-74"/> - <source>Select a topic from the list and click the <b>Display</b>-button to open the online help.</source> - <translation>Выберите раздел из списка и нажмите на кнопку <b>Показать</b> для открытия онлайн справки.</translation> - </message> -</context> -</TS> diff --git a/translations/assistant_adp_zh_CN.ts b/translations/assistant_adp_zh_CN.ts deleted file mode 100644 index 2d8d85c9..0000000 --- a/translations/assistant_adp_zh_CN.ts +++ /dev/null @@ -1,999 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.0" language="zh_CN"> -<context> - <name>AssistantServer</name> - <message> - <location filename="../tools/assistant/compat/main.cpp" line="+225"/> - <source>Qt Assistant</source> - <translation>Qt 助手</translation> - </message> - <message> - <location line="+1"/> - <source>Failed to bind to port %1</source> - <translation>绑定到端口%1失败</translation> - </message> -</context> -<context> - <name>FontPanel</name> - <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/> - <source>Font</source> - <translation>字体</translation> - </message> - <message> - <location line="+11"/> - <source>&Writing system</source> - <translation>书写系统(&W)</translation> - </message> - <message> - <location line="+3"/> - <source>&Family</source> - <translation>字体族(&F)</translation> - </message> - <message> - <location line="+4"/> - <source>&Style</source> - <translation>风格(&S)</translation> - </message> - <message> - <location line="+4"/> - <source>&Point size</source> - <translation>点大小(&P)</translation> - </message> -</context> -<context> - <name>FontSettingsDialog</name> - <message> - <location filename="../tools/assistant/compat/fontsettingsdialog.cpp" line="+63"/> - <source>Font Settings</source> - <translation>字体设置</translation> - </message> - <message> - <location line="+7"/> - <source>Font settings for:</source> - <translation>字体设置用于:</translation> - </message> - <message> - <location line="+4"/> - <source>Browser</source> - <translation>浏览器</translation> - </message> - <message> - <location line="+1"/> - <source>Application</source> - <translation>应用程序</translation> - </message> - <message> - <location line="+6"/> - <source>Use custom settings</source> - <translation>使用自定义设置</translation> - </message> -</context> -<context> - <name>HelpDialog</name> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+279"/> - <source>Open Link in Current Tab</source> - <translation>在当前标签页打开链接</translation> - </message> - <message> - <location line="+3"/> - <source>Open Link in New Window</source> - <translation>在新窗口中打开链接</translation> - </message> - <message> - <location line="+3"/> - <source>Open Link in New Tab</source> - <translation>在新标签页中打开链接</translation> - </message> - <message> - <location line="+73"/> - <location line="+82"/> - <source>Prepare...</source> - <translation>准备...</translation> - </message> - <message> - <location line="-64"/> - <location line="+16"/> - <location line="+661"/> - <source>Qt Assistant</source> - <translation>Qt 助手</translation> - </message> - <message> - <location line="-677"/> - <source>Failed to load keyword index file -Assistant will not work!</source> - <translation>加载关键词索引文件失败 -Qt 助手将不能工作!</translation> - </message> - <message> - <location line="+17"/> - <source>Cannot open the index file %1</source> - <translation>无法打开索引文件 %1</translation> - </message> - <message> - <location line="+58"/> - <location line="+124"/> - <location line="+8"/> - <source>Warning</source> - <translation>警告</translation> - </message> - <message> - <location line="-131"/> - <location line="+124"/> - <source>Documentation file %1 does not exist! -Skipping file.</source> - <translation>文档文件 %1 不存在! -跳过文件。</translation> - </message> - <message> - <location line="-112"/> - <location line="+133"/> - <source>Parse Error</source> - <translation>解析错误</translation> - </message> - <message> - <location line="-13"/> - <source>Documentation file %1 is not compatible! -Skipping file.</source> - <translation>%1 文档文件不兼容! -跳过文件!</translation> - </message> - <message> - <location line="+48"/> - <location line="+469"/> - <source>Done</source> - <translation>完成</translation> - </message> - <message> - <location line="-47"/> - <source>Failed to save fulltext search index -Assistant will not work!</source> - <translation>保存全文搜索索引失败 Qt 助手将不能工作!</translation> - </message> - <message> - <location line="+29"/> - <source>Indexing files...</source> - <translation>正在索引文件...</translation> - </message> - <message> - <location line="+15"/> - <source>Reading dictionary...</source> - <translation>正在读取词典...</translation> - </message> - <message> - <location line="+46"/> - <location line="+9"/> - <source>Full Text Search</source> - <translation>全文搜索</translation> - </message> - <message> - <location line="-8"/> - <source>Using a wildcard within phrases is not allowed.</source> - <translation>不允许在短语中使用通配符。</translation> - </message> - <message> - <location line="+9"/> - <source>The closing quotation mark is missing.</source> - <translation>缺少关闭标点。</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui"/> - <source>Help</source> - <translation>帮助</translation> - </message> - <message> - <location/> - <source><b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p></source> - <translation><b>帮助</b><p>在内容列表中选择您需要帮助的主题,或者在索引中搜索这个关键词。</p></translation> - </message> - <message> - <location/> - <source>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</source> - <translation>按种类、索引和标签显示帮助主题。另一个标签页中可以执行全文搜索。</translation> - </message> - <message> - <location/> - <source>Con&tents</source> - <translation>内容(&T)</translation> - </message> - <message> - <location/> - <source><b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p></source> - <translation><b>按种类组织帮助主题。</b><p>双击一项可以查看那个种类中的主题。要查看一个主题,只要双击它就可以了。</p></translation> - </message> - <message> - <location/> - <source>column 1</source> - <translation>列 1</translation> - </message> - <message> - <location/> - <source>&Index</source> - <translation>索引(&I)</translation> - </message> - <message> - <location/> - <source>&Look For:</source> - <translation>查找(&L):</translation> - </message> - <message> - <location/> - <source>Enter keyword</source> - <translation>输入关键词</translation> - </message> - <message> - <location/> - <source><b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p></source> - <translation><b>输入一个关键词。</b><p>这个列表将会选择一个和已输入字符串最匹配的一项。</p></translation> - </message> - <message> - <location/> - <source><b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p></source> - <translation><b>可用的帮助主题列表。</b><p>双击一项打开它的帮助页面。如果找到一个以上的结果,你必须指定你想要打开哪一个。</p></translation> - </message> - <message> - <location/> - <source>&Bookmarks</source> - <translation>书签(&B)</translation> - </message> - <message> - <location/> - <source>Displays the list of bookmarks.</source> - <translation>显示书签列表。</translation> - </message> - <message> - <location/> - <source>Add new bookmark</source> - <translation>添加新书签</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>把当前显示的页面添加为一个新书签。</translation> - </message> - <message> - <location/> - <source>&New</source> - <translation>新建(&N)</translation> - </message> - <message> - <location/> - <source>Delete bookmark</source> - <translation>删除书签</translation> - </message> - <message> - <location/> - <source>Delete the selected bookmark.</source> - <translation>删除被选中的书签。</translation> - </message> - <message> - <location/> - <source>&Delete</source> - <translation>删除(&D)</translation> - </message> - <message> - <location/> - <source>&Search</source> - <translation>搜索(&S)</translation> - </message> - <message> - <location/> - <source>Searching f&or:</source> - <translation>正在搜索(&O):</translation> - </message> - <message> - <location/> - <source>Enter searchword(s).</source> - <translation>输入搜索词。</translation> - </message> - <message> - <location/> - <source><b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p></source> - <translation><b>输入搜索词。<b><p>在这里输入您要查找的词。这个词可以包含通配符(*)。如果是一个词的序列,请把它们放在英文引号内。</p></translation> - </message> - <message> - <location/> - <source><b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p></source> - <translation><b>发现文档</b><p>这个列表包含上此搜索发现的所有文档。这些文档已经排序,例如,第一个文档最为匹配。</p></translation> - </message> - <message> - <location/> - <source>Found &Documents:</source> - <translation>找到的文档(&D):</translation> - </message> - <message> - <location/> - <source>Display the help page.</source> - <translation>显示帮助页面。</translation> - </message> - <message> - <location/> - <source>Display the help page for the full text search.</source> - <translation>显示全文文本搜索的帮助页面。</translation> - </message> - <message> - <location/> - <source>He&lp</source> - <translation>帮助(&L)</translation> - </message> - <message> - <location/> - <source>Start searching.</source> - <translation>开始搜索。</translation> - </message> - <message> - <location/> - <source>Pressing this button starts the search.</source> - <translation>点击这个按钮开始搜索。</translation> - </message> - <message> - <location/> - <source>Preparing...</source> - <translation>正在准备...</translation> - </message> - <message numerus="yes"> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+7"/> - <source>%n document(s) found.</source> - <translation> - <numerusform>%n 个文档已经找到。</numerusform> - </translation> - </message> -</context> -<context> - <name>HelpWindow</name> - <message> - <location filename="../tools/assistant/compat/helpwindow.cpp" line="+97"/> - <source>Help</source> - <translation>帮助</translation> - </message> - <message> - <location line="+1"/> - <source>Unable to launch web browser. -</source> - <translation>不能启动网页浏览器。 -</translation> - </message> - <message> - <location line="+28"/> - <source>Failed to open link: '%1'</source> - <translation>打开链接失败:“%1”</translation> - </message> - <message> - <location line="+1"/> - <source><div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div></source> - <translation><div align="center"><h1>没有找到这个页面</h1><br><h3>“%1”</h3></div></translation> - </message> - <message> - <location line="+2"/> - <source>Error...</source> - <translation>错误...</translation> - </message> - <message> - <location line="+61"/> - <source>Open Link in New Window Shift+LMB</source> - <translation>在新窗口中打开链接 Shift+LMB</translation> - </message> - <message> - <location line="-2"/> - <source>Open Link in New Tab</source> - <translation>在新标签页中打开链接</translation> - </message> - <message> - <location line="-89"/> - <source>OK</source> - <translation>确定</translation> - </message> - <message> - <location line="+86"/> - <source>Copy &Link Location</source> - <translation>复制链接地址(&L)</translation> - </message> -</context> -<context> - <name>Index</name> - <message> - <location filename="../tools/assistant/compat/index.cpp" line="+385"/> - <source>Untitled</source> - <translation>未命名的</translation> - </message> -</context> -<context> - <name>MainWindow</name> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+103"/> - <source>Sidebar</source> - <translation>侧栏</translation> - </message> - <message> - <location line="+18"/> - <source>&Window</source> - <translation>窗口(&W)</translation> - </message> - <message> - <location line="+2"/> - <source>Minimize</source> - <translation>最小化</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+M</source> - <translation>Ctrl+M</translation> - </message> - <message> - <location line="+34"/> - <source>Initializing Qt Assistant...</source> - <translation>正在初始化 Qt 助手...</translation> - </message> - <message> - <location line="+26"/> - <source>SHIFT+CTRL+=</source> - <translation>SHIFT+CTRL+=</translation> - </message> - <message> - <location line="+4"/> - <source>Ctrl+T</source> - <translation>Ctrl+T</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+I</source> - <translation>Ctrl+I</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+B</source> - <translation>Ctrl+B</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+S</source> - <translation>Ctrl+S</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Ctrl+W</source> - <translation>Ctrl+W</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+1"/> - <source>Ctrl+]</source> - <translation>Ctrl+]</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+[</source> - <translation>Ctrl+[</translation> - </message> - <message> - <location line="+7"/> - <source>Views</source> - <translation>视图</translation> - </message> - <message> - <location line="+80"/> - <source>Displays the main page of a specific documentation set.</source> - <translation>显示一个指定文档集的主页面。</translation> - </message> - <message> - <source>Open Source Edition</source> - <translation type="obsolete">开源版本</translation> - </message> - <message> - <source>This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development.</source> - <translation type="obsolete">这个版本的 Qt 助手是 Qt 开源版本的一部分,用于开发开源应用程序。Qt 是一个用于跨平台应用程序开发的综合 C++ 框架。</translation> - </message> - <message> - <source>This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.</source> - <translation type="obsolete">我们已经允许您在 Qt 商业许可协议下使用本程序。有关细节,请阅读本软件发行中所带的 LICENSE 文件。</translation> - </message> - <message> - <location line="+49"/> - <location line="+1"/> - <source>Qt Assistant</source> - <translation>Qt 助手</translation> - </message> - <message> - <location line="+19"/> - <source>Failed to open about application contents in file: '%1'</source> - <translation>在“%1”文件中打开应用程序内容失败</translation> - </message> - <message> - <location line="+201"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+238"/> - <location line="+6"/> - <source>Save Page</source> - <translation>保存页面</translation> - </message> - <message> - <location line="+0"/> - <source>Cannot open file for writing!</source> - <translation>不能写打开文件!</translation> - </message> - <message> - <source>Qt Assistant by Trolltech</source> - <translation type="obsolete">Trolltech 的 Qt 助手</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Qt Assistant by Nokia</source> - <translation>Qt助手 - Nokia</translation> - </message> - <message> - <location/> - <source>Toolbar</source> - <translation>工具栏</translation> - </message> - <message> - <location/> - <source>Go</source> - <translation>前往</translation> - </message> - <message> - <location/> - <source>&Help</source> - <translation>帮助(&H)</translation> - </message> - <message> - <location/> - <source>&File</source> - <translation>文件(&F)</translation> - </message> - <message> - <location/> - <source>Boo&kmarks</source> - <translation>书签(&K)</translation> - </message> - <message> - <location/> - <source>&Go</source> - <translation>前往(&G)</translation> - </message> - <message> - <location/> - <source>&View</source> - <translation>查看(&V)</translation> - </message> - <message> - <location/> - <source>&Edit</source> - <translation>编辑(&E)</translation> - </message> - <message> - <location/> - <source>&Print...</source> - <translation>打印(&P)...</translation> - </message> - <message> - <location/> - <source>Print the currently displayed page.</source> - <translation>打印当前显示页面。</translation> - </message> - <message> - <location/> - <source>Ctrl+P</source> - <translation>Ctrl+P</translation> - </message> - <message> - <location/> - <source>E&xit</source> - <translation>退出(&X)</translation> - </message> - <message> - <location/> - <source>Quit Qt Assistant.</source> - <translation>退出 Qt 助手。</translation> - </message> - <message> - <location/> - <source>Ctrl+Q</source> - <translation>Ctrl+Q</translation> - </message> - <message> - <location/> - <source>&Copy</source> - <translation>复制(&C)</translation> - </message> - <message> - <location/> - <source>Copy the selected text to the clipboard.</source> - <translation>复制选中的文本到剪贴板。</translation> - </message> - <message> - <location/> - <source>Ctrl+C</source> - <translation>Ctrl+C</translation> - </message> - <message> - <location/> - <source>&Find in Text...</source> - <translation>在文本中查找(&F)...</translation> - </message> - <message> - <location/> - <source>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</source> - <translation>打开查找对话框。Qt 助手将会在当前显示页面中搜索您输入的文本。</translation> - </message> - <message> - <location/> - <source>Ctrl+F</source> - <translation>Ctrl+F</translation> - </message> - <message> - <location/> - <source>Find &Next</source> - <translation>查找下一个(&N)</translation> - </message> - <message> - <location/> - <source>F3</source> - <translation>F3</translation> - </message> - <message> - <location/> - <source>Find &Previous</source> - <translation>查找上一个(&P)</translation> - </message> - <message> - <location/> - <source>Shift+F3</source> - <translation>Shift+F3</translation> - </message> - <message> - <location/> - <source>&Home</source> - <translation>主页(&H)</translation> - </message> - <message> - <location/> - <source>Go to the home page. Qt Assistant's home page is the Qt Reference Documentation.</source> - <translation>前往主页。Qt 助手的主页就是 Qt 参考文档。</translation> - </message> - <message> - <location/> - <source>Ctrl+Home</source> - <translation>Ctrl+Home</translation> - </message> - <message> - <location/> - <source>&Previous</source> - <translation>上一页(&P)</translation> - </message> - <message> - <location/> - <source>Go to the previous page.</source> - <translation>前往上一页。</translation> - </message> - <message> - <location/> - <source>Alt+Left</source> - <translation>Alt+Left</translation> - </message> - <message> - <location/> - <source>&Next</source> - <translation>下一页(&N)</translation> - </message> - <message> - <location/> - <source>Go to the next page.</source> - <translation>前往下一页。</translation> - </message> - <message> - <location/> - <source>Alt+Right</source> - <translation>Alt+Right</translation> - </message> - <message> - <location/> - <source>About Qt Assistant</source> - <translation>关于 Qt 助手</translation> - </message> - <message> - <location/> - <source>Display further information about Qt Assistant.</source> - <translation>显示有关 Qt 助手的更多信息。</translation> - </message> - <message> - <location/> - <source>About Qt</source> - <translation>关于 Qt</translation> - </message> - <message> - <location/> - <source>Zoom &in</source> - <translation>放大(&I)</translation> - </message> - <message> - <location/> - <source>Zoom in on the document, i.e. increase the font size.</source> - <translation>放大文档,也就是增大字体大小。</translation> - </message> - <message> - <location/> - <source>Ctrl++</source> - <translation>Ctrl++</translation> - </message> - <message> - <location/> - <source>Zoom &out</source> - <translation>缩小(&O)</translation> - </message> - <message> - <location/> - <source>Zoom out on the document, i.e. decrease the font size.</source> - <translation>缩小文档,也就是减小字体大小。</translation> - </message> - <message> - <location/> - <source>Ctrl+-</source> - <translation>Ctrl+-</translation> - </message> - <message> - <location/> - <source>New Window</source> - <translation>新建窗口</translation> - </message> - <message> - <location/> - <source>Open a new window.</source> - <translation>打开一个新窗口。</translation> - </message> - <message> - <location/> - <source>Ctrl+N</source> - <translation>Ctrl+N</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>关闭(&C)</translation> - </message> - <message> - <location/> - <source>Close the current window.</source> - <translation>关闭当前窗口。</translation> - </message> - <message> - <location/> - <source>&Add Bookmark</source> - <translation>添加书签(&A)</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>把当前显示页面添加为一个新书签。</translation> - </message> - <message> - <location/> - <source>What's This?</source> - <translation>这是什么?</translation> - </message> - <message> - <location/> - <source>"What's This?" context sensitive help.</source> - <translation>“这是什么?”上下文敏感帮助。</translation> - </message> - <message> - <location/> - <source>Shift+F1</source> - <translation>Shift+F1</translation> - </message> - <message> - <location/> - <source>Add Tab</source> - <translation>添加标签页</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+N</source> - <translation>Ctrl+Alt+N</translation> - </message> - <message> - <location/> - <source>Next Tab</source> - <translation>下一个标签页</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Right</source> - <translation>Ctrl+Alt+Right</translation> - </message> - <message> - <location/> - <source>Previous Tab</source> - <translation>前一个标签页</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Left</source> - <translation>Ctrl+Alt+Left</translation> - </message> - <message> - <location/> - <source>Close Tab</source> - <translation>关闭标签页</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Q</source> - <translation>Ctrl+Alt+Q</translation> - </message> - <message> - <location/> - <source>Qt Assistant Manual</source> - <translation>Qt 助手手册</translation> - </message> - <message> - <location/> - <source>F1</source> - <translation>F1</translation> - </message> - <message> - <location/> - <source>Save Page As...</source> - <translation>页面另存为...</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+S</source> - <translation>Ctrl+Alt+S</translation> - </message> - <message> - <location/> - <source>Sync with Table of Contents</source> - <translation>同步目录</translation> - </message> - <message> - <location/> - <source>Select the page in contents tab.</source> - <translation>选择内容标签页中的页面。</translation> - </message> - <message> - <location/> - <source>Font Settings...</source> - <translation>字体设置...</translation> - </message> - <message> - <source>You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a> for an overview of Qt licensing.</source> - <translation type="obsolete">开发商业(闭源)应用程序,你需要商业 Qt 许可。对于 Qt 许可的概览,请参考<a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a>。</translation> - </message> - <message> - <source>This program is licensed to you under the terms of the Qt %1 License Agreement. For details, see the license file that came with this software distribution.</source> - <translation type="obsolete">我们已经允许您在 Qt %1 许可协议下使用本程序。有关细节,请阅读本软件发行中所带的许可协议文件。</translation> - </message> -</context> -<context> - <name>QObject</name> - <message> - <source>Qt Assistant by Trolltech</source> - <translation type="obsolete">Trolltech 的 Qt 助手</translation> - </message> - <message> - <location filename="../tools/assistant/compat/config.cpp" line="+350"/> - <source>Qt Assistant by Nokia</source> - <translation>Qt助手 - Nokia</translation> - </message> -</context> -<context> - <name>TabbedBrowser</name> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+149"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+86"/> - <source>Add page</source> - <translation>添加页面</translation> - </message> - <message> - <location line="+9"/> - <source>Close page</source> - <translation>关闭页面</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui"/> - <source>TabbedBrowser</source> - <translation>标签页浏览器</translation> - </message> - <message> - <location/> - <source>Untitled</source> - <translation>未命名的</translation> - </message> - <message> - <location/> - <source>Previous</source> - <translation>上一个</translation> - </message> - <message> - <location/> - <source>Next</source> - <translation>下一个</translation> - </message> - <message> - <location/> - <source>Case Sensitive</source> - <translation>区分大小写</translation> - </message> - <message> - <location/> - <source>Whole words</source> - <translation>整词</translation> - </message> - <message> - <location/> - <source><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</source> - <translation><img src=":/trolltech/assistant/images/wrap.png">&nbsp;搜索已经回环</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+243"/> - <source>New Tab</source> - <translation>新标签页</translation> - </message> - <message> - <location line="+1"/> - <source>Close Tab</source> - <translation>关闭标签页</translation> - </message> - <message> - <location line="+1"/> - <source>Close Other Tabs</source> - <translation>关闭其它标签页</translation> - </message> -</context> -<context> - <name>TopicChooser</name> - <message> - <location filename="../tools/assistant/compat/topicchooser.cpp" line="+56"/> - <source>Choose a topic for <b>%1</b></source> - <translation>为<b>%1</b>选择一个主题</translation> - </message> - <message> - <location filename="../tools/assistant/compat/topicchooser.ui"/> - <source>Choose Topic</source> - <translation>选择主题</translation> - </message> - <message> - <location/> - <source>Select a topic from the list and click the <b>Display</b>-button to open the online help.</source> - <translation>从列表中选择一个主题并且点击<b>显示</b>按钮打开在线帮助。</translation> - </message> - <message> - <location/> - <source>&Topics</source> - <translation>主题(&T)</translation> - </message> - <message> - <location/> - <source>Displays a list of available help topics for the keyword.</source> - <translation>为这个关键词显示一个可用帮助主题的列表。</translation> - </message> - <message> - <location/> - <source>&Display</source> - <translation>显示(&D)</translation> - </message> - <message> - <location/> - <source>Open the topic selected in the list.</source> - <translation>打开列表中选中的主题。</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>关闭(&C)</translation> - </message> - <message> - <location/> - <source>Close the Dialog.</source> - <translation>关闭对话框。</translation> - </message> -</context> -</TS> diff --git a/translations/assistant_adp_zh_TW.ts b/translations/assistant_adp_zh_TW.ts deleted file mode 100644 index d622d11..0000000 --- a/translations/assistant_adp_zh_TW.ts +++ /dev/null @@ -1,1000 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE TS> -<TS version="2.0" language="zh_TW"> -<context> - <name>AssistantServer</name> - <message> - <location filename="../tools/assistant/compat/main.cpp" line="+225"/> - <source>Qt Assistant</source> - <translation>Qt 小幫手</translation> - </message> - <message> - <location line="+1"/> - <source>Failed to bind to port %1</source> - <translation>無法結合連接埠 %1</translation> - </message> -</context> -<context> - <name>FontPanel</name> - <message> - <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/> - <source>Font</source> - <translation>字型</translation> - </message> - <message> - <location line="+11"/> - <source>&Writing system</source> - <translation>寫入系統(&W)</translation> - </message> - <message> - <location line="+3"/> - <source>&Family</source> - <translation>家族(&F)</translation> - </message> - <message> - <location line="+4"/> - <source>&Style</source> - <translation>風格(&S)</translation> - </message> - <message> - <location line="+4"/> - <source>&Point size</source> - <translation>點大小(&P)</translation> - </message> -</context> -<context> - <name>FontSettingsDialog</name> - <message> - <location filename="../tools/assistant/compat/fontsettingsdialog.cpp" line="+63"/> - <source>Font Settings</source> - <translation>字型設定</translation> - </message> - <message> - <location line="+7"/> - <source>Font settings for:</source> - <translation>字型設定用於:</translation> - </message> - <message> - <location line="+4"/> - <source>Browser</source> - <translation>瀏覽器</translation> - </message> - <message> - <location line="+1"/> - <source>Application</source> - <translation>應用程式</translation> - </message> - <message> - <location line="+6"/> - <source>Use custom settings</source> - <translation>使用者自訂設定</translation> - </message> -</context> -<context> - <name>HelpDialog</name> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui"/> - <source>Con&tents</source> - <translation>內容(&T)</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+376"/> - <location line="+16"/> - <location line="+661"/> - <source>Qt Assistant</source> - <translation>Qt 小幫手</translation> - </message> - <message> - <location line="-774"/> - <source>Open Link in Current Tab</source> - <translation>在目前的分頁開啟連結</translation> - </message> - <message> - <location line="+3"/> - <source>Open Link in New Window</source> - <translation>在新視窗開啟連結</translation> - </message> - <message> - <location line="+3"/> - <source>Open Link in New Tab</source> - <translation>在新分頁開啟連結</translation> - </message> - <message> - <location line="+73"/> - <location line="+82"/> - <source>Prepare...</source> - <translation>準備中...</translation> - </message> - <message> - <location line="-64"/> - <source>Failed to load keyword index file -Assistant will not work!</source> - <translation>無法載入關鍵字索引檔 -小幫手將無法運作!</translation> - </message> - <message> - <location line="+17"/> - <source>Cannot open the index file %1</source> - <translation>無法開啟索引檔 %1</translation> - </message> - <message> - <location line="+58"/> - <location line="+124"/> - <location line="+8"/> - <source>Warning</source> - <translation>警告</translation> - </message> - <message> - <location line="-131"/> - <location line="+124"/> - <source>Documentation file %1 does not exist! -Skipping file.</source> - <translation>文件檔 %1 不存在 -將跳過此檔案。</translation> - </message> - <message> - <location line="-112"/> - <location line="+133"/> - <source>Parse Error</source> - <translation>剖析錯誤</translation> - </message> - <message> - <location line="-13"/> - <source>Documentation file %1 is not compatible! -Skipping file.</source> - <translation>文件檔 %1 不相容 -將跳過此檔案。</translation> - </message> - <message> - <location line="+48"/> - <location line="+469"/> - <source>Done</source> - <translation>完成</translation> - </message> - <message> - <location line="-47"/> - <source>Failed to save fulltext search index -Assistant will not work!</source> - <translation>無法儲存全文檢索搜尋索引。 -小幫手將無法運作!</translation> - </message> - <message> - <location line="+29"/> - <source>Indexing files...</source> - <translation>建立檔案索引中...</translation> - </message> - <message> - <location line="+15"/> - <source>Reading dictionary...</source> - <translation>讀取字典中...</translation> - </message> - <message> - <location line="+46"/> - <location line="+9"/> - <source>Full Text Search</source> - <translation>全文檢索</translation> - </message> - <message> - <location line="-8"/> - <source>Using a wildcard within phrases is not allowed.</source> - <translation>在片語中不能使用萬用字元。</translation> - </message> - <message> - <location line="+9"/> - <source>The closing quotation mark is missing.</source> - <translation>沒有關閉引號。</translation> - </message> - <message> - <location filename="../tools/assistant/compat/helpdialog.ui"/> - <source>Help</source> - <translation>說明</translation> - </message> - <message> - <location/> - <source><b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p></source> - <translation><b>說明</b><p>請從內容清單中選擇您需要說明的主題,或是在索引中搜尋關鍵字。</p></translation> - </message> - <message> - <location/> - <source>Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search.</source> - <translation>依分類、索引或書籤來顯示說明主題。另一個分頁會繼承此全文檢索。</translation> - </message> - <message> - <location/> - <source><b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p></source> - <translation><b>依類別組織說明主題。</b><p>雙擊可以查看該類別中有哪些主題。雙擊該主題可以查看內容。</p></translation> - </message> - <message> - <location/> - <source>column 1</source> - <translation>欄 1</translation> - </message> - <message> - <location/> - <source>&Index</source> - <translation>索引(&I)</translation> - </message> - <message> - <location/> - <source>&Look For:</source> - <translation>搜尋(&L):</translation> - </message> - <message> - <location/> - <source>Enter keyword</source> - <translation>輸入關鍵字</translation> - </message> - <message> - <location/> - <source><b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p></source> - <translation><b>輸入關鍵字。</b><p>此清單可以選擇最能符合輸入字串的項目。</p></translation> - </message> - <message> - <location/> - <source><b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p></source> - <translation><b>可用說明主題清單。</b><p>雙擊可以開啟該說明頁面。如果找到一個以上,您必須指定您要看哪一個頁面。</p></translation> - </message> - <message> - <location/> - <source>&Bookmarks</source> - <translation>書籤(&B)</translation> - </message> - <message> - <location/> - <source>Displays the list of bookmarks.</source> - <translation>顯示書籤的清單。</translation> - </message> - <message> - <location/> - <source>Add new bookmark</source> - <translation>新增書籤</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>將目前顯示的頁面新增到書籤中。</translation> - </message> - <message> - <location/> - <source>&New</source> - <translation>新增(&N)</translation> - </message> - <message> - <location/> - <source>Delete bookmark</source> - <translation>刪除書籤</translation> - </message> - <message> - <location/> - <source>Delete the selected bookmark.</source> - <translation>刪除選取的書籤。</translation> - </message> - <message> - <location/> - <source>&Delete</source> - <translation>刪除(&D)</translation> - </message> - <message> - <location/> - <source>&Search</source> - <translation>搜尋(&S)</translation> - </message> - <message> - <location/> - <source>Searching f&or:</source> - <translation>搜尋內容(&O):</translation> - </message> - <message> - <location/> - <source>Enter searchword(s).</source> - <translation>請輸入搜尋關鍵字詞。</translation> - </message> - <message> - <location/> - <source><b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p></source> - <translation><b>輸入搜尋關鍵字詞。</b><p>在此輸入您要搜尋的關鍵字詞。可以使用萬用字元 (*)。如果是一個片語,請用引號括起來。</p></translation> - </message> - <message> - <location/> - <source><b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p></source> - <translation><b>找到的文件</b><p>這放清單包含了所有上次搜尋找到的文件。文件會依符合程度排序。</p></translation> - </message> - <message> - <location/> - <source>Found &Documents:</source> - <translation>找到的文件(&D):</translation> - </message> - <message> - <location/> - <source>Display the help page.</source> - <translation>顯示說明頁面。</translation> - </message> - <message> - <location/> - <source>Display the help page for the full text search.</source> - <translation>顯示全文檢索的說明頁面。</translation> - </message> - <message> - <location/> - <source>He&lp</source> - <translation>說明(&L)</translation> - </message> - <message> - <location/> - <source>Start searching.</source> - <translation>開始搜尋。</translation> - </message> - <message> - <location/> - <source>Pressing this button starts the search.</source> - <translation>按下此按鍵開始搜尋。</translation> - </message> - <message> - <location/> - <source>Preparing...</source> - <translation>準備中...</translation> - </message> - <message numerus="yes"> - <location filename="../tools/assistant/compat/helpdialog.cpp" line="+7"/> - <source>%n document(s) found.</source> - <translation> - <numerusform>找到 %n 個文件。</numerusform> - </translation> - </message> -</context> -<context> - <name>HelpWindow</name> - <message> - <location filename="../tools/assistant/compat/helpwindow.cpp" line="+97"/> - <source>Help</source> - <translation>說明</translation> - </message> - <message> - <location line="+93"/> - <source>Open Link in New Window Shift+LMB</source> - <translation>在新視窗開啟連結 Shift+滑鼠左鍵</translation> - </message> - <message> - <location line="-92"/> - <source>Unable to launch web browser. -</source> - <translation>無法啟動瀏覽器。 -</translation> - </message> - <message> - <location line="+1"/> - <source>OK</source> - <translation>確定</translation> - </message> - <message> - <location line="+27"/> - <source>Failed to open link: '%1'</source> - <translation>無法開啟連結:%1</translation> - </message> - <message> - <location line="+1"/> - <source><div align="center"><h1>The page could not be found</h1><br><h3>'%1'</h3></div></source> - <translation><div align="center"><h1>找不到該頁面</h1><br><h3>%1</h3></div></translation> - </message> - <message> - <location line="+2"/> - <source>Error...</source> - <translation>錯誤...</translation> - </message> - <message> - <location line="+59"/> - <source>Open Link in New Tab</source> - <translation>在新分頁開啟連結</translation> - </message> - <message> - <location line="-3"/> - <source>Copy &Link Location</source> - <translation>複製連結位置(&L)</translation> - </message> -</context> -<context> - <name>Index</name> - <message> - <location filename="../tools/assistant/compat/index.cpp" line="+385"/> - <source>Untitled</source> - <translation>未命名</translation> - </message> -</context> -<context> - <name>MainWindow</name> - <message> - <source>Qt Assistant by Trolltech</source> - <translation type="obsolete">Qt 小幫手,Trolltech 公司提供</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Toolbar</source> - <translation>工具列</translation> - </message> - <message> - <location/> - <source>&Print...</source> - <translation>列印(&P)...</translation> - </message> - <message> - <location/> - <source>E&xit</source> - <translation>離開(&X)</translation> - </message> - <message> - <location/> - <source>&Copy</source> - <translation>複製(&C)</translation> - </message> - <message> - <location/> - <source>&Find in Text...</source> - <translation>在文字中尋找(&F)...</translation> - </message> - <message> - <location/> - <source>&Home</source> - <translation>首頁(&H)</translation> - </message> - <message> - <location/> - <source>&Previous</source> - <translation>前一個(&P)</translation> - </message> - <message> - <location/> - <source>&Next</source> - <translation>下一個(&N)</translation> - </message> - <message> - <location/> - <source>About Qt</source> - <translation>關於 Qt</translation> - </message> - <message> - <location/> - <source>Zoom &in</source> - <translation>放大(&I)</translation> - </message> - <message> - <location/> - <source>Zoom &out</source> - <translation>縮小(&O)</translation> - </message> - <message> - <location/> - <source>New Window</source> - <translation>新視窗</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+188"/> - <source>Ctrl+T</source> - <translation>Ctrl+T</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+I</source> - <translation>Ctrl+I</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+B</source> - <translation>Ctrl+B</translation> - </message> - <message> - <location line="+139"/> - <location line="+1"/> - <source>Qt Assistant</source> - <translation>Qt 小幫手</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>&Add Bookmark</source> - <translation>新增書籤(&A)</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="-227"/> - <source>Sidebar</source> - <translation>邊列</translation> - </message> - <message> - <location line="+18"/> - <source>&Window</source> - <translation>視窗(&W)</translation> - </message> - <message> - <location line="+2"/> - <source>Minimize</source> - <translation>最小化</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+M</source> - <translation>Ctrl+M</translation> - </message> - <message> - <location line="+34"/> - <source>Initializing Qt Assistant...</source> - <translation>初始化 Qt 小幫手中...</translation> - </message> - <message> - <location line="+26"/> - <source>SHIFT+CTRL+=</source> - <translation>SHIFT+CTRL+=</translation> - </message> - <message> - <location line="+7"/> - <source>Ctrl+S</source> - <translation>Ctrl+S</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Ctrl+W</source> - <translation>Ctrl+W</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.cpp" line="+1"/> - <source>Ctrl+]</source> - <translation>Ctrl+]</translation> - </message> - <message> - <location line="+1"/> - <source>Ctrl+[</source> - <translation>Ctrl+[</translation> - </message> - <message> - <location line="+7"/> - <source>Views</source> - <translation>檢視</translation> - </message> - <message> - <location line="+80"/> - <source>Displays the main page of a specific documentation set.</source> - <translation>顯示指定文件集的主頁面。</translation> - </message> - <message> - <source>Open Source Edition</source> - <translation type="obsolete">開放源碼版本</translation> - </message> - <message> - <source>This version of Qt Assistant is part of the Qt Open Source Edition, for use in the development of Open Source applications. Qt is a comprehensive C++ framework for cross-platform application development.</source> - <translation type="obsolete">此版本的 Qt 小幫手是 Qt 開放源碼版本的一部份,只能用於開發開放源碼的應用程式。Qt 為一個跨平台的,強大的 C++ 應用程式開發框架。</translation> - </message> - <message> - <source>This program is licensed to you under the terms of the Qt Commercial License Agreement. For details, see the file LICENSE that came with this software distribution.</source> - <translation type="obsolete">此程式以 Qt 商業授權同意書(Qt Commerical License Agreement)授權給您。詳情請參照 LICENSE 檔。</translation> - </message> - <message> - <location line="+69"/> - <source>Failed to open about application contents in file: '%1'</source> - <translation>無法開啟檔案中應用程式的「關於」內容:%1</translation> - </message> - <message> - <location line="+201"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+238"/> - <location line="+6"/> - <source>Save Page</source> - <translation>儲存頁面</translation> - </message> - <message> - <location line="+0"/> - <source>Cannot open file for writing!</source> - <translation>無法開啟檔案以寫入!</translation> - </message> - <message> - <location filename="../tools/assistant/compat/mainwindow.ui"/> - <source>Qt Assistant by Nokia</source> - <translation>Nokia 提供的 Qt 小幫手</translation> - </message> - <message> - <location/> - <source>Go</source> - <translation>走</translation> - </message> - <message> - <location/> - <source>&Help</source> - <translation>說明(&H)</translation> - </message> - <message> - <location/> - <source>&File</source> - <translation>檔案(&F)</translation> - </message> - <message> - <location/> - <source>Boo&kmarks</source> - <translation>書籤(&K)</translation> - </message> - <message> - <location/> - <source>&Go</source> - <translation>走(&G)</translation> - </message> - <message> - <location/> - <source>&View</source> - <translation>檢視(&V)</translation> - </message> - <message> - <location/> - <source>&Edit</source> - <translation>編輯(&E)</translation> - </message> - <message> - <location/> - <source>Print the currently displayed page.</source> - <translation>列印目前顯示的頁面。</translation> - </message> - <message> - <location/> - <source>Ctrl+P</source> - <translation>Ctrl+P</translation> - </message> - <message> - <location/> - <source>Quit Qt Assistant.</source> - <translation>離開 Qt 小幫手。</translation> - </message> - <message> - <location/> - <source>Ctrl+Q</source> - <translation>Ctrl+Q</translation> - </message> - <message> - <location/> - <source>Copy the selected text to the clipboard.</source> - <translation>複製選取的文字到剪貼簿中。</translation> - </message> - <message> - <location/> - <source>Ctrl+C</source> - <translation>Ctrl+C</translation> - </message> - <message> - <location/> - <source>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</source> - <translation>開啟「尋找」對話框。Qt 小幫手會在目前顯示的頁面中搜尋您所輸入的文字。</translation> - </message> - <message> - <location/> - <source>Ctrl+F</source> - <translation>Ctrl+F</translation> - </message> - <message> - <location/> - <source>Find &Next</source> - <translation>尋找下一筆(&N)</translation> - </message> - <message> - <location/> - <source>F3</source> - <translation>F3</translation> - </message> - <message> - <location/> - <source>Find &Previous</source> - <translation>尋找上一筆(&P)</translation> - </message> - <message> - <location/> - <source>Shift+F3</source> - <translation>Shift+F3</translation> - </message> - <message> - <location/> - <source>Go to the home page. Qt Assistant's home page is the Qt Reference Documentation.</source> - <translation>回到首頁。Qt 小幫手的首頁為 Qt 參考文件。</translation> - </message> - <message> - <location/> - <source>Ctrl+Home</source> - <translation>Ctrl+Home</translation> - </message> - <message> - <location/> - <source>Go to the previous page.</source> - <translation>跳到上一頁。</translation> - </message> - <message> - <location/> - <source>Alt+Left</source> - <translation>Alt+Left</translation> - </message> - <message> - <location/> - <source>Go to the next page.</source> - <translation>跳到下一頁。</translation> - </message> - <message> - <location/> - <source>Alt+Right</source> - <translation>Alt+Right</translation> - </message> - <message> - <location/> - <source>About Qt Assistant</source> - <translation>關於 Qt 小幫手</translation> - </message> - <message> - <location/> - <source>Display further information about Qt Assistant.</source> - <translation>顯示關於 Qt 小幫手的詳情。</translation> - </message> - <message> - <location/> - <source>Zoom in on the document, i.e. increase the font size.</source> - <translation>放大文件,也就是加大字型。</translation> - </message> - <message> - <location/> - <source>Ctrl++</source> - <translation>Ctrl++</translation> - </message> - <message> - <location/> - <source>Zoom out on the document, i.e. decrease the font size.</source> - <translation>縮小文件,也就是縮小字型。</translation> - </message> - <message> - <location/> - <source>Ctrl+-</source> - <translation>Ctrl+-</translation> - </message> - <message> - <location/> - <source>Open a new window.</source> - <translation>開啟新視窗。</translation> - </message> - <message> - <location/> - <source>Ctrl+N</source> - <translation>Ctrl+N</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>關閉(&C)</translation> - </message> - <message> - <location/> - <source>Close the current window.</source> - <translation>關閉目前的視窗。</translation> - </message> - <message> - <location/> - <source>Add the currently displayed page as a new bookmark.</source> - <translation>將目前顯示的頁面新增到書籤中。</translation> - </message> - <message> - <location/> - <source>What's This?</source> - <translation>這是什麼?</translation> - </message> - <message> - <location/> - <source>"What's This?" context sensitive help.</source> - <translation>「這是什麼?」內文說明。</translation> - </message> - <message> - <location/> - <source>Shift+F1</source> - <translation>Shift+F1</translation> - </message> - <message> - <location/> - <source>Add Tab</source> - <translation>新增分頁</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+N</source> - <translation>Ctrl+Alt+N</translation> - </message> - <message> - <location/> - <source>Next Tab</source> - <translation>下一個分頁</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Right</source> - <translation>Ctrl+Alt+Right</translation> - </message> - <message> - <location/> - <source>Previous Tab</source> - <translation>前一個分頁</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Left</source> - <translation>Ctrl+Alt+Left</translation> - </message> - <message> - <location/> - <source>Close Tab</source> - <translation>關閉分頁</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+Q</source> - <translation>Ctrl+Alt+Q</translation> - </message> - <message> - <location/> - <source>Qt Assistant Manual</source> - <translation>Qt 小幫手手冊</translation> - </message> - <message> - <location/> - <source>F1</source> - <translation>F1</translation> - </message> - <message> - <location/> - <source>Save Page As...</source> - <translation>另存頁面為...</translation> - </message> - <message> - <location/> - <source>Ctrl+Alt+S</source> - <translation>Ctrl+Alt+S</translation> - </message> - <message> - <location/> - <source>Sync with Table of Contents</source> - <translation>與目錄同步</translation> - </message> - <message> - <location/> - <source>Select the page in contents tab.</source> - <translation>選擇在內容分頁中的頁面。</translation> - </message> - <message> - <location/> - <source>Font Settings...</source> - <translation>字型設定...</translation> - </message> - <message> - <source>You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a> for an overview of Qt licensing.</source> - <translation type="obsolete">您需要商業版的 Qt 授權才能發展私有(封閉)應用程式軟體。關於 Qt 授權的概要,請參考 <a href="http://qt.nokia.com/company/model">qt.nokia.com/company/model</a>。</translation> - </message> - <message> - <source>This program is licensed to you under the terms of the Qt %1 License Agreement. For details, see the license file that came with this software distribution.</source> - <translation type="obsolete">此程式以 Qt %1 授權同意書授權給您。詳情請參照套件中的授權檔。</translation> - </message> -</context> -<context> - <name>QObject</name> - <message> - <source>Qt Assistant by Trolltech</source> - <translation type="obsolete">Qt 小幫手,Trolltech 公司提供</translation> - </message> - <message> - <location filename="../tools/assistant/compat/config.cpp" line="+350"/> - <source>Qt Assistant by Nokia</source> - <translation>Nokia 提供的 Qt 小幫手</translation> - </message> -</context> -<context> - <name>TabbedBrowser</name> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.cpp" line="+149"/> - <source>...</source> - <translation>...</translation> - </message> - <message> - <location line="+86"/> - <source>Add page</source> - <translation>新增頁面</translation> - </message> - <message> - <location line="+9"/> - <source>Close page</source> - <translation>關閉頁面</translation> - </message> - <message> - <location line="+243"/> - <source>New Tab</source> - <translation>新增分頁</translation> - </message> - <message> - <location line="+1"/> - <source>Close Tab</source> - <translation>關閉分頁</translation> - </message> - <message> - <location line="+1"/> - <source>Close Other Tabs</source> - <translation>關閉其他分頁</translation> - </message> - <message> - <location filename="../tools/assistant/compat/tabbedbrowser.ui"/> - <source>TabbedBrowser</source> - <translation>分頁式瀏覽器</translation> - </message> - <message> - <location/> - <source>Untitled</source> - <translation>未命名</translation> - </message> - <message> - <location/> - <source>Previous</source> - <translation>前一個</translation> - </message> - <message> - <location/> - <source>Next</source> - <translation>下一個</translation> - </message> - <message> - <location/> - <source>Case Sensitive</source> - <translation>區分大小寫</translation> - </message> - <message> - <location/> - <source>Whole words</source> - <translation>整個字詞</translation> - </message> - <message> - <location/> - <source><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</source> - <translation><img src=":/trolltech/assistant/images/wrap.png">&nbsp;搜尋已折回</translation> - </message> -</context> -<context> - <name>TopicChooser</name> - <message> - <location filename="../tools/assistant/compat/topicchooser.cpp" line="+56"/> - <source>Choose a topic for <b>%1</b></source> - <translation>請為 <b>%1</b> 選擇一個主題</translation> - </message> - <message> - <location filename="../tools/assistant/compat/topicchooser.ui"/> - <source>Choose Topic</source> - <translation>選擇主題</translation> - </message> - <message> - <location/> - <source>Select a topic from the list and click the <b>Display</b>-button to open the online help.</source> - <translation>請從清單中選取一個主題,並按下「顯示」鍵開啟線上說明。</translation> - </message> - <message> - <location/> - <source>&Topics</source> - <translation>主題(&T)</translation> - </message> - <message> - <location/> - <source>Displays a list of available help topics for the keyword.</source> - <translation>顯示此關鍵字可用的說明主題。</translation> - </message> - <message> - <location/> - <source>&Display</source> - <translation>顯示(&D)</translation> - </message> - <message> - <location/> - <source>Open the topic selected in the list.</source> - <translation>開啟在清單中選取的主題。</translation> - </message> - <message> - <location/> - <source>&Close</source> - <translation>關閉(&C)</translation> - </message> - <message> - <location/> - <source>Close the Dialog.</source> - <translation>關閉對話框。</translation> - </message> -</context> -</TS> diff --git a/translations/assistant_hu.ts b/translations/assistant_hu.ts new file mode 100644 index 0000000..e43070c --- /dev/null +++ b/translations/assistant_hu.ts @@ -0,0 +1,1083 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="hu"> +<context> + <name>AboutDialog</name> + <message> + <location filename="../tools/assistant/tools/assistant/aboutdialog.cpp" line="+110"/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> +</context> +<context> + <name>AboutLabel</name> + <message> + <location line="-14"/> + <source>Warning</source> + <translation>Figyelmeztetés</translation> + </message> + <message> + <location line="+1"/> + <source>Unable to launch external application. +</source> + <translation>Nem lehet külső alkalmazást elindítani.</translation> + </message> + <message> + <location line="+1"/> + <source>OK</source> + <translation>OK</translation> + </message> +</context> +<context> + <name>BookmarkDialog</name> + <message> + <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui"/> + <source>Add Bookmark</source> + <translation>Könyvjelző hozzáadása</translation> + </message> + <message> + <location/> + <source>Bookmark:</source> + <translation>Könyvjelző:</translation> + </message> + <message> + <location/> + <source>Add in Folder:</source> + <translation>Hozzáadás dossziéban:</translation> + </message> + <message> + <location/> + <source>New Folder</source> + <translation>Új dosszié</translation> + </message> + <message> + <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+184"/> + <location line="+18"/> + <location line="+39"/> + <location line="+18"/> + <location line="+30"/> + <source>Bookmarks</source> + <translation>Könyvjelzők</translation> + </message> + <message> + <location filename="../tools/assistant/tools/assistant/bookmarkdialog.ui"/> + <source>+</source> + <translation>+</translation> + </message> + <message> + <location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="-61"/> + <source>Delete Folder</source> + <translation>Dosszié törlése</translation> + </message> + <message> + <location line="+1"/> + <source>Rename Folder</source> + <translation>Dosszié átnevezése</translation> + </message> +</context> +<context> + <name>BookmarkManager</name> + <message> + <location line="+435"/> + <source>Bookmarks</source> + <translation>Könyvjelzők</translation> + </message> + <message> + <location line="+37"/> + <source>Remove</source> + <translation>Áthelyezés</translation> + </message> + <message> + <location line="+1"/> + <source>You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue?</source> + <translation>Egy olyan dossziét fog törölni, ami <br> törli annak tartalmát is. Biztos benne, hogy folytatja?</translation> + </message> + <message> + <location line="+143"/> + <location line="+9"/> + <source>New Folder</source> + <translation>Új Dosszié</translation> + </message> +</context> +<context> + <name>BookmarkWidget</name> + <message> + <location line="-417"/> + <source>Filter:</source> + <translation>Szűrő:</translation> + </message> + <message> + <location line="+33"/> + <source>Remove</source> + <translation>Eltávolítás</translation> + </message> + <message> + <location line="-79"/> + <source>Delete Folder</source> + <translation>Dosszié törlése</translation> + </message> + <message> + <location line="+1"/> + <source>Rename Folder</source> + <translation>Dosszié átnevezése</translation> + </message> + <message> + <location line="+2"/> + <source>Show Bookmark</source> + <translation>Könyvjelző megjelenítése</translation> + </message> + <message> + <location line="+1"/> + <source>Show Bookmark in New Tab</source> + <translation>Könyvjelző megjelenítése új lapon</translation> + </message> + <message> + <location line="+3"/> + <source>Delete Bookmark</source> + <translation>Könyvjelző törlése</translation> + </message> + <message> + <location line="+1"/> + <source>Rename Bookmark</source> + <translation>Könyvjelző átnevezése</translation> + </message> + <message> + <location line="+62"/> + <source>Add</source> + <translation>Hozzáadás</translation> + </message> +</context> +<context> + <name>CentralWidget</name> + <message> + <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="+239"/> + <source>Add new page</source> + <translation>Új lap hozzáadása</translation> + </message> + <message> + <location line="+9"/> + <source>Close current page</source> + <translation>Aktuális lap bezárása</translation> + </message> + <message> + <location line="+312"/> + <source>Print Document</source> + <translation>Dokumentum nyomtatása</translation> + </message> + <message> + <location line="+130"/> + <location line="+2"/> + <source>unknown</source> + <translation>ismeretlen</translation> + </message> + <message> + <location line="+93"/> + <source>Add New Page</source> + <translation>Új lap hozzáadása</translation> + </message> + <message> + <location line="+3"/> + <source>Close This Page</source> + <translation>Lap bezárása</translation> + </message> + <message> + <location line="+3"/> + <source>Close Other Pages</source> + <translation>Többi lap bezárása</translation> + </message> + <message> + <location line="+5"/> + <source>Add Bookmark for this Page...</source> + <translation>Könyvjelző hozzáadása ehhez a laphoz...</translation> + </message> + <message> + <location line="+235"/> + <source>Search</source> + <translation>Keresés</translation> + </message> +</context> +<context> + <name>ContentWindow</name> + <message> + <location filename="../tools/assistant/tools/assistant/contentwindow.cpp" line="+158"/> + <source>Open Link</source> + <translation>Link megnyitása</translation> + </message> + <message> + <location line="+1"/> + <source>Open Link in New Tab</source> + <translation>Link megnyitása új lapon</translation> + </message> +</context> +<context> + <name>FilterNameDialogClass</name> + <message> + <location filename="../tools/assistant/tools/assistant/filternamedialog.ui"/> + <source>Add Filter Name</source> + <translation>Szűrő név hozzáadása</translation> + </message> + <message> + <location/> + <source>Filter Name:</source> + <translation>Szűrő név:</translation> + </message> +</context> +<context> + <name>FindWidget</name> + <message> + <location filename="../tools/assistant/tools/assistant/centralwidget.cpp" line="-918"/> + <source>Previous</source> + <translation>Előző</translation> + </message> + <message> + <location line="+4"/> + <source>Next</source> + <translation>Következő</translation> + </message> + <message> + <location line="+4"/> + <source>Case Sensitive</source> + <translation>Kis és nagybetű érzékeny</translation> + </message> + <message> + <location line="+3"/> + <source>Whole words</source> + <translation>Egész szavakat</translation> + </message> + <message> + <location line="+12"/> + <source><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped</source> + <translation><img src=":/trolltech/assistant/images/wrap.png">&nbsp;Keresés tördelése</translation> + </message> +</context> +<context> + <name>FontPanel</name> + <message> + <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/> + <source>Font</source> + <translation>Betű</translation> + </message> + <message> + <location line="+11"/> + <source>&Writing system</source> + <translation>Rendszer &írása</translation> + </message> + <message> + <location line="+3"/> + <source>&Family</source> + <translation>&Család</translation> + </message> + <message> + <location line="+4"/> + <source>&Style</source> + <translation>&Stílus</translation> + </message> + <message> + <location line="+4"/> + <source>&Point size</source> + <translation>&Pont méret</translation> + </message> +</context> +<context> + <name>HelpViewer</name> + <message> + <location filename="../tools/assistant/tools/assistant/helpviewer.cpp" line="+489"/> + <source>Help</source> + <translation>Segítség</translation> + </message> + <message> + <location line="+1"/> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <location line="-62"/> + <source><title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div></source> + <translation><title>404-es hiba...</title><div align="center"><br><br><h1>A lap nem található </h1><br><h3>'%1'</h3></div></translation> + </message> + <message> + <location line="+125"/> + <source>Copy &Link Location</source> + <translation>&Link címének másolása</translation> + </message> + <message> + <location line="+3"/> + <source>Open Link in New Tab Ctrl+LMB</source> + <translation>Link megnyitása új lapon Ctrl+LMB</translation> + </message> + <message> + <location line="-275"/> + <source>Open Link in New Tab</source> + <translation>Link megnyitása új lapon</translation> + </message> + <message> + <location line="+209"/> + <source>Unable to launch external application. +</source> + <translation>Nem lehet külső alkalmazást indítani.</translation> + </message> +</context> +<context> + <name>IndexWindow</name> + <message> + <location filename="../tools/assistant/tools/assistant/indexwindow.cpp" line="+66"/> + <source>&Look for:</source> + <translation>&Keresés:</translation> + </message> + <message> + <location line="+68"/> + <source>Open Link</source> + <translation>Link megnyitása</translation> + </message> + <message> + <location line="+1"/> + <source>Open Link in New Tab</source> + <translation>Link megnyitása új lapon</translation> + </message> +</context> +<context> + <name>InstallDialog</name> + <message> + <location filename="../tools/assistant/tools/assistant/installdialog.ui"/> + <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+76"/> + <source>Install Documentation</source> + <translation></translation> + </message> + <message> + <location filename="../tools/assistant/tools/assistant/installdialog.cpp" line="+30"/> + <source>Downloading documentation info...</source> + <translation>Dokumentum információ letöltése...</translation> + </message> + <message> + <location line="+48"/> + <source>Download canceled.</source> + <translation>Letöltés vmegszakítva.</translation> + </message> + <message> + <location line="+26"/> + <location line="+78"/> + <location line="+27"/> + <source>Done.</source> + <translation>Kész.</translation> + </message> + <message> + <location line="-90"/> + <source>The file %1 already exists. Do you want to overwrite it?</source> + <translation>A(z) %1 fájl már létezik. Felül szeretné írni?</translation> + </message> + <message> + <location line="+11"/> + <source>Unable to save the file %1: %2.</source> + <translation>Nem lehet elmenteni a(z) %1 fájlt: %2.</translation> + </message> + <message> + <location line="+8"/> + <source>Downloading %1...</source> + <translation>%1 letöltése...</translation> + </message> + <message> + <location line="+19"/> + <location line="+42"/> + <location line="+38"/> + <source>Download failed: %1.</source> + <translation>Nem sikerült a letöltés: %1.</translation> + </message> + <message> + <location line="-70"/> + <source>Documentation info file is corrupt!</source> + <translation>Dokumentum információ sérült!</translation> + </message> + <message> + <location line="+37"/> + <source>Download failed: Downloaded file is corrupted.</source> + <translation>Nem sikerült letölteni: A letöltött fájl sérült.</translation> + </message> + <message> + <location line="+2"/> + <source>Installing documentation %1...</source> + <translation>%1 dokumentáció telepítése...</translation> + </message> + <message> + <location line="+22"/> + <source>Error while installing documentation: +%1</source> + <translation>Hiba történt a dokumentáció telepítése közben: %1</translation> + </message> + <message> + <location filename="../tools/assistant/tools/assistant/installdialog.ui"/> + <source>Available Documentation:</source> + <translation>Elérhető dokumentáció:</translation> + </message> + <message> + <location/> + <source>Install</source> + <translation>Telepítés</translation> + </message> + <message> + <location/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location/> + <source>Installation Path:</source> + <translation>Telepítési útvonal:</translation> + </message> + <message> + <location/> + <source>...</source> + <translation>...</translation> + </message> +</context> +<context> + <name>MainWindow</name> + <message> + <location filename="../tools/assistant/tools/assistant/mainwindow.cpp" line="+110"/> + <location line="+383"/> + <source>Index</source> + <translation>Index</translation> + </message> + <message> + <location line="-377"/> + <location line="+375"/> + <source>Contents</source> + <translation>Tartalom</translation> + </message> + <message> + <location line="-370"/> + <location line="+374"/> + <source>Bookmarks</source> + <translation>Könyvjelzők</translation> + </message> + <message> + <location line="+2"/> + <source>Search</source> + <translation>Keresés</translation> + </message> + <message> + <location line="-364"/> + <location line="+207"/> + <location line="+514"/> + <source>Qt Assistant</source> + <translation>Qt Assistant</translation> + </message> + <message> + <location line="-546"/> + <location line="+5"/> + <source>Unfiltered</source> + <translation>Szűrés nélküli</translation> + </message> + <message> + <location line="+107"/> + <source>Page Set&up...</source> + <translation>Lap Beállí&tás...</translation> + </message> + <message> + <location line="+2"/> + <source>Print Preview...</source> + <translation>Nyomtatási előnézet...</translation> + </message> + <message> + <location line="+3"/> + <source>&Print...</source> + <translation>&Nyomtatás...</translation> + </message> + <message> + <location line="+7"/> + <source>New &Tab</source> + <translation>Új &Lap</translation> + </message> + <message> + <location line="+3"/> + <source>&Close Tab</source> + <translation>Lap &bezárása</translation> + </message> + <message> + <location line="+4"/> + <source>&Quit</source> + <translation>&Kilépés</translation> + </message> + <message> + <location line="+5"/> + <source>&Copy selected Text</source> + <translation>Kiválasztott szöveg &másolása</translation> + </message> + <message> + <location line="+8"/> + <source>&Find in Text...</source> + <translation>&Keresés szövegben...</translation> + </message> + <message> + <location line="+2"/> + <source>&Find</source> + <translation>&Keresés</translation> + </message> + <message> + <location line="+4"/> + <source>Find &Next</source> + <translation>&Következő keresés</translation> + </message> + <message> + <location line="+4"/> + <source>Find &Previous</source> + <translation>&Előző keresés</translation> + </message> + <message> + <location line="+5"/> + <source>Preferences...</source> + <translation>Beállítások...</translation> + </message> + <message> + <location line="+4"/> + <source>Zoom &in</source> + <translation>&Nagyítás</translation> + </message> + <message> + <location line="+6"/> + <source>Zoom &out</source> + <translation>&Kicsinyítés</translation> + </message> + <message> + <location line="+6"/> + <source>Normal &Size</source> + <translation>Normál &méret</translation> + </message> + <message> + <location line="+4"/> + <source>Ctrl+0</source> + <translation>Ctrl + 0</translation> + </message> + <message> + <location line="+5"/> + <source>ALT+C</source> + <translation>ALT + C</translation> + </message> + <message> + <location line="+2"/> + <source>ALT+I</source> + <translation>ALT + l</translation> + </message> + <message> + <location line="+4"/> + <source>ALT+S</source> + <translation>ALT + S</translation> + </message> + <message> + <location line="+3"/> + <source>&Home</source> + <translation>&Otthon</translation> + </message> + <message> + <location line="+4"/> + <source>&Back</source> + <translation>&Vissza</translation> + </message> + <message> + <location line="+5"/> + <source>&Forward</source> + <translation>&Előre</translation> + </message> + <message> + <location line="+6"/> + <source>Sync with Table of Contents</source> + <translation>Tartalomjegyzékkel való szinkronizálás</translation> + </message> + <message> + <location line="+2"/> + <source>Sync</source> + <translation>Szinkronizálás</translation> + </message> + <message> + <location line="+5"/> + <source>Next Page</source> + <translation>Következő lap</translation> + </message> + <message> + <location line="+1"/> + <source>Ctrl+Alt+Right</source> + <translation>Ctrl+Alt+Right</translation> + </message> + <message> + <location line="+3"/> + <source>Previous Page</source> + <translation>Előző lap</translation> + </message> + <message> + <location line="+1"/> + <source>Ctrl+Alt+Left</source> + <translation>Ctrl+Alt+Left</translation> + </message> + <message> + <location line="+4"/> + <source>Add Bookmark...</source> + <translation>Könyvjelző hozzáadása...</translation> + </message> + <message> + <location line="+5"/> + <source>About...</source> + <translation>Névjegy...</translation> + </message> + <message> + <location line="+16"/> + <source>Navigation Toolbar</source> + <translation>Navigációs eszköztár</translation> + </message> + <message> + <location line="+76"/> + <source>Toolbars</source> + <translation>Eszköztár</translation> + </message> + <message> + <location line="+15"/> + <source>Filter Toolbar</source> + <translation>Eszköztár szűrő</translation> + </message> + <message> + <location line="+2"/> + <source>Filtered by:</source> + <translation>Szűrési feltétel:</translation> + </message> + <message> + <location line="+25"/> + <source>Address Toolbar</source> + <translation>Eszköztár cím</translation> + </message> + <message> + <location line="+4"/> + <source>Address:</source> + <translation>Cím:</translation> + </message> + <message> + <location line="+114"/> + <source>Could not find the associated content item.</source> + <translation>Nem sikerült az összekapcsolt tartalom elemet megtalálni.</translation> + </message> + <message> + <location line="+71"/> + <source>About %1</source> + <translation>%1-ről</translation> + </message> + <message> + <location line="+114"/> + <source>Updating search index</source> + <translation>Keresési index frissítése</translation> + </message> + <message> + <location line="-640"/> + <source>Looking for Qt Documentation...</source> + <translation>Qt dokumentáció keresése...</translation> + </message> + <message> + <location line="+241"/> + <source>&Window</source> + <translation>&Ablak</translation> + </message> + <message> + <location line="+3"/> + <source>Minimize</source> + <translation>Minimalizálás</translation> + </message> + <message> + <location line="+1"/> + <source>Ctrl+M</source> + <translation>Ctrl + M</translation> + </message> + <message> + <location line="-2"/> + <source>Zoom</source> + <translation>Zoomolás</translation> + </message> + <message> + <location line="-159"/> + <source>&File</source> + <translation>&Fájl</translation> + </message> + <message> + <location line="+25"/> + <source>&Edit</source> + <translation>&Szerkesztés</translation> + </message> + <message> + <location line="+27"/> + <source>&View</source> + <translation>&Nézet</translation> + </message> + <message> + <location line="+30"/> + <source>&Go</source> + <translation>&Gyerünk</translation> + </message> + <message> + <location line="+2"/> + <source>ALT+Home</source> + <translation>ALT+Home</translation> + </message> + <message> + <location line="+29"/> + <source>&Bookmarks</source> + <translation>&Könyvjelzők</translation> + </message> + <message> + <location line="+5"/> + <source>&Help</source> + <translation>&Segítség</translation> + </message> + <message> + <location line="-40"/> + <source>ALT+O</source> + <translation>ALT + 0</translation> + </message> + <message> + <location line="+38"/> + <source>CTRL+D</source> + <translation>CTRL+D</translation> + </message> +</context> +<context> + <name>PreferencesDialog</name> + <message> + <location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="+259"/> + <location line="+43"/> + <source>Add Documentation</source> + <translation>Dokumentáció hozzáadása</translation> + </message> + <message> + <location line="-43"/> + <source>Qt Compressed Help Files (*.qch)</source> + <translation>Qt tömörített súgó fájlok (*.qch)</translation> + </message> + <message> + <location line="+37"/> + <source>The specified file is not a valid Qt Help File!</source> + <translation>A meghatározott fájl egy érvénytelen Qt Súgó fájl!</translation> + </message> + <message> + <location line="-8"/> + <source>The namespace %1 is already registered!</source> + <translation>A(z) %1 névtér már regisztrálva van!</translation> + </message> + <message> + <location line="+31"/> + <source>Remove Documentation</source> + <translation>Dokumentáció eltávolítása</translation> + </message> + <message> + <location line="+1"/> + <source>Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents.</source> + <translation>Néhány dokumentum jelenleg az Assistant hivatkozásban lett megnyitva, amely az a dokumentum, amit megpróbál eltávolítani. A dokumentum eltávolítása be fogja zárni azokat a dokumentumokat.</translation> + </message> + <message> + <location line="+2"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location line="+1"/> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <location line="+88"/> + <source>Use custom settings</source> + <translation>Szokásos beállítások használata</translation> + </message> +</context> +<context> + <name>PreferencesDialogClass</name> + <message> + <location filename="../tools/assistant/tools/assistant/preferencesdialog.ui"/> + <source>Preferences</source> + <translation>Beállítások</translation> + </message> + <message> + <location/> + <source>Fonts</source> + <translation>Betűk</translation> + </message> + <message> + <location/> + <source>Font settings:</source> + <translation>Betű beállítások:</translation> + </message> + <message> + <location/> + <source>Browser</source> + <translation>Böngésző</translation> + </message> + <message> + <location/> + <source>Application</source> + <translation>Alkalmazás</translation> + </message> + <message> + <location/> + <source>Filters</source> + <translation>Szűrők</translation> + </message> + <message> + <location/> + <source>Filter:</source> + <translation>Szűrők:</translation> + </message> + <message> + <location/> + <source>Attributes:</source> + <translation>Attrubútumok:</translation> + </message> + <message> + <location/> + <source>1</source> + <translation>1</translation> + </message> + <message> + <location/> + <source>Add</source> + <translation>Hozzáadás</translation> + </message> + <message> + <location/> + <source>Remove</source> + <translation>Eltávolítás</translation> + </message> + <message> + <location/> + <source>Documentation</source> + <translation>Dokumentáció</translation> + </message> + <message> + <location/> + <source>Registered Documentation:</source> + <translation>Regisztrált dokumentáció:</translation> + </message> + <message> + <location/> + <source>Add...</source> + <translation>Hozzáadás...</translation> + </message> + <message> + <location/> + <source>Options</source> + <translation>Opciók</translation> + </message> + <message> + <location/> + <source>Current Page</source> + <translation>Aktuális lap</translation> + </message> + <message> + <location/> + <source>Restore to default</source> + <translation>Alapértelmezett beállítások visszaállítása</translation> + </message> + <message> + <location/> + <source>Homepage</source> + <translation>Honlap</translation> + </message> + <message> + <location/> + <source>On help start:</source> + <translation>Súgó indításra:</translation> + </message> + <message> + <location/> + <source>Show my home page</source> + <translation>Honlapom megjelenítése</translation> + </message> + <message> + <location/> + <source>Show a blank page</source> + <translation>Egy üres lap megjelenítése</translation> + </message> + <message> + <location/> + <source>Show my tabs from last session</source> + <translation>A lapjaim megjelenításe a legutolsó szakaszból</translation> + </message> + <message> + <location/> + <source>Blank Page</source> + <translation>Üres lap</translation> + </message> +</context> +<context> + <name>QObject</name> + <message> + <location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="+112"/> + <source>The specified collection file does not exist!</source> + <translation>A meghatározott gyűjtemény fájl nem létezik!</translation> + </message> + <message> + <location line="+4"/> + <source>Missing collection file!</source> + <translation>Hiányzó gyűjtemény fájl!</translation> + </message> + <message> + <location line="+9"/> + <source>Invalid URL!</source> + <translation>Érvénytelen URL!</translation> + </message> + <message> + <location line="+4"/> + <source>Missing URL!</source> + <translation>Hiányzó URL!</translation> + </message> + <message> + <location line="+17"/> + <location line="+19"/> + <location line="+19"/> + <source>Unknown widget: %1</source> + <translation>Ismeretlen widget: %1</translation> + </message> + <message> + <location line="-34"/> + <location line="+19"/> + <location line="+19"/> + <source>Missing widget!</source> + <translation>Hiányzó widget!</translation> + </message> + <message> + <location line="+7"/> + <location line="+12"/> + <source>The specified Qt help file does not exist!</source> + <translation>A meghatározott Qt súgó fájl nem létezik!</translation> + </message> + <message> + <location line="-7"/> + <location line="+12"/> + <source>Missing help file!</source> + <translation>Hiányzó súgó fájl!</translation> + </message> + <message> + <location line="+7"/> + <source>Missing filter argument!</source> + <translation>Hiányzó szűrő argumentum!</translation> + </message> + <message> + <location line="+12"/> + <source>Unknown option: %1</source> + <translation>Ismeretlen opció: %1</translation> + </message> + <message> + <location line="+30"/> + <location line="+2"/> + <source>Qt Assistant</source> + <translation>Qt Assistant</translation> + </message> + <message> + <location filename="../tools/assistant/tools/assistant/main.cpp" line="+225"/> + <source>Could not register documentation file +%1 + +Reason: +%2</source> + <translation>Nem sikerült a dokumentációs fájl regisztrálása +%1 + +Ok: +%2</translation> + </message> + <message> + <location line="+4"/> + <source>Documentation successfully registered.</source> + <translation>A dokumentáció regisztrálása sikeresen megtörtént.</translation> + </message> + <message> + <location line="+11"/> + <source>Could not unregister documentation file +%1 + +Reason: +%2</source> + <translation>Nem sikerült regisztrálni a dokumentációs fájlt +%1 + +Ok: +%2</translation> + </message> + <message> + <location line="-3"/> + <source>Documentation successfully unregistered.</source> + <translation>Dokumentáció regisztrációjának megszűntetése sikeresen megtörtént.</translation> + </message> + <message> + <location line="+40"/> + <source>Cannot load sqlite database driver!</source> + <translation>Nem lehet betölteni az sqlite adatbázis vezérlőt!</translation> + </message> + <message> + <location line="+9"/> + <source>The specified collection file could not be read!</source> + <translation>A meghatározott gyűjtemény fájlt nem lehet olvasni!</translation> + </message> +</context> +<context> + <name>RemoteControl</name> + <message> + <location filename="../tools/assistant/tools/assistant/remotecontrol.cpp" line="+163"/> + <source>Debugging Remote Control</source> + <translation>Debuggolás Távoli Vezérlő</translation> + </message> + <message> + <location line="+1"/> + <source>Received Command: %1 %2</source> + <translation>Elfogadott parancs: %1 %2</translation> + </message> +</context> +<context> + <name>SearchWidget</name> + <message> + <location filename="../tools/assistant/tools/assistant/searchwidget.cpp" line="+196"/> + <source>&Copy</source> + <translation>&Másolás</translation> + </message> + <message> + <location line="+4"/> + <source>Copy &Link Location</source> + <translation>&Link címének másolása</translation> + </message> + <message> + <location line="+4"/> + <source>Open Link in New Tab</source> + <translation>Link megnyitása új lapon</translation> + </message> + <message> + <location line="+8"/> + <source>Select All</source> + <translation>Az összes kiválasztása</translation> + </message> +</context> +<context> + <name>TopicChooser</name> + <message> + <location filename="../tools/assistant/tools/assistant/topicchooser.cpp" line="+54"/> + <source>Choose a topic for <b>%1</b>:</source> + <translation>Topik választása a következőhöz: <b>%1</b>:</translation> + </message> + <message> + <location filename="../tools/assistant/tools/assistant/topicchooser.ui"/> + <source>Choose Topic</source> + <translation>Topik választása</translation> + </message> + <message> + <location/> + <source>&Topics</source> + <translation>&Topikok</translation> + </message> + <message> + <location/> + <source>&Display</source> + <translation>&Kijelzés</translation> + </message> + <message> + <location/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> +</context> +</TS> diff --git a/translations/designer_hu.ts b/translations/designer_hu.ts new file mode 100644 index 0000000..c2960bc --- /dev/null +++ b/translations/designer_hu.ts @@ -0,0 +1,7023 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="hu"> +<context> + <name>AbstractFindWidget</name> + <message> + <location filename="../tools/shared/findwidget/abstractfindwidget.cpp" line="+127"/> + <source>&Previous</source> + <translation>&Előző</translation> + </message> + <message> + <location line="+8"/> + <source>&Next</source> + <translation>&Következő</translation> + </message> + <message> + <location line="+24"/> + <source>&Case sensitive</source> + <translation>&Kis ér nagybetű érzékeny</translation> + </message> + <message> + <location line="+8"/> + <source>Whole &words</source> + <translation>Egész &szavakat</translation> + </message> + <message> + <location line="+12"/> + <source><img src=":/trolltech/shared/images/wrap.png">&nbsp;Search wrapped</source> + <translation><img src=":/trolltech/shared/images/wrap.png">&nbsp;Keresés tördelve</translation> + </message> +</context> +<context> + <name>AddLinkDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/addlinkdialog.ui" line="+5"/> + <source>Insert Link</source> + <translation>Link beszúrása</translation> + </message> + <message> + <location line="+14"/> + <source>Title:</source> + <translation>Cím:</translation> + </message> + <message> + <location line="+17"/> + <source>URL:</source> + <translation>URL:</translation> + </message> +</context> +<context> + <name>AppFontDialog</name> + <message> + <location filename="../tools/designer/src/designer/appfontdialog.cpp" line="+418"/> + <source>Additional Fonts</source> + <translation>További betűl</translation> + </message> +</context> +<context> + <name>AppFontManager</name> + <message> + <location line="-267"/> + <source>'%1' is not a file.</source> + <translation>%1 nem egy fájl.</translation> + </message> + <message> + <location line="+4"/> + <source>The font file '%1' does not have read permissions.</source> + <translation>'%1' betű fájlnak nincsen olvasási engedélye.</translation> + </message> + <message> + <location line="+8"/> + <source>The font file '%1' is already loaded.</source> + <translation>'%1' font fájl már be van töltve.</translation> + </message> + <message> + <location line="+7"/> + <source>The font file '%1' could not be loaded.</source> + <translation>'%1' font fájlt nem sikerült betölteni.</translation> + </message> + <message> + <location line="+17"/> + <source>'%1' is not a valid font id.</source> + <translation>'%1' nem egy érvényes betű azonosító.</translation> + </message> + <message> + <location line="+11"/> + <source>There is no loaded font matching the id '%1'.</source> + <translation>Nincsen '%1' azonosítóval megegyező betöltött betű.</translation> + </message> + <message> + <location line="+15"/> + <source>The font '%1' (%2) could not be unloaded.</source> + <translation>'%1' betűt (%2) nem lehetett kirakni.</translation> + </message> +</context> +<context> + <name>AppFontWidget</name> + <message> + <location line="+26"/> + <source>Fonts</source> + <translation>Betűk</translation> + </message> + <message> + <location line="+58"/> + <source>Add font files</source> + <translation>Betű fájlok hozzáadása</translation> + </message> + <message> + <location line="+5"/> + <source>Remove current font file</source> + <translation>Aktuális betű fájl eltávolítása</translation> + </message> + <message> + <location line="+4"/> + <source>Remove all font files</source> + <translation>Az összes betű fájl eltávolítása</translation> + </message> + <message> + <location line="+19"/> + <source>Add Font Files</source> + <translation>Betű fájlok hozzáadása</translation> + </message> + <message> + <location line="+1"/> + <source>Font files (*.ttf)</source> + <translation>Betű fájlok (*.ttf)</translation> + </message> + <message> + <location line="+13"/> + <source>Error Adding Fonts</source> + <translation>Hiba történt a betűk hozzáadásakor</translation> + </message> + <message> + <location line="+24"/> + <source>Error Removing Fonts</source> + <translation>Hiba történt a betűk eltávolításakor</translation> + </message> + <message> + <location line="+22"/> + <source>Remove Fonts</source> + <translation>Betűk eltávolítása</translation> + </message> + <message> + <location line="+0"/> + <source>Would you like to remove all fonts?</source> + <translation>El szeretné távolítani az összes betűt?</translation> + </message> +</context> +<context> + <name>AppearanceOptionsWidget</name> + <message> + <location filename="../tools/designer/src/designer/qdesigner_appearanceoptions.ui" line="+14"/> + <source>Form</source> + <translation></translation> + </message> + <message> + <location line="+6"/> + <source>User Interface Mode</source> + <translation>Felhasználói interfész mód</translation> + </message> +</context> +<context> + <name>AssistantClient</name> + <message> + <location filename="../tools/designer/src/designer/assistantclient.cpp" line="+100"/> + <source>Unable to send request: Assistant is not responding.</source> + <translation>Nem lehet elküldeni a kérést, az Assistant nem válaszol.</translation> + </message> + <message> + <location line="+39"/> + <source>The binary '%1' does not exist.</source> + <translation>'%1' bináris nem létezik.</translation> + </message> + <message> + <location line="+9"/> + <source>Unable to launch assistant (%1).</source> + <translation>Nem lehet elindítani a(z) %1 assistant.</translation> + </message> +</context> +<context> + <name>BrushPropertyManager</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/brushpropertymanager.cpp" line="+52"/> + <source>No brush</source> + <translation>Nincs kefe</translation> + </message> + <message> + <location line="+1"/> + <source>Solid</source> + <translation>Szolid</translation> + </message> + <message> + <location line="+1"/> + <source>Dense 1</source> + <translation>Sűrű 1</translation> + </message> + <message> + <location line="+1"/> + <source>Dense 2</source> + <translation>Sűrű 2</translation> + </message> + <message> + <location line="+1"/> + <source>Dense 3</source> + <translation>Sűrű 3</translation> + </message> + <message> + <location line="+1"/> + <source>Dense 4</source> + <translation>Sűrű 4</translation> + </message> + <message> + <location line="+1"/> + <source>Dense 5</source> + <translation>Sűrű 5</translation> + </message> + <message> + <location line="+1"/> + <source>Dense 6</source> + <translation>Sűrű 6</translation> + </message> + <message> + <location line="+1"/> + <source>Dense 7</source> + <translation>Sűrű 7</translation> + </message> + <message> + <location line="+1"/> + <source>Horizontal</source> + <translation>Horizontális</translation> + </message> + <message> + <location line="+1"/> + <source>Vertical</source> + <translation>Vertikális</translation> + </message> + <message> + <location line="+1"/> + <source>Cross</source> + <translation>Kereszt</translation> + </message> + <message> + <location line="+1"/> + <source>Backward diagonal</source> + <translation>Visszafele átlós</translation> + </message> + <message> + <location line="+1"/> + <source>Forward diagonal</source> + <translation>Előre átlós</translation> + </message> + <message> + <location line="+1"/> + <source>Crossing diagonal</source> + <translation>Kereszt átlós</translation> + </message> + <message> + <location line="+83"/> + <source>Style</source> + <translation>Stílus</translation> + </message> + <message> + <location line="+11"/> + <source>Color</source> + <translation>Szín</translation> + </message> + <message> + <location line="+105"/> + <source>[%1, %2]</source> + <translation>[%1, %2]</translation> + </message> +</context> +<context> + <name>Command</name> + <message> + <location filename="../tools/designer/src/components/signalsloteditor/signalsloteditor.cpp" line="+208"/> + <location line="+258"/> + <source>Change signal</source> + <translation>Jel változtatás</translation> + </message> + <message> + <location line="-256"/> + <location line="+268"/> + <source>Change slot</source> + <translation>Szlot változtatás</translation> + </message> + <message> + <location line="-220"/> + <source>Change signal-slot connection</source> + <translation>Jel szlot kapcsolat változtatása</translation> + </message> + <message> + <location line="+234"/> + <source>Change sender</source> + <translation>Küldő változtatás</translation> + </message> + <message> + <location line="+18"/> + <source>Change receiver</source> + <translation>Fogadó változtatás</translation> + </message> + <message> + <location filename="../tools/designer/src/components/taskmenu/button_taskmenu.cpp" line="+221"/> + <source>Create button group</source> + <translation>Gomb csoport létrehozása</translation> + </message> + <message> + <location line="+27"/> + <source>Break button group</source> + <translation>Gomb csoport törése</translation> + </message> + <message> + <location line="+9"/> + <source>Break button group '%1'</source> + <translation>'%1' gomb csoport törése</translation> + </message> + <message> + <location line="+17"/> + <source>Add buttons to group</source> + <translation>Gomb hozzáadása a csoporthoz</translation> + </message> + <message> + <location line="+8"/> + <location filename="../tools/designer/src/lib/shared/formlayoutmenu.cpp" line="+458"/> + <source>Add '%1' to '%2'</source> + <extracomment>Command description for adding buttons to a QButtonGroup</extracomment> + <translation>'%1' hozzáadása '%2'-höz</translation> + </message> + <message> + <location line="+14"/> + <source>Remove buttons from group</source> + <translation>Gomb eltávolítása a csoportból</translation> + </message> + <message> + <location line="+15"/> + <source>Remove '%1' from '%2'</source> + <extracomment>Command description for removing buttons from a QButtonGroup</extracomment> + <translation>'%1' eltávolítása '%2'-ból</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/connectionedit.cpp" line="+143"/> + <source>Add connection</source> + <translation>Kapcsolat hozzáadása</translation> + </message> + <message> + <location line="+54"/> + <source>Adjust connection</source> + <translation>Kapcsolat beállítása</translation> + </message> + <message> + <location line="+19"/> + <source>Delete connections</source> + <translation>Kapcsolatok törlése</translation> + </message> + <message> + <location line="+58"/> + <source>Change source</source> + <translation>Forrás változtatása</translation> + </message> + <message> + <location line="+2"/> + <source>Change target</source> + <translation>Cél változtatása</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/morphmenu.cpp" line="+349"/> + <source>Morph %1/'%2' into %3</source> + <extracomment>MorphWidgetCommand description</extracomment> + <translation>%1/'%2' alakváltoztatása %3-re</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_command.cpp" line="+149"/> + <source>Insert '%1'</source> + <translation>'%1' beszúrása</translation> + </message> + <message> + <location line="+133"/> + <source>Change Z-order of '%1'</source> + <translation>'%1' Z sorrendjének megváltoztatása</translation> + </message> + <message> + <location line="+34"/> + <source>Raise '%1'</source> + <translation>'%1' növelése</translation> + </message> + <message> + <location line="+33"/> + <source>Lower '%1'</source> + <translation>Alsó '%1'</translation> + </message> + <message> + <location line="+113"/> + <source>Delete '%1'</source> + <translation>'%1' törlése</translation> + </message> + <message> + <location line="+119"/> + <source>Reparent '%1'</source> + <translation>'%1' újra szülősítése</translation> + </message> + <message> + <location line="+53"/> + <source>Promote to custom widget</source> + <translation>Egyéni widget elősegítése</translation> + </message> + <message> + <location line="+42"/> + <source>Demote from custom widget</source> + <translation>Egyéni widget lefokozása</translation> + </message> + <message> + <location line="+79"/> + <source>Lay out using grid</source> + <translation>Tervraj rácsok használatával</translation> + </message> + <message> + <location line="+3"/> + <source>Lay out vertically</source> + <translation>Tervrajz vertikálisan</translation> + </message> + <message> + <location line="+3"/> + <source>Lay out horizontally</source> + <translation>Tervrajz horizontálisan</translation> + </message> + <message> + <location line="+41"/> + <source>Break layout</source> + <translation>Tervrajz törése</translation> + </message> + <message> + <location line="+105"/> + <source>Simplify Grid Layout</source> + <translation>Egyszerűsített rács tervrajz</translation> + </message> + <message> + <location line="+135"/> + <location line="+235"/> + <location line="+78"/> + <source>Move Page</source> + <translation>Lap mozgatása</translation> + </message> + <message> + <location line="-279"/> + <location line="+123"/> + <location line="+188"/> + <location line="+666"/> + <source>Delete Page</source> + <translation>Lap törlése</translation> + </message> + <message> + <location line="-939"/> + <location line="+123"/> + <source>Page</source> + <translation>Lap</translation> + </message> + <message> + <location line="+860"/> + <source>page</source> + <translation>lap</translation> + </message> + <message> + <location line="-978"/> + <location line="+123"/> + <location line="+186"/> + <location line="+667"/> + <source>Insert Page</source> + <translation>Lap beszúrása</translation> + </message> + <message> + <location line="-647"/> + <source>Change Tab order</source> + <translation>Tab sorrend változtatása</translation> + </message> + <message> + <location line="+28"/> + <source>Create Menu Bar</source> + <translation>Menü sáv</translation> + </message> + <message> + <location line="+44"/> + <source>Delete Menu Bar</source> + <translation>Menü sáv törlése</translation> + </message> + <message> + <location line="+47"/> + <source>Create Status Bar</source> + <translation>Státusz sáv létrehozása</translation> + </message> + <message> + <location line="+42"/> + <source>Delete Status Bar</source> + <translation>Státusz sáv törlése</translation> + </message> + <message> + <location line="+45"/> + <source>Add Tool Bar</source> + <translation>Eszköz sáv hozzáadása</translation> + </message> + <message> + <location line="+59"/> + <source>Add Dock Window</source> + <translation>Dokk ablak hozzáadása</translation> + </message> + <message> + <location line="+53"/> + <source>Adjust Size of '%1'</source> + <translation>'%1' méretének igazítása</translation> + </message> + <message> + <location line="+57"/> + <source>Change Form Layout Item Geometry</source> + <translation>Űrlap tervrajz elem geometriájának megváltoztatása</translation> + </message> + <message> + <location line="+95"/> + <source>Change Layout Item Geometry</source> + <translation>Tervrajz elem geometriájának megváltoztatása</translation> + </message> + <message> + <location line="+138"/> + <source>Delete Subwindow</source> + <translation>Alablak törlése</translation> + </message> + <message> + <location line="+44"/> + <source>Insert Subwindow</source> + <translation>Alablak beszúrása</translation> + </message> + <message> + <location line="+2"/> + <source>subwindow</source> + <translation>alablak</translation> + </message> + <message> + <location line="+1"/> + <source>Subwindow</source> + <translation>Alablak</translation> + </message> + <message> + <location line="+391"/> + <source>Change Table Contents</source> + <translation>Táblázat tartalom megváltoztatása</translation> + </message> + <message> + <location line="+107"/> + <source>Change Tree Contents</source> + <translation>Fa tartalom megváltoztatása</translation> + </message> + <message> + <location line="+74"/> + <location line="+146"/> + <source>Add action</source> + <translation>Tevékenység hozzáadása</translation> + </message> + <message> + <location line="-120"/> + <location line="+126"/> + <source>Remove action</source> + <translation>Tevékenység eltávolítása</translation> + </message> + <message> + <location line="+53"/> + <source>Add menu</source> + <translation>Menü hozzáadása</translation> + </message> + <message> + <location line="+6"/> + <source>Remove menu</source> + <translation>Menü eltávolítása</translation> + </message> + <message> + <location line="+6"/> + <source>Create submenu</source> + <translation>Almenü létrehozása</translation> + </message> + <message> + <location line="+31"/> + <source>Delete Tool Bar</source> + <translation>Eszköz sáv törlése</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_command2.cpp" line="+154"/> + <source>Change layout of '%1' from %2 to %3</source> + <translation>'%1' tervrajz megváltoztatása %2-ről %3-ra</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_menu.cpp" line="+1195"/> + <source>Set action text</source> + <translation>Tevékenység szöveg beállítása</translation> + </message> + <message> + <location line="+3"/> + <source>Insert action</source> + <translation>Tevékenység beszúrása</translation> + </message> + <message> + <location line="+89"/> + <location filename="../tools/designer/src/lib/shared/qdesigner_menubar.cpp" line="+907"/> + <source>Move action</source> + <translation>Tevékenység mozgatása</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_menubar.cpp" line="-424"/> + <source>Change Title</source> + <translation>Cím megváltoztatása</translation> + </message> + <message> + <location line="+2"/> + <source>Insert Menu</source> + <translation>Menü beszúrása</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_propertycommand.cpp" line="+1213"/> + <source>Changed '%1' of '%2'</source> + <translation>'%2' '%1'-ének megváltoztatása</translation> + </message> + <message numerus="yes"> + <location line="+3"/> + <source>Changed '%1' of %n objects</source> + <translation> + <numerusform>%n objektum %1-ének megváltoztatása</numerusform> + </translation> + </message> + <message> + <location line="+76"/> + <source>Reset '%1' of '%2'</source> + <translation>'%2' '%1'-ének megváltoztatása</translation> + </message> + <message numerus="yes"> + <location line="+3"/> + <source>Reset '%1' of %n objects</source> + <translation> + <numerusform>%n objektum '%1'-ének újraindítása</numerusform> + </translation> + </message> + <message> + <location line="+89"/> + <source>Add dynamic property '%1' to '%2'</source> + <translation>'%2' '%1' dinamikus tulajdonságának hozzáadása</translation> + </message> + <message numerus="yes"> + <location line="+3"/> + <source>Add dynamic property '%1' to %n objects</source> + <translation> + <numerusform>%n objektum' '%1' dinamikus tulajdonságának hozzáadása</numerusform> + </translation> + </message> + <message> + <location line="+86"/> + <source>Remove dynamic property '%1' from '%2'</source> + <translation>'%1' dinamikus tulajdonság eltávolítáas '%2'-ből</translation> + </message> + <message numerus="yes"> + <location line="+3"/> + <source>Remove dynamic property '%1' from %n objects</source> + <translation> + <numerusform>'%1' dinamikus tulajdonság eltávolítása %n objektumból</numerusform> + </translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/scriptcommand.cpp" line="+55"/> + <source>Change script</source> + <translation>Szkript megváltoztatása</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/signalslotdialog.cpp" line="+202"/> + <source>Change signals/slots</source> + <translation>Jelek/Szlotok megváltoztatása</translation> + </message> +</context> +<context> + <name>ConnectDialog</name> + <message> + <location filename="../tools/designer/src/components/signalsloteditor/connectdialog.ui" line="+13"/> + <source>Configure Connection</source> + <translation>Kapcsolat konfigurálása</translation> + </message> + <message> + <location line="+6"/> + <location line="+40"/> + <source>GroupBox</source> + <translation>CsoportDoboz</translation> + </message> + <message> + <location line="-25"/> + <location line="+40"/> + <source>Edit...</source> + <translation>Szerkesztés...</translation> + </message> + <message> + <location line="+25"/> + <source>Show signals and slots inherited from QWidget</source> + <translation>QWidget-ből örökölt jelek és szlotok megjelenítése</translation> + </message> +</context> +<context> + <name>ConnectionDelegate</name> + <message> + <location filename="../tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp" line="+643"/> + <source><object></source> + <translation><objekttum></translation> + </message> + <message> + <location line="+18"/> + <source><signal></source> + <translation><jel></translation> + </message> + <message> + <location line="+0"/> + <source><slot></source> + <translation><szlot></translation> + </message> +</context> +<context> + <name>DPI_Chooser</name> + <message> + <location filename="../tools/designer/src/components/formeditor/dpi_chooser.cpp" line="+69"/> + <source>Standard (96 x 96)</source> + <extracomment>Embedded device standard screen resolution</extracomment> + <translation>Szabványos (96 x 96)</translation> + </message> + <message> + <location line="+2"/> + <source>Greenphone (179 x 185)</source> + <extracomment>Embedded device screen resolution</extracomment> + <translation>Greenphone (179 x 185)</translation> + </message> + <message> + <location line="+2"/> + <source>High (192 x 192)</source> + <extracomment>Embedded device high definition screen resolution</extracomment> + <translation>Magasság (192 x 192)</translation> + </message> +</context> +<context> + <name>Designer</name> + <message> + <location filename="../tools/designer/src/components/formeditor/qdesigner_resource.cpp" line="+449"/> + <source>Qt Designer</source> + <translation>Qt Designer</translation> + </message> + <message> + <location line="+10"/> + <source>This file contains top level spacers.<br>They have <b>NOT</b> been saved into the form.</source> + <translation>Ez a fájl felső szintű távtartókat tartalmaz.<br> Nem tartalmaznak <b>SEMMIT</b>, ami el lenne mentve az űrlapba.</translation> + </message> + <message> + <location line="+2"/> + <source>Perhaps you forgot to create a layout?</source> + <translation>Talán elfelejtette létrehozni a tervrajzot?</translation> + </message> + <message> + <location line="+173"/> + <source>Invalid UI file: The root element <ui> is missing.</source> + <translation>Érvénytelen UI fájl. A rendszergazda elem <ui> hiányzik.</translation> + </message> + <message> + <location line="+6"/> + <source>An error has occurred while reading the UI file at line %1, column %2: %3</source> + <translation>Hiba történt az UI fájl olvasás közben %1 sorban, %2 oszlopban: %3</translation> + </message> + <message> + <location line="+26"/> + <source>This file cannot be read because it was created using %1.</source> + <translation>A fájl nem olvasható, mert %1 használatával hozták létre.</translation> + </message> + <message> + <location line="+14"/> + <source>This file was created using Designer from Qt-%1 and cannot be read.</source> + <translation>A fájlt a(z) %1 Qt Designer-rel hozták létre és nem olvasható.</translation> + </message> + <message> + <location line="+30"/> + <source>The converted file could not be read.</source> + <translation>A konvertált fájlt nem sikerült olvasni.</translation> + </message> + <message> + <location line="+4"/> + <source>This file was created using Designer from Qt-%1 and will be converted to a new form by Qt Designer.</source> + <translation>A fájlt a(z) %1 Qt Designer-rel hozták létre és a Qt Designer egy új űrlapra fogja konvertálni.</translation> + </message> + <message> + <location line="+3"/> + <source>The old form has not been touched, but you will have to save the form under a new name.</source> + <translation>A régi űrlap nem lett érintve, de az űrlapot új néven kell majd elmentenie.</translation> + </message> + <message> + <location line="+11"/> + <source>This file was created using Designer from Qt-%1 and could not be read: +%2</source> + <translation>A fájl a(z) %1 Qt Designer-rel lett létrehozva és nem olvasható: +%2</translation> + </message> + <message> + <location line="+3"/> + <source>Please run it through <b>uic3&nbsp;-convert</b> to convert it to Qt-4's ui format.</source> + <translation>Kérem futtassa a <br>uic3&nbsp;-convert</b> Qt 4-s ui formára konvertáláshoz.</translation> + </message> + <message> + <location line="+31"/> + <source>This file cannot be read because the extra info extension failed to load.</source> + <translation>Ez a fájl nem olvasható, mert az extra információ kiterjesztést nem sikerült betölteni.</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/qsimpleresource.cpp" line="+339"/> + <source>Custom Widgets</source> + <translation>Egyéni Widgetek</translation> + </message> + <message> + <location line="+12"/> + <source>Promoted Widgets</source> + <translation>Támogatott Widgetek</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_utils.cpp" line="+682"/> + <source>Unable to launch %1.</source> + <translation>Nem lehet elindítani %1-t.</translation> + </message> + <message> + <location line="+4"/> + <source>%1 timed out.</source> + <translation>%1 időtúllépés.</translation> + </message> +</context> +<context> + <name>DesignerMetaEnum</name> + <message> + <location line="-513"/> + <source>%1 is not a valid enumeration value of '%2'.</source> + <translation>%1 nem egy érvényes '%2' felsorolási érték.</translation> + </message> + <message> + <location line="+5"/> + <source>'%1' could not be converted to an enumeration value of type '%2'.</source> + <translation>'%1' nem konvertálható egy '%2' típusú felsorolási értékre.</translation> + </message> +</context> +<context> + <name>DesignerMetaFlags</name> + <message> + <location line="+78"/> + <source>'%1' could not be converted to a flag value of type '%2'.</source> + <translation>'%1' nem konvertálható egy '%2' típusú jelző értékre.</translation> + </message> +</context> +<context> + <name>DeviceProfile</name> + <message> + <location filename="../tools/designer/src/lib/shared/deviceprofile.cpp" line="+397"/> + <source>'%1' is not a number.</source> + <extracomment>Reading a number for an embedded device profile</extracomment> + <translation>'%1' nem egy szám.</translation> + </message> + <message> + <location line="+23"/> + <source>An invalid tag <%1> was encountered.</source> + <translation>Egy érvénytelen címkét <%1> talált.</translation> + </message> +</context> +<context> + <name>DeviceProfileDialog</name> + <message> + <location filename="../tools/designer/src/components/formeditor/deviceprofiledialog.ui" line="+20"/> + <source>&Family</source> + <translation>&Család</translation> + </message> + <message> + <location line="+13"/> + <source>&Point Size</source> + <translation>&Pont méret</translation> + </message> + <message> + <location line="+13"/> + <source>Style</source> + <translation>Stílus</translation> + </message> + <message> + <location line="+13"/> + <source>Device DPI</source> + <translation>Eszköz DPI</translation> + </message> + <message> + <location line="+10"/> + <source>Name</source> + <translation>Név</translation> + </message> +</context> +<context> + <name>DeviceSkin</name> + <message> + <location filename="../tools/shared/deviceskin/deviceskin.cpp" line="+79"/> + <source>The image file '%1' could not be loaded.</source> + <translation>Nem sikerült betölteni a(z) '%1' kép fájlt.</translation> + </message> + <message> + <location line="+64"/> + <source>The skin directory '%1' does not contain a configuration file.</source> + <translation>A(z) '%1' szkin könyvtár nem tartalmaz egy konfigurációs fájlt sem.</translation> + </message> + <message> + <location line="+5"/> + <source>The skin configuration file '%1' could not be opened.</source> + <translation>A(z) '%1' szkin konfigurációs fájlt nem sikerült megnyitni.</translation> + </message> + <message> + <location line="+6"/> + <source>The skin configuration file '%1' could not be read: %2</source> + <translation>A(z) '%1' szkin konfigurációs fájlt nem sikerült olvasni: %2</translation> + </message> + <message> + <location line="+70"/> + <source>Syntax error: %1</source> + <translation>Szintakszis hiba: %1</translation> + </message> + <message> + <location line="+21"/> + <source>The skin "up" image file '%1' does not exist.</source> + <translation>A(z) '%1' szkin 'fel' kép fájl nem létezik.</translation> + </message> + <message> + <location line="+10"/> + <source>The skin "down" image file '%1' does not exist.</source> + <translation>A(z) '%1' szkin 'le' kép fájl nem létezik.</translation> + </message> + <message> + <location line="+11"/> + <source>The skin "closed" image file '%1' does not exist.</source> + <translation>A(z) '%1' szkin 'zárt' kép fájl nem létezik.</translation> + </message> + <message> + <location line="+12"/> + <source>The skin cursor image file '%1' does not exist.</source> + <translation>A(z) '%1' szkin kurzor kép fájl nem létezik.</translation> + </message> + <message> + <location line="+25"/> + <source>Syntax error in area definition: %1</source> + <translation>Szintakszis hiba a terület definícióban: %1</translation> + </message> + <message> + <location line="+38"/> + <source>Mismatch in number of areas, expected %1, got %2.</source> + <translation>Rossz párosítás a területek számában, várt %1, kapot %2.</translation> + </message> +</context> +<context> + <name>EmbeddedOptionsControl</name> + <message> + <location filename="../tools/designer/src/components/formeditor/embeddedoptionspage.cpp" line="+307"/> + <source><html><table><tr><td><b>Font</b></td><td>%1, %2</td></tr><tr><td><b>Style</b></td><td>%3</td></tr><tr><td><b>Resolution</b></td><td>%4 x %5</td></tr></table></html></source> + <extracomment>Format embedded device profile description</extracomment> + <translation><html><table><tr><td><b>Betű</b></td><td>%1, %2</td></tr><tr><td><b>Stílus</b></td><td>%3</td></tr><tr><td><b>Felbontás</b></td><td>%4 x %5</td></tr></table></html></translation> + </message> +</context> +<context> + <name>EmbeddedOptionsPage</name> + <message> + <location line="+103"/> + <source>Embedded Design</source> + <extracomment>Tab in preferences dialog</extracomment> + <translation>Tab a beállítások párbeszéd ablakban</translation> + </message> + <message> + <location line="+10"/> + <source>Device Profiles</source> + <extracomment>EmbeddedOptionsControl group box"</extracomment> + <translation>BeágyazottOpciókVezérlő csoport doboz"</translation> + </message> +</context> +<context> + <name>FontPanel</name> + <message> + <location filename="../tools/shared/fontpanel/fontpanel.cpp" line="+63"/> + <source>Font</source> + <translation>Betű</translation> + </message> + <message> + <location line="+11"/> + <source>&Writing system</source> + <translation>Rendszer &írása</translation> + </message> + <message> + <location line="+3"/> + <source>&Family</source> + <translation>&Család</translation> + </message> + <message> + <location line="+4"/> + <source>&Style</source> + <translation>&Stílus</translation> + </message> + <message> + <location line="+4"/> + <source>&Point size</source> + <translation>&Pont méret</translation> + </message> +</context> +<context> + <name>FontPropertyManager</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/fontpropertymanager.cpp" line="+62"/> + <source>PreferDefault</source> + <translation>AlapértelmezettPreferálása</translation> + </message> + <message> + <location line="+1"/> + <source>NoAntialias</source> + <translation>NincsÁtlapolás</translation> + </message> + <message> + <location line="+1"/> + <source>PreferAntialias</source> + <translation>ÁtlapolásPreferálása</translation> + </message> + <message> + <location line="+61"/> + <source>Antialiasing</source> + <translation>Átlapolás</translation> + </message> +</context> +<context> + <name>FormBuilder</name> + <message> + <location filename="../tools/designer/src/lib/uilib/formbuilderextra.cpp" line="+359"/> + <source>Invalid stretch value for '%1': '%2'</source> + <extracomment>Parsing layout stretch values</extracomment> + <translation>Érvénytelen érték kiterjesztés '%1'-re: '%2'</translation> + </message> + <message> + <location line="+62"/> + <source>Invalid minimum size for '%1': '%2'</source> + <extracomment>Parsing grid layout minimum size values</extracomment> + <translation>Érvénytelen minimum méret '%1'-re: '%2'</translation> + </message> +</context> +<context> + <name>FormEditorOptionsPage</name> + <message> + <location filename="../tools/designer/src/components/formeditor/formeditor_optionspage.cpp" line="+91"/> + <source>%1 %</source> + <translation>%1 %</translation> + </message> + <message> + <location line="+4"/> + <source>Preview Zoom</source> + <translation>Zoom előnézet</translation> + </message> + <message> + <location line="+2"/> + <source>Default Zoom</source> + <translation>Alapértelmezett zoom</translation> + </message> + <message> + <location line="+29"/> + <source>Forms</source> + <extracomment>Tab in preferences dialog</extracomment> + <translation>Űrlapok</translation> + </message> + <message> + <location line="+13"/> + <source>Default Grid</source> + <translation>Alapértelmezett rács</translation> + </message> +</context> +<context> + <name>FormLayoutRowDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/formlayoutrowdialog.ui" line="+6"/> + <source>Add Form Layout Row</source> + <translatorcomment>нелепица какая-то</translatorcomment> + <translation>Űrlap szerkezet sor hozzaadása</translation> + </message> + <message> + <location line="+11"/> + <source>&Label text:</source> + <translation>&Címke szöveg:</translation> + </message> + <message> + <location line="+23"/> + <source>Field &type:</source> + <translation>Mező &típus:</translation> + </message> + <message> + <location line="+20"/> + <source>&Field name:</source> + <translation>&Mező név:</translation> + </message> + <message> + <location line="+10"/> + <source>&Buddy:</source> + <translation>&Haver:</translation> + </message> + <message> + <location line="+17"/> + <source>&Row:</source> + <translation>&Sor:</translation> + </message> + <message> + <location line="+16"/> + <source>Label &name:</source> + <translation>Címke &név:</translation> + </message> +</context> +<context> + <name>FormWindow</name> + <message> + <location filename="../tools/designer/src/components/formeditor/formwindow.cpp" line="+1701"/> + <source>Unexpected element <%1></source> + <translation>Váratlan elem <%1></translation> + </message> + <message> + <location line="+7"/> + <source>Error while pasting clipboard contents at line %1, column %2: %3</source> + <translation>Hiba történt a vágólap tartalom beillesztése közben a(z) %1 sorban, %2 oszlopban: %3</translation> + </message> +</context> +<context> + <name>FormWindowSettings</name> + <message> + <location filename="../tools/designer/src/components/formeditor/formwindowsettings.ui" line="+54"/> + <source>Form Settings</source> + <translation>Űrlap beállítások</translation> + </message> + <message> + <location line="+14"/> + <source>Layout &Default</source> + <translation>&Alapértelmezett elrendezés</translation> + </message> + <message> + <location line="+15"/> + <source>&Spacing:</source> + <translation>&Ritkítás:</translation> + </message> + <message> + <location line="+10"/> + <source>&Margin:</source> + <translation>&Margó:</translation> + </message> + <message> + <location line="+19"/> + <source>&Layout Function</source> + <translation>&Elrendezés függvény +</translation> + </message> + <message> + <location line="+21"/> + <source>Ma&rgin:</source> + <translation>Ma&rgó:</translation> + </message> + <message> + <location line="+10"/> + <source>Spa&cing:</source> + <translation>Rit&kítás:</translation> + </message> + <message> + <location line="+117"/> + <source>&Author</source> + <translation>&Szerző</translation> + </message> + <message> + <location line="-41"/> + <source>&Include Hints</source> + <translation>Célzások &beleértése</translation> + </message> + <message> + <location line="-53"/> + <source>&Pixmap Function</source> + <translation>&Pixmap függvény</translation> + </message> + <message> + <location line="+71"/> + <source>Grid</source> + <translation>Rács</translation> + </message> + <message> + <location line="+7"/> + <source>Embedded Design</source> + <translation>Beágyazott terv</translation> + </message> +</context> +<context> + <name>IconSelector</name> + <message> + <location filename="../tools/designer/src/lib/shared/iconselector.cpp" line="+352"/> + <source>All Pixmaps (</source> + <translation>Az összes Pixmap (</translation> + </message> +</context> +<context> + <name>ItemPropertyBrowser</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/itemlisteditor.cpp" line="+66"/> + <source>XX Icon Selected off</source> + <extracomment>Sample string to determinate the width for the first column of the list item property browser</extracomment> + <translation>XX ikon kiválasztásának kikapcsolása</translation> + </message> +</context> +<context> + <name>MainWindowBase</name> + <message> + <location filename="../tools/designer/src/designer/mainwindow.cpp" line="+119"/> + <source>Main</source> + <extracomment>Not currently used (main tool bar)</extracomment> + <translation>Fő</translation> + </message> + <message> + <location line="+6"/> + <source>File</source> + <translation>Fájl</translation> + </message> + <message> + <location line="+1"/> + <source>Edit</source> + <translation>Szerkesztés</translation> + </message> + <message> + <location line="+1"/> + <source>Tools</source> + <translation>Eszközök</translation> + </message> + <message> + <location line="+1"/> + <source>Form</source> + <translation>Űrlap</translation> + </message> + <message> + <location line="+7"/> + <source>Qt Designer</source> + <translation>Qt Designer</translation> + </message> +</context> +<context> + <name>NewForm</name> + <message> + <location filename="../tools/designer/src/designer/newform.cpp" line="+79"/> + <source>C&reate</source> + <translation>&Létrehozás</translation> + </message> + <message> + <location line="+1"/> + <source>Recent</source> + <translation>Utóbbi</translation> + </message> + <message> + <location line="+32"/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> + <message> + <location line="+3"/> + <source>&Open...</source> + <translation>&Megnyitás...</translation> + </message> + <message> + <location line="+4"/> + <source>&Recent Forms</source> + <translation>&Utóbbi űrlapok</translation> + </message> + <message> + <location line="+64"/> + <source>Read error</source> + <translation>Olvasási hiba</translation> + </message> + <message> + <location line="-100"/> + <source>New Form</source> + <translation>Űj űrlap</translation> + </message> + <message> + <location line="-5"/> + <source>Show this Dialog on Startup</source> + <translation>Párbeszédablak megjelenítése betöltéskor</translation> + </message> + <message> + <location line="+128"/> + <source>A temporary form file could not be created in %1.</source> + <translation>Egy átmeneti űrlap fájlt nem sikerült létrehozni %1-ben.</translation> + </message> + <message> + <location line="+6"/> + <source>The temporary form file %1 could not be written.</source> + <translation>A(z) %1 átmeneti űrlap fájlt nem sikerült írni.</translation> + </message> +</context> +<context> + <name>ObjectInspectorModel</name> + <message> + <location filename="../tools/designer/src/components/objectinspector/objectinspectormodel.cpp" line="+360"/> + <source>Object</source> + <translation>Objektum</translation> + </message> + <message> + <location line="+1"/> + <source>Class</source> + <translation>Osztály</translation> + </message> + <message> + <location line="+35"/> + <source>separator</source> + <translation>Elválasztó</translation> + </message> + <message> + <location line="+98"/> + <source><noname></source> + <translation><noname></translation> + </message> +</context> +<context> + <name>ObjectNameDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_taskmenu.cpp" line="+158"/> + <source>Change Object Name</source> + <translation>Objektum nevének megváltoztatása</translation> + </message> + <message> + <location line="+4"/> + <source>Object Name</source> + <translation>Objektum név</translation> + </message> +</context> +<context> + <name>PluginDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/plugindialog.ui" line="+54"/> + <source>Plugin Information</source> + <translation>Beépülő modul információ</translation> + </message> + <message> + <location line="+26"/> + <source>1</source> + <translation>1</translation> + </message> +</context> +<context> + <name>PreferencesDialog</name> + <message> + <location filename="../tools/designer/src/designer/preferencesdialog.ui" line="+20"/> + <source>Preferences</source> + <translation>Beállítások</translation> + </message> +</context> +<context> + <name>PreviewConfigurationWidget</name> + <message> + <location filename="../tools/designer/src/lib/shared/previewconfigurationwidget.ui" line="+5"/> + <source>Form</source> + <translation>Űrlap</translation> + </message> + <message> + <location line="+3"/> + <source>Print/Preview Configuration</source> + <translation>Nyomtatás/Előnézet konfiguráció</translation> + </message> + <message> + <location line="+9"/> + <source>Style</source> + <translation>Stílus</translation> + </message> + <message> + <location line="+10"/> + <source>Style sheet</source> + <translation>Stíluslap</translation> + </message> + <message> + <location line="+19"/> + <location line="+7"/> + <location line="+21"/> + <source>...</source> + <translation>...</translation> + </message> + <message> + <location line="-12"/> + <source>Device skin</source> + <translation>Eszköz szkin</translation> + </message> +</context> +<context> + <name>PromotionModel</name> + <message> + <location filename="../tools/designer/src/lib/shared/promotionmodel.cpp" line="+112"/> + <source>Not used</source> + <extracomment>Usage of promoted widgets</extracomment> + <translation>Nincs használva</translation> + </message> +</context> +<context> + <name>Q3WizardContainer</name> + <message> + <location filename="../tools/designer/src/plugins/widgets/q3wizard/q3wizard_container.cpp" line="+172"/> + <location line="+5"/> + <source>Page</source> + <translation>Lap</translation> + </message> +</context> +<context> + <name>QAbstractFormBuilder</name> + <message> + <location filename="../tools/designer/src/lib/uilib/abstractformbuilder.cpp" line="+206"/> + <source>Unexpected element <%1></source> + <translation>Váratlan elem <%1></translation> + </message> + <message> + <location line="+5"/> + <source>An error has occurred while reading the UI file at line %1, column %2: %3</source> + <translation>Hiba történt az UI fájl olvasása közben a(z) %1 sorban, %2 oszlopban: %3</translation> + </message> + <message> + <location line="+6"/> + <source>Invalid UI file: The root element <ui> is missing.</source> + <translation>Érvénytelen UI fájl. A rendszergazda elem <ui> hiányzik.</translation> + </message> + <message> + <location line="+119"/> + <source>The creation of a widget of the class '%1' failed.</source> + <translation>A(z) '%1' osztály egy widget-ének létrehozása nem sikerült.</translation> + </message> + <message> + <location line="+296"/> + <source>Attempt to add child that is not of class QWizardPage to QWizard.</source> + <translation>Gyermek hozzáadásának megkísérelése QWizard-hoz, amely nem egy QWizardPage osztály.</translation> + </message> + <message> + <location line="+86"/> + <source>Attempt to add a layout to a widget '%1' (%2) which already has a layout of non-box type %3. +This indicates an inconsistency in the ui-file.</source> + <translation>Egy elrendezés hozzáadásának megprónálás egy "%1' widgethez (%2), melynek már egy %3 típusú nem doboz elrendezése van. +Ez ellentmondást mutat az ui fájlban.</translation> + </message> + <message> + <location line="+144"/> + <source>Empty widget item in %1 '%2'.</source> + <translation>Üres widget elem %1-ben '%2'.</translation> + </message> + <message> + <location line="+680"/> + <source>Flags property are not supported yet.</source> + <translation>Jelző tulajdonság még nem támogatott.</translation> + </message> + <message> + <location line="+81"/> + <source>While applying tab stops: The widget '%1' could not be found.</source> + <translation>Tab stops alkalmazásakor: A(z) '%1' widget nem található.</translation> + </message> + <message> + <location line="+908"/> + <source>Invalid QButtonGroup reference '%1' referenced by '%2'.</source> + <translation>Érvénytelen '%1' QButtonGroup hivatkozásra hivatkozik a(z) '%2'.</translation> + </message> + <message> + <location line="+511"/> + <source>This version of the uitools library is linked without script support.</source> + <translation>Az uitools könyvtár ezen verziója szkript támogatás nélkül linkelt.</translation> + </message> +</context> +<context> + <name>QAxWidgetPlugin</name> + <message> + <location filename="../tools/designer/src/plugins/activeqt/qaxwidgetplugin.cpp" line="+75"/> + <source>ActiveX control</source> + <translation>ActiveX vezérlő</translation> + </message> + <message> + <location line="+5"/> + <source>ActiveX control widget</source> + <translation>ActiveX vezérlő widget</translation> + </message> +</context> +<context> + <name>QAxWidgetTaskMenu</name> + <message> + <location filename="../tools/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp" line="+119"/> + <source>Set Control</source> + <translation>Vezérlő beállítása</translation> + </message> + <message> + <location line="+1"/> + <source>Reset Control</source> + <translation>Vezérlő újraindítása</translation> + </message> + <message> + <location line="+41"/> + <source>Licensed Control</source> + <translation>Felhatalmazott vezérlő</translation> + </message> + <message> + <location line="+1"/> + <source>The control requires a design-time license</source> + <translation>A vezérlő egy tervezés idejű felhatalmazást igényel</translation> + </message> +</context> +<context> + <name>QCoreApplication</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_promotion.cpp" line="+83"/> + <source>%1 is not a promoted class.</source> + <translation>%1 nem egy támogatott osztály.</translation> + </message> + <message> + <location line="+65"/> + <source>The base class %1 is invalid.</source> + <translation>A(z) %1 alap osztály érvénytelen.</translation> + </message> + <message> + <location line="+7"/> + <source>The class %1 already exists.</source> + <translation>A(z) %1 osztály már létezik.</translation> + </message> + <message> + <location line="+9"/> + <source>Promoted Widgets</source> + <translation>Támogatott Widget-ek</translation> + </message> + <message> + <location line="+126"/> + <source>The class %1 cannot be removed</source> + <translation>A(z) %1 osztályt nem lehet eltávolítani</translation> + </message> + <message> + <location line="+9"/> + <source>The class %1 cannot be removed because it is still referenced.</source> + <translation>A(z) %1 osztályt nem lehet eltávolítani, mert még mindig hivatkozott.</translation> + </message> + <message> + <location line="+10"/> + <source>The class %1 cannot be renamed</source> + <translation>A(z) %1 osztályt nem lehet átnevezni</translation> + </message> + <message> + <location line="+7"/> + <source>The class %1 cannot be renamed to an empty name.</source> + <translation>A(z) %1 osztályt nem lehet átnevezni egy üres névűre.</translation> + </message> + <message> + <location line="+5"/> + <source>There is already a class named %1.</source> + <translation>Már van egy %1 nevű osztály.</translation> + </message> + <message> + <location line="+29"/> + <source>Cannot set an empty include file.</source> + <translatorcomment>перевод близко к тексту - буквальный совсем глаз режет</translatorcomment> + <translation>Nem lehet beállítani egy üres bennefoglalt fájlt.</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/uilib/formscriptrunner.cpp" line="+88"/> + <source>Exception at line %1: %2</source> + <translation>Kivétel a(z) %1 sorban: %2</translation> + </message> + <message> + <location line="+36"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> + <message> + <location line="+50"/> + <source>An error occurred while running the script for %1: %2 +Script: %3</source> + <translation>Hiba történt a szkript futtása közben %1-re: %2 +Szkript: %3</translation> + </message> +</context> +<context> + <name>QDesigner</name> + <message> + <location filename="../tools/designer/src/designer/qdesigner.cpp" line="+141"/> + <source>%1 - warning</source> + <translation>%1 -figyelmeztetés</translation> + </message> + <message> + <location line="+96"/> + <source>Qt Designer</source> + <translation>Qt Designer</translation> + </message> + <message> + <location line="+1"/> + <source>This application cannot be used for the Console edition of Qt</source> + <translation>Ezt alkalmazást nem lehet a Qt konzol szerkesztésére használni</translation> + </message> +</context> +<context> + <name>QDesignerActions</name> + <message> + <location filename="../tools/designer/src/designer/qdesigner_actions.cpp" line="+128"/> + <source>Saved %1.</source> + <translation>Mentve: %1.</translation> + </message> + <message> + <location line="+50"/> + <source>Edit Widgets</source> + <translation>Widget-ek szerkesztése</translation> + </message> + <message> + <location line="+10"/> + <source>&Quit</source> + <translation>&Bezárás</translation> + </message> + <message> + <location line="+3"/> + <source>&Minimize</source> + <translation>&Minimalizálás</translation> + </message> + <message> + <location line="+2"/> + <source>Bring All to Front</source> + <translation>Az összes előre hozása</translation> + </message> + <message> + <location line="+2"/> + <source>Preferences...</source> + <translation>Beállítások...</translation> + </message> + <message> + <location line="+298"/> + <source>Clear &Menu</source> + <translation>&Menü tisztítása</translation> + </message> + <message> + <location line="-233"/> + <source>CTRL+SHIFT+S</source> + <translation>CTRL+SHIFT+S</translation> + </message> + <message> + <location line="+113"/> + <source>CTRL+R</source> + <translation>CTRL+R</translation> + </message> + <message> + <location line="+18"/> + <source>CTRL+M</source> + <translation>CTRL+M</translation> + </message> + <message> + <location line="+31"/> + <source>Qt Designer &Help</source> + <translation>Qt Designer &Súgó</translation> + </message> + <message> + <location line="+7"/> + <source>Current Widget Help</source> + <translation>Aktuális Widget Súgó</translation> + </message> + <message> + <location line="+7"/> + <source>What's New in Qt Designer?</source> + <translation>Mi az újdonság a Qt Designer-ben?</translation> + </message> + <message> + <location line="+7"/> + <source>About Plugins</source> + <translation>Beépülő modulokról</translation> + </message> + <message> + <location line="+6"/> + <location line="+601"/> + <source>About Qt Designer</source> + <translation>Qt Designer-ről</translation> + </message> + <message> + <location line="-595"/> + <source>About Qt</source> + <translation>Qt-ról</translation> + </message> + <message> + <location line="+121"/> + <location line="+197"/> + <source>Open Form</source> + <translation>Űrlap megnyitása</translation> + </message> + <message> + <location line="-196"/> + <location line="+37"/> + <location line="+160"/> + <source>Designer UI files (*.%1);;All Files (*)</source> + <translation>Designer UI fájlok (*.%1);;Az összes fájl (*)</translation> + </message> + <message> + <location line="-620"/> + <source>%1 already exists. +Do you want to replace it?</source> + <translation>%1 már létezik. +Le szeretné cserélni?</translation> + </message> + <message> + <location line="+42"/> + <source>Additional Fonts...</source> + <translation>További betűk...</translation> + </message> + <message> + <location line="+303"/> + <source>&Recent Forms</source> + <translation>&Utóbbi űrlapok</translation> + </message> + <message> + <location line="+202"/> + <source>Designer</source> + <translation>Designer</translation> + </message> + <message> + <location line="+0"/> + <source>Feature not implemented yet!</source> + <translation>A tulajdonság még nincs implementálva!</translation> + </message> + <message> + <location line="+59"/> + <source>Read error</source> + <translation>Olvasási hiba</translation> + </message> + <message> + <location line="+1"/> + <source>%1 +Do you want to update the file location or generate a new form?</source> + <translation>%1 +Szeretné frissíteni a fájl helyét vagy generálni egy új űrlapot?</translation> + </message> + <message> + <location line="+3"/> + <source>&Update</source> + <translation>&Frissítés</translation> + </message> + <message> + <location line="+1"/> + <source>&New Form</source> + <translation>&Új űrlap</translation> + </message> + <message> + <location line="+77"/> + <location line="+40"/> + <source>Save Form?</source> + <translation>Menti az űrlapot?</translation> + </message> + <message> + <location line="-39"/> + <source>Could not open file</source> + <translation>Nem sikerült megnyitni a fájlt</translation> + </message> + <message> + <location line="+10"/> + <source>Select New File</source> + <translation>Új fájl kiválasztása</translation> + </message> + <message> + <location line="+30"/> + <source>Could not write file</source> + <translation>Nem sikerült írni a fájlt</translation> + </message> + <message> + <location line="+201"/> + <source>&Close Preview</source> + <translation>Előnézet &bezárása</translation> + </message> + <message> + <location line="-905"/> + <source>&New...</source> + <translation>&Új...</translation> + </message> + <message> + <location line="+1"/> + <source>&Open...</source> + <translation>&Megnyitás...</translation> + </message> + <message> + <location line="+1"/> + <source>&Save</source> + <translation>&Mentés</translation> + </message> + <message> + <location line="+1"/> + <source>Save &As...</source> + <translation>Mentés &másként...</translation> + </message> + <message> + <location line="+1"/> + <source>Save A&ll</source> + <translation>Az ö&sszes mentése</translation> + </message> + <message> + <location line="+1"/> + <source>Save As &Template...</source> + <translation>Mentés &sablonként...</translation> + </message> + <message> + <location line="+1"/> + <location line="+901"/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> + <message> + <location line="-900"/> + <source>Save &Image...</source> + <translation>&Kép mentése...</translation> + </message> + <message> + <location line="+1"/> + <source>&Print...</source> + <translation>&Nyomtatás...</translation> + </message> + <message> + <location line="+3"/> + <source>View &Code...</source> + <translation>&Kód nézet...</translation> + </message> + <message> + <location line="+68"/> + <source>ALT+CTRL+S</source> + <translation>ALT+CTRL+S</translation> + </message> + <message> + <location line="+356"/> + <location line="+248"/> + <source>Save Form As</source> + <translation>Mentés űrlapként</translation> + </message> + <message> + <location line="+429"/> + <source>Preview failed</source> + <translation>Előnézet hiba</translation> + </message> + <message> + <location line="-575"/> + <source>Code generation failed</source> + <translation>Kód generálási hiba</translation> + </message> + <message> + <location line="+131"/> + <source>The file %1 could not be opened. +Reason: %2 +Would you like to retry or select a different file?</source> + <translation>Nem sikerült megnyitni a(z) %1 fájlt. +Ok: %2 +Meg szeretné újra próbálni vagy kiválasztani egy különböző fájlt?</translation> + </message> + <message> + <location line="+39"/> + <source>It was not possible to write the entire file %1 to disk. +Reason:%2 +Would you like to retry?</source> + <translation>Nem lehetett az egész %1 fájlt a lemezre írni. +Ok: %2 +Meg szeretné próbálni újra?</translation> + </message> + <message> + <location line="+158"/> + <location line="+34"/> + <source>Assistant</source> + <translation>Assistant</translation> + </message> + <message> + <location line="+47"/> + <location line="+23"/> + <source>The backup file %1 could not be written.</source> + <translation>Nem sikerült írni az archivált %1 fájlt.</translation> + </message> + <message> + <location line="+107"/> + <source>The backup directory %1 could not be created.</source> + <translation>Nem sikerült létrehozni a(z) %1 archivált könyvtárat.</translation> + </message> + <message> + <location line="+6"/> + <source>The temporary backup directory %1 could not be created.</source> + <translation>Nem sikerült létrehozni az átmeneti archivált %1 könyvtárat.</translation> + </message> + <message> + <location line="+54"/> + <source>Image files (*.%1)</source> + <translation>Kép fájlok (*.%1)</translation> + </message> + <message> + <location line="+9"/> + <location line="+17"/> + <source>Save Image</source> + <translation>Kép mentése</translation> + </message> + <message> + <location line="-4"/> + <source>Saved image %1.</source> + <translation>Mentett kép: %1.</translation> + </message> + <message> + <location line="+5"/> + <source>The file %1 could not be written.</source> + <translation>Nem sikerült írni a(z) %1 fájlt.</translation> + </message> + <message> + <location line="+13"/> + <source>Please close all forms to enable the loading of additional fonts.</source> + <translation>Kérem zárja be az összes űrlapot további betűk betöltéséhez.</translation> + </message> + <message> + <location line="+52"/> + <source>Printed %1.</source> + <translation>Kinyomtatva: %1.</translation> + </message> +</context> +<context> + <name>QDesignerAppearanceOptionsPage</name> + <message> + <location filename="../tools/designer/src/designer/qdesigner_appearanceoptions.cpp" line="+138"/> + <source>Appearance</source> + <extracomment>Tab in preferences dialog</extracomment> + <translation>Megjelenés</translation> + </message> +</context> +<context> + <name>QDesignerAppearanceOptionsWidget</name> + <message> + <location line="-53"/> + <source>Docked Window</source> + <translation>Dokkolt ablak</translation> + </message> + <message> + <location line="+1"/> + <source>Multiple Top-Level Windows</source> + <translation>Összes felső szintű ablakok</translation> + </message> + <message> + <location line="+5"/> + <source>Toolwindow Font</source> + <translation>Eszköz ablak betű</translation> + </message> +</context> +<context> + <name>QDesignerAxWidget</name> + <message> + <location filename="../tools/designer/src/plugins/activeqt/qaxwidgettaskmenu.cpp" line="-71"/> + <source>Reset control</source> + <translation>Vezérlés újraindítása</translation> + </message> + <message> + <location line="+2"/> + <source>Set control</source> + <translation>Vezérlés beállítása</translation> + </message> + <message> + <location filename="../tools/designer/src/plugins/activeqt/qdesigneraxwidget.cpp" line="+179"/> + <source>Control loaded</source> + <translation>Vezérlés betöltve</translation> + </message> + <message> + <location line="+40"/> + <source>A COM exception occurred when executing a meta call of type %1, index %2 of "%3".</source> + <translation>Egy COM kivétel történt a(z) %1 típusú meta hívás végrehajtása közben, '%3' %2 indexe.</translation> + </message> +</context> +<context> + <name>QDesignerFormBuilder</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_formbuilder.cpp" line="+89"/> + <source>Script errors occurred:</source> + <translation>Szkript hiba történt:</translation> + </message> + <message> + <location line="+307"/> + <source>The preview failed to build.</source> + <translation>Nem sikerült az előnézetet felépíteni.</translation> + </message> + <message> + <location line="+65"/> + <source>Designer</source> + <translation>Designer</translation> + </message> +</context> +<context> + <name>QDesignerFormWindow</name> + <message> + <location filename="../tools/designer/src/designer/qdesigner_formwindow.cpp" line="+217"/> + <source>%1 - %2[*]</source> + <translation>%1 - %2[*]</translation> + </message> + <message> + <location line="+10"/> + <source>Save Form?</source> + <translation>Űrlap mentése?</translation> + </message> + <message> + <location line="+1"/> + <source>Do you want to save the changes to this document before closing?</source> + <translation>El szeretné menteni a változtatásokat ebbe a dokumentumba a bezárás előtt?</translation> + </message> + <message> + <location line="+2"/> + <source>If you don't save, your changes will be lost.</source> + <translation>Ha nem menti el, a változtatásai el fognak veszni.</translation> + </message> +</context> +<context> + <name>QDesignerMenu</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_menu.cpp" line="-1181"/> + <source>Type Here</source> + <translation>Gépelje be ide</translation> + </message> + <message> + <location line="+3"/> + <source>Add Separator</source> + <translation>Elválasztó hozzáadása</translation> + </message> + <message> + <location line="+371"/> + <source>Insert separator</source> + <translation>Elválasztó beszúrása</translation> + </message> + <message> + <location line="+5"/> + <source>Remove separator</source> + <translation>Elválasztó eltávolítása</translation> + </message> + <message> + <location line="+2"/> + <source>Remove action '%1'</source> + <translation>'%1' tevékenység eltávolítása</translation> + </message> + <message> + <location line="+25"/> + <location line="+650"/> + <source>Add separator</source> + <translation>Elválasztó hozzáadása</translation> + </message> + <message> + <location line="-348"/> + <source>Insert action</source> + <translation>Tevékenység beszúrása</translation> + </message> +</context> +<context> + <name>QDesignerMenuBar</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_menubar.cpp" line="-375"/> + <source>Type Here</source> + <translation>Gépelje be ide</translation> + </message> + <message> + <location line="+298"/> + <source>Remove Menu '%1'</source> + <translation>'%1' menü eltávolítása</translation> + </message> + <message> + <location line="+12"/> + <source>Remove Menu Bar</source> + <translation>Menü sáv eltávolítása</translation> + </message> + <message> + <location line="+70"/> + <source>Menu</source> + <translation>Menü</translation> + </message> +</context> +<context> + <name>QDesignerPluginManager</name> + <message> + <location filename="../tools/designer/src/lib/shared/pluginmanager.cpp" line="+271"/> + <source>An XML error was encountered when parsing the XML of the custom widget %1: %2</source> + <translation>Egy XML hiba történt az egyéni %1 widget XML-ének elemzése közben: %2</translation> + </message> + <message> + <location line="+5"/> + <source>A required attribute ('%1') is missing.</source> + <translation>Egy szükséges attribútum ('%1') hiányzik.</translation> + </message> + <message> + <location line="+38"/> + <source>An invalid property specification ('%1') was encountered. Supported types: %2</source> + <translation>Egy érvénytelen tulajdonság specifikációt ('%1') talált. Támogatott típusok: %2</translation> + </message> + <message> + <location line="+20"/> + <source>'%1' is not a valid string property specification.</source> + <translation>'%1' nem egy érvényes sztring tulajdonság specifikáció.</translation> + </message> + <message> + <location line="+40"/> + <source>The XML of the custom widget %1 does not contain any of the elements <widget> or <ui>.</source> + <translation>Az egyéni %1 widget XML-je nem tartalmaz semmilyen elemet <widget> vagy <ui>.</translation> + </message> + <message> + <location line="+12"/> + <source>The class attribute for the class %1 is missing.</source> + <translation>Az osztály attribútum %1 osztályra hiányzik.</translation> + </message> + <message> + <location line="+4"/> + <source>The class attribute for the class %1 does not match the class name %2.</source> + <translation>Az osztály attribútum %1 osztályra nem egyezik meg a(z) %2 osztály nevével.</translation> + </message> +</context> +<context> + <name>QDesignerPropertySheet</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_propertysheet.cpp" line="+754"/> + <source>Dynamic Properties</source> + <translation>Dinamikus tulajdonságok</translation> + </message> +</context> +<context> + <name>QDesignerResource</name> + <message> + <location filename="../tools/designer/src/components/formeditor/qdesigner_resource.cpp" line="+461"/> + <source>The layout type '%1' is not supported, defaulting to grid.</source> + <translation>A(z) '%1' elrendezés típus nem támogatott, alapértelmezett rács.</translation> + </message> + <message> + <location line="+243"/> + <source>The container extension of the widget '%1' (%2) returned a widget not managed by Designer '%3' (%4) when queried for page #%5. +Container pages should only be added by specifying them in XML returned by the domXml() method of the custom widget.</source> + <translation>A(z) '%1' (%2) widget konténer kiterjesztése egy olyan widget-et adott vissza, amelyet a(z) '%3' (%4) Designer nem kezel, %5 lap lekéréskor. +Konténer lapokat XML-ben való specifikációjuk által kellene hozzáadni, az egyéni widget domXML() eljárása által.</translation> + </message> + <message> + <location line="+599"/> + <source>Unexpected element <%1></source> + <extracomment>Parsing clipboard contents</extracomment> + <translation>Váratlan elem <%1></translation> + </message> + <message> + <location line="+6"/> + <source>Error while pasting clipboard contents at line %1, column %2: %3</source> + <extracomment>Parsing clipboard contents</extracomment> + <translation>Hiba történt a vágólap tartalmának beillesztése közben a(z) %1 sorban, %2 oszlopban: %3</translation> + </message> + <message> + <location line="+6"/> + <source>Error while pasting clipboard contents: The root element <ui> is missing.</source> + <extracomment>Parsing clipboard contents</extracomment> + <translation>Hiba történt a vágólap tartalmának beillesztése közben. A rendszergazda elem <ui> hiányzik.</translation> + </message> +</context> +<context> + <name>QDesignerSharedSettings</name> + <message> + <location filename="../tools/designer/src/lib/shared/shared_settings.cpp" line="+83"/> + <source>The template path %1 could not be created.</source> + <translation>Nem sikerült létrehozni a(z) %1 sablon útvonalat.</translation> + </message> + <message> + <location line="+184"/> + <source>An error has been encountered while parsing device profile XML: %1</source> + <translation>Hiba történt az eszköz profil %1 XML elemzése közben</translation> + </message> +</context> +<context> + <name>QDesignerToolWindow</name> + <message> + <location filename="../tools/designer/src/designer/qdesigner_toolwindow.cpp" line="+190"/> + <source>Property Editor</source> + <translation>Tulajdonság szerkesztő</translation> + </message> + <message> + <location line="+54"/> + <source>Action Editor</source> + <translation>Tevékenység szerkesztő</translation> + </message> + <message> + <location line="+42"/> + <source>Object Inspector</source> + <translation>Objektum felügyelő</translation> + </message> + <message> + <location line="+35"/> + <source>Resource Browser</source> + <translation>Erőforrás böngésző</translation> + </message> + <message> + <location line="+34"/> + <source>Signal/Slot Editor</source> + <translation>Jel/Szlot szerkesztő</translation> + </message> + <message> + <location line="+41"/> + <source>Widget Box</source> + <translation>Widget doboz</translation> + </message> +</context> +<context> + <name>QDesignerWorkbench</name> + <message> + <location filename="../tools/designer/src/designer/qdesigner_workbench.cpp" line="+199"/> + <source>&File</source> + <translation>&Fájl</translation> + </message> + <message> + <location line="+6"/> + <source>F&orm</source> + <translation>&Űrlap</translation> + </message> + <message> + <location line="+1"/> + <source>Preview in</source> + <translation>Előnézetben</translation> + </message> + <message> + <location line="+8"/> + <source>&Window</source> + <translation>&Ablak</translation> + </message> + <message> + <location line="+2"/> + <source>&Help</source> + <translation>&Súgó</translation> + </message> + <message> + <location line="-15"/> + <source>Edit</source> + <translation>Szerkesztés</translation> + </message> + <message> + <location line="+38"/> + <source>Toolbars</source> + <translation>Eszközsávok</translation> + </message> + <message> + <location line="+465"/> + <source>Save Forms?</source> + <translation>Űrlap mentése?</translation> + </message> + <message numerus="yes"> + <location line="+1"/> + <source>There are %n forms with unsaved changes. Do you want to review these changes before quitting?</source> + <translation> + <numerusform>%n űrlapban vannak el nem mentett változtatások. Át szeretné tekintei ezeket a változtatásokat a kilépés előtt?</numerusform> + </translation> + </message> + <message> + <location line="-495"/> + <source>&View</source> + <translation>&Nézet</translation> + </message> + <message> + <location line="+2"/> + <source>&Settings</source> + <translation>&Beállítások</translation> + </message> + <message> + <location line="+204"/> + <source>Widget Box</source> + <translation>Widget doboz</translation> + </message> + <message> + <location line="+292"/> + <source>If you do not review your documents, all your changes will be lost.</source> + <translation>Ha nem tekinti át újra a dokumentumokat, az összes változtatása el fog veszni.</translation> + </message> + <message> + <location line="+1"/> + <source>Discard Changes</source> + <translation>Változtatások eldobása</translation> + </message> + <message> + <location line="+2"/> + <source>Review Changes</source> + <translation>Változtatások áttekintése</translation> + </message> + <message> + <location line="+95"/> + <source>Backup Information</source> + <translation>Archiválási információ</translation> + </message> + <message> + <location line="+1"/> + <source>The last session of Designer was not terminated correctly. Backup files were left behind. Do you want to load them?</source> + <translation>A Designer utolsó szakasza nem megfelelően állt le. Archivált fájlok hagyott maga után. Be szeretné tölteni őket?</translation> + </message> + <message> + <location line="+111"/> + <source>The file <b>%1</b> could not be opened.</source> + <translation>A(z) <b>%1</b> fájlt nem sikerült megnyitni.</translation> + </message> + <message> + <location line="+46"/> + <source>The file <b>%1</b> is not a valid Designer UI file.</source> + <translation>A(z) <b>%1</b> fájl nem egy érvényes Designer UI fájl.</translation> + </message> +</context> +<context> + <name>QFormBuilder</name> + <message> + <location filename="../tools/designer/src/lib/uilib/formbuilder.cpp" line="+163"/> + <source>An empty class name was passed on to %1 (object name: '%2').</source> + <extracomment>Empty class name passed to widget factory method</extracomment> + <translation>Egy üres osztály név volt %1-ra (objektum név: '%2').</translation> + </message> + <message> + <location line="+56"/> + <source>QFormBuilder was unable to create a custom widget of the class '%1'; defaulting to base class '%2'.</source> + <translation>QFormBuilder-nek nem sikerült létrehozni egy '%1' osztály egyéni widget-et, alapértelmezés a(z) '%2' alap osztályra.</translation> + </message> + <message> + <location line="+6"/> + <source>QFormBuilder was unable to create a widget of the class '%1'.</source> + <translation>QFormBuilder-nak nem sikerült létrehoznia egy '%1' osztály widget-et.</translation> + </message> + <message> + <location line="+61"/> + <source>The layout type `%1' is not supported.</source> + <translation>A(z) '%1' elrendezés terv nem támogatott.</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/uilib/properties.cpp" line="+106"/> + <source>The set-type property %1 could not be read.</source> + <translation>Nem sikerült olvasni a(z) %1 beállított típusú tulajdonságot.</translation> + </message> + <message> + <location line="+23"/> + <source>The enumeration-type property %1 could not be read.</source> + <translation>A(z) %1 felsorolási típus tulajdonságot nem sikerült olvasni.</translation> + </message> + <message> + <location line="+190"/> + <source>Reading properties of the type %1 is not supported yet.</source> + <translation>'%1' típus tulajdonságok olvasása még nem támogatott.</translation> + </message> + <message> + <location line="+266"/> + <source>The property %1 could not be written. The type %2 is not supported yet.</source> + <translation>A(z) %1 tulajdonságot nem sikerült írni. A(z) %2 típus nem támogatott még.</translation> + </message> +</context> +<context> + <name>QStackedWidgetEventFilter</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_stackedbox.cpp" line="+194"/> + <source>Previous Page</source> + <translation>Előző lap</translation> + </message> + <message> + <location line="+1"/> + <source>Next Page</source> + <translation>Következő lap</translation> + </message> + <message> + <location line="+1"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> + <message> + <location line="+1"/> + <source>Before Current Page</source> + <translation>Aktuális lap előtt</translation> + </message> + <message> + <location line="+1"/> + <source>After Current Page</source> + <translation>Aktuális lap után</translation> + </message> + <message> + <location line="+1"/> + <source>Change Page Order...</source> + <translation>Lap sorrend megváltoztatása...</translation> + </message> + <message> + <location line="+72"/> + <source>Change Page Order</source> + <translation>Lap sorrend megváltoztatása</translation> + </message> + <message> + <location line="+49"/> + <source>Page %1 of %2</source> + <translation>%2 %1 lapja</translation> + </message> + <message> + <location line="+10"/> + <location line="+4"/> + <source>Insert Page</source> + <translation>Lap beszúrása</translation> + </message> +</context> +<context> + <name>QStackedWidgetPreviewEventFilter</name> + <message> + <location line="-153"/> + <source>Go to previous page of %1 '%2' (%3/%4).</source> + <translation>Ugrás a(z) %1 '%2' (%3/%4) előző lapjára.</translation> + </message> + <message> + <location line="+4"/> + <source>Go to next page of %1 '%2' (%3/%4).</source> + <translation>Ugrás a(z) %1 '%2' (%3/%4) következő lapjára.</translation> + </message> +</context> +<context> + <name>QTabWidgetEventFilter</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_tabwidget.cpp" line="+89"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> + <message> + <location line="+1"/> + <source>Before Current Page</source> + <translation>Aktuális lap előtt</translation> + </message> + <message> + <location line="+1"/> + <source>After Current Page</source> + <translation>Aktuális lap után</translation> + </message> + <message> + <location line="+283"/> + <source>Page %1 of %2</source> + <translation>%2 %1 lapja</translation> + </message> + <message> + <location line="+10"/> + <location line="+4"/> + <source>Insert Page</source> + <translation>Lap beszúrása</translation> + </message> +</context> +<context> + <name>QToolBoxHelper</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_toolbox.cpp" line="+64"/> + <source>Delete Page</source> + <translation>Lap törlése</translation> + </message> + <message> + <location line="+1"/> + <source>Before Current Page</source> + <translation>Aktuális lap előtt</translation> + </message> + <message> + <location line="+1"/> + <source>After Current Page</source> + <translation>Aktuális lap után</translation> + </message> + <message> + <location line="+1"/> + <source>Change Page Order...</source> + <translation>Lap sorrend megváltoztatása...</translation> + </message> + <message> + <location line="+116"/> + <source>Change Page Order</source> + <translation>Lap sorrend megváltoztatása</translation> + </message> + <message> + <location line="+44"/> + <source>Page %1 of %2</source> + <translation>%2 %1 lapja</translation> + </message> + <message> + <location line="+12"/> + <source>Insert Page</source> + <translation>Lap beszúrása</translation> + </message> +</context> +<context> + <name>QtBoolEdit</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp" line="+226"/> + <location line="+10"/> + <location line="+25"/> + <source>True</source> + <translation>Igaz</translation> + </message> + <message> + <location line="-25"/> + <location line="+25"/> + <source>False</source> + <translation>Hamis</translation> + </message> +</context> +<context> + <name>QtBoolPropertyManager</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertymanager.cpp" line="+1469"/> + <source>True</source> + <translation>Igaz</translation> + </message> + <message> + <location line="+1"/> + <source>False</source> + <translation>Hamis</translation> + </message> +</context> +<context> + <name>QtCharEdit</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qteditorfactory.cpp" line="+1581"/> + <source>Clear Char</source> + <translation>Karakter ürítése</translation> + </message> +</context> +<context> + <name>QtColorEditWidget</name> + <message> + <location line="+605"/> + <source>...</source> + <translation>...</translation> + </message> +</context> +<context> + <name>QtColorPropertyManager</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertymanager.cpp" line="+4743"/> + <source>Red</source> + <translation>Piros</translation> + </message> + <message> + <location line="+8"/> + <source>Green</source> + <translation>Zöld</translation> + </message> + <message> + <location line="+8"/> + <source>Blue</source> + <translation>Kék</translation> + </message> + <message> + <location line="+8"/> + <source>Alpha</source> + <translation>Alfa</translation> + </message> +</context> +<context> + <name>QtCursorDatabase</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp" line="-206"/> + <source>Arrow</source> + <translation>Nyíl</translation> + </message> + <message> + <location line="+2"/> + <source>Up Arrow</source> + <translation>Felfele nyíl</translation> + </message> + <message> + <location line="+2"/> + <source>Cross</source> + <translation>Kereszt</translation> + </message> + <message> + <location line="+2"/> + <source>Wait</source> + <translation>Várakozás</translation> + </message> + <message> + <location line="+2"/> + <source>IBeam</source> + <translation>IBeam</translation> + </message> + <message> + <location line="+2"/> + <source>Size Vertical</source> + <translation>Vertikális méret</translation> + </message> + <message> + <location line="+2"/> + <source>Size Horizontal</source> + <translation>Horizontális méret</translation> + </message> + <message> + <location line="+2"/> + <source>Size Backslash</source> + <translation>Visszaper méret</translation> + </message> + <message> + <location line="+2"/> + <source>Size Slash</source> + <translation>Per méret</translation> + </message> + <message> + <location line="+2"/> + <source>Size All</source> + <translation>Az összes méret</translation> + </message> + <message> + <location line="+2"/> + <source>Blank</source> + <translation>Üres</translation> + </message> + <message> + <location line="+2"/> + <source>Split Vertical</source> + <translation>Vertikális feldarabolás</translation> + </message> + <message> + <location line="+2"/> + <source>Split Horizontal</source> + <translation>Horizontális feldarabolás</translation> + </message> + <message> + <location line="+2"/> + <source>Pointing Hand</source> + <translation>Mutató kéz</translation> + </message> + <message> + <location line="+2"/> + <source>Forbidden</source> + <translation>Tiltott</translation> + </message> + <message> + <location line="+2"/> + <source>Open Hand</source> + <translation>Nyitott kéz</translation> + </message> + <message> + <location line="+2"/> + <source>Closed Hand</source> + <translation>Zárt kéz</translation> + </message> + <message> + <location line="+2"/> + <source>What's This</source> + <translation>Mi ez</translation> + </message> + <message> + <location line="+2"/> + <source>Busy</source> + <translation>Elfoglalt</translation> + </message> +</context> +<context> + <name>QtFontEditWidget</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qteditorfactory.cpp" line="+198"/> + <source>...</source> + <translation>...</translation> + </message> + <message> + <location line="+20"/> + <source>Select Font</source> + <translation>Betű kiválasztása</translation> + </message> +</context> +<context> + <name>QtFontPropertyManager</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertymanager.cpp" line="-351"/> + <source>Family</source> + <translation>Család</translation> + </message> + <message> + <location line="+13"/> + <source>Point Size</source> + <translation>Pont méret</translation> + </message> + <message> + <location line="+8"/> + <source>Bold</source> + <translation>Félkövér</translation> + </message> + <message> + <location line="+7"/> + <source>Italic</source> + <translation>Dőlt</translation> + </message> + <message> + <location line="+7"/> + <source>Underline</source> + <translation>Aláhúzás</translation> + </message> + <message> + <location line="+7"/> + <source>Strikeout</source> + <translation>Kitalálás</translation> + </message> + <message> + <location line="+7"/> + <source>Kerning</source> + <translation>Szóközökkel feltöltés</translation> + </message> +</context> +<context> + <name>QtGradientDialog</name> + <message> + <location filename="../tools/shared/qtgradienteditor/qtgradientdialog.ui" line="+53"/> + <source>Edit Gradient</source> + <translation>Meredekség szerkesztése</translation> + </message> +</context> +<context> + <name>QtGradientEditor</name> + <message> + <location filename="../tools/shared/qtgradienteditor/qtgradienteditor.cpp" line="+431"/> + <source>Start X</source> + <translation>X indítása</translation> + </message> + <message> + <location line="+4"/> + <source>Start Y</source> + <translation>Y indítása</translation> + </message> + <message> + <location line="+4"/> + <source>Final X</source> + <translation>Végső X</translation> + </message> + <message> + <location line="+4"/> + <source>Final Y</source> + <translation>Végső Y</translation> + </message> + <message> + <location line="+7"/> + <location line="+24"/> + <source>Central X</source> + <translation>X középpont</translation> + </message> + <message> + <location line="-20"/> + <location line="+24"/> + <source>Central Y</source> + <translation>Y középpont</translation> + </message> + <message> + <location line="-20"/> + <source>Focal X</source> + <translation>X gyújtópont</translation> + </message> + <message> + <location line="+4"/> + <source>Focal Y</source> + <translation>Y gyújtópont</translation> + </message> + <message> + <location line="+4"/> + <source>Radius</source> + <translation>Sugár</translation> + </message> + <message> + <location line="+16"/> + <source>Angle</source> + <translation>Szög</translation> + </message> + <message> + <location line="+288"/> + <source>Linear</source> + <translation>Lineáris</translation> + </message> + <message> + <location line="+1"/> + <source>Radial</source> + <translation>Sugárirányú</translation> + </message> + <message> + <location line="+1"/> + <source>Conical</source> + <translation>Kúp alakú</translation> + </message> + <message> + <location line="+20"/> + <source>Pad</source> + <translation>Lyuk</translation> + </message> + <message> + <location line="+1"/> + <source>Repeat</source> + <translation>Megismétlés</translation> + </message> + <message> + <location line="+1"/> + <source>Reflect</source> + <translation>Prizma</translation> + </message> + <message> + <location filename="../tools/shared/qtgradienteditor/qtgradienteditor.ui" line="+53"/> + <source>Form</source> + <translation>Űrlap</translation> + </message> + <message> + <location line="+48"/> + <source>Gradient Editor</source> + <translation>Meredekség szerkesztő</translation> + </message> + <message> + <location line="+3"/> + <source>This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop.</source> + <translation>Ez a mező jeleníti meg a meredekség egy előzetének szerkesztését. Ez engedélyezi a meredekség típusához tartozó paraméter specifikus dolgok szerkesztését, mint a kezdő és végpont, sugár, stb. a fogd & vidd módszerrel.</translation> + </message> + <message> + <location line="+16"/> + <source>1</source> + <translation>1</translation> + </message> + <message> + <location line="+35"/> + <source>2</source> + <translation>2</translation> + </message> + <message> + <location line="+35"/> + <source>3</source> + <translation>3</translation> + </message> + <message> + <location line="+35"/> + <source>4</source> + <translation>4</translation> + </message> + <message> + <location line="+35"/> + <source>5</source> + <translation>5</translation> + </message> + <message> + <location line="+35"/> + <source>Gradient Stops Editor</source> + <translation>Meredekség leállítás szerkesztő</translation> + </message> + <message> + <location line="+3"/> + <source>This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions.</source> + <translation>Ez a mező engedélyezi a meredekség leállításának szerkesztését.Dupla kattintás a létező leállítás kezelőn duplikálja ezt. Dupla kattintás a létező leállítás kezelőn kívül létrehoz egy új leállítást. Fogd & vidd az újrapozíciónálo kezelőt. Használja a jobb egér gombot a felugró menü összefüggéshez extra tevékenységekkel.</translation> + </message> + <message> + <location line="+13"/> + <source>Zoom</source> + <translation>Zoom</translation> + </message> + <message> + <location line="+19"/> + <location line="+3"/> + <source>Reset Zoom</source> + <translation>Újraindítás zoom</translation> + </message> + <message> + <location line="+13"/> + <source>Position</source> + <translation>Pozíció</translation> + </message> + <message> + <location line="+19"/> + <location line="+49"/> + <location line="+22"/> + <source>Hue</source> + <translation>Színárnyalat</translation> + </message> + <message> + <location line="-68"/> + <source>H</source> + <translation>H</translation> + </message> + <message> + <location line="+87"/> + <location line="+49"/> + <source>Saturation</source> + <translation>Telítettség</translation> + </message> + <message> + <location line="-46"/> + <source>S</source> + <translation>S</translation> + </message> + <message> + <location line="+68"/> + <source>Sat</source> + <translation>Sat</translation> + </message> + <message> + <location line="+19"/> + <location line="+49"/> + <source>Value</source> + <translation>Érték</translation> + </message> + <message> + <location line="-46"/> + <source>V</source> + <translation>V</translation> + </message> + <message> + <location line="+68"/> + <source>Val</source> + <translation>Val</translation> + </message> + <message> + <location line="+19"/> + <location line="+49"/> + <location line="+22"/> + <source>Alpha</source> + <translation>Alfa</translation> + </message> + <message> + <location line="-68"/> + <source>A</source> + <translation>A</translation> + </message> + <message> + <location line="+81"/> + <source>Type</source> + <translation>Típus</translation> + </message> + <message> + <location line="+13"/> + <source>Spread</source> + <translation>Kiterjedés</translation> + </message> + <message> + <location line="+19"/> + <source>Color</source> + <translation>Szín</translation> + </message> + <message> + <location line="+13"/> + <source>Current stop's color</source> + <translation>Aktuális leállítás színe</translation> + </message> + <message> + <location line="+22"/> + <source>Show HSV specification</source> + <translation>HSV specifikáció megjelenítése</translation> + </message> + <message> + <location line="+3"/> + <source>HSV</source> + <translation>HSV</translation> + </message> + <message> + <location line="+22"/> + <source>Show RGB specification</source> + <translation>RGB specifikáció megjelenítése</translation> + </message> + <message> + <location line="+3"/> + <source>RGB</source> + <translation>RGB</translation> + </message> + <message> + <location line="+28"/> + <source>Current stop's position</source> + <translation>Aktuális leállítás pozíciója</translation> + </message> + <message> + <location line="+188"/> + <source>%</source> + <translation>%</translation> + </message> + <message> + <location line="+111"/> + <source>Zoom In</source> + <translation>Nagyítás</translation> + </message> + <message> + <location line="+7"/> + <source>Zoom Out</source> + <translation>Kicsinyítés</translation> + </message> + <message> + <location line="+35"/> + <source>Toggle details extension</source> + <translation>Részlet kiterjesztések kapcsolgatása</translation> + </message> + <message> + <location line="+3"/> + <source>></source> + <translation>></translation> + </message> + <message> + <location line="+19"/> + <source>Linear Type</source> + <translation>Lineáris típus</translation> + </message> + <message> + <location line="+3"/> + <location line="+22"/> + <location line="+22"/> + <location line="+22"/> + <location line="+22"/> + <location line="+22"/> + <source>...</source> + <translation>...</translation> + </message> + <message> + <location line="-91"/> + <source>Radial Type</source> + <translation>Sugárirányú típus</translation> + </message> + <message> + <location line="+22"/> + <source>Conical Type</source> + <translation>Kúp alakú típus</translation> + </message> + <message> + <location line="+22"/> + <source>Pad Spread</source> + <translation>Lyuk kiterjedés</translation> + </message> + <message> + <location line="+22"/> + <source>Repeat Spread</source> + <translation>Ismétlési kiterjedés</translation> + </message> + <message> + <location line="+22"/> + <source>Reflect Spread</source> + <translation>Prizma kiterjedés</translation> + </message> +</context> +<context> + <name>QtGradientStopsWidget</name> + <message> + <location filename="../tools/shared/qtgradienteditor/qtgradientstopswidget.cpp" line="+947"/> + <source>New Stop</source> + <translation>Új leállítás</translation> + </message> + <message> + <location line="+1"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> + <message> + <location line="+1"/> + <source>Flip All</source> + <translation>Az összes feldobása</translation> + </message> + <message> + <location line="+1"/> + <source>Select All</source> + <translation>Az összes kiválasztása</translation> + </message> + <message> + <location line="+1"/> + <source>Zoom In</source> + <translation>Nagyítás</translation> + </message> + <message> + <location line="+1"/> + <source>Zoom Out</source> + <translation>Kicsinyítés</translation> + </message> + <message> + <location line="+1"/> + <source>Reset Zoom</source> + <translation>Zoom újraindítása</translation> + </message> +</context> +<context> + <name>QtGradientView</name> + <message> + <location filename="../tools/shared/qtgradienteditor/qtgradientview.cpp" line="+107"/> + <source>Grad</source> + <translation>Diplomás</translation> + </message> + <message> + <location line="+26"/> + <source>Remove Gradient</source> + <translation>Meredekség eltávolítása</translation> + </message> + <message> + <location line="+1"/> + <source>Are you sure you want to remove the selected gradient?</source> + <translation>El szeretné távolítani a kiválasztott meredekséget?</translation> + </message> + <message> + <location filename="../tools/shared/qtgradienteditor/qtgradientview.ui" line="+39"/> + <location filename="../tools/shared/qtgradienteditor/qtgradientview.cpp" line="+74"/> + <source>New...</source> + <translation>Új...</translation> + </message> + <message> + <location line="+19"/> + <location filename="../tools/shared/qtgradienteditor/qtgradientview.cpp" line="+1"/> + <source>Edit...</source> + <translation>Szerkesztés...</translation> + </message> + <message> + <location line="+19"/> + <location filename="../tools/shared/qtgradienteditor/qtgradientview.cpp" line="+1"/> + <source>Rename</source> + <translation>Átnevezés</translation> + </message> + <message> + <location line="+19"/> + <location filename="../tools/shared/qtgradienteditor/qtgradientview.cpp" line="+1"/> + <source>Remove</source> + <translation>Eltávolítás</translation> + </message> + <message> + <location line="-83"/> + <source>Gradient View</source> + <translation>Meredekség nézet</translation> + </message> +</context> +<context> + <name>QtGradientViewDialog</name> + <message> + <location filename="../tools/shared/qtgradienteditor/qtgradientviewdialog.ui" line="+53"/> + <source>Select Gradient</source> + <translation>Meredekség kiválasztása</translation> + </message> +</context> +<context> + <name>QtKeySequenceEdit</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp" line="+221"/> + <source>Clear Shortcut</source> + <translation>Gyorsbillentyű kitisztítása</translation> + </message> +</context> +<context> + <name>QtLocalePropertyManager</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertymanager.cpp" line="-3541"/> + <source>%1, %2</source> + <translation>%1, %2</translation> + </message> + <message> + <location line="+53"/> + <source>Language</source> + <translation>Nyelv</translation> + </message> + <message> + <location line="+8"/> + <source>Country</source> + <translation>Ország</translation> + </message> +</context> +<context> + <name>QtPointFPropertyManager</name> + <message> + <location line="+411"/> + <source>(%1, %2)</source> + <translation>(%1, %2)</translation> + </message> + <message> + <location line="+71"/> + <source>X</source> + <translation>X</translation> + </message> + <message> + <location line="+8"/> + <source>Y</source> + <translation>Y</translation> + </message> +</context> +<context> + <name>QtPointPropertyManager</name> + <message> + <location line="-320"/> + <source>(%1, %2)</source> + <translation>(%1, %2)</translation> + </message> + <message> + <location line="+37"/> + <source>X</source> + <translation>X</translation> + </message> + <message> + <location line="+7"/> + <source>Y</source> + <translation>Y</translation> + </message> +</context> +<context> + <name>QtPropertyBrowserUtils</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp" line="-136"/> + <source>[%1, %2, %3] (%4)</source> + <translation>[%1, %2, %3] (%4)</translation> + </message> + <message> + <location line="+30"/> + <source>[%1, %2]</source> + <translation>[%1, %2]</translation> + </message> +</context> +<context> + <name>QtRectFPropertyManager</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertymanager.cpp" line="+1706"/> + <source>[(%1, %2), %3 x %4]</source> + <translation>[(%1, %2), %3 x %4]</translation> + </message> + <message> + <location line="+156"/> + <source>X</source> + <translation>X</translation> + </message> + <message> + <location line="+8"/> + <source>Y</source> + <translation>Y</translation> + </message> + <message> + <location line="+8"/> + <source>Width</source> + <translation>Szélesség</translation> + </message> + <message> + <location line="+9"/> + <source>Height</source> + <translation>Magasság</translation> + </message> +</context> +<context> + <name>QtRectPropertyManager</name> + <message> + <location line="-612"/> + <source>[(%1, %2), %3 x %4]</source> + <translation>[(%1, %2), %3 x %4]</translation> + </message> + <message> + <location line="+120"/> + <source>X</source> + <translation>X</translation> + </message> + <message> + <location line="+7"/> + <source>Y</source> + <translation>Y</translation> + </message> + <message> + <location line="+7"/> + <source>Width</source> + <translation>Szélesség</translation> + </message> + <message> + <location line="+8"/> + <source>Height</source> + <translation>Magasság</translation> + </message> +</context> +<context> + <name>QtResourceEditorDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/qtresourceeditordialog.cpp" line="+76"/> + <source>%1 already exists. +Do you want to replace it?</source> + <translation>%1 már létezik. +Le szeretné cserélni?</translation> + </message> + <message> + <location line="+5"/> + <source>The file does not appear to be a resource file; element '%1' was found where '%2' was expected.</source> + <translation>A fájl nem egy erőforrás fájl, '%1' elem található, ahol '%2' a várt.</translation> + </message> + <message> + <location line="+902"/> + <source>%1 [read-only]</source> + <translation>%1 [csak olvasható]</translation> + </message> + <message> + <location line="+2"/> + <location line="+198"/> + <source>%1 [missing]</source> + <translation>%1 [hiányzik]</translation> + </message> + <message> + <location line="-72"/> + <source><no prefix></source> + <translation><nincs előtag></translation> + </message> + <message> + <location line="+320"/> + <location line="+566"/> + <source>New Resource File</source> + <translation>Új erőforrás fájl</translation> + </message> + <message> + <location line="-564"/> + <location line="+25"/> + <source>Resource files (*.qrc)</source> + <translation>Erőforrás fájlok (*.qrc)</translation> + </message> + <message> + <location line="-2"/> + <source>Import Resource File</source> + <translation>Erőforrás fájl importálása</translation> + </message> + <message> + <location line="+112"/> + <source>newPrefix</source> + <translation>újElőtag</translation> + </message> + <message> + <location line="+16"/> + <source><p><b>Warning:</b> The file</p><p>%1</p><p>is outside of the current resource file's parent directory.</p></source> + <translation><p><b>Figyelmeztetés:</b> A(z)</p><p>%1</p><p>fájl az aktuális erőforrás fájl szülő könyvtárán kívül helyezkedik el.</p></translation> + </message> + <message> + <location line="+8"/> + <source><p>To resolve the issue, press:</p><table><tr><th align="left">Copy</th><td>to copy the file to the resource file's parent directory.</td></tr><tr><th align="left">Copy As...</th><td>to copy the file into a subdirectory of the resource file's parent directory.</td></tr><tr><th align="left">Keep</th><td>to use its current location.</td></tr></table></source> + <translation><p>A hiba megoldásához, nyomja le a következőt:</p><table><tr><th align="left">Másolás</th><td>a fájl erőforrás fájljának szülőkönyvtárába másoláshoz.</td></tr><tr><th align="left">Másolás másként...</th><td>a fájl erőforrás fájljának szülőkönyvtárának egy alkönyvtárába másoláshoz.</td></tr><tr><th align="left">Megtartás</th><td>az aktuális helyének használatához. </td></tr></table></translation> + </message> + <message> + <location line="+25"/> + <source>Add Files</source> + <translation>Fájlok hozzáadása</translation> + </message> + <message> + <location line="+21"/> + <source>Incorrect Path</source> + <translation>Helytelen útvonal</translation> + </message> + <message> + <location line="+3"/> + <location line="+19"/> + <location line="+212"/> + <location line="+7"/> + <source>Copy</source> + <translation>Másolás</translation> + </message> + <message> + <location line="-236"/> + <source>Copy As...</source> + <translation>Másolás, mint...</translation> + </message> + <message> + <location line="+2"/> + <source>Keep</source> + <translation>Megtartás</translation> + </message> + <message> + <location line="+2"/> + <source>Skip</source> + <translation>Kihagyás</translation> + </message> + <message> + <location line="+87"/> + <source>Clone Prefix</source> + <translation>Előtag klónozása</translation> + </message> + <message> + <location line="+1"/> + <source>Enter the suffix which you want to add to the names of the cloned files. +This could for example be a language extension like "_de".</source> + <translation>Gépelje be az utótagot, melyet hozzá akar adni a klónozott fájl nevekhez. +Ez például egy nyelv kiterjesztés lenne, úgy mint "_de".</translation> + </message> + <message> + <location line="+113"/> + <location line="+4"/> + <source>Copy As</source> + <translation>Másolás, mint</translation> + </message> + <message> + <location line="+1"/> + <source><p>The selected file:</p><p>%1</p><p>is outside of the current resource file's directory:</p><p>%2</p><p>Please select another path within this directory.<p></source> + <translation><p>A kiválaszott fájl:</p><p>%1</p><p>az aktuális erőforrás fájl könytárán kívül helyezkedik el:</p><p>%2</p><p>Kérem válasszon másik útvonalat ezen a könyvtáron belül.<p></translation> + </message> + <message> + <location line="+20"/> + <source>Could not overwrite %1.</source> + <translation>Nem sikerült felülírni %1.</translation> + </message> + <message> + <location line="+7"/> + <source>Could not copy +%1 +to +%2</source> + <translation>Nem sikerült másolni +%1 +ide +%2</translation> + </message> + <message> + <location line="+35"/> + <source>A parse error occurred at line %1, column %2 of %3: +%4</source> + <translation>Egy elemzési hiba történt %3 %1 sorában, %2 oszlopában: +%4</translation> + </message> + <message> + <location line="+12"/> + <source>Save Resource File</source> + <translation>Erőforrás fájl mentése</translation> + </message> + <message> + <location line="+1"/> + <source>Could not write %1: %2</source> + <translation>Nem sikerült írni %1: %2</translation> + </message> + <message> + <location line="+33"/> + <source>Edit Resources</source> + <translation>Erőforrások szerkesztése</translation> + </message> + <message> + <location line="+35"/> + <source>New...</source> + <translation>Új...</translation> + </message> + <message> + <location line="+2"/> + <source>Open...</source> + <translation>Megnyitás...</translation> + </message> + <message> + <location line="+1"/> + <source>Open Resource File</source> + <translation>Erőforrás fájl megnyitása</translation> + </message> + <message> + <location line="+1"/> + <location line="+11"/> + <source>Remove</source> + <translation>Eltávolítás</translation> + </message> + <message> + <location line="-10"/> + <location line="+11"/> + <source>Move Up</source> + <translation>Mozgatás felfelé</translation> + </message> + <message> + <location line="-10"/> + <location line="+11"/> + <source>Move Down</source> + <translation>Mozgatás lefelé</translation> + </message> + <message> + <location line="-9"/> + <location line="+1"/> + <source>Add Prefix</source> + <translation>Előtag hozzáadása</translation> + </message> + <message> + <location line="+1"/> + <source>Add Files...</source> + <translation>Fájlok hozzáadása...</translation> + </message> + <message> + <location line="+1"/> + <source>Change Prefix</source> + <translation>Előtag megváltoztatása</translation> + </message> + <message> + <location line="+1"/> + <source>Change Language</source> + <translation>Nyelv megváltoztatása</translation> + </message> + <message> + <location line="+1"/> + <source>Change Alias</source> + <translation>Álnév megváltoztatása</translation> + </message> + <message> + <location line="+1"/> + <source>Clone Prefix...</source> + <translation>Előtag klónozása...</translation> + </message> + <message> + <location line="+37"/> + <source>Prefix / Path</source> + <translation>Előtag / Útvonal</translation> + </message> + <message> + <location line="+1"/> + <source>Language / Alias</source> + <translation>Nyelv / Álnév</translation> + </message> + <message> + <location line="+117"/> + <source><html><p><b>Warning:</b> There have been problems while reloading the resources:</p><pre>%1</pre></html></source> + <translation><html><p><b>Figyelmeztetés:</b> Hibák történtek az erőforrások újra töltése közben:</p><pre>%1</pre></html></translation> + </message> + <message> + <location line="+2"/> + <source>Resource Warning</source> + <translation>Erőforrás figyelmeztetés</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/qtresourceeditordialog.ui" line="+13"/> + <source>Dialog</source> + <translation>Párbeszéd ablak</translation> + </message> + <message> + <location line="+26"/> + <source>New File</source> + <translation>Új fájl</translation> + </message> + <message> + <location line="+3"/> + <location line="+50"/> + <source>N</source> + <translation>N</translation> + </message> + <message> + <location line="-43"/> + <source>Remove File</source> + <translation>Fájl eltávolítása</translation> + </message> + <message> + <location line="+3"/> + <location line="+57"/> + <source>R</source> + <translation>R</translation> + </message> + <message> + <location line="-34"/> + <source>I</source> + <translation>I</translation> + </message> + <message> + <location line="+14"/> + <source>New Resource</source> + <translation>Új erőforrás</translation> + </message> + <message> + <location line="+10"/> + <source>A</source> + <translation>A</translation> + </message> + <message> + <location line="+7"/> + <source>Remove Resource or File</source> + <translation>Erőforrás vagy fájl eltávolítása</translation> + </message> +</context> +<context> + <name>QtResourceView</name> + <message> + <location filename="../tools/designer/src/lib/shared/qtresourceview.cpp" line="+566"/> + <source>Size: %1 x %2 +%3</source> + <translation>Méret: %1 x %2 +%3</translation> + </message> + <message> + <location line="+20"/> + <source>Edit Resources...</source> + <translation>Erőforrások szerkesztése...</translation> + </message> + <message> + <location line="+6"/> + <source>Reload</source> + <translation>Újratöltés</translation> + </message> + <message> + <location line="+7"/> + <source>Copy Path</source> + <translation>Útvonal másolása</translation> + </message> +</context> +<context> + <name>QtResourceViewDialog</name> + <message> + <location line="+250"/> + <source>Select Resource</source> + <translation>Erőforrás kiválasztása</translation> + </message> +</context> +<context> + <name>QtSizeFPropertyManager</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qtpropertymanager.cpp" line="-535"/> + <source>%1 x %2</source> + <translation>%1 x %2</translation> + </message> + <message> + <location line="+130"/> + <source>Width</source> + <translation>Szélesség</translation> + </message> + <message> + <location line="+9"/> + <source>Height</source> + <translation>Magasság</translation> + </message> +</context> +<context> + <name>QtSizePolicyPropertyManager</name> + <message> + <location line="+1709"/> + <location line="+1"/> + <source><Invalid></source> + <translation><Érvénytelen></translation> + </message> + <message> + <location line="+1"/> + <source>[%1, %2, %3, %4]</source> + <translation>[%1, %2, %3, %4]</translation> + </message> + <message> + <location line="+45"/> + <source>Horizontal Policy</source> + <translation>Horizontális irányvonal</translation> + </message> + <message> + <location line="+9"/> + <source>Vertical Policy</source> + <translation>Vertikális irányelv</translation> + </message> + <message> + <location line="+9"/> + <source>Horizontal Stretch</source> + <translation>Horizontális terjedelem</translation> + </message> + <message> + <location line="+8"/> + <source>Vertical Stretch</source> + <translation>Vertikális terjedelem</translation> + </message> +</context> +<context> + <name>QtSizePropertyManager</name> + <message> + <location line="-2286"/> + <source>%1 x %2</source> + <translation>%1 x %2</translation> + </message> + <message> + <location line="+96"/> + <source>Width</source> + <translation>Szélesség</translation> + </message> + <message> + <location line="+8"/> + <source>Height</source> + <translation>Magasság</translation> + </message> +</context> +<context> + <name>QtToolBarDialog</name> + <message> + <location filename="../tools/shared/qttoolbardialog/qttoolbardialog.cpp" line="+1240"/> + <source>Custom Toolbar</source> + <translation>Egyéni eszköz sáv</translation> + </message> + <message> + <location line="+544"/> + <source>< S E P A R A T O R ></source> + <translation>< E L V Á L A S Z T Ó ></translation> + </message> + <message> + <location filename="../tools/shared/qttoolbardialog/qttoolbardialog.ui" line="+13"/> + <source>Customize Toolbars</source> + <translation>Eszköz sávok testreszabása</translation> + </message> + <message> + <location line="+13"/> + <source>1</source> + <translation>1</translation> + </message> + <message> + <location line="+8"/> + <source>Actions</source> + <translation>Tevékenységek</translation> + </message> + <message> + <location line="+15"/> + <source>Toolbars</source> + <translation>Eszköz sávok</translation> + </message> + <message> + <location line="+7"/> + <source>Add new toolbar</source> + <translation>Új eszköz sáv hozzáadása</translation> + </message> + <message> + <location line="+3"/> + <source>New</source> + <translation>Új</translation> + </message> + <message> + <location line="+7"/> + <source>Remove selected toolbar</source> + <translation>Kiválaszott eszköz sáv eltávolítás</translation> + </message> + <message> + <location line="+3"/> + <source>Remove</source> + <translation>Eltávolítás</translation> + </message> + <message> + <location line="+7"/> + <source>Rename toolbar</source> + <translation>Eszköz sáv átnevezése</translation> + </message> + <message> + <location line="+3"/> + <source>Rename</source> + <translation>Átnevezés</translation> + </message> + <message> + <location line="+23"/> + <source>Move action up</source> + <translation>Tevékenység mozgatása felfelé</translation> + </message> + <message> + <location line="+3"/> + <source>Up</source> + <translation>Fel</translation> + </message> + <message> + <location line="+13"/> + <source>Remove action from toolbar</source> + <translation>Tevékenység eltávolítása az eszköz sávról</translation> + </message> + <message> + <location line="+3"/> + <source><-</source> + <translation><-</translation> + </message> + <message> + <location line="+13"/> + <source>Add action to toolbar</source> + <translation>Tevékenység hozzáadása az eszközsávhoz</translation> + </message> + <message> + <location line="+3"/> + <source>-></source> + <translation>-></translation> + </message> + <message> + <location line="+13"/> + <source>Move action down</source> + <translation>Tevékenység mozgatása felfele</translation> + </message> + <message> + <location line="+3"/> + <source>Down</source> + <translation>Le</translation> + </message> + <message> + <location line="+25"/> + <source>Current Toolbar Actions</source> + <translation>Aktuális eszköz sáv tevékenységek</translation> + </message> +</context> +<context> + <name>QtTreePropertyBrowser</name> + <message> + <location filename="../tools/shared/qtpropertybrowser/qttreepropertybrowser.cpp" line="+442"/> + <source>Property</source> + <translation>Tulajdonság</translation> + </message> + <message> + <location line="+1"/> + <source>Value</source> + <translation>Érték</translation> + </message> +</context> +<context> + <name>SaveFormAsTemplate</name> + <message> + <location filename="../tools/designer/src/designer/saveformastemplate.cpp" line="+72"/> + <source>Add path...</source> + <translation>Útvonal hozzáadása...</translation> + </message> + <message> + <location line="+23"/> + <source>Template Exists</source> + <translation>A sablon létezik</translation> + </message> + <message> + <location line="+1"/> + <source>A template with the name %1 already exists. +Do you want overwrite the template?</source> + <translation>Egy %1 nevű sablon már létezik. +Felül szeretné írni a sablont?</translation> + </message> + <message> + <location line="+3"/> + <source>Overwrite Template</source> + <translation>Sablom felülírása</translation> + </message> + <message> + <location line="+7"/> + <source>Open Error</source> + <translation>Megnyitási hiba</translation> + </message> + <message> + <location line="+1"/> + <source>There was an error opening template %1 for writing. Reason: %2</source> + <translation>Hiba történt a(z) %1 sablon írásra megnyitása közben. Ok: %2</translation> + </message> + <message> + <location line="+13"/> + <source>Write Error</source> + <translation>Írása hiba</translation> + </message> + <message> + <location line="+1"/> + <source>There was an error writing the template %1 to disk. Reason: %2</source> + <translation>Hiba történt a(z) %1 sablon lemezre írása közben. Ok: %2</translation> + </message> + <message> + <location line="+27"/> + <source>Pick a directory to save templates in</source> + <translation>Egy könyvtár gondos kiválasztása, melybe a könytárak lesznek elmentve</translation> + </message> + <message> + <location filename="../tools/designer/src/designer/saveformastemplate.ui" line="+45"/> + <source>Save Form As Template</source> + <translation>Az űrlap sablonként mentése</translation> + </message> + <message> + <location line="+49"/> + <source>&Category:</source> + <translation>&Kategória:</translation> + </message> + <message> + <location line="-35"/> + <source>&Name:</source> + <translation>&Név:</translation> + </message> +</context> +<context> + <name>ScriptErrorDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/scripterrordialog.cpp" line="+59"/> + <source>An error occurred while running the scripts for "%1": +</source> + <translation>Hiba történt a szkriptek futtatása közben '%1'-re:</translation> + </message> +</context> +<context> + <name>SelectSignalDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/selectsignaldialog.ui" line="+14"/> + <source>Go to slot</source> + <translation>Szlotra ugrás</translation> + </message> + <message> + <location line="+6"/> + <source>Select signal</source> + <translation>Jel kiválasztása</translation> + </message> + <message> + <location line="+13"/> + <source>signal</source> + <translation>jel</translation> + </message> + <message> + <location line="+5"/> + <source>class</source> + <translation>osztály</translation> + </message> +</context> +<context> + <name>SignalSlotConnection</name> + <message> + <location filename="../tools/designer/src/components/signalsloteditor/signalsloteditor.cpp" line="-358"/> + <source>SENDER(%1), SIGNAL(%2), RECEIVER(%3), SLOT(%4)</source> + <translation>KÜLDŐ(%1), JEL(%2), FOGADÓ(%3), SZLOT(%4)</translation> + </message> +</context> +<context> + <name>SignalSlotDialogClass</name> + <message> + <location filename="../tools/designer/src/lib/shared/signalslotdialog.ui" line="+13"/> + <source>Signals and slots</source> + <translation>Jelek és szlotok</translation> + </message> + <message> + <location line="+6"/> + <source>Slots</source> + <translation>Szlotok</translation> + </message> + <message> + <location line="+11"/> + <location line="+49"/> + <source>Add</source> + <translation>Hozzáadás</translation> + </message> + <message> + <location line="-46"/> + <location line="+10"/> + <location line="+39"/> + <location line="+10"/> + <source>...</source> + <translation>...</translation> + </message> + <message> + <location line="-52"/> + <location line="+49"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> + <message> + <location line="-21"/> + <source>Signals</source> + <translation>Jelek</translation> + </message> +</context> +<context> + <name>Spacer</name> + <message> + <location filename="../tools/designer/src/lib/shared/spacer_widget.cpp" line="+275"/> + <source>Horizontal Spacer '%1', %2 x %3</source> + <translation>Horizontális távtartók '%1', %2 x %3</translation> + </message> + <message> + <location line="+0"/> + <source>Vertical Spacer '%1', %2 x %3</source> + <translation>Vertikális távtartók '%1', %2 x %3</translation> + </message> +</context> +<context> + <name>TemplateOptionsPage</name> + <message> + <location filename="../tools/designer/src/components/formeditor/templateoptionspage.cpp" line="+156"/> + <source>Template Paths</source> + <extracomment>Tab in preferences dialog</extracomment> + <translatorcomment>Слово "пути" опустил, т.к. с другими вкладками не перепутать, а длинная вкладка не смотрится.</translatorcomment> + <translation>Sablon útvonalak</translation> + </message> +</context> +<context> + <name>ToolBarManager</name> + <message> + <location filename="../tools/designer/src/designer/mainwindow.cpp" line="+89"/> + <source>Configure Toolbars...</source> + <translation>Eszköz sávok konfigurálása...</translation> + </message> + <message> + <location line="+15"/> + <source>Window</source> + <translation>Ablak</translation> + </message> + <message> + <location line="+1"/> + <source>Help</source> + <translation>Súgó</translation> + </message> + <message> + <location line="+7"/> + <source>Style</source> + <translation>Stílus</translation> + </message> + <message> + <location line="+2"/> + <source>Dock views</source> + <translation>Dokk nézetek</translation> + </message> + <message> + <location line="+6"/> + <source>Toolbars</source> + <translation>Eszköz sávok</translation> + </message> +</context> +<context> + <name>VersionDialog</name> + <message> + <location filename="../tools/designer/src/designer/versiondialog.cpp" line="+171"/> + <source><h3>%1</h3><br/><br/>Version %2</source> + <translation><h3>%1</h3><br/><br/>Verzió %2</translation> + </message> + <message> + <location line="+1"/> + <source>Qt Designer</source> + <translation>Qt Designer</translation> + </message> + <message> + <location line="+1"/> + <source><br/>Qt Designer is a graphical user interface designer for Qt applications.<br/></source> + <translation><br/>Qt Designer egy grafikus felhasználói felület tervező Qt alkalmazásokhoz.<br/></translation> + </message> + <message> + <location line="+2"/> + <source>%1<br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</source> + <translation>%1<br/>Szerzői jog (C) 2010 Nokia vállalat és/vagy leányvállalata(i).</translation> + </message> +</context> +<context> + <name>WidgetDataBase</name> + <message> + <location filename="../tools/designer/src/lib/shared/widgetdatabase.cpp" line="+814"/> + <source>The file contains a custom widget '%1' whose base class (%2) differs from the current entry in the widget database (%3). The widget database is left unchanged.</source> + <translation>A fájl egy egyéni '%1' widget-t tartalmaz, aminek az alap osztálya (%2) különbözik az aktuális beviteltől a widget adatbázisban (%3). A widget adatbázis változatlanul lett hagyva.</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ActionEditor</name> + <message> + <location filename="../tools/designer/src/lib/shared/actioneditor.cpp" line="+123"/> + <source>New...</source> + <translation>Új...</translation> + </message> + <message> + <location line="+1"/> + <source>Edit...</source> + <translation>Szerkesztés...</translation> + </message> + <message> + <location line="+1"/> + <source>Go to slot...</source> + <translation>Ugrás a szlotra...</translation> + </message> + <message> + <location line="+1"/> + <source>Copy</source> + <translation>Másolás</translation> + </message> + <message> + <location line="+1"/> + <source>Cut</source> + <translation>Kivágás</translation> + </message> + <message> + <location line="+1"/> + <source>Paste</source> + <translation>Beillesztés</translation> + </message> + <message> + <location line="+1"/> + <source>Select all</source> + <translation>Az összes kiválasztása</translation> + </message> + <message> + <location line="+1"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> + <message> + <location line="+9"/> + <source>Actions</source> + <translation>Tevékenységek</translation> + </message> + <message> + <location line="+49"/> + <source>Configure Action Editor</source> + <translation>Tevékenység szerkesztő konfigurálása</translation> + </message> + <message> + <location line="+3"/> + <source>Icon View</source> + <translation>Ikon nézet</translation> + </message> + <message> + <location line="+6"/> + <source>Detailed View</source> + <translation>Részletezett nézet</translation> + </message> + <message> + <location line="+246"/> + <source>New action</source> + <translation>Új tevékenység</translation> + </message> + <message> + <location line="+98"/> + <source>Edit action</source> + <translation>Tevékenység szerkesztése</translation> + </message> + <message> + <location line="+69"/> + <source>Remove action '%1'</source> + <translation>'%1' tevékenység eltávolítása</translation> + </message> + <message> + <location line="+0"/> + <source>Remove actions</source> + <translation>Tevékenységek eltávolítása</translation> + </message> + <message> + <location line="+186"/> + <source>Used In</source> + <translation>Használva ebben</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ActionModel</name> + <message> + <location filename="../tools/designer/src/lib/shared/actionrepository.cpp" line="+95"/> + <source>Name</source> + <translation>Név</translation> + </message> + <message> + <location line="+1"/> + <source>Used</source> + <translation>Használt</translation> + </message> + <message> + <location line="+1"/> + <source>Text</source> + <translation>Szöveg</translation> + </message> + <message> + <location line="+1"/> + <source>Shortcut</source> + <translation>Rövidebb út</translation> + </message> + <message> + <location line="+1"/> + <source>Checkable</source> + <translation>Leellenőrizhető</translation> + </message> + <message> + <location line="+1"/> + <source>ToolTip</source> + <translation>Eszköz tipp</translation> + </message> +</context> +<context> + <name>qdesigner_internal::BrushManagerProxy</name> + <message> + <location filename="../tools/designer/src/components/formeditor/brushmanagerproxy.cpp" line="+219"/> + <source>The element '%1' is missing the required attribute '%2'.</source> + <translation>A(z) '%1' elem hiányzik, a szükséges attribútum '%2'.</translation> + </message> + <message> + <location line="+11"/> + <source>Empty brush name encountered.</source> + <translation>Üres kefe nevet talált.</translation> + </message> + <message> + <location line="+10"/> + <source>An unexpected element '%1' was encountered.</source> + <translation>Egy '%1' váratlan elemet talált.</translation> + </message> + <message> + <location line="+7"/> + <source>An error occurred when reading the brush definition file '%1' at line line %2, column %3: %4</source> + <translation>Hiba történt a(z) '%1' ecset definíciós fájl olvasása közben %2 sorban, %3 oszlopban: %4</translation> + </message> + <message> + <location line="+43"/> + <source>An error occurred when reading the resource file '%1' at line %2, column %3: %4</source> + <translation>Hiba történt a(z) '%1' erőforrás fájl olvasása közben, %2 sorban, %3 oszlopban: %4</translation> + </message> +</context> +<context> + <name>qdesigner_internal::BuddyEditor</name> + <message> + <location filename="../tools/designer/src/components/buddyeditor/buddyeditor.cpp" line="+261"/> + <source>Add buddy</source> + <translation>Haver hozzáadása</translation> + </message> + <message> + <location line="+52"/> + <source>Remove buddies</source> + <translation>Haverok eltávolítása</translation> + </message> + <message numerus="yes"> + <location line="+24"/> + <source>Remove %n buddies</source> + <translation> + <numerusform>%n haverok eltávolítása</numerusform> + </translation> + </message> + <message numerus="yes"> + <location line="+51"/> + <source>Add %n buddies</source> + <translation> + <numerusform>%n haver hozzáadása</numerusform> + </translation> + </message> + <message> + <location line="+47"/> + <source>Set automatically</source> + <translation>Automatikus beállítás</translation> + </message> +</context> +<context> + <name>qdesigner_internal::BuddyEditorPlugin</name> + <message> + <location filename="../tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp" line="+73"/> + <source>Edit Buddies</source> + <translation>Haverok szerkesztése</translation> + </message> +</context> +<context> + <name>qdesigner_internal::BuddyEditorTool</name> + <message> + <location filename="../tools/designer/src/components/buddyeditor/buddyeditor_tool.cpp" line="+56"/> + <source>Edit Buddies</source> + <translation>Haverok szerkesztése</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ButtonGroupMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/button_taskmenu.cpp" line="+7"/> + <source>Select members</source> + <translation>Tagok kiválasztása</translation> + </message> + <message> + <location line="+1"/> + <source>Break</source> + <translation>Törés</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ButtonTaskMenu</name> + <message> + <location line="+121"/> + <source>Assign to button group</source> + <translation>Gomb csoporthoz rendelés</translation> + </message> + <message> + <location line="+2"/> + <source>Button group</source> + <translation>Gomb csoport</translation> + </message> + <message> + <location line="+1"/> + <source>New button group</source> + <translation>Új gomb csoport</translation> + </message> + <message> + <location line="+1"/> + <source>Change text...</source> + <translation>Szöveg megváltoztatása...</translation> + </message> + <message> + <location line="+1"/> + <source>None</source> + <translation>Semmi</translation> + </message> + <message> + <location line="+101"/> + <source>Button group '%1'</source> + <translation>'%1' gomb csoport</translation> + </message> +</context> +<context> + <name>qdesigner_internal::CodeDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/codedialog.cpp" line="+95"/> + <source>Save...</source> + <translation>Mentés...</translation> + </message> + <message> + <location line="+4"/> + <source>Copy All</source> + <translation>Az összes másolása</translation> + </message> + <message> + <location line="+5"/> + <source>&Find in Text...</source> + <translation>&Keresés szövegben...</translation> + </message> + <message> + <location line="+75"/> + <source>A temporary form file could not be created in %1.</source> + <translation>Egy átmeneti űrlap fájlt nem sikerült létrehozni %1-ben.</translation> + </message> + <message> + <location line="+6"/> + <source>The temporary form file %1 could not be written.</source> + <translation>A(z) %1 átmeneti űrlap fájlt nem sikerült írni.</translation> + </message> + <message> + <location line="+21"/> + <source>%1 - [Code]</source> + <translation>%1 - [Kód]</translation> + </message> + <message> + <location line="+23"/> + <source>Save Code</source> + <translation>Kód mentése</translation> + </message> + <message> + <location line="+0"/> + <source>Header Files (*.%1)</source> + <translation>Fejállományok (*.%1)</translation> + </message> + <message> + <location line="+6"/> + <source>The file %1 could not be opened: %2</source> + <translation>A(z) %1 fájlt nem sikerült megnyitni: %2</translation> + </message> + <message> + <location line="+5"/> + <source>The file %1 could not be written: %2</source> + <translation>A(z) %1 fájlt nem sikerült írni: %2</translation> + </message> + <message> + <location line="+11"/> + <source>%1 - Error</source> + <translation>%1 - Hiba</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ColorAction</name> + <message> + <location filename="../tools/designer/src/lib/shared/richtexteditor.cpp" line="+246"/> + <source>Text Color</source> + <translation>Szöveg szín</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ComboBoxTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/combobox_taskmenu.cpp" line="+68"/> + <source>Edit Items...</source> + <translation>Elemek szerkesztése...</translation> + </message> + <message> + <location line="+38"/> + <source>Change Combobox Contents</source> + <translation>Combobox tartalmának megváltoztatása</translation> + </message> +</context> +<context> + <name>qdesigner_internal::CommandLinkButtonTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/button_taskmenu.cpp" line="+156"/> + <source>Change description...</source> + <translation>Leírás megváltoztatása...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ConnectionEdit</name> + <message> + <location filename="../tools/designer/src/lib/shared/connectionedit.cpp" line="+1313"/> + <source>Select All</source> + <translation>Az összes kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Deselect All</source> + <translation>Az összes kijelölés eltűntetése</translation> + </message> + <message> + <location line="+5"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ConnectionModel</name> + <message> + <location filename="../tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp" line="-465"/> + <source>Sender</source> + <translation>Küldő</translation> + </message> + <message> + <location line="+1"/> + <source>Signal</source> + <translation>Jel</translation> + </message> + <message> + <location line="+1"/> + <source>Receiver</source> + <translation>Fogadó</translation> + </message> + <message> + <location line="+1"/> + <source>Slot</source> + <translation>Szlot</translation> + </message> + <message> + <location line="+90"/> + <source><sender></source> + <translation><küldő></translation> + </message> + <message> + <location line="+1"/> + <source><signal></source> + <translation><jel></translation> + </message> + <message> + <location line="+1"/> + <source><receiver></source> + <translation><fogadó></translation> + </message> + <message> + <location line="+1"/> + <source><slot></source> + <translation><szlot></translation> + </message> + <message> + <location line="+108"/> + <source>The connection already exists!<br>%1</source> + <translation>A kapcsolat már létezik!<br>%1</translation> + </message> + <message> + <location line="+2"/> + <source>Signal and Slot Editor</source> + <translation>Jel és Szlot szerkesztő</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ContainerWidgetTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/containerwidget_taskmenu.cpp" line="+79"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> + <message> + <location line="+25"/> + <source>Insert</source> + <translation>Beszúrás</translation> + </message> + <message> + <location line="+3"/> + <source>Insert Page Before Current Page</source> + <translation>Lap beszúrása az aktuális lap elé</translation> + </message> + <message> + <location line="+4"/> + <source>Insert Page After Current Page</source> + <translation>Lap beszúrása az aktuális lap után</translation> + </message> + <message> + <location line="+8"/> + <source>Add Subwindow</source> + <translation>Alablak hozzáadása</translation> + </message> + <message> + <location line="+38"/> + <source>Subwindow</source> + <translation>Al ablak</translation> + </message> + <message> + <location line="+2"/> + <source>Page</source> + <translation>Lap</translation> + </message> + <message> + <location line="+1"/> + <source>Page %1 of %2</source> + <translation>%2 %1 lapja</translation> + </message> +</context> +<context> + <name>qdesigner_internal::DPI_Chooser</name> + <message> + <location filename="../tools/designer/src/components/formeditor/dpi_chooser.cpp" line="+27"/> + <source>System (%1 x %2)</source> + <extracomment>System resolution</extracomment> + <translation>Rendszer (%1 x %2)</translation> + </message> + <message> + <location line="+7"/> + <source>User defined</source> + <translation>Felhasználó által definiált</translation> + </message> + <message> + <location line="+18"/> + <source> x </source> + <extracomment>DPI X/Y separator</extracomment> + <translation> x </translation> + </message> +</context> +<context> + <name>qdesigner_internal::DesignerPropertyManager</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/designerpropertymanager.cpp" line="+647"/> + <location line="+6"/> + <source>AlignLeft</source> + <translation>IgazításBalra</translation> + </message> + <message> + <location line="-5"/> + <source>AlignHCenter</source> + <translation>IgazításHKözépre</translation> + </message> + <message> + <location line="+1"/> + <source>AlignRight</source> + <translation>IgazításJobbra</translation> + </message> + <message> + <location line="+1"/> + <source>AlignJustify</source> + <translation>IgazításFeloldása</translation> + </message> + <message> + <location line="+9"/> + <source>AlignTop</source> + <translation>IgazításTetejére</translation> + </message> + <message> + <location line="+1"/> + <location line="+4"/> + <source>AlignVCenter</source> + <translation>IgazításVKözépre</translation> + </message> + <message> + <location line="-3"/> + <source>AlignBottom</source> + <translation>IgazításAlulra</translation> + </message> + <message> + <location line="+565"/> + <source>%1, %2</source> + <translation>%1, %2</translation> + </message> + <message numerus="yes"> + <location line="+6"/> + <source>Customized (%n roles)</source> + <translation> + <numerusform>Testreszabva (%n szabály)</numerusform> + </translation> + </message> + <message> + <location line="+1"/> + <source>Inherited</source> + <translation>Örökölt</translation> + </message> + <message> + <location line="+566"/> + <source>Horizontal</source> + <translation>Horizontális</translation> + </message> + <message> + <location line="+9"/> + <source>Vertical</source> + <translation>Vertikális</translation> + </message> + <message> + <location line="+15"/> + <source>Normal Off</source> + <translation>Normál ki</translation> + </message> + <message> + <location line="+1"/> + <source>Normal On</source> + <translation>Normál be</translation> + </message> + <message> + <location line="+1"/> + <source>Disabled Off</source> + <translation>Tiltás ki</translation> + </message> + <message> + <location line="+1"/> + <source>Disabled On</source> + <translation>Tiltás be</translation> + </message> + <message> + <location line="+1"/> + <source>Active Off</source> + <translation>Aktív ki</translation> + </message> + <message> + <location line="+1"/> + <source>Active On</source> + <translation>Aktív be</translation> + </message> + <message> + <location line="+1"/> + <source>Selected Off</source> + <translation>Kiválasztás ki</translation> + </message> + <message> + <location line="+1"/> + <source>Selected On</source> + <translation>Kiválasztás be</translation> + </message> + <message> + <location line="+7"/> + <location line="+21"/> + <source>translatable</source> + <translation>fordítható</translation> + </message> + <message> + <location line="-15"/> + <location line="+21"/> + <source>disambiguation</source> + <translation>Nem félreérthető</translation> + </message> + <message> + <location line="-15"/> + <location line="+21"/> + <source>comment</source> + <translation>megjegyzés</translation> + </message> +</context> +<context> + <name>qdesigner_internal::DeviceProfileDialog</name> + <message> + <location filename="../tools/designer/src/components/formeditor/deviceprofiledialog.cpp" line="+63"/> + <source>Device Profiles (*.%1)</source> + <translation>Eszköz profilok (*.%1)</translation> + </message> + <message> + <location line="+31"/> + <source>Default</source> + <translation>Alapértelmezett</translation> + </message> + <message> + <location line="+67"/> + <source>Save Profile</source> + <translation>Profil mentése</translation> + </message> + <message> + <location line="+10"/> + <source>Save Profile - Error</source> + <translation>Profil mentése - Hiba</translation> + </message> + <message> + <location line="+0"/> + <source>Unable to open the file '%1' for writing: %2</source> + <translation>Nem lehet megnyitni a(z) '%1' fájlt írásra: %2</translation> + </message> + <message> + <location line="+8"/> + <source>Open profile</source> + <translation>Profil megnyitása</translation> + </message> + <message> + <location line="+6"/> + <location line="+6"/> + <source>Open Profile - Error</source> + <translation>Profil megnyitása - Hiba</translation> + </message> + <message> + <location line="-6"/> + <source>Unable to open the file '%1' for reading: %2</source> + <translation>Nem lehet megnyitni a(z) '%1' fájlt olvasásra: %2</translation> + </message> + <message> + <location line="+6"/> + <source>'%1' is not a valid profile: %2</source> + <translation>'%1' nem egy érvényes profil: %2</translation> + </message> +</context> +<context> + <name>qdesigner_internal::Dialog</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/stringlisteditor.ui" line="+53"/> + <source>Dialog</source> + <translation>Párbeszéd ablak</translation> + </message> + <message> + <location line="+12"/> + <source>StringList</source> + <translation>Sztring lista</translation> + </message> + <message> + <location line="+28"/> + <source>New String</source> + <translation>Új Sztring</translation> + </message> + <message> + <location line="+3"/> + <source>&New</source> + <translation>&Új</translation> + </message> + <message> + <location line="+10"/> + <source>Delete String</source> + <translation>Sztring törlése</translation> + </message> + <message> + <location line="+3"/> + <source>&Delete</source> + <translation>&Törlés</translation> + </message> + <message> + <location line="+33"/> + <source>&Value:</source> + <translation>&Érték:</translation> + </message> + <message> + <location line="+38"/> + <source>Move String Up</source> + <translation>Sztring felfelé mozgatása</translation> + </message> + <message> + <location line="+3"/> + <source>Up</source> + <translation>Fel</translation> + </message> + <message> + <location line="+7"/> + <source>Move String Down</source> + <translation>Sztring lefelé mozgatása</translation> + </message> + <message> + <location line="+3"/> + <source>Down</source> + <translation>Le</translation> + </message> +</context> +<context> + <name>qdesigner_internal::EmbeddedOptionsControl</name> + <message> + <location filename="../tools/designer/src/components/formeditor/embeddedoptionspage.cpp" line="-260"/> + <source>None</source> + <translation>Semmi</translation> + </message> + <message> + <location line="+4"/> + <source>Add a profile</source> + <translation>Egy profil hozzáadása</translation> + </message> + <message> + <location line="+6"/> + <source>Edit the selected profile</source> + <translation>A kiválasztott profil szerkesztése</translation> + </message> + <message> + <location line="+4"/> + <source>Delete the selected profile</source> + <translation>A kiválasztott profil törlése</translation> + </message> + <message> + <location line="+22"/> + <source>Add Profile</source> + <translation>Profil hozzáadása</translation> + </message> + <message> + <location line="+7"/> + <source>New profile</source> + <translation>Új profil</translation> + </message> + <message> + <location line="+35"/> + <source>Edit Profile</source> + <translation>Profil szerkesztése</translation> + </message> + <message> + <location line="+26"/> + <source>Delete Profile</source> + <translation>Profil törlése</translation> + </message> + <message> + <location line="+1"/> + <source>Would you like to delete the profile '%1'?</source> + <translation>Törölni szeretné a(z) '%1' profilet?</translation> + </message> + <message> + <location line="+55"/> + <source>Default</source> + <translation>Alapértelmezett</translation> + </message> +</context> +<context> + <name>qdesigner_internal::FilterWidget</name> + <message> + <location filename="../tools/designer/src/lib/shared/filterwidget.cpp" line="+185"/> + <source><Filter></source> + <translation><Szűrő></translation> + </message> +</context> +<context> + <name>qdesigner_internal::FormEditor</name> + <message> + <location filename="../tools/designer/src/components/formeditor/formeditor.cpp" line="+190"/> + <source>Resource File Changed</source> + <translation>Erőforrás fájl megváltoztatva</translation> + </message> + <message> + <location line="+1"/> + <source>The file "%1" has changed outside Designer. Do you want to reload it?</source> + <translation>A(z) '%1' fájl megváltoztatták a Designer-en kívül. Újra szeretné tölteni?</translation> + </message> +</context> +<context> + <name>qdesigner_internal::FormLayoutMenu</name> + <message> + <location filename="../tools/designer/src/lib/shared/formlayoutmenu.cpp" line="+24"/> + <source>Add form layout row...</source> + <translation>Űrlap elrendezési sor hozzáadása...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::FormWindow</name> + <message> + <location filename="../tools/designer/src/components/formeditor/formwindow.cpp" line="-1267"/> + <source>Edit contents</source> + <translation>Tartalom szerkesztése</translation> + </message> + <message> + <location line="+1"/> + <source>F2</source> + <translation>F2</translation> + </message> + <message> + <location line="+774"/> + <source>Insert widget '%1'</source> + <translation>'%1' widget beszúrása</translation> + </message> + <message> + <location line="+67"/> + <source>Resize</source> + <translation>Átméretezés</translation> + </message> + <message> + <location line="+218"/> + <location line="+15"/> + <source>Key Move</source> + <translation>Kulcs mozgatás</translation> + </message> + <message numerus="yes"> + <location line="+211"/> + <source>Paste %n action(s)</source> + <translation> + <numerusform>%n tevékenység beillesztése</numerusform> + </translation> + </message> + <message numerus="yes"> + <location line="+2"/> + <source>Paste %n widget(s)</source> + <translation> + <numerusform>%n widget beillesztése</numerusform> + </translation> + </message> + <message> + <location line="+1"/> + <source>Paste (%1 widgets, %2 actions)</source> + <translation>Beillesztés (%1 widget-ek, %2 tevékenységek)</translation> + </message> + <message> + <location line="+56"/> + <source>Cannot paste widgets. Designer could not find a container without a layout to paste into.</source> + <translation>Nem lehet beilleszteni a widget-eket. A Designer nem talált egy tárolót sem elrendezés nélküli beillesztéshez.</translation> + </message> + <message> + <location line="+2"/> + <source>Break the layout of the container you want to paste into, select this container and then paste again.</source> + <translation>A tároló elrendezésének megtörése, ahová be akarja illeszteni, válassza ki ezt a tárolót és aztán illessze e újra.</translation> + </message> + <message> + <location line="+4"/> + <source>Paste error</source> + <translation>Beillesztési hiba</translation> + </message> + <message> + <location line="+183"/> + <source>Raise widgets</source> + <translation>Widget-ek növelése</translation> + </message> + <message> + <location line="+17"/> + <source>Lower widgets</source> + <translation>Alsó widget-ek</translation> + </message> + <message> + <location line="+204"/> + <source>Select Ancestor</source> + <translation>Ős kiválasztása</translation> + </message> + <message> + <location line="+41"/> + <source>Lay out</source> + <translation>Elrendezés</translation> + </message> + <message> + <location line="+493"/> + <location line="+55"/> + <source>Drop widget</source> + <translation>Widget ejtése</translation> + </message> + <message> + <location line="-13"/> + <source>A QMainWindow-based form does not contain a central widget.</source> + <translation>Egy QMainWindow alapú űrlap nem tartalmaz egy központi widget-et.</translation> + </message> +</context> +<context> + <name>qdesigner_internal::FormWindowBase</name> + <message> + <location filename="../tools/designer/src/lib/shared/formwindowbase.cpp" line="+393"/> + <source>Delete '%1'</source> + <translation>'%1' törlése</translation> + </message> + <message> + <location line="+0"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> +</context> +<context> + <name>qdesigner_internal::FormWindowManager</name> + <message> + <location filename="../tools/designer/src/components/formeditor/formwindowmanager.cpp" line="+364"/> + <source>Cu&t</source> + <translation>&Kivágás</translation> + </message> + <message> + <location line="+3"/> + <source>Cuts the selected widgets and puts them on the clipboard</source> + <translation>A kiválaszott widget-ek kivágása és vágólapra helyezése</translation> + </message> + <message> + <location line="+5"/> + <source>&Copy</source> + <translation>&Másolás</translation> + </message> + <message> + <location line="+3"/> + <source>Copies the selected widgets to the clipboard</source> + <translation>A kiválasztott widget-ek vágólapra másolása</translation> + </message> + <message> + <location line="+5"/> + <source>&Paste</source> + <translation>&Beillesztés</translation> + </message> + <message> + <location line="+3"/> + <source>Pastes the clipboard's contents</source> + <translation>A vágólap tartalmának beillesztése</translation> + </message> + <message> + <location line="+5"/> + <source>&Delete</source> + <translation>&Törlés</translation> + </message> + <message> + <location line="+2"/> + <source>Deletes the selected widgets</source> + <translation>A kiválasztott widget-ek törlése</translation> + </message> + <message> + <location line="+5"/> + <source>Select &All</source> + <translation>Az &összes kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Selects all widgets</source> + <translation>Az összes widget kiválasztása</translation> + </message> + <message> + <location line="+5"/> + <source>Bring to &Front</source> + <translation>&Előre hozás</translation> + </message> + <message> + <location line="+3"/> + <location line="+1"/> + <source>Raises the selected widgets</source> + <translation>A kiválaszott widget-ek növelése</translation> + </message> + <message> + <location line="+4"/> + <source>Send to &Back</source> + <translation>&Visszaküldés</translation> + </message> + <message> + <location line="+3"/> + <location line="+1"/> + <source>Lowers the selected widgets</source> + <translation>Alsó kiválasztott widget-ek</translation> + </message> + <message> + <location line="+4"/> + <source>Adjust &Size</source> + <translation>&Méret igazítása</translation> + </message> + <message> + <location line="+3"/> + <source>Adjusts the size of the selected widget</source> + <translation>A kiválasztott widget méretének igazítása</translation> + </message> + <message> + <location line="+6"/> + <source>Lay Out &Horizontally</source> + <translation>Elrendezés &Horizontálisan</translation> + </message> + <message> + <location line="+3"/> + <source>Lays out the selected widgets horizontally</source> + <translation>A kiválaszott widget-ek horizontális elrendezése</translation> + </message> + <message> + <location line="+6"/> + <source>Lay Out &Vertically</source> + <translation>Elrendezés &vertikálisan</translation> + </message> + <message> + <location line="+3"/> + <source>Lays out the selected widgets vertically</source> + <translation>A kiválaszott widget-ek vertikális elrendezése</translation> + </message> + <message> + <location line="+7"/> + <source>Lay Out in a &Form Layout</source> + <translation>Elrendezés egy &Űrlap elrendezésben</translation> + </message> + <message> + <location line="+3"/> + <source>Lays out the selected widgets in a form layout</source> + <translation>A kiválaszott widget-ek elrendezése egy űrlap elrendezésben</translation> + </message> + <message> + <location line="+7"/> + <source>Lay Out in a &Grid</source> + <translation>Elrendezés egy &rácsban</translation> + </message> + <message> + <location line="+3"/> + <source>Lays out the selected widgets in a grid</source> + <translation>A kiválasztott widget-ek elrendezése egy rácsban</translation> + </message> + <message> + <location line="+7"/> + <source>Lay Out Horizontally in S&plitter</source> + <translation>Elrendezés Horizontálisan a &csúszkában</translation> + </message> + <message> + <location line="+3"/> + <source>Lays out the selected widgets horizontally in a splitter</source> + <translation>A kiválasztott widget-ek horizontális elrendezése egy csúszkában</translation> + </message> + <message> + <location line="+7"/> + <source>Lay Out Vertically in Sp&litter</source> + <translation>Elrendezés vertikálisan egy &csúszkában</translation> + </message> + <message> + <location line="+3"/> + <source>Lays out the selected widgets vertically in a splitter</source> + <translation>A kiválaszott widget-ek vertikális elrendezése egy csúszkában</translation> + </message> + <message> + <location line="+7"/> + <source>&Break Layout</source> + <translation>Elrendezés &törése</translation> + </message> + <message> + <location line="+3"/> + <source>Breaks the selected layout</source> + <translation>A kiválaszott elrendezés törése</translation> + </message> + <message> + <location line="+5"/> + <source>Si&mplify Grid Layout</source> + <translation>Egy&szerűsített rács elrendezés</translation> + </message> + <message> + <location line="+2"/> + <source>Removes empty columns and rows</source> + <translation>Üres oszlopok és sorok eltávolítása</translation> + </message> + <message> + <location line="+6"/> + <source>&Preview...</source> + <translation>&Előnézet...</translation> + </message> + <message> + <location line="+2"/> + <source>Preview current form</source> + <translation>Aktuális űrlap előnézet</translation> + </message> + <message> + <location line="+15"/> + <source>Form &Settings...</source> + <translation>Űrlap &beállítások...</translation> + </message> + <message> + <location line="+92"/> + <source>Break Layout</source> + <translation>Elrendezés törése</translation> + </message> + <message> + <location line="+26"/> + <source>Adjust Size</source> + <translation>Méret igazítása</translation> + </message> + <message> + <location line="+43"/> + <source>Could not create form preview</source> + <comment>Title of warning message box</comment> + <translation>Nem sikerült létrehozni az űrlap előnézetet</translation> + </message> + <message> + <location line="+341"/> + <source>Form Settings - %1</source> + <translation>Űrlap beállítások - %1</translation> + </message> +</context> +<context> + <name>qdesigner_internal::FormWindowSettings</name> + <message> + <location filename="../tools/designer/src/components/formeditor/formwindowsettings.cpp" line="+193"/> + <source>None</source> + <translation>Semmi</translation> + </message> + <message> + <location line="+1"/> + <source>Device Profile: %1</source> + <translation>Eszköz profil: %1</translation> + </message> +</context> +<context> + <name>qdesigner_internal::GridPanel</name> + <message> + <location filename="../tools/designer/src/lib/shared/gridpanel.ui" line="+13"/> + <source>Form</source> + <translation>Űrlap</translation> + </message> + <message> + <location line="+18"/> + <source>Grid</source> + <translation>Rács</translation> + </message> + <message> + <location line="+12"/> + <source>Visible</source> + <translation>Látható</translation> + </message> + <message> + <location line="+7"/> + <source>Grid &X</source> + <translation>Rács &X</translation> + </message> + <message> + <location line="+26"/> + <location line="+57"/> + <source>Snap</source> + <translation>Bepattintás</translation> + </message> + <message> + <location line="-48"/> + <source>Reset</source> + <translation>Újraindítás</translation> + </message> + <message> + <location line="+22"/> + <source>Grid &Y</source> + <translation>Rács &Y</translation> + </message> +</context> +<context> + <name>qdesigner_internal::GroupBoxTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/groupbox_taskmenu.cpp" line="+82"/> + <source>Change title...</source> + <translation>Cím változtatása...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::HtmlTextEdit</name> + <message> + <location filename="../tools/designer/src/lib/shared/richtexteditor.cpp" line="-58"/> + <source>Insert HTML entity</source> + <translation>HTML entitás beszúrása</translation> + </message> +</context> +<context> + <name>qdesigner_internal::IconSelector</name> + <message> + <location filename="../tools/designer/src/lib/shared/iconselector.cpp" line="-24"/> + <source>The pixmap file '%1' cannot be read.</source> + <translation>A(z) '%1' pixmap fájlt nem lehet olvasni.</translation> + </message> + <message> + <location line="+6"/> + <source>The file '%1' does not appear to be a valid pixmap file: %2</source> + <translation>A(z) '%1' fájlt nem egy érvényes pixmap fájl: %2</translation> + </message> + <message> + <location line="+9"/> + <source>The file '%1' could not be read: %2</source> + <translation>A(z) '%1' fájlt nem sikerült olvasni: %2</translation> + </message> + <message> + <location line="+33"/> + <source>Choose a Pixmap</source> + <translation>Egy pixmap kiválasztása</translation> + </message> + <message> + <location line="+7"/> + <source>Pixmap Read Error</source> + <translation>Pixmap olvasási hiba</translation> + </message> + <message> + <location line="+54"/> + <source>...</source> + <translation>...</translation> + </message> + <message> + <location line="+6"/> + <source>Normal Off</source> + <translation>Normál ki</translation> + </message> + <message> + <location line="+1"/> + <source>Normal On</source> + <translation>Normál be</translation> + </message> + <message> + <location line="+1"/> + <source>Disabled Off</source> + <translation>Tiltás ki</translation> + </message> + <message> + <location line="+1"/> + <source>Disabled On</source> + <translation>Tiltás be</translation> + </message> + <message> + <location line="+1"/> + <source>Active Off</source> + <translation>Aktív ki</translation> + </message> + <message> + <location line="+1"/> + <source>Active On</source> + <translation>Aktív be</translation> + </message> + <message> + <location line="+1"/> + <source>Selected Off</source> + <translation>Kiválaszott ki</translation> + </message> + <message> + <location line="+1"/> + <source>Selected On</source> + <translation>Kiválaszott be</translation> + </message> + <message> + <location line="+8"/> + <source>Choose Resource...</source> + <translation>Erőforrás kiválasztása...</translation> + </message> + <message> + <location line="+1"/> + <source>Choose File...</source> + <translation>Fájl kiválasztása...</translation> + </message> + <message> + <location line="+1"/> + <source>Reset</source> + <translation>Újraindítás</translation> + </message> + <message> + <location line="+1"/> + <source>Reset All</source> + <translation>Az összes újraindítása</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ItemListEditor</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/itemlisteditor.cpp" line="+358"/> + <source>Properties &<<</source> + <translation>Tulajdonságok &<<</translation> + </message> + <message> + <location filename="../tools/designer/src/components/taskmenu/itemlisteditor.ui" line="+143"/> + <location filename="../tools/designer/src/components/taskmenu/itemlisteditor.cpp" line="+2"/> + <source>Properties &>></source> + <translation>Tulajdonságok &>></translation> + </message> + <message> + <location line="-75"/> + <source>Items List</source> + <translation>Elem lista</translation> + </message> + <message> + <location line="+9"/> + <source>New Item</source> + <translation>Új elem</translation> + </message> + <message> + <location line="+3"/> + <source>&New</source> + <translation>&Új</translation> + </message> + <message> + <location line="+7"/> + <source>Delete Item</source> + <translation>Elem törlése</translation> + </message> + <message> + <location line="+3"/> + <source>&Delete</source> + <translation>&Törlés</translation> + </message> + <message> + <location line="+20"/> + <source>Move Item Up</source> + <translation>Elem mozgatása felfelé</translation> + </message> + <message> + <location line="+3"/> + <source>U</source> + <translation>U</translation> + </message> + <message> + <location line="+7"/> + <source>Move Item Down</source> + <translation>Elem mozgatása lefelé</translation> + </message> + <message> + <location line="+3"/> + <source>D</source> + <translation>D</translation> + </message> +</context> +<context> + <name>qdesigner_internal::LabelTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/label_taskmenu.cpp" line="+85"/> + <source>Change rich text...</source> + <translation>Gazdag szöveg választása...</translation> + </message> + <message> + <location line="+1"/> + <source>Change plain text...</source> + <translation>Egyszerű szöveg választása...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::LanguageResourceDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/iconselector.cpp" line="-343"/> + <source>Choose Resource</source> + <translation>Erőforrás kiválasztása</translation> + </message> +</context> +<context> + <name>qdesigner_internal::LineEditTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/lineedit_taskmenu.cpp" line="+80"/> + <source>Change text...</source> + <translation>Szöveg kiválasztása...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ListWidgetEditor</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/listwidgeteditor.cpp" line="+69"/> + <source>New Item</source> + <translation>Új elem</translation> + </message> + <message> + <location line="+32"/> + <source>Edit List Widget</source> + <translation>Widget szerkesztési lista</translation> + </message> + <message> + <location line="+19"/> + <source>Edit Combobox</source> + <translation>Combobox szerkesztése</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ListWidgetTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/listwidget_taskmenu.cpp" line="+67"/> + <source>Edit Items...</source> + <translation>Elemek szerkesztése...</translation> + </message> + <message> + <location line="+38"/> + <source>Change List Contents</source> + <translation>Tartalom változtatási lista</translation> + </message> +</context> +<context> + <name>qdesigner_internal::MdiContainerWidgetTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/containerwidget_taskmenu.cpp" line="+118"/> + <source>Next Subwindow</source> + <translation>Új alablak</translation> + </message> + <message> + <location line="+1"/> + <source>Previous Subwindow</source> + <translation>Előző alablak</translation> + </message> + <message> + <location line="+1"/> + <source>Tile</source> + <translation>Cserép</translation> + </message> + <message> + <location line="+1"/> + <source>Cascade</source> + <translation>Kaszkád</translation> + </message> +</context> +<context> + <name>qdesigner_internal::MenuTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/menutaskmenu.cpp" line="+56"/> + <source>Remove</source> + <translation>Eltávolítás</translation> + </message> +</context> +<context> + <name>qdesigner_internal::MorphMenu</name> + <message> + <location filename="../tools/designer/src/lib/shared/morphmenu.cpp" line="+264"/> + <source>Morph into</source> + <translation>Morph into</translation> + </message> +</context> +<context> + <name>qdesigner_internal::NewActionDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/newactiondialog.ui" line="+46"/> + <source>New Action...</source> + <translation>Új tevékenység...</translation> + </message> + <message> + <location line="+8"/> + <source>&Text:</source> + <translation>&Szöveg:</translation> + </message> + <message> + <location line="+20"/> + <source>Object &name:</source> + <translation>Objektum &név:</translation> + </message> + <message> + <location line="+13"/> + <source>&Icon:</source> + <translation>&Ikon:</translation> + </message> + <message> + <location line="+30"/> + <source>Shortcut:</source> + <translation>Rövidebb út:</translation> + </message> + <message> + <location line="+14"/> + <source>Checkable:</source> + <translation>Ellenőrizhető:</translation> + </message> + <message> + <location line="+7"/> + <source>ToolTip:</source> + <translation>Eszköz tipp:</translation> + </message> + <message> + <location line="+19"/> + <location line="+21"/> + <source>...</source> + <translation>...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::NewDynamicPropertyDialog</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/newdynamicpropertydialog.cpp" line="+134"/> + <source>Set Property Name</source> + <translation>Tulajdonság nevének beállítása</translation> + </message> + <message> + <location line="+11"/> + <source>The current object already has a property named '%1'. +Please select another, unique one.</source> + <translation>Az aktuális objektumnak már van egy '%1' nevű tulajdonsága. +Kérem válasszon másikat, egy egyedülállót.</translation> + </message> + <message> + <location line="+4"/> + <source>The '_q_' prefix is reserved for the Qt library. +Please select another name.</source> + <translation>Az '_q_' előtag foglalt a Qt könyvtárhoz. +Kérem válasszon másikat.</translation> + </message> + <message> + <location filename="../tools/designer/src/components/propertyeditor/newdynamicpropertydialog.ui" line="+13"/> + <source>Create Dynamic Property</source> + <translation>Dinamikus tulajdonság létrehozása</translation> + </message> + <message> + <location line="+24"/> + <source>Property Name</source> + <translation>Tulajdonság Neve</translation> + </message> + <message> + <location line="+12"/> + <source>horizontalSpacer</source> + <translation>horizontálisTávtartó</translation> + </message> + <message> + <location line="+24"/> + <source>Property Type</source> + <translation>Tulajdonság Típusa</translation> + </message> +</context> +<context> + <name>qdesigner_internal::NewFormWidget</name> + <message> + <location filename="../tools/designer/src/lib/shared/newformwidget.cpp" line="+104"/> + <source>Default size</source> + <translation>Alapértelmezett méret</translation> + </message> + <message> + <location line="+1"/> + <source>QVGA portrait (240x320)</source> + <translation>QVGA portré (240x320)</translation> + </message> + <message> + <location line="+1"/> + <source>QVGA landscape (320x240)</source> + <translation>QVGA tájkép (320x240)</translation> + </message> + <message> + <location line="+1"/> + <source>VGA portrait (480x640)</source> + <translation>VGA portré (480x640)</translation> + </message> + <message> + <location line="+1"/> + <source>VGA landscape (640x480)</source> + <translation>VGA tájkép: (640x480)</translation> + </message> + <message> + <location line="+66"/> + <source>Widgets</source> + <extracomment>New Form Dialog Categories</extracomment> + <translation>Widget-ek</translation> + </message> + <message> + <location line="+1"/> + <source>Custom Widgets</source> + <translation>Egyéni Widget-ek</translation> + </message> + <message> + <location line="+18"/> + <source>None</source> + <translation>Semmi</translation> + </message> + <message> + <location line="+57"/> + <source>Error loading form</source> + <translation>Hiba történt az űrlap betöltése közben</translation> + </message> + <message> + <location line="+244"/> + <source>Unable to open the form template file '%1': %2</source> + <translation>Nem lehet megnyitni a(z) '%1' űrlap sablon fájlt: %2</translation> + </message> + <message> + <location line="+67"/> + <source>Internal error: No template selected.</source> + <translation>Belső hiba: Nincsen sablon kiválasztva.</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/newformwidget.ui" line="+82"/> + <source>0</source> + <translation>0</translation> + </message> + <message> + <location line="+19"/> + <source>Choose a template for a preview</source> + <translation>Válasszon egy sablont egy előnézetre</translation> + </message> + <message> + <location line="+44"/> + <source>Embedded Design</source> + <translation>Beágyazott tervezés</translation> + </message> + <message> + <location line="+12"/> + <source>Device:</source> + <translation>Eszköz:</translation> + </message> + <message> + <location line="+7"/> + <source>Screen Size:</source> + <translation>Képernyő méret:</translation> + </message> +</context> +<context> + <name>qdesigner_internal::NewPromotedClassPanel</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_promotiondialog.cpp" line="+92"/> + <source>Add</source> + <translation>Hozzáadás</translation> + </message> + <message> + <location line="+2"/> + <source>New Promoted Class</source> + <translation>Új támogatott osztály</translation> + </message> + <message> + <location line="+15"/> + <source>Base class name:</source> + <translation>Alap osztály név:</translation> + </message> + <message> + <location line="+1"/> + <source>Promoted class name:</source> + <translation>Támogatott osztály neve:</translation> + </message> + <message> + <location line="+1"/> + <source>Header file:</source> + <translation>Fejállomány:</translation> + </message> + <message> + <location line="+1"/> + <source>Global include</source> + <translation>Globális include</translation> + </message> + <message> + <location line="+11"/> + <source>Reset</source> + <translation>Újraindítás</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ObjectInspector</name> + <message> + <location filename="../tools/designer/src/components/objectinspector/objectinspector.cpp" line="+754"/> + <source>&Find in Text...</source> + <translation>&Keresés a szövegben...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::ObjectInspector::ObjectInspectorPrivate</name> + <message> + <location line="-438"/> + <source>Change Current Page</source> + <translation>Aktuális lap megváltoztatása</translation> + </message> +</context> +<context> + <name>qdesigner_internal::OrderDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/orderdialog.cpp" line="+109"/> + <source>Index %1 (%2)</source> + <translation>Index %1 (%2)</translation> + </message> + <message> + <location line="+3"/> + <source>%1 %2</source> + <translation>%1 %2</translation> + </message> + <message> + <location filename="../tools/designer/src/lib/shared/orderdialog.ui" line="+53"/> + <source>Change Page Order</source> + <translation>Lap sorrend megváltoztatása</translation> + </message> + <message> + <location line="+6"/> + <source>Page Order</source> + <translation>Lap sorrend</translation> + </message> + <message> + <location line="+57"/> + <source>Move page up</source> + <translation>Lap mozgatása felfelé</translation> + </message> + <message> + <location line="+7"/> + <source>Move page down</source> + <translation>Lap mozgatása lefelé</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PaletteEditor</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/paletteeditor.ui" line="+61"/> + <source>Edit Palette</source> + <translation>Paletta szerkesztése</translation> + </message> + <message> + <location line="+24"/> + <source>Tune Palette</source> + <translation>Paletta finomhangolása</translation> + </message> + <message> + <location line="+37"/> + <source>Show Details</source> + <translation>Részletek megjelenítése</translation> + </message> + <message> + <location line="+7"/> + <source>Compute Details</source> + <translation>Számítási részletek</translation> + </message> + <message> + <location line="+10"/> + <source>Quick</source> + <translation>Gyors</translation> + </message> + <message> + <location line="+18"/> + <source>Preview</source> + <translation>Előnézet</translation> + </message> + <message> + <location line="+12"/> + <source>Disabled</source> + <translation>Tiltott</translation> + </message> + <message> + <location line="+7"/> + <source>Inactive</source> + <translation>Inaktív</translation> + </message> + <message> + <location line="+7"/> + <source>Active</source> + <translation>Aktív</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PaletteEditorButton</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/paletteeditorbutton.cpp" line="+57"/> + <source>Change Palette</source> + <translation>Paletta megváltoztatása</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PaletteModel</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/paletteeditor.cpp" line="+374"/> + <source>Color Role</source> + <translation>Szín szabály</translation> + </message> + <message> + <location line="+2"/> + <source>Active</source> + <translation>Aktív</translation> + </message> + <message> + <location line="+2"/> + <source>Inactive</source> + <translation>Inaktív</translation> + </message> + <message> + <location line="+2"/> + <source>Disabled</source> + <translation>Tiltott</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PixmapEditor</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/designerpropertymanager.cpp" line="-1541"/> + <source>Choose Resource...</source> + <translation>Erőforrás kiválasztása...</translation> + </message> + <message> + <location line="+1"/> + <source>Choose File...</source> + <translation>Fájl kiválasztása...</translation> + </message> + <message> + <location line="+1"/> + <source>Copy Path</source> + <translation>Útvonal kiválasztása</translation> + </message> + <message> + <location line="+1"/> + <source>Paste Path</source> + <translation>Útvonal beillesztése</translation> + </message> + <message> + <location line="+6"/> + <location line="+16"/> + <source>...</source> + <translation>...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PlainTextEditorDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/plaintexteditor.cpp" line="+65"/> + <source>Edit text</source> + <translation>Szöveg szerkesztése</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PluginDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/plugindialog.cpp" line="+72"/> + <source>Components</source> + <translation>Komponensek</translation> + </message> + <message> + <location line="+13"/> + <source>Plugin Information</source> + <translation>Beépülő modul információ</translation> + </message> + <message> + <location line="+4"/> + <source>Refresh</source> + <translation>Felfrissítés</translation> + </message> + <message> + <location line="+1"/> + <source>Scan for newly installed custom widget plugins.</source> + <translation>Újonnan telepített egyéni widget beépülő modulok letapogatása.</translation> + </message> + <message> + <location line="+48"/> + <source>Qt Designer couldn't find any plugins</source> + <translation>Qt Designer nem talált egyetlen beépülő modult sem</translation> + </message> + <message> + <location line="+3"/> + <source>Qt Designer found the following plugins</source> + <translation>Qt Designer a következő beépülő modulokat találta</translation> + </message> + <message> + <location line="+55"/> + <source>New custom widget plugins have been found.</source> + <translation>Új egyéni widget betöltő modul talált.</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PreviewActionGroup</name> + <message> + <location filename="../tools/designer/src/components/formeditor/previewactiongroup.cpp" line="+95"/> + <source>%1 Style</source> + <translation>%1 Stílus</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PreviewConfigurationWidget</name> + <message> + <location filename="../tools/designer/src/lib/shared/previewconfigurationwidget.cpp" line="+139"/> + <source>Default</source> + <translation>Alapértelmezett</translation> + </message> + <message> + <location line="+22"/> + <source>None</source> + <translation>Semmi</translation> + </message> + <message> + <location line="+6"/> + <source>Browse...</source> + <translation>Böngészés...</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate</name> + <message> + <location line="+118"/> + <source>Load Custom Device Skin</source> + <translation>Egyéni eszköz szkin betöltése</translation> + </message> + <message> + <location line="+2"/> + <source>All QVFB Skins (*.%1)</source> + <translation>Az összes QVFB szkin (*.%1)</translation> + </message> + <message> + <location line="+16"/> + <source>%1 - Duplicate Skin</source> + <translation>%1 - Duplikált szkin</translation> + </message> + <message> + <location line="+1"/> + <source>The skin '%1' already exists.</source> + <translation>A(z) '%1' szkin már létezik.</translation> + </message> + <message> + <location line="+14"/> + <source>%1 - Error</source> + <translation>%1 - Hiba</translation> + </message> + <message> + <location line="+1"/> + <source>%1 is not a valid skin directory: +%2</source> + <translation>%1 nem egy érvényes szkin könyvtár: +%2</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PreviewDeviceSkin</name> + <message> + <location filename="../tools/designer/src/lib/shared/previewmanager.cpp" line="+259"/> + <source>&Portrait</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Landscape (&CCW)</source> + <extracomment>Rotate form preview counter-clockwise</extracomment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>&Landscape (CW)</source> + <extracomment>Rotate form preview clockwise</extracomment> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> +</context> +<context> + <name>qdesigner_internal::PreviewManager</name> + <message> + <location line="+426"/> + <source>%1 - [Preview]</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::PreviewMdiArea</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/previewframe.cpp" line="+72"/> + <source>The moose in the noose +ate the goose who was loose.</source> + <extracomment>Palette editor background</extracomment> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::PreviewWidget</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/previewwidget.ui" line="+61"/> + <source>Preview Window</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+20"/> + <source>LineEdit</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+8"/> + <source>ComboBox</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+19"/> + <source>PushButton</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+58"/> + <source>ButtonGroup2</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+12"/> + <source>CheckBox1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <source>CheckBox2</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <source>ButtonGroup</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+12"/> + <source>RadioButton1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <source>RadioButton2</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>RadioButton3</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::PromotionModel</name> + <message> + <location filename="../tools/designer/src/lib/shared/promotionmodel.cpp" line="+17"/> + <source>Name</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Header file</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Global include</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Usage</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::PromotionTaskMenu</name> + <message> + <location filename="../tools/designer/src/lib/shared/promotiontaskmenu.cpp" line="+85"/> + <source>Promoted widgets...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Promote to ...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Change signals/slots...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Promote to</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Demote to %1</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::PropertyEditor</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/propertyeditor.cpp" line="+183"/> + <source>Add Dynamic Property...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Remove Dynamic Property</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Sorting</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Color Groups</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Tree View</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Drop Down Button View</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+50"/> + <source>String...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Bool...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>Other...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Configure Property Editor</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+533"/> + <source>Object: %1 +Class: %2</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::PropertyLineEdit</name> + <message> + <location filename="../tools/designer/src/lib/shared/propertylineedit.cpp" line="+88"/> + <source>Insert line break</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::QDesignerPromotionDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_promotiondialog.cpp" line="+85"/> + <source>Promoted Widgets</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Promoted Classes</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+60"/> + <source>Promote</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+152"/> + <source>Change signals/slots...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+17"/> + <source>%1 - Error</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::QDesignerResource</name> + <message> + <location filename="../tools/designer/src/components/formeditor/qdesigner_resource.cpp" line="+277"/> + <source>Loading qrc file</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>The specified qrc file <p><b>%1</b></p><p>could not be found. Do you want to update the file location?</p></source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> + <source>New location for %1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Resource files (*.qrc)</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::QDesignerTaskMenu</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_taskmenu.cpp" line="+68"/> + <source>Change objectName...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Change toolTip...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Change whatsThis...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Change styleSheet...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Create Menu Bar</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Add Tool Bar</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Create Status Bar</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Remove Status Bar</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Change script...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Change signals/slots...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Go to slot...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Size Constraints</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>Set Minimum Width</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>Set Minimum Height</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>Set Minimum Size</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> + <source>Set Maximum Width</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>Set Maximum Height</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>Set Maximum Size</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+235"/> + <source>Edit ToolTip</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>Edit WhatsThis</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+144"/> + <source>no signals available</source> + <translation type="unfinished"></translation> + </message> + <message numerus="yes"> + <location line="+67"/> + <source>Set size constraint on %n widget(s)</source> + <translation type="unfinished"> + <numerusform></numerusform> + </translation> + </message> +</context> +<context> + <name>qdesigner_internal::QDesignerWidgetBox</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_widgetbox.cpp" line="+123"/> + <location line="+13"/> + <source>Unexpected element <%1></source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>A parse error occurred at line %1, column %2 of the XML code specified for the widget %3: %4 +%5</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <source>The XML code specified for the widget %1 does not contain any widget elements. +%2</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../tools/designer/src/components/widgetbox/widgetboxtreewidget.cpp" line="+349"/> + <source>An error has been encountered at line %1 of %2: %3</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+139"/> + <source>Unexpected element <%1> encountered when parsing for <widget> or <ui></source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+19"/> + <source>Unexpected end of file encountered when parsing widgets.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <source>A widget element could not be found.</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::QtGradientStopsController</name> + <message> + <location filename="../tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp" line="+173"/> + <source>H</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>S</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>V</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> + <location line="+4"/> + <source>Hue</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-3"/> + <source>Sat</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Val</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Saturation</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Value</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+22"/> + <source>R</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>G</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>B</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> + <source>Red</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Green</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Blue</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::RichTextEditorDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/richtexteditor.cpp" line="+436"/> + <source>Edit text</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+23"/> + <source>Rich Text</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Source</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> + <source>&OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>&Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::RichTextEditorToolBar</name> + <message> + <location line="-302"/> + <source>Bold</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>CTRL+B</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>Italic</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>CTRL+I</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>Underline</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>CTRL+U</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>Left Align</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>Center</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>Right Align</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>Justify</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <source>Superscript</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> + <source>Subscript</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <source>Insert &Link</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>Insert &Image</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::ScriptDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/scriptdialog.cpp" line="+66"/> + <source>Edit script</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source><html>Enter a Qt Script snippet to be executed while loading the form.<br>The widget and its children are accessible via the variables <i>widget</i> and <i>childWidgets</i>, respectively.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+51"/> + <source>Syntax error</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::ScriptErrorDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/scripterrordialog.cpp" line="+27"/> + <source>Script errors</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::SignalSlotDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/signalslotdialog.cpp" line="+199"/> + <source>There is already a slot with the signature '%1'.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>There is already a signal with the signature '%1'.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>%1 - Duplicate Signature</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+21"/> + <location line="+76"/> + <source>Signals/Slots of %1</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::SignalSlotEditorPlugin</name> + <message> + <location filename="../tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp" line="+72"/> + <source>Edit Signals/Slots</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>F4</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::SignalSlotEditorTool</name> + <message> + <location filename="../tools/designer/src/components/signalsloteditor/signalsloteditor_tool.cpp" line="+58"/> + <source>Edit Signals/Slots</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::StatusBarTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/toolbar_taskmenu.cpp" line="+81"/> + <source>Remove</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::StringListEditorButton</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/stringlisteditorbutton.cpp" line="+56"/> + <source>Change String List</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::StyleSheetEditorDialog</name> + <message> + <location filename="../tools/designer/src/lib/shared/stylesheeteditor.cpp" line="+90"/> + <location line="+280"/> + <source>Valid Style Sheet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-278"/> + <source>Add Resource...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Add Gradient...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Add Color...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Add Font...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Edit Style Sheet</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+276"/> + <source>Invalid Style Sheet</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TabOrderEditor</name> + <message> + <location filename="../tools/designer/src/components/tabordereditor/tabordereditor.cpp" line="+363"/> + <source>Start from Here</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>Restart</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Tab Order List...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+44"/> + <source>Tab Order List</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Tab Order</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TabOrderEditorPlugin</name> + <message> + <location filename="../tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp" line="+73"/> + <source>Edit Tab Order</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TabOrderEditorTool</name> + <message> + <location filename="../tools/designer/src/components/tabordereditor/tabordereditor_tool.cpp" line="+57"/> + <source>Edit Tab Order</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TableWidgetEditor</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/tablewidgeteditor.ui" line="+97"/> + <location filename="../tools/designer/src/components/taskmenu/tablewidgeteditor.cpp" line="+218"/> + <source>Properties &>></source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-44"/> + <source>Edit Table Widget</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <source>&Items</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+12"/> + <source>Table Items</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../tools/designer/src/components/taskmenu/tablewidgeteditor.cpp" line="-151"/> + <source>New Column</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>New Row</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+8"/> + <source>&Columns</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>&Rows</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+137"/> + <source>Properties &<<</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TableWidgetTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/tablewidget_taskmenu.cpp" line="+64"/> + <source>Edit Items...</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TemplateOptionsWidget</name> + <message> + <location filename="../tools/designer/src/components/formeditor/templateoptionspage.cpp" line="-18"/> + <source>Pick a directory to save templates in</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../tools/designer/src/components/formeditor/templateoptionspage.ui" line="+13"/> + <source>Form</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+6"/> + <source>Additional Template Paths</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <location line="+7"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TextEditTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/textedit_taskmenu.cpp" line="+58"/> + <source>Edit HTML</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Change HTML...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <source>Edit Text</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Change Plain Text...</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TextEditor</name> + <message> + <location filename="../tools/designer/src/components/propertyeditor/designerpropertymanager.cpp" line="-204"/> + <source>Choose Resource...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Choose File...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+5"/> + <source>...</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+118"/> + <source>Choose a File</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::ToolBarEventFilter</name> + <message> + <location filename="../tools/designer/src/lib/shared/qdesigner_toolbar.cpp" line="+148"/> + <source>Insert Separator before '%1'</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+9"/> + <source>Append Separator</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+12"/> + <source>Remove action '%1'</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Remove Toolbar '%1'</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+58"/> + <source>Insert Separator</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TreeWidgetEditor</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/treewidgeteditor.cpp" line="+68"/> + <source>New Column</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+8"/> + <source>&Columns</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+69"/> + <source>Per column properties</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Common properties</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../tools/designer/src/components/taskmenu/treewidgeteditor.ui" line="+101"/> + <location filename="../tools/designer/src/components/taskmenu/treewidgeteditor.cpp" line="+53"/> + <source>New Item</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <location filename="../tools/designer/src/components/taskmenu/treewidgeteditor.cpp" line="+19"/> + <source>New Subitem</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../tools/designer/src/components/taskmenu/treewidgeteditor.cpp" line="+175"/> + <source>Properties &<<</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../tools/designer/src/components/taskmenu/treewidgeteditor.ui" line="+86"/> + <location filename="../tools/designer/src/components/taskmenu/treewidgeteditor.cpp" line="+2"/> + <source>Properties &>></source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="-144"/> + <source>Edit Tree Widget</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <source>&Items</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+24"/> + <source>Tree Items</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+4"/> + <source>1</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+13"/> + <source>&New</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+10"/> + <source>New &Subitem</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Delete Item</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>&Delete</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+20"/> + <source>Move Item Left (before Parent Item)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>L</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Move Item Right (as a First Subitem of the Next Sibling Item)</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>R</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Move Item Up</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>U</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+7"/> + <source>Move Item Down</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>D</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::TreeWidgetTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/treewidget_taskmenu.cpp" line="+63"/> + <source>Edit Items...</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::WidgetBox</name> + <message> + <location filename="../tools/designer/src/components/widgetbox/widgetbox_dnditem.cpp" line="+115"/> + <source>Warning: Widget creation failed in the widget box. This could be caused by invalid custom widget XML.</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::WidgetBoxTreeWidget</name> + <message> + <location filename="../tools/designer/src/components/widgetbox/widgetboxtreewidget.cpp" line="-268"/> + <source>Scratchpad</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+370"/> + <source>Custom Widgets</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+263"/> + <source>Expand all</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Collapse all</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> + <source>List View</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Icon View</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+15"/> + <source>Remove</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+2"/> + <source>Edit name</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::WidgetDataBase</name> + <message> + <location filename="../tools/designer/src/lib/shared/widgetdatabase.cpp" line="-411"/> + <source>A custom widget plugin whose class name (%1) matches that of an existing class has been found.</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::WidgetEditorTool</name> + <message> + <location filename="../tools/designer/src/components/formeditor/tool_widgeteditor.cpp" line="+67"/> + <source>Edit Widgets</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::WidgetFactory</name> + <message> + <location filename="../tools/designer/src/lib/shared/widgetfactory.cpp" line="+263"/> + <source>The custom widget factory registered for widgets of class %1 returned 0.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+44"/> + <source>A class name mismatch occurred when creating a widget using the custom widget factory registered for widgets of class %1. It returned a widget of class %2.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+99"/> + <source>%1 Widget</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+90"/> + <source>The current page of the container '%1' (%2) could not be determined while creating a layout.This indicates an inconsistency in the ui-file, probably a layout being constructed on a container widget.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+53"/> + <source>Attempt to add a layout to a widget '%1' (%2) which already has an unmanaged layout of type %3. +This indicates an inconsistency in the ui-file.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+211"/> + <source>Cannot create style '%1'.</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::WizardContainerWidgetTaskMenu</name> + <message> + <location filename="../tools/designer/src/components/taskmenu/containerwidget_taskmenu.cpp" line="-49"/> + <source>Next</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+1"/> + <source>Back</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::ZoomMenu</name> + <message> + <location filename="../tools/designer/src/lib/shared/zoomwidget.cpp" line="+84"/> + <source>%1 %</source> + <extracomment>Zoom factor</extracomment> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>qdesigner_internal::ZoomablePreviewDeviceSkin</name> + <message> + <location filename="../tools/designer/src/lib/shared/previewmanager.cpp" line="-270"/> + <source>&Zoom</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/translations/linguist_hu.ts b/translations/linguist_hu.ts new file mode 100644 index 0000000..aaff893 --- /dev/null +++ b/translations/linguist_hu.ts @@ -0,0 +1,2014 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="hu_HU" sourcelanguage="hu"> +<context> + <name>AboutDialog</name> + <message> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+1358"/> + <source>Qt Linguist</source> + <translation>Qt Linguist</translation> + </message> +</context> +<context> + <name>BatchTranslationDialog</name> + <message> + <location filename="../tools/linguist/linguist/batchtranslationdialog.cpp" line="+79"/> + <source>Batch Translation of '%1' - Qt Linguist</source> + <translation>'%1' Qt Linguist egy adat fordítása</translation> + </message> + <message> + <location line="+37"/> + <source>Searching, please wait...</source> + <translation>Keresés, kérem várjon...</translation> + </message> + <message> + <location line="+0"/> + <source>&Cancel</source> + <translation>&Mégse</translation> + </message> + <message> + <location line="+42"/> + <source>Linguist batch translator</source> + <translation>Linguist köteg fordító</translation> + </message> + <message numerus="yes"> + <location line="+1"/> + <source>Batch translated %n entries</source> + <translation> + <numerusform>%n adat belépés lefordítva</numerusform> + </translation> + </message> + <message> + <location filename="../tools/linguist/linguist/batchtranslation.ui"/> + <source>Qt Linguist - Batch Translation</source> + <translation>Qt Linguist adat fordítás</translation> + </message> + <message> + <location/> + <source>Options</source> + <translation>Opciók</translation> + </message> + <message> + <location/> + <source>Set translated entries to finished</source> + <translation>Lefordított bevitelek befejezettre állítása</translation> + </message> + <message> + <location/> + <source>Retranslate entries with existing translation</source> + <translation>Bevitelek újrafordítása létező fordításokkal</translation> + </message> + <message> + <location/> + <source>Translate also finished entries</source> + <translation>Befejezett belépéseknek is a lefordítása</translation> + </message> + <message> + <location/> + <source>Phrase book preference</source> + <translation>Fázis könyv beállítások</translation> + </message> + <message> + <location/> + <source>Move up</source> + <translation>Felfelé mozgatás</translation> + </message> + <message> + <location/> + <source>Move down</source> + <translation>Lefelé mozgatás</translation> + </message> + <message> + <location/> + <source>&Run</source> + <translation>&Futtatás</translation> + </message> + <message> + <location/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location/> + <source>Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked</source> + <translation>Ne felejtse el, hogy a módosított belépések újra lesznek indítva befejezetlenre, ha a 'lefordított bevitelek befejezettre állítása' felül meg van jelölve</translation> + </message> + <message> + <location/> + <source>The batch translator will search through the selected phrase books in the order given above</source> + <translation>A köteg fordító a kiválasztott fázis könyvek között fog keresni, a fent megadott sorrendben</translation> + </message> +</context> +<context> + <name>DataModel</name> + <message> + <location filename="../tools/linguist/linguist/messagemodel.cpp" line="+214"/> + <source><qt>Duplicate messages found in '%1':</source> + <translation><qt>Dupliált üzenetek találhatóak a(z) '%1'-ben:</translation> + </message> + <message> + <location line="+4"/> + <location line="+8"/> + <source><p>[more duplicates omitted]</source> + <translation><p>[többi duplikáció kihagyása]</translation> + </message> + <message> + <location line="-5"/> + <source><p>* ID: %1</source> + <translation><p>* Azonosító: %1</translation> + </message> + <message> + <location line="+8"/> + <source><p>* Context: %1<br>* Source: %2</source> + <translation><p>* Szövegösszefüggés: %1<br>* Forrás: %2</translation> + </message> + <message> + <location line="+3"/> + <source><br>* Comment: %3</source> + <translation><br>* Megjegyzés: %3</translation> + </message> + <message> + <location line="+71"/> + <source>Linguist does not know the plural rules for '%1'. +Will assume a single universal form.</source> + <translation>A Linguist nem ismeri a többes számú szabályokat a '%1'-re. Egy egyszerű univerzális formát fog feltételezni.</translation> + </message> + <message> + <location line="+56"/> + <source>Cannot create '%2': %1</source> + <translation>Nem lehet létrehozni '%2': %1</translation> + </message> + <message> + <location line="+56"/> + <source>Universal Form</source> + <translation>Univerzális forma</translation> + </message> +</context> +<context> + <name>ErrorsView</name> + <message> + <location filename="../tools/linguist/linguist/errorsview.cpp" line="+76"/> + <source>Accelerator possibly superfluous in translation.</source> + <translation>A gyorsítás valószínűleg nélkülözhető a fordításban.</translation> + </message> + <message> + <location line="+3"/> + <source>Accelerator possibly missing in translation.</source> + <translation>A gyorsítás valószínűleg hiányzik a fordításban.</translation> + </message> + <message> + <location line="+3"/> + <source>Translation does not end with the same punctuation as the source text.</source> + <translation>A fordítás nem ugyanazzal az írásjellel végződik, mint a forrás szöveg.</translation> + </message> + <message> + <location line="+3"/> + <source>A phrase book suggestion for '%1' was ignored.</source> + <translation>A(z) '%1'-re tett fáziskönyv ajánlat mellőzve lett.</translation> + </message> + <message> + <location line="+3"/> + <source>Translation does not refer to the same place markers as in the source text.</source> + <translation>Nem ugyanazok a hely megjelölők találhatóak a fordításban, mint a forrás szövegben.</translation> + </message> + <message> + <location line="+3"/> + <source>Translation does not contain the necessary %n place marker.</source> + <translation>A fordítás nem tartalmazza a szükséges %n hely megjelölőket.</translation> + </message> + <message> + <location line="+3"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> +</context> +<context> + <name>FindDialog</name> + <message> + <location filename="../tools/linguist/linguist/finddialog.ui"/> + <source>This window allows you to search for some text in the translation source file.</source> + <translation>Ez az ablak engedélyezi, hogy szöveget keresses a fordítás forrás fájlban.</translation> + </message> + <message> + <location/> + <source>Type in the text to search for.</source> + <translation>Gépelje be szövegbe, amit keres..</translation> + </message> + <message> + <location/> + <source>Options</source> + <translation>Opciók</translation> + </message> + <message> + <location/> + <source>Source texts are searched when checked.</source> + <translation>Forrás szövegek keresési ellenőrzéskor.</translation> + </message> + <message> + <location/> + <source>Translations are searched when checked.</source> + <translation>Fordítások keresése ellenőrzéskor.</translation> + </message> + <message> + <location/> + <source>Texts such as 'TeX' and 'tex' are considered as different when checked.</source> + <translation>'TeX' és 'tex' szövegek különbözőként kezelése bejelöléskor.</translation> + </message> + <message> + <location/> + <source>Comments and contexts are searched when checked.</source> + <translation>Megjegyzések és tartalmak keresése bejelöléskor.</translation> + </message> + <message> + <location/> + <source>Find</source> + <translation>Keresés +</translation> + </message> + <message> + <location/> + <source>&Find what:</source> + <translation>Ennek &keresése:</translation> + </message> + <message> + <location/> + <source>&Source texts</source> + <translation>&Forrás szövegek</translation> + </message> + <message> + <location/> + <source>&Translations</source> + <translation>&Fordítások</translation> + </message> + <message> + <location/> + <source>&Match case</source> + <translation>&Egyezés</translation> + </message> + <message> + <location/> + <source>&Comments</source> + <translation>&Kommentek</translation> + </message> + <message> + <location/> + <source>Ignore &accelerators</source> + <translation>&Gyorsítások mellőzése</translation> + </message> + <message> + <location/> + <source>Click here to find the next occurrence of the text you typed in.</source> + <translation>Kattintson ide a begépelt szöveg következő előfordulásának megkereséséhez.</translation> + </message> + <message> + <location/> + <source>Find Next</source> + <translation>Következő keresése</translation> + </message> + <message> + <location/> + <source>Click here to close this window.</source> + <translation>Kattintson ide az ablak bezárásához.</translation> + </message> + <message> + <location/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/finddialog.cpp" line="+12"/> + <source></source> + <comment>Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog</comment> + <translatorcomment>Válassza ki a Szerkesztés/Keresés opciót a menüből vagy nyomja le a Ctrl+F billentyűket a keresési párbeszédablak felugrásához</translatorcomment> + <translation></translation> + </message> +</context> +<context> + <name>FormMultiWidget</name> + <message> + <location filename="../tools/linguist/linguist/messageeditorwidgets.cpp" line="+296"/> + <source>Alt+Delete</source> + <extracomment>translate, but don't change</extracomment> + <translatorcomment>fordítsd, de ne változtasd</translatorcomment> + <translation>ALT+Delete</translation> + </message> + <message> + <location line="+1"/> + <source>Shift+Alt+Insert</source> + <extracomment>translate, but don't change</extracomment> + <translatorcomment>Fordítsd, de ne változtasd.</translatorcomment> + <translation>Shift+Alt+Insert</translation> + </message> + <message> + <location line="+1"/> + <source>Alt+Insert</source> + <extracomment>translate, but don't change</extracomment> + <translation>Alt+Insert</translation> + </message> + <message> + <location line="+131"/> + <source>Confirmation - Qt Linguist</source> + <translation>Megerősítés - Qt Linguist</translation> + </message> + <message> + <location line="+1"/> + <source>Delete non-empty length variant?</source> + <translation>Törölje az 0 hosszúságú változatok?</translation> + </message> +</context> +<context> + <name>LRelease</name> + <message numerus="yes"> + <location filename="../tools/linguist/shared/qm.cpp" line="+761"/> + <source>Dropped %n message(s) which had no ID.</source> + <translation> + <numerusform>%n üzenez eldobva, melyek nem rendelkeztek azonosítóval.</numerusform> + </translation> + </message> + <message numerus="yes"> + <location line="+4"/> + <source>Excess context/disambiguation dropped from %n message(s).</source> + <translation> + <numerusform>Fölösleges szövegösszefüggés/egyértelműsítés törlése %n üzenetből.</numerusform> + </translation> + </message> + <message numerus="yes"> + <location line="+8"/> + <source> Generated %n translation(s) (%1 finished and %2 unfinished) +</source> + <translation> + <numerusform>%n fordítás legenerálása (%1 befejezett és %2 befejezetlen)</numerusform> + </translation> + </message> + <message numerus="yes"> + <location line="+4"/> + <source> Ignored %n untranslated source text(s) +</source> + <translation> + <numerusform>%n lefordítatlan forrás szöveg mellőzése</numerusform> + </translation> + </message> +</context> +<context> + <name>MainWindow</name> + <message> + <location filename="../tools/linguist/linguist/mainwindow.ui"/> + <source>MainWindow</source> + <translation>FőAblak</translation> + </message> + <message> + <location/> + <source>&Phrases</source> + <translation>&Fázisok</translation> + </message> + <message> + <location/> + <source>&Close Phrase Book</source> + <translation>&Fázis könyvek bezárása</translation> + </message> + <message> + <location/> + <source>&Edit Phrase Book</source> + <translation>Fázis könyvek &szerkesztése</translation> + </message> + <message> + <location/> + <source>&Print Phrase Book</source> + <translation>&Fázis könyvek nyomtatása</translation> + </message> + <message> + <location/> + <source>V&alidation</source> + <translation>&Érvényesítés</translation> + </message> + <message> + <location/> + <source>&View</source> + <translation>&Nézet</translation> + </message> + <message> + <location/> + <source>Vie&ws</source> + <translation>&Nézetek</translation> + </message> + <message> + <location/> + <source>&Toolbars</source> + <translation>&Eszköztár</translation> + </message> + <message> + <location/> + <source>&Help</source> + <translation>&Súgó</translation> + </message> + <message> + <location/> + <source>&Translation</source> + <translation>&Fordítások</translation> + </message> + <message> + <location/> + <source>&File</source> + <translation>&Fájl</translation> + </message> + <message> + <location/> + <source>&Edit</source> + <translation>&Szerkesztés</translation> + </message> + <message> + <location/> + <source>&Open...</source> + <translation>&Megnyitás...</translation> + </message> + <message> + <location/> + <source>Open a Qt translation source file (TS file) for editing</source> + <translation>Egy Qt fordítási forrás fájl (TS fájl) megnyitása szerkesztésre</translation> + </message> + <message> + <location/> + <source>Ctrl+O</source> + <translation>Ctrl+O</translation> + </message> + <message> + <location/> + <source>E&xit</source> + <translation>&Kilépés</translation> + </message> + <message> + <location/> + <source>Close this window and exit.</source> + <translation>Ablak bezárása és kilépés.</translation> + </message> + <message> + <location/> + <source>Ctrl+Q</source> + <translation>Ctrl+Q</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+646"/> + <location line="+15"/> + <source>&Save</source> + <translation>&Mentés</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.ui"/> + <source>Save changes made to this Qt translation source file</source> + <translation>Változtatások elmentése a Qt fordítási forrás fájlban</translation> + </message> + <message> + <location/> + <source>Move to the previous unfinished item.</source> + <translation>Az előző befejezetlen elemre mozgatás.</translation> + </message> + <message> + <location/> + <source>Move to the next unfinished item.</source> + <translation>A következő befejezetlen elemre mozgatás.</translation> + </message> + <message> + <location/> + <source>Move to the previous item.</source> + <translation>Az előző elemre mozgatás.</translation> + </message> + <message> + <location/> + <source>Move to the next item.</source> + <translation>A következő elemre mozgatás.</translation> + </message> + <message> + <location/> + <source>Mark this item as done and move to the next unfinished item.</source> + <translation>Az elem készre jelölése és a következő befejezetlen elemre mozgás.</translation> + </message> + <message> + <location/> + <source>Copy from source text</source> + <translation>Másolás forrás szövegből</translation> + </message> + <message> + <location/> + <source>Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window.</source> + <translation>Gyorsítások érvényesség ellenőrzésének kapcsolgatása, lásd vajon az et jelek száma megegyezik-e a a forrás és lefordított szövegben. Ha ez az ellenőrzés hibásan zárul le, a figyelmeztető ablakban egy üzenet tűnik fel.</translation> + </message> + <message> + <location/> + <source>Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window.</source> + <translation>A végződő írásjelek érvényesség ellenőrzésének kapcsolgatása. Ha ez az ellenőrzés nem sikerült, akkor egy üzenet bukkan fel a figyelmeztető ablakban.</translation> + </message> + <message> + <location/> + <source>Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window.</source> + <translation>Fázis ajánlások ellenőrzésének kapcsolgatása. Ha az ellenőrzés sikertelen, akkor egy üzenet bukkan fel a figyelmeztető ablakban.</translation> + </message> + <message> + <location/> + <source>Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window.</source> + <translation>A hely megjelelölők érvényesség ellenőrzésének kapcsolgatása, lásd vajon a(z) %1, %2.. következetesen vannak-e használva a forrás és lefordított szövegben. Ha az ellenőrzés sikertelen, egy üzenet bukkan fel a figyelmeztető ablakban.</translation> + </message> + <message> + <location/> + <source>Open Read-O&nly...</source> + <translation>&Csak olvasható megnyitása...</translation> + </message> + <message> + <location/> + <source>&Save All</source> + <translation>Az összes &mentése</translation> + </message> + <message> + <location/> + <source>Ctrl+S</source> + <translation>Ctrl+S</translation> + </message> + <message> + <location/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-14"/> + <location line="+11"/> + <source>Save &As...</source> + <translation>&Másként mentés...</translation> + </message> + <message> + <location/> + <source>Save As...</source> + <translation>Másként mentés...</translation> + </message> + <message> + <location/> + <source>Save changes made to this Qt translation source file into a new file.</source> + <translation>A változtatások egy új fájlba mentése, amik ebben a Qt fordítási forrás fájlban keletkeztek.</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+4"/> + <source>&Release</source> + <translation>&Kiadás</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.ui"/> + <source>Create a Qt message file suitable for released applications from the current message file.</source> + <translation>Qt üzenez fájl létrehozása az aktuális üzenet fájlból, ami alkalmas a kiadásra.</translation> + </message> + <message> + <location/> + <source>&Print...</source> + <translation>&Nyomtatás...</translation> + </message> + <message> + <location/> + <source>Ctrl+P</source> + <translation>Ctrl+P</translation> + </message> + <message> + <location/> + <source>&Undo</source> + <translation>&Visszacsinálás</translation> + </message> + <message> + <location/> + <source>Recently Opened &Files</source> + <translation>&Utoljára megnyitott &fájlok</translation> + </message> + <message> + <location/> + <source>Save</source> + <translation>Mentés</translation> + </message> + <message> + <location/> + <source>Print a list of all the translation units in the current translation source file.</source> + <translation>Az összes fordítási egység kinyomtatása az aktuális fordítási forrás fájlban.</translation> + </message> + <message> + <location/> + <source>Undo the last editing operation performed on the current translation.</source> + <translation>Az utoljára szerkesztett művelet visszavonása az aktuális fordításon.</translation> + </message> + <message> + <location/> + <source>Ctrl+Z</source> + <translation>Ctrl+Z</translation> + </message> + <message> + <location/> + <source>&Redo</source> + <translation>&Helyreállítás</translation> + </message> + <message> + <location/> + <source>Redo an undone editing operation performed on the translation.</source> + <translation>Szerkesztő művelet helyreállítása és visszavonása, ami az aktuális fordításon lett végrehajtva.</translation> + </message> + <message> + <location/> + <source>Ctrl+Y</source> + <translation>Ctrl+Y</translation> + </message> + <message> + <location/> + <source>Cu&t</source> + <translation>&Kivágás</translation> + </message> + <message> + <location/> + <source>Copy the selected translation text to the clipboard and deletes it.</source> + <translation>A kiválasztott fordítási szöveg vágólapra másolása és törlése.</translation> + </message> + <message> + <location/> + <source>Ctrl+X</source> + <translation>Ctrl+X</translation> + </message> + <message> + <location/> + <source>&Copy</source> + <translation>&Másolás</translation> + </message> + <message> + <location/> + <source>Copy the selected translation text to the clipboard.</source> + <translation>A kiválaszott fordítási szöveg vágólapra másolása.</translation> + </message> + <message> + <location/> + <source>Ctrl+C</source> + <translation>Ctrl+C</translation> + </message> + <message> + <location/> + <source>&Paste</source> + <translation>&Beillesztés</translation> + </message> + <message> + <location/> + <source>Paste the clipboard text into the translation.</source> + <translation>A vágólapon levő szöveg fordításba illesztése.</translation> + </message> + <message> + <location/> + <source>Ctrl+V</source> + <translation>Ctrl+V</translation> + </message> + <message> + <location/> + <source>Select &All</source> + <translation>Az &összes kiválasztása</translation> + </message> + <message> + <location/> + <source>Select the whole translation text.</source> + <translation>Az egész fordítási szöveg kiválasztása.</translation> + </message> + <message> + <location/> + <source>Ctrl+A</source> + <translation>Ctrl+A</translation> + </message> + <message> + <location/> + <source>&Find...</source> + <translation>&Keresés...</translation> + </message> + <message> + <location/> + <source>Search for some text in the translation source file.</source> + <translation>Néhány szövegre keresés a fordítási forrás fájlban.</translation> + </message> + <message> + <location/> + <source>Ctrl+F</source> + <translation>Ctrl+F</translation> + </message> + <message> + <location/> + <source>Find &Next</source> + <translation>&Következő keresése</translation> + </message> + <message> + <location/> + <source>Continue the search where it was left.</source> + <translation>A keresés folytatása ott, ahol abba lett hagyva.</translation> + </message> + <message> + <location/> + <source>F3</source> + <translation>F3</translation> + </message> + <message> + <location/> + <source>&Prev Unfinished</source> + <translation>Az &előző befejezetlen</translation> + </message> + <message> + <location/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location/> + <source>&Close All</source> + <translation>Az összes &bezárása</translation> + </message> + <message> + <location/> + <source>Ctrl+W</source> + <translation>Ctrl+W</translation> + </message> + <message> + <location/> + <source>Ctrl+K</source> + <translation>Ctrl+K</translation> + </message> + <message> + <location/> + <source>&Next Unfinished</source> + <translation>&Következő befejezetlen</translation> + </message> + <message> + <location/> + <source>P&rev</source> + <translation>&Előző</translation> + </message> + <message> + <location/> + <source>Ctrl+Shift+K</source> + <translation>Ctrl+Shift+K</translation> + </message> + <message> + <location/> + <source>Ne&xt</source> + <translation>&Következő</translation> + </message> + <message> + <location/> + <source>&Done and Next</source> + <translation>&Kész és Következő</translation> + </message> + <message> + <location/> + <source>Copies the source text into the translation field.</source> + <translation>Forrás szövegek fordítási mezőbe másolása.</translation> + </message> + <message> + <location/> + <source>Ctrl+B</source> + <translation>Ctrl+B</translation> + </message> + <message> + <location/> + <source>&Accelerators</source> + <translation>&Gyorsítások</translation> + </message> + <message> + <location/> + <source>&Ending Punctuation</source> + <translation>&Vég írásjelek</translation> + </message> + <message> + <location/> + <source>&Phrase matches</source> + <translation>&Fázis egyezés</translation> + </message> + <message> + <location/> + <source>Place &Marker Matches</source> + <translation>Hely &megjelölők egyezései</translation> + </message> + <message> + <location/> + <source>&New Phrase Book...</source> + <translation>&Új fázis könyv...</translation> + </message> + <message> + <location/> + <source>Create a new phrase book.</source> + <translation>Egy új fázis könyv létrehozása.</translation> + </message> + <message> + <location/> + <source>Ctrl+N</source> + <translation>Ctrl+N</translation> + </message> + <message> + <location/> + <source>&Open Phrase Book...</source> + <translation>Fázis könyv &megnyitása...</translation> + </message> + <message> + <location/> + <source>Open a phrase book to assist translation.</source> + <translation>Fáris könyv megnyitása a fordítás támogatásával.</translation> + </message> + <message> + <location/> + <source>Ctrl+H</source> + <translation>Ctrl+H</translation> + </message> + <message> + <location/> + <source>&Reset Sorting</source> + <translation>&Rendezés helyreállítása</translation> + </message> + <message> + <location/> + <source>Sort the items back in the same order as in the message file.</source> + <translation>Az elemek visszarendezése ugyanabba a sorrendben, ahogy az üzenet fájlban található.</translation> + </message> + <message> + <location/> + <source>&Display guesses</source> + <translation>Feltételezések &kijelzése</translation> + </message> + <message> + <location/> + <source>Set whether or not to display translation guesses.</source> + <translation>Annak beállítása, hogy vajon kijelezze a fordítási feltételezéseket vagy sem.</translation> + </message> + <message> + <location/> + <source>&Statistics</source> + <translation>&Statisztikák</translation> + </message> + <message> + <location/> + <source>Display translation statistics.</source> + <translation>Fordítási statisztikák kijelzése.</translation> + </message> + <message> + <location/> + <source>&Manual</source> + <translation>&Kézi</translation> + </message> + <message> + <location/> + <source>F1</source> + <translation>F1</translation> + </message> + <message> + <location/> + <source>About Qt Linguist</source> + <translation>Qt Linguist-ról</translation> + </message> + <message> + <location/> + <source>About Qt</source> + <translation>Qt-ról</translation> + </message> + <message> + <location/> + <source>Display information about the Qt toolkit by Trolltech.</source> + <translation>Információ megjelenítése a Trolltech Qt eszközrendszeréről.</translation> + </message> + <message> + <location/> + <source>&What's This?</source> + <translation>&Mi ez?</translation> + </message> + <message> + <location/> + <source>What's This?</source> + <translation>Mi ez?</translation> + </message> + <message> + <location/> + <source>Enter What's This? mode.</source> + <translation>Mi ez? beviteli mód.</translation> + </message> + <message> + <location/> + <source>Shift+F1</source> + <translation>Shift+F1</translation> + </message> + <message> + <location/> + <source>&Search And Translate...</source> + <translation>&Keresés és fordítás...</translation> + </message> + <message> + <location/> + <source>Replace the translation on all entries that matches the search source text.</source> + <translation>A fordítások kicserélése az összes olyan helyen, ahol az megegyezik a keresett forrás szöveggel.</translation> + </message> + <message> + <location/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+21"/> + <source>&Batch Translation...</source> + <translation>&Köteg fordítás...</translation> + </message> + <message> + <location/> + <source>Batch translate all entries using the information in the phrase books.</source> + <translation>Köteg fordítás mindenhol, ahol az információ a fázis könyvekben van haszálva.</translation> + </message> + <message> + <location/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-34"/> + <location line="+10"/> + <source>Release As...</source> + <translation>Kiadás, mint...</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-2005"/> + <source></source> + <comment>This is the application's main window.</comment> + <translatorcomment>Ez az alkalmazás fő ablaka.</translatorcomment> + <translation></translation> + </message> + <message> + <location line="+188"/> + <source>Source text</source> + <translation>Forrás szöveg</translation> + </message> + <message> + <location line="+1"/> + <location line="+25"/> + <source>Index</source> + <translation>Index</translation> + </message> + <message> + <location line="-2"/> + <location line="+63"/> + <source>Context</source> + <translation>Összefüggés</translation> + </message> + <message> + <location line="-62"/> + <source>Items</source> + <translation>Elemek</translation> + </message> + <message> + <location line="+79"/> + <source>This panel lists the source contexts.</source> + <translation>Ez a panel kilistázza a forrás összefüggéseket.</translation> + </message> + <message> + <location line="+15"/> + <source>Strings</source> + <translation>Sztringek</translation> + </message> + <message> + <location line="+39"/> + <source>Phrases and guesses</source> + <translation>Kommunikációk és feltételezések</translation> + </message> + <message> + <location line="+10"/> + <source>Sources and Forms</source> + <translation>Források és formák</translation> + </message> + <message> + <location line="+15"/> + <source>Warnings</source> + <translation>Figyelmeztetések</translation> + </message> + <message> + <location line="+59"/> + <source> MOD </source> + <comment>status bar: file(s) modified</comment> + <translation>MOD</translation> + </message> + <message> + <location line="+130"/> + <source>Loading...</source> + <translation>Betöltés...</translation> + </message> + <message> + <location line="+32"/> + <location line="+22"/> + <source>Loading File - Qt Linguist</source> + <translation>Fájl betöltése - Qt Linguist</translation> + </message> + <message> + <location line="-21"/> + <source>The file '%1' does not seem to be related to the currently open file(s) '%2'. + +Close the open file(s) first?</source> + <translation>A(z) '%1' fájl nem tartozik hozzá egyetlen aktuálisan megnyitott '%2' fájlhoz sem. + +Bezárja először a megnyitott fájl(oka)t?</translation> + </message> + <message> + <location line="+22"/> + <source>The file '%1' does not seem to be related to the file '%2' which is being loaded as well. + +Skip loading the first named file?</source> + <translation>A(z) '%1' fájl nem tartozik egyetlen '%2' fájlhoz sem, amelyik ugyanúgy be lett töltve. + +Azt első megnevezett fájl betöltésének kihagyása?</translation> + </message> + <message numerus="yes"> + <location line="+61"/> + <source>%n translation unit(s) loaded.</source> + <translation> + <numerusform>%n fordítási egység betöltése.</numerusform> + </translation> + </message> + <message> + <location line="+93"/> + <source>Related files (%1);;</source> + <translation>Hozzákapcsolodó fájlok (%1);;</translation> + </message> + <message> + <location line="+4"/> + <source>Open Translation Files</source> + <translation>Fordítási fájlok megnyitása</translation> + </message> + <message> + <location line="+10"/> + <location line="+31"/> + <source>File saved.</source> + <translation>Fájl elmentve.</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.ui"/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+15"/> + <location line="+1165"/> + <source>Release</source> + <translation>Kiadás</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-1164"/> + <source>Qt message files for released applications (*.qm) +All files (*)</source> + <translation>Qt üzenet fájlok a kiadott alkalmazásra (*.qm) +Az összes fájl(*)</translation> + </message> + <message> + <location line="+3"/> + <location line="+12"/> + <source>File created.</source> + <translation>Fál létrehozva.</translation> + </message> + <message> + <location line="+34"/> + <location line="+355"/> + <source>Printing...</source> + <translation>Nyomtatás...</translation> + </message> + <message> + <location line="-347"/> + <source>Context: %1</source> + <translation>Összefüggés: %1</translation> + </message> + <message> + <location line="+32"/> + <source>finished</source> + <translation>Befejezve</translation> + </message> + <message> + <location line="+3"/> + <source>unresolved</source> + <translation>Nincs megoldva</translation> + </message> + <message> + <location line="+3"/> + <source>obsolete</source> + <translation>Elavulás</translation> + </message> + <message> + <location line="+15"/> + <location line="+307"/> + <source>Printing... (page %1)</source> + <translation>Nyomtatás... (%1 lap)</translation> + </message> + <message> + <location line="-300"/> + <location line="+307"/> + <source>Printing completed</source> + <translation>Nyomtatás teljesítve</translation> + </message> + <message> + <location line="-305"/> + <location line="+307"/> + <source>Printing aborted</source> + <translation>Nyomtatás megszakítva</translation> + </message> + <message> + <location line="-232"/> + <source>Search wrapped.</source> + <translation>Keresés elrejtése.</translation> + </message> + <message> + <location line="+17"/> + <location line="+278"/> + <location line="+34"/> + <location line="+24"/> + <location line="+22"/> + <location line="+516"/> + <location line="+1"/> + <location line="+274"/> + <location line="+40"/> + <location line="+10"/> + <source>Qt Linguist</source> + <translation>Qt Linguist</translation> + </message> + <message> + <location line="-1198"/> + <location line="+102"/> + <source>Cannot find the string '%1'.</source> + <translation>A(z) '%1' sztring nem található.</translation> + </message> + <message> + <location line="-82"/> + <source>Search And Translate in '%1' - Qt Linguist</source> + <translation>Keresés és fordítás a(z) '%1'-ben - Qt Linguist</translation> + </message> + <message> + <location line="+34"/> + <location line="+23"/> + <location line="+24"/> + <source>Translate - Qt Linguist</source> + <translation>Qt Linguist fordítása</translation> + </message> + <message numerus="yes"> + <location line="-46"/> + <source>Translated %n entry(s)</source> + <translation> + <numerusform>%n bevitel lefordítva</numerusform> + </translation> + </message> + <message> + <location line="+23"/> + <source>No more occurrences of '%1'. Start over?</source> + <translation>Nem található '%1' több előfordulása. Előlről kezdi?</translation> + </message> + <message> + <location line="+30"/> + <source>Create New Phrase Book</source> + <translation>Új kommunikációs könyv létrehozása</translation> + </message> + <message> + <location line="+1"/> + <source>Qt phrase books (*.qph) +All files (*)</source> + <translation>Qt kommunikációs könyv (*.qph) +Az összes fájl (*)</translation> + </message> + <message> + <location line="+11"/> + <source>Phrase book created.</source> + <translation>Kommunikációs könyv létrehozva.</translation> + </message> + <message> + <location line="+17"/> + <source>Open Phrase Book</source> + <translation>Kommunikációs könyv megnyitása</translation> + </message> + <message> + <location line="+1"/> + <source>Qt phrase books (*.qph);;All files (*)</source> + <translation>Qt kommunikációs könyvek (*.qpm);;Az összes fájl (*)</translation> + </message> + <message numerus="yes"> + <location line="+7"/> + <source>%n phrase(s) loaded.</source> + <translation> + <numerusform>%n kommunikáció betöltése.</numerusform> + </translation> + </message> + <message> + <location line="+93"/> + <location line="+3"/> + <location line="+7"/> + <source>Add to phrase book</source> + <translation>Kommunikációs könyv hozzáadása</translation> + </message> + <message> + <location line="-9"/> + <source>No appropriate phrasebook found.</source> + <translation>Nem található megfelelő kommunikációs könyv.</translation> + </message> + <message> + <location line="+3"/> + <source>Adding entry to phrasebook %1</source> + <translation>Új elem hozzáadása a(z) %1 fázis fáziskönyvhöz</translation> + </message> + <message> + <location line="+7"/> + <source>Select phrase book to add to</source> + <translation>Kommunikációs könyv kiválasztása hozzáadásra</translation> + </message> + <message> + <location line="+29"/> + <source>Unable to launch Qt Assistant (%1)</source> + <translation>Nem lehet elindítani a Qt Assistant (%1)</translation> + </message> + <message> + <location line="+17"/> + <source>Version %1</source> + <translation>%1 Verzió</translation> + </message> + <message> + <location line="+3"/> + <source><center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist is a tool for adding translations to Qt applications.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</source> + <translation><center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist egy olyan eszköz, amelyekkel fordítások adhat hozzá a Qt alkalmazásokhoz.</p><p>Szerzői jog(C) 2010 Nokia Vállalat és/vagy leányvállalatai.</translation> + </message> + <message> + <location line="+38"/> + <source>Do you want to save the modified files?</source> + <translation>El szeretné menteni a módosított fájlokat?</translation> + </message> + <message> + <location line="+22"/> + <source>Do you want to save '%1'?</source> + <translation>El szeretné menteni a(z) %1-t ?</translation> + </message> + <message> + <location line="+43"/> + <source>Qt Linguist[*]</source> + <translation>Qt Linguist[*]</translation> + </message> + <message> + <location line="+2"/> + <source>%1[*] - Qt Linguist</source> + <translation>%1[*] - Qt Linguist</translation> + </message> + <message> + <location line="+267"/> + <location line="+12"/> + <source>No untranslated translation units left.</source> + <translation>Nem maradtak lefordítatlan fordítások.</translation> + </message> + <message> + <location line="+176"/> + <source>&Window</source> + <translation>&Ablak</translation> + </message> + <message> + <location line="+2"/> + <source>Minimize</source> + <translation>Minimalizálás</translation> + </message> + <message> + <location line="+1"/> + <source>Ctrl+M</source> + <translation>Ctrl+M</translation> + </message> + <message> + <location line="+12"/> + <source>Display the manual for %1.</source> + <translation>A manuál megjelenítése %1-re vonatkozóan.</translation> + </message> + <message> + <location line="+1"/> + <source>Display information about %1.</source> + <translation>Információ megjelenítése a(z) %1-ről.</translation> + </message> + <message> + <location line="+70"/> + <source>&Save '%1'</source> + <translation>'%1' &mentése</translation> + </message> + <message> + <location line="+1"/> + <source>Save '%1' &As...</source> + <translation>'%1' &másként mentése...</translation> + </message> + <message> + <location line="+1"/> + <source>Release '%1'</source> + <translation>'%1' kiadása</translation> + </message> + <message> + <location line="+1"/> + <source>Release '%1' As...</source> + <translation>'%1' másként kiadása...</translation> + </message> + <message> + <location line="+1"/> + <source>&Close '%1'</source> + <translation>'%1' &bezárása</translation> + </message> + <message> + <location line="+6"/> + <location line="+13"/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> + <message> + <location line="-10"/> + <source>Save All</source> + <translation>Az összes mentése</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.ui"/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+1"/> + <source>&Release All</source> + <translation>Az összes &kiadása</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+1"/> + <source>Close All</source> + <translation>Az összes bezárása</translation> + </message> + <message> + <location line="+23"/> + <source>Translation File &Settings for '%1'...</source> + <translation>Fordítási fájlok &beállítása erre '%1'...</translation> + </message> + <message> + <location line="+1"/> + <source>&Batch Translation of '%1'...</source> + <translation>A(z) '%1' &köteg fordítása...</translation> + </message> + <message> + <location line="+1"/> + <source>Search And &Translate in '%1'...</source> + <translation>Keresés és &fordítás '%1'-ben...</translation> + </message> + <message> + <location line="+4"/> + <source>Search And &Translate...</source> + <translation>Keresés és &fordítás...</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.ui"/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+51"/> + <source>File</source> + <translation>Fájl</translation> + </message> + <message> + <location/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+7"/> + <source>Edit</source> + <translation>Szerkesztés</translation> + </message> + <message> + <location/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+6"/> + <source>Translation</source> + <translation>Fordítás</translation> + </message> + <message> + <location/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+6"/> + <source>Validation</source> + <translation>Érvényesítés</translation> + </message> + <message> + <location/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+7"/> + <source>Help</source> + <translation>Súgó</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="+84"/> + <source>Cannot read from phrase book '%1'.</source> + <translation>Nem lehet a(z) '%1' kommunikációs könyvből olvasni.</translation> + </message> + <message> + <location line="+15"/> + <source>Close this phrase book.</source> + <translation>A kommunikációs könyv bezárása.</translation> + </message> + <message> + <location line="+4"/> + <source>Enables you to add, modify, or delete entries in this phrase book.</source> + <translation>Hozzáadás, módosítás, vagy törlés engedélyezése ebben a kommunikációs könyvben.</translation> + </message> + <message> + <location line="+5"/> + <source>Print the entries in this phrase book.</source> + <translation>Az összes bevitel kinyomtatása ebben a társalgási szótárban.</translation> + </message> + <message> + <location line="+16"/> + <source>Cannot create phrase book '%1'.</source> + <translation>Nem lehet a '%1' társalgási szótárat létrehozni.</translation> + </message> + <message> + <location line="+10"/> + <source>Do you want to save phrase book '%1'?</source> + <translation>El szeretné menteni a '%1' társalgási szótárat?</translation> + </message> + <message> + <location line="+323"/> + <source>All</source> + <translation>Mind</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.ui"/> + <source>Open/Refresh Form &Preview</source> + <translation>Forma megnyitása/felfrissítése &nézet</translation> + </message> + <message> + <location/> + <source>Form Preview Tool</source> + <translation>Forma előnézeti eszköz</translation> + </message> + <message> + <location/> + <source>F5</source> + <translation>F5</translation> + </message> + <message> + <location/> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-536"/> + <source>Translation File &Settings...</source> + <translation>Fordítási fájl &beállítások...</translation> + </message> + <message> + <location/> + <source>&Add to Phrase Book</source> + <translation>Társalgási szótárhoz &hozzáadás</translation> + </message> + <message> + <location/> + <source>Ctrl+T</source> + <translation>Ctrl+T</translation> + </message> + <message> + <location/> + <source>Ctrl+J</source> + <translation>Ctrl+J</translation> + </message> + <message> + <location/> + <source>Ctrl+Shift+J</source> + <translation>Ctrl+Shift+J</translation> + </message> + <message> + <location/> + <source>Previous unfinished item</source> + <translation>Előző befejezetlen elem</translation> + </message> + <message> + <location/> + <source>Next unfinished item</source> + <translation>Következő befejezetlen elem</translation> + </message> + <message> + <location/> + <source>Move to previous item</source> + <translation>Az előző befejezetlen elemre mozgás</translation> + </message> + <message> + <location/> + <source>Next item</source> + <translation>Következő elem</translation> + </message> + <message> + <location/> + <source>Mark item as done and move to the next unfinished item</source> + <translation>Az elem készként jelölése és a következő befejezetlen elemre mozgatás</translation> + </message> + <message> + <location/> + <source>Copies the source text into the translation field</source> + <translation>A forrás szöveg fordítási szövegbe másolása</translation> + </message> + <message> + <location/> + <source>Toggle the validity check of accelerators</source> + <translation>Gyorsítások érvényesség ellenőrzésének kapcsolgatása</translation> + </message> + <message> + <location/> + <source>Toggle the validity check of ending punctuation</source> + <translation>Vég írásjelek érvényesség ellenőrzésének kapcsolgatása</translation> + </message> + <message> + <location/> + <source>Toggle checking that phrase suggestions are used</source> + <translation>A használt társalgási ajánlások ellenőrzésének kapcsolgatása</translation> + </message> + <message> + <location/> + <source>Toggle the validity check of place markers</source> + <translation>Hely megjelölők érvényesség vizsgálatának kapcsolgatása</translation> + </message> + <message> + <location/> + <source>Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the TS file.</source> + <translation>Egy Qt üzenet fájl létrehozása az aktuális üzenet fájlból, amely megfelelő az alkalmazás kiadásaira. A fájlnév TS fájl nevéből lesz automatikusan meghatározva.</translation> + </message> + <message> + <location/> + <source>Length Variants</source> + <translation>Hossz változatok</translation> + </message> +</context> +<context> + <name>MessageEditor</name> + <message> + <location filename="../tools/linguist/linguist/messageeditor.cpp" line="+42"/> + <source></source> + <comment>This is the right panel of the main window.</comment> + <translatorcomment>Ez a fő ablak jobb panelja.</translatorcomment> + <translation></translation> + </message> + <message> + <location line="+30"/> + <source>Russian</source> + <translation>Orosz</translation> + </message> + <message> + <location line="+1"/> + <source>German</source> + <translation>Német</translation> + </message> + <message> + <location line="+1"/> + <source>Japanese</source> + <translation>Japán</translation> + </message> + <message> + <location line="+1"/> + <source>French</source> + <translation>Francia</translation> + </message> + <message> + <location line="+1"/> + <source>Polish</source> + <translation>Lengyel</translation> + </message> + <message> + <location line="+1"/> + <source>Chinese</source> + <translation>Kínai</translation> + </message> + <message> + <location line="+53"/> + <source>This whole panel allows you to view and edit the translation of some source text.</source> + <translation>Ez az egész pabel engedélyezi néhány forrás szöveg fordításának megtekintését és szerkesztését.</translation> + </message> + <message> + <location line="+18"/> + <source>Source text</source> + <translation>Forrás szöveg</translation> + </message> + <message> + <location line="+2"/> + <source>This area shows the source text.</source> + <translation>Ez a terület mutatja a forrás szöveget.</translation> + </message> + <message> + <location line="+4"/> + <source>Source text (Plural)</source> + <translation>Forrás szöveg (Többesszám)</translation> + </message> + <message> + <location line="+2"/> + <source>This area shows the plural form of the source text.</source> + <translation>Ez a terület mutatja a forrás szöveg többesszámú formáját.</translation> + </message> + <message> + <location line="+4"/> + <source>Developer comments</source> + <translation>Fejlesztői megjegyzések</translation> + </message> + <message> + <location line="+3"/> + <source>This area shows a comment that may guide you, and the context in which the text occurs.</source> + <translation>Ez a terület mutatja a megjegyzéseket, ami segítheti Önt, és az összefüggéseket, hogy melyik szövegben fordul elő.</translation> + </message> + <message> + <location line="+59"/> + <source>Here you can enter comments for your own use. They have no effect on the translated applications.</source> + <translation>Itt hozzáadhatja a saját megjegyzését saját használatra. Nincsen hatásuk a lefordított alkalmazásokon.</translation> + </message> + <message> + <location line="+232"/> + <source>%1 translation (%2)</source> + <translation>%1 fordítás (%2)</translation> + </message> + <message> + <location line="+9"/> + <source>This is where you can enter or modify the translation of the above source text.</source> + <translation>Ez az a hely, ahol beviheti és módosíthatja a fentebb található forrás szöveg fordítását.</translation> + </message> + <message> + <location line="+5"/> + <source>%1 translation</source> + <translation>%1 fordítás</translation> + </message> + <message> + <location line="+1"/> + <source>%1 translator comments</source> + <translation>%1 fordító megjegyzések</translation> + </message> + <message> + <location line="+157"/> + <source>'%1' +Line: %2</source> + <translation>'%1' +Sor: %2</translation> + </message> +</context> +<context> + <name>MessageModel</name> + <message> + <location filename="../tools/linguist/linguist/messagemodel.cpp" line="+832"/> + <source>Completion status for %1</source> + <translation>%1 elkészítési státusza</translation> + </message> + <message> + <location line="+15"/> + <source><file header></source> + <translation><file header></translation> + </message> + <message> + <location line="+2"/> + <source><context comment></source> + <translation><context comment></translation> + </message> + <message> + <location line="+71"/> + <source><unnamed context></source> + <translation><unnamed context></translation> + </message> +</context> +<context> + <name>MsgEdit</name> + <message> + <location filename="../tools/linguist/linguist/messageeditor.cpp" line="-614"/> + <source></source> + <comment>This is the right panel of the main window.</comment> + <translatorcomment>Ez a fő ablak jobb panelja.</translatorcomment> + <translation></translation> + </message> +</context> +<context> + <name>PhraseBookBox</name> + <message> + <location filename="../tools/linguist/linguist/phrasebookbox.cpp" line="+12"/> + <source></source> + <comment>Go to Phrase > Edit Phrase Book... The dialog that pops up is a PhraseBookBox.</comment> + <translatorcomment>Társalgás -> Társalgási szótár szerkesztése... A felbukkanó ablak egy TársalgásiSzótárDoboz.</translatorcomment> + <translation></translation> + </message> + <message> + <location line="+54"/> + <source>(New Entry)</source> + <translation>(Új bevitel)</translation> + </message> + <message> + <location line="+3"/> + <source>%1[*] - Qt Linguist</source> + <translation>%1[*] - Qt Linguist</translation> + </message> + <message> + <location line="+90"/> + <source>Qt Linguist</source> + <translation>Qt Linguist</translation> + </message> + <message> + <location line="+1"/> + <source>Cannot save phrase book '%1'.</source> + <translation>Nem lehet elmenteni a(z) '%1' társalgási szótárat.</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/phrasebookbox.ui"/> + <source>Edit Phrase Book</source> + <translation>Társalgási szótár szerkesztése</translation> + </message> + <message> + <location/> + <source>This window allows you to add, modify, or delete entries in a phrase book.</source> + <translation>Ez az ablak engedélyezi új bevitelek hozzáadását, módosítását, vagy törlését egy társalgási szótárban.</translation> + </message> + <message> + <location/> + <source>&Translation:</source> + <translation>&Fordítás:</translation> + </message> + <message> + <location/> + <source>This is the phrase in the target language corresponding to the source phrase.</source> + <translation>Ez a forrás társalgás megfelelője a cél nyelvben.</translation> + </message> + <message> + <location/> + <source>S&ource phrase:</source> + <translation>&Forrás társalgás:</translation> + </message> + <message> + <location/> + <source>This is a definition for the source phrase.</source> + <translation>Ez egy forrás fordítás definíció.</translation> + </message> + <message> + <location/> + <source>This is the phrase in the source language.</source> + <translation>Ez egy társalgás a forrás nyelvben.</translation> + </message> + <message> + <location/> + <source>&Definition:</source> + <translation>&Definíció:</translation> + </message> + <message> + <location/> + <source>Click here to add the phrase to the phrase book.</source> + <translation>Kattintson ide a társalgás hozzáadásához a társalgási könyvben.</translation> + </message> + <message> + <location/> + <source>&New Entry</source> + <translation>&Új bevitel</translation> + </message> + <message> + <location/> + <source>Click here to remove the entry from the phrase book.</source> + <translation>Kattintson ide a bevitel társalgási könyvből való eltávolításához.</translation> + </message> + <message> + <location/> + <source>&Remove Entry</source> + <translation>Bevitel &eltávolítása</translation> + </message> + <message> + <location/> + <source>Settin&gs...</source> + <translation>&Beállítások...</translation> + </message> + <message> + <location/> + <source>Click here to save the changes made.</source> + <translation>Kattintson ide a változtatások elmentéséhez.</translation> + </message> + <message> + <location/> + <source>&Save</source> + <translation>&Mentés</translation> + </message> + <message> + <location/> + <source>Click here to close this window.</source> + <translation>Kattintson ide az ablak bezárásához.</translation> + </message> + <message> + <location/> + <source>Close</source> + <translation>Bezárás</translation> + </message> +</context> +<context> + <name>PhraseModel</name> + <message> + <location filename="../tools/linguist/linguist/phrasemodel.cpp" line="+117"/> + <source>Source phrase</source> + <translation>Forrás társalgás</translation> + </message> + <message> + <location line="+2"/> + <source>Translation</source> + <translation>Fordítás</translation> + </message> + <message> + <location line="+2"/> + <source>Definition</source> + <translation>Definíció</translation> + </message> +</context> +<context> + <name>PhraseView</name> + <message> + <location filename="../tools/linguist/linguist/phraseview.cpp" line="+122"/> + <source>Insert</source> + <translation>Beszúrás</translation> + </message> + <message> + <location line="+3"/> + <source>Edit</source> + <translation>Szerkesztés</translation> + </message> + <message> + <location line="+113"/> + <source>Guess (%1)</source> + <translation>Feltételezés (%1)</translation> + </message> + <message> + <location line="+2"/> + <source>Guess</source> + <translation>Feltételezés</translation> + </message> +</context> +<context> + <name>QObject</name> + <message> + <location filename="../tools/linguist/shared/qm.cpp" line="+12"/> + <source>Compiled Qt translations</source> + <translation>Lefordított Qt fordítások</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/mainwindow.cpp" line="-1280"/> + <source>Translation files (%1);;</source> + <translation>Fordítási fájlok (%1);;</translation> + </message> + <message> + <location line="+5"/> + <source>All files (*)</source> + <translation>Fájlok hozzáadása ( *)</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/messagemodel.cpp" line="-1127"/> + <location line="+27"/> + <location line="+67"/> + <location line="+39"/> + <location line="+17"/> + <location line="+15"/> + <location filename="../tools/linguist/linguist/phrase.cpp" line="+196"/> + <source>Qt Linguist</source> + <translation>Qt Linguist</translation> + </message> + <message> + <location filename="../tools/linguist/shared/po.cpp" line="+658"/> + <source>GNU Gettext localization files</source> + <translation>GNU Gettext lokalizációs fájlok</translation> + </message> + <message> + <location filename="../tools/linguist/shared/ts.cpp" line="+752"/> + <source>Qt translation sources (format 1.1)</source> + <translation>Qt fordítási forrása (1.1 formátum)</translation> + </message> + <message> + <location line="+8"/> + <source>Qt translation sources (format 2.0)</source> + <translation>Qt fordítás források (2.0 formátum)</translation> + </message> + <message> + <location line="+9"/> + <source>Qt translation sources (latest format)</source> + <translation>Qt fordítási források (legutolsó formátum)</translation> + </message> + <message> + <location filename="../tools/linguist/shared/xliff.cpp" line="+827"/> + <source>XLIFF localization files</source> + <translation>XLIFF lokalizációs fájlok</translation> + </message> + <message> + <location filename="../tools/linguist/shared/qph.cpp" line="+183"/> + <source>Qt Linguist 'Phrase Book'</source> + <translation>Qt Linguist 'Társalgási Könyv'</translation> + </message> +</context> +<context> + <name>SourceCodeView</name> + <message> + <location filename="../tools/linguist/linguist/sourcecodeview.cpp" line="+70"/> + <source><i>Source code not available</i></source> + <translation><i>A forrás kód nem elérhető</i></translation> + </message> + <message> + <location line="+33"/> + <source><i>File %1 not available</i></source> + <translation><i>A(z) %1 fájl nem elérhető</i></translation> + </message> + <message> + <location line="+5"/> + <source><i>File %1 not readable</i></source> + <translation><i>A(z) %1 fájl nem olvasható</i></translation> + </message> +</context> +<context> + <name>Statistics</name> + <message> + <location filename="../tools/linguist/linguist/statistics.ui"/> + <source>Statistics</source> + <translation>Statisztikák</translation> + </message> + <message> + <location/> + <source>Translation</source> + <translation>Fordítás</translation> + </message> + <message> + <location/> + <source>Source</source> + <translation>Forrás</translation> + </message> + <message> + <location/> + <source>0</source> + <translation>0</translation> + </message> + <message> + <location/> + <source>Words:</source> + <translation>Szavak:</translation> + </message> + <message> + <location/> + <source>Characters:</source> + <translation>Karakterek:</translation> + </message> + <message> + <location/> + <source>Characters (with spaces):</source> + <translation>Karakterek (szóközökkel):</translation> + </message> + <message> + <location/> + <source>Close</source> + <translation>Bezárás</translation> + </message> +</context> +<context> + <name>TranslateDialog</name> + <message> + <location filename="../tools/linguist/linguist/translatedialog.ui"/> + <source>This window allows you to search for some text in the translation source file.</source> + <translation>Ez az ablak engedélyezi, hogy rákeressen néhány szövegre a fordítási forrás fájlban.</translation> + </message> + <message> + <location/> + <source>Type in the text to search for.</source> + <translation>Gépelje be a keresni kívánt szöveget.</translation> + </message> + <message> + <location/> + <source>Find &source text:</source> + <translation>&Forrás szöveg keresése:</translation> + </message> + <message> + <location/> + <source>&Translate to:</source> + <translation>&Fordítás erre:</translation> + </message> + <message> + <location/> + <source>Search options</source> + <translation>Keresés opciók</translation> + </message> + <message> + <location/> + <source>Texts such as 'TeX' and 'tex' are considered as different when checked.</source> + <translation>'TeX' és 'text' szövegek különbözően kezelése bejelöléskor.</translation> + </message> + <message> + <location/> + <source>Match &case</source> + <translation>Megegyező &eset</translation> + </message> + <message> + <location/> + <source>Mark new translation as &finished</source> + <translation>Új fordítások &befejezettként jelölése</translation> + </message> + <message> + <location/> + <source>Click here to find the next occurrence of the text you typed in.</source> + <translation>Kattintson ide a begépelt szöveg következő előfordulásának megkereséséhez.</translation> + </message> + <message> + <location/> + <source>Find Next</source> + <translation>Következő keresése</translation> + </message> + <message> + <location/> + <source>Translate</source> + <translation>Fordítás</translation> + </message> + <message> + <location/> + <source>Translate All</source> + <translation>Az összes fordítása</translation> + </message> + <message> + <location/> + <source>Click here to close this window.</source> + <translation>Kattintson ide az ablak bezárásához.</translation> + </message> + <message> + <location/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> +</context> +<context> + <name>TranslationSettingsDialog</name> + <message> + <location filename="../tools/linguist/linguist/translationsettingsdialog.cpp" line="+68"/> + <source>Any Country</source> + <translation>Bármeny ország</translation> + </message> + <message> + <location line="+11"/> + <location line="+8"/> + <source>Settings for '%1' - Qt Linguist</source> + <translation>'%1'-re állítás - Qt Linguist</translation> + </message> + <message> + <location filename="../tools/linguist/linguist/translationsettings.ui"/> + <source>Source language</source> + <translation>Forrás nyelv</translation> + </message> + <message> + <location/> + <source>Language</source> + <translation>Nyelv</translation> + </message> + <message> + <location/> + <source>Country/Region</source> + <translation>OrszágRégió</translation> + </message> + <message> + <location/> + <source>Target language</source> + <translation>Cél nyelv</translation> + </message> +</context> +</TS> diff --git a/translations/qt_help_hu.ts b/translations/qt_help_hu.ts new file mode 100644 index 0000000..3fbe0e9 --- /dev/null +++ b/translations/qt_help_hu.ts @@ -0,0 +1,298 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="hu_HU"> +<context> + <name>QCLuceneResultWidget</name> + <message> + <source>Search Results</source> + <translation>Keresési eredmény</translation> + </message> + <message> + <source>Note:</source> + <translation>Megjegyzés:</translation> + </message> + <message> + <source>The search results may not be complete since the documentation is still being indexed!</source> + <translation>A keresési eredmény lehet, hogy nem teljes, mivel a dokumentáció még mindig indexelvan van!</translation> + </message> + <message> + <source>Your search did not match any documents.</source> + <translation>A keresési feltételeknek megfelően nincs találat.</translation> + </message> + <message> + <source>(The reason for this might be that the documentation is still being indexed.)</source> + <translation>(Ennek az oka az lehet, hogy a dokumentáció még mindig indexelve van.)</translation> + </message> +</context> +<context> + <name>QHelpCollectionHandler</name> + <message> + <source>The collection file '%1' is not set up yet!</source> + <translation>A(z) '%1'gyűjtemény fájl még nincs beállítva!</translation> + </message> + <message> + <source>Cannot load sqlite database driver!</source> + <translation>Nem lehet betölteni az sqlite adatbázis vezérlőt!</translation> + </message> + <message> + <source>Cannot open collection file: %1</source> + <translation>Nem lehet megnyitni a gyűjtemény fájlt: %1</translation> + </message> + <message> + <source>Cannot create tables in file %1!</source> + <translation>Nem lehet lehet a(z) %1 fájlban táblákat létrehozni!</translation> + </message> + <message> + <source>The collection file '%1' already exists!</source> + <translation>A(z) '%1' gyűjtemény fájl már létezik!</translation> + </message> + <message> + <source>Unknown filter '%1'!</source> + <translation>Ismeretlen szűrő '%1'!</translation> + </message> + <message> + <source>Invalid documentation file '%1'!</source> + <translation>Érvénytelen dokumentációs fájl '%1'!</translation> + </message> + <message> + <source>Cannot register namespace '%1'!</source> + <translation>Nem lehet regisztrálni a(z) '%1' névteret!</translation> + </message> + <message> + <source>Cannot open database '%1' to optimize!</source> + <translation>Nem lehet optimalizálásra megnyitni a(z) '%1' adatbázist!</translation> + </message> + <message> + <source>Cannot create directory: %1</source> + <translation>Nem lehet a könyvtárat létrehozni: %1</translation> + </message> + <message> + <source>Cannot copy collection file: %1</source> + <translation>Nem lehet a gyűjtemény fájlt másolni: %1</translation> + </message> + <message> + <source>Cannot register filter %1!</source> + <translation>Nem lehet regisztrálni a(z) %1 szűrőt!</translation> + </message> + <message> + <source>Cannot open documentation file %1!</source> + <translation>Nem lehet megnyitni a(z) %1 dokumentációs fájlt!</translation> + </message> + <message> + <source>The namespace %1 was not registered!</source> + <translation>A(z) %1 névteret nem regisztrálták!</translation> + </message> + <message> + <source>Namespace %1 already exists!</source> + <translation>A(z) %1 névtér már létezik!</translation> + </message> +</context> +<context> + <name>QHelpDBReader</name> + <message> + <source>Cannot open database '%1' '%2': %3</source> + <translation>Nem lehet megnyitni az adatbázist '%1' '%2': %3</translation> + </message> +</context> +<context> + <name>QHelpEngineCore</name> + <message> + <source>The specified namespace does not exist!</source> + <translation>A meghatározott névtér nem létezik!</translation> + </message> +</context> +<context> + <name>QHelpEngineCorePrivate</name> + <message> + <source>Cannot open documentation file %1: %2!</source> + <translation>Nem lehet megnyitni a(z) %1 fájlt: %2!</translation> + </message> +</context> +<context> + <name>QHelpGenerator</name> + <message> + <source>Invalid help data!</source> + <translation>Érvénytelen segítség adat!</translation> + </message> + <message> + <source>No output file name specified!</source> + <translation>Nincsen kimeneti fájl meghatározva!</translation> + </message> + <message> + <source>Building up file structure...</source> + <translation>Fájl struktúra felépítése...</translation> + </message> + <message> + <source>The file %1 cannot be overwritten!</source> + <translation>Nem lehet felülírni a(z) %1 fájlt!</translation> + </message> + <message> + <source>Cannot open data base file %1!</source> + <translation>Nem lehet megnyitni a(z) %1 adatbázis fájlt!</translation> + </message> + <message> + <source>Cannot register namespace %1!</source> + <translation>Nem lehet regisztrálni a(z) %1 névteret!</translation> + </message> + <message> + <source>Insert custom filters...</source> + <translation>Szokásos szűrő beszúrása...</translation> + </message> + <message> + <source>Insert help data for filter section (%1 of %2)...</source> + <translation>Segítség adatok beszúrása a szűrő szegmens számára (%1 %2-től)...</translation> + </message> + <message> + <source>Documentation successfully generated.</source> + <translation>A dokumentáció legenerálása sikeresen lezajlott.</translation> + </message> + <message> + <source>Some tables already exist!</source> + <translation>Néhány tábla már létezik!</translation> + </message> + <message> + <source>Cannot create tables!</source> + <translation>Nem lehet a táblákat létrehozni!</translation> + </message> + <message> + <source>Cannot register virtual folder!</source> + <translation>Nem lehet registrálni a virtuális dossziét!</translation> + </message> + <message> + <source>Insert files...</source> + <translation>Fájlok beszúrása...</translation> + </message> + <message> + <source>The referenced file %1 must be inside or within a subdirectory of (%2). Skipping it.</source> + <translation>A(z) %1 hivatkozott fájlnak a(z) (%2) alkönyvtárán belül kell elhelyezkednie. Ennek kihagyása.</translation> + </message> + <message> + <source>The file %1 does not exist! Skipping it.</source> + <translation>A(z) %1 fájl nem létezik! Ennek kihagyása.</translation> + </message> + <message> + <source>Cannot open file %1! Skipping it.</source> + <translation>Nem lehet megnyitni a(z) %1 fájlt! Ennek kihagyása.</translation> + </message> + <message> + <source>The filter %1 is already registered!</source> + <translation>A(z) %1 szűrő már regisztrálva van!</translation> + </message> + <message> + <source>Cannot register filter %1!</source> + <translation>Nem lehet regisztrálni a(z) %1 szűrőt!</translation> + </message> + <message> + <source>Insert indices...</source> + <translation>Indexek beszúrása...</translation> + </message> + <message> + <source>Insert contents...</source> + <translation>Tartalom beszúrása...</translation> + </message> + <message> + <source>Cannot insert contents!</source> + <translation>Nem lehet beszúrni a tartalmat!</translation> + </message> + <message> + <source>Cannot register contents!</source> + <translation>Nem lehet regisztrálni a tartalmat!</translation> + </message> +</context> +<context> + <name>QHelpSearchQueryWidget</name> + <message> + <source>Search for:</source> + <translation>Keresés erre:</translation> + </message> + <message> + <source>Previous search</source> + <translation>Előző keresése</translation> + </message> + <message> + <source>Next search</source> + <translation>Következő keresése</translation> + </message> + <message> + <source>Search</source> + <translation>Keresés</translation> + </message> + <message> + <source>Advanced search</source> + <translation>Összetett keresés</translation> + </message> + <message> + <source>words <B>similar</B> to:</source> + <translation>szavak <B>hasonlóak</B> ehhez:</translation> + </message> + <message> + <source><B>without</B> the words:</source> + <translation>Ezen szavak <B>nélkül</B>:</translation> + </message> + <message> + <source>with <B>exact phrase</B>:</source> + <translation><B>Pontos kifejezés</B>:</translation> + </message> + <message> + <source>with <B>all</B> of the words:</source> + <translation>Ezen szavak<B>mindegyikével</B>:</translation> + </message> + <message> + <source>with <B>at least one</B> of the words:</source> + <translation><B>Legalább egy</B> a következő szavak közül:</translation> + </message> +</context> +<context> + <name>QHelpSearchResultWidget</name> + <message> + <source>0 - 0 of 0 Hits</source> + <translation>0 találat 0 - 0</translation> + </message> +</context> +<context> + <name>QHelpSearchResultWidgetPrivate</name> + <message> + <source>%1 - %2 of %3 Hits</source> + <translation>%3 Találat %1 - %2</translation> + </message> +</context> +<context> + <name>QObject</name> + <message> + <source>Unknown token.</source> + <translation>Ismeretlen jel.</translation> + </message> + <message> + <source>Unknown token. Expected "QtHelpProject"!</source> + <translation>Ismeretlen hel. "QtSegítségProjekt" várt!</translation> + </message> + <message> + <source>Error in line %1: %2</source> + <translation>Hiba a(z) %1 sorban: %2</translation> + </message> + <message> + <source>A virtual folder must not contain a '/' character!</source> + <translation>A virtuális dosszié nem tartalmazhat '/' karaktert!</translation> + </message> + <message> + <source>A namespace must not contain a '/' character!</source> + <translation>A névtér nem tartalmazhat '/' karaktert!</translation> + </message> + <message> + <source>Missing namespace in QtHelpProject.</source> + <translation>Hiányzó névtér a QtSegítségProjektben.</translation> + </message> + <message> + <source>Missing virtual folder in QtHelpProject</source> + <translation>Hiányzó virtuális dosszié a QtSegítségProjektben</translation> + </message> + <message> + <source>Missing attribute in keyword at line %1.</source> + <translation>Hiányzó attirbútum a kulcsszóban a(z) %1 sorban.</translation> + </message> + <message> + <source>The input file %1 could not be opened!</source> + <translation>Nem sikerült megnyitni a(z) %1 bemeneti fájlt!</translation> + </message> +</context> +</TS> diff --git a/translations/qt_hu.ts b/translations/qt_hu.ts new file mode 100644 index 0000000..ecc9826 --- /dev/null +++ b/translations/qt_hu.ts @@ -0,0 +1,10537 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="hu"> +<context> + <name>CloseButton</name> + <message> + <location filename="../src/gui/widgets/qtabbar.cpp" line="+2262"/> + <source>Close Tab</source> + <translation>Lap bezárása</translation> + </message> +</context> +<context> + <name>FakeReply</name> + <message> + <location filename="../src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp" line="+2198"/> + <source>Fake error !</source> + <translation>Hamisítási hiba !</translation> + </message> + <message> + <location line="+3"/> + <source>Invalid URL</source> + <translation>Érvénytelen URL</translation> + </message> +</context> +<context> + <name>Phonon::</name> + <message> + <location filename="../src/3rdparty/phonon/phonon/phononnamespace.cpp" line="+55"/> + <source>Notifications</source> + <translation>Értesítések</translation> + </message> + <message> + <location line="+2"/> + <source>Music</source> + <translation>Zene</translation> + </message> + <message> + <location line="+2"/> + <source>Video</source> + <translation>Videó</translation> + </message> + <message> + <location line="+2"/> + <source>Communication</source> + <translation>Kommunikáció</translation> + </message> + <message> + <location line="+2"/> + <source>Games</source> + <translation>Játékok</translation> + </message> + <message> + <location line="+2"/> + <source>Accessibility</source> + <translation>Hozzáférhetőség</translation> + </message> +</context> +<context> + <name>Phonon::AudioOutput</name> + <message> + <location filename="../src/3rdparty/phonon/phonon/audiooutput.cpp" line="+385"/> + <source><html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html></source> + <translation><html>Az audió visszajátszó eszköz <b>%1</b> nem működik.<br/>Visszavonul ide: <b>%2</b>.</html></translation> + </message> + <message> + <location line="+13"/> + <source><html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html></source> + <translation><html>Az audió visszajátszó eszközre kapcsolás <b>%1</b><br/>amely éppen elérhetővé vált és magasabb prioritása van.</html></translation> + </message> + <message> + <location line="+3"/> + <source>Revert back to device '%1'</source> + <translation>Visszatérés a(z) '%1' eszközre</translation> + </message> +</context> +<context> + <name>Phonon::Gstreamer::Backend</name> + <message> + <location filename="../src/3rdparty/phonon/gstreamer/backend.cpp" line="+182"/> + <source>Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. + Some video features have been disabled.</source> + <translation>Figyelmeztetés: Úgy tűnik nem telepítette megfelelően a gstreamer0.10-plugins csomagot. + Néhány videó tulajdonság tiltva van.</translation> + </message> + <message> + <location line="+5"/> + <source>Warning: You do not seem to have the base GStreamer plugins installed. + All audio and video support has been disabled</source> + <translation>Figyelmeztetés: Úgy tűnik nem telepítette az alap GStreamer beépülő modulokat. + Az összes audió és videó támogatás tiltva van</translation> + </message> +</context> +<context> + <name>Phonon::Gstreamer::MediaObject</name> + <message> + <location filename="../src/3rdparty/phonon/gstreamer/mediaobject.cpp" line="+90"/> + <source>Cannot start playback. + +Check your GStreamer installation and make sure you +have libgstreamer-plugins-base installed.</source> + <translation>Nem lehet elindítani a visszajátszást. + +Ellenőrizze le a GStreamer telepítését és győzödjön meg róla, hogy installálta a libgstreamer-plugins-base csomagot.</translation> + </message> + <message> + <location line="+113"/> + <source>A required codec is missing. You need to install the following codec(s) to play this content: %0</source> + <translation>Egy szükséges kódek hiányzik. A következő kódek(ek) telepítése szükséges ennek a tartalomnak a lejátszásához: %0</translation> + </message> + <message> + <location line="+702"/> + <location line="+8"/> + <location line="+15"/> + <location line="+26"/> + <location line="+6"/> + <location line="+19"/> + <location line="+339"/> + <location line="+24"/> + <source>Could not open media source.</source> + <translation>Nem sikerült megnyitni a média forrást.</translation> + </message> + <message> + <location line="-424"/> + <source>Invalid source type.</source> + <translation>Érvénytelen forrás típus.</translation> + </message> + <message> + <location line="+398"/> + <source>Could not locate media source.</source> + <translation>Nem sikerült telepíteni a média forrást.</translation> + </message> + <message> + <location line="+10"/> + <source>Could not open audio device. The device is already in use.</source> + <translation>Nem sikerült megnyitni az audió eszközt. Az eszköz már használatban van.</translation> + </message> + <message> + <location line="+13"/> + <source>Could not decode media source.</source> + <translation>Nem sikerült dekódolni a forrást.</translation> + </message> +</context> +<context> + <name>Phonon::MMF</name> + <message> + <location filename="../src/3rdparty/phonon/mmf/audiooutput.cpp" line="+108"/> + <source>Audio Output</source> + <translation>Audio kimenet</translation> + </message> + <message> + <location line="+1"/> + <source>The audio output device</source> + <translation>A kimeneti audió eszköz</translation> + </message> +</context> +<context> + <name>Phonon::MMF::AudioEqualizer</name> + <message> + <location filename="../src/3rdparty/phonon/mmf/audioequalizer.cpp" line="+75"/> + <source>Frequency band, %1 Hz</source> + <translation>Frekvencia sáv, '%1' Hz</translation> + </message> +</context> +<context> + <name>Phonon::MMF::EffectFactory</name> + <message> + <location filename="../src/3rdparty/phonon/mmf/effectfactory.cpp" line="+65"/> + <source>Audio Equalizer</source> + <translation>Audió hangszínszabályozó</translation> + </message> + <message> + <location line="+2"/> + <source>Bass Boost</source> + <translation>Basszus erősítés</translation> + </message> + <message> + <location line="+2"/> + <source>Distance Attenuation</source> + <translation>Távcsillapítás</translation> + </message> + <message> + <location line="+2"/> + <location line="+2"/> + <source>Environmental Reverb</source> + <translation>Környezeti visszhang</translation> + </message> + <message> + <location line="+2"/> + <source>Loudness</source> + <translation>Hangosság</translation> + </message> + <message> + <location line="+2"/> + <source>Source Orientation</source> + <translation>Forrás orientáció</translation> + </message> + <message> + <location line="+2"/> + <source>Stereo Widening</source> + <translation>Sztereó szélesség</translation> + </message> +</context> +<context> + <name>Phonon::MMF::MediaObject</name> + <message> + <location filename="../src/3rdparty/phonon/mmf/mediaobject.cpp" line="+291"/> + <source>Media type could not be determined</source> + <translation>Nem lehetet meghatározni a média típust</translation> + </message> +</context> +<context> + <name>Phonon::VolumeSlider</name> + <message> + <location filename="../src/3rdparty/phonon/phonon/volumeslider.cpp" line="+42"/> + <location line="+18"/> + <location line="+129"/> + <location line="+15"/> + <source>Volume: %1%</source> + <translation>Hangerő: %1%</translation> + </message> + <message> + <location line="-159"/> + <location line="+18"/> + <location line="+54"/> + <source>Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1%</source> + <translation>Használja ezt a csúszkát a hangerő szabályozásához. A legbaloldalib pozíció: 0%, a legjobboldalibb %1%</translation> + </message> + <message> + <location line="+67"/> + <source>Muted</source> + <translation>Elnémított</translation> + </message> +</context> +<context> + <name>Q3Accel</name> + <message> + <location filename="../src/qt3support/other/q3accel.cpp" line="+481"/> + <source>%1, %2 not defined</source> + <translation>%1, %2 nincs definiálva</translation> + </message> + <message> + <location line="+36"/> + <source>Ambiguous %1 not handled</source> + <translation>Félreérthető %1 nincs lekezelve</translation> + </message> +</context> +<context> + <name>Q3DataTable</name> + <message> + <location filename="../src/qt3support/sql/q3datatable.cpp" line="+285"/> + <source>True</source> + <translation>Igaz</translation> + </message> + <message> + <location line="+1"/> + <source>False</source> + <translation>Hamis</translation> + </message> + <message> + <location line="+505"/> + <source>Insert</source> + <translation>Beszúrás</translation> + </message> + <message> + <location line="+1"/> + <source>Update</source> + <translation>Frissítés</translation> + </message> + <message> + <location line="+1"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> +</context> +<context> + <name>Q3FileDialog</name> + <message> + <location filename="../src/qt3support/dialogs/q3filedialog.cpp" line="+829"/> + <source>Copy or Move a File</source> + <translation>Egy fájl másolása vagy mozgatása</translation> + </message> + <message> + <location line="+8"/> + <source>Read: %1</source> + <translation>Olvasás: %1</translation> + </message> + <message> + <location line="+6"/> + <location line="+30"/> + <source>Write: %1</source> + <translation>Írás: %1</translation> + </message> + <message> + <location line="-22"/> + <location line="+1579"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location line="-157"/> + <location line="+49"/> + <location line="+2149"/> + <location filename="../src/qt3support/dialogs/q3filedialog_mac.cpp" line="+112"/> + <source>All Files (*)</source> + <translation>Az összes fájl (*)</translation> + </message> + <message> + <location line="-2085"/> + <source>Name</source> + <translation>Név</translation> + </message> + <message> + <location line="+1"/> + <source>Size</source> + <translation>Méret</translation> + </message> + <message> + <location line="+2"/> + <source>Type</source> + <translation>Típus</translation> + </message> + <message> + <location line="+1"/> + <source>Date</source> + <translation>Dátum</translation> + </message> + <message> + <location line="+1"/> + <source>Attributes</source> + <translation>Attribútumok</translation> + </message> + <message> + <location line="+35"/> + <location line="+2027"/> + <source>&OK</source> + <translation>&OK</translation> + </message> + <message> + <location line="-1987"/> + <source>Look &in:</source> + <translation>&Benéz:</translation> + </message> + <message> + <location line="+1"/> + <location line="+1977"/> + <location line="+16"/> + <source>File &name:</source> + <translation>Fájl &név:</translation> + </message> + <message> + <location line="-1992"/> + <source>File &type:</source> + <translation>Fájl &típus:</translation> + </message> + <message> + <location line="+7"/> + <source>Back</source> + <translation>Vissza</translation> + </message> + <message> + <location line="+7"/> + <source>One directory up</source> + <translation>Egy könyvtárral kintebb</translation> + </message> + <message> + <location line="+9"/> + <source>Create New Folder</source> + <translation>Új mappa létrehozása</translation> + </message> + <message> + <location line="+18"/> + <source>List View</source> + <translation>Lista nézet</translation> + </message> + <message> + <location line="+8"/> + <source>Detail View</source> + <translation>Részletes nézet</translation> + </message> + <message> + <location line="+9"/> + <source>Preview File Info</source> + <translation>Fájl információ előnézet</translation> + </message> + <message> + <location line="+19"/> + <source>Preview File Contents</source> + <translation>Fájl tartalom előnézet</translation> + </message> + <message> + <location line="+88"/> + <source>Read-write</source> + <translation>Írás olvasás</translation> + </message> + <message> + <location line="+1"/> + <source>Read-only</source> + <translation>Csak olvasható</translation> + </message> + <message> + <location line="+1"/> + <source>Write-only</source> + <translation>Csak írható</translation> + </message> + <message> + <location line="+1"/> + <source>Inaccessible</source> + <translation>Hozzáférhetetlen</translation> + </message> + <message> + <location line="+2"/> + <source>Symlink to File</source> + <translation>Szimlink a fájlra</translation> + </message> + <message> + <location line="+1"/> + <source>Symlink to Directory</source> + <translation>Szimlink a könyvtárra</translation> + </message> + <message> + <location line="+1"/> + <source>Symlink to Special</source> + <translation>Szimlink egy speciálisra</translation> + </message> + <message> + <location line="+1"/> + <source>File</source> + <translation>Fájl</translation> + </message> + <message> + <location line="+1"/> + <source>Dir</source> + <translation>Könyvtár</translation> + </message> + <message> + <location line="+1"/> + <source>Special</source> + <translation>Speciális</translation> + </message> + <message> + <location line="+704"/> + <location line="+1999"/> + <location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="+209"/> + <source>Open</source> + <translation>Megnyitás</translation> + </message> + <message> + <location line="-1889"/> + <location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="+71"/> + <source>Save As</source> + <translation>Mentés másként</translation> + </message> + <message> + <location line="+642"/> + <location line="+5"/> + <location line="+355"/> + <source>&Open</source> + <translation>&Megnyitás</translation> + </message> + <message> + <location line="-357"/> + <location line="+341"/> + <source>&Save</source> + <translation>&Mentés</translation> + </message> + <message> + <location line="-334"/> + <source>&Rename</source> + <translation>&Átnevezés</translation> + </message> + <message> + <location line="+1"/> + <source>&Delete</source> + <translation>&Törlés</translation> + </message> + <message> + <location line="+20"/> + <source>R&eload</source> + <translation>&Újratöltés</translation> + </message> + <message> + <location line="+4"/> + <source>Sort by &Name</source> + <translation>Rendezés &Név alapján</translation> + </message> + <message> + <location line="+2"/> + <source>Sort by &Size</source> + <translation>Rendezés &Méret alapján</translation> + </message> + <message> + <location line="+1"/> + <source>Sort by &Date</source> + <translation>Rendezés &Dátum alapján</translation> + </message> + <message> + <location line="+2"/> + <source>&Unsorted</source> + <translation>&Rendezetlen</translation> + </message> + <message> + <location line="+15"/> + <source>Sort</source> + <translation>Rendezés</translation> + </message> + <message> + <location line="+4"/> + <source>Show &hidden files</source> + <translation>&Rejtett fájlok megjelenítése</translation> + </message> + <message> + <location line="+31"/> + <source>the file</source> + <translation>a fájl</translation> + </message> + <message> + <location line="+2"/> + <source>the directory</source> + <translation>a könyvtár</translation> + </message> + <message> + <location line="+2"/> + <source>the symlink</source> + <translation>a szimlink</translation> + </message> + <message> + <location line="+3"/> + <source>Delete %1</source> + <translation>%1 törlése</translation> + </message> + <message> + <location line="+1"/> + <source><qt>Are you sure you wish to delete %1 "%2"?</qt></source> + <translation><qt>Biztos benne, hogy törölni kívánja a(z) %1 "%2"?</qt></translation> + </message> + <message> + <location line="+2"/> + <source>&Yes</source> + <translation>&Igen</translation> + </message> + <message> + <location line="+0"/> + <source>&No</source> + <translation>&Nem</translation> + </message> + <message> + <location line="+36"/> + <source>New Folder 1</source> + <translation>Új mappa 1</translation> + </message> + <message> + <location line="+5"/> + <source>New Folder</source> + <translation>Új mappa</translation> + </message> + <message> + <location line="+5"/> + <source>New Folder %1</source> + <translation>Új mappa %1</translation> + </message> + <message> + <location line="+98"/> + <source>Find Directory</source> + <translation>Könyvtár keresése</translation> + </message> + <message> + <location line="+5"/> + <location line="+108"/> + <source>Directories</source> + <translation>Könyvtárak</translation> + </message> + <message> + <location line="-2"/> + <source>Directory:</source> + <translation>Könyvtár:</translation> + </message> + <message> + <location line="+40"/> + <location line="+1009"/> + <source>Error</source> + <translation>Hiba</translation> + </message> + <message> + <location line="-1008"/> + <source>%1 +File not found. +Check path and filename.</source> + <translation>%1 +Fájl nem található +Útvonal és fájlnév ellenőrzése.</translation> + </message> + <message> + <location filename="../src/qt3support/dialogs/q3filedialog_win.cpp" line="-191"/> + <source>All Files (*.*)</source> + <translation>Az összes fájl (*.*)</translation> + </message> + <message> + <location line="+264"/> + <source>Open </source> + <translation>Megnyitás</translation> + </message> + <message> + <location line="+107"/> + <source>Select a Directory</source> + <translation>Egy könyvtár kiválasztása</translation> + </message> +</context> +<context> + <name>Q3LocalFs</name> + <message> + <location filename="../src/qt3support/network/q3localfs.cpp" line="+130"/> + <location line="+10"/> + <source>Could not read directory +%1</source> + <translation>Nem sikerült a könytárat olvasni +%1</translation> + </message> + <message> + <location line="+45"/> + <source>Could not create directory +%1</source> + <translation>Nem sikerült létrehozni a könyvtárat +%1</translation> + </message> + <message> + <location line="+34"/> + <source>Could not remove file or directory +%1</source> + <translation>Nem sikerült eltávolítani egy fájlt vag könyvtárat +%1</translation> + </message> + <message> + <location line="+27"/> + <source>Could not rename +%1 +to +%2</source> + <translation>Nem sikerült átnevezni ezt +%1 +erre +%2</translation> + </message> + <message> + <location line="+25"/> + <source>Could not open +%1</source> + <translation>Nem sikerült megnyitni +%1</translation> + </message> + <message> + <location line="+68"/> + <source>Could not write +%1</source> + <translation>Nem sikerült írni +%1</translation> + </message> +</context> +<context> + <name>Q3MainWindow</name> + <message> + <location filename="../src/qt3support/widgets/q3mainwindow.cpp" line="+2051"/> + <source>Line up</source> + <translation>Egy sorral feljebb</translation> + </message> + <message> + <location line="+2"/> + <source>Customize...</source> + <translation>Egyéni...</translation> + </message> +</context> +<context> + <name>Q3NetworkProtocol</name> + <message> + <location filename="../src/qt3support/network/q3networkprotocol.cpp" line="+854"/> + <source>Operation stopped by the user</source> + <translation>A felhasználó leállította a műveletet</translation> + </message> +</context> +<context> + <name>Q3ProgressDialog</name> + <message> + <location filename="../src/qt3support/dialogs/q3progressdialog.cpp" line="+224"/> + <location line="+61"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> +</context> +<context> + <name>Q3TabDialog</name> + <message> + <location filename="../src/qt3support/dialogs/q3tabdialog.cpp" line="+190"/> + <location line="+824"/> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <location line="-366"/> + <source>Apply</source> + <translation>Alkalmazza</translation> + </message> + <message> + <location line="+43"/> + <source>Help</source> + <translation>Súgó</translation> + </message> + <message> + <location line="+45"/> + <source>Defaults</source> + <translation>Alapértelemett</translation> + </message> + <message> + <location line="+50"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> +</context> +<context> + <name>Q3TextEdit</name> + <message> + <location filename="../src/qt3support/text/q3textedit.cpp" line="+5429"/> + <source>&Undo</source> + <translation>&Visszavonás</translation> + </message> + <message> + <location line="+1"/> + <source>&Redo</source> + <translation>&Helyreállítás</translation> + </message> + <message> + <location line="+5"/> + <source>Cu&t</source> + <translation>&Kivágás</translation> + </message> + <message> + <location line="+1"/> + <source>&Copy</source> + <translation>&Másolás</translation> + </message> + <message> + <location line="+2"/> + <source>&Paste</source> + <translation>&Beillesztés</translation> + </message> + <message> + <location line="+3"/> + <source>Clear</source> + <translation>Kiürítés</translation> + </message> + <message> + <location line="+4"/> + <location line="+2"/> + <source>Select All</source> + <translation>Az összes kiválasztása</translation> + </message> +</context> +<context> + <name>Q3TitleBar</name> + <message> + <location filename="../src/plugins/accessible/compat/q3complexwidgets.cpp" line="+246"/> + <source>System</source> + <translation>Rendszer</translation> + </message> + <message> + <location line="+3"/> + <source>Restore up</source> + <translation>Felállítás</translation> + </message> + <message> + <location line="+1"/> + <source>Minimize</source> + <translation>Minimalizálás</translation> + </message> + <message> + <location line="+3"/> + <source>Restore down</source> + <translation>Leállítás</translation> + </message> + <message> + <location line="+1"/> + <source>Maximize</source> + <translation>Maximalizálás</translation> + </message> + <message> + <location line="+2"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location line="+18"/> + <source>Contains commands to manipulate the window</source> + <translation>Tartalmazza az ablak manipulációs parancsokat</translation> + </message> + <message> + <location line="+3"/> + <source>Puts a minimized window back to normal</source> + <translation>Egy minimalizált ablak normálra visszatétele</translation> + </message> + <message> + <location line="+1"/> + <source>Moves the window out of the way</source> + <translation>Az ablak félreeső helyre mozgatása</translation> + </message> + <message> + <location line="+3"/> + <source>Puts a maximized window back to normal</source> + <translation>Maximalizált ablak normálra visszatétele</translation> + </message> + <message> + <location line="+1"/> + <source>Makes the window full screen</source> + <translation>Az ablak maximális méretűvé tétele</translation> + </message> + <message> + <location line="+2"/> + <source>Closes the window</source> + <translation>Az ablak bezárása</translation> + </message> + <message> + <location line="+2"/> + <source>Displays the name of the window and contains controls to manipulate it</source> + <translation>Az ablak nevének megjelenítése és manipuláláshoz szükséges vezérlő elemek tartalmazása</translation> + </message> +</context> +<context> + <name>Q3ToolBar</name> + <message> + <location filename="../src/qt3support/widgets/q3toolbar.cpp" line="+692"/> + <source>More...</source> + <translation>További...</translation> + </message> +</context> +<context> + <name>Q3UrlOperator</name> + <message> + <location filename="../src/qt3support/network/q3urloperator.cpp" line="+386"/> + <location line="+260"/> + <location line="+4"/> + <source>The protocol `%1' is not supported</source> + <translation>A(z) '%1' protokoll nem támogatott</translation> + </message> + <message> + <location line="-260"/> + <source>The protocol `%1' does not support listing directories</source> + <translation>A(z) '%1' protokoll nem támogatja a könyvtár listázást</translation> + </message> + <message> + <location line="+3"/> + <source>The protocol `%1' does not support creating new directories</source> + <translation>A(z) '%1' protokoll nem támogatja az új könyvtárak létrehozását</translation> + </message> + <message> + <location line="+3"/> + <source>The protocol `%1' does not support removing files or directories</source> + <translation>A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárat áthelyezését</translation> + </message> + <message> + <location line="+3"/> + <source>The protocol `%1' does not support renaming files or directories</source> + <translation>A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárat átnevezését</translation> + </message> + <message> + <location line="+3"/> + <source>The protocol `%1' does not support getting files</source> + <translation>A(z) '%1' protokoll nem támogatja fájlok szerzését</translation> + </message> + <message> + <location line="+3"/> + <source>The protocol `%1' does not support putting files</source> + <translation>A(z) '%1' protokoll nem támogatja fájlok betevését</translation> + </message> + <message> + <location line="+243"/> + <location line="+4"/> + <source>The protocol `%1' does not support copying or moving files or directories</source> + <translation>A(z) '%1' protokoll nem támogatja fájlok vagy könyvtárak mozgatását vagy másolását</translation> + </message> + <message> + <location line="+237"/> + <location line="+1"/> + <source>(unknown)</source> + <translation>(ismeretlen)</translation> + </message> +</context> +<context> + <name>Q3Wizard</name> + <message> + <location filename="../src/qt3support/dialogs/q3wizard.cpp" line="+177"/> + <source>&Cancel</source> + <translation>&Mégse</translation> + </message> + <message> + <location line="+1"/> + <source>< &Back</source> + <translation>< &Vissza</translation> + </message> + <message> + <location line="+1"/> + <source>&Next ></source> + <translation>&Következő ></translation> + </message> + <message> + <location line="+1"/> + <source>&Finish</source> + <translation>&Befejezés</translation> + </message> + <message> + <location line="+1"/> + <source>&Help</source> + <translation>&Súgó</translation> + </message> +</context> +<context> + <name>QAbstractSocket</name> + <message> + <location filename="../src/network/socket/qabstractsocket.cpp" line="+899"/> + <location filename="../src/network/socket/qhttpsocketengine.cpp" line="+643"/> + <location filename="../src/network/socket/qsocks5socketengine.cpp" line="+661"/> + <location line="+26"/> + <source>Host not found</source> + <translation>A hoszt nem található</translation> + </message> + <message> + <location line="+50"/> + <location filename="../src/network/socket/qhttpsocketengine.cpp" line="+3"/> + <location filename="../src/network/socket/qsocks5socketengine.cpp" line="+4"/> + <source>Connection refused</source> + <translation>A kapcsolódás elutasítva</translation> + </message> + <message> + <location line="+142"/> + <source>Connection timed out</source> + <translation>Kapcsolódási időtúllépés</translation> + </message> + <message> + <location line="-555"/> + <location line="+805"/> + <location line="+208"/> + <source>Operation on socket is not supported</source> + <translation>A socket művelet nem támogatott</translation> + </message> + <message> + <location line="+200"/> + <source>Socket operation timed out</source> + <translation>Socket művelet időtúllépés</translation> + </message> + <message> + <location line="+380"/> + <source>Socket is not connected</source> + <translation>Socket nincs csatlakoztatva</translation> + </message> + <message> + <location filename="../src/network/socket/qsocks5socketengine.cpp" line="-8"/> + <source>Network unreachable</source> + <translation>A hálózat nem elérhető</translation> + </message> +</context> +<context> + <name>QAbstractSpinBox</name> + <message> + <location filename="../src/gui/widgets/qabstractspinbox.cpp" line="+1217"/> + <source>&Step up</source> + <translation>&Növelés</translation> + </message> + <message> + <location line="+2"/> + <source>Step &down</source> + <translation>&Csökkentés</translation> + </message> + <message> + <location line="-8"/> + <source>&Select All</source> + <translation>Az összes &kiválasztása</translation> + </message> +</context> +<context> + <name>QAccessibleButton</name> + <message> + <location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="+250"/> + <source>Press</source> + <translation>Megnyomás</translation> + </message> +</context> +<context> + <name>QApplication</name> + <message> + <location filename="../src/gui/kernel/qapplication.cpp" line="+2279"/> + <source>QT_LAYOUT_DIRECTION</source> + <comment>Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout.</comment> + <translation>QT_LAYOUT_DIRECTION</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qmessagebox.h" line="+354"/> + <source>Executable '%1' requires Qt %2, found Qt %3.</source> + <translation>A(z) '%1' futtatható fájl igényli a Qt %2, de Qt %3.-t talált.</translation> + </message> + <message> + <location line="+2"/> + <source>Incompatible Qt Library Error</source> + <translation>Inkompatibilis Qt könyvtár hiba</translation> + </message> + <message> + <location filename="../src/gui/accessible/qaccessibleobject.cpp" line="+376"/> + <source>Activate</source> + <translation>Aktiválás</translation> + </message> + <message> + <location line="+2"/> + <source>Activates the program's main window</source> + <translation>A program fő ablakának aktiválása</translation> + </message> +</context> +<context> + <name>QAxSelect</name> + <message> + <location filename="../src/activeqt/container/qaxselect.ui"/> + <source>Select ActiveX Control</source> + <translation>ActiveX vezérlő kiválasztása</translation> + </message> + <message> + <location/> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <location/> + <source>&Cancel</source> + <translation>&Mégse</translation> + </message> + <message> + <location/> + <source>COM &Object:</source> + <translation>COM &Objektum:</translation> + </message> +</context> +<context> + <name>QCheckBox</name> + <message> + <location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="-136"/> + <source>Uncheck</source> + <translation>Nincs bejelölve</translation> + </message> + <message> + <location line="+3"/> + <source>Check</source> + <translation>Bejelölve</translation> + </message> + <message> + <location line="+1"/> + <source>Toggle</source> + <translation>Kapcsolgatás</translation> + </message> +</context> +<context> + <name>QColorDialog</name> + <message> + <location filename="../src/gui/dialogs/qcolordialog.cpp" line="+1349"/> + <source>Hu&e:</source> + <translation>&Színárnyalat:</translation> + </message> + <message> + <location line="+1"/> + <source>&Sat:</source> + <translation>&Sat:</translation> + </message> + <message> + <location line="+1"/> + <source>&Val:</source> + <translation>&Érték:</translation> + </message> + <message> + <location line="+1"/> + <source>&Red:</source> + <translation>&Piros:</translation> + </message> + <message> + <location line="+1"/> + <source>&Green:</source> + <translation>&Zöld:</translation> + </message> + <message> + <location line="+1"/> + <source>Bl&ue:</source> + <translation>&Kék:</translation> + </message> + <message> + <location line="+1"/> + <source>A&lpha channel:</source> + <translation>A&lfa csatorna:</translation> + </message> + <message> + <location line="+101"/> + <source>Select Color</source> + <translation>Szín kiválasztása</translation> + </message> + <message> + <location line="+180"/> + <source>&Basic colors</source> + <translation>&Alap színek</translation> + </message> + <message> + <location line="+1"/> + <source>&Custom colors</source> + <translation>&Egyéni színek</translation> + </message> + <message> + <location line="+1"/> + <source>&Add to Custom Colors</source> + <translation>&Egyéni színek hozzáadása</translation> + </message> +</context> +<context> + <name>QComboBox</name> + <message> + <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="+1771"/> + <location line="+65"/> + <source>Open</source> + <translation>Megnyitás</translation> + </message> + <message> + <location filename="../src/gui/itemviews/qitemeditorfactory.cpp" line="+556"/> + <source>False</source> + <translation>Hamis</translation> + </message> + <message> + <location line="+1"/> + <source>True</source> + <translation>Igaz</translation> + </message> + <message> + <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="+0"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> +</context> +<context> + <name>QCoreApplication</name> + <message> + <location filename="../src/corelib/kernel/qsystemsemaphore_unix.cpp" line="+119"/> + <source>%1: key is empty</source> + <comment>QSystemSemaphore</comment> + <translation>%1:kulcs üres</translation> + </message> + <message> + <location line="+12"/> + <source>%1: unable to make key</source> + <comment>QSystemSemaphore</comment> + <translation>%1: nem lehet kulcsot csinálni</translation> + </message> + <message> + <location line="+9"/> + <source>%1: ftok failed</source> + <comment>QSystemSemaphore</comment> + <translation>%1: ftok hiba</translation> + </message> + <message> + <location filename="../src/corelib/kernel/qsystemsemaphore_symbian.cpp" line="+65"/> + <source>%1: already exists</source> + <comment>QSystemSemaphore</comment> + <translation>%1: már létezik</translation> + </message> + <message> + <location line="+4"/> + <source>%1: does not exist</source> + <comment>QSystemSemaphore</comment> + <translation>%1: nem létezik</translation> + </message> + <message> + <location line="+5"/> + <source>%1: out of resources</source> + <comment>QSystemSemaphore</comment> + <translation>%1: elfogytak az erőforrások</translation> + </message> + <message> + <location line="+4"/> + <source>%1: unknown error %2</source> + <comment>QSystemSemaphore</comment> + <translation>%1: ismeretlen hiba %2</translation> + </message> +</context> +<context> + <name>QDB2Driver</name> + <message> + <location filename="../src/sql/drivers/db2/qsql_db2.cpp" line="+1254"/> + <source>Unable to connect</source> + <translation>Nem lehet csatlakozni</translation> + </message> + <message> + <location line="+298"/> + <source>Unable to commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+17"/> + <source>Unable to rollback transaction</source> + <translation>Nem lehet visszagörgetni a tranzakciót</translation> + </message> + <message> + <location line="+15"/> + <source>Unable to set autocommit</source> + <translation>Nem lehet beállítani az automatikus kommitolást</translation> + </message> +</context> +<context> + <name>QDB2Result</name> + <message> + <location line="-1031"/> + <location line="+240"/> + <source>Unable to execute statement</source> + <translation>Nem lehet végrehajtani a műveletet</translation> + </message> + <message> + <location line="-203"/> + <source>Unable to prepare statement</source> + <translation>Nem lehet felkészülni a műveletre</translation> + </message> + <message> + <location line="+193"/> + <source>Unable to bind variable</source> + <translation>Nem lehet összekötni a változót</translation> + </message> + <message> + <location line="+89"/> + <source>Unable to fetch record %1</source> + <translation>Nem lehet letölteni a(z) %1 felvételt</translation> + </message> + <message> + <location line="+19"/> + <source>Unable to fetch next</source> + <translation>Nem lehet letölteni a következőt</translation> + </message> + <message> + <location line="+21"/> + <source>Unable to fetch first</source> + <translation>Nem lehet letölteni az elsőt</translation> + </message> +</context> +<context> + <name>QDateTimeEdit</name> + <message> + <location filename="../src/gui/widgets/qdatetimeedit.cpp" line="+2287"/> + <source>AM</source> + <translation>AM</translation> + </message> + <message> + <location line="+0"/> + <source>am</source> + <translation>am</translation> + </message> + <message> + <location line="+2"/> + <source>PM</source> + <translation>PM</translation> + </message> + <message> + <location line="+0"/> + <source>pm</source> + <translation>pm</translation> + </message> +</context> +<context> + <name>QDial</name> + <message> + <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+951"/> + <source>QDial</source> + <translation>QDial</translation> + </message> + <message> + <location line="+2"/> + <source>SpeedoMeter</source> + <translation>Sebességmérő</translation> + </message> + <message> + <location line="+2"/> + <source>SliderHandle</source> + <translation>CsúszkaKezelő</translation> + </message> +</context> +<context> + <name>QDialog</name> + <message> + <location filename="../src/gui/dialogs/qdialog.cpp" line="+636"/> + <source>What's This?</source> + <translation>Mi ez?</translation> + </message> + <message> + <location line="-135"/> + <source>Done</source> + <translation>Kész</translation> + </message> +</context> +<context> + <name>QDialogButtonBox</name> + <message> + <location filename="../src/gui/dialogs/qmessagebox.cpp" line="+1872"/> + <location line="+464"/> + <location filename="../src/gui/widgets/qdialogbuttonbox.cpp" line="+622"/> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <location filename="../src/gui/widgets/qdialogbuttonbox.cpp" line="+3"/> + <source>Save</source> + <translation>Mentés</translation> + </message> + <message> + <location line="+0"/> + <source>&Save</source> + <translation>&Mentés</translation> + </message> + <message> + <location line="+3"/> + <source>Open</source> + <translation>Megnyitás</translation> + </message> + <message> + <location line="+3"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location line="+0"/> + <source>&Cancel</source> + <translation>&Mégse</translation> + </message> + <message> + <location line="+3"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location line="+0"/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> + <message> + <location line="+3"/> + <source>Apply</source> + <translation>Alkalmazza</translation> + </message> + <message> + <location line="+3"/> + <source>Reset</source> + <translation>Visszaállítás</translation> + </message> + <message> + <location line="+3"/> + <source>Help</source> + <translation>Súgó</translation> + </message> + <message> + <location line="+4"/> + <source>Don't Save</source> + <translation>Ne mentse</translation> + </message> + <message> + <location line="+4"/> + <source>Discard</source> + <translation>Eldob</translation> + </message> + <message> + <location line="+3"/> + <source>&Yes</source> + <translation>&Igen</translation> + </message> + <message> + <location line="+3"/> + <source>Yes to &All</source> + <translation>Igen az &összesre</translation> + </message> + <message> + <location line="+3"/> + <source>&No</source> + <translation>&Nem</translation> + </message> + <message> + <location line="+3"/> + <source>N&o to All</source> + <translation>&Nem az összesre</translation> + </message> + <message> + <location line="+3"/> + <source>Save All</source> + <translation>Az összes mentése</translation> + </message> + <message> + <location line="+3"/> + <source>Abort</source> + <translation>Megszakítás</translation> + </message> + <message> + <location line="+3"/> + <source>Retry</source> + <translation>Újra próbálkozás</translation> + </message> + <message> + <location line="+3"/> + <source>Ignore</source> + <translation>Mellőzés</translation> + </message> + <message> + <location line="+3"/> + <source>Restore Defaults</source> + <translation>Alapértelemezett beállítások visszaállítása</translation> + </message> + <message> + <location line="-29"/> + <source>Close without Saving</source> + <translation>Bezárás mentés nélkül</translation> + </message> + <message> + <location line="-27"/> + <source>&OK</source> + <translation>&OK</translation> + </message> +</context> +<context> + <name>QDirModel</name> + <message> + <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+457"/> + <source>Name</source> + <translation>Név</translation> + </message> + <message> + <location line="+1"/> + <source>Size</source> + <translation>Méret</translation> + </message> + <message> + <location line="+3"/> + <source>Kind</source> + <comment>Match OS X Finder</comment> + <translation>Fajta</translation> + </message> + <message> + <location line="+2"/> + <source>Type</source> + <comment>All other platforms</comment> + <translation>Típus</translation> + </message> + <message> + <location line="+6"/> + <source>Date Modified</source> + <translation>Dátum módosítva</translation> + </message> +</context> +<context> + <name>QDockWidget</name> + <message> + <location filename="../src/plugins/accessible/widgets/qaccessiblewidgets.cpp" line="+1239"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location line="+2"/> + <source>Dock</source> + <translation>Dokkolás</translation> + </message> + <message> + <location line="+1"/> + <source>Float</source> + <translation>Lebegtetés</translation> + </message> +</context> +<context> + <name>QDoubleSpinBox</name> + <message> + <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-537"/> + <source>More</source> + <translation>Több</translation> + </message> + <message> + <location line="+2"/> + <source>Less</source> + <translation>Kevesebb</translation> + </message> +</context> +<context> + <name>QErrorMessage</name> + <message> + <location filename="../src/gui/dialogs/qerrormessage.cpp" line="+414"/> + <source>&Show this message again</source> + <translation>Az üzenet újbóli &megjelenítése</translation> + </message> + <message> + <location line="+1"/> + <source>&OK</source> + <translation>&OK</translation> + </message> + <message> + <location line="-207"/> + <source>Debug Message:</source> + <translation>Debug üzenet:</translation> + </message> + <message> + <location line="+3"/> + <source>Warning:</source> + <translation>Figyelmeztetés:</translation> + </message> + <message> + <location line="+3"/> + <source>Fatal Error:</source> + <translation>Végzetes hiba:</translation> + </message> +</context> +<context> + <name>QFile</name> + <message> + <location filename="../src/corelib/io/qfile.cpp" line="+697"/> + <location line="+155"/> + <source>Destination file exists</source> + <translation>A cél fájl létezik</translation> + </message> + <message> + <location line="-140"/> + <source>Will not rename sequential file using block copy</source> + <translation>Blokkos másolásnál nem lesznek átnevezve az egymást követő fájlok</translation> + </message> + <message> + <location line="+23"/> + <source>Cannot remove source file</source> + <translation>Nem lehet a forrás fájlt eltávolítani</translation> + </message> + <message> + <location line="+130"/> + <source>Cannot open %1 for input</source> + <translation>Nem lehet megnyitni %1-t bementre</translation> + </message> + <message> + <location line="+17"/> + <source>Cannot open for output</source> + <translation>Nem lehet megnyitni a kimenetre</translation> + </message> + <message> + <location line="+10"/> + <source>Failure to write block</source> + <translation>Hiba történt a blokk írás közben</translation> + </message> + <message> + <location line="+13"/> + <source>Cannot create %1 for output</source> + <translation>Nem lehet létrehozni a(z) %1-t kimenetre</translation> + </message> +</context> +<context> + <name>QFileDialog</name> + <message> + <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+558"/> + <location line="+450"/> + <source>All Files (*)</source> + <translation>Az összes fájl (*)</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.ui"/> + <location filename="../src/gui/dialogs/qfiledialog_embedded.ui"/> + <source>Back</source> + <translation>Vissza</translation> + </message> + <message> + <location/> + <location filename="../src/gui/dialogs/qfiledialog_embedded.ui"/> + <source>List View</source> + <translation>Lista nézet</translation> + </message> + <message> + <location/> + <location filename="../src/gui/dialogs/qfiledialog_embedded.ui"/> + <source>Detail View</source> + <translation>Részletes nézet</translation> + </message> + <message> + <location filename="../src/gui/itemviews/qfileiconprovider.cpp" line="+464"/> + <location line="+1"/> + <source>File</source> + <translation>Fájl</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-467"/> + <source>Open</source> + <translation>Megnyitás</translation> + </message> + <message> + <location line="+2"/> + <source>Save As</source> + <translation>Mentés másként</translation> + </message> + <message> + <location line="+689"/> + <location line="+50"/> + <location line="+1528"/> + <source>&Open</source> + <translation>&Megnyitás</translation> + </message> + <message> + <location line="-1578"/> + <location line="+50"/> + <source>&Save</source> + <translation>&Mentés</translation> + </message> + <message> + <location line="+1801"/> + <source>Recent Places</source> + <translation>Utolsó helyek</translation> + </message> + <message> + <location line="-2511"/> + <source>&Rename</source> + <translation>&Átnevezés</translation> + </message> + <message> + <location line="+1"/> + <source>&Delete</source> + <translation>&Törlés</translation> + </message> + <message> + <location line="+1"/> + <source>Show &hidden files</source> + <translation>&Rejtett fájlok megjelenítése</translation> + </message> + <message> + <location line="+1957"/> + <source>New Folder</source> + <translation>Új mappa</translation> + </message> + <message> + <location line="-1992"/> + <source>Find Directory</source> + <translation>Könyvtár keresése</translation> + </message> + <message> + <location line="+696"/> + <source>Directories</source> + <translation>Könyvtárak</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog_win.cpp" line="+174"/> + <source>All Files (*.*)</source> + <translation>Az összes fájl (*.*)</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-655"/> + <location line="+659"/> + <source>Directory:</source> + <translation>Könyvtár:</translation> + </message> + <message> + <location line="+810"/> + <source>%1 already exists. +Do you want to replace it?</source> + <translation>A(z) %1 már létezik. +Szeretné lecserélni?</translation> + </message> + <message> + <location line="+20"/> + <source>%1 +File not found. +Please verify the correct file name was given.</source> + <translation>%1 +Fájl nem található. +Kérem ellenőrizze, hogy helyes fájlnevet adott meg.</translation> + </message> + <message> + <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+402"/> + <source>My Computer</source> + <translation>Sajátgép</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.ui"/> + <location filename="../src/gui/dialogs/qfiledialog_embedded.ui"/> + <source>Parent Directory</source> + <translation>Szülő könyvtár</translation> + </message> + <message> + <location/> + <location filename="../src/gui/dialogs/qfiledialog_embedded.ui"/> + <source>Files of type:</source> + <translation>Típusfájlok:</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-54"/> + <location line="+862"/> + <source>%1 +Directory not found. +Please verify the correct directory name was given.</source> + <translation>%1 +A könyvtár nem található. +Kérem ellenőrizze le, hogy helyes könyvtár nevet adott meg.</translation> + </message> + <message> + <location line="-218"/> + <source>'%1' is write protected. +Do you want to delete it anyway?</source> + <translation>A(z) '%1' írásvédett. +Mégis törölni szeretné?</translation> + </message> + <message> + <location line="+5"/> + <source>Are sure you want to delete '%1'?</source> + <translation>Törölni szeretné '%1'?</translation> + </message> + <message> + <location line="+15"/> + <source>Could not delete directory.</source> + <translation>Nem sikerült törölni a könyvtárat.</translation> + </message> + <message> + <location filename="../src/gui/itemviews/qfileiconprovider.cpp" line="-4"/> + <source>Drive</source> + <translation>Vezérlő</translation> + </message> + <message> + <location line="+9"/> + <source>File Folder</source> + <comment>Match Windows Explorer</comment> + <translation>Fájl mappa</translation> + </message> + <message> + <location line="+2"/> + <source>Folder</source> + <comment>All other platforms</comment> + <translation>Mappa</translation> + </message> + <message> + <location line="+9"/> + <source>Alias</source> + <comment>Mac OS X Finder</comment> + <translation>Álnév</translation> + </message> + <message> + <location line="+2"/> + <source>Shortcut</source> + <comment>All other platforms</comment> + <translation>Gyorsbillentyű</translation> + </message> + <message> + <location line="+7"/> + <source>Unknown</source> + <translation>Ismeretlen</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-2111"/> + <source>Show </source> + <translation>Megjelenítés</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.ui"/> + <location filename="../src/gui/dialogs/qfiledialog_embedded.ui"/> + <source>Forward</source> + <translation>Előre</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.cpp" line="+7"/> + <source>&New Folder</source> + <translation>&Új mappa</translation> + </message> + <message> + <location line="+667"/> + <location line="+38"/> + <source>&Choose</source> + <translation>&Kiválasztás</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qsidebar.cpp" line="+442"/> + <source>Remove</source> + <translation>Eltávolítás</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.cpp" line="-698"/> + <location line="+663"/> + <source>File &name:</source> + <translation>Fájl &név:</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfiledialog.ui"/> + <location filename="../src/gui/dialogs/qfiledialog_embedded.ui"/> + <source>Look in:</source> + <translation>Benéz:</translation> + </message> + <message> + <location/> + <location filename="../src/gui/dialogs/qfiledialog_embedded.ui"/> + <source>Create New Folder</source> + <translation>Új mappa létrehozása</translation> + </message> +</context> +<context> + <name>QFileSystemModel</name> + <message> + <location filename="../src/gui/dialogs/qfilesystemmodel.cpp" line="+744"/> + <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+476"/> + <source>%1 TB</source> + <translation>%1 TB</translation> + </message> + <message> + <location line="+2"/> + <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+2"/> + <source>%1 GB</source> + <translation>%1 GB</translation> + </message> + <message> + <location line="+2"/> + <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+2"/> + <source>%1 MB</source> + <translation>%1 MB</translation> + </message> + <message> + <location line="+2"/> + <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+2"/> + <source>%1 KB</source> + <translation>%1 KB</translation> + </message> + <message> + <location line="+1"/> + <source>%1 bytes</source> + <translation>%1 bájt</translation> + </message> + <message> + <location line="+77"/> + <source>Invalid filename</source> + <translation>Érvénytelen fájlnév</translation> + </message> + <message> + <location line="+1"/> + <source><b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks.</source> + <translation><b>A(z) "%1" név nem használható.</b><p>Próbáljon meg más nevet használni, kevesebb karakterrel vagy írásjelekek nélkül.</translation> + </message> + <message> + <location line="+64"/> + <source>Name</source> + <translation>Név</translation> + </message> + <message> + <location line="+2"/> + <source>Size</source> + <translation>Méret</translation> + </message> + <message> + <location line="+4"/> + <source>Kind</source> + <comment>Match OS X Finder</comment> + <translation>Fajta</translation> + </message> + <message> + <location line="+2"/> + <source>Type</source> + <comment>All other platforms</comment> + <translation>Típus</translation> + </message> + <message> + <location line="+7"/> + <source>Date Modified</source> + <translation>Dátum módosítva</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qfilesystemmodel_p.h" line="+258"/> + <source>My Computer</source> + <translation>Sajátgép</translation> + </message> + <message> + <location line="+2"/> + <source>Computer</source> + <translation>Számítógép</translation> + </message> + <message> + <location filename="../src/gui/itemviews/qdirmodel.cpp" line="+1"/> + <source>%1 byte(s)</source> + <translation>%1 bájt</translation> + </message> +</context> +<context> + <name>QFontDatabase</name> + <message> + <location filename="../src/gui/text/qfontdatabase.cpp" line="+102"/> + <location line="+1342"/> + <source>Normal</source> + <translation>Normál</translation> + </message> + <message> + <location line="-1339"/> + <location line="+12"/> + <location line="+1315"/> + <source>Bold</source> + <translation>Kövér</translation> + </message> + <message> + <location line="-1324"/> + <location line="+1326"/> + <source>Demi Bold</source> + <translation>Félkövér</translation> + </message> + <message> + <location line="-1323"/> + <location line="+18"/> + <location line="+1301"/> + <source>Black</source> + <translation>Fekete</translation> + </message> + <message> + <location line="-1311"/> + <source>Demi</source> + <translation>Fél</translation> + </message> + <message> + <location line="+6"/> + <location line="+1311"/> + <source>Light</source> + <translation>Világos</translation> + </message> + <message> + <location line="-1165"/> + <location line="+1168"/> + <source>Italic</source> + <translation>Dőlt</translation> + </message> + <message> + <location line="-1165"/> + <location line="+1167"/> + <source>Oblique</source> + <translation>Homályos</translation> + </message> + <message> + <location line="+704"/> + <source>Any</source> + <translation>Bármilyen</translation> + </message> + <message> + <location line="+3"/> + <source>Latin</source> + <translation>Latin</translation> + </message> + <message> + <location line="+3"/> + <source>Greek</source> + <translation>Görög</translation> + </message> + <message> + <location line="+3"/> + <source>Cyrillic</source> + <translation>Ciril</translation> + </message> + <message> + <location line="+3"/> + <source>Armenian</source> + <translation>Örmény</translation> + </message> + <message> + <location line="+3"/> + <source>Hebrew</source> + <translation>Héber</translation> + </message> + <message> + <location line="+3"/> + <source>Arabic</source> + <translation>Arab</translation> + </message> + <message> + <location line="+3"/> + <source>Syriac</source> + <translation>Szíriai</translation> + </message> + <message> + <location line="+3"/> + <source>Thaana</source> + <translation>Thana</translation> + </message> + <message> + <location line="+3"/> + <source>Devanagari</source> + <translation>Dévanágari</translation> + </message> + <message> + <location line="+3"/> + <source>Bengali</source> + <translation>Bengáli</translation> + </message> + <message> + <location line="+3"/> + <source>Gurmukhi</source> + <translation>Gurmukhi</translation> + </message> + <message> + <location line="+3"/> + <source>Gujarati</source> + <translation>Gujarati</translation> + </message> + <message> + <location line="+3"/> + <source>Oriya</source> + <translation>Oriya</translation> + </message> + <message> + <location line="+3"/> + <source>Tamil</source> + <translation>Tamil</translation> + </message> + <message> + <location line="+3"/> + <source>Telugu</source> + <translation>Telugu</translation> + </message> + <message> + <location line="+3"/> + <source>Kannada</source> + <translation>Kanadai</translation> + </message> + <message> + <location line="+3"/> + <source>Malayalam</source> + <translation>Maláj</translation> + </message> + <message> + <location line="+3"/> + <source>Sinhala</source> + <translation>Sinhala</translation> + </message> + <message> + <location line="+3"/> + <source>Thai</source> + <translation>Tájföldi</translation> + </message> + <message> + <location line="+3"/> + <source>Lao</source> + <translation>Lao</translation> + </message> + <message> + <location line="+3"/> + <source>Tibetan</source> + <translation>Tibeti</translation> + </message> + <message> + <location line="+3"/> + <source>Myanmar</source> + <translation>Mianmari</translation> + </message> + <message> + <location line="+3"/> + <source>Georgian</source> + <translation>Grúz</translation> + </message> + <message> + <location line="+3"/> + <source>Khmer</source> + <translation>Khmer</translation> + </message> + <message> + <location line="+3"/> + <source>Simplified Chinese</source> + <translation>Egyszerűsített kínai</translation> + </message> + <message> + <location line="+3"/> + <source>Traditional Chinese</source> + <translation>Hagyományos kínai</translation> + </message> + <message> + <location line="+3"/> + <source>Japanese</source> + <translation>Japán</translation> + </message> + <message> + <location line="+3"/> + <source>Korean</source> + <translation>Koreai</translation> + </message> + <message> + <location line="+3"/> + <source>Vietnamese</source> + <translation>Vietnámi</translation> + </message> + <message> + <location line="+3"/> + <source>Symbol</source> + <translation>Szimbólum</translation> + </message> + <message> + <location line="+3"/> + <source>Ogham</source> + <translation>Ogham</translation> + </message> + <message> + <location line="+3"/> + <source>Runic</source> + <translation>Székely</translation> + </message> + <message> + <location line="+3"/> + <source>N'Ko</source> + <translation>N'Ko</translation> + </message> +</context> +<context> + <name>QFontDialog</name> + <message> + <location filename="../src/gui/dialogs/qfontdialog.cpp" line="+776"/> + <source>&Font</source> + <translation>&Betű</translation> + </message> + <message> + <location line="+1"/> + <source>Font st&yle</source> + <translation>Betű st&ílus</translation> + </message> + <message> + <location line="+1"/> + <source>&Size</source> + <translation>&Méret</translation> + </message> + <message> + <location line="+4"/> + <source>Effects</source> + <translation>Hatások</translation> + </message> + <message> + <location line="+2"/> + <source>Stri&keout</source> + <translation>Ki&talál</translation> + </message> + <message> + <location line="+1"/> + <source>&Underline</source> + <translation>&Aláhúzás</translation> + </message> + <message> + <location line="+1"/> + <source>Sample</source> + <translation>Minta</translation> + </message> + <message> + <location line="-608"/> + <location line="+257"/> + <source>Select Font</source> + <translation>Betű kiválasztása</translation> + </message> + <message> + <location line="+352"/> + <source>Wr&iting System</source> + <translation>Rendszer &írása</translation> + </message> +</context> +<context> + <name>QFtp</name> + <message> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+2303"/> + <source>Host %1 found</source> + <translation>%1 host megtalálva</translation> + </message> + <message> + <location line="+7"/> + <source>Host found</source> + <translation>Hoszt megtalálva</translation> + </message> + <message> + <location filename="../src/network/access/qftp.cpp" line="+1008"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="-1456"/> + <location line="+1451"/> + <source>Connected to host %1</source> + <translation>%1 hosztra csatlkoztatva</translation> + </message> + <message> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+7"/> + <source>Connected to host</source> + <translation>Hosztra csatlakoztatva</translation> + </message> + <message> + <location line="-5"/> + <source>Connection to %1 closed</source> + <translation>%1-re csatlakoztatása bezárva</translation> + </message> + <message> + <location filename="../src/network/access/qftp.cpp" line="+1377"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="-243"/> + <location line="+250"/> + <source>Connection closed</source> + <translation>Kapcsolat bezárva</translation> + </message> + <message> + <location line="-1489"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="-1566"/> + <source>Host %1 not found</source> + <translation>%1 host nem található</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+4"/> + <source>Connection refused to host %1</source> + <translation>Kapcsolat elutasítva a(z) %1 hoszttal</translation> + </message> + <message> + <location line="+4"/> + <source>Connection timed out to host %1</source> + <translation>Kapcsolati időtúllépés a %1 hoszttal</translation> + </message> + <message> + <location line="+501"/> + <location line="+29"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+458"/> + <location line="+728"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> + <message> + <location line="+891"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+77"/> + <source>Connecting to host failed: +%1</source> + <translation>A hoszthoz kapcsolódás nem sikerült: +%1</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/> + <source>Login failed: +%1</source> + <translation>Bejelentkezési hiba: +%1</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/> + <source>Listing directory failed: +%1</source> + <translation>Könyvtár listázási hiba: +%1</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/> + <source>Changing directory failed: +%1</source> + <translation>Könyvtár változtatási hiba: +%1</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/> + <source>Downloading file failed: +%1</source> + <translation>Fájl letöltési hiba: +%1</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/> + <source>Uploading file failed: +%1</source> + <translation>Fájl feltöltési hiba: +%1</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/> + <source>Removing file failed: +%1</source> + <translation>Fájl eltávolítási hiba: +%1</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/> + <source>Creating directory failed: +%1</source> + <translation>Könyvtár létrehozási hiba: +%1</translation> + </message> + <message> + <location line="+4"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+3"/> + <source>Removing directory failed: +%1</source> + <translation>Könyvtár eltávolítása hiba: +%1</translation> + </message> + <message> + <location line="-1529"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="-1356"/> + <source>Not connected</source> + <translation>Nincs csatlakoztatva</translation> + </message> + <message> + <location line="+399"/> + <location filename="../src/qt3support/network/q3ftp.cpp" line="+332"/> + <source>Connection refused for data connection</source> + <translation>Adat kapcsolat érdekében történő csatlakozás megtagadva</translation> + </message> +</context> +<context> + <name>QHostInfo</name> + <message> + <location filename="../src/network/kernel/qhostinfo_p.h" line="+185"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> +</context> +<context> + <name>QHostInfoAgent</name> + <message> + <location filename="../src/network/kernel/qhostinfo_unix.cpp" line="+257"/> + <location line="+32"/> + <location filename="../src/network/kernel/qhostinfo_win.cpp" line="+220"/> + <location line="+27"/> + <source>Host not found</source> + <translation>A hoszt nem található</translation> + </message> + <message> + <location line="-45"/> + <location line="+39"/> + <location filename="../src/network/kernel/qhostinfo_win.cpp" line="-34"/> + <location line="+29"/> + <source>Unknown address type</source> + <translation>Ismeretlen cím típus</translation> + </message> + <message> + <location line="+10"/> + <location filename="../src/network/kernel/qhostinfo_win.cpp" line="-19"/> + <location line="+27"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> + <message> + <location filename="../src/network/kernel/qhostinfo_win.cpp" line="-67"/> + <source>No host name given</source> + <translation>Nincs hoszt név megadva</translation> + </message> + <message> + <location line="+0"/> + <source>Invalid hostname</source> + <translation>Érvénytelen hoszt név</translation> + </message> +</context> +<context> + <name>QHttp</name> + <message> + <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+578"/> + <location filename="../src/qt3support/network/q3http.cpp" line="+1835"/> + <source>Connection refused</source> + <translation>Kapcsolat megtagadva</translation> + </message> + <message> + <location filename="../src/network/access/qhttp.cpp" line="+2639"/> + <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="-4"/> + <location filename="../src/qt3support/network/q3http.cpp" line="+3"/> + <source>Host %1 not found</source> + <translation>A(z) %1 hoszt nem található</translation> + </message> + <message> + <location line="-62"/> + <location filename="../src/qt3support/network/q3http.cpp" line="-45"/> + <source>Wrong content length</source> + <translation>Hibás tartalom hossz</translation> + </message> + <message> + <location line="+82"/> + <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+10"/> + <location line="+19"/> + <location filename="../src/qt3support/network/q3http.cpp" line="+48"/> + <source>HTTP request failed</source> + <translation>HTTP kérési hiba</translation> + </message> + <message> + <location filename="../src/qt3support/network/q3http.cpp" line="+450"/> + <source>Host %1 found</source> + <translation>A(z) %1 hoszt nem található</translation> + </message> + <message> + <location line="+14"/> + <source>Host found</source> + <translation>Hoszt megtalálható</translation> + </message> + <message> + <location line="-11"/> + <source>Connected to host %1</source> + <translation>%1 hoszthoz csatlakozva van</translation> + </message> + <message> + <location line="+14"/> + <source>Connected to host</source> + <translation>Hosztra csatlakoztatva</translation> + </message> + <message> + <location line="-11"/> + <source>Connection to %1 closed</source> + <translation>%1-re csatlkozás bezárva</translation> + </message> + <message> + <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="-22"/> + <location filename="../src/qt3support/network/q3http.cpp" line="+14"/> + <source>Connection closed</source> + <translation>Kapcsolat bezárva</translation> + </message> + <message> + <location filename="../src/network/access/qhttp.cpp" line="-1077"/> + <location line="+820"/> + <location filename="../src/qt3support/network/q3http.cpp" line="-1152"/> + <location line="+567"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> + <message> + <location line="-568"/> + <location filename="../src/qt3support/network/q3http.cpp" line="-370"/> + <source>Request aborted</source> + <translation>Kérés megszakítva</translation> + </message> + <message> + <location line="+579"/> + <location filename="../src/qt3support/network/q3http.cpp" line="+381"/> + <source>No server set to connect to</source> + <translation>Nincsen szerver beállítva, amire csatlakozni lehetne</translation> + </message> + <message> + <location line="+168"/> + <location filename="../src/qt3support/network/q3http.cpp" line="+60"/> + <source>Server closed connection unexpectedly</source> + <translation>A szerver váratlanul bezárta a kapcsolatot</translation> + </message> + <message> + <location line="+172"/> + <location filename="../src/qt3support/network/q3http.cpp" line="+113"/> + <source>Invalid HTTP response header</source> + <translation>Érvénytelen HTTP válasz fejléc</translation> + </message> + <message> + <location line="+28"/> + <source>Unknown authentication method</source> + <translation>Ismeretlen hitelesítési eljárás</translation> + </message> + <message> + <location line="+97"/> + <location line="+48"/> + <location filename="../src/qt3support/network/q3http.cpp" line="+40"/> + <location line="+47"/> + <source>Invalid HTTP chunked body</source> + <translation>Érvénytelen nagy HTTP törzs</translation> + </message> + <message> + <location line="+38"/> + <source>Error writing response to device</source> + <translation>Hiba történt a válasz eszközre írása közben</translation> + </message> + <message> + <location line="-173"/> + <source>Proxy authentication required</source> + <translation>Proxy hitelesítés szükséges</translation> + </message> + <message> + <location line="+4"/> + <source>Authentication required</source> + <translation>Hitelesítés szükséges</translation> + </message> + <message> + <location filename="../src/network/access/qhttpnetworkconnection.cpp" line="+6"/> + <source>Proxy requires authentication</source> + <translation>A proxy a hitelesítést kéri</translation> + </message> + <message> + <location line="+3"/> + <source>Host requires authentication</source> + <translation>A hoszt hitelesítést kér</translation> + </message> + <message> + <location line="+3"/> + <source>Data corrupted</source> + <translation>Sérült adat</translation> + </message> + <message> + <location line="+6"/> + <source>SSL handshake failed</source> + <translation>SSL kézfogási hiba</translation> + </message> + <message> + <location line="-3"/> + <source>Unknown protocol specified</source> + <translation>Ismeretlen protokoll van megadva</translation> + </message> + <message> + <location filename="../src/network/access/qhttp.cpp" line="-159"/> + <source>Connection refused (or timed out)</source> + <translation>Kapcsolat megtagadva (vagy időtúllépés)</translation> + </message> + <message> + <location line="-2266"/> + <source>HTTPS connection requested but SSL support not compiled in</source> + <translation>HTTP kapcsolat lett kérve, de az SSL támogatás nincs beleforgatva</translation> + </message> +</context> +<context> + <name>QHttpSocketEngine</name> + <message> + <location filename="../src/network/socket/qhttpsocketengine.cpp" line="-89"/> + <source>Did not receive HTTP response from proxy</source> + <translation>Nem kapott HTTP választ a proxy-tól</translation> + </message> + <message> + <location line="+25"/> + <source>Error parsing authentication request from proxy</source> + <translation>Hiba történt a proxy hitelesítés kérésének elemzése közben</translation> + </message> + <message> + <location line="+31"/> + <source>Authentication required</source> + <translation>Hitelesítés szükséges</translation> + </message> + <message> + <location line="+27"/> + <source>Proxy denied connection</source> + <translation>A proxy megtagadta a kapcsolatot</translation> + </message> + <message> + <location line="+10"/> + <source>Error communicating with HTTP proxy</source> + <translation>Hiba történt a HTTP proxy-val történő kommunikáció közben</translation> + </message> + <message> + <location line="+23"/> + <source>Proxy server not found</source> + <translation>A proxy szerver nem található</translation> + </message> + <message> + <location line="+2"/> + <source>Proxy connection refused</source> + <translation>A proxy kapcsolat elutasítva</translation> + </message> + <message> + <location line="+2"/> + <source>Proxy server connection timed out</source> + <translation>Proxy szerver kapcsolódási időtúllépés</translation> + </message> + <message> + <location line="+2"/> + <source>Proxy connection closed prematurely</source> + <translation>Proxy kapcsolódás túl korán be lett zárva</translation> + </message> +</context> +<context> + <name>QIBaseDriver</name> + <message> + <location filename="../src/sql/drivers/ibase/qsql_ibase.cpp" line="+1491"/> + <source>Error opening database</source> + <translation>Hiba történt az adatbázis megnyitása közben</translation> + </message> + <message> + <location line="+54"/> + <source>Could not start transaction</source> + <translation>Nem sikerült elindítani a tranzakciót</translation> + </message> + <message> + <location line="+13"/> + <source>Unable to commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+13"/> + <source>Unable to rollback transaction</source> + <translation>Nem lehet visszagörgetni a tranzakciót</translation> + </message> +</context> +<context> + <name>QIBaseResult</name> + <message> + <location line="-1149"/> + <source>Unable to create BLOB</source> + <translation>Nem lehet BLOB-t létrehozni</translation> + </message> + <message> + <location line="+6"/> + <source>Unable to write BLOB</source> + <translation>Nem lehet írni a BLOB-t</translation> + </message> + <message> + <location line="+14"/> + <source>Unable to open BLOB</source> + <translation>Nem lehet megnyitni a BLOB-t</translation> + </message> + <message> + <location line="+16"/> + <source>Unable to read BLOB</source> + <translation>Nem lehet olvasni a BLOB-t</translation> + </message> + <message> + <location line="+125"/> + <location line="+187"/> + <source>Could not find array</source> + <translation>Nem sikerült megtalálni a tömböt</translation> + </message> + <message> + <location line="-155"/> + <source>Could not get array data</source> + <translation>Nem sikerüét megszerezni a tömb adatokat</translation> + </message> + <message> + <location line="+210"/> + <source>Could not get query info</source> + <translation>Nem sikerült megszerezni a lekérdezi információt</translation> + </message> + <message> + <location line="+20"/> + <source>Could not start transaction</source> + <translation>Nem sikerült elindítani a tranzakciót</translation> + </message> + <message> + <location line="+19"/> + <source>Unable to commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+42"/> + <source>Could not allocate statement</source> + <translation>Nem sikerült lefoglalni a műveletet</translation> + </message> + <message> + <location line="+5"/> + <source>Could not prepare statement</source> + <translation>Nem sikerült felkészülni a műveletre</translation> + </message> + <message> + <location line="+5"/> + <location line="+11"/> + <source>Could not describe input statement</source> + <translation>Nem sikerült leírni a bemeneti állítást</translation> + </message> + <message> + <location line="+14"/> + <source>Could not describe statement</source> + <translation>Nem sikerült leírni az állítást</translation> + </message> + <message> + <location line="+115"/> + <source>Unable to close statement</source> + <translation>Nem lehet megnyitni az állítást</translation> + </message> + <message> + <location line="+8"/> + <source>Unable to execute query</source> + <translation>Nem lehet végrehajtani a lekérdezést</translation> + </message> + <message> + <location line="+46"/> + <source>Could not fetch next item</source> + <translation>Nem lehet letölteni a következő elemet</translation> + </message> + <message> + <location line="+197"/> + <source>Could not get statement info</source> + <translation>Nem lehet az művelet információkat megszerezni</translation> + </message> +</context> +<context> + <name>QIODevice</name> + <message> + <location filename="../src/corelib/global/qglobal.cpp" line="+2072"/> + <source>Permission denied</source> + <translation>Beleegyezés megtagadva</translation> + </message> + <message> + <location line="+3"/> + <source>Too many open files</source> + <translation>Túl sok fájl megnyitása</translation> + </message> + <message> + <location line="+3"/> + <source>No such file or directory</source> + <translation>Nincs ilyen fájl vagy könyvtár</translation> + </message> + <message> + <location line="+3"/> + <source>No space left on device</source> + <translation>Nincs több hely a lemezen</translation> + </message> + <message> + <location filename="../src/corelib/io/qiodevice.cpp" line="+1561"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> +</context> +<context> + <name>QInputContext</name> + <message> + <location filename="../src/gui/inputmethod/qinputcontextfactory.cpp" line="+256"/> + <source>XIM</source> + <translation>XIM</translation> + </message> + <message> + <location line="+4"/> + <source>FEP</source> + <translation>FEP</translation> + </message> + <message> + <location line="+23"/> + <source>XIM input method</source> + <translation>XIM beviteli eljárás</translation> + </message> + <message> + <location line="+4"/> + <source>Windows input method</source> + <translation>Windows beviteli eljárás</translation> + </message> + <message> + <location line="+4"/> + <source>Mac OS X input method</source> + <translation>Mac OS X beviteli eljárás</translation> + </message> + <message> + <location line="+4"/> + <source>S60 FEP input method</source> + <translation>S60 FEP beviteli eljárás</translation> + </message> +</context> +<context> + <name>QInputDialog</name> + <message> + <location filename="../src/gui/dialogs/qinputdialog.cpp" line="+223"/> + <source>Enter a value:</source> + <translation>Egy értél bevitele:</translation> + </message> +</context> +<context> + <name>QLibrary</name> + <message> + <location filename="../src/corelib/plugin/qlibrary.cpp" line="+383"/> + <source>Could not mmap '%1': %2</source> + <translation>Nem sikerült az mmap '%1': %2</translation> + </message> + <message> + <location line="+22"/> + <source>Plugin verification data mismatch in '%1'</source> + <translation>Beépülő modul igazoló adata nem megfelelő a(z) '%1'-ben</translation> + </message> + <message> + <location line="+6"/> + <source>Could not unmap '%1': %2</source> + <translation>Nem lehet eltávolítani a letérképezést '%1': %2</translation> + </message> + <message> + <location line="+344"/> + <source>The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5]</source> + <translation>A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. (%2.%3.%4) [%5]</translation> + </message> + <message> + <location line="+20"/> + <source>The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3"</source> + <translation>A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. A várt építési kulcs '%2', kapott '%3'</translation> + </message> + <message> + <location line="+365"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> + <message> + <location line="-402"/> + <location filename="../src/corelib/plugin/qpluginloader.cpp" line="+343"/> + <source>The shared library was not found.</source> + <translation>A megosztott könyvtár nem található.</translation> + </message> + <message> + <location line="+2"/> + <source>The file '%1' is not a valid Qt plugin.</source> + <translation>A(z) '%1' fájl nem egy érvényes Qt beépülő modul.</translation> + </message> + <message> + <location line="+43"/> + <source>The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.)</source> + <translation>A(z) '%1' beépülő modul inkompatibilis Qt könyvtárat használ. (Nem lehet a debug és kiadási könyvtárakat keverni.)</translation> + </message> + <message> + <location filename="../src/corelib/plugin/qlibrary_unix.cpp" line="+236"/> + <location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+87"/> + <source>Cannot load library %1: %2</source> + <translation>Nem lehet betölteni a(z) %1 könyvtárat: %2</translation> + </message> + <message> + <location line="+17"/> + <location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+22"/> + <source>Cannot unload library %1: %2</source> + <translation>Nem lehet kirakni a(z) %1 könyvtárat: %2</translation> + </message> + <message> + <location line="+34"/> + <location filename="../src/corelib/plugin/qlibrary_win.cpp" line="+15"/> + <source>Cannot resolve symbol "%1" in %2: %3</source> + <translation>Nem lehet megfejteni a(z) '%1' szimbólumot a(z) %2-ben: %3</translation> + </message> +</context> +<context> + <name>QLineEdit</name> + <message> + <location filename="../src/gui/widgets/qlineedit.cpp" line="+2035"/> + <source>Select All</source> + <translation>Az összes kiválasztása</translation> + </message> + <message> + <location line="-32"/> + <source>&Undo</source> + <translation>&Visszavonás</translation> + </message> + <message> + <location line="+4"/> + <source>&Redo</source> + <translation>&Helyreállítás</translation> + </message> + <message> + <location line="+7"/> + <source>Cu&t</source> + <translation>&Kivágás</translation> + </message> + <message> + <location line="+5"/> + <source>&Copy</source> + <translation>&Másolás</translation> + </message> + <message> + <location line="+5"/> + <source>&Paste</source> + <translation>&Beillesztés</translation> + </message> + <message> + <location line="+5"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> +</context> +<context> + <name>QLocalServer</name> + <message> + <location filename="../src/network/socket/qlocalserver.cpp" line="+224"/> + <location filename="../src/network/socket/qlocalserver_unix.cpp" line="+246"/> + <source>%1: Name error</source> + <translation>%1: Név hiba</translation> + </message> + <message> + <location filename="../src/network/socket/qlocalserver_unix.cpp" line="-8"/> + <source>%1: Permission denied</source> + <translation>%1: Engedély megtagadva</translation> + </message> + <message> + <location line="+12"/> + <source>%1: Address in use</source> + <translation>%1: Cím használatban</translation> + </message> + <message> + <location line="+5"/> + <source>%1: Unknown error %2</source> + <translation>%1: Ismeretlen hiba %2</translation> + </message> +</context> +<context> + <name>QLocalSocket</name> + <message> + <location filename="../src/network/socket/qlocalsocket_tcp.cpp" line="+132"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+139"/> + <source>%1: Connection refused</source> + <translation>%1: Kapcsolat elutasítva</translation> + </message> + <message> + <location line="+3"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/> + <source>%1: Remote closed</source> + <translation>%1: Távol bezárva</translation> + </message> + <message> + <location line="+3"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/> + <location filename="../src/network/socket/qlocalsocket_win.cpp" line="+80"/> + <location line="+45"/> + <source>%1: Invalid name</source> + <translation>%1: Érvénytelen név</translation> + </message> + <message> + <location line="+3"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/> + <source>%1: Socket access error</source> + <translation>%1: Socket hozzáférési hiba</translation> + </message> + <message> + <location line="+3"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/> + <source>%1: Socket resource error</source> + <translation>%1: Socket erőforrás hiba</translation> + </message> + <message> + <location line="+3"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/> + <source>%1: Socket operation timed out</source> + <translation>%1: Socker művelet időtúllépés</translation> + </message> + <message> + <location line="+3"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/> + <source>%1: Datagram too large</source> + <translation>%1: Túl nagy datagram</translation> + </message> + <message> + <location line="+3"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/> + <location filename="../src/network/socket/qlocalsocket_win.cpp" line="-50"/> + <source>%1: Connection error</source> + <translation>%1: Kapcsolat hiba</translation> + </message> + <message> + <location line="+3"/> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+3"/> + <source>%1: The socket operation is not supported</source> + <translation>%1: A socket művelet nem támogatott</translation> + </message> + <message> + <location line="+4"/> + <source>%1: Unknown error</source> + <translation>%1: Ismeretlen hiba</translation> + </message> + <message> + <location filename="../src/network/socket/qlocalsocket_unix.cpp" line="+4"/> + <location filename="../src/network/socket/qlocalsocket_win.cpp" line="+10"/> + <source>%1: Unknown error %2</source> + <translation>%1: Ismeretlen hiba %2</translation> + </message> +</context> +<context> + <name>QMYSQLDriver</name> + <message> + <location filename="../src/sql/drivers/mysql/qsql_mysql.cpp" line="+1261"/> + <source>Unable to open database '</source> + <translation>Nem lehet megnyitni az adatbázist</translation> + </message> + <message> + <location line="+11"/> + <source>Unable to connect</source> + <translation>Nem lehet kapcsolódni</translation> + </message> + <message> + <location line="+151"/> + <source>Unable to begin transaction</source> + <translation>Nem lehet megkezdeni a tranzakciót</translation> + </message> + <message> + <location line="+17"/> + <source>Unable to commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+17"/> + <source>Unable to rollback transaction</source> + <translation>Nem lehet visszagörgetni a tranzakciót</translation> + </message> +</context> +<context> + <name>QMYSQLResult</name> + <message> + <location line="-969"/> + <source>Unable to fetch data</source> + <translation>Nem lehet letölteni az adatot</translation> + </message> + <message> + <location line="+183"/> + <source>Unable to execute query</source> + <translation>Nem lehet végrehajtani a lekérdezést</translation> + </message> + <message> + <location line="+6"/> + <source>Unable to store result</source> + <translation>Nem lehet tárolni az eredményt</translation> + </message> + <message> + <location line="+191"/> + <location line="+8"/> + <source>Unable to prepare statement</source> + <translation>Nem lehet felkészülni a műveletre</translation> + </message> + <message> + <location line="+37"/> + <source>Unable to reset statement</source> + <translation>Nem lehet visszaállítani a műveleteket</translation> + </message> + <message> + <location line="+86"/> + <source>Unable to bind value</source> + <translation>Nem lehet összekötni az értéket</translation> + </message> + <message> + <location line="+11"/> + <source>Unable to execute statement</source> + <translation>Nem lehet végrehajtani az állítást</translation> + </message> + <message> + <location line="+14"/> + <location line="+21"/> + <source>Unable to bind outvalues</source> + <translation>Nem lehet összekötni a kiértékeléseket</translation> + </message> + <message> + <location line="-12"/> + <source>Unable to store statement results</source> + <translation>Nem lehet letárolni a művelet eredményeket</translation> + </message> + <message> + <location line="-253"/> + <source>Unable to execute next query</source> + <translation>Nem lehet végrehajtani a következő lekérdezést</translation> + </message> + <message> + <location line="+10"/> + <source>Unable to store next result</source> + <translation>Nem lehet letárolni a következő eredményt</translation> + </message> +</context> +<context> + <name>QMdiArea</name> + <message> + <location filename="../src/gui/widgets/qmdiarea.cpp" line="+290"/> + <source>(Untitled)</source> + <translation>(Címtelen)</translation> + </message> +</context> +<context> + <name>QMdiSubWindow</name> + <message> + <location filename="../src/gui/widgets/qmdisubwindow.cpp" line="+280"/> + <source>%1 - [%2]</source> + <translation>%1 - [%2]</translation> + </message> + <message> + <location line="+72"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location line="-18"/> + <source>Minimize</source> + <translation>Minimalizálás</translation> + </message> + <message> + <location line="+13"/> + <source>Restore Down</source> + <translation>Leállítás</translation> + </message> + <message> + <location line="+707"/> + <source>&Restore</source> + <translation>&Letárolás</translation> + </message> + <message> + <location line="+3"/> + <source>&Move</source> + <translation>&Mozgatás</translation> + </message> + <message> + <location line="+1"/> + <source>&Size</source> + <translation>&Méret</translation> + </message> + <message> + <location line="+1"/> + <source>Mi&nimize</source> + <translation>&Minimalizálás</translation> + </message> + <message> + <location line="+2"/> + <source>Ma&ximize</source> + <translation>Ma&ximalizálás</translation> + </message> + <message> + <location line="+2"/> + <source>Stay on &Top</source> + <translation>&Tetején maradni</translation> + </message> + <message> + <location line="+3"/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> + <message> + <location line="-729"/> + <source>Maximize</source> + <translation>Maximalizálás</translation> + </message> + <message> + <location line="+3"/> + <source>Unshade</source> + <translation>Árnyékolás megszüntetése</translation> + </message> + <message> + <location line="+3"/> + <source>Shade</source> + <translation>Árnyákolás</translation> + </message> + <message> + <location line="+6"/> + <source>Restore</source> + <translation>Visszaállítás</translation> + </message> + <message> + <location line="+6"/> + <source>Help</source> + <translation>Súgó</translation> + </message> + <message> + <location line="+3"/> + <source>Menu</source> + <translation>Menü</translation> + </message> + <message> + <location line="-79"/> + <source>- [%1]</source> + <translation>- [%1]</translation> + </message> +</context> +<context> + <name>QMenu</name> + <message> + <location filename="../src/plugins/accessible/widgets/qaccessiblemenu.cpp" line="+157"/> + <location line="+225"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location line="-224"/> + <location line="+225"/> + <source>Open</source> + <translation>Megnyitás</translation> + </message> + <message> + <location line="-223"/> + <location line="+225"/> + <location line="+51"/> + <source>Execute</source> + <translation>Végrehajtás</translation> + </message> +</context> +<context> + <name>QMenuBar</name> + <message> + <location filename="../src/gui/widgets/qmenu_symbian.cpp" line="+410"/> + <source>Actions</source> + <translation>Tevékenységek</translation> + </message> +</context> +<context> + <name>QMessageBox</name> + <message> + <location filename="../src/gui/dialogs/qmessagebox.cpp" line="-1964"/> + <location line="+847"/> + <location filename="../src/gui/dialogs/qmessagebox.h" line="-52"/> + <location line="+8"/> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <location line="+477"/> + <source><h3>About Qt</h3><p>This program uses Qt version %1.</p></source> + <translation><h3>Qt-ról</h3><p>Ez a program a(z) %1 Qt verziót használja.</p></translation> + </message> + <message> + <location line="+5"/> + <source><p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p><p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://qt.nokia.com/products/licensing">qt.nokia.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://qt.nokia.com/">qt.nokia.com</a> for more information.</p></source> + <translation></translation> + </message> + <message> + <location line="+31"/> + <source>About Qt</source> + <translation>Qt-ról</translation> + </message> + <message> + <location line="-512"/> + <source>Help</source> + <translation>Súgó</translation> + </message> + <message> + <location line="-1099"/> + <source>Show Details...</source> + <translation>Részletek megjelenítése...</translation> + </message> + <message> + <location line="+1"/> + <source>Hide Details...</source> + <translation>Részletek elrejtése...</translation> + </message> +</context> +<context> + <name>QMultiInputContext</name> + <message> + <location filename="../src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp" line="+88"/> + <source>Select IM</source> + <translation>IM kiválasztása</translation> + </message> +</context> +<context> + <name>QMultiInputContextPlugin</name> + <message> + <location filename="../src/plugins/inputmethods/imsw-multi/qmultiinputcontextplugin.cpp" line="+95"/> + <source>Multiple input method switcher</source> + <translation>Összetett beviteli eljárás kapcsoló</translation> + </message> + <message> + <location line="+7"/> + <source>Multiple input method switcher that uses the context menu of the text widgets</source> + <translation>Összetett beviteli eljárás kapcsoló, ami a szöveg widgetek menü összefüggéseit használja</translation> + </message> +</context> +<context> + <name>QNativeSocketEngine</name> + <message> + <location filename="../src/network/socket/qnativesocketengine.cpp" line="+206"/> + <source>The remote host closed the connection</source> + <translation>A távoli hoszt bezárta a kapcsolatot</translation> + </message> + <message> + <location line="+3"/> + <source>Network operation timed out</source> + <translation>Hálózati művelet időtúllépése</translation> + </message> + <message> + <location line="+3"/> + <source>Out of resources</source> + <translation>Kifogytak az erőforrások</translation> + </message> + <message> + <location line="+3"/> + <source>Unsupported socket operation</source> + <translation>Nem támogatott socket művelet</translation> + </message> + <message> + <location line="+3"/> + <source>Protocol type not supported</source> + <translation>Nem támogatott protokoll típus</translation> + </message> + <message> + <location line="+3"/> + <source>Invalid socket descriptor</source> + <translation>Érvénytelen socket leíró</translation> + </message> + <message> + <location line="+6"/> + <source>Network unreachable</source> + <translation>A hálózat nem elérhető</translation> + </message> + <message> + <location line="+3"/> + <source>Permission denied</source> + <translation>Engedély megtagadva</translation> + </message> + <message> + <location line="+3"/> + <source>Connection timed out</source> + <translation>Kapcsolat időtúllépés</translation> + </message> + <message> + <location line="+3"/> + <source>Connection refused</source> + <translation>Kapcsolat elutasítva</translation> + </message> + <message> + <location line="+3"/> + <source>The bound address is already in use</source> + <translation>A cím összeköttetés már használatban van</translation> + </message> + <message> + <location line="+3"/> + <source>The address is not available</source> + <translation>A cím nem elérhető</translation> + </message> + <message> + <location line="+3"/> + <source>The address is protected</source> + <translation>A cím védett</translation> + </message> + <message> + <location line="+6"/> + <source>Unable to send a message</source> + <translation>Nem lehet üzenetet küldeni</translation> + </message> + <message> + <location line="+3"/> + <source>Unable to receive a message</source> + <translation>Nem lehet megkapni az üzeneteket</translation> + </message> + <message> + <location line="+3"/> + <source>Unable to write</source> + <translation>Nem lehet írni</translation> + </message> + <message> + <location line="+3"/> + <source>Network error</source> + <translation>Hálózati hiba</translation> + </message> + <message> + <location line="+3"/> + <source>Another socket is already listening on the same port</source> + <translation>Egy másik socker már ugyanazon a porton figyel</translation> + </message> + <message> + <location line="-66"/> + <source>Unable to initialize non-blocking socket</source> + <translation>Nem lehet inicializálni egy nem blokkoló socketet</translation> + </message> + <message> + <location line="+3"/> + <source>Unable to initialize broadcast socket</source> + <translation>Nem lehet inicializálni a socket közvetítőt</translation> + </message> + <message> + <location line="+3"/> + <source>Attempt to use IPv6 socket on a platform with no IPv6 support</source> + <translation>IPv6 socket használatának kipróbálása olyan platformon, amelyik nem támogatja az IPv6-t</translation> + </message> + <message> + <location line="+21"/> + <source>Host unreachable</source> + <translation>A hoszt nem elérhető</translation> + </message> + <message> + <location line="+24"/> + <source>Datagram was too large to send</source> + <translation>A datagram túl nagy volt elküldésre</translation> + </message> + <message> + <location line="+18"/> + <source>Operation on non-socket</source> + <translation>Nem socketen végzett művelet</translation> + </message> + <message> + <location line="+6"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> + <message> + <location line="-3"/> + <source>The proxy type is invalid for this operation</source> + <translation>A proxy típusa ismeretlen erre a műveletre</translation> + </message> +</context> +<context> + <name>QNetworkAccessCacheBackend</name> + <message> + <location filename="../src/network/access/qnetworkaccesscachebackend.cpp" line="+66"/> + <source>Error opening %1</source> + <translation>Hiba történt a(z) %1 megnyitása közben</translation> + </message> +</context> +<context> + <name>QNetworkAccessDebugPipeBackend</name> + <message> + <location filename="../src/network/access/qnetworkaccessdebugpipebackend.cpp" line="+195"/> + <source>Write error writing to %1: %2</source> + <translation>Írása hiba történt a(z) %1-be történő írás közben: %2</translation> + </message> +</context> +<context> + <name>QNetworkAccessFileBackend</name> + <message> + <location filename="../src/network/access/qfilenetworkreply.cpp" line="+83"/> + <location filename="../src/network/access/qnetworkaccessfilebackend.cpp" line="+100"/> + <source>Request for opening non-local file %1</source> + <translation>Kérés a(z) %1 nem helyi fál megnyitására</translation> + </message> + <message> + <location line="+31"/> + <location filename="../src/network/access/qnetworkaccessfilebackend.cpp" line="+45"/> + <source>Error opening %1: %2</source> + <translation>Hiba történt a(z) %1 megnyitása közben: %2</translation> + </message> + <message> + <location filename="../src/network/access/qnetworkaccessfilebackend.cpp" line="+38"/> + <source>Write error writing to %1: %2</source> + <translation>Írási hiba történt a(z) %1-be írás közben: %2</translation> + </message> + <message> + <location filename="../src/network/access/qfilenetworkreply.cpp" line="-11"/> + <location filename="../src/network/access/qnetworkaccessfilebackend.cpp" line="+48"/> + <source>Cannot open %1: Path is a directory</source> + <translation>Nem lehet megnyitni a(z) %1-t: az útvonal egy könyvtár</translation> + </message> + <message> + <location filename="../src/network/access/qnetworkaccessfilebackend.cpp" line="+21"/> + <source>Read error reading from %1: %2</source> + <translation>Olvasási hiba történt a(z) %1-ból való olvasás közben: %2</translation> + </message> +</context> +<context> + <name>QNetworkAccessFtpBackend</name> + <message> + <location filename="../src/network/access/qnetworkaccessftpbackend.cpp" line="+131"/> + <source>No suitable proxy found</source> + <translation>Nem található megfelelő proxy</translation> + </message> + <message> + <location line="+14"/> + <source>Cannot open %1: is a directory</source> + <translation>Nem lehet megnyitni a(z) %1 t, mert az egy könyvtár</translation> + </message> + <message> + <location line="+112"/> + <source>Logging in to %1 failed: authentication required</source> + <translation>A(z) %1-be történő loggolás nem sikerült: hitelesítés szükséges</translation> + </message> + <message> + <location line="+39"/> + <source>Error while downloading %1: %2</source> + <translation>Hiba történt a(z) %1 letöltése közben: %2</translation> + </message> + <message> + <location line="+2"/> + <source>Error while uploading %1: %2</source> + <translation>Hiba történt a(z) %1 feltöltése közben: %2</translation> + </message> +</context> +<context> + <name>QNetworkAccessHttpBackend</name> + <message> + <location filename="../src/network/access/qnetworkaccesshttpbackend.cpp" line="+585"/> + <source>No suitable proxy found</source> + <translation>Nem található megfelelő proxy</translation> + </message> +</context> +<context> + <name>QNetworkReply</name> + <message> + <location line="+95"/> + <source>Error downloading %1 - server replied: %2</source> + <translation>Hiba történt a(z) %1 letöltése közben - a szerver válasza: %2</translation> + </message> + <message> + <location filename="../src/network/access/qnetworkreplyimpl.cpp" line="+77"/> + <source>Protocol "%1" is unknown</source> + <translation>A(z) '%1' protokoll ismeretlen</translation> + </message> +</context> +<context> + <name>QNetworkReplyImpl</name> + <message> + <location line="+519"/> + <location line="+28"/> + <source>Operation canceled</source> + <translation>Művelet visszavonása</translation> + </message> +</context> +<context> + <name>QOCIDriver</name> + <message> + <location filename="../src/sql/drivers/oci/qsql_oci.cpp" line="+2083"/> + <source>Unable to logon</source> + <translation>Nem lehet bejelentkezni</translation> + </message> + <message> + <location line="-144"/> + <source>Unable to initialize</source> + <comment>QOCIDriver</comment> + <translation>Nem lehet inicializálni</translation> + </message> + <message> + <location line="+215"/> + <source>Unable to begin transaction</source> + <translation>Nem lehet megkezdeni a tranzakciót</translation> + </message> + <message> + <location line="+19"/> + <source>Unable to commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+19"/> + <source>Unable to rollback transaction</source> + <translation>Nem lehet visszagörgetni a tranzakciót</translation> + </message> +</context> +<context> + <name>QOCIResult</name> + <message> + <location line="-979"/> + <location line="+168"/> + <location line="+15"/> + <source>Unable to bind column for batch execute</source> + <translation>Nem lehet összekötni az oszlopot köteg végrehajtásra</translation> + </message> + <message> + <location line="+15"/> + <source>Unable to execute batch statement</source> + <translation>Nem lehet végrehajtani a köteg állítást</translation> + </message> + <message> + <location line="+304"/> + <source>Unable to goto next</source> + <translation>Nem lehet a következőre ugrani</translation> + </message> + <message> + <location line="+59"/> + <source>Unable to alloc statement</source> + <translation>Nem lehet helyet lefoglalni az állításnak</translation> + </message> + <message> + <location line="+15"/> + <source>Unable to prepare statement</source> + <translation>Nem lehet felkészülni a műveletre</translation> + </message> + <message> + <location line="+26"/> + <source>Unable to get statement type</source> + <translation>Nem lehet megszerezni az állítás típusát</translation> + </message> + <message> + <location line="+20"/> + <source>Unable to bind value</source> + <translation>Nem lehet összekötni az értéket</translation> + </message> + <message> + <location line="+19"/> + <source>Unable to execute statement</source> + <translation>Nem lehet végrehajtani az állítást</translation> + </message> +</context> +<context> + <name>QODBCDriver</name> + <message> + <location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="+1790"/> + <source>Unable to connect</source> + <translation>Nem lehet kapcsolódni</translation> + </message> + <message> + <location line="+238"/> + <source>Unable to disable autocommit</source> + <translation>Nem lehet letiltani az automatikus kommitolást</translation> + </message> + <message> + <location line="+17"/> + <source>Unable to commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+17"/> + <source>Unable to rollback transaction</source> + <translation>Nem lehet visszagörgetni a tranzakciót</translation> + </message> + <message> + <location line="+15"/> + <source>Unable to enable autocommit</source> + <translation>Nem lehet engedélyezni az automatikus kommitolást</translation> + </message> + <message> + <location line="-281"/> + <source>Unable to connect - Driver doesn't support all functionality required</source> + <translation>Nem lehet csatlakozni- A vezérlő nem támogatja az összes szükséges funkciót</translation> + </message> +</context> +<context> + <name>QODBCResult</name> + <message> + <location line="-932"/> + <location line="+346"/> + <source>QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration</source> + <translation>QODBCEredmény::Visszaállítás: Nen lehet beállítani az 'SQL_CURSOR_STATIC' állítás attribútumra. Kérem ellenőrizze le az ODBC vezérlő konfigurációt</translation> + </message> + <message> + <location line="-329"/> + <location line="+623"/> + <source>Unable to execute statement</source> + <translation>Nem lehet végrehajtani az állítást</translation> + </message> + <message> + <location line="-547"/> + <source>Unable to fetch next</source> + <translation>Nem lehet letölteni a következőt</translation> + </message> + <message> + <location line="+271"/> + <source>Unable to prepare statement</source> + <translation>Nem lehet felkészülni az állításra</translation> + </message> + <message> + <location line="+268"/> + <source>Unable to bind variable</source> + <translation>Nem lehet összekötni a változót</translation> + </message> + <message> + <location filename="../src/sql/drivers/db2/qsql_db2.cpp" line="+190"/> + <location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="-467"/> + <location line="+576"/> + <source>Unable to fetch last</source> + <translation>Nem lehet letölteni az utolsót</translation> + </message> + <message> + <location filename="../src/sql/drivers/odbc/qsql_odbc.cpp" line="-670"/> + <source>Unable to fetch</source> + <translation>Nem lehet letölteni</translation> + </message> + <message> + <location line="+44"/> + <source>Unable to fetch first</source> + <translation>Nem letölteni az elsőt</translation> + </message> + <message> + <location line="+19"/> + <source>Unable to fetch previous</source> + <translation>Nem lehet letölteni az előzőt</translation> + </message> +</context> +<context> + <name>QObject</name> + <message> + <location filename="../src/network/kernel/qhostinfo_unix.cpp" line="-97"/> + <source>Invalid hostname</source> + <translation>Érvénytelen hoszt név</translation> + </message> + <message> + <location filename="../src/network/access/qnetworkaccessdatabackend.cpp" line="+74"/> + <source>Operation not supported on %1</source> + <translation>A művelet nem támogatott a(z) %1-n</translation> + </message> + <message> + <location line="+57"/> + <source>Invalid URI: %1</source> + <translation>Érvénytelen URI: %1</translation> + </message> + <message> + <location filename="../src/network/access/qnetworkaccessdebugpipebackend.cpp" line="+60"/> + <source>Socket error on %1: %2</source> + <translation>Socket hiba a(z) %1-n: %2</translation> + </message> + <message> + <location line="+15"/> + <source>Remote host closed the connection prematurely on %1</source> + <translation>A távoli hoszt túl korán bezárta a kapcsolatot a(z) %1-n</translation> + </message> + <message> + <location filename="../src/network/kernel/qhostinfo.cpp" line="+175"/> + <location filename="../src/network/kernel/qhostinfo_unix.cpp" line="+0"/> + <source>No host name given</source> + <translation>Nincs hoszt név megadva</translation> + </message> +</context> +<context> + <name>QPPDOptionsModel</name> + <message> + <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="+1197"/> + <source>Name</source> + <translation>Név</translation> + </message> + <message> + <location line="+2"/> + <source>Value</source> + <translation>Érték</translation> + </message> +</context> +<context> + <name>QPSQLDriver</name> + <message> + <location filename="../src/sql/drivers/psql/qsql_psql.cpp" line="+782"/> + <source>Unable to connect</source> + <translation>Nem lehet csatlakozni</translation> + </message> + <message> + <location line="+49"/> + <source>Could not begin transaction</source> + <translation>Nem sikerült megkezdeni a tranzakciót</translation> + </message> + <message> + <location line="+30"/> + <source>Could not commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+16"/> + <source>Could not rollback transaction</source> + <translation>Nem lehet visszagörgetni a tranzakciót</translation> + </message> + <message> + <location line="+374"/> + <source>Unable to subscribe</source> + <translation>Nem lehet feliratkozni</translation> + </message> + <message> + <location line="+32"/> + <source>Unable to unsubscribe</source> + <translation>Nem lehet leiratkozni</translation> + </message> +</context> +<context> + <name>QPSQLResult</name> + <message> + <location line="-1085"/> + <source>Unable to create query</source> + <translation>Nem lehet létrehozni a lekérdezést</translation> + </message> + <message> + <location line="+372"/> + <source>Unable to prepare statement</source> + <translation>Nem lehet felkészülni az állításra</translation> + </message> +</context> +<context> + <name>QPageSetupWidget</name> + <message> + <location filename="../src/gui/dialogs/qpagesetupdialog_unix.cpp" line="+304"/> + <source>Centimeters (cm)</source> + <translation>Centiméter (cm)</translation> + </message> + <message> + <location line="+0"/> + <source>Millimeters (mm)</source> + <translation>Milliméter (mm)</translation> + </message> + <message> + <location line="+0"/> + <source>Inches (in)</source> + <translation>Incs (in)</translation> + </message> + <message> + <location line="+0"/> + <source>Points (pt)</source> + <translation>Pont (pt)</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qpagesetupwidget.ui"/> + <source>Form</source> + <translation></translation> + </message> + <message> + <location/> + <source>Paper</source> + <translation>Papír</translation> + </message> + <message> + <location/> + <source>Page size:</source> + <translation>Lap méret:</translation> + </message> + <message> + <location/> + <source>Width:</source> + <translation>Szélesség:</translation> + </message> + <message> + <location/> + <source>Height:</source> + <translation>Magasság:</translation> + </message> + <message> + <location/> + <source>Paper source:</source> + <translation>Papír forrás:</translation> + </message> + <message> + <location/> + <source>Orientation</source> + <translation>Elhelyezkedés</translation> + </message> + <message> + <location/> + <source>Portrait</source> + <translation>Portré</translation> + </message> + <message> + <location/> + <source>Landscape</source> + <translation>Tájkép</translation> + </message> + <message> + <location/> + <source>Reverse landscape</source> + <translation>Fordított tájkép</translation> + </message> + <message> + <location/> + <source>Reverse portrait</source> + <translation>Fordított portré</translation> + </message> + <message> + <location/> + <source>Margins</source> + <translation>Margó</translation> + </message> + <message> + <location/> + <source>top margin</source> + <translation>Felső margó</translation> + </message> + <message> + <location/> + <source>left margin</source> + <translation>Bal margó</translation> + </message> + <message> + <location/> + <source>right margin</source> + <translation>Jobb margó</translation> + </message> + <message> + <location/> + <source>bottom margin</source> + <translation>Alsó margó</translation> + </message> +</context> +<context> + <name>QPluginLoader</name> + <message> + <location filename="../src/corelib/plugin/qpluginloader.cpp" line="+24"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> + <message> + <location line="-113"/> + <source>The plugin was not loaded.</source> + <translation>A beépülő modult nem sikerült betölteni.</translation> + </message> +</context> +<context> + <name>QPrintDialog</name> + <message> + <location filename="../src/gui/painting/qprinterinfo_unix.cpp" line="+108"/> + <source>locally connected</source> + <translation>Helyileg csatlakoztatva</translation> + </message> + <message> + <location line="+23"/> + <location line="+225"/> + <source>Aliases: %1</source> + <translation>Álnevek: %1</translation> + </message> + <message> + <location line="+225"/> + <location line="+199"/> + <source>unknown</source> + <translation>ismeretlen</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="+266"/> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="+375"/> + <source>Print all</source> + <translation>Az összes kinyomtatása</translation> + </message> + <message> + <location line="+2"/> + <source>Print range</source> + <translation>Egy tartomány kinyomtatása</translation> + </message> + <message> + <location line="-48"/> + <source>A0 (841 x 1189 mm)</source> + <translation>A0 (841 x 1189 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>A1 (594 x 841 mm)</source> + <translation>A1 (594 x 841 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>A2 (420 x 594 mm)</source> + <translation>A2 (420 x 594 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>A3 (297 x 420 mm)</source> + <translation>A3 (297 x 420 mm)</translation> + </message> + <message> + <location line="+2"/> + <source>A5 (148 x 210 mm)</source> + <translation>A5 (148 x 210 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>A6 (105 x 148 mm)</source> + <translation>A6 (105 x 148 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>A7 (74 x 105 mm)</source> + <translation>A7 (74 x 105 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>A8 (52 x 74 mm)</source> + <translation>A8 (52 x 74 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>A9 (37 x 52 mm)</source> + <translation>A9 (37 x 52 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B0 (1000 x 1414 mm)</source> + <translation>B0 (1000 x 1414 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B1 (707 x 1000 mm)</source> + <translation>B1 (707 x 1000 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B2 (500 x 707 mm)</source> + <translation>B2 (500 x 707 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B3 (353 x 500 mm)</source> + <translation>B3 (353 x 500 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B4 (250 x 353 mm)</source> + <translation>B4 (250 x 353 mm)</translation> + </message> + <message> + <location line="+2"/> + <source>B6 (125 x 176 mm)</source> + <translation>B6 (125 x 176 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B7 (88 x 125 mm)</source> + <translation>B7 (88 x 125 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B8 (62 x 88 mm)</source> + <translation>B8 (62 x 88 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B9 (44 x 62 mm)</source> + <translation>B9 (44 x 62 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>B10 (31 x 44 mm)</source> + <translation>B10 (31 x 44 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>C5E (163 x 229 mm)</source> + <translation>C5E (163 x 229 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>DLE (110 x 220 mm)</source> + <translation>DLE (110 x 220 mm)</translation> + </message> + <message> + <location line="+2"/> + <source>Folio (210 x 330 mm)</source> + <translation>Fólió (210 x 330 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>Ledger (432 x 279 mm)</source> + <translation>Főkönyv (432 x 279 mm)</translation> + </message> + <message> + <location line="+3"/> + <source>Tabloid (279 x 432 mm)</source> + <translation>Tabletta (279 x 432 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>US Common #10 Envelope (105 x 241 mm)</source> + <translation>US közös #10 bélyeg (105 x 241 mm)</translation> + </message> + <message> + <location line="-25"/> + <source>A4 (210 x 297 mm, 8.26 x 11.7 inches)</source> + <translation>A4 (210 x 297 mm, 8.26 x 11.7 inches)</translation> + </message> + <message> + <location line="+11"/> + <source>B5 (176 x 250 mm, 6.93 x 9.84 inches)</source> + <translation>B5 (176 x 250 mm, 6.93 x 9.84 inches)</translation> + </message> + <message> + <location line="+8"/> + <source>Executive (7.5 x 10 inches, 191 x 254 mm)</source> + <translation>Vezető (7.5 x 10 inches, 191 x 254 mm)</translation> + </message> + <message> + <location line="+3"/> + <source>Legal (8.5 x 14 inches, 216 x 356 mm)</source> + <translation>Legális (8.5 x 14 inches, 216 x 356 mm)</translation> + </message> + <message> + <location line="+1"/> + <source>Letter (8.5 x 11 inches, 216 x 279 mm)</source> + <translation>Levél (8.5 x 11 inches, 216 x 279 mm)</translation> + </message> + <message> + <location line="+20"/> + <source>Print selection</source> + <translation>Nyomtatási kiválasztás</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qabstractprintdialog.cpp" line="+112"/> + <location line="+13"/> + <location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="-2"/> + <source>Print</source> + <translation>Nyomtatás</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-359"/> + <source>Print To File ...</source> + <translation>Fájlba nyomtatás ...</translation> + </message> + <message> + <location line="+82"/> + <source>File %1 is not writable. +Please choose a different file name.</source> + <translation>A(z) %1 fájl nem írható. +Kérem válasszon különböző fájl nevet.</translation> + </message> + <message> + <location line="+4"/> + <source>%1 already exists. +Do you want to overwrite it?</source> + <translation>A(z) %1 már létezik. +Felül szeretné írni?</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qprintdialog_qws.cpp" line="-228"/> + <source>File exists</source> + <translation>Fájl létezik</translation> + </message> + <message> + <location line="+1"/> + <source><qt>Do you want to overwrite it?</qt></source> + <translation><qt>Felül szeretné írni?</qt></translation> + </message> + <message> + <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-8"/> + <source>%1 is a directory. +Please choose a different file name.</source> + <translation>A(z) %1 egy könyvtár. +Kérem válasszon egy különböző fájl nevet.</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qprintdialog_win.cpp" line="+1"/> + <source>The 'From' value cannot be greater than the 'To' value.</source> + <translation>A '-Tól' érték nem lehet nagyobb az '-Ig' értéknél.</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qpagesetupdialog_unix.cpp" line="-232"/> + <source>A0</source> + <translation>A0</translation> + </message> + <message> + <location line="+1"/> + <source>A1</source> + <translation>A1</translation> + </message> + <message> + <location line="+1"/> + <source>A2</source> + <translation>A2</translation> + </message> + <message> + <location line="+1"/> + <source>A3</source> + <translation>A3</translation> + </message> + <message> + <location line="+1"/> + <source>A4</source> + <translation>A4</translation> + </message> + <message> + <location line="+1"/> + <source>A5</source> + <translation>A5</translation> + </message> + <message> + <location line="+1"/> + <source>A6</source> + <translation>A6</translation> + </message> + <message> + <location line="+1"/> + <source>A7</source> + <translation>A7</translation> + </message> + <message> + <location line="+1"/> + <source>A8</source> + <translation>A8</translation> + </message> + <message> + <location line="+1"/> + <source>A9</source> + <translation>A9</translation> + </message> + <message> + <location line="+1"/> + <source>B0</source> + <translation>B0</translation> + </message> + <message> + <location line="+1"/> + <source>B1</source> + <translation>B1</translation> + </message> + <message> + <location line="+1"/> + <source>B2</source> + <translation>B2</translation> + </message> + <message> + <location line="+1"/> + <source>B3</source> + <translation>B3</translation> + </message> + <message> + <location line="+1"/> + <source>B4</source> + <translation>B4</translation> + </message> + <message> + <location line="+1"/> + <source>B5</source> + <translation>B5</translation> + </message> + <message> + <location line="+1"/> + <source>B6</source> + <translation>B6</translation> + </message> + <message> + <location line="+1"/> + <source>B7</source> + <translation>B7</translation> + </message> + <message> + <location line="+1"/> + <source>B8</source> + <translation>B8</translation> + </message> + <message> + <location line="+1"/> + <source>B9</source> + <translation>B9</translation> + </message> + <message> + <location line="+1"/> + <source>B10</source> + <translation>B10</translation> + </message> + <message> + <location line="+1"/> + <source>C5E</source> + <translation>C5E</translation> + </message> + <message> + <location line="+1"/> + <source>DLE</source> + <translation>DLE</translation> + </message> + <message> + <location line="+1"/> + <source>Executive</source> + <translation>Vezető</translation> + </message> + <message> + <location line="+1"/> + <source>Folio</source> + <translation>Fólió</translation> + </message> + <message> + <location line="+1"/> + <source>Ledger</source> + <translation>Főkönyv</translation> + </message> + <message> + <location line="+1"/> + <source>Legal</source> + <translation>Legális</translation> + </message> + <message> + <location line="+1"/> + <source>Letter</source> + <translation>Levél</translation> + </message> + <message> + <location line="+1"/> + <source>Tabloid</source> + <translation>Tabletta</translation> + </message> + <message> + <location line="+1"/> + <source>US Common #10 Envelope</source> + <translation>US közös #10 bélyeg</translation> + </message> + <message> + <location line="+1"/> + <source>Custom</source> + <translation>Egyéni</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qprintdialog_unix.cpp" line="-523"/> + <location line="+68"/> + <source>&Options >></source> + <translation>&Opciók >></translation> + </message> + <message> + <location line="+4"/> + <source>&Options <<</source> + <translation>&Opciók <<</translation> + </message> + <message> + <location line="+253"/> + <source>Print to File (PDF)</source> + <translation>Fájlba nyomtatás (PDF)</translation> + </message> + <message> + <location line="+1"/> + <source>Print to File (Postscript)</source> + <translation>Fájlba nyomtatás (Postscript)</translation> + </message> + <message> + <location line="+47"/> + <source>Local file</source> + <translation>Helyi fájl</translation> + </message> + <message> + <location line="+1"/> + <source>Write %1 file</source> + <translation>%1 fájlba írás</translation> + </message> + <message> + <location line="-369"/> + <source>&Print</source> + <translation>&Nyomtatás</translation> + </message> +</context> +<context> + <name>QPrintPreviewDialog</name> + <message> + <location filename="../src/gui/dialogs/qprintpreviewdialog.cpp" line="+246"/> + <source>%1%</source> + <translation>%1%</translation> + </message> + <message> + <location line="+68"/> + <source>Print Preview</source> + <translation>Nyomtatási előnézet</translation> + </message> + <message> + <location line="+30"/> + <source>Next page</source> + <translation>Következő lap</translation> + </message> + <message> + <location line="+1"/> + <source>Previous page</source> + <translation>Előző lap</translation> + </message> + <message> + <location line="+1"/> + <source>First page</source> + <translation>Első lap</translation> + </message> + <message> + <location line="+1"/> + <source>Last page</source> + <translation>Utolsó lap</translation> + </message> + <message> + <location line="+9"/> + <source>Fit width</source> + <translation>Megfelelő szélesség</translation> + </message> + <message> + <location line="+1"/> + <source>Fit page</source> + <translation>Megfelelő lap</translation> + </message> + <message> + <location line="+11"/> + <source>Zoom in</source> + <translation>Nagyítás</translation> + </message> + <message> + <location line="+1"/> + <source>Zoom out</source> + <translation>Kicsinyítés</translation> + </message> + <message> + <location line="+6"/> + <source>Portrait</source> + <translation>Portré</translation> + </message> + <message> + <location line="+1"/> + <source>Landscape</source> + <translation>Tájkép</translation> + </message> + <message> + <location line="+10"/> + <source>Show single page</source> + <translation>Egyetlen lap megjelenítése</translation> + </message> + <message> + <location line="+1"/> + <source>Show facing pages</source> + <translation>Lapok megjelenítése szemből</translation> + </message> + <message> + <location line="+1"/> + <source>Show overview of all pages</source> + <translation>Az összes lap áttekintésének megjelenítése</translation> + </message> + <message> + <location line="+15"/> + <source>Print</source> + <translation>Nyomtatás</translation> + </message> + <message> + <location line="+1"/> + <source>Page setup</source> + <translation>Lap beállítás</translation> + </message> + <message> + <location line="+150"/> + <source>Export to PDF</source> + <translation>PDF-be exportálás</translation> + </message> + <message> + <location line="+3"/> + <source>Export to PostScript</source> + <translation>PostScript-be exportálás</translation> + </message> + <message> + <location filename="../src/gui/dialogs/qabstractpagesetupdialog.cpp" line="+68"/> + <location line="+12"/> + <source>Page Setup</source> + <translation>Lap beállítás</translation> + </message> +</context> +<context> + <name>QPrintPropertiesWidget</name> + <message> + <location filename="../src/gui/dialogs/qprintpropertieswidget.ui"/> + <source>Form</source> + <translation>Forma</translation> + </message> + <message> + <location/> + <source>Page</source> + <translation>Lap</translation> + </message> + <message> + <location/> + <source>Advanced</source> + <translation>Speciális</translation> + </message> +</context> +<context> + <name>QPrintSettingsOutput</name> + <message> + <location filename="../src/gui/dialogs/qprintsettingsoutput.ui"/> + <source>Form</source> + <translation>Forma</translation> + </message> + <message> + <location/> + <source>Copies</source> + <translation>Másolás</translation> + </message> + <message> + <location/> + <source>Print range</source> + <translation>Tartomány nyomtatása</translation> + </message> + <message> + <location/> + <source>Print all</source> + <translation>Az összes nyomtatása</translation> + </message> + <message> + <location/> + <source>Pages from</source> + <translation>Lapok ettől</translation> + </message> + <message> + <location/> + <source>to</source> + <translation>eddig</translation> + </message> + <message> + <location/> + <source>Selection</source> + <translation>Kiválasztás</translation> + </message> + <message> + <location/> + <source>Output Settings</source> + <translation>Kimeneti beállítások</translation> + </message> + <message> + <location/> + <source>Copies:</source> + <translation>Másolatok:</translation> + </message> + <message> + <location/> + <source>Collate</source> + <translation>Egyeztet</translation> + </message> + <message> + <location/> + <source>Reverse</source> + <translation>Fordítva</translation> + </message> + <message> + <location/> + <source>Options</source> + <translation>Opciók</translation> + </message> + <message> + <location/> + <source>Color Mode</source> + <translation>Színes mód</translation> + </message> + <message> + <location/> + <source>Color</source> + <translation>Szín</translation> + </message> + <message> + <location/> + <source>Grayscale</source> + <translation>Szürkeárnyalat</translation> + </message> + <message> + <location/> + <source>Duplex Printing</source> + <translation>Dupla nyomtatás</translation> + </message> + <message> + <location/> + <source>None</source> + <translation>Semmi</translation> + </message> + <message> + <location/> + <source>Long side</source> + <translation>Hosszú oldal</translation> + </message> + <message> + <location/> + <source>Short side</source> + <translation>Rövid oldal</translation> + </message> +</context> +<context> + <name>QPrintWidget</name> + <message> + <location filename="../src/gui/dialogs/qprintwidget.ui"/> + <source>Form</source> + <translation>Űrlap</translation> + </message> + <message> + <location/> + <source>Printer</source> + <translation>Nyomtató</translation> + </message> + <message> + <location/> + <source>&Name:</source> + <translation>&Név:</translation> + </message> + <message> + <location/> + <source>P&roperties</source> + <translation>Tu&lajdonságok</translation> + </message> + <message> + <location/> + <source>Location:</source> + <translation>Elhelyezkedés:</translation> + </message> + <message> + <location/> + <source>Preview</source> + <translation>Előnézet</translation> + </message> + <message> + <location/> + <source>Type:</source> + <translation>Típus:</translation> + </message> + <message> + <location/> + <source>Output &file:</source> + <translation>Kimeneti &fájl:</translation> + </message> + <message> + <location/> + <source>...</source> + <translation>...</translation> + </message> +</context> +<context> + <name>QProcess</name> + <message> + <location filename="../src/corelib/io/qprocess_unix.cpp" line="+406"/> + <location filename="../src/corelib/io/qprocess_win.cpp" line="+137"/> + <source>Could not open input redirection for reading</source> + <translation>Nem sikerült megnyitni a bevitel olvasásra irányítását</translation> + </message> + <message> + <location line="+12"/> + <location filename="../src/corelib/io/qprocess_win.cpp" line="+20"/> + <source>Could not open output redirection for writing</source> + <translation>Nem sikerült megnyitni a kimenet írásra irányítását</translation> + </message> + <message> + <location line="+239"/> + <source>Resource error (fork failure): %1</source> + <translation>Erőforrás hiba (Szétágazás hiba): %1</translation> + </message> + <message> + <location line="+258"/> + <location line="+52"/> + <location line="+74"/> + <location line="+66"/> + <location filename="../src/corelib/io/qprocess_win.cpp" line="+406"/> + <location line="+50"/> + <location line="+75"/> + <location line="+42"/> + <location line="+54"/> + <source>Process operation timed out</source> + <translation>Folyamat művelet időtúllépés</translation> + </message> + <message> + <location filename="../src/corelib/io/qprocess.cpp" line="+855"/> + <location line="+52"/> + <location filename="../src/corelib/io/qprocess_win.cpp" line="-211"/> + <location line="+50"/> + <source>Error reading from process</source> + <translation>Hiba történt a folyamat olvasása közben</translation> + </message> + <message> + <location line="+47"/> + <location line="+826"/> + <location filename="../src/corelib/io/qprocess_win.cpp" line="+140"/> + <source>Error writing to process</source> + <translation>Hiba történt a folyamat írása közben</translation> + </message> + <message> + <location line="-756"/> + <source>Process crashed</source> + <translation>A folyamat összeomlott</translation> + </message> + <message> + <location line="+959"/> + <source>No program defined</source> + <translation>Nincs program definiálva</translation> + </message> + <message> + <location filename="../src/corelib/io/qprocess_win.cpp" line="-360"/> + <source>Process failed to start: %1</source> + <translation>Nem sikerült elindítani a folyamatot: %1</translation> + </message> +</context> +<context> + <name>QProgressDialog</name> + <message> + <location filename="../src/gui/dialogs/qprogressdialog.cpp" line="+196"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> +</context> +<context> + <name>QPushButton</name> + <message> + <location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="-8"/> + <source>Open</source> + <translation>Megnyitás</translation> + </message> +</context> +<context> + <name>QRadioButton</name> + <message> + <location line="+12"/> + <source>Check</source> + <translation>Ellenőrzés</translation> + </message> +</context> +<context> + <name>QRegExp</name> + <message> + <location filename="../src/corelib/tools/qregexp.cpp" line="+65"/> + <source>no error occurred</source> + <translation>nem történt hiba</translation> + </message> + <message> + <location line="+1"/> + <source>disabled feature used</source> + <translation>tiltás tulajdonság használva</translation> + </message> + <message> + <location line="+1"/> + <source>bad char class syntax</source> + <translation>rossz karakter osztály szintakszis</translation> + </message> + <message> + <location line="+1"/> + <source>bad lookahead syntax</source> + <translation>rossz előreolvasási szintakszis</translation> + </message> + <message> + <location line="+1"/> + <source>bad repetition syntax</source> + <translation>rossz ismétlési szintakszis</translation> + </message> + <message> + <location line="+1"/> + <source>invalid octal value</source> + <translation>érvénytelen oktális érték</translation> + </message> + <message> + <location line="+1"/> + <source>missing left delim</source> + <translation>hiányzó bal határolójel</translation> + </message> + <message> + <location line="+1"/> + <source>unexpected end</source> + <translation>váratlan vég</translation> + </message> + <message> + <location line="+1"/> + <source>met internal limit</source> + <translation>találkozott belső korlát</translation> + </message> + <message> + <location line="+1"/> + <source>invalid interval</source> + <translation>érvénytelen intervallum</translation> + </message> + <message> + <location line="+1"/> + <source>invalid category</source> + <translation>érvénytelen kategória</translation> + </message> +</context> +<context> + <name>QSQLite2Driver</name> + <message> + <location filename="../src/sql/drivers/sqlite2/qsql_sqlite2.cpp" line="+391"/> + <source>Error opening database</source> + <translation>Hiba történt az adatbázis megnyitása közben</translation> + </message> + <message> + <location line="+41"/> + <source>Unable to begin transaction</source> + <translation>Nem lehet elkezdeni a tranzakciót</translation> + </message> + <message> + <location line="+17"/> + <source>Unable to commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+17"/> + <source>Unable to rollback transaction</source> + <translation>Nem lehet visszagörgetni a tranzakciót</translation> + </message> +</context> +<context> + <name>QSQLite2Result</name> + <message> + <location line="-319"/> + <source>Unable to fetch results</source> + <translation>Nem lehet letölteni az eredményeket</translation> + </message> + <message> + <location line="+143"/> + <source>Unable to execute statement</source> + <translation>Nem lehet végrehajtani az állítást</translation> + </message> +</context> +<context> + <name>QSQLiteDriver</name> + <message> + <location filename="../src/sql/drivers/sqlite/qsql_sqlite.cpp" line="+540"/> + <source>Error opening database</source> + <translation>Hiba történt az adatbázis megnyitása közben</translation> + </message> + <message> + <location line="+11"/> + <source>Error closing database</source> + <translation>Hiba történt az adatbázis bezárása közben</translation> + </message> + <message> + <location line="+20"/> + <source>Unable to begin transaction</source> + <translation>Nem lehet elkezdeni a tranzakciót</translation> + </message> + <message> + <location line="+15"/> + <source>Unable to commit transaction</source> + <translation>Nem lehet kommitolni a tranzakciót</translation> + </message> + <message> + <location line="+15"/> + <source>Unable to rollback transaction</source> + <translation>Nem lehet visszagörgetni a tranzakciót</translation> + </message> +</context> +<context> + <name>QSQLiteResult</name> + <message> + <location line="-404"/> + <location line="+62"/> + <location line="+8"/> + <source>Unable to fetch row</source> + <translation>Nem lehet leszedni a sort</translation> + </message> + <message> + <location line="+59"/> + <source>Unable to execute statement</source> + <translation>Nem lehet végrehajtani az állítást</translation> + </message> + <message> + <location line="+20"/> + <source>Unable to reset statement</source> + <translation>Nem lehet visszaállítani az állítást</translation> + </message> + <message> + <location line="+45"/> + <source>Unable to bind parameters</source> + <translation>Nem lehet összekötni a paramétereket</translation> + </message> + <message> + <location line="+7"/> + <source>Parameter count mismatch</source> + <translation>A paraméter számláló nem megfelelő</translation> + </message> + <message> + <location line="-200"/> + <source>No query</source> + <translation>Nincs lekérdezés</translation> + </message> +</context> +<context> + <name>QScriptBreakpointsModel</name> + <message> + <location filename="../src/scripttools/debugging/qscriptbreakpointsmodel.cpp" line="+455"/> + <source>ID</source> + <translation>Azonosító</translation> + </message> + <message> + <location line="+2"/> + <source>Location</source> + <translation>Elhelyezkedés</translation> + </message> + <message> + <location line="+2"/> + <source>Condition</source> + <translation>Feltétel</translation> + </message> + <message> + <location line="+2"/> + <source>Ignore-count</source> + <translation>Számítás mellőzése</translation> + </message> + <message> + <location line="+2"/> + <source>Single-shot</source> + <translation>Egylövetű</translation> + </message> + <message> + <location line="+2"/> + <source>Hit-count</source> + <translation>Leütés számítás</translation> + </message> +</context> +<context> + <name>QScriptBreakpointsWidget</name> + <message> + <location filename="../src/scripttools/debugging/qscriptbreakpointswidget.cpp" line="+298"/> + <source>New</source> + <translation>Új</translation> + </message> + <message> + <location line="+6"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> +</context> +<context> + <name>QScriptDebugger</name> + <message> + <location filename="../src/scripttools/debugging/qscriptdebugger.cpp" line="+885"/> + <location line="+1013"/> + <source>Go to Line</source> + <translation>Ugrás erre a sorra</translation> + </message> + <message> + <location line="-1012"/> + <source>Line:</source> + <translation>Sor:</translation> + </message> + <message> + <location line="+791"/> + <source>Interrupt</source> + <translation>Megszakítás</translation> + </message> + <message> + <location line="+2"/> + <source>Shift+F5</source> + <translation>Shift+F5</translation> + </message> + <message> + <location line="+15"/> + <source>Continue</source> + <translation>Folytatás</translation> + </message> + <message> + <location line="+2"/> + <source>F5</source> + <translation>F5</translation> + </message> + <message> + <location line="+15"/> + <source>Step Into</source> + <translation>Belelépés</translation> + </message> + <message> + <location line="+2"/> + <source>F11</source> + <translation>F11</translation> + </message> + <message> + <location line="+15"/> + <source>Step Over</source> + <translation>Átlépés</translation> + </message> + <message> + <location line="+2"/> + <source>F10</source> + <translation>F10</translation> + </message> + <message> + <location line="+15"/> + <source>Step Out</source> + <translation>Kilép</translation> + </message> + <message> + <location line="+2"/> + <source>Shift+F11</source> + <translation>Shift+F11</translation> + </message> + <message> + <location line="+15"/> + <source>Run to Cursor</source> + <translation>Kurzorra futás</translation> + </message> + <message> + <location line="+2"/> + <source>Ctrl+F10</source> + <translation>Ctrl+F10</translation> + </message> + <message> + <location line="+16"/> + <source>Run to New Script</source> + <translation>Az új Szkriptre futás</translation> + </message> + <message> + <location line="+15"/> + <source>Toggle Breakpoint</source> + <translation>Töréspont kapcsolgatása</translation> + </message> + <message> + <location line="+1"/> + <source>F9</source> + <translation>F9</translation> + </message> + <message> + <location line="+14"/> + <source>Clear Debug Output</source> + <translation>Debug kimenet kiürítése</translation> + </message> + <message> + <location line="+13"/> + <source>Clear Error Log</source> + <translation>Error Log kiürítése</translation> + </message> + <message> + <location line="+13"/> + <source>Clear Console</source> + <translation>Konzol kiürítése</translation> + </message> + <message> + <location line="+14"/> + <source>&Find in Script...</source> + <translation>Szkriptben &keresés...</translation> + </message> + <message> + <location line="+1"/> + <source>Ctrl+F</source> + <translation>Ctrl+F</translation> + </message> + <message> + <location line="+17"/> + <source>Find &Next</source> + <translation>&Következő keresése</translation> + </message> + <message> + <location line="+2"/> + <source>F3</source> + <translation>F3</translation> + </message> + <message> + <location line="+13"/> + <source>Find &Previous</source> + <translation>&Előző keresése</translation> + </message> + <message> + <location line="+2"/> + <source>Shift+F3</source> + <translation>Shift+F3</translation> + </message> + <message> + <location line="+14"/> + <source>Ctrl+G</source> + <translation>Ctrl+G</translation> + </message> + <message> + <location line="+11"/> + <source>Debug</source> + <translation>Debug</translation> + </message> +</context> +<context> + <name>QScriptDebuggerCodeFinderWidget</name> + <message> + <location filename="../src/scripttools/debugging/qscriptdebuggercodefinderwidget.cpp" line="+141"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location line="+13"/> + <source>Previous</source> + <translation>Előző</translation> + </message> + <message> + <location line="+7"/> + <source>Next</source> + <translation>Következő</translation> + </message> + <message> + <location line="+5"/> + <source>Case Sensitive</source> + <translation>Kis és nagybetű érzékeny</translation> + </message> + <message> + <location line="+3"/> + <source>Whole words</source> + <translation>Egész szavakat</translation> + </message> + <message> + <location line="+9"/> + <source><img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Search wrapped</source> + <translation><img src=":/qt/scripttools/debugging/images/wrap.png">&nbsp;Keresés tördelve</translation> + </message> +</context> +<context> + <name>QScriptDebuggerLocalsModel</name> + <message> + <location filename="../src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp" line="+872"/> + <source>Name</source> + <translation>Név</translation> + </message> + <message> + <location line="+2"/> + <source>Value</source> + <translation>Érték</translation> + </message> +</context> +<context> + <name>QScriptDebuggerStackModel</name> + <message> + <location filename="../src/scripttools/debugging/qscriptdebuggerstackmodel.cpp" line="+161"/> + <source>Level</source> + <translation>Szint</translation> + </message> + <message> + <location line="+2"/> + <source>Name</source> + <translation>Név</translation> + </message> + <message> + <location line="+2"/> + <source>Location</source> + <translation>Elhelyezkedés</translation> + </message> +</context> +<context> + <name>QScriptEdit</name> + <message> + <location filename="../src/scripttools/debugging/qscriptedit.cpp" line="+411"/> + <source>Toggle Breakpoint</source> + <translation>Töréspont kapcsolgatása</translation> + </message> + <message> + <location line="+2"/> + <source>Disable Breakpoint</source> + <translation>Töréspont tiltása</translation> + </message> + <message> + <location line="+1"/> + <source>Enable Breakpoint</source> + <translation>Töréspont engedélyezése</translation> + </message> + <message> + <location line="+4"/> + <source>Breakpoint Condition:</source> + <translation>Töréspont feltétel:</translation> + </message> +</context> +<context> + <name>QScriptEngineDebugger</name> + <message> + <location filename="../src/scripttools/debugging/qscriptenginedebugger.cpp" line="+523"/> + <source>Loaded Scripts</source> + <translation>Betöltött szkriptek</translation> + </message> + <message> + <location line="+6"/> + <source>Breakpoints</source> + <translation>Töréspontok</translation> + </message> + <message> + <location line="+6"/> + <source>Stack</source> + <translation>Verem</translation> + </message> + <message> + <location line="+6"/> + <source>Locals</source> + <translation>Helyi változók</translation> + </message> + <message> + <location line="+6"/> + <source>Console</source> + <translation>Konzol</translation> + </message> + <message> + <location line="+6"/> + <source>Debug Output</source> + <translation>Debug kimenet</translation> + </message> + <message> + <location line="+6"/> + <source>Error Log</source> + <translation>Hiba Log</translation> + </message> + <message> + <location line="+12"/> + <source>Search</source> + <translation>Keresés</translation> + </message> + <message> + <location line="+7"/> + <source>View</source> + <translation>Nézet</translation> + </message> + <message> + <location line="+18"/> + <source>Qt Script Debugger</source> + <translation>Qt szkript debugger</translation> + </message> +</context> +<context> + <name>QScriptNewBreakpointWidget</name> + <message> + <location filename="../src/scripttools/debugging/qscriptbreakpointswidget.cpp" line="-223"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> +</context> +<context> + <name>QScrollBar</name> + <message> + <location filename="../src/gui/widgets/qscrollbar.cpp" line="+454"/> + <source>Scroll here</source> + <translation>Görgetés itt</translation> + </message> + <message> + <location line="+2"/> + <source>Left edge</source> + <translation>Bal szegély</translation> + </message> + <message> + <location line="+0"/> + <source>Top</source> + <translation>Tető</translation> + </message> + <message> + <location line="+1"/> + <source>Right edge</source> + <translation>Jobb szegély</translation> + </message> + <message> + <location line="+0"/> + <source>Bottom</source> + <translation>Alja</translation> + </message> + <message> + <location line="+2"/> + <source>Page left</source> + <translation>Lapzoás balra</translation> + </message> + <message> + <location line="+0"/> + <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+143"/> + <source>Page up</source> + <translation>Lapozás felfele</translation> + </message> + <message> + <location line="+1"/> + <source>Page right</source> + <translation>Lapozás jobbra</translation> + </message> + <message> + <location line="+0"/> + <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+4"/> + <source>Page down</source> + <translation>Lapozás lefele</translation> + </message> + <message> + <location line="+2"/> + <source>Scroll left</source> + <translation>Görgetés balra</translation> + </message> + <message> + <location line="+0"/> + <source>Scroll up</source> + <translation>Görgetés felfele</translation> + </message> + <message> + <location line="+1"/> + <source>Scroll right</source> + <translation>Görgetés jobbra</translation> + </message> + <message> + <location line="+0"/> + <source>Scroll down</source> + <translation>Görgetés lefele</translation> + </message> + <message> + <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-6"/> + <source>Line up</source> + <translation>Egy sorral feljebb</translation> + </message> + <message> + <location line="+4"/> + <source>Position</source> + <translation>Pozíció</translation> + </message> + <message> + <location line="+4"/> + <source>Line down</source> + <translation>Egy sorral lejjebb</translation> + </message> +</context> +<context> + <name>QSharedMemory</name> + <message> + <location filename="../src/corelib/kernel/qsharedmemory.cpp" line="+304"/> + <source>%1: create size is less then 0</source> + <translation>%1: 0-nál kisebb méret létrehozása</translation> + </message> + <message> + <location line="+168"/> + <location filename="../src/corelib/kernel/qsharedmemory_p.h" line="+155"/> + <source>%1: unable to lock</source> + <translation>%1: Nem lehet zárolni</translation> + </message> + <message> + <location line="+22"/> + <source>%1: unable to unlock</source> + <translation>%1: Nem lehet kinyitni</translation> + </message> + <message> + <location filename="../src/corelib/kernel/qsharedmemory_symbian.cpp" line="+83"/> + <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+79"/> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+87"/> + <source>%1: permission denied</source> + <translation>%1: engedély megtagadva</translation> + </message> + <message> + <location line="-16"/> + <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+4"/> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="-22"/> + <source>%1: already exists</source> + <translation>%1: már létezik</translation> + </message> + <message> + <location line="+4"/> + <source>%1: doesn't exists</source> + <translation>%1: nem létezik</translation> + </message> + <message> + <location line="+8"/> + <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+10"/> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+18"/> + <source>%1: out of resources</source> + <translation>%1: Kifogyott az erőforrásból</translation> + </message> + <message> + <location line="+7"/> + <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+4"/> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+7"/> + <source>%1: unknown error %2</source> + <translation>%1: ismeretlen hiba %2</translation> + </message> + <message> + <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+21"/> + <source>%1: key is empty</source> + <translation>%1: Üres kulcs</translation> + </message> + <message> + <location line="+15"/> + <source>%1: ftok failed</source> + <translation>%1: ftok hiba</translation> + </message> + <message> + <location filename="../src/corelib/kernel/qsharedmemory_symbian.cpp" line="+56"/> + <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="+51"/> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+15"/> + <source>%1: unable to make key</source> + <translation>%1: Nem lehet kulcsot csinálni</translation> + </message> + <message> + <location filename="../src/corelib/kernel/qsharedmemory_unix.cpp" line="-97"/> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="-31"/> + <source>%1: doesn't exist</source> + <translation>%1: nem létezik</translation> + </message> + <message> + <location line="+39"/> + <source>%1: UNIX key file doesn't exist</source> + <translation>%1: UNIX kulcs fájl nem létezik</translation> + </message> + <message> + <location line="+78"/> + <source>%1: system-imposed size restrictions</source> + <translation>%1: a rendszer rárakott méretének korlátozásai</translation> + </message> + <message> + <location line="+53"/> + <source>%1: not attached</source> + <translation>%1: nincs hozzácsatolva</translation> + </message> + <message> + <location filename="../src/corelib/kernel/qsharedmemory_symbian.cpp" line="-67"/> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+4"/> + <source>%1: invalid size</source> + <translation>%1: érvénytelen méret</translation> + </message> + <message> + <location line="+40"/> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+63"/> + <source>%1: key error</source> + <translation>%1: kulcs hiba</translation> + </message> + <message> + <location filename="../src/corelib/kernel/qsharedmemory_win.cpp" line="+32"/> + <source>%1: size query failed</source> + <translation>%1: méret lekérdezési hiba</translation> + </message> + <message> + <location filename="../src/corelib/kernel/qsharedmemory.cpp" line="-271"/> + <source>%1: unable to set key on lock</source> + <translation>%1: nem lehet beállítani a kulcsot a záron</translation> + </message> +</context> +<context> + <name>QShortcut</name> + <message> + <location filename="../src/gui/kernel/qkeysequence.cpp" line="+393"/> + <source>Space</source> + <translation>Space</translation> + </message> + <message> + <location line="+1"/> + <source>Esc</source> + <translation>Esc</translation> + </message> + <message> + <location line="+1"/> + <source>Tab</source> + <translation>Tab</translation> + </message> + <message> + <location line="+1"/> + <source>Backtab</source> + <translation>Backtab</translation> + </message> + <message> + <location line="+1"/> + <source>Backspace</source> + <translation>Backspace</translation> + </message> + <message> + <location line="+1"/> + <source>Return</source> + <translation>Return</translation> + </message> + <message> + <location line="+1"/> + <source>Enter</source> + <translation>Enter</translation> + </message> + <message> + <location line="+1"/> + <source>Ins</source> + <translation>Ins</translation> + </message> + <message> + <location line="+1"/> + <source>Del</source> + <translation>Del</translation> + </message> + <message> + <location line="+1"/> + <source>Pause</source> + <translation>Pause</translation> + </message> + <message> + <location line="+1"/> + <source>Print</source> + <translation>Print</translation> + </message> + <message> + <location line="+1"/> + <source>SysReq</source> + <translation>SysReq</translation> + </message> + <message> + <location line="+1"/> + <source>Home</source> + <translation>Home</translation> + </message> + <message> + <location line="+1"/> + <source>End</source> + <translation>End</translation> + </message> + <message> + <location line="+1"/> + <source>Left</source> + <translation>Left</translation> + </message> + <message> + <location line="+1"/> + <source>Up</source> + <translation>Up</translation> + </message> + <message> + <location line="+1"/> + <source>Right</source> + <translation>Right</translation> + </message> + <message> + <location line="+1"/> + <source>Down</source> + <translation>Down</translation> + </message> + <message> + <location line="+1"/> + <source>PgUp</source> + <translation>PgUp</translation> + </message> + <message> + <location line="+1"/> + <source>PgDown</source> + <translation>PgDown</translation> + </message> + <message> + <location line="+1"/> + <source>CapsLock</source> + <translation>CapsLock</translation> + </message> + <message> + <location line="+1"/> + <source>NumLock</source> + <translation>NumLock</translation> + </message> + <message> + <location line="+1"/> + <source>ScrollLock</source> + <translation>ScrollLock</translation> + </message> + <message> + <location line="+1"/> + <source>Menu</source> + <translation>Menü</translation> + </message> + <message> + <location line="+1"/> + <source>Help</source> + <translation>Súgó</translation> + </message> + <message> + <location line="+5"/> + <source>Back</source> + <translation>Vissza</translation> + </message> + <message> + <location line="+1"/> + <source>Forward</source> + <translation>Előre</translation> + </message> + <message> + <location line="+1"/> + <source>Stop</source> + <translation>Leállítás</translation> + </message> + <message> + <location line="+1"/> + <source>Refresh</source> + <translation>Felfrissítés</translation> + </message> + <message> + <location line="+1"/> + <source>Volume Down</source> + <translation>Hangerő lehalkítása</translation> + </message> + <message> + <location line="+1"/> + <source>Volume Mute</source> + <translation>Hangerő Elnémítás</translation> + </message> + <message> + <location line="+1"/> + <source>Volume Up</source> + <translation>Hangerő hangosítása</translation> + </message> + <message> + <location line="+1"/> + <source>Bass Boost</source> + <translation>Basszus erősítés</translation> + </message> + <message> + <location line="+1"/> + <source>Bass Up</source> + <translation>Basszus növelése</translation> + </message> + <message> + <location line="+1"/> + <source>Bass Down</source> + <translation>Basszus csökkentése</translation> + </message> + <message> + <location line="+1"/> + <source>Treble Up</source> + <translation>Felháromszorozás</translation> + </message> + <message> + <location line="+1"/> + <source>Treble Down</source> + <translation>Leharmadolás</translation> + </message> + <message> + <location line="+1"/> + <source>Media Play</source> + <translation>Média elindítása</translation> + </message> + <message> + <location line="+1"/> + <source>Media Stop</source> + <translation>Média leállítása</translation> + </message> + <message> + <location line="+1"/> + <source>Media Previous</source> + <translation>Előző média</translation> + </message> + <message> + <location line="+1"/> + <source>Media Next</source> + <translation>Következő média</translation> + </message> + <message> + <location line="+1"/> + <source>Media Record</source> + <translation>Média felvétel</translation> + </message> + <message> + <location line="+2"/> + <source>Favorites</source> + <translation>Kedvcencek</translation> + </message> + <message> + <location line="+1"/> + <source>Search</source> + <translation>Keresés</translation> + </message> + <message> + <location line="+1"/> + <source>Standby</source> + <translation>Készenlét</translation> + </message> + <message> + <location line="+1"/> + <source>Open URL</source> + <translation>URL megnyitása</translation> + </message> + <message> + <location line="+1"/> + <source>Launch Mail</source> + <translation>Mail indítása</translation> + </message> + <message> + <location line="+1"/> + <source>Launch Media</source> + <translation>Média indítása</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (0)</source> + <translation>Elindítás (0)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (1)</source> + <translation>Elindítás (1)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (2)</source> + <translation>Elindítás (2)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (3)</source> + <translation>Elindítás (3)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (4)</source> + <translation>Elindítás (4)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (5)</source> + <translation>Elindítás (5)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (6)</source> + <translation>Elindítás (6)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (7)</source> + <translation>Elindítás (7)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (8)</source> + <translation>Elindítás (8)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (9)</source> + <translation>Elindítás (9)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (A)</source> + <translation>Elindítás (A)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (B)</source> + <translation>Elindítás (B)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (C)</source> + <translation>Elindítás (C)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (D)</source> + <translation>Elindítás (D)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (E)</source> + <translation>Elindítás (E)</translation> + </message> + <message> + <location line="+1"/> + <source>Launch (F)</source> + <translation>Elindítás (F)</translation> + </message> + <message> + <location line="+1"/> + <source>Monitor Brightness Up</source> + <translation>Monitorfény növelése</translation> + </message> + <message> + <location line="+1"/> + <source>Monitor Brightness Down</source> + <translation>Monitorfény csökkentése</translation> + </message> + <message> + <location line="+1"/> + <source>Keyboard Light On/Off</source> + <translation>Billentyű világítás be/ki</translation> + </message> + <message> + <location line="+1"/> + <source>Keyboard Brightness Up</source> + <translation>Billentyűfény növelése</translation> + </message> + <message> + <location line="+1"/> + <source>Keyboard Brightness Down</source> + <translation>Billentyűfény csökkentése</translation> + </message> + <message> + <location line="+1"/> + <source>Power Off</source> + <translation>Kikapcsolás</translation> + </message> + <message> + <location line="+1"/> + <source>Wake Up</source> + <translation>Felébresztés</translation> + </message> + <message> + <location line="+1"/> + <source>Eject</source> + <translation>Kidobás</translation> + </message> + <message> + <location line="+1"/> + <source>Screensaver</source> + <translation>Képernyővédő</translation> + </message> + <message> + <location line="+1"/> + <source>WWW</source> + <translation>WWW</translation> + </message> + <message> + <location line="+1"/> + <source>Sleep</source> + <translation>Alvás</translation> + </message> + <message> + <location line="+1"/> + <source>LightBulb</source> + <translation>Villanykörte</translation> + </message> + <message> + <location line="+1"/> + <source>Shop</source> + <translation>Bolt</translation> + </message> + <message> + <location line="+1"/> + <source>History</source> + <translation>Történelem</translation> + </message> + <message> + <location line="+1"/> + <source>Add Favorite</source> + <translation>Hozzáadás a kedvencekhez</translation> + </message> + <message> + <location line="+1"/> + <source>Hot Links</source> + <translation>Hot linkek</translation> + </message> + <message> + <location line="+1"/> + <source>Adjust Brightness</source> + <translation>Fényszabályozás</translation> + </message> + <message> + <location line="+1"/> + <source>Finance</source> + <translation>Pénzügy</translation> + </message> + <message> + <location line="+1"/> + <source>Community</source> + <translation>Közösség</translation> + </message> + <message> + <location line="+1"/> + <source>Audio Rewind</source> + <translation>Audió áttekercselés</translation> + </message> + <message> + <location line="+1"/> + <source>Back Forward</source> + <translation>Előre hátra</translation> + </message> + <message> + <location line="+1"/> + <source>Application Left</source> + <translation>Alkalmazás balra</translation> + </message> + <message> + <location line="+1"/> + <source>Application Right</source> + <translation>Alkalmazás jobbra</translation> + </message> + <message> + <location line="+1"/> + <source>Book</source> + <translation>Könyv</translation> + </message> + <message> + <location line="+1"/> + <source>CD</source> + <translation>CD</translation> + </message> + <message> + <location line="+1"/> + <source>Calculator</source> + <translation>Számológép</translation> + </message> + <message> + <location line="+1"/> + <source>Clear</source> + <translation>Tiszta</translation> + </message> + <message> + <location line="+1"/> + <source>Clear Grab</source> + <translation>Tiszta megmarkolás</translation> + </message> + <message> + <location line="+1"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location line="+1"/> + <source>Copy</source> + <translation>Másolás</translation> + </message> + <message> + <location line="+1"/> + <source>Cut</source> + <translation>Kivágás</translation> + </message> + <message> + <location line="+1"/> + <source>Display</source> + <translation>Megjelenítés</translation> + </message> + <message> + <location line="+1"/> + <source>DOS</source> + <translation>DOS</translation> + </message> + <message> + <location line="+1"/> + <source>Documents</source> + <translation>Dokumentumok</translation> + </message> + <message> + <location line="+1"/> + <source>Spreadsheet</source> + <translation>Táblázatkezelő</translation> + </message> + <message> + <location line="+1"/> + <source>Browser</source> + <translation>Böngésző</translation> + </message> + <message> + <location line="+1"/> + <source>Game</source> + <translation>Játék</translation> + </message> + <message> + <location line="+1"/> + <source>Go</source> + <translation>Gyerünk</translation> + </message> + <message> + <location line="+1"/> + <source>iTouch</source> + <translation>iTouch</translation> + </message> + <message> + <location line="+1"/> + <source>Logoff</source> + <translation>Kijelentkezés</translation> + </message> + <message> + <location line="+1"/> + <source>Market</source> + <translation>Piac</translation> + </message> + <message> + <location line="+1"/> + <source>Meeting</source> + <translation>Találkozó</translation> + </message> + <message> + <location line="+1"/> + <source>Keyboard Menu</source> + <translation>Billlentyű menü</translation> + </message> + <message> + <location line="+1"/> + <source>Menu PB</source> + <translation>PB menü</translation> + </message> + <message> + <location line="+1"/> + <source>My Sites</source> + <translation>Oldalam</translation> + </message> + <message> + <location line="+1"/> + <source>News</source> + <translation>Hírek</translation> + </message> + <message> + <location line="+1"/> + <source>Home Office</source> + <translation>Otthoni iroda</translation> + </message> + <message> + <location line="+1"/> + <source>Option</source> + <translation>Opció</translation> + </message> + <message> + <location line="+1"/> + <source>Paste</source> + <translation>Beillesztés</translation> + </message> + <message> + <location line="+1"/> + <source>Phone</source> + <translation>Telefon</translation> + </message> + <message> + <location line="+1"/> + <source>Reply</source> + <translation>Válasz</translation> + </message> + <message> + <location line="+1"/> + <source>Reload</source> + <translation>Újratöltés</translation> + </message> + <message> + <location line="+1"/> + <source>Rotate Windows</source> + <translation>Ablakok forgatása</translation> + </message> + <message> + <location line="+1"/> + <source>Rotation PB</source> + <translation>PB forgatás</translation> + </message> + <message> + <location line="+1"/> + <source>Rotation KB</source> + <translation>KB forgatás</translation> + </message> + <message> + <location line="+1"/> + <source>Save</source> + <translation>Mentés</translation> + </message> + <message> + <location line="+1"/> + <source>Send</source> + <translation>Küldés</translation> + </message> + <message> + <location line="+1"/> + <source>Spellchecker</source> + <translation>Helyesírás ellenőrző</translation> + </message> + <message> + <location line="+1"/> + <source>Split Screen</source> + <translation>Képernyő felosztása</translation> + </message> + <message> + <location line="+1"/> + <source>Support</source> + <translation>Támogatás</translation> + </message> + <message> + <location line="+1"/> + <source>Task Panel</source> + <translation>Feladat panel</translation> + </message> + <message> + <location line="+1"/> + <source>Terminal</source> + <translation>Terminál</translation> + </message> + <message> + <location line="+1"/> + <source>Tools</source> + <translation>Eszközök</translation> + </message> + <message> + <location line="+1"/> + <source>Travel</source> + <translation>Utazás</translation> + </message> + <message> + <location line="+1"/> + <source>Video</source> + <translation>Videó</translation> + </message> + <message> + <location line="+1"/> + <source>Word Processor</source> + <translation>Szó feldolgozó</translation> + </message> + <message> + <location line="+1"/> + <source>XFer</source> + <translation>XFer</translation> + </message> + <message> + <location line="+1"/> + <source>Zoom In</source> + <translation>Nagyítás</translation> + </message> + <message> + <location line="+1"/> + <source>Zoom Out</source> + <translation>Kicsinyítés</translation> + </message> + <message> + <location line="+1"/> + <source>Away</source> + <translation>Távol</translation> + </message> + <message> + <location line="+1"/> + <source>Messenger</source> + <translation>Hírnök</translation> + </message> + <message> + <location line="+1"/> + <source>WebCam</source> + <translation>WebCam</translation> + </message> + <message> + <location line="+1"/> + <source>Mail Forward</source> + <translation>Mail továbbítása</translation> + </message> + <message> + <location line="+1"/> + <source>Pictures</source> + <translation>Képek</translation> + </message> + <message> + <location line="+1"/> + <source>Music</source> + <translation>Zene</translation> + </message> + <message> + <location line="+1"/> + <source>Battery</source> + <translation>Elem</translation> + </message> + <message> + <location line="+1"/> + <source>Bluetooth</source> + <translation>Bluetooth</translation> + </message> + <message> + <location line="+1"/> + <source>Wireless</source> + <translation>Vezeték nélküli</translation> + </message> + <message> + <location line="+1"/> + <source>Ultra Wide Band</source> + <translation>Ultra széles sáv</translation> + </message> + <message> + <location line="+1"/> + <source>Audio Forward</source> + <translation>Audio továbbítás</translation> + </message> + <message> + <location line="+1"/> + <source>Audio Repeat</source> + <translation>Audió ismétlés</translation> + </message> + <message> + <location line="+1"/> + <source>Audio Random Play</source> + <translation>Audió véletlenszerű lejátszása</translation> + </message> + <message> + <location line="+1"/> + <source>Subtitle</source> + <translation>Alcím</translation> + </message> + <message> + <location line="+1"/> + <source>Audio Cycle Track</source> + <translation>Audió ciklikus követése</translation> + </message> + <message> + <location line="+1"/> + <source>Time</source> + <translation>Idő</translation> + </message> + <message> + <location line="+2"/> + <source>View</source> + <translation>Nézet</translation> + </message> + <message> + <location line="+1"/> + <source>Top Menu</source> + <translation>Felső menü</translation> + </message> + <message> + <location line="+1"/> + <source>Suspend</source> + <translation>Felfüggesztés</translation> + </message> + <message> + <location line="+1"/> + <source>Hibernate</source> + <translation>Hibernálás</translation> + </message> + <message> + <location line="+4"/> + <source>Print Screen</source> + <translation>Képernyő másolás</translation> + </message> + <message> + <location line="+1"/> + <source>Page Up</source> + <translation>Feljebb lapozás</translation> + </message> + <message> + <location line="+1"/> + <source>Page Down</source> + <translation>Lejjebb lapozás</translation> + </message> + <message> + <location line="+1"/> + <source>Caps Lock</source> + <translation>Caps Lock</translation> + </message> + <message> + <location line="+1"/> + <source>Num Lock</source> + <translation>Num Lock</translation> + </message> + <message> + <location line="+1"/> + <source>Number Lock</source> + <translation>Number Lock</translation> + </message> + <message> + <location line="+1"/> + <source>Scroll Lock</source> + <translation>Scroll Lock</translation> + </message> + <message> + <location line="+1"/> + <source>Insert</source> + <translation>Insert</translation> + </message> + <message> + <location line="+1"/> + <source>Delete</source> + <translation>Delete</translation> + </message> + <message> + <location line="+1"/> + <source>Escape</source> + <translation>Escape</translation> + </message> + <message> + <location line="+1"/> + <source>System Request</source> + <translation>System Request</translation> + </message> + <message> + <location line="-18"/> + <location line="+22"/> + <source>Select</source> + <translation>Kiválsztás</translation> + </message> + <message> + <location line="+1"/> + <source>Yes</source> + <translation>Igen</translation> + </message> + <message> + <location line="+1"/> + <source>No</source> + <translation>Nem</translation> + </message> + <message> + <location line="+4"/> + <source>Context1</source> + <translation>Tartalom1</translation> + </message> + <message> + <location line="+1"/> + <source>Context2</source> + <translation>Tartalom2</translation> + </message> + <message> + <location line="+1"/> + <source>Context3</source> + <translation>Tartalom3</translation> + </message> + <message> + <location line="+1"/> + <source>Context4</source> + <translation>Tartalom4</translation> + </message> + <message> + <location line="+1"/> + <source>Call</source> + <translation>Hívás</translation> + </message> + <message> + <location line="+1"/> + <source>Hangup</source> + <translation>Felfüggeszt</translation> + </message> + <message> + <location line="+1"/> + <source>Flip</source> + <translation>Feldobás</translation> + </message> + <message> + <location line="+573"/> + <location line="+135"/> + <source>Ctrl</source> + <translation>Ctrl</translation> + </message> + <message> + <location line="-134"/> + <location line="+138"/> + <source>Shift</source> + <translation>Shift</translation> + </message> + <message> + <location line="-137"/> + <location line="+135"/> + <source>Alt</source> + <translation>Alt</translation> + </message> + <message> + <location line="-134"/> + <location line="+130"/> + <source>Meta</source> + <translation>Meta</translation> + </message> + <message> + <location line="-40"/> + <source>+</source> + <translation>+</translation> + </message> + <message> + <location line="+61"/> + <source>F%1</source> + <translation>F%1</translation> + </message> + <message> + <location line="-869"/> + <source>Home Page</source> + <translation>Honlap</translation> + </message> +</context> +<context> + <name>QSlider</name> + <message> + <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="+151"/> + <source>Page left</source> + <translation>Lapozás balra</translation> + </message> + <message> + <location line="+0"/> + <source>Page up</source> + <translation>Lapozás felfele</translation> + </message> + <message> + <location line="+2"/> + <source>Position</source> + <translation>Pozíció</translation> + </message> + <message> + <location line="+3"/> + <source>Page right</source> + <translation>Lapozás jobbra</translation> + </message> + <message> + <location line="+0"/> + <source>Page down</source> + <translation>Lapozás lefele</translation> + </message> +</context> +<context> + <name>QSocks5SocketEngine</name> + <message> + <location filename="../src/network/socket/qsocks5socketengine.cpp" line="-67"/> + <source>Connection to proxy refused</source> + <translation>Proxyhoz kapcsolódás elutasítva</translation> + </message> + <message> + <location line="+4"/> + <source>Connection to proxy closed prematurely</source> + <translation>A proxyhoz való csatlakozás túl korán be lett zárva</translation> + </message> + <message> + <location line="+4"/> + <source>Proxy host not found</source> + <translation>Proxy hoszt nem található</translation> + </message> + <message> + <location line="+5"/> + <source>Connection to proxy timed out</source> + <translation>Proxyhoz való csatlakozásnál időtúllépés történt</translation> + </message> + <message> + <location line="+17"/> + <source>Proxy authentication failed</source> + <translation>Proxy hitelesítési hiba</translation> + </message> + <message> + <location line="+1"/> + <source>Proxy authentication failed: %1</source> + <translation>Proxy hitelesítési hiba: %1</translation> + </message> + <message> + <location line="+9"/> + <source>SOCKS version 5 protocol error</source> + <translation>SOCKS verzió 5-s protokoll hiba</translation> + </message> + <message> + <location line="+19"/> + <source>General SOCKSv5 server failure</source> + <translation>Általános SOCKSv5 szerver hiba</translation> + </message> + <message> + <location line="+4"/> + <source>Connection not allowed by SOCKSv5 server</source> + <translation>A csatlakozást nem engedi a SOCKSv5 szerver</translation> + </message> + <message> + <location line="+16"/> + <source>TTL expired</source> + <translation>Lejárt a TTL</translation> + </message> + <message> + <location line="+4"/> + <source>SOCKSv5 command not supported</source> + <translation>SOCKSv5 parancs nincs támogatva</translation> + </message> + <message> + <location line="+4"/> + <source>Address type not supported</source> + <translation>Cím típus nincs támogatva</translation> + </message> + <message> + <location line="+5"/> + <source>Unknown SOCKSv5 proxy error code 0x%1</source> + <translation>Ismeretlen SOCKSv5 proxy hiba kód 0x%1</translation> + </message> + <message> + <location line="+689"/> + <source>Network operation timed out</source> + <translation>Hálózat műveleti időtúllépés</translation> + </message> +</context> +<context> + <name>QSoftKeyManager</name> + <message> + <location filename="../src/gui/kernel/qsoftkeymanager.cpp" line="+79"/> + <source>Ok</source> + <translation>Ok</translation> + </message> + <message> + <location line="+3"/> + <source>Select</source> + <translation>Kiválasztás</translation> + </message> + <message> + <location line="+3"/> + <source>Done</source> + <translation>Kész</translation> + </message> + <message> + <location line="+3"/> + <source>Options</source> + <translation>Opciók</translation> + </message> + <message> + <location line="+3"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location line="+172"/> + <source>Exit</source> + <translation>Kilépés</translation> + </message> +</context> +<context> + <name>QSpinBox</name> + <message> + <location filename="../src/plugins/accessible/widgets/rangecontrols.cpp" line="-574"/> + <source>More</source> + <translation>Több</translation> + </message> + <message> + <location line="+2"/> + <source>Less</source> + <translation>Kevés</translation> + </message> +</context> +<context> + <name>QSql</name> + <message> + <location filename="../src/qt3support/sql/q3sqlmanager_p.cpp" line="+890"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> + <message> + <location line="+1"/> + <source>Delete this record?</source> + <translation>Törölni szeretné ezt a felvételt?</translation> + </message> + <message> + <location line="+1"/> + <location line="+16"/> + <location line="+36"/> + <source>Yes</source> + <translation>Igen</translation> + </message> + <message> + <location line="-51"/> + <location line="+16"/> + <location line="+36"/> + <source>No</source> + <translation>Nem</translation> + </message> + <message> + <location line="-44"/> + <source>Insert</source> + <translation>Beszúrás</translation> + </message> + <message> + <location line="+2"/> + <source>Update</source> + <translation>Frissítés</translation> + </message> + <message> + <location line="+4"/> + <source>Save edits?</source> + <translation>Szerkesztések mentése?</translation> + </message> + <message> + <location line="+3"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location line="+32"/> + <source>Confirm</source> + <translation>Megerősítés</translation> + </message> + <message> + <location line="+1"/> + <source>Cancel your edits?</source> + <translation>Szerkesztések visszavonása?</translation> + </message> +</context> +<context> + <name>QSslSocket</name> + <message> + <location filename="../src/network/ssl/qsslsocket_openssl.cpp" line="+546"/> + <source>Unable to write data: %1</source> + <translation>Nem lehet adatot írni: %1</translation> + </message> + <message> + <location line="+119"/> + <source>Error while reading: %1</source> + <translation>Hiba történt olvasás közben: %1</translation> + </message> + <message> + <location line="+96"/> + <source>Error during SSL handshake: %1</source> + <translation>Hiba történt az SSL kézfogás közben: %1</translation> + </message> + <message> + <location line="-501"/> + <source>Error creating SSL context (%1)</source> + <translation>Hiba történt az SSL összefüggés (%1) létrehozása közben</translation> + </message> + <message> + <location line="+25"/> + <source>Invalid or empty cipher list (%1)</source> + <translation>Érvénytelen vagy üres számjegy lista (%1)</translation> + </message> + <message> + <location line="+42"/> + <source>Private key does not certify public key, %1</source> + <translation>A privát kulcs nem igazolja a publikus kulcsot, %1</translation> + </message> + <message> + <location line="+20"/> + <source>Error creating SSL session, %1</source> + <translation>Hiba történt az SSL szakasz létrehozása közben, %1</translation> + </message> + <message> + <location line="+15"/> + <source>Error creating SSL session: %1</source> + <translation>Hiba történt az SSL szakasz létrehozása közben: %1</translation> + </message> + <message> + <location line="-61"/> + <source>Cannot provide a certificate with no key, %1</source> + <translation>Nem lehet biztosítani egy igazolást kulcs nélkül, %1</translation> + </message> + <message> + <location line="+7"/> + <source>Error loading local certificate, %1</source> + <translation>Hiba történt a helyi igazolás betöltése közben, %1</translation> + </message> + <message> + <location line="+12"/> + <source>Error loading private key, %1</source> + <translation>Hiba történt a privát kulcs betöltése közben, %1</translation> + </message> + <message> + <location filename="../src/network/ssl/qsslerror.cpp" line="+213"/> + <source>No error</source> + <translation>Nincs hiba</translation> + </message> + <message> + <location line="+3"/> + <source>The issuer certificate could not be found</source> + <translation>A problémás igazolás nem található</translation> + </message> + <message> + <location line="+3"/> + <source>The certificate signature could not be decrypted</source> + <translation>Az igazolás aláírás titkosítását nem sikerült feloldani</translation> + </message> + <message> + <location line="+3"/> + <source>The public key in the certificate could not be read</source> + <translation>Az igazolásban található publikus kulcsot nem sikerült olvasni</translation> + </message> + <message> + <location line="+3"/> + <source>The signature of the certificate is invalid</source> + <translation>Az igazolás aláírása érvénytelen</translation> + </message> + <message> + <location line="+3"/> + <source>The certificate is not yet valid</source> + <translation>Az igazolás még nem érvényes</translation> + </message> + <message> + <location line="+3"/> + <source>The certificate has expired</source> + <translation>Az igazolás lejárt</translation> + </message> + <message> + <location line="+3"/> + <source>The certificate's notBefore field contains an invalid time</source> + <translation>A mező érvénytelen idő tartalmazása előtt nincsen igazolás</translation> + </message> + <message> + <location line="+3"/> + <source>The certificate's notAfter field contains an invalid time</source> + <translation>A mező érvénytelen idő tartalmazása után nincsen igazolás</translation> + </message> + <message> + <location line="+3"/> + <source>The certificate is self-signed, and untrusted</source> + <translation>Az igazolás ön jelölt, és megbízhatatlan</translation> + </message> + <message> + <location line="+3"/> + <source>The root certificate of the certificate chain is self-signed, and untrusted</source> + <translation>Az igazolás lánc rendszergazda igazolása ön jelölt és megbízhatatlan</translation> + </message> + <message> + <location line="+3"/> + <source>The issuer certificate of a locally looked up certificate could not be found</source> + <translation>Egy helyileg utánanézett igazolás problémás igazolása nem található</translation> + </message> + <message> + <location line="+3"/> + <source>No certificates could be verified</source> + <translation>Nem sikerült igazolást leellenőrizni</translation> + </message> + <message> + <location line="+3"/> + <source>One of the CA certificates is invalid</source> + <translation>A CA igazolások egyike érvénytelen</translation> + </message> + <message> + <location line="+3"/> + <source>The basicConstraints path length parameter has been exceeded</source> + <translation>Az alap megszorítási útvonal hossz paramétereket meghaladták</translation> + </message> + <message> + <location line="+3"/> + <source>The supplied certificate is unsuitable for this purpose</source> + <translation>A szolgáltatott igazolás nem alkalmas erre a célra</translation> + </message> + <message> + <location line="+3"/> + <source>The root CA certificate is not trusted for this purpose</source> + <translation>A rendszergazda CA igazolás nem megbízható erre a célra</translation> + </message> + <message> + <location line="+3"/> + <source>The root CA certificate is marked to reject the specified purpose</source> + <translation>A rendszergazda CA igazolás a specializást cél megtagadására lett megjelölve</translation> + </message> + <message> + <location line="+3"/> + <source>The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate</source> + <translation>Az aktuális jelölt problémás igazolása meg lett tagadva, mert a téma neve nem egyezett az aktuális igazolás problémás nevével</translation> + </message> + <message> + <location line="+4"/> + <source>The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate</source> + <translation>Az aktuális jelölt problémás igazolása el lett utasítva, mert a problémás név és sorszám benyűjtva és nem egyezett az aktuális igazolás hitelesítési kulcs azonosítójával</translation> + </message> + <message> + <location line="+5"/> + <source>The peer did not present any certificate</source> + <translation>A kortárs nem nyújtott be egyetlen igazolást sem</translation> + </message> + <message> + <location line="+3"/> + <source>The host name did not match any of the valid hosts for this certificate</source> + <translation>A hoszt név nem egyezik egyetlen érvényes hoszttal sem erre az igazolásra</translation> + </message> + <message> + <location line="+6"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> +</context> +<context> + <name>QStateMachine</name> + <message> + <location filename="../src/corelib/statemachine/qstatemachine.cpp" line="+1028"/> + <source>Missing initial state in compound state '%1'</source> + <translation>Hiányzó kezdeti állapot összetett helyzetben '%1'</translation> + </message> + <message> + <location line="+7"/> + <source>Missing default state in history state '%1'</source> + <translation>Hiányzó alapértelmezett állapot a történelmi állapotokban '%1'</translation> + </message> + <message> + <location line="+7"/> + <source>No common ancestor for targets and source of transition from state '%1'</source> + <translation>Nincs közös őse az átmeneti céloknak és forrásnak a(z) '%1' helyzetből</translation> + </message> + <message> + <location line="+4"/> + <source>Unknown error</source> + <translation>Ismeretlen hiba</translation> + </message> +</context> +<context> + <name>QSystemSemaphore</name> + <message> + <location filename="../src/corelib/kernel/qsystemsemaphore_unix.cpp" line="-46"/> + <source>%1: does not exist</source> + <translation>%1 : nem létezik</translation> + </message> + <message> + <location line="+5"/> + <location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+66"/> + <source>%1: out of resources</source> + <translation>%1: kifogyott az erőforrásból</translation> + </message> + <message> + <location line="-13"/> + <location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+4"/> + <source>%1: permission denied</source> + <translation>%1: Engedély megtagadva</translation> + </message> + <message> + <location line="+4"/> + <source>%1: already exists</source> + <translation>%1: már létezik</translation> + </message> + <message> + <location line="+13"/> + <location filename="../src/corelib/kernel/qsystemsemaphore_win.cpp" line="+3"/> + <source>%1: unknown error %2</source> + <translation>%1: ismeretlen hiba %2</translation> + </message> +</context> +<context> + <name>QTDSDriver</name> + <message> + <location filename="../src/sql/drivers/tds/qsql_tds.cpp" line="+595"/> + <source>Unable to open connection</source> + <translation>Nem lehet megnyitni a kapcsolatot</translation> + </message> + <message> + <location line="+5"/> + <source>Unable to use database</source> + <translation>Nem lehet az adatbázist használni</translation> + </message> +</context> +<context> + <name>QTabBar</name> + <message> + <location filename="../src/plugins/accessible/widgets/complexwidgets.cpp" line="-326"/> + <source>Scroll Left</source> + <translation>Görgetés balra</translation> + </message> + <message> + <location line="+0"/> + <source>Scroll Right</source> + <translation>Görgetésre jobbra</translation> + </message> +</context> +<context> + <name>QTcpServer</name> + <message> + <location filename="../src/network/socket/qtcpserver.cpp" line="+282"/> + <source>Operation on socket is not supported</source> + <translation>A socketen végzett művelet nem támogatott</translation> + </message> +</context> +<context> + <name>QTextControl</name> + <message> + <location filename="../src/gui/text/qtextcontrol.cpp" line="+2024"/> + <source>&Undo</source> + <translation>&Visszavonás</translation> + </message> + <message> + <location line="+2"/> + <source>&Redo</source> + <translation>&Megismétlés</translation> + </message> + <message> + <location line="+4"/> + <source>Cu&t</source> + <translation>&Kivágás</translation> + </message> + <message> + <location line="+5"/> + <source>&Copy</source> + <translation>&Másolás</translation> + </message> + <message> + <location line="+7"/> + <source>Copy &Link Location</source> + <translation>&Link címének másolása</translation> + </message> + <message> + <location line="+6"/> + <source>&Paste</source> + <translation>&Beillesztés</translation> + </message> + <message> + <location line="+3"/> + <source>Delete</source> + <translation>Törlés</translation> + </message> + <message> + <location line="+7"/> + <source>Select All</source> + <translation>Az összes kiválasztása</translation> + </message> +</context> +<context> + <name>QToolButton</name> + <message> + <location filename="../src/plugins/accessible/widgets/simplewidgets.cpp" line="+310"/> + <location line="+6"/> + <source>Press</source> + <translation>Megnyomás</translation> + </message> + <message> + <location line="-4"/> + <location line="+8"/> + <source>Open</source> + <translation>Megnyitás</translation> + </message> +</context> +<context> + <name>QUdpSocket</name> + <message> + <location filename="../src/network/socket/qudpsocket.cpp" line="+179"/> + <source>This platform does not support IPv6</source> + <translation>Ez a platform nem támogatja az IPv6-t</translation> + </message> +</context> +<context> + <name>QUndoGroup</name> + <message> + <location filename="../src/gui/util/qundogroup.cpp" line="+385"/> + <source>Undo</source> + <translation>Visszavonás</translation> + </message> + <message> + <location line="+28"/> + <source>Redo</source> + <translation>Megismétlés</translation> + </message> +</context> +<context> + <name>QUndoModel</name> + <message> + <location filename="../src/gui/util/qundoview.cpp" line="+101"/> + <source><empty></source> + <translation><üres></translation> + </message> +</context> +<context> + <name>QUndoStack</name> + <message> + <location filename="../src/gui/util/qundostack.cpp" line="+832"/> + <source>Undo</source> + <translation>Visszavonás</translation> + </message> + <message> + <location line="+27"/> + <source>Redo</source> + <translation>Megismétlés</translation> + </message> +</context> +<context> + <name>QUnicodeControlCharacterMenu</name> + <message> + <location filename="../src/gui/text/qtextcontrol.cpp" line="+899"/> + <source>LRM Left-to-right mark</source> + <translation>LRM balról jobbra jelölés</translation> + </message> + <message> + <location line="+1"/> + <source>RLM Right-to-left mark</source> + <translation>RLM jobbról balra jelölés</translation> + </message> + <message> + <location line="+1"/> + <source>ZWJ Zero width joiner</source> + <translation>ZWJ Nulla szélességű asztalos</translation> + </message> + <message> + <location line="+1"/> + <source>ZWNJ Zero width non-joiner</source> + <translation>ZWNJ Nulla szélességű nem asztalos</translation> + </message> + <message> + <location line="+1"/> + <source>ZWSP Zero width space</source> + <translation>ZWSP Nulla szélességű hely</translation> + </message> + <message> + <location line="+1"/> + <source>LRE Start of left-to-right embedding</source> + <translation>LRE Balról jobbra beágyazás kezdete</translation> + </message> + <message> + <location line="+1"/> + <source>RLE Start of right-to-left embedding</source> + <translation>RLE Jobbról balra beágyazás kezdete</translation> + </message> + <message> + <location line="+1"/> + <source>LRO Start of left-to-right override</source> + <translation>LRO Balról jobbra megsemmisítés kezdete</translation> + </message> + <message> + <location line="+1"/> + <source>RLO Start of right-to-left override</source> + <translation>RLO Jobbról balra megsemmisítés kezdete</translation> + </message> + <message> + <location line="+1"/> + <source>PDF Pop directional formatting</source> + <translation>PDF Kérirányú formázás benézése</translation> + </message> + <message> + <location line="+6"/> + <source>Insert Unicode control character</source> + <translation>Unicode vezérlő karakter beszúrása</translation> + </message> +</context> +<context> + <name>QWebFrame</name> + <message> + <location filename="../src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp" line="+712"/> + <source>Request cancelled</source> + <translation>Kérés visszavonva</translation> + </message> + <message> + <location line="+19"/> + <source>Request blocked</source> + <translation>Kérés blokkolva</translation> + </message> + <message> + <location line="+7"/> + <source>Cannot show URL</source> + <translation>Nem lehet megjeleníteni az URL-t</translation> + </message> + <message> + <location line="+6"/> + <source>Frame load interrupted by policy change</source> + <translation>Irányvonal megváltozása miatt a szerkezet töltése megszakítva</translation> + </message> + <message> + <location line="+6"/> + <source>Cannot show mimetype</source> + <translation>Nem lehet megjeleníteni mime típust</translation> + </message> + <message> + <location line="+6"/> + <source>File does not exist</source> + <translation>A fájl nem létezik</translation> + </message> +</context> +<context> + <name>QWebPage</name> + <message> + <location filename="../src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp" line="+42"/> + <source>Submit</source> + <comment>default label for Submit buttons in forms on web pages</comment> + <translation>Feltöltés</translation> + </message> + <message> + <location line="+5"/> + <source>Submit</source> + <comment>Submit (input element) alt text for <input> elements with no alt, title, or value</comment> + <translation>Feltöltés</translation> + </message> + <message> + <location line="+5"/> + <source>Reset</source> + <comment>default label for Reset buttons in forms on web pages</comment> + <translation>Helyreállítás</translation> + </message> + <message> + <location line="+16"/> + <source>Choose File</source> + <comment>title for file button used in HTML forms</comment> + <translation>Fájl kiválasztása</translation> + </message> + <message> + <location line="+5"/> + <source>No file selected</source> + <comment>text to display in file button used in HTML forms when no file is selected</comment> + <translation>Nincsen egyetlen fájl sem kiválasztva</translation> + </message> + <message> + <location line="+5"/> + <source>Open in New Window</source> + <comment>Open in New Window context menu item</comment> + <translation>Megnyitás új ablakban</translation> + </message> + <message> + <location line="+5"/> + <source>Save Link...</source> + <comment>Download Linked File context menu item</comment> + <translation>Link mentése...</translation> + </message> + <message> + <location line="+5"/> + <source>Copy Link</source> + <comment>Copy Link context menu item</comment> + <translation>Link másolása</translation> + </message> + <message> + <location line="+5"/> + <source>Open Image</source> + <comment>Open Image in New Window context menu item</comment> + <translation>Kép megnyitása</translation> + </message> + <message> + <location line="+5"/> + <source>Save Image</source> + <comment>Download Image context menu item</comment> + <translation>Kép elmentése</translation> + </message> + <message> + <location line="+5"/> + <source>Copy Image</source> + <comment>Copy Link context menu item</comment> + <translation>Kép másolása</translation> + </message> + <message> + <location line="+5"/> + <source>Open Frame</source> + <comment>Open Frame in New Window context menu item</comment> + <translation>Szerkezet megnyitása</translation> + </message> + <message> + <location line="+5"/> + <source>Copy</source> + <comment>Copy context menu item</comment> + <translation>Másolás</translation> + </message> + <message> + <location line="+5"/> + <source>Go Back</source> + <comment>Back context menu item</comment> + <translation>Menj vissza</translation> + </message> + <message> + <location line="+5"/> + <source>Go Forward</source> + <comment>Forward context menu item</comment> + <translation>Menj előre</translation> + </message> + <message> + <location line="+5"/> + <source>Stop</source> + <comment>Stop context menu item</comment> + <translation>Leállítás</translation> + </message> + <message> + <location line="+5"/> + <source>Reload</source> + <comment>Reload context menu item</comment> + <translation>Újratöltés</translation> + </message> + <message> + <location line="+5"/> + <source>Cut</source> + <comment>Cut context menu item</comment> + <translation>Kivágás</translation> + </message> + <message> + <location line="+5"/> + <source>Paste</source> + <comment>Paste context menu item</comment> + <translation>Beillesztés</translation> + </message> + <message> + <location line="+5"/> + <source>No Guesses Found</source> + <comment>No Guesses Found context menu item</comment> + <translation>Nincs feltételezések találata</translation> + </message> + <message> + <location line="+5"/> + <source>Ignore</source> + <comment>Ignore Spelling context menu item</comment> + <translation>Mellőzés</translation> + </message> + <message> + <location line="+5"/> + <source>Add To Dictionary</source> + <comment>Learn Spelling context menu item</comment> + <translation>Hozzáadás a szótárhoz</translation> + </message> + <message> + <location line="+5"/> + <source>Search The Web</source> + <comment>Search The Web context menu item</comment> + <translation>Keresés a weben</translation> + </message> + <message> + <location line="+5"/> + <source>Look Up In Dictionary</source> + <comment>Look Up in Dictionary context menu item</comment> + <translation>Utánanézés szótárban</translation> + </message> + <message> + <location line="+5"/> + <source>Open Link</source> + <comment>Open Link context menu item</comment> + <translation>Link megnyitása</translation> + </message> + <message> + <location line="+5"/> + <source>Ignore</source> + <comment>Ignore Grammar context menu item</comment> + <translation>Mellőzés</translation> + </message> + <message> + <location line="+5"/> + <source>Spelling</source> + <comment>Spelling and Grammar context sub-menu item</comment> + <translation>Helyesírás</translation> + </message> + <message> + <location line="+5"/> + <source>Show Spelling and Grammar</source> + <comment>menu item title</comment> + <translation>Helyesírás és nyelvtan megjelenítése</translation> + </message> + <message> + <location line="+1"/> + <source>Hide Spelling and Grammar</source> + <comment>menu item title</comment> + <translation>Helyesírás és nyelvtan elrejtése</translation> + </message> + <message> + <location line="+5"/> + <source>Check Spelling</source> + <comment>Check spelling context menu item</comment> + <translation>Helyesírás ellenőrzés</translation> + </message> + <message> + <location line="+5"/> + <source>Check Spelling While Typing</source> + <comment>Check spelling while typing context menu item</comment> + <translation>Helyesírás ellenőrzés gépelés közben</translation> + </message> + <message> + <location line="+5"/> + <source>Check Grammar With Spelling</source> + <comment>Check grammar with spelling context menu item</comment> + <translation>Nyelvtani ellenőrzés helyesírás ellenőrzéssel</translation> + </message> + <message> + <location line="+5"/> + <source>Fonts</source> + <comment>Font context sub-menu item</comment> + <translation>Betű</translation> + </message> + <message> + <location line="+5"/> + <source>Bold</source> + <comment>Bold context menu item</comment> + <translation>Félkövér</translation> + </message> + <message> + <location line="+5"/> + <source>Italic</source> + <comment>Italic context menu item</comment> + <translation>Dőlt</translation> + </message> + <message> + <location line="+5"/> + <source>Underline</source> + <comment>Underline context menu item</comment> + <translation>Aláhúzás</translation> + </message> + <message> + <location line="+5"/> + <source>Outline</source> + <comment>Outline context menu item</comment> + <translation>Kontúrozás</translation> + </message> + <message> + <location line="+5"/> + <source>Direction</source> + <comment>Writing direction context sub-menu item</comment> + <translation>Irány összefüggések írás, menü elem</translation> + </message> + <message> + <location line="+5"/> + <source>Text Direction</source> + <comment>Text direction context sub-menu item</comment> + <translation>Szöveg irány</translation> + </message> + <message> + <location line="+5"/> + <source>Default</source> + <comment>Default writing direction context menu item</comment> + <translation>Alapértelmezett</translation> + </message> + <message> + <location line="+5"/> + <source>Left to Right</source> + <comment>Left to Right context menu item</comment> + <translation>Balról jobbra</translation> + </message> + <message> + <location line="+5"/> + <source>Right to Left</source> + <comment>Right to Left context menu item</comment> + <translation>Jobbról balra</translation> + </message> + <message> + <location line="+105"/> + <source>Loading...</source> + <comment>Media controller status message when the media is loading</comment> + <translation>Betöltés...</translation> + </message> + <message> + <location line="+5"/> + <source>Live Broadcast</source> + <comment>Media controller status message when watching a live broadcast</comment> + <translation>Élő bejelentés</translation> + </message> + <message> + <location line="+8"/> + <source>Audio Element</source> + <comment>Media controller element</comment> + <translation>Audió elem</translation> + </message> + <message> + <location line="+2"/> + <source>Video Element</source> + <comment>Media controller element</comment> + <translation>Videó elem</translation> + </message> + <message> + <location line="+2"/> + <source>Mute Button</source> + <comment>Media controller element</comment> + <translation>Elnémítás gomb</translation> + </message> + <message> + <location line="+2"/> + <source>Unmute Button</source> + <comment>Media controller element</comment> + <translation>Elnémítás megszűntetése gomb</translation> + </message> + <message> + <location line="+2"/> + <source>Play Button</source> + <comment>Media controller element</comment> + <translation>Lejátszás gomb</translation> + </message> + <message> + <location line="+2"/> + <source>Pause Button</source> + <comment>Media controller element</comment> + <translation>Szünet gomb</translation> + </message> + <message> + <location line="+2"/> + <source>Slider</source> + <comment>Media controller element</comment> + <translation>Csúszka</translation> + </message> + <message> + <location line="+2"/> + <source>Slider Thumb</source> + <comment>Media controller element</comment> + <translation>Csuszka ujj</translation> + </message> + <message> + <location line="+2"/> + <source>Rewind Button</source> + <comment>Media controller element</comment> + <translation>Áttekercselés gomb</translation> + </message> + <message> + <location line="+2"/> + <source>Return to Real-time Button</source> + <comment>Media controller element</comment> + <translation>A valós idejűre visszatérés gomb</translation> + </message> + <message> + <location line="+2"/> + <source>Elapsed Time</source> + <comment>Media controller element</comment> + <translation>Eltelt idő</translation> + </message> + <message> + <location line="+2"/> + <source>Remaining Time</source> + <comment>Media controller element</comment> + <translation>Fennmaradó idő</translation> + </message> + <message> + <location line="+2"/> + <source>Status Display</source> + <comment>Media controller element</comment> + <translation>Státusz kijelzés</translation> + </message> + <message> + <location line="+2"/> + <source>Fullscreen Button</source> + <comment>Media controller element</comment> + <translation>Teljes képernyő gomb</translation> + </message> + <message> + <location line="+2"/> + <source>Seek Forward Button</source> + <comment>Media controller element</comment> + <translation>Keresés továbbítása gomb</translation> + </message> + <message> + <location line="+2"/> + <source>Seek Back Button</source> + <comment>Media controller element</comment> + <translation>Keresés visszafele gomb</translation> + </message> + <message> + <location line="+8"/> + <source>Audio element playback controls and status display</source> + <comment>Media controller element</comment> + <translation>Audió elem visszajátszás vezérlők és státusz kijelzés</translation> + </message> + <message> + <location line="+2"/> + <source>Video element playback controls and status display</source> + <comment>Media controller element</comment> + <translation>Videó elem visszajátszás vezérlők és státusz kijelzés</translation> + </message> + <message> + <location line="+2"/> + <source>Mute audio tracks</source> + <comment>Media controller element</comment> + <translation>Audió számok elnémítása</translation> + </message> + <message> + <location line="+2"/> + <source>Unmute audio tracks</source> + <comment>Media controller element</comment> + <translation>Audió számok elnémításának megszűntetése</translation> + </message> + <message> + <location line="+2"/> + <source>Begin playback</source> + <comment>Media controller element</comment> + <translation>Visszajátszás megkezdése</translation> + </message> + <message> + <location line="+2"/> + <source>Pause playback</source> + <comment>Media controller element</comment> + <translation>Visszajátszás szüneteltetése</translation> + </message> + <message> + <location line="+2"/> + <source>Movie time scrubber</source> + <comment>Media controller element</comment> + <translation>Film idő súroló</translation> + </message> + <message> + <location line="+2"/> + <source>Movie time scrubber thumb</source> + <comment>Media controller element</comment> + <translation>Film idő súrolókörte</translation> + </message> + <message> + <location line="+2"/> + <source>Rewind movie</source> + <comment>Media controller element</comment> + <translation>Film visszatekerése</translation> + </message> + <message> + <location line="+2"/> + <source>Return streaming movie to real-time</source> + <comment>Media controller element</comment> + <translation>Özönlő filmek visszaadása a valós idő számára</translation> + </message> + <message> + <location line="+2"/> + <source>Current movie time</source> + <comment>Media controller element</comment> + <translation>Az aktuális filmidő</translation> + </message> + <message> + <location line="+2"/> + <source>Remaining movie time</source> + <comment>Media controller element</comment> + <translation>Fennmaradó filmidő</translation> + </message> + <message> + <location line="+2"/> + <source>Current movie status</source> + <comment>Media controller element</comment> + <translation>Az aktuális film státusz</translation> + </message> + <message> + <location line="+2"/> + <source>Play movie in full-screen mode</source> + <comment>Media controller element</comment> + <translation>Film lejátszása teljes képernyős módban</translation> + </message> + <message> + <location line="+2"/> + <source>Seek quickly back</source> + <comment>Media controller element</comment> + <translation>Gyorsan visszafele keresés</translation> + </message> + <message> + <location line="+2"/> + <source>Seek quickly forward</source> + <comment>Media controller element</comment> + <translation>Gyorsan előre keresés</translation> + </message> + <message> + <location line="+9"/> + <source>Indefinite time</source> + <comment>Media time description</comment> + <translation>Bizonytalan idő</translation> + </message> + <message> + <location line="+9"/> + <source>%1 days %2 hours %3 minutes %4 seconds</source> + <comment>Media time description</comment> + <translation>%1 nap %2 óra %3 perc %4 másodperc</translation> + </message> + <message> + <location line="+4"/> + <source>%1 hours %2 minutes %3 seconds</source> + <comment>Media time description</comment> + <translation>%1 óra %2 perc %3 másodperc</translation> + </message> + <message> + <location line="+4"/> + <source>%1 minutes %2 seconds</source> + <comment>Media time description</comment> + <translation>%1 perc %2 másodperc</translation> + </message> + <message> + <location line="+3"/> + <source>%1 seconds</source> + <comment>Media time description</comment> + <translation>%1 másodperc</translation> + </message> + <message> + <location line="-210"/> + <source>Inspect</source> + <comment>Inspect Element context menu item</comment> + <translation>Megtekintés</translation> + </message> + <message> + <location line="+5"/> + <source>No recent searches</source> + <comment>Label for only item in menu that appears when clicking on the search field image, when no searches have been performed</comment> + <translation>Nincsenek utóbbi keresések</translation> + </message> + <message> + <location line="+5"/> + <source>Recent searches</source> + <comment>label for first item in the menu that appears when clicking on the search field image, used as embedded menu title</comment> + <translation>Utóbbi keresések</translation> + </message> + <message> + <location line="+5"/> + <source>Clear recent searches</source> + <comment>menu item in Recent Searches menu that empties menu's contents</comment> + <translation>Utóbbi keresések kiürítése</translation> + </message> + <message> + <location line="+75"/> + <source>Unknown</source> + <comment>Unknown filesize FTP directory listing item</comment> + <translation>Ismeretlen</translation> + </message> + <message> + <location filename="../src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp" line="+167"/> + <source>Web Inspector - %2</source> + <translation>Web felügyelő - %2</translation> + </message> + <message> + <location filename="../src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp" line="+5"/> + <source>%1 (%2x%3 pixels)</source> + <comment>Title string for images</comment> + <translation>%1 (%2x%3 pixelek)</translation> + </message> + <message> + <location filename="../src/3rdparty/webkit/WebCore/platform/network/qt/QNetworkReplyHandler.cpp" line="+412"/> + <source>Bad HTTP request</source> + <translation>Érvénytelen HTTP kérés</translation> + </message> + <message> + <location filename="../src/3rdparty/webkit/WebCore/platform/qt/Localizations.cpp" line="-291"/> + <source>This is a searchable index. Enter search keywords: </source> + <comment>text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'</comment> + <translation>Ez egy kereshető index. Gépelje be a kívánt kulcsszavakat:</translation> + </message> + <message> + <location filename="../src/3rdparty/webkit/WebCore/platform/qt/ScrollbarQt.cpp" line="+58"/> + <source>Scroll here</source> + <translation>Görgetés ide</translation> + </message> + <message> + <location line="+3"/> + <source>Left edge</source> + <translation>Bal szegély</translation> + </message> + <message> + <location line="+0"/> + <source>Top</source> + <translation>Felül</translation> + </message> + <message> + <location line="+1"/> + <source>Right edge</source> + <translation>Jobb szegély</translation> + </message> + <message> + <location line="+0"/> + <source>Bottom</source> + <translation>Alul</translation> + </message> + <message> + <location line="+3"/> + <source>Page left</source> + <translation>Lapozás balra</translation> + </message> + <message> + <location line="+0"/> + <source>Page up</source> + <translation>Lapozás fel</translation> + </message> + <message> + <location line="+1"/> + <source>Page right</source> + <translation>Lapozás jobbra</translation> + </message> + <message> + <location line="+0"/> + <source>Page down</source> + <translation>Lapozás balra</translation> + </message> + <message> + <location line="+3"/> + <source>Scroll left</source> + <translation>Görgetés balra</translation> + </message> + <message> + <location line="+0"/> + <source>Scroll up</source> + <translation>Görgetés fel</translation> + </message> + <message> + <location line="+1"/> + <source>Scroll right</source> + <translation>Görgetés jobbra</translation> + </message> + <message> + <location line="+0"/> + <source>Scroll down</source> + <translation>Görgetés lefele</translation> + </message> + <message numerus="yes"> + <location filename="../src/3rdparty/webkit/WebCore/platform/qt/FileChooserQt.cpp" line="+45"/> + <source>%n file(s)</source> + <comment>number of chosen file</comment> + <translation> + <numerusform>%n fájl</numerusform> + </translation> + </message> + <message> + <location filename="../src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp" line="+1822"/> + <source>JavaScript Alert - %1</source> + <translation>JavaSzkript figyelmeztetés - %1</translation> + </message> + <message> + <location line="+16"/> + <source>JavaScript Confirm - %1</source> + <translation>JavaSzkript megerősítés - %1</translation> + </message> + <message> + <location line="+18"/> + <source>JavaScript Prompt - %1</source> + <translation>JavaSzkript prompt - %1</translation> + </message> + <message> + <location line="+25"/> + <source>JavaScript Problem - %1</source> + <translation>JavaSzkript probléma - %1</translation> + </message> + <message> + <location line="+0"/> + <source>The script on this page appears to have a problem. Do you want to stop the script?</source> + <translation>Az ezen a lapon található szkriptnek úgy tűnik, hogy van egy problémája. Le szeretné állítani a szkriptet?</translation> + </message> + <message> + <location line="+381"/> + <source>Move the cursor to the next character</source> + <translation>Az egér mozgatása a következő karakterre</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the previous character</source> + <translation>Az egér mozgatása az előző karakterre</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the next word</source> + <translation>Az egér mozgatása a következő szóra</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the previous word</source> + <translation>Az egér mozgatása az előző szóra</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the next line</source> + <translation>Az egér mozgatása a következő sorra</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the previous line</source> + <translation>Az egér mozgatása az előző sorra</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the start of the line</source> + <translation>Az egér mozgatása a sor elejére</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the end of the line</source> + <translation>Az egér mozgatása a sor végére</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the start of the block</source> + <translation>Az egér mozgatása a blokk elejére</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the end of the block</source> + <translation>Az egér mozgatása a blokk végére</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the start of the document</source> + <translation>Az egér mozgatása a dokumentum elejére</translation> + </message> + <message> + <location line="+3"/> + <source>Move the cursor to the end of the document</source> + <translation>Az egér mozgatása a dokumentum végére</translation> + </message> + <message> + <location line="+3"/> + <source>Select all</source> + <translation>Az összes kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the next character</source> + <translation>A következő karakter kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the previous character</source> + <translation>Az előző karakter kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the next word</source> + <translation>A következő szó kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the previous word</source> + <translation>Az előző szó kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the next line</source> + <translation>A következő sor kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the previous line</source> + <translation>Az előző sor kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the start of the line</source> + <translation>A sor elejének kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the end of the line</source> + <translation>A sor végének kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the start of the block</source> + <translation>A blokk elejének kiválsztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the end of the block</source> + <translation>A blokk végének kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the start of the document</source> + <translation>A dokumentum elejének kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Select to the end of the document</source> + <translation>A dokumentum végének kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source>Delete to the start of the word</source> + <translation>A szó elejének törlése</translation> + </message> + <message> + <location line="+3"/> + <source>Delete to the end of the word</source> + <translation>A szó végének törlése</translation> + </message> + <message> + <location line="+33"/> + <source>Insert a new paragraph</source> + <translation>Egy új bekezdés beszúrása</translation> + </message> + <message> + <location line="+3"/> + <source>Insert a new line</source> + <translation>Egy új sor beszúrása</translation> + </message> + <message> + <location line="+4"/> + <source>Paste and Match Style</source> + <translation>Stílus beillesztése és összepasszintása</translation> + </message> + <message> + <location line="+3"/> + <source>Remove formatting</source> + <translation>Formázás eltávolítása</translation> + </message> + <message> + <location line="+4"/> + <source>Strikethrough</source> + <translation>Áthúzás</translation> + </message> + <message> + <location line="+4"/> + <source>Subscript</source> + <translation>Alsó index</translation> + </message> + <message> + <location line="+4"/> + <source>Superscript</source> + <translation>Felső index</translation> + </message> + <message> + <location line="+4"/> + <source>Insert Bulleted List</source> + <translation>Hivatalos közlemény lista beszúrása</translation> + </message> + <message> + <location line="+4"/> + <source>Insert Numbered List</source> + <translation>Számozott lista beszúrása</translation> + </message> + <message> + <location line="+4"/> + <source>Indent</source> + <translation>Behúzás</translation> + </message> + <message> + <location line="+3"/> + <source>Outdent</source> + <translation>Behúzás kifelé</translation> + </message> + <message> + <location line="+3"/> + <source>Center</source> + <translation>Közép</translation> + </message> + <message> + <location line="+3"/> + <source>Justify</source> + <translation>Igazolás</translation> + </message> + <message> + <location line="+3"/> + <source>Align Left</source> + <translation>Balra állít</translation> + </message> + <message> + <location line="+3"/> + <source>Align Right</source> + <translation>Jobbra állít</translation> + </message> +</context> +<context> + <name>QWhatsThisAction</name> + <message> + <location filename="../src/gui/kernel/qwhatsthis.cpp" line="+527"/> + <source>What's This?</source> + <translation>Mi ez?</translation> + </message> +</context> +<context> + <name>QWidget</name> + <message> + <location filename="../src/gui/kernel/qwidget.cpp" line="+5720"/> + <source>*</source> + <translation>*</translation> + </message> +</context> +<context> + <name>QWizard</name> + <message> + <location filename="../src/gui/dialogs/qwizard.cpp" line="+661"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location line="+2"/> + <source>Help</source> + <translation>Súgó</translation> + </message> + <message> + <location line="-14"/> + <source>< &Back</source> + <translation>< &Vissza</translation> + </message> + <message> + <location line="+10"/> + <source>&Finish</source> + <translation>&Befejezés</translation> + </message> + <message> + <location line="+4"/> + <source>&Help</source> + <translation>&Súgó</translation> + </message> + <message> + <location line="-14"/> + <source>Go Back</source> + <translation>Vissza ugrás</translation> + </message> + <message> + <location line="+3"/> + <source>Continue</source> + <translation>Folytatás</translation> + </message> + <message> + <location line="+5"/> + <source>Commit</source> + <translation>Kommit</translation> + </message> + <message> + <location line="+2"/> + <source>Done</source> + <translation>Kész</translation> + </message> + <message> + <location line="-4"/> + <source>&Next</source> + <translation>&Következő</translation> + </message> + <message> + <location line="+0"/> + <source>&Next ></source> + <translation>&Következő ></translation> + </message> +</context> +<context> + <name>QWorkspace</name> + <message> + <location filename="../src/gui/widgets/qworkspace.cpp" line="+1089"/> + <source>&Restore</source> + <translation>&Visszaállítás</translation> + </message> + <message> + <location line="+1"/> + <source>&Move</source> + <translation>&Mozgatás</translation> + </message> + <message> + <location line="+1"/> + <source>&Size</source> + <translation>&Méret</translation> + </message> + <message> + <location line="+2"/> + <source>Mi&nimize</source> + <translation>&Minimalizálás</translation> + </message> + <message> + <location line="+2"/> + <source>Ma&ximize</source> + <translation>Ma&ximalizálás</translation> + </message> + <message> + <location line="+2"/> + <source>&Close</source> + <translation>&Bezárás</translation> + </message> + <message> + <location line="+6"/> + <source>Stay on &Top</source> + <translation>&Tetején maradni</translation> + </message> + <message> + <location line="-988"/> + <source>Minimize</source> + <translation>Minimalizálás</translation> + </message> + <message> + <location line="+2"/> + <source>Restore Down</source> + <translation>Letárolás</translation> + </message> + <message> + <location line="-4"/> + <source>Close</source> + <translation>Bezárás</translation> + </message> + <message> + <location line="+993"/> + <location line="+1059"/> + <source>Sh&ade</source> + <translation>Árnya&lat</translation> + </message> + <message> + <location line="-278"/> + <location line="+60"/> + <source>%1 - [%2]</source> + <translation>%1 - [%2]</translation> + </message> + <message> + <location line="+214"/> + <source>&Unshade</source> + <translation>&Leeresztés</translation> + </message> +</context> +<context> + <name>QXml</name> + <message> + <location filename="../src/xml/sax/qxml.cpp" line="+58"/> + <source>no error occurred</source> + <translation>nem történt hiba</translation> + </message> + <message> + <location line="+1"/> + <source>error triggered by consumer</source> + <translation>Ügyfél által előidézett hiba</translation> + </message> + <message> + <location line="+1"/> + <source>unexpected end of file</source> + <translation>Váratlan fájlvég</translation> + </message> + <message> + <location line="+1"/> + <source>more than one document type definition</source> + <translation>Több mint egy dokumentum típus definíció</translation> + </message> + <message> + <location line="+1"/> + <source>error occurred while parsing element</source> + <translation>Hiba történt az elem elemzése közben</translation> + </message> + <message> + <location line="+1"/> + <source>tag mismatch</source> + <translation>Nem egyező címke</translation> + </message> + <message> + <location line="+1"/> + <source>error occurred while parsing content</source> + <translation>Hiba történt a tartalom elemzése közben</translation> + </message> + <message> + <location line="+1"/> + <source>unexpected character</source> + <translation>váratlan karakter</translation> + </message> + <message> + <location line="+1"/> + <source>invalid name for processing instruction</source> + <translation>érvénytelen név az utasítás feldolgozására</translation> + </message> + <message> + <location line="+1"/> + <source>version expected while reading the XML declaration</source> + <translation>várt verzió az XML deklaráció olvasása közben</translation> + </message> + <message> + <location line="+1"/> + <source>wrong value for standalone declaration</source> + <translation>Hibás egyedülálló deklaráció érték</translation> + </message> + <message> + <location line="+3"/> + <source>error occurred while parsing document type definition</source> + <translation>Hiba történt a dokumentum típus definíció elemzése közben</translation> + </message> + <message> + <location line="+1"/> + <source>letter is expected</source> + <translation>betű várt</translation> + </message> + <message> + <location line="+1"/> + <source>error occurred while parsing comment</source> + <translation>hiba történt az elemző megjegyzés előfordulása közben</translation> + </message> + <message> + <location line="+1"/> + <source>error occurred while parsing reference</source> + <translation>Hiba történt az elemző hivatkozás előfordulása közben</translation> + </message> + <message> + <location line="+1"/> + <source>internal general entity reference not allowed in DTD</source> + <translation>A DTD-ben nem engedélyezett a belső általános valós hivatkozás</translation> + </message> + <message> + <location line="+1"/> + <source>external parsed general entity reference not allowed in attribute value</source> + <translation>Az attribútum értékben nem engedélyezett a külsőleg elemzett általános valós hivatkozás</translation> + </message> + <message> + <location line="+1"/> + <source>external parsed general entity reference not allowed in DTD</source> + <translation>A DTD-ben nem engedélyezett a külsőleg elemzett általános valós hivatkozás</translation> + </message> + <message> + <location line="+1"/> + <source>unparsed entity reference in wrong context</source> + <translation>Hivatkozás egy nem értelmezett entitásra hibás összefüggésben</translation> + </message> + <message> + <location line="+1"/> + <source>recursive entities</source> + <translation>Rekurzív entitások</translation> + </message> + <message> + <location line="+1"/> + <source>error in the text declaration of an external entity</source> + <translation>Hiba egy külső entitás szöveg deklarációjában</translation> + </message> + <message> + <location line="-11"/> + <source>encoding declaration or standalone declaration expected while reading the XML declaration</source> + <translation>Kódolása deklaráció vagy egyedülálló deklaráció várt az XML deklaráció olvasása közben</translation> + </message> + <message> + <location line="+1"/> + <source>standalone declaration expected while reading the XML declaration</source> + <translation>Egyedülálló deklaráció várt az XML deklaráció olvasása közben</translation> + </message> +</context> +<context> + <name>QXmlPatternistCLI</name> + <message> + <location filename="../src/xmlpatterns/api/qcoloringmessagehandler.cpp" line="+87"/> + <source>Warning in %1, at line %2, column %3: %4</source> + <translation>Figyelmeztetés %1-ben, %2 sorban, %3 oszlopban: %4</translation> + </message> + <message> + <location line="+7"/> + <source>Warning in %1: %2</source> + <translation>Figyelmeztetés %1-ben: %2</translation> + </message> + <message> + <location line="+16"/> + <source>Unknown location</source> + <translation>Ismeretlen elhelyezkedés</translation> + </message> + <message> + <location line="+14"/> + <source>Error %1 in %2, at line %3, column %4: %5</source> + <translation>%1 hiba %2-ben, %3 sorban, %4 oszlopban: %5</translation> + </message> + <message> + <location line="+8"/> + <source>Error %1 in %2: %3</source> + <translation>%1 hiba %2-ben: %3</translation> + </message> +</context> +<context> + <name>QXmlStream</name> + <message> + <location filename="../src/corelib/xml/qxmlstream.cpp" line="+611"/> + <location filename="../src/corelib/xml/qxmlstream_p.h" line="+1770"/> + <source>Extra content at end of document.</source> + <translation>Extra tartalom a dokumentum végén.</translation> + </message> + <message> + <location line="+271"/> + <source>Invalid entity value.</source> + <translation>Érvénytelen entitás érték.</translation> + </message> + <message> + <location line="+109"/> + <source>Invalid XML character.</source> + <translation>Érvénytelen XML karakter.</translation> + </message> + <message> + <location line="+259"/> + <source>Sequence ']]>' not allowed in content.</source> + <translation>']]>' sor nem engedélyezett a tartalomban.</translation> + </message> + <message> + <location line="+309"/> + <source>Namespace prefix '%1' not declared</source> + <translation>'%1' névtér előtag nincsen deklarálva</translation> + </message> + <message> + <location line="+78"/> + <source>Attribute redefined.</source> + <translation>Attribútum újradefiniálva.</translation> + </message> + <message> + <location line="+115"/> + <source>Unexpected character '%1' in public id literal.</source> + <translation>Váratlan karakter '%1' a publikus azonosító literál.</translation> + </message> + <message> + <location line="+28"/> + <source>Invalid XML version string.</source> + <translation>Érvénytelen XML verzió sztring.</translation> + </message> + <message> + <location line="+2"/> + <source>Unsupported XML version.</source> + <translation>Nem támogatott XML verzió.</translation> + </message> + <message> + <location line="+23"/> + <source>%1 is an invalid encoding name.</source> + <translation>%1 egy érvénytelen kódolási név.</translation> + </message> + <message> + <location line="+7"/> + <source>Encoding %1 is unsupported</source> + <translation>%1 kódolás nem támogatva</translation> + </message> + <message> + <location line="+16"/> + <source>Standalone accepts only yes or no.</source> + <translation>Egyedülálló elfogadás kizárólas igen vagy nem.</translation> + </message> + <message> + <location line="+2"/> + <source>Invalid attribute in XML declaration.</source> + <translation>Érvénytelen attribútum az XML deklarációban.</translation> + </message> + <message> + <location line="+16"/> + <source>Premature end of document.</source> + <translation>Túl korai dokumentum vég.</translation> + </message> + <message> + <location line="+2"/> + <source>Invalid document.</source> + <translation>Érvénytelen dokumentum.</translation> + </message> + <message> + <location line="+40"/> + <source>Expected </source> + <translation>Várt</translation> + </message> + <message> + <location line="+11"/> + <source>, but got '</source> + <translation>, pedig megkapta '</translation> + </message> + <message> + <location line="+4"/> + <source>Unexpected '</source> + <translation>Váratlan '</translation> + </message> + <message> + <location line="+225"/> + <source>Expected character data.</source> + <translation>Várt karakter adat.</translation> + </message> + <message> + <location filename="../src/corelib/xml/qxmlstream_p.h" line="-995"/> + <source>Recursive entity detected.</source> + <translation>Rekurzív entitás észlelve.</translation> + </message> + <message> + <location line="+516"/> + <source>Start tag expected.</source> + <translation>Kezdő címke várva.</translation> + </message> + <message> + <location line="+222"/> + <source>XML declaration not at start of document.</source> + <translation>XML deklaráció nem a dokumentum elején található.</translation> + </message> + <message> + <location line="-31"/> + <source>NDATA in parameter entity declaration.</source> + <translation>NDATA a paraméter entitás deklarációban.</translation> + </message> + <message> + <location line="+34"/> + <source>%1 is an invalid processing instruction name.</source> + <translation>%1 egy érvénytelen feldolgozó utasítás neve.</translation> + </message> + <message> + <location line="+11"/> + <source>Invalid processing instruction name.</source> + <translation>Érvénytelen feldolgozó utasítás név.</translation> + </message> + <message> + <location filename="../src/corelib/xml/qxmlstream.cpp" line="-536"/> + <location line="+12"/> + <location filename="../src/corelib/xml/qxmlstream_p.h" line="+164"/> + <location line="+53"/> + <source>Illegal namespace declaration.</source> + <translation>Illegális névtér deklarációk.</translation> + </message> + <message> + <location filename="../src/corelib/xml/qxmlstream_p.h" line="+15"/> + <source>Invalid XML name.</source> + <translation>Érvénytelen XML név.</translation> + </message> + <message> + <location line="+23"/> + <source>Opening and ending tag mismatch.</source> + <translation>Nyitó és záró címkék nem egyeznek.</translation> + </message> + <message> + <location line="+18"/> + <source>Reference to unparsed entity '%1'.</source> + <translation>Hivatkozás egy nem értelmezett entitásra '%1'.</translation> + </message> + <message> + <location line="-13"/> + <location line="+61"/> + <location line="+40"/> + <source>Entity '%1' not declared.</source> + <translation>'%1' entitás nincsen deklarálva.</translation> + </message> + <message> + <location line="-26"/> + <source>Reference to external entity '%1' in attribute value.</source> + <translation>Hivatkozás egy külső entitásra '%1' az attribútum értékben.</translation> + </message> + <message> + <location line="+40"/> + <source>Invalid character reference.</source> + <translation>Érvénytelen karakter hivatkozás.</translation> + </message> + <message> + <location filename="../src/corelib/xml/qxmlstream.cpp" line="-75"/> + <location filename="../src/corelib/xml/qxmlstream_p.h" line="-823"/> + <source>Encountered incorrectly encoded content.</source> + <translation>Helytelen kódolási tartalommal találta szembe magát.</translation> + </message> + <message> + <location line="+274"/> + <source>The standalone pseudo attribute must appear after the encoding.</source> + <translation>Az egyedülálló ál attribútumnak a kódolás után kell feltűnnie.</translation> + </message> + <message> + <location filename="../src/corelib/xml/qxmlstream_p.h" line="+562"/> + <source>%1 is an invalid PUBLIC identifier.</source> + <translation>%1 egy érvénytelen PUBLIC-us azonosító.</translation> + </message> +</context> +<context> + <name>QtXmlPatterns</name> + <message> + <location filename="../src/xmlpatterns/data/qabstractduration.cpp" line="+99"/> + <location line="+15"/> + <source>At least one component must be present.</source> + <translation>Legalább egy komponenset be kell nyújtani.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qanyuri_p.h" line="+132"/> + <source>%1 is not a valid value of type %2.</source> + <translation>%1 nem egy érvény értéke a(z) %2 típusnak.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qatomiccasters_p.h" line="+223"/> + <source>When casting to %1 from %2, the source value cannot be %3.</source> + <translation>A(z) %1-ről %2-re történő kasztoláskor, a forrás érték nem lehet %3.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qboolean.cpp" line="+78"/> + <source>Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values.</source> + <translation>Hatékony logikai értéket nem lehet egy sor számára kiszámítani, amely kettő vagy több atomikus értéket tartalmaz.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qprocessinginstructionconstructor.cpp" line="+84"/> + <source>The data of a processing instruction cannot contain the string %1</source> + <translation>Egy feldolgozó utasítás adata nem tartalmazhat %1 sztringet</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qqnameconstructor_p.h" line="+168"/> + <location filename="../src/xmlpatterns/functions/qqnamefns.cpp" line="+69"/> + <source>%1 is an invalid %2</source> + <translation>%1 egy érvénytelen %2</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qassemblestringfns.cpp" line="+88"/> + <source>%1 is not a valid XML 1.0 character.</source> + <translation>%1 egy érvénytelen 1.0 XML karakter.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qerrorfn.cpp" line="+61"/> + <source>%1 was called.</source> + <translation>%1 lett meghívva.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qpatternmatchingfns.cpp" line="+133"/> + <source>In the replacement string, %1 must be followed by at least one digit when not escaped.</source> + <translation>A kicserélési sztrinben, %1 -t legalább egy számnak kell követnie nem meneküléskor.</translation> + </message> + <message> + <location line="+26"/> + <source>In the replacement string, %1 can only be used to escape itself or %2, not %3</source> + <translation>A kicserelési sztringben, %1-t csak magának a(z) %2 vagy %3 menekülésére lehet használni</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qpatternplatform.cpp" line="+92"/> + <source>%1 matches newline characters</source> + <translation>%1 megegyező újsor karakterek</translation> + </message> + <message> + <location line="+10"/> + <source>Matches are case insensitive</source> + <translation>Az egyezés kis és nagybetűre nem érzékeny</translation> + </message> + <message> + <location line="+104"/> + <source>%1 is an invalid regular expression pattern: %2</source> + <translation>%1 egy érvénytelen reguláris kifejezés minta: %2</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qsequencefns.cpp" line="+346"/> + <source>It will not be possible to retrieve %1.</source> + <translation>Nem lesz lehetséges kinyerni %1.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qsequencegeneratingfns.cpp" line="+266"/> + <source>The default collection is undefined</source> + <translation>Az alapértelmezett gyűjtemény nincs definiálva</translation> + </message> + <message> + <location line="+13"/> + <source>%1 cannot be retrieved</source> + <translation>%1 nem lehet megszerezni</translation> + </message> + <message> + <location filename="../src/xmlpatterns/janitors/qitemverifier.cpp" line="+67"/> + <source>The item %1 did not match the required type %2.</source> + <translation>A(z) %1 elem nem egyezik a szükséges típussal %2.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/parser/qquerytransformparser.cpp" line="+352"/> + <location line="+7323"/> + <source>%1 is an unknown schema type.</source> + <translation>%1 egy ismeretlen terv típus.</translation> + </message> + <message> + <location line="-7254"/> + <source>A template with name %1 has already been declared.</source> + <translation>Egy %1 nevű sablon már deklarálva van.</translation> + </message> + <message> + <location line="+213"/> + <source>Only one %1 declaration can occur in the query prolog.</source> + <translation>Kizárólag egy %1 deklaráció fordulhat elő a kérdéses előszóban.</translation> + </message> + <message> + <location line="+188"/> + <source>The initialization of variable %1 depends on itself</source> + <translation>A(z) %1 változó inicializálása önmagától függ</translation> + </message> + <message> + <location filename="../src/xmlpatterns/parser/qparsercontext.cpp" line="+93"/> + <source>The variable %1 is unused</source> + <translation>A(z) %1 változó nincsen használva</translation> + </message> + <message> + <location filename="../src/xmlpatterns/parser/qquerytransformparser.cpp" line="+2904"/> + <source>Version %1 is not supported. The supported XQuery version is 1.0.</source> + <translation>%1-es verzió nem támogatott. A támogatott XQuery verzió az 1.0.</translation> + </message> + <message> + <location line="+71"/> + <source>No function with signature %1 is available</source> + <translation>Nincs %1 aláírással rendelkező függvény</translation> + </message> + <message> + <location line="+303"/> + <source>It is not possible to redeclare prefix %1.</source> + <translation>Nem lehetséges a(z) %1 előtag újradeklarálása.</translation> + </message> + <message> + <location line="+18"/> + <source>Prefix %1 is already declared in the prolog.</source> + <translation>%1 előtag már deklarálva van az előszóban.</translation> + </message> + <message> + <location line="+95"/> + <source>The name of an option must have a prefix. There is no default namespace for options.</source> + <translation>Az opció nevének tartalmaznia kell egy előtagot. Nincs alapértelmezett névtér ezekre az opciókra.</translation> + </message> + <message> + <location line="+171"/> + <source>The Schema Import feature is not supported, and therefore %1 declarations cannot occur.</source> + <translation>A terv importálása tulajdonság nem támogatott, és ennek következtében a(z) %1 deklarációk nem fordulhatnak elő.</translation> + </message> + <message> + <location line="+13"/> + <source>The target namespace of a %1 cannot be empty.</source> + <translation>Egy %1 cél névtere nem lehet üres.</translation> + </message> + <message> + <location line="+8"/> + <source>The module import feature is not supported</source> + <translation>A modul importáló tulajdonság nem támogatott</translation> + </message> + <message> + <location line="+178"/> + <source>The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2</source> + <translation>Egy felhasználó által definiált függvény névterének egy könyvtár modulban megfelelőnek kell lenni a modul névtérrel. Más szóval, %1-nek kellene lennie %2 helyett</translation> + </message> + <message> + <location line="+34"/> + <source>A function already exists with the signature %1.</source> + <translation>Egy függvény már létezik ezzel az aláírással %1.</translation> + </message> + <message> + <location line="+23"/> + <source>No external functions are supported. All supported functions can be used directly, without first declaring them as external</source> + <translation>Kulső függvények nincsenek támogatva. Az összes támogatott függvényt lehet közvetlenül haszálni, az első külső deklarálásuk nélkül</translation> + </message> + <message> + <location line="+1709"/> + <source>The %1-axis is unsupported in XQuery</source> + <translation>A(z) %1 tengely nem támogatott az XQuery-ben</translation> + </message> + <message> + <location line="+435"/> + <source>The namespace URI cannot be the empty string when binding to a prefix, %1.</source> + <translation>Az URI névtér nem lehet üres sztring egy előtaghoz való összeköttetéskor, %1.</translation> + </message> + <message> + <location line="+7"/> + <source>%1 is an invalid namespace URI.</source> + <translation>%1 egy érvénytelen URI névtér.</translation> + </message> + <message> + <location line="+6"/> + <source>It is not possible to bind to the prefix %1</source> + <translation>Nem lehetséges a(z) %1 előtaggal összekötni</translation> + </message> + <message> + <location line="+30"/> + <source>Two namespace declaration attributes have the same name: %1.</source> + <translation>Két névtér deklaráció attribútumnak ugyanaz a neve: %1.</translation> + </message> + <message> + <location line="+89"/> + <source>The namespace URI must be a constant and cannot use enclosed expressions.</source> + <translation>Az URI névtérnek állandónak kell lennie és nem használhat elhatárolt kifejezéseket.</translation> + </message> + <message> + <location line="+699"/> + <location line="+71"/> + <source>%1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported.</source> + <translation>%1 nem a hatókör attribútum deklarációin belül található. Vegye figyelembe, hogy a terv importáló tulajdonság nem támogatott.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/type/qcardinality.cpp" line="+55"/> + <source>empty</source> + <translation>üres</translation> + </message> + <message> + <location line="+2"/> + <source>zero or one</source> + <translation>nulla vagy egy</translation> + </message> + <message> + <location line="+2"/> + <source>exactly one</source> + <translation>pontosan egy</translation> + </message> + <message> + <location line="+2"/> + <source>one or more</source> + <translation>egy vagy több</translation> + </message> + <message> + <location line="+2"/> + <source>zero or more</source> + <translation>nulla vagy több</translation> + </message> + <message> + <location filename="../src/xmlpatterns/type/qtypechecker.cpp" line="+156"/> + <source>The focus is undefined.</source> + <translation>A fókusz nincs definiálva.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/utils/qoutputvalidator.cpp" line="+93"/> + <source>An attribute by name %1 has already been created.</source> + <translation>Egy %1 nevű attribútum már létre lett hozva.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/api/qiodevicedelegate.cpp" line="+84"/> + <source>Network timeout.</source> + <translation>Hálózati időtúllépés.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/api/qxmlserializer.cpp" line="+320"/> + <source>Element %1 can't be serialized because it appears outside the document element.</source> + <translation>%1 elemet nem lehet besorolni, mert úgy tűnik a dokumentum elem külső oldalán található.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qabstractdatetime.cpp" line="+80"/> + <source>Year %1 is invalid because it begins with %2.</source> + <translation>%1 év érvénytelen, mert %2-vel kezdődik.</translation> + </message> + <message> + <location line="+19"/> + <source>Day %1 is outside the range %2..%3.</source> + <translation>%1 nap a tartomány külsp oldalán van %2..%3.</translation> + </message> + <message> + <location line="+7"/> + <source>Month %1 is outside the range %2..%3.</source> + <translation>%1 hónap a tartomány külső felületén van %2..%3.</translation> + </message> + <message> + <location line="+10"/> + <source>Overflow: Can't represent date %1.</source> + <translation>Túlcsordulás: Nem lehet feltünteti a(z) %1 dátumot.</translation> + </message> + <message> + <location line="+9"/> + <source>Day %1 is invalid for month %2.</source> + <translation>%1 nap érvénytelen a(z) %2 hónapra vonatkozólag.</translation> + </message> + <message> + <location line="+49"/> + <source>Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; </source> + <translation>Idő 24:%1:%2:%3 érvénytelen. Az óra 24, de a perc, másodperc, és milliszekundum egyáltalán nem 0; </translation> + </message> + <message> + <location line="+13"/> + <source>Time %1:%2:%3.%4 is invalid.</source> + <translation>Idő %1:%2:%3.%4 érvénytelen.</translation> + </message> + <message> + <location line="+115"/> + <source>Overflow: Date can't be represented.</source> + <translation>Túlcsordulás: A dátumot nem lehet feltüntetni.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qabstractduration.cpp" line="-7"/> + <source>At least one time component must appear after the %1-delimiter.</source> + <translation>Legalább egy idő komponensnek lennie kell a(z) %1 határolójel után.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qatomicmathematicians.cpp" line="+201"/> + <location line="+32"/> + <source>Dividing a value of type %1 by %2 (not-a-number) is not allowed.</source> + <translation>%1 típus értékének osztása egy %2(nem szám)-mal nem engedélyezett.</translation> + </message> + <message> + <location line="-20"/> + <source>Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed.</source> + <translation>%1 típus értékének osztása egy %2 vagy %3(plusz vagy minusz nulla)-mal nem engedélyezett.</translation> + </message> + <message> + <location line="+32"/> + <source>Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed.</source> + <translation>%1 típusú érték %2 vagy %3-mal való szorzása(plusz vagy minusz végtelen) nem engedélyezett.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qatomicvalue.cpp" line="+79"/> + <source>A value of type %1 cannot have an Effective Boolean Value.</source> + <translation>%1 típusú értéknek nincsen hatékony logikai értéke.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qderivedinteger_p.h" line="+402"/> + <source>Value %1 of type %2 exceeds maximum (%3).</source> + <translation>%2 típus %1 értéke elérte a maxiumot (%3).</translation> + </message> + <message> + <location line="+9"/> + <source>Value %1 of type %2 is below minimum (%3).</source> + <translation>%1 típus %2 értéke a minimum alatt van (%3).</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qhexbinary.cpp" line="+91"/> + <source>A value of type %1 must contain an even number of digits. The value %2 does not.</source> + <translation>%1 típus értékének tartalmaznia kell egy páratlan számú számot. A(z) %2 érték nem.</translation> + </message> + <message> + <location line="+19"/> + <source>%1 is not valid as a value of type %2.</source> + <translation>%1 érvénytelen %2 típusú értékként.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qarithmeticexpression.cpp" line="+207"/> + <source>Operator %1 cannot be used on type %2.</source> + <translation>%1 műveletet nem lehet a(z) %2 típuson használni.</translation> + </message> + <message> + <location line="+17"/> + <source>Operator %1 cannot be used on atomic values of type %2 and %3.</source> + <translation>%1 műveletet nem lehet a %2 és %3-as típusú atomikus értéken használni.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qattributenamevalidator.cpp" line="+66"/> + <source>The namespace URI in the name for a computed attribute cannot be %1.</source> + <translation>Az URI névtér a névben számított attribútumra nem lehet %1.</translation> + </message> + <message> + <location line="+9"/> + <source>The name for a computed attribute cannot have the namespace URI %1 with the local name %2.</source> + <translation>Egy kiszámított attribútumnak nem lehet %1 URI névtere %2 helyi névvel.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qcastas.cpp" line="+88"/> + <source>Type error in cast, expected %1, received %2.</source> + <translation>Típus hiba a kasztolásban, %1 várt, %2 kapott.</translation> + </message> + <message> + <location line="+29"/> + <source>When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed.</source> + <translation>%1-re kasztoláskor vagy típus származtatáskor, a forrás értéknek ugyanolyan típusúnak kell lennie, vagy sztring literálnak kell lennie. %2 típus nem engedélyezett.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qcommentconstructor.cpp" line="+67"/> + <source>A comment cannot contain %1</source> + <translation>A megjegyzés nem tartalmazhat %1-t</translation> + </message> + <message> + <location line="+6"/> + <source>A comment cannot end with a %1.</source> + <translation>A megjegyzés nem végződget %1-gyel.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qdocumentcontentvalidator.cpp" line="+86"/> + <source>An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place.</source> + <translation>Az attribútum csomópont egy dokumentum csomópont gyermeke. Ennek következtében a(z) %1 attribútum nem helyénvaló.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qexpressionfactory.cpp" line="+162"/> + <source>A library module cannot be evaluated directly. It must be imported from a main module.</source> + <translation>A köbyvtár modult nem lehet közvetlenül kiértékelni. A fő modulból kell importálni.</translation> + </message> + <message> + <location line="+40"/> + <source>No template by name %1 exists.</source> + <translation>%1 nevű sablon nem létezik.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qgenericpredicate.cpp" line="+106"/> + <source>A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type.</source> + <translation>A(z) %1 típus értéke egy állítmány. Egy állítmánynak tartalmaznia kell vagy egy szám típust vagy egy effektív logikai érték típust.</translation> + </message> + <message> + <location line="+32"/> + <source>A positional predicate must evaluate to a single numeric value.</source> + <translation>A helyzet állítmányt egy egyetlen szám értékként kell kiértékelni.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qncnameconstructor_p.h" line="+113"/> + <source>The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, %2 is invalid.</source> + <translation>A cél neve egy utasítás feldolgozásban nem lehet %1 kis és nagybetűk bármely kombinációjában. Ennek következtében a(z) %2 érvénytelen.</translation> + </message> + <message> + <location line="+24"/> + <source>%1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3.</source> + <translation>%1 nem egy érvényes cél név az utasítás feldolgozásban. %2 vagy %3 értéknek kell lennie.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qpath.cpp" line="+109"/> + <source>The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two.</source> + <translation>Az utolsó lépésnek vagy csomópontokat vagy atomikus értékeket kell tartalmaznia. Ez nem lehet a kettő közötti keverék.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qqnameconstructor.cpp" line="+82"/> + <source>No namespace binding exists for the prefix %1</source> + <translation>Nem létezik névtér összeköttetés a(z) %1 előtagra</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qqnameconstructor_p.h" line="-12"/> + <source>No namespace binding exists for the prefix %1 in %2</source> + <translation>Nem létezik névtér összeköttetés a(z) %1 előtagra %2-ben</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qaggregatefns.cpp" line="+120"/> + <source>The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration.</source> + <translation>Az első argumentum %1 nem lehet %2 típusú. Egy számos típusnak kelle lennie, xs:évHónapIdőtartam vagy xs:napIdőTartam.</translation> + </message> + <message> + <location line="+74"/> + <source>The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5.</source> + <translation>Az első argumentum %1 nem lehet %2 típusú. %3, %4 vagy %5 típusúnak kell lennie.</translation> + </message> + <message> + <location line="+91"/> + <source>The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5.</source> + <translation>Az második argumentum %1 nem lehet %2 típusú. %3, %4 vagy %5 típusúnak kell lennie.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qdatetimefn.cpp" line="+86"/> + <source>If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same.</source> + <translation>Ha mindkét értéknek zóna eltolása van, ugyanazt a zóna eltolást kell tartalmazniuk. %1 és %2 nem ugyanaz.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qpatternmatchingfns.cpp" line="-65"/> + <source>%1 must be followed by %2 or %3, not at the end of the replacement string.</source> + <translation>%1-t %2 vagy %3-nak kell követnie, nem a kicserélési sztring végén.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qpatternplatform.cpp" line="-110"/> + <source>%1 and %2 match the start and end of a line.</source> + <translation>%1 és %2 egyezik a sor elején és végén.</translation> + </message> + <message> + <location line="+10"/> + <source>Whitespace characters are removed, except when they appear in character classes</source> + <translation>Nem látható karakterek eltávolítva, kivéve mikor karakter osztályokban tűnnek fel</translation> + </message> + <message> + <location line="+130"/> + <source>%1 is an invalid flag for regular expressions. Valid flags are:</source> + <translation>%1 egy érvénytelen jelző reguláris kifejezésekre. Érvényes flagek:</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qqnamefns.cpp" line="+17"/> + <source>If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified.</source> + <translation>Ha az első argumentum üres sorozat vagy nulla hosszúságú sztring (nincsen névtér), egy előtagot nem lehet meghatározni. %1 előtag volt meghatározva.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qstringvaluefns.cpp" line="+252"/> + <source>The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization).</source> + <translation>A(z) %1 szabványosítási forma nem támogatott. A támogatott formák %2, %3, %4 és %5 és semmi más, lásd az üres sztringet (nincs szabványosítás).</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qtimezonefns.cpp" line="+87"/> + <source>A zone offset must be in the range %1..%2 inclusive. %3 is out of range.</source> + <translation>A zóna eltolásnak a(z) %1..%2 tartományban kell benne lennie. %3 az tartományon kívüli.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/janitors/qcardinalityverifier.cpp" line="+58"/> + <source>Required cardinality is %1; got cardinality %2.</source> + <translation>Szükséges számosság %1, szerzett számosság %2.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/parser/qquerytransformparser.cpp" line="-3944"/> + <source>The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2.</source> + <translation>A(z) %1 kódolás érvénytelen. Kizárólag latin karaktereket kell tartalmaznia, nem szabad látható karaktereket tartalmaznia, és a(z) %2 reguláris kifejezéssel kell megegyeznie.</translation> + </message> + <message> + <location line="+260"/> + <source>The keyword %1 cannot occur with any other mode name.</source> + <translation>A(z) %1 kulcscszó nem fordulhat elő semmilyen más mód névvel.</translation> + </message> + <message> + <location line="-3117"/> + <source>No variable with name %1 exists</source> + <translation>%1 nevű változó nem létezik</translation> + </message> + <message> + <location line="+3146"/> + <source>The value of attribute %1 must be of type %2, which %3 isn't.</source> + <translation>A(z) %1 attribútumnak %2 típusúnak kell lennie, amelyik nem %3-as.</translation> + </message> + <message> + <location line="+75"/> + <source>The prefix %1 cannot be bound. By default, it is already bound to the namespace %2.</source> + <translation>A(z) %1 előtagot nem lehet összekötni. Alapértelmezetten, már hozzá van kötve a %2 névtérhez.</translation> + </message> + <message> + <location line="+312"/> + <source>A variable with name %1 has already been declared.</source> + <translation>%1 nevű változó már deklarálva van.</translation> + </message> + <message> + <location line="+39"/> + <source>No value is available for the external variable with name %1.</source> + <translation>%1 nevű külső változóhoz nem érhető el érték. </translation> + </message> + <message> + <location line="+96"/> + <source>A stylesheet function must have a prefixed name.</source> + <translation>A stíluslap függvénynek tartalmaznia kell egy előtag nevet.</translation> + </message> + <message> + <location line="+18"/> + <source>The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases.</source> + <translation>A(z) %1 névtér foglalt, ennek következtében a felhasználó által definiált függvényt nem lehet használni. Próbálja ki az előredefiniált %2 előtagot, amely erre az esetekre van kitalálva.</translation> + </message> + <message> + <location line="+106"/> + <source>An argument with name %1 has already been declared. Every argument name must be unique.</source> + <translation>Egy %1 nevű argumentum már deklarálva van. Minden argumentum névnek egyedülállónak kell lennie.</translation> + </message> + <message> + <location line="+179"/> + <source>When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal.</source> + <translation>Mikor %1 függvény van használva egyeztetése egy mintán belül, az argumentumnak egy változó hivatkozásnak vagy egy sztring literálnak kell lennie.</translation> + </message> + <message> + <location line="+11"/> + <source>In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching.</source> + <translation>Egy XSLT mintában, az első argumentumnak a(z) %1 függvényre egy sztring literálnak kell lennie, amikor egyeztetésre használják.</translation> + </message> + <message> + <location line="+14"/> + <source>In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching.</source> + <translation>Egy XSLT mintában, az első argumentumnak a(z) %1 függvény esetén egy literálnak vagy egy változó hibatkozásnak kell lennie, mikor egyeztetésre használják.</translation> + </message> + <message> + <location line="+9"/> + <source>In an XSL-T pattern, function %1 cannot have a third argument.</source> + <translation>Egy XSLT mintában, %1 függvénynek nem lehet egy harmadik argumentuma.</translation> + </message> + <message> + <location line="+10"/> + <source>In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching.</source> + <translation>Egy XSLT mintában, kizárólag a(z) %1 és %2 függvényeket, és %3-at nem lehet egyeztetésre használni.</translation> + </message> + <message> + <location line="+63"/> + <source>In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can.</source> + <translation>Egy XSLT mintában, %1 tengelyt nem lehet használni, kizárólag a(z) %2 vagy %3 tengelyeket.</translation> + </message> + <message> + <location line="+126"/> + <source>%1 is an invalid template mode name.</source> + <translation>%1 egy érvénytelen sablon mód név.</translation> + </message> + <message> + <location line="+44"/> + <source>The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide.</source> + <translation>Egy változó összeköttetés nevének egy for kifejezésben különböznie kell a pozícionális változótol. Ezért, a két %1 nevű változó ütközik.</translation> + </message> + <message> + <location line="+778"/> + <source>The Schema Validation Feature is not supported. Hence, %1-expressions may not be used.</source> + <translation>A terv jóváhagyási tulajdonság nem támogatott. Ezért, %1 kifejezést nem lehet használni.</translation> + </message> + <message> + <location line="+40"/> + <source>None of the pragma expressions are supported. Therefore, a fallback expression must be present</source> + <translation>A pragma kifejezések egyike sem támogatott. Ezért egy visszavonuló kifejezést kell nyújtani</translation> + </message> + <message> + <location line="+269"/> + <source>Each name of a template parameter must be unique; %1 is duplicated.</source> + <translation>Sablon paraméter mindegyik nevének egyedülállónak kell lennie, %1 az duplikáns.</translation> + </message> + <message> + <location line="+462"/> + <source>No function with name %1 is available.</source> + <translation>%1 nevű függvény nem elérhető.</translation> + </message> + <message> + <location line="-6235"/> + <source>%1 is not a valid numeric literal.</source> + <translation>%1 nem egy érvényes számos literál.</translation> + </message> + <message> + <location line="-152"/> + <source>W3C XML Schema identity constraint selector</source> + <translation>W3C XML terv azonosító megszorító kiválasztó</translation> + </message> + <message> + <location line="+3"/> + <source>W3C XML Schema identity constraint field</source> + <translation>W3C XML Terv azonosító megszorító mező</translation> + </message> + <message> + <location line="+4"/> + <source>A construct was encountered which is disallowed in the current language(%1).</source> + <translation>Egy olyan konstruktort talált amelyik nincsen engedélyezve az aktuális nyelvben(%1).</translation> + </message> + <message> + <location line="+6502"/> + <source>Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared).</source> + <translation>%1 névteret kizárólag a %2-vel lehet összekötni (és ennyi, vagy mindkét esetben, előre deklarált).</translation> + </message> + <message> + <location line="+8"/> + <source>Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared).</source> + <translation>%1 előtagot kizárólag a %2-vel lehet összekötni (és ennyi, vagy mindkét esetben, előre deklarált).</translation> + </message> + <message> + <location line="+120"/> + <source>An attribute with name %1 has already appeared on this element.</source> + <translation>%1 attribútum név már van ebben az elemben.</translation> + </message> + <message> + <location line="+61"/> + <source>A direct element constructor is not well-formed. %1 is ended with %2.</source> + <translation>Egy közvetlen elem konstruktor, mely nincsen jól megformázva. %1 a(z) %2-ben végzőik.</translation> + </message> + <message> + <location line="+458"/> + <source>The name %1 does not refer to any schema type.</source> + <translation>A(z) %1 név nem vonatkozik egyetlen terv típusra sem.</translation> + </message> + <message> + <location line="+10"/> + <source>%1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works.</source> + <translation>%1 egy összetett típus. Összetett típusra kasztolás nem lehetséges. De egy atomikus típusra mint egy %2 működik.</translation> + </message> + <message> + <location line="+9"/> + <source>%1 is not an atomic type. Casting is only possible to atomic types.</source> + <translation>%1 nem egy atomikus típus. Kaszolás kizárólag csak atomikus típusra lehetséges.</translation> + </message> + <message> + <location line="+76"/> + <source>%1 is not a valid name for a processing-instruction.</source> + <translation>%1 nem egy érvényes név egy utasítás feldolgozásra.</translation> + </message> + <message> + <location line="+188"/> + <source>The name of an extension expression must be in a namespace.</source> + <translation>Egy kifejezés kiterjesztés nevének egy névtérben kell lennie.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/type/qtypechecker.cpp" line="-93"/> + <source>Required type is %1, but %2 was found.</source> + <translation>%1 a szükséges típus, de %2 található.</translation> + </message> + <message> + <location line="+44"/> + <source>Promoting %1 to %2 may cause loss of precision.</source> + <translation>%1 elősegítése %2-re precíziós vesztést okozhat.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/utils/qoutputvalidator.cpp" line="-7"/> + <source>It's not possible to add attributes after any other kind of node.</source> + <translation>Nem lehetséges attribútumokat hozzáadni, bármely másik csomópont után.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/utils/qxpathhelper_p.h" line="+120"/> + <source>Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported.</source> + <translation>Kizárólag a Unicode Kódpontos összevetés támogatott(%1). %2 nem támogatott.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/data/qatomicmathematicians.cpp" line="-180"/> + <source>Integer division (%1) by zero (%2) is undefined.</source> + <translation>Egész számos (%1) osztás nullával (%2) nem definiált.</translation> + </message> + <message> + <location line="+7"/> + <source>Division (%1) by zero (%2) is undefined.</source> + <translation>Osztás (%1) nullával (%2) nem definiált.</translation> + </message> + <message> + <location line="+7"/> + <source>Modulus division (%1) by zero (%2) is undefined.</source> + <translation>Tényezős osztás (%1) nullával (%2) nem definiált.</translation> + </message> + <message numerus="yes"> + <location filename="../src/xmlpatterns/functions/qabstractfunctionfactory.cpp" line="+77"/> + <source>%1 takes at most %n argument(s). %2 is therefore invalid.</source> + <translation> + <numerusform>%1 legalább %n argumentumot vár. A(z) %2 ennel következtében érvénytelen.</numerusform> + </translation> + </message> + <message numerus="yes"> + <location line="+11"/> + <source>%1 requires at least %n argument(s). %2 is therefore invalid.</source> + <translation> + <numerusform>%1 legalább %n argumentumot igényel. Ennek következtében a(z) %2 érvénytelen.</numerusform> + </translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qcontextnodechecker.cpp" line="+54"/> + <source>The root node of the second argument to function %1 must be a document node. %2 is not a document node.</source> + <translation>A második argumentum rendszergazda csomópontja %1 függvényre dokumentum csomópontnak kell lenni. %2 nem egy dokumentum csomópont.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/parser/qquerytransformparser.cpp" line="-3172"/> + <source>The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this)</source> + <translation>A névtér a felhasználó által definiált függvényre nem lehet üres (próbálja ki az előredefiniált %1 előtagot, mely innen esetekre lett kitalálva)</translation> + </message> + <message> + <location line="-693"/> + <location line="+10"/> + <source>A default namespace declaration must occur before function, variable, and option declarations.</source> + <translation>Egy alapértelmezett névtér deklarációnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie.</translation> + </message> + <message> + <location line="+10"/> + <source>Namespace declarations must occur before function, variable, and option declarations.</source> + <translation>A névtér deklarációnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie.</translation> + </message> + <message> + <location line="+11"/> + <source>Module imports must occur before function, variable, and option declarations.</source> + <translation>Modul importálásnak a függvény, változó, és opció deklarációk előtt kell elhelyezkednie.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qtimezonefns.cpp" line="+12"/> + <source>%1 is not a whole number of minutes.</source> + <translation>%1 nem egy egész számú perc érték.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/api/qxmlserializer.cpp" line="+60"/> + <source>Attribute %1 can't be serialized because it appears at the top level.</source> + <translation>%1 attribtútumot nem lehet sorozatosítani, mert legfelső szinten tűnik fel.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp" line="+344"/> + <source>%1 is an unsupported encoding.</source> + <translation>%1 egy nem támogatott kódolás.</translation> + </message> + <message> + <location line="+16"/> + <source>%1 contains octets which are disallowed in the requested encoding %2.</source> + <translation>%1 oktálisokat tartalmat, melyek tiltva vannak a lekérdezett %2 kódolásban.</translation> + </message> + <message> + <location line="+18"/> + <source>The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character.</source> + <translation>A kódpont %1, mely a %2-ben fordul elő %3 kódolást használva, egy érvénytelen XML karakter.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qapplytemplate.cpp" line="+119"/> + <source>Ambiguous rule match.</source> + <translation>Bizonytalan szabály egyezés.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qcomputednamespaceconstructor.cpp" line="+69"/> + <source>In a namespace constructor, the value for a namespace cannot be an empty string.</source> + <translation>Egy névtér konstruktorban, egy névtér értéke nem lehet egy üres sztring.</translation> + </message> + <message> + <location line="+11"/> + <source>The prefix must be a valid %1, which %2 is not.</source> + <translation>Az előtagnak egy érvényes %1-nek kell lennie, %2 nem lehet.</translation> + </message> + <message> + <location line="+14"/> + <source>The prefix %1 cannot be bound.</source> + <translation>A(z) %1 előtagot nem lehet összekötni.</translation> + </message> + <message> + <location line="+10"/> + <source>Only the prefix %1 can be bound to %2 and vice versa.</source> + <translation>Kizárólag a(z) %1 előtagot lehet összekötni a %2-vel és fordítva.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/expr/qtemplate.cpp" line="+145"/> + <source>The parameter %1 is required, but no corresponding %2 is supplied.</source> + <translation>A(z) %1 paraméter követelik, de nincs megelelő %2 támogatás hozzá.</translation> + </message> + <message> + <location line="-71"/> + <source>The parameter %1 is passed, but no corresponding %2 exists.</source> + <translation>A(z) %1 paraméter teljesítve, de a megfelelő %2 nem létezik.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/functions/qunparsedtextfn.cpp" line="+65"/> + <source>The URI cannot have a fragment</source> + <translation>Az URI nem tartalmaz tördezettséget</translation> + </message> + <message> + <location filename="../src/xmlpatterns/parser/qxslttokenizer.cpp" line="+519"/> + <source>Element %1 is not allowed at this location.</source> + <translation>%1 elem nincs engedélyezve ezen a ponton.</translation> + </message> + <message> + <location line="+9"/> + <source>Text nodes are not allowed at this location.</source> + <translation>Szöveg csomópontok nincsenek engedélyezve ezen a ponton.</translation> + </message> + <message> + <location line="+20"/> + <source>Parse error: %1</source> + <translation>Elemzési hiba: %1</translation> + </message> + <message> + <location line="+62"/> + <source>The value of the XSL-T version attribute must be a value of type %1, which %2 isn't.</source> + <translation>XSLT verzió attribútum értékének %1 típusú értéknek kell lennie, %2 nem lehet.</translation> + </message> + <message> + <location line="+20"/> + <source>Running an XSL-T 1.0 stylesheet with a 2.0 processor.</source> + <translation>Egy XSLT 1.0 stíluslap egy 2.0 feldolgozóval való futtatása.</translation> + </message> + <message> + <location line="+108"/> + <source>Unknown XSL-T attribute %1.</source> + <translation>Ismeretlen XSLT attribútum %1.</translation> + </message> + <message> + <location line="+23"/> + <source>Attribute %1 and %2 are mutually exclusive.</source> + <translation>A(z) %1 és %2 attribútum kölcsönösen kizárják egymást.</translation> + </message> + <message> + <location line="+166"/> + <source>In a simplified stylesheet module, attribute %1 must be present.</source> + <translation>Egy leegyszerűsített stíluslap modulban, %1 attribútumot kell nyújtani.</translation> + </message> + <message> + <location line="+72"/> + <source>If element %1 has no attribute %2, it cannot have attribute %3 or %4.</source> + <translation>Ha a(z) %1 elem nem tartalmaz %2 attribútumot, akkor nem tartalmazhat %3 vagy %4 attribútumot.</translation> + </message> + <message> + <location line="+9"/> + <source>Element %1 must have at least one of the attributes %2 or %3.</source> + <translation>%1 elemnek legalább egy %2 vagy %3 attribútumot kell tartalmaznia.</translation> + </message> + <message> + <location line="+28"/> + <source>At least one mode must be specified in the %1-attribute on element %2.</source> + <translation>Legalább egy csomópontot meg kell határozni a(z) %1 attribútumban a(z) %2 elemen.</translation> + </message> + <message> + <location line="+123"/> + <source>Element %1 must come last.</source> + <translation>%1 elemnek kell utoljára következnie.</translation> + </message> + <message> + <location line="+24"/> + <source>At least one %1-element must occur before %2.</source> + <translation>Legalább egy %1 elemnek kell előfordulnia %2 előtt.</translation> + </message> + <message> + <location line="+7"/> + <source>Only one %1-element can appear.</source> + <translation>Csak egy %1 elem jelenhet meg.</translation> + </message> + <message> + <location line="+31"/> + <source>At least one %1-element must occur inside %2.</source> + <translation>Legalább egy %1 elem fordulhat elő %2-n belül.</translation> + </message> + <message> + <location line="+58"/> + <source>When attribute %1 is present on %2, a sequence constructor cannot be used.</source> + <translation>Mikor %1 attribútuk van benyújtva %2-n, egy sorozat konstruktort nem lehet használni.</translation> + </message> + <message> + <location line="+13"/> + <source>Element %1 must have either a %2-attribute or a sequence constructor.</source> + <translation>%1 elemnek vagy egy %2 attribútumot vagy egy sorozat konstruktort kell tartalmaznia.</translation> + </message> + <message> + <location line="+125"/> + <source>When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor.</source> + <translation>Amikor egy paramétert igényel, egy alapértelmezett érték ellátni egy %1 attribútum vagy egy sorozat konstruktoron keresztül.</translation> + </message> + <message> + <location line="+270"/> + <source>Element %1 cannot have children.</source> + <translation>%1 elem nem tartalmazhat gyereket.</translation> + </message> + <message> + <location line="+434"/> + <source>Element %1 cannot have a sequence constructor.</source> + <translation>%1 elem nem tartalmazhat egy sorozat konstruktort.</translation> + </message> + <message> + <location line="+86"/> + <location line="+9"/> + <source>The attribute %1 cannot appear on %2, when it is a child of %3.</source> + <translation>A(z) %1 attribútum nem jelenhet meg %2-n, mikor egy %3 gyereke.</translation> + </message> + <message> + <location line="+15"/> + <source>A parameter in a function cannot be declared to be a tunnel.</source> + <translation>Egy paramétert nem lehet behangoltnak deklarálni egy függvényben.</translation> + </message> + <message> + <location line="+149"/> + <source>This processor is not Schema-aware and therefore %1 cannot be used.</source> + <translation>Ez a feldolgozó nem terv biztos és ennek következtében a(z) %1-t nem lehet használni.</translation> + </message> + <message> + <location line="+57"/> + <source>Top level stylesheet elements must be in a non-null namespace, which %1 isn't.</source> + <translation>Felső szintű stíluslap elemeknek nem szabad egy nem nulla névtérnek lenniük, %1 nem jó.</translation> + </message> + <message> + <location line="+48"/> + <source>The value for attribute %1 on element %2 must either be %3 or %4, not %5.</source> + <translation>%1 attribútum értékének a(z) %2-s elemen vagy %3 vagy %4, vagy %5-nek kell lennie.</translation> + </message> + <message> + <location line="+20"/> + <source>Attribute %1 cannot have the value %2.</source> + <translation>%1 attribútum nem tartalmazhat %2 értéket.</translation> + </message> + <message> + <location line="+58"/> + <source>The attribute %1 can only appear on the first %2 element.</source> + <translation>A(z) %1 attribútum kizárólag az első %2 elemen tűnhet fel.</translation> + </message> + <message> + <location line="+99"/> + <source>At least one %1 element must appear as child of %2.</source> + <translation>Legalább egy %1 elemnek mutatkoznia %2 gyerekeként.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/schema/qxsdschemachecker.cpp" line="+227"/> + <source>%1 has inheritance loop in its base type %2.</source> + <translation>%1 tartalmaz egy öröklődési hurkot annak %2 alaptípusában.</translation> + </message> + <message> + <location line="+5"/> + <location line="+24"/> + <source>Circular inheritance of base type %1.</source> + <translation>A(z) %1 alaptípus cirkuláris öröklődése.</translation> + </message> + <message> + <location line="+11"/> + <source>Circular inheritance of union %1.</source> + <translation>A(z) %1 union cirkuláris öröklődése.</translation> + </message> + <message> + <location line="+25"/> + <source>%1 is not allowed to derive from %2 by restriction as the latter defines it as final.</source> + <translation>A(z) %1 %2-ből való származtatása nem megengedett, azzal a korlátozassal, hogy az utóbbi utolsónak definiálja.</translation> + </message> + <message> + <location line="+5"/> + <source>%1 is not allowed to derive from %2 by extension as the latter defines it as final.</source> + <translation>%1-nek nem engedélyezett a %2-ből való származtatása, azzal a kiegészítéssel, hogy a utóbbi végsőnek definiálja.</translation> + </message> + <message> + <location line="+31"/> + <source>Base type of simple type %1 cannot be complex type %2.</source> + <translation>A(z) %1 egyszerű típus alaptípusa nem lehet egy %2 összetett típus.</translation> + </message> + <message> + <location line="+9"/> + <source>Simple type %1 cannot have direct base type %2.</source> + <translation>A(z) %1 egyszerű típus nem tartalmazhat közvetlen %2 alap típust.</translation> + </message> + <message> + <location line="+33"/> + <location line="+9"/> + <source>Simple type %1 is not allowed to have base type %2.</source> + <translation>%1 egyszerű típusnak nincs engedélyezve, hogy %2 alap típusokat tartalmazzon.</translation> + </message> + <message> + <location line="+12"/> + <source>Simple type %1 can only have simple atomic type as base type.</source> + <translation>A(z) %1 egyszerű típus kizárólag egyszerű atomikus típusokat tartalmazhat alaptípusként.</translation> + </message> + <message> + <location line="+6"/> + <source>Simple type %1 cannot derive from %2 as the latter defines restriction as final.</source> + <translation>%1 egyszerű típus nem származtatható %2-ből, mint ahogy az utóbbi végső korlátozásokat definiál.</translation> + </message> + <message> + <location line="+13"/> + <location line="+484"/> + <source>Variety of item type of %1 must be either atomic or union.</source> + <translation>%1 elemtípus különbözőségeinek vagy vagy atomikus vagy unionnak kell lenni.</translation> + </message> + <message> + <location line="-474"/> + <location line="+483"/> + <source>Variety of member types of %1 must be atomic.</source> + <translation>%1 tagtípusok különbözőségének atomikusnak kell lennie.</translation> + </message> + <message> + <location line="-470"/> + <location line="+451"/> + <source>%1 is not allowed to derive from %2 by list as the latter defines it as final.</source> + <translation>%1 származtatása a(z) %2-ből nem engedélyezett, listázva azt, hogy az utóbbi végsőként definiálja.</translation> + </message> + <message> + <location line="-431"/> + <source>Simple type %1 is only allowed to have %2 facet.</source> + <translation>%1 egyszerű típus kizárólag %2 oldalt tartalmazhat.</translation> + </message> + <message> + <location line="+10"/> + <source>Base type of simple type %1 must have variety of type list.</source> + <translation>%1 egyszerű típus alap típusának különböző típus listákat kell tartalmaznia.</translation> + </message> + <message> + <location line="+6"/> + <source>Base type of simple type %1 has defined derivation by restriction as final.</source> + <translation>%1 egyszerű típus alaptípusa definiálja a számaztatást végső korlátozással.</translation> + </message> + <message> + <location line="+6"/> + <source>Item type of base type does not match item type of %1.</source> + <translation>Az alap típus elem típusa nem egyezik a(z) %1 elemtípusával. </translation> + </message> + <message> + <location line="+26"/> + <location line="+93"/> + <source>Simple type %1 contains not allowed facet type %2.</source> + <translation>%1 egyszerű típus nem engedélyezett oldal %2 típusokat tartalmaz.</translation> + </message> + <message> + <location line="-72"/> + <location line="+413"/> + <source>%1 is not allowed to derive from %2 by union as the latter defines it as final.</source> + <translation>%1 %2-ből történő származtatása nem engedélyezett az unió által, az utóbbi végsőként definiálja.</translation> + </message> + <message> + <location line="-404"/> + <source>%1 is not allowed to have any facets.</source> + <translation>%1 nem tartalmazhat semmilyen oldalt.</translation> + </message> + <message> + <location line="+8"/> + <source>Base type %1 of simple type %2 must have variety of union.</source> + <translation>%2 egyszerű típus %1 alap típusának különböző egységeket kell tartalmaznia.</translation> + </message> + <message> + <location line="+9"/> + <source>Base type %1 of simple type %2 is not allowed to have restriction in %3 attribute.</source> + <translation>%2 egyszerű típus %1 alap típusa nem tartalmazhat korlátozásokat a %3 attribútumban.</translation> + </message> + <message> + <location line="+18"/> + <source>Member type %1 cannot be derived from member type %2 of %3's base type %4.</source> + <translation>%1 tag típus nem származtatható a(z) %3 %4 alap típusának %2 tagtípusából.</translation> + </message> + <message> + <location line="+65"/> + <source>Derivation method of %1 must be extension because the base type %2 is a simple type.</source> + <translation>%1 származtatása eljárásának kiterjesztésnek kell lennie, mert %2 alap típus egy egyszerű típus.</translation> + </message> + <message> + <location line="+30"/> + <source>Complex type %1 has duplicated element %2 in its content model.</source> + <translation>A(z) %1 összetett típusnak duplikáns %2 eleme van a tartalmi modellében.</translation> + </message> + <message> + <location line="+8"/> + <source>Complex type %1 has non-deterministic content.</source> + <translation>%1 összetett típusnak nincsen meghatározott tartalma.</translation> + </message> + <message> + <location line="+21"/> + <source>Attributes of complex type %1 are not a valid extension of the attributes of base type %2: %3.</source> + <translation>%1 összetett típus attribútumai a(z) %2 alap típus attribútumainak nem érvényes kiterjesztései: %3.</translation> + </message> + <message> + <location line="+37"/> + <source>Content model of complex type %1 is not a valid extension of content model of %2.</source> + <translation>%1 komplex típus tartalmi modelle a(z) %2 tartalmi modellének nem egy érvényes kiterjesztése.</translation> + </message> + <message> + <location line="+10"/> + <source>Complex type %1 must have simple content.</source> + <translation>%1 komplex típusnak tartalmaznia kell egy egyszerű tartalmat.</translation> + </message> + <message> + <location line="+7"/> + <source>Complex type %1 must have the same simple type as its base class %2.</source> + <translation>%1 komplex típusnak ugyanazt az egyszerű típust kell tartalmaznia a(z) %2 alap osztálya számára.</translation> + </message> + <message> + <location line="+67"/> + <source>Complex type %1 cannot be derived from base type %2%3.</source> + <translation>%1 komplex típus nem származtatható a(z) %2%3 alap típusból.</translation> + </message> + <message> + <location line="+14"/> + <source>Attributes of complex type %1 are not a valid restriction from the attributes of base type %2: %3.</source> + <translation>%1 komplex típus attribútumai nem egy érvényes korlátozások a(z) %2 alap típus attribútumaitól: %3.</translation> + </message> + <message> + <location line="+14"/> + <source>Complex type %1 with simple content cannot be derived from complex base type %2.</source> + <translation>%1 komplex típus egyszerű tartalommal nem származtatható %2 komplex alap típusból.</translation> + </message> + <message> + <location line="+35"/> + <source>Item type of simple type %1 cannot be a complex type.</source> + <translation>A(z) %1 egyszerű típus elemi típusa nem lehet egy komplex típus.</translation> + </message> + <message> + <location line="+44"/> + <source>Member type of simple type %1 cannot be a complex type.</source> + <translation>%1 egyszerű típus tag típusa nem lehet egy komplex típus.</translation> + </message> + <message> + <location line="+8"/> + <source>%1 is not allowed to have a member type with the same name as itself.</source> + <translation>%1 nem engedélyzett, hogy tartalmazzon egy tag típust ugyanazzal a névvel, mint a saját neve.</translation> + </message> + <message> + <location line="+83"/> + <location line="+29"/> + <location line="+34"/> + <source>%1 facet collides with %2 facet.</source> + <translation>%1 oldal ütközik a(z) %2 oldallal.</translation> + </message> + <message> + <location line="-20"/> + <source>%1 facet must have the same value as %2 facet of base type.</source> + <translation>%1 oldalnak ugyanazt az értéket kell tartalmaznia, mint az alap típus %2 oldalának.</translation> + </message> + <message> + <location line="+37"/> + <source>%1 facet must be equal or greater than %2 facet of base type.</source> + <translation>%1 oldalnak nagyobbnak vagy egyenlőnek kell lennie, mint az alap típus %2 oldalának.</translation> + </message> + <message> + <location line="+19"/> + <location line="+125"/> + <location line="+55"/> + <location line="+12"/> + <location line="+91"/> + <location line="+58"/> + <location line="+34"/> + <location line="+35"/> + <source>%1 facet must be less than or equal to %2 facet of base type.</source> + <translation>%1 oldalnal kisebb vagy egyenlőnek kell lennie az alap típus %2 oldalánál.</translation> + </message> + <message> + <location line="-389"/> + <source>%1 facet contains invalid regular expression</source> + <translation>%1 oldal érvénytelen reguláris kifejezéseket tartalmaz</translation> + </message> + <message> + <location line="+15"/> + <source>Unknown notation %1 used in %2 facet.</source> + <translation>%1 ismeretlen jelölési mód van használva a(z) %2 oldalon.</translation> + </message> + <message> + <location line="+20"/> + <source>%1 facet contains invalid value %2: %3.</source> + <translation>%1 oldal érvénytelen %2 értéket tartalmaz: %3.</translation> + </message> + <message> + <location line="+22"/> + <source>%1 facet cannot be %2 or %3 if %4 facet of base type is %5.</source> + <translation>%1 oldal nem lehet %2 vagy %3, ha az alap típus %4 oldala %5.</translation> + </message> + <message> + <location line="+11"/> + <source>%1 facet cannot be %2 if %3 facet of base type is %4.</source> + <translation>%1 oldal nem lehet %2, ha az alap típus %3 oldala %4.</translation> + </message> + <message> + <location line="+20"/> + <location line="+55"/> + <location line="+230"/> + <source>%1 facet must be less than or equal to %2 facet.</source> + <translation>%1 oldalnak kisebb egyenlőnek kell lennie a(z) %2 oldalnál.</translation> + </message> + <message> + <location line="-257"/> + <location line="+134"/> + <location line="+82"/> + <source>%1 facet must be less than %2 facet of base type.</source> + <translation>%1 oldalnak kisebbnek kell lennie az alap típus %2 oldalánál.</translation> + </message> + <message> + <location line="-201"/> + <location line="+79"/> + <source>%1 facet and %2 facet cannot appear together.</source> + <translation>%1 oldal és %2 oldal nem fordulhat elő együtt.</translation> + </message> + <message> + <location line="-27"/> + <location line="+12"/> + <location line="+113"/> + <source>%1 facet must be greater than %2 facet of base type.</source> + <translation>%1 oldalnak nagyobbnak kell lennie, mint az alaptípus %2 oldalának.</translation> + </message> + <message> + <location line="-86"/> + <location line="+58"/> + <source>%1 facet must be less than %2 facet.</source> + <translation>%1 oldalnak kisebbnek kell lenni a(z) %2 oldalnál.</translation> + </message> + <message> + <location line="-42"/> + <location line="+58"/> + <source>%1 facet must be greater than or equal to %2 facet of base type.</source> + <translation>%1 oldalnak nagyobb vagy egyenlőnek kell lennie az alap típus %2 oldalánál.</translation> + </message> + <message> + <location line="+113"/> + <source>Simple type contains not allowed facet %1.</source> + <translation>Egyszerű típus nem tartalmazhat %1 oldalt.</translation> + </message> + <message> + <location line="+12"/> + <source>%1, %2, %3, %4, %5 and %6 facets are not allowed when derived by list.</source> + <translation>%1, %2, %3, %4, %5 és %6 oldalak nem engedélyezettek listáról származtatáskor.</translation> + </message> + <message> + <location line="+16"/> + <source>Only %1 and %2 facets are allowed when derived by union.</source> + <translation>Csak a(z) %1 és %2 oldalak engedélyezettek union származtatásakor.</translation> + </message> + <message> + <location line="+23"/> + <location line="+16"/> + <source>%1 contains %2 facet with invalid data: %3.</source> + <translation>%1 %2 oldalt tartalmaz érvénytelen adattal: %3.</translation> + </message> + <message> + <location line="+24"/> + <source>Attribute group %1 contains attribute %2 twice.</source> + <translation>A(z) %1 attribútum csoport a(z) %2 attribútumot kétszer tartalmazza.</translation> + </message> + <message> + <location line="+9"/> + <source>Attribute group %1 contains two different attributes that both have types derived from %2.</source> + <translation>A(z) %1 attribútum csoport két különböző attribútumot tartalmaz, melyek közül mindkettő %2-ból számaztatott típusokat tartalmaz.</translation> + </message> + <message> + <location line="+8"/> + <source>Attribute group %1 contains attribute %2 that has value constraint but type that inherits from %3.</source> + <translation>A(z) %1 attribútum csoport %2 attribútumot tartalmaz, amely olyan megszorított értéket tartalmaz, kivéve a típust, amit %3-ból örököl.</translation> + </message> + <message> + <location line="+23"/> + <source>Complex type %1 contains attribute %2 twice.</source> + <translation>A(z) %1 összetett típus %2 attribútumot tartalmazza kétszer.</translation> + </message> + <message> + <location line="+9"/> + <source>Complex type %1 contains two different attributes that both have types derived from %2.</source> + <translation>%1 komplex típus két különböző attribútumot tartalmaz, amelyek közül mindkettő %2-ból származtatott típusokat tartalmaz.</translation> + </message> + <message> + <location line="+8"/> + <source>Complex type %1 contains attribute %2 that has value constraint but type that inherits from %3.</source> + <translation>%1 kompex típus %2 attribútumot tartalmaz, aminek megszorító értéke van, kivéve a típust, amit a(z) %3-ból örököl.</translation> + </message> + <message> + <location line="+43"/> + <source>Element %1 is not allowed to have a value constraint if its base type is complex.</source> + <translation>%1 elem nem tartalmazhat egy korlátozott értéket, ha az alaptípusa komplex.</translation> + </message> + <message> + <location line="+7"/> + <source>Element %1 is not allowed to have a value constraint if its type is derived from %2.</source> + <translation>%1 elem nem tartalmazhat egy korlátozott értéket, ha a típusa a(z) %2-ből származik.</translation> + </message> + <message> + <location line="+10"/> + <location line="+11"/> + <source>Value constraint of element %1 is not of elements type: %2.</source> + <translation>%1 elem korlátozó értéke nem elemi típus: %2.</translation> + </message> + <message> + <location line="+13"/> + <source>Element %1 is not allowed to have substitution group affiliation as it is no global element.</source> + <translation>%1 elem nem tartalmazhat helyettesítési csoport egyesítést, mert nem egy globális elem.</translation> + </message> + <message> + <location line="+28"/> + <source>Type of element %1 cannot be derived from type of substitution group affiliation.</source> + <translation>%1 elem típus nem származtatható helyettesítési csoport egyesítési típusból.</translation> + </message> + <message> + <location line="+41"/> + <source>Value constraint of attribute %1 is not of attributes type: %2.</source> + <translation>%1 attribútum korlátozó értéke nem attribútum típus: %2.</translation> + </message> + <message> + <location line="+9"/> + <source>Attribute %1 has value constraint but has type derived from %2.</source> + <translation>%1 attribútumnak korlátozó értéke van, de %2-ből származtatott típust tartalmaz.</translation> + </message> + <message> + <location line="+56"/> + <source>%1 attribute in derived complex type must be %2 like in base type.</source> + <translation>%1 attribútum egy származtatott komplex típusban %2-nek kell lennie, mint az alap típusban.</translation> + </message> + <message> + <location line="+11"/> + <source>Attribute %1 in derived complex type must have %2 value constraint like in base type.</source> + <translation>A származtatott komplex típusban levő %1 attribútumnak %2 érték korlátozót kell tartalmaznia, mint az alap típusban.</translation> + </message> + <message> + <location line="+9"/> + <source>Attribute %1 in derived complex type must have the same %2 value constraint like in base type.</source> + <translation>Származtatott komplex típusban levő %1 attribútumnak ugyanazt a(z) %2 korlátozott értéket kell tartalmaznia, mint az alap típusban.</translation> + </message> + <message> + <location line="+7"/> + <source>Attribute %1 in derived complex type must have %2 value constraint.</source> + <translation>Származtatott komplex típusban levő %1 attribútumnak %2 érték korlátozót kell tartalmaznia.</translation> + </message> + <message> + <location line="+18"/> + <source>processContent of base wildcard must be weaker than derived wildcard.</source> + <translation>Az alap helyettesítő jel folyamat tartalma gyengébb kell legyen, mint a származtatott helyettesítő jel.</translation> + </message> + <message> + <location line="+39"/> + <location line="+15"/> + <source>Element %1 exists twice with different types.</source> + <translation>%1 elem kétszer létezik különböző típusokkal.</translation> + </message> + <message> + <location line="+28"/> + <source>Particle contains non-deterministic wildcards.</source> + <translation>A részecske nem meghatározott helyettesítő jeleket tartalmaz.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/schema/qxsdschemahelper.cpp" line="+691"/> + <location line="+63"/> + <source>Base attribute %1 is required but derived attribute is not.</source> + <translation>A(z) %1 alap attribútum szükséges, de a származtatott attribútum nem.</translation> + </message> + <message> + <location line="-57"/> + <source>Type of derived attribute %1 cannot be validly derived from type of base attribute.</source> + <translation>A(z) %1 származtatott attribútum típusa nem lehet érvényesen származtatni az alap attribútum típusból.</translation> + </message> + <message> + <location line="+28"/> + <source>Value constraint of derived attribute %1 does not match value constraint of base attribute.</source> + <translation>'%1 származtatott attribútum érték korlátozója nem egyezik az alap attribútum érték korlátozójával.</translation> + </message> + <message> + <location line="+5"/> + <source>Derived attribute %1 does not exist in the base definition.</source> + <translation>%1 származtatott attribútum nem létezik az alap definícióban.</translation> + </message> + <message> + <location line="+11"/> + <source>Derived attribute %1 does not match the wildcard in the base definition.</source> + <translation>%1 származtatott attribútum nem egyezik a helyettesítő jellel az alap definícióban.</translation> + </message> + <message> + <location line="+17"/> + <source>Base attribute %1 is required but missing in derived definition.</source> + <translation>%1 alap attribútum szükséges, de hiáynzik a származtatott definícióban.</translation> + </message> + <message> + <location line="+9"/> + <source>Derived definition contains an %1 element that does not exists in the base definition</source> + <translation>A származtatot definíció egy %1 elemet tartalmaz, ami nem létezik az alap definícióban</translation> + </message> + <message> + <location line="+5"/> + <source>Derived wildcard is not a subset of the base wildcard.</source> + <translation>Származtatott helyettesítőjel nem az alap helyettesítőjel egy részhalmaza.</translation> + </message> + <message> + <location line="+5"/> + <source>%1 of derived wildcard is not a valid restriction of %2 of base wildcard</source> + <translation>Származtaott helyettesítő jel %1-e nem az alap helyettesítőjel %2-nek egy érvényes korlátozója</translation> + </message> + <message> + <location line="+23"/> + <source>Attribute %1 from base type is missing in derived type.</source> + <translation>Az alap típus %1 attribútuma hiányzik a származtatott típusban.</translation> + </message> + <message> + <location line="+5"/> + <source>Type of derived attribute %1 differs from type of base attribute.</source> + <translation>A(z) %1 származtatott típus az alap attribútum típusától különbözik.</translation> + </message> + <message> + <location line="+8"/> + <source>Base definition contains an %1 element that is missing in the derived definition</source> + <translation>Az alap definíció egy %1 elemet tartalmaz, ami hiányzik a származtatott definícióból</translation> + </message> + <message> + <location filename="../src/xmlpatterns/schema/qxsdschemaresolver.cpp" line="+354"/> + <source>%1 references unknown %2 or %3 element %4.</source> + <translation>%1 ismeretlen %2 vagy %3 elemre hivatkozik %4.</translation> + </message> + <message> + <location line="+10"/> + <source>%1 references identity constraint %2 that is no %3 or %4 element.</source> + <translation>%1 %2 indentitás korlátozóra hivatkozik, ami nem %3 vagy %4 elem.</translation> + </message> + <message> + <location line="+10"/> + <source>%1 has a different number of fields from the identity constraint %2 that it references.</source> + <translation>%1 mezők egy különböző számát tartalmazza a(z) %2 indetitás korlátozóbol, amelyik erre hivatkozik.</translation> + </message> + <message> + <location line="+23"/> + <source>Base type %1 of %2 element cannot be resolved.</source> + <translation>%1 elem %2 alap típusát nem lehet megfejteni.</translation> + </message> + <message> + <location line="+84"/> + <source>Item type %1 of %2 element cannot be resolved.</source> + <translation>%2 elem %1 elem típusát nem lehet megfejteni.</translation> + </message> + <message> + <location line="+31"/> + <source>Member type %1 of %2 element cannot be resolved.</source> + <translation>%2 elem %1 tag típusát nem lehet megoldani.</translation> + </message> + <message> + <location line="+28"/> + <location line="+408"/> + <location line="+30"/> + <source>Type %1 of %2 element cannot be resolved.</source> + <translation>%2 elem %1 típusát nem lehet megoldani.</translation> + </message> + <message> + <location line="-416"/> + <source>Base type %1 of complex type cannot be resolved.</source> + <translation>Komplex típus %1 alap típusát nem lehet megfejteni.</translation> + </message> + <message> + <location line="+9"/> + <source>%1 cannot have complex base type that has a %2.</source> + <translation>%1 nem tartalmazhat komplex alap típusokat, egy %2-t tartalmaz.</translation> + </message> + <message> + <location line="+279"/> + <source>Content model of complex type %1 contains %2 element so it cannot be derived by extension from a non-empty type.</source> + <translation>%1 komplex típus tartalmi modelle %2 elemet tartalmaz, tehát nem származtatható kiterjesztésben egy nem üres típusból.</translation> + </message> + <message> + <location line="+6"/> + <source>Complex type %1 cannot be derived by extension from %2 as the latter contains %3 element in its content model.</source> + <translation>%1 komplex nem típus nem származtatható kiterjesztésben %2-ből, mert az utóbbi %3 elemet tartalmaz a tartalmi modellében.</translation> + </message> + <message> + <location line="+101"/> + <source>Type of %1 element must be a simple type, %2 is not.</source> + <translation>%1 elem típusnak egy egyszerű típusnak kell, de %2 nem az.</translation> + </message> + <message> + <location line="+62"/> + <source>Substitution group %1 of %2 element cannot be resolved.</source> + <translation>%2 elem %1 helyettesítési csoportját nem lehet megoldani.</translation> + </message> + <message> + <location line="+9"/> + <source>Substitution group %1 has circular definition.</source> + <translation>%1 helyettesítési csoport cirkuláris definíciót tartalmaz.</translation> + </message> + <message> + <location line="+120"/> + <location line="+7"/> + <source>Duplicated element names %1 in %2 element.</source> + <translation>Duplikát %1 elemnév %2 elemben.</translation> + </message> + <message> + <location line="+29"/> + <location line="+52"/> + <location line="+71"/> + <location line="+28"/> + <source>Reference %1 of %2 element cannot be resolved.</source> + <translation>%2 elem %1 hivatkozását nem lehet megoldani.</translation> + </message> + <message> + <location line="-138"/> + <source>Circular group reference for %1.</source> + <translation>Cirkuláris csoport hivatkozás %1-re.</translation> + </message> + <message> + <location line="+16"/> + <source>%1 element is not allowed in this scope</source> + <translation>%1 elem nem engedélyezett ebben a hatókörben</translation> + </message> + <message> + <location line="+5"/> + <source>%1 element cannot have %2 attribute with value other than %3.</source> + <translation>%1 elem nem tartalmazhat %2 attribútumot %3-tól eltérő értékkel.</translation> + </message> + <message> + <location line="+8"/> + <source>%1 element cannot have %2 attribute with value other than %3 or %4.</source> + <translation>%1 element nem tartalmazhat %2 attribútumot %3 vagy %4-től eltérő értékkel.</translation> + </message> + <message> + <location line="+91"/> + <source>%1 or %2 attribute of reference %3 does not match with the attribute declaration %4.</source> + <translation>%3 hivatkozás %1 vagy %2 attribútuma nem egyezik meg a(z) %4 attribútum deklarációval.</translation> + </message> + <message> + <location line="+25"/> + <source>Attribute group %1 has circular reference.</source> + <translation>%1 attribútum csoport cirkuláris hivatkozást tartalmaz.</translation> + </message> + <message> + <location line="+131"/> + <source>%1 attribute in %2 must have %3 use like in base type %4.</source> + <translation>%2-ben található %1 attribútumnak %3 használatát kell tartalmaznia, mint a(z) %4 alap típusban.</translation> + </message> + <message> + <location line="+52"/> + <source>Attribute wildcard of %1 is not a valid restriction of attribute wildcard of base type %2.</source> + <translation>%1 attribútum helyettesítő jele nem a(z) %2 alap típus attribútum helyettesítő jelének egy érvényes korlátozása.</translation> + </message> + <message> + <location line="+7"/> + <source>%1 has attribute wildcard but its base type %2 has not.</source> + <translation>%1 attribútum helyettesítő jelet tartalmaz, de a(z) %2 alap típusa nem.</translation> + </message> + <message> + <location line="+26"/> + <source>Union of attribute wildcard of type %1 and attribute wildcard of its base type %2 is not expressible.</source> + <translation>%2 alaptípusának attribútum helyettesítő jele és a(z) %1 típus attribútum helyettesítő jelének union-ja nem kifejezhető.</translation> + </message> + <message> + <location line="+48"/> + <source>Enumeration facet contains invalid content: {%1} is not a value of type %2.</source> + <translation>Felsorolás oldal érvénytelen tartalmat tartalmaz. {%1} nem egy érvényes %2 típus érték.</translation> + </message> + <message> + <location line="+10"/> + <source>Namespace prefix of qualified name %1 is not defined.</source> + <translation>%1 minősített név névtér előtagja nincs definiálva.</translation> + </message> + <message> + <location line="+51"/> + <location line="+18"/> + <source>%1 element %2 is not a valid restriction of the %3 element it redefines: %4.</source> + <translation>%2 elem %1 nem a(z) %3 elem egy érvényes korlátozása, újradefininálja: %4.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/schema/qxsdparticlechecker.cpp" line="+165"/> + <source>Empty particle cannot be derived from non-empty particle.</source> + <translation>Üres részecskét nem lehet egy üres részecskéből származtatni.</translation> + </message> + <message> + <location line="+15"/> + <source>Derived particle is missing element %1.</source> + <translation>Származtatott részecskének van egy %1 hiányzó eleme.</translation> + </message> + <message> + <location line="+7"/> + <source>Derived element %1 is missing value constraint as defined in base particle.</source> + <translation>%1 származtatott elem hiányol egy érték korlátozót, ami az alap részecskében van definiálva.</translation> + </message> + <message> + <location line="+5"/> + <source>Derived element %1 has weaker value constraint than base particle.</source> + <translation>%1 származtatott elem gyengébb érték korlátozót tartalmaz, mint az alap részecske.</translation> + </message> + <message> + <location line="+7"/> + <source>Fixed value constraint of element %1 differs from value constraint in base particle.</source> + <translation>%1 elem fix érték korlátozója különbözik az alap részecskében található érték korlátozótól.</translation> + </message> + <message> + <location line="+7"/> + <source>Derived element %1 cannot be nillable as base element is not nillable.</source> + <translation>%1 származtatott elem nem lehet nullázható, mint ahogy az alap elem sem nullázható.</translation> + </message> + <message> + <location line="+10"/> + <source>Block constraints of derived element %1 must not be more weaker than in the base element.</source> + <translation>%1 származtatott elem blokk korlátozója nem lehet gyengébb, mint az alap elemben.</translation> + </message> + <message> + <location line="+11"/> + <source>Simple type of derived element %1 cannot be validly derived from base element.</source> + <translation>%1 származtatott elem egyszerű típusa nem származtatható érvényesen az alap elemből.</translation> + </message> + <message> + <location line="+5"/> + <source>Complex type of derived element %1 cannot be validly derived from base element.</source> + <translation>%1 származtatott elem komplex típusa nem származtatható érvényesen az alap elemből.</translation> + </message> + <message> + <location line="+24"/> + <source>Element %1 is missing in derived particle.</source> + <translation>%1 elem hiányzik a származtott récseszkében.</translation> + </message> + <message> + <location line="+18"/> + <source>Element %1 does not match namespace constraint of wildcard in base particle.</source> + <translation>%1 elem nem egyezik meg az alap részecskében található helyettesítő jel névtér korlátozójával.</translation> + </message> + <message> + <location line="+11"/> + <source>Wildcard in derived particle is not a valid subset of wildcard in base particle.</source> + <translation>Helyettesítő jel a származtatott részecskénen nem az alap részecskében található helyettesítő jel egy érvényes részhalmaza.</translation> + </message> + <message> + <location line="+5"/> + <source>processContent of wildcard in derived particle is weaker than wildcard in base particle.</source> + <translation>A származtatott részecskében található helyettesítő jel folyamatTartalma gyengébb, mint az alap részecskében található helyettesítő jel.</translation> + </message> + <message> + <location line="+240"/> + <source>Derived particle allows content that is not allowed in the base particle.</source> + <translation>Származtatott részecske engedélyezi a tartalmat, ami nem engedélyezett az alap részecskében.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/schema/qxsdschemaparser.cpp" line="+170"/> + <source>Can not process unknown element %1, expected elements are: %2.</source> + <translation>Nem lehet feldolgozni ismeretlen %1 elemet, várt elemek: %2.</translation> + </message> + <message> + <location line="+13"/> + <source>Element %1 is not allowed in this scope, possible elements are: %2.</source> + <translation>%1 elem nem engedélyezett ebben a hatórközben, lehetséges elemek: %2.</translation> + </message> + <message> + <location line="+16"/> + <source>Child element is missing in that scope, possible child elements are: %1.</source> + <translation>Gyermek elem hiányzik abban a hatókörben, lehetséges gyermek elemek: %1.</translation> + </message> + <message> + <location line="+127"/> + <source>Document is not a XML schema.</source> + <translation>Dokumentum nem egy XML terv.</translation> + </message> + <message> + <location line="+22"/> + <source>%1 attribute of %2 element contains invalid content: {%3} is not a value of type %4.</source> + <translation>%2 elem %1 attribútuma érvénytelen tartalmat tartalmaz: {%3} nem egy %4 típus érték.</translation> + </message> + <message> + <location line="+6"/> + <source>%1 attribute of %2 element contains invalid content: {%3}.</source> + <translation>%2 elem %1 attribútuma érvénytelen tartalmat tartalmaz: {%3}.</translation> + </message> + <message> + <location line="+26"/> + <source>Target namespace %1 of included schema is different from the target namespace %2 as defined by the including schema.</source> + <translation>A beleértett terv %1 cél névtere különbözik a %2 cél névtértől, amit a beleértett terv által lett definiálva.</translation> + </message> + <message> + <location line="+14"/> + <location line="+11"/> + <source>Target namespace %1 of imported schema is different from the target namespace %2 as defined by the importing schema.</source> + <translation>Az importált terv %1 cél névtere különbözik a(z) %2 cél névtértől, ami az importált terv által van definiálva.</translation> + </message> + <message> + <location line="+237"/> + <source>%1 element is not allowed to have the same %2 attribute value as the target namespace %3.</source> + <translation>%1 elem nem tartalmazhatja ugyanazt a(z) %2 attribútum értéket, mint a(z) %3 cél névtér.</translation> + </message> + <message> + <location line="+8"/> + <source>%1 element without %2 attribute is not allowed inside schema without target namespace.</source> + <translation>%1 elem %2 attribútum nélkül nem engedélyezett a vázlaton belül cél névtér nélkül.</translation> + </message> + <message> + <location line="+833"/> + <location line="+158"/> + <source>%1 element is not allowed inside %2 element if %3 attribute is present.</source> + <translation>%1 elem nem engedélyezett a(z) %2 elemen belül, ha %3 attribútum van nyújtva.</translation> + </message> + <message> + <location line="-97"/> + <location line="+119"/> + <location line="+92"/> + <source>%1 element has neither %2 attribute nor %3 child element.</source> + <translation>%1 elem nem tartalmaz %2 attribútumot és %3 gyermek elemet sem.</translation> + </message> + <message> + <location line="+835"/> + <location line="+1474"/> + <location line="+232"/> + <location line="+7"/> + <location line="+260"/> + <location line="+17"/> + <location line="+258"/> + <location line="+6"/> + <location line="+17"/> + <location line="+6"/> + <location line="+17"/> + <location line="+11"/> + <location line="+11"/> + <location line="+11"/> + <source>%1 element with %2 child element must not have a %3 attribute.</source> + <translation>%1 elem %2 gyermek elemmel nem tartalmazhat egy %3 attribútumot.</translation> + </message> + <message> + <location line="-1325"/> + <source>%1 attribute of %2 element must be %3 or %4.</source> + <translation>%2 elem %1 attribútumának %3 vagy %4-nek kell lennie.</translation> + </message> + <message> + <location line="+36"/> + <source>%1 attribute of %2 element must have a value of %3.</source> + <translation>%2 elem %1 attribútumának %3 egy értékét tartalmaznia kell.</translation> + </message> + <message> + <location line="+7"/> + <location line="+34"/> + <source>%1 attribute of %2 element must have a value of %3 or %4.</source> + <translation>%2 elem %1 attribútumának tartalmaznia kell %3 vagy %4 egy értékét.</translation> + </message> + <message> + <location line="+319"/> + <location line="+129"/> + <location line="+9"/> + <location line="+7"/> + <location line="+7"/> + <location line="+327"/> + <location line="+203"/> + <location line="+6"/> + <location line="+6"/> + <location line="+6"/> + <location line="+6"/> + <location line="+6"/> + <location line="+6"/> + <location line="+77"/> + <source>%1 element must not have %2 and %3 attribute together.</source> + <translation>%1 elemnek tartalmaznia kell %2 és %3 attribútumokat együttesen.</translation> + </message> + <message> + <location line="-768"/> + <location line="+222"/> + <source>Content of %1 attribute of %2 element must not be from namespace %3.</source> + <translation>%2 elem %1 attribútumának tartalmának nem szabad a(z) %3 névtérből lennie.</translation> + </message> + <message> + <location line="-215"/> + <location line="+222"/> + <source>%1 attribute of %2 element must not be %3.</source> + <translation>%2 elem %1 attribútumának nem szabad %3-nak lennie.</translation> + </message> + <message> + <location line="-64"/> + <source>%1 attribute of %2 element must have the value %3 because the %4 attribute is set.</source> + <translation>%2 elem %1 attribútumának tartalmaznia kell %3 értéket, mert %4 attribútum be van állítva.</translation> + </message> + <message> + <location line="+187"/> + <source>Specifying use='prohibited' inside an attribute group has no effect.</source> + <translation>Használat meghatározásának = 'tiltott' egy attribútum csoportját belül nincsen hatása.</translation> + </message> + <message> + <location line="+353"/> + <source>%1 element must have either %2 or %3 attribute.</source> + <translation>%1 elemnek vagy %2 vagy %3 attribútumot tartalmaznia kell.</translation> + </message> + <message> + <location line="+554"/> + <source>%1 element must have either %2 attribute or %3 or %4 as child element.</source> + <translation>%1 elemnek tartalmaznia kell vagy %2 vagy %3 vagy %4 attribútumot, mint ahogy a gyermek elem.</translation> + </message> + <message> + <location line="+55"/> + <source>%1 element requires either %2 or %3 attribute.</source> + <translation>%1 elem vagy %2 vagy %3 attribútumot igényli.</translation> + </message> + <message> + <location line="+19"/> + <source>Text or entity references not allowed inside %1 element</source> + <translation>Szöveg avgy entitás hivatkozás nem engedélyezett a(z) %1 elemen belül</translation> + </message> + <message> + <location line="+41"/> + <location line="+112"/> + <source>%1 attribute of %2 element must contain %3, %4 or a list of URIs.</source> + <translation>%2 elem %1 attribútumának tartalmaznia kell %3, %4 vagy URI-k egy listáját.</translation> + </message> + <message> + <location line="+126"/> + <source>%1 element is not allowed in this context.</source> + <translation>%1 elem nem engedélyezett ebben a szöveg környezetben.</translation> + </message> + <message> + <location line="+53"/> + <source>%1 attribute of %2 element has larger value than %3 attribute.</source> + <translation>%2 elem %1 attribútuma nagyobb értéket tartalmaz, mint a %3 attribútum.</translation> + </message> + <message> + <location line="+25"/> + <source>Prefix of qualified name %1 is not defined.</source> + <translation>A(z) %1 minősített név előtagja nem definiált.</translation> + </message> + <message> + <location line="+65"/> + <location line="+61"/> + <source>%1 attribute of %2 element must either contain %3 or the other values.</source> + <translation>%2 elem %1 attribútumának vagy %3 vagy más értékeket kell tartalmaznia.</translation> + </message> + <message> + <location line="+131"/> + <source>Component with ID %1 has been defined previously.</source> + <translation>%1 azonosítóval rendelkezővel komponens előzőleg definiálva lett.</translation> + </message> + <message> + <location line="+17"/> + <source>Element %1 already defined.</source> + <translation>%1 elem már definiálva van.</translation> + </message> + <message> + <location line="+11"/> + <source>Attribute %1 already defined.</source> + <translation>%1 attribútum már definiálva van.</translation> + </message> + <message> + <location line="+15"/> + <source>Type %1 already defined.</source> + <translation>%1 típus már definiálva van.</translation> + </message> + <message> + <location line="+23"/> + <source>Attribute group %1 already defined.</source> + <translation>%1 csoport attribútum már definiálva van.</translation> + </message> + <message> + <location line="+11"/> + <source>Element group %1 already defined.</source> + <translation>%1 csoport elem már definiálva van.</translation> + </message> + <message> + <location line="+11"/> + <source>Notation %1 already defined.</source> + <translation>%1 értesítés már definiálva van.</translation> + </message> + <message> + <location line="+11"/> + <source>Identity constraint %1 already defined.</source> + <translation>%1 azonosító korlátozó már definiálva van.</translation> + </message> + <message> + <location line="+11"/> + <source>Duplicated facets in simple type %1.</source> + <translation>Duplikált oldalak %1 egyszerű típusban.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/schema/qxsdtypechecker.cpp" line="+233"/> + <location line="+7"/> + <location line="+21"/> + <source>%1 is not valid according to %2.</source> + <translation>%1 nem érvényes %2 szerint.</translation> + </message> + <message> + <location line="+167"/> + <source>String content does not match the length facet.</source> + <translation>Sztring tartalom nem egyezik a hossz oldallal.</translation> + </message> + <message> + <location line="+8"/> + <source>String content does not match the minLength facet.</source> + <translation>Sztring tartalom nem egyezik a minimális hosszúságú felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>String content does not match the maxLength facet.</source> + <translation>Sztring tartalom nem egyezik a maximális hosszúságú felülettel.</translation> + </message> + <message> + <location line="+18"/> + <source>String content does not match pattern facet.</source> + <translation>Sztrng tartalom nem egyezik a minta felülettel.</translation> + </message> + <message> + <location line="+18"/> + <source>String content is not listed in the enumeration facet.</source> + <translation>Sztring tartalom nincs listázva a felsorol felületben.</translation> + </message> + <message> + <location line="+17"/> + <source>Signed integer content does not match the maxInclusive facet.</source> + <translation>Előjeles egész szám tartalom nem egyezik a maximális beleszámított felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Signed integer content does not match the maxExclusive facet.</source> + <translation>Előjeles egész szám tartalom nem egyzik a maximális kizárólagos felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Signed integer content does not match the minInclusive facet.</source> + <translation>Előjeles egész szám tartalom nem egyezik a minimális beleértet felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Signed integer content does not match the minExclusive facet.</source> + <translation>Előjeles egész szám tartalom nem egyezik a minimális kizárólagos felülettel.</translation> + </message> + <message> + <location line="+18"/> + <source>Signed integer content is not listed in the enumeration facet.</source> + <translation>Előjeles egész szám tartalom nincsen kilistázva a felsorolási felületben.</translation> + </message> + <message> + <location line="+18"/> + <source>Signed integer content does not match pattern facet.</source> + <translation>Előjeles egész szám tartalom nem egyezik a minta felületben.</translation> + </message> + <message> + <location line="+9"/> + <source>Signed integer content does not match in the totalDigits facet.</source> + <translation>Előjeles egész szám tartalom nem egyezik a teljesSzámos felület.</translation> + </message> + <message> + <location line="+17"/> + <source>Unsigned integer content does not match the maxInclusive facet.</source> + <translation>Nem előjeles egész szám tartalom nem egyezik a maximális beleértett felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Unsigned integer content does not match the maxExclusive facet.</source> + <translation>Nem előjeles egész szám tartalom nem egyezik a maximális kizárólagos felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Unsigned integer content does not match the minInclusive facet.</source> + <translation>Nem előjeles tartalom nem egyezik a minimális beleértett felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Unsigned integer content does not match the minExclusive facet.</source> + <translation>Nem előjeleg egész szám tartalom nem egyezik a beleértett minimális felülettel.</translation> + </message> + <message> + <location line="+18"/> + <source>Unsigned integer content is not listed in the enumeration facet.</source> + <translation>Nem előjeles egész szám tartalom nincsen kilistázva a felsorolási felületben.</translation> + </message> + <message> + <location line="+18"/> + <source>Unsigned integer content does not match pattern facet.</source> + <translation>Nem előjeles egész szám tartalom nem egyezik a minta felületben.</translation> + </message> + <message> + <location line="+9"/> + <source>Unsigned integer content does not match in the totalDigits facet.</source> + <translation>Nem előjeles egész szám tartalom nem egyezik a teljesSzámos felületben.</translation> + </message> + <message> + <location line="+17"/> + <source>Double content does not match the maxInclusive facet.</source> + <translation>Dupla tartalom nem egyezik a maximális beleértett felületben.</translation> + </message> + <message> + <location line="+8"/> + <source>Double content does not match the maxExclusive facet.</source> + <translation>Dupla tartalom nem egyezik a maximális kizárólagos felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Double content does not match the minInclusive facet.</source> + <translation>Dupla tartalom nem egyezik a minimális beleértett felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Double content does not match the minExclusive facet.</source> + <translation>Dupla tartalom nem egyezik a minimális kizárólag felülettel.</translation> + </message> + <message> + <location line="+18"/> + <source>Double content is not listed in the enumeration facet.</source> + <translation>Dupla tartalom nincs listázva a felsorolási felületben.</translation> + </message> + <message> + <location line="+18"/> + <source>Double content does not match pattern facet.</source> + <translation>Dupla tartalom nem egyezik a minta felületben.</translation> + </message> + <message> + <location line="+18"/> + <source>Decimal content does not match in the fractionDigits facet.</source> + <translation>Tizedes tartalom nem egyezik a szám tényezős felületben.</translation> + </message> + <message> + <location line="+9"/> + <source>Decimal content does not match in the totalDigits facet.</source> + <translation>Tizedes tartalom nem egyezik a teljesenSzámos felületben.</translation> + </message> + <message> + <location line="+14"/> + <source>Date time content does not match the maxInclusive facet.</source> + <translation>Dátum idő tartalom nem egyezik a maximális beleértett felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Date time content does not match the maxExclusive facet.</source> + <translation>Dátum idő tartalom nem egyezik a maximális kizárólagos felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Date time content does not match the minInclusive facet.</source> + <translation>Dátum idő tartalom nem egyezik a minimális beleértett felülettel.</translation> + </message> + <message> + <location line="+8"/> + <source>Date time content does not match the minExclusive facet.</source> + <translation>Dátum idő tartalom nem egyezik a minimális kizárólagos felülettel.</translation> + </message> + <message> + <location line="+18"/> + <source>Date time content is not listed in the enumeration facet.</source> + <translation>Dátum idő tartalom nincsen kilistázva a felsorolási felületben.</translation> + </message> + <message> + <location line="+18"/> + <source>Date time content does not match pattern facet.</source> + <translation>Dátum idő tartalom nem egyezik a minta felületben.</translation> + </message> + <message> + <location line="+15"/> + <source>Duration content does not match the maxInclusive facet.</source> + <translation>Tartalom időtartam nem egyezik a maximális beleértett felülettel.</translation> + </message> + <message> + <location line="+9"/> + <source>Duration content does not match the maxExclusive facet.</source> + <translation>Tartalom időtartam nem egyezik a maximális kizárólagos felülettel.</translation> + </message> + <message> + <location line="+9"/> + <source>Duration content does not match the minInclusive facet.</source> + <translation>Tartalom időtartam nem egyezik a minimális benne foglalt felülettel.</translation> + </message> + <message> + <location line="+9"/> + <source>Duration content does not match the minExclusive facet.</source> + <translation>Tartalom időtartam nem egyezik a minimális kizárólagos felülettel.</translation> + </message> + <message> + <location line="+18"/> + <source>Duration content is not listed in the enumeration facet.</source> + <translation>Tartalom időtartam nincs listázva a felsorolási felületben.</translation> + </message> + <message> + <location line="+18"/> + <source>Duration content does not match pattern facet.</source> + <translation>Tartalom időtartam nem egyezik a felület mintában.</translation> + </message> + <message> + <location line="+27"/> + <source>Boolean content does not match pattern facet.</source> + <translation>Logikai tartalom nem egyezik a minta felületben.</translation> + </message> + <message> + <location line="+17"/> + <source>Binary content does not match the length facet.</source> + <translation>Bináris tartalom nem egyezik a hossz felületben.</translation> + </message> + <message> + <location line="+8"/> + <source>Binary content does not match the minLength facet.</source> + <translation>Bináris tartalom nem egyezik a minimális hossz felületben.</translation> + </message> + <message> + <location line="+8"/> + <source>Binary content does not match the maxLength facet.</source> + <translation>Bináris tartalom nem egyezik a maximális hossz felületben.</translation> + </message> + <message> + <location line="+18"/> + <source>Binary content is not listed in the enumeration facet.</source> + <translation>Bináris tartalom nincsen kilistázva a felsorolási felületben.</translation> + </message> + <message> + <location line="+27"/> + <source>Invalid QName content: %1.</source> + <translation>Érvénytelen QName tartalom: %1.</translation> + </message> + <message> + <location line="+17"/> + <source>QName content is not listed in the enumeration facet.</source> + <translation>QName tartalom nincsen kilistázva a felsorolási felületben.</translation> + </message> + <message> + <location line="+18"/> + <source>QName content does not match pattern facet.</source> + <translation>QName tartalom nem egyezik a mintha felületben.</translation> + </message> + <message> + <location line="+36"/> + <source>Notation content is not listed in the enumeration facet.</source> + <translation>Tartalom jelölés nincsen kilistázva a felsorolási felületben.</translation> + </message> + <message> + <location line="+19"/> + <source>List content does not match length facet.</source> + <translation>Tartalom lista nem egyezik a hossz felületben.</translation> + </message> + <message> + <location line="+7"/> + <source>List content does not match minLength facet.</source> + <translation>Tartalmi lista nem egyezik a minimális hossz felületben.</translation> + </message> + <message> + <location line="+7"/> + <source>List content does not match maxLength facet.</source> + <translation>Tartalmi list nem egyezik a maximális hossz felületen.</translation> + </message> + <message> + <location line="+90"/> + <source>List content is not listed in the enumeration facet.</source> + <translation>Tartalmi lista nincsen kilistázva a felsorolási felületen.</translation> + </message> + <message> + <location line="+18"/> + <source>List content does not match pattern facet.</source> + <translation>Tartalmi lista nem egyezik a minta felületen.</translation> + </message> + <message> + <location line="+39"/> + <source>Union content is not listed in the enumeration facet.</source> + <translation>Egység tartalom nincsen kilistázva a felsorolási felületen.</translation> + </message> + <message> + <location line="+18"/> + <source>Union content does not match pattern facet.</source> + <translation>Egység tartalom nem egyezik a minta felületen.</translation> + </message> + <message> + <location line="+15"/> + <source>Data of type %1 are not allowed to be empty.</source> + <translation>%1 típus adata nem engedélyezett, hogy üres legyen.</translation> + </message> + <message> + <location filename="../src/xmlpatterns/schema/qxsdvalidatinginstancereader.cpp" line="+160"/> + <source>Element %1 is missing child element.</source> + <translation>%1 elem hiányzik a gyermek elemből.</translation> + </message> + <message> + <location line="+16"/> + <source>There is one IDREF value with no corresponding ID: %1.</source> + <translation>Van egy IDREF érték nem megfelelő azonosítóval: %1.</translation> + </message> + <message> + <location line="+27"/> + <source>Loaded schema file is invalid.</source> + <translation>Betöltött terv fájl nem létezik.</translation> + </message> + <message> + <location line="+16"/> + <source>%1 contains invalid data.</source> + <translation>%1 érvénytelen adatot tartalmaz.</translation> + </message> + <message> + <location line="+13"/> + <source>xsi:schemaLocation namespace %1 has already appeared earlier in the instance document.</source> + <translation>xsi:tervElhelyezkedés %1 névtér már előfordult korábban a példa dokumentumban.</translation> + </message> + <message> + <location line="+22"/> + <source>xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute.</source> + <translation>xsi:tervElhelyezkedés névtér nem fordulhat elő az első nem névtér elem vagy attribútum után.</translation> + </message> + <message> + <location line="+18"/> + <source>No schema defined for validation.</source> + <translation>Nincsen terv definiálva jóváhagyásra.</translation> + </message> + <message> + <location line="+10"/> + <source>No definition for element %1 available.</source> + <translation>Nincsen elérhető definíció a(z) %1 elemre.</translation> + </message> + <message> + <location line="+18"/> + <location line="+49"/> + <location line="+142"/> + <source>Specified type %1 is not known to the schema.</source> + <translation>%1 meghatározott típus ismeretlen a terv számára.</translation> + </message> + <message> + <location line="-176"/> + <source>Element %1 is not defined in this scope.</source> + <translation>%1 elem nincs definiálva ebben a hatókörben.</translation> + </message> + <message> + <location line="+43"/> + <source>Declaration for element %1 does not exist.</source> + <translation>%1 elem deklaráció nem létezik.</translation> + </message> + <message> + <location line="+12"/> + <source>Element %1 contains invalid content.</source> + <translation>%1 elem érvénytelen tartalmat tartalmaz.</translation> + </message> + <message> + <location line="+73"/> + <source>Element %1 is declared as abstract.</source> + <translation>%1 elem elvontkét lett deklarálva.</translation> + </message> + <message> + <location line="+7"/> + <source>Element %1 is not nillable.</source> + <translation>%1 elem nem nullázható.</translation> + </message> + <message> + <location line="+8"/> + <source>Attribute %1 contains invalid data: %2</source> + <translation>%1 attribútum érvénytelen adatokat tartalmaz: %2</translation> + </message> + <message> + <location line="+8"/> + <source>Element contains content although it is nillable.</source> + <translation>Elem nem nullázható elemeket tartalmaz.</translation> + </message> + <message> + <location line="+6"/> + <source>Fixed value constraint not allowed if element is nillable.</source> + <translation>Fix érték korlátozó nem engedélyezett, ha az elem nullázható.</translation> + </message> + <message> + <location line="+230"/> + <source>Element %1 cannot contain other elements, as it has a fixed content.</source> + <translation>%1 nem tartalmazhat másik elemeket, mint ennek is egy fix mérete van.</translation> + </message> + <message> + <location line="-198"/> + <source>Specified type %1 is not validly substitutable with element type %2.</source> + <translation>%1 meghatározott típus nem helyettesíthető érvényesen %2 elem típussal.</translation> + </message> + <message> + <location line="+23"/> + <source>Complex type %1 is not allowed to be abstract.</source> + <translation>%1 komplex típus nem engedélyezett, hogy elvont legyen.</translation> + </message> + <message> + <location line="+21"/> + <source>Element %1 contains not allowed attributes.</source> + <translation>%1 nem engedélyezett attribútumokat tartalmaz.</translation> + </message> + <message> + <location line="+6"/> + <location line="+97"/> + <source>Element %1 contains not allowed child element.</source> + <translation>%1 nem engedélyezett gyermek attribútumokat tartalmaz.</translation> + </message> + <message> + <location line="-76"/> + <location line="+93"/> + <source>Content of element %1 does not match its type definition: %2.</source> + <translation>%1 elem tartalma nem egyezik meg a típus definíciójával: %2.</translation> + </message> + <message> + <location line="-85"/> + <location line="+92"/> + <location line="+41"/> + <source>Content of element %1 does not match defined value constraint.</source> + <translation>%1 elem tartalma nem egyezik meg a definiált érték korlátozóval.</translation> + </message> + <message> + <location line="-73"/> + <source>Element %1 contains not allowed child content.</source> + <translation>%1 nem engedélyezett gyermek tartalmat tartalmaz.</translation> + </message> + <message> + <location line="+41"/> + <source>Element %1 contains not allowed text content.</source> + <translation>%1 nem engedélyezett szöveg tartalmat tartalmaz.</translation> + </message> + <message> + <location line="+61"/> + <source>Element %1 is missing required attribute %2.</source> + <translation>%1 hiányzik, %2 attribútum igényli.</translation> + </message> + <message> + <location line="+29"/> + <source>Attribute %1 does not match the attribute wildcard.</source> + <translation>%1 attribűtum nem egyezik meg az attribútum helyettesítő jellel.</translation> + </message> + <message> + <location line="+9"/> + <source>Declaration for attribute %1 does not exist.</source> + <translation>%1 attribútum deklarációja nem létezik.</translation> + </message> + <message> + <location line="+6"/> + <source>Element %1 contains two attributes of type %2.</source> + <translation>%1 elem %2 típus két attribútumát tartalmazza.</translation> + </message> + <message> + <location line="+11"/> + <source>Attribute %1 contains invalid content.</source> + <translation>%1 attribútum érvénytelen tartalmaz tartalmaz.</translation> + </message> + <message> + <location line="+7"/> + <source>Element %1 contains unknown attribute %2.</source> + <translation>%1 elem ismeretlen %2 attribútumokat tartalmaz.</translation> + </message> + <message> + <location line="+40"/> + <location line="+46"/> + <source>Content of attribute %1 does not match its type definition: %2.</source> + <translation>%1 attribútum tartalma nem egyezik a típus definíciójával: %2.</translation> + </message> + <message> + <location line="-38"/> + <location line="+46"/> + <source>Content of attribute %1 does not match defined value constraint.</source> + <translation>%1 attribútum tartalma nem egyezik meg a definiált érték korlátozóval.</translation> + </message> + <message> + <location line="+88"/> + <source>Non-unique value found for constraint %1.</source> + <translation>Nem található egyedülálló érték a(z) %1 módosítóra.</translation> + </message> + <message> + <location line="+20"/> + <source>Key constraint %1 contains absent fields.</source> + <translation>%1 kulcs korlátozó hiányzó mezőket tartalmaz.</translation> + </message> + <message> + <location line="+18"/> + <source>Key constraint %1 contains references nillable element %2.</source> + <translation>%1 kulcs korlátozó hivatkozásokat nem tartalmaz nullázható %2 elemekre.</translation> + </message> + <message> + <location line="+40"/> + <source>No referenced value found for key reference %1.</source> + <translation>Nem található referencia érték a(z) %1 kulcs referenciára.</translation> + </message> + <message> + <location line="+64"/> + <source>More than one value found for field %1.</source> + <translation>Több mint egy érték található a(z) %1-es mezőre.</translation> + </message> + <message> + <location line="+20"/> + <source>Field %1 has no simple type.</source> + <translation>%1 mezőnek nincsen egyszerű típusa.</translation> + </message> + <message> + <location line="+73"/> + <source>ID value '%1' is not unique.</source> + <translation>%1 azonosító érték nem egyedülálló.</translation> + </message> + <message> + <location line="+11"/> + <source>'%1' attribute contains invalid QName content: %2.</source> + <translation>%1 attribútum érvénytelen QName tartalmaz tartalmaz: %2.</translation> + </message> +</context> +</TS> diff --git a/translations/qtconfig_hu.ts b/translations/qtconfig_hu.ts new file mode 100644 index 0000000..0eaead0 --- /dev/null +++ b/translations/qtconfig_hu.ts @@ -0,0 +1,920 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="hu"> +<context> + <name>MainWindow</name> + <message> + <location filename="../tools/qtconfig/mainwindow.cpp" line="+202"/> + <source>Desktop Settings (Default)</source> + <translation>Asztali beállítások (Alapértelmezett)</translation> + </message> + <message> + <location line="+5"/> + <source>Choose style and palette based on your desktop settings.</source> + <translation>Stílus és paletta alapú kiválasztása az asztali beállításokban.</translation> + </message> + <message> + <location line="+144"/> + <source>On The Spot</source> + <translation>Azon nyomban</translation> + </message> + <message> + <location line="+33"/> + <location line="+1"/> + <location line="+38"/> + <location line="+1"/> + <source>Auto (default)</source> + <translation>Automatikus (alapértelmezett)</translation> + </message> + <message> + <location line="-38"/> + <source>Choose audio output automatically.</source> + <translation>Audió kimenet automatikus kiválasztása.</translation> + </message> + <message> + <location line="+1"/> + <location line="+1"/> + <source>aRts</source> + <translation>aRts</translation> + </message> + <message> + <location line="+1"/> + <source>Experimental aRts support for GStreamer.</source> + <translation>Kísérleti aRts támogatás a GStreamerhez.</translation> + </message> + <message> + <location line="+31"/> + <source>Phonon GStreamer backend not available.</source> + <translation>Phonon GStreamer backend nem elérhető.</translation> + </message> + <message> + <location line="+4"/> + <source>Choose render method automatically</source> + <translation>Render eljárás automatikus kiválasztása</translation> + </message> + <message> + <location line="+2"/> + <location line="+1"/> + <source>X11</source> + <translation>X11</translation> + </message> + <message> + <location line="+0"/> + <source>Use X11 Overlays</source> + <translation>X11 borítás használata</translation> + </message> + <message> + <location line="+3"/> + <location line="+1"/> + <source>OpenGL</source> + <translation>OpenGL</translation> + </message> + <message> + <location line="+0"/> + <source>Use OpenGL if avaiable</source> + <translation>OpenGL használata, ha rendelkezésre áll</translation> + </message> + <message> + <location line="+2"/> + <location line="+1"/> + <source>Software</source> + <translation>Szoftver</translation> + </message> + <message> + <location line="+0"/> + <source>Use simple software rendering</source> + <translation>Egyszerű szoftver adás használata</translation> + </message> + <message> + <location line="+27"/> + <source>No changes to be saved.</source> + <translation>A változtatások nincsenek elmentve.</translation> + </message> + <message> + <location line="+4"/> + <source>Saving changes...</source> + <translation>Változtatások elmentése...</translation> + </message> + <message> + <location line="+48"/> + <source>Over The Spot</source> + <translation>Célon túlmenően</translation> + </message> + <message> + <location line="+2"/> + <source>Off The Spot</source> + <translation>Elkalandozás</translation> + </message> + <message> + <location line="+2"/> + <source>Root</source> + <translation>Rendszergazda</translation> + </message> + <message> + <location line="+466"/> + <source>Select a Directory</source> + <translation>Egy könyvtár kiválasztása</translation> + </message> + <message> + <location line="+17"/> + <source><h3>%1</h3><br/>Version %2<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).</source> + <translation><h3>%1</h3><br/>Verzió %2<br/><br/>Szerzői jog (C) 2010 Nokia vállalat és/vagy leányvállalata(i).</translation> + </message> + <message> + <location line="+3"/> + <location line="+1"/> + <location line="+8"/> + <source>Qt Configuration</source> + <translation>Qt Konfiguráció</translation> + </message> + <message> + <location line="+22"/> + <source>Save Changes</source> + <translation>Változtatások elmentése</translation> + </message> + <message> + <location line="+1"/> + <source>Save changes to settings?</source> + <translation>Változtatások elmentése a beállításokba ?</translation> + </message> + <message> + <location line="+1"/> + <source>&Yes</source> + <translation>&Igen</translation> + </message> + <message> + <location line="+0"/> + <source>&No</source> + <translation>&Nem</translation> + </message> + <message> + <location line="+0"/> + <source>&Cancel</source> + <translation>&Mégse</translation> + </message> +</context> +<context> + <name>MainWindowBase</name> + <message> + <location filename="../tools/qtconfig/mainwindowbase.ui" line="+54"/> + <source>Qt Configuration</source> + <translation>Qt Konfiguráció +</translation> + </message> + <message> + <location line="+35"/> + <source>Appearance</source> + <translation>Feltűnés</translation> + </message> + <message> + <location line="+18"/> + <source>GUI Style</source> + <translation>GUI Stílus</translation> + </message> + <message> + <location line="+18"/> + <source>Select GUI &Style:</source> + <translation>GUI &Stílus kiválasztása:</translation> + </message> + <message> + <location line="+88"/> + <source>Build Palette</source> + <translation>Építési paletta</translation> + </message> + <message> + <location line="+12"/> + <source>&3-D Effects:</source> + <translation>&3 D Hatások:</translation> + </message> + <message> + <location line="+31"/> + <source>Window Back&ground:</source> + <translation>Ablak Hát&tér:</translation> + </message> + <message> + <location line="+35"/> + <source>&Tune Palette...</source> + <translation>&Hangolási paletta...</translation> + </message> + <message> + <location line="+10"/> + <source>Please use the KDE Control Center to set the palette.</source> + <translation>Kérem használja a KDE Vezérlő Központot a paletta beállításához.</translation> + </message> + <message> + <location line="-154"/> + <source>Preview</source> + <translation>Előnézet</translation> + </message> + <message> + <location line="+6"/> + <source>Select &Palette:</source> + <translation>&Paletta kiválasztása:</translation> + </message> + <message> + <location line="+11"/> + <source>Active Palette</source> + <translation>Aktív paletta</translation> + </message> + <message> + <location line="+5"/> + <source>Inactive Palette</source> + <translation>Inaktív paletta</translation> + </message> + <message> + <location line="+5"/> + <source>Disabled Palette</source> + <translation>Tiltott paletta</translation> + </message> + <message> + <location line="+138"/> + <source>Fonts</source> + <translation>Betűk</translation> + </message> + <message> + <location line="+6"/> + <source>Default Font</source> + <translation>Alapértelmezett betű</translation> + </message> + <message> + <location line="+45"/> + <source>&Style:</source> + <translation>&Stílus:</translation> + </message> + <message> + <location line="+10"/> + <source>&Point Size:</source> + <translation>&Pont méret:</translation> + </message> + <message> + <location line="+10"/> + <source>F&amily:</source> + <translation>Csa&lád:</translation> + </message> + <message> + <location line="+10"/> + <source>Sample Text</source> + <translation>Minta szöveg</translation> + </message> + <message> + <location line="+13"/> + <source>Font Substitution</source> + <translation>Betű helyettesítés</translation> + </message> + <message> + <location line="+20"/> + <source>S&elect or Enter a Family:</source> + <translation>Egy család ki&választása vgy bevitele:</translation> + </message> + <message> + <location line="+38"/> + <source>Current Substitutions:</source> + <translation>Aktuális helyettesítés:</translation> + </message> + <message> + <location line="+18"/> + <location line="+501"/> + <source>Up</source> + <translation>Fel</translation> + </message> + <message> + <location line="-494"/> + <location line="+508"/> + <source>Down</source> + <translation>Le</translation> + </message> + <message> + <location line="-501"/> + <location line="+494"/> + <source>Remove</source> + <translation>Eltávolítás</translation> + </message> + <message> + <location line="-464"/> + <source>Select s&ubstitute Family:</source> + <translation>Család &helyettesítésének kiválasztása:</translation> + </message> + <message> + <location line="+20"/> + <location line="+487"/> + <source>Add</source> + <translation>Hozzáad</translation> + </message> + <message> + <location line="-474"/> + <source>Interface</source> + <translation>Interfész</translation> + </message> + <message> + <location line="+6"/> + <source>Feel Settings</source> + <translation>Érzet beállítások</translation> + </message> + <message> + <location line="+12"/> + <location line="+26"/> + <source> ms</source> + <translation> ms</translation> + </message> + <message> + <location line="-13"/> + <source>&Double Click Interval:</source> + <translation>&Dupla kattintási intervallum:</translation> + </message> + <message> + <location line="+10"/> + <source>No blinking</source> + <translation>Nincs villogás</translation> + </message> + <message> + <location line="+16"/> + <source>&Cursor Flash Time:</source> + <translation>&Kurzor flash idő:</translation> + </message> + <message> + <location line="+10"/> + <source> lines</source> + <translation>sorok</translation> + </message> + <message> + <location line="+13"/> + <source>Wheel &Scroll Lines:</source> + <translation>Kerék sor &görgetés:</translation> + </message> + <message> + <location line="+10"/> + <source>Resolve symlinks in URLs</source> + <translation>URL-ben található szimlinkek megoldása</translation> + </message> + <message> + <location line="+10"/> + <source>GUI Effects</source> + <translation>GUI hatások</translation> + </message> + <message> + <location line="+12"/> + <source>&Enable</source> + <translation>&Engedélyezés</translation> + </message> + <message> + <location line="+3"/> + <source>Alt+E</source> + <translation>Alt+E</translation> + </message> + <message> + <location line="+22"/> + <source>&Menu Effect:</source> + <translation>&Menü hatás:</translation> + </message> + <message> + <location line="+10"/> + <source>C&omboBox Effect:</source> + <translation>C&omboBox hatás:</translation> + </message> + <message> + <location line="+10"/> + <source>&ToolTip Effect:</source> + <translation>&Eszköz tipp hatás:</translation> + </message> + <message> + <location line="+10"/> + <source>Tool&Box Effect:</source> + <translation>Eszköz&doboz hatás:</translation> + </message> + <message> + <location line="+17"/> + <location line="+19"/> + <location line="+14"/> + <location line="+19"/> + <source>Disable</source> + <translation>Tiltás</translation> + </message> + <message> + <location line="-47"/> + <location line="+19"/> + <location line="+14"/> + <location line="+19"/> + <source>Animate</source> + <translation>Animálás</translation> + </message> + <message> + <location line="-47"/> + <location line="+33"/> + <source>Fade</source> + <translation>Elhalkulás</translation> + </message> + <message> + <location line="+28"/> + <source>Global Strut</source> + <translation>Globális struktúra</translation> + </message> + <message> + <location line="+12"/> + <source>Minimum &Width:</source> + <translation>Minimum &szélesség:</translation> + </message> + <message> + <location line="+10"/> + <source>Minimum Hei&ght:</source> + <translation>Minimum ma&gasség:</translation> + </message> + <message> + <location line="+10"/> + <location line="+10"/> + <source> pixels</source> + <translation>pixelek</translation> + </message> + <message> + <location line="+13"/> + <source>Enhanced support for languages written right-to-left</source> + <translation>Kiterjesztett támogatás a jobbról balra írt nyelvek számára</translation> + </message> + <message> + <location line="+7"/> + <source>XIM Input Style:</source> + <translation>XIM beviteli stílus:</translation> + </message> + <message> + <location line="+11"/> + <source>On The Spot</source> + <translation>Azon nyomban</translation> + </message> + <message> + <location line="+5"/> + <source>Over The Spot</source> + <translation>Célon túlmenően</translation> + </message> + <message> + <location line="+5"/> + <source>Off The Spot</source> + <translation>Elkalandozás</translation> + </message> + <message> + <location line="+5"/> + <source>Root</source> + <translation>Rendszergazda</translation> + </message> + <message> + <location line="+8"/> + <source>Default Input Method:</source> + <translation>Alapértelmezett beviteli eljárás:</translation> + </message> + <message> + <location line="+31"/> + <source>Printer</source> + <translation>Nyomtató</translation> + </message> + <message> + <location line="+6"/> + <source>Enable Font embedding</source> + <translation>Betű beágyazás engedélyezése</translation> + </message> + <message> + <location line="+16"/> + <source>Font Paths</source> + <translation>Betű útvonalak</translation> + </message> + <message> + <location line="+77"/> + <source>Browse...</source> + <translation>Böngészés...</translation> + </message> + <message> + <location line="+7"/> + <source>Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list.</source> + <translation>Nyomja meg a <b>Böngészés</b> gombot vagy lépjen be egy könyvtárba és nyomja meg az Enter gombot hogy hozzáadja őket a listához.</translation> + </message> + <message> + <location line="+16"/> + <source>Phonon</source> + <translation>Phonon</translation> + </message> + <message> + <location line="+6"/> + <source>About Phonon</source> + <translation>Phonon-ról</translation> + </message> + <message> + <location line="+6"/> + <location line="+44"/> + <source>Current Version:</source> + <translation>Aktuális verzió:</translation> + </message> + <message> + <location line="-37"/> + <location line="+44"/> + <source>Not available</source> + <translation>Nem elérhető</translation> + </message> + <message> + <location line="-37"/> + <location line="+44"/> + <source>Website:</source> + <translation>Weblap:</translation> + </message> + <message> + <location line="-37"/> + <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html></source> + <translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html></translation> + </message> + <message> + <location line="+17"/> + <source>About GStreamer</source> + <translation>GStreamer-ről</translation> + </message> + <message> + <location line="+27"/> + <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html></source> + <translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html></translation> + </message> + <message> + <location line="+17"/> + <source>GStreamer backend settings</source> + <translation>GStreamer backend beállítások</translation> + </message> + <message> + <location line="+6"/> + <source>Preferred audio sink:</source> + <translation>Preferrált audió tartály:</translation> + </message> + <message> + <location line="+13"/> + <source>Preferred render method:</source> + <translation>Preferrált render eljárás:</translation> + </message> + <message> + <location line="+13"/> + <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Note: changes to these settings may prevent applications from starting up correctly.</span></p></body></html></source> + <translation><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Megjegyzés: Ezekben a beállításokban történő változtatások megakadályozhatják az alkalmazásokat a megfelelő betöltéstől.</span></p></body></html></translation> + </message> + <message> + <location line="+68"/> + <source>&File</source> + <translation>&Fájl</translation> + </message> + <message> + <location line="+19"/> + <source>&Help</source> + <translation>&Súgó</translation> + </message> + <message> + <location line="+14"/> + <source>&Save</source> + <translation>&Mentés</translation> + </message> + <message> + <location line="+3"/> + <source>Save</source> + <translation>Mentés</translation> + </message> + <message> + <location line="+3"/> + <source>Ctrl+S</source> + <translation>Ctrl+S</translation> + </message> + <message> + <location line="+5"/> + <source>E&xit</source> + <translation>&Kilépés</translation> + </message> + <message> + <location line="+3"/> + <source>Exit</source> + <translation>Kilépés</translation> + </message> + <message> + <location line="+8"/> + <source>&About</source> + <translation>&Névjegy</translation> + </message> + <message> + <location line="+3"/> + <source>About</source> + <translation>Névjegy</translation> + </message> + <message> + <location line="+8"/> + <source>About &Qt</source> + <translation>&Qt-ról</translation> + </message> + <message> + <location line="+3"/> + <source>About Qt</source> + <translation>Qt-ról</translation> + </message> +</context> +<context> + <name>PaletteEditorAdvancedBase</name> + <message> + <location filename="../tools/qtconfig/paletteeditoradvancedbase.ui" line="+61"/> + <source>Tune Palette</source> + <translation>Hangoló paletta</translation> + </message> + <message> + <location line="+6"/> + <source><b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p></source> + <translation><b>Paletta szerkesztése</b><p>Az aktuális widget vagy űrlap palettájának megváltoztatása</p><p>Egy generált paletta használata vagy szín kiválasztás mindegyik színcsoport és szín szabályra.</p><p>A paletta tesztelhető különböző widget szerkezetekkel az előnézeti szegmensben.</p></translation> + </message> + <message> + <location line="+29"/> + <source>Select &Palette:</source> + <translation>&Paletta kiválasztása:</translation> + </message> + <message> + <location line="+14"/> + <source>Active Palette</source> + <translation>Aktív paletta</translation> + </message> + <message> + <location line="+5"/> + <source>Inactive Palette</source> + <translation>Inaktív paletta</translation> + </message> + <message> + <location line="+5"/> + <source>Disabled Palette</source> + <translation>Paletta tiltása</translation> + </message> + <message> + <location line="+21"/> + <source>Auto</source> + <translation>Auto</translation> + </message> + <message> + <location line="+18"/> + <source>Build inactive palette from active</source> + <translation>Inaktív paletta építése aktívból</translation> + </message> + <message> + <location line="+13"/> + <source>Build disabled palette from active</source> + <translation>Tiltott paletta építése aktívból</translation> + </message> + <message> + <location line="+16"/> + <source>Central color &roles</source> + <translation>Központi szín &szabályok</translation> + </message> + <message> + <location line="+18"/> + <source>Choose central color role</source> + <translation>Központi szín szabályok kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source><b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p></source> + <translation><b>Egy szín szabály kiválasztása.</b><p>Az elérhetp központi szabályok: <ul> <li>Ablak - általános háttér szín.</li> <li>AblakSzöveg - általános előtér szín. </li> <li>Alap - háttérszínként használva példul szöveg beviteli widgetekre, rendszerint fehér vagy más világos színekre. </li> <li>Szöveg - az előtér szín van haszálva a bázissal. Rendszerint ez ugyanaz, mint az AblakSzöveg, amilyen esetekben egy jó ellentétet kell biztosítania mindkettőre Ablakkal és Bázissal. </li> <li>Gomb - általános gomb háttér szín, ahol a gomboknak szüksége van egy háttére ami különbözik az ablakétól, mint a Macintosh stílusban. </li> <li>GombSzöveg - egy előtér szín van használva gomb színnel. </li> <li>Kihangsúlyozás - egy szín a kiválasztott vagy kihangsúlyozott elem jelölésére. </li> <li>KihangsúlyozottSzöveg - egy szöveg szín, ami ellentétes a kihangsúlyozással. </li> <li>VilágosSzöveg - egy szöveg szín, ami nagyon különböző az AblakSzövegtől és a kontrasztoktól jól van példul feketével. </li> </ul> </p></translation> + </message> + <message> + <location line="+4"/> + <source>Window</source> + <translation>Ablak</translation> + </message> + <message> + <location line="+5"/> + <source>WindowText</source> + <translation>AblakSzöveg</translation> + </message> + <message> + <location line="+5"/> + <source>Button</source> + <translation>Gomb</translation> + </message> + <message> + <location line="+5"/> + <source>Base</source> + <translation>Bázis</translation> + </message> + <message> + <location line="+5"/> + <source>Text</source> + <translation>Szöveg</translation> + </message> + <message> + <location line="+5"/> + <source>BrightText</source> + <translation>VilágosSzöveg</translation> + </message> + <message> + <location line="+5"/> + <source>ButtonText</source> + <translation>GombSzöveg</translation> + </message> + <message> + <location line="+5"/> + <source>Highlight</source> + <translation>Kihangsúlyozás</translation> + </message> + <message> + <location line="+5"/> + <source>HighlightedText</source> + <translation>KihangsúlyozottSzöveg</translation> + </message> + <message> + <location line="+52"/> + <source>&Select Color:</source> + <translation>Szín &kiválasztása:</translation> + </message> + <message> + <location line="+24"/> + <location line="+171"/> + <source>Choose a color</source> + <translation>Egy szín kiválasztása</translation> + </message> + <message> + <location line="-168"/> + <source>Choose a color for the selected central color role.</source> + <translation>Egy szín kiválasztása a kiválasztott központi szín szabályokra.</translation> + </message> + <message> + <location line="+15"/> + <source>3-D shadow &effects</source> + <translation>3 D árnyék &hatások</translation> + </message> + <message> + <location line="+29"/> + <source>Build &from button color</source> + <translation>Építés gomb szín&ből</translation> + </message> + <message> + <location line="+6"/> + <source>Generate shadings</source> + <translation>Árnyékolások generálása</translation> + </message> + <message> + <location line="+3"/> + <source>Check to let 3D-effect colors be calculated from button-color.</source> + <translation></translation> + </message> + <message> + <location line="+10"/> + <source>Choose 3D-effect color role</source> + <translation>3D hatás szín szabályok kiválasztása</translation> + </message> + <message> + <location line="+3"/> + <source><b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul></source> + <translation></translation> + </message> + <message> + <location line="+4"/> + <source>Light</source> + <translation>Világos</translation> + </message> + <message> + <location line="+5"/> + <source>Midlight</source> + <translation>Központi fény</translation> + </message> + <message> + <location line="+5"/> + <source>Mid</source> + <translation>Középső</translation> + </message> + <message> + <location line="+5"/> + <source>Dark</source> + <translation>Sötét</translation> + </message> + <message> + <location line="+5"/> + <source>Shadow</source> + <translation>Árnyék</translation> + </message> + <message> + <location line="+54"/> + <source>Select Co&lor:</source> + <translation>&Szín kiválasztása:</translation> + </message> + <message> + <location line="+27"/> + <source>Choose a color for the selected effect color role.</source> + <translation>Egy szín kiválasztása a kiválaszott hatás szín szabályra.</translation> + </message> + <message> + <location line="+42"/> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <location line="+9"/> + <source>Close dialog and apply all changes.</source> + <translation>Párbeszéd ablak bezárása és az összes változtatás alkalmazása.</translation> + </message> + <message> + <location line="+10"/> + <source>Cancel</source> + <translation>Mégse</translation> + </message> + <message> + <location line="+6"/> + <source>Close dialog and discard all changes.</source> + <translation>Párbeszédablak bezárása és az összes változtatás eldobása.</translation> + </message> +</context> +<context> + <name>PreviewFrame</name> + <message> + <location filename="../tools/qtconfig/previewframe.cpp" line="+81"/> + <source>Desktop settings will only take effect after an application restart.</source> + <translation>Az asztal beállítások kizárólag az alkalmazás újraindítása utan lépnek érvénybe.</translation> + </message> +</context> +<context> + <name>PreviewWidgetBase</name> + <message> + <location filename="../tools/qtconfig/previewwidgetbase.ui" line="+66"/> + <source>Preview Window</source> + <translation>Előnézet ablak</translation> + </message> + <message> + <location line="+40"/> + <source>ButtonGroup</source> + <translation>GombCsoport</translation> + </message> + <message> + <location line="+18"/> + <source>RadioButton1</source> + <translation>RádioGomb1</translation> + </message> + <message> + <location line="+13"/> + <source>RadioButton2</source> + <translation>RádioGomb2</translation> + </message> + <message> + <location line="+10"/> + <source>RadioButton3</source> + <translation>RádioGomb3</translation> + </message> + <message> + <location line="+13"/> + <source>ButtonGroup2</source> + <translation>GombCsoport2</translation> + </message> + <message> + <location line="+18"/> + <source>CheckBox1</source> + <translation>Jelölőnégyzet1</translation> + </message> + <message> + <location line="+13"/> + <source>CheckBox2</source> + <translation>Jelölőnégyzet2</translation> + </message> + <message> + <location line="+36"/> + <source>LineEdit</source> + <translation>SorSzerkesztés</translation> + </message> + <message> + <location line="+11"/> + <source>ComboBox</source> + <translation>ComboBox</translation> + </message> + <message> + <location line="+29"/> + <source>PushButton</source> + <translation>NyomóGomb</translation> + </message> + <message> + <location line="+41"/> + <source><p> +<a href="http://qt.nokia.com">http://qt.nokia.com</a> +</p> +<p> +<a href="http://www.kde.org">http://www.kde.org</a> +</p></source> + <translation><p> +<a href="http://qt.nokia.com">http://qt.nokia.com</a> +</p> +<p> +<a href="http://www.kde.org">http://www.kde.org</a> +</p></translation> + </message> +</context> +</TS> diff --git a/translations/qvfb_hu.ts b/translations/qvfb_hu.ts new file mode 100644 index 0000000..bb8c931 --- /dev/null +++ b/translations/qvfb_hu.ts @@ -0,0 +1,344 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="hu"> +<context> + <name>AnimationSaveWidget</name> + <message> + <location filename="../tools/qvfb/qvfb.cpp" line="+865"/> + <location line="+204"/> + <source>Record</source> + <translation>Rekord</translation> + </message> + <message> + <location line="-202"/> + <source>Reset</source> + <translation>Visszaállítás</translation> + </message> + <message> + <location line="+2"/> + <source>Save</source> + <translation>Mentés</translation> + </message> + <message> + <location line="+18"/> + <source>Save in MPEG format (requires netpbm package installed)</source> + <translation>MPEG formátumba mentés (netpbm csomag telepítése szükséges)</translation> + </message> + <message> + <location line="+8"/> + <location line="+206"/> + <source>Click record to begin recording.</source> + <translation>Kattintson az írásra az írás megkezdéséhez.</translation> + </message> + <message> + <location line="-115"/> + <location line="+147"/> + <source>Finished saving.</source> + <translation>Befejezett mentés.</translation> + </message> + <message> + <location line="-63"/> + <source>Paused. Click record to resume, or save if done.</source> + <translation>Szüneteltetve. Kattintson az írásra a folytatáshoz, vagy mentse el, ha kész.</translation> + </message> + <message> + <location line="+6"/> + <source>Pause</source> + <translation>Szünet</translation> + </message> + <message> + <location line="+1"/> + <source>Recording...</source> + <translation>Felvétel...</translation> + </message> + <message> + <location line="+40"/> + <source>Saving... </source> + <translation>Mentés...</translation> + </message> + <message> + <location line="+4"/> + <location line="+4"/> + <source>Save animation...</source> + <translation>Animáció mentése...</translation> + </message> + <message> + <location line="+2"/> + <source>Save canceled.</source> + <translation>Megnés visszavonva.</translation> + </message> + <message> + <location line="+9"/> + <source>Save failed!</source> + <translation>Mentési hiba!</translation> + </message> +</context> +<context> + <name>Config</name> + <message> + <location filename="../tools/qvfb/config.ui" line="+54"/> + <source>Configure</source> + <translation>Konfigurálás</translation> + </message> + <message> + <location line="+29"/> + <source>Size</source> + <translation>Méret</translation> + </message> + <message> + <location line="+12"/> + <source>176x220 "SmartPhone"</source> + <translation>176x220 "ÜgyesTelefon"</translation> + </message> + <message> + <location line="+7"/> + <source>240x320 "PDA"</source> + <translation>240x320 "PDA"</translation> + </message> + <message> + <location line="+7"/> + <source>320x240 "TV" / "QVGA"</source> + <translation>320x240 "TV" / "QVGA"</translation> + </message> + <message> + <location line="+7"/> + <source>640x480 "VGA"</source> + <translation>640x480 "VGA"</translation> + </message> + <message> + <location line="+7"/> + <source>800x600</source> + <translation>800x600</translation> + </message> + <message> + <location line="+7"/> + <source>1024x768</source> + <translation>1024x768</translation> + </message> + <message> + <location line="+21"/> + <source>Custom</source> + <translation>Szokásos</translation> + </message> + <message> + <location line="+44"/> + <source>Depth</source> + <translation>Mélység</translation> + </message> + <message> + <location line="+6"/> + <source>1 bit monochrome</source> + <translation>1 bites egyszínű</translation> + </message> + <message> + <location line="+7"/> + <source>2 bit grayscale</source> + <translation>2 bites szürke skálázás</translation> + </message> + <message> + <location line="+7"/> + <source>4 bit grayscale</source> + <translation>4 bites szürke slálázás</translation> + </message> + <message> + <location line="+7"/> + <source>8 bit</source> + <translation>8 bites</translation> + </message> + <message> + <location line="+7"/> + <source>12 (16) bit</source> + <translation>12 (16) bites</translation> + </message> + <message> + <location line="+7"/> + <source>15 bit</source> + <translation>15 bites</translation> + </message> + <message> + <location line="+7"/> + <source>16 bit</source> + <translation>16 bites</translation> + </message> + <message> + <location line="+7"/> + <source>18 bit</source> + <translation>18 bites</translation> + </message> + <message> + <location line="+7"/> + <source>24 bit</source> + <translation>24 bites</translation> + </message> + <message> + <location line="+7"/> + <source>32 bit</source> + <translation>32 bites</translation> + </message> + <message> + <location line="+7"/> + <source>32 bit ARGB</source> + <translation>32 bites ARGB</translation> + </message> + <message> + <location line="+7"/> + <source>Swap red and blue channels</source> + <translation>Piros és kék csatornák felcserélése</translation> + </message> + <message> + <location line="+3"/> + <source>BGR format</source> + <translation>BGR formátum</translation> + </message> + <message> + <location line="+20"/> + <source>Skin</source> + <translation>Szkin</translation> + </message> + <message> + <location line="+14"/> + <source>None</source> + <translation>Semmi</translation> + </message> + <message> + <location line="+10"/> + <source>Emulate touch screen (no mouse move)</source> + <translatorcomment>указателя?</translatorcomment> + <translation>Érintő képernyő emulálása (nincs egér mozgatás)</translation> + </message> + <message> + <location line="+7"/> + <source>Emulate LCD screen (Only with fixed zoom of 3.0 times magnification)</source> + <translation>LCD kijelző emulálása (Kizárólag egy fix 3-szoros nagyítással)</translation> + </message> + <message> + <location line="+26"/> + <source><p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>.</source> + <translation><p>Vegye figyelembe azt, hogy bármely alkalmazás, amely virtuális framebuffer-t használ, be lesz fejezve, ha megváltoztatja a méretet vagy a mélységet <i>felül</i>. Szabadon módosíthatja a Gamma-t <i>alul</i>.</translation> + </message> + <message> + <location line="+10"/> + <source>Gamma</source> + <translation>Gamma</translation> + </message> + <message> + <location line="+12"/> + <source>Blue</source> + <translation>Kék</translation> + </message> + <message> + <location line="+489"/> + <location line="+496"/> + <location line="+14"/> + <location line="+496"/> + <source>1.0</source> + <translation>1.0</translation> + </message> + <message> + <location line="-999"/> + <source>Green</source> + <translation>Zöld</translation> + </message> + <message> + <location line="+496"/> + <source>All</source> + <translation>Mind</translation> + </message> + <message> + <location line="+496"/> + <source>Red</source> + <translation>Piros</translation> + </message> + <message> + <location line="+496"/> + <source>Set all to 1.0</source> + <translation>Az összes 1.0-ra állítása</translation> + </message> + <message> + <location line="+34"/> + <source>&OK</source> + <translation>&OK</translation> + </message> + <message> + <location line="+13"/> + <source>&Cancel</source> + <translation>&Mégse</translation> + </message> +</context> +<context> + <name>DeviceSkin</name> + <message> + <location filename="../tools/shared/deviceskin/deviceskin.cpp" line="+79"/> + <source>The image file '%1' could not be loaded.</source> + <translation>Nem sikerült betölteni a(z) '%1' kép fájlt.</translation> + </message> + <message> + <location line="+64"/> + <source>The skin directory '%1' does not contain a configuration file.</source> + <translation>A(z) '%1' skin könyvtár nem tartalmaz egyetlen konfigurációs fájlt sem.</translation> + </message> + <message> + <location line="+5"/> + <source>The skin configuration file '%1' could not be opened.</source> + <translation>Nem lehetett megnyitni a(z) '%1' skin konfigurációs fájlt.</translation> + </message> + <message> + <location line="+6"/> + <source>The skin configuration file '%1' could not be read: %2</source> + <translation>Nem lehetett olvasni a(z) '%1' skin konfigurációs fájlt: %2</translation> + </message> + <message> + <location line="+70"/> + <source>Syntax error: %1</source> + <translation>Szintakszis hiba: %1</translation> + </message> + <message> + <location line="+21"/> + <source>The skin "up" image file '%1' does not exist.</source> + <translation>A(z) '%1 'fel' skinezett kép fájl nem létezik.</translation> + </message> + <message> + <location line="+10"/> + <source>The skin "down" image file '%1' does not exist.</source> + <translation>A(z) '%1 'le' skinezett kép fájl nem létezik.</translation> + </message> + <message> + <location line="+11"/> + <source>The skin "closed" image file '%1' does not exist.</source> + <translation>A(z) '%1' skin "bezárt" kép fájl nem létezik.</translation> + </message> + <message> + <location line="+12"/> + <source>The skin cursor image file '%1' does not exist.</source> + <translation>A(z) '%1' skin kurzor kép fájl nem létezik.</translation> + </message> + <message> + <location line="+25"/> + <source>Syntax error in area definition: %1</source> + <translation>Szintaszis hiba a terület definícióban: %1</translation> + </message> + <message> + <location line="+38"/> + <source>Mismatch in number of areas, expected %1, got %2.</source> + <translation>Nem megfelelő terület szám, %1 várt, %2 kapott.</translation> + </message> +</context> +<context> + <name>QVFb</name> + <message> + <location filename="../tools/qvfb/qvfb.cpp" line="-501"/> + <source>Browse...</source> + <translation>Böngészés...</translation> + </message> + <message> + <location line="+140"/> + <source>Load Custom Skin...</source> + <translation>Szokásos skin betöltése...</translation> + </message> + <message> + <location line="+1"/> + <source>All QVFB Skins (*.skin)</source> + <translation>Minden QVFB skin (*.skin)</translation> + </message> +</context> +</TS> diff --git a/translations/translations.pri b/translations/translations.pri index 9c70557..808dc4f 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -17,7 +17,7 @@ LUPDATE += -locations relative -no-ui-lines ###### Qt Libraries -QT_TS = ar cs da de es fr iw ja_JP pl pt ru sk sl sv uk zh_CN zh_TW +QT_TS = ar cs da de es fr hu iw ja_JP pl pt ru sk sl sv uk zh_CN zh_TW ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ -I../include -I../include/Qt \ @@ -57,9 +57,7 @@ ts-linguist.depends = sub-tools ts-assistant.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \ ../tools/assistant/translations/translations.pro \ && $$LUPDATE \ - ../tools/assistant/translations/qt_help.pro \ - && $$LUPDATE \ - ../tools/assistant/translations/translations_adp.pro) + ../tools/assistant/translations/qt_help.pro)) ts-assistant.depends = sub-tools ###### Qtconfig |