summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-12-26 06:49:20 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-01-04 10:28:56 (GMT)
commit0de81bba8ca5a4fedace010a88027591071cde36 (patch)
treee2451870c9bdbb2d9f5fdeed69c818497ed5829f /Utilities
parent0cf550b2ca500be0e3dffc47be92438d3e789b81 (diff)
downloadCMake-0de81bba8ca5a4fedace010a88027591071cde36.zip
CMake-0de81bba8ca5a4fedace010a88027591071cde36.tar.gz
CMake-0de81bba8ca5a4fedace010a88027591071cde36.tar.bz2
Help: Workaround pygments reporting an error for genexes.
Without the workaround, CMake code snippets are not highlighted at all because pygments can not lex the generator expressions.
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/Sphinx/cmake.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 1955e42..336c74a 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -12,6 +12,16 @@
import os
import re
+# Monkey patch for pygments reporting an error when generator expressions are
+# used.
+# https://bitbucket.org/birkenfeld/pygments-main/issue/942/cmake-generator-expressions-not-handled
+from pygments.lexers import CMakeLexer
+from pygments.token import Name, Operator
+from pygments.lexer import bygroups
+CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)',
+ bygroups(Operator, Name.Variable, Operator)))
+
+
from docutils.parsers.rst import Directive, directives
from docutils.transforms import Transform
try:
nings.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp index 2f5cf6c..74b7b06 100644 --- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp +++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp @@ -138,10 +138,11 @@ void tst_CompilerWarnings::warnings() } static QString tmpSourceFile; bool openResult = true; - QString templatePath = QDir::temp().absoluteFilePath("XXXXXX-test.cpp"); - QTemporaryFile tmpQSourceFile(templatePath); + const QString tmpBaseName("XXXXXX-test.cpp"); + QString templatePath = QDir::temp().absoluteFilePath(tmpBaseName); + QFile tmpQSourceFile(templatePath); if (tmpSourceFile.isEmpty()) { - tmpQSourceFile.open(); + tmpQSourceFile.open(QIODevice::ReadWrite | QIODevice::Truncate); tmpSourceFile = tmpQSourceFile.fileName(); QFile cppSource(":/test.cpp"); bool openResult = cppSource.open(QIODevice::ReadOnly); @@ -152,6 +153,7 @@ void tst_CompilerWarnings::warnings() out << in.readAll(); } } + tmpQSourceFile.close(); QVERIFY2(openResult, "Need resource temporary \"test.cpp\""); QStringList args; @@ -228,8 +230,8 @@ void tst_CompilerWarnings::warnings() #ifdef Q_CC_MSVC QString errs = QString::fromLocal8Bit(proc.readAllStandardOutput().constData()); - if (errs.startsWith(tmpSourceFile)) - errs = errs.mid(10); + if (errs.startsWith(tmpBaseName)) + errs = errs.mid(tmpBaseName.size()).simplified();; #else QString errs = QString::fromLocal8Bit(proc.readAllStandardError().constData()); #endif @@ -243,6 +245,8 @@ void tst_CompilerWarnings::warnings() } QCOMPARE(errList.count(), 0); // verbose info how many lines of errors in output QVERIFY(errs.isEmpty()); + + tmpQSourceFile.remove(); } QTEST_APPLESS_MAIN(tst_CompilerWarnings) -- cgit v0.12 From 8efe6915c9a6dfa531ec39d5de7e8af34f76dc3c Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Fri, 7 Aug 2009 08:32:35 +0200 Subject: Avoid compiling imageformats if you configure with -no-lib* Task-number: 239108 Reviewed-by: Andy Shaw --- configure | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/configure b/configure index e58180a..2b81cab 100755 --- a/configure +++ b/configure @@ -5706,7 +5706,9 @@ fi if [ "$CFG_INOTIFY" = "yes" ]; then QT_CONFIG="$QT_CONFIG inotify" fi -if [ "$CFG_LIBJPEG" = "system" ]; then +if [ "$CFG_LIBJPEG" = "no" ]; then + CFG_JPEG="no" +elif [ "$CFG_LIBJPEG" = "system" ]; then QT_CONFIG="$QT_CONFIG system-jpeg" fi if [ "$CFG_JPEG" = "no" ]; then @@ -5714,7 +5716,9 @@ if [ "$CFG_JPEG" = "no" ]; then elif [ "$CFG_JPEG" = "yes" ]; then QT_CONFIG="$QT_CONFIG jpeg" fi -if [ "$CFG_LIBMNG" = "system" ]; then +if [ "$CFG_LIBMNG" = "no" ]; then + CFG_MNG="no" +elif [ "$CFG_LIBMNG" = "system" ]; then QT_CONFIG="$QT_CONFIG system-mng" fi if [ "$CFG_MNG" = "no" ]; then @@ -5738,7 +5742,9 @@ if [ "$CFG_GIF" = "no" ]; then elif [ "$CFG_GIF" = "yes" ]; then QT_CONFIG="$QT_CONFIG gif" fi -if [ "$CFG_LIBTIFF" = "system" ]; then +if [ "$CFG_LIBTIFF" = "no" ]; then + CFG_TIFF="no" +elif [ "$CFG_LIBTIFF" = "system" ]; then QT_CONFIG="$QT_CONFIG system-tiff" fi if [ "$CFG_TIFF" = "no" ]; then -- cgit v0.12 From 41d27eac40cecbc0067be9622c9bc1c579582a47 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 7 Aug 2009 13:17:05 +0200 Subject: Autotest: ensure we don't mishandle SSL certificates with NULs This is a vulnerability in some implementations. Qt isn't affected because... well, we never implemented the decoding of escape sequences :-) --- .../more-certificates/badguy-nul-cn.crt | 81 ++++++++++++++++++++++ tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 17 +++++ 2 files changed, 98 insertions(+) create mode 100644 tests/auto/qsslcertificate/more-certificates/badguy-nul-cn.crt diff --git a/tests/auto/qsslcertificate/more-certificates/badguy-nul-cn.crt b/tests/auto/qsslcertificate/more-certificates/badguy-nul-cn.crt new file mode 100644 index 0000000..b899733 --- /dev/null +++ b/tests/auto/qsslcertificate/more-certificates/badguy-nul-cn.crt @@ -0,0 +1,81 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=GB, ST=Berkshire, L=Newbury, O=My Company Ltd, OU=CA, CN=NULL-friendly CA + Validity + Not Before: Aug 4 07:33:43 2009 GMT + Not After : Aug 2 07:33:43 2019 GMT + Subject: CN=www.bank.com\x00.badguy.com + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + RSA Public Key: (2048 bit) + Modulus (2048 bit): + 00:cd:26:70:96:a9:a6:5d:3e:9c:ed:0f:08:15:5a: + 7c:17:25:68:68:af:13:b9:ad:41:fa:12:54:e2:84: + 72:7d:58:d1:e2:40:42:c1:59:ed:05:3d:aa:10:53: + 70:00:88:3a:77:a0:c0:56:9e:ac:7d:21:2a:71:44: + 51:08:bc:17:07:da:a8:a3:76:dc:51:bc:1b:8a:f6: + 02:1a:55:bf:46:b4:44:6b:27:5e:be:e5:17:8b:56: + b2:c6:82:36:11:83:a8:bf:f7:2f:0d:17:f6:cd:47: + b5:6f:2b:a6:41:b6:8d:33:5f:ea:ea:8b:b1:1a:e2: + 99:38:ff:59:5b:0a:a1:71:13:ca:37:3f:b9:b0:1e: + 91:9a:c8:93:35:0c:4a:e0:9d:f4:d2:61:c7:4e:5b: + 41:0a:7c:31:54:99:db:f5:65:ce:80:d3:c2:02:37: + 64:fd:54:12:7b:ea:ac:85:59:5c:17:e1:2e:f6:d0: + a8:f2:d0:2e:94:59:2f:c2:a6:5f:da:07:de:7b:2e: + 14:07:ed:e4:27:24:37:9d:09:2e:b1:f9:5a:48:b9: + 80:24:43:e6:cb:c7:6e:35:df:d5:69:34:ff:e6:d6: + 9e:e8:76:66:6e:5f:59:01:3c:96:3b:ec:72:0b:3c: + 1e:95:0f:ce:68:13:9c:22:dd:1b:b5:44:28:50:4a: + 05:7f + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: + CA:FALSE + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: + 33:15:24:BE:DA:66:3A:06:8B:D9:27:34:3A:AF:62:40:E4:95:66:5D + X509v3 Authority Key Identifier: + keyid:0A:69:39:5F:9D:30:04:18:08:2E:02:0E:E6:EA:9D:B2:26:F6:E2:6A + + Signature Algorithm: sha1WithRSAEncryption + 32:65:23:1f:c8:d9:53:84:82:d0:0a:eb:14:51:24:03:bc:6c: + 1b:2a:5a:fe:1b:f0:e8:69:0c:2b:19:86:cf:7f:32:76:d8:2b: + d2:cf:8b:c4:d1:b6:5b:9c:60:a3:99:2e:92:72:06:ce:de:8b: + d2:a2:d2:89:7c:13:a9:0b:4e:be:12:09:e5:d6:28:3a:ac:a7: + 26:56:94:7f:13:ee:64:7d:de:94:60:75:c1:bc:55:97:d4:aa: + 13:8e:02:d8:b0:b0:70:53:ae:18:53:ce:aa:b2:2c:85:3e:e3: + f3:e1:26:f3:fa:5c:ee:f8:7b:0b:c6:39:b5:04:33:5e:ae:b8: + 5e:0e:66:cc:a8:c0:6a:0d:ec:60:c1:c5:d9:39:ea:bd:1b:8f: + 1c:7d:16:38:b1:e8:c8:37:01:aa:4b:99:df:e4:0f:10:be:61: + ee:9a:cf:cd:27:05:46:00:60:d8:6a:74:08:32:3c:8b:90:01: + 6a:07:33:0c:6c:90:db:ea:fb:6a:17:1a:76:bb:73:14:27:e1: + a4:7e:d5:dd:30:b1:5d:f2:0e:aa:d4:b2:d5:4c:f6:4f:91:2a: + 07:f4:37:c1:cf:48:19:c5:fe:7e:92:96:a8:df:50:6a:31:92: + a3:b1:14:fe:41:cc:49:62:98:4d:ea:c5:ba:05:2d:49:c3:22: + 72:ef:41:09 +-----BEGIN CERTIFICATE----- +MIIDjTCCAnWgAwIBAgIBATANBgkqhkiG9w0BAQUFADB0MQswCQYDVQQGEwJHQjES +MBAGA1UECBMJQmVya3NoaXJlMRAwDgYDVQQHEwdOZXdidXJ5MRcwFQYDVQQKEw5N +eSBDb21wYW55IEx0ZDELMAkGA1UECxMCQ0ExGTAXBgNVBAMTEE5VTEwtZnJpZW5k +bHkgQ0EwHhcNMDkwODA0MDczMzQzWhcNMTkwODAyMDczMzQzWjAjMSEwHwYDVQQD +Exh3d3cuYmFuay5jb20ALmJhZGd1eS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDNJnCWqaZdPpztDwgVWnwXJWhorxO5rUH6ElTihHJ9WNHiQELB +We0FPaoQU3AAiDp3oMBWnqx9ISpxRFEIvBcH2qijdtxRvBuK9gIaVb9GtERrJ16+ +5ReLVrLGgjYRg6i/9y8NF/bNR7VvK6ZBto0zX+rqi7Ea4pk4/1lbCqFxE8o3P7mw +HpGayJM1DErgnfTSYcdOW0EKfDFUmdv1Zc6A08ICN2T9VBJ76qyFWVwX4S720Kjy +0C6UWS/Cpl/aB957LhQH7eQnJDedCS6x+VpIuYAkQ+bLx24139VpNP/m1p7odmZu +X1kBPJY77HILPB6VD85oE5wi3Ru1RChQSgV/AgMBAAGjezB5MAkGA1UdEwQCMAAw +LAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0G +A1UdDgQWBBQzFSS+2mY6BovZJzQ6r2JA5JVmXTAfBgNVHSMEGDAWgBQKaTlfnTAE +GAguAg7m6p2yJvbiajANBgkqhkiG9w0BAQUFAAOCAQEAMmUjH8jZU4SC0ArrFFEk +A7xsGypa/hvw6GkMKxmGz38ydtgr0s+LxNG2W5xgo5kuknIGzt6L0qLSiXwTqQtO +vhIJ5dYoOqynJlaUfxPuZH3elGB1wbxVl9SqE44C2LCwcFOuGFPOqrIshT7j8+Em +8/pc7vh7C8Y5tQQzXq64Xg5mzKjAag3sYMHF2TnqvRuPHH0WOLHoyDcBqkuZ3+QP +EL5h7prPzScFRgBg2Gp0CDI8i5ABagczDGyQ2+r7ahcadrtzFCfhpH7V3TCxXfIO +qtSy1Uz2T5EqB/Q3wc9IGcX+fpKWqN9QajGSo7EU/kHMSWKYTerFugUtScMicu9B +CQ== +-----END CERTIFICATE----- diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index 7fd92d6..80ac228 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -100,6 +100,7 @@ private slots: void fromPath(); void certInfo(); void task256066toPem(); + void nulInCN(); // ### add tests for certificate bundles (multiple certificates concatenated into a single // structure); both PEM and DER formatted #endif @@ -727,6 +728,22 @@ void tst_QSslCertificate::task256066toPem() QCOMPARE(pem1, pem2); } +void tst_QSslCertificate::nulInCN() +{ + QList certList = + QSslCertificate::fromPath(SRCDIR "more-certificates/badguy-nul-cn.crt"); + QCOMPARE(certList.size(), 1); + + const QSslCertificate &cert = certList.at(0); + QVERIFY(!cert.isNull()); + + QString cn = cert.subjectInfo(QSslCertificate::CommonName); + QVERIFY(cn != "www.bank.com"); + + static const char realCN[] = "www.bank.com\\x00.badguy.com"; + QCOMPARE(cn, QString::fromLatin1(realCN, sizeof realCN - 1)); +} + #endif // QT_NO_OPENSSL QTEST_MAIN(tst_QSslCertificate) -- cgit v0.12 From 79c488a28819b58eed519fb3df2705b8c6e35e05 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Jul 2009 17:22:11 +0200 Subject: Add functionality tests for XSync. It was reported to be auto-detected, but wasn't. Apparently, AIX 6's X11 doesn't have this. Reviewed-By: Denis Dzyubenko (cherry picked from commit 0a63875d787e1b035ace2c76fa1d0de6329127d7) --- config.tests/x11/xsync/xsync.cpp | 11 +++++++++++ config.tests/x11/xsync/xsync.pro | 3 +++ configure | 36 +++++++++++++++++++++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 config.tests/x11/xsync/xsync.cpp create mode 100644 config.tests/x11/xsync/xsync.pro diff --git a/config.tests/x11/xsync/xsync.cpp b/config.tests/x11/xsync/xsync.cpp new file mode 100644 index 0000000..a23fb08 --- /dev/null +++ b/config.tests/x11/xsync/xsync.cpp @@ -0,0 +1,11 @@ +#include +#include +#include + +int main(int, char **) +{ + XSyncValue value; + (void*)&XSyncIntToValue; + (void*)&XSyncCreateCounter; + return 0; +} diff --git a/config.tests/x11/xsync/xsync.pro b/config.tests/x11/xsync/xsync.pro new file mode 100644 index 0000000..58b8238 --- /dev/null +++ b/config.tests/x11/xsync/xsync.pro @@ -0,0 +1,3 @@ +CONFIG += x11 +CONFIG -= qt +SOURCES = xsync.cpp diff --git a/configure b/configure index 2b81cab..b5baadb 100755 --- a/configure +++ b/configure @@ -570,6 +570,7 @@ CFG_DEBUG_RELEASE=no CFG_SHARED=yes CFG_SM=auto CFG_XSHAPE=auto +CFG_XSYNC=auto CFG_XINERAMA=runtime CFG_XFIXES=runtime CFG_ZLIB=auto @@ -831,7 +832,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-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|-svg|-webkit|-scripttools|-rpath|-force-pkg-config) + -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xshape|-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|-svg|-webkit|-scripttools|-rpath|-force-pkg-config) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1419,6 +1420,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + xsync) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_XSYNC="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; xinput) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then CFG_XINPUT="$VAL" @@ -3480,6 +3488,10 @@ Qt/X11 only: $SHY -xshape ............ Compile XShape support. Requires X11/extensions/shape.h. + $SHN -no-xsync .......... Do not compile XSync support. + $SHY -xsync ............. Compile XSync support. + Requires X11/extensions/sync.h. + $XAN -no-xinerama ....... Do not compile Xinerama (multihead) support. $XAY -xinerama .......... Compile Xinerama support. Requires X11/extensions/Xinerama.h and libXinerama. @@ -4993,6 +5005,23 @@ if [ "$PLATFORM_X11" = "yes" ]; then fi fi + # auto-detect XSync support + if [ "$CFG_XSYNC" != "no" ]; then + if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xsync "XSync" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then + CFG_XSYNC=yes + else + if [ "$CFG_XSYNC" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then + echo "XSync support cannot be enabled due to functionality tests!" + echo " Turn on verbose messaging (-v) to $0 to see the final report." + echo " If you believe this message is in error you may use the continue" + echo " switch (-continue) to $0 to continue." + exit 101 + else + CFG_XSYNC=no + fi + fi + fi + # auto-detect Xinerama support if [ "$CFG_XINERAMA" != "no" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/xinerama "Xinerama" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then @@ -5791,6 +5820,9 @@ if [ "$PLATFORM_X11" = "yes" ]; then if [ "$CFG_XSHAPE" = "yes" ]; then QT_CONFIG="$QT_CONFIG xshape" fi + if [ "$CFG_XSYNC" = "yes" ]; then + QT_CONFIG="$QT_CONFIG xsync" + fi if [ "$CFG_XINERAMA" = "yes" ]; then QT_CONFIG="$QT_CONFIG xinerama" QMakeVar set QMAKE_LIBS_X11 '-lXinerama $$QMAKE_LIBS_X11' @@ -6503,6 +6535,7 @@ fi [ "$CFG_XRENDER" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XRENDER" [ "$CFG_MITSHM" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MITSHM" [ "$CFG_XSHAPE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SHAPE" +[ "$CFG_XSYNC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XSYNC" [ "$CFG_XINPUT" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_XINPUT QT_NO_TABLET" [ "$CFG_XCURSOR" = "runtime" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_RUNTIME_XCURSOR" @@ -6944,6 +6977,7 @@ fi if [ "$PLATFORM_X11" = "yes" ]; then echo "NAS sound support ... $CFG_NAS" echo "XShape support ...... $CFG_XSHAPE" + echo "XSync support ....... $CFG_XSYNC" echo "Xinerama support .... $CFG_XINERAMA" echo "Xcursor support ..... $CFG_XCURSOR" echo "Xfixes support ...... $CFG_XFIXES" -- cgit v0.12 From 923134936e132e857b663c4837f66565dfa3d9e6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Jul 2009 15:38:27 +0200 Subject: xlC 7 cannot compile QtConcurrent with these templates here (cherry picked from commit cb64ac587249f5dc6563a035e2ef5a3ad2bc5d13) --- src/corelib/concurrent/qfuture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/concurrent/qfuture.h b/src/corelib/concurrent/qfuture.h index 47015ee..f2db5ac 100644 --- a/src/corelib/concurrent/qfuture.h +++ b/src/corelib/concurrent/qfuture.h @@ -210,7 +210,7 @@ public: bool operator==(const QFuture &other) const { return (d == other.d); } bool operator!=(const QFuture &other) const { return (d != other.d); } -#ifndef QT_NO_MEMBER_TEMPLATES +#if !defined(QT_NO_MEMBER_TEMPLATES) && !defined(Q_CC_XLC) template QFuture(const QFuture &other) : d(other.d) -- cgit v0.12 From 3eb12a43e3cf673ec0608833551b25f153af1aa3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 30 Jul 2009 16:40:06 +0200 Subject: Fix compilation with xlC 7: operands to ?: must match. "../shared/qm.cpp", line 556.45: 1540-0207 (S) No common type found for operands with type "const char [7]" and "QByteArray". Reviewed-by: Trust Me (cherry picked from commit 3ae2cab9c8bd1790a00da2755ac036143a3a35f4) --- tools/linguist/shared/qm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index 381f5c5..231ec84 100644 --- a/tools/linguist/shared/qm.cpp +++ b/tools/linguist/shared/qm.cpp @@ -546,7 +546,7 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) //qDebug() << "NUMITEMS: " << numItems; QTextCodec *codec = QTextCodec::codecForName( - cd.m_codecForSource.isEmpty() ? "Latin1" : cd.m_codecForSource); + cd.m_codecForSource.isEmpty() ? QByteArray("Latin1") : cd.m_codecForSource); QTextCodec *utf8Codec = 0; if (codec->name() != "UTF-8") utf8Codec = QTextCodec::codecForName("UTF-8"); -- cgit v0.12 From c39436c722e778460366995877d66a8935d2d636 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 31 Jul 2009 10:30:44 +0200 Subject: Fix compilation with xlC 7: operands to ?: must match. See 3ae2cab9c8bd1790a00da2755ac036143a3a35f4 for another similar fix. Reviewed-by: Trust Me (cherry picked from commit 18fbfdf0f774198e2e1277e064cc3a8eb9dbb29d) --- tools/linguist/shared/po.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/linguist/shared/po.cpp b/tools/linguist/shared/po.cpp index 4850cfd..575e751 100644 --- a/tools/linguist/shared/po.cpp +++ b/tools/linguist/shared/po.cpp @@ -359,7 +359,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd) const QChar quote = QLatin1Char('"'); const QChar newline = QLatin1Char('\n'); QTextStream in(&dev); - in.setCodec(cd.m_codecForSource.isEmpty() ? "UTF-8" : cd.m_codecForSource); + in.setCodec(cd.m_codecForSource.isEmpty() ? QByteArray("UTF-8") : cd.m_codecForSource); bool error = false; // format of a .po file entry: @@ -552,7 +552,7 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd) { bool ok = true; QTextStream out(&dev); - out.setCodec(cd.m_outputCodec.isEmpty() ? "UTF-8" : cd.m_outputCodec); + out.setCodec(cd.m_outputCodec.isEmpty() ? QByteArray("UTF-8") : cd.m_outputCodec); bool first = true; if (translator.messages().isEmpty() || !translator.messages().first().sourceText().isEmpty()) { -- cgit v0.12 From 47f58dfad1eb7fe61a523597023df33f3d320377 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Sat, 8 Aug 2009 23:58:46 +0200 Subject: Made the QGesture::reset function protected. By default the QGesture::reset function is protected, and it can be made public in the derived class if necessary. Reviewed-by: trustme --- src/gui/kernel/qgesture.h | 3 +-- src/gui/kernel/qstandardgestures.h | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h index 7da37c4..839fdca 100644 --- a/src/gui/kernel/qgesture.h +++ b/src/gui/kernel/qgesture.h @@ -73,14 +73,13 @@ public: void setGraphicsItem(QGraphicsItem *); QGraphicsItem *graphicsItem() const; - virtual void reset(); - Qt::GestureState state() const; protected: QGesture(QGesturePrivate &dd, QObject *parent); bool eventFilter(QObject*, QEvent*); + virtual void reset(); void updateState(Qt::GestureState state); Q_SIGNALS: diff --git a/src/gui/kernel/qstandardgestures.h b/src/gui/kernel/qstandardgestures.h index c734fba..03a1374 100644 --- a/src/gui/kernel/qstandardgestures.h +++ b/src/gui/kernel/qstandardgestures.h @@ -66,11 +66,13 @@ public: QPanGesture(QWidget *parent); bool filterEvent(QEvent *event); - void reset(); QSize totalOffset() const; QSize lastOffset() const; +protected: + void reset(); + private: bool event(QEvent *event); bool eventFilter(QObject *receiver, QEvent *event); -- cgit v0.12 From 6826490774d66e0470fc1e5848ab89b3a0d0bb86 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 5 Aug 2009 18:57:25 +0200 Subject: Implemented QPinchGesture. Added a new standard gesture, which is implemented using a native zoom and rotate gestures on Windows and with a direct touch event handling on other platforms. Improved pan support - we subscribe to native pan gesture only when it's really needed, and we pass proper flags for single finger horizontal/vertical panning. Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qapplication_p.h | 3 + src/gui/kernel/qapplication_win.cpp | 21 ++-- src/gui/kernel/qevent_p.h | 5 +- src/gui/kernel/qstandardgestures.cpp | 210 ++++++++++++++++++++++++++++++++++- src/gui/kernel/qstandardgestures.h | 39 +++++++ src/gui/kernel/qstandardgestures_p.h | 25 +++++ src/gui/kernel/qwidget_win.cpp | 40 ++++--- 7 files changed, 316 insertions(+), 27 deletions(-) diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index c4ce2ea..9953907 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -235,6 +235,7 @@ typedef struct tagGESTUREINFO # define GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY 0x00000004 # define GC_ZOOM 0x00000001 +# define GC_ROTATE 0x00000001 typedef struct tagGESTURECONFIG { @@ -243,6 +244,8 @@ typedef struct tagGESTURECONFIG DWORD dwBlock; } GESTURECONFIG; +# define GID_ROTATE_ANGLE_FROM_ARGUMENT(arg) ((((double)(arg) / 65535.0) * 4.0 * 3.14159265) - 2.0*3.14159265) + #endif // WM_GESTURE #endif // Q_WS_WIN diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index bdee6ec..cb67409 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -3721,17 +3721,18 @@ bool QETWidget::translateGestureEvent(const MSG &msg) QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); BOOL bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi); + if (bResult) { + const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y); + QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos); + if (alienWidget && alienWidget->internalWinId()) + alienWidget = 0; + QWidget *widget = alienWidget ? alienWidget : this; - const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y); - QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos); - if (alienWidget && alienWidget->internalWinId()) - alienWidget = 0; - QWidget *widget = alienWidget ? alienWidget : this; + QNativeGestureEvent event; + event.sequenceId = gi.dwSequenceID; + event.position = QPoint(gi.ptsLocation.x, gi.ptsLocation.y); + event.argument = gi.ullArguments; - QNativeGestureEvent event; - event.sequenceId = gi.dwSequenceID; - event.position = QPoint(gi.ptsLocation.x, gi.ptsLocation.y); - if (bResult) { switch (gi.dwID) { case GID_BEGIN: event.gestureType = QNativeGestureEvent::GestureBegin; @@ -3746,6 +3747,8 @@ bool QETWidget::translateGestureEvent(const MSG &msg) event.gestureType = QNativeGestureEvent::Pan; break; case GID_ROTATE: + event.gestureType = QNativeGestureEvent::Rotate; + break; case GID_TWOFINGERTAP: case GID_ROLLOVER: default: diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h index b21b35c..2ff672b 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -133,9 +133,9 @@ public: }; QNativeGestureEvent() - : QEvent(QEvent::NativeGesture), gestureType(None), percentage(0), direction(0, 0) + : QEvent(QEvent::NativeGesture), gestureType(None), percentage(0) #ifdef Q_WS_WIN - , sequenceId(0) + , sequenceId(0), argument(0) #endif { } @@ -146,6 +146,7 @@ public: QSize direction; #ifdef Q_WS_WIN ulong sequenceId; + quint64 argument; #endif }; diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp index 7078dbf..ac03cd2 100644 --- a/src/gui/kernel/qstandardgestures.cpp +++ b/src/gui/kernel/qstandardgestures.cpp @@ -132,8 +132,7 @@ bool QPanGesture::eventFilter(QObject *receiver, QEvent *event) it = qAppPriv->widgetGestures.find(static_cast(receiver)); if (it == qAppPriv->widgetGestures.end()) return false; - QPanGesture *gesture = it.value().pan; - if (this != gesture) + if (this != it.value().pan) return false; Qt::GestureState nextState = Qt::NoGesture; switch(ev->gestureType) { @@ -162,7 +161,7 @@ bool QPanGesture::eventFilter(QObject *receiver, QEvent *event) d->totalOffset += d->lastOffset; } d->lastPosition = ev->position; - gesture->updateState(nextState); + updateState(nextState); return true; } #endif @@ -248,6 +247,7 @@ void QPanGesture::reset() d->panFinishedTimer = 0; } #endif + QGesture::reset(); } /*! @@ -273,6 +273,210 @@ QSize QPanGesture::lastOffset() const return d->lastOffset; } + +/*! + \class QPinchGesture + \since 4.6 + + \brief The QPinchGesture class represents a Pinch gesture, + providing additional information related to zooming and/or rotation. +*/ + +/*! + Creates a new Pinch gesture handler object and marks it as a child of \a + parent. + + On some platform like Windows it's necessary to provide a non-null widget + as \a parent to get native gesture support. +*/ +QPinchGesture::QPinchGesture(QWidget *parent) + : QGesture(*new QPinchGesturePrivate, parent) +{ + if (parent) { + QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); + qAppPriv->widgetGestures[parent].pinch = this; +#ifdef Q_WS_WIN + qt_widget_private(parent)->winSetupGestures(); +#endif + } +} + +/*! \internal */ +bool QPinchGesture::event(QEvent *event) +{ + switch (event->type()) { + case QEvent::ParentAboutToChange: + if (QWidget *w = qobject_cast(parent())) { + getQApplicationPrivateInternal()->widgetGestures[w].pinch = 0; +#ifdef Q_WS_WIN + qt_widget_private(w)->winSetupGestures(); +#endif + } + break; + case QEvent::ParentChange: + if (QWidget *w = qobject_cast(parent())) { + getQApplicationPrivateInternal()->widgetGestures[w].pinch = this; +#ifdef Q_WS_WIN + qt_widget_private(w)->winSetupGestures(); +#endif + } + break; + default: + break; + } + return QObject::event(event); +} + +bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event) +{ +#ifdef Q_WS_WIN + Q_D(QPinchGesture); + if (receiver->isWidgetType() && event->type() == QEvent::NativeGesture) { + QNativeGestureEvent *ev = static_cast(event); + QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); + QApplicationPrivate::WidgetStandardGesturesMap::iterator it; + it = qAppPriv->widgetGestures.find(static_cast(receiver)); + if (it == qAppPriv->widgetGestures.end()) + return false; + if (this != it.value().pinch) + return false; + Qt::GestureState nextState = Qt::NoGesture; + switch(ev->gestureType) { + case QNativeGestureEvent::GestureBegin: + // next we might receive the first gesture update event, so we + // prepare for it. + d->state = Qt::NoGesture; + d->scaleFactor = d->lastScaleFactor = 1; + d->rotationAngle = d->lastRotationAngle = 0; + d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint(); + d->initialDistance = 0; + return false; + case QNativeGestureEvent::Rotate: + d->lastRotationAngle = d->rotationAngle; + d->rotationAngle = -1 * GID_ROTATE_ANGLE_FROM_ARGUMENT(ev->argument); + nextState = Qt::GestureUpdated; + event->accept(); + break; + case QNativeGestureEvent::Zoom: + if (d->initialDistance != 0) { + d->lastScaleFactor = d->scaleFactor; + int distance = int(qint64(ev->argument)); + d->scaleFactor = (qreal) distance / d->initialDistance; + } else { + d->initialDistance = int(qint64(ev->argument)); + } + nextState = Qt::GestureUpdated; + event->accept(); + break; + case QNativeGestureEvent::GestureEnd: + if (state() == Qt::NoGesture) + return false; // some other gesture has ended + nextState = Qt::GestureFinished; + break; + default: + return false; + } + if (d->startCenterPoint.isNull()) + d->startCenterPoint = d->centerPoint; + d->lastCenterPoint = d->centerPoint; + d->centerPoint = static_cast(receiver)->mapFromGlobal(ev->position); + updateState(nextState); + return true; + } +#endif + return QGesture::eventFilter(receiver, event); +} + +/*! \internal */ +bool QPinchGesture::filterEvent(QEvent *event) +{ + Q_UNUSED(event); + return false; +} + +/*! \internal */ +void QPinchGesture::reset() +{ + Q_D(QPinchGesture); + d->scaleFactor = d->lastScaleFactor = 0; + d->rotationAngle = d->lastRotationAngle = 0; + d->startCenterPoint = d->centerPoint = d->lastCenterPoint = QPoint(); + QGesture::reset(); +} + +/*! + \property QPinchGesture::scaleFactor + + Specifies a scale factor of the pinch gesture. +*/ +qreal QPinchGesture::scaleFactor() const +{ + return d_func()->scaleFactor; +} + +/*! + \property QPinchGesture::lastScaleFactor + + Specifies a previous scale factor of the pinch gesture. +*/ +qreal QPinchGesture::lastScaleFactor() const +{ + return d_func()->lastScaleFactor; +} + +/*! + \property QPinchGesture::rotationAngle + + Specifies a rotation angle of the gesture. +*/ +qreal QPinchGesture::rotationAngle() const +{ + return d_func()->rotationAngle; +} + +/*! + \property QPinchGesture::lastRotationAngle + + Specifies a previous rotation angle of the gesture. +*/ +qreal QPinchGesture::lastRotationAngle() const +{ + return d_func()->lastRotationAngle; +} + +/*! + \property QPinchGesture::centerPoint + + Specifies a center point of the gesture. The point can be used as a center + point that the object is rotated around. +*/ +QPoint QPinchGesture::centerPoint() const +{ + return d_func()->centerPoint; +} + +/*! + \property QPinchGesture::lastCenterPoint + + Specifies a previous center point of the gesture. +*/ +QPoint QPinchGesture::lastCenterPoint() const +{ + return d_func()->lastCenterPoint; +} + +/*! + \property QPinchGesture::startCenterPoint + + Specifies an initial center point of the gesture. Difference between the + startCenterPoint and the centerPoint is the distance at which pinching + fingers has shifted. +*/ +QPoint QPinchGesture::startCenterPoint() const +{ + return d_func()->startCenterPoint; +} + QT_END_NAMESPACE #include "moc_qstandardgestures.cpp" diff --git a/src/gui/kernel/qstandardgestures.h b/src/gui/kernel/qstandardgestures.h index 03a1374..adee740 100644 --- a/src/gui/kernel/qstandardgestures.h +++ b/src/gui/kernel/qstandardgestures.h @@ -80,6 +80,45 @@ private: friend class QWidget; }; +class QPinchGesturePrivate; +class Q_GUI_EXPORT QPinchGesture : public QGesture +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QPinchGesture) + + Q_PROPERTY(qreal scaleFactor READ scaleFactor) + Q_PROPERTY(qreal lastScaleFactor READ lastScaleFactor) + + Q_PROPERTY(qreal rotationAngle READ rotationAngle) + Q_PROPERTY(qreal lastRotationAngle READ lastRotationAngle) + + Q_PROPERTY(QPoint startCenterPoint READ startCenterPoint) + Q_PROPERTY(QPoint lastCenterPoint READ lastCenterPoint) + Q_PROPERTY(QPoint centerPoint READ centerPoint) + +public: + QPinchGesture(QWidget *parent); + + bool filterEvent(QEvent *event); + void reset(); + + QPoint startCenterPoint() const; + QPoint lastCenterPoint() const; + QPoint centerPoint() const; + + qreal scaleFactor() const; + qreal lastScaleFactor() const; + + qreal rotationAngle() const; + qreal lastRotationAngle() const; + +private: + bool event(QEvent *event); + bool eventFilter(QObject *receiver, QEvent *event); + + friend class QWidget; +}; + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/kernel/qstandardgestures_p.h b/src/gui/kernel/qstandardgestures_p.h index 0fe24ee..43636d0 100644 --- a/src/gui/kernel/qstandardgestures_p.h +++ b/src/gui/kernel/qstandardgestures_p.h @@ -85,6 +85,31 @@ public: #endif }; +class QPinchGesturePrivate : public QGesturePrivate +{ + Q_DECLARE_PUBLIC(QPinchGesture) + +public: + QPinchGesturePrivate() + : scaleFactor(0), lastScaleFactor(0), + rotationAngle(0), lastRotationAngle(0) +#ifdef Q_WS_WIN + ,initialDistance(0) +#endif + { + } + qreal scaleFactor; + qreal lastScaleFactor; + qreal rotationAngle; + qreal lastRotationAngle; + QPoint startCenterPoint; + QPoint lastCenterPoint; + QPoint centerPoint; +#ifdef Q_WS_WIN + int initialDistance; +#endif +}; + QT_END_NAMESPACE #endif // QSTANDARDGESTURES_P_H diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 7cfa111..510df7f 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1160,6 +1160,8 @@ void QWidgetPrivate::show_sys() data.window_state |= Qt::WindowMaximized; } + winSetupGestures(); + invalidateBuffer(q->rect()); } #endif //Q_WS_WINCE @@ -2058,8 +2060,11 @@ void QWidgetPrivate::winSetupGestures() Q_Q(QWidget); if (!q) return; - extern QApplicationPrivate* getQApplicationPrivateInternal(); - QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); + q->setAttribute(Qt::WA_DontCreateNativeAncestors); + q->setAttribute(Qt::WA_NativeWindow); + if (!q->isVisible()) + return; + QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); bool needh = false; bool needv = false; bool singleFingerPanEnabled = false; @@ -2072,34 +2077,43 @@ void QWidgetPrivate::winSetupGestures() QScrollBar *vbar = asa->verticalScrollBar(); Qt::ScrollBarPolicy hbarpolicy = asa->horizontalScrollBarPolicy(); Qt::ScrollBarPolicy vbarpolicy = asa->verticalScrollBarPolicy(); - needh = (hbarpolicy == Qt::ScrollBarAlwaysOn - || (hbarpolicy == Qt::ScrollBarAsNeeded && hbar->minimum() < hbar->maximum())); - needv = (vbarpolicy == Qt::ScrollBarAlwaysOn - || (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum())); + needh = (hbarpolicy == Qt::ScrollBarAlwaysOn || + (hbarpolicy == Qt::ScrollBarAsNeeded && hbar->minimum() < hbar->maximum())); + needv = (vbarpolicy == Qt::ScrollBarAlwaysOn || + (vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum())); singleFingerPanEnabled = asa->d_func()->singleFingerPanEnabled; } else { winid = q->winId(); } if (qAppPriv->SetGestureConfig) { - GESTURECONFIG gc[2]; + GESTURECONFIG gc[3]; + memset(gc, 0, sizeof(gc)); gc[0].dwID = GID_PAN; - if (gestures.pan || needh || needv) { + if (gestures.pan) { gc[0].dwWant = GC_PAN; - gc[0].dwBlock = 0; if (needv && singleFingerPanEnabled) gc[0].dwWant |= GC_PAN_WITH_SINGLE_FINGER_VERTICALLY; + else + gc[0].dwBlock |= GC_PAN_WITH_SINGLE_FINGER_VERTICALLY; if (needh && singleFingerPanEnabled) gc[0].dwWant |= GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY; + else + gc[0].dwBlock |= GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY; } else { - gc[0].dwWant = 0; gc[0].dwBlock = GC_PAN; } gc[1].dwID = GID_ZOOM; - if (gestures.pinch) { + if (gestures.pinch) gc[1].dwWant = GC_ZOOM; - gc[1].dwBlock = 0; - } + else + gc[1].dwBlock = GC_ZOOM; + gc[2].dwID = GID_ROTATE; + if (gestures.pinch) + gc[2].dwWant = GC_ROTATE; + else + gc[2].dwBlock = GC_ROTATE; + Q_ASSERT(winid); qAppPriv->SetGestureConfig(winid, 0, sizeof(gc)/sizeof(gc[0]), gc, sizeof(gc[0])); } -- cgit v0.12 From 65ba2c18a9a3ec82331c0ccab47edc8e252192df Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 10 Aug 2009 13:45:24 +0200 Subject: Fixed an assert that could happen when the mediaSource is deleted When using streaming, it could happen that the last reference to the MediaSource is in another thread. So the objects are destroyed from another thread. In which case we would delete QObject (ioDevice) in another thread. That is fixed by calling deleteLater which will ensure that they are deleted in their own thread. Note: there was a nother assert that could happen due to a race condition in the worker thread. That is also fixed with this patch. Reviewed-by: jbache --- src/3rdparty/phonon/ds9/mediaobject.cpp | 55 ++++++++++-------------------- src/3rdparty/phonon/ds9/mediaobject.h | 1 - src/3rdparty/phonon/phonon/mediasource.cpp | 8 +++-- 3 files changed, 24 insertions(+), 40 deletions(-) diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp index 10782c2..b163ad4 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.cpp +++ b/src/3rdparty/phonon/ds9/mediaobject.cpp @@ -57,24 +57,6 @@ namespace Phonon { } - WorkerThread::Work WorkerThread::dequeueWork() - { - QMutexLocker locker(&m_mutex); - if (m_finished) { - return Work(); - } - Work ret = m_queue.dequeue(); - - //we ensure to have the wait condition in the right state - if (m_queue.isEmpty()) { - m_waitCondition.reset(); - } else { - m_waitCondition.set(); - } - - return ret; - } - void WorkerThread::run() { while (m_finished == false) { @@ -88,11 +70,6 @@ namespace Phonon } DWORD result = ::WaitForMultipleObjects(count, handles, FALSE, INFINITE); if (result == WAIT_OBJECT_0) { - if (m_finished) { - //that's the end of the thread execution - return; - } - handleTask(); } else { //this is the event management @@ -199,22 +176,25 @@ namespace Phonon void WorkerThread::handleTask() { - const Work w = dequeueWork(); - - if (m_finished) { + QMutexLocker locker(&m_mutex); + if (m_finished || m_queue.isEmpty()) { return; } - HRESULT hr = S_OK; + const Work w = m_queue.dequeue(); - { - QMutexLocker locker(&m_mutex); - m_currentRender = w.graph; - m_currentRenderId = w.id; + //we ensure to have the wait condition in the right state + if (m_queue.isEmpty()) { + m_waitCondition.reset(); + } else { + m_waitCondition.set(); } + HRESULT hr = S_OK; + + m_currentRender = w.graph; + m_currentRenderId = w.id; if (w.task == ReplaceGraph) { - QMutexLocker locker(&m_mutex); int index = -1; for(int i = 0; i < FILTER_COUNT; ++i) { if (m_graphHandle[i].graph == w.oldGraph) { @@ -237,6 +217,9 @@ namespace Phonon m_graphHandle[index].handle = h; } } else if (w.task == Render) { + //we need to unlock here because the use might trigger a call to abort + //which uses the same mutex + locker.unlock(); if (w.filter) { //let's render pins w.graph->AddFilter(w.filter, 0); @@ -255,6 +238,7 @@ namespace Phonon if (hr != E_ABORT) { emit asyncRenderFinished(w.id, hr, w.graph); } + locker.relock(); } else if (w.task == Seek) { //that's a seekrequest ComPointer mediaSeeking(w.graph, IID_IMediaSeeking); @@ -327,11 +311,8 @@ namespace Phonon } } - { - QMutexLocker locker(&m_mutex); - m_currentRender = Graph(); - m_currentRenderId = 0; - } + m_currentRender = Graph(); + m_currentRenderId = 0; } void WorkerThread::abortCurrentRender(qint16 renderId) diff --git a/src/3rdparty/phonon/ds9/mediaobject.h b/src/3rdparty/phonon/ds9/mediaobject.h index 2c34ffc..fe52604 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.h +++ b/src/3rdparty/phonon/ds9/mediaobject.h @@ -135,7 +135,6 @@ namespace Phonon }; QList decoders; //for the state change requests }; - Work dequeueWork(); void handleTask(); Graph m_currentRender; diff --git a/src/3rdparty/phonon/phonon/mediasource.cpp b/src/3rdparty/phonon/phonon/mediasource.cpp index 0a21c87..c003af9 100644 --- a/src/3rdparty/phonon/phonon/mediasource.cpp +++ b/src/3rdparty/phonon/phonon/mediasource.cpp @@ -140,8 +140,12 @@ MediaSourcePrivate::~MediaSourcePrivate() { #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM if (autoDelete) { - delete stream; - delete ioDevice; + //here we use deleteLater because this object + //might be destroyed from another thread + if (stream) + stream->deleteLater(); + if (ioDevice) + ioDevice->deleteLater(); } #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM } -- cgit v0.12 From 2a1dcf7a47d81ad8b492c312dfd5e422ba2e3cd0 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 10 Aug 2009 14:57:30 +0200 Subject: qdoc: List the NOTIFY signal function in the property doc. --- tools/qdoc3/cppcodeparser.cpp | 3 +++ tools/qdoc3/generator.cpp | 2 +- tools/qdoc3/htmlgenerator.cpp | 8 ++++++++ tools/qdoc3/node.h | 5 +++-- tools/qdoc3/tree.cpp | 3 +++ 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index 562684b..12ec7f3 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -1737,6 +1737,9 @@ bool CppCodeParser::matchProperty(InnerNode *parent) property->setDesignable(value.toLower() == "true"); else if (key == "RESET") tre->addPropertyFunction(property, value, PropertyNode::Resetter); + else if (key == "NOTIFY") { + tre->addPropertyFunction(property, value, PropertyNode::Notifier); + } } match(Tok_RightParen); return true; diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index e92f53b..9538dfe 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -283,7 +283,7 @@ bool Generator::generateText(const Text& text, bool Generator::generateQmlText(const Text& text, const Node *relative, CodeMarker *marker, - const QString& qmlName) + const QString& /* qmlName */ ) { const Atom* atom = text.firstAtom(); if (atom == 0) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 26874e1..c203c62 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -3420,6 +3420,14 @@ void HtmlGenerator::generateDetailedMember(const Node *node, out() << "

Access functions:

\n"; generateSectionList(section, node, marker, CodeMarker::Accessors); } + + Section notifiers; + notifiers.members += property->notifiers(); + + if (!notifiers.members.isEmpty()) { + out() << "

Notifier signal:

\n"; + generateSectionList(notifiers, node, marker, CodeMarker::Accessors); + } } else if (node->type() == Node::Enum) { const EnumNode *enume = static_cast(node); diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 17ec447..61f2a76 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -590,8 +590,8 @@ class FunctionNode : public LeafNode class PropertyNode : public LeafNode { public: - enum FunctionRole { Getter, Setter, Resetter }; - enum { NumFunctionRoles = Resetter + 1 }; + enum FunctionRole { Getter, Setter, Resetter, Notifier }; + enum { NumFunctionRoles = Notifier + 1 }; PropertyNode(InnerNode *parent, const QString& name); virtual ~PropertyNode() { } @@ -609,6 +609,7 @@ class PropertyNode : public LeafNode NodeList getters() const { return functions(Getter); } NodeList setters() const { return functions(Setter); } NodeList resetters() const { return functions(Resetter); } + NodeList notifiers() const { return functions(Notifier); } bool isStored() const { return fromTrool(sto, storedDefault()); } bool isDesignable() const { return fromTrool(des, designableDefault()); } const PropertyNode *overriddenFrom() const { return overrides; } diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index f832062..a5e22f1 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -485,6 +485,7 @@ void Tree::resolveProperties() QString getterName = (*propEntry)[PropertyNode::Getter]; QString setterName = (*propEntry)[PropertyNode::Setter]; QString resetterName = (*propEntry)[PropertyNode::Resetter]; + QString notifierName = (*propEntry)[PropertyNode::Notifier]; NodeList::ConstIterator c = parent->childNodes().begin(); while (c != parent->childNodes().end()) { @@ -499,6 +500,8 @@ void Tree::resolveProperties() property->addFunction(function, PropertyNode::Setter); } else if (function->name() == resetterName) { property->addFunction(function, PropertyNode::Resetter); + } else if (function->name() == notifierName) { + property->addFunction(function, PropertyNode::Notifier); } } } -- cgit v0.12 From 4fe7c464be95fbbcb663a21f9519024486123248 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 10 Aug 2009 11:26:01 +0200 Subject: Compile fix with namespaces --- examples/statemachine/rogue/window.h | 2 ++ src/corelib/kernel/qeventdispatcher_unix.cpp | 2 +- src/corelib/tools/qsharedpointer.cpp | 10 ++++++++++ src/gui/graphicsview/qgraphicstransform_p.h | 4 ++++ src/gui/image/qimagepixmapcleanuphooks.cpp | 3 +++ src/network/access/qnetworkcookie.h | 6 +++--- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/examples/statemachine/rogue/window.h b/examples/statemachine/rogue/window.h index bcd86bd..1df566d 100644 --- a/examples/statemachine/rogue/window.h +++ b/examples/statemachine/rogue/window.h @@ -44,9 +44,11 @@ #include +QT_BEGIN_NAMESPACE class QState; class QStateMachine; class QTransition; +QT_END_NAMESPACE #define WIDTH 35 #define HEIGHT 20 diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index 7982d4c..da15148 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -627,7 +627,7 @@ QEventDispatcherUNIX::~QEventDispatcherUNIX() int QEventDispatcherUNIX::select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, timeval *timeout) { - return ::qt_safe_select(nfds, readfds, writefds, exceptfds, timeout); + return qt_safe_select(nfds, readfds, writefds, exceptfds, timeout); } /*! diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index f18dee8..cdb7d1d 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -867,6 +867,8 @@ #if !defined(QT_NO_QOBJECT) #include "../kernel/qobject_p.h" +QT_BEGIN_NAMESPACE + /*! \internal This function is called for a just-created QObject \a obj, to enable @@ -910,6 +912,9 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge } return d->sharedRefcount; } + +QT_END_NAMESPACE + #endif @@ -932,6 +937,8 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge # include # include +QT_BEGIN_NAMESPACE + static inline QByteArray saveBacktrace() __attribute__((always_inline)); static inline QByteArray saveBacktrace() { @@ -992,6 +999,9 @@ static void printBacktrace(QByteArray stacktrace) waitpid(child, 0, 0); } } + +QT_END_NAMESPACE + # endif // BACKTRACE_SUPPORTED namespace { diff --git a/src/gui/graphicsview/qgraphicstransform_p.h b/src/gui/graphicsview/qgraphicstransform_p.h index 2d36eda..467021f 100644 --- a/src/gui/graphicsview/qgraphicstransform_p.h +++ b/src/gui/graphicsview/qgraphicstransform_p.h @@ -55,6 +55,8 @@ #include "private/qobject_p.h" +QT_BEGIN_NAMESPACE + class QGraphicsItem; class QGraphicsTransformPrivate : public QObjectPrivate { @@ -70,4 +72,6 @@ public: static void updateItem(QGraphicsItem *item); }; +QT_END_NAMESPACE + #endif // QGRAPHICSTRANSFORM_P_H diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp index 7d1c5fb..789700a 100644 --- a/src/gui/image/qimagepixmapcleanuphooks.cpp +++ b/src/gui/image/qimagepixmapcleanuphooks.cpp @@ -43,6 +43,8 @@ #include "qpixmapdata_p.h" +QT_BEGIN_NAMESPACE + // Legacy, single instance hooks: ### Qt 5: remove typedef void (*_qt_pixmap_cleanup_hook)(int); typedef void (*_qt_pixmap_cleanup_hook_64)(qint64); @@ -108,3 +110,4 @@ void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) qt_image_cleanup_hook_64(key); } +QT_END_NAMESPACE diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h index ef309a8..4bc3f3f 100644 --- a/src/network/access/qnetworkcookie.h +++ b/src/network/access/qnetworkcookie.h @@ -106,9 +106,6 @@ private: }; Q_DECLARE_TYPEINFO(QNetworkCookie, Q_MOVABLE_TYPE); -// ### Qt5 remove this include -#include "qnetworkcookiejar.h" - #ifndef QT_NO_DEBUG_STREAM class QDebug; Q_NETWORK_EXPORT QDebug operator<<(QDebug, const QNetworkCookie &); @@ -116,6 +113,9 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug, const QNetworkCookie &); QT_END_NAMESPACE +// ### Qt5 remove this include +#include "qnetworkcookiejar.h" + Q_DECLARE_METATYPE(QNetworkCookie) Q_DECLARE_METATYPE(QList) -- cgit v0.12 From cbf60a676402eebae558568a2da4574a20f7a27e Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 10 Aug 2009 15:10:22 +0200 Subject: Compile fix for QStringBuilder auto test --- tests/auto/qstringbuilder/scenario1.pro | 1 + tests/auto/qstringbuilder/scenario2.pro | 1 + tests/auto/qstringbuilder/scenario3.pro | 1 + tests/auto/qstringbuilder/scenario4.pro | 1 + tests/auto/qstringbuilder/tst_qstringbuilder.cpp | 11 +---- tests/auto/qstringbuilder/tst_qstringbuilder.h | 55 ++++++++++++++++++++++++ 6 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 tests/auto/qstringbuilder/tst_qstringbuilder.h diff --git a/tests/auto/qstringbuilder/scenario1.pro b/tests/auto/qstringbuilder/scenario1.pro index 4ce7156..d72451c 100644 --- a/tests/auto/qstringbuilder/scenario1.pro +++ b/tests/auto/qstringbuilder/scenario1.pro @@ -3,6 +3,7 @@ load(qttest_p4) QT = core SOURCES += scenario1.cpp +HEADERS += tst_qstringbuilder.h DEFINES += SCENARIO=1 diff --git a/tests/auto/qstringbuilder/scenario2.pro b/tests/auto/qstringbuilder/scenario2.pro index 64c46e2..78e0c68 100644 --- a/tests/auto/qstringbuilder/scenario2.pro +++ b/tests/auto/qstringbuilder/scenario2.pro @@ -3,5 +3,6 @@ load(qttest_p4) QT = core SOURCES += scenario2.cpp +HEADERS += tst_qstringbuilder.h DEFINES += SCENARIO=2 diff --git a/tests/auto/qstringbuilder/scenario3.pro b/tests/auto/qstringbuilder/scenario3.pro index beedffd..7b9e5af 100644 --- a/tests/auto/qstringbuilder/scenario3.pro +++ b/tests/auto/qstringbuilder/scenario3.pro @@ -3,5 +3,6 @@ load(qttest_p4) QT = core SOURCES += scenario3.cpp +HEADERS += tst_qstringbuilder.h DEFINES += SCENARIO=3 diff --git a/tests/auto/qstringbuilder/scenario4.pro b/tests/auto/qstringbuilder/scenario4.pro index 1c45a70..1b62b25 100644 --- a/tests/auto/qstringbuilder/scenario4.pro +++ b/tests/auto/qstringbuilder/scenario4.pro @@ -3,5 +3,6 @@ load(qttest_p4) QT = core SOURCES += scenario4.cpp +HEADERS += tst_qstringbuilder.h DEFINES += SCENARIO=4 diff --git a/tests/auto/qstringbuilder/tst_qstringbuilder.cpp b/tests/auto/qstringbuilder/tst_qstringbuilder.cpp index 72889bc..86f6ada 100644 --- a/tests/auto/qstringbuilder/tst_qstringbuilder.cpp +++ b/tests/auto/qstringbuilder/tst_qstringbuilder.cpp @@ -86,20 +86,13 @@ #endif #include +#include "tst_qstringbuilder.h" //TESTED_CLASS=QStringBuilder //TESTED_FILES=qstringbuilder.cpp #define LITERAL "some literal" -class tst_QStringBuilder : public QObject -{ - Q_OBJECT - -private slots: - void scenario(); -}; - void tst_QStringBuilder::scenario() { QLatin1Literal l1literal(LITERAL); @@ -138,5 +131,3 @@ void tst_QStringBuilder::scenario() } QTEST_APPLESS_MAIN(tst_QStringBuilder) - -#include "tst_qstringbuilder.moc" diff --git a/tests/auto/qstringbuilder/tst_qstringbuilder.h b/tests/auto/qstringbuilder/tst_qstringbuilder.h new file mode 100644 index 0000000..92c66d8 --- /dev/null +++ b/tests/auto/qstringbuilder/tst_qstringbuilder.h @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TST_QSTRINGBUILDER_H +#define TST_QSTRINGBUILDER_H + +#include + +class tst_QStringBuilder : public QObject +{ + Q_OBJECT + +private slots: + void scenario(); +}; + +#endif -- cgit v0.12 From 56f58a397ace5985571995ddfce98a99c490ebf8 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 10 Aug 2009 15:45:02 +0200 Subject: Removed unused member in QApplicationPrivate The appAllTouchPoints variable isn't used on Windows, remove it. --- src/gui/kernel/qapplication_p.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index 9953907..f809672 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -527,7 +527,6 @@ public: static PtrCloseTouchInputHandle CloseTouchInputHandle; QHash touchInputIDToTouchPointID; - QList appAllTouchPoints; bool translateTouchEvent(const MSG &msg); PtrGetGestureInfo GetGestureInfo; -- cgit v0.12 From 24aa36349b9fc0be9d9bf80b0db607588e0a54f6 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 10 Aug 2009 15:50:43 +0200 Subject: Doc: Fix qdoc warnings --- src/gui/kernel/qgesture.cpp | 2 +- src/testlib/qabstracttestlogger.cpp | 4 +++- src/testlib/qbenchmark.cpp | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp index 38e8851..672fc1c 100644 --- a/src/gui/kernel/qgesture.cpp +++ b/src/gui/kernel/qgesture.cpp @@ -204,7 +204,7 @@ Qt::GestureState QGesture::state() const \a state, and it should be called after all the internal properties have been initialized. - \sa started, triggered, finished, cancelled + \sa started(), triggered(), finished(), cancelled() */ void QGesture::updateState(Qt::GestureState state) { diff --git a/src/testlib/qabstracttestlogger.cpp b/src/testlib/qabstracttestlogger.cpp index 2fa535e..6b4b375 100644 --- a/src/testlib/qabstracttestlogger.cpp +++ b/src/testlib/qabstracttestlogger.cpp @@ -114,7 +114,9 @@ namespace QTest extern void filter_unprintable(char *str); -/*! \internal +/*! + \fn int QTest::qt_asprintf(QTestCharBuffer *buf, const char *format, ...); + \internal */ int qt_asprintf(QTestCharBuffer *str, const char *format, ...) { diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index bad3379..eaec02f 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -179,11 +179,17 @@ void QBenchmarkTestMethodData::setResult(qint64 value) QBenchmarkResult(QBenchmarkGlobalData::current->context, value, iterationCount); } -/*! \internal +/*! + \class QTest::QBenchmarkIterationController + \internal + The QBenchmarkIterationController class is used by the QBENCHMARK macro to drive the benchmarking loop. It is repsonsible for starting and stopping the timing measurements as well as calling the result reporting functions. */ + +/*! \internal +*/ QTest::QBenchmarkIterationController::QBenchmarkIterationController(RunMode runMode) { QTest::beginBenchmarkMeasurement(); -- cgit v0.12 From 0c98e05dfeccdca99bc180ccccd04b38305ad025 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 10 Aug 2009 16:07:33 +0200 Subject: Compile fix on Linux. Reviewed-by: brad The declaration of getQApplicationPrivateInternal was only available as 'friend' on Q_WS_WIN. --- src/gui/kernel/qapplication.h | 4 ---- src/gui/kernel/qapplication_win.cpp | 11 +++-------- src/gui/kernel/qstandardgestures.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index 19ae085..58e0cc3 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -375,10 +375,6 @@ private: friend class QDirectPainterPrivate; #endif -#if defined(Q_WS_WIN) - friend QApplicationPrivate* getQApplicationPrivateInternal(); -#endif - #if defined(Q_WS_MAC) || defined(Q_WS_X11) Q_PRIVATE_SLOT(d_func(), void _q_alertTimeOut()) #endif diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index cb67409..d5448db 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -428,11 +428,6 @@ extern QCursor *qt_grab_cursor(); #define __export #endif -QApplicationPrivate* getQApplicationPrivateInternal() -{ - return qApp->d_func(); -} - extern "C" LRESULT CALLBACK QtWndProc(HWND, UINT, WPARAM, LPARAM); class QETWidget : public QWidget // event translator widget @@ -1461,7 +1456,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam // we receive the message for each toplevel window included internal hidden ones, // but the aboutToQuit signal should be emitted only once. - QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); + QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); if (endsession && !qAppPriv->aboutToQuitEmitted) { qAppPriv->aboutToQuitEmitted = true; int index = QApplication::staticMetaObject.indexOfSignal("aboutToQuit()"); @@ -1648,7 +1643,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam } else { switch (message) { case WM_TOUCH: - result = getQApplicationPrivateInternal()->translateTouchEvent(msg); + result = QApplicationPrivate::instance()->translateTouchEvent(msg); break; case WM_KEYDOWN: // keyboard event case WM_SYSKEYDOWN: @@ -3719,7 +3714,7 @@ bool QETWidget::translateGestureEvent(const MSG &msg) memset(&gi, 0, sizeof(GESTUREINFO)); gi.cbSize = sizeof(GESTUREINFO); - QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); + QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); BOOL bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi); if (bResult) { const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y); diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp index ac03cd2..b4c3787 100644 --- a/src/gui/kernel/qstandardgestures.cpp +++ b/src/gui/kernel/qstandardgestures.cpp @@ -293,7 +293,7 @@ QPinchGesture::QPinchGesture(QWidget *parent) : QGesture(*new QPinchGesturePrivate, parent) { if (parent) { - QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); + QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); qAppPriv->widgetGestures[parent].pinch = this; #ifdef Q_WS_WIN qt_widget_private(parent)->winSetupGestures(); @@ -307,7 +307,7 @@ bool QPinchGesture::event(QEvent *event) switch (event->type()) { case QEvent::ParentAboutToChange: if (QWidget *w = qobject_cast(parent())) { - getQApplicationPrivateInternal()->widgetGestures[w].pinch = 0; + QApplicationPrivate::instance()->widgetGestures[w].pinch = 0; #ifdef Q_WS_WIN qt_widget_private(w)->winSetupGestures(); #endif @@ -315,7 +315,7 @@ bool QPinchGesture::event(QEvent *event) break; case QEvent::ParentChange: if (QWidget *w = qobject_cast(parent())) { - getQApplicationPrivateInternal()->widgetGestures[w].pinch = this; + QApplicationPrivate::instance()->widgetGestures[w].pinch = this; #ifdef Q_WS_WIN qt_widget_private(w)->winSetupGestures(); #endif @@ -333,7 +333,7 @@ bool QPinchGesture::eventFilter(QObject *receiver, QEvent *event) Q_D(QPinchGesture); if (receiver->isWidgetType() && event->type() == QEvent::NativeGesture) { QNativeGestureEvent *ev = static_cast(event); - QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); + QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); QApplicationPrivate::WidgetStandardGesturesMap::iterator it; it = qAppPriv->widgetGestures.find(static_cast(receiver)); if (it == qAppPriv->widgetGestures.end()) -- cgit v0.12 From eeb206d41d386d4d3dee1ff2813d132d15f670d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 10 Aug 2009 16:16:16 +0200 Subject: Compile and work on Linux. Reviewed-by: Kim --- tests/arthur/lance/main.cpp | 2 +- tests/arthur/lance/widgets.h | 39 +++++++++++++++++++++------------------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/tests/arthur/lance/main.cpp b/tests/arthur/lance/main.cpp index f95b426..0c9f3d8 100644 --- a/tests/arthur/lance/main.cpp +++ b/tests/arthur/lance/main.cpp @@ -271,7 +271,7 @@ int main(int argc, char **argv) QString format = QString(argv[++i]).toLower(); imageFormat = QImage::Format_Invalid; - static const unsigned int formatCount = + static const int formatCount = sizeof(imageFormats) / sizeof(imageFormats[0]); for (int ff = 0; ff < formatCount; ++ff) { if (QLatin1String(imageFormats[ff].name) == format) { diff --git a/tests/arthur/lance/widgets.h b/tests/arthur/lance/widgets.h index 7247608..61691dc 100644 --- a/tests/arthur/lance/widgets.h +++ b/tests/arthur/lance/widgets.h @@ -56,6 +56,9 @@ #include #include #include +#include +#include + #include @@ -96,8 +99,8 @@ public: OnScreenWidget(const QString &file, QWidget *parent = 0) : T(parent), - m_view_mode(RenderView), - m_filename(file) + m_filename(file), + m_view_mode(RenderView) { QSettings settings("Trolltech", "lance"); for (int i=0; i<10; ++i) { @@ -117,36 +120,36 @@ public: } if (m_baseline.isNull()) { - setWindowTitle("Rendering: '" + file + "'. No baseline available"); + T::setWindowTitle("Rendering: '" + file + "'. No baseline available"); } else { - setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference"); + T::setWindowTitle("Rendering: '" + file + "'. Shortcuts: 1=render, 2=baseline, 3=difference"); StupidWorkaround *workaround = new StupidWorkaround(this, &m_view_mode); QSignalMapper *mapper = new QSignalMapper(this); - connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int))); - connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString))); + T::connect(mapper, SIGNAL(mapped(int)), workaround, SLOT(setViewMode(int))); + T::connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setWindowTitle(QString))); QAction *renderViewAction = new QAction("Render View", this); renderViewAction->setShortcut(Qt::Key_1); - connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map())); + T::connect(renderViewAction, SIGNAL(triggered()), mapper, SLOT(map())); mapper->setMapping(renderViewAction, RenderView); mapper->setMapping(renderViewAction, "Render View: " + file); - addAction(renderViewAction); + T::addAction(renderViewAction); QAction *baselineAction = new QAction("Baseline", this); baselineAction->setShortcut(Qt::Key_2); - connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map())); + T::connect(baselineAction, SIGNAL(triggered()), mapper, SLOT(map())); mapper->setMapping(baselineAction, BaselineView); mapper->setMapping(baselineAction, "Baseline View: " + file); - addAction(baselineAction); + T::addAction(baselineAction); QAction *differenceAction = new QAction("Differenfe View", this); differenceAction->setShortcut(Qt::Key_3); - connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map())); + T::connect(differenceAction, SIGNAL(triggered()), mapper, SLOT(map())); mapper->setMapping(differenceAction, DifferenceView); mapper->setMapping(differenceAction, "Difference View" + file); - addAction(differenceAction); + T::addAction(differenceAction); } @@ -178,7 +181,7 @@ public: } } - void OnScreenWidget::paintRenderView() + void paintRenderView() { QPainter pt; QPaintDevice *dev = this; @@ -233,7 +236,7 @@ public: } if (m_render_view.isNull()) { - m_render_view = window()->windowSurface()->grabWidget(this); + m_render_view = T::window()->windowSurface()->grabWidget(this); m_render_view.save("renderView.png"); } } @@ -242,7 +245,7 @@ public: QPainter p(this); if (m_baseline.isNull()) { - p.drawText(rect(), Qt::AlignCenter, + p.drawText(T::rect(), Qt::AlignCenter, "No baseline found\n" "file '" + m_baseline_name + "' does not exist..."); return; @@ -258,7 +261,7 @@ public: QPixmap generateDifference() { - QImage img(size(), QImage::Format_RGB32); + QImage img(T::size(), QImage::Format_RGB32); img.fill(0); QPainter p(&img); @@ -275,13 +278,13 @@ public: void paintDifferenceView() { QPainter p(this); if (m_baseline.isNull()) { - p.drawText(rect(), Qt::AlignCenter, + p.drawText(T::rect(), Qt::AlignCenter, "No baseline found\n" "file '" + m_baseline_name + "' does not exist..."); return; } - p.fillRect(rect(), Qt::black); + p.fillRect(T::rect(), Qt::black); p.drawPixmap(0, 0, generateDifference()); } -- cgit v0.12 From 9c4ed99ede2de8dae005cef9a6c519e2b561a54f Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Mon, 10 Aug 2009 16:15:03 +0200 Subject: Fixed a possible problem when unplugging a QToolBar The 'break' statement was misplaced... This was found thanks to coverity --- src/gui/widgets/qtoolbararealayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qtoolbararealayout.cpp b/src/gui/widgets/qtoolbararealayout.cpp index b4a0ef0..afd526a 100644 --- a/src/gui/widgets/qtoolbararealayout.cpp +++ b/src/gui/widgets/qtoolbararealayout.cpp @@ -1156,8 +1156,8 @@ QLayoutItem *QToolBarAreaLayout::unplug(const QList &path, QToolBarAreaLayo if (!next.skip()) { newExtraSpace = next.pos - previous.pos - pick(line.o, previous.sizeHint()); previous.resize(line.o, next.pos - previous.pos); + break; } - break; } break; } -- cgit v0.12 From f4dba5394f6772a61af56fd25052e29a44de89ed Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 10 Aug 2009 16:27:51 +0200 Subject: Doc: Clarified the behavior of QDir::exists(). Task-number: 259091 Reviewed-by: Trust Me --- src/corelib/io/qdir.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 072eb27..cb0fdeb 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1541,9 +1541,11 @@ bool QDir::isReadable() const /*! \overload - Returns true if the \e directory exists; otherwise returns false. - (If a file with the same name is found this function will return - false). + Returns true if the directory exists; otherwise returns false. + (If a file with the same name is found this function will return false). + + The overload of this function that accepts an argument is used to test + for the presence of files and directories within a directory. \sa QFileInfo::exists(), QFile::exists() */ @@ -1773,8 +1775,11 @@ bool QDir::rename(const QString &oldName, const QString &newName) /*! Returns true if the file called \a name exists; otherwise returns - false. Unless \a name contains an absolute file path, the file - name is assumed to be relative to the current directory. + false. + + Unless \a name contains an absolute file path, the file name is assumed + to be relative to the directory itself, so this function is typically used + to check for the presence of files within a directory. \sa QFileInfo::exists(), QFile::exists() */ -- cgit v0.12 From a4b6a5ccf5146dc5fbe2b8363b4c6fb73a8d975e Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 10 Aug 2009 16:33:25 +0200 Subject: Doc: add \since 4.6 for new functions --- src/corelib/kernel/qmetaobject.cpp | 2 ++ src/testlib/qtestcase.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index d43c5dd..f153c7e 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -2488,6 +2488,7 @@ bool QMetaProperty::isUser(const QObject *object) const } /*! + \since 4.6 Returns true if the property is constant; otherwise returns false. A property is constant if the \c{Q_PROPERTY()}'s \c CONSTANT attribute @@ -2502,6 +2503,7 @@ bool QMetaProperty::isConstant() const } /*! + \since 4.6 Returns true if the property is final; otherwise returns false. A property is final if the \c{Q_PROPERTY()}'s \c FINAL attribute diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 21a686e..51e767c 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -353,6 +353,7 @@ QT_BEGIN_NAMESPACE /*! \macro QBENCHMARK_ONCE + \since 4.6 \relates QTest -- cgit v0.12 From 724d7721331b444a6dd817cd4e12909a2cae709a Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 10 Aug 2009 16:34:12 +0200 Subject: Doc: Fixed spelling mistake and some acronyms. Task-number: 259268 Reviewed-by: Trust Me --- src/network/access/qhttp.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp index faa2398..4c06848 100644 --- a/src/network/access/qhttp.cpp +++ b/src/network/access/qhttp.cpp @@ -1597,11 +1597,11 @@ QHttp::~QHttp() This enum is used to specify the mode of connection to use: - \value ConnectionModeHttp The connection is a regular Http connection to the server - \value ConnectionModeHttps The Https protocol is used and the connection is encrypted using SSL. + \value ConnectionModeHttp The connection is a regular HTTP connection to the server + \value ConnectionModeHttps The HTTPS protocol is used and the connection is encrypted using SSL. - When using the Https mode, care should be taken to connect to the sslErrors signal, and - handle possible Ssl errors. + When using the HTTPS mode, care should be taken to connect to the sslErrors signal, and + handle possible SSL errors. \sa QSslSocket */ @@ -2039,7 +2039,7 @@ int QHttp::setHost(const QString &hostName, quint16 port) port \a port using the connection mode \a mode. If port is 0, it will use the default port for the \a mode used - (80 for Http and 443 fopr Https). + (80 for HTTP and 443 for HTTPS). The function does not block; instead, it returns immediately. The request is scheduled, and its execution is performed asynchronously. The -- cgit v0.12 From 41537bb8ea6f6174690d244a1cc07678f4bf4229 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 10 Aug 2009 16:47:41 +0200 Subject: fix issues reported by Coverity --- src/corelib/statemachine/qhistorystate.cpp | 4 +--- src/corelib/statemachine/qstate_p.h | 2 +- src/corelib/statemachine/qstatemachine.cpp | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp index e5ca837..d21eee9 100644 --- a/src/corelib/statemachine/qhistorystate.cpp +++ b/src/corelib/statemachine/qhistorystate.cpp @@ -120,7 +120,7 @@ QT_BEGIN_NAMESPACE */ QHistoryStatePrivate::QHistoryStatePrivate() - : defaultState(0) + : defaultState(0), historyType(QHistoryState::ShallowHistory) { } @@ -135,8 +135,6 @@ QHistoryStatePrivate *QHistoryStatePrivate::get(QHistoryState *q) QHistoryState::QHistoryState(QState *parent) : QAbstractState(*new QHistoryStatePrivate, parent) { - Q_D(QHistoryState); - d->historyType = ShallowHistory; } /*! Constructs a new history state of the given \a type, with the given \a diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h index 20eb5ea..c43a26c 100644 --- a/src/corelib/statemachine/qstate_p.h +++ b/src/corelib/statemachine/qstate_p.h @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE struct QPropertyAssignment { QPropertyAssignment() - : object(0) {} + : object(0), explicitlySet(true) {} QPropertyAssignment(QObject *o, const QByteArray &n, const QVariant &v, bool es = true) : object(o), propertyName(n), value(v), explicitlySet(es) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 9cb1d4d..5926176 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -209,6 +209,7 @@ QStateMachinePrivate::QStateMachinePrivate() processing = false; processingScheduled = false; stop = false; + stopProcessingReason = EventQueueEmpty; error = QStateMachine::NoError; globalRestorePolicy = QStateMachine::DoNotRestoreProperties; signalEventGenerator = 0; -- cgit v0.12 From 66f26230a463fef12e8c95ea7819e476e038d4f8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 10 Aug 2009 16:53:28 +0200 Subject: Linguist: Fixed spehling error. --- tools/linguist/linguist/mainwindow.cpp | 10 +++++----- tools/linguist/linguist/mainwindow.ui | 6 +++--- tools/linguist/linguist/messageeditor.cpp | 2 +- tools/linguist/linguist/messageeditor.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp index bb79b19..22ff46a 100644 --- a/tools/linguist/linguist/mainwindow.cpp +++ b/tools/linguist/linguist/mainwindow.cpp @@ -482,9 +482,9 @@ MainWindow::MainWindow() readConfig(); m_statistics = 0; - connect(m_ui.actionLenghtVariants, SIGNAL(toggled(bool)), - m_messageEditor, SLOT(setLenghtVariants(bool))); - m_messageEditor->setLenghtVariants(m_ui.actionLenghtVariants->isChecked()); + connect(m_ui.actionLengthVariants, SIGNAL(toggled(bool)), + m_messageEditor, SLOT(setLengthVariants(bool))); + m_messageEditor->setLengthVariants(m_ui.actionLengthVariants->isChecked()); m_focusWatcher = new FocusWatcher(m_messageEditor, this); m_contextView->installEventFilter(m_focusWatcher); @@ -2521,7 +2521,7 @@ void MainWindow::readConfig() config.value(settingPath("Validators/PhraseMatch"), true).toBool()); m_ui.actionPlaceMarkerMatches->setChecked( config.value(settingPath("Validators/PlaceMarkers"), true).toBool()); - m_ui.actionLenghtVariants->setChecked( + m_ui.actionLengthVariants->setChecked( config.value(settingPath("Options/LengthVariants"), false).toBool()); recentFiles().readConfig(); @@ -2548,7 +2548,7 @@ void MainWindow::writeConfig() config.setValue(settingPath("Validators/PlaceMarkers"), m_ui.actionPlaceMarkerMatches->isChecked()); config.setValue(settingPath("Options/LengthVariants"), - m_ui.actionLenghtVariants->isChecked()); + m_ui.actionLengthVariants->isChecked()); config.setValue(settingPath("MainWindowState"), saveState()); recentFiles().writeConfig(); diff --git a/tools/linguist/linguist/mainwindow.ui b/tools/linguist/linguist/mainwindow.ui index 613241b..9dfb1ff 100644 --- a/tools/linguist/linguist/mainwindow.ui +++ b/tools/linguist/linguist/mainwindow.ui @@ -116,7 +116,7 @@ - + @@ -878,12 +878,12 @@ Ctrl+W - + true - Lenght Variants + Length Variants diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp index 9e598a8..e911389 100644 --- a/tools/linguist/linguist/messageeditor.cpp +++ b/tools/linguist/linguist/messageeditor.cpp @@ -710,7 +710,7 @@ void MessageEditor::setEditingEnabled(int model, bool enabled) updateCanPaste(); } -void MessageEditor::setLenghtVariants(bool on) +void MessageEditor::setLengthVariants(bool on) { m_lengthVariants = on; foreach (const MessageEditorData &ed, m_editors) diff --git a/tools/linguist/linguist/messageeditor.h b/tools/linguist/linguist/messageeditor.h index 4106036..b195a04 100644 --- a/tools/linguist/linguist/messageeditor.h +++ b/tools/linguist/linguist/messageeditor.h @@ -110,7 +110,7 @@ public slots: void beginFromSource(); void setEditorFocus(); void setTranslation(int latestModel, const QString &translation); - void setLenghtVariants(bool on); + void setLengthVariants(bool on); private slots: void editorCreated(QTextEdit *); -- cgit v0.12 From cbd8a54f8c55e1982430fc929e9d74f977699428 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 10 Aug 2009 16:54:24 +0200 Subject: Translations: Purged and updated German of Assistant/Linguist/Help. --- translations/assistant_de.ts | 304 +++-------- translations/linguist_de.ts | 1180 +++++++----------------------------------- translations/qt_help_de.ts | 40 +- 3 files changed, 310 insertions(+), 1214 deletions(-) diff --git a/translations/assistant_de.ts b/translations/assistant_de.ts index f702465..ce32062 100644 --- a/translations/assistant_de.ts +++ b/translations/assistant_de.ts @@ -52,11 +52,11 @@ Neuer Ordner - + - - - + + + Bookmarks Lesezeichen @@ -66,7 +66,7 @@ + - + Delete Folder Ordner löschen @@ -79,12 +79,12 @@ BookmarkManager - + Bookmarks Lesezeichen - + Remove Entfernen @@ -94,7 +94,7 @@ Wenn Sie diesen Ordner löschen, wird auch<br>dessen kompletter Inhalt gelöscht. Möchten Sie wirklich fortfahren? - + New Folder Neuer Ordner @@ -103,25 +103,17 @@ BookmarkWidget - + Filter: Filter: - Bookmarks - Lesezeichen - - - + Remove Entfernen - You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? - Wenn Sie dieses Verzeichnis löschen, wird auch<br>dessen kompletter Inhalt gelöscht! Fortfahren? - - - + Delete Folder Ordner löschen @@ -151,11 +143,7 @@ Lesezeichen umbenennen - Search for: - Suchen: - - - + Add Hinzufügen @@ -163,7 +151,7 @@ CentralWidget - + Add new page Neue Seite hinzufügen @@ -173,7 +161,7 @@ Aktuelle Seite schließen - + Print Document Drucken @@ -184,7 +172,7 @@ unbekannt - + Add New Page Neue Seite hinzufügen @@ -204,7 +192,7 @@ Lesezeichen für diese Seite hinzufügen ... - + Search Suchen @@ -212,7 +200,7 @@ ContentWindow - + Open Link Link öffnen @@ -225,10 +213,6 @@ FilterNameDialogClass - FilterNameDialog - FilterNameDialog - - Add Filter Name Filternamen hinzufügen @@ -242,7 +226,7 @@ FindWidget - + Previous Zurück @@ -303,12 +287,6 @@ Hilfe - Unable to launch web browser. - - Der Webbrowser konnte nicht gestarted werden. - - - OK OK @@ -362,13 +340,13 @@ InstallDialog - + Install Documentation Dokumentation installieren - + Downloading documentation info... Dokumentationsinformation herunterladen ... @@ -462,20 +440,20 @@ MainWindow - - + + Index Index - - + + Contents Inhalt - - + + Bookmarks Lesezeichen @@ -485,24 +463,20 @@ Suchen - - - + + + Qt Assistant Qt Assistant - + Unfiltered Ohne Filter - File - Datei - - - + Page Set&up... S&eite einrichten ... @@ -517,111 +491,62 @@ &Drucken ... - CTRL+P - CTRL+P - - - + New &Tab Neuer &Tab - CTRL+T - CTRL+T - - &Close Tab Tab &schließen - CTRL+W - CTRL+W - - &Quit &Beenden - - CTRL+Q - CTRL+Q - - - Edit - Bearbeiten - - - + &Copy selected Text Ausgewählten Text &kopieren - Ctrl+C - Ctrl+C - - - + &Find in Text... &Textsuche ... - Ctrl+F - Ctrl+F - - - + Find &Next &Weitersuchen - F3 - F3 - - Find &Previous &Vorheriges suchen - Shift+F3 - Shift+F3 - - Preferences... Einstellungen ... - View - Ansicht - - Zoom &in &Vergrößern - Ctrl++ - Ctrl++ - - - + Zoom &out Ver&kleinern - Ctrl+- - Ctrl+- - - - + Normal &Size Standard&größe - + Ctrl+0 Ctrl+0 @@ -636,30 +561,17 @@ ALT+I - ALT+B - ALT+B - - ALT+S ALT+S - Go - Gehe - - &Home &Startseite - - Ctrl+Home - Ctrl+Home - - - + &Back &Rückwärts @@ -669,12 +581,12 @@ &Vorwärts - + Sync with Table of Contents Seite mit Inhalt-Tab abgleichen - + Next Page Nächste Seite @@ -699,15 +611,7 @@ Lesezeichen hinzufügen ... - CTRL+B - CTRL+B - - - Help - Hilfe - - - + About... Ãœber ... @@ -747,38 +651,22 @@ Der zugehörige Inhaltseintrag konnte nicht gefunden werden. - Open Source Edition - Open Source Edition - - - 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. - 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. - - - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qtsoftware.com/company/model.html">qtsoftware.com/company/model.html</a> for an overview of Qt licensing. - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qtsoftware.com/company/model.html">qtsoftware.com/company/model.html</a> for an overview of Qt licensing. - - - 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. - 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. - - - + About %1 Ãœber %1 - + Updating search index Suchindex wird aufgebaut - + Looking for Qt Documentation... Suche nach Qt-Dokumentation ... - + &Window &Fenster @@ -798,54 +686,47 @@ Zoom - Add - Hinzufügen - - - Remove - Entfernen - - - + &File &Datei - + &Edit &Bearbeiten - + &View &Ansicht - + &Go &Gehe zu + + ALT+Home + + + &Bookmarks &Lesezeichen - + &Help &Hilfe - You need a commercial Qt license for development of proprietary (closed source) applications. Please see <a href="http://qtsoftware.com/company/about/businessmodel">http://qtsoftware.com/company/about/businessmodel</a> for an overview of Qt licensing. - Sie benötigen eine kommerzielle Qt Lizenz für die Entwicklung von proprietären (geschlossenen) Anwendungen. Besuchen Sie <a href="http://qtsoftware.com/company/about/businessmodel">http://qtsoftware.com/company/about/businessmodel</a> um sich einen Ãœberblick über die Qt Lizenzvergabe zu verschaffen. - - - + ALT+O ALT+O - + CTRL+D CTRL+D @@ -853,15 +734,7 @@ PreferencesDialog - From Local File System... - Von Dateisystem... - - - Download from Help Server... - Von Hilfe-Server herunterladen... - - - + Add Documentation Dokumentation hinzufügen @@ -902,7 +775,7 @@ OK - + Use custom settings Benutzerdefinierte Einstellungen verwenden @@ -980,22 +853,6 @@ Hinzufügen ... - Network - Netzwerk - - - Use Http Proxy - Http Proxy - - - Http Proxy: - Http Proxy: - - - Port: - Port: - - Options Einstellungen @@ -1015,14 +872,35 @@ Homepage Startseite + + + On help start: + Zu Beginn: + + + + Show my home page + Startseite zeigen + + + + Show a blank page + Leere Seite zeigen + + + + Show my tabs from last session + Reiter aus letzter Sitzung zeigen + + + + Blank Page + Leere Seite + QObject - New Folder - Neuer Ordner - - The specified collection file does not exist! Die angegebene Katalogdatei (collection file) kann nicht gefunden werden. @@ -1085,7 +963,7 @@ Qt Assistant - + Could not register documentation file %1 @@ -1128,12 +1006,6 @@ Grund: The specified collection file could not be read! Die angegebene Katalogdatei (collection file) kann nicht gelesen werden. - - - - Bookmark - Lesezeichen - RemoteControl @@ -1170,10 +1042,6 @@ Grund: Select All Alles markieren - - Open Link - Link öffnen - TopicChooser diff --git a/translations/linguist_de.ts b/translations/linguist_de.ts index 48f1f2e..8924b6e 100644 --- a/translations/linguist_de.ts +++ b/translations/linguist_de.ts @@ -2,24 +2,9 @@ - - - - (New Entry) - (Neuer Eintrag) - - - - @default - - (New Phrase) - (Neue Phrase) - - - AboutDialog - + Qt Linguist Qt Linguist @@ -76,11 +61,6 @@ - Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked. - Beachten Sie, dass die geänderten Einträge in den Status 'unerledigt' zurückgesetzt werden, wenn 'Ãœbersetzung als erledigt markieren' deaktiviert ist. - - - Translate also finished entries Erledigte Einträge übersetzen @@ -101,11 +81,6 @@ - The batch translator will search through the selected phrase books in the order given above. - Der automatische Ãœbersetzer wird in der angegebenen Reihenfolge durch die ausgewählten Wörterbücher gehen. - - - &Run &Ausführen @@ -114,6 +89,16 @@ Cancel Abbrechen + + + Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked + Geänderte Einträge werden als unerledigt gekennzeichnet, wenn die obige Einstellung 'Ãœbersetzung als erledigt markieren' nicht aktiviert ist + + + + The batch translator will search through the selected phrase books in the order given above + Der automatische Ãœbersetzer wird in der angegebenen Reihenfolge durch die ausgewählten Wörterbücher gehen + DataModel @@ -156,61 +141,6 @@ Es wird mit einer einfachen Universalform gearbeitet. - EditorPage - - Source text - Ursprungstext - - - This area shows the source text. - Dieser Bereich zeigt den Ursprungstext. - - - This area shows a comment that may guide you, and the context in which the text occurs. - Dieser Bereich zeigt eventuelle Kommentare und den Kontext, in dem der Text auftritt. - - - Existing %1 translation - Existierende Ãœbersetzung %1 - - - Translation - Ãœbersetzung - - - %1 translation - Ãœbersetzung %1 - - - %1 translation (%2) - Ãœbersetzung %1 (%2) - - - This is where you can enter or modify the translation of some source text. - Hier können Sie die Ãœbersetzung des Ursprungstextes eingeben bzw. ändern. - - - German - Deutsch - - - Japanese - Japanisch - - - French - Französisch - - - Polish - Polnisch - - - Chinese - Chinesisch - - - ErrorsView @@ -251,19 +181,11 @@ Es wird mit einer einfachen Universalform gearbeitet. FindDialog - Qt Linguist - Qt Linguist - - This window allows you to search for some text in the translation source file. Dieses Fenster erlaubt die Suche in der Ãœbersetzungsdatei. - Find what: - Suchen nach: - - Type in the text to search for. Geben Sie den Text ein, nach dem gesucht werden soll. @@ -279,37 +201,21 @@ Es wird mit einer einfachen Universalform gearbeitet. Wenn aktiviert, wird in den Ursprungstexten gesucht. - Source texts - Ursprungsstexte - - Translations are searched when checked. Wenn ausgewählt, wird in den Ãœbersetzungen gesucht. - Translations - Ãœbersetzungen - - Texts such as 'TeX' and 'tex' are considered as different when checked. Wenn aktiviert, werden Texte wie 'TeX' und 'tex' als unterschiedlich betrachtet. - Match case - Groß-/Kleinschreibung beachten - - Comments and contexts are searched when checked. Wenn ausgewählt, werden Kommentare und Kontextnamen durchsucht. - Comments - Kommentare - - Find Suchen @@ -365,10 +271,6 @@ Es wird mit einer einfachen Universalform gearbeitet. Abbrechen - Ignore accelerators - Kurztasten ignorieren - - Choose Edit|Find from the menu bar or press Ctrl+F to pop up the Find dialog @@ -376,16 +278,56 @@ Es wird mit einer einfachen Universalform gearbeitet. - FormHolder + FormMultiWidget + + + Alt+Delete + translate, but don't change + + + + + Shift+Alt+Insert + translate, but don't change + + + + + Alt+Insert + translate, but don't change + + + + + Confirmation - Qt Linguist + Bestätigung - Qt Linguist + - Preview Form - Vorschau + + Delete non-empty length variant? + Soll die ausgefüllte Längenvariante gelöscht werden? LRelease - + + Dropped %n message(s) which had no ID. + + Es wurde ein Eintrag ohne Bezeichner gelöscht. + Es wurde %n Einträge ohne Bezeichner gelöscht. + + + + + Excess context/disambiguation dropped from %n message(s). + + Es wurde überflüssiger Kontext beziehungsweise überflüssige Infomation zur Unterscheidung bei einem Eintrag entfernt. + Es wurde überflüssiger Kontext beziehungsweise überflüssige Infomation zur Unterscheidung bei %n Einträgen entfernt. + + + + Generated %n translation(s) (%1 finished and %2 unfinished) @@ -408,89 +350,6 @@ Es wird mit einer einfachen Universalform gearbeitet. - LanguagesDialog - - Open Translation File - Öffne Ãœbersetzungsdatei - - - Qt translation sources (%1);;Qt translation sources (*.ts);;XLIFF localization files (*.xlf);;All files (*) - Qt Ãœbersetzungsdateien (%1);;Qt Ãœbersetzungsdateien (*.ts);;XLIFF Lokalisierungsdateien (*.xlf);;Alle Dateien (*) - - - Auxiliary Languages - Unterstützende Sprachen - - - Locale - Regionalschema - - - File - Datei - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; 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;">Move selected language up</p></body></html> - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; 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;">Bewege ausgewählte Sprache herauf</p></body></html> - - - up - Hoch - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; 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; font-size:8pt;">Move selected language down</p></body></html> - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; 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; font-size:8pt;">Bewege ausgewählte Sprache herunter</p></body></html> - - - down - Herunter - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; 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;">Remove selected language</p></body></html> - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; 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;">Entferne ausgewählte Sprache</p></body></html> - - - remove - Entfernen - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; 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;">Open auxiliary language files</p></body></html> - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; 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;">Öffne unterstützende Sprachen</p></body></html> - - - ... - ... - - - OK - OK - - - MainWindow @@ -538,10 +397,6 @@ p, li { white-space: pre-wrap; } &Werkzeugleisten - Too&ls - &Werkzeuge - - &Help &Hilfe @@ -557,19 +412,11 @@ p, li { white-space: pre-wrap; } &Datei - Re&cently Opened Files - &Zuletzt geöffnete Dateien - - &Edit &Bearbeiten - &New - &Neu - - &Open... Ö&ffnen ... @@ -612,51 +459,26 @@ p, li { white-space: pre-wrap; } - Previous unfinished item. - Vorheriger unerledigter Eintrag. - - - Move to the previous unfinished item. Zum vorherigen unerledigten Eintrag gehen. - Next unfinished item. - Nächster unerledigter Eintrag. - - - Move to the next unfinished item. Zum nächsten unerledigten Eintrag gehen. - Move to previous item. - Zum vorigen Eintrag gehen. - - - Move to the previous item. Zum vorigen Eintrag gehen. - Next item. - Nächster Eintrag. - - - Move to the next item. Zum nächsten Eintrag gehen. - Mark item as done and move to the next unfinished item. - Eintrag als erledigt markieren und zum nächsten unerledigten Eintrag gehen. - - - Mark this item as done and move to the next unfinished item. Diesen Eintrag als erledigt markieren und zum nächsten unerledigten Eintrag gehen. @@ -667,21 +489,11 @@ p, li { white-space: pre-wrap; } - Toggle the validity check of accelerators. - Prüfung der Tastenkürzel ein- bzw. ausschalten. - - - 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. Die Prüfung der Tastenkürzel, das heißt, die Ãœbereinstimmung der kaufmännischen Und-Zeichen in Quelle und Ãœbersetzung ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. - Toggle the validity check of ending punctuation. - Prüfung der Satzendezeichen am Ende des Textes ein- bzw. ausschalten. - - - Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. Die Prüfung der Satzendezeichen am Ende des Textes ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. @@ -692,11 +504,6 @@ p, li { white-space: pre-wrap; } - Toggle the validity check of place markers. - Prüfung der Platzhalter ein- bzw. ausschalten. - - - 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. Die Prüfung der Platzhalter, das heißt, ob %1, %2 usw. in Ursprungstext und Ãœbersetzung übereinstimmend verwendet werden, ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. @@ -716,14 +523,14 @@ p, li { white-space: pre-wrap; } Ctrl+S + - Save &As... Speichern &unter... - + Save As... Speichern unter ... @@ -748,10 +555,6 @@ p, li { white-space: pre-wrap; } &Drucken ... - Print a list of all the phrases in the current Qt translation source file. - Drucke die Liste aller Ãœbersetzungen in der aktuellen Qt Ãœbersetzungsdatei. - - Ctrl+P Ctrl+P @@ -762,10 +565,6 @@ p, li { white-space: pre-wrap; } &Rückgängig - Undo the last editing operation performed on the translation. - Mache die letzte Änderung an der Ãœbersetzung rückgängig. - - Recently Opened &Files Zu&letzt bearbeitete Dateien @@ -916,10 +715,6 @@ p, li { white-space: pre-wrap; } Ctrl+W - Moves to the previous unfinished item. - Gehe zum letzten unerledigten Eintrag. - - Ctrl+K Ctrl+K @@ -930,23 +725,11 @@ p, li { white-space: pre-wrap; } &Nächster Unerledigter - Moves to the next unfinished item. - Gehe zum nächsten unerledigten Eintrag. - - - Ctrl+L - Ctrl+L - - P&rev V&orheriger - Moves to the previous item. - Gehe zum letzten Eintrag. - - Ctrl+Shift+K Ctrl+Shift+K @@ -957,27 +740,11 @@ p, li { white-space: pre-wrap; } Nä&chster - Moves to the next item. - Gehe zum nächsten Eintrag. - - - Ctrl+Shift+L - Ctrl+Shift+L - - &Done and Next &Fertig und Nächster - Marks this item as done and moves to the next unfinished item. - Markiere diesen Eintrag als erledigt und gehe zum nächsten unerledigten Eintrg. - - - &Begin from source - Ãœbernehme &Ursprungstext - - Copies the source text into the translation field. Kopiert den Ursprungstext in das Ãœbersetzungsfeld. @@ -993,38 +760,21 @@ p, li { white-space: pre-wrap; } &Kurzbefehle - Toggle validity checks of accelerators. - Aktiviere/Deaktiviere Validitätsprüfung für Kurztasten. - - &Ending Punctuation &Punktierung am Ende - Toggle validity checks of ending punctuation. - Aktiviere/Deaktiviere Validitätsprüfung für Punktierung am Ende des Textes. - - &Phrase matches &Wörterbuch - Toggle checking that phrase suggestions are used. - Ãœberprüfung, ob Wörterbucheinträge benutzt werden, aktivieren/deaktivieren. - - - Place &Marker Matches Platz&halter - Toggle validity checks of place markers. - Aktiviere/Deaktiviere Validitätsprüfung für Platzhalter . - - &New Phrase Book... &Neues Wörterbuch ... @@ -1140,36 +890,31 @@ p, li { white-space: pre-wrap; } Die Ãœbersetzung aller Einträge ersetzen, die dem Suchtext entsprechen. + - &Batch Translation... &Automatische Ãœbersetzung ... - + Batch translate all entries using the information in the phrase books. Alle Einträge automatisch mit Hilfe des Wörterbuchs übersetzen. + - Release As... Freigeben unter ... - - 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. - Eine Qt-Nachrichtendatei aus der aktuellen Ãœbersetzungsdatei erzeugen. Der Dateiname wird automatisch aus dem Namen der TS-Datei abgeleitet. - - - + This is the application's main window. - + Source text Ursprungstext @@ -1181,17 +926,17 @@ p, li { white-space: pre-wrap; } - + Context Kontext - + Items Einträge - + This panel lists the source contexts. Dieser Bereich zeigt die Kontexte an. @@ -1219,10 +964,10 @@ p, li { white-space: pre-wrap; } MOD status bar: file(s) modified - + Geändert - + Loading... Lade ... @@ -1275,14 +1020,19 @@ Soll die erstgenannte Datei übersprungen werden? Datei gespeichert. - - + + <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) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> + + + + + Release Freigeben - + Qt message files for released applications (*.qm) All files (*) Qt-Nachrichtendateien (*.qm) @@ -1295,7 +1045,7 @@ Alle Dateien (*) Datei erzeugt. - + Printing... Drucke ... @@ -1346,7 +1096,7 @@ Alle Dateien (*) - + @@ -1358,18 +1108,11 @@ Alle Dateien (*) Qt Linguist - + Cannot find the string '%1'. Kann Zeichenkette '%1' nicht finden. - - Translated %n entries to '%1' - - Ein Eintrag wurde mit '%1' übersetzt - %n Einträge wurden mit '%1' übersetzt - - Search And Translate in '%1' - Qt Linguist @@ -1463,16 +1206,7 @@ Alle Dateien (*) Version %1 - Open Source Edition - Open Source Edition - - - - <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>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> - <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist ist ein Werkzeug zum Ãœbersetzen von Qt-Anwendungen.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> - - - + Do you want to save the modified files? Möchten Sie die geänderten Dateien speichern? @@ -1559,13 +1293,13 @@ Alle Dateien (*) Alles speichern - + &Release All Alles f&reigeben - + Close All Alle schließen @@ -1590,37 +1324,37 @@ Alle Dateien (*) Suchen und &übersetzen ... - + File Datei - - + + Edit Bearbeiten - - + + Translation Ãœbersetzung - - + + Validation Validierung - - + + Help Hilfe - + Cannot read from phrase book '%1'. Wörterbuch '%1' kann nicht gelesen werden. @@ -1650,7 +1384,7 @@ Alle Dateien (*) Möchten Sie das Wörterbuch '%1' speichern? - + All Alle @@ -1670,21 +1404,13 @@ Alle Dateien (*) F5 - - + + Translation File &Settings... E&instellungen ... - Other &Languages... - A&ndere Sprachen... - - - Edit which other languages to show. - Welche anderen Sprachen sollen dargestellt werden. - - - + &Add to Phrase Book Zum Wörterbuch &hinzufügen @@ -1703,22 +1429,93 @@ Alle Dateien (*) Ctrl+Shift+J Ctrl+Shift+J - - - MessageEditor - - German - Deutsch + + Previous unfinished item + Vorheriger unerledigter Eintrag - - Japanese - Japanisch + + Next unfinished item + Nächster unerledigter Eintrag - - French + + Move to previous item + Zum vorigen Eintrag gehen + + + + Next item + Nächster Eintrag + + + + Mark item as done and move to the next unfinished item + Eintrag als erledigt markieren und zum nächsten unerledigten Eintrag gehen + + + + Copies the source text into the translation field + Kopiert den Ursprungstext in das Ãœbersetzungsfeld + + + + Toggle the validity check of accelerators + Prüfung der Tastenkürzel ein- bzw. ausschalten + + + + Toggle the validity check of ending punctuation + Prüfung der Satzendezeichen am Ende des Textes ein- bzw. ausschalten + + + + Toggle checking that phrase suggestions are used + Ãœberprüfung, ob Wörterbucheinträge benutzt werden, aktivieren/deaktivieren + + + + Toggle the validity check of place markers + Prüfung der Platzhalter ein- bzw. ausschalten' + + + + 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. + Eine Qt-Nachrichtendatei aus der aktuellen Ãœbersetzungsdatei erzeugen. Der Dateiname wird automatisch aus dem Namen der TS-Datei abgeleitet. + + + + Length Variants + Längenvarianten + + + + MessageEditor + + + + This is the right panel of the main window. + + + + + Russian + Russisch + + + + German + Deutsch + + + + Japanese + Japanisch + + + + French Französisch @@ -1732,7 +1529,7 @@ Alle Dateien (*) Chinesisch - + This whole panel allows you to view and edit the translation of some source text. Dieser Bereich erlaubt die Darstellung und Änderung der Ãœbersetzung eines Textes. @@ -1747,7 +1544,7 @@ Alle Dateien (*) Dieser Bereich zeigt den Ursprungstext. - + Source text (Plural) Ursprungstext (Plural) @@ -1757,7 +1554,7 @@ Alle Dateien (*) Dieser Bereich zeigt die Pluralform des Ursprungstexts. - + Developer comments Hinweise des Entwicklers @@ -1772,12 +1569,12 @@ Alle Dateien (*) Hier können Sie Hinweise für den eigenen Gebrauch eintragen. Diese haben keinen Einflusse auf die Ãœbersetzung. - + %1 translation (%2) Ãœbersetzung %1 (%2) - + This is where you can enter or modify the translation of the above source text. Hier können Sie die Ãœbersetzung des Ursprungstextes eingeben bzw. ändern. @@ -1792,56 +1589,16 @@ Alle Dateien (*) %1 Hinweise des Ãœbersetzers - + '%1' Line: %2 '%1' Zeile: %2 - - %1 Translation (%2) - Ãœbersetzung %1 (%2) - - - bell - bell - - - backspace - Rücktaste - - - new page - Neue Seite - - - new line - Neue Zeile - - - carriage return - Carriage Return - - - tab - Tab - MessageModel - Context - Kontext - - - Items - Einträge - - - Index - Index - - Completion status for %1 Bearbeitungsstand von %1 @@ -1863,16 +1620,9 @@ Zeile: %2 - MessagesTreeView - - Done - Done - - - MsgEdit - + This is the right panel of the main window. @@ -1881,17 +1631,18 @@ Zeile: %2 PhraseBookBox - %1 - %2[*] - %1 - %2[*] - - - + Go to Phrase > Edit Phrase Book... The dialog that pops up is a PhraseBookBox. - + + (New Entry) + (Neuer Eintrag) + + + %1[*] - Qt Linguist %1[*] - Qt Linguist @@ -1911,10 +1662,6 @@ Zeile: %2 Wörterbuch bearbeiten - This window allows you to add, modify, or delete phrases in a phrase book. - Dieses Fenster erlaubt das Hinzufügen, Ändern und Entfernen von Einträgen aus dem Wörterbuch. - - This window allows you to add, modify, or delete entries in a phrase book. Dieses Fenster erlaubt das Hinzufügen, Ändern und Entfernen von Wörterbuch-Einträgen. @@ -1975,18 +1722,6 @@ Zeile: %2 &Einstellungen ... - &New Phrase - &Neuer Eintrag - - - Click here to remove the phrase from the phrase book. - Entferne den Eintrag aus dem Wörterbuch. - - - &Remove Phrase - &Entferne Eintrag - - Click here to save the changes made. Änderungen speichern. @@ -2028,7 +1763,7 @@ Zeile: %2 PhraseView - + Insert Einfügen @@ -2056,7 +1791,7 @@ Zeile: %2 Kompilierte Qt-Ãœbersetzungen - + Translation files (%1);; Ãœbersetzungsdateien (%1);; @@ -2077,26 +1812,11 @@ Zeile: %2 Qt Linguist - - C++ source files - C++-Quelltextdateien - - - - Java source files - Java-Quelltextdateien - - - + GNU Gettext localization files GNU-Gettext-Ãœbersetzungsdateien - - Qt Script source files - Qt-Skript-Quelltextdateien - - Qt translation sources (format 1.1) Qt-Ãœbersetzungsdateien (Formatversion 1.1) @@ -2112,61 +1832,17 @@ Zeile: %2 Qt-Ãœbersetzungsdateien (aktuelles Format) - - Qt Designer form files - Formulardateien für Qt Designer - - - - Qt Jambi form files - Formulardateien für Qt Jambi - - - + XLIFF localization files XLIFF-Ãœbersetzungsdateien - + Qt Linguist 'Phrase Book' Qt-Linguist-Wörterbuch - QtWindowListMenu - - Tile - Teilen - - - Cascade - Kaskadieren - - - Close - Schließen - - - Close All - Alle schließen - - - - SortedMessagesModel - - Source text - Ursprungstext - - - Translation - Ãœbersetzung - - - Index - Index - - - SourceCodeView @@ -2192,10 +1868,6 @@ Zeile: %2 Statistiken - &Close - &Schließen - - Translation Ãœbersetzung @@ -2232,406 +1904,8 @@ Zeile: %2 - TrPreviewTool - - <No Translation> - <Keine Ãœbersetzung> - - - Open Forms - Öffne Maske - - - User interface form files (*.ui);;All files (*.*) - User Interface Masken Dateien (*.ui);;Alle Dateien (*.*) - - - Could not load form file(s): - - Könnte Quelldateien nicht laden: - - - - Load Translation - Lade Ãœbersetzung - - - Translation files (*.qm);;All files (*.*) - Ãœbersetzungsdateien (*.qm);;Alle Dateien (*.*) - - - Could not load translation file: - - Konnte Ãœbersetzungsdatei nicht laden: - - - - Could not reload translation file(s): - - Konnte Ãœbersetzungsdateien nicht erneut laden: - - - - Qt Translation Preview Tool: Warning - Qt Vorschau: Warnung - - - About - Info - - - Could not load form file: -%1. - Konnte Maskendatei nicht laden. -%1. - - - - TrPreviewToolClass - - Qt Translation Preview Tool - Qt Vorschau Tool - - - &View - &Ansicht - - - &Views - &Ansichten - - - &Help - &Hilfe - - - &File - &Datei - - - Forms - Masken - - - &Open Form... - &Öffne Maske... - - - &Load Translation... - &Lade Ãœbersetzung... - - - &Reload Translations - Lade Ãœbersetzungen &neu - - - F5 - F5 - - - &Close - &Schließen - - - About - Info - - - About Qt - Ãœber Qt - - - - TrWindow - - Context - Kontext - - - This panel lists the source contexts. - Dieser Bereich zeigt die Kontexte an. - - - Strings - Zeichenketten - - - Phrases and guesses - Wörterbuch und Vorschläge - - - Source code - Quelltext - - - Warnings - Warnungen - - - MOD - MOD - - - Loading... - Lade... - - - Qt Linguist - Qt Linguist - - - Cannot open '%1'. - Kann '%1' nicht öffnen. - - - %n source phrase(s) loaded. - - Einen Ursprungstext geladen. - %n Ursprungstexte geladen. - - - - Open Translation File - Öffne Ãœbersetzungsdatei - - - Qt translation sources (*.ts);;XLIFF localization files (*.xlf);;All files (*) - Qt Ãœbersetzungsdateien (*.ts);;Qt Ãœbersetzungsdateien (*.ts);;Alle Dateien (*) - - - File saved. - Datei gespeichert. - - - Cannot save '%1'. - Kann '%1' nicht speichern. - - - Qt translation source (*.ts) -XLIFF localization file (*.xlf) -All files (*) - Qt Ãœbersetzungsdateien (*.ts) -Qt Ãœbersetzungsdateien (*.ts) -Alle Dateien (*) - - - Release - Freigeben - - - Qt message files for released applications (*.qm) -All files (*) - Qt Nachrichtendateien (*.qm) -Alle Dateien (*) - - - File created. - Datei erzeugt. - - - Printing... - Drucke... - - - Context: %1 - Kontext: %1 - - - finished - erledigt - - - unresolved - ungelöst - - - obsolete - veraltet - - - Printing... (page %1) - Drucke... (Seite %1) - - - Printing completed - Drucken beendet - - - Printing aborted - Drucken abgebrochen - - - Search wrapped. - Suche beginnt von oben. - - - Cannot find the string '%1'. - Kann Zeichenkette '%1' nicht finden. - - - Translate - Ãœbersetzungen - - - Translated %n entries to '%1' - - Ein Eintrag wurde mit '%1' übersetzt - %n Einträge wurden mit '%1' übersetzt - - - - Create New Phrase Book - Erzeugen eines neuen Wörterbuchs - - - Qt phrase books (*.qph) -All files (*) - Qt Wörterbücher (*.qph) -Alle Dateien (*) - - - A file called '%1' already exists. Please choose another name. - Die Datei '%1' existiert schon. Bitte wählen Sie einen anderen Namen. - - - Phrase book created. - Wörterbuch erzeugt. - - - Open Phrase Book - Öffne Wörterbuch - - - Qt phrase books (*.qph);;All files (*) - Qt Wörterbücher (*.qph);;Alle Dateien (*) - - - %n phrase(s) loaded. - - Ein Wörterbucheintrag geladen. - %n Wörterbucheinträge geladen. - - - - Add to phrase book - Hinzufügen zum Wörterbuch - - - Adding phrase to phrasebook %1 - Eintrag zu Wörterbuch %1 hinzufügen - - - Select phrase book to add to - Zu welchem Wörterbuch soll der Eintrag hinzugefügt werden? - - - Unable to launch Qt Assistant (%1) - Kann Qt Assistant nicht starten (%1) - - - Version %1 - Version %1 - - - Open Source Edition - Open Source Edition - - - <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>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> - <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist ist ein Werkzeug zum Ãœbersetzen von Qt Anwendungen.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> - - - Do you want to save '%1'? - Wollen Sie '%1' speichern? - - - Qt Linguist by Trolltech[*] - Qt Linguist von Trolltech[*] - - - %1 - %2[*] - %1 - %2[*] - - - Qt Linguist by Trolltech - Qt Linguist von Trolltech - - - No untranslated phrases left. - Alle Einträge sind übersetzt. - - - &Window - &Fenster - - - Minimize - Minimieren - - - Ctrl+M - Ctrl+M - - - Display the manual for %1. - Zeige Handbuch für %1 an. - - - Display information about %1. - Zeige Informationen über %1 an. - - - File - Datei - - - Edit - Bearbeiten - - - Translation - Ãœbersetzung - - - Validation - Validierung - - - Help - Hilfe - - - Cannot read from phrase book '%1'. - Kann Wörterbuch '%1' nicht lesen. - - - Close this phrase book. - Schließe dieses Wörterbuch. - - - Allow you to add, modify, or delete phrases of this phrase book. - Erlaubt das Hinzufügen, Ändern und Entfernen von Einträgen aus dem Wörterbuch. - - - Print the entries of the phrase book. - Drucke die Einträge des Wörterbuchs. - - - Cannot create phrase book '%1'. - Kann Wörterbuch '%1' nicht erzeugen. - - - Do you want to save phrasebook '%1'? - Wollen Sie das Wörterbuch '%1' speichern? - - - TranslateDialog - Qt Linguist - Qt Linguist - - This window allows you to search for some text in the translation source file. Dieses Fenster erlaubt die Suche in der Ãœbersetzungsdatei. @@ -2703,25 +1977,6 @@ Alle Dateien (*) - TranslationSettings - - Qt Linguist - Translation file settings - Qt Linguist - Einstellungen der Ãœbersetzungsdatei - - - Target language - Zielsprache - - - Language - Sprache - - - Country/Region - Land/Region - - - TranslationSettingsDialog @@ -2755,47 +2010,4 @@ Alle Dateien (*) Zielsprache - - databaseTranslationDialog - - Qt Linguist - Batch Translation - Qt Linguist - Automatische Ãœbersetzung - - - Options - Optionen - - - Only translate entries with no translation - Ãœbersetze nur Einträge ohne bisherige Ãœbersetzung - - - Set translated entries to finished - Markiere Ãœbersetzung als erledigt - - - Phrase book preference - Wörterbücher - - - Move up - Nach oben - - - Move down - Nach unten - - - The batch translator will search through the selected phrasebooks in the order given above. - Der automatische Ãœbersetzer wird in der angegebenen Reihenfolge durch die ausgewählten Wörterbücher gehen. - - - &Run - &Ausführen - - - &Cancel - &Abbrechen - - diff --git a/translations/qt_help_de.ts b/translations/qt_help_de.ts index 9d48661..8e6cb85 100644 --- a/translations/qt_help_de.ts +++ b/translations/qt_help_de.ts @@ -111,8 +111,9 @@ QHelpDBReader - + Cannot open database '%1' '%2': %3 + The placeholders are: %1 - The name of the database which cannot be opened %2 - The unique id for the connection %3 - The actual error string Kann Datenbank nicht öffnen: '%1' '%2': %3 @@ -200,17 +201,22 @@ Dateien einfügen... - + + The referenced file %1 must be inside or within a subdirectory of (%2). Skipping it. + Die referenzierte Datei %1 muss sich im Verzeichnis %2 oder in einem Unterverzeichnis davon befinden. Sie wird übersprungen. + + + The file %1 does not exist! Skipping it. Die Datei %1 existiert nicht. Wird übersprungen. - + Cannot open file %1! Skipping it. Die Datei %1 kann nicht geöffnet werden. Wird übersprungen. - + The filter %1 is already registered! Der Filter %1 ist bereits registriert. @@ -243,17 +249,27 @@ QHelpSearchQueryWidget - + Search for: Suche nach: + + Previous search + Vorige Suche + + + + Next search + Nächste Suche + + Search Suche - + Advanced search Erweiterte Suche @@ -263,22 +279,22 @@ Worte <B>ähnlich</B> zu: - + <B>without</B> the words: <B>ohne</B> die Wörter: - + with <B>exact phrase</B>: mit der <B>genauen Wortgruppe</B>: - + with <B>all</B> of the words: mit <B>allen</B> Wörtern: - + with <B>at least one</B> of the words: mit <B>irgendeinem</B> der Wörter: @@ -307,7 +323,7 @@ Ohne Titel - + Unknown token. Unbekanntes Token. @@ -347,7 +363,7 @@ Fehlendes Attribut in Schlagwort in Zeile %1. - + The input file %1 could not be opened! Die Eingabe-Datei %1 kann nicht geöffnet werden. -- cgit v0.12 From 4111f8d417409579d591798c491f9f2aa7c0021d Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 10 Aug 2009 16:54:28 +0200 Subject: New mkspecs for Windows Mobile 6.5 We need extra mkspecs for Windows Mobile 6.5 to support gestures, since gestures are only supported with 6.5 Reviewed-by: Maurice --- .../default_post.prf | 1 + mkspecs/wincewm65professional-msvc2005/qmake.conf | 5 +++ .../wincewm65professional-msvc2005/qplatformdefs.h | 42 +++++++++++++++++++++ .../default_post.prf | 1 + mkspecs/wincewm65professional-msvc2008/qmake.conf | 3 ++ .../wincewm65professional-msvc2008/qplatformdefs.h | 43 ++++++++++++++++++++++ 6 files changed, 95 insertions(+) create mode 100644 mkspecs/wincewm65professional-msvc2005/default_post.prf create mode 100644 mkspecs/wincewm65professional-msvc2005/qmake.conf create mode 100644 mkspecs/wincewm65professional-msvc2005/qplatformdefs.h create mode 100644 mkspecs/wincewm65professional-msvc2008/default_post.prf create mode 100644 mkspecs/wincewm65professional-msvc2008/qmake.conf create mode 100644 mkspecs/wincewm65professional-msvc2008/qplatformdefs.h diff --git a/mkspecs/wincewm65professional-msvc2005/default_post.prf b/mkspecs/wincewm65professional-msvc2005/default_post.prf new file mode 100644 index 0000000..86bc964 --- /dev/null +++ b/mkspecs/wincewm65professional-msvc2005/default_post.prf @@ -0,0 +1 @@ +include(../wincewm60professional-msvc2005/default_post.prf) diff --git a/mkspecs/wincewm65professional-msvc2005/qmake.conf b/mkspecs/wincewm65professional-msvc2005/qmake.conf new file mode 100644 index 0000000..b4ae096 --- /dev/null +++ b/mkspecs/wincewm65professional-msvc2005/qmake.conf @@ -0,0 +1,5 @@ +include(../wincewm60professional-msvc2005/qmake.conf) + +DEFINES += QT_WINCE_GESTURES +QMAKE_LIBS_GUI += TouchGestureCore.lib + diff --git a/mkspecs/wincewm65professional-msvc2005/qplatformdefs.h b/mkspecs/wincewm65professional-msvc2005/qplatformdefs.h new file mode 100644 index 0000000..4317bc1 --- /dev/null +++ b/mkspecs/wincewm65professional-msvc2005/qplatformdefs.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../wincewm60professional-msvc2005/qplatformdefs.h" diff --git a/mkspecs/wincewm65professional-msvc2008/default_post.prf b/mkspecs/wincewm65professional-msvc2008/default_post.prf new file mode 100644 index 0000000..c854561 --- /dev/null +++ b/mkspecs/wincewm65professional-msvc2008/default_post.prf @@ -0,0 +1 @@ +include(../wincewm65professional-msvc2005/default_post.prf) diff --git a/mkspecs/wincewm65professional-msvc2008/qmake.conf b/mkspecs/wincewm65professional-msvc2008/qmake.conf new file mode 100644 index 0000000..552c7c8 --- /dev/null +++ b/mkspecs/wincewm65professional-msvc2008/qmake.conf @@ -0,0 +1,3 @@ +include(../wincewm65professional-msvc2005/qmake.conf) +QMAKE_COMPILER_DEFINES -= _MSC_VER=1400 +QMAKE_COMPILER_DEFINES += _MSC_VER=1500 diff --git a/mkspecs/wincewm65professional-msvc2008/qplatformdefs.h b/mkspecs/wincewm65professional-msvc2008/qplatformdefs.h new file mode 100644 index 0000000..7f724f9 --- /dev/null +++ b/mkspecs/wincewm65professional-msvc2008/qplatformdefs.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../wincewm65professional-msvc2005/qplatformdefs.h" + -- cgit v0.12 From 9a92aee8ff94a1b705e92f895831f9437762da75 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 10 Aug 2009 16:56:22 +0200 Subject: Gesture support for Windows Mobile 6.5 Gestures on Windows Mobile 6.5 rely on a statically linked library, that is added in the mkspecs for Windows Mobile 6.5 In the case the gesture functions do not have been resolved (==0), we do not call them. Reviewed-by: Joerg --- src/gui/kernel/qapplication_win.cpp | 58 ++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index bdee6ec..281be33 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -51,6 +51,9 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c #ifdef Q_WS_WINCE_WM #include #include +#ifdef QT_WINCE_GESTURES +#include +#endif #endif #include "qapplication.h" @@ -815,30 +818,41 @@ void qt_init(QApplicationPrivate *priv, int) ptrSetProcessDPIAware(); #endif + priv->GetGestureInfo = 0; + priv->GetGestureExtraArgs = 0; + +#ifdef Q_WS_WINCE_WM + priv->GetGestureInfo = (PtrGetGestureInfo) &TKGetGestureInfo; + priv->GetGestureExtraArgs = (PtrGetGestureExtraArgs) &TKGetGestureExtraArguments; + priv->CloseGestureInfoHandle = (PtrCloseGestureInfoHandle) 0; + priv->SetGestureConfig = (PtrSetGestureConfig) 0; + priv->GetGestureConfig = (PtrGetGestureConfig) 0; +#else priv->GetGestureInfo = - (PtrGetGestureInfo)QLibrary::resolve(QLatin1String("user32"), - "GetGestureInfo"); + (PtrGetGestureInfo)QLibrary::resolve(QLatin1String("user32"), + "GetGestureInfo"); priv->GetGestureExtraArgs = - (PtrGetGestureExtraArgs)QLibrary::resolve(QLatin1String("user32"), - "GetGestureExtraArgs"); + (PtrGetGestureExtraArgs)QLibrary::resolve(QLatin1String("user32"), + "GetGestureExtraArgs"); priv->CloseGestureInfoHandle = - (PtrCloseGestureInfoHandle)QLibrary::resolve(QLatin1String("user32"), - "CloseGestureInfoHandle"); + (PtrCloseGestureInfoHandle)QLibrary::resolve(QLatin1String("user32"), + "CloseGestureInfoHandle"); + priv->SetGestureConfig = + (PtrSetGestureConfig)QLibrary::resolve(QLatin1String("user32"), + "SetGestureConfig"); priv->SetGestureConfig = - (PtrSetGestureConfig)QLibrary::resolve(QLatin1String("user32"), - "SetGestureConfig"); - priv->GetGestureConfig = - (PtrGetGestureConfig)QLibrary::resolve(QLatin1String("user32"), - "GetGestureConfig"); + (PtrGetGestureConfig)QLibrary::resolve(QLatin1String("user32"), + "GetGestureConfig"); priv->BeginPanningFeedback = - (PtrBeginPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"), - "BeginPanningFeedback"); + (PtrBeginPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"), + "BeginPanningFeedback"); priv->UpdatePanningFeedback = - (PtrUpdatePanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"), - "UpdatePanningFeedback"); + (PtrUpdatePanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"), + "UpdatePanningFeedback"); priv->EndPanningFeedback = (PtrEndPanningFeedback)QLibrary::resolve(QLatin1String("uxtheme"), "EndPanningFeedback"); +#endif } /***************************************************************************** @@ -3720,7 +3734,16 @@ bool QETWidget::translateGestureEvent(const MSG &msg) gi.cbSize = sizeof(GESTUREINFO); QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); - BOOL bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi); +#ifdef Q_WS_WINCE_WM +#define GID_ZOOM 0xf000 +#define GID_ROTATE 0xf001 +#define GID_TWOFINGERTAP 0xf002 +#define GID_ROLLOVER 0xf003 +#endif + BOOL bResult = false; + if (qAppPriv->GetGestureInfo) + bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi); + const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y); QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos); @@ -3751,7 +3774,8 @@ bool QETWidget::translateGestureEvent(const MSG &msg) default: break; } - qAppPriv->CloseGestureInfoHandle((HANDLE)msg.lParam); + if (qAppPriv->CloseGestureInfoHandle) + qAppPriv->CloseGestureInfoHandle((HANDLE)msg.lParam); if (event.gestureType != QNativeGestureEvent::None) qt_sendSpontaneousEvent(widget, &event); } else { -- cgit v0.12 From d918f98a4ab80405e0fe75fadf8491069a4c7ab8 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Mon, 10 Aug 2009 17:02:32 +0200 Subject: Make chooseConfig work on some EGL implementations According to the spec, if we pass a 0 out pointer, EGL should tell us how many configurations are available. However, we pass a 0 out pointer, but say that it's 256 elements big, it confuses some implementations. Fix that by passing a 0 out pointer and saying that it has space for 0 elements. Now we correctly get the amount of available configs. Reviewed-by: Rhys Weatherley --- src/gui/egl/qegl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index ebdac9a..1c45a58 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -95,7 +95,7 @@ bool QEglContext::chooseConfig do { // Get the number of matching configurations for this set of properties. EGLint matching = 0; - if (!eglChooseConfig(dpy, props.properties(), 0, 256, &matching) || !matching) + if (!eglChooseConfig(dpy, props.properties(), 0, 0, &matching) || !matching) continue; // If we want the best pixel format, then return the first -- cgit v0.12 From c3610da4be9b12bfe01b565db5ed2508da88c120 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 10 Aug 2009 12:13:46 +0200 Subject: tst_QSharedPointer fixed for Windows CE We cannot create too many threads on Windows CE. Reviewed-By: thartman --- tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index 1101a08..516729c 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -1373,7 +1373,9 @@ void tst_QSharedPointer::threadStressTest_data() QTest::newRow("5+10") << 5 << 10; QTest::newRow("5+30") << 5 << 30; +#ifndef Q_OS_WINCE QTest::newRow("100+100") << 100 << 100; +#endif } void tst_QSharedPointer::threadStressTest() -- cgit v0.12 From a6d51bc97a923bd990e5188035f7c913456138f7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 10 Aug 2009 15:12:08 +0200 Subject: respect QAbstractSpinBox::NoButtons in windowsce / windowsmobile styles Code is adapted from QCommonStyle which handles this case for other styles. Reviewed-by: thartman --- src/gui/styles/qwindowscestyle.cpp | 6 +++++- src/gui/styles/qwindowsmobilestyle.cpp | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qwindowscestyle.cpp b/src/gui/styles/qwindowscestyle.cpp index 997fc72..cd13dd8 100644 --- a/src/gui/styles/qwindowscestyle.cpp +++ b/src/gui/styles/qwindowscestyle.cpp @@ -1951,7 +1951,11 @@ QRect QWindowsCEStyle::subControlRect(ComplexControl control, const QStyleOption rect = QRect(x, y , bs.width(), bs.height()); break; case SC_SpinBoxEditField: - rect = QRect(lx, fw, rx-2, spinbox->rect.height() - 2*fw); + if (spinbox->buttonSymbols == QAbstractSpinBox::NoButtons) { + rect = QRect(lx, fw, spinbox->rect.width() - 2*fw - 2, spinbox->rect.height() - 2*fw); + } else { + rect = QRect(lx, fw, rx-2, spinbox->rect.height() - 2*fw); + } break; case SC_SpinBoxFrame: rect = spinbox->rect; diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index c70b4c8..e708042 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -2984,7 +2984,11 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp rect = QRect(x + bs.width(), 0, bs.width(), bs.height()); break; case SC_SpinBoxEditField: + if (spinBox->buttonSymbols == QAbstractSpinBox::NoButtons) { + rect = QRect(lx, fw, spinBox->rect.width() - 2*fw - 2, spinBox->rect.height() - 2*fw); + } else { rect = QRect(lx, fw, rx-2, spinBox->rect.height() - 2*fw); + } break; case SC_SpinBoxFrame: rect = spinBox->rect; -- cgit v0.12 From 8262b8b7dfda60446685eed8ec373c4da252cbeb Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 10 Aug 2009 15:18:35 +0200 Subject: remove compiler warning for Windows CE whitespaces fixed Reviewed-by: TrustMe --- src/corelib/io/qprocess_win.cpp | 46 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index eae17b4..d8da606 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -372,32 +372,30 @@ void QProcessPrivate::startProcess() qDebug(" pass environment : %s", environment.isEmpty() ? "no" : "yes"); #endif - DWORD dwCreationFlags = CREATE_NO_WINDOW; - #if defined(Q_OS_WINCE) - QString fullPathProgram = program; - if (!QDir::isAbsolutePath(fullPathProgram)) - fullPathProgram = QFileInfo(fullPathProgram).absoluteFilePath(); - fullPathProgram.replace(QLatin1Char('/'), QLatin1Char('\\')); - success = CreateProcess((wchar_t*)fullPathProgram.utf16(), - (wchar_t*)args.utf16(), - 0, 0, false, 0, 0, 0, 0, pid); + QString fullPathProgram = program; + if (!QDir::isAbsolutePath(fullPathProgram)) + fullPathProgram = QFileInfo(fullPathProgram).absoluteFilePath(); + fullPathProgram.replace(QLatin1Char('/'), QLatin1Char('\\')); + success = CreateProcess((wchar_t*)fullPathProgram.utf16(), + (wchar_t*)args.utf16(), + 0, 0, false, 0, 0, 0, 0, pid); #else - dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT; - STARTUPINFOW startupInfo = { sizeof( STARTUPINFO ), 0, 0, 0, - (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, - (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, - 0, 0, 0, - STARTF_USESTDHANDLES, - 0, 0, 0, - stdinChannel.pipe[0], stdoutChannel.pipe[1], stderrChannel.pipe[1] - }; - success = CreateProcess(0, (wchar_t*)args.utf16(), - 0, 0, TRUE, dwCreationFlags, - environment ? envlist.data() : 0, - workingDirectory.isEmpty() ? 0 - : (wchar_t*)QDir::toNativeSeparators(workingDirectory).utf16(), - &startupInfo, pid); + DWORD dwCreationFlags = CREATE_NO_WINDOW; + dwCreationFlags |= CREATE_UNICODE_ENVIRONMENT; + STARTUPINFOW startupInfo = { sizeof( STARTUPINFO ), 0, 0, 0, + (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, + (ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT, + 0, 0, 0, + STARTF_USESTDHANDLES, + 0, 0, 0, + stdinChannel.pipe[0], stdoutChannel.pipe[1], stderrChannel.pipe[1] + }; + success = CreateProcess(0, (wchar_t*)args.utf16(), + 0, 0, TRUE, dwCreationFlags, + environment ? envlist.data() : 0, + workingDirectory.isEmpty() ? 0 : (wchar_t*)QDir::toNativeSeparators(workingDirectory).utf16(), + &startupInfo, pid); if (stdinChannel.pipe[0] != INVALID_Q_PIPE) { CloseHandle(stdinChannel.pipe[0]); -- cgit v0.12 From 33e9b82813f5573be6e5a780524044a2170d8dd4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 10 Aug 2009 17:00:27 +0200 Subject: don't test dbus stuff where no dbus is Reviewed-by: Leo --- tests/auto/auto.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index d3e295b..d7f27bd 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -106,8 +106,6 @@ SUBDIRS += \ qdate \ qdatetime \ qdatetimeedit \ - qdbuspendingcall \ - qdbuspendingreply \ qdebug \ qdesktopservices \ qdesktopwidget \ @@ -457,6 +455,8 @@ unix:!embedded:contains(QT_CONFIG, dbus):SUBDIRS += \ qdbusmarshall \ qdbusmetaobject \ qdbusmetatype \ + qdbuspendingcall \ + qdbuspendingreply \ qdbusperformance \ qdbusreply \ qdbusthreading \ -- cgit v0.12 From 70b5327e51481bf7b91d8fad50e3fc9ff3a1e888 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 10 Aug 2009 12:13:02 +0200 Subject: QtWebKit compile fix for Windows CE There's no getenv on Windows CE. Reviewed-By: Simon Hausmann --- src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 1a45fe6..613a72f 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -105,7 +105,7 @@ void QWEBKIT_EXPORT qt_drt_overwritePluginDirectories() PluginDatabase* db = PluginDatabase::installedPlugins(/* populate */ false); Vector paths; - String qtPath(getenv("QTWEBKIT_PLUGIN_PATH")); + String qtPath(qgetenv("QTWEBKIT_PLUGIN_PATH").data()); qtPath.split(UChar(':'), /* allowEmptyEntries */ false, paths); db->setPluginDirectories(paths); -- cgit v0.12 From 35ef002453cbe9841e23a7d33064a51dbe99fb06 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 10 Aug 2009 17:15:03 +0200 Subject: Manual merge --- src/gui/kernel/qapplication_win.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 5843c34..bb910b7 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -3728,7 +3728,7 @@ bool QETWidget::translateGestureEvent(const MSG &msg) memset(&gi, 0, sizeof(GESTUREINFO)); gi.cbSize = sizeof(GESTUREINFO); - QApplicationPrivate *qAppPriv = getQApplicationPrivateInternal(); + QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); #ifdef Q_WS_WINCE_WM #define GID_ZOOM 0xf000 #define GID_ROTATE 0xf001 @@ -3739,8 +3739,6 @@ bool QETWidget::translateGestureEvent(const MSG &msg) if (qAppPriv->GetGestureInfo) bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi); - QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); - BOOL bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi); if (bResult) { const QPoint widgetPos = QPoint(gi.ptsLocation.x, gi.ptsLocation.y); QWidget *alienWidget = !internalWinId() ? this : childAt(widgetPos); -- cgit v0.12 From 13a31fe82845f8b1f4d86919080d3b2a87c4d061 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 10 Aug 2009 17:15:03 +0200 Subject: Introducing icon theme support Added some static functions to QIcon to support desktop themes based on the freedesktop spec. It is not intended to replace KIcon and the intention is to use it when available to share icon cache between applications. Applications currently using icon themes are Assistant, Designer and the textedit demo. Reviewed-by: ogoffart --- demos/textedit/textedit.cpp | 65 +- doc/src/snippets/code/src_gui_image_qicon.cpp | 9 + src/gui/gui.pro | 1 - src/gui/image/image.pri | 3 + src/gui/image/qicon.cpp | 226 ++++-- src/gui/image/qicon.h | 10 + src/gui/image/qicon_p.h | 138 ++++ src/gui/image/qiconloader.cpp | 599 ++++++++++++++++ src/gui/image/qiconloader_p.h | 185 +++++ src/gui/kernel/qapplication_x11.cpp | 4 +- src/gui/styles/gtksymbols.cpp | 8 +- src/gui/styles/gtksymbols_p.h | 1 + src/gui/styles/qcleanlooksstyle.cpp | 563 +-------------- src/gui/styles/qcleanlooksstyle_p.h | 2 - src/gui/styles/qcommonstyle.cpp | 770 ++++++--------------- src/gui/styles/qcommonstyle_p.h | 13 - src/gui/styles/qgtkstyle.cpp | 96 +-- src/gui/styles/qgtkstyle.h | 4 + .../testtheme/16x16/actions/appointment-new.png | Bin 0 -> 897 bytes .../testtheme/22x22/actions/appointment-new.png | Bin 0 -> 1411 bytes .../testtheme/32x32/actions/appointment-new.png | Bin 0 -> 2399 bytes tests/auto/qicon/icons/testtheme/index.theme | 492 +++++++++++++ .../icons/testtheme/scalable/actions/svg-only.svg | 425 ++++++++++++ .../themeparent/16x16/actions/address-book-new.png | Bin 0 -> 796 bytes .../themeparent/16x16/actions/appointment-new.png | Bin 0 -> 897 bytes .../themeparent/22x22/actions/address-book-new.png | Bin 0 -> 924 bytes .../themeparent/22x22/actions/appointment-new.png | Bin 0 -> 1411 bytes .../themeparent/32x32/actions/address-book-new.png | Bin 0 -> 1897 bytes .../themeparent/32x32/actions/appointment-new.png | Bin 0 -> 2399 bytes tests/auto/qicon/icons/themeparent/index.theme | 492 +++++++++++++ .../scalable/actions/address-book-new.svg | 389 +++++++++++ .../scalable/actions/appointment-new.svg | 425 ++++++++++++ tests/auto/qicon/tst_qicon.cpp | 67 ++ tools/assistant/compat/mainwindow.cpp | 10 + tools/assistant/tools/assistant/mainwindow.cpp | 13 + .../components/buddyeditor/buddyeditor_plugin.cpp | 5 +- .../components/formeditor/formwindowmanager.cpp | 22 +- .../signalsloteditor/signalsloteditor_plugin.cpp | 3 +- .../tabordereditor/tabordereditor_plugin.cpp | 4 +- tools/designer/src/designer/qdesigner_actions.cpp | 7 +- tools/designer/src/lib/shared/actioneditor.cpp | 18 +- tools/designer/src/lib/shared/qtresourceview.cpp | 10 +- 42 files changed, 3784 insertions(+), 1295 deletions(-) create mode 100644 src/gui/image/qicon_p.h create mode 100644 src/gui/image/qiconloader.cpp create mode 100644 src/gui/image/qiconloader_p.h create mode 100644 tests/auto/qicon/icons/testtheme/16x16/actions/appointment-new.png create mode 100644 tests/auto/qicon/icons/testtheme/22x22/actions/appointment-new.png create mode 100644 tests/auto/qicon/icons/testtheme/32x32/actions/appointment-new.png create mode 100644 tests/auto/qicon/icons/testtheme/index.theme create mode 100644 tests/auto/qicon/icons/testtheme/scalable/actions/svg-only.svg create mode 100644 tests/auto/qicon/icons/themeparent/16x16/actions/address-book-new.png create mode 100644 tests/auto/qicon/icons/themeparent/16x16/actions/appointment-new.png create mode 100644 tests/auto/qicon/icons/themeparent/22x22/actions/address-book-new.png create mode 100644 tests/auto/qicon/icons/themeparent/22x22/actions/appointment-new.png create mode 100644 tests/auto/qicon/icons/themeparent/32x32/actions/address-book-new.png create mode 100644 tests/auto/qicon/icons/themeparent/32x32/actions/appointment-new.png create mode 100644 tests/auto/qicon/icons/themeparent/index.theme create mode 100644 tests/auto/qicon/icons/themeparent/scalable/actions/address-book-new.svg create mode 100644 tests/auto/qicon/icons/themeparent/scalable/actions/appointment-new.svg diff --git a/demos/textedit/textedit.cpp b/demos/textedit/textedit.cpp index d1e12bb..31b419a 100644 --- a/demos/textedit/textedit.cpp +++ b/demos/textedit/textedit.cpp @@ -158,14 +158,16 @@ void TextEdit::setupFileActions() QAction *a; - a = new QAction(QIcon(rsrcPath + "/filenew.png"), tr("&New"), this); + QIcon newIcon = QIcon::fromTheme("document-new", QIcon(rsrcPath + "/filenew.png")); + a = new QAction( newIcon, tr("&New"), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::New); connect(a, SIGNAL(triggered()), this, SLOT(fileNew())); tb->addAction(a); menu->addAction(a); - a = new QAction(QIcon(rsrcPath + "/fileopen.png"), tr("&Open..."), this); + a = new QAction(QIcon::fromTheme("document-open", QIcon(rsrcPath + "/fileopen.png")), + tr("&Open..."), this); a->setShortcut(QKeySequence::Open); connect(a, SIGNAL(triggered()), this, SLOT(fileOpen())); tb->addAction(a); @@ -173,7 +175,8 @@ void TextEdit::setupFileActions() menu->addSeparator(); - actionSave = a = new QAction(QIcon(rsrcPath + "/filesave.png"), tr("&Save"), this); + actionSave = a = new QAction(QIcon::fromTheme("document-save", QIcon(rsrcPath + "/filesave.png")), + tr("&Save"), this); a->setShortcut(QKeySequence::Save); connect(a, SIGNAL(triggered()), this, SLOT(fileSave())); a->setEnabled(false); @@ -187,17 +190,21 @@ void TextEdit::setupFileActions() menu->addSeparator(); #ifndef QT_NO_PRINTER - a = new QAction(QIcon(rsrcPath + "/fileprint.png"), tr("&Print..."), this); + a = new QAction(QIcon::fromTheme("document-print", QIcon(rsrcPath + "/fileprint.png")), + tr("&Print..."), this); + a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::Print); connect(a, SIGNAL(triggered()), this, SLOT(filePrint())); tb->addAction(a); menu->addAction(a); - a = new QAction(QIcon(rsrcPath + "/fileprint.png"), tr("Print Preview..."), this); + a = new QAction(QIcon::fromTheme("fileprint", QIcon(rsrcPath + "/fileprint.png")), + tr("Print Preview..."), this); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPreview())); menu->addAction(a); - a = new QAction(QIcon(rsrcPath + "/exportpdf.png"), tr("&Export PDF..."), this); + a = new QAction(QIcon::fromTheme("exportpdf", QIcon(rsrcPath + "/exportpdf.png")), + tr("&Export PDF..."), this); a->setPriority(QAction::LowPriority); a->setShortcut(Qt::CTRL + Qt::Key_D); connect(a, SIGNAL(triggered()), this, SLOT(filePrintPdf())); @@ -218,32 +225,36 @@ void TextEdit::setupEditActions() QToolBar *tb = new QToolBar(this); tb->setWindowTitle(tr("Edit Actions")); addToolBar(tb); - QMenu *menu = new QMenu(tr("&Edit"), this); menuBar()->addMenu(menu); QAction *a; - a = actionUndo = new QAction(QIcon(rsrcPath + "/editundo.png"), tr("&Undo"), this); + a = actionUndo = new QAction(QIcon::fromTheme("edit-undo", QIcon(rsrcPath + "/editundo.png")), + tr("&Undo"), this); a->setShortcut(QKeySequence::Undo); tb->addAction(a); menu->addAction(a); - a = actionRedo = new QAction(QIcon(rsrcPath + "/editredo.png"), tr("&Redo"), this); + a = actionRedo = new QAction(QIcon::fromTheme("edit-redo", QIcon(rsrcPath + "/editredo.png")), + tr("&Redo"), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::Redo); tb->addAction(a); menu->addAction(a); menu->addSeparator(); - a = actionCut = new QAction(QIcon(rsrcPath + "/editcut.png"), tr("Cu&t"), this); + a = actionCut = new QAction(QIcon::fromTheme("edit-cut", QIcon(rsrcPath + "/editcut.png")), + tr("Cu&t"), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::Cut); tb->addAction(a); menu->addAction(a); - a = actionCopy = new QAction(QIcon(rsrcPath + "/editcopy.png"), tr("&Copy"), this); + a = actionCopy = new QAction(QIcon::fromTheme("edit-copy", QIcon(rsrcPath + "/editcopy.png")), + tr("&Copy"), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::Copy); tb->addAction(a); menu->addAction(a); - a = actionPaste = new QAction(QIcon(rsrcPath + "/editpaste.png"), tr("&Paste"), this); + a = actionPaste = new QAction(QIcon::fromTheme("edit-paste", QIcon(rsrcPath + "/editpaste.png")), + tr("&Paste"), this); a->setPriority(QAction::LowPriority); a->setShortcut(QKeySequence::Paste); tb->addAction(a); @@ -260,10 +271,11 @@ void TextEdit::setupTextActions() QMenu *menu = new QMenu(tr("F&ormat"), this); menuBar()->addMenu(menu); - actionTextBold = new QAction(QIcon(rsrcPath + "/textbold.png"), tr("&Bold"), this); - actionTextBold->setPriority(QAction::LowPriority); + actionTextBold = new QAction(QIcon::fromTheme("format-text-bold", QIcon(rsrcPath + "/textbold.png")), + tr("&Bold"), this); actionTextBold->setShortcut(Qt::CTRL + Qt::Key_B); - QFont bold; + actionTextBold->setPriority(QAction::LowPriority); + QFont bold; bold.setBold(true); actionTextBold->setFont(bold); connect(actionTextBold, SIGNAL(triggered()), this, SLOT(textBold())); @@ -271,7 +283,8 @@ void TextEdit::setupTextActions() menu->addAction(actionTextBold); actionTextBold->setCheckable(true); - actionTextItalic = new QAction(QIcon(rsrcPath + "/textitalic.png"), tr("&Italic"), this); + actionTextItalic = new QAction(QIcon::fromTheme("format-text-italic", QIcon(rsrcPath + "/textitalic.png")), + tr("&Italic"), this); actionTextItalic->setPriority(QAction::LowPriority); actionTextItalic->setShortcut(Qt::CTRL + Qt::Key_I); QFont italic; @@ -282,9 +295,10 @@ void TextEdit::setupTextActions() menu->addAction(actionTextItalic); actionTextItalic->setCheckable(true); - actionTextUnderline = new QAction(QIcon(rsrcPath + "/textunder.png"), tr("&Underline"), this); - actionTextUnderline->setPriority(QAction::LowPriority); + actionTextUnderline = new QAction(QIcon::fromTheme("format-text-underline", QIcon(rsrcPath + "/textunder.png")), + tr("&Underline"), this); actionTextUnderline->setShortcut(Qt::CTRL + Qt::Key_U); + actionTextUnderline->setPriority(QAction::LowPriority); QFont underline; underline.setUnderline(true); actionTextUnderline->setFont(underline); @@ -300,15 +314,16 @@ void TextEdit::setupTextActions() // Make sure the alignLeft is always left of the alignRight if (QApplication::isLeftToRight()) { - actionAlignLeft = new QAction(QIcon(rsrcPath + "/textleft.png"), tr("&Left"), grp); - actionAlignCenter = new QAction(QIcon(rsrcPath + "/textcenter.png"), tr("C&enter"), grp); - actionAlignRight = new QAction(QIcon(rsrcPath + "/textright.png"), tr("&Right"), grp); + actionAlignLeft = new QAction(QIcon::fromTheme("format-justify-left", QIcon(rsrcPath + "/textleft.png")), + tr("&Left"), grp); + actionAlignCenter = new QAction(QIcon::fromTheme("format-justify-center", QIcon(rsrcPath + "/textcenter.png")), tr("C&enter"), grp); + actionAlignRight = new QAction(QIcon::fromTheme("format-justify-right", QIcon(rsrcPath + "/textright.png")), tr("&Right"), grp); } else { - actionAlignRight = new QAction(QIcon(rsrcPath + "/textright.png"), tr("&Right"), grp); - actionAlignCenter = new QAction(QIcon(rsrcPath + "/textcenter.png"), tr("C&enter"), grp); - actionAlignLeft = new QAction(QIcon(rsrcPath + "/textleft.png"), tr("&Left"), grp); + actionAlignRight = new QAction(QIcon::fromTheme("format-justify-right", QIcon(rsrcPath + "/textright.png")), tr("&Right"), grp); + actionAlignCenter = new QAction(QIcon::fromTheme("format-justify-center", QIcon(rsrcPath + "/textcenter.png")), tr("C&enter"), grp); + actionAlignLeft = new QAction(QIcon::fromTheme("format-justify-left", QIcon(rsrcPath + "/textleft.png")), tr("&Left"), grp); } - actionAlignJustify = new QAction(QIcon(rsrcPath + "/textjustify.png"), tr("&Justify"), grp); + actionAlignJustify = new QAction(QIcon::fromTheme("format-justify-fill", QIcon(rsrcPath + "/textjustify.png")), tr("&Justify"), grp); actionAlignLeft->setShortcut(Qt::CTRL + Qt::Key_L); actionAlignLeft->setCheckable(true); diff --git a/doc/src/snippets/code/src_gui_image_qicon.cpp b/doc/src/snippets/code/src_gui_image_qicon.cpp index 2b7c893..455fd84 100644 --- a/doc/src/snippets/code/src_gui_image_qicon.cpp +++ b/doc/src/snippets/code/src_gui_image_qicon.cpp @@ -20,3 +20,12 @@ void MyWidget::drawIcon(QPainter *painter, QPoint pos) painter->drawPixmap(pos, pixmap); } //! [2] + +//! [3] + QIcon undoicon = QIcon::fromTheme("edit-undo"); +//! [3] + +//! [4] + QIcon undoicon = QIcon::fromTheme("edit-undo", QIcon(":/undo.png")); +//! [4] + diff --git a/src/gui/gui.pro b/src/gui/gui.pro index b77bfdc..a49d680 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -46,4 +46,3 @@ contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri) QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist DEFINES += Q_INTERNAL_QAPP_SRC - diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri index b9c36dc..baf2125 100644 --- a/src/gui/image/image.pri +++ b/src/gui/image/image.pri @@ -6,6 +6,8 @@ HEADERS += \ image/qbitmap.h \ image/qicon.h \ + image/qicon_p.h \ + image/qiconloader_p.h \ image/qiconengine.h \ image/qiconengineplugin.h \ image/qimage.h \ @@ -32,6 +34,7 @@ HEADERS += \ SOURCES += \ image/qbitmap.cpp \ image/qicon.cpp \ + image/qiconloader.cpp \ image/qimage.cpp \ image/qimageiohandler.cpp \ image/qimagereader.cpp \ diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index fa407c7..7a43514 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -40,9 +40,11 @@ ****************************************************************************/ #include "qicon.h" +#include "qicon_p.h" #include "qiconengine.h" #include "qiconengineplugin.h" #include "private/qfactoryloader_p.h" +#include "private/qiconloader_p.h" #include "qapplication.h" #include "qstyleoption.h" #include "qpainter.h" @@ -50,6 +52,7 @@ #include "qstyle.h" #include "qpixmapcache.h" #include "qvariant.h" +#include "qcache.h" #include "qdebug.h" #ifdef Q_WS_MAC @@ -57,6 +60,11 @@ #include #endif +#ifdef Q_WS_X11 +#include "private/qt_x11_p.h" +#include "private/qkde_p.h" +#endif + QT_BEGIN_NAMESPACE /*! @@ -94,73 +102,14 @@ QT_BEGIN_NAMESPACE static QBasicAtomicInt serialNumCounter = Q_BASIC_ATOMIC_INITIALIZER(1); -class QIconPrivate -{ -public: - QIconPrivate(): engine(0), ref(1), serialNum(serialNumCounter.fetchAndAddRelaxed(1)), detach_no(0), engine_version(2), v1RefCount(0) {} - - ~QIconPrivate() { - if (engine_version == 1) { - if (!v1RefCount->deref()) { - delete engine; - delete v1RefCount; - } - } else if (engine_version == 2) { - delete engine; - } - } - - QIconEngine *engine; - - QAtomicInt ref; - int serialNum; - int detach_no; - int engine_version; - - QAtomicInt *v1RefCount; -}; - - -struct QPixmapIconEngineEntry +QIconPrivate::QIconPrivate() + : engine(0), ref(1), + serialNum(serialNumCounter.fetchAndAddRelaxed(1)), + detach_no(0), + engine_version(2), + v1RefCount(0) { - QPixmapIconEngineEntry():mode(QIcon::Normal), state(QIcon::Off){} - QPixmapIconEngineEntry(const QPixmap &pm, QIcon::Mode m = QIcon::Normal, QIcon::State s = QIcon::Off) - :pixmap(pm), size(pm.size()), mode(m), state(s){} - QPixmapIconEngineEntry(const QString &file, const QSize &sz = QSize(), QIcon::Mode m = QIcon::Normal, QIcon::State s = QIcon::Off) - :fileName(file), size(sz), mode(m), state(s){} - QPixmap pixmap; - QString fileName; - QSize size; - QIcon::Mode mode; - QIcon::State state; - bool isNull() const {return (fileName.isEmpty() && pixmap.isNull()); } -}; - -class QPixmapIconEngine : public QIconEngineV2 { -public: - QPixmapIconEngine(); - QPixmapIconEngine(const QPixmapIconEngine &); - ~QPixmapIconEngine(); - void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); - QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); - QPixmapIconEngineEntry *bestMatch(const QSize &size, QIcon::Mode mode, QIcon::State state, bool sizeOnly); - QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); - void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state); - void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state); - - // v2 functions - QString key() const; - QIconEngineV2 *clone() const; - bool read(QDataStream &in); - bool write(QDataStream &out) const; - void virtual_hook(int id, void *data); - -private: - QPixmapIconEngineEntry *tryMatch(const QSize &size, QIcon::Mode mode, QIcon::State state); - QVector pixmaps; - - friend QDataStream &operator<<(QDataStream &s, const QIcon &icon); -}; +} QPixmapIconEngine::QPixmapIconEngine() { @@ -918,6 +867,146 @@ QList QIcon::availableSizes(Mode mode, State state) const return engine->availableSizes(mode, state); } +/*! + \since 4.6 + + Sets the search paths for icon themes. + \sa themeSearchPaths(), fromTheme() +*/ +void QIcon::setThemeSearchPaths(const QStringList &paths) +{ + QIconLoader::instance()->setThemeSearchPath(paths); +} + +/*! + \since 4.6 + + Returns the search paths for icon themes. + + The default value will depend on the platform: + + On X11, the search path will use the XDG_DATA_DIRS environment + variable if available. + + On Windows the search path defaults to [Application Directory]/icons + + On Mac the default search path will search in the + [Contents/Resources/icons] part of the application bundle. + + \sa setThemeSearchPaths(), fromName() +*/ +QStringList QIcon::themeSearchPaths() +{ + return QIconLoader::instance()->themeSearchPaths(); +} + +/*! + \since 4.6 + + Sets the current icon theme. + + The name should correspond to a directory name in the + current \ themeSearchPath() containing an index.theme + file describing it's contents.. + +*/ +void QIcon::setThemeName(const QString &path) +{ + QIconLoader::instance()->setThemeName(path); +} + +/*! + \since 4.6 + + Returns the name of the current icon theme. + + On X11, the current icon theme depends on your desktop + settings. On other platforms it is not set by default. + + \sa themeSearchPaths(), themeIcon(), fromTheme(), hasThemeIcon() +*/ +QString QIcon::themeName() +{ + return QIconLoader::instance()->themeName(); +} + +/*! + \since 4.6 + + Returns the QIcon corresponding to \a name in the current + icon theme. If no such icon is found in the current theme + \a fallback is return instead. + + To use an icon theme on Windows or Mac, you will need to + bundle a compliant theme with your application and make sure + it is located in your themeSarchPaths. + + The lastest version of the freedesktop icon specification and naming + spesification can be obtained here: + http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html + http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html + + To fetch an icon from the current icon theme: + + \snippet doc/src/snippets/code/src_gui_image_qicon.cpp 3 + + Or if you want to provide a guaranteed fallback for platforms that + do not support theme icons, you can use the second argument: + + \snippet doc/src/snippets/code/src_gui_image_qicon.cpp 4 + + \note By default, only X11 will support themed icons. In order to + use themed icons on Mac and Windows, you will have to bundle a + compliant theme in one of your themeSearchPaths() and set the + appropriate themeName(). + + \sa themeName(), themeSearchPaths() +*/ +QIcon QIcon::fromTheme(const QString &name, const QIcon &fallback) +{ + + static QCache iconCache; + + QIcon icon; + +#ifdef Q_WS_X11 + if (X11->desktopEnvironment == DE_KDE) { + icon = QKde::kdeIcon(name); + if (!icon.isNull()) + return icon; + } +#endif + + if (iconCache.contains(name)) { + icon = *iconCache.object(name); + } else { + QIcon *cachedIcon = new QIcon(new QIconLoaderEngine(name)); + iconCache.insert(name, cachedIcon); + icon = *cachedIcon; + } + + if (icon.availableSizes().isEmpty()) + return fallback; + + return icon; +} + +/*! + \since 4.6 + + Returns true if there is an icon available for a \a name in the current + icon theme, otherwise returns false. + + \sa themeSearchPaths(), fromTheme() +*/ +bool QIcon::hasThemeIcon(const QString &name) +{ + QIcon icon = fromTheme(name); + + return !icon.isNull(); +} + + /***************************************************************************** QIcon stream functions *****************************************************************************/ @@ -989,6 +1078,11 @@ QDataStream &operator>>(QDataStream &s, QIcon &icon) QIconEngineV2 *engine = new QPixmapIconEngine; icon.d->engine = engine; engine->read(s); + } else if (key == QLatin1String("QIconLoaderEngine")) { + icon.d = new QIconPrivate; + QIconEngineV2 *engine = new QIconLoaderEngine(); + icon.d->engine = engine; + engine->read(s); #if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) } else if (QIconEngineFactoryInterfaceV2 *factory = qobject_cast(loaderV2()->instance(key))) { if (QIconEngineV2 *engine= factory->create()) { diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h index c318e14..2a71717 100644 --- a/src/gui/image/qicon.h +++ b/src/gui/image/qicon.h @@ -97,6 +97,16 @@ public: QList availableSizes(Mode mode = Normal, State state = Off) const; + static QIcon fromTheme(const QString &name, const QIcon &fallback = QIcon()); + static bool hasThemeIcon(const QString &name); + + static QStringList themeSearchPaths(); + static void setThemeSearchPaths(const QStringList &searchpath); + + static QString themeName(); + static void setThemeName(const QString &path); + + #ifdef QT3_SUPPORT enum Size { Small, Large, Automatic = Small }; static QT3_SUPPORT void setPixmapSize(Size which, const QSize &size); diff --git a/src/gui/image/qicon_p.h b/src/gui/image/qicon_p.h new file mode 100644 index 0000000..ccac4c3 --- /dev/null +++ b/src/gui/image/qicon_p.h @@ -0,0 +1,138 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QICON_P_H +#define QICON_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 +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QIconPrivate +{ +public: + QIconPrivate(); + + ~QIconPrivate() { + if (engine_version == 1) { + if (!v1RefCount->deref()) { + delete engine; + delete v1RefCount; + } + } else if (engine_version == 2) { + delete engine; + } + } + + QIconEngine *engine; + + QAtomicInt ref; + int serialNum; + int detach_no; + int engine_version; + + QAtomicInt *v1RefCount; +}; + + +struct QPixmapIconEngineEntry +{ + QPixmapIconEngineEntry():mode(QIcon::Normal), state(QIcon::Off){} + QPixmapIconEngineEntry(const QPixmap &pm, QIcon::Mode m = QIcon::Normal, QIcon::State s = QIcon::Off) + :pixmap(pm), size(pm.size()), mode(m), state(s){} + QPixmapIconEngineEntry(const QString &file, const QSize &sz = QSize(), QIcon::Mode m = QIcon::Normal, QIcon::State s = QIcon::Off) + :fileName(file), size(sz), mode(m), state(s){} + QPixmap pixmap; + QString fileName; + QSize size; + QIcon::Mode mode; + QIcon::State state; + bool isNull() const {return (fileName.isEmpty() && pixmap.isNull()); } +}; + + + +class QPixmapIconEngine : public QIconEngineV2 { +public: + QPixmapIconEngine(); + QPixmapIconEngine(const QPixmapIconEngine &); + ~QPixmapIconEngine(); + void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); + QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); + QPixmapIconEngineEntry *bestMatch(const QSize &size, QIcon::Mode mode, QIcon::State state, bool sizeOnly); + QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); + void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state); + void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state); + + // v2 functions + QString key() const; + QIconEngineV2 *clone() const; + bool read(QDataStream &in); + bool write(QDataStream &out) const; + void virtual_hook(int id, void *data); + +private: + QPixmapIconEngineEntry *tryMatch(const QSize &size, QIcon::Mode mode, QIcon::State state); + QVector pixmaps; + + friend QDataStream &operator<<(QDataStream &s, const QIcon &icon); + friend class QIconThemeEngine; +}; + +QT_END_NAMESPACE + +#endif // QICON_P_H diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp new file mode 100644 index 0000000..6bf8d3b --- /dev/null +++ b/src/gui/image/qiconloader.cpp @@ -0,0 +1,599 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef Q_WS_MAC +#include +#endif + +#ifdef Q_WS_X11 +#include +#include +#endif + +QT_BEGIN_NAMESPACE + +Q_GLOBAL_STATIC(QIconLoader, iconLoaderInstance) + +static QString systemThemeName() +{ + QString result; +#ifdef Q_WS_X11 + if (X11->desktopEnvironment == DE_GNOME) { + result = QGtk::getGConfString(QLatin1String("/desktop/gnome/interface/icon_theme"), + QLatin1String("gnome")); + } else if (X11->desktopEnvironment == DE_KDE) { + QString kdeDefault = X11->desktopVersion >= 4 ? + QString::fromLatin1("oxygen") : + QString::fromLatin1("crystalsvg"); + + QSettings settings(QKde::kdeHome() + + QLatin1String("/share/config/kdeglobals"), + QSettings::IniFormat); + + settings.beginGroup(QLatin1String("Icons")); + + result = settings.value(QLatin1String("Theme"), kdeDefault).toString(); + } +#endif + return result; +} + +static QString fallbackTheme() +{ + QString defaultTheme = systemThemeName(); + if (defaultTheme.isEmpty()) + defaultTheme = QLatin1String("hicolor"); + return defaultTheme; +} + +QIconLoader::QIconLoader() : + m_themeKey(1), m_supportsSvg(false) +{ + m_systemTheme = systemThemeName(); + + QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid, + QLatin1String("/iconengines"), + Qt::CaseInsensitive); + if (iconFactoryLoader.keys().contains(QLatin1String("svg"))) + m_supportsSvg = true; +} + +QIconLoader *QIconLoader::instance() +{ + return iconLoaderInstance(); +} + +// Queries the system theme and invalidates existing +// icons if the theme has changed. +void QIconLoader::updateSystemTheme() +{ + // Only change if this is not explicitly set by the user + if (m_userTheme.isEmpty()) { + QString theme = systemThemeName(); + if (theme != m_systemTheme) { + m_systemTheme = theme; + invalidateKey(); + } + } +} + +void QIconLoader::setThemeName(const QString &themeName) +{ + m_userTheme = themeName; + invalidateKey(); +} + +void QIconLoader::setThemeSearchPath(const QStringList &searchPaths) +{ + m_iconDirs = searchPaths; + themeList.clear(); + invalidateKey(); +} + +QStringList QIconLoader::themeSearchPaths() const +{ + if (m_iconDirs.isEmpty()) { + +#if defined(Q_WS_X11) + + QString xdgDirString = QFile::decodeName(getenv("XDG_DATA_DIRS")); + if (xdgDirString.isEmpty()) + xdgDirString = QLatin1String("/usr/local/share/:/usr/share/"); + + QStringList xdgDirs = xdgDirString.split(QLatin1Char(':')); + + for (int i = 0 ; i < xdgDirs.size() ; ++i) { + QDir dir(xdgDirs[i]); + if (dir.exists()) + m_iconDirs.append(dir.path() + + QLatin1String("/icons")); + } + + if (X11->desktopEnvironment == DE_KDE) { + + m_iconDirs << QLatin1Char(':') + + QKde::kdeHome() + + QLatin1String("/share/icons"); + QStringList kdeDirs = + QFile::decodeName(getenv("KDEDIRS")).split(QLatin1Char(':')); + + for (int i = 0 ; i< kdeDirs.count() ; ++i) { + QDir dir(QLatin1Char(':') + kdeDirs.at(i) + + QLatin1String("/share/icons")); + if (dir.exists()) + m_iconDirs.append(dir.path()); + } + } + + // Add home directory first in search path + QDir homeDir(QDir::homePath() + QLatin1String("/.icons")); + if (homeDir.exists()) + m_iconDirs.prepend(homeDir.path()); + +#elif defined(Q_WS_WIN) + m_iconDirs.append(qApp->applicationDirPath() + + QLatin1String("/icons")); +#elif defined(Q_WS_MAC) + m_iconDirs.append(qApp->applicationDirPath() + + QLatin1String("/../Resources/icons")); +#endif + } + return m_iconDirs; +} + +QIconTheme::QIconTheme(const QString &themeName) + : m_valid(false) +{ + QFile themeIndex; + + QList keyList; + QStringList iconDirs = QIcon::themeSearchPaths(); + for ( int i = 0 ; i < iconDirs.size() ; ++i) { + QDir iconDir(iconDirs[i]); + QString themeDir = iconDir.path() + QLatin1Char('/') + themeName; + themeIndex.setFileName(themeDir + QLatin1String("/index.theme")); + if (themeIndex.exists()) { + m_contentDir = themeDir; + m_valid = true; + break; + } + } + + if (themeIndex.exists()) { + const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat); + QStringListIterator keyIterator(indexReader.allKeys()); + while (keyIterator.hasNext()) { + + const QString key = keyIterator.next(); + if (key.endsWith(QLatin1String("/Size"))) { + // Note the QSettings ini-format does not accept + // slashes in key names, hence we have to cheat + if (int size = indexReader.value(key).toInt()) { + QString directoryKey = key.left(key.size() - 5); + QIconDirInfo dirInfo(directoryKey); + dirInfo.size = size; + QString type = indexReader.value(directoryKey + + QLatin1String("/Type") + ).toString(); + + if (type == QLatin1String("Fixed")) + dirInfo.type = QIconDirInfo::Fixed; + else if (type == QLatin1String("Scalable")) + dirInfo.type = QIconDirInfo::Scalable; + else + dirInfo.type = QIconDirInfo::Threshold; + + dirInfo.threshold = indexReader.value(directoryKey + + QLatin1String("/Threshold"), + 2).toInt(); + + dirInfo.minSize = indexReader.value(directoryKey + + QLatin1String("/MinSize"), + size).toInt(); + + dirInfo.maxSize = indexReader.value(directoryKey + + QLatin1String("/MaxSize"), + size).toInt(); + m_keyList.append(dirInfo); + } + } + } + + // Parent themes provide fallbacks for missing icons + m_parents = indexReader.value( + QLatin1String("Icon Theme/Inherits")).toStringList(); + + // Ensure a default platform fallback for all themes + if (m_parents.isEmpty()) + m_parents.append(fallbackTheme()); + + // Ensure that all themes fall back to hicolor + if (!m_parents.isEmpty()) + m_parents.append(QLatin1String("hicolor")); + } +} + +QThemeIconEntries QIconLoader::findIconHelper(const QString &themeName, + const QString &iconName, + QStringList &visited) const +{ + QThemeIconEntries entries; + Q_ASSERT(!themeName.isEmpty()); + + QPixmap pixmap; + + // Used to protect against potential recursions + visited << themeName; + + QIconTheme theme = themeList.value(themeName); + if (!theme.isValid()) { + theme = QIconTheme(themeName); + if (!theme.isValid()) + theme = fallbackTheme(); + + themeList.insert(themeName, theme); + } + + QString contentDir = theme.contentDir() + QLatin1Char('/'); + QList subDirs = theme.keyList(); + + const QString svgext(QLatin1String(".svg")); + const QString pngext(QLatin1String(".png")); + + // Add all relevant files + for (int i = 0; i < subDirs.size() ; ++i) { + const QIconDirInfo &dirInfo = subDirs.at(i); + QString subdir = dirInfo.path; + QDir currentDir(contentDir + subdir); + + if (dirInfo.type == QIconDirInfo::Scalable && m_supportsSvg && + currentDir.exists(iconName + svgext)) { + ScalableEntry *iconEntry = new ScalableEntry; + iconEntry->dir = dirInfo; + iconEntry->filename = currentDir.filePath(iconName + svgext); + entries.append(iconEntry); + + } else if (currentDir.exists(iconName + pngext)) { + PixmapEntry *iconEntry = new PixmapEntry; + iconEntry->dir = dirInfo; + iconEntry->filename = currentDir.filePath(iconName + pngext); + // Notice we ensure that pixmap entries allways come before + // scalable to preserve search order afterwards + entries.prepend(iconEntry); + } + } + + if (entries.isEmpty()) { + const QStringList parents = theme.parents(); + // Search recursively through inherited themes + for (int i = 0 ; i < parents.size() ; ++i) { + + const QString parentTheme = parents.at(i).trimmed(); + + if (!visited.contains(parentTheme)) // guard against recursion + entries = findIconHelper(parentTheme, iconName, visited); + + if (!entries.isEmpty()) // success + break; + } + } + return entries; +} + +QThemeIconEntries QIconLoader::loadIcon(const QString &name) const +{ + if (!themeName().isEmpty()) { + QStringList visited; + return findIconHelper(themeName(), name, visited); + } + + return QThemeIconEntries(); +} + + +// -------- Icon Loader Engine -------- // + + +QIconLoaderEngine::QIconLoaderEngine(const QString& iconName) + : m_iconName(iconName), m_key(0) +{ +} + +QIconLoaderEngine::~QIconLoaderEngine() +{ + while (!m_entries.isEmpty()) + delete m_entries.takeLast(); + Q_ASSERT(m_entries.size() == 0); +} + +QIconLoaderEngine::QIconLoaderEngine(const QIconLoaderEngine &other) + : QIconEngineV2(other), + m_iconName(other.m_iconName), + m_key(0) +{ +} + +QIconEngineV2 *QIconLoaderEngine::clone() const +{ + return new QIconLoaderEngine(*this); +} + +bool QIconLoaderEngine::read(QDataStream &in) { + in >> m_iconName; + return true; +} + +bool QIconLoaderEngine::write(QDataStream &out) const +{ + out << m_iconName; + return true; +} + +bool QIconLoaderEngine::hasIcon() const +{ + return !(m_entries.isEmpty()); +} + +// Lazily load the icon +void QIconLoaderEngine::ensureLoaded() +{ + if (!(iconLoaderInstance()->themeKey() == m_key)) { + + while (!m_entries.isEmpty()) + delete m_entries.takeLast(); + + Q_ASSERT(m_entries.size() == 0); + m_entries = iconLoaderInstance()->loadIcon(m_iconName); + m_key = iconLoaderInstance()->themeKey(); + } +} + +void QIconLoaderEngine::paint(QPainter *painter, const QRect &rect, + QIcon::Mode mode, QIcon::State state) +{ + QSize pixmapSize = rect.size(); +#if defined(Q_WS_MAC) + pixmapSize *= qt_mac_get_scalefactor(); +#endif + painter->drawPixmap(rect, pixmap(pixmapSize, mode, state)); +} + +/* + * This algorithm is defined by the freedesktop spec: + * http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html + */ +static bool directoryMatchesSize(const QIconDirInfo &dir, int iconsize) +{ + if (dir.type == QIconDirInfo::Fixed) { + return dir.size == iconsize; + + } else if (dir.type == QIconDirInfo::Scalable) { + return dir.size <= dir.maxSize && + iconsize >= dir.minSize; + + } else if (dir.type == QIconDirInfo::Threshold) { + return iconsize >= dir.size - dir.threshold && + iconsize <= dir.size + dir.threshold; + } + + Q_ASSERT(1); // Not a valid value + return false; +} + +/* + * This algorithm is defined by the freedesktop spec: + * http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html + */ +static int directorySizeDistance(const QIconDirInfo &dir, int iconsize) +{ + if (dir.type == QIconDirInfo::Fixed) { + return qAbs(dir.size - iconsize); + + } else if (dir.type == QIconDirInfo::Scalable) { + if (iconsize < dir.minSize) + return dir.minSize - iconsize; + else if (iconsize > dir.maxSize) + return iconsize - dir.maxSize; + else + return 0; + + } else if (dir.type == QIconDirInfo::Threshold) { + if (iconsize < dir.size - dir.threshold) + return dir.minSize - iconsize; + else if (iconsize > dir.size + dir.threshold) + return iconsize - dir.maxSize; + else return 0; + } + + Q_ASSERT(1); // Not a valid value + return INT_MAX; +} + +QIconLoaderEngineEntry *QIconLoaderEngine::entryForSize(const QSize &size) +{ + int iconsize = qMin(size.width(), size.height()); + + // Note that m_entries are sorted so that png-files + // come first + + // Search for exact matches first + for (int i = 0; i < m_entries.count(); ++i) { + QIconLoaderEngineEntry *entry = m_entries.at(i); + if (directoryMatchesSize(entry->dir, iconsize)) { + return entry; + } + } + + // Find the minimum distance icon + int minimalSize = INT_MAX; + QIconLoaderEngineEntry *closestMatch = 0; + for (int i = 0; i < m_entries.count(); ++i) { + QIconLoaderEngineEntry *entry = m_entries.at(i); + int distance = directorySizeDistance(entry->dir, iconsize); + if (distance < minimalSize) { + minimalSize = distance; + closestMatch = entry; + } + } + return closestMatch; +} + +/* + * Returns the actual icon size. For scalable svg's this is equivalent + * to the requested size. Otherwise the closest match is returned. + * + * todo: the spec is a bit fuzzy in this area, but we should probably + * allow scaling down pixmap icons as well. + * + */ +QSize QIconLoaderEngine::actualSize(const QSize &size, QIcon::Mode mode, + QIcon::State state) +{ + ensureLoaded(); + + QIconLoaderEngineEntry *entry = entryForSize(size); + if (entry) { + const QIconDirInfo &dir = entry->dir; + if (dir.type == QIconDirInfo::Scalable) + return size; + else + return QSize(dir.size, dir.size); + } + return QIconEngineV2::actualSize(size, mode, state); +} + +QPixmap PixmapEntry::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) +{ + Q_UNUSED(state); + + // Ensure that basePixmap is lazily initialized before generating the + // key, otherwise the cache key is not unique + if (basePixmap.isNull()) + basePixmap.load(filename); + + int actualSize = qMin(size.width(), size.height()); + QString key = QLatin1String("$qt_theme_") + + QString::number(basePixmap.cacheKey(), 16) + + QLatin1Char('_') + + QString::number(mode) + + QLatin1Char('_') + + QString::number(qApp->palette().cacheKey(), 16) + + QLatin1Char('_') + + QString::number(actualSize); + + QPixmap cachedPixmap; + if (QPixmapCache::find(key, &cachedPixmap)) { + return cachedPixmap; + } else { + QStyleOption opt(0); + opt.palette = qApp->palette(); + cachedPixmap = qApp->style()->generatedIconPixmap(mode, basePixmap, &opt); + QPixmapCache::insert(key, cachedPixmap); + } + return cachedPixmap; +} + +QPixmap ScalableEntry::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) +{ + if (svgIcon.isNull()) + svgIcon = QIcon(filename); + + // Simply reuse svg icon engine + return svgIcon.pixmap(size, mode, state); +} + +QPixmap QIconLoaderEngine::pixmap(const QSize &size, QIcon::Mode mode, + QIcon::State state) +{ + ensureLoaded(); + + QIconLoaderEngineEntry *entry = entryForSize(size); + if (entry) + return entry->pixmap(size, mode, state); + + return QPixmap(); +} + +QString QIconLoaderEngine::key() const +{ + return QLatin1String("QIconLoaderEngine"); +} + +void QIconLoaderEngine::virtual_hook(int id, void *data) +{ + ensureLoaded(); + + switch (id) { + case QIconEngineV2::AvailableSizesHook: + { + QIconEngineV2::AvailableSizesArgument &arg + = *reinterpret_cast(data); + const QList directoryKey = iconLoaderInstance()->theme().keyList(); + arg.sizes.clear(); + + // Gets all sizes from the DirectoryInfo entries + for (int i = 0 ; i < m_entries.size() ; ++i) { + int size = m_entries.at(i)->dir.size; + arg.sizes.append(QSize(size, size)); + } + } + break; + default: + QIconEngineV2::virtual_hook(id, data); + } +} + +QT_END_NAMESPACE diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h new file mode 100644 index 0000000..707107c --- /dev/null +++ b/src/gui/image/qiconloader_p.h @@ -0,0 +1,185 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDESKTOPICON_P_H +#define QDESKTOPICON_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 +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class QIconLoader; + +struct QIconDirInfo +{ + enum Type { Fixed, Scalable, Threshold }; + QIconDirInfo(const QString &_path = QString()) : + path(_path), + size(0), + maxSize(0), + minSize(0), + threshold(0), + type(Threshold) {} + QString path; + short size; + short maxSize; + short minSize; + short threshold; + Type type : 4; +}; + +class QIconLoaderEngineEntry + { +public: + virtual QPixmap pixmap(const QSize &size, + QIcon::Mode mode, + QIcon::State state) = 0; + QString filename; + QIconDirInfo dir; + static int count; +}; + +struct ScalableEntry : public QIconLoaderEngineEntry +{ + QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); + QIcon svgIcon; +}; + +struct PixmapEntry : public QIconLoaderEngineEntry +{ + QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); + QPixmap basePixmap; +}; + +typedef QList QThemeIconEntries; + +class QIconLoaderEngine : public QIconEngineV2 +{ +public: + QIconLoaderEngine(const QString& iconName = QString()); + ~QIconLoaderEngine(); + + void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); + QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); + QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); + QIconEngineV2 *clone() const; + bool read(QDataStream &in); + bool write(QDataStream &out) const; + +private: + QString key() const; + bool hasIcon() const; + void ensureLoaded(); + void virtual_hook(int id, void *data); + QIconLoaderEngineEntry *entryForSize(const QSize &size); + QIconLoaderEngine(const QIconLoaderEngine &other); + QThemeIconEntries m_entries; + QString m_iconName; + uint m_key; + + friend class QIconLoader; +}; + +class QIconTheme +{ +public: + QIconTheme(const QString &name); + QIconTheme() : m_valid(false) {}; + QStringList parents() { return m_parents; } + QList keyList() { return m_keyList; } + QString contentDir() { return m_contentDir; } + bool isValid() { return m_valid; } + +private: + QString m_contentDir; + QList m_keyList; + QStringList m_parents; + bool m_valid; +}; + +class QIconLoader : public QObject +{ +public: + QIconLoader(); + QThemeIconEntries loadIcon(const QString &iconName) const; + uint themeKey() const { return m_themeKey; } + + QString themeName() const { return m_userTheme.isEmpty() ? m_systemTheme : m_userTheme; } + void setThemeName(const QString &themeName); + QIconTheme theme() { return themeList.value(themeName()); } + void setThemeSearchPath(const QStringList &searchPaths); + QStringList themeSearchPaths() const; + QIconDirInfo dirInfo(int dirindex); + static QIconLoader *instance(); + void updateSystemTheme(); + void invalidateKey() { m_themeKey++; } + +private: + QThemeIconEntries findIconHelper(const QString &themeName, + const QString &iconName, + QStringList &visited) const; + uint m_themeKey; + bool m_supportsSvg; + + mutable QString m_userTheme; + mutable QString m_systemTheme; + mutable QStringList m_iconDirs; + mutable QHash themeList; +}; + +QT_END_NAMESPACE + +#endif // QDESKTOPICON_P_H diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 32e7e3c..221101a 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -78,6 +78,7 @@ #include #include #include +#include #include "qstyle.h" #include "qmetaobject.h" #include "qtimer.h" @@ -1087,7 +1088,6 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0, if (QApplication::desktopSettingsAware()) { // first, read from settings QApplicationPrivate::x11_apply_settings(); - // the call to QApplication::style() below creates the system // palette, which breaks the logic after the RESOURCE_MANAGER // loop... so I have to save this value to be able to use it later @@ -1328,6 +1328,8 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0, QApplication::setEffectEnabled(Qt::UI_AnimateToolBox, effects.contains(QLatin1String("animatetoolbox"))); } + + QIconLoader::instance()->updateSystemTheme(); } diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index f947ac1..c8b4fda 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -60,6 +60,7 @@ #include #include +#include #include #include @@ -341,9 +342,9 @@ static bool resolveGConf() typedef int (*x11ErrorHandler)(Display*, XErrorEvent*); -static QString getGConfString(const QString &value) +QString QGtk::getGConfString(const QString &value, const QString &fallback) { - QString retVal; + QString retVal = fallback; if (resolveGConf()) { g_type_init(); GConfClient* client = QGtk::gconf_client_get_default(); @@ -393,7 +394,7 @@ static QString getThemeName() // Fall back to gconf if (themeName.isEmpty() && resolveGConf()) - themeName = getGConfString(QLS("/desktop/gnome/interface/gtk_theme")); + themeName = QGtk::getGConfString(QLS("/desktop/gnome/interface/gtk_theme")); return themeName; } @@ -561,6 +562,7 @@ void QGtkStyleUpdateScheduler::updateTheme() QApplication::sendEvent(widget, &e); } } + QIconLoader::instance()->updateSystemTheme(); } static void add_widget(GtkWidget *widget) diff --git a/src/gui/styles/gtksymbols_p.h b/src/gui/styles/gtksymbols_p.h index 18c6dc5..68e970a 100644 --- a/src/gui/styles/gtksymbols_p.h +++ b/src/gui/styles/gtksymbols_p.h @@ -216,6 +216,7 @@ public: static QString openDirectory(QWidget *parent, const QString &caption, const QString &dir, QFileDialog::Options options); static QStringList openFilenames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options); + static QString getGConfString(const QString &key, const QString &fallback = QString()); static Ptr_gtk_container_forall gtk_container_forall; static Ptr_gtk_init gtk_init; diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index 8f88781..1782e36 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -462,26 +462,6 @@ static const char * const qt_cleanlooks_checkbox_checked[] = { " ", " "}; -#ifdef Q_WS_X11 -extern "C" { - struct GConfClient; - struct GError; - typedef void (*Ptr_g_type_init)(); - typedef GConfClient* (*Ptr_gconf_client_get_default)(); - typedef char* (*Ptr_gconf_client_get_string)(GConfClient*, const char*, GError **); - typedef void (*Ptr_g_object_unref)(void *); - typedef void (*Ptr_g_error_free)(GError *); - typedef void (*Ptr_g_free)(void*); -} - -static Ptr_g_type_init p_g_type_init = 0; -static Ptr_gconf_client_get_default p_gconf_client_get_default = 0; -static Ptr_gconf_client_get_string p_gconf_client_get_string = 0; -static Ptr_g_object_unref p_g_object_unref = 0; -static Ptr_g_error_free p_g_error_free = 0; -static Ptr_g_free p_g_free = 0; -#endif - static void qt_cleanlooks_draw_gradient(QPainter *painter, const QRect &rect, const QColor &gradientStart, const QColor &gradientStop, Direction direction = TopDown, QBrush bgBrush = QBrush()) { @@ -3848,17 +3828,6 @@ QSize QCleanlooksStyle::sizeFromContents(ContentsType type, const QStyleOption * void QCleanlooksStyle::polish(QApplication *app) { QWindowsStyle::polish(app); -#ifdef Q_WS_X11 - Q_D(QCleanlooksStyle); - - QString dataDirs = QLatin1String(getenv("XDG_DATA_DIRS")); - - if (dataDirs.isEmpty()) - dataDirs = QLatin1String("/usr/local/share/:/usr/share/"); - - dataDirs.prepend(QDir::homePath() + QLatin1String("/:")); - d->iconDirs = dataDirs.split(QLatin1Char(':')); -#endif } /*! @@ -4376,44 +4345,6 @@ QRect QCleanlooksStyle::subElementRect(SubElement sr, const QStyleOption *opt, c return r; } -void QCleanlooksStylePrivate::lookupIconTheme() const -{ -#ifdef Q_WS_X11 - - if (themeName.isEmpty()) { - //resolve glib and gconf functions - p_g_type_init = (Ptr_g_type_init)QLibrary::resolve(QLatin1String("gobject-2.0"), 0, "g_type_init"); - p_gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLatin1String("gconf-2"), 4, "gconf_client_get_default"); - p_gconf_client_get_string = (Ptr_gconf_client_get_string)QLibrary::resolve(QLatin1String("gconf-2"), 4, "gconf_client_get_string"); - p_g_object_unref = (Ptr_g_object_unref)QLibrary::resolve(QLatin1String("gobject-2.0"), 0, "g_object_unref"); - p_g_error_free = (Ptr_g_error_free)QLibrary::resolve(QLatin1String("glib-2.0"), 0, "g_error_free"); - p_g_free = (Ptr_g_free)QLibrary::resolve(QLatin1String("glib-2.0"), 0, "g_free"); - - if (p_g_type_init && - p_gconf_client_get_default && - p_gconf_client_get_string && - p_g_object_unref && - p_g_error_free && - p_g_free) { - - p_g_type_init(); - GConfClient* client = p_gconf_client_get_default(); - GError *err = 0; - char *str = p_gconf_client_get_string(client, "/desktop/gnome/interface/icon_theme", &err); - if (!err) { - themeName = QString::fromUtf8(str); - p_g_free(str); - } - p_g_object_unref(client); - if (err) - p_g_error_free (err); - } - if (themeName.isEmpty()) - themeName = QLatin1String("gnome"); - } -#endif -} - /*! \internal */ @@ -4421,165 +4352,6 @@ QIcon QCleanlooksStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const { -#ifdef Q_WS_X11 - Q_D(const QCleanlooksStyle); - if (!QApplication::desktopSettingsAware()) - return QWindowsStyle::standardIconImplementation(standardIcon, option, widget); - QIcon icon; - QPixmap pixmap; - QPixmap link; - d->lookupIconTheme(); - switch (standardIcon) { - case SP_DirIcon: { - icon = QIcon(proxy()->standardPixmap(standardIcon, option, widget)); - icon.addPixmap(proxy()->standardPixmap(SP_DirClosedIcon, option, widget), - QIcon::Normal, QIcon::Off); - pixmap = d->findIcon(16, QLatin1String("gnome-fs-directory.png")); - if (!pixmap.isNull()) - icon.addPixmap(pixmap, QIcon::Normal, QIcon::Off); - pixmap = d->findIcon(48, QLatin1String("gnome-fs-directory.png")); - if (!pixmap.isNull()) - icon.addPixmap(pixmap, QIcon::Normal, QIcon::Off); - pixmap = d->findIcon(16, QLatin1String("gnome-fs-directory-accept.png")); - if (!pixmap.isNull()) - icon.addPixmap(pixmap, QIcon::Normal, QIcon::On); - pixmap = d->findIcon(16, QLatin1String("gnome-fs-directory-accept.png")); - if (!pixmap.isNull()) - icon.addPixmap(pixmap, QIcon::Normal, QIcon::On); - } - break; - case SP_DirLinkIcon: - { - icon = QIcon(proxy()->standardPixmap(standardIcon, option, widget)); - QPixmap link = d->findIcon(12, QLatin1String("emblem-symbolic-link.png")); - if (!link.isNull()) { - icon.addPixmap(proxy()->standardPixmap(SP_DirLinkIcon, option, widget)); - pixmap = d->findIcon(16, QLatin1String("gnome-fs-directory.png")); - if (!pixmap.isNull()) { - QPainter painter(&pixmap); - painter.drawPixmap(8, 8, 8, 8, link); - painter.end(); - icon.addPixmap(pixmap); - } - } - break; - } - case SP_FileIcon: - { - icon = d->createIcon(QLatin1String("unknown.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("gnome-fs-regular.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("stock_new.png")); - break; - } - case SP_DialogCloseButton: - { - icon = d->createIcon(QLatin1String("gtk-close.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("stock-close.png")); - break; - } - case SP_DirHomeIcon: - { - icon = d->createIcon(QLatin1String("folder_home.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("gnome_home.png")); - break; - } - case SP_DriveFDIcon: - { - icon = d->createIcon(QLatin1String("gnome-dev-floppy.png")); - break; - } - case SP_ComputerIcon: - { - icon = d->createIcon(QLatin1String("gnome-fs-client.png")); - break; - } - case SP_DesktopIcon: - { - icon = d->createIcon(QLatin1String("gnome-fs-desktop.png")); - break; - } - case SP_TrashIcon: - { - icon = d->createIcon(QLatin1String("gnome-fs-trash-empty.png")); - break; - } - case SP_DriveCDIcon: - case SP_DriveDVDIcon: - { - icon = d->createIcon(QLatin1String("gnome-dev-cdrom.png")); - break; - } - case SP_DriveHDIcon: - { - icon = d->createIcon(QLatin1String("gnome-dev-harddisk.png")); - break; - } - case SP_ArrowUp: - { - icon = d->createIcon(QLatin1String("stock_up.png")); - break; - } - case SP_ArrowDown: - { - icon = d->createIcon(QLatin1String("stock_down.png")); - break; - } - case SP_ArrowRight: - { - icon = d->createIcon(QLatin1String("stock_right.png")); - break; - } - case SP_ArrowLeft: - { - icon = d->createIcon(QLatin1String("stock_left.png")); - break; - } - case SP_BrowserReload: - { - icon = d->createIcon(QLatin1String("view-refresh.png")); - break; - } - case SP_BrowserStop: - { - pixmap = d->findIcon(24, QLatin1String("stop.png")); - break; - } - case SP_FileLinkIcon: - { - icon = QIcon(proxy()->standardPixmap(standardIcon, option, widget)); - QPixmap link = d->findIcon(12, QLatin1String("emblem-symbolic-link.png")); - if (!link.isNull()) { - icon.addPixmap(proxy()->standardPixmap(SP_FileLinkIcon,option, widget)); - pixmap = d->findIcon(16, QLatin1String("unknown.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("stock_new.png")); - if (!pixmap.isNull()) { - QPainter painter(&pixmap); - painter.drawPixmap(8, 8, 8, 8, link); - painter.end(); - icon.addPixmap(pixmap); - } - } - break; - } - case SP_ArrowForward: - if (QApplication::layoutDirection() == Qt::RightToLeft) - return standardIconImplementation(SP_ArrowLeft, option, widget); - return standardIconImplementation(SP_ArrowRight, option, widget); - case SP_ArrowBack: - if (QApplication::layoutDirection() == Qt::RightToLeft) - return standardIconImplementation(SP_ArrowRight, option, widget); - return standardIconImplementation(SP_ArrowLeft, option, widget); - default: - icon = QIcon(proxy()->standardPixmap(standardIcon, option, widget)); - } - if (!icon.isNull()) - return icon; -#endif // Q_WS_X11 return QWindowsStyle::standardIconImplementation(standardIcon, option, widget); } @@ -4589,341 +4361,10 @@ QIcon QCleanlooksStyle::standardIconImplementation(StandardPixmap standardIcon, QPixmap QCleanlooksStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const { -#ifdef Q_WS_X11 - Q_D(const QCleanlooksStyle); QPixmap pixmap; - if (!QApplication::desktopSettingsAware()) - return QWindowsStyle::standardPixmap(standardPixmap, opt, widget); - d->lookupIconTheme(); + #ifndef QT_NO_IMAGEFORMAT_XPM switch (standardPixmap) { - case SP_MessageBoxInformation: - { - pixmap = d->findIcon(48, QLatin1String("dialog-info.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(48, QLatin1String("stock_dialog-info.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MessageBoxWarning: - { - pixmap = d->findIcon(48, QLatin1String("dialog-warning.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(48, QLatin1String("stock_dialog-warning.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MessageBoxCritical: - { - pixmap = d->findIcon(48, QLatin1String("dialog-error.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(48, QLatin1String("stock_dialog-error.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MessageBoxQuestion: - { - pixmap = d->findIcon(48, QLatin1String("dialog-question.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DirHomeIcon: - { - pixmap = d->findIcon(16, QLatin1String("folder_home.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("gnome_home.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DialogOpenButton: - case SP_DirOpenIcon: - { - pixmap = d->findIcon(24, QLatin1String("stock_open.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_FileIcon: - { - pixmap = d->findIcon(24, QLatin1String("unknown.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(24, QLatin1String("gnome-fs-regular.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(24, QLatin1String("stock_new.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_FileLinkIcon: - { - pixmap = d->findIcon(24, QLatin1String("emblem-symbolic-link.png")); - if (!pixmap.isNull()) { - QPixmap fileIcon = d->findIcon(24, QLatin1String("unknown.png")); - if (fileIcon.isNull()) - fileIcon = d->findIcon(24, QLatin1String("stock_new.png")); - if (!fileIcon.isNull()) { - QPainter painter(&fileIcon); - painter.setRenderHint(QPainter::SmoothPixmapTransform); - painter.drawPixmap(12, 12, 12, 12, pixmap); - return fileIcon; - } - } - break; - } - case SP_DirClosedIcon: - case SP_DirIcon: - { - pixmap = d->findIcon(24, QLatin1String("gnome-fs-directory.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DirLinkIcon: - { - pixmap = d->findIcon(24, QLatin1String("emblem-symbolic-link.png")); - if (!pixmap.isNull()) { - QPixmap dirIcon = d->findIcon(24, QLatin1String("gnome-fs-directory.png")); - if (!dirIcon.isNull()) { - QPainter painter(&dirIcon); - painter.setRenderHint(QPainter::SmoothPixmapTransform); - painter.drawPixmap(12, 12, 12, 12, pixmap); - return dirIcon; - } - } - break; - } - case SP_DriveFDIcon: - { - pixmap = d->findIcon(24, QLatin1String("gnome-dev-floppy.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_ComputerIcon: - { - pixmap = d->findIcon(24, QLatin1String("gnome-fs-client.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DesktopIcon: - { - pixmap = d->findIcon(24, QLatin1String("gnome-fs-desktop.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_TrashIcon: - { - pixmap = d->findIcon(24, QLatin1String("gnome-fs-trash-empty.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DriveCDIcon: - case SP_DriveDVDIcon: - { - pixmap = d->findIcon(24, QLatin1String("gnome-dev-cdrom.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DriveHDIcon: - { - pixmap = d->findIcon(24, QLatin1String("gnome-dev-harddisk.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_FileDialogToParent: - { - pixmap = d->findIcon(16, QLatin1String("stock_up.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_FileDialogNewFolder: - { - pixmap = d->findIcon(16, QLatin1String("stock_new-dir.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_ArrowUp: - { - pixmap = d->findIcon(16, QLatin1String("stock_up.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_ArrowDown: - { - pixmap = d->findIcon(16, QLatin1String("stock_down.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_ArrowRight: - { - pixmap = d->findIcon(16, QLatin1String("stock_right.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_ArrowLeft: - { - pixmap = d->findIcon(16, QLatin1String("stock_left.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DialogCloseButton: - { - pixmap = d->findIcon(24, QLatin1String("gtk-close.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(24, QLatin1String("stock-close.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DialogApplyButton: - { - pixmap = d->findIcon(24, QLatin1String("dialog-apply.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(24, QLatin1String("stock-apply.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DialogResetButton: - { - pixmap = d->findIcon(24, QLatin1String("gtk-clear.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DialogHelpButton: - { - pixmap = d->findIcon(24, QLatin1String("gtk-help.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DialogOkButton: - { - pixmap = d->findIcon(24, QLatin1String("dialog-ok.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(24, QLatin1String("stock-ok.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DialogCancelButton: - { - pixmap = d->findIcon(24, QLatin1String("dialog-cancel.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(24, QLatin1String("stock-cancel.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(24, QLatin1String("process-stop.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_DialogSaveButton: - { - pixmap = d->findIcon(24, QLatin1String("stock_save.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_BrowserStop: - { - pixmap = d->findIcon(16, QLatin1String("process-stop.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_BrowserReload: - { - pixmap = d->findIcon(16, QLatin1String("view-refresh.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaPlay: - { - pixmap = d->findIcon(24, QLatin1String("media-playback-start.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaPause: - { - pixmap = d->findIcon(24, QLatin1String("media-playback-pause.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaStop: - { - pixmap = d->findIcon(24, QLatin1String("media-playback-stop.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaVolume: - { - pixmap = d->findIcon(16, QLatin1String("audio-volume-medium.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaVolumeMuted: - { - pixmap = d->findIcon(16, QLatin1String("audio-volume-muted.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaSeekForward: - { - pixmap = d->findIcon(24, QLatin1String("media-seek-forward.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaSeekBackward: - { - pixmap = d->findIcon(24, QLatin1String("media-seek-backward.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaSkipForward: - { - pixmap = d->findIcon(24, QLatin1String("media-skip-forward.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_MediaSkipBackward: - { - pixmap = d->findIcon(24, QLatin1String("media-skip-backward.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_TitleBarMenuButton: - case SP_TitleBarShadeButton: - case SP_TitleBarUnshadeButton: - case SP_TitleBarMaxButton: - case SP_TitleBarContextHelpButton: - return QWindowsStyle::standardPixmap(standardPixmap, opt, widget); case SP_TitleBarNormalButton: return QPixmap((const char **)dock_widget_restore_xpm); case SP_TitleBarMinButton: @@ -4936,7 +4377,7 @@ QPixmap QCleanlooksStyle::standardPixmap(StandardPixmap standardPixmap, const QS break; } #endif //QT_NO_IMAGEFORMAT_XPM -#endif //Q_WS_X11 + return QWindowsStyle::standardPixmap(standardPixmap, opt, widget); } diff --git a/src/gui/styles/qcleanlooksstyle_p.h b/src/gui/styles/qcleanlooksstyle_p.h index a26d40d..d325499 100644 --- a/src/gui/styles/qcleanlooksstyle_p.h +++ b/src/gui/styles/qcleanlooksstyle_p.h @@ -71,8 +71,6 @@ public: ~QCleanlooksStylePrivate() { } - - void lookupIconTheme() const; }; QT_END_NAMESPACE diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index c7feb25..3878856 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -840,176 +840,8 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut #endif // QT_NO_TOOLBUTTON - #ifdef Q_WS_X11 // These functions are used to parse the X11 freedesktop icon spec -void QCommonStylePrivate::lookupIconTheme() const -{ - if (!themeName.isEmpty()) - return; - - QString dataDirs = QString::fromLocal8Bit(getenv("XDG_DATA_DIRS")); - if (dataDirs.isEmpty()) - dataDirs = QLatin1String("/usr/local/share/:/usr/share/"); - dataDirs += QLatin1Char(':') + QKde::kdeHome() + QLatin1String("/share"); - dataDirs.prepend(QDir::homePath() + QLatin1String("/:")); - QStringList kdeDirs = QString::fromLocal8Bit(getenv("KDEDIRS")).split(QLatin1Char(':'), QString::SkipEmptyParts); - foreach (const QString &dirName, kdeDirs) - dataDirs.append(QLatin1Char(':') + dirName + QLatin1String("/share")); - iconDirs = dataDirs.split(QLatin1Char(':')); - - QFileInfo fileInfo(QLatin1String("/usr/share/icons/default.kde")); - QDir dir(fileInfo.canonicalFilePath()); - QString kdeDefault = (X11->desktopEnvironment != DE_KDE || X11->desktopVersion >= 4) - ? QString::fromLatin1("oxygen") : QString::fromLatin1("crystalsvg"); - QString defaultTheme = fileInfo.exists() ? dir.dirName() : kdeDefault; - QSettings settings(QKde::kdeHome() + - QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat); - settings.beginGroup(QLatin1String("Icons")); - themeName = settings.value(QLatin1String("Theme"), defaultTheme).toString(); -} - -QIconTheme QCommonStylePrivate::parseIndexFile(const QString &themeName) const -{ - Q_Q(const QCommonStyle); - QIconTheme theme; - QFile themeIndex; - QStringList parents; - QHash dirList; - - for ( int i = 0 ; i < iconDirs.size() && !themeIndex.exists() ; ++i) { - QString contentDir = QLatin1String(iconDirs[i].startsWith(QDir::homePath()) ? - "/.icons/" : "/icons/"); - themeIndex.setFileName(iconDirs[i] + contentDir + - themeName + QLatin1String("/index.theme")); - } - - if (themeIndex.open(QIODevice::ReadOnly | QIODevice::Text)) { - - QTextStream in(&themeIndex); - - while (!in.atEnd()) { - - QString line = in.readLine(); - - if (line.startsWith(QLatin1String("Inherits="))) { - line = line.right(line.length() - 9); - parents = line.split(QLatin1Char(',')); - } - - if (line.startsWith(QLatin1Char('['))) { - line = line.trimmed(); - line.chop(1); - QString dirName = line.right(line.length() - 1); - if (!in.atEnd()) { - line = in.readLine(); - int size; - if (line.startsWith(QLatin1String("Size="))) { - size = line.right(line.length() - 5).toInt(); - if (size) - dirList.insertMulti(size, dirName); - } - } - } - } - } - - if (q->inherits("QPlastiqueStyle")) { - QFileInfo fileInfo(QLatin1String("/usr/share/icons/default.kde")); - QDir dir(fileInfo.canonicalFilePath()); - QString defaultKDETheme = dir.exists() ? dir.dirName() : QString::fromLatin1("crystalsvg"); - if (!parents.contains(defaultKDETheme) && themeName != defaultKDETheme) - parents.append(defaultKDETheme); - } else if (parents.isEmpty() && themeName != QLatin1String("hicolor")) { - parents.append(QLatin1String("hicolor")); - } - theme = QIconTheme(dirList, parents); - return theme; -} - -QPixmap QCommonStylePrivate::findIconHelper(int size, - const QString &themeName, - const QString &iconName, - QStringList &visited) const -{ - QPixmap pixmap; - - if (!themeName.isEmpty()) { - - visited << themeName; - QIconTheme theme = themeList.value(themeName); - - if (!theme.isValid()) { - theme = parseIndexFile(themeName); - themeList.insert(themeName, theme); - } - - if (!theme.isValid()) - return QPixmap(); - - QList subDirs = theme.dirList().values(size); - - for ( int i = 0 ; i < iconDirs.size() ; ++i) { - for ( int j = 0 ; j < subDirs.size() ; ++j) { - QString contentDir = (iconDirs[i].startsWith(QDir::homePath())) ? - QLatin1String("/.icons/") : QLatin1String("/icons/"); - QString fileName = iconDirs[i] + contentDir + themeName + QLatin1Char('/') + subDirs[j] + QLatin1Char('/') + iconName; - QFile file(fileName); - if (file.exists()) - pixmap.load(fileName); - if (!pixmap.isNull()) - break; - } - } - - if (pixmap.isNull()) { - QStringList parents = theme.parents(); - //search recursively through inherited themes - for (int i = 0 ; pixmap.isNull() && i < parents.size() ; ++i) { - QString parentTheme = parents[i].trimmed(); - if (!visited.contains(parentTheme)) //guard against endless recursion - pixmap = findIconHelper(size, parentTheme, iconName, visited); - } - } - } - return pixmap; -} - -/*! \internal - find a pixmap with the given size and name from the freedesktop theme. -*/ -QPixmap QCommonStylePrivate::findIcon(int size, const QString &name) const -{ - QIcon icon = QKde::kdeIcon(name); - if (!icon.isNull()) - return icon.pixmap(size); - - QPixmap pixmap; - QString pixmapName = QLatin1String("$qt") + name + QString::number(size); - - if (QPixmapCache::find(pixmapName, pixmap)) - return pixmap; - - if (!themeName.isEmpty()) { - QStringList visited; - pixmap = findIconHelper(size, themeName, name, visited); - } - QPixmapCache::insert(pixmapName, pixmap); - return pixmap; -} -/*! \internal - create an Icon from the freedesktop theme. - */ -QIcon QCommonStylePrivate::createIcon(const QString &name) const -{ - QIcon icon = QKde::kdeIcon(name); - if (icon.isNull()) { - icon.addPixmap(findIcon(16, name)); - icon.addPixmap(findIcon(24, name)); - icon.addPixmap(findIcon(32, name)); - } - return icon; -} /*!internal Checks if you are running KDE and looks up the toolbar @@ -4859,8 +4691,24 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid ret = int(QStyleHelper::dpiScaled(6.)); break; - case PM_TabBarIconSize: case PM_ToolBarIconSize: +#ifdef Q_WS_X11 + if (X11->desktopVersion >= 4) { + static int iconSize = 0; + if (!iconSize) { + QSettings settings(QKde::kdeHome() + + QLatin1String("/share/config/kdeglobals"), + QSettings::IniFormat); + settings.beginGroup(QLatin1String("ToolbarIcons")); + iconSize = settings.value(QLatin1String("Size"), QLatin1String("22")).toInt(); + } + ret = iconSize; + } else +#endif + ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); + break; + + case PM_TabBarIconSize: case PM_ListViewIconSize: ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); break; @@ -5371,293 +5219,161 @@ QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *opti Q_UNUSED(widget); Q_UNUSED(sp); #else -#ifdef Q_WS_X11 - Q_D(const QCommonStyle); QPixmap pixmap; - if (QApplication::desktopSettingsAware()) { - d->lookupIconTheme(); + + if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { switch (sp) { case SP_DirHomeIcon: - { - pixmap = d->findIcon(16, QLatin1String("folder_home.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } + pixmap = QIcon::fromTheme(QLatin1String("user-home")).pixmap(16); + break; case SP_MessageBoxInformation: - { - pixmap = d->findIcon(32, QLatin1String("messagebox_info.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } + pixmap = QIcon::fromTheme(QLatin1String("messagebox_info")).pixmap(16); + break; case SP_MessageBoxWarning: - { - pixmap = d->findIcon(32, QLatin1String("messagebox_warning.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } + pixmap = QIcon::fromTheme(QLatin1String("messagebox_warning")).pixmap(16); + break; case SP_MessageBoxCritical: - { - pixmap = d->findIcon(32, QLatin1String("messagebox_critical.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } + pixmap = QIcon::fromTheme(QLatin1String("messagebox_critical")).pixmap(16); + break; case SP_MessageBoxQuestion: - { - pixmap = d->findIcon(32, QLatin1String("help.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } + pixmap = QIcon::fromTheme(QLatin1String("help")).pixmap(16); + break; case SP_DialogOpenButton: case SP_DirOpenIcon: - { - pixmap = d->findIcon(16, QLatin1String("folder-open.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("folder_open.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } + pixmap = QIcon::fromTheme(QLatin1String("folder-open")).pixmap(16); + break; case SP_FileIcon: - { - pixmap = d->findIcon(16, QLatin1String("text-x-generic.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("empty.png")); - if (!pixmap.isNull()) - return pixmap; - break; - } - case SP_FileLinkIcon: - { - pixmap = d->findIcon(16, QLatin1String("link_overlay.png")); - if (!pixmap.isNull()) { - QPixmap fileIcon = d->findIcon(16, QLatin1String("text-x-generic.png")); - if (fileIcon.isNull()) - fileIcon = d->findIcon(16, QLatin1String("empty.png")); - if (!fileIcon.isNull()) { - QPainter painter(&fileIcon); - painter.drawPixmap(0, 0, 16, 16, pixmap); - return fileIcon; - } - } - break; - } + pixmap = QIcon::fromTheme(QLatin1String("text-x-generic"), + QIcon::fromTheme(QLatin1String("empty"))).pixmap(16); + break; case SP_DirClosedIcon: case SP_DirIcon: - { - pixmap = d->findIcon(16, QLatin1String("folder.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("folder")).pixmap(16); break; - } - case SP_DirLinkIcon: - { - pixmap = d->findIcon(16, QLatin1String("link_overlay.png")); - if (!pixmap.isNull()) { - QPixmap dirIcon = d->findIcon(16, QLatin1String("folder.png")); - if (!dirIcon.isNull()) { - QPainter painter(&dirIcon); - painter.drawPixmap(0, 0, 16, 16, pixmap); - return dirIcon; - } - } - break; - } case SP_DriveFDIcon: - { - pixmap = d->findIcon(16, QLatin1String("media-floppy.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("3floppy_unmount.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-floppy"), + QIcon::fromTheme(QLatin1String("3floppy_unmount"))).pixmap(16); break; - } case SP_ComputerIcon: - { - pixmap = d->findIcon(16, QLatin1String("computer.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("system.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("computer"), + QIcon::fromTheme(QLatin1String("system"))).pixmap(16); break; - } case SP_DesktopIcon: - { - pixmap = d->findIcon(16, QLatin1String("user-desktop.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("desktop.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("user-desktop"), + QIcon::fromTheme(QLatin1String("desktop"))).pixmap(16); break; - } case SP_TrashIcon: - { - pixmap = d->findIcon(16, QLatin1String("user-trash.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("trashcan_empty.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("user-trash"), + QIcon::fromTheme(QLatin1String("trashcan_empty"))).pixmap(16); break; - } case SP_DriveCDIcon: case SP_DriveDVDIcon: - { - pixmap = d->findIcon(16, QLatin1String("media-optical.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("cdrom_unmount.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-optical"), + QIcon::fromTheme(QLatin1String("cdrom_unmount"))).pixmap(16); break; - } case SP_DriveHDIcon: - { - pixmap = d->findIcon(16, QLatin1String("drive-harddisk.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(16, QLatin1String("hdd_unmount.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("drive-harddisk"), + QIcon::fromTheme(QLatin1String("hdd_unmount"))).pixmap(16); break; - } case SP_FileDialogToParent: - { - pixmap = d->findIcon(32, QLatin1String("go-up.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(32, QLatin1String("up.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("go-up"), + QIcon::fromTheme(QLatin1String("up"))).pixmap(16); break; - } case SP_FileDialogNewFolder: - { - pixmap = d->findIcon(16, QLatin1String("folder_new.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("folder_new")).pixmap(16); break; - } case SP_ArrowUp: - { - pixmap = d->findIcon(32, QLatin1String("go-up.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(32, QLatin1String("up.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("go-up"), + QIcon::fromTheme(QLatin1String("up"))).pixmap(16); break; - } case SP_ArrowDown: - { - pixmap = d->findIcon(32, QLatin1String("go-down.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(32, QLatin1String("down.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("go-down"), + QIcon::fromTheme(QLatin1String("down"))).pixmap(16); break; - } case SP_ArrowRight: - { - pixmap = d->findIcon(32, QLatin1String("go-next.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(32, QLatin1String("forward.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("go-next"), + QIcon::fromTheme(QLatin1String("forward"))).pixmap(16); break; - } case SP_ArrowLeft: - { - pixmap = d->findIcon(32, QLatin1String("go-previous.png")); - if (pixmap.isNull()) - pixmap = d->findIcon(32, QLatin1String("back.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("go-previous"), + QIcon::fromTheme(QLatin1String("back"))).pixmap(16); break; - } case SP_FileDialogDetailedView: - { - pixmap = d->findIcon(16, QLatin1String("view_detailed.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("view_detailed")).pixmap(16); break; - } - case SP_FileDialogListView: - { - pixmap = d->findIcon(16, QLatin1String("view_icon.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("view_icon")).pixmap(16); break; - } case SP_BrowserReload: - { - pixmap = d->findIcon(32, QLatin1String("reload.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("reload")).pixmap(16); break; - } case SP_BrowserStop: - { - pixmap = d->findIcon(32, QLatin1String("stop.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("process-stop")).pixmap(16); break; - } case SP_MediaPlay: - { - pixmap = d->findIcon(16, QLatin1String("player_play.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-playback-start")).pixmap(16); break; - } case SP_MediaPause: - { - pixmap = d->findIcon(16, QLatin1String("player_pause.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-playback-pause")).pixmap(16); break; - } case SP_MediaStop: - { - pixmap = d->findIcon(16, QLatin1String("player_stop.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-playback-stop")).pixmap(16); break; - } case SP_MediaSeekForward: - { - pixmap = d->findIcon(16, QLatin1String("player_fwd.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-seek-forward")).pixmap(16); break; - } case SP_MediaSeekBackward: - { - pixmap = d->findIcon(16, QLatin1String("player_rew.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-seek-backward")).pixmap(16); break; - } case SP_MediaSkipForward: - { - pixmap = d->findIcon(16, QLatin1String("player_end.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-skip-backward")).pixmap(16); break; - } case SP_MediaSkipBackward: - { - pixmap = d->findIcon(16, QLatin1String("player_start.png")); - if (!pixmap.isNull()) - return pixmap; + pixmap = QIcon::fromTheme(QLatin1String("media-skip-backward")).pixmap(16); + break; + case SP_DialogResetButton: + pixmap = QIcon::fromTheme(QLatin1String("edit-clear")).pixmap(24); + break; + case SP_DialogHelpButton: + pixmap = QIcon::fromTheme(QLatin1String("help-contents")).pixmap(24); + break; + case SP_DialogCancelButton: + pixmap = QIcon::fromTheme(QLatin1String("process-stop")).pixmap(24); + break; + case SP_DialogSaveButton: + pixmap = QIcon::fromTheme(QLatin1String("document-save")).pixmap(24); break; + case SP_FileLinkIcon: + pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); + if (!pixmap.isNull()) { + QPixmap fileIcon = QIcon::fromTheme(QLatin1String("text-x-generic")).pixmap(16); + if (fileIcon.isNull()) + fileIcon = QIcon::fromTheme(QLatin1String("empty")).pixmap(16); + if (!fileIcon.isNull()) { + QPainter painter(&fileIcon); + painter.drawPixmap(0, 0, 16, 16, pixmap); + return fileIcon; + } } - + break; + case SP_DirLinkIcon: + pixmap = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")).pixmap(16); + if (!pixmap.isNull()) { + QPixmap dirIcon = QIcon::fromTheme(QLatin1String("folder")).pixmap(16); + if (!dirIcon.isNull()) { + QPainter painter(&dirIcon); + painter.drawPixmap(0, 0, 16, 16, pixmap); + return dirIcon; + } + } + break; default: break; } } -#endif //Q_WS_X11 + + if (!pixmap.isNull()) + return pixmap; #endif //QT_NO_IMAGEFORMAT_PNG switch (sp) { #ifndef QT_NO_IMAGEFORMAT_XPM @@ -5793,254 +5509,178 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons const QWidget *widget) const { QIcon icon; - if (QApplication::desktopSettingsAware()) { -#ifdef Q_WS_X11 - Q_D(const QCommonStyle); - d->lookupIconTheme(); - QPixmap pixmap; + if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) { switch (standardIcon) { case SP_DirHomeIcon: - { - icon = d->createIcon(QLatin1String("folder_home.png")); + icon = QIcon::fromTheme(QLatin1String("user-home")); break; - } case SP_MessageBoxInformation: - { - icon = d->createIcon(QLatin1String("dialog-information.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("messagebox_info.png")); + icon = QIcon::fromTheme(QLatin1String("dialog-information")); break; - } case SP_MessageBoxWarning: - { - icon = d->createIcon(QLatin1String("dialog-warning.png")); - icon = d->createIcon(QLatin1String("dialog-warning.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("messagebox_warning.png")); + icon = QIcon::fromTheme(QLatin1String("dialog-warning")); break; - } case SP_MessageBoxCritical: - { - icon = d->createIcon(QLatin1String("dialog-error.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("messagebox_critical.png")); + icon = QIcon::fromTheme(QLatin1String("dialog-error")); break; - } case SP_MessageBoxQuestion: - { - icon = d->createIcon(QLatin1String("help.png")); + icon = QIcon::fromTheme(QLatin1String("dialog-question")); break; - } case SP_DialogOpenButton: case SP_DirOpenIcon: - { - icon = d->createIcon(QLatin1String("folder-open.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("folder_open.png")); + icon = QIcon::fromTheme(QLatin1String("folder-open")); break; - } case SP_FileIcon: - { - icon = d->createIcon(QLatin1String("text-x-generic.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("empty.png")); + icon = QIcon::fromTheme(QLatin1String("text-x-generic")); break; - } case SP_DirClosedIcon: case SP_DirIcon: - { - icon = d->createIcon(QLatin1String("folder.png")); + icon = QIcon::fromTheme(QLatin1String("folder")); break; - } case SP_DriveFDIcon: - { - icon = d->createIcon(QLatin1String("floppy_unmount.png")); + icon = QIcon::fromTheme(QLatin1String("floppy_unmount")); break; - } case SP_ComputerIcon: - { - icon = d->createIcon(QLatin1String("computer.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("system.png")); + icon = QIcon::fromTheme(QLatin1String("computer"), + QIcon::fromTheme(QLatin1String("system"))); break; - } case SP_DesktopIcon: - { - icon = d->createIcon(QLatin1String("user-desktop.png")); + icon = QIcon::fromTheme(QLatin1String("user-desktop")); break; - } case SP_TrashIcon: - { - icon = d->createIcon(QLatin1String("user-trash.png")); + icon = QIcon::fromTheme(QLatin1String("user-trash")); break; - } case SP_DriveCDIcon: case SP_DriveDVDIcon: - { - icon = d->createIcon(QLatin1String("media-optical.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("cdrom_unmount.png")); + icon = QIcon::fromTheme(QLatin1String("media-optical")); break; - } case SP_DriveHDIcon: - { - icon = d->createIcon(QLatin1String("drive-harddisk.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("hdd_unmount.png")); + icon = QIcon::fromTheme(QLatin1String("drive-harddisk")); break; - } case SP_FileDialogToParent: - { - icon = d->createIcon(QLatin1String("go-up.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("up.png")); + icon = QIcon::fromTheme(QLatin1String("go-up")); break; - } case SP_FileDialogNewFolder: - { - icon = d->createIcon(QLatin1String("folder_new.png")); + icon = QIcon::fromTheme(QLatin1String("folder-new")); break; - } case SP_ArrowUp: - { - icon = d->createIcon(QLatin1String("go-up.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("up.png")); + icon = QIcon::fromTheme(QLatin1String("go-up")); break; - } case SP_ArrowDown: - { - icon = d->createIcon(QLatin1String("go-down.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("down.png")); + icon = QIcon::fromTheme(QLatin1String("go-down")); break; - } case SP_ArrowRight: - { - icon = d->createIcon(QLatin1String("go-next.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("forward.png")); + icon = QIcon::fromTheme(QLatin1String("go-next")); break; - } case SP_ArrowLeft: - { - icon = d->createIcon(QLatin1String("go-previous.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("back.png")); + icon = QIcon::fromTheme(QLatin1String("go-previous")); + break; + case SP_DialogHelpButton: + icon = QIcon::fromTheme(QLatin1String("help-contents")); + break; + case SP_DialogCancelButton: + icon = QIcon::fromTheme(QLatin1String("process-stop")); + break; + case SP_DialogCloseButton: + icon = QIcon::fromTheme(QLatin1String("window-close")); + break; + case SP_DialogApplyButton: + icon = QIcon::fromTheme(QLatin1String("dialog-ok-apply")); + break; + case SP_DialogOkButton: + icon = QIcon::fromTheme(QLatin1String("dialog-ok")); break; - } case SP_FileDialogDetailedView: - { - icon = d->createIcon(QLatin1String("view-list-details.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("view_detailed.png")); + icon = QIcon::fromTheme(QLatin1String("view-list-details")); break; - } case SP_FileDialogListView: - { - icon = d->createIcon(QLatin1String("view-list-icons.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("view_icon.png")); + icon = QIcon::fromTheme(QLatin1String("view-list-icons")); break; - } case SP_BrowserReload: - { - icon = d->createIcon(QLatin1String("view-refresh.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("reload.png")); + icon = QIcon::fromTheme(QLatin1String("view-refresh")); break; - } case SP_BrowserStop: - { - icon = d->createIcon(QLatin1String("process-stop.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("stop.png")); + icon = QIcon::fromTheme(QLatin1String("process-stop")); break; - } case SP_MediaPlay: - { - icon = d->createIcon(QLatin1String("media-playback-start.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("player_play.png")); + icon = QIcon::fromTheme(QLatin1String("media-playback-start")); break; - } case SP_MediaPause: - { - icon = d->createIcon(QLatin1String("media-playback-pause.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("player_pause.png")); + icon = QIcon::fromTheme(QLatin1String("media-playback-pause")); break; - } case SP_MediaStop: - { - icon = d->createIcon(QLatin1String("media-playback-stop.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("player_stop.png")); + icon = QIcon::fromTheme(QLatin1String("media-playback-stop")); break; - } case SP_MediaSeekForward: - { - icon = d->createIcon(QLatin1String("media-skip-forward.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("player_fwd.png")); + icon = QIcon::fromTheme(QLatin1String("media-seek-forward")); break; - } case SP_MediaSeekBackward: - { - icon = d->createIcon(QLatin1String("media-skip-backward.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("player_rew.png")); + icon = QIcon::fromTheme(QLatin1String("media-seek-backward")); break; - } case SP_MediaSkipForward: - { - icon = d->createIcon(QLatin1String("media-skip-forward.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("player_end.png")); + icon = QIcon::fromTheme(QLatin1String("media-skip-forward")); break; - } case SP_MediaSkipBackward: - { - icon = d->createIcon(QLatin1String("media-skip-backward.png")); - if (icon.isNull()) - icon = d->createIcon(QLatin1String("player_start.png")); + icon = QIcon::fromTheme(QLatin1String("media-skip-backward")); break; - } - - case SP_FileLinkIcon: { - icon = QIcon(proxy()->standardPixmap(standardIcon, option, widget)); - QPixmap pixmap = d->findIcon(32, QLatin1String("link_overlay.png")); - if (!pixmap.isNull()) { - QPixmap fileIcon = d->findIcon(32, QLatin1String("text-x-generic.png")); - if (fileIcon.isNull()) - fileIcon = d->findIcon(32, QLatin1String("empty.png")); - if (!fileIcon.isNull()) { - QPainter painter(&fileIcon); - painter.drawPixmap(0, 0, 32, 32, pixmap); - icon.addPixmap(fileIcon); + case SP_MediaVolume: + icon = QIcon::fromTheme(QLatin1String("audio-volume-medium")); + break; + case SP_MediaVolumeMuted: + icon = QIcon::fromTheme(QLatin1String("audio-volume-muted")); + break; + case SP_DialogResetButton: + icon = QIcon::fromTheme(QLatin1String("edit-clear")); + break; + case SP_ArrowForward: + if (QApplication::layoutDirection() == Qt::RightToLeft) + return standardIconImplementation(SP_ArrowLeft, option, widget); + return standardIconImplementation(SP_ArrowRight, option, widget); + case SP_ArrowBack: + if (QApplication::layoutDirection() == Qt::RightToLeft) + return standardIconImplementation(SP_ArrowRight, option, widget); + return standardIconImplementation(SP_ArrowLeft, option, widget); + case SP_FileLinkIcon: + { + QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); + if (!linkIcon.isNull()) { + QIcon baseIcon = standardIconImplementation(SP_FileIcon, option, widget); + const QList sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); + for (int i = 0 ; i < sizes.size() ; ++i) { + int size = sizes[i].width(); + QPixmap basePixmap = baseIcon.pixmap(size); + QPixmap linkPixmap = linkIcon.pixmap(size/2); + QPainter painter(&basePixmap); + painter.drawPixmap(size/2, size/2, linkPixmap); + icon.addPixmap(basePixmap); + } } } - } - break; - case SP_DirLinkIcon: { - icon = QIcon(proxy()->standardPixmap(standardIcon, option, widget)); - QPixmap pixmap = d->findIcon(32, QLatin1String("link_overlay.png")); - if (!pixmap.isNull()) { - QPixmap fileIcon = d->findIcon(32, QLatin1String("folder.png")); - if (!fileIcon.isNull()) { - QPainter painter(&fileIcon); - painter.drawPixmap(0, 0, 32, 32, pixmap); - icon.addPixmap(fileIcon); + break; + case SP_DirLinkIcon: + { + QIcon linkIcon = QIcon::fromTheme(QLatin1String("emblem-symbolic-link")); + if (!linkIcon.isNull()) { + QIcon baseIcon = standardIconImplementation(SP_DirIcon, option, widget); + const QList sizes = baseIcon.availableSizes(QIcon::Normal, QIcon::Off); + for (int i = 0 ; i < sizes.size() ; ++i) { + int size = sizes[i].width(); + QPixmap basePixmap = baseIcon.pixmap(size); + QPixmap linkPixmap = linkIcon.pixmap(size/2); + QPainter painter(&basePixmap); + painter.drawPixmap(size/2, size/2, linkPixmap); + icon.addPixmap(basePixmap); + } } - } } break; default: break; } + if (!icon.isNull()) return icon; -#elif defined(Q_WS_MAC) +#if defined(Q_WS_MAC) OSType iconType = 0; switch (standardIcon) { case QStyle::SP_MessageBoxQuestion: @@ -6131,11 +5771,9 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons ReleaseIconRef(overlayIcon); return retIcon; } - -#endif //Q_WS_X11 || Q_WS_MAC +#endif // Q_WS_MAC } - switch (standardIcon) { #ifndef QT_NO_IMAGEFORMAT_PNG case SP_FileDialogNewFolder: diff --git a/src/gui/styles/qcommonstyle_p.h b/src/gui/styles/qcommonstyle_p.h index f2af5b2..cff46e6 100644 --- a/src/gui/styles/qcommonstyle_p.h +++ b/src/gui/styles/qcommonstyle_p.h @@ -122,20 +122,7 @@ public: } #endif mutable QIcon tabBarcloseButtonIcon; - -//icon detection on X11 -#ifdef Q_WS_X11 - void lookupIconTheme() const; int lookupToolButtonStyle() const; - QIcon createIcon(const QString &) const; - QPixmap findIcon(int size, const QString &) const; - QPixmap findIconHelper(int size, const QString &, const QString &, QStringList &visited) const; - QIconTheme parseIndexFile(const QString &themeName) const; - mutable QString themeName; - mutable QStringList iconDirs; - mutable QHash themeList; -#endif - }; QT_END_NAMESPACE diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 660b4c3..f6d8c88 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -3239,6 +3239,7 @@ QSize QGtkStyle::sizeFromContents(ContentsType type, const QStyleOption *option, return newSize; } + /*! \reimp */ QPixmap QGtkStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option, const QWidget *widget) const @@ -3271,65 +3272,80 @@ QPixmap QGtkStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option, } break; - case SP_DialogDiscardButton: { + case SP_DialogDiscardButton: return QGtkPainter::getIcon(GTK_STOCK_DELETE); - } - - case SP_DialogOkButton: { + case SP_DialogOkButton: return QGtkPainter::getIcon(GTK_STOCK_OK); - } - - case SP_DialogCancelButton: { + case SP_DialogCancelButton: return QGtkPainter::getIcon(GTK_STOCK_CANCEL); - } - - case SP_DialogYesButton: { + case SP_DialogYesButton: return QGtkPainter::getIcon(GTK_STOCK_YES); - } - - case SP_DialogNoButton: { + case SP_DialogNoButton: return QGtkPainter::getIcon(GTK_STOCK_NO); - } - - case SP_DialogOpenButton: { + case SP_DialogOpenButton: return QGtkPainter::getIcon(GTK_STOCK_OPEN); - } - - case SP_DialogCloseButton: { + case SP_DialogCloseButton: return QGtkPainter::getIcon(GTK_STOCK_CLOSE); - } - - case SP_DialogApplyButton: { + case SP_DialogApplyButton: return QGtkPainter::getIcon(GTK_STOCK_APPLY); - } - - case SP_DialogSaveButton: { + case SP_DialogSaveButton: return QGtkPainter::getIcon(GTK_STOCK_SAVE); - } - - case SP_MessageBoxWarning: { + case SP_MessageBoxWarning: return QGtkPainter::getIcon(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); - } - - case SP_MessageBoxQuestion: { + case SP_MessageBoxQuestion: return QGtkPainter::getIcon(GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); - } - - case SP_MessageBoxInformation: { + case SP_MessageBoxInformation: return QGtkPainter::getIcon(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG); - } - - case SP_MessageBoxCritical: { + case SP_MessageBoxCritical: return QGtkPainter::getIcon(GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_DIALOG); - } - default: return QCleanlooksStyle::standardPixmap(sp, option, widget); } + return pixmap; +} - return QPixmap(); +/*! + \internal +*/ +QIcon QGtkStyle::standardIconImplementation(StandardPixmap standardIcon, + const QStyleOption *option, + const QWidget *widget) const +{ + if (!QGtk::isThemeAvailable()) + return QCleanlooksStyle::standardIconImplementation(standardIcon, option, widget); + switch (standardIcon) { + case SP_DialogDiscardButton: + return QGtkPainter::getIcon(GTK_STOCK_DELETE); + case SP_DialogOkButton: + return QGtkPainter::getIcon(GTK_STOCK_OK); + case SP_DialogCancelButton: + return QGtkPainter::getIcon(GTK_STOCK_CANCEL); + case SP_DialogYesButton: + return QGtkPainter::getIcon(GTK_STOCK_YES); + case SP_DialogNoButton: + return QGtkPainter::getIcon(GTK_STOCK_NO); + case SP_DialogOpenButton: + return QGtkPainter::getIcon(GTK_STOCK_OPEN); + case SP_DialogCloseButton: + return QGtkPainter::getIcon(GTK_STOCK_CLOSE); + case SP_DialogApplyButton: + return QGtkPainter::getIcon(GTK_STOCK_APPLY); + case SP_DialogSaveButton: + return QGtkPainter::getIcon(GTK_STOCK_SAVE); + case SP_MessageBoxWarning: + return QGtkPainter::getIcon(GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); + case SP_MessageBoxQuestion: + return QGtkPainter::getIcon(GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG); + case SP_MessageBoxInformation: + return QGtkPainter::getIcon(GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG); + case SP_MessageBoxCritical: + return QGtkPainter::getIcon(GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_DIALOG); + default: + return QCleanlooksStyle::standardIconImplementation(standardIcon, option, widget); + } } + /*! \reimp */ QRect QGtkStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const { diff --git a/src/gui/styles/qgtkstyle.h b/src/gui/styles/qgtkstyle.h index e12f175..f12de52 100644 --- a/src/gui/styles/qgtkstyle.h +++ b/src/gui/styles/qgtkstyle.h @@ -106,6 +106,10 @@ public: void unpolish(QWidget *widget); void unpolish(QApplication *app); + +protected Q_SLOTS: + QIcon standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, + const QWidget *widget = 0) const; }; diff --git a/tests/auto/qicon/icons/testtheme/16x16/actions/appointment-new.png b/tests/auto/qicon/icons/testtheme/16x16/actions/appointment-new.png new file mode 100644 index 0000000..18b7c67 Binary files /dev/null and b/tests/auto/qicon/icons/testtheme/16x16/actions/appointment-new.png differ diff --git a/tests/auto/qicon/icons/testtheme/22x22/actions/appointment-new.png b/tests/auto/qicon/icons/testtheme/22x22/actions/appointment-new.png new file mode 100644 index 0000000..d676ffd Binary files /dev/null and b/tests/auto/qicon/icons/testtheme/22x22/actions/appointment-new.png differ diff --git a/tests/auto/qicon/icons/testtheme/32x32/actions/appointment-new.png b/tests/auto/qicon/icons/testtheme/32x32/actions/appointment-new.png new file mode 100644 index 0000000..85daef3 Binary files /dev/null and b/tests/auto/qicon/icons/testtheme/32x32/actions/appointment-new.png differ diff --git a/tests/auto/qicon/icons/testtheme/index.theme b/tests/auto/qicon/icons/testtheme/index.theme new file mode 100644 index 0000000..e18736a --- /dev/null +++ b/tests/auto/qicon/icons/testtheme/index.theme @@ -0,0 +1,492 @@ +[Icon Theme] +_Name=Test +_Comment=Test Theme +Inherits=crystalsvg, themeparent +Example=x-directory-normal + +# KDE Specific Stuff +DisplayDepth=32 +LinkOverlay=link_overlay +LockOverlay=lock_overlay +ZipOverlay=zip_overlay +DesktopDefault=48 +DesktopSizes=16,22,32,48,64,72,96,128 +ToolbarDefault=22 +ToolbarSizes=16,22,32,48 +MainToolbarDefault=22 +MainToolbarSizes=16,22,32,48 +SmallDefault=16 +SmallSizes=16 +PanelDefault=32 +PanelSizes=16,22,32,48,64,72,96,128 + +# Directory list +Directories=16x16/actions,16x16/apps,16x16/categories,16x16/devices,16x16/emblems,16x16/emotes,16x16/mimetypes,16x16/places,16x16/status,22x22/actions,22x22/apps,22x22/categories,22x22/devices,22x22/emblems,22x22/emotes,22x22/mimetypes,22x22/places,22x22/status,24x24/actions,24x24/apps,24x24/categories,24x24/devices,24x24/emblems,24x24/emotes,24x24/mimetypes,24x24/places,24x24/status,32x32/actions,32x32/apps,32x32/categories,32x32/devices,32x32/emblems,32x32/emotes,32x32/mimetypes,32x32/places,32x32/status,48x48/actions,48x48/apps,48x48/categories,48x48/devices,48x48/emblems,48x48/emotes,48x48/mimetypes,48x48/places,48x48/status,64x64/actions,64x64/apps,64x64/categories,64x64/devices,64x64/emblems,64x64/emotes,64x64/mimetypes,64x64/places,64x64/status,72x72/actions,72x72/apps,72x72/categories,72x72/devices,72x72/emblems,72x72/emotes,72x72/mimetypes,72x72/places,72x72/status,96x96/actions,96x96/apps,96x96/categories,96x96/devices,96x96/emblems,96x96/emotes,96x96/mimetypes,96x96/places,96x96/status,128x128/actions,128x128/apps,128x128/categories,128x128/devices,128x128/emblems,128x128/emotes,128x128/mimetypes,128x128/places,128x128/status,scalable/actions,scalable/apps,scalable/categories,scalable/devices,scalable/emblems,scalable/emotes,scalable/mimetypes,scalable/places,scalable/status + +[16x16/actions] +Size=16 +Context=Actions +Type=Fixed + +[16x16/apps] +Size=16 +Context=Applications +Type=Fixed + +[16x16/categories] +Size=16 +Context=Categories +Type=Fixed + +[16x16/devices] +Size=16 +Context=Devices +Type=Fixed + +[16x16/emblems] +Size=16 +Context=Emblems +Type=Fixed + +[16x16/emotes] +Size=16 +Context=Emotes +Type=Fixed + +[16x16/mimetypes] +Size=16 +Context=MimeTypes +Type=Fixed + +[16x16/places] +Size=16 +Context=Places +Type=Fixed + +[16x16/status] +Size=16 +Context=Status +Type=Fixed + +[22x22/actions] +Size=22 +Context=Actions +Type=Fixed + +[22x22/apps] +Size=22 +Context=Applications +Type=Fixed + +[22x22/categories] +Size=22 +Context=Categories +Type=Fixed + +[22x22/devices] +Size=22 +Context=Devices +Type=Fixed + +[22x22/emblems] +Size=22 +Context=Emblems +Type=Fixed + +[22x22/emotes] +Size=22 +Context=Emotes +Type=Fixed + +[22x22/mimetypes] +Size=22 +Context=MimeTypes +Type=Fixed + +[22x22/places] +Size=22 +Context=Places +Type=Fixed + +[22x22/status] +Size=22 +Context=Status +Type=Fixed + +[24x24/actions] +Size=24 +Context=Actions +Type=Fixed + +[24x24/apps] +Size=24 +Context=Applications +Type=Fixed + +[24x24/categories] +Size=24 +Context=Categories +Type=Fixed + +[24x24/devices] +Size=24 +Context=Devices +Type=Fixed + +[24x24/emblems] +Size=24 +Context=Emblems +Type=Fixed + +[24x24/emotes] +Size=24 +Context=Emotes +Type=Fixed + +[24x24/mimetypes] +Size=24 +Context=MimeTypes +Type=Fixed + +[24x24/places] +Size=24 +Context=Places +Type=Fixed + +[24x24/status] +Size=24 +Context=Status +Type=Fixed + +[32x32/actions] +Size=32 +Context=Actions +Type=Fixed + +[32x32/apps] +Size=32 +Context=Applications +Type=Fixed + +[32x32/categories] +Size=32 +Context=Categories +Type=Fixed + +[32x32/devices] +Size=32 +Context=Devices +Type=Fixed + +[32x32/emblems] +Size=32 +Context=Emblems +Type=Fixed + +[32x32/emotes] +Size=32 +Context=Emotes +Type=Fixed + +[32x32/mimetypes] +Size=32 +Context=MimeTypes +Type=Fixed + +[32x32/places] +Size=32 +Context=Places +Type=Fixed + +[32x32/status] +Size=32 +Context=Status +Type=Fixed + +[48x48/actions] +Size=48 +Context=Actions +Type=Fixed + +[48x48/apps] +Size=48 +Context=Applications +Type=Fixed + +[48x48/categories] +Size=48 +Context=Categories +Type=Fixed + +[48x48/devices] +Size=48 +Context=Devices +Type=Fixed + +[48x48/emblems] +Size=48 +Context=Emblems +Type=Fixed + +[48x48/emotes] +Size=48 +Context=Emotes +Type=Fixed + +[48x48/mimetypes] +Size=48 +Context=MimeTypes +Type=Fixed + +[48x48/places] +Size=48 +Context=Places +Type=Fixed + +[48x48/status] +Size=48 +Context=Status +Type=Fixed + +[64x64/actions] +Size=64 +Context=Actions +Type=Fixed + +[64x64/apps] +Size=64 +Context=Applications +Type=Fixed + +[64x64/categories] +Size=64 +Context=Categories +Type=Fixed + +[64x64/devices] +Size=64 +Context=Devices +Type=Fixed + +[64x64/emblems] +Size=64 +Context=Emblems +Type=Fixed + +[64x64/emotes] +Size=64 +Context=Emotes +Type=Fixed + +[64x64/mimetypes] +Size=64 +Context=MimeTypes +Type=Fixed + +[64x64/places] +Size=64 +Context=Places +Type=Fixed + +[64x64/status] +Size=64 +Context=Status +Type=Fixed + +[72x72/actions] +Size=72 +Context=Actions +Type=Fixed + +[72x72/apps] +Size=72 +Context=Applications +Type=Fixed + +[72x72/categories] +Size=72 +Context=Categories +Type=Fixed + +[72x72/devices] +Size=72 +Context=Devices +Type=Fixed + +[72x72/emblems] +Size=72 +Context=Emblems +Type=Fixed + +[72x72/emotes] +Size=72 +Context=Emotes +Type=Fixed + +[72x72/mimetypes] +Size=72 +Context=MimeTypes +Type=Fixed + +[72x72/places] +Size=72 +Context=Places +Type=Fixed + +[72x72/status] +Size=72 +Context=Status +Type=Fixed + +[96x96/actions] +Size=96 +Context=Actions +Type=Fixed + +[96x96/apps] +Size=96 +Context=Applications +Type=Fixed + +[96x96/categories] +Size=96 +Context=Categories +Type=Fixed + +[96x96/devices] +Size=96 +Context=Devices +Type=Fixed + +[96x96/emblems] +Size=96 +Context=Emblems +Type=Fixed + +[96x96/emotes] +Size=96 +Context=Emotes +Type=Fixed + +[96x96/mimetypes] +Size=96 +Context=MimeTypes +Type=Fixed + +[96x96/places] +Size=96 +Context=Places +Type=Fixed + +[96x96/status] +Size=96 +Context=Status +Type=Fixed + +[128x128/actions] +Size=128 +Context=Actions +Type=Fixed + +[128x128/apps] +Size=128 +Context=Applications +Type=Fixed + +[128x128/categories] +Size=128 +Context=Categories +Type=Fixed + +[128x128/devices] +Size=128 +Context=Devices +Type=Fixed + +[128x128/emblems] +Size=128 +Context=Emblems +Type=Fixed + +[128x128/emotes] +Size=128 +Context=Emotes +Type=Fixed + +[128x128/mimetypes] +Size=128 +Context=MimeTypes +Type=Fixed + +[128x128/places] +Size=128 +Context=Places +Type=Fixed + +[128x128/status] +Size=128 +Context=Status +Type=Fixed + +[scalable/actions] +Size=48 +Context=Actions +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/apps] +Size=48 +Context=Applications +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/categories] +Size=48 +Context=Categories +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/devices] +Size=48 +Context=Devices +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/emblems] +Size=48 +Context=Emblems +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/emotes] +Size=48 +Context=Emotes +Type=Scalable +Minsize=32 +MaxSize=256 + +[scalable/mimetypes] +Size=48 +Context=MimeTypes +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/places] +Size=48 +Context=Places +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/status] +Size=48 +Context=Status +Type=Scalable +MinSize=32 +MaxSize=256 diff --git a/tests/auto/qicon/icons/testtheme/scalable/actions/svg-only.svg b/tests/auto/qicon/icons/testtheme/scalable/actions/svg-only.svg new file mode 100644 index 0000000..4cb14f8 --- /dev/null +++ b/tests/auto/qicon/icons/testtheme/scalable/actions/svg-only.svg @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + New Appointment + + + appointment + new + meeting + rvsp + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/qicon/icons/themeparent/16x16/actions/address-book-new.png b/tests/auto/qicon/icons/themeparent/16x16/actions/address-book-new.png new file mode 100644 index 0000000..2098cfd Binary files /dev/null and b/tests/auto/qicon/icons/themeparent/16x16/actions/address-book-new.png differ diff --git a/tests/auto/qicon/icons/themeparent/16x16/actions/appointment-new.png b/tests/auto/qicon/icons/themeparent/16x16/actions/appointment-new.png new file mode 100644 index 0000000..18b7c67 Binary files /dev/null and b/tests/auto/qicon/icons/themeparent/16x16/actions/appointment-new.png differ diff --git a/tests/auto/qicon/icons/themeparent/22x22/actions/address-book-new.png b/tests/auto/qicon/icons/themeparent/22x22/actions/address-book-new.png new file mode 100644 index 0000000..fad446c Binary files /dev/null and b/tests/auto/qicon/icons/themeparent/22x22/actions/address-book-new.png differ diff --git a/tests/auto/qicon/icons/themeparent/22x22/actions/appointment-new.png b/tests/auto/qicon/icons/themeparent/22x22/actions/appointment-new.png new file mode 100644 index 0000000..d676ffd Binary files /dev/null and b/tests/auto/qicon/icons/themeparent/22x22/actions/appointment-new.png differ diff --git a/tests/auto/qicon/icons/themeparent/32x32/actions/address-book-new.png b/tests/auto/qicon/icons/themeparent/32x32/actions/address-book-new.png new file mode 100644 index 0000000..420139d Binary files /dev/null and b/tests/auto/qicon/icons/themeparent/32x32/actions/address-book-new.png differ diff --git a/tests/auto/qicon/icons/themeparent/32x32/actions/appointment-new.png b/tests/auto/qicon/icons/themeparent/32x32/actions/appointment-new.png new file mode 100644 index 0000000..85daef3 Binary files /dev/null and b/tests/auto/qicon/icons/themeparent/32x32/actions/appointment-new.png differ diff --git a/tests/auto/qicon/icons/themeparent/index.theme b/tests/auto/qicon/icons/themeparent/index.theme new file mode 100644 index 0000000..e536a0b --- /dev/null +++ b/tests/auto/qicon/icons/themeparent/index.theme @@ -0,0 +1,492 @@ +[Icon Theme] +_Name=Test +_Comment=Test Theme +Inherits=gnome,crystalsvg +Example=x-directory-normal + +# KDE Specific Stuff +DisplayDepth=32 +LinkOverlay=link_overlay +LockOverlay=lock_overlay +ZipOverlay=zip_overlay +DesktopDefault=48 +DesktopSizes=16,22,32,48,64,72,96,128 +ToolbarDefault=22 +ToolbarSizes=16,22,32,48 +MainToolbarDefault=22 +MainToolbarSizes=16,22,32,48 +SmallDefault=16 +SmallSizes=16 +PanelDefault=32 +PanelSizes=16,22,32,48,64,72,96,128 + +# Directory list +Directories=16x16/actions,16x16/apps,16x16/categories,16x16/devices,16x16/emblems,16x16/emotes,16x16/mimetypes,16x16/places,16x16/status,22x22/actions,22x22/apps,22x22/categories,22x22/devices,22x22/emblems,22x22/emotes,22x22/mimetypes,22x22/places,22x22/status,24x24/actions,24x24/apps,24x24/categories,24x24/devices,24x24/emblems,24x24/emotes,24x24/mimetypes,24x24/places,24x24/status,32x32/actions,32x32/apps,32x32/categories,32x32/devices,32x32/emblems,32x32/emotes,32x32/mimetypes,32x32/places,32x32/status,48x48/actions,48x48/apps,48x48/categories,48x48/devices,48x48/emblems,48x48/emotes,48x48/mimetypes,48x48/places,48x48/status,64x64/actions,64x64/apps,64x64/categories,64x64/devices,64x64/emblems,64x64/emotes,64x64/mimetypes,64x64/places,64x64/status,72x72/actions,72x72/apps,72x72/categories,72x72/devices,72x72/emblems,72x72/emotes,72x72/mimetypes,72x72/places,72x72/status,96x96/actions,96x96/apps,96x96/categories,96x96/devices,96x96/emblems,96x96/emotes,96x96/mimetypes,96x96/places,96x96/status,128x128/actions,128x128/apps,128x128/categories,128x128/devices,128x128/emblems,128x128/emotes,128x128/mimetypes,128x128/places,128x128/status,scalable/actions,scalable/apps,scalable/categories,scalable/devices,scalable/emblems,scalable/emotes,scalable/mimetypes,scalable/places,scalable/status + +[16x16/actions] +Size=16 +Context=Actions +Type=Fixed + +[16x16/apps] +Size=16 +Context=Applications +Type=Fixed + +[16x16/categories] +Size=16 +Context=Categories +Type=Fixed + +[16x16/devices] +Size=16 +Context=Devices +Type=Fixed + +[16x16/emblems] +Size=16 +Context=Emblems +Type=Fixed + +[16x16/emotes] +Size=16 +Context=Emotes +Type=Fixed + +[16x16/mimetypes] +Size=16 +Context=MimeTypes +Type=Fixed + +[16x16/places] +Size=16 +Context=Places +Type=Fixed + +[16x16/status] +Size=16 +Context=Status +Type=Fixed + +[22x22/actions] +Size=22 +Context=Actions +Type=Fixed + +[22x22/apps] +Size=22 +Context=Applications +Type=Fixed + +[22x22/categories] +Size=22 +Context=Categories +Type=Fixed + +[22x22/devices] +Size=22 +Context=Devices +Type=Fixed + +[22x22/emblems] +Size=22 +Context=Emblems +Type=Fixed + +[22x22/emotes] +Size=22 +Context=Emotes +Type=Fixed + +[22x22/mimetypes] +Size=22 +Context=MimeTypes +Type=Fixed + +[22x22/places] +Size=22 +Context=Places +Type=Fixed + +[22x22/status] +Size=22 +Context=Status +Type=Fixed + +[24x24/actions] +Size=24 +Context=Actions +Type=Fixed + +[24x24/apps] +Size=24 +Context=Applications +Type=Fixed + +[24x24/categories] +Size=24 +Context=Categories +Type=Fixed + +[24x24/devices] +Size=24 +Context=Devices +Type=Fixed + +[24x24/emblems] +Size=24 +Context=Emblems +Type=Fixed + +[24x24/emotes] +Size=24 +Context=Emotes +Type=Fixed + +[24x24/mimetypes] +Size=24 +Context=MimeTypes +Type=Fixed + +[24x24/places] +Size=24 +Context=Places +Type=Fixed + +[24x24/status] +Size=24 +Context=Status +Type=Fixed + +[32x32/actions] +Size=32 +Context=Actions +Type=Fixed + +[32x32/apps] +Size=32 +Context=Applications +Type=Fixed + +[32x32/categories] +Size=32 +Context=Categories +Type=Fixed + +[32x32/devices] +Size=32 +Context=Devices +Type=Fixed + +[32x32/emblems] +Size=32 +Context=Emblems +Type=Fixed + +[32x32/emotes] +Size=32 +Context=Emotes +Type=Fixed + +[32x32/mimetypes] +Size=32 +Context=MimeTypes +Type=Fixed + +[32x32/places] +Size=32 +Context=Places +Type=Fixed + +[32x32/status] +Size=32 +Context=Status +Type=Fixed + +[48x48/actions] +Size=48 +Context=Actions +Type=Fixed + +[48x48/apps] +Size=48 +Context=Applications +Type=Fixed + +[48x48/categories] +Size=48 +Context=Categories +Type=Fixed + +[48x48/devices] +Size=48 +Context=Devices +Type=Fixed + +[48x48/emblems] +Size=48 +Context=Emblems +Type=Fixed + +[48x48/emotes] +Size=48 +Context=Emotes +Type=Fixed + +[48x48/mimetypes] +Size=48 +Context=MimeTypes +Type=Fixed + +[48x48/places] +Size=48 +Context=Places +Type=Fixed + +[48x48/status] +Size=48 +Context=Status +Type=Fixed + +[64x64/actions] +Size=64 +Context=Actions +Type=Fixed + +[64x64/apps] +Size=64 +Context=Applications +Type=Fixed + +[64x64/categories] +Size=64 +Context=Categories +Type=Fixed + +[64x64/devices] +Size=64 +Context=Devices +Type=Fixed + +[64x64/emblems] +Size=64 +Context=Emblems +Type=Fixed + +[64x64/emotes] +Size=64 +Context=Emotes +Type=Fixed + +[64x64/mimetypes] +Size=64 +Context=MimeTypes +Type=Fixed + +[64x64/places] +Size=64 +Context=Places +Type=Fixed + +[64x64/status] +Size=64 +Context=Status +Type=Fixed + +[72x72/actions] +Size=72 +Context=Actions +Type=Fixed + +[72x72/apps] +Size=72 +Context=Applications +Type=Fixed + +[72x72/categories] +Size=72 +Context=Categories +Type=Fixed + +[72x72/devices] +Size=72 +Context=Devices +Type=Fixed + +[72x72/emblems] +Size=72 +Context=Emblems +Type=Fixed + +[72x72/emotes] +Size=72 +Context=Emotes +Type=Fixed + +[72x72/mimetypes] +Size=72 +Context=MimeTypes +Type=Fixed + +[72x72/places] +Size=72 +Context=Places +Type=Fixed + +[72x72/status] +Size=72 +Context=Status +Type=Fixed + +[96x96/actions] +Size=96 +Context=Actions +Type=Fixed + +[96x96/apps] +Size=96 +Context=Applications +Type=Fixed + +[96x96/categories] +Size=96 +Context=Categories +Type=Fixed + +[96x96/devices] +Size=96 +Context=Devices +Type=Fixed + +[96x96/emblems] +Size=96 +Context=Emblems +Type=Fixed + +[96x96/emotes] +Size=96 +Context=Emotes +Type=Fixed + +[96x96/mimetypes] +Size=96 +Context=MimeTypes +Type=Fixed + +[96x96/places] +Size=96 +Context=Places +Type=Fixed + +[96x96/status] +Size=96 +Context=Status +Type=Fixed + +[128x128/actions] +Size=128 +Context=Actions +Type=Fixed + +[128x128/apps] +Size=128 +Context=Applications +Type=Fixed + +[128x128/categories] +Size=128 +Context=Categories +Type=Fixed + +[128x128/devices] +Size=128 +Context=Devices +Type=Fixed + +[128x128/emblems] +Size=128 +Context=Emblems +Type=Fixed + +[128x128/emotes] +Size=128 +Context=Emotes +Type=Fixed + +[128x128/mimetypes] +Size=128 +Context=MimeTypes +Type=Fixed + +[128x128/places] +Size=128 +Context=Places +Type=Fixed + +[128x128/status] +Size=128 +Context=Status +Type=Fixed + +[scalable/actions] +Size=48 +Context=Actions +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/apps] +Size=48 +Context=Applications +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/categories] +Size=48 +Context=Categories +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/devices] +Size=48 +Context=Devices +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/emblems] +Size=48 +Context=Emblems +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/emotes] +Size=48 +Context=Emotes +Type=Scalable +Minsize=32 +MaxSize=256 + +[scalable/mimetypes] +Size=48 +Context=MimeTypes +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/places] +Size=48 +Context=Places +Type=Scalable +MinSize=32 +MaxSize=256 + +[scalable/status] +Size=48 +Context=Status +Type=Scalable +MinSize=32 +MaxSize=256 diff --git a/tests/auto/qicon/icons/themeparent/scalable/actions/address-book-new.svg b/tests/auto/qicon/icons/themeparent/scalable/actions/address-book-new.svg new file mode 100644 index 0000000..600a82c --- /dev/null +++ b/tests/auto/qicon/icons/themeparent/scalable/actions/address-book-new.svg @@ -0,0 +1,389 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Addess Book - New + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + + address + contact + book + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/qicon/icons/themeparent/scalable/actions/appointment-new.svg b/tests/auto/qicon/icons/themeparent/scalable/actions/appointment-new.svg new file mode 100644 index 0000000..4cb14f8 --- /dev/null +++ b/tests/auto/qicon/icons/themeparent/scalable/actions/appointment-new.svg @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + Jakub Steiner + + + http://jimmac.musichall.cz + + New Appointment + + + appointment + new + meeting + rvsp + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp index a266c16..545ca09 100644 --- a/tests/auto/qicon/tst_qicon.cpp +++ b/tests/auto/qicon/tst_qicon.cpp @@ -74,6 +74,7 @@ private slots: void availableSizes(); void streamAvailableSizes_data(); void streamAvailableSizes(); + void fromTheme(); void task184901_badCache(); void task223279_inconsistentAddFile(); @@ -605,6 +606,72 @@ void tst_QIcon::task184901_badCache() QVERIFY( icon.pixmap(32, QIcon::Normal).toImage() == icon.pixmap(32, QIcon::Disabled).toImage() ); } +void tst_QIcon::fromTheme() +{ + const QString prefix = QLatin1String(SRCDIR) + QLatin1String("/"); + QString searchPath = prefix + QLatin1String("/icons"); + QIcon::setThemeSearchPaths(QStringList() << searchPath); + QVERIFY(QIcon::themeSearchPaths().size() == 1); + QCOMPARE(searchPath, QIcon::themeSearchPaths()[0]); + + QString themeName("testtheme"); + QIcon::setThemeName(themeName); + QCOMPARE(QIcon::themeName(), themeName); + + // Test normal icon + QIcon appointmentIcon = QIcon::fromTheme("appointment-new"); + QVERIFY(!appointmentIcon.isNull()); + QVERIFY(!appointmentIcon.availableSizes(QIcon::Normal, QIcon::Off).isEmpty()); + QVERIFY(appointmentIcon.availableSizes().contains(QSize(16, 16))); + QVERIFY(appointmentIcon.availableSizes().contains(QSize(32, 32))); + QVERIFY(appointmentIcon.availableSizes().contains(QSize(22, 22))); + + // Test icon from parent theme + QIcon abIcon = QIcon::fromTheme("address-book-new"); + QVERIFY(!abIcon.isNull()); + QVERIFY(QIcon::hasThemeIcon("address-book-new")); + QVERIFY(!abIcon.availableSizes().isEmpty()); + + // Test non existing icon + QIcon noIcon = QIcon::fromTheme("broken-icon"); + QVERIFY(noIcon.isNull()); + QVERIFY(!QIcon::hasThemeIcon("broken-icon")); + + // Test non existing icon with fallback + noIcon = QIcon::fromTheme("broken-icon", abIcon); + QVERIFY(noIcon.cacheKey() == abIcon.cacheKey()); + + // Test svg-only icon + noIcon = QIcon::fromTheme("svg-icon", abIcon); + QVERIFY(!noIcon.availableSizes().isEmpty()); + + QByteArray ba; + // write to QByteArray + { + QBuffer buffer(&ba); + buffer.open(QIODevice::WriteOnly); + QDataStream stream(&buffer); + stream << abIcon; + } + + // read from QByteArray + { + QBuffer buffer(&ba); + buffer.open(QIODevice::ReadOnly); + QDataStream stream(&buffer); + QIcon i; + stream >> i; + QCOMPARE(i.isNull(), abIcon.isNull()); + QCOMPARE(i.availableSizes(), abIcon.availableSizes()); + } + + // Make sure setting the theme name clears the state + QIcon::setThemeName(""); + abIcon = QIcon::fromTheme("address-book-new"); + QVERIFY(abIcon.isNull()); +} + + void tst_QIcon::task223279_inconsistentAddFile() { QIcon icon1; diff --git a/tools/assistant/compat/mainwindow.cpp b/tools/assistant/compat/mainwindow.cpp index 670b144..9d308df 100644 --- a/tools/assistant/compat/mainwindow.cpp +++ b/tools/assistant/compat/mainwindow.cpp @@ -140,6 +140,16 @@ MainWindow::MainWindow() 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 } diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index bc73b80..a0d4fbf 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -545,6 +545,19 @@ void MainWindow::setupActions() m_aboutAction = menu->addAction(tr("About..."), this, SLOT(showAboutDialog())); m_aboutAction->setMenuRole(QAction::AboutRole); +#ifdef Q_WS_X11 + m_backAction->setIcon(QIcon::fromTheme("go-previous" , m_backAction->icon())); + m_nextAction->setIcon(QIcon::fromTheme("go-next" , m_nextAction->icon())); + m_zoomInAction->setIcon(QIcon::fromTheme("zoom-in" , m_zoomInAction->icon())); + m_zoomOutAction->setIcon(QIcon::fromTheme("zoom-out" , m_zoomOutAction->icon())); + m_resetZoomAction->setIcon(QIcon::fromTheme("zoom-original" , m_resetZoomAction->icon())); + m_syncAction->setIcon(QIcon::fromTheme("view-refresh" , m_syncAction->icon())); + m_copyAction->setIcon(QIcon::fromTheme("edit-copy" , m_copyAction->icon())); + m_findAction->setIcon(QIcon::fromTheme("edit-find" , m_findAction->icon())); + m_homeAction->setIcon(QIcon::fromTheme("go-home" , m_homeAction->icon())); + m_printAction->setIcon(QIcon::fromTheme("document-print" , m_printAction->icon())); +#endif + QToolBar *navigationBar = addToolBar(tr("Navigation Toolbar")); navigationBar->setObjectName(QLatin1String("NavigationToolBar")); navigationBar->addAction(m_backAction); diff --git a/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp b/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp index ff0c3c6..cf838a2 100644 --- a/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp +++ b/tools/designer/src/components/buddyeditor/buddyeditor_plugin.cpp @@ -72,8 +72,9 @@ void BuddyEditorPlugin::initialize(QDesignerFormEditorInterface *core) m_action = new QAction(tr("Edit Buddies"), this); m_action->setObjectName(QLatin1String("__qt_edit_buddies_action")); - m_action->setIcon(QIcon(core->resourceLocation() + QLatin1String("/buddytool.png"))); - m_action->setIcon(QIcon(core->resourceLocation() + QLatin1String("/buddytool.png"))); + QIcon buddyIcon = QIcon::fromTheme("designer-edit-buddy", + QIcon(core->resourceLocation() + QLatin1String("/buddytool.png"))); + m_action->setIcon(buddyIcon); m_action->setEnabled(false); setParent(core); diff --git a/tools/designer/src/components/formeditor/formwindowmanager.cpp b/tools/designer/src/components/formeditor/formwindowmanager.cpp index 993bae9..a2a0a40 100644 --- a/tools/designer/src/components/formeditor/formwindowmanager.cpp +++ b/tools/designer/src/components/formeditor/formwindowmanager.cpp @@ -443,7 +443,8 @@ void FormWindowManager::setupActions() m_actionVerticalLayout->setEnabled(false); connect(m_actionVerticalLayout, SIGNAL(triggered()), this, SLOT(createLayout())); - QAction *actionFormLayout = new QAction(createIconSet(QLatin1String("editform.png")), tr("Lay Out in a &Form Layout"), this); + QIcon formIcon = QIcon::fromTheme("designer-form-layout", createIconSet(QLatin1String("editform.png"))); + QAction *actionFormLayout = new QAction(formIcon, tr("Lay Out in a &Form Layout"), this); actionFormLayout->setObjectName(QLatin1String("__qt_form_layout_action")); actionFormLayout->setShortcut(Qt::CTRL + Qt::Key_6); actionFormLayout->setStatusTip(tr("Lays out the selected widgets in a form layout")); @@ -510,15 +511,30 @@ void FormWindowManager::setupActions() m_actionUndo = m_undoGroup->createUndoAction(this); m_actionUndo->setEnabled(false); - m_actionUndo->setIcon(createIconSet(QLatin1String("undo.png"))); + + m_actionUndo->setIcon(QIcon::fromTheme("edit-undo", createIconSet(QLatin1String("undo.png")))); m_actionRedo = m_undoGroup->createRedoAction(this); m_actionRedo->setEnabled(false); - m_actionRedo->setIcon(createIconSet(QLatin1String("redo.png"))); + m_actionRedo->setIcon(QIcon::fromTheme("edit-redo", createIconSet(QLatin1String("redo.png")))); m_actionShowFormWindowSettingsDialog = new QAction(tr("Form &Settings..."), this); m_actionShowFormWindowSettingsDialog->setObjectName(QLatin1String("__qt_form_settings_action")); connect(m_actionShowFormWindowSettingsDialog, SIGNAL(triggered()), this, SLOT(slotActionShowFormWindowSettingsDialog())); m_actionShowFormWindowSettingsDialog->setEnabled(false); + + + m_actionCopy->setIcon(QIcon::fromTheme("edit-copy", m_actionCopy->icon())); + m_actionCut->setIcon(QIcon::fromTheme("edit-cut", m_actionCut->icon())); + m_actionPaste->setIcon(QIcon::fromTheme("edit-paste", m_actionPaste->icon())); + + // These do not currently exist, but will allow theme authors to fill in the gaps + m_actionBreakLayout->setIcon(QIcon::fromTheme("designer-break-layout", m_actionBreakLayout->icon())); + m_actionGridLayout->setIcon(QIcon::fromTheme("designer-grid-layout", m_actionGridLayout->icon())); + m_actionHorizontalLayout->setIcon(QIcon::fromTheme("designer-horizontal-layout", m_actionHorizontalLayout->icon())); + m_actionVerticalLayout->setIcon(QIcon::fromTheme("designer-vertical-layout", m_actionVerticalLayout->icon())); + m_actionSplitHorizontal->setIcon(QIcon::fromTheme("designer-split-horizontal", m_actionSplitHorizontal->icon())); + m_actionSplitVertical->setIcon(QIcon::fromTheme("designer-split-vertical", m_actionSplitVertical->icon())); + m_actionAdjustSize->setIcon(QIcon::fromTheme("designer-adjust-size", m_actionAdjustSize->icon())); } void FormWindowManager::slotActionCutActivated() diff --git a/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp b/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp index e664ae7..a113041 100644 --- a/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp +++ b/tools/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp @@ -72,7 +72,8 @@ void SignalSlotEditorPlugin::initialize(QDesignerFormEditorInterface *core) m_action = new QAction(tr("Edit Signals/Slots"), this); m_action->setObjectName(QLatin1String("__qt_edit_signals_slots_action")); m_action->setShortcut(tr("F4")); - QIcon icon(QIcon(core->resourceLocation() + QLatin1String("/signalslottool.png"))); + QIcon icon = QIcon::fromTheme("designer-edit-signals", + QIcon(core->resourceLocation() + QLatin1String("/signalslottool.png"))); m_action->setIcon(icon); m_action->setEnabled(false); diff --git a/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp b/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp index 9b051c9..ddddd08 100644 --- a/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp +++ b/tools/designer/src/components/tabordereditor/tabordereditor_plugin.cpp @@ -72,7 +72,9 @@ void TabOrderEditorPlugin::initialize(QDesignerFormEditorInterface *core) m_action = new QAction(tr("Edit Tab Order"), this); m_action->setObjectName(QLatin1String("_qt_edit_tab_order_action")); - m_action->setIcon(QIcon(core->resourceLocation() + QLatin1String("/tabordertool.png"))); + QIcon icon = QIcon::fromTheme("designer-edit-tabs", + QIcon(core->resourceLocation() + QLatin1String("/tabordertool.png"))); + m_action->setIcon(icon); m_action->setEnabled(false); setParent(core); diff --git a/tools/designer/src/designer/qdesigner_actions.cpp b/tools/designer/src/designer/qdesigner_actions.cpp index c671386..567a13e 100644 --- a/tools/designer/src/designer/qdesigner_actions.cpp +++ b/tools/designer/src/designer/qdesigner_actions.cpp @@ -200,6 +200,10 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) #endif m_previewManager(0) { + m_newFormAction->setIcon(QIcon::fromTheme("document-new", m_newFormAction->icon())); + m_openFormAction->setIcon(QIcon::fromTheme("document-open", m_openFormAction->icon())); + m_saveFormAction->setIcon(QIcon::fromTheme("document-save", m_saveFormAction->icon())); + Q_ASSERT(m_core != 0); qdesigner_internal::QDesignerFormWindowManager *ifwm = qobject_cast(m_core->formWindowManager()); Q_ASSERT(ifwm); @@ -323,7 +327,8 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) shortcuts.append(QKeySequence(Qt::Key_Escape)); #endif m_editWidgetsAction->setShortcuts(shortcuts); - m_editWidgetsAction->setIcon(QIcon(m_core->resourceLocation() + QLatin1String("/widgettool.png"))); + QIcon fallback(m_core->resourceLocation() + QLatin1String("/widgettool.png")); + m_editWidgetsAction->setIcon(QIcon::fromTheme("designer-edit-widget", fallback)); connect(m_editWidgetsAction, SIGNAL(triggered()), this, SLOT(editWidgetsSlot())); m_editWidgetsAction->setChecked(true); m_editWidgetsAction->setEnabled(false); diff --git a/tools/designer/src/lib/shared/actioneditor.cpp b/tools/designer/src/lib/shared/actioneditor.cpp index 1a236d6..a931b8a 100644 --- a/tools/designer/src/lib/shared/actioneditor.cpp +++ b/tools/designer/src/lib/shared/actioneditor.cpp @@ -147,7 +147,8 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent, toolbar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); l->addWidget(toolbar); // edit actions - m_actionNew->setIcon(createIconSet(QLatin1String("filenew.png"))); + QIcon documentNewIcon = QIcon::fromTheme("document-new", createIconSet(QLatin1String("filenew.png"))); + m_actionNew->setIcon(documentNewIcon); m_actionNew->setEnabled(false); connect(m_actionNew, SIGNAL(triggered()), this, SLOT(slotNewAction())); toolbar->addAction(m_actionNew); @@ -156,15 +157,18 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent, m_actionCut->setEnabled(false); connect(m_actionCut, SIGNAL(triggered()), this, SLOT(slotCut())); - m_actionCut->setIcon(createIconSet(QLatin1String("editcut.png"))); + QIcon editCutIcon = QIcon::fromTheme("edit-cut", createIconSet(QLatin1String("editcut.png"))); + m_actionCut->setIcon(editCutIcon); m_actionCopy->setEnabled(false); connect(m_actionCopy, SIGNAL(triggered()), this, SLOT(slotCopy())); - m_actionCopy->setIcon(createIconSet(QLatin1String("editcopy.png"))); + QIcon editCopyIcon = QIcon::fromTheme("edit-copy", createIconSet(QLatin1String("editcopy.png"))); + m_actionCopy->setIcon(editCopyIcon); toolbar->addAction(m_actionCopy); connect(m_actionPaste, SIGNAL(triggered()), this, SLOT(slotPaste())); - m_actionPaste->setIcon(createIconSet(QLatin1String("editpaste.png"))); + QIcon editPasteIcon = QIcon::fromTheme("edit-paste", createIconSet(QLatin1String("editpaste.png"))); + m_actionPaste->setIcon(editPasteIcon); toolbar->addAction(m_actionPaste); m_actionEdit->setEnabled(false); @@ -172,7 +176,8 @@ ActionEditor::ActionEditor(QDesignerFormEditorInterface *core, QWidget *parent, connect(m_actionNavigateToSlot, SIGNAL(triggered()), this, SLOT(navigateToSlotCurrentAction())); - m_actionDelete->setIcon(createIconSet(QLatin1String("editdelete.png"))); + QIcon editDeleteIcon = QIcon::fromTheme("edit-delete", createIconSet(QLatin1String("editdelete.png"))); + m_actionDelete->setIcon(editDeleteIcon); m_actionDelete->setEnabled(false); connect(m_actionDelete, SIGNAL(triggered()), this, SLOT(slotDelete())); toolbar->addAction(m_actionDelete); @@ -243,7 +248,8 @@ QToolButton *ActionEditor::createConfigureMenuButton(const QString &t, QMenu **p { QToolButton *configureButton = new QToolButton; QAction *configureAction = new QAction(t, configureButton); - configureAction->setIcon(createIconSet(QLatin1String("configure.png"))); + QIcon configureIcon = QIcon::fromTheme("document-properties", createIconSet(QLatin1String("configure.png"))); + configureAction->setIcon(configureIcon); QMenu *configureMenu = new QMenu; configureAction->setMenu(configureMenu); configureButton->setDefaultAction(configureAction); diff --git a/tools/designer/src/lib/shared/qtresourceview.cpp b/tools/designer/src/lib/shared/qtresourceview.cpp index 40be3e6..f55f7ae 100644 --- a/tools/designer/src/lib/shared/qtresourceview.cpp +++ b/tools/designer/src/lib/shared/qtresourceview.cpp @@ -582,17 +582,21 @@ QtResourceView::QtResourceView(QDesignerFormEditorInterface *core, QWidget *pare { d_ptr->q_ptr = this; - d_ptr->m_editResourcesAction = new QAction(qdesigner_internal::createIconSet(QLatin1String("edit.png")), tr("Edit Resources..."), this); + QIcon editIcon = QIcon::fromTheme("document-properties", qdesigner_internal::createIconSet(QLatin1String("edit.png"))); + d_ptr->m_editResourcesAction = new QAction(editIcon, tr("Edit Resources..."), this); d_ptr->m_toolBar->addAction(d_ptr->m_editResourcesAction); connect(d_ptr->m_editResourcesAction, SIGNAL(triggered()), this, SLOT(slotEditResources())); d_ptr->m_editResourcesAction->setEnabled(false); - d_ptr->m_reloadResourcesAction = new QAction(qdesigner_internal::createIconSet(QLatin1String("reload.png")), tr("Reload"), this); + QIcon refreshIcon = QIcon::fromTheme("view-refresh", qdesigner_internal::createIconSet(QLatin1String("reload.png"))); + d_ptr->m_reloadResourcesAction = new QAction(refreshIcon, tr("Reload"), this); + d_ptr->m_toolBar->addAction(d_ptr->m_reloadResourcesAction); connect(d_ptr->m_reloadResourcesAction, SIGNAL(triggered()), this, SLOT(slotReloadResources())); d_ptr->m_reloadResourcesAction->setEnabled(false); - d_ptr->m_copyResourcePathAction = new QAction(qdesigner_internal::createIconSet(QLatin1String("editcopy.png")), tr("Copy Path"), this); + QIcon copyIcon = QIcon::fromTheme("edit-copy", qdesigner_internal::createIconSet(QLatin1String("editcopy.png"))); + d_ptr->m_copyResourcePathAction = new QAction(copyIcon, tr("Copy Path"), this); connect(d_ptr->m_copyResourcePathAction, SIGNAL(triggered()), this, SLOT(slotCopyResourcePath())); d_ptr->m_copyResourcePathAction->setEnabled(false); -- cgit v0.12 From f9605d3f396043e5b893470acaeb4c726361e9dc Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 10 Aug 2009 18:19:53 +0200 Subject: Make QGtkStyle react properly to font changes in GNOME We only reacted to font changes before when the whole theme changed. Two things had to be fixed to support this. We need to check if the font changed in QGtkStyle::updateTheme and we need to make sure that QApplication does not reset these settings for us. Reviewed-by: joao --- src/gui/kernel/qapplication_x11.cpp | 36 ++++++++++++++++++++---------------- src/gui/styles/gtksymbols.cpp | 6 +++++- src/gui/styles/qgtkstyle.cpp | 2 +- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 221101a..470b433 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -871,28 +871,32 @@ bool QApplicationPrivate::x11_apply_settings() } // ### Fix properly for 4.6 - if (!(QApplicationPrivate::app_style && QApplicationPrivate::app_style->inherits("QGtkStyle"))) { + bool usingGtkSettings = QApplicationPrivate::app_style && QApplicationPrivate::app_style->inherits("QGtkStyle"); + if (!usingGtkSettings) { if (groupCount == QPalette::NColorGroups) QApplicationPrivate::setSystemPalette(pal); } if (!appFont) { - QFont font(QApplication::font()); - QString fontDescription; - // Override Qt font if KDE4 settings can be used - if (X11->desktopEnvironment == DE_KDE && X11->desktopVersion >= 4) { - QSettings kdeSettings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat); - fontDescription = kdeSettings.value(QLatin1String("font")).toString(); - if (fontDescription.isEmpty()) { - // KDE stores fonts without quotes - fontDescription = kdeSettings.value(QLatin1String("font")).toStringList().join(QLatin1String(",")); + // ### Fix properly for 4.6 + if (!usingGtkSettings) { + QFont font(QApplication::font()); + QString fontDescription; + // Override Qt font if KDE4 settings can be used + if (X11->desktopVersion == 4) { + QSettings kdeSettings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat); + fontDescription = kdeSettings.value(QLatin1String("font")).toString(); + if (fontDescription.isEmpty()) { + // KDE stores fonts without quotes + fontDescription = kdeSettings.value(QLatin1String("font")).toStringList().join(QLatin1String(",")); + } + } + if (fontDescription.isEmpty()) + fontDescription = settings.value(QLatin1String("font")).toString(); + if (!fontDescription .isEmpty()) { + font.fromString(fontDescription ); + QApplicationPrivate::setSystemFont(font); } - } - if (fontDescription.isEmpty()) - fontDescription = settings.value(QLatin1String("font")).toString(); - if (!fontDescription .isEmpty()) { - font.fromString(fontDescription ); - QApplicationPrivate::setSystemFont(font); } } diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index c8b4fda..2d8d6e2 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -547,9 +547,13 @@ void QGtkStyleUpdateScheduler::updateTheme() { static QString oldTheme(QLS("qt_not_set")); QPixmapCache::clear(); + + QFont font = QGtk::getThemeFont(); + if (QApplication::font() != font) + qApp->setFont(font); + if (oldTheme != getThemeName()) { oldTheme = getThemeName(); - qApp->setFont(QGtk::getThemeFont()); QPalette newPalette = qApp->style()->standardPalette(); QApplicationPrivate::setSystemPalette(newPalette); QApplication::setPalette(newPalette); diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index f6d8c88..5f56230 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -1,4 +1,4 @@ -/******* ********************************************************************* +/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Nokia Corporation (qt-info@nokia.com) -- cgit v0.12 From 4096911423fcd52c59d83f153b3a83ae99312a70 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Mon, 10 Aug 2009 19:23:04 +0200 Subject: Add a Widget for manual testing of the tablet API The QTabletWidget shows the informations provided by the last QTabletEvent. --- tests/manual/qtabletevent/main.cpp | 9 ++ tests/manual/qtabletevent/qtabletevent.pro | 13 +++ tests/manual/qtabletevent/tabletwidget.cpp | 150 +++++++++++++++++++++++++++++ tests/manual/qtabletevent/tabletwidget.h | 32 ++++++ 4 files changed, 204 insertions(+) create mode 100644 tests/manual/qtabletevent/main.cpp create mode 100644 tests/manual/qtabletevent/qtabletevent.pro create mode 100644 tests/manual/qtabletevent/tabletwidget.cpp create mode 100644 tests/manual/qtabletevent/tabletwidget.h diff --git a/tests/manual/qtabletevent/main.cpp b/tests/manual/qtabletevent/main.cpp new file mode 100644 index 0000000..4014d58 --- /dev/null +++ b/tests/manual/qtabletevent/main.cpp @@ -0,0 +1,9 @@ +#include +#include "tabletwidget.h" + +int main(int argc, char **argv) { + QApplication app(argc, argv); + TabletWidget tabletWidget; + tabletWidget.showMaximized(); + return app.exec(); +} diff --git a/tests/manual/qtabletevent/qtabletevent.pro b/tests/manual/qtabletevent/qtabletevent.pro new file mode 100644 index 0000000..e0ed549 --- /dev/null +++ b/tests/manual/qtabletevent/qtabletevent.pro @@ -0,0 +1,13 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Mon Aug 10 17:02:09 2009 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . + +# Input +SOURCES += main.cpp\ + tabletwidget.cpp +HEADERS += tabletwidget.h diff --git a/tests/manual/qtabletevent/tabletwidget.cpp b/tests/manual/qtabletevent/tabletwidget.cpp new file mode 100644 index 0000000..4d6a365 --- /dev/null +++ b/tests/manual/qtabletevent/tabletwidget.cpp @@ -0,0 +1,150 @@ +#include "tabletwidget.h" +#include +#include + +TabletWidget::TabletWidget() +{ + QPalette newPalette = palette(); + newPalette.setColor(QPalette::Window, Qt::white); + setPalette(newPalette); + qApp->installEventFilter(this); + resetAttributes(); +} + +bool TabletWidget::eventFilter(QObject *, QEvent *ev) +{ + switch (ev->type()) { + case QEvent::TabletEnterProximity: + case QEvent::TabletLeaveProximity: + case QEvent::TabletMove: + case QEvent::TabletPress: + case QEvent::TabletRelease: + { + QTabletEvent *event = static_cast(ev); + mType = event->type(); + mPos = event->pos(); + mGPos = event->globalPos(); + mHiResGlobalPos = event->hiResGlobalPos(); + mDev = event->device(); + mPointerType = event->pointerType(); + mUnique = event->uniqueId(); + mXT = event->xTilt(); + mYT = event->yTilt(); + mZ = event->z(); + mPress = event->pressure(); + mTangential = event->tangentialPressure(); + mRot = event->rotation(); + if (isVisible()) + update(); + break; + } + case QEvent::MouseMove: + { + resetAttributes(); + QMouseEvent *event = static_cast(ev); + mType = event->type(); + mPos = event->pos(); + mGPos = event->globalPos(); + } + default: + break; + } + return false; +} + +void TabletWidget::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + + QStringList eventInfo; + + QString typeString("Event type: "); + switch (mType) { + case QEvent::TabletEnterProximity: + typeString += "QEvent::TabletEnterProximity"; + break; + case QEvent::TabletLeaveProximity: + typeString += "QEvent::TabletLeaveProximity"; + break; + case QEvent::TabletMove: + typeString += "QEvent::TabletMove"; + break; + case QEvent::TabletPress: + typeString += "QEvent::TabletPress"; + break; + case QEvent::TabletRelease: + typeString += "QEvent::TabletRelease"; + break; + case QEvent::MouseMove: + typeString += "QEvent::MouseMove"; + break; + } + eventInfo << typeString; + + eventInfo << QString("Global position: %1 %2").arg(QString::number(mGPos.x()), QString::number(mGPos.y())); + eventInfo << QString("Local position: %1 %2").arg(QString::number(mPos.x()), QString::number(mPos.y())); + if (mType == QEvent::TabletEnterProximity || mType == QEvent::TabletLeaveProximity + || mType == QEvent::TabletMove || mType == QEvent::TabletPress + || mType == QEvent::TabletRelease) { + + eventInfo << QString("Hight res global position: %1 %2").arg(QString::number(mHiResGlobalPos.x()), QString::number(mHiResGlobalPos.y())); + + QString pointerType("Pointer type: "); + switch (mPointerType) { + case QTabletEvent::UnknownPointer: + pointerType += "QTabletEvent::UnknownPointer"; + break; + case QTabletEvent::Pen: + pointerType += "QTabletEvent::Pen"; + break; + case QTabletEvent::Cursor: + pointerType += "QTabletEvent::Cursor"; + break; + case QTabletEvent::Eraser: + pointerType += "QTabletEvent::Eraser"; + break; + } + eventInfo << pointerType; + + + QString deviceString = "Device type: "; + switch (mDev) { + case QTabletEvent::NoDevice: + deviceString += "QTabletEvent::NoDevice"; + break; + case QTabletEvent::Puck: + deviceString += "QTabletEvent::Puck"; + break; + case QTabletEvent::Stylus: + deviceString += "QTabletEvent::Stylus"; + break; + case QTabletEvent::Airbrush: + deviceString += "QTabletEvent::Airbrush"; + break; + case QTabletEvent::FourDMouse: + deviceString += "QTabletEvent::FourDMouse"; + break; + case QTabletEvent::RotationStylus: + deviceString += "QTabletEvent::RotationStylus"; + break; + } + eventInfo << deviceString; + + eventInfo << QString("Pressure: %1").arg(QString::number(mPress)); + eventInfo << QString("Tangential pressure: %1").arg(QString::number(mTangential)); + eventInfo << QString("Rotation: %1").arg(QString::number(mRot)); + eventInfo << QString("xTilt: %1").arg(QString::number(mXT)); + eventInfo << QString("yTilt: %1").arg(QString::number(mYT)); + eventInfo << QString("z: %1").arg(QString::number(mZ)); + + eventInfo << QString("Unique Id: %1").arg(QString::number(mUnique)); + } + + painter.drawText(rect(), eventInfo.join("\n")); +} + +void TabletWidget::tabletEvent(QTabletEvent *event) +{ + event->accept(); +} + diff --git a/tests/manual/qtabletevent/tabletwidget.h b/tests/manual/qtabletevent/tabletwidget.h new file mode 100644 index 0000000..b0efef2 --- /dev/null +++ b/tests/manual/qtabletevent/tabletwidget.h @@ -0,0 +1,32 @@ +#ifndef TABLETWIDGET_H +#define TABLETWIDGET_H + +#include +#include + +// a widget showing the information of the last tablet event +class TabletWidget : public QWidget +{ +public: + TabletWidget(); +protected: + bool eventFilter(QObject *obj, QEvent *ev); + void tabletEvent(QTabletEvent *event); + void paintEvent(QPaintEvent *event); +private: + void resetAttributes() { + mType = mDev = mPointerType = mXT = mYT = mZ = 0; + mPress = mTangential = mRot = 0.0; + mPos = mGPos = QPoint(); + mHiResGlobalPos = QPointF(); + mUnique = 0; + } + int mType; + QPoint mPos, mGPos; + QPointF mHiResGlobalPos; + int mDev, mPointerType, mXT, mYT, mZ; + qreal mPress, mTangential, mRot; + qint64 mUnique; +}; + +#endif // TABLETWIDGET_H -- cgit v0.12 From 557b8c58023ad0bdbd79bf25b770dc873a57cad1 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 10 Aug 2009 19:37:30 +0200 Subject: Doc: Documented the use of spaces in qmake variables. Reviewed-by: Trust Me --- doc/src/qmake-manual.qdoc | 23 +++++++++++++++++++++-- doc/src/snippets/qmake/spaces.pro | 9 +++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 doc/src/snippets/qmake/spaces.pro diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc index 211d7e9..3363881 100644 --- a/doc/src/qmake-manual.qdoc +++ b/doc/src/qmake-manual.qdoc @@ -258,6 +258,8 @@ on strings and lists of values. These are described in the chapter on \l{qmake Advanced Usage}. + \section3 Whitespace + Normally, variables are used to contain whitespace-separated lists of values. However, it is sometimes necessary to specify values containing spaces. These must be quoted in the following way: @@ -265,7 +267,10 @@ \snippet doc/src/snippets/qmake/quoting.pro 0 The quoted text is treated as a single item in the list of values held by - the variable. + the variable. This approach is used to deal with paths that contain spaces, + particularly on the Windows platform. See the documentation for the + \l{qmake Variable Reference#INCLUDEPATH}{INCLUDEPATH} and + \l{qmake Variable Reference#LIBS}{LIBS} variables for examples. \section2 Comments @@ -380,7 +385,7 @@ This is ignored if \c warn_off is specified. \row \o warn_off \o The compiler should output as few warnings as possible. \row \o copy_dir_files \o Enables the install rule to also copy directories, not just files. - \endtable + \endtable The \c debug_and_release option is special in that it enables \e both debug and release versions of a project to be built. In such a case, the Makefile that @@ -1369,6 +1374,13 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 35 + To specify a path containing spaces, quote the path using the technique + mentioned in the \l{qmake Project Files#Whitespace}{qmake Project Files} + document. For example, paths with spaces can be specified on Windows + and Unix platforms in the following way: + + \snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces + \target INSTALLS \section1 INSTALLS @@ -1422,6 +1434,13 @@ \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 38 + To specify a path containing spaces, quote the path using the technique + mentioned in the \l{qmake Project Files#Whitespace}{qmake Project Files} + document. For example, paths with spaces can be specified on Windows + and Unix platforms in the following way: + + \snippet doc/src/snippets/qmake/spaces.pro quoting library paths with spaces + \bold{Note:} On Windows, specifying libraries with the \c{-l} option, as in the above example, will cause the library with the highest version number to be used; for example, \c{libmath2.lib} could potentially be used diff --git a/doc/src/snippets/qmake/spaces.pro b/doc/src/snippets/qmake/spaces.pro new file mode 100644 index 0000000..c78e984 --- /dev/null +++ b/doc/src/snippets/qmake/spaces.pro @@ -0,0 +1,9 @@ +#! [quoting library paths with spaces] +win32:LIBS += "C:/mylibs/extra libs/extra.lib" +unix:LIBS += -L"/home/user/extra libs" -lextra +#! [quoting library paths with spaces] + +#! [quoting include paths with spaces] +win32:INCLUDEPATH += "C:/mylibs/extra headers" +unix:INCLUDEPATH += "/home/user/extra headers" +#! [quoting include paths with spaces] -- cgit v0.12 From dd9d869300d34725bc480d827f91b3103c84f045 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 10 Aug 2009 19:50:01 +0200 Subject: fixing the Windows CE build after adding gesture support We must guard the code with QT_WINCE_GESTURES. Reviewed-by: TrustMe --- src/gui/kernel/qapplication_win.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index bb910b7..a0142e1 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -816,13 +816,13 @@ void qt_init(QApplicationPrivate *priv, int) priv->GetGestureInfo = 0; priv->GetGestureExtraArgs = 0; -#ifdef Q_WS_WINCE_WM +#if defined(Q_WS_WINCE_WM) && defined(QT_WINCE_GESTURES) priv->GetGestureInfo = (PtrGetGestureInfo) &TKGetGestureInfo; priv->GetGestureExtraArgs = (PtrGetGestureExtraArgs) &TKGetGestureExtraArguments; priv->CloseGestureInfoHandle = (PtrCloseGestureInfoHandle) 0; priv->SetGestureConfig = (PtrSetGestureConfig) 0; priv->GetGestureConfig = (PtrGetGestureConfig) 0; -#else +#elif !defined(Q_WS_WINCE) priv->GetGestureInfo = (PtrGetGestureInfo)QLibrary::resolve(QLatin1String("user32"), "GetGestureInfo"); @@ -1252,7 +1252,10 @@ void QApplication::beep() static void alert_widget(QWidget *widget, int duration) { -#ifndef Q_OS_WINCE +#ifdef Q_OS_WINCE + Q_UNUSED(widget); + Q_UNUSED(duration); +#else bool stopFlash = duration < 0; if (widget && (!widget->isActiveWindow() || stopFlash)) { @@ -3729,10 +3732,14 @@ bool QETWidget::translateGestureEvent(const MSG &msg) gi.cbSize = sizeof(GESTUREINFO); QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); -#ifdef Q_WS_WINCE_WM +#if defined(Q_WS_WINCE_WM) && defined(QT_WINCE_GESTURES) +#undef GID_ZOOM #define GID_ZOOM 0xf000 +#undef GID_ROTATE #define GID_ROTATE 0xf001 +#undef GID_TWOFINGERTAP #define GID_TWOFINGERTAP 0xf002 +#undef GID_ROLLOVER #define GID_ROLLOVER 0xf003 #endif BOOL bResult = false; -- cgit v0.12 From 36c93eca351218ce43a0c6346209d364737b6b84 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 10 Aug 2009 20:46:16 +0200 Subject: Better implementation for commit d13418effc5f00474541ae513a30c9a42c2a1cb3. The previous version could run in an endless loop with infinite models. Reviewed-by: olivier --- src/gui/itemviews/qitemselectionmodel.cpp | 60 +++++++++++++--------- src/gui/itemviews/qitemselectionmodel_p.h | 2 - .../tst_qitemselectionmodel.cpp | 30 +++++++++++ 3 files changed, 66 insertions(+), 26 deletions(-) diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp index 0f35ac1..06c345f 100644 --- a/src/gui/itemviews/qitemselectionmodel.cpp +++ b/src/gui/itemviews/qitemselectionmodel.cpp @@ -590,31 +590,43 @@ void QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(const QModelIndex &pare emit q->currentColumnChanged(currentIndex, old); } - // update selectionsx - QModelIndex tl = model->index(start, 0, parent); - QModelIndex br = model->index(end, model->columnCount(parent) - 1, parent); - recursiveDeselect(QItemSelectionRange(tl, br)); - finalize(); -} - -void QItemSelectionModelPrivate::recursiveDeselect(const QItemSelectionRange &range) -{ - Q_Q(QItemSelectionModel); - - QItemSelection sel(range.topLeft(), range.bottomRight()); - q->select(sel, QItemSelectionModel::Deselect); - - QModelIndexList idxList = range.indexes(); - QModelIndexList::const_iterator it = idxList.begin(); - for (; it != idxList.end(); ++it) - { - if (!model->hasChildren(*it)) - continue; - - const QModelIndex &firstChild = it->child(0,0); - const QModelIndex &lastChild = it->child(model->rowCount(*it) - 1, model->columnCount(*it) - 1); - recursiveDeselect(QItemSelectionRange(firstChild, lastChild)); + QItemSelection deselected; + QItemSelection::iterator it = currentSelection.begin(); + while (it != currentSelection.end()) { + if (it->topLeft().parent() != parent) { // Check parents until reaching root or contained in range + QModelIndex itParent = it->topLeft().parent(); + while (itParent.isValid() && itParent.parent() != parent) + itParent = itParent.parent(); + + if (parent.isValid() && start <= itParent.row() && itParent.row() <= end) { + deselected.append(*it); + it = currentSelection.erase(it); + } else { + ++it; + } + } else if (start <= it->bottom() && it->bottom() <= end // Full inclusion + && start <= it->top() && it->top() <= end) { + deselected.append(*it); + it = currentSelection.erase(it); + } else if (start <= it->top() && it->top() <= end) { // Top intersection + deselected.append(QItemSelectionRange(it->topLeft(), model->index(end, it->left(), it->parent()))); + it = currentSelection.insert(it, QItemSelectionRange(model->index(end + 1, it->left(), it->parent()), + it->bottomRight())); + it = currentSelection.erase(++it); + } else if (start <= it->bottom() && it->bottom() <= end) { // Bottom intersection + deselected.append(QItemSelectionRange(model->index(start, it->right(), it->parent()), it->bottomRight())); + it = currentSelection.insert(it, QItemSelectionRange(it->topLeft(), + model->index(start - 1, it->right(), it->parent()))); + it = currentSelection.erase(++it); + } else { + if (it->top() < start && end < it->bottom()) // Middle intersection (do nothing) + deselected.append(QItemSelectionRange(model->index(start, it->right(), it->parent()), + model->index(end, it->left(), it->parent()))); + ++it; + } } + + emit q->selectionChanged(QItemSelection(), deselected); } /*! diff --git a/src/gui/itemviews/qitemselectionmodel_p.h b/src/gui/itemviews/qitemselectionmodel_p.h index 8176d4c..18ad506 100644 --- a/src/gui/itemviews/qitemselectionmodel_p.h +++ b/src/gui/itemviews/qitemselectionmodel_p.h @@ -77,8 +77,6 @@ public: void _q_layoutAboutToBeChanged(); void _q_layoutChanged(); - void recursiveDeselect(const QItemSelectionRange &range); - inline void remove(QList &r) { QList::const_iterator it = r.constBegin(); diff --git a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp index 05e23f1..ec21f79 100644 --- a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -2209,6 +2209,36 @@ void tst_QItemSelectionModel::task232634_childrenDeselectionSignal() QSignalSpy deselectSpy(&selectionModel, SIGNAL(selectionChanged(const QItemSelection& , const QItemSelection&))); model.removeRows(0, 1, root); QVERIFY(deselectSpy.count() == 1); + + // More testing stress for the patch. + model.clear(); + selectionModel.clear(); + + parentItem = model.invisibleRootItem(); + for (int i = 0; i < 2; ++i) { + QStandardItem *item = new QStandardItem(QString("item %0").arg(i)); + parentItem->appendRow(item); + } + for (int i = 0; i < 2; ++i) { + parentItem = model.invisibleRootItem()->child(i, 0); + for (int j = 0; j < 2; ++j) { + QStandardItem *item = new QStandardItem(QString("item %0.%1").arg(i).arg(j)); + parentItem->appendRow(item); + } + } + + sel = model.index(0, 0).child(0, 0); + selectionModel.select(sel, QItemSelectionModel::Select); + QModelIndex sel2 = model.index(1, 0).child(0, 0); + selectionModel.select(sel2, QItemSelectionModel::Select); + + QVERIFY(selectionModel.selection().contains(sel)); + QVERIFY(selectionModel.selection().contains(sel2)); + deselectSpy.clear(); + model.removeRow(0, model.index(0, 0)); + QVERIFY(deselectSpy.count() == 1); + QVERIFY(!selectionModel.selection().contains(sel)); + QVERIFY(selectionModel.selection().contains(sel2)); } QTEST_MAIN(tst_QItemSelectionModel) -- cgit v0.12 From a675f83543d9a8bb61cb5f5227c6793ae343cc80 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 10 Aug 2009 21:51:31 +0200 Subject: Doc: Fix links and qdoc warnings. --- src/gui/image/qicon.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 7a43514..b7759e4 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -870,7 +870,7 @@ QList QIcon::availableSizes(Mode mode, State state) const /*! \since 4.6 - Sets the search paths for icon themes. + Sets the search paths for icon themes to \a paths. \sa themeSearchPaths(), fromTheme() */ void QIcon::setThemeSearchPaths(const QStringList &paths) @@ -893,7 +893,7 @@ void QIcon::setThemeSearchPaths(const QStringList &paths) On Mac the default search path will search in the [Contents/Resources/icons] part of the application bundle. - \sa setThemeSearchPaths(), fromName() + \sa setThemeSearchPaths(), fromTheme() */ QStringList QIcon::themeSearchPaths() { @@ -923,7 +923,7 @@ void QIcon::setThemeName(const QString &path) On X11, the current icon theme depends on your desktop settings. On other platforms it is not set by default. - \sa themeSearchPaths(), themeIcon(), fromTheme(), hasThemeIcon() + \sa themeSearchPaths(), fromTheme(), hasThemeIcon() */ QString QIcon::themeName() { -- cgit v0.12 From 6c3c9d812a730d5bc1bcd6261befe077a65be594 Mon Sep 17 00:00:00 2001 From: Bill King Date: Tue, 11 Aug 2009 08:23:30 +1000 Subject: Fixes coverity warning of uninit variable. --- src/sql/drivers/psql/qsql_psql.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 4fd0c11..fccc622 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -158,7 +158,7 @@ void QPSQLDriverPrivate::appendTables(QStringList &tl, QSqlQuery &t, QChar type) class QPSQLResultPrivate { public: - QPSQLResultPrivate(QPSQLResult *qq): q(qq), driver(0), result(0), currentSize(-1) {} + QPSQLResultPrivate(QPSQLResult *qq): q(qq), driver(0), result(0), currentSize(-1), preparedQueriesEnabled(false) {} QPSQLResult *q; const QPSQLDriverPrivate *driver; -- cgit v0.12 From b2690f454d3a9066f6651afb1f398f9fbaebac28 Mon Sep 17 00:00:00 2001 From: Bill King Date: Tue, 11 Aug 2009 10:12:27 +1000 Subject: Make compile. --- src/gui/image/qiconloader.cpp | 1 + src/gui/image/qiconloader_p.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 6bf8d3b..e6e3074 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #ifdef Q_WS_MAC #include diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h index 707107c..08d6cfe 100644 --- a/src/gui/image/qiconloader_p.h +++ b/src/gui/image/qiconloader_p.h @@ -58,6 +58,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE -- cgit v0.12 From 276ad6012620864d4e9fb4a9cb45bcf904c9fbc3 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 11 Aug 2009 12:58:44 +1000 Subject: Use a linked list for signal/slot ConnectionList Using a linked list, rather than a QList improves connection performance by eliminating the QList allocation costs. Reviewed-by: brad --- src/corelib/kernel/qobject.cpp | 116 +++++++++++++++++++++++++++-------------- src/corelib/kernel/qobject_p.h | 9 +++- 2 files changed, 86 insertions(+), 39 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 6520170..371770f 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -257,11 +257,13 @@ bool QObjectPrivate::isSender(const QObject *receiver, const char *signal) const QMutexLocker locker(signalSlotLock(q)); if (connectionLists) { if (signal_index < connectionLists->count()) { - const ConnectionList &connectionList = connectionLists->at(signal_index); - for (int i = 0; i < connectionList.count(); ++i) { - const QObjectPrivate::Connection *c = connectionList.at(i); + const QObjectPrivate::Connection *c = + connectionLists->at(signal_index).first; + + while (c) { if (c->receiver == receiver) return true; + c = c->nextConnectionList; } } } @@ -279,11 +281,12 @@ QObjectList QObjectPrivate::receiverList(const char *signal) const QMutexLocker locker(signalSlotLock(q)); if (connectionLists) { if (signal_index < connectionLists->count()) { - const ConnectionList &connectionList = connectionLists->at(signal_index); - for (int i = 0; i < connectionList.count(); ++i) { - const QObjectPrivate::Connection *c = connectionList.at(i); + const QObjectPrivate::Connection *c = connectionLists->at(signal_index).first; + + while (c) { if (c->receiver) returnValue << c->receiver; + c = c->nextConnectionList; } } } @@ -308,7 +311,13 @@ void QObjectPrivate::addConnection(int signal, Connection *c) connectionLists->resize(signal + 1); ConnectionList &connectionList = (*connectionLists)[signal]; - connectionList.append(c); + if (connectionList.last) { + connectionList.last->nextConnectionList = c; + } else { + connectionList.first = c; + } + connectionList.last = c; + cleanConnectionLists(); } @@ -317,14 +326,32 @@ void QObjectPrivate::cleanConnectionLists() if (connectionLists->dirty && !connectionLists->inUse) { // remove broken connections for (int signal = -1; signal < connectionLists->count(); ++signal) { - QObjectPrivate::ConnectionList &connectionList = (*connectionLists)[signal]; - for (int i = 0; i < connectionList.count(); ++i) { - QObjectPrivate::Connection *c = connectionList.at(i); - if (!c->receiver) { + QObjectPrivate::ConnectionList &connectionList = + (*connectionLists)[signal]; + + // Set to the last entry in the connection list that was *not* + // deleted. This is needed to update the list's last pointer + // at the end of the cleanup. + QObjectPrivate::Connection *last = 0; + + QObjectPrivate::Connection **prev = &connectionList.first; + QObjectPrivate::Connection *c = *prev; + while (c) { + if (c->receiver) { + last = c; + prev = &c->nextConnectionList; + c = *prev; + } else { + QObjectPrivate::Connection *next = c->nextConnectionList; + *prev = next; delete c; - connectionList.removeAt(i--); + c = next; } } + + // Correct the connection list's last pointer. As + // conectionList.last could equal last, this could be a noop + connectionList.last = last; } connectionLists->dirty = false; } @@ -797,17 +824,19 @@ QObject::~QObject() if (d->connectionLists) { ++d->connectionLists->inUse; for (int signal = -1; signal < d->connectionLists->count(); ++signal) { - QObjectPrivate::ConnectionList &connectionList = (*d->connectionLists)[signal]; - for (int i = 0; i < connectionList.count(); ++i) { - QObjectPrivate::Connection *c = connectionList[i]; + QObjectPrivate::ConnectionList &connectionList = + (*d->connectionLists)[signal]; + + while (QObjectPrivate::Connection *c = connectionList.first) { if (!c->receiver) { + connectionList.first = c->nextConnectionList; delete c; continue; } QMutex *m = signalSlotLock(c->receiver); bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); - c = connectionList[i]; + if (c->receiver) { *c->prev = c->next; if (c->next) c->next->prev = c->prev; @@ -815,6 +844,7 @@ QObject::~QObject() if (needToUnlock) m->unlock(); + connectionList.first = c->nextConnectionList; delete c; } } @@ -2412,11 +2442,11 @@ int QObject::receivers(const char *signal) const QMutexLocker locker(signalSlotLock(this)); if (d->connectionLists) { if (signal_index < d->connectionLists->count()) { - const QObjectPrivate::ConnectionList &connectionList = - d->connectionLists->at(signal_index); - for (int i = 0; i < connectionList.count(); ++i) { - const QObjectPrivate::Connection *c = connectionList.at(i); + const QObjectPrivate::Connection *c = + d->connectionLists->at(signal_index).first; + while (c) { receivers += c->receiver ? 1 : 0; + c = c->nextConnectionList; } } } @@ -2861,11 +2891,13 @@ bool QMetaObject::connect(const QObject *sender, int signal_index, if (type & Qt::UniqueConnection) { QObjectConnectionListVector *connectionLists = s->d_func()->connectionLists; if (connectionLists && connectionLists->count() > signal_index) { - QObjectPrivate::ConnectionList &connectionList = (*connectionLists)[signal_index]; - for (int i = 0; i < connectionList.count(); ++i) { - QObjectPrivate::Connection *c2 = connectionList.at(i); + const QObjectPrivate::Connection *c2 = + (*connectionLists)[signal_index].first; + + while (c2) { if (c2->receiver == receiver && c2->method == method_index) return false; + c2 = c2->nextConnectionList; } } type &= Qt::UniqueConnection - 1; @@ -2877,6 +2909,7 @@ bool QMetaObject::connect(const QObject *sender, int signal_index, c->method = method_index; c->connectionType = type; c->argumentTypes = types; + c->nextConnectionList = 0; c->prev = &r->d_func()->senders; c->next = *c->prev; *c->prev = c; @@ -2926,9 +2959,9 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index, if (signal_index < 0) { // remove from all connection lists for (signal_index = -1; signal_index < connectionLists->count(); ++signal_index) { - QObjectPrivate::ConnectionList &connectionList = (*connectionLists)[signal_index]; - for (int i = 0; i < connectionList.count(); ++i) { - QObjectPrivate::Connection *c = connectionList[i]; + QObjectPrivate::Connection *c = + (*connectionLists)[signal_index].first; + while (c) { if (c->receiver && (r == 0 || (c->receiver == r && (method_index < 0 || c->method == method_index)))) { @@ -2937,7 +2970,6 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index, if (!receiverMutex && senderMutex != m) { // need to relock this receiver and sender in the correct order needToUnlock = QOrderedMutexLocker::relock(senderMutex, m); - c = connectionList[i]; } if (c->receiver) { *c->prev = c->next; @@ -2952,12 +2984,13 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index, success = true; connectionLists->dirty = true; } + c = c->nextConnectionList; } } } else if (signal_index < connectionLists->count()) { - QObjectPrivate::ConnectionList &connectionList = (*connectionLists)[signal_index]; - for (int i = 0; i < connectionList.count(); ++i) { - QObjectPrivate::Connection *c = connectionList[i]; + QObjectPrivate::Connection *c = + (*connectionLists)[signal_index].first; + while (c) { if (c->receiver && (r == 0 || (c->receiver == r && (method_index < 0 || c->method == method_index)))) { @@ -2966,7 +2999,6 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index, if (!receiverMutex && senderMutex != m) { // need to relock this receiver and sender in the correct order needToUnlock = QOrderedMutexLocker::relock(senderMutex, m); - c = connectionList[i]; } if (c->receiver) { *c->prev = c->next; @@ -2980,6 +3012,7 @@ bool QMetaObject::disconnect(const QObject *sender, int signal_index, success = true; connectionLists->dirty = true; } + c = c->nextConnectionList; } } @@ -3144,9 +3177,14 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal signal = to_signal_index; continue; } - int count = connectionLists->at(signal).count(); - for (int i = 0; i < count; ++i) { - QObjectPrivate::Connection *c = connectionLists->at(signal)[i]; + + QObjectPrivate::Connection *c = connectionLists->at(signal).first; + if (!c) continue; + // We need to check against last here to ensure that signals added + // during the signal emission are not emitted in this emission. + QObjectPrivate::Connection *last = connectionLists->at(signal).last; + + do { if (!c->receiver) continue; @@ -3208,7 +3246,7 @@ void QMetaObject::activate(QObject *sender, int from_signal_index, int to_signal if (connectionLists->orphaned) break; - } + } while (c != last && (c = c->nextConnectionList) != 0); if (connectionLists->orphaned) break; @@ -3527,11 +3565,12 @@ void QObject::dumpObjectInfo() qDebug(" signal: %s", signal.signature()); // receivers - const QObjectPrivate::ConnectionList &connectionList = d->connectionLists->at(signal_index); - for (int i = 0; i < connectionList.count(); ++i) { - const QObjectPrivate::Connection *c = connectionList.at(i); + const QObjectPrivate::Connection *c = + d->connectionLists->at(signal_index).first; + while (c) { if (!c->receiver) { qDebug(" "); + c = c->nextConnectionList; continue; } const QMetaObject *receiverMetaObject = c->receiver->metaObject(); @@ -3540,6 +3579,7 @@ void QObject::dumpObjectInfo() receiverMetaObject->className(), c->receiver->objectName().isEmpty() ? "unnamed" : qPrintable(c->receiver->objectName()), method.signature()); + c = c->nextConnectionList; } } } else { diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 5d17bfd..4f8f1b9 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -113,12 +113,19 @@ public: int method; uint connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking QBasicAtomicPointer argumentTypes; + // The next pointer for the singly-linked ConnectionList + Connection *nextConnectionList; //senders linked list Connection *next; Connection **prev; ~Connection(); }; - typedef QList ConnectionList; + // ConnectionList is a singly-linked list + struct ConnectionList { + ConnectionList() : first(0), last(0) {} + Connection *first; + Connection *last; + }; struct Sender { -- cgit v0.12 From b200e79d5df436f2c881f8a2bc5534ee53e664d5 Mon Sep 17 00:00:00 2001 From: Bill King Date: Tue, 11 Aug 2009 13:50:12 +1000 Subject: Fixes false fails in interbase autotests. --- tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp | 3 +++ tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 4 ++++ tests/auto/qsqlquery/tst_qsqlquery.cpp | 2 ++ 3 files changed, 9 insertions(+) diff --git a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp index e5a9b01..0f30656 100644 --- a/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp +++ b/tests/auto/q3sqlcursor/tst_q3sqlcursor.cpp @@ -524,6 +524,9 @@ void tst_Q3SqlCursor::unicode() if ( !db.driver()->hasFeature( QSqlDriver::Unicode ) ) { QSKIP( "DBMS not Unicode capable", SkipSingle ); } + // ascii in the data storage, can't transliterate properly. invalid test. + if(db.driverName().startsWith("QIBASE") && (db.databaseName() == "silence.nokia.troll.no:c:\\ibase\\testdb_ascii" || db.databaseName() == "/opt/interbase/qttest.gdb")) + QSKIP("Can't transliterate extended unicode to ascii", SkipSingle); Q3SqlCursor cur( qTableName( "qtest_unicode" ), true, db ); QSqlRecord* irec = cur.primeInsert(); diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index fe4c86e..83569b4 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -2274,6 +2274,10 @@ void tst_QSqlDatabase::eventNotificationPSQL() QSqlDatabase db = QSqlDatabase::database(dbName); CHECK_DATABASE(db); +#if defined(Q_OS_LINUX) + QSKIP( "Event support doesn't work on linux", SkipAll ); +#endif + QSqlQuery query(db); QString procedureName = qTableName("posteventProc"); diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index f3dd920..e1823e6 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -1611,6 +1611,8 @@ void tst_QSqlQuery::prepare_bind_exec() QFETCH( QString, dbName ); QSqlDatabase db = QSqlDatabase::database( dbName ); CHECK_DATABASE( db ); + if(db.driverName().startsWith("QIBASE") && (db.databaseName() == "silence.nokia.troll.no:c:\\ibase\\testdb_ascii" || db.databaseName() == "/opt/interbase/qttest.gdb")) + QSKIP("Can't transliterate extended unicode to ascii", SkipSingle); { // new scope for SQLITE -- cgit v0.12 From f5795d4e84b132f5c8640c73265763ecfda566d3 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 11 Aug 2009 09:02:17 +0200 Subject: compile fix for Win32 use correct function pointer (Get) Reviewed-by: Thomas Hartmann --- src/gui/kernel/qapplication_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index a0142e1..45e6645 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -835,7 +835,7 @@ void qt_init(QApplicationPrivate *priv, int) priv->SetGestureConfig = (PtrSetGestureConfig)QLibrary::resolve(QLatin1String("user32"), "SetGestureConfig"); - priv->SetGestureConfig = + priv->GetGestureConfig = (PtrGetGestureConfig)QLibrary::resolve(QLatin1String("user32"), "GetGestureConfig"); priv->BeginPanningFeedback = -- cgit v0.12 From 20050c010038ab10c29b68833b2054b87dd59a33 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 11 Aug 2009 09:28:27 +0200 Subject: Compile QtGui on Linux with no Gtk development package present. --- src/gui/image/qiconloader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index e6e3074..2204ac9 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -73,8 +73,12 @@ static QString systemThemeName() QString result; #ifdef Q_WS_X11 if (X11->desktopEnvironment == DE_GNOME) { +#if defined(QT_NO_STYLE_GTK) + result = QLatin1String("gnome"); +#else result = QGtk::getGConfString(QLatin1String("/desktop/gnome/interface/icon_theme"), QLatin1String("gnome")); +#endif } else if (X11->desktopEnvironment == DE_KDE) { QString kdeDefault = X11->desktopVersion >= 4 ? QString::fromLatin1("oxygen") : -- cgit v0.12 From 9ccaa95e7dbae96527b3ec502d4c604a4d691aec Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 11 Aug 2009 09:36:12 +0200 Subject: Tr-Fixes in Qt Designer. --- .../designer/src/components/propertyeditor/previewframe.cpp | 12 ++++++------ tools/designer/src/lib/shared/pluginmanager.cpp | 2 +- tools/designer/src/lib/shared/previewmanager.cpp | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/designer/src/components/propertyeditor/previewframe.cpp b/tools/designer/src/components/propertyeditor/previewframe.cpp index 33073e2..913a476 100644 --- a/tools/designer/src/components/propertyeditor/previewframe.cpp +++ b/tools/designer/src/components/propertyeditor/previewframe.cpp @@ -42,15 +42,17 @@ #include "previewframe.h" #include "previewwidget.h" +#include +#include #include #include #include #include -#include QT_BEGIN_NAMESPACE -namespace { +namespace qdesigner_internal { + class PreviewMdiArea: public QMdiArea { public: PreviewMdiArea(QWidget *parent = 0) : QMdiArea(parent) {} @@ -65,13 +67,11 @@ namespace { QPainter p(paintWidget); p.fillRect(rect(), paintWidget->palette().color(backgroundRole()).dark()); p.setPen(QPen(Qt::white)); + //: Palette editor background p.drawText(0, height() / 2, width(), height(), Qt::AlignHCenter, - tr("The moose in the noose\nate the goose who was loose.")); + QCoreApplication::translate("qdesigner_internal::PreviewMdiArea", "The moose in the noose\nate the goose who was loose.")); return true; } -} - -namespace qdesigner_internal { PreviewFrame::PreviewFrame(QWidget *parent) : QFrame(parent), diff --git a/tools/designer/src/lib/shared/pluginmanager.cpp b/tools/designer/src/lib/shared/pluginmanager.cpp index b8c1c40..58d6c5c 100644 --- a/tools/designer/src/lib/shared/pluginmanager.cpp +++ b/tools/designer/src/lib/shared/pluginmanager.cpp @@ -331,7 +331,7 @@ static bool parsePropertySpecs(QXmlStreamReader &sr, const bool noTr = notrS == QLatin1String("true") || notrS == QLatin1String("1"); QDesignerCustomWidgetSharedData::StringPropertyType v(typeStringToType(type, &typeOk), !noTr); if (!typeOk) { - *errorMessage = QDesignerPluginManager::tr("'%1' is not a valid string property specification!").arg(type); + *errorMessage = QDesignerPluginManager::tr("'%1' is not a valid string property specification.").arg(type); return false; } rc->insert(name, v); diff --git a/tools/designer/src/lib/shared/previewmanager.cpp b/tools/designer/src/lib/shared/previewmanager.cpp index 890bfc1..81bf6fb 100644 --- a/tools/designer/src/lib/shared/previewmanager.cpp +++ b/tools/designer/src/lib/shared/previewmanager.cpp @@ -257,7 +257,9 @@ void PreviewDeviceSkin::slotPopupMenu() connect(directionGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotDirection(QAction*))); directionGroup->setExclusive(true); m_directionUpAction = createCheckableActionIntData(tr("&Portrait"), DirectionUp, m_direction, directionGroup, this); + //: Rotate form preview counter-clockwise m_directionLeftAction = createCheckableActionIntData(tr("Landscape (&CCW)"), DirectionLeft, m_direction, directionGroup, this); + //: Rotate form preview clockwise m_directionRightAction = createCheckableActionIntData(tr("&Landscape (CW)"), DirectionRight, m_direction, directionGroup, this); m_closeAction = new QAction(tr("&Close"), this); connect(m_closeAction, SIGNAL(triggered()), parentWidget(), SLOT(close())); -- cgit v0.12 From ec82f4fee841cc312a2d3517de36941ad8bee158 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 11 Aug 2009 09:36:49 +0200 Subject: Updated and purged German translation of Qt Designer. --- translations/designer_de.ts | 653 +++++++++++++++++++++++--------------------- 1 file changed, 336 insertions(+), 317 deletions(-) diff --git a/translations/designer_de.ts b/translations/designer_de.ts index 5109544..405e424 100644 --- a/translations/designer_de.ts +++ b/translations/designer_de.ts @@ -2,30 +2,6 @@ - - - - <object> - <Objekt> - - - - <signal> - <Signal> - - - - <slot> - <Slot> - - - - The moose in the noose -ate the goose who was loose. - - - - AbstractFindWidget @@ -202,34 +178,6 @@ ate the goose who was loose. - BrushManagerProxy - - - The element '%1' is missing the required attribute '%2'. - Bei dem Element fehlt das erforderliche Attribut '%2'. - - - - Empty brush name encountered. - Fehlender Name bei der Brush-Definition. - - - - An unexpected element '%1' was encountered. - Ein ungültiges Element '%1' wurde festgestellt. - - - - An error occurred when reading the brush definition file '%1' at line line %2, column %3: %4 - Fehler beim Lesen der Brush-Datei '%1' bei Zeile %2, Spalte %3: %4 - - - - An error occurred when reading the resource file '%1' at line %2, column %3: %4 - Fehler beim Lesen der Ressourcen-Datei '%1' bei Zeile %2, Spalte %3: %4 - - - BrushPropertyManager @@ -565,7 +513,7 @@ ate the goose who was loose. Werkzeugleiste löschen - + Set action text Text der Aktion setzen @@ -576,12 +524,12 @@ ate the goose who was loose. - + Move action Aktion verschieben - + Change Title Titel ändern @@ -626,7 +574,7 @@ ate the goose who was loose. Tabellarisches Layout vereinfachen - + Create button group Buttons gruppieren @@ -680,7 +628,7 @@ ate the goose who was loose. Skript ändern - + Changed '%1' of '%2' '%1' von '%2' geändert @@ -759,6 +707,24 @@ ate the goose who was loose. + ConnectionDelegate + + + <object> + <Objekt> + + + + <signal> + <Signal> + + + + <slot> + <Slot> + + + DPI_Chooser @@ -782,7 +748,7 @@ ate the goose who was loose. Designer - + Qt Designer Qt Designer @@ -807,17 +773,7 @@ ate the goose who was loose. Haben Sie ein Layout eingefügt? - - Invalid ui file: The root element <ui> is missing. - Fehler beim Lesen der ui-Datei: Das Wurzelelement <ui> fehlt. - - - - An error has occurred while reading the ui file at line %1, column %2: %3 - Fehler beim Lesen der ui-Datei bei Zeile %1, Spalte %2: %3 - - - + This file cannot be read because it was created using %1. Die Datei kann nicht gelesen werden, da sie mit %1 erzeugt wurde. @@ -827,17 +783,27 @@ ate the goose who was loose. Die Datei kann nicht gelesen werden, da sie mit dem Designer der Version %1 erzeugt wurde. - + This file cannot be read because the extra info extension failed to load. Die Datei kann nicht gelesen werden (Fehler beim Laden der Daten der ExtraInfoExtension). - + The converted file could not be read. Die konvertierte Datei konnte nicht gelesen werden. - + + Invalid UI file: The root element <ui> is missing. + Fehler beim Lesen der ui-Datei: Das Wurzelelement <ui> fehlt. + + + + An error has occurred while reading the UI file at line %1, column %2: %3 + Fehler beim Lesen der ui-Datei bei Zeile %1, Spalte %2: %3 + + + This file was created using Designer from Qt-%1 and will be converted to a new form by Qt Designer. Die Datei wurde mit dem Designer der Version %1 erzeugt und wird zu einem neuen Formular konvertiert. @@ -859,7 +825,7 @@ ate the goose who was loose. Bitte wandeln Sie sie mit dem Befehl <b>uic3&nbsp;-convert</b> zum Format von Qt 4. - + Custom Widgets Benutzerdefinierte Widgets @@ -993,7 +959,7 @@ ate the goose who was loose. EmbeddedOptionsControl - + <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> Format embedded device profile description <html><table><tr><td><b>Font</b></td><td>%1, %2</td></tr><tr><td><b>Stil</b></td><td>%3</td></tr><tr><td><b>Auflösung</b></td><td>%4 x %5</td></tr></table></html> @@ -1068,7 +1034,7 @@ ate the goose who was loose. FormBuilder - + Invalid stretch value for '%1': '%2' Parsing layout stretch values Ungültiger Stretch-Wert für '%1': '%2' @@ -1150,7 +1116,7 @@ ate the goose who was loose. FormWindow - + Unexpected element <%1> Ungültiges Element <%1> @@ -1241,14 +1207,6 @@ ate the goose who was loose. - LanguageResourceDialog - - - Choose Resource - Ressource auswählen - - - MainWindowBase @@ -1336,17 +1294,9 @@ ate the goose who was loose. - NewFormWidget - - - Unable to open the form template file '%1': %2 - Die Formularvorlage %1 konnte nicht geöffnet werden: %2 - - - ObjectInspectorModel - + Object Objekt @@ -1369,7 +1319,7 @@ ate the goose who was loose. ObjectNameDialog - + Change Object Name Objektnamen bearbeiten @@ -1389,7 +1339,7 @@ ate the goose who was loose. 1 - 1 + 1 @@ -1403,21 +1353,6 @@ ate the goose who was loose. PreviewConfigurationWidget - - Default - Vorgabe - - - - None - Kein - - - - Browse... - Durchsuchen... - - Form Formular @@ -1451,7 +1386,7 @@ ate the goose who was loose. PromotionModel - + Not used Usage of promoted widgets Nicht verwendet @@ -1475,12 +1410,12 @@ ate the goose who was loose. - An error has occurred while reading the ui file at line %1, column %2: %3 + An error has occurred while reading the UI file at line %1, column %2: %3 Fehler beim Lesen der ui-Datei bei Zeile %1, Spalte %2: %3 - Invalid ui file: The root element <ui> is missing. + Invalid UI file: The root element <ui> is missing. Fehler beim Lesen der ui-Datei: Das Wurzelelement <ui> fehlt. @@ -1489,7 +1424,7 @@ ate the goose who was loose. Es konnte kein Widget der Klasse '%1' erzeugt werden. - + Attempt to add child that is not of class QWizardPage to QWizard. Es wurde versucht, einem Objekt der Klasse QWizard eine Seite hinzuzufügen, die nicht vom Typ QWizardPage ist. @@ -1505,7 +1440,7 @@ This indicates an inconsistency in the ui-file. Leeres Widget-Item in %1 '%2'. - + Flags property are not supported yet. Eigenschaften des Typs "Flag" werden nicht unterstützt. @@ -1676,22 +1611,17 @@ Script: %3 Einstellungen... - + Clear &Menu Menü &löschen - + CTRL+SHIFT+S CTRL+SHIFT+S - - CTRL+Q - CTRL+Q - - - + CTRL+R CTRL+R @@ -1745,7 +1675,7 @@ Script: %3 Designer-UI-Dateien (*.%1);;Alle Dateien (*) - + %1 already exists. Do you want to replace it? Die Datei %1 existiert bereits. @@ -1757,7 +1687,7 @@ Möchten Sie sie überschreiben? Das Formular %1 wurde gespeichert... - + &Recent Forms &Zuletzt bearbeitete Formulare @@ -1841,7 +1771,7 @@ Möchten Sie einen anderen Namen eingeben oder ein neues Formular erzeugen?Vorschau &schließen - + Save &Image... &Vorschaubild speichern... @@ -1856,7 +1786,7 @@ Möchten Sie einen anderen Namen eingeben oder ein neues Formular erzeugen?&Zusätzliche Schriftarten... - + The file %1 could not be opened. Reason: %2 Would you like to retry or select a different file? @@ -1890,7 +1820,7 @@ Möchten Sie es noch einmal versuchen? Die Datei %1 konnte nicht geschrieben werden. - + &New... &Neu... @@ -1921,17 +1851,17 @@ Möchten Sie es noch einmal versuchen? - + &Close &Schließen - + View &Code... &Code anzeigen... - + Save Form As Formular unter einem anderen Namen speichern @@ -1963,7 +1893,7 @@ Möchten Sie es noch einmal versuchen? %1 wurde gedruckt. - + ALT+CTRL+S ALT+CTRL+S @@ -2062,7 +1992,7 @@ Möchten Sie es noch einmal versuchen? QDesignerMenu - + Type Here Geben Sie Text ein @@ -2072,7 +2002,7 @@ Möchten Sie es noch einmal versuchen? Trenner hinzufügen - + Insert separator Trenner einfügen @@ -2088,12 +2018,12 @@ Möchten Sie es noch einmal versuchen? - + Add separator Trenner hinzufügen - + Insert action Aktion einfügen @@ -2101,12 +2031,12 @@ Möchten Sie es noch einmal versuchen? QDesignerMenuBar - + Type Here Geben Sie Text ein - + Remove Menu '%1' Menü '%1' öschen @@ -2124,12 +2054,27 @@ Möchten Sie es noch einmal versuchen? QDesignerPluginManager - + An XML error was encountered when parsing the XML of the custom widget %1: %2 Fehler beim Auswerten des XML des benutzerdefinierten Widgets %1: %2 - + + A required attribute ('%1') is missing. + Bei dem Element fehlt ein erforderliches Attribut ('%1'). + + + + An invalid property specification ('%1') was encountered. Supported types: %2 + '%1' ist keine gültige Spezifikation einer Eigenschaft. Die folgenden Typen werden unterstützt: %2 + + + + '%1' is not a valid string property specification. + '%1' ist keine gültige Spezifikation einer Zeichenketten-Eigenschaft. + + + The XML of the custom widget %1 does not contain any of the elements <widget> or <ui>. Der XML-Code für das Widget %1 enthält kein gültiges Wurzelelement (<widget>, <ui>). @@ -2155,12 +2100,12 @@ Möchten Sie es noch einmal versuchen? QDesignerResource - + The layout type '%1' is not supported, defaulting to grid. Der Layout-Typ '%1' wird nicht unterstützt; es wurde ein Grid-Layout erzeugt. - + 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. Die Container-Extension des Widgets '%1' (%2) gab für Seite %5 ein Widget '%3' (%4) zurück, was nicht von Designer verwaltet wird. @@ -2228,30 +2173,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier Widget Box - Widgetbox - - - - QDesignerWidgetBox - - - An error has been encountered at line %1 of %2: %3 - Fehler bei Zeile %1 von %2: %3 - - - - Unexpected element <%1> encountered when parsing for <widget> or <ui> - Es wurde ein Element <%1> gefunden; (anstatt <widget> or <ui>) - - - - Unexpected end of file encountered when parsing widgets. - Vorzeitiges Dateiende beim Lesen der Widget-Box-Konfiguration. - - - - A widget element could not be found. - Es fehlt das Widget-Element. + Widget-Box @@ -2292,12 +2214,12 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier Werkzeugleisten - + Save Forms? Formulare speichern? - + &View &Ansicht @@ -2307,7 +2229,12 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier &Einstellungen - + + Widget Box + Widgetbox + + + If you do not review your documents, all your changes will be lost. Die Änderungen gehen verloren, wenn Sie sich die Formulare nicht noch einmal ansehen. @@ -2338,7 +2265,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier - The file <b>%1</b> is not a valid Designer ui file. + The file <b>%1</b> is not a valid Designer UI file. Die Datei <b>%1</b> ist keine gültige Designer-Datei. @@ -2353,7 +2280,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QFormBuilder - + An empty class name was passed on to %1 (object name: '%2'). Empty class name passed to widget factory method Der Methode %1 wurde ein leerer Klassennamen übergeben (Name '%2'). @@ -2369,7 +2296,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QFormBuilder konnte kein Objekt der Klasse '%1' erzeugen. - + The layout type `%1' is not supported. Layouts des Typs `%1' werden nicht unterstützt. @@ -2393,16 +2320,6 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier The property %1 could not be written. The type %2 is not supported yet. Die Eigenschaft %1 konnte nicht geschrieben werden, da der Typ %2 nicht unterstützt wird. - - - The enumeration-value '%1' is invalid. The default value '%2' will be used instead. - Der Aufzählungswert '%1' ist ungültig. Der Vorgabewert '%2' wird verwendet. - - - - The flag-value '%1' is invalid. Zero will be used instead. - Der Maskenwert '%1' ist ungültig. Es wird 0 verwendet. - QStackedWidgetEventFilter @@ -2447,7 +2364,8 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier Seite %1 von %2 - + + Insert Page Seite einfügen @@ -2455,7 +2373,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QStackedWidgetPreviewEventFilter - + Go to previous page of %1 '%2' (%3/%4). Gehe zur vorigen Seite von %1 '%2' (%3/%4). @@ -2488,7 +2406,8 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier Seite %1 von %2 - + + Insert Page Seite einfügen @@ -2759,7 +2678,7 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QtGradientEditor - + Start X Anfangswert X @@ -2811,6 +2730,36 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier Winkel + + Linear + Linear + + + + Radial + Radial + + + + Conical + Konisch + + + + Pad + Auffüllen + + + + Repeat + Wiederholen + + + + Reflect + Spiegeln + + Form Form @@ -3087,31 +3036,31 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier Möchten Sie den ausgewählten Gradienten löschen? - + New... Neu... - - + + Edit... Ändern... - - + + Rename Umbenennen - - + + Remove Löschen - + Gradient View Gradientenanzeige @@ -3119,7 +3068,6 @@ Container-Seiten sollten ausschließlich im XML der domXML()-Methode spezifizier QtGradientViewDialog - Select Gradient Gradienten auswählen @@ -3545,24 +3493,24 @@ Dies kann zum Beispiel eine Sprachkennung wie "_de" sein. QtResourceView - + Size: %1 x %2 %3 Größe: %1 x %2 %3 - + Edit Resources... Ressourcen bearbeiten... - + Reload Neu laden - + Copy Path Pfad kopieren @@ -3570,7 +3518,7 @@ Dies kann zum Beispiel eine Sprachkennung wie "_de" sein. QtResourceViewDialog - + Select Resource Ressource auswählen @@ -3834,7 +3782,7 @@ Möchten Sie sie überschreiben? ScriptErrorDialog - + An error occurred while running the scripts for "%1": Bei der Ausführung der Skripte für "%1" sind Fehler aufgetreten: @@ -3978,8 +3926,8 @@ Möchten Sie sie überschreiben? - - %1<br/>%2<br/>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> + + %1<br/>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).<br/><br/>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.<br/> @@ -3994,7 +3942,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::ActionEditor - + Actions Aktionen @@ -4009,7 +3957,7 @@ Möchten Sie sie überschreiben? Löschen - + New action Neue Aktion @@ -4019,7 +3967,7 @@ Möchten Sie sie überschreiben? Aktion ändern - + Edit... Ändern... @@ -4049,7 +3997,7 @@ Möchten Sie sie überschreiben? Alles auswählen - + Icon View Icon-Ansicht @@ -4059,7 +4007,7 @@ Möchten Sie sie überschreiben? Detaillierte Ansicht - + Remove actions Aktionen löschen @@ -4074,7 +4022,7 @@ Möchten Sie sie überschreiben? Verwendet in - + Configure Action Editor Aktionseditor konfigurieren @@ -4113,9 +4061,37 @@ Möchten Sie sie überschreiben? + qdesigner_internal::BrushManagerProxy + + + The element '%1' is missing the required attribute '%2'. + Bei dem Element fehlt das erforderliche Attribut '%2'. + + + + Empty brush name encountered. + Fehlender Name bei der Brush-Definition. + + + + An unexpected element '%1' was encountered. + Ein ungültiges Element '%1' wurde festgestellt. + + + + An error occurred when reading the brush definition file '%1' at line line %2, column %3: %4 + Fehler beim Lesen der Brush-Datei '%1' bei Zeile %2, Spalte %3: %4 + + + + An error occurred when reading the resource file '%1' at line %2, column %3: %4 + Fehler beim Lesen der Ressourcen-Datei '%1' bei Zeile %2, Spalte %3: %4 + + + qdesigner_internal::BuddyEditor - + Add buddy Buddy hinzufügen @@ -4149,7 +4125,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::BuddyEditorPlugin - + Edit Buddies Buddies bearbeiten @@ -4157,7 +4133,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::BuddyEditorTool - + Edit Buddies Buddies bearbeiten @@ -4211,7 +4187,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::CodeDialog - + Save... Speichern... @@ -4269,7 +4245,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::ColorAction - + Text Color Schriftfarbe @@ -4277,7 +4253,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::ComboBoxTaskMenu - + Edit Items... Einträge ändern... @@ -4369,7 +4345,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::ContainerWidgetTaskMenu - + Insert Page Before Current Page Seite davor einfügen @@ -4432,7 +4408,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::DesignerPropertyManager - + AlignLeft Linksbündig ausrichten @@ -4773,7 +4749,7 @@ Möchten Sie sie überschreiben? Fehler beim Einfügen - + Lay out Layout @@ -4784,7 +4760,7 @@ Möchten Sie sie überschreiben? Widget einfügen - + Paste %n action(s) Eine Aktion einfügen @@ -4820,7 +4796,7 @@ Möchten Sie sie überschreiben? Bitte lösen Sie das Layout des gewünschten Containers auf und wählen Sie ihn erneut aus, um die Widgets einzufügen. - + Select Ancestor Ãœbergeordnetes Widget auswählen @@ -4830,7 +4806,7 @@ Möchten Sie sie überschreiben? Ein auf QMainWindow basierendes Formular enthält kein zentrales Widget. - + Raise widgets Widgets nach vorn bringen @@ -4843,7 +4819,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::FormWindowBase - + Delete Löschen @@ -4856,7 +4832,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::FormWindowManager - + Cu&t &Ausschneiden @@ -4958,7 +4934,7 @@ Möchten Sie sie überschreiben? Ordnet die ausgewählten Objekte senkrecht an - + Lay Out in a &Grid Objekte &tabellarisch anordnen @@ -5008,12 +4984,12 @@ Möchten Sie sie überschreiben? Vorschau des Formulars - + Form &Settings... Formular&einstellungen... - + Break Layout Layout auflösen @@ -5034,7 +5010,7 @@ Möchten Sie sie überschreiben? Formulareinstellungen - %1 - + Removes empty columns and rows Entfernt unbesetzte Zeilen und Spalten @@ -5108,7 +5084,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::GroupBoxTaskMenu - + Change title... Titel ändern... @@ -5124,7 +5100,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::IconSelector - + The pixmap file '%1' cannot be read. Die Pixmap-Datei '%1' kann nicht gelesen werden. @@ -5222,13 +5198,13 @@ Möchten Sie sie überschreiben? Eigenschaften &<< - + Properties &>> Eigenschaften &>> - + Items List Liste der Elemente @@ -5276,7 +5252,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::LabelTaskMenu - + Change rich text... Formatierbaren Text ändern... @@ -5287,9 +5263,17 @@ Möchten Sie sie überschreiben? + qdesigner_internal::LanguageResourceDialog + + + Choose Resource + Ressource auswählen + + + qdesigner_internal::LineEditTaskMenu - + Change text... Text ändern... @@ -5297,7 +5281,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::ListWidgetEditor - + Edit List Widget List-Widget ändern @@ -5315,7 +5299,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::ListWidgetTaskMenu - + Edit Items... Elemente ändern... @@ -5351,7 +5335,7 @@ Möchten Sie sie überschreiben? qdesigner_internal::MenuTaskMenu - + Remove Löschen @@ -5451,7 +5435,7 @@ Please select another name. qdesigner_internal::NewFormWidget - + Default size Vorgabe @@ -5497,7 +5481,12 @@ Please select another name. Das Formular konnte nicht geladen werden - + + Unable to open the form template file '%1': %2 + Die Formularvorlage '%1' konnte nicht geöffnet werden: %2 + + + Internal error: No template selected. Interner Fehler: Es ist keine Vorlage selektiert. @@ -5530,7 +5519,7 @@ Please select another name. qdesigner_internal::NewPromotedClassPanel - + Add Hinzufügen @@ -5568,23 +5557,20 @@ Please select another name. qdesigner_internal::ObjectInspector - - &Find in Text... - &Suchen... - - - - qdesigner_internal::ObjectInspector::ObjectInspectorPrivate - - + Change Current Page Seite wechseln + + + &Find in Text... + &Suchen... + qdesigner_internal::OrderDialog - + Index %1 (%2) Position %1 (%2) @@ -5665,7 +5651,7 @@ Please select another name. qdesigner_internal::PaletteEditorButton - + Change Palette Palette ändern @@ -5673,7 +5659,7 @@ Please select another name. qdesigner_internal::PaletteModel - + Color Role Farbrolle @@ -5725,7 +5711,7 @@ Please select another name. qdesigner_internal::PlainTextEditorDialog - + Edit text Text bearbeiten @@ -5767,10 +5753,6 @@ Please select another name. New custom widget plugins have been found. Es wurden neuinstallierten Plugins mit benutzerdefinierten Widgets gefunden. - - 1 - 1 - qdesigner_internal::PreviewActionGroup @@ -5781,9 +5763,24 @@ Please select another name. - qdesigner_internal::PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate + qdesigner_internal::PreviewConfigurationWidget + + + Default + Vorgabe + + + + None + Kein + + + + Browse... + Durchsuchen... + - + Load Custom Device Skin Benutzerdefinierten Geräte-Skin laden @@ -5818,7 +5815,24 @@ Please select another name. qdesigner_internal::PreviewDeviceSkin - + + &Portrait + &Hochformat + + + + Landscape (&CCW) + Rotate form preview counter-clockwise + Querformat (&entgegen Uhrzeigersinn) + + + + &Landscape (CW) + Rotate form preview clockwise + Querformat (im &Uhrzeigersinn) + + + &Close &Schließen @@ -5826,12 +5840,22 @@ Please select another name. qdesigner_internal::PreviewManager - + %1 - [Preview] %1 - [Vorschau] + qdesigner_internal::PreviewMdiArea + + + The moose in the noose +ate the goose who was loose. + Palette editor background + + + + qdesigner_internal::PreviewWidget @@ -5943,7 +5967,7 @@ Please select another name. qdesigner_internal::PropertyEditor - + Add Dynamic Property... Dynamische Eigenschaft hinzufügen... @@ -6178,7 +6202,7 @@ Klasse: %2 qdesigner_internal::QDesignerWidgetBox - + Unexpected element <%1> Ungültiges Element <%1> @@ -6196,44 +6220,31 @@ Klasse: %2 %2 Der XML-Code für das Widget %1 enthält keine Widgets.%2 - - - qdesigner_internal::QtGradientEditor - - - Linear - Linear - - - - Radial - Radial - - - Conical - Konisch + + An error has been encountered at line %1 of %2: %3 + Fehler bei Zeile %1 von %2: %3 - - Pad - Auffüllen + + Unexpected element <%1> encountered when parsing for <widget> or <ui> + An Stelle des erwarteten <widget>- oder <ui>-Elementes wurde <%1> gefunden - - Repeat - Wiederholen + + Unexpected end of file encountered when parsing widgets. + Vorzeitiges Dateiende beim Lesen der Widget-Box-Konfiguration. - - Reflect - Spiegeln + + A widget element could not be found. + Es fehlt das Widget-Element. qdesigner_internal::QtGradientStopsController - + H H @@ -6408,7 +6419,7 @@ Klasse: %2 qdesigner_internal::ScriptDialog - + Edit script Skript bearbeiten @@ -6458,7 +6469,7 @@ Klasse: %2 qdesigner_internal::SignalSlotEditorPlugin - + Edit Signals/Slots Signale und Slots bearbeiten @@ -6471,7 +6482,7 @@ Klasse: %2 qdesigner_internal::SignalSlotEditorTool - + Edit Signals/Slots Signale und Slots bearbeiten @@ -6479,7 +6490,7 @@ Klasse: %2 qdesigner_internal::StatusBarTaskMenu - + Remove Löschen @@ -6487,7 +6498,7 @@ Klasse: %2 qdesigner_internal::StringListEditorButton - + Change String List Zeichenkettenliste ändern @@ -6495,7 +6506,7 @@ Klasse: %2 qdesigner_internal::StyleSheetEditorDialog - + Edit Style Sheet Stylesheet bearbeiten @@ -6562,7 +6573,7 @@ Klasse: %2 qdesigner_internal::TabOrderEditorPlugin - + Edit Tab Order Tabulatorreihenfolge bearbeiten @@ -6570,7 +6581,7 @@ Klasse: %2 qdesigner_internal::TabOrderEditorTool - + Edit Tab Order Tabulatorreihenfolge bearbeiten @@ -6578,7 +6589,7 @@ Klasse: %2 qdesigner_internal::TableWidgetEditor - + New Column Neue Spalte @@ -6603,13 +6614,13 @@ Klasse: %2 Eigenschaften &<< - + Properties &>> Eigenschaften &>> - + Edit Table Widget Table Widget ändern @@ -6627,7 +6638,7 @@ Klasse: %2 qdesigner_internal::TableWidgetTaskMenu - + Edit Items... Elemente ändern... @@ -6658,7 +6669,7 @@ Klasse: %2 qdesigner_internal::TextEditTaskMenu - + Change HTML... HTML ändern... @@ -6681,7 +6692,7 @@ Klasse: %2 qdesigner_internal::TextEditor - + Choose Resource... Ressource auswählen... @@ -6691,12 +6702,12 @@ Klasse: %2 Datei auswählen... - + Choose a File - + ... ... @@ -6704,7 +6715,7 @@ Klasse: %2 qdesigner_internal::ToolBarEventFilter - + Insert Separator Trenner einfügen @@ -6732,7 +6743,7 @@ Klasse: %2 qdesigner_internal::TreeWidgetEditor - + &Columns &Spalten @@ -6747,24 +6758,24 @@ Klasse: %2 Gemeinsame Eigenschaften - + New Item Neues Element - + Properties &<< Eigenschaften &<< - + Properties &>> Eigenschaften &>> - + New Column Neue Spalte @@ -6784,13 +6795,13 @@ Klasse: %2 Elemente + - New Subitem - + New &Subitem Neues &untergeordnetes Element @@ -6858,7 +6869,7 @@ Klasse: %2 qdesigner_internal::TreeWidgetTaskMenu - + Edit Items... Elemente ändern... @@ -6866,7 +6877,7 @@ Klasse: %2 qdesigner_internal::WidgetBox - + Warning: Widget creation failed in the widget box. This could be caused by invalid custom widget XML. Warnung: Die Erzeugung des Widgets in der Widget-Box schlug fehl. Das könnte durch fehlerhaften XML-Code benutzerdefinierter Widgets verursacht worden sein. @@ -6884,7 +6895,7 @@ Klasse: %2 Benutzerdefinierte Widgets - + Expand all Alles aufklappen @@ -6925,7 +6936,7 @@ Klasse: %2 qdesigner_internal::WidgetEditorTool - + Edit Widgets Widgets bearbeiten @@ -6933,7 +6944,7 @@ Klasse: %2 qdesigner_internal::WidgetFactory - + The custom widget factory registered for widgets of class %1 returned 0. Die Factory für benutzerdefinierte Widgets der Klasse %1 gab einen 0-Zeiger zurück. @@ -6986,4 +6997,12 @@ This indicates an inconsistency in the ui-file. %1 % + + qdesigner_internal::ZoomablePreviewDeviceSkin + + + &Zoom + &Vergrößern + + -- cgit v0.12 From dadb7b7ad36c43757d96b540b40cc3d81dca69d2 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 11 Aug 2009 11:36:48 +0200 Subject: QTableView with swapped headers PageUp/PageDown bug QTableView with header-swapped rows wouldn't scroll correctly when PageUp or PageDown pressed. Simplified calculation for next currentIndex provided in QTableView::moveCursor. Task-number: 259308 Reviewed-by: olivier --- src/gui/itemviews/qtableview.cpp | 17 ++++++++-------- tests/auto/qtableview/tst_qtableview.cpp | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 2009499..8fc99a0 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -1197,17 +1197,16 @@ QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifi visualRow = bottom; break; case MovePageUp: { - int top = 0; - while (top < bottom && d->isVisualRowHiddenOrDisabled(top, visualColumn)) - ++top; - int newRow = qMax(rowAt(visualRect(current).top() - d->viewport->height()), top); - return d->model->index(qBound(0, newRow, bottom), current.column(), d->root); + int newRow = rowAt(visualRect(current).top() - d->viewport->height()); + if (newRow == -1) + newRow = d->logicalRow(0); + return d->model->index(newRow, current.column(), d->root); } case MovePageDown: { - int newRow = qMin(rowAt(visualRect(current).bottom() + d->viewport->height()), bottom); - if (newRow < 0) - newRow = bottom; - return d->model->index(qBound(0, newRow, bottom), current.column(), d->root); + int newRow = rowAt(visualRect(current).bottom() + d->viewport->height()); + if (newRow == -1) + newRow = d->logicalRow(bottom); + return d->model->index(newRow, current.column(), d->root); }} int logicalRow = d->logicalRow(visualRow); diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index eb39dd7..597e24a 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -42,6 +42,7 @@ #include #include +#include "../../shared/util.h" //TESTED_CLASS= //TESTED_FILES= @@ -177,6 +178,7 @@ private slots: void task227953_setRootIndex(); void task240266_veryBigColumn(); void task248688_autoScrollNavigation(); + void task259308_scrollVerticalHeaderSwappedSections(); void mouseWheel_data(); void mouseWheel(); @@ -3253,6 +3255,37 @@ void tst_QTableView::addColumnWhileEditing() QCOMPARE(editor->geometry(), view.visualRect(last)); } +void tst_QTableView::task259308_scrollVerticalHeaderSwappedSections() +{ + QStandardItemModel model; + model.setRowCount(50); + model.setColumnCount(2); + for (int row = 0; row < model.rowCount(); ++row) + for (int col = 0; col < model.columnCount(); ++col) { + const QModelIndex &idx = model.index(row, col); + model.setData(idx, QVariant(row), Qt::EditRole); + } + + QTableView tv; + tv.setModel(&model); + tv.show(); + tv.verticalHeader()->swapSections(0, model.rowCount() - 1); + + QTest::qWait(60); + QTest::keyClick(&tv, Qt::Key_PageUp); // PageUp won't scroll when at top + QTRY_COMPARE(tv.rowAt(0), tv.verticalHeader()->logicalIndex(0)); + + int newRow = tv.rowAt(tv.viewport()->height()); + if (newRow == tv.rowAt(tv.viewport()->height() - 1)) // Overlapping row + newRow++; + QTest::keyClick(&tv, Qt::Key_PageDown); // Scroll down and check current + QTRY_COMPARE(tv.currentIndex().row(), newRow); + + tv.setCurrentIndex(model.index(0, 0)); + QTest::qWait(60); + QTest::keyClick(&tv, Qt::Key_PageDown); // PageDown won't scroll when at the bottom + QTRY_COMPARE(tv.rowAt(tv.viewport()->height() - 1), tv.verticalHeader()->logicalIndex(model.rowCount() - 1)); +} QTEST_MAIN(tst_QTableView) #include "tst_qtableview.moc" -- cgit v0.12 From 73b61029b00e12f313f9097d665539792d53e885 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Tue, 11 Aug 2009 13:13:11 +0200 Subject: Fix BC breakage caused by commit 7aa2d76d. Code compiled with 4.5 expects to find the QBenchmarkIterationController() constructor, so ad an overload instead of replacing it. --- src/testlib/qbenchmark.cpp | 7 +++++++ src/testlib/qbenchmark.h | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index eaec02f..42ce662 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -197,6 +197,13 @@ QTest::QBenchmarkIterationController::QBenchmarkIterationController(RunMode runM if (runMode == RunOnce) QBenchmarkTestMethodData::current->runOnce = true; } + +QTest::QBenchmarkIterationController::QBenchmarkIterationController() +{ + QTest::beginBenchmarkMeasurement(); + i = 0; +} + /*! \internal */ QTest::QBenchmarkIterationController::~QBenchmarkIterationController() diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h index 87d34e7..7b1792d 100644 --- a/src/testlib/qbenchmark.h +++ b/src/testlib/qbenchmark.h @@ -65,6 +65,7 @@ class Q_TESTLIB_EXPORT QBenchmarkIterationController { public: enum RunMode { RepeatUntilValidMeasurement, RunOnce }; + QBenchmarkIterationController(); QBenchmarkIterationController(RunMode runMode); ~QBenchmarkIterationController(); bool isDone(); @@ -75,7 +76,7 @@ public: } #define QBENCHMARK \ - for (QTest::QBenchmarkIterationController __iteration_controller(QTest::QBenchmarkIterationController::RepeatUntilValidMeasurement); \ + for (QTest::QBenchmarkIterationController __iteration_controller(); \ __iteration_controller.isDone() == false; __iteration_controller.next()) #define QBENCHMARK_ONCE \ -- cgit v0.12 From 72ce054c0f5ed1691ad4056f03e240b69a39e8c7 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Tue, 11 Aug 2009 13:16:45 +0200 Subject: Compile. --- src/testlib/qbenchmark.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qbenchmark.h b/src/testlib/qbenchmark.h index 7b1792d..a9f38de 100644 --- a/src/testlib/qbenchmark.h +++ b/src/testlib/qbenchmark.h @@ -76,7 +76,7 @@ public: } #define QBENCHMARK \ - for (QTest::QBenchmarkIterationController __iteration_controller(); \ + for (QTest::QBenchmarkIterationController __iteration_controller; \ __iteration_controller.isDone() == false; __iteration_controller.next()) #define QBENCHMARK_ONCE \ -- cgit v0.12 From 507c0ff17beeddfd281a4e978c2612031ce49154 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 11 Aug 2009 13:16:51 +0200 Subject: Phonon: improve locking to make it safer to load a source Task-number: 259482 --- src/3rdparty/phonon/ds9/mediaobject.cpp | 32 ++++++++++++++++++++------------ src/3rdparty/phonon/ds9/mediaobject.h | 3 ++- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp index b163ad4..a4feef6 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.cpp +++ b/src/3rdparty/phonon/ds9/mediaobject.cpp @@ -192,8 +192,11 @@ namespace Phonon HRESULT hr = S_OK; - m_currentRender = w.graph; - m_currentRenderId = w.id; + { + QMutexLocker locker(&m_currentMutex); + m_currentRender = w.graph; + m_currentRenderId = w.id; + } if (w.task == ReplaceGraph) { int index = -1; for(int i = 0; i < FILTER_COUNT; ++i) { @@ -217,9 +220,6 @@ namespace Phonon m_graphHandle[index].handle = h; } } else if (w.task == Render) { - //we need to unlock here because the use might trigger a call to abort - //which uses the same mutex - locker.unlock(); if (w.filter) { //let's render pins w.graph->AddFilter(w.filter, 0); @@ -238,7 +238,6 @@ namespace Phonon if (hr != E_ABORT) { emit asyncRenderFinished(w.id, hr, w.graph); } - locker.relock(); } else if (w.task == Seek) { //that's a seekrequest ComPointer mediaSeeking(w.graph, IID_IMediaSeeking); @@ -311,12 +310,22 @@ namespace Phonon } } - m_currentRender = Graph(); - m_currentRenderId = 0; + { + QMutexLocker locker(&m_currentMutex); + m_currentRender = Graph(); + m_currentRenderId = 0; + } } void WorkerThread::abortCurrentRender(qint16 renderId) { + { + QMutexLocker locker(&m_currentMutex); + if (m_currentRender && m_currentRenderId == renderId) { + m_currentRender->Abort(); + } + } + QMutexLocker locker(&m_mutex); bool found = false; for(int i = 0; !found && i < m_queue.size(); ++i) { @@ -324,12 +333,11 @@ namespace Phonon if (w.id == renderId) { found = true; m_queue.removeAt(i); + if (m_queue.isEmpty()) { + m_waitCondition.reset(); + } } } - - if (m_currentRender && m_currentRenderId == renderId) { - m_currentRender->Abort(); - } } //tells the thread to stop processing diff --git a/src/3rdparty/phonon/ds9/mediaobject.h b/src/3rdparty/phonon/ds9/mediaobject.h index fe52604..a6beb5f 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.h +++ b/src/3rdparty/phonon/ds9/mediaobject.h @@ -143,7 +143,8 @@ namespace Phonon bool m_finished; quint16 m_currentWorkId; QWinWaitCondition m_waitCondition; - QMutex m_mutex; + QMutex m_mutex; // mutex for the m_queue, m_finished and m_currentWorkId + QMutex m_currentMutex; //mutex for current renderer and id //this is for WaitForMultipleObjects struct -- cgit v0.12 From 19059f306d1d8154bb330b7c428982baf6a964ec Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Tue, 11 Aug 2009 13:20:17 +0200 Subject: Perform the variable initalizations _before_ starting the clock. Removes a few of cycles erronously included in the results. --- src/testlib/qbenchmark.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp index 42ce662..8a2cc44 100644 --- a/src/testlib/qbenchmark.cpp +++ b/src/testlib/qbenchmark.cpp @@ -192,16 +192,16 @@ void QBenchmarkTestMethodData::setResult(qint64 value) */ QTest::QBenchmarkIterationController::QBenchmarkIterationController(RunMode runMode) { - QTest::beginBenchmarkMeasurement(); i = 0; if (runMode == RunOnce) QBenchmarkTestMethodData::current->runOnce = true; + QTest::beginBenchmarkMeasurement(); } QTest::QBenchmarkIterationController::QBenchmarkIterationController() { - QTest::beginBenchmarkMeasurement(); i = 0; + QTest::beginBenchmarkMeasurement(); } /*! \internal -- cgit v0.12 From 78f64021650372f177a62d1b46e5cd33dc3a3250 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 11 Aug 2009 13:57:28 +0200 Subject: Phonon: Video widget on Windows flickers when going to next video Now we just disable the updates during a short amount of time. This should give enough time to the video to start. Task-number: 251776 --- src/3rdparty/phonon/ds9/videowidget.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index 34ff8cb..07b9cf3 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -84,7 +84,19 @@ namespace Phonon void setCurrentRenderer(AbstractVideoRenderer *renderer) { m_currentRenderer = renderer; - update(); + //we disallow repaint on that widget for just a fraction of second + //this allows better transition between videos + setUpdatesEnabled(false); + m_flickerFreeTimer.start(20, this); + } + + void timerEvent(QTimerEvent *e) + { + if (e->timerId() == m_flickerFreeTimer.timerId()) { + m_flickerFreeTimer.stop(); + setUpdatesEnabled(true); + } + QWidget::timerEvent(e); } QSize sizeHint() const @@ -160,6 +172,7 @@ namespace Phonon VideoWidget *m_node; AbstractVideoRenderer *m_currentRenderer; QVariant m_restoreScreenSaverActive; + QBasicTimer m_flickerFreeTimer; }; VideoWidget::VideoWidget(QWidget *parent) -- cgit v0.12 From c1c4f55b099f38cb5b50c24378d74acf91ef964a Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Tue, 11 Aug 2009 14:14:23 +0200 Subject: Doc - Some documentation fixes for Model View documentation together with some clarification (Task 229722) on what is a current item, what are selected items, etc. Task: 229722 Reviewed-By: TrustMe --- doc/src/model-view-programming.qdoc | 220 +++++++++++++++++++++--------------- 1 file changed, 126 insertions(+), 94 deletions(-) diff --git a/doc/src/model-view-programming.qdoc b/doc/src/model-view-programming.qdoc index 7d7db19..0c7ea2f 100644 --- a/doc/src/model-view-programming.qdoc +++ b/doc/src/model-view-programming.qdoc @@ -373,13 +373,12 @@ In the model/view architecture, the model provides a standard interface that views and delegates use to access data. In Qt, the standard - interface is defined by the QAbstractItemModel class. No matter how - the items of data are stored in any underlying data structure, all - subclasses of QAbstractItemModel represent the data as a hierarchical - structure containing tables of items. - Views use this \e convention to access items of data in the model, but - they are not restricted in the way that they present this information - to the user. + interface is defined by the QAbstractItemModel class. No matter how the + items of data are stored in any underlying data structure, all subclasses + of QAbstractItemModel represent the data as a hierarchical structure + containing tables of items. Views use this \e convention to access items + of data in the model, but they are not restricted in the way that they + present this information to the user. \image modelview-models.png @@ -393,27 +392,26 @@ \section2 Model Indexes To ensure that the representation of the data is kept separate from the - way it is accessed, the concept of a \e{model index} is introduced. - Each piece of information that can be obtained via a model is - represented by a model index. Views and delegates use these indexes to - request items of data to display. + way it is accessed, the concept of a \e{model index} is introduced. Each + piece of information that can be obtained via a model is represented by + a model index. Views and delegates use these indexes to request items of + data to display. - As a result, only the model needs to know how to obtain data, and the - type of data managed by the model can be defined fairly generally. - Model indexes contain a pointer to the model that created them, and - this prevents confusion when working with more than one model. + As a result, only the model needs to know how to obtain data, and the type + of data managed by the model can be defined fairly generally. Model indexes + contain a pointer to the model that created them, and this prevents + confusion when working with more than one model. \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 0 - Model indexes provide \e temporary references to pieces of information, - and can be used to retrieve or modify data via the model. Since models - may reorganize their internal structures from time to time, model - indexes may become invalid, and \e{should not be stored}. If a - long-term reference to a piece of information is required, a - \e{persistent model index} must be created. This provides a reference - to the information that the model keeps up-to-date. - Temporary model indexes are provided by the QModelIndex class, and - persistent model indexes are provided by the QPersistentModelIndex + Model indexes provide \e temporary references to pieces of information, and + can be used to retrieve or modify data via the model. Since models may + reorganize their internal structures from time to time, model indexes may + become invalid, and \e{should not be stored}. If a long-term reference to a + piece of information is required, a \e{persistent model index} must be + created. This provides a reference to the information that the model keeps + up-to-date. Temporary model indexes are provided by the QModelIndex class, + and persistent model indexes are provided by the QPersistentModelIndex class. To obtain a model index that corresponds to an item of data, three @@ -423,30 +421,29 @@ \section2 Rows and Columns - In its most basic form, a model can be accessed as a simple table - in which items are located by their row and column numbers. \e{This does - not mean that the underlying pieces of data are stored in an array - structure}; the use of row and column numbers is only a convention to - allow components to communicate with each other. - We can retrieve information about any given item by specifying its row - and column numbers to the model, and we receive an index that - represents the item: + In its most basic form, a model can be accessed as a simple table in which + items are located by their row and column numbers. \e{This does not mean + that the underlying pieces of data are stored in an array structure}; the + use of row and column numbers is only a convention to allow components to + communicate with each other. We can retrieve information about any given + item by specifying its row and column numbers to the model, and we receive + an index that represents the item: \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 1 - Models that provide interfaces to simple, single level data structures - like lists and tables do not need any other information to be provided - but, as the above code indicates, we need to supply more information - when obtaining a model index. + Models that provide interfaces to simple, single level data structures like + lists and tables do not need any other information to be provided but, as + the above code indicates, we need to supply more information when obtaining + a model index. \table \row \i \inlineimage modelview-tablemodel.png \i \bold{Rows and columns} The diagram shows a representation of a basic table model in which each - item is located by a pair of row and column numbers. - By passing the relevant row and column numbers to the model we - obtain a model index that refers to an item of data. + item is located by a pair of row and column numbers. We obtain a model + index that refers to an item of data by passing the relevant row and + column numbers to the model. \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 2 @@ -458,17 +455,16 @@ \section2 Parents of Items The table-like interface to item data provided by models is ideal when - using data in a table or list view; the row and column number system - maps exactly to the way the views display items. - However, structures such as tree views require the model to expose a more - flexible interface to the items within. As a result, each item can also be - the parent of another table of items, in much the same way that a top-level - item in a tree view can contain another list of items. - - When requesting an index for a model item, we must provide some - information about the item's parent. Outside the model, the only way to - refer to an item is through a model index, so a parent model index must - also be given: + using data in a table or list view; the row and column number system maps + exactly to the way the views display items. However, structures such as + tree views require the model to expose a more flexible interface to the + items within. As a result, each item can also be the parent of another + table of items, in much the same way that a top-level item in a tree view + can contain another list of items. + + When requesting an index for a model item, we must provide some information + about the item's parent. Outside the model, the only way to refer to an + item is through a model index, so a parent model index must also be given: \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 3 @@ -476,14 +472,16 @@ \row \i \inlineimage modelview-treemodel.png \i \bold{Parents, rows, and columns} - The diagram shows a representation of a tree model in which each item - is referred to by a parent, a row number, and a column number. + The diagram shows a representation of a tree model in which each item is + referred to by a parent, a row number, and a column number. Items "A" and "C" are represented as top-level siblings in the model: + \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 4 Item "A" has a number of children. A model index for item "B" is obtained with the following code: + \snippet doc/src/snippets/code/doc_src_model-view-programming.qdoc 5 \endtable @@ -492,9 +490,8 @@ Items in a model can perform various \e roles for other components, allowing different kinds of data to be supplied for different situations. For example, Qt::DisplayRole is used to access a string that can be - displayed as text in a view. - Typically, items contain data for a number of different roles, and the - standard roles are defined by Qt::ItemDataRole. + displayed as text in a view. Typically, items contain data for a number of + different roles, and the standard roles are defined by Qt::ItemDataRole. We can ask the model for the item's data by passing it the model index corresponding to the item, and by specifying a role to obtain the type @@ -510,13 +507,13 @@ Views can display the roles in different ways, so it is important to supply appropriate information for each role. - The \l{Creating New Models} section covers some specific uses of roles - in more detail. + The \l{Creating New Models} section covers some specific uses of roles in + more detail. \endtable - Most common uses for item data are covered by the standard roles defined - in Qt::ItemDataRole. By supplying appropriate item data for each role, - models can provide hints to views and delegates about how items should be + Most common uses for item data are covered by the standard roles defined in + Qt::ItemDataRole. By supplying appropriate item data for each role, models + can provide hints to views and delegates about how items should be presented to the user. Different kinds of views have the freedom to interpret or ignore this information as required. It is also possible to define additional roles for application-specific purposes. @@ -983,42 +980,77 @@ \section1 Concepts - The selection model used in the new item view classes offers many - improvements over the selection model used in Qt 3. It provides a - more general description of selections based on the facilities of - the model/view architecture. Although the standard classes for - manipulating selections are sufficient for the item views provided, - the selection model allows you to create specialized selection models - to suit the requirements for your own item models and views. - - Information about the items selected in a view is stored in an instance - of the \l QItemSelectionModel class. This maintains model indexes for - items in a single model, and is independent of any views. Since there - can be many views onto a model, it is possible to share selections - between views, allowing applications to show multiple views in a - consistent way. - - Selections are made up of \e{selection ranges}. These efficiently - maintain information about large selections of items by recording - only the starting and ending model indexes for each range of selected - items. Non-contiguous selections of items are constructed by using - more than one selection range to describe the selection. - - Selections are applied to a collection of model indexes held by - a selection model. The most recent selection of items applied is - known as the \e{current selection}. The effects of this selection can - be modified even after its application through the use of certain - types of selection commands. These are discussed later in this - section. + The selection model used in the item view classes offers many improvements + over the selection model used in Qt 3. It provides a more general + description of selections based on the facilities of the model/view + architecture. Although the standard classes for manipulating selections are + sufficient for the item views provided, the selection model allows you to + create specialized selection models to suit the requirements for your own + item models and views. + + Information about the items selected in a view is stored in an instance of + the \l QItemSelectionModel class. This maintains model indexes for items in + a single model, and is independent of any views. Since there can be many + views onto a model, it is possible to share selections between views, + allowing applications to show multiple views in a consistent way. + + Selections are made up of \e{selection ranges}. These efficiently maintain + information about large selections of items by recording only the starting + and ending model indexes for each range of selected items. Non-contiguous + selections of items are constructed by using more than one selection range + to describe the selection. + + Selections are applied to a collection of model indexes held by a selection + model. The most recent selection of items applied is known as the + \e{current selection}. The effects of this selection can be modified even + after its application through the use of certain types of selection + commands. These are discussed later in this section. + + + \section2 Current Item and Selected Items + + In a view, there is always a current item and a selected item - two + independent states. An item can be the current item and selected at the + same time. The view is responsible for ensuring that there is always a + current item as keyboard navigation, for example, requires a current item. + + The table below highlights the differences between current item and + selected items. + + \table + \header + \o Current Item + \o Selected Items + + \row + \o There can only be one current item. + \o There can be multiple selected items. + \row + \o The current item will be changed with key navigation or mouse + button clicks. + \o The selected state of items is set or unset, depending on several + pre-defined modes - e.g., single selection, multiple selection, + etc. - when the user interacts with the items. + \row + \o The current item will be edited if the edit key, \gui F2, is + pressed or the item is double-clicked (provided that editing is + enabled). + \o The current item can be used together with an anchor to specify a + range that should be selected or deselected (or a combination of + the two). + \row + \o The current item is indicated by the focus rectangle. + \o The selected items are indicated with the selection rectangle. + \endtable When manipulating selections, it is often helpful to think of - \l QItemSelectionModel as a record of the selection state of all the - items in an item model. Once a selection model is set up, collections - of items can be selected, deselected, or their selection states can - be toggled without the need to know which items are already selected. - The indexes of all selected items can be retrieved at any time, and - other components can be informed of changes to the selection model - via the signals and slots mechanism. + \l QItemSelectionModel as a record of the selection state of all the items + in an item model. Once a selection model is set up, collections of items + can be selected, deselected, or their selection states can be toggled + without the need to know which items are already selected. The indexes of + all selected items can be retrieved at any time, and other components can + be informed of changes to the selection model via the signals and slots + mechanism. \section1 Using a Selection Model -- cgit v0.12 From 50f6168a7e0f76124830d63981bb1b8c2fa67f8c Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Tue, 11 Aug 2009 14:17:02 +0200 Subject: Remove trailing whitespace Reviewed-By: TrustMe --- doc/src/model-view-programming.qdoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/src/model-view-programming.qdoc b/doc/src/model-view-programming.qdoc index 0c7ea2f..2a077da 100644 --- a/doc/src/model-view-programming.qdoc +++ b/doc/src/model-view-programming.qdoc @@ -1015,7 +1015,7 @@ current item as keyboard navigation, for example, requires a current item. The table below highlights the differences between current item and - selected items. + selected items. \table \header @@ -1432,7 +1432,7 @@ \snippet doc/src/snippets/stringlistmodel/model.h 3 \section2 Making the Model Editable - + A delegate checks whether an item is editable before creating an editor. The model must let the delegate know that its items are editable. We do this by returning the correct flags for each item in @@ -1468,7 +1468,7 @@ is limited to just one model index. Also the data() function needs to be changed to add the Qt::EditRole test: - + \snippet doc/src/snippets/stringlistmodel/model.cpp 1 \section2 Inserting and Removing Rows @@ -2481,4 +2481,3 @@ {fetchMore()} must be reimplemented as their default implementation returns false and does nothing. */ - -- cgit v0.12 From 1056df7f11e4c7964a72e89d02bd3016ccd2c9f1 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 11 Aug 2009 13:10:03 +0200 Subject: Add support for hooking BeginPaint/EndPaint on 64Bit Windows Webkit uses the runtime patching trick explained by "Feng Yuan" for hooking these paint functions. It currently supports only 32bit assembly code. This patch adds support for 64Bit version. Since inline-assemblies are not supported for 64Bit, we have use a seperate .asm file. Reviewed-by: Simon Hausmann Reviewed-by: Thiago Macieira --- src/3rdparty/webkit/WebCore/WebCore.pro | 17 ++++++++ .../webkit/WebCore/plugins/win/PaintHooks.asm | 50 ++++++++++++++++++++++ .../webkit/WebCore/plugins/win/PluginViewWin.cpp | 46 +++++++++++++++++++- 3 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 2eb7c08..68da1d6 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -3218,3 +3218,20 @@ CONFIG(QTDIR_build):isEqual(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4 CONFIG += no_debug_info } +!win32-g++:win32:contains(QMAKE_HOST.arch, x86_64):{ + asm_compiler.commands = ml64 /c + asm_compiler.commands += /Fo ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} + asm_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)} + asm_compiler.input = ASM_SOURCES + asm_compiler.variable_out = OBJECTS + asm_compiler.name = compiling[asm] ${QMAKE_FILE_IN} + silent:asm_compiler.commands = @echo compiling[asm] ${QMAKE_FILE_IN} && $$asm_compiler.commands + QMAKE_EXTRA_COMPILERS += asm_compiler + + ASM_SOURCES += \ + plugins/win/PaintHooks.asm + if(win32-msvc2005|win32-msvc2008):equals(TEMPLATE_PREFIX, "vc") { + SOURCES += \ + plugins/win/PaintHooks.asm + } +} diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm b/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm new file mode 100644 index 0000000..9128663 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm @@ -0,0 +1,50 @@ +;/* +; 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 Library General Public +; License as published by the Free Software Foundation; either +; version 2 of the License, or (at your option) any later version. +; +; 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 +; Library General Public License for more details. +; +; You should have received a copy of the GNU Library General Public License +; along with this library; see the file COPYING.LIB. If not, write to +; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +; Boston, MA 02110-1301, USA. +;*/ + +;HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint); + +PUBLIC _HBeginPaint + +_TEXT SEGMENT + +_HBeginPaint PROC + mov r10,rcx + mov eax,1017h + syscall + ret +_HBeginPaint ENDP + +_TEXT ENDS + +;BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint); + +PUBLIC _HEndPaint + +_TEXT SEGMENT + +_HEndPaint PROC + mov r10,rcx + mov eax,1019h + syscall + ret +_HEndPaint ENDP + +_TEXT ENDS + +END diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp index c97984d..4fc03dc 100644 --- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp @@ -117,6 +117,14 @@ static BYTE* beginPaint; static unsigned endPaintSysCall; static BYTE* endPaint; +typedef HDC (WINAPI *PtrBeginPaint)(HWND, PAINTSTRUCT*); +typedef BOOL (WINAPI *PtrEndPaint)(HWND, const PAINTSTRUCT*); + +#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) +extern "C" HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint); +extern "C" BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint); +#endif + HDC WINAPI PluginView::hookedBeginPaint(HWND hWnd, PAINTSTRUCT* lpPaint) { PluginView* pluginView = reinterpret_cast(GetProp(hWnd, kWebPluginViewProperty)); @@ -139,12 +147,14 @@ HDC WINAPI PluginView::hookedBeginPaint(HWND hWnd, PAINTSTRUCT* lpPaint) : "memory" ); return result; -#else +#elif defined(_M_IX86) // Call through to the original BeginPaint. __asm mov eax, beginPaintSysCall __asm push lpPaint __asm push hWnd __asm call beginPaint +#else + return _HBeginPaint(hWnd, lpPaint); #endif } @@ -166,12 +176,14 @@ BOOL WINAPI PluginView::hookedEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint) : "a" (endPaintSysCall), "g" (lpPaint), "g" (hWnd), "m" (*endPaint) ); return result; -#else +#elif defined (_M_IX86) // Call through to the original EndPaint. __asm mov eax, endPaintSysCall __asm push lpPaint __asm push hWnd __asm call endPaint +#else + return _HEndPaint(hWnd, lpPaint); #endif } @@ -184,6 +196,7 @@ static void hook(const char* module, const char* proc, unsigned& sysCallID, BYTE pProc = reinterpret_cast(reinterpret_cast(GetProcAddress(hMod, proc))); +#if COMPILER(GCC) || defined(_M_IX86) if (pProc[0] != 0xB8) return; @@ -199,6 +212,35 @@ static void hook(const char* module, const char* proc, unsigned& sysCallID, BYTE *reinterpret_cast(pProc + 1) = reinterpret_cast(pNewProc) - reinterpret_cast(pProc + 5); pProc += 5; +#else + /* Disassembly of BeginPaint() + 00000000779FC5B0 4C 8B D1 mov r10,rcx + 00000000779FC5B3 B8 17 10 00 00 mov eax,1017h + 00000000779FC5B8 0F 05 syscall + 00000000779FC5BA C3 ret + 00000000779FC5BB 90 nop + 00000000779FC5BC 90 nop + 00000000779FC5BD 90 nop + 00000000779FC5BE 90 nop + 00000000779FC5BF 90 nop + 00000000779FC5C0 90 nop + 00000000779FC5C1 90 nop + 00000000779FC5C2 90 nop + 00000000779FC5C3 90 nop + */ + // Check for the signature as in the above disassembly + DWORD guard = 0xB8D18B4C; + if (*reinterpret_cast(pProc) != guard) + return; + + DWORD flOldProtect; + VirtualProtect(pProc, 12, PAGE_EXECUTE_READWRITE, & flOldProtect); + pProc[0] = 0x48; // mov rax, this + pProc[1] = 0xb8; + *(__int64*)(pProc+2) = (__int64)pNewProc; + pProc[10] = 0xff; // jmp rax + pProc[11] = 0xe0; +#endif } static void setUpOffscreenPaintingHooks(HDC (WINAPI*hookedBeginPaint)(HWND, PAINTSTRUCT*), BOOL (WINAPI*hookedEndPaint)(HWND, const PAINTSTRUCT*)) -- cgit v0.12 From 1c4a75de75157f0ffa0a75d8c5f177bf45119c50 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 11 Aug 2009 13:20:16 +0200 Subject: Fix compile error on 64Bit Added new overload with int64 parameter. Reviewed-by: Simon Hausmann --- .../webkit/JavaScriptCore/runtime/UString.cpp | 31 ++++++++++++++++++++++ .../webkit/JavaScriptCore/runtime/UString.h | 3 +++ 2 files changed, 34 insertions(+) diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp index 118751e..f64219c 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.cpp @@ -942,6 +942,37 @@ UString UString::from(int i) return UString(p, static_cast(end - p)); } +#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) +UString UString::from(int64_t i) +{ + UChar buf[1 + sizeof(i) * 3]; + UChar* end = buf + sizeof(buf) / sizeof(UChar); + UChar* p = end; + + if (i == 0) + *--p = '0'; + else if (i == LLONG_MIN) { + char minBuf[1 + sizeof(i) * 3]; + snprintf(minBuf, sizeof(minBuf) - 1, "%I64d", LLONG_MIN); + return UString(minBuf); + } else { + bool negative = false; + if (i < 0) { + negative = true; + i = -i; + } + while (i) { + *--p = static_cast((i % 10) + '0'); + i /= 10; + } + if (negative) + *--p = '-'; + } + + return UString(p, static_cast(end - p)); +} +#endif + UString UString::from(unsigned int u) { UChar buf[sizeof(u) * 3]; diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h index d01b75d..f2572a9 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h @@ -256,6 +256,9 @@ namespace JSC { } static UString from(int); +#if PLATFORM(WIN_OS) && PLATFORM(X86_64) && COMPILER(MSVC) + static UString from(int64_t i); +#endif static UString from(unsigned int); static UString from(long); static UString from(double); -- cgit v0.12 From 0d3a88ae2f4f4c9b356ee093ba6d166b92256a56 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 11 Aug 2009 14:15:49 +0200 Subject: Fix Whitespace errors Reviewed-by: Trust Me --- .../webkit/WebCore/plugins/win/PaintHooks.asm | 30 +++++++++++----------- .../webkit/WebCore/plugins/win/PluginViewWin.cpp | 28 ++++++++++---------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm b/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm index 9128663..1508813 100644 --- a/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm +++ b/src/3rdparty/webkit/WebCore/plugins/win/PaintHooks.asm @@ -16,35 +16,35 @@ ; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ;*/ - + ;HDC __stdcall _HBeginPaint(HWND hWnd, LPPAINTSTRUCT lpPaint); -PUBLIC _HBeginPaint +PUBLIC _HBeginPaint -_TEXT SEGMENT +_TEXT SEGMENT _HBeginPaint PROC - mov r10,rcx - mov eax,1017h - syscall - ret + mov r10,rcx + mov eax,1017h + syscall + ret _HBeginPaint ENDP -_TEXT ENDS +_TEXT ENDS ;BOOL __stdcall _HEndPaint(HWND hWnd, const PAINTSTRUCT* lpPaint); -PUBLIC _HEndPaint +PUBLIC _HEndPaint -_TEXT SEGMENT +_TEXT SEGMENT _HEndPaint PROC - mov r10,rcx - mov eax,1019h - syscall - ret + mov r10,rcx + mov eax,1019h + syscall + ret _HEndPaint ENDP -_TEXT ENDS +_TEXT ENDS END diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp index 4fc03dc..2687186 100644 --- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp @@ -214,22 +214,22 @@ static void hook(const char* module, const char* proc, unsigned& sysCallID, BYTE pProc += 5; #else /* Disassembly of BeginPaint() - 00000000779FC5B0 4C 8B D1 mov r10,rcx - 00000000779FC5B3 B8 17 10 00 00 mov eax,1017h - 00000000779FC5B8 0F 05 syscall - 00000000779FC5BA C3 ret - 00000000779FC5BB 90 nop - 00000000779FC5BC 90 nop - 00000000779FC5BD 90 nop - 00000000779FC5BE 90 nop - 00000000779FC5BF 90 nop - 00000000779FC5C0 90 nop - 00000000779FC5C1 90 nop - 00000000779FC5C2 90 nop - 00000000779FC5C3 90 nop + 00000000779FC5B0 4C 8B D1 mov r10,rcx + 00000000779FC5B3 B8 17 10 00 00 mov eax,1017h + 00000000779FC5B8 0F 05 syscall + 00000000779FC5BA C3 ret + 00000000779FC5BB 90 nop + 00000000779FC5BC 90 nop + 00000000779FC5BD 90 nop + 00000000779FC5BE 90 nop + 00000000779FC5BF 90 nop + 00000000779FC5C0 90 nop + 00000000779FC5C1 90 nop + 00000000779FC5C2 90 nop + 00000000779FC5C3 90 nop */ // Check for the signature as in the above disassembly - DWORD guard = 0xB8D18B4C; + DWORD guard = 0xB8D18B4C; if (*reinterpret_cast(pProc) != guard) return; -- cgit v0.12 From b81b46407299c0b03fffab60d6d87cc71b57cd34 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 11 Aug 2009 14:28:37 +0200 Subject: Wrote an autotest to expose a bug in the GLib event dispatcher. Zero timers don't fire on the first pass in the GLib event dispatcher. Ideally I should fix the bug of course, but time doesn't permit at the moment. Submitting this test instead as a "reminder". The UNIX event dispatcher passes the test, and it also passes if moved to the end of the slots. Task: 259505 --- tests/auto/qtimer/tst_qtimer.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index 43b7553..8c8f1e3 100644 --- a/tests/auto/qtimer/tst_qtimer.cpp +++ b/tests/auto/qtimer/tst_qtimer.cpp @@ -73,6 +73,7 @@ public slots: void init(); void cleanup(); private slots: + void zeroTimer(); void singleShotTimeout(); void timeout(); void livelock_data(); @@ -129,6 +130,20 @@ void tst_QTimer::cleanup() { } +void tst_QTimer::zeroTimer() +{ + TimerHelper helper; + QTimer timer; + timer.setInterval(0); + timer.start(); + + connect(&timer, SIGNAL(timeout()), &helper, SLOT(timeout())); + + QCoreApplication::processEvents(); + + QCOMPARE(helper.count, 1); +} + void tst_QTimer::singleShotTimeout() { TimerHelper helper; @@ -482,4 +497,3 @@ void tst_QTimer::restartedTimerFiresTooSoon() QTEST_MAIN(tst_QTimer) #include "tst_qtimer.moc" -\ -- cgit v0.12 From e08c698d48a3179515e0392843c77efcac892134 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 11 Aug 2009 14:40:12 +0200 Subject: Phonon::VideoWidget still flickering small patch to make sure even the native events of the pending ones won't trigger anything in the paintevent Task-number: 251776 --- src/3rdparty/phonon/ds9/videowidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index 07b9cf3..091be16 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -118,6 +118,8 @@ namespace Phonon void paintEvent(QPaintEvent *e) { + if (!updatesEnabled()) + return; //this avoids repaint from native events checkCurrentRenderingMode(); m_currentRenderer->repaintCurrentFrame(this, e->rect()); } -- cgit v0.12 From bead88ed4149202638167499e50148ae9fb7ab3e Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 11 Aug 2009 14:42:53 +0200 Subject: Allow make utilities other than "make" Instead of hard coding "make", use "$MAKE". If $MAKE is not set, configure will export it for us when searching for "make". Reviewed-by: Bradley T. Hughes --- config.tests/mac/crc.test | 6 +++--- config.tests/unix/compile.test | 6 +++--- config.tests/unix/doubleformat.test | 2 +- config.tests/unix/endian.test | 4 ++-- config.tests/unix/ptrsize.test | 4 ++-- config.tests/x11/notype.test | 4 ++-- configure | 2 ++ 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/config.tests/mac/crc.test b/config.tests/mac/crc.test index 1a16204..644ff75 100755 --- a/config.tests/mac/crc.test +++ b/config.tests/mac/crc.test @@ -52,13 +52,13 @@ test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST" cd "$OUTDIR/$TEST" -make distclean >/dev/null 2>&1 +$MAKE distclean >/dev/null 2>&1 "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" if [ "$VERBOSE" = "yes" ]; then - make + $MAKE else - make >/dev/null 2>&1 + $MAKE >/dev/null 2>&1 fi diff --git a/config.tests/unix/compile.test b/config.tests/unix/compile.test index 550890f..67a4636 100755 --- a/config.tests/unix/compile.test +++ b/config.tests/unix/compile.test @@ -64,14 +64,14 @@ test -d "$OUTDIR/$TEST" || mkdir -p "$OUTDIR/$TEST" cd "$OUTDIR/$TEST" -test -r Makefile && make distclean >/dev/null 2>&1 +test -r Makefile && $MAKE distclean >/dev/null 2>&1 "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" if [ "$VERBOSE" = "yes" ]; then - make + $MAKE else - make >/dev/null 2>&1 + $MAKE >/dev/null 2>&1 fi [ -x "$EXE" ] && SUCCESS=yes diff --git a/config.tests/unix/doubleformat.test b/config.tests/unix/doubleformat.test index 3e707c5..953efd8 100755 --- a/config.tests/unix/doubleformat.test +++ b/config.tests/unix/doubleformat.test @@ -14,7 +14,7 @@ test -d "$OUTDIR/config.tests/unix/doubleformat" || mkdir -p "$OUTDIR/config.tes cd "$OUTDIR/config.tests/unix/doubleformat" DOUBLEFORMAT="UNKNOWN" -[ "$VERBOSE" = "yes" ] && make || make >/dev/null 2>&1 +[ "$VERBOSE" = "yes" ] && $MAKE || $MAKE >/dev/null 2>&1 if [ -f ./doubleformattest ]; then : # nop diff --git a/config.tests/unix/endian.test b/config.tests/unix/endian.test index 2c21652..4755b1f 100755 --- a/config.tests/unix/endian.test +++ b/config.tests/unix/endian.test @@ -15,7 +15,7 @@ cd "$OUTDIR/config.tests/unix/endian" ENDIAN="UNKNOWN" -[ "$VERBOSE" = "yes" ] && make || make >/dev/null 2>&1 +[ "$VERBOSE" = "yes" ] && $MAKE || $MAKE >/dev/null 2>&1 if [ -f ./endiantest.exe ]; then binary=./endiantest.exe @@ -40,7 +40,7 @@ elif strings $binary | grep MostSignificantByteFirst >/dev/null 2>&1; then fi # make clean as this tests is compiled for both the host and the target -make distclean +$MAKE distclean # done if [ "$ENDIAN" = "LITTLE" ]; then diff --git a/config.tests/unix/ptrsize.test b/config.tests/unix/ptrsize.test index 1307cec..c1d80ee 100755 --- a/config.tests/unix/ptrsize.test +++ b/config.tests/unix/ptrsize.test @@ -14,9 +14,9 @@ test -d "$OUTDIR/config.tests/unix/ptrsize" || mkdir -p "$OUTDIR/config.tests/un cd "$OUTDIR/config.tests/unix/ptrsize" if [ "$VERBOSE" = "yes" ]; then - (make clean && make) + ($MAKE clean && $MAKE) else - (make clean && make) >/dev/null 2>&1 + ($MAKE clean && $MAKE) >/dev/null 2>&1 fi RETVAL=$? diff --git a/config.tests/x11/notype.test b/config.tests/x11/notype.test index a522491..3a01d8f 100755 --- a/config.tests/x11/notype.test +++ b/config.tests/x11/notype.test @@ -31,9 +31,9 @@ if [ $XPLATFORM = "solaris-g++" -o $XPLATFORM = "hpux-g++" -o $XPLATFORM = "aix- cd "$OUTDIR/config.tests/x11/notype" if [ "$VERBOSE" = "yes" ]; then - make + $MAKE else - make >/dev/null 2>&1 + $MAKE >/dev/null 2>&1 fi [ -x notypetest ] && NOTYPE=no diff --git a/configure b/configure index cca6847..7b7cc1c 100755 --- a/configure +++ b/configure @@ -2200,6 +2200,8 @@ if [ -z "$MAKE" ]; then echo >&2 "Cannot proceed." exit 1 fi + # export MAKE, we need it later in the config.tests + export MAKE fi fi ### help -- cgit v0.12 From cd649261f902c96c065d44591f6ee76a9b2be5dc Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 11 Aug 2009 14:46:40 +0200 Subject: Phonon: avoids assert when switching source The problem was that when switching source, the previous one was still running. So we now explicitly stop it. --- src/3rdparty/phonon/ds9/mediaobject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/3rdparty/phonon/ds9/mediaobject.cpp b/src/3rdparty/phonon/ds9/mediaobject.cpp index a4feef6..22f1527 100644 --- a/src/3rdparty/phonon/ds9/mediaobject.cpp +++ b/src/3rdparty/phonon/ds9/mediaobject.cpp @@ -512,6 +512,8 @@ namespace Phonon qSwap(m_graphs[0], m_graphs[1]); //swap the graphs + m_graphs[1]->stop(); //make sure we stop the previous graph + if (currentGraph()->mediaSource().type() != Phonon::MediaSource::Invalid && catchComError(currentGraph()->renderResult())) { setState(Phonon::ErrorState); -- cgit v0.12 From ca28af7c530e60f55556aa7efc6fe19660be53b1 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 11 Aug 2009 13:13:25 +0200 Subject: Fixed uploading of glyphs to the glyph cache in the GL2 engine. Upload the glyph one scanline at a time to work around what probably is a driver bug. This replaces a previous fix 6d0290b2202d4fc084595ba678c2a2d984392e72. Reviewed-by: Tom --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index a3475c7..3f14fdf 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -261,11 +261,21 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph) if (mask.format() == QImage::Format_RGB32) { glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, m_height - c.y, maskWidth, maskHeight, GL_BGRA, GL_UNSIGNED_BYTE, mask.bits()); } else { - // If the width of the uploaded data is not a multiple of four bytes, we get some garbage - // in the glyph cache, probably because of a driver bug. - // Convert to ARGB32 to get a multiple of 4 bytes per line. - mask = mask.convertToFormat(QImage::Format_ARGB32); - glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_BGRA, GL_UNSIGNED_BYTE, mask.bits()); +#ifdef QT_OPENGL_ES2 + glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_ALPHA, GL_UNSIGNED_BYTE, mask.bits()); +#else + // glTexSubImage2D() might cause some garbage to appear in the texture if the mask width is + // not a multiple of four bytes. The bug appeared on a computer with 32-bit Windows Vista + // and nVidia GeForce 8500GT. GL_UNPACK_ALIGNMENT is set to four bytes, 'mask' has a + // multiple of four bytes per line, and most of the glyph shows up correctly in the + // texture, which makes me think that this is a driver bug. + // One workaround is to make sure the mask width is a multiple of four bytes, for instance + // by converting it to a format with four bytes per pixel. Another is to copy one line at a + // time. + + for (uint i = 0; i < maskHeight; ++i) + glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y + i, maskWidth, 1, GL_ALPHA, GL_UNSIGNED_BYTE, mask.scanLine(i)); +#endif } } -- cgit v0.12 From 12b344960c386c11423dc158a7ca866149208a3b Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 21 Jul 2009 14:57:14 +0200 Subject: Adding Windows Mobile 6.5 style --- src/gui/styles/qwindowsmobilestyle.cpp | 4252 ++++++++++++++++++++++++++++++-- src/gui/styles/qwindowsmobilestyle_p.h | 39 + 2 files changed, 4020 insertions(+), 271 deletions(-) diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index c70b4c8..1408c70f 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -669,10 +669,3852 @@ static const char * const min_small_xpm[] = { " ++++++++++++ ", " "}; +#ifdef Q_WS_WINCE_WM + +static char * sbhandleup_xpm[] = { +"26 41 45 1", +" c None", +". c #000000", +"+ c #E7E7E7", +"@ c #D6D7D6", +"# c #949294", +"$ c #737573", +"% c #636563", +"& c #636163", +"* c #5A5D5A", +"= c #5A595A", +"- c #525552", +"; c #525152", +"> c #4A4D4A", +", c #7B797B", +"' c #CECFCE", +") c #CED3CE", +"! c #6B6D6B", +"~ c #6B696B", +"{ c #737173", +"] c #7B7D7B", +"^ c #848684", +"/ c #848284", +"( c #8C8A8C", +"_ c #8C8E8C", +": c #B5B2B5", +"< c #FFFFFF", +"[ c #949694", +"} c #B5B6B5", +"| c #9C9A9C", +"1 c #ADAEAD", +"2 c #9C9E9C", +"3 c #BDBABD", +"4 c #BDBEBD", +"5 c #F7F3F7", +"6 c #C6C3C6", +"7 c #C6C7C6", +"8 c #A5A2A5", +"9 c #CECBCE", +"0 c #FFFBFF", +"a c #ADAAAD", +"b c #A5A6A5", +"c c #D6D3D6", +"d c #B5BAB5", +"e c #DEDFDE", +"f c #DEDBDE", +"..........................", +"+@#$%%&&&**===---;;;;>=,'+", +"+@#$%%&&&**===---;;;;>=$'+", +")$!!~~%%&&&**===---;;;;>;'", +"#{$]],,$${{{!!~~%%%&&&*-;]", +"#{$]],,$${{{!!~~%%%&&&*-;]", +",$^//]],,$${{{!!~~%%%&&*;*", +",,(^^//]],$${!!!!!~~%%%&-*", +",,(^^//]],$${!!!!!~~%%%&-*", +"]]_((^^//]$!%%~!{{!!~~%%-*", +"//#__((^^]{:<<:~!{{{!!~~=*", +"//#__((^^]{:<<:~!{{{!!~~=&", +"//###__(/$:<<<<:~{${{!!~*&", +"^^[[##_^]:<<<<<<}!{$${{!*%", +"^^[[##_^]:<<<<<<}!{$${{!*%", +"((|[[#_/:<<<<<<<<}!$$${{&~", +"((||[#^1<<<<1:<<<<}!$$$$&~", +"((||[#^1<<<<1:<<<<}!$$$$&~", +"__2|#(1<<<<}],}<<<<}{$,$%~", +"##2|_1<<<<}^((]3<<<<}{$,~!", +"##2|_1<<<<}^((]3<<<<}{$,~!", +"##2#1<<<<3^###(/4<<<<}{,~{", +"##2#1<<<<3^###(/4<<<<}{,~!", +"[[2_5<<<4(#|[[#_/6<<<<,,!{", +"[|2_5<<4_[||||[[_/7<<<,]{$", +"[|2_5<<4_[||||[[_/7<<<,]{$", +"||8_5<6#|2222|||[_/9<<,]{$", +"228#06[28888222||[_/'<,/$,", +"228#06[28888222||[_/'<,/$,", +"22a|6[8bbbb88822||[(/c](,]", +"881b8baaabbbb88222|[(^(_,]", +"881b8baaabbbb88222|[(^(_,]", +"88111111aaabbb88822|[###]/", +"bb:::11111aaabbb8822||[[/^", +"bb:::11111aaabbb8822||[[//", +"bb:::::1111aaabbb8822||[/(", +"3a1::::::1111aaabb8822|_^8", +"da1::::::1111aaabb8822|_^8", +"e1aaabbbb888822||[[##__((@", +"+e4:aaabbbb88822||[[[#[b@+", +"+e4:aaabbbb88822||[[[#[bf+"}; + +static char * sbhandledown_xpm[] = { +"26 40 46 1", +" c None", +". c #E7E7E7", +"+ c #DEDFDE", +"@ c #BDBEBD", +"# c #B5B2B5", +"$ c #ADAAAD", +"% c #A5A6A5", +"& c #A5A2A5", +"* c #9C9E9C", +"= c #9C9A9C", +"- c #949694", +"; c #949294", +"> c #D6D7D6", +", c #DEDBDE", +"' c #D6DBD6", +") c #ADAEAD", +"! c #8C8E8C", +"~ c #8C8A8C", +"{ c #BDBABD", +"] c #848684", +"^ c #B5BAB5", +"/ c #848284", +"( c #848A84", +"_ c #7B7D7B", +": c #7B797B", +"< c #C6C3C6", +"[ c #D6D3D6", +"} c #FFFBFF", +"| c #CECFCE", +"1 c #FFFFFF", +"2 c #737573", +"3 c #F7F3F7", +"4 c #CECBCE", +"5 c #737173", +"6 c #C6C7C6", +"7 c #6B6D6B", +"8 c #B5B6B5", +"9 c #6B696B", +"0 c #636563", +"a c #636163", +"b c #5A5D5A", +"c c #5A595A", +"d c #525552", +"e c #525152", +"f c #4A4D4A", +"g c #C6CBC6", +".+@#$$$%%%%&&&**==---;-%>.", +".+@#$$$%%%%&&&**==---;-%,.", +"')$$$%%%%&&&&**==--;;!!~~>", +"{$)######))))$$$%%&&**=!]&", +"^$)######))))$$$%%&&**=!]&", +"%%#####))))$$$%%%&&**==-/(", +"%%###)))))$$$%%%&&**==--/]", +"%%###)))))$$$%%%&&**==--//", +"&&))))))$$$%%%&&&**=-;;;_/", +"&&)%&%$$$%%%%&&***=-~]~!:_", +"&&)%&%$$$%%%%&&***=-~]~!:_", +"**$=<-&%%%%&&&**==-~/[_~:_", +"**&;}<-*&&&&***==-!/|1:/2:", +"**&;}<-*&&&&***==-!/|1:/2:", +"==&!31<;=****===-!/411:_5:", +"-=*!311@!-====--!/6111:_52", +"-=*!311@!-====--!/6111:_52", +"--*!3111@~;=--;!/<1111::75", +";;*;)1111{];;;~/@111185:95", +";;*;)1111{];;;~/@111185:97", +";;*=!)11118]~~_{1111852:97", +";;*=!)11118]~~_{1111852:97", +"!!*=;~)11118_:81111852:207", +"~~==-;])1111)#1111872222a9", +"~~==-;])1111)#1111872222a9", +"~~=--;!/#111111118722255a0", +"]]--;;!]_#11111187522557b0", +"]]--;;!]_#11111187522557b0", +"//;;;!!~/2#1111#95255779ba", +"//;!!~~]]_5#11#975557799cb", +"//;!!~~]]_5#11#975557799ca", +"__!~~]]//_27009755779900db", +"::~]]//__:2257777799000adb", +"::~]]//__:2257777799000adb", +":2]//__::225557799000aabeb", +";52__::225557799000aaabde_", +";52__::225557799000aaabde_", +"[2779900aaabbcccdddeeeefeg", +".>;200aaabbcccdddeeeefc:|.", +".>;200aaabbcccdddeeeefc2|."}; + +static char * sbgripdown_xpm[] = { +"26 34 39 1", +" c None", +". c #949294", +"+ c #9C9E9C", +"@ c #9C9A9C", +"# c #949694", +"$ c #8C8E8C", +"% c #8C8A8C", +"& c #848684", +"* c #848284", +"= c #7B7D7B", +"- c #7B797B", +"; c #6B696B", +"> c #636563", +", c #737573", +"' c #636163", +") c #737173", +"! c #5A5D5A", +"~ c #6B6D6B", +"{ c #5A595A", +"] c #B5B6B5", +"^ c #BDBEBD", +"/ c #ADAEAD", +"( c #BDBABD", +"_ c #525552", +": c #313031", +"< c #525152", +"[ c #ADAAAD", +"} c #BDBAB5", +"| c #4A4D4A", +"1 c #4A494A", +"2 c #C6C3C6", +"3 c #C6CBC6", +"4 c #E7E7E7", +"5 c #DEDFDE", +"6 c #E7E3E7", +"7 c #DEE3DE", +"8 c #CECBCE", +"9 c #8C928C", +"0 c #CECFCE", +"..+++@@@###...$$%&&**==-;>", +"$.++@@@@##...$$%%&**==-->>", +"$$+@@@@###..$$%%&&*==--,>>", +"$$@@@@###..$$%%&&**==-,,>'", +"%%@@@###..$$$%&&**==--,,''", +"%%@@###..$$$%&&**==--,,)''", +"%%@###...$$%%&&*==--,,))'!", +"&&###...$$%%&&**==--,)))!!", +"&&##...$$%%&&**==--,,))~!!", +"&&#...$$%%&&**==--,,))~~!{", +"**...$$%%&&**==--,,))~~;!{", +"**..$$%%&&**===--,)))~~;{{", +"**.$$%%&]^&===//,,))~~;;{{", +"==$$%%&&]^*==-((,))~~;;>{_", +"==$%%&&***::--,,::~~;;;>__", +"==%%&&&**=::-,,)::~~;;>>__", +"--%&&&**==--,,)))~~;;>>>__", +"--&&&**==--,,)))~~;;>>>'_<", +",-&&**==]^-,))[[~;;>>>''<<", +",,&**==-]^-)))}};;>>>'''<<", +",,**==--,,::)~~;::>>'''!<<", +"))*==--,,)::~~;;::>'''!!<|", +"))==--,,)))~~;;;>>'''!!!||", +"))=--,,)))~~;;;>>'''!!!{||", +"~~--,,)))~~;;;>>'''!!!{{||", +"~~-,,)))~~;;>>>'''!!!{{{|1", +";;,,)))~~;;>>>'''!!!{{{_1<", +"~;,)))~~;;>>>'''!!!{{{__1'", +"%>~))~~;;>>>'''!!!{{{__|1$", +"2>>~~~;;>>>''!!!{{{{__<113", +"4%'';;;>>>''!!!{{{{__<11%4", +"45-!!'>>>''!!!{{{{_<|11)64", +"447+!{{___<<<||||1111|+444", +"444489~__<<<||||111>$04444"}; + +static char * sbgripup_xpm[] = { +"26 34 38 1", +" c None", +". c #E7E7E7", +"+ c #D6DBD6", +"@ c #C6C7C6", +"# c #B5B6B5", +"$ c #ADAEAD", +"% c #ADAAAD", +"& c #A5A6A5", +"* c #A5A2A5", +"= c #BDBEBD", +"- c #DEDFDE", +"; c #C6CBC6", +"> c #9C9E9C", +", c #E7E3E7", +"' c #BDBABD", +") c #B5B2B5", +"! c #9C9A9C", +"~ c #DEE3DE", +"{ c #949694", +"] c #D6D7D6", +"^ c #949294", +"/ c #DEDBDE", +"( c #8C8E8C", +"_ c #8C8A8C", +": c #848684", +"< c #D6D3CE", +"[ c #CECBCE", +"} c #D6D3D6", +"| c #848284", +"1 c #313031", +"2 c #7B7D7B", +"3 c #CECFCE", +"4 c #CECBC6", +"5 c #7B797B", +"6 c #737573", +"7 c #737173", +"8 c #6B6D6B", +"9 c #6B696B", +"....+@#$$%%%%&&&***$=-....", +"...;$$$$$%%%&&&&**>>>>@...", +".,'$$)#'#####)))$$$%*!!$~.", +".=$)#'''####))))$$$%%*!{'.", +"]$$''''#####)))$$$%%%&*{^/", +"=$#'''#####)))$$$$%%&&&!^#", +"$$'''#####))))$$$%%%&&*>(!", +"$$''#####))))$$$%%%&&&*>(^", +"$$######))))$$$$%%&&&**>(_", +"%$#####))))$$$$%%%&&***>__", +"%$####))))$$$$%%%&&&**>>__", +"%%###)))))$$$%%%&&&**>>>_:", +"%%##))))<])$$%[[&&***>>!::", +"%%#)))))<]$$%%}<&&**>>!!:|", +"&%)))))$$$11%%&&11*>>>!!:|", +"&&))))$$$$11%&&&11*>>!!{||", +"&&)))$$$$$%%%&&&**>>!!!{|2", +"&&))$$$$$%%%&&&**>>>!!{{|2", +"*&)$$$$$3]%&&&4@*>>!!{{{22", +"**$$$$$%3]%&&&<<>>!!!{{^25", +"**$$$$%%%%11&**>11!!{{^^25", +"**$$$%%%%&11***>11!!{{^^55", +"**$$%%%%&&&***>>!!!{{^^(55", +">>$%%%%&&&***>>>!!{{^^((56", +">>%%%%&&&&***>>!!!{{^^((66", +">>%%%&&&&***>>!!!{{^^((_67", +"!>%%&&&&***>>>!!{{{^^(__67", +"!!%&&&&***>>>!!!{{^^((_:77", +"!!&&&&***>>>!!!{{^^((__:77", +"!!&&&****>>!!!{{^^^(__::78", +"{!&&****>>>!!{{{^^((_::|88", +"{{&****>>>!!!{{^^((__:||88", +"{{****>>>!!!{{^^^(__::|289", +"{{***>>>!!!{{{^^((_::||289"}; + +static char * sbgripmiddle_xpm[] = { +"26 2 12 1", +" c None", +". c #949294", +"+ c #A5A2A5", +"@ c #9C9E9C", +"# c #9C9A9C", +"$ c #949694", +"% c #8C8E8C", +"& c #8C8A8C", +"* c #848684", +"= c #848284", +"- c #7B7D7B", +"; c #6B696B", +"..++@@@###$$$..%%&&*==--;;", +"..++@@@###$$$..%%&&*==--;;"}; + + +static char * listviewhighmiddle_xpm[] = { +"8 46 197 2", +" c None", +". c #66759E", +"+ c #6C789D", +"@ c #6A789E", +"# c #6B789E", +"$ c #6A779D", +"% c #6C789C", +"& c #6F7D9B", +"* c #6F7D9A", +"= c #9DB6EE", +"- c #9DB6ED", +"; c #9CB6ED", +"> c #A1B6EF", +", c #A2B6F0", +"' c #93AAE9", +") c #95ABEA", +"! c #94ABEA", +"~ c #94A9E8", +"{ c #8BA8EA", +"] c #8BA7EA", +"^ c #8AA7EA", +"/ c #8EAAE8", +"( c #8FAAE8", +"_ c #88A2E7", +": c #8CA3E8", +"< c #8BA3E7", +"[ c #8BA3E8", +"} c #8BA2E7", +"| c #8CA2E7", +"1 c #8DA2E7", +"2 c #87A1E8", +"3 c #87A1E9", +"4 c #86A0E8", +"5 c #86A1E7", +"6 c #87A2E7", +"7 c #859EE9", +"8 c #849DE9", +"9 c #869EE9", +"0 c #869FE9", +"a c #7C9BEA", +"b c #7C9CEA", +"c c #7B9CEA", +"d c #7C9BE9", +"e c #7E9CE9", +"f c #7B9AEA", +"g c #7C99E9", +"h c #7C9AEA", +"i c #7B9AE8", +"j c #7A9AEA", +"k c #7996E1", +"l c #7C96E4", +"m c #7B96E3", +"n c #7B95E3", +"o c #7E95E5", +"p c #7E95E6", +"q c #7292E1", +"r c #7490DF", +"s c #7591E0", +"t c #7590DF", +"u c #7392E1", +"v c #6D8CDE", +"w c #6F8EDD", +"x c #6E8DDD", +"y c #6E8DDE", +"z c #6F8EDE", +"A c #6E8EDE", +"B c #718EDD", +"C c #728EDD", +"D c #6B89E0", +"E c #6C89DF", +"F c #6D89E0", +"G c #6D89DF", +"H c #6C88DF", +"I c #6D88DF", +"J c #6D86DD", +"K c #6086E0", +"L c #6686E0", +"M c #6586E0", +"N c #6486E0", +"O c #6485E0", +"P c #6786DF", +"Q c #5F85E0", +"R c #6583DE", +"S c #6683DE", +"T c #6682DD", +"U c #6086DF", +"V c #5F86E0", +"W c #567ED7", +"X c #567ED8", +"Y c #557DD7", +"Z c #5A7FD8", +"` c #6281DA", +" . c #5379D9", +".. c #5278D9", +"+. c #547BD8", +"@. c #4C73D7", +"#. c #4B72D2", +"$. c #4C73D4", +"%. c #4C73D3", +"&. c #4B72D4", +"*. c #4F75D3", +"=. c #5074D2", +"-. c #4971D0", +";. c #4871D0", +">. c #335ECF", +",. c #325ECB", +"'. c #335ECD", +"). c #335ECE", +"!. c #325DCD", +"~. c #2E59C9", +"{. c #3059C9", +"]. c #2F59C9", +"^. c #2F59C8", +"/. c #2B59CA", +"(. c #3355C6", +"_. c #3354C5", +":. c #3156C7", +"<. c #3056C7", +"[. c #3355C7", +"}. c #3355C5", +"|. c #254EBF", +"1. c #1F51C1", +"2. c #234FC0", +"3. c #234FBF", +"4. c #2350C0", +"5. c #1E50BE", +"6. c #1D50C0", +"7. c #264DBE", +"8. c #264CBD", +"9. c #254DBE", +"0. c #244EBF", +"a. c #254DBF", +"b. c #234CBF", +"c. c #244CC0", +"d. c #244BC0", +"e. c #234BC0", +"f. c #234BBF", +"g. c #234CBE", +"h. c #2049B7", +"i. c #2A49B5", +"j. c #2749B5", +"k. c #2749B6", +"l. c #2D49B4", +"m. c #2649B6", +"n. c #2946B5", +"o. c #2A48B6", +"p. c #2947B5", +"q. c #2946B6", +"r. c #2848B6", +"s. c #2549B5", +"t. c #2648B6", +"u. c #2744B5", +"v. c #2744B4", +"w. c #2744AF", +"x. c #2543B4", +"y. c #2543B2", +"z. c #2442B2", +"A. c #2442B3", +"B. c #2442B5", +"C. c #2543B3", +"D. c #1F40B1", +"E. c #1E40B1", +"F. c #243EAE", +"G. c #273BAC", +"H. c #263DAC", +"I. c #253CAB", +"J. c #273CAB", +"K. c #273CAC", +"L. c #263BAA", +"M. c #253CAE", +"N. c #263BA6", +"O. c #253BA5", +"P. c #253AA5", +"Q. c #253BA6", +"R. c #253CA7", +"S. c #263AA6", +"T. c #243CA6", +"U. c #253CA5", +"V. c #273BA8", +"W. c #2F4DA4", +"X. c #2F4DA3", +"Y. c #1B2F85", +"Z. c #B5B5B6", +"`. c #B5B5B5", +" + c #B5B6B6", +".+ c #B5B4B6", +"++ c #C2C3C5", +"@+ c #C0C3C3", +"#+ c #C1C3C4", +"$+ c #E3E3E3", +"%+ c #E3E3E4", +"&+ c #E4E3E4", +"*+ c #E2E3E4", +"=+ c #ECEEEB", +"-+ c #EBEDEA", +";+ c #EEF0ED", +">+ c #EFF0EE", +". + @ @ # # $ % ", +"& & * & & & & & ", +"= = - = = ; > , ", +"' ) ! ! ! ) ' ~ ", +"{ ] { { { ^ / ( ", +"_ : < [ : } | 1 ", +"2 2 2 3 2 4 5 6 ", +"7 7 7 7 7 8 9 0 ", +"a b a a a c d e ", +"f g h h h h i j ", +"k l m m m n o p ", +"q q q q q q q q ", +"r r s s s t q u ", +"v w x y z A B C ", +"D E F F G F H I ", +"J K L M N O P Q ", +"R R S S S T U V ", +"W W X X X Y Z ` ", +" . . . . ...+.W ", +" . . . . ..... .", +"@.#.$.$.%.&.*.=.", +"-.-.;.-.-.-.-.-.", +">.,.'.).).!.!.>.", +"~.{.].^.].^././.", +"(.(.(.(.(._.:.<.", +"(.(.[.[.[.[.(.}.", +"|.1.2.3.3.4.5.6.", +"7.7.7.7.7.8.9.0.", +"a.b.c.d.c.e.f.g.", +"h.i.j.k.j.k.l.m.", +"n.o.p.q.r.p.s.t.", +"u.u.v.u.u.u.u.u.", +"w.x.y.z.A.y.B.C.", +"D.D.E.D.D.D.D.D.", +"D.D.E.D.D.D.D.D.", +"F.G.H.I.J.K.L.M.", +"N.N.O.N.N.P.Q.R.", +"N.N.S.N.N.N.N.N.", +"T.N.T.T.T.U.N.V.", +"W.W.X.W.W.W.W.W.", +"W.W.W.W.W.W.W.W.", +"Y.Y.Y.Y.Y.Y.Y.Y.", +"Z.`. + +.+Z.`.`.", +"++@+#+#+#+#+@+@+", +"$+%+&+&+*+%+%+%+", +"=+-+;+-+-+>+-+-+"}; + + + +static char * listviewhighcornerleft_xpm[] = { +"100 46 1475 2", +" c None", +". c #FBFBFC", +"+ c #E8EAE7", +"@ c #758DC3", +"# c #42599E", +"$ c #28418A", +"% c #19418F", +"& c #3F5695", +"* c #415896", +"= c #435A98", +"- c #445C99", +"; c #465E9B", +"> c #48609B", +", c #49629C", +"' c #4A639D", +") c #49639D", +"! c #4A629D", +"~ c #4B639D", +"{ c #4B649D", +"] c #4C659D", +"^ c #4D669D", +"/ c #4E689D", +"( c #506A9D", +"_ c #516A9D", +": c #536B9C", +"< c #546C9C", +"[ c #566D9B", +"} c #576D9B", +"| c #586E9C", +"1 c #5B6F9D", +"2 c #61739D", +"3 c #63749E", +"4 c #64749E", +"5 c #68769E", +"6 c #6A779E", +"7 c #6B789E", +"8 c #66759E", +"9 c #6C789D", +"0 c #EEF0ED", +"a c #D0D3DC", +"b c #3E51A3", +"c c #28428B", +"d c #29428C", +"e c #425996", +"f c #455C99", +"g c #485F9C", +"h c #49619E", +"i c #4A63A0", +"j c #4B64A1", +"k c #4B65A1", +"l c #4C66A2", +"m c #4D67A2", +"n c #4F69A1", +"o c #516AA1", +"p c #536CA0", +"q c #556DA1", +"r c #576EA0", +"s c #586F9F", +"t c #586E9F", +"u c #596F9E", +"v c #5A6F9E", +"w c #5C709E", +"x c #5E719E", +"y c #5F729F", +"z c #62739F", +"A c #63739E", +"B c #64749D", +"C c #65749E", +"D c #69769D", +"E c #6C799E", +"F c #6D799F", +"G c #707D9F", +"H c #717F9E", +"I c #6E7AA1", +"J c #6C789E", +"K c #6F7C9C", +"L c #6F7D9B", +"M c #2A4AA0", +"N c #4971D0", +"O c #4C72D8", +"P c #5472C0", +"Q c #5573BF", +"R c #5774BF", +"S c #5875BF", +"T c #5976C1", +"U c #5A76C1", +"V c #5C78C2", +"W c #5E7AC2", +"X c #607CC3", +"Y c #627EC3", +"Z c #637FC4", +"` c #6581C5", +" . c #6682C6", +".. c #6783C7", +"+. c #6984C8", +"@. c #6B85C9", +"#. c #6D87CA", +"$. c #6F89CB", +"%. c #718CCD", +"&. c #748ECF", +"*. c #7690D0", +"=. c #7992D2", +"-. c #7A93D3", +";. c #7C95D5", +">. c #7F98D7", +",. c #8099D8", +"'. c #859CDB", +"). c #8AA0DD", +"!. c #8DA3DF", +"~. c #8FA5E0", +"{. c #90A5E0", +"]. c #91A6E1", +"^. c #91A5E1", +"/. c #90A4E0", +"(. c #8EA3DE", +"_. c #92A6E2", +":. c #8FA4DF", +"<. c #90A5DE", +"[. c #90A5DC", +"}. c #90A6DB", +"|. c #91A6E0", +"1. c #93A7E2", +"2. c #95AAE6", +"3. c #99AEEA", +"4. c #9AB2EA", +"5. c #99B1E9", +"6. c #99B1E7", +"7. c #98AFE6", +"8. c #93A8E2", +"9. c #97ACE7", +"0. c #9AB3EB", +"a. c #9DB5ED", +"b. c #9DB6EE", +"c. c #375095", +"d. c #4056AD", +"e. c #506DCD", +"f. c #4360CC", +"g. c #345ED6", +"h. c #335ECF", +"i. c #355ED6", +"j. c #355FD6", +"k. c #365FD6", +"l. c #355FD0", +"m. c #3760D5", +"n. c #3A63D4", +"o. c #3C63D1", +"p. c #3B63CD", +"q. c #3B63C9", +"r. c #3B62C9", +"s. c #3D63C8", +"t. c #4065C5", +"u. c #4567C5", +"v. c #496BC5", +"w. c #4F70C7", +"x. c #5273C8", +"y. c #5475CA", +"z. c #5777CB", +"A. c #5879CD", +"B. c #5A7BCE", +"C. c #5D7DCF", +"D. c #5F7ECF", +"E. c #617FD0", +"F. c #6381D1", +"G. c #6583D2", +"H. c #6785D2", +"I. c #6886D3", +"J. c #6A88D4", +"K. c #6C89D5", +"L. c #6E8BD6", +"M. c #708CD7", +"N. c #718DD8", +"O. c #738EDA", +"P. c #748FDB", +"Q. c #7691DC", +"R. c #7893DD", +"S. c #7994DD", +"T. c #7A96DE", +"U. c #7B97DF", +"V. c #7C98E0", +"W. c #7E9AE2", +"X. c #7F9BE3", +"Y. c #829DE4", +"Z. c #849FE5", +"`. c #87A0E6", +" + c #88A1E7", +".+ c #89A2E6", +"++ c #8CA3E7", +"@+ c #8EA5E9", +"#+ c #8EA6E9", +"$+ c #8FA7E9", +"%+ c #8FA8E8", +"&+ c #8FA9E8", +"*+ c #91A9E8", +"=+ c #90A7E8", +"-+ c #8FA8EA", +";+ c #90AAEA", +">+ c #93ABEA", +",+ c #95ABEA", +"'+ c #93ABE9", +")+ c #94ABEA", +"!+ c #90A9EA", +"~+ c #93AAE9", +"{+ c #273E7E", +"]+ c #345ED5", +"^+ c #3D60CE", +"/+ c #3D60CF", +"(+ c #345ECF", +"_+ c #335ED0", +":+ c #355FD3", +"<+ c #3A60CE", +"[+ c #3A5FCB", +"}+ c #385FC9", +"|+ c #3B60C8", +"1+ c #3C63CB", +"2+ c #3E64CB", +"3+ c #4166CA", +"4+ c #4568C9", +"5+ c #4A6CC7", +"6+ c #4F71C8", +"7+ c #5172CA", +"8+ c #5475CE", +"9+ c #5678D3", +"0+ c #597CD6", +"a+ c #5C7ED7", +"b+ c #5E7FD8", +"c+ c #6181D9", +"d+ c #6383DA", +"e+ c #6585DA", +"f+ c #6786DB", +"g+ c #6988DC", +"h+ c #6B8ADD", +"i+ c #6D8BDE", +"j+ c #6F8DDE", +"k+ c #718EDF", +"l+ c #728FE0", +"m+ c #7390E1", +"n+ c #7390E2", +"o+ c #7491E3", +"p+ c #7592E4", +"q+ c #7693E4", +"r+ c #7794E5", +"s+ c #7894E5", +"t+ c #7995E6", +"u+ c #7B96E6", +"v+ c #7C97E7", +"w+ c #7D9AE8", +"x+ c #7F9CE9", +"y+ c #829DE9", +"z+ c #849EE9", +"A+ c #859EE9", +"B+ c #87A0E7", +"C+ c #8AA2E7", +"D+ c #8BA3E8", +"E+ c #89A2E7", +"F+ c #8CA6EA", +"G+ c #8BA6EA", +"H+ c #8BA7EA", +"I+ c #8CA3E8", +"J+ c #8BA8EA", +"K+ c #8CA7EA", +"L+ c #8CA8EA", +"M+ c #4659C7", +"N+ c #355ECF", +"O+ c #3660CF", +"P+ c #3860CE", +"Q+ c #3961CD", +"R+ c #3B61CB", +"S+ c #3B61CA", +"T+ c #3D62CA", +"U+ c #3D63CA", +"V+ c #4165CB", +"W+ c #456ACB", +"X+ c #4B6FCD", +"Y+ c #5174CE", +"Z+ c #5275D1", +"`+ c #5477D4", +" @ c #5678D9", +".@ c #587ADB", +"+@ c #597BDB", +"@@ c #5B7DDC", +"#@ c #5E7FDC", +"$@ c #6081DD", +"%@ c #6283DE", +"&@ c #6484DF", +"*@ c #6787E0", +"=@ c #6989E1", +"-@ c #6B8BE1", +";@ c #6D8DE2", +">@ c #6F8EE3", +",@ c #718FE4", +"'@ c #7290E4", +")@ c #7491E5", +"!@ c #7692E6", +"~@ c #7793E5", +"{@ c #7894E6", +"]@ c #7895E7", +"^@ c #7996E8", +"/@ c #7A97E8", +"(@ c #7B98E9", +"_@ c #7D99E8", +":@ c #7F9AE8", +"<@ c #7F9BE9", +"[@ c #7F9CEA", +"}@ c #859EE8", +"|@ c #859FE8", +"1@ c #85A0E9", +"2@ c #869FE9", +"3@ c #86A1E7", +"4@ c #86A0E9", +"5@ c #87A1E7", +"6@ c #88A2E7", +"7@ c #87A1E9", +"8@ c #5A6FCA", +"9@ c #365FCF", +"0@ c #345ED0", +"a@ c #385FCC", +"b@ c #385FCE", +"c@ c #3A61CC", +"d@ c #3B62CD", +"e@ c #3E64CD", +"f@ c #4167CF", +"g@ c #4469CF", +"h@ c #486CD1", +"i@ c #4D71D2", +"j@ c #5175D4", +"k@ c #5376D6", +"l@ c #5578DA", +"m@ c #5679DC", +"n@ c #587BDD", +"o@ c #5A7DDE", +"p@ c #5D80DE", +"q@ c #5F82DF", +"r@ c #6284DF", +"s@ c #6585E0", +"t@ c #6787E1", +"u@ c #6988E2", +"v@ c #6B8AE2", +"w@ c #6D8CE3", +"x@ c #6E8DE3", +"y@ c #708EE4", +"z@ c #718FE3", +"A@ c #7391E4", +"B@ c #7592E5", +"C@ c #7895E5", +"D@ c #7996E6", +"E@ c #7A97E6", +"F@ c #7B98E7", +"G@ c #7A98E8", +"H@ c #7B99E9", +"I@ c #7E9AE9", +"J@ c #7D9AE9", +"K@ c #7E9AEA", +"L@ c #809CE9", +"M@ c #819DE8", +"N@ c #7F9BEA", +"O@ c #819DE9", +"P@ c #819CE9", +"Q@ c #839EE9", +"R@ c #839EE8", +"S@ c #839DEA", +"T@ c #859FE9", +"U@ c #87A0E8", +"V@ c #86A0E8", +"W@ c #87A1E8", +"X@ c #3760CF", +"Y@ c #3A61CE", +"Z@ c #3A62CD", +"`@ c #3F66CE", +" # c #4368D0", +".# c #466CD2", +"+# c #496DD5", +"@# c #4E72D6", +"## c #5175D8", +"$# c #5276DA", +"%# c #5578DC", +"&# c #577ADC", +"*# c #597CDD", +"=# c #5B7DDD", +"-# c #5D7FDE", +";# c #5E81DE", +"># c #6183DF", +",# c #6386DF", +"'# c #6687E0", +")# c #6888E0", +"!# c #6A89E1", +"~# c #6C8AE1", +"{# c #6E8CE2", +"]# c #6F8DE2", +"^# c #7390E4", +"/# c #7390E3", +"(# c #7491E4", +"_# c #7693E5", +":# c #7895E6", +"<# c #7896E6", +"[# c #7997E7", +"}# c #7B97E7", +"|# c #7B98E8", +"1# c #7C98E8", +"2# c #7E9BE9", +"3# c #809CEA", +"4# c #819CEA", +"5# c #839DE9", +"6# c #365FD0", +"7# c #3660D0", +"8# c #3961CF", +"9# c #3B63CF", +"0# c #3D64D0", +"a# c #4067D0", +"b# c #4469D2", +"c# c #466BD3", +"d# c #496ED5", +"e# c #4C71D6", +"f# c #4E72D8", +"g# c #5074D9", +"h# c #5376DB", +"i# c #5578DB", +"j# c #587ADC", +"k# c #5B7CDC", +"l# c #5D7EDD", +"m# c #5F80DD", +"n# c #6081DE", +"o# c #6383DE", +"p# c #6686DF", +"q# c #6887E0", +"r# c #6988E0", +"s# c #6B89E1", +"t# c #6C8AE0", +"u# c #6E8CE1", +"v# c #708EE2", +"w# c #718FE2", +"x# c #7290E3", +"y# c #7391E2", +"z# c #7492E1", +"A# c #7592E2", +"B# c #7691E3", +"C# c #7591E3", +"D# c #7692E3", +"E# c #7693E3", +"F# c #7793E4", +"G# c #7893E4", +"H# c #7994E5", +"I# c #7D97E8", +"J# c #7E98E8", +"K# c #7D98E8", +"L# c #7D99E9", +"M# c #7D9BEA", +"N# c #7D9CEA", +"O# c #7E99E8", +"P# c #7D9AEA", +"Q# c #7C9BEA", +"R# c #7C9CEA", +"S# c #355FCF", +"T# c #3860D0", +"U# c #3A62D0", +"V# c #3C64D1", +"W# c #4167D1", +"X# c #4369D3", +"Y# c #466BD4", +"Z# c #486DD5", +"`# c #4A6ED7", +" $ c #4C70D8", +".$ c #5478D9", +"+$ c #577BDA", +"@$ c #597DDB", +"#$ c #5B7EDB", +"$$ c #5D7FDC", +"%$ c #6182DE", +"&$ c #6284DE", +"*$ c #6485DF", +"=$ c #6586DF", +"-$ c #6787DF", +";$ c #6888DF", +">$ c #6A8ADF", +",$ c #6C8BE0", +"'$ c #6D8CE0", +")$ c #6E8DE1", +"!$ c #6F8DE1", +"~$ c #708EE1", +"{$ c #718FE0", +"]$ c #728FE1", +"^$ c #7390E0", +"/$ c #738FE0", +"($ c #7490E1", +"_$ c #7590E1", +":$ c #7591E1", +"<$ c #7592E1", +"[$ c #7692E2", +"}$ c #7794E2", +"|$ c #7894E3", +"1$ c #7996E3", +"2$ c #7A96E5", +"3$ c #7B98E6", +"4$ c #7B9AE8", +"5$ c #7C99E8", +"6$ c #7C96E5", +"7$ c #7D97E7", +"8$ c #7C99E9", +"9$ c #7B9AE9", +"0$ c #7B9AEA", +"a$ c #5B6DCF", +"b$ c #305EC8", +"c$ c #335ECE", +"d$ c #305ECA", +"e$ c #345FCF", +"f$ c #3761D0", +"g$ c #3A62D1", +"h$ c #3C64D2", +"i$ c #4066D3", +"j$ c #466BD5", +"k$ c #486ED6", +"l$ c #4A6ED6", +"m$ c #4D71D8", +"n$ c #4F72D9", +"o$ c #5073D9", +"p$ c #4F72D8", +"q$ c #5074D8", +"r$ c #5276D9", +"s$ c #587ADA", +"t$ c #5B7CDB", +"u$ c #5D7EDC", +"v$ c #5F7FDD", +"w$ c #6081DC", +"x$ c #6182DD", +"y$ c #6283DD", +"z$ c #6484DE", +"A$ c #6585DD", +"B$ c #6787DE", +"C$ c #6988DF", +"D$ c #6A89DE", +"E$ c #6C8ADF", +"F$ c #6D8BDF", +"G$ c #6E8CE0", +"H$ c #6F8DE0", +"I$ c #718EE0", +"J$ c #728FDF", +"K$ c #728FDE", +"L$ c #7290E0", +"M$ c #7190E0", +"N$ c #7291E0", +"O$ c #7191E0", +"P$ c #7392E1", +"Q$ c #7493E1", +"R$ c #7594E1", +"S$ c #7594E2", +"T$ c #7694E2", +"U$ c #7695E2", +"V$ c #7A96E4", +"W$ c #7895E2", +"X$ c #7A96E2", +"Y$ c #7A96E3", +"Z$ c #7B96E3", +"`$ c #7996E1", +" % c #7C96E4", +".% c #305EC9", +"+% c #315ECC", +"@% c #325ECE", +"#% c #3760D0", +"$% c #3962D1", +"%% c #3E66D3", +"&% c #4268D4", +"*% c #446BD5", +"=% c #476CD6", +"-% c #496ED7", +";% c #4B6FD7", +">% c #4C70D7", +",% c #4E71D7", +"'% c #5074D7", +")% c #5276D8", +"!% c #5376D8", +"~% c #5779DA", +"{% c #597ADA", +"]% c #5A7BDB", +"^% c #5B7CDA", +"/% c #5D7EDB", +"(% c #5E7FDB", +"_% c #6182DB", +":% c #6384DC", +"<% c #6586DD", +"[% c #6686DC", +"}% c #6887DD", +"|% c #6988DD", +"1% c #6A8ADE", +"2% c #6B8BDE", +"3% c #6C8CDE", +"4% c #6E8DDF", +"5% c #6E8CDF", +"6% c #6D8DDF", +"7% c #6C8BDF", +"8% c #6F8DDF", +"9% c #718FDF", +"0% c #7290DF", +"a% c #7391E0", +"b% c #7491E0", +"c% c #7292E1", +"d% c #3959C5", +"e% c #345BC5", +"f% c #315EC8", +"g% c #355BC5", +"h% c #325EC8", +"i% c #315ECB", +"j% c #345DCC", +"k% c #335ECD", +"l% c #345ECD", +"m% c #355FCE", +"n% c #3862D0", +"o% c #3E66D2", +"p% c #456BD5", +"q% c #476CD5", +"r% c #4B6ED7", +"s% c #4B6FD6", +"t% c #4B6FD5", +"u% c #4D71D6", +"v% c #5073D7", +"w% c #5174D7", +"x% c #5275D8", +"y% c #5577D8", +"z% c #5678D8", +"A% c #5779D9", +"B% c #587AD8", +"C% c #597CD9", +"D% c #5B7DD9", +"E% c #5D7FDA", +"F% c #5F80DB", +"G% c #6182DC", +"H% c #6484DC", +"I% c #6585DC", +"J% c #6787DD", +"K% c #6988DE", +"L% c #6B8ADE", +"M% c #6B8ADF", +"N% c #6989DE", +"O% c #6B89DE", +"P% c #6E8BDF", +"Q% c #708CDE", +"R% c #708DDF", +"S% c #708FDF", +"T% c #728EDF", +"U% c #6F8EDD", +"V% c #728EDD", +"W% c #7390DF", +"X% c #7490DF", +"Y% c #335DC8", +"Z% c #3759C5", +"`% c #3859C5", +" & c #335EC8", +".& c #325DCA", +"+& c #345CCB", +"@& c #335DCC", +"#& c #345DCD", +"$& c #355FCD", +"%& c #3861D0", +"&& c #3B64D1", +"*& c #3E65D2", +"=& c #4168D3", +"-& c #456AD5", +";& c #4B6ED5", +">& c #4C6FD4", +",& c #4D70D5", +"'& c #4F72D6", +")& c #5173D6", +"!& c #5375D7", +"~& c #5476D8", +"{& c #5577D7", +"]& c #5477D8", +"^& c #5677D8", +"/& c #5879D9", +"(& c #597AD9", +"_& c #5C7DDA", +":& c #6080DC", +"<& c #6080DB", +"[& c #6181DC", +"}& c #6282DC", +"|& c #6383DD", +"1& c #6484DD", +"2& c #6686DE", +"3& c #6685DE", +"4& c #6786DE", +"5& c #6687DE", +"6& c #6887DE", +"7& c #6987DE", +"8& c #6788DF", +"9& c #6785DF", +"0& c #6B89DF", +"a& c #6C89DF", +"b& c #6F8DDD", +"c& c #6D8CDE", +"d& c #445BBB", +"e& c #3759BE", +"f& c #375AC6", +"g& c #355CC8", +"h& c #345CCA", +"i& c #355ECC", +"j& c #365FCD", +"k& c #3761CE", +"l& c #3A63D0", +"m& c #3D65D1", +"n& c #466AD4", +"o& c #476BD4", +"p& c #486CD3", +"q& c #4A6ED4", +"r& c #4B6ED4", +"s& c #4E71D6", +"t& c #4F71D5", +"u& c #5072D6", +"v& c #5274D7", +"w& c #5273D7", +"x& c #5274D6", +"y& c #5476D7", +"z& c #5779D8", +"A& c #587AD9", +"B& c #5A7CDA", +"C& c #5C7DDB", +"D& c #5D7EDA", +"E& c #6081DA", +"F& c #6181DB", +"G& c #6283DC", +"H& c #6483DD", +"I& c #6483DE", +"J& c #6585DE", +"K& c #6786DF", +"L& c #6886DE", +"M& c #6887DF", +"N& c #6987DF", +"O& c #6A88DF", +"P& c #6786E0", +"Q& c #6A86DE", +"R& c #6B89E0", +"S& c #365BC8", +"T& c #365CC8", +"U& c #375DCA", +"V& c #375FCB", +"W& c #3860CD", +"X& c #3C63D0", +"Y& c #4167D2", +"Z& c #4268D2", +"`& c #4368D2", +" * c #4367D2", +".* c #4568D2", +"+* c #466AD2", +"@* c #496CD3", +"#* c #4A6DD3", +"$* c #4A6DD4", +"%* c #4D70D4", +"&* c #4F72D5", +"** c #4C70D4", +"=* c #4E72D5", +"-* c #5173D5", +";* c #5375D6", +">* c #597BDA", +",* c #5B7DDA", +"'* c #5C7EDB", +")* c #5D7FDB", +"!* c #5E80DB", +"~* c #5E81DA", +"{* c #5F81DB", +"]* c #5F82DB", +"^* c #6384DD", +"/* c #6384DE", +"(* c #6585DF", +"_* c #6486E0", +":* c #6583DD", +"<* c #6386E0", +"[* c #6686E0", +"}* c #6B86DD", +"|* c #6D86DD", +"1* c #6086E0", +"2* c #5573CD", +"3* c #3959C3", +"4* c #3959C4", +"5* c #3759C0", +"6* c #375BC7", +"7* c #365CC7", +"8* c #395FCC", +"9* c #3B62CE", +"0* c #3E64D0", +"a* c #4066D1", +"b* c #4166D1", +"c* c #4064CF", +"d* c #4065CF", +"e* c #4266D0", +"f* c #4468D1", +"g* c #4569D1", +"h* c #476BD2", +"i* c #466AD1", +"j* c #476AD2", +"k* c #456AD1", +"l* c #496DD2", +"m* c #4A6FD3", +"n* c #496ED2", +"o* c #4B70D4", +"p* c #4D71D4", +"q* c #4E72D4", +"r* c #5073D4", +"s* c #5174D5", +"t* c #5175D5", +"u* c #5276D6", +"v* c #5377D6", +"w* c #5478D7", +"x* c #5579D7", +"y* c #567AD8", +"z* c #577BD9", +"A* c #597CD8", +"B* c #5A7DD9", +"C* c #5A7ED9", +"D* c #5B7FDA", +"E* c #5C80DA", +"F* c #5D80DA", +"G* c #5E81DB", +"H* c #5D80DB", +"I* c #6082DC", +"J* c #6183DD", +"K* c #6183DE", +"L* c #6082DB", +"M* c #6282DE", +"N* c #6682DE", +"O* c #6583DE", +"P* c #3759BF", +"Q* c #375AC2", +"R* c #375AC1", +"S* c #375AC4", +"T* c #395DCA", +"U* c #3A5ECA", +"V* c #3C60CC", +"W* c #3D61CD", +"X* c #3D61CC", +"Y* c #3C61CD", +"Z* c #3E62CD", +"`* c #3F64CE", +" = c #4266CF", +".= c #4468D0", +"+= c #4267CF", +"@= c #4166CE", +"#= c #4065CE", +"$= c #4166CD", +"%= c #4267CE", +"&= c #456AD0", +"*= c #4368CE", +"== c #4468CF", +"-= c #4569D0", +";= c #486BD1", +">= c #4B6FD3", +",= c #4C70D3", +"'= c #4F73D4", +")= c #5275D5", +"!= c #5477D6", +"~= c #577BD7", +"{= c #587CD8", +"]= c #577CD8", +"^= c #597DD9", +"/= c #5A7DDA", +"(= c #597DDA", +"_= c #587CDA", +":= c #5A7EDA", +"<= c #567BD8", +"[= c #557AD9", +"}= c #567BD9", +"|= c #577CD9", +"1= c #587DD9", +"2= c #587ED9", +"3= c #577ED8", +"4= c #587DD8", +"5= c #587ED8", +"6= c #567ED7", +"7= c #526ABD", +"8= c #3759C1", +"9= c #385BC7", +"0= c #395CC8", +"a= c #3B5DC9", +"b= c #3B5ECA", +"c= c #3A5FCA", +"d= c #3B60CC", +"e= c #3C61CC", +"f= c #3D62CD", +"g= c #3E63CD", +"h= c #3C61CB", +"i= c #3C61CA", +"j= c #3D62CB", +"k= c #3F64CC", +"l= c #4065CD", +"m= c #4669D0", +"n= c #476AD0", +"o= c #496BD1", +"p= c #4A6DD2", +"q= c #4B6ED2", +"r= c #4D71D3", +"s= c #4E73D4", +"t= c #4F74D4", +"u= c #5075D5", +"v= c #5276D5", +"w= c #5377D7", +"x= c #5278D7", +"y= c #5277D6", +"z= c #5378D7", +"A= c #5379D8", +"B= c #5379D9", +"C= c #5278D8", +"D= c #5178D7", +"E= c #3355C0", +"F= c #3556C1", +"G= c #395AC6", +"H= c #385AC7", +"I= c #395BC7", +"J= c #395EC9", +"K= c #395FCA", +"L= c #3B60CA", +"M= c #3B60CB", +"N= c #375DC7", +"O= c #385EC8", +"P= c #395FC9", +"Q= c #3A60CA", +"R= c #3D63CC", +"S= c #4367CF", +"T= c #476BD1", +"U= c #4A6ED2", +"V= c #4B6FD2", +"W= c #4C6FD2", +"X= c #4D70D1", +"Y= c #4E71D2", +"Z= c #4E72D2", +"`= c #4E74D4", +" - c #4E75D5", +".- c #4E75D4", +"+- c #4F75D3", +"@- c #5075D2", +"#- c #5075D3", +"$- c #5177D7", +"%- c #5178D8", +"&- c #4F75D5", +"*- c #5076D5", +"=- c #4F76D6", +"-- c #5279D9", +";- c #3C52B1", +">- c #3656C3", +",- c #3757C5", +"'- c #3758C6", +")- c #3759C6", +"!- c #375BC6", +"~- c #385CC7", +"{- c #385DC8", +"]- c #365CC6", +"^- c #355BC6", +"/- c #355CC6", +"(- c #365DC7", +"_- c #375EC8", +":- c #375CC6", +"<- c #385EC6", +"[- c #3A5FC7", +"}- c #3C60C8", +"|- c #3D61C9", +"1- c #3E62CA", +"2- c #4063CC", +"3- c #4165CE", +"4- c #4268D0", +"5- c #4269D1", +"6- c #436AD2", +"7- c #446AD2", +"8- c #456BD2", +"9- c #496CD1", +"0- c #4C6CD0", +"a- c #4D6CCF", +"b- c #4E6DD0", +"c- c #4F6ECF", +"d- c #4E6FCF", +"e- c #4C70CF", +"f- c #4A71D0", +"g- c #4F6FCF", +"h- c #4B71D0", +"i- c #4A72D1", +"j- c #4B73D4", +"k- c #4F70D0", +"l- c #4C73D3", +"m- c #4C73D6", +"n- c #4B72D2", +"o- c #4B71D1", +"p- c #4C73D7", +"q- c #3354C0", +"r- c #3152BE", +"s- c #3052BE", +"t- c #3051BF", +"u- c #2E4FBF", +"v- c #2E4FBE", +"w- c #2E50BF", +"x- c #2F50BF", +"y- c #3156C4", +"z- c #2F56C5", +"A- c #2E57C5", +"B- c #2F57C5", +"C- c #3057C6", +"D- c #3258C6", +"E- c #3459C7", +"F- c #365AC7", +"G- c #385BC8", +"H- c #3B5DCA", +"I- c #3B5DCB", +"J- c #3C5ECC", +"K- c #3C60CD", +"L- c #3C62CE", +"M- c #3D65D0", +"N- c #3D66D1", +"O- c #4166D2", +"P- c #4667D2", +"Q- c #4A67D1", +"R- c #4C68D0", +"S- c #4C69CF", +"T- c #4D6BCE", +"U- c #4E6DCD", +"V- c #4E6ECE", +"W- c #4E6DCE", +"X- c #4970D0", +"Y- c #4770D0", +"Z- c #4B6BCE", +"`- c #4A6CCE", +" ; c #496DCF", +".; c #476FD0", +"+; c #4870D0", +"@; c #486DCF", +"#; c #242F79", +"$; c #2F41AC", +"%; c #2040B8", +"&; c #2041B8", +"*; c #2243B3", +"=; c #2243B8", +"-; c #2343B8", +";; c #2444B8", +">; c #2445B8", +",; c #2445B6", +"'; c #2445B7", +"); c #2444B9", +"!; c #2949BE", +"~; c #2649BF", +"{; c #234BBF", +"]; c #224CBF", +"^; c #224AC0", +"/; c #244CC0", +"(; c #254DC0", +"_; c #254DC1", +":; c #264DC2", +"<; c #274EC3", +"[; c #274CC3", +"}; c #274DC4", +"|; c #254DC5", +"1; c #214EC5", +"2; c #204FC6", +"3; c #1F50C8", +"4; c #2151C9", +"5; c #2B53C8", +"6; c #3154C7", +"7; c #3255C6", +"8; c #2F57C7", +"9; c #2C58C9", +"0; c #2D59CA", +"a; c #2D58C9", +"b; c #2E5BCC", +"c; c #325ECC", +"d; c #325ECB", +"e; c #1F40B1", +"f; c #1F40B2", +"g; c #1F40B3", +"h; c #2A44BD", +"i; c #2845BE", +"j; c #2745BE", +"k; c #2646BF", +"l; c #2546BE", +"m; c #2347BF", +"n; c #2147BF", +"o; c #2048C0", +"p; c #1D48C0", +"q; c #1C48C0", +"r; c #1B47C0", +"s; c #1C48BF", +"t; c #1E49BE", +"u; c #214ABD", +"v; c #244CBD", +"w; c #264DBE", +"x; c #254EC0", +"y; c #214FC2", +"z; c #1B51C5", +"A; c #1C51C7", +"B; c #2250C8", +"C; c #2A52C8", +"D; c #3254C6", +"E; c #3355C5", +"F; c #3154C8", +"G; c #3355C6", +"H; c #2F57C8", +"I; c #2E58C9", +"J; c #2E59C9", +"K; c #3059C9", +"L; c #2040B6", +"M; c #2743BB", +"N; c #2844BC", +"O; c #2743BD", +"P; c #2844BE", +"Q; c #2844BD", +"R; c #2346BE", +"S; c #2047BF", +"T; c #1E48C0", +"U; c #1D47C0", +"V; c #1D49BF", +"W; c #1F49BF", +"X; c #204ABE", +"Y; c #254DBF", +"Z; c #234EC0", +"`; c #2050C1", +" > c #1C51C3", +".> c #1F51C6", +"+> c #2651C8", +"@> c #2D53C7", +"#> c #3155C6", +"$> c #3155C7", +"%> c #3355C7", +"&> c #3254C7", +"*> c #1E40B1", +"=> c #2141B8", +"-> c #2442B9", +";> c #2744BB", +">> c #2945BB", +",> c #2A45BB", +"'> c #2944BA", +")> c #2745BB", +"!> c #2545BC", +"~> c #2246BD", +"{> c #2047BE", +"]> c #1F47BD", +"^> c #1D48BE", +"/> c #1E49C0", +"(> c #1F4AC0", +"_> c #214BBF", +":> c #244CBE", +"<> c #254DBE", +"[> c #244DBE", +"}> c #224FBF", +"|> c #2051C1", +"1> c #2151C3", +"2> c #2252C5", +"3> c #2151C1", +"4> c #2851C6", +"5> c #2A50C6", +"6> c #2E54C6", +"7> c #1F51C2", +"8> c #1D52C5", +"9> c #2651C9", +"0> c #2950C7", +"a> c #2D40A5", +"b> c #2040B0", +"c> c #1F40B0", +"d> c #223CAE", +"e> c #233CAE", +"f> c #253BAC", +"g> c #253BAD", +"h> c #233CB0", +"i> c #213EB2", +"j> c #1F3FB4", +"k> c #1E40B6", +"l> c #1F3FB7", +"m> c #1E3EB8", +"n> c #1F3FB8", +"o> c #2040B7", +"p> c #2141B6", +"q> c #2140B7", +"r> c #2241B6", +"s> c #2342B5", +"t> c #2442B6", +"u> c #2543B5", +"v> c #2643B4", +"w> c #2544B6", +"x> c #2346B8", +"y> c #2247B9", +"z> c #2048BC", +"A> c #1F48BF", +"B> c #2049C0", +"C> c #214AC0", +"D> c #224BBF", +"E> c #234CBE", +"F> c #244DBF", +"G> c #234CBF", +"H> c #264DC0", +"I> c #274EBF", +"J> c #264DBF", +"K> c #254EBF", +"L> c #2050C0", +"M> c #1F51C1", +"N> c #1E42A4", +"O> c #263BA6", +"P> c #253BA7", +"Q> c #253CA7", +"R> c #1E41A5", +"S> c #1F40AF", +"T> c #273AAC", +"U> c #1E40B0", +"V> c #1F40B5", +"W> c #1F40B6", +"X> c #1F40B8", +"Y> c #1E40B8", +"Z> c #1F3EB8", +"`> c #203FB7", +" , c #2240B6", +"., c #2341B7", +"+, c #2345B9", +"@, c #2147BB", +"#, c #2148BA", +"$, c #2049BB", +"%, c #2049BD", +"&, c #2049BF", +"*, c #224BBE", +"=, c #244DBD", +"-, c #244CBF", +";, c #182969", +">, c #273BAD", +",, c #2739AB", +"', c #263AAC", +"), c #243CAE", +"!, c #233DAE", +"~, c #213EAF", +"{, c #1F3FB0", +"], c #2040B4", +"^, c #1F3FB6", +"/, c #1E3EB7", +"(, c #2240B7", +"_, c #2341B6", +":, c #2543B4", +"<, c #2644B3", +"[, c #2544B5", +"}, c #2545B5", +"|, c #2547B6", +"1, c #2548B7", +"2, c #2349BA", +"3, c #1F49BE", +"4, c #2149BD", +"5, c #2049BE", +"6, c #214BBE", +"7, c #2249BE", +"8, c #234CBD", +"9, c #2149BE", +"0, c #1E49BF", +"a, c #253BA9", +"b, c #253BAB", +"c, c #263AAB", +"d, c #213DAF", +"e, c #203EAF", +"f, c #1D40AF", +"g, c #1D40B0", +"h, c #1E40B4", +"i, c #2241B7", +"j, c #2643B6", +"k, c #2744B5", +"l, c #2643B5", +"m, c #2346B6", +"n, c #2147B7", +"o, c #2644B6", +"p, c #2247B7", +"q, c #2248B8", +"r, c #2647B7", +"s, c #2549B7", +"t, c #2645B7", +"u, c #2148B8", +"v, c #2847B6", +"w, c #2549B6", +"x, c #2849B6", +"y, c #2049B7", +"z, c #2A49B5", +"A, c #243BA4", +"B, c #253BA5", +"C, c #253BA6", +"D, c #263AA7", +"E, c #263AA8", +"F, c #2739AA", +"G, c #243CAD", +"H, c #223DAE", +"I, c #1F3EAF", +"J, c #1E3FB0", +"K, c #1D40B1", +"L, c #1E3FB1", +"M, c #1F3FB3", +"N, c #1F3FB5", +"O, c #2140B6", +"P, c #2140B8", +"Q, c #2744B4", +"R, c #2746B6", +"S, c #2947B6", +"T, c #2946B5", +"U, c #2A48B6", +"V, c #3551A8", +"W, c #1F399C", +"X, c #143D9F", +"Y, c #263BA5", +"Z, c #273BA8", +"`, c #273BAA", +" ' c #263AAD", +".' c #233CAD", +"+' c #213DAE", +"@' c #203FB2", +"#' c #2342B6", +"$' c #2443B6", +"%' c #2543B6", +"&' c #2644B5", +"*' c #133D9E", +"=' c #263BA7", +"-' c #263BA9", +";' c #273BA9", +">' c #263AAA", +",' c #2539AB", +"'' c #2639AB", +")' c #253AAC", +"!' c #243BAD", +"~' c #223DAF", +"{' c #203FB0", +"]' c #2040B1", +"^' c #2140B3", +"/' c #2543B1", +"(' c #2744AF", +"_' c #1A3CA0", +":' c #1D3BA2", +"<' c #233BA4", +"[' c #263AA5", +"}' c #253AA5", +"|' c #263AA6", +"1' c #263BA4", +"2' c #243BA5", +"3' c #263BA8", +"4' c #223EAF", +"5' c #3B4CA5", +"6' c #1D379A", +"7' c #1E389C", +"8' c #1E399F", +"9' c #1F3BA2", +"0' c #1F3BA3", +"a' c #213BA4", +"b' c #233AA3", +"c' c #243AA3", +"d' c #2539A4", +"e' c #253AA6", +"f' c #243BA7", +"g' c #253CAA", +"h' c #253CAC", +"i' c #253CAD", +"j' c #253CAE", +"k' c #243DAE", +"l' c #213FAF", +"m' c #223FAF", +"n' c #2040AF", +"o' c #253D93", +"p' c #1D3894", +"q' c #1F379A", +"r' c #1E389B", +"s' c #1D399C", +"t' c #1C3A9D", +"u' c #1B3A9D", +"v' c #183B9E", +"w' c #163C9E", +"x' c #153C9E", +"y' c #163B9D", +"z' c #173B9D", +"A' c #193A9D", +"B' c #1C3A9E", +"C' c #1F3AA1", +"D' c #223AA4", +"E' c #253BA8", +"F' c #273BA7", +"G' c #263CAB", +"H' c #263CAC", +"I' c #243EAE", +"J' c #273BAC", +"K' c #2A3795", +"L' c #1F389B", +"M' c #1D389B", +"N' c #1C399C", +"O' c #1B399C", +"P' c #1A3A9D", +"Q' c #1D399B", +"R' c #1B399B", +"S' c #1A3A9C", +"T' c #1B3A9F", +"U' c #1D3AA0", +"V' c #203BA2", +"W' c #203BA3", +"X' c #2639A6", +"Y' c #1B3692", +"Z' c #1C3794", +"`' c #1D3796", +" ) c #1E3898", +".) c #1E389A", +"+) c #1F399B", +"@) c #1A399C", +"#) c #193A9E", +"$) c #1A3BA0", +"%) c #1C3BA2", +"&) c #1D3CA3", +"*) c #203CA4", +"=) c #223BA5", +"-) c #3C4699", +";) c #2B4595", +">) c #1C3793", +",) c #1D3895", +"') c #1E3897", +")) c #1F3998", +"!) c #1F3999", +"~) c #1F399A", +"{) c #1E399C", +"]) c #1C3B9E", +"^) c #1D3BA0", +"/) c #1E3CA2", +"() c #223CA5", +"_) c #243CA6", +":) c #596FA9", +"<) c #3B4894", +"[) c #314993", +"}) c #29499F", +"|) c #28489E", +"1) c #2B4BA1", +"2) c #2C4BA1", +"3) c #2D4CA2", +"4) c #2E4CA3", +"5) c #2F4CA4", +"6) c #2E4CA4", +"7) c #2F4DA3", +"8) c #2F4DA4", +"9) c #D3D5D2", +"0) c #3B4794", +"a) c #314791", +"b) c #304892", +"c) c #304893", +"d) c #2F4995", +"e) c #2F4997", +"f) c #2D4A9A", +"g) c #2A4A9D", +"h) c #294A9F", +"i) c #284AA0", +"j) c #294AA0", +"k) c #2B4AA1", +"l) c #2D4CA3", +"m) c #C9CAC9", +"n) c #455D9B", +"o) c #242F78", +"p) c #1B2F85", +"q) c #C6C3C8", +"r) c #B5B2B6", +"s) c #B5B7B4", +"t) c #B5B7B3", +"u) c #B5B2B5", +"v) c #B5B3B4", +"w) c #B5B5B4", +"x) c #B5B6B3", +"y) c #B5B4B4", +"z) c #B5B3B5", +"A) c #B5B4B5", +"B) c #B5B5B5", +"C) c #B5B5B3", +"D) c #B5B5B6", +"E) c #BAC3BE", +"F) c #B9C3BD", +"G) c #C1C3C4", +"H) c #BFC3C2", +"I) c #B9C3BE", +"J) c #BBC3BF", +"K) c #BDC3C1", +"L) c #C0C3C3", +"M) c #BEC3C1", +"N) c #C2C3C5", +"O) c #E6E3E8", +"P) c #E0E2DF", +"Q) c #E1E1E1", +"R) c #E2E1E3", +"S) c #E4E1E6", +"T) c #E4E2E7", +"U) c #E4E2E6", +"V) c #E3E3E4", +"W) c #E2E3E3", +"X) c #E1E3E2", +"Y) c #E3E3E3", +"Z) c #E3E3E2", +"`) c #EBEDEA", +" ! c #EAECE9", +".! c #E9EBE8", +"+! c #ECEEEB", +". . + @ # $ $ $ $ $ $ $ % $ $ $ $ $ % $ $ $ $ $ $ % $ $ $ $ $ % $ $ $ $ $ $ $ $ $ % $ $ & * = - ; > , , ' ) ! ! ~ { ] ^ / ( _ : < [ } | | 1 2 3 3 4 4 4 4 4 4 4 5 6 4 4 4 5 6 7 8 9 4 5 6 7 8 9 6 7 8 9 ", +"0 a b % $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ c d d d d $ $ $ $ $ c d e f g h i i i i j k l m n o p q r s t u v w x y z 4 A B C D 9 9 E 9 E F G H I F J K L L L L J K L L L L L L L L ", +"@ % M N O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O P Q R S T U V W X Y Z ` ...+.@.#.$.%.&.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.b.b.b.b.b.", +"c.$ d.O e.f.g.g.g.h.g.g.g.g.g.h.h.g.g.g.g.g.h.h.g.g.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. +.+++@+#+$+@+$+%+&+*+=+$+-+;+>+,+'+)+!+;+>+,+~+,+>+,+~+,+", +"$ {+N N f.f.f.f.h.h.h.g.f.f.h.h.h.h.g.f.f.h.h.h.h.]+^+/+(+h._+:+<+[+}+|+1+2+3+4+5+6+7+8+9+0+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+A+B+.+C+D+E+D+F+G+H+C+I+F+G+J+K+L+H+F+G+J+K+L+H+J+H+J+H+", +"{+{+N N M+M+h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.N+N+h.h.(+O+P+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@;@>@,@'@)@!@~@{@]@^@/@(@_@:@<@[@[@y+}@|@1@A+1@2@3@ +2@4@2@5@C+D+6@D+7@5@C+D+6@I+C+D+6@I+", +"{+{+8@N M+M+h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.9@9@0@N+a@b@c@d@e@f@g@h@i@j@k@l@m@n@o@p@q@r@s@t@u@v@w@x@y@z@A@B@q+r+C@D@E@F@G@H@_@I@J@K@<@L@M@N@O@P@Q@R@S@T@A+A+U@V@W@W@A+2@U@V@W@W@U@V@W@W@", +"{+{+8@N f.M+h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.(+(+(+9@9@X@Y@Z@e@`@ #.#+#@###$#%#&#*#=#-#;#>#,#'#)#!#~#{#]#z@^#/#(#p+_#r+:#s+t+<#[#}#|#|#1#_@|#_@_@2#L@3#4#y+y+5#z+z+z+5#z+z+z+z+A+A+A+A+A+", +"{+{+8@8@f.f.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.(+6#7#8#9#0#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#&@p#q#r#s#t#u#v#w#x#x#y#y#z#A#B#C#D#E#E#F#G#H#F#H#H#u+v+I#J#K#L#J@J@M#N#O#P#M#M#M#N#M#Q#Q#R#", +"$ {+8@e.f.f.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.h.S#l.7#T#U#V#W#X#Y#Z#`# $f#g###.$+$@$#$$$$@%$&$*$=$-$;$>$,$'$)$!$~$~${$]$^$/$($($_$_$:$<$_$<$[$}$|$|$1$2$2$3$}#4$5$6$7$8$8$9$8$8$8$0$8$", +"$ {+a$e.f.f.h.h.h.h.h.h.h.h.h.b$h.c$c$c$c$c$d$c$c$c$c$c$c$c$c$c$c$e$e$7#f$g$h$i$X#j$k$l$m$n$o$p$q$r$l@s$t$u$v$w$x$y$z$A$B$C$D$E$F$G$G$H$I$J$J$K$K$J$L$L$L$L$L$M$N$O$P$Q$R$S$T$U$1$V$T$W$X$Y$1$V$Y$Z$`$ %", +"$ $ a$a$f.f.b$b$b$b$b$b$b$b$b$b$b$b$b$b$b$b$b$b$.%b$b$b$.%d$+%+%@%h.e$l.#%$%h$%%&%*%=%-%;%>%,%'%)%!% @ @~%{%]%^%/%(%w$_%:%<%[%}%|%D$1%2%3%4%5%4%4%6%5%5%4%4%4%5%7%5%8%9%L$0%a%a%a%P$b%P$P$z#z#z#P$c%c%c%", +"$ $ 8@e.f.f.d%b$b$b$b$b$d%b$b$b$b$b$b$e%f%b$b$b$b$b$g%h%b$.%i%i%j%k%l%m%X@n%h$o%&%p%q%`#r%s%t%u%v%w%x%y% @z%A%B%C%D%E%F%G%:%H%I%[%J%}%K%|%D$K%D$D$L%M%M%M%M%M%D$N%O%i+P%j+Q%R%S%T%0%U%V%W%W%W%W%X%X%X%X%", +"$ $ 8@8@f.f.d%d%b$b$b$b$d%d%b$b$b$h%Y%Z%Z%h%f%f%h%Y%`%`% &h%h%.&+&@&#&$&X@%&&&*&=&-&j$Z#+#;&>&,&'&)&)&!&~&{&]&^&/&(&^%_&(%:&<&[&}&|&1&A$A$2&3&4&4&5&B$6&7&B$7&8&9&6&7&0&a&a&i+i+i+b&a&a&j+U%c&U%j+U%c&U%", +"$ $ 8@8@d&e&d%d%d%d%d%d%d%d%d%d%d%`%d%d%d%d%`%`%`%d%d%d%d%`%`%f&g&h&j%i&j&k&l&m&=&X#Y#n&o&p&q&r&>&s&t&t&u&v&w&x&y&{&z&A&B&C&D&(%(%F%F%E&F&}&}&|&G&|&H&1&I%I&A$1&}&z$z$J&K&L&M&N&O&0&P&Q&0&a&R&a&a&a&R&a&", +"{+$ 8@8@e&e&d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%`%f&S&T&U&V&W&Y@X&Y&Z&`& *.*+*@*#*@*r&$*#*r&%*&***=*-*;*y&z%A%z&A&A&>*B&,*,*'*)*!*!*~*{*F&}&{*}&{*]*G%G%y$^*/*J&(*2&_*:*<*=$[*}*<*=$<*|*1*", +"{+{+8@2*e&e&d%d%d%d%d%d%d%d%d%e&3*4*4*4*4*4*5*4*4*4*4*4*4*4*4*4*`%f&6*6*7*8*9*0*a*b*c*d*e*f*g*h*i*j*+*k*h*l*m*n*m*o*p*q*r*s*t*u*v*w*x*y*y*z*A*B*C*D*E*F*G*E*G*F*H*G*F*~*]*{*I*x$J*K*L*G%K*M*o#o#I&N*O*O*", +"{+{+8@2*e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&P*e&e&e&e&e&e&P*P*e&e&e&P*P*5*Q*R*S*T*U*V*W*X*Y*Z*`*d* =.=+=@=#=$=%=g@&=*===-=i*;=l*>=,=q*'=s*)=k@!=x*~={=]=^=/=(=_=:=(=<=<=]=[=}=|=]=]=1=2=3=|=4=5=2=2=2=3=6=6=6=", +"{+{+7=e.e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&e&P*P*8=9=0=a=b=U*c=d=e=f=e@#=g=h=i=i=j=k=k=l=%===m=n=o=p=q=,=r=s=t=u=v=v*w=x=x=y=z=z=A=z=A=B=C=B=D=C=B=x=B=B=B=B=B=B=B=B=B=B=B=B=B=B=", +"{+{+7=7=e&e&e&e&E=E=e&e&e&e&E=E=E=e&e&e&e&E=E=E=e&e&e&e&E=E=e&e&e&e&E=E=E=F=d%G=G=H=I=J=K=L=M=R+}+N=O=P=Q=j=i=h=R=e@@=S=-=T=h@l*U=V=W=X=Y=Z=`= - - -.-+-@- -#-$-%-$-&-*-$-=-%-----C=$-%---------B=B=B=B=", +"{+{+7=7=;-;-E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=>-,-'-)-!-6*~-{-{-]-^-/-/-(-_-:-N=<-[-}-|-1-2-3- =4-5-6-7-8-9-0-0-a-b-c-d-e-f-g-h-h-i-j-k-h-h-i-j-l-m-n-o-i-j-l-m-n-j-l-p-n-", +"{+{+7=7=;-;-E=E=E=E=E=E=E=E=q-r-s-t-t-u-u-v-v-v-u-w-x-u-u-u-u-u-u-u-u-v-v-u-u-u-u-u-v-v-u-u-u-u-v-v-u-y-z-A-B-C-D-E-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-U-V-W-V-e-X-Y-Z-`- ;.;Y-N N +;@;.;Y-N N N N N N N ", +"#;#;d&d&$;$;%;%;%;%;%;%;%;%;&;*;=;-;-;-;;;>;,;>;>;>;;;>;>;>;>;>;>;>;>;>;';);>;>;>;>;>;';>;>;>;>;>;';);!;~;{;];^;/;(;_;_;:;<;[;};};|;1;2;3;4;5;6;7;8;9;9;0;a;0;0;b;h.a;0;0;b;h.c;h.d;0;b;h.c;h.d;h.c;h.d;", +"#;#;;-;-$;$;e;e;e;e;e;e;e;e;e;e;e;f;f;f;f;e;e;e;f;f;f;f;f;f;f;f;f;f;f;f;g;%;f;f;f;f;f;g;f;f;f;f;f;g;%;h;i;j;k;l;m;n;o;p;q;r;r;s;t;u;v;w;x;y;z;A;B;C;6;D;E;F;G;G;H;I;F;G;G;H;I;J;J;K;G;H;I;J;J;K;I;J;J;K;", +"#;#;;-;-$;$;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;L;e;e;e;e;e;e;e;e;e;e;e;e;L;M;N;O;P;Q;i;i;k;R;S;T;U;q;q;V;W;X;{;Y;Z;`; >.>+>@>#>+>$>6;#>#>+>%>&>G;G;G;G;G;&>G;G;G;G;G;G;G;G;G;", +"#;#;d.;-$;$;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;*>e;e;e;e;e;e;e;e;e;e;e;e;*>=>->;>>>,>'>'>)>!>~>{>]>^>^>V;V;/>(>_>:><>[>}>|>1>2>3>2>4>5>6>7>8>9>0>G;G;G;G;9>0>G;G;G;G;G;G;G;G;", +"#;#;d.d.a>a>e;e;e;e;e;e;e;e;e;e;b>b>c>c>c>c>c>b>e;e;e;e;e;e;e;e;e;e;e;e;e;e;d>e>f>g>h>i>j>k>l>l>m>m>n>n>o>o>p>q>r>r>s>t>u>v>v>u>w>';x>y>z>t;A>B>C>D>E>E>F>G>F>H>H>I>F>Y;J>w;K>L>K>M>J>w;K>L>K>M>K>L>K>M>", +"#;#;d.d.a>a>N>e;N>O>O>O>N>e;N>O>O>P>Q>R>S>R>Q>O>O>O>N>e;N>O>O>O>N>e;N>N>O>T>e;e;e;U>U>U>U>f;V>W>o>o>o>o>X>X>Y>Y>n>n>Z>Z>`> ,.,t>t>u>u>w>+,@,#,$,%,A>&,*,=,B>[>-,w;<>C>[>-,w;w;w;w;w;-,w;w;w;w;w;w;w;w;w;", +"#;;,;-;-a>a>N>N>N>O>O>O>N>N>N>O>O>O>O>N>N>N>O>O>O>O>N>N>N>O>O>O>N>N>N>N>O>>,,,,,,,',g>),!,~,{,{,*>U>e;f;],o>%;o>^,^,/,/,l>q>(,_,t>u>:,<,v>[,},|,1,2,%,%,3,4,5,6,7,8,9,5,6,0,G>G>Y;G>6,0,G>G>Y;G>G>G>Y;G>", +";,;,;-;-O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>P>a,b,',',c,c,f>),e>d,e,{,{,U>U>f,f,U>U>g,g,*>g;h,^,^,`>`>q>i,t>j,k,k,l,w>m,n,o,p,q,r,s,t,p,u,v,w,x,y,z,u,v,w,x,y,z,w,x,y,z,", +";,;,b b O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>A,A,A,B,C,D,E,F,c,',g>G,!,H,~,e,{,I,J,J,K,K,U>f,f,J,L,M,N,L;O,i,P,.,l,Q,k,k,k,k,k,k,R,v,k,k,k,R,v,S,T,U,k,R,v,S,T,U,v,S,T,U,", +";,;,b V,W,W,X,X,O>X,X,X,X,X,O>X,X,X,X,X,X,O>X,X,X,X,X,X,O>X,X,X,X,X,O>X,X,O>O>O>O>B,B,B,B,Y,O>O>Z,`,T>T> '',g>.'+'e,{,{,e,+'+'e,e,{,J,K,e;@'N,O,#'$'%'%'j,%'j,&'k,k,%'j,&'k,k,k,k,k,&'k,k,k,k,k,k,k,k,k,", +";,;,b V,W,W,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,*'O>O>O>O>O>O>O>O>B,B,A,A,B,C,='-'`,;'>'>',''')'!'!'e>e>~'~'~,~,{'{,*>*>e;]']']']']']'^'/']']']'^'/':,(':,]'^'/':,(':,/':,(':,", +";,;,V,V,W,W,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,_':'<'['}'|'|'O>O>O>O>O>O>O>Y,Y,1'1'B,B,2'2'C,3'-'>'c,)')'!'),4'{'e;]'e;*>*>e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;e;", +";,;,5'5'W,W,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,W,6'6'6'7'8'9'0'a'b'c'd'd'}'}'O>O>O>O>O>O>O>O>Y,1'1'['['e'e'f'g'h'i'j'k'G,),!,l'j'm'n'b>b>),m'b>e;e;e;e;e;b>e;e;e;e;e;e;e;e;e;", +";,;,b b o'o'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'W,q'q'q'r's't'u'v'w'x'y'z'A'B'C'D'2'2'B,B,O>O>O>O>O>O>O>O>O>O>O>Y,Y,C,C,='='='E'F'3'3'3'G'Z,='F'F'G'H'I'J'F'F'G'H'I'J'G'H'I'J'", +";,;,b b K'K'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'W,W,W,W,W,L'L'q'r'M'N'O'P'u'N's'Q'R'S'A'T'U'C'V'9'0'W'D'}'X'|'O>O>B,B,O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>", +";,;,b b K'K'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'p'Y'Y'Y'Z'`' ).)+)+)+)W,W,W,W,L'L'q'q'r'r's'M'N'P'@)A'#)$)%)&)*)=)B,|'|'O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>O>", +"{+;,$ -);)K'p'p'o'p'p'p'p'p'o'p'p'p'p'p'p'o'p'p'p'p'p'p'o'p'p'p'p'p'o'o'p'p'p'p'p'p'p'p'p'p'>)>)Y'Y'>)Z',)')))!)~)+)W,W,W,W,W,W,W,W,W,W,W,L'L'{)s't'])^)/)])/)/)O>()])/)/)O>()O>_)O>/)O>()O>_)O>()O>_)O>", +":);,;,;)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)[)M M M M M M M M M M M M M M M M M M })})|)|)})M M 1)2)3)4)5)6)6)6)7)7)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)", +"9)#;;,;,$ -)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)<)0)a)a)a)b)c)d)e)f)g)h)i)i)j)j)M M M M M M M M M M M })})})})M k)k)M M k)l)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)8)", +"+ 9)m)n)$ #;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;#;o)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)p)", +"+ + 9)a m)q)r)s)r)s)r)s)r)s)r)r)s)r)s)r)s)r)r)s)r)s)r)s)r)s)r)s)r)s)r)s)r)t)u)v)w)x)x)w)y)z)A)A)B)B)B)B)w)w)C)C)w)w)B)B)B)B)B)w)w)w)w)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)B)D)B)B)B)B)B)D)B)B)B)D)B)", +". + + 9)9)9)q)E)q)E)q)E)q)E)q)q)E)q)E)q)E)q)q)E)q)E)q)E)q)E)q)E)q)E)q)E)q)F)G)H)E)I)J)K)H)L)L)L)L)L)L)L)H)H)M)M)H)H)L)L)G)L)L)H)H)H)H)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)L)N)L)L)L)L)L)N)L)L)L)N)L)", +". . 0 . + O)P)O)P)O)P)O)P)O)P)P)O)P)O)P)O)P)P)O)P)O)P)O)P)O)P)O)P)O)P)O)P)O)Q)R)S)T)U)V)W)X)W)W)V)V)V)V)V)V)V)V)Y)Y)Z)Z)Y)Z)Z)Y)Y)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)V)Y)V)V)V)V)V)Y)V)V)V)Y)V)", +". . . 0 0 0 . 0 0 0 + 0 + 0 + 0 + 0 + 0 + 0 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 0 `) !+ + + .! !`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)`)+!`)`)`)`)`)+!`)`)`)+!`)"}; + + +static char * listviewhighcornerright_xpm[] = { +"100 46 780 2", +" c None", +". c #6A779D", +"+ c #6C789C", +"@ c #6C789D", +"# c #6B789D", +"$ c #6A779E", +"% c #66759E", +"& c #64749E", +"* c #63749E", +"= c #61739D", +"- c #576D9B", +"; c #556C9C", +"> c #4D679D", +", c #4A649D", +"' c #49629D", +") c #465E9C", +"! c #40579C", +"~ c #3B5394", +"{ c #2C4E97", +"] c #314993", +"^ c #2B4595", +"/ c #1B4296", +"( c #253D93", +"_ c #19418F", +": c #0F3C96", +"< c #42599E", +"[ c #758DC3", +"} c #E8EAE7", +"| c #EEF0ED", +"1 c #FBFBFC", +"2 c #6F7D9B", +"3 c #6F7D9A", +"4 c #6E7B9C", +"5 c #67759E", +"6 c #63739E", +"7 c #62739D", +"8 c #596F9C", +"9 c #4A639D", +"0 c #47609C", +"a c #445B9F", +"b c #3E5697", +"c c #2E509A", +"d c #2D509A", +"e c #2D4F99", +"f c #2D4F98", +"g c #28418A", +"h c #3E51A3", +"i c #D0D3DC", +"j c #A1B6EF", +"k c #A2B6F0", +"l c #A1B6F0", +"m c #A3B6F0", +"n c #A0B6EF", +"o c #9DB6EE", +"p c #9CB5EF", +"q c #9CB2F0", +"r c #9FB5EE", +"s c #9CB4EB", +"t c #9AB3EC", +"u c #9AB0EC", +"v c #9DB3EB", +"w c #9BB4EC", +"x c #9BB4EE", +"y c #9BB1EF", +"z c #9BB0F0", +"A c #90ACF0", +"B c #93ABEE", +"C c #91A8EB", +"D c #8BA3E8", +"E c #88A1E7", +"F c #809DE9", +"G c #7A99E8", +"H c #7491E5", +"I c #698AE4", +"J c #6184E3", +"K c #507EDC", +"L c #4E7CDB", +"M c #4F7DDC", +"N c #5479DA", +"O c #567BDC", +"P c #577CDD", +"Q c #5074DA", +"R c #5174DB", +"S c #5175DC", +"T c #5276DD", +"U c #4D71DE", +"V c #4C72D8", +"W c #3A6CE0", +"X c #2B49A6", +"Y c #E0E2DF", +"Z c #93AAE9", +"` c #94A9E8", +" . c #94AAE9", +".. c #93A9E9", +"+. c #92AAE9", +"@. c #8DA9E8", +"#. c #8CA7E9", +"$. c #92ABE9", +"%. c #8EAAE9", +"&. c #8EA9E9", +"*. c #8FAAE9", +"=. c #8CA8E9", +"-. c #8CA2E7", +";. c #86A1E6", +">. c #839EE9", +",. c #7F9CE9", +"'. c #7A97E8", +"). c #7693E7", +"!. c #6E8EE8", +"~. c #678AE9", +"{. c #5D84E3", +"]. c #577CDF", +"^. c #4E77DF", +"/. c #4A70DB", +"(. c #4870DB", +"_. c #4870DC", +":. c #4770E3", +"<. c #496FDC", +"[. c #486EDB", +"}. c #466FE4", +"|. c #466EE3", +"1. c #4167D9", +"2. c #4066D8", +"3. c #3F66D8", +"4. c #3D64D7", +"5. c #3960DA", +"6. c #476DD9", +"7. c #446EE5", +"8. c #305EC8", +"9. c #8EAAE8", +"0. c #8FAAE8", +"a. c #91AAE9", +"b. c #8FA9E8", +"c. c #8BA8E8", +"d. c #8AA7E9", +"e. c #8BA5EA", +"f. c #8AA7E8", +"g. c #87A2E6", +"h. c #859FE8", +"i. c #7F9DE8", +"j. c #7C9AE8", +"k. c #7B95E7", +"l. c #7090E8", +"m. c #6B8BE9", +"n. c #6386E6", +"o. c #5881E1", +"p. c #5479DE", +"q. c #4D74DE", +"r. c #476EDB", +"s. c #446EE1", +"t. c #446EE0", +"u. c #446EDF", +"v. c #446DE0", +"w. c #426ADF", +"x. c #3C64DA", +"y. c #4360CC", +"z. c #D3D5D2", +"A. c #E6E3E8", +"B. c #8DA2E7", +"C. c #8CA6EA", +"D. c #8DA3E9", +"E. c #88A2E7", +"F. c #87A1E7", +"G. c #8AA1E7", +"H. c #849EE9", +"I. c #7D9AE9", +"J. c #7B98E8", +"K. c #7796E5", +"L. c #7191E7", +"M. c #688CE9", +"N. c #6687E5", +"O. c #5C83E1", +"P. c #557BDE", +"Q. c #4F76DE", +"R. c #4C72DE", +"S. c #456EDF", +"T. c #426AD9", +"U. c #4269D9", +"V. c #4269D8", +"W. c #3D64D9", +"X. c #3A61DA", +"Y. c #345ED6", +"Z. c #335ECF", +"`. c #C6C3C8", +" + c #86A1E7", +".+ c #87A2E7", +"++ c #87A0E7", +"@+ c #859EE8", +"#+ c #849DE9", +"$+ c #7E9BE9", +"%+ c #7A99E9", +"&+ c #7A95E5", +"*+ c #7593E7", +"=+ c #6F8EE9", +"-+ c #668AE5", +";+ c #6386E0", +">+ c #5B82DF", +",+ c #5379DE", +"'+ c #5075DE", +")+ c #4B6FDC", +"!+ c #446AD7", +"~+ c #4269D6", +"{+ c #4269D5", +"]+ c #3E65D7", +"^+ c #C9CAC9", +"/+ c #869EE9", +"(+ c #859FE9", +"_+ c #849FE9", +":+ c #829DE8", +"<+ c #819DE8", +"[+ c #7B9AE9", +"}+ c #7A96E6", +"|+ c #7290E8", +"1+ c #698CE6", +"2+ c #6689E0", +"3+ c #5D84E0", +"4+ c #587FDF", +"5+ c #5377DD", +"6+ c #4B74DE", +"7+ c #496BD8", +"8+ c #7C9BE9", +"9+ c #7E9CE9", +"0+ c #7D9AEA", +"a+ c #7D9BEA", +"b+ c #7D98E8", +"c+ c #7C98E8", +"d+ c #7796E4", +"e+ c #7592E6", +"f+ c #7390E1", +"g+ c #698DE0", +"h+ c #6588DE", +"i+ c #5E84E0", +"j+ c #5880DF", +"k+ c #5479DC", +"l+ c #4F75DE", +"m+ c #4A6FDB", +"n+ c #436AD7", +"o+ c #3F65D7", +"p+ c #BAC3BE", +"q+ c #7B9AE8", +"r+ c #7B9AEA", +"s+ c #7A9AEA", +"t+ c #7B99E9", +"u+ c #7D97E7", +"v+ c #7D95E6", +"w+ c #7D95E5", +"x+ c #7C95E6", +"y+ c #7493E3", +"z+ c #7290DF", +"A+ c #6C8DDE", +"B+ c #6B89E1", +"C+ c #6486DF", +"D+ c #5D81DF", +"E+ c #567DDE", +"F+ c #4F73DE", +"G+ c #496EDA", +"H+ c #355ED6", +"I+ c #345ED5", +"J+ c #7E95E5", +"K+ c #7C97E8", +"L+ c #7C97E7", +"M+ c #7B94E6", +"N+ c #7A95E4", +"O+ c #7695E5", +"P+ c #7694E4", +"Q+ c #7994E6", +"R+ c #7995E4", +"S+ c #7594E4", +"T+ c #7391E2", +"U+ c #6E8EDE", +"V+ c #6B8ADE", +"W+ c #6688DF", +"X+ c #5F84E0", +"Y+ c #5980E0", +"Z+ c #4D72DD", +"`+ c #456BD7", +" @ c #4168D6", +".@ c #3C64D7", +"+@ c #335ED0", +"@@ c #4659C7", +"#@ c #7292E1", +"$@ c #7392E1", +"%@ c #7492E1", +"&@ c #718FDF", +"*@ c #6F8EDE", +"=@ c #6D8BDE", +"-@ c #6B88DF", +";@ c #597FDF", +">@ c #557ADD", +",@ c #5176DC", +"'@ c #4D74DD", +")@ c #496DDA", +"!@ c #3860D8", +"~@ c #7391E0", +"{@ c #7290DE", +"]@ c #6D8EDD", +"^@ c #6D8DDD", +"/@ c #7190E0", +"(@ c #6C8DDD", +"_@ c #6B89DF", +":@ c #6487E0", +"<@ c #6085DF", +"[@ c #5F81DE", +"}@ c #567EDE", +"|@ c #4F74D9", +"1@ c #466BD7", +"2@ c #4067D5", +"3@ c #3C63D7", +"4@ c #335ED3", +"5@ c #335ED1", +"6@ c #718EDD", +"7@ c #728EDD", +"8@ c #748EDD", +"9@ c #708EDD", +"0@ c #6F8DDD", +"a@ c #6E8DDD", +"b@ c #6C8ADE", +"c@ c #6C89DF", +"d@ c #6988DF", +"e@ c #6387DF", +"f@ c #6282DE", +"g@ c #5681E0", +"h@ c #577BDD", +"i@ c #5277DB", +"j@ c #4D73D8", +"k@ c #4A70D8", +"l@ c #436AD5", +"m@ c #3F66D6", +"n@ c #3C63D8", +"o@ c #3960D8", +"p@ c #3860D7", +"q@ c #335ED2", +"r@ c #345ED4", +"s@ c #6C88DF", +"t@ c #6D88DF", +"u@ c #6B89DE", +"v@ c #6888DF", +"w@ c #6587E0", +"x@ c #6989DF", +"y@ c #6687E0", +"z@ c #6287E0", +"A@ c #6281DD", +"B@ c #5881E0", +"C@ c #557ADB", +"D@ c #5176D9", +"E@ c #4E75D7", +"F@ c #4A6FD8", +"G@ c #476BD6", +"H@ c #4067D6", +"I@ c #3C62D7", +"J@ c #3C60D4", +"K@ c #365ED1", +"L@ c #345ED3", +"M@ c #6786DF", +"N@ c #5F85E0", +"O@ c #5F86E0", +"P@ c #6186DF", +"Q@ c #6286E0", +"R@ c #6284DF", +"S@ c #6384DF", +"T@ c #5B7FDE", +"U@ c #577DDC", +"V@ c #557BDA", +"W@ c #5278D8", +"X@ c #4E76D6", +"Y@ c #4C72D7", +"Z@ c #486DD8", +"`@ c #4469D6", +" # c #3F62D2", +".# c #3C60CF", +"+# c #345ECF", +"@# c #6086DF", +"## c #6085E0", +"$# c #6285DF", +"%# c #6383DD", +"&# c #6481DC", +"*# c #6380DD", +"=# c #6183DE", +"-# c #6083DD", +";# c #6081DC", +"># c #6080DD", +",# c #6083DE", +"'# c #6181DC", +")# c #6280DD", +"!# c #577EDB", +"~# c #557CD7", +"{# c #4F76D6", +"]# c #4E74D7", +"^# c #466CD7", +"/# c #3B64D6", +"(# c #4261CD", +"_# c #375FCE", +":# c #5A7FD8", +"<# c #6281DA", +"[# c #5F81D8", +"}# c #5C80D8", +"|# c #557DD7", +"1# c #577ED8", +"2# c #567ED7", +"3# c #587DD8", +"4# c #577DD8", +"5# c #587ED8", +"6# c #567DD8", +"7# c #5379D9", +"8# c #5177D7", +"9# c #4D74D5", +"0# c #486ED9", +"a# c #4068D4", +"b# c #3D65D2", +"c# c #4361CC", +"d# c #345ECE", +"e# c #325DCF", +"f# c #2C5AD1", +"g# c #3959C5", +"h# c #547BD8", +"i# c #567DD7", +"j# c #557BD8", +"k# c #5279D9", +"l# c #5278D9", +"m# c #4D74D6", +"n# c #4B71D8", +"o# c #496CD8", +"p# c #4669D7", +"q# c #3D66D3", +"r# c #3F62CF", +"s# c #4260CC", +"t# c #5379D8", +"u# c #4E75D4", +"v# c #4C73D7", +"w# c #476CD7", +"x# c #4869D0", +"y# c #4067D2", +"z# c #3D64D1", +"A# c #4261CC", +"B# c #395FCE", +"C# c #4F75D3", +"D# c #5074D2", +"E# c #5174D1", +"F# c #5175D1", +"G# c #4F74D3", +"H# c #4C73D5", +"I# c #4C73D4", +"J# c #4A72D1", +"K# c #4B70CF", +"L# c #506CCC", +"M# c #4D6BCE", +"N# c #4167D0", +"O# c #3D65D1", +"P# c #3F63CF", +"Q# c #3B5FCD", +"R# c #3159CD", +"S# c #4971D0", +"T# c #4870CF", +"U# c #4C6FCF", +"V# c #4E6CCE", +"W# c #4E6BCE", +"X# c #4769CF", +"Y# c #3D66D0", +"Z# c #3C65D1", +"`# c #4062CE", +" $ c #3D5FCD", +".$ c #365FCF", +"+$ c #325DCD", +"@$ c #2D5AD0", +"#$ c #3859C5", +"$$ c #355FCF", +"%$ c #355ECF", +"&$ c #335ECE", +"*$ c #305CCD", +"=$ c #2B5ACE", +"-$ c #3056C9", +";$ c #2553C6", +">$ c #2153C8", +",$ c #1F4FC7", +"'$ c #274CC5", +")$ c #214AC7", +"!$ c #1C48C8", +"~$ c #1244C9", +"{$ c #1043C9", +"]$ c #1144C9", +"^$ c #2A45BE", +"/$ c #2744B5", +"($ c #1D49C0", +"_$ c #2B58DE", +":$ c #002D94", +"<$ c #2B59CA", +"[$ c #2A59CA", +"}$ c #2E57C8", +"|$ c #3255C6", +"1$ c #3355C5", +"2$ c #1C52C8", +"3$ c #1D50C7", +"4$ c #234FC6", +"5$ c #264CC5", +"6$ c #1D48C7", +"7$ c #1245C8", +"8$ c #1F44C2", +"9$ c #2945BE", +"0$ c #2A45BD", +"a$ c #2040BF", +"b$ c #3156C7", +"c$ c #3056C7", +"d$ c #3354C5", +"e$ c #3355C6", +"f$ c #3255C5", +"g$ c #3254C5", +"h$ c #1952C7", +"i$ c #1951C8", +"j$ c #2050C7", +"k$ c #274CC4", +"l$ c #244CC6", +"m$ c #1F49C7", +"n$ c #1E47C5", +"o$ c #2045C3", +"p$ c #1C44BF", +"q$ c #2045BE", +"r$ c #2040B8", +"s$ c #3254C6", +"t$ c #3055C6", +"u$ c #2A54C6", +"v$ c #2353C7", +"w$ c #3054C5", +"x$ c #2F55C5", +"y$ c #2A54C5", +"z$ c #2553C5", +"A$ c #2F54C5", +"B$ c #3155C6", +"C$ c #2A54C7", +"D$ c #1A52C8", +"E$ c #204FC2", +"F$ c #264DC6", +"G$ c #234BC5", +"H$ c #1D48C1", +"I$ c #1E48BF", +"J$ c #2646BE", +"K$ c #2B45BD", +"L$ c #1E43BE", +"M$ c #2643BF", +"N$ c #2243BF", +"O$ c #3049BC", +"P$ c #1E50BE", +"Q$ c #1D50C0", +"R$ c #1D50BF", +"S$ c #1852C1", +"T$ c #1E51C0", +"U$ c #214FBF", +"V$ c #2050C0", +"W$ c #244EBF", +"X$ c #2151C0", +"Y$ c #234FBF", +"Z$ c #2350C0", +"`$ c #2351C0", +" % c #244FBF", +".% c #2250C0", +"+% c #2051C0", +"@% c #1E50C0", +"#% c #244DBE", +"$% c #274DBF", +"%% c #244CBF", +"&% c #1C48C0", +"*% c #2247BF", +"=% c #2C44BD", +"-% c #1C44BE", +";% c #1444BF", +">% c #1841BF", +",% c #1F40BF", +"'% c #254DBE", +")% c #224FBE", +"!% c #224FBF", +"~% c #234EBF", +"{% c #254CBD", +"]% c #244DBD", +"^% c #244CBD", +"/% c #264DBE", +"(% c #264DBD", +"_% c #214BC0", +":% c #1D48C0", +"<% c #2347BF", +"[% c #2B44BD", +"}% c #2444BE", +"|% c #0F42BF", +"1% c #0641BF", +"2% c #0F41BF", +"3% c #1741BE", +"4% c #1F40BD", +"5% c #234BBF", +"6% c #234CBE", +"7% c #214BBE", +"8% c #244CBE", +"9% c #214ABE", +"0% c #214ABF", +"a% c #1F48C0", +"b% c #2746BE", +"c% c #1F43BE", +"d% c #0941BE", +"e% c #0342BA", +"f% c #0242BC", +"g% c #1241B8", +"h% c #1F40B7", +"i% c #2F41AC", +"j% c #2644AE", +"k% c #2D49B4", +"l% c #2649B6", +"m% c #2949B7", +"n% c #2849B5", +"o% c #2149B8", +"p% c #1E49B9", +"q% c #1F48B8", +"r% c #1F49B9", +"s% c #2545B6", +"t% c #2744B7", +"u% c #2844B7", +"v% c #2043B8", +"w% c #1241B7", +"x% c #1340B8", +"y% c #0D41B8", +"z% c #1941B8", +"A% c #1F40B8", +"B% c #203FB8", +"C% c #2549B5", +"D% c #2648B6", +"E% c #2547B7", +"F% c #2248B7", +"G% c #2048B7", +"H% c #2346B6", +"I% c #2146B6", +"J% c #2247B7", +"K% c #2148B7", +"L% c #2743B4", +"M% c #2643B5", +"N% c #2542B6", +"O% c #1D42B7", +"P% c #0E42B8", +"Q% c #0C41B8", +"R% c #1341B8", +"S% c #1740B8", +"T% c #1C41B8", +"U% c #1F40B1", +"V% c #2644B5", +"W% c #2544B5", +"X% c #2544B4", +"Y% c #2444B5", +"Z% c #2444B4", +"`% c #2744B4", +" & c #2241B7", +".& c #1D41B8", +"+& c #0B42B8", +"@& c #0942B8", +"#& c #0C42B8", +"$& c #0F41B8", +"%& c #1641B8", +"&& c #2442B5", +"*& c #2543B3", +"=& c #2342B2", +"-& c #2341B4", +";& c #2141B3", +">& c #2141B5", +",& c #2140B5", +"'& c #2040B5", +")& c #1C40B7", +"!& c #1B41B3", +"~& c #0142B6", +"{& c #0E41B7", +"]& c #1141B7", +"^& c #1440B2", +"/& c #113FB0", +"(& c #1440B0", +"_& c #213EAF", +":& c #233DAE", +"<& c #223EAF", +"[& c #1E40B1", +"}& c #173EAD", +"|& c #1440AF", +"1& c #0D40AF", +"2& c #0941B0", +"3& c #0D3FAE", +"4& c #1B3CAC", +"5& c #233CAD", +"6& c #203FB0", +"7& c #273BAD", +"8& c #1D40B0", +"9& c #2040B1", +"0& c #1E40B0", +"a& c #1C40B0", +"b& c #1B3DAC", +"c& c #143DAC", +"d& c #193DAD", +"e& c #1B3DAD", +"f& c #173DAD", +"g& c #153DAC", +"h& c #1C3CAC", +"i& c #243CAD", +"j& c #213FB0", +"k& c #263BAA", +"l& c #253CAE", +"m& c #273AAC", +"n& c #273AAD", +"o& c #253BAD", +"p& c #1D3CAC", +"q& c #243BAD", +"r& c #1E3CAC", +"s& c #263BAD", +"t& c #1A3DAC", +"u& c #143DAB", +"v& c #163DAC", +"w& c #1A3CAC", +"x& c #1F3CAD", +"y& c #263BAB", +"z& c #263BA6", +"A& c #1E42A4", +"B& c #2D40A5", +"C& c #253BA6", +"D& c #253CA7", +"E& c #263AA5", +"F& c #253BA7", +"G& c #1E3BA6", +"H& c #193DA6", +"I& c #173DA5", +"J& c #143DA6", +"K& c #1A3DA7", +"L& c #133DA6", +"M& c #123DA5", +"N& c #1A3CA7", +"O& c #243BA6", +"P& c #263AA7", +"Q& c #273BA7", +"R& c #263AA6", +"S& c #223BA6", +"T& c #1D3BA6", +"U& c #173CA6", +"V& c #133DA5", +"W& c #1B3DA6", +"X& c #193DA5", +"Y& c #123DA4", +"Z& c #163CA5", +"`& c #213CA6", +" * c #273BA8", +".* c #263BA7", +"+* c #253BA5", +"@* c #263BA5", +"#* c #1C3BA6", +"$* c #1B3BA9", +"%* c #133BA8", +"&* c #0A3BA7", +"** c #083AA6", +"=* c #123CA5", +"-* c #0839A8", +";* c #0239A6", +">* c #123AA8", +",* c #1F49C8", +"'* c #2F4DA4", +")* c #2E4DA3", +"!* c #384CA4", +"~* c #3C4DA7", +"{* c #394EA7", +"]* c #3B4CA5", +"^* c #3C52B1", +"/* c #3551A8", +"(* c #3759BE", +"_* c #4161C7", +":* c #0033A8", +"<* c #596FA9", +"[* c #2F4DA3", +"}* c #2D4BA5", +"|* c #2E4CA4", +"1* c #2C4AA5", +"2* c #2D4BA4", +"3* c #354DA4", +"4* c #3A4BA4", +"5* c #394DA6", +"6* c #4056AD", +"7* c #445BBB", +"8* c #B5B7B4", +"9* c #1B2F85", +"0* c #242F79", +"a* c #B5B5B5", +"b* c #B5B2B6", +"c* c #C0C3C3", +"d* c #E3E3E4", +"e* c #EBEDEA", +". + @ + # $ % & # $ % & # $ % & # $ % & & * = - ; > , ' ) ! ~ { { { { { { { ] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ / / / ( / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / _ _ / / : / < [ } | | | 1 1 ", +"2 2 2 2 3 2 4 @ 3 2 4 @ 3 2 4 @ 3 2 4 @ # 5 6 7 8 ; > 9 0 a b c d e f { { { ] ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ( ( ( ( ( ( ( ( ( / / / / / / / / / / / / / / / / / _ _ _ _ _ _ _ _ _ _ _ g g _ / / : : : h i } 1 | 1 ", +"j k l m n o p q n o p q r s t u v w x y z A B C D E F G H I J K L M N O P O O Q R S T T T T T T T T T T T T T T T T T T U U U U U U U U U U U U U U U U U U U U U U U U U U U U V V V U U W X : [ Y | | ", +"Z ` . ...+.@.#...+.@.#.Z $.%.&.Z $.*.=.-.;.>.,.'.).!.~.{.].^./.(._.:.<.[.}.|.1.2.3.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.6.7.8.: h Y } 1 ", +"9.0.a.b.c.c.d.e.f.c.d.e.f.c.d.e.f.c.d.e.g.h.i.j.k.l.m.n.o.p.q.r.s.s.t.u.u.v.w.x.4.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.y.5.7.6.: / z.A.} ", +"-.B.C.D.-.E.g.F.G.E.g.F.G.E.g.F.G.E.g.F.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.V.U.U.W.X.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Z.y.Y.7.7.: : `.z.} ", +" +.+g.;.++F.@+#+++F.@+#+++F.@+#+++F.@+#+$+%+&+*+=+-+;+>+,+'+)+!+~+{+]+{+{+4.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.Y.Y.5.5.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Z.Z.Z.y.y.5.7.7.: : ^+z.Y ", +"/+(+_+#+H.H.>.:+H.H.>.:+H.H.>.:+H.H.>.<+[+}+*+|+1+2+3+4+5+6+7+{+{+4.4.4.4.4.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.Y.Y.Y.Y.Y.Y.Y.5.Y.Y.Y.Y.Y.Y.Y.Y.5.Y.Y.5.5.5.5.Y.Y.Y.Y.Y.Y.Z.Z.Z.Z.y.y.y.y.y.y.7.7.: : ^+i } ", +"8+9+0+0+a+0+0+b+a+0+0+b+a+0+0+b+a+0+0+c+d+e+f+g+h+i+j+k+l+m+n+o+4.4.4.4.5.5.5.5.5.5.Y.Y.5.5.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Y.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.7.7.: : p+z.Y ", +"q+r+r+s+t+u+v+w+t+u+v+w+t+u+v+w+t+u+x+&+y+z+A+B+C+D+E+5+F+G+~+4.4.4.4.5.5.5.5.5.H+Y.Y.Y.Y.Y.Y.Y.Y.I+Y.Z.Y.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.7.7.: : `.z.A.", +"J+v+K+L+M+N+O+P+Q+R+O+P+Q+R+O+P+Q+R+O+S+T+U+V+W+X+Y+P.T Z+`+ @4.4..@5.5.5.5.5.5.Y.Y.Y.I+I+I+I+I++@+@Z.Z.Y.Y.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.@@Z.7.7.: : p+z.Y ", +"#@$@$@%@%@$@#@&@#@#@#@&@#@#@#@&@#@#@#@*@=@-@;+i+;@>@,@'@)@ @4.X.5.5.H+Y.Y.Y.!@Y.Y.I++@+@Z.Z.+@Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.y.Z.6.6.: : `.z.A.", +"#@$@~@~@~@{@]@^@/@{@]@^@/@{@]@^@/@{@]@(@_@:@<@[@}@k+|@V 1@2@3@5.5.5.Y.Y.I+4@I+5@+@Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.y.Z.6.6.: : p+z.Y ", +"6@7@8@9@0@a@b@c@a@a@b@c@a@a@b@c@a@a@b@d@e@<@f@g@h@i@j@k@l@m@n@o@o@p@Y.I+q@q@r@+@Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.y.Z.6.6.: : `.z.A.", +"s@t@u@_@_@v@w@w@x@v@w@w@x@v@y@y@x@v@:@z@A@B@P C@D@E@F@G@H@I@J@K@5@+@+@+@r@I+L@Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.@@Z.W W : : p+z.Y ", +"M@N@O@P@C+Q@Q@R@C+;+Q@R@C+;+;+S@C+Q@Q@R@T@U@V@W@X@Y@Z@`@4. #.#+#Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.8.Z.Z.Z.Z.8.8.Z.Z.y.@@@@W W : : `.z.A.", +"@#O@O@##$#%#&#*#=#-#;#>#,#-#;#>#,#-#'#)#!#~#W@{#]#k@^#H@/#(#_#Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.Z.8.8.Z.Z.Z.Z.Z.Z.Z.8.8.8.8.8.8.8.8.8.8.8.Z.Z.y.y.@@W W : : p+z.Y ", +":#<#[#}#|#1#2#3#4#5#1#4#4#1#1#4#4#1#1#6#7#8#9#V 0#`+a#b#c#d#e#Z.Z.Z.f#Z.Z.Z.f#f#f#f#f#f#f#f#f#f#g#g#g#g#g#8.8.8.8.8.8.8.8.8.g#g#g#g#8.g#8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.y.y.@@W W : : `.z.A.", +"h#2#i#6#|#j#7#k#|#j#7#7#|#j#7#7#|#j#7#l#8#m#n#n#o#p#q#r#s#d#e#Z.Z.Z.f#f#f#f#Z.f#f#g#g#g#g#g#g#g#g#g#g#g#g#8.8.8.g#g#8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.y.y.y.y.8.8.8.y.y.@@W W : : p+z.Y ", +"l#7#7#l#7#7#7#W@7#7#7#W@7#7#k#W@t#7#7#W@u#v#n#w#x#y#z#A#B#Z.e#f#f#Z.f#f#f#Z.Z.g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#8.8.8.g#g#g#g#8.8.g#g#g#g#g#g#8.8.g#8.8.y.8.8.y.y.8.y.y.y.y.@@W W : : `.z.A.", +"C#D#E#F#G#H#I#J#G#H#I#J#G#H#I#J#G#H#I#J#K#L#M#N#O#P#s#Q#+#f#R#f#f#f#f#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#@@@@y.y.@@@@y.y.W W : : p+z.Y ", +"S#S#S#S#S#T#S#U#S#T#S#U#S#T#S#U#S#T#S#U#V#W#X#Y#Z#`# $.$+$@$#$g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#g#@@@@@@@@@@@@@@@@@@y.y.W W : : `.z.A.", +"+$Z..$$$%$+$&$*$%$+$&$*$%$+$&$*$%$+$&$*$=$-$;$>$,$'$)$!$~${$]$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$/$/$/$/$($($_$_$:$:$p+z.Y ", +"<$<$<$<$<$[$}$|$<$[$}$|$<$[$}$|$<$[$}$|$1$2$3$4$5$)$6$7$8$9$0$a$a$a$a$a$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$/$/$/$^$^$^$/$/$/$/$/$/$/$/$/$/$/$/$/$/$($($_$_$:$:$`.z.A.", +"b$c$c$c$d$e$e$f$g$|$|$1$d$e$e$1$d$e$e$1$h$i$j$k$l$m$n$o$p$9$q$a$a$a$a$a$a$a$a$^$a$a$^$^$^$^$^$^$a$r$r$r$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$^$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$($($_$_$:$:$p+z.Y ", +"e$1$s$s$1$t$u$v$w$x$y$z$A$x$u$v$g$B$C$>$D$E$F$G$H$I$J$K$L$M$N$a$a$a$a$a$a$a$a$^$r$r$a$^$^$^$a$r$r$r$r$r$/$^$r$^$^$^$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$O$($_$_$:$:$`.z.A.", +"P$Q$R$S$T$U$V$W$X$Y$Z$W$`$ %.%W$+%U$@%#%$%%%&%($*%=%-%;%>%>%,%r$r$r$r$r$a$a$a$/$/$/$r$r$r$r$r$r$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$O$($_$_$:$:$p+z.Y ", +"'%W$)%!%~%{%'%]%~%^%'%]%~%^%'%]%~%^%/%(%_%&%:%<%[%}%|%1%2%3%4%r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$/$r$/$/$r$r$r$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$/$r$/$/$/$/$/$O$($_$_$:$:$`.z.A.", +"5%6%'%'%6%7%8%9%6%7%8%9%6%7%8%9%6%7%8%0%&%a%<%b%[%c%d%e%f%g%h%r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$/$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$/$/$/$/$/$/$/$/$/$/$/$/$/$/$r$r$/$/$r$r$/$r$i%j%O$($_$_$:$:$p+z.Y ", +"k%l%m%n%o%o%p%q%o%o%r%q%o%o%r%q%o%o%p%q%s%t%/$u%v%w%x%y%z%A%B%r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$/$/$/$/$/$/$/$r$r$i%i%i%r$r$i%i%i%i%i%i%i%i%i%i%i%i%r$/$/$j%j%j%j%j%j%j%j%j%O$($_$_$:$:$`.z.A.", +"C%D%E%F%G%H%I%J%K%H%I%J%K%H%I%J%K%H%I%J%L%M%N%O%P%Q%R%S%T%A%B%r$r$r$r$r$r$r$r$r$r$r$r$r$r$r$U%U%r$r$i%i%/$/$r$r$/$/$/$/$r$r$i%i%i%i%i%i%i%i%i%i%i%i%i%i%j%i%j%j%j%j%j%j%j%j%j%j%j%j%j%O$($_$_$:$:$p+z.Y ", +"/$/$/$/$V%V%W%X%W%Y%Y%Z%W%W%Y%Z%W%W%W%`%`% &B%.&+&@&#&$&%&A%B%r$r$r$U%U%U%U%r$U%U%U%U%U%U%U%U%U%U%i%i%i%i%i%i%i%i%/$/$/$i%i%i%i%i%i%i%i%i%j%j%j%j%i%i%i%i%i%j%j%j%i%i%j%j%j%j%j%j%j%j%O$($_$_$:$:$`.z.A.", +"&&*&=&-&=&;&>&,&=&;&>&,&=&;&>&,&=&;&>&'&)&!&~&{&]&^&/&(&_&:&<&U%U%U%U%U%U%U%U%U%U%U%U%U%i%i%U%U%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%O$($_$_$:$:$p+z.Y ", +"U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%U%[&}&|&1&2&3&4&5&_&6&U%7&U%U%U%U%U%U%U%U%i%i%U%U%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%O$O$_$_$:$:$`.z.A.", +"U%U%U%U%U%U%[&8&U%9&[&0&U%9&[&0&U%9&[&a&:&b&c&d&e&f&g&h&i&<&j&U%U%U%U%U%U%U%U%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%O$O$_$_$:$:$p+z.Y ", +"k&l&m&7&7&n&o&p&7&n&q&r&s&s&q&r&s&n&o&p&t&u&u&g&v&w&x&q&n&m&y&7&7&U%U%7&z&7&z&U%A&B&i%i%B&B&i%i%B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&i%B&O$O$_$_$:$:$`.z.A.", +"C&D&E&z&z&E&F&G&z&E&F&G&z&E&F&G&z&E&F&G&H&I&J&K&L&M&N&O&P&Q&z&z&z&z&z&z&z&z&z&z&z&z&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&O$O$_$_$:$:$p+z.Y ", +"z&z&z&z&R&S&T&U&R&S&T&U&R&S&T&U&R&S&T&U&V&V&W&X&Y&Z&`&C&R&z&z&z&z&z&z&z&z&z&z&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&O$O$_$_$:$:$^+z.A.", +"z& *.*+*@*#*$*%*@*#*$*%*@*#*$*%*@*#*$*%*&***=*-*;*>*k&P&+*z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&z&B&B&B&B&z&z&z&B&B&B&z&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&B&/$O$O$@@_$,*:$/ ^+z.Y ", +"'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*'*)*'*!*~*{*]*^*^*^*/*/*/*/*/*/*/*^*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*^*/*/*/*/*/*h h ^*h h ^*^*h h ^*^*^*^*h ^*^*^*^*h ^*^*^*(*_*_*_*_*_$:*:$<*`.z.} ", +"'*'*'*'*'*[*}*|*'*[*}*|*'*[*}*|*'*[*}*|*1*1*2*}*}*2*[*)*3*4*5*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*h h h h h h h h h h h h h h h h 6*7*_*_*_*_*^*:*:$: 8*z.Y } ", +"9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*9*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*0*( <*8*^+z.Y } 1 ", +"a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*a*8*b*8*b*8*b*8*b*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*b*8*8*8*8*b*8*`.z.A.Y | | ", +"c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*c*p+`.p+`.p+`.p+`.`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+`.p+^+`.^+^+z.z.Y Y | | 1 ", +"d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*d*A.Y A.Y A.Y A.Y Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y A.Y } } | | | | 1 1 ", +"e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*} | } | } | } | | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | } | | | | 1 | | | 1 1 1 "}; + + +static char * tabmiddle_xpm[] = { +"33 42 32 1", +" c None", +". c #CECFEF", +"+ c #CECBE7", +"@ c #C6C7E7", +"# c #C6CBE7", +"$ c #BDBEDE", +"% c #BDC3DE", +"& c #CECBEF", +"* c #B5B6D6", +"= c #ADAECE", +"- c #ADB2CE", +"; c #BDBAD6", +"> c #B5BAD6", +", c #C6C3DE", +"' c #ADAAC6", +") c #B5B2CE", +"! c #B5B6CE", +"~ c #A5A2BD", +"{ c #A5A6BD", +"] c #9C9EB5", +"^ c #9CA2BD", +"/ c #ADAEC6", +"( c #C6C3E7", +"_ c #9C9AB5", +": c #A5A6C6", +"< c #949AAD", +"[ c #A5AAC6", +"} c #9496AD", +"| c #BDBADE", +"1 c #BDBED6", +"2 c #9CA2B5", +"3 c #A5AABD", +"..........................+@.#.#.", +"........................$@%&#.#..", +"......................**$$@@&#.#.", +".....................=-;>,%+@.#..", +"....................'')!$$@@&#.#.", +"...................~{=)$$@@&#.#..", +"..................]^'/;;(%&#.#...", +"................._]:/*>,%&@.#.#..", +".................<{[)!$%+@.#.#...", +"................}~{=!$%@@.#......", +"................]^/-|$@@.#.......", +"................]'/*;@@&#........", +"...............<~[)>,%&#.#.......", +"...............]~=)$%+#.#........", +"...............]'/;1@@.#.........", +"...............~{)*,%&#..........", +"...............2/-$$@#...........", +"...............~[*>(@&#..........", +"...............^=)$%+#...........", +"...............{'*>(@.#..........", +"...............^=)$%+#...........", +"...............{'*>(@.#..........", +"...............^=)$%+#...........", +"...............{'*>(@.#..........", +"...............^=)$%+#...........", +"...............{'*>(@.#..........", +"...............^=)$%+#...........", +"...............{'*>@@.#..........", +"...............^=!$%&#...........", +"...............{/*;@@.#..........", +"...............{)!$%&#...........", +"..............]'/;1@@.#..........", +"..............23)>,%&#...........", +"..............~=-$$@@.#..........", +".............]{/*;@@.#...........", +"............<^[)>,%&#............", +"............]{/!$%@@.#...........", +"..........]^[-!$%@@.#............", +".........]^3/!>$@@.#.............", +".......<]^3/!>$@@&#..............", +".....<]2{[/!>$%@&#.#.............", +"}<<_]2{3/-!>$%@&#.#.............."}; + + +static char * tabselectedbeginn_xpm[] = { +"33 39 28 1", +" c None", +". c #CECFEF", +"+ c #EFF3EF", +"@ c #FFFBFF", +"# c #F7FBF7", +"$ c #FFFFFF", +"% c #EFEFEF", +"& c #F7F7F7", +"* c #DEDFDE", +"= c #E7E7E7", +"- c #D6D3D6", +"; c #DEE3DE", +"> c #EFEBEF", +", c #F7F3F7", +"' c #CECBCE", +") c #CECFCE", +"! c #D6D7D6", +"~ c #DEDBDE", +"{ c #E7EBE7", +"] c #C6C7C6", +"^ c #E7E3E7", +"/ c #BDC3BD", +"( c #CED3CE", +"_ c #BDBABD", +": c #C6C3C6", +"< c #C6CBC6", +"[ c #D6DBD6", +"} c #BDBEBD", +"..........................+@#$#$$", +"........................%%&&@#$#$", +"......................*==%%&&@#$$", +"....................--*;>%,&@#$#$", +"...................')!~={,+@#$#$$", +"...................]-!^=%%&&@#$#$", +"................../'(~;>%&&@#$#$$", +"................._])!*={,&@#$#$$$", +"................_])~*>%&&$#$$$$$$", +"................:%&&$#$$$$$$$$", +".............../)!^{,&@#$$$$$$$$$", +"...............](*^%+@#$$$$$$$$$$", +"...............]!~=%&&$$$$$$$$$$$", +"...............'(*=,+@#$$$$$$$$$$", +"...............%&&$$$$$$$$$$$", +"...............'-^=,+@#$$$$$$$$$$", +"...............%&#$$$$$$$$$$$", +"...............'-^=,+@#$$$$$$$$$$", +"...............%&#$$$$$$$$$$$", +"...............'-^=,+@#$$$$$$$$$$", +"...............%&#$$$$$$$$$$$", +"...............'-^=,+@#$$$$$$$$$$", +"...............%&#$$$$$$$$$$$", +"...............'!^=,&@#$$$$$$$$$$", +"...............<~*>%&#$$$$$$$$$$$", +"...............)!^{,&@#$$$$$$$$$$", +"..............])~;%+@#$$$$$$$$$$$", +"..............]-[={&&$#$$$$$$$$$$", +".............])!^=,&@#$$$$$$$$$$$", +"............:'-*^%+@#$$$$$$$$$$$$", +"............])~*>%&&$#$$$$$$$$$$$", +"...........:'!*={,&@#$$$$$$$$$$$$", +"..........:'-~^=,+@#$$$$$$$$$$$$$", +".......}]'-~^=%,&@#$$$$$$$$$$$$$$", +".....}:])-~^=%,+@#$#$$$$$$$$$$$$$", +"}}}:]')-!*^=%,&@#$#$$$$$$$$$$$$$$"}; + + +static char * tabselectedend_xpm[] = { +"33 42 33 1", +" c None", +". c #FFFFFF", +"+ c #CECBE7", +"@ c #C6C7E7", +"# c #CECFEF", +"$ c #C6CBE7", +"% c #BDBEDE", +"& c #BDC3DE", +"* c #CECBEF", +"= c #B5B6D6", +"- c #ADAECE", +"; c #ADB2CE", +"> c #BDBAD6", +", c #B5BAD6", +"' c #C6C3DE", +") c #ADAAC6", +"! c #B5B2CE", +"~ c #B5B6CE", +"{ c #A5A2BD", +"] c #A5A6BD", +"^ c #9C9EB5", +"/ c #9CA2BD", +"( c #ADAEC6", +"_ c #C6C3E7", +": c #9C9AB5", +"< c #A5A6C6", +"[ c #949AAD", +"} c #A5AAC6", +"| c #9496AD", +"1 c #BDBADE", +"2 c #BDBED6", +"3 c #9CA2B5", +"4 c #A5AABD", +"..........................+@#$#$#", +"........................%@&*$#$##", +"......................==%%@@*$#$#", +".....................-;>,'&+@#$##", +"....................))!~%%@@*$#$#", +"...................{]-!%%@@*$#$##", +"..................^/)(>>_&*$#$###", +".................:^<(=,'&*@#$#$##", +".................[]}!~%&+@#$#$###", +"................|{]-~%&@@#$######", +"................^/(;1%@@#$#######", +"................^)(=>@@*$########", +"...............[{}!,'&*$#$#######", +"...............^{-!%&+$#$########", +"...............^)(>2@@#$#########", +"...............{]!='&*$##########", +"...............3(;%%@$###########", +"...............{}=,_@*$##########", +".............../-!%&+$###########", +"...............])=,_@#$##########", +".............../-!%&+$###########", +"...............])=,_@#$##########", +".............../-!%&+$###########", +"...............])=,_@#$##########", +".............../-!%&+$###########", +"...............])=,_@#$##########", +".............../-!%&+$###########", +"...............])=,@@#$##########", +".............../-~%&*$###########", +"...............](=>@@#$##########", +"...............]!~%&*$###########", +"..............^)(>2@@#$##########", +"..............34!,'&*$###########", +"..............{-;%%@@#$##########", +".............^](=>@@#$###########", +"............[/}!,'&*$############", +"............^](~%&@@#$###########", +"..........^/};~%&@@#$############", +".........^/4(~,%@@#$#############", +".......[^/4(~,%@@*$##############", +".....[^3]}(~,%&@*$#$#############", +"|[[:^3]4(;~,%&@*$#$##############"}; + + +static char * tabend_xpm[] = { +"33 42 3 1", +" c None", +". c #CECFEF", +"+ c #FFFFFF", +"..........................+++++++", +"........................+++++++++", +"......................+++++++++++", +".....................++++++++++++", +"....................+++++++++++++", +"...................++++++++++++++", +"..................+++++++++++++++", +".................++++++++++++++++", +".................++++++++++++++++", +"................+++++++++++++++++", +"................+++++++++++++++++", +"................+++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"...............++++++++++++++++++", +"..............+++++++++++++++++++", +"..............+++++++++++++++++++", +"..............+++++++++++++++++++", +".............++++++++++++++++++++", +"............+++++++++++++++++++++", +"............+++++++++++++++++++++", +"..........+++++++++++++++++++++++", +".........++++++++++++++++++++++++", +".......++++++++++++++++++++++++++", +".....++++++++++++++++++++++++++++", +"+++++++++++++++++++++++++++++++++"}; + + + + +QColor fromHsl(QColor c) +{ + const qreal h = c.hueF(); + const qreal s = c.saturationF(); + const qreal l = c.valueF(); + + qreal ca[3] = {0, 0, 0}; + + if (s == 0 || h == 1) { + // achromatic case + ca[0] = ca[1] = ca[2] = l; + } else { + // chromatic case + qreal temp2; + if (l < qreal(0.5)) + temp2 = l * (qreal(1.0) + s); + else + temp2 = l + s - (l * s); + + const qreal temp1 = (qreal(2.0) * l) - temp2; + qreal temp3[3] = { h + (qreal(1.0) / qreal(3.0)), + h, + h - (qreal(1.0) / qreal(3.0)) }; + + for (int i = 0; i != 3; ++i) { + if (temp3[i] < qreal(0.0)) + temp3[i] += qreal(1.0); + else if (temp3[i] > qreal(1.0)) + temp3[i] -= qreal(1.0); + + const qreal sixtemp3 = temp3[i] * qreal(6.0); + + if (sixtemp3 < qreal(1.0)) + ca[i] = ((temp1 + (temp2 - temp1) * sixtemp3)); + else if ((temp3[i] * qreal(2.0)) < qreal(1.0)) + ca[i] = (temp2); + else if ((temp3[i] * qreal(3.0)) < qreal(2.0)) + ca[i] = temp1 + (temp2 -temp1) * (qreal(2.0) /qreal(3.0) - temp3[i]) * qreal(6.0); + else ca[i] = temp1; + } + } + + return QColor::fromRgbF(ca[0], ca[1], ca[2]); +} + +#define Q_MAX_3(a, b, c) ( ( a > b && a > c) ? a : (b > c ? b : c) ) +#define Q_MIN_3(a, b, c) ( ( a < b && a < c) ? a : (b < c ? b : c) ) + +QColor toHsl(QColor c) +{ + QColor color; + qreal h; + qreal s; + qreal l; + + const qreal r = c.redF(); + const qreal g = c.greenF(); + const qreal b = c.blueF(); + const qreal max = Q_MAX_3(r, g, b); + const qreal min = Q_MIN_3(r, g, b); + const qreal delta = max - min; + const qreal delta2 = max + min; + const qreal lightness = qreal(0.5) * delta2; + l = (lightness); + if (qFuzzyIsNull(delta)) { + // achromatic case, hue is undefined + h = 0; + s = 0; + } else { + // chromatic case + qreal hue = 0; + if (lightness < qreal(0.5)) + s = ((delta / delta2)); + else + s = ((delta / (qreal(2.0) - delta2))); + if (qFuzzyCompare(r, max)) { + hue = ((g - b) /delta); + } else if (qFuzzyCompare(g, max)) { + hue = (2.0 + (b - r) / delta); + } else if (qFuzzyCompare(b, max)) { + hue = (4.0 + (r - g) / delta); + } else { + Q_ASSERT_X(false, "QColor::toHsv", "internal error"); + } + hue *= 60.0; + if (hue < 0.0) + hue += 360.0; + h = (hue * 100); + } + + h = h / 36000; + + return QColor::fromHsvF(h, s, l); +} + +void contrastImage(QImage *image) +{ + QVector colorTable = image->colorTable(); + for (int i=2;i< colorTable.size();i++) { + QColor c(colorTable.at(i)); + c.toHsv(); + if (c.value() < 150) + c = Qt::black; + else + c = Qt::white; + colorTable[i] = c.rgb(); + } + image->setColorTable(colorTable); +} + +void tintColor(QColor &color, QColor tintColor, qreal _saturation) +{ + tintColor = toHsl(tintColor); + color = toHsl(color); + qreal hue = tintColor.hueF(); + + qreal saturation = color.saturationF(); + if (_saturation) + saturation = _saturation; + qreal lightness = color.valueF(); + color.setHsvF(hue, saturation, lightness); + + color = fromHsl(color); + color.toRgb(); +} + +void tintImagePal(QImage *image, QColor color, qreal saturation) +{ + QVector colorTable = image->colorTable(); + for (int i=2;i< colorTable.size();i++) { + QColor c(toHsl(colorTable.at(i))); + tintColor(c, color, saturation); + colorTable[i] = c.rgb(); + } + image->setColorTable(colorTable); +} + + +void tintImage(QImage *image, QColor color, qreal saturation) +{ + *image = image->convertToFormat(QImage::Format_RGB32); + + for (int x = 0; x < image->width(); x++) + for (int y = 0; y < image->height(); y++) { + QColor c(image->pixel(x,y)); + tintColor(c, color, saturation); + image->setPixel(x, y, c.rgb()); + } +} + +#endif //Q_WS_WINCE_WM enum QSliderDirection { SliderUp, SliderDown, SliderLeft, SliderRight }; +void QWindowsMobileStylePrivate::tintImagesButton(QColor color) +{ + if (currentTintButton == color) + return; + + imageTabEnd = QImage(tabend_xpm); + imageTabSelectedEnd = QImage(tabselectedend_xpm); + imageTabSelectedBegin = QImage(tabselectedbeginn_xpm); + imageTabMiddle = QImage(tabmiddle_xpm); + tintImage(&imageTabEnd, color, 0.0); + tintImage(&imageTabSelectedEnd, color, 0.0); + tintImage(&imageTabSelectedBegin, color, 0.0); + tintImage(&imageTabMiddle, color, 0.0); + + if (!doubleControls) { + int height = imageTabMiddle.height() / 2 + 1; + imageTabEnd = imageTabEnd.scaledToHeight(height); + imageTabMiddle = imageTabMiddle.scaledToHeight(height); + imageTabSelectedEnd = imageTabSelectedEnd.scaledToHeight(height); + imageTabSelectedBegin = imageTabSelectedBegin.scaledToHeight(height); + } +} + +void QWindowsMobileStylePrivate::tintImagesHigh(QColor color) +{ + if (currentTintHigh == color) + return; + currentTintHigh = color; + tintListViewHighlight(color); + imageScrollbarHandleUpHigh = imageScrollbarHandleUp; + imageScrollbarHandleDownHigh = imageScrollbarHandleDown; + tintImagePal(&imageScrollbarHandleDownHigh, color, qreal(0.8)); + tintImagePal(&imageScrollbarHandleUpHigh, color, qreal(0.8)); +} + +void QWindowsMobileStylePrivate::tintListViewHighlight(QColor color) +{ + imageListViewHighlightCornerRight = QImage(listviewhighcornerright_xpm); + tintImage(&imageListViewHighlightCornerRight, color, qreal(0.0)); + + imageListViewHighlightCornerLeft = QImage(listviewhighcornerleft_xpm); + tintImage(&imageListViewHighlightCornerLeft, color, qreal(0.0)); + + imageListViewHighlightMiddle = QImage(listviewhighmiddle_xpm); + tintImage(&imageListViewHighlightMiddle, color, qreal(0.0)); + + int height = imageListViewHighlightMiddle.height(); + if (!doubleControls) { + height = height / 2; + imageListViewHighlightCornerRight = imageListViewHighlightCornerRight.scaledToHeight(height); + imageListViewHighlightCornerLeft = imageListViewHighlightCornerLeft.scaledToHeight(height); + imageListViewHighlightMiddle = imageListViewHighlightMiddle.scaledToHeight(height); + } +} + +void QWindowsMobileStylePrivate::setupWindowsMobileStyle65() +{ +#ifdef Q_WS_WINCE_WM + wm65 = true; + if (wm65) { + imageScrollbarHandleUp = QImage(sbhandleup_xpm); + imageScrollbarHandleDown = QImage(sbhandledown_xpm); + imageScrollbarGripUp = QImage(sbgripup_xpm); + imageScrollbarGripDown = QImage(sbgripdown_xpm); + imageScrollbarGripMiddle = QImage(sbgripmiddle_xpm); + + if (!doubleControls) { + imageScrollbarHandleUp = imageScrollbarHandleUp.scaledToHeight(imageScrollbarHandleUp.height() / 2); + imageScrollbarHandleDown = imageScrollbarHandleDown.scaledToHeight(imageScrollbarHandleDown.height() / 2); + imageScrollbarGripMiddle = imageScrollbarGripMiddle.scaledToHeight(imageScrollbarGripMiddle.height() / 2); + imageScrollbarGripUp = imageScrollbarGripUp.scaledToHeight(imageScrollbarGripUp.height() / 2); + imageScrollbarGripDown = imageScrollbarGripDown.scaledToHeight(imageScrollbarGripDown.height() / 2); + } else { + } + tintImagesHigh(Qt::blue); + } +#endif //Q_WS_WINCE_WM +} + +void QWindowsMobileStylePrivate::drawTabBarTab(QPainter *painter, const QStyleOptionTab *tab) +{ +#ifdef Q_WS_WINCE_WM + if (wm65) { + tintImagesButton(tab->palette.button().color()); + QRect r; + r.setTopLeft(tab->rect.topRight() - QPoint(imageTabMiddle.width(), 0)); + r.setBottomRight(tab->rect.bottomRight()); + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect, tab->palette.window()); + } else { + painter->fillRect(tab->rect, QColor(imageTabMiddle.pixel(0,0))); + } + if (tab->selectedPosition == QStyleOptionTab::NextIsSelected) { + painter->drawImage(r, imageTabSelectedBegin); + } else if (tab->position == QStyleOptionTab::End || + tab->position == QStyleOptionTab::OnlyOneTab) { + if (!(tab->state & QStyle::State_Selected)) { + painter->drawImage(r, imageTabEnd); + } + } else if (tab->state & QStyle::State_Selected) { + painter->drawImage(r, imageTabSelectedEnd); + } else { + painter->drawImage(r, imageTabMiddle); + } + if (tab->position == QStyleOptionTab::Beginning && ! (tab->state & QStyle::State_Selected)) { + painter->drawImage(tab->rect.topLeft() - QPoint(imageTabMiddle.width() * 0.60, 0), imageTabSelectedEnd); + } + //imageTabBarBig + return; + } +#endif //Q_WS_WINCE_WM + painter->save(); + painter->setPen(tab->palette.shadow().color()); + if (doubleControls) { + QPen pen = painter->pen(); + pen.setWidth(2); + pen.setCapStyle(Qt::FlatCap); + painter->setPen(pen); + } + if(tab->shape == QTabBar::RoundedNorth) { + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect, tab->palette.light()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + } + else { + painter->fillRect(tab->rect, tab->palette.button()); + painter->drawLine(tab->rect.bottomLeft() , tab->rect.bottomRight()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + } + } + else if(tab->shape == QTabBar::RoundedSouth) { + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect.adjusted(0,-2,0,0), tab->palette.light()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + } + else { + painter->fillRect(tab->rect, tab->palette.button()); + if (doubleControls) + painter->drawLine(tab->rect.topLeft() + QPoint(0,1), tab->rect.topRight() + QPoint(0,1)); + else + painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + } + } + else if(tab->shape == QTabBar::RoundedEast) { + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect, tab->palette.light()); + painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); + } + else { + painter->fillRect(tab->rect, tab->palette.button()); + painter->drawLine(tab->rect.topLeft(), tab->rect.bottomLeft()); + painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); + } + } + else if(tab->shape == QTabBar::RoundedWest) { + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect, tab->palette.light()); + painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); + } + else { + painter->fillRect(tab->rect, tab->palette.button()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); + } + } + painter->restore(); +} + +void QWindowsMobileStylePrivate::drawPanelItemViewSelected(QPainter *painter, const QStyleOptionViewItemV4 *option, QRect rect) +{ +#ifdef Q_WS_WINCE_WM + if (wm65) { + QRect r; + if (rect.isValid()) + r = rect; + else + r = option->rect; + tintImagesHigh(option->palette.highlight().color()); + + painter->setPen(QColor(Qt::lightGray)); + + if (option->viewItemPosition == QStyleOptionViewItemV4::Middle) { + painter->drawImage(r, imageListViewHighlightMiddle); + } else if (option->viewItemPosition == QStyleOptionViewItemV4::Beginning) { + painter->drawImage(r.adjusted(10, 0, 0, 0), imageListViewHighlightMiddle); + } else if (option->viewItemPosition == QStyleOptionViewItemV4::End) { + painter->drawImage(r.adjusted(0, 0, -10, 0), imageListViewHighlightMiddle); + } else { + painter->drawImage(r.adjusted(10, 0, -10, 0), imageListViewHighlightMiddle); + } + + QImage cornerLeft = imageListViewHighlightCornerLeft; + QImage cornerRight = imageListViewHighlightCornerRight; + + int width = r.width() > cornerRight.width() ? r.width() : cornerRight.width(); + + if ((width * 2) > r.width()) { + width = (r.width() - 5) / 2; + } + + cornerLeft = cornerLeft.scaled(width, r.height()); + cornerRight = cornerRight.scaled(width, r.height()); + + if ((option->viewItemPosition == QStyleOptionViewItemV4::Beginning) || (option->viewItemPosition == QStyleOptionViewItemV4::OnlyOne) || !option->viewItemPosition) { + painter->drawImage(r.topLeft(), cornerLeft); + } + if ((option->viewItemPosition == QStyleOptionViewItemV4::End) || (option->viewItemPosition == QStyleOptionViewItemV4::OnlyOne) || !option->viewItemPosition) { + painter->drawImage(r.topRight() - QPoint(cornerRight.width(),0), cornerRight); + } + return; + } +#endif //Q_WS_WINCE_WM + QPalette::ColorGroup cg = option->state & QStyle::State_Enabled + ? QPalette::Normal : QPalette::Disabled; + + if (rect.isValid()) + painter->fillRect(rect, option->palette.brush(cg, QPalette::Highlight)); + else + painter->fillRect(option->rect, option->palette.brush(cg, QPalette::Highlight)); +} + +void QWindowsMobileStylePrivate::drawScrollbarGrip(QPainter *p, QStyleOptionSlider *newScrollbar, const QStyleOptionComplex *option, bool drawCompleteFrame) +{ +#ifdef Q_WS_WINCE_WM + if (wm65) { + if (newScrollbar->orientation == Qt::Horizontal) { + QTransform transform; + transform.rotate(-90); + QRect r = newScrollbar->rect; + p->drawImage(r.adjusted(10, 0, -10, 0), imageScrollbarGripMiddle.transformed(transform)); + p->drawImage(r.topLeft(), imageScrollbarGripUp.transformed(transform)); + p->drawImage(r.topRight() - QPoint(imageScrollbarGripDown.height() - 1, 0), imageScrollbarGripDown.transformed(transform)); + } else { + QRect r = newScrollbar->rect; + p->drawImage(r.adjusted(0, 10, 0, -10), imageScrollbarGripMiddle); + p->drawImage(r.topLeft(), imageScrollbarGripUp); + p->drawImage(r.bottomLeft() - QPoint(0, imageScrollbarGripDown.height() - 1), imageScrollbarGripDown); + } + return ; + } +#endif + if (newScrollbar->orientation == Qt::Horizontal) { + p->fillRect(newScrollbar->rect,option->palette.button()); + QRect r = newScrollbar->rect; + p->drawLine(r.topLeft(), r.bottomLeft()); + p->drawLine(r.topRight(), r.bottomRight()); + if (smartphone) { + p->drawLine(r.topLeft(), r.topRight()); + p->drawLine(r.bottomLeft(), r.bottomRight()); + } + } + else { + p->fillRect(newScrollbar->rect,option->palette.button()); + QRect r = newScrollbar->rect; + p->drawLine(r.topLeft(), r.topRight()); + p->drawLine(r.bottomLeft(), r.bottomRight()); + if (smartphone) { + p->drawLine(r.topLeft(), r.bottomLeft()); + p->drawLine(r.topRight(), r.bottomRight()); + } + } + if (newScrollbar->state & QStyle::State_HasFocus) { + QStyleOptionFocusRect fropt; + fropt.QStyleOption::operator=(*newScrollbar); + fropt.rect.setRect(newScrollbar->rect.x() + 2, newScrollbar->rect.y() + 2, + newScrollbar->rect.width() - 5, + newScrollbar->rect.height() - 5); + } + int gripMargin = doubleControls ? 4 : 2; + int doubleLines = doubleControls ? 2 : 1; + //If there is a frame around the scrollbar (abstractScrollArea), + //then the margin is different, because of the missing frame + int gripMarginFrame = doubleControls ? 3 : 1; + if (drawCompleteFrame) + gripMarginFrame = 0; + //draw grips + if (!smartphone) + if (newScrollbar->orientation == Qt::Horizontal) { + for (int i = -3; i < 3; i += 2) { + p->drawLine( + QPoint(newScrollbar->rect.center().x() + i * doubleLines + 1, + newScrollbar->rect.top() + gripMargin +gripMarginFrame), + QPoint(newScrollbar->rect.center().x() + i * doubleLines + 1, + newScrollbar->rect.bottom() - gripMargin)); + } + } else { + for (int i = -2; i < 4 ; i += 2) { + p->drawLine( + QPoint(newScrollbar->rect.left() + gripMargin + gripMarginFrame , + newScrollbar->rect.center().y() + 1 + i * doubleLines - 1), + QPoint(newScrollbar->rect.right() - gripMargin, + newScrollbar->rect.center().y() + 1 + i * doubleLines - 1)); + } + } + if (!smartphone) { + QRect r; + if (doubleControls) + r = option->rect.adjusted(1, 1, -1, 0); + else + r = option->rect.adjusted(0, 0, -1, 0); + if (drawCompleteFrame && doubleControls) + r.adjust(0, 0, 0, -1); + //Check if the scrollbar is part of an abstractItemView and draw the frame according + if (drawCompleteFrame) + p->drawRect(r); + else + if (newScrollbar->orientation == Qt::Horizontal) + p->drawLine(r.topLeft(), r.topRight()); + else + p->drawLine(r.topLeft(), r.bottomLeft()); + } +} + +void QWindowsMobileStylePrivate::drawScrollbarHandleUp(QPainter *p, QStyleOptionSlider *opt, bool completeFrame, bool ) +{ +#ifdef Q_WS_WINCE_WM + if (wm65) { + tintImagesHigh(opt->palette.highlight().color()); + QRect r = opt->rect; + if (opt->orientation == Qt::Horizontal) { + QTransform transform; + transform.rotate(-90); + if (opt->state & QStyle::State_Sunken) + p->drawImage(r.topLeft(), imageScrollbarHandleUpHigh.transformed(transform)); + else + p->drawImage(r.topLeft(), imageScrollbarHandleUp.transformed(transform)); + } else { + if (opt->state & QStyle::State_Sunken) + p->drawImage(r.topLeft(), imageScrollbarHandleUpHigh); + else + p->drawImage(r.topLeft(), imageScrollbarHandleUp); + } + return ; + } +#endif .//Q_WS_WINCE_WM + + QBrush fill = opt->palette.button(); + if (opt->state & QStyle::State_Sunken) + fill = opt->palette.shadow(); + + QStyleOption arrowOpt = *opt; + if (doubleControls) + arrowOpt.rect = opt->rect.adjusted(4, 6, -5, -3); + else + arrowOpt.rect = opt->rect.adjusted(5, 6, -4, -3); + + bool horizontal = (opt->orientation == Qt::Horizontal); + + if (horizontal) { + p->fillRect(opt->rect,fill); + QRect r = opt->rect.adjusted(0,0,1,0); + p->drawLine(r.topRight(), r.bottomRight()); + if (doubleControls) + arrowOpt.rect.adjust(0, -2 ,0, -2); + q_func()->drawPrimitive(QStyle::PE_IndicatorArrowLeft, &arrowOpt, p, 0); + } else { + p->fillRect(opt->rect,fill); + QRect r = opt->rect.adjusted(0, 0, 0, 1); + p->drawLine(r.bottomLeft(), r.bottomRight()); + if (completeFrame) + arrowOpt.rect.adjust(-2, 0, -2, 0); + if (doubleControls) + arrowOpt.rect.adjust(0, -4 , 0, -4); + if (completeFrame && doubleControls) + arrowOpt.rect.adjust(2, 0, 2, 0); + q_func()->drawPrimitive(QStyle::PE_IndicatorArrowUp, &arrowOpt, p, 0); + } +} + +void QWindowsMobileStylePrivate::drawScrollbarHandleDown(QPainter *p, QStyleOptionSlider *opt, bool completeFrame, bool secondScrollBar) +{ + +#ifdef Q_WS_WINCE_WM + if (wm65) { + tintImagesHigh(opt->palette.highlight().color()); + QRect r = opt->rect; + if (opt->orientation == Qt::Horizontal) { + QTransform transform; + transform.rotate(-90); + if (opt->state & QStyle::State_Sunken) + p->drawImage(r.topLeft(), imageScrollbarHandleDownHigh.transformed(transform)); + else + p->drawImage(r.topLeft(), imageScrollbarHandleDown.transformed(transform)); + } else { + if (opt->state & QStyle::State_Sunken) + p->drawImage(r.topLeft(), imageScrollbarHandleDownHigh); + else + p->drawImage(r.topLeft(), imageScrollbarHandleDown); + } + return ; + } +#endif .//Q_WS_WINCE_WM + + QBrush fill = opt->palette.button(); + if (opt->state & QStyle::State_Sunken) + fill = opt->palette.shadow(); + + QStyleOption arrowOpt = *opt; + if (doubleControls) + arrowOpt.rect = opt->rect.adjusted(4, 0, -5, 3); + else + arrowOpt.rect = opt->rect.adjusted(5, 6, -4, -3); + + bool horizontal = (opt->orientation == Qt::Horizontal); + + if (horizontal) { + p->fillRect(opt->rect,fill); + QRect r = opt->rect.adjusted(0, 0, 0, 0); + p->drawLine(r.topLeft(), r.bottomLeft()); + if (secondScrollBar) + p->drawLine(r.topRight(), r.bottomRight()); + if (doubleControls) + arrowOpt.rect.adjust(0, 4, 0, 4 ); + q_func()->drawPrimitive(QStyle::PE_IndicatorArrowRight, &arrowOpt, p, 0); + } else { + p->fillRect(opt->rect,fill); + QRect r = opt->rect.adjusted(0, -1, 0, -1); + p->drawLine(r.topLeft(), r.topRight()); + if (secondScrollBar) + p->drawLine(r.bottomLeft() + QPoint(0,1), r.bottomRight() + QPoint(0, 1)); + if (completeFrame) + arrowOpt.rect.adjust(-2, 0, -2, 0); + if (doubleControls) + arrowOpt.rect.adjust(1, 0, 1, 0 ); + if (completeFrame && doubleControls) + arrowOpt.rect.adjust(1, 0, 1, 0); + q_func()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &arrowOpt, p, 0); + } +} + +void QWindowsMobileStylePrivate::drawScrollbarGroove(QPainter *p,const QStyleOptionSlider *opt) +{ +#ifdef Q_OS_WINCE_WM + if (wm65) { + p->fillRect(opt->rect,QColor(231, 231, 231)); + return ; + } +#endif + QBrush fill; + if (smartphone) { + fill = opt->palette.light(); + p->fillRect(opt->rect,fill); + fill = opt->palette.button(); + QImage image; +#ifndef QT_NO_IMAGEFORMAT_XPM + if (opt->orientation == Qt::Horizontal) + image = QImage(vertlines_xpm); + else + image = QImage(horlines_xpm); +#endif + image.setColor(1, opt->palette.button().color().rgb()); + fill.setTextureImage(image); + } + else { + fill = opt->palette.light(); + } + p->fillRect(opt->rect,fill); +} + QWindowsMobileStyle::QWindowsMobileStyle(QWindowsMobileStylePrivate &dd) : QWindowsStyle(dd) { qApp->setEffectEnabled(Qt::UI_FadeMenu, false); qApp->setEffectEnabled(Qt::UI_AnimateMenu, false); @@ -721,6 +4563,9 @@ QWindowsMobileStylePrivate::QWindowsMobileStylePrivate() :QWindowsStylePrivate() imageNormalize = QImage(normal_small_xpm); } + setupWindowsMobileStyle65(); + + imageArrowDownBig = QImage(arrowdown_big_xpm); imageArrowUpBig = QImage(arrowdown_big_xpm).mirrored(); imageArrowLeftBig = QImage(arrowleft_big_xpm); @@ -1373,21 +5218,37 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp } switch (tab->shape) { case QTabBar::RoundedNorth: +#ifdef Q_WS_WINCE_WM + if (!d->wm65) +#endif + { if (d->doubleControls) - painter->drawLine(rect.topLeft() + QPoint(0, 1), rect.topRight() + QPoint(0, 1)); + painter->drawLine(rect.topLeft() + QPoint(0, 1), rect.topRight() + QPoint(0, 1)); else painter->drawLine(rect.topLeft(), rect.topRight()); + } break; case QTabBar::RoundedSouth: +#ifdef Q_WS_WINCE_WM + if (!d->wm65) +#endif + { if (d->doubleControls) painter->drawLine(rect.bottomLeft(), rect.bottomRight()); else painter->drawLine(rect.bottomLeft(), rect.bottomRight()); + } break; case QTabBar::RoundedEast: +#ifdef Q_WS_WINCE_WM + if (!d->wm65) +#endif painter->drawLine(rect.topRight(), rect.bottomRight()); break; case QTabBar::RoundedWest: +#ifdef Q_WS_WINCE_WM + if (!d->wm65) +#endif painter->drawLine(rect.topLeft(), rect.bottomLeft()); break; case QTabBar::TriangularWest: @@ -1406,6 +5267,47 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp } break; #endif //QT_NO_TABBAR +#ifndef QT_NO_ITEMVIEWS + case PE_PanelItemViewRow: + if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(option)) { + QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled + ? QPalette::Normal : QPalette::Disabled; + if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) + cg = QPalette::Inactive; + + if ((vopt->state & QStyle::State_Selected) && proxy()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, option, widget)) + d->drawPanelItemViewSelected(painter, vopt); + else if (vopt->features & QStyleOptionViewItemV2::Alternate) + painter->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase)); + else if (!(vopt->state & QStyle::State_Enabled)) + painter->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Base)); + } + break; + case PE_PanelItemViewItem: + if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(option)) { + QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled + ? QPalette::Normal : QPalette::Disabled; + if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active)) + cg = QPalette::Inactive; + + if (vopt->showDecorationSelected && (vopt->state & QStyle::State_Selected)) { + d->drawPanelItemViewSelected(painter, vopt); + } else { + if (vopt->backgroundBrush.style() != Qt::NoBrush) { + QPointF oldBO = painter->brushOrigin(); + painter->setBrushOrigin(vopt->rect.topLeft()); + painter->fillRect(vopt->rect, vopt->backgroundBrush); + painter->setBrushOrigin(oldBO); + } + + if (vopt->state & QStyle::State_Selected) { + QRect textRect = subElementRect(QStyle::SE_ItemViewItemText, option, widget); + d->drawPanelItemViewSelected(painter, vopt, textRect); + } + } + } + break; +#endif //QT_NO_ITEMVIEWS case PE_FrameWindow: { QPalette popupPal = option->palette; @@ -1586,67 +5488,10 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption break; case CE_TabBarTabShape: if (const QStyleOptionTab *tab = qstyleoption_cast(option)) { + if (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::RoundedWest) { - - painter->save(); - painter->setPen(tab->palette.shadow().color()); - if (d->doubleControls) { - QPen pen = painter->pen(); - pen.setWidth(2); - pen.setCapStyle(Qt::FlatCap); - painter->setPen(pen); - } - if(tab->shape == QTabBar::RoundedNorth) { - if (tab->state & State_Selected) { - painter->fillRect(tab->rect, tab->palette.light()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - } - else { - painter->fillRect(tab->rect, tab->palette.button()); - painter->drawLine(tab->rect.bottomLeft() , tab->rect.bottomRight()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - } - } - else if(tab->shape == QTabBar::RoundedSouth) { - - if (tab->state & State_Selected) { - painter->fillRect(tab->rect.adjusted(0,-2,0,0), tab->palette.light()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - } - else { - painter->fillRect(tab->rect, tab->palette.button()); - if (d->doubleControls) - painter->drawLine(tab->rect.topLeft() + QPoint(0,1), tab->rect.topRight() + QPoint(0,1)); - else - painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - } - } - else if(tab->shape == QTabBar::RoundedEast) { - if (tab->state & State_Selected) { - painter->fillRect(tab->rect, tab->palette.light()); - painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); - } - else { - painter->fillRect(tab->rect, tab->palette.button()); - painter->drawLine(tab->rect.topLeft(), tab->rect.bottomLeft()); - painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); - } - } - else if(tab->shape == QTabBar::RoundedWest) { - if (tab->state & State_Selected) { - painter->fillRect(tab->rect, tab->palette.light()); - painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); - } - else { - painter->fillRect(tab->rect, tab->palette.button()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); - } - } - - painter->restore(); + d->drawTabBarTab(painter, tab); } else { QCommonStyle::drawControl(element, option, painter, widget); } @@ -2118,26 +5963,8 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl painter->setPen(pen); } if (const QStyleOptionSlider *scrollbar = qstyleoption_cast(option)) { + d->drawScrollbarGroove(painter, scrollbar); // Make a copy here and reset it for each primitive. - QBrush fill; - if (d->smartphone) { - fill = option->palette.light(); - painter->fillRect(option->rect,fill); - fill = option->palette.button(); - QImage image; -#ifndef QT_NO_IMAGEFORMAT_XPM - if (scrollbar->orientation == Qt::Horizontal) - image = QImage(vertlines_xpm); - else - image = QImage(horlines_xpm); -#endif - image.setColor(1, option->palette.button().color().rgb()); - fill.setTextureImage(image); - } - else { - fill = option->palette.light(); - } - painter->fillRect(option->rect,fill); QStyleOptionSlider newScrollbar = *scrollbar; State saveFlags = scrollbar->state; //Check if the scrollbar is part of an abstractItemView and draw the frame according @@ -2163,34 +5990,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl if (newScrollbar.rect.isValid()) { if (!(scrollbar->activeSubControls & SC_ScrollBarSubLine)) newScrollbar.state &= ~(State_Sunken | State_MouseOver); - QStyleOption arrowOpt = newScrollbar; - if (d->doubleControls) - arrowOpt.rect = newScrollbar.rect.adjusted(4, 6, -5, -3); - else - arrowOpt.rect = newScrollbar.rect.adjusted(5, 6, -4, -3); - QBrush fill = option->palette.button(); - if (newScrollbar.state & State_Sunken) - fill = option->palette.shadow(); - if (scrollbar->orientation == Qt::Horizontal) { - painter->fillRect(newScrollbar.rect,fill); - QRect r = newScrollbar.rect.adjusted(0,0,1,0); - painter->drawLine(r.topRight(), r.bottomRight()); - if (d->doubleControls) - arrowOpt.rect.adjust(0, -2 ,0, -2); - drawPrimitive(PE_IndicatorArrowLeft, &arrowOpt, painter, widget); - } - else { - painter->fillRect(newScrollbar.rect,fill); - QRect r = newScrollbar.rect.adjusted(0, 0, 0, 1); - painter->drawLine(r.bottomLeft(), r.bottomRight()); - if (drawCompleteFrame) - arrowOpt.rect.adjust(-2, 0, -2, 0); - if (d->doubleControls) - arrowOpt.rect.adjust(0, -4 , 0, -4); - if (drawCompleteFrame && d->doubleControls) - arrowOpt.rect.adjust(2, 0, 2, 0); - drawPrimitive(PE_IndicatorArrowUp, &arrowOpt, painter, widget); - } + d->drawScrollbarHandleUp(painter, &newScrollbar, drawCompleteFrame, secondScrollBar); } } if (scrollbar->subControls & SC_ScrollBarAddLine) { @@ -2200,168 +6000,20 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl if (newScrollbar.rect.isValid()) { if (!(scrollbar->activeSubControls & SC_ScrollBarAddLine)) newScrollbar.state &= ~(State_Sunken | State_MouseOver); - QStyleOption arrowOpt = newScrollbar; - if (d->doubleControls) - arrowOpt.rect = newScrollbar.rect.adjusted(4, 0, -5, 3); - else - arrowOpt.rect = newScrollbar.rect.adjusted(5, 6, -4, -3); - QBrush fill = option->palette.button(); - if (newScrollbar.state & State_Sunken) - fill = option->palette.shadow(); - if (scrollbar->orientation == Qt::Horizontal) { - painter->fillRect(newScrollbar.rect,fill); - QRect r = newScrollbar.rect.adjusted(0, 0, 0, 0); - painter->drawLine(r.topLeft(), r.bottomLeft()); - if (secondScrollBar) - painter->drawLine(r.topRight(), r.bottomRight()); - if (d->doubleControls) - arrowOpt.rect.adjust(0, 4, 0, 4 ); - drawPrimitive(PE_IndicatorArrowRight, &arrowOpt, painter, widget); - } - else { - painter->fillRect(newScrollbar.rect,fill); - QRect r = newScrollbar.rect.adjusted(0, -1, 0, -1); - painter->drawLine(r.topLeft(), r.topRight()); - if (secondScrollBar) - painter->drawLine(r.bottomLeft() + QPoint(0,1), r.bottomRight() + QPoint(0, 1)); - if (drawCompleteFrame) - arrowOpt.rect.adjust(-2, 0, -2, 0); - if (d->doubleControls) - arrowOpt.rect.adjust(1, 0, 1, 0 ); - if (drawCompleteFrame && d->doubleControls) - arrowOpt.rect.adjust(1, 0, 1, 0); - drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); - } - } - } - if (scrollbar->subControls & SC_ScrollBarSubPage) { - newScrollbar.rect = scrollbar->rect; - newScrollbar.state = saveFlags; - newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarSubPage, widget); - if (newScrollbar.rect.isValid()) { - if (!(scrollbar->activeSubControls & SC_ScrollBarSubPage)) - newScrollbar.state &= ~(State_Sunken | State_MouseOver); - if (scrollbar->orientation == Qt::Horizontal) { - QRect r = newScrollbar.rect.adjusted(0, 0, 0, 0); - } - else{ - QRect r = newScrollbar.rect.adjusted(0, 0, 0, 0); - } - } - } - if (scrollbar->subControls & SC_ScrollBarAddPage) { - newScrollbar.rect = scrollbar->rect; - newScrollbar.state = saveFlags; - newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarAddPage, widget); - if (newScrollbar.rect.isValid()) { - if (!(scrollbar->activeSubControls & SC_ScrollBarAddPage)) - newScrollbar.state &= ~(State_Sunken | State_MouseOver); - if (scrollbar->orientation == Qt::Horizontal) { - QRect r = newScrollbar.rect.adjusted(0, 0, 0, -1); - } - else { - QRect r = newScrollbar.rect.adjusted(0, 0,- 1, 0); - } - } - } - if (scrollbar->subControls & SC_ScrollBarFirst) { - newScrollbar.rect = scrollbar->rect; - newScrollbar.state = saveFlags; - newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarFirst, widget); - if (newScrollbar.rect.isValid()) { - if (!(scrollbar->activeSubControls & SC_ScrollBarFirst)) - newScrollbar.state &= ~(State_Sunken | State_MouseOver); - QRect r = newScrollbar.rect; - } - } - if (scrollbar->subControls & SC_ScrollBarLast) { - newScrollbar.rect = scrollbar->rect; - newScrollbar.state = saveFlags; - newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarLast, widget); - if (newScrollbar.rect.isValid()) { - if (!(scrollbar->activeSubControls & SC_ScrollBarLast)) - newScrollbar.state &= ~(State_Sunken | State_MouseOver); - QRect r = newScrollbar.rect; + d->drawScrollbarHandleDown(painter, &newScrollbar, drawCompleteFrame, secondScrollBar); } } if (scrollbar->subControls & SC_ScrollBarSlider) { - newScrollbar.rect = scrollbar->rect; - newScrollbar.state = saveFlags; - newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarSlider, widget); - if (newScrollbar.rect.isValid()) { - if (!(scrollbar->activeSubControls & SC_ScrollBarSlider)) - newScrollbar.state &= ~(State_Sunken | State_MouseOver); - if (scrollbar->orientation == Qt::Horizontal) { - painter->fillRect(newScrollbar.rect,option->palette.button()); - QRect r = newScrollbar.rect; - painter->drawLine(r.topLeft(), r.bottomLeft()); - painter->drawLine(r.topRight(), r.bottomRight()); - if (d->smartphone) { - painter->drawLine(r.topLeft(), r.topRight()); - painter->drawLine(r.bottomLeft(), r.bottomRight()); - } - } - else { - painter->fillRect(newScrollbar.rect,option->palette.button()); - QRect r = newScrollbar.rect; - painter->drawLine(r.topLeft(), r.topRight()); - painter->drawLine(r.bottomLeft(), r.bottomRight()); - if (d->smartphone) { - painter->drawLine(r.topLeft(), r.bottomLeft()); - painter->drawLine(r.topRight(), r.bottomRight()); - } - } - if (scrollbar->state & State_HasFocus) { - QStyleOptionFocusRect fropt; - fropt.QStyleOption::operator=(newScrollbar); - fropt.rect.setRect(newScrollbar.rect.x() + 2, newScrollbar.rect.y() + 2, - newScrollbar.rect.width() - 5, - newScrollbar.rect.height() - 5); - } - } - } - int gripMargin = d->doubleControls ? 4 : 2; - int doubleLines = d->doubleControls ? 2 : 1; - //If there is a frame around the scrollbar (abstractScrollArea), - //then the margin is different, because of the missing frame - int gripMarginFrame = d->doubleControls ? 3 : 1; - if (drawCompleteFrame) - gripMarginFrame = 0; - //draw grips - if (!d->smartphone) - if (scrollbar->orientation == Qt::Horizontal) { - for (int i = -3; i < 3; i += 2) { - painter->drawLine( - QPoint(newScrollbar.rect.center().x() + i * doubleLines + 1, - newScrollbar.rect.top() + gripMargin +gripMarginFrame), - QPoint(newScrollbar.rect.center().x() + i * doubleLines + 1, - newScrollbar.rect.bottom() - gripMargin)); - } - } else { - for (int i = -2; i < 4 ; i += 2) { - painter->drawLine( - QPoint(newScrollbar.rect.left() + gripMargin + gripMarginFrame , - newScrollbar.rect.center().y() + 1 + i * doubleLines - 1), - QPoint(newScrollbar.rect.right() - gripMargin, - newScrollbar.rect.center().y() + 1 + i * doubleLines - 1)); - } - } - if (!d->smartphone) { - QRect r; - if (d->doubleControls) - r = option->rect.adjusted(1, 1, -1, 0); - else - r = option->rect.adjusted(0, 0, -1, 0); - if (drawCompleteFrame && d->doubleControls) - r.adjust(0, 0, 0, -1); - //Check if the scrollbar is part of an abstractItemView and draw the frame according - if (drawCompleteFrame) - painter->drawRect(r); - else - if (scrollbar->orientation == Qt::Horizontal) - painter->drawLine(r.topLeft(), r.topRight()); - else - painter->drawLine(r.topLeft(), r.bottomLeft()); + + newScrollbar.rect = scrollbar->rect; + newScrollbar.state = saveFlags; + newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarSlider, widget); + + if (newScrollbar.rect.isValid()) { + if (!(scrollbar->activeSubControls & SC_ScrollBarSlider)) + newScrollbar.state &= ~(State_Sunken | State_MouseOver); + d->drawScrollbarGrip(painter, &newScrollbar, option, drawCompleteFrame); + } } } painter->restore(); @@ -2719,11 +6371,25 @@ QSize QWindowsMobileStyle::sizeFromContents(ContentsType type, const QStyleOptio newSize = QSize(newSize.width() + 1, newSize.height()); break; case CT_TabBarTab: - newSize += QSize(0,0); + if (d_func()->doubleControls) + newSize = QSize(newSize.width(), 42); + else + newSize = QSize(newSize.width(), 21); break; case CT_HeaderSection: newSize += QSize(4, 2); break; +#ifndef QT_NO_ITEMVIEWS +#ifdef Q_WS_WINCE_WM + case CT_ItemViewItem: + if (d_func()->wm65) + if (d_func()->doubleControls) + newSize.setHeight(46); + else + newSize.setHeight(23); + break; +#endif //Q_WS_WINCE_WM +#endif //QT_NO_ITEMVIEWS default: break; } @@ -2751,7 +6417,7 @@ QRect QWindowsMobileStyle::subElementRect(SubElement element, const QStyleOption break; default: break; - #ifndef QT_NO_SLIDER +#ifndef QT_NO_SLIDER case SE_SliderFocusRect: if (const QStyleOptionSlider *slider = qstyleoption_cast(option)) { rect = slider->rect; @@ -2762,6 +6428,14 @@ QRect QWindowsMobileStyle::subElementRect(SubElement element, const QStyleOption rect.adjust(-1, -1, 0, 0); break; #endif // QT_NO_SLIDER +#ifndef QT_NO_ITEMVIEWS + case SE_ItemViewItemFocusRect: +#ifdef Q_WS_WINCE_WM + if (d->wm65) + rect = QRect(); +#endif + break; +#endif //QT_NO_ITEMVIEWS } return rect; } @@ -2778,9 +6452,20 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp case CC_ScrollBar: if (const QStyleOptionSlider *scrollbar = qstyleoption_cast(option)) { int sliderButtonExtent = pixelMetric(PM_ScrollBarExtent, scrollbar, widget); - int sliderlen; float stretchFactor = 1.4f; int sliderButtonExtentDir = int (sliderButtonExtent * stretchFactor); + +#ifdef Q_WS_WINCE_WM + if (d->wm65) +#else + if (false) +#endif //Q_WS_WINCE_WM + { + sliderButtonExtent = d->imageScrollbarHandleUp.width(); + sliderButtonExtentDir = d->imageScrollbarHandleUp.height(); + } + + int sliderlen; int maxlen = ((scrollbar->orientation == Qt::Horizontal) ? scrollbar->rect.width() : scrollbar->rect.height()) - (sliderButtonExtentDir * 2); // calculate slider length @@ -3318,15 +7003,36 @@ int QWindowsMobileStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, co d->doubleControls ? ret = 42 : ret = 21; break; case PM_ScrollBarSliderMin: - d->doubleControls ? ret = 36 : ret = 18; +#ifdef Q_WS_WINCE_WM + if (d->wm65) +#else + if (false) +#endif + { + d->doubleControls ? ret = 68 : ret = 34; + } else { + d->doubleControls ? ret = 36 : ret = 18; + } break; case PM_ScrollBarExtent: { - //Check if the scrollbar is part of an abstractItemView and set size according + if (d->smartphone) ret = 9; else d->doubleControls ? ret = 25 : ret = 13; + +#ifdef Q_WS_WINCE_WM + if (d->wm65) +#else + if (false) +#endif + { + d->doubleControls ? ret = 26 : ret = 13; + break; + } + #ifndef QT_NO_SCROLLAREA + //Check if the scrollbar is part of an abstractItemView and set size according if (widget) if (QWidget *parent = widget->parentWidget()) if (qobject_cast(parent->parentWidget())) @@ -3466,6 +7172,10 @@ QPixmap QWindowsMobileStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPi switch (iconMode) { case QIcon::Selected: { +#ifdef Q_WS_WINCE_WM + if (d_func()->wm65) + return pixmap; +#endif //Q_WS_WINCE_WM QImage img = pixmap.toImage().convertToFormat(QImage::Format_ARGB32); int imgh = img.height(); int imgw = img.width(); diff --git a/src/gui/styles/qwindowsmobilestyle_p.h b/src/gui/styles/qwindowsmobilestyle_p.h index 4f20bce3..59c07d8 100644 --- a/src/gui/styles/qwindowsmobilestyle_p.h +++ b/src/gui/styles/qwindowsmobilestyle_p.h @@ -67,6 +67,9 @@ public: QWindowsMobileStylePrivate(); bool doubleControls; bool smartphone; +#ifdef Q_WS_WINCE_WM + bool wm65; +#endif QImage imageRadioButton; QImage imageRadioButtonChecked; @@ -85,6 +88,42 @@ public: QImage imageMaximize; QImage imageNormalize; QImage imageMinimize; + + void setupWindowsMobileStyle65(); + +#ifdef Q_WS_WINCE_WM + //Windows Mobile 6.5 images + QImage imageScrollbarHandleUp; + QImage imageScrollbarHandleDown; + QImage imageScrollbarHandleUpHigh; + QImage imageScrollbarHandleDownHigh; + QImage imageScrollbarGripUp; + QImage imageScrollbarGripDown; + QImage imageScrollbarGripMiddle; + QImage imageListViewHighlightCornerLeft; + QImage imageListViewHighlightCornerRight; + QImage imageListViewHighlightMiddle; + QImage imageTabEnd; + QImage imageTabSelectedEnd; + QImage imageTabSelectedBegin; + QImage imageTabMiddle; + + QColor currentTintHigh; + QColor currentTintButton; + + void tintImagesHigh(QColor color); + void tintImagesButton(QColor color); + void tintListViewHighlight(QColor color); + void drawPanelItemViewSelected(QPainter *painter, const QStyleOptionViewItemV4 *option, QRect rect = QRect()); + + void drawScrollbarHandleUp(QPainter *p, QStyleOptionSlider *opt, bool completeFrame = false, bool secondScrollBar = false); + void drawScrollbarHandleDown(QPainter *p, QStyleOptionSlider *opt, bool completeFrame = false, bool secondScrollBar = false); + void drawScrollbarGroove(QPainter *p, const QStyleOptionSlider *opt); + void drawScrollbarGrip(QPainter *p, QStyleOptionSlider *newScrollbar, const QStyleOptionComplex *option, bool drawCompleteFrame); + void drawTabBarTab(QPainter *p, const QStyleOptionTab *tab); + +#endif //Q_WS_WINCE_WM + }; QT_END_NAMESPACE -- cgit v0.12 From 64c5e55bdd53fbde6a5485eba15da501411a22ca Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 11 Aug 2009 15:20:59 +0200 Subject: using proxy() --- src/gui/styles/qwindowsmobilestyle.cpp | 206 ++++++++++++++++----------------- 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index 1408c70f..ce2c806 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -75,8 +75,9 @@ #ifdef Q_WS_WINCE #include "qt_windows.h" #include "qguifunctions_wince.h" -extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp -extern bool qt_wince_is_smartphone(); //defined in qguifunctions_wince.cpp +extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp +extern bool qt_wince_is_smartphone(); //defined in qguifunctions_wince.cpp +extern bool qt_wince_is_windows_mobile_65(); //defined in qguifunctions_wince.cpp #endif // Q_WS_WINCE QT_BEGIN_NAMESPACE @@ -4410,7 +4411,7 @@ void QWindowsMobileStylePrivate::drawScrollbarHandleUp(QPainter *p, QStyleOption p->drawLine(r.topRight(), r.bottomRight()); if (doubleControls) arrowOpt.rect.adjust(0, -2 ,0, -2); - q_func()->drawPrimitive(QStyle::PE_IndicatorArrowLeft, &arrowOpt, p, 0); + q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowLeft, &arrowOpt, p, 0); } else { p->fillRect(opt->rect,fill); QRect r = opt->rect.adjusted(0, 0, 0, 1); @@ -4421,7 +4422,7 @@ void QWindowsMobileStylePrivate::drawScrollbarHandleUp(QPainter *p, QStyleOption arrowOpt.rect.adjust(0, -4 , 0, -4); if (completeFrame && doubleControls) arrowOpt.rect.adjust(2, 0, 2, 0); - q_func()->drawPrimitive(QStyle::PE_IndicatorArrowUp, &arrowOpt, p, 0); + q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowUp, &arrowOpt, p, 0); } } @@ -4469,7 +4470,7 @@ void QWindowsMobileStylePrivate::drawScrollbarHandleDown(QPainter *p, QStyleOpti p->drawLine(r.topRight(), r.bottomRight()); if (doubleControls) arrowOpt.rect.adjust(0, 4, 0, 4 ); - q_func()->drawPrimitive(QStyle::PE_IndicatorArrowRight, &arrowOpt, p, 0); + q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowRight, &arrowOpt, p, 0); } else { p->fillRect(opt->rect,fill); QRect r = opt->rect.adjusted(0, -1, 0, -1); @@ -4482,7 +4483,7 @@ void QWindowsMobileStylePrivate::drawScrollbarHandleDown(QPainter *p, QStyleOpti arrowOpt.rect.adjust(1, 0, 1, 0 ); if (completeFrame && doubleControls) arrowOpt.rect.adjust(1, 0, 1, 0); - q_func()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &arrowOpt, p, 0); + q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &arrowOpt, p, 0); } } @@ -5001,7 +5002,7 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp case PE_IndicatorSpinPlus: case PE_IndicatorSpinMinus: { QRect r = option->rect; - int fw = pixelMetric(PM_DefaultFrameWidth, option, widget)+2; + int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget)+2; QRect br = r.adjusted(fw, fw, -fw, -fw); int offset = (option->state & State_Sunken) ? 1 : 0; int step = (br.width() + 4) / 5; @@ -5038,8 +5039,8 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp break; } if (option->state & State_Sunken) - painter->translate(pixelMetric(PM_ButtonShiftHorizontal), - pixelMetric(PM_ButtonShiftVertical)); + painter->translate(proxy()->pixelMetric(PM_ButtonShiftHorizontal), + proxy()->pixelMetric(PM_ButtonShiftVertical)); if (option->state & State_Enabled) { painter->translate(option->rect.x() + option->rect.width() / 2, option->rect.y() + option->rect.height() / 2); @@ -5301,7 +5302,7 @@ void QWindowsMobileStyle::drawPrimitive(PrimitiveElement element, const QStyleOp } if (vopt->state & QStyle::State_Selected) { - QRect textRect = subElementRect(QStyle::SE_ItemViewItemText, option, widget); + QRect textRect = proxy()->subElementRect(QStyle::SE_ItemViewItemText, option, widget); d->drawPanelItemViewSelected(painter, vopt, textRect); } } @@ -5403,25 +5404,25 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption case CE_PushButtonBevel: if (const QStyleOptionButton *button = qstyleoption_cast(option)) { QRect br = button->rect; - int dbi = pixelMetric(PM_ButtonDefaultIndicator, button, widget); + int dbi = proxy()->pixelMetric(PM_ButtonDefaultIndicator, button, widget); if (button->features & QStyleOptionButton::AutoDefaultButton) br.setCoords(br.left() + dbi, br.top() + dbi, br.right() - dbi, br.bottom() - dbi); QStyleOptionButton tmpBtn = *button; tmpBtn.rect = br; - drawPrimitive(PE_PanelButtonCommand, &tmpBtn, painter, widget); + proxy()->drawPrimitive(PE_PanelButtonCommand, &tmpBtn, painter, widget); if (button->features & QStyleOptionButton::HasMenu) { - int mbi = pixelMetric(PM_MenuButtonIndicator, button, widget); + int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, button, widget); QRect ir = button->rect; QStyleOptionButton newButton = *button; if (d->doubleControls) newButton.rect = QRect(ir.right() - mbi, ir.height() - 30, mbi, ir.height() - 4); else newButton.rect = QRect(ir.right() - mbi, ir.height() - 20, mbi, ir.height() - 4); - drawPrimitive(PE_IndicatorArrowDown, &newButton, painter, widget); + proxy()->drawPrimitive(PE_IndicatorArrowDown, &newButton, painter, widget); } if (button->features & QStyleOptionButton::DefaultButton) - drawPrimitive(PE_FrameDefaultButton, option, painter, widget); + proxy()->drawPrimitive(PE_FrameDefaultButton, option, painter, widget); } break; case CE_RadioButton: @@ -5429,19 +5430,19 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption if (const QStyleOptionButton *button = qstyleoption_cast(option)) { bool isRadio = (element == CE_RadioButton); QStyleOptionButton subopt = *button; - subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator + subopt.rect = proxy()->subElementRect(isRadio ? SE_RadioButtonIndicator : SE_CheckBoxIndicator, button, widget); - drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, + proxy()->drawPrimitive(isRadio ? PE_IndicatorRadioButton : PE_IndicatorCheckBox, &subopt, painter, widget); - subopt.rect = subElementRect(isRadio ? SE_RadioButtonContents + subopt.rect = proxy()->subElementRect(isRadio ? SE_RadioButtonContents : SE_CheckBoxContents, button, widget); - drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget); + proxy()->drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &subopt, painter, widget); if (button->state & State_HasFocus) { QStyleOptionFocusRect fropt; fropt.QStyleOption::operator=(*button); - fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect + fropt.rect = proxy()->subElementRect(isRadio ? SE_RadioButtonFocusRect : SE_CheckBoxFocusRect, button, widget); - drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); } } break; @@ -5455,7 +5456,7 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption QRect textRect = button->rect; if (!button->icon.isNull()) { pix = button->icon.pixmap(button->iconSize, button->state & State_Enabled ? QIcon::Normal : QIcon::Disabled); - drawItemPixmap(painter, button->rect, alignment, pix); + proxy()->drawItemPixmap(painter, button->rect, alignment, pix); if (button->direction == Qt::RightToLeft) textRect.setRight(textRect.right() - button->iconSize.width() - 4); else @@ -5463,10 +5464,10 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption } if (!button->text.isEmpty()){ if (button->state & State_Enabled) - drawItemText(painter, textRect, alignment | Qt::TextShowMnemonic, + proxy()->drawItemText(painter, textRect, alignment | Qt::TextShowMnemonic, button->palette, false, button->text, QPalette::WindowText); else - drawItemText(painter, textRect, alignment | Qt::TextShowMnemonic, + proxy()->drawItemText(painter, textRect, alignment | Qt::TextShowMnemonic, button->palette, false, button->text, QPalette::Mid); } } @@ -5482,8 +5483,8 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption #ifndef QT_NO_TABBAR case CE_TabBarTab: if (const QStyleOptionTab *tab = qstyleoption_cast(option)) { - drawControl(CE_TabBarTabShape, tab, painter, widget); - drawControl(CE_TabBarTabLabel, tab, painter, widget); + proxy()->drawControl(CE_TabBarTabShape, tab, painter, widget); + proxy()->drawControl(CE_TabBarTabLabel, tab, painter, widget); } break; case CE_TabBarTabShape: @@ -5522,17 +5523,17 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption if (const QStyleOptionHeader *header = qstyleoption_cast(option)) { QRegion clipRegion = painter->clipRegion(); painter->setClipRect(option->rect); - drawControl(CE_HeaderSection, header, painter, widget); + proxy()->drawControl(CE_HeaderSection, header, painter, widget); QStyleOptionHeader subopt = *header; - subopt.rect = subElementRect(SE_HeaderLabel, header, widget); + subopt.rect = proxy()->subElementRect(SE_HeaderLabel, header, widget); if (header->state & State_Sunken) subopt.palette.setColor(QPalette::ButtonText, header->palette.brightText().color()); subopt.state |= QStyle::State_On; if (subopt.rect.isValid()) - drawControl(CE_HeaderLabel, &subopt, painter, widget); + proxy()->drawControl(CE_HeaderLabel, &subopt, painter, widget); if (header->sortIndicator != QStyleOptionHeader::None) { - subopt.rect = subElementRect(SE_HeaderArrow, option, widget); - drawPrimitive(PE_IndicatorHeaderArrow, &subopt, painter, widget); + subopt.rect = proxy()->subElementRect(SE_HeaderArrow, option, widget); + proxy()->drawPrimitive(PE_IndicatorHeaderArrow, &subopt, painter, widget); } painter->setClipRegion(clipRegion); } @@ -5677,14 +5678,14 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption painter->setFont(newFont); QPalette palette = dwOpt->palette; palette.setColor(QPalette::Window, inactiveCaptionTextColor); - QRect titleRect = subElementRect(SE_DockWidgetTitleBarText, option, widget); + QRect titleRect = proxy()->subElementRect(SE_DockWidgetTitleBarText, option, widget); if (verticalTitleBar) { titleRect = QRect(r.left() + rect.bottom() - titleRect.bottom(), r.top() + titleRect.left() - rect.left(), titleRect.height(), titleRect.width()); } - drawItemText(painter, titleRect, + proxy()->drawItemText(painter, titleRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::TextShowMnemonic, palette, dwOpt->state & State_Enabled, dwOpt->title, floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText); @@ -5734,7 +5735,7 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption point.rx() += pixw; if ((button->state & (State_On | State_Sunken)) && button->direction == Qt::RightToLeft) - point.rx() -= pixelMetric(PM_ButtonShiftHorizontal, option, widget) * 2; + point.rx() -= proxy()->pixelMetric(PM_ButtonShiftHorizontal, option, widget) * 2; painter->drawPixmap(visualPos(button->direction, button->rect, point), pixmap); @@ -5750,9 +5751,9 @@ void QWindowsMobileStyle::drawControl(ControlElement element, const QStyleOption tf |= Qt::AlignHCenter; } if (button->state & State_Enabled) - drawItemText(painter, ir, tf, button->palette, true, button->text, colorRole); + proxy()->drawItemText(painter, ir, tf, button->palette, true, button->text, colorRole); else - drawItemText(painter, ir, tf, button->palette, true, button->text, QPalette::Mid); + proxy()->drawItemText(painter, ir, tf, button->palette, true, button->text, QPalette::Mid); painter->restore(); } break; @@ -5772,11 +5773,11 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl #ifndef QT_NO_SLIDER case CC_Slider: if (const QStyleOptionSlider *slider = qstyleoption_cast(option)) { - int thickness = pixelMetric(PM_SliderControlThickness, slider, widget); - int len = pixelMetric(PM_SliderLength, slider, widget); + int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); + int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); int ticks = slider->tickPosition; - QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, widget); - QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, widget); + QRect groove = proxy()->subControlRect(CC_Slider, slider, SC_SliderGroove, widget); + QRect handle = proxy()->subControlRect(CC_Slider, slider, SC_SliderHandle, widget); if ((slider->subControls & SC_SliderGroove) && groove.isValid()) { int mid = thickness / 2; @@ -5827,8 +5828,8 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl if (slider->state & State_HasFocus) { QStyleOptionFocusRect fropt; fropt.QStyleOption::operator=(*slider); - fropt.rect = subElementRect(SE_SliderFocusRect, slider, widget); - drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); + fropt.rect = proxy()->subElementRect(SE_SliderFocusRect, slider, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); } if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) { Qt::BGMode oldMode = painter->backgroundMode(); @@ -5986,7 +5987,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl saveFlags |= State_Enabled; if (scrollbar->subControls & SC_ScrollBarSubLine) { newScrollbar.state = saveFlags; - newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarSubLine, widget); + newScrollbar.rect = proxy()->subControlRect(control, &newScrollbar, SC_ScrollBarSubLine, widget); if (newScrollbar.rect.isValid()) { if (!(scrollbar->activeSubControls & SC_ScrollBarSubLine)) newScrollbar.state &= ~(State_Sunken | State_MouseOver); @@ -5996,7 +5997,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl if (scrollbar->subControls & SC_ScrollBarAddLine) { newScrollbar.rect = scrollbar->rect; newScrollbar.state = saveFlags; - newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarAddLine, widget); + newScrollbar.rect = proxy()->subControlRect(control, &newScrollbar, SC_ScrollBarAddLine, widget); if (newScrollbar.rect.isValid()) { if (!(scrollbar->activeSubControls & SC_ScrollBarAddLine)) newScrollbar.state &= ~(State_Sunken | State_MouseOver); @@ -6007,7 +6008,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl newScrollbar.rect = scrollbar->rect; newScrollbar.state = saveFlags; - newScrollbar.rect = subControlRect(control, &newScrollbar, SC_ScrollBarSlider, widget); + newScrollbar.rect = proxy()->subControlRect(control, &newScrollbar, SC_ScrollBarSlider, widget); if (newScrollbar.rect.isValid()) { if (!(scrollbar->activeSubControls & SC_ScrollBarSlider)) @@ -6030,8 +6031,8 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl isTabWidget = (qobject_cast(parent->parentWidget())); #endif //QT_NO_TABWIDGET - button = subControlRect(control, toolbutton, SC_ToolButton, widget); - menuarea = subControlRect(control, toolbutton, SC_ToolButtonMenu, widget); + button = proxy()->subControlRect(control, toolbutton, SC_ToolButton, widget); + menuarea = proxy()->subControlRect(control, toolbutton, SC_ToolButtonMenu, widget); State buttonFlags = toolbutton->state; if (buttonFlags & State_AutoRaise) { if (!(buttonFlags & State_MouseOver)) { @@ -6048,7 +6049,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl if (toolbutton->subControls & SC_ToolButton) { tool.rect = button; tool.state = buttonFlags; - drawPrimitive(PE_PanelButtonTool, &tool, painter, widget); + proxy()->drawPrimitive(PE_PanelButtonTool, &tool, painter, widget); } if (toolbutton->subControls & SC_ToolButtonMenu) { tool.rect = menuarea; @@ -6057,7 +6058,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl toolMenu = *toolbutton; toolMenu.state = menuFlags; if (buttonFlags & State_Sunken) - drawPrimitive(PE_PanelButtonTool, &toolMenu, painter, widget); + proxy()->drawPrimitive(PE_PanelButtonTool, &toolMenu, painter, widget); QStyleOption arrowOpt(0); arrowOpt.rect = tool.rect; arrowOpt.palette = tool.palette; @@ -6069,25 +6070,25 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl painter->fillRect(menuarea, option->palette.shadow()); } arrowOpt.state = flags; - drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); + proxy()->drawPrimitive(PE_IndicatorArrowDown, &arrowOpt, painter, widget); } if (toolbutton->state & State_HasFocus) { QStyleOptionFocusRect focusRect; focusRect.QStyleOption::operator=(*toolbutton); focusRect.rect.adjust(3, 3, -3, -3); if (toolbutton->features & QStyleOptionToolButton::Menu) - focusRect.rect.adjust(0, 0, -pixelMetric(QStyle::PM_MenuButtonIndicator, + focusRect.rect.adjust(0, 0, -proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, toolbutton, widget), 0); - drawPrimitive(PE_FrameFocusRect, &focusRect, painter, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &focusRect, painter, widget); } QStyleOptionToolButton label = *toolbutton; if (isTabWidget) label.state = toolbutton->state; else label.state = toolbutton->state & State_Enabled; - int fw = pixelMetric(PM_DefaultFrameWidth, option, widget); + int fw = proxy()->pixelMetric(PM_DefaultFrameWidth, option, widget); label.rect = button.adjusted(fw, fw, -fw, -fw); - drawControl(CE_ToolButtonLabel, &label, painter, widget); + proxy()->drawControl(CE_ToolButtonLabel, &label, painter, widget); } break; @@ -6101,15 +6102,15 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl painter->setFont(font); QStyleOptionGroupBox groupBoxFont = *groupBox; groupBoxFont.fontMetrics = QFontMetrics(font); - QRect textRect = subControlRect(CC_GroupBox, &groupBoxFont, SC_GroupBoxLabel, widget); - QRect checkBoxRect = subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget).adjusted(0,0,0,0); + QRect textRect = proxy()->subControlRect(CC_GroupBox, &groupBoxFont, SC_GroupBoxLabel, widget); + QRect checkBoxRect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxCheckBox, widget).adjusted(0,0,0,0); if (groupBox->subControls & QStyle::SC_GroupBoxFrame) { QStyleOptionFrameV2 frame; frame.QStyleOption::operator=(*groupBox); frame.features = groupBox->features; frame.lineWidth = groupBox->lineWidth; frame.midLineWidth = groupBox->midLineWidth; - frame.rect = subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget); + frame.rect = proxy()->subControlRect(CC_GroupBox, option, SC_GroupBoxFrame, widget); painter->save(); QRegion region(groupBox->rect); if (!groupBox->text.isEmpty()) { @@ -6119,7 +6120,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl finalRect.adjust(ltr ? -4 : 0, 0, ltr ? 0 : 4, 0); region -= finalRect; } - drawPrimitive(PE_FrameGroupBox, &frame, painter, widget); + proxy()->drawPrimitive(PE_FrameGroupBox, &frame, painter, widget); painter->restore(); } // Draw checkbox @@ -6127,7 +6128,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl QStyleOptionButton box; box.QStyleOption::operator=(*groupBox); box.rect = checkBoxRect; - drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); + proxy()->drawPrimitive(PE_IndicatorCheckBox, &box, painter, widget); } // Draw title if ((groupBox->subControls & QStyle::SC_GroupBoxLabel) && !groupBox->text.isEmpty()) { @@ -6143,17 +6144,17 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl alignment |= Qt::TextHideMnemonic; if (groupBox->state & State_Enabled) - drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment, + proxy()->drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment, groupBox->palette, true, groupBox->text, textColor.isValid() ? QPalette::NoRole : QPalette::Link); else - drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment, + proxy()->drawItemText(painter, textRect, Qt::TextShowMnemonic | Qt::AlignHCenter | alignment, groupBox->palette, true, groupBox->text, QPalette::Mid); if (groupBox->state & State_HasFocus) { QStyleOptionFocusRect fropt; fropt.QStyleOption::operator=(*groupBox); fropt.rect = textRect; - drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); } } painter->restore(); @@ -6166,11 +6167,11 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl if (const QStyleOptionComboBox *cmb = qstyleoption_cast(option)) { QBrush editBrush = cmb->palette.brush(QPalette::Base); if ((cmb->subControls & SC_ComboBoxFrame) && cmb->frame) - qDrawPlainRect(painter, option->rect, option->palette.shadow().color(), pixelMetric(PM_ComboBoxFrameWidth, option, widget), &editBrush); + qDrawPlainRect(painter, option->rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_ComboBoxFrameWidth, option, widget), &editBrush); else painter->fillRect(option->rect, editBrush); State flags = State_None; - QRect ar = subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget); + QRect ar = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget); if ((option->state & State_On)) { painter->fillRect(ar.adjusted(0, 0, 1, 1),cmb->palette.brush(QPalette::Shadow)); } @@ -6186,9 +6187,9 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl arrowOpt.rect = ar; arrowOpt.palette = cmb->palette; arrowOpt.state = flags; - drawPrimitive(PrimitiveElement(PE_IndicatorArrowDownBig), &arrowOpt, painter, widget); + proxy()->drawPrimitive(PrimitiveElement(PE_IndicatorArrowDownBig), &arrowOpt, painter, widget); if (cmb->subControls & SC_ComboBoxEditField) { - QRect re = subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField, widget); + QRect re = proxy()->subControlRect(CC_ComboBox, cmb, SC_ComboBoxEditField, widget); if (cmb->state & State_HasFocus && !cmb->editable) painter->fillRect(re.x(), re.y(), re.width(), re.height(), cmb->palette.brush(QPalette::Highlight)); @@ -6202,11 +6203,11 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl if (cmb->state & State_HasFocus && !cmb->editable) { QStyleOptionFocusRect focus; focus.QStyleOption::operator=(*cmb); - focus.rect = subElementRect(SE_ComboBoxFocusRect, cmb, widget); + focus.rect = proxy()->subElementRect(SE_ComboBoxFocusRect, cmb, widget); focus.state |= State_FocusAtBorder; focus.backgroundColor = cmb->palette.highlight().color(); if ((option->state & State_On)) - drawPrimitive(PE_FrameFocusRect, &focus, painter, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &focus, painter, widget); } } } @@ -6222,8 +6223,8 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl int primitiveElement; if (spinBox->frame && (spinBox->subControls & SC_SpinBoxFrame)) { - QRect r = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxFrame, widget); - qDrawPlainRect(painter, r, option->palette.shadow().color(),pixelMetric(PM_SpinBoxFrameWidth, option, widget),0); + QRect r = proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxFrame, widget); + qDrawPlainRect(painter, r, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget),0); } QPalette shadePal(option->palette); shadePal.setColor(QPalette::Button, option->palette.light().color()); @@ -6245,13 +6246,13 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl } primitiveElement = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorArrowUpBig : PE_IndicatorArrowUpBig); - copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxUp, widget); + copy.rect = proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxUp, widget); if (copy.state & (State_Sunken | State_On)) - qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(),pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Shadow)); + qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Shadow)); else - qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(),pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); - copy.rect.adjust(pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0, -pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0); - drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); + qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); + copy.rect.adjust(proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0, -pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0); + proxy()->drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); } if (spinBox->subControls & SC_SpinBoxDown) { copy.subControls = SC_SpinBoxDown; @@ -6271,23 +6272,23 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl } primitiveElement = (spinBox->buttonSymbols == QAbstractSpinBox::PlusMinus ? PE_IndicatorArrowDownBig : PE_IndicatorArrowDownBig); - copy.rect = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxDown, widget); - qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(),pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); + copy.rect = proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxDown, widget); + qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); if (copy.state & (State_Sunken | State_On)) - qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(),pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Shadow)); + qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Shadow)); else - qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(),pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); + qDrawPlainRect(painter, copy.rect, option->palette.shadow().color(), proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), ©.palette.brush(QPalette::Base)); copy.rect.adjust(3, 0, -4, 0); if (primitiveElement == PE_IndicatorArrowUp || primitiveElement == PE_IndicatorArrowDown) { - int frameWidth = pixelMetric(PM_SpinBoxFrameWidth, option, widget); + int frameWidth = proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget); copy.rect = copy.rect.adjusted(frameWidth, frameWidth, -frameWidth, -frameWidth); - drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); + proxy()->drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); } else { - drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); + proxy()->drawPrimitive(PrimitiveElement(primitiveElement), ©, painter, widget); } if (spinBox->frame && (spinBox->subControls & SC_SpinBoxFrame)) { - QRect r = subControlRect(CC_SpinBox, spinBox, SC_SpinBoxEditField, widget); + QRect r = proxy()->subControlRect(CC_SpinBox, spinBox, SC_SpinBoxEditField, widget); } } } @@ -6312,7 +6313,7 @@ QSize QWindowsMobileStyle::sizeFromContents(ContentsType type, const QStyleOptio h = newSize.height(); int defwidth = 0; if (button->features & QStyleOptionButton::AutoDefaultButton) - defwidth = 2 * pixelMetric(PM_ButtonDefaultIndicator, button, widget); + defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, button, widget); if (w < 75 + defwidth && button->icon.isNull()) w = 75 + defwidth; if (h < 23 + defwidth) @@ -6335,9 +6336,9 @@ QSize QWindowsMobileStyle::sizeFromContents(ContentsType type, const QStyleOptio if (const QStyleOptionButton *button = qstyleoption_cast(option)) { bool isRadio = (type == CT_RadioButton); QRect irect = visualRect(button->direction, button->rect, - subElementRect(isRadio ? SE_RadioButtonIndicator + proxy()->subElementRect(isRadio ? SE_RadioButtonIndicator : SE_CheckBoxIndicator, button, widget)); - int h = pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight + int h = proxy()->pixelMetric(isRadio ? PM_ExclusiveIndicatorHeight : PM_IndicatorHeight, button, widget); int margins = (!button->icon.isNull() && button->text.isEmpty()) ? 0 : 10; if (d_func()->doubleControls) @@ -6349,7 +6350,7 @@ QSize QWindowsMobileStyle::sizeFromContents(ContentsType type, const QStyleOptio #ifndef QT_NO_COMBOBOX case CT_ComboBox: if (const QStyleOptionComboBox *comboBox = qstyleoption_cast(option)) { - int fw = comboBox->frame ? pixelMetric(PM_ComboBoxFrameWidth, option, widget) * 2 : 0; + int fw = comboBox->frame ? proxy()->pixelMetric(PM_ComboBoxFrameWidth, option, widget) * 2 : 0; newSize = QSize(newSize.width() + fw + 9, newSize.height() + fw-4); //Nine is a magic Number - See CommonStyle for real magic (23) } break; @@ -6357,7 +6358,7 @@ QSize QWindowsMobileStyle::sizeFromContents(ContentsType type, const QStyleOptio #ifndef QT_NO_SPINBOX case CT_SpinBox: if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast(option)) { - int fw = spinBox->frame ? pixelMetric(PM_SpinBoxFrameWidth, option, widget) * 2 : 0; + int fw = spinBox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget) * 2 : 0; newSize = QSize(newSize.width() + fw-5, newSize.height() + fw-6); } break; @@ -6451,7 +6452,7 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp #ifndef QT_NO_SCROLLBAR case CC_ScrollBar: if (const QStyleOptionSlider *scrollbar = qstyleoption_cast(option)) { - int sliderButtonExtent = pixelMetric(PM_ScrollBarExtent, scrollbar, widget); + int sliderButtonExtent = proxy()->pixelMetric(PM_ScrollBarExtent, scrollbar, widget); float stretchFactor = 1.4f; int sliderButtonExtentDir = int (sliderButtonExtent * stretchFactor); @@ -6473,7 +6474,7 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp uint range = scrollbar->maximum - scrollbar->minimum; sliderlen = (qint64(scrollbar->pageStep) * maxlen) / (range + scrollbar->pageStep); - int slidermin = pixelMetric(PM_ScrollBarSliderMin, scrollbar, widget); + int slidermin = proxy()->pixelMetric(PM_ScrollBarSliderMin, scrollbar, widget); if (sliderlen < slidermin || range > INT_MAX / 2) sliderlen = slidermin; if (sliderlen > maxlen) @@ -6568,7 +6569,7 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp #ifndef QT_NO_TOOLBUTTON case CC_ToolButton: if (const QStyleOptionToolButton *toolButton = qstyleoption_cast(option)) { - int mbi = pixelMetric(PM_MenuButtonIndicator, toolButton, widget); + int mbi = proxy()->pixelMetric(PM_MenuButtonIndicator, toolButton, widget); rect = toolButton->rect; switch (subControl) { case SC_ToolButton: @@ -6594,12 +6595,12 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp #ifndef QT_NO_SLIDER case CC_Slider: if (const QStyleOptionSlider *slider = qstyleoption_cast(option)) { - int tickOffset = pixelMetric(PM_SliderTickmarkOffset, slider, widget); - int thickness = pixelMetric(PM_SliderControlThickness, slider, widget); + int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget); + int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget); switch (subControl) { case SC_SliderHandle: { int sliderPos = 0; - int len = pixelMetric(PM_SliderLength, slider, widget); + int len = proxy()->pixelMetric(PM_SliderLength, slider, widget); bool horizontal = slider->orientation == Qt::Horizontal; sliderPos = sliderPositionFromValue(slider->minimum, slider->maximum, slider->sliderPosition, @@ -6652,7 +6653,7 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp case CC_SpinBox: if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast(option)) { QSize bs; - int fw = spinBox->frame ? pixelMetric(PM_SpinBoxFrameWidth, spinBox, widget) : 0; + int fw = spinBox->frame ? proxy()->pixelMetric(PM_SpinBoxFrameWidth, spinBox, widget) : 0; bs.setHeight(qMax(d->doubleControls ? 28 : 14, (spinBox->rect.height()))); // 1.6 -approximate golden mean bs.setWidth(qMax(d->doubleControls ? 28 : 14, qMin((bs.height()*7/8), (spinBox->rect.width() / 8)))); @@ -6663,7 +6664,7 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp rx = x - fw; switch (subControl) { case SC_SpinBoxUp: - rect = QRect(x+pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0 , bs.width(), bs.height()); + rect = QRect(x + proxy()->pixelMetric(PM_SpinBoxFrameWidth, option, widget), 0 , bs.width(), bs.height()); break; case SC_SpinBoxDown: rect = QRect(x + bs.width(), 0, bs.width(), bs.height()); @@ -6709,7 +6710,7 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp } int frameWidth = 0; if (groupBox->text.size()) { - frameWidth = pixelMetric(PM_DefaultFrameWidth, groupBox, widget); + frameWidth = proxy()->pixelMetric(PM_DefaultFrameWidth, groupBox, widget); rect = frameRect.adjusted(frameWidth, frameWidth + topHeight + labelMargin, -frameWidth, -frameWidth); } else { @@ -6730,8 +6731,8 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp rect.setHeight(h); else rect.setHeight(0); - int indicatorWidth = pixelMetric(PM_IndicatorWidth, option, widget); - int indicatorSpace = pixelMetric(PM_CheckBoxLabelSpacing, option, widget) - 1; + int indicatorWidth = proxy()->pixelMetric(PM_IndicatorWidth, option, widget); + int indicatorSpace = proxy()->pixelMetric(PM_CheckBoxLabelSpacing, option, widget) - 1; bool hasCheckBox = groupBox->subControls & QStyle::SC_GroupBoxCheckBox; int checkBoxSize = hasCheckBox ? (indicatorWidth + indicatorSpace) : 0; @@ -6745,7 +6746,7 @@ QRect QWindowsMobileStyle::subControlRect(ComplexControl control, const QStyleOp int left = 2; // Adjust for check box if (subControl == SC_GroupBoxCheckBox) { - int indicatorHeight = pixelMetric(PM_IndicatorHeight, option, widget); + int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, option, widget); left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth); int top = totalRect.top() + (fontMetrics.height() - indicatorHeight) / 2; totalRect.setRect(left, top, indicatorWidth, indicatorHeight); @@ -6941,7 +6942,6 @@ int QWindowsMobileStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, co case PM_RadioButtonLabelSpacing: ret = d->doubleControls ? 6 * 2 : 6; break; - break; // Returns the number of pixels to use for the business part of the // slider (i.e., the non-tickmark portion). The remaining space is shared // equally between the tickmark regions. @@ -6960,7 +6960,7 @@ int QWindowsMobileStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, co } int thick = 8; if (ticks != QSlider::TicksBothSides && ticks != QSlider::NoTicks) - thick += pixelMetric(PM_SliderLength, sl, widget) / 4; + thick += proxy()->pixelMetric(PM_SliderLength, sl, widget) / 4; space -= thick; if (space > 0) @@ -6982,7 +6982,7 @@ int QWindowsMobileStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, co d->doubleControls ? ret = 64 : ret = 32; break; case PM_IconViewIconSize: - ret = pixelMetric(PM_LargeIconSize, opt, widget); + ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget); break; case PM_ToolBarIconSize: d->doubleControls ? ret = 2 * windowsMobileIconSize : ret = windowsMobileIconSize; -- cgit v0.12 From 2a4cce47072d8ec71127cf17650683e17a8cdaca Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 11 Aug 2009 15:22:00 +0200 Subject: adding qt_wince_is_windows_mobile_65() --- src/gui/kernel/qguifunctions_wince.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp index 011c726..aba06d5 100644 --- a/src/gui/kernel/qguifunctions_wince.cpp +++ b/src/gui/kernel/qguifunctions_wince.cpp @@ -256,6 +256,31 @@ bool qt_wince_is_platform(const QString &platformString) { return false; } +int qt_wince_get_build() +{ + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof(osvi); + if (GetVersionEx(&osvi)) { + return osvi.dwBuildNumber; + } + return 0; +} + +int qt_wince_get_version() +{ + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof(osvi); + if (GetVersionEx(&osvi)) { + return (osvi.dwMajorVersion * 10 + osvi.dwMinorVersion); + } + return 0; +} + +bool qt_wince_is_windows_mobile_65() +{ + return ((qt_wince_get_version() == 52) && (qt_wince_get_build() > 2000)); +} + bool qt_wince_is_pocket_pc() { return qt_wince_is_platform(QString::fromLatin1("PocketPC")); } -- cgit v0.12 From 4f97f62eb4c8f6ebe9bc7a8f30f3f0219a456c75 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 11 Aug 2009 15:22:18 +0200 Subject: activate wm65 style only for wm65 --- src/gui/styles/qwindowsmobilestyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index ce2c806..014e46e 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -4114,7 +4114,7 @@ void QWindowsMobileStylePrivate::tintListViewHighlight(QColor color) void QWindowsMobileStylePrivate::setupWindowsMobileStyle65() { #ifdef Q_WS_WINCE_WM - wm65 = true; + wm65 = qt_wince_is_windows_mobile_65(); if (wm65) { imageScrollbarHandleUp = QImage(sbhandleup_xpm); imageScrollbarHandleDown = QImage(sbhandledown_xpm); -- cgit v0.12 From cb7e836d917eb43a9664c0f6b3e02788c0d78919 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 11 Aug 2009 16:01:16 +0200 Subject: Cleanup of Windows Mobile Style Reviewed-by: Maurice --- src/gui/styles/qwindowsmobilestyle.cpp | 137 +++++++++++++++------------------ 1 file changed, 61 insertions(+), 76 deletions(-) diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index 014e46e..7376f16 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -3996,21 +3996,6 @@ QColor toHsl(QColor c) return QColor::fromHsvF(h, s, l); } -void contrastImage(QImage *image) -{ - QVector colorTable = image->colorTable(); - for (int i=2;i< colorTable.size();i++) { - QColor c(colorTable.at(i)); - c.toHsv(); - if (c.value() < 150) - c = Qt::black; - else - c = Qt::white; - colorTable[i] = c.rgb(); - } - image->setColorTable(colorTable); -} - void tintColor(QColor &color, QColor tintColor, qreal _saturation) { tintColor = toHsl(tintColor); @@ -4167,62 +4152,62 @@ void QWindowsMobileStylePrivate::drawTabBarTab(QPainter *painter, const QStyleOp return; } #endif //Q_WS_WINCE_WM - painter->save(); - painter->setPen(tab->palette.shadow().color()); - if (doubleControls) { - QPen pen = painter->pen(); - pen.setWidth(2); - pen.setCapStyle(Qt::FlatCap); - painter->setPen(pen); - } - if(tab->shape == QTabBar::RoundedNorth) { - if (tab->state & QStyle::State_Selected) { - painter->fillRect(tab->rect, tab->palette.light()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - } - else { - painter->fillRect(tab->rect, tab->palette.button()); - painter->drawLine(tab->rect.bottomLeft() , tab->rect.bottomRight()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - } - } - else if(tab->shape == QTabBar::RoundedSouth) { - if (tab->state & QStyle::State_Selected) { - painter->fillRect(tab->rect.adjusted(0,-2,0,0), tab->palette.light()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - } - else { - painter->fillRect(tab->rect, tab->palette.button()); - if (doubleControls) - painter->drawLine(tab->rect.topLeft() + QPoint(0,1), tab->rect.topRight() + QPoint(0,1)); - else - painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - } - } - else if(tab->shape == QTabBar::RoundedEast) { - if (tab->state & QStyle::State_Selected) { - painter->fillRect(tab->rect, tab->palette.light()); - painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); - } - else { - painter->fillRect(tab->rect, tab->palette.button()); - painter->drawLine(tab->rect.topLeft(), tab->rect.bottomLeft()); - painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); - } - } - else if(tab->shape == QTabBar::RoundedWest) { - if (tab->state & QStyle::State_Selected) { - painter->fillRect(tab->rect, tab->palette.light()); - painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); - } - else { - painter->fillRect(tab->rect, tab->palette.button()); - painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); - painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); - } - } - painter->restore(); + painter->save(); + painter->setPen(tab->palette.shadow().color()); + if (doubleControls) { + QPen pen = painter->pen(); + pen.setWidth(2); + pen.setCapStyle(Qt::FlatCap); + painter->setPen(pen); + } + if(tab->shape == QTabBar::RoundedNorth) { + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect, tab->palette.light()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + } + else { + painter->fillRect(tab->rect, tab->palette.button()); + painter->drawLine(tab->rect.bottomLeft() , tab->rect.bottomRight()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + } + } + else if(tab->shape == QTabBar::RoundedSouth) { + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect.adjusted(0,-2,0,0), tab->palette.light()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + } + else { + painter->fillRect(tab->rect, tab->palette.button()); + if (doubleControls) + painter->drawLine(tab->rect.topLeft() + QPoint(0,1), tab->rect.topRight() + QPoint(0,1)); + else + painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + } + } + else if(tab->shape == QTabBar::RoundedEast) { + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect, tab->palette.light()); + painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); + } + else { + painter->fillRect(tab->rect, tab->palette.button()); + painter->drawLine(tab->rect.topLeft(), tab->rect.bottomLeft()); + painter->drawLine(tab->rect.topLeft(), tab->rect.topRight()); + } + } + else if(tab->shape == QTabBar::RoundedWest) { + if (tab->state & QStyle::State_Selected) { + painter->fillRect(tab->rect, tab->palette.light()); + painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); + } + else { + painter->fillRect(tab->rect, tab->palette.button()); + painter->drawLine(tab->rect.topRight(), tab->rect.bottomRight()); + painter->drawLine(tab->rect.bottomLeft(), tab->rect.bottomRight()); + } + } + painter->restore(); } void QWindowsMobileStylePrivate::drawPanelItemViewSelected(QPainter *painter, const QStyleOptionViewItemV4 *option, QRect rect) @@ -4391,7 +4376,7 @@ void QWindowsMobileStylePrivate::drawScrollbarHandleUp(QPainter *p, QStyleOption } return ; } -#endif .//Q_WS_WINCE_WM +#endif //Q_WS_WINCE_WM QBrush fill = opt->palette.button(); if (opt->state & QStyle::State_Sunken) @@ -4448,7 +4433,7 @@ void QWindowsMobileStylePrivate::drawScrollbarHandleDown(QPainter *p, QStyleOpti } return ; } -#endif .//Q_WS_WINCE_WM +#endif //Q_WS_WINCE_WM QBrush fill = opt->palette.button(); if (opt->state & QStyle::State_Sunken) @@ -4491,14 +4476,14 @@ void QWindowsMobileStylePrivate::drawScrollbarGroove(QPainter *p,const QStyleOpt { #ifdef Q_OS_WINCE_WM if (wm65) { - p->fillRect(opt->rect,QColor(231, 231, 231)); + p->fillRect(opt->rect, QColor(231, 231, 231)); return ; } #endif QBrush fill; if (smartphone) { fill = opt->palette.light(); - p->fillRect(opt->rect,fill); + p->fillRect(opt->rect, fill); fill = opt->palette.button(); QImage image; #ifndef QT_NO_IMAGEFORMAT_XPM @@ -4513,7 +4498,7 @@ void QWindowsMobileStylePrivate::drawScrollbarGroove(QPainter *p,const QStyleOpt else { fill = opt->palette.light(); } - p->fillRect(opt->rect,fill); + p->fillRect(opt->rect, fill); } QWindowsMobileStyle::QWindowsMobileStyle(QWindowsMobileStylePrivate &dd) : QWindowsStyle(dd) { -- cgit v0.12 From c6030230d0af230cfcf084cc7bc16515c863c37b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 11 Aug 2009 16:20:57 +0200 Subject: Make QFileInfo::isSymlink() work for symlinks on Windows This feature on Windows was added in Windows 2000, but its not so easy to utilize until at least Vista was released. Reviewed-by: Marius Storm-Olsen --- src/corelib/io/qfsfileengine_win.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 819034a..7c75525 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1525,6 +1525,8 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil ret |= FileType; } } else if (d->doStat()) { + if (d->fileAttrib & FILE_ATTRIBUTE_REPARSE_POINT) + ret |= LinkType; if (d->fileAttrib & FILE_ATTRIBUTE_DIRECTORY) { ret |= DirectoryType; } else { -- cgit v0.12 From 01cb98e141d201d7f7efd83dabefc7938759694b Mon Sep 17 00:00:00 2001 From: Matthew Cattell Date: Tue, 11 Aug 2009 16:38:34 +0200 Subject: QDateTimeEdit: setFrame property is respected when a popup calendar has been set. The hasFrame() or frame property of the QStyleOptionSpinBox was not being copiedthrough to the QStyleOptionComboBox inside the paintEvent method if a calendarPopup had been enabled. Task-number:259510 Reviewed-by:Jens Bache-Wiig --- src/gui/widgets/qdatetimeedit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp index cb76876..96d5619 100644 --- a/src/gui/widgets/qdatetimeedit.cpp +++ b/src/gui/widgets/qdatetimeedit.cpp @@ -2270,6 +2270,7 @@ void QDateTimeEdit::paintEvent(QPaintEvent *event) optCombo.init(this); optCombo.editable = true; + optCombo.frame = opt.frame; optCombo.subControls = opt.subControls; optCombo.activeSubControls = opt.activeSubControls; optCombo.state = opt.state; -- cgit v0.12 From 54ad9d0e8527eef9ce027f90d7c0ec1d9051833a Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 11 Aug 2009 16:50:45 +0200 Subject: QWidget::isHidden documentation clarification. Reviewed-by: Kavindra --- src/gui/kernel/qwidget.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index f705761..0dfc6e3 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -6863,9 +6863,12 @@ void QWidgetPrivate::hide_helper() widgets that are not visible. - Widgets are hidden if they were created as independent - windows or as children of visible widgets, or if hide() or setVisible(false) was called. - + Widgets are hidden if: + \list + \o they were created as independent windows, + \o they were created as children of visible widgets, + \o hide() or setVisible(false) was called. + \endlist */ -- cgit v0.12 From 71fd7e60c43392f2c21598a0c9d28b7aa5204cda Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 11 Aug 2009 16:55:15 +0200 Subject: Doc: Added information about quoting of path strings. Task-number: None Reviewed-by: Andy Shaw Review-was: Tentative --- doc/src/qmake-manual.qdoc | 19 +++++++++++++------ doc/src/snippets/qmake/spaces.pro | 8 ++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/doc/src/qmake-manual.qdoc b/doc/src/qmake-manual.qdoc index 3363881..1463da7 100644 --- a/doc/src/qmake-manual.qdoc +++ b/doc/src/qmake-manual.qdoc @@ -262,15 +262,20 @@ Normally, variables are used to contain whitespace-separated lists of values. However, it is sometimes necessary to specify values containing - spaces. These must be quoted in the following way: + spaces. These must be quoted by using the + \l{qmake Function Reference#quote-string}{quote()} function in the following way: \snippet doc/src/snippets/qmake/quoting.pro 0 The quoted text is treated as a single item in the list of values held by - the variable. This approach is used to deal with paths that contain spaces, - particularly on the Windows platform. See the documentation for the + the variable. A similar approach is used to deal with paths that contain + spaces, particularly when defining the \l{qmake Variable Reference#INCLUDEPATH}{INCLUDEPATH} and - \l{qmake Variable Reference#LIBS}{LIBS} variables for examples. + \l{qmake Variable Reference#LIBS}{LIBS} variables for the Windows platform. + In cases like these, the \l{qmake Function Reference#quote(string)}{quote()} + function can be used in the following way: + + \snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces \section2 Comments @@ -1377,7 +1382,8 @@ To specify a path containing spaces, quote the path using the technique mentioned in the \l{qmake Project Files#Whitespace}{qmake Project Files} document. For example, paths with spaces can be specified on Windows - and Unix platforms in the following way: + and Unix platforms by using the \l{qmake Function Reference#quote-string}{quote()} + function in the following way: \snippet doc/src/snippets/qmake/spaces.pro quoting include paths with spaces @@ -1437,7 +1443,8 @@ To specify a path containing spaces, quote the path using the technique mentioned in the \l{qmake Project Files#Whitespace}{qmake Project Files} document. For example, paths with spaces can be specified on Windows - and Unix platforms in the following way: + and Unix platforms by using the \l{qmake Function Reference#quote-string}{quote()} + function in the following way: \snippet doc/src/snippets/qmake/spaces.pro quoting library paths with spaces diff --git a/doc/src/snippets/qmake/spaces.pro b/doc/src/snippets/qmake/spaces.pro index c78e984..544ef05 100644 --- a/doc/src/snippets/qmake/spaces.pro +++ b/doc/src/snippets/qmake/spaces.pro @@ -1,9 +1,9 @@ #! [quoting library paths with spaces] -win32:LIBS += "C:/mylibs/extra libs/extra.lib" -unix:LIBS += -L"/home/user/extra libs" -lextra +win32:LIBS += $$quote(C:/mylibs/extra libs/extra.lib) +unix:LIBS += $$quote(-L/home/user/extra libs) -lextra #! [quoting library paths with spaces] #! [quoting include paths with spaces] -win32:INCLUDEPATH += "C:/mylibs/extra headers" -unix:INCLUDEPATH += "/home/user/extra headers" +win32:INCLUDEPATH += $$quote(C:/mylibs/extra headers) +unix:INCLUDEPATH += $$quote(/home/user/extra headers) #! [quoting include paths with spaces] -- cgit v0.12 From 8f5c9f36fac630abb262205f98c7fa562ec6b814 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 11 Aug 2009 16:57:04 +0200 Subject: Doc: Added information about the Qt::AutoCompatConnection enum value. Task-number: 235850 Reviewed-by: Trust Me --- doc/src/classes/qnamespace.qdoc | 7 ++++++- doc/src/porting4.qdoc | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/src/classes/qnamespace.qdoc b/doc/src/classes/qnamespace.qdoc index a49e079..18ecd7b 100644 --- a/doc/src/classes/qnamespace.qdoc +++ b/doc/src/classes/qnamespace.qdoc @@ -514,7 +514,6 @@ slots. In particular, it determines whether a particular signal is delivered to a slot immediately or queued for delivery at a later time. - \omitvalue AutoCompatConnection \value DirectConnection When emitted, the signal is immediately delivered to the slot. \value QueuedConnection When emitted, the signal is queued until the event loop is able to deliver it to the slot. @@ -533,6 +532,12 @@ not already connected to the same slot before connecting, otherwise, the connection will fail. This value was introduced in Qt 4.6. + \value AutoCompatConnection + The default connection type for signals and slots when Qt 3 support + is enabled. Equivalent to AutoConnection for connections but will cause warnings + to be output under certain circumstances. See + \l{Porting to Qt 4#Compatibility Signals and Slots}{Compatibility Signals and Slots} + for further information. With queued connections, the parameters must be of types that are known to Qt's meta-object system, because Qt needs to copy the arguments to store them diff --git a/doc/src/porting4.qdoc b/doc/src/porting4.qdoc index 963b918..286e10d 100644 --- a/doc/src/porting4.qdoc +++ b/doc/src/porting4.qdoc @@ -561,6 +561,21 @@ \note Setting widget attributes to disable key features of Qt's widget rendering model may also cause other features to be disabled. + \section1 Compatibility Signals and Slots + + When \c QT3_SUPPORT is defined, the default connection type for signals + and slots is the Qt::AutoCompatConnection type. This allows so-called + \e compatibility signals and slots (defined in Qt 3 support mode to provide + Qt 3 compatibility features) to be connected to other signals and + slots. + + However, if Qt is compiled with debugging output enabled, and the + developer uses other connection types to connect to compatibility + signals and slots (perhaps by building their application without Qt 3 + support enabled), then Qt will output warnings to the console to + indicate that compatibility connections are being made. This is intended + to be used as an aid in the process of porting a Qt 3 application to Qt 4. + \section1 QAccel The \c QAccel class has been renamed Q3Accel and moved to the -- cgit v0.12 From ac174ba05db74eb5928ac5d3408bca201adf29ca Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 11 Aug 2009 16:58:56 +0200 Subject: Doc: Fixed qdoc markup. Reviewed-by: Trust Me --- doc/src/examples/moveblocks.qdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/examples/moveblocks.qdoc b/doc/src/examples/moveblocks.qdoc index 7e42307..a0049ec 100644 --- a/doc/src/examples/moveblocks.qdoc +++ b/doc/src/examples/moveblocks.qdoc @@ -169,7 +169,7 @@ remember which state was the last state to which we transitioned. \snippet examples/animation/moveblocks/main.cpp 11 - + We select the next state we are going to transition to, and post a \c StateSwitchEvent, which we know will trigger the \c StateSwitchTransition to the selected state. @@ -198,8 +198,8 @@ \section1 The StateSwitchEvent Class \c StateSwitchEvent inherits QEvent, and holds a number that has - been assigned to a state and state switch transition by \c - StateSwitcher. We have already seen how it is used to trigger \c + been assigned to a state and state switch transition by + \c StateSwitcher. We have already seen how it is used to trigger \c{StateSwitchTransition}s in \c StateSwitcher. \snippet examples/animation/moveblocks/main.cpp 15 -- cgit v0.12 From 37a8926fd8aa1971a4d0a8b04facf63c631b9367 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 11 Aug 2009 10:26:31 +0200 Subject: fix warnings for the qreal == float case Reviewed-by: mauricek --- src/gui/graphicsview/qgraphicsscene_p.h | 4 ++-- src/gui/styles/qstylehelper.cpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index a4bbdd2..7415591 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -267,9 +267,9 @@ static inline void _q_adjustRect(QRectF *rect) { Q_ASSERT(rect); if (!rect->width()) - rect->adjust(-0.00001, 0, 0.00001, 0); + rect->adjust(qreal(-0.00001), 0, qreal(0.00001), 0); if (!rect->height()) - rect->adjust(0, -0.00001, 0, 0.00001); + rect->adjust(0, qreal(-0.00001), 0, qreal(0.00001)); } static inline QRectF adjustedItemBoundingRect(const QGraphicsItem *item) diff --git a/src/gui/styles/qstylehelper.cpp b/src/gui/styles/qstylehelper.cpp index 4877ec4..402c4d1 100644 --- a/src/gui/styles/qstylehelper.cpp +++ b/src/gui/styles/qstylehelper.cpp @@ -250,8 +250,8 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter) QRadialGradient shadowGradient(shadowRect.center().x(), shadowRect.center().y(), shadowRect.width()/2.0, shadowRect.center().x(), shadowRect.center().y()); - shadowGradient.setColorAt(0.91, QColor(0, 0, 0, 40)); - shadowGradient.setColorAt(1.0, Qt::transparent); + shadowGradient.setColorAt(qreal(0.91), QColor(0, 0, 0, 40)); + shadowGradient.setColorAt(qreal(1.0), Qt::transparent); p->setBrush(shadowGradient); p->setPen(Qt::NoPen); p->translate(shadowSize, shadowSize); @@ -263,8 +263,8 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter) br.width()*1.3, br.center().x(), br.center().y() - br.height()/2); gradient.setColorAt(0, buttonColor.lighter(110)); - gradient.setColorAt(0.5, buttonColor); - gradient.setColorAt(0.501, buttonColor.darker(102)); + gradient.setColorAt(qreal(0.5), buttonColor); + gradient.setColorAt(qreal(0.501), buttonColor.darker(102)); gradient.setColorAt(1, buttonColor.darker(115)); p->setBrush(gradient); } else { @@ -290,21 +290,21 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter) END_STYLE_PIXMAPCACHE - QPointF dp = calcRadialPos(option, 0.70); + QPointF dp = calcRadialPos(option, qreal(0.70)); buttonColor = buttonColor.lighter(104); - buttonColor.setAlphaF(0.8); - const qreal ds = r/7.0; + buttonColor.setAlphaF(qreal(0.8)); + const qreal ds = r/qreal(7.0); QRectF dialRect(dp.x() - ds, dp.y() - ds, 2*ds, 2*ds); QRadialGradient dialGradient(dialRect.center().x() + dialRect.width()/2, dialRect.center().y() + dialRect.width(), dialRect.width()*2, dialRect.center().x(), dialRect.center().y()); dialGradient.setColorAt(1, buttonColor.darker(140)); - dialGradient.setColorAt(0.4, buttonColor.darker(120)); + dialGradient.setColorAt(qreal(0.4), buttonColor.darker(120)); dialGradient.setColorAt(0, buttonColor.darker(110)); if (penSize > 3.0) { painter->setPen(QPen(QColor(0, 0, 0, 25), penSize)); - painter->drawLine(calcRadialPos(option, 0.90), calcRadialPos(option, 0.96)); + painter->drawLine(calcRadialPos(option, qreal(0.90)), calcRadialPos(option, qreal(0.96))); } painter->setBrush(dialGradient); -- cgit v0.12 From d45b0ee01402c2474652f6afd2cd1e8564d8071c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 11 Aug 2009 16:03:03 +0200 Subject: QPoint comparision operators use qFuzzyIsNull instead of qFuzzyCompare qFuzzyCompare doesn't support 0 as parameter. So this function is pretty useless for QPoint, where coordinates can be zero. Reviewed-by: Harald Fernengel --- src/corelib/tools/qpoint.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h index df35eaa..8d653b0 100644 --- a/src/corelib/tools/qpoint.h +++ b/src/corelib/tools/qpoint.h @@ -302,12 +302,12 @@ inline QPointF &QPointF::operator*=(qreal c) inline bool operator==(const QPointF &p1, const QPointF &p2) { - return qFuzzyCompare(p1.xp, p2.xp) && qFuzzyCompare(p1.yp, p2.yp); + return qFuzzyIsNull(p1.xp - p2.xp) && qFuzzyIsNull(p1.yp - p2.yp); } inline bool operator!=(const QPointF &p1, const QPointF &p2) { - return !qFuzzyCompare(p1.xp, p2.xp) || !qFuzzyCompare(p1.yp, p2.yp); + return !qFuzzyIsNull(p1.xp - p2.xp) || !qFuzzyIsNull(p1.yp - p2.yp); } inline const QPointF operator+(const QPointF &p1, const QPointF &p2) -- cgit v0.12 From ee7d7a4f3016e8ca94bde5c2328676e31bf4eba2 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 11 Aug 2009 11:53:41 +0200 Subject: fix QTextFormat::doubleProperty where qreal is float This function was too strict. It returned 0 if the property wasn't of type QVariant::Double. Now it tests for QMetaType::Float too. Reviewed-by: kh1 Reviewed-by: mauricek --- src/gui/text/qtextformat.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index a3dd83e..fd0c17f 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -875,7 +875,8 @@ int QTextFormat::intProperty(int propertyId) const /*! Returns the value of the property specified by \a propertyId. If the - property isn't of QVariant::Double type, 0 is returned instead. + property isn't of QVariant::Double or QMetaType::Float type, 0 is + returned instead. \sa setProperty() boolProperty() intProperty() stringProperty() colorProperty() lengthProperty() lengthVectorProperty() Property */ @@ -884,9 +885,9 @@ qreal QTextFormat::doubleProperty(int propertyId) const if (!d) return 0.; const QVariant prop = d->property(propertyId); - if (prop.type() != QVariant::Double) + if (prop.type() != QVariant::Double && prop.type() != QMetaType::Float) return 0.; - return prop.toDouble(); // #### + return qVariantValue(prop); } /*! -- cgit v0.12 From 204c771ab5c0ef62c76ead594bfeacc3627ab108 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 11 Aug 2009 17:56:43 +0200 Subject: fix tst_QPixmapCache::clear for Windows CE This test used too much memory for Windows CE <= 5. Reviewed-by: thartman --- tests/auto/qpixmapcache/tst_qpixmapcache.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp index e71bd5d..7866df8 100644 --- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp @@ -392,14 +392,19 @@ void tst_QPixmapCache::clear() QPixmap p1(10, 10); p1.fill(Qt::red); - for (int i = 0; i < 20000; ++i) +#ifdef Q_OS_WINCE + const int numberOfKeys = 10000; +#else + const int numberOfKeys = 20000; +#endif + for (int i = 0; i < numberOfKeys; ++i) QVERIFY(QPixmapCache::find("x" + QString::number(i)) == 0); - for (int j = 0; j < 20000; ++j) + for (int j = 0; j < numberOfKeys; ++j) QPixmapCache::insert(QString::number(j), p1); int num = 0; - for (int k = 0; k < 20000; ++k) { + for (int k = 0; k < numberOfKeys; ++k) { if (QPixmapCache::find(QString::number(k), p1)) ++num; } @@ -407,7 +412,7 @@ void tst_QPixmapCache::clear() QPixmapCache::clear(); - for (int k = 0; k < 20000; ++k) + for (int k = 0; k < numberOfKeys; ++k) QVERIFY(QPixmapCache::find(QString::number(k)) == 0); //The int part of the API @@ -415,12 +420,12 @@ void tst_QPixmapCache::clear() p2.fill(Qt::red); QList keys; - for (int k = 0; k < 20000; ++k) + for (int k = 0; k < numberOfKeys; ++k) keys.append(QPixmapCache::insert(p2)); QPixmapCache::clear(); - for (int k = 0; k < 20000; ++k) { + for (int k = 0; k < numberOfKeys; ++k) { QVERIFY(QPixmapCache::find(keys.at(k), &p1) == 0); QCOMPARE(getPrivate(keys[k])->isValid, false); } -- cgit v0.12 From eb4efda5c8a9a32c38945e26f68217b170b87ffb Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:14 +0200 Subject: QFSFileEngine::mkdir fix on Windows This function now returns early if a non-directory is met in the path. Something like /foo/bar/&&/ will bail out early. Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 7c75525..11d1ca6 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -958,9 +958,13 @@ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) con if (slash) { QString chunk = dirName.left(slash); bool existed = false; - if (!isDirPath(chunk, &existed) && !existed) { - if (!mkDir(chunk)) + if (!isDirPath(chunk, &existed)) { + if (!existed) { + if (!mkDir(chunk)) + return false; + } else { return false; + } } } } -- cgit v0.12 From d703c131bae6fb89672a55e1bcd735e2514e75ac Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:16 +0200 Subject: don't set FileType flag when link's target doesn't exists Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 11d1ca6..25fbae8 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -896,7 +896,7 @@ static inline bool rmDir(const QString &path) static inline bool isDirPath(const QString &dirPath, bool *existed) { QString path = dirPath; - if (path.length() == 2 &&path.at(1) == QLatin1Char(':')) + if (path.length() == 2 && path.at(1) == QLatin1Char(':')) path += QLatin1Char('\\'); DWORD fileAttrib = ::GetFileAttributes((wchar_t*)QFSFileEnginePrivate::longFileName(path).utf16()); @@ -1523,9 +1523,10 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil ret |= LinkType; QString l = readLink(d->filePath); if (!l.isEmpty()) { - if (isDirPath(l, 0)) + bool existed = false; + if (isDirPath(l, &existed) && existed) ret |= DirectoryType; - else + else if (existed) ret |= FileType; } } else if (d->doStat()) { -- cgit v0.12 From c9fb4ac3483c492f32e4f42987935478d4e89eb8 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:18 +0200 Subject: micro-optimization in QFSFileEngine::mkdir Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_unix.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index c0b6820..075aa7c 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -414,15 +414,15 @@ bool QFSFileEngine::mkdir(const QString &name, bool createParentDirectories) con if ((st.st_mode & S_IFMT) != S_IFDIR) return false; } else if (QT_MKDIR(chunk, 0777) != 0) { - return false; + return false; } } } return true; } #if defined(Q_OS_DARWIN) // Mac X doesn't support trailing /'s - if (dirName[dirName.length() - 1] == QLatin1Char('/')) - dirName = dirName.left(dirName.length() - 1); + if (dirName.endsWith(QLatin1Char('/'))) + dirName.chop(1); #endif return (QT_MKDIR(QFile::encodeName(dirName), 0777) == 0); } -- cgit v0.12 From bcbaeff0332e30f020f031b99efcc69d9707f962 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:20 +0200 Subject: replace QFile::exists() by QT_STAT() respectively which is a bit faster since it doesn't creates new file engine instance Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_unix.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 075aa7c..cde5272 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -76,10 +76,14 @@ static QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QString & if ((flags & QIODevice::ReadOnly) && !(flags & QIODevice::Truncate)) { mode = "rb"; if (flags & QIODevice::WriteOnly) { - if (!fileName.isEmpty() &&QFile::exists(fileName)) - mode = "rb+"; - else + QT_STATBUF statBuf; + if (!fileName.isEmpty() + && QT_STAT(QFile::encodeName(fileName), &statBuf) == 0 + && (statBuf.st_mode & S_IFMT) == S_IFREG) { + mode += "+"; + } else { mode = "wb+"; + } } } else if (flags & QIODevice::WriteOnly) { mode = "wb"; -- cgit v0.12 From 0e193b51c995395c92f8b1d0b67a782314772c6c Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:23 +0200 Subject: avoid needless const_cast-s tried_stat, could_stat, need_lstat, and is_link are members marked as mutable; prefer mutable over const_cast Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_unix.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index cde5272..029d422 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -524,18 +524,19 @@ QFileInfoList QFSFileEngine::drives() bool QFSFileEnginePrivate::doStat() const { - if (tried_stat == 0) { - QFSFileEnginePrivate *that = const_cast(this); + if (!tried_stat) { + tried_stat = true; + could_stat = false; + if (fh && nativeFilePath.isEmpty()) { // ### actually covers two cases: d->fh and when the file is not open - that->could_stat = (QT_FSTAT(fileno(fh), &st) == 0); + could_stat = (QT_FSTAT(QT_FILENO(fh), &st) == 0); } else if (fd == -1) { // ### actually covers two cases: d->fh and when the file is not open - that->could_stat = (QT_STAT(nativeFilePath.constData(), &st) == 0); + could_stat = (QT_STAT(nativeFilePath.constData(), &st) == 0); } else { - that->could_stat = (QT_FSTAT(fd, &st) == 0); + could_stat = (QT_FSTAT(fd, &st) == 0); } - that->tried_stat = 1; } return could_stat; } @@ -543,10 +544,10 @@ bool QFSFileEnginePrivate::doStat() const bool QFSFileEnginePrivate::isSymlink() const { if (need_lstat) { - QFSFileEnginePrivate *that = const_cast(this); - that->need_lstat = false; + need_lstat = false; + QT_STATBUF st; // don't clobber our main one - that->is_link = (QT_LSTAT(nativeFilePath.constData(), &st) == 0) ? S_ISLNK(st.st_mode) : false; + is_link = (QT_LSTAT(nativeFilePath.constData(), &st) == 0) ? S_ISLNK(st.st_mode) : false; } return is_link; } -- cgit v0.12 From 7fe0dfb80efd67886a33fe8b37e9714175925688 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:25 +0200 Subject: avoid crash when testing HiddenFlag and BaseName is empty Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_unix.cpp | 3 ++- tests/auto/qfileinfo/tst_qfileinfo.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 029d422..4d451e6 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -656,7 +656,8 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const ret |= LocalDiskFlag; if (exists) ret |= ExistsFlag; - if (fileName(BaseName)[0] == QLatin1Char('.') + QString baseName = fileName(BaseName); + if ((baseName.size() > 0 && baseName.at(0) == QLatin1Char('.')) #if !defined(QWS) && defined(Q_OS_MAC) || _q_isMacHidden(d->filePath) #endif diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index a87e306..e2800e5 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -974,6 +974,9 @@ void tst_QFileInfo::isHidden_data() foreach (const QFileInfo& info, QDir::drives()) { QTest::newRow(qPrintable("drive." + info.path())) << info.path() << false; } +#if !defined(Q_OS_WIN) + QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << false; +#endif #ifdef Q_OS_MAC QTest::newRow("mac_etc") << QString::fromLatin1("/etc") << true; QTest::newRow("mac_private_etc") << QString::fromLatin1("/private/etc") << false; -- cgit v0.12 From f36fb8b2b63b3734cc2bd66b329ca4fef1204845 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:27 +0200 Subject: '.' and '..' must not be hidden _unix code always sets HiddenFlag for special dirs which is wrong; also there is some inconsistence under win: * FindFirstFile sets FILE_ATTRIBUTE_HIDDEN flag for ".." of hidden dir *even* if parent dir is not hidden; * GetFileAttributes sets FILE_ATTRIBUTE_HIDDEN flag for ".." *only* if parent dir is hidden. so, _win part sets HiddenFlag wrong too; finally, we never test parent dir's flags; futhermore hidden special dirs (dotAndDotDot) makes dir iterator's filtering a bit more complex Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_unix.cpp | 18 +++++++++++------- src/corelib/io/qfsfileengine_win.cpp | 7 ++++--- tests/auto/qfileinfo/tst_qfileinfo.cpp | 13 +++++++++++++ 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 4d451e6..ff10a44 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -656,15 +656,19 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const ret |= LocalDiskFlag; if (exists) ret |= ExistsFlag; - QString baseName = fileName(BaseName); - if ((baseName.size() > 0 && baseName.at(0) == QLatin1Char('.')) + if (d->filePath == QLatin1String("/")) { + ret |= RootFlag; + } else { + QString baseName = fileName(BaseName); + if ((baseName.size() > 1 + && baseName.at(0) == QLatin1Char('.') && baseName.at(1) != QLatin1Char('.')) #if !defined(QWS) && defined(Q_OS_MAC) - || _q_isMacHidden(d->filePath) + || _q_isMacHidden(d->filePath) #endif - ) - ret |= HiddenFlag; - if (d->filePath == QLatin1String("/")) - ret |= RootFlag; + ) { + ret |= HiddenFlag; + } + } } return ret; } diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 25fbae8..c2b993b 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1542,12 +1542,13 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil if (type & FlagsMask) { if(d->doStat()) { ret |= QAbstractFileEngine::FileFlags(ExistsFlag | LocalDiskFlag); - if (d->fileAttrib & FILE_ATTRIBUTE_HIDDEN) - ret |= HiddenFlag; if (d->filePath == QLatin1String("/") || (d->filePath.at(0).isLetter() && d->filePath.mid(1,d->filePath.length()) == QLatin1String(":/")) || isUncRoot(d->filePath)) { ret |= RootFlag; - ret &= ~HiddenFlag; + } else if (d->fileAttrib & FILE_ATTRIBUTE_HIDDEN) { + QString baseName = fileName(BaseName); + if (baseName != QLatin1String(".") && baseName != QLatin1String("..")) + ret |= HiddenFlag; } } } diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index e2800e5..fa2bd6e 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -974,9 +974,22 @@ void tst_QFileInfo::isHidden_data() foreach (const QFileInfo& info, QDir::drives()) { QTest::newRow(qPrintable("drive." + info.path())) << info.path() << false; } + +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + QTest::newRow("C:/RECYCLER") << QString::fromLatin1("C:/RECYCLER") << true; + QTest::newRow("C:/RECYCLER/.") << QString::fromLatin1("C:/RECYCLER/.") << false; + QTest::newRow("C:/RECYCLER/..") << QString::fromLatin1("C:/RECYCLER/..") << false; +#endif +#if defined(Q_OS_UNIX) + QTest::newRow("~/.qt") << QDir::homePath() + QString("/.qt") << true; + QTest::newRow("~/.qt/.") << QDir::homePath() + QString("/.qt/.") << false; + QTest::newRow("~/.qt/..") << QDir::homePath() + QString("/.qt/..") << false; +#endif + #if !defined(Q_OS_WIN) QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << false; #endif + #ifdef Q_OS_MAC QTest::newRow("mac_etc") << QString::fromLatin1("/etc") << true; QTest::newRow("mac_private_etc") << QString::fromLatin1("/private/etc") << false; -- cgit v0.12 From 53576b4d3c3e7325d01efba6c4da80299492f2db Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:30 +0200 Subject: QFSFileEngine must set LocalDiskFlag regardless file exists or not LocalDiskFlag actually means "Local File Engine" and can be effectively used for testing file path for target storage type (local/network/virtual and so on) Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 5 +++-- tests/auto/qfileinfo/tst_qfileinfo.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index c2b993b..52fe44e 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1540,8 +1540,9 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil } } if (type & FlagsMask) { - if(d->doStat()) { - ret |= QAbstractFileEngine::FileFlags(ExistsFlag | LocalDiskFlag); + ret |= LocalDiskFlag; + if (d->doStat()) { + ret |= ExistsFlag; if (d->filePath == QLatin1String("/") || (d->filePath.at(0).isLetter() && d->filePath.mid(1,d->filePath.length()) == QLatin1String(":/")) || isUncRoot(d->filePath)) { ret |= RootFlag; diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index fa2bd6e..306ca49 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -147,6 +147,9 @@ private slots: void isBundle_data(); void isBundle(); + void isLocalFs_data(); + void isLocalFs(); + void refresh(); #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) @@ -1024,6 +1027,29 @@ void tst_QFileInfo::isBundle() QCOMPARE(fi.isBundle(), isBundle); } +void tst_QFileInfo::isLocalFs_data() +{ + QTest::addColumn("path"); + QTest::addColumn("isLocalFs"); + + QTest::newRow("local root") << QString::fromLatin1("/") << true; + QTest::newRow("local non-existent file") << QString::fromLatin1("/abrakadabra.boo") << true; + + QTest::newRow("qresource root") << QString::fromLatin1(":/") << false; +} + +void tst_QFileInfo::isLocalFs() +{ + QFETCH(QString, path); + QFETCH(bool, isLocalFs); + + QFileInfo info(path); + QFileInfoPrivate *privateInfo = getPrivate(info); + QVERIFY(privateInfo->data->fileEngine); + QCOMPARE(bool(privateInfo->data->fileEngine->fileFlags(QAbstractFileEngine::LocalDiskFlag) + & QAbstractFileEngine::LocalDiskFlag), isLocalFs); +} + void tst_QFileInfo::refresh() { #if defined(Q_OS_WINCE) -- cgit v0.12 From 7fe142cfcf27632a455ce193fa57c131afea61cc Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:33 +0200 Subject: move dubbed code into static funtion Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 52fe44e..2c9b977 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -337,6 +337,13 @@ static bool uncShareExists(const QString &server) return false; } +static bool isDriveRoot(const QString &path) +{ + return (path.length() == 3 + && path.at(0).isLetter() && path.at(1) == QLatin1Char(':') + && path.at(2) == QLatin1Char('/')); +} + static QString nativeAbsoluteFilePathCore(const QString &path) { QString ret; @@ -1217,8 +1224,8 @@ bool QFSFileEnginePrivate::doStat() const could_stat = fileAttrib != INVALID_FILE_ATTRIBUTES; if (!could_stat) { #if !defined(Q_OS_WINCE) - if (!fname.isEmpty() && fname.at(0).isLetter() && fname.mid(1, fname.length()) == QLatin1String(":/")) { - // an empty drive ?? + if (isDriveRoot(fname)) { + // a valid drive ?? DWORD drivesBitmask = ::GetLogicalDrives(); int drivebit = 1 << (fname.at(0).toUpper().unicode() - QLatin1Char('A').unicode()); if (drivesBitmask & drivebit) { @@ -1543,8 +1550,7 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil ret |= LocalDiskFlag; if (d->doStat()) { ret |= ExistsFlag; - if (d->filePath == QLatin1String("/") || (d->filePath.at(0).isLetter() && d->filePath.mid(1,d->filePath.length()) == QLatin1String(":/")) - || isUncRoot(d->filePath)) { + if (d->filePath == QLatin1String("/") || isDriveRoot(d->filePath) || isUncRoot(d->filePath)) { ret |= RootFlag; } else if (d->fileAttrib & FILE_ATTRIBUTE_HIDDEN) { QString baseName = fileName(BaseName); -- cgit v0.12 From 2c36b1ec645991535ca974dc9e0d5ce812f0708a Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:35 +0200 Subject: don't mix calculated and forced permission bits this commit just moves closing bracket to the function end Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 2c9b977..a512bd6 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1481,25 +1481,25 @@ QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions() const //### what to do with permissions if we don't use NTFS // for now just add all permissions and what about exe missions ?? // also qt_ntfs_permission_lookup is now not set by defualt ... should it ? - ret |= QAbstractFileEngine::ReadOtherPerm | QAbstractFileEngine::ReadGroupPerm + ret |= QAbstractFileEngine::ReadOtherPerm | QAbstractFileEngine::ReadGroupPerm | QAbstractFileEngine::ReadOwnerPerm | QAbstractFileEngine::ReadUserPerm | QAbstractFileEngine::WriteUserPerm | QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteGroupPerm | QAbstractFileEngine::WriteOtherPerm; - } - if (doStat()) { - if (ret & (QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | - QAbstractFileEngine::WriteGroupPerm | QAbstractFileEngine::WriteOtherPerm)) { - if (fileAttrib & FILE_ATTRIBUTE_READONLY) - ret &= ~(QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | - QAbstractFileEngine::WriteGroupPerm | QAbstractFileEngine::WriteOtherPerm); - } + if (doStat()) { + if (ret & (QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | + QAbstractFileEngine::WriteGroupPerm | QAbstractFileEngine::WriteOtherPerm)) { + if (fileAttrib & FILE_ATTRIBUTE_READONLY) + ret &= ~(QAbstractFileEngine::WriteOwnerPerm | QAbstractFileEngine::WriteUserPerm | + QAbstractFileEngine::WriteGroupPerm | QAbstractFileEngine::WriteOtherPerm); + } - QString ext = filePath.right(4).toLower(); - if (ext == QLatin1String(".exe") || ext == QLatin1String(".com") || ext == QLatin1String(".bat") || - ext == QLatin1String(".pif") || ext == QLatin1String(".cmd") || (fileAttrib & FILE_ATTRIBUTE_DIRECTORY)) - ret |= QAbstractFileEngine::ExeOwnerPerm | QAbstractFileEngine::ExeGroupPerm | - QAbstractFileEngine::ExeOtherPerm | QAbstractFileEngine::ExeUserPerm; + QString ext = filePath.right(4).toLower(); + if (ext == QLatin1String(".exe") || ext == QLatin1String(".com") || ext == QLatin1String(".bat") || + ext == QLatin1String(".pif") || ext == QLatin1String(".cmd") || (fileAttrib & FILE_ATTRIBUTE_DIRECTORY)) + ret |= QAbstractFileEngine::ExeOwnerPerm | QAbstractFileEngine::ExeGroupPerm | + QAbstractFileEngine::ExeOtherPerm | QAbstractFileEngine::ExeUserPerm; + } } return ret; } -- cgit v0.12 From 1ff4c70e181e79456690a23a3af97cfef52c9f5e Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:37 +0200 Subject: don't mix link's target's permissions with link's Exe*Perm bits Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index a512bd6..9e341b9 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -1494,7 +1494,8 @@ QAbstractFileEngine::FileFlags QFSFileEnginePrivate::getPermissions() const QAbstractFileEngine::WriteGroupPerm | QAbstractFileEngine::WriteOtherPerm); } - QString ext = filePath.right(4).toLower(); + QString fname = filePath.endsWith(QLatin1String(".lnk")) ? readLink(filePath) : filePath; + QString ext = fname.right(4).toLower(); if (ext == QLatin1String(".exe") || ext == QLatin1String(".com") || ext == QLatin1String(".bat") || ext == QLatin1String(".pif") || ext == QLatin1String(".cmd") || (fileAttrib & FILE_ATTRIBUTE_DIRECTORY)) ret |= QAbstractFileEngine::ExeOwnerPerm | QAbstractFileEngine::ExeGroupPerm | -- cgit v0.12 From a7e9efcb96a93f23636e8bc98bb89b705a82cbf4 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:39 +0200 Subject: optimize longFileName() a bit isUncPath() is always called with native separator-ed paths, so we can avoid needless comparisons; don't declare isUncPath() under CE since it never used Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 9e341b9..a6c2c17 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -295,13 +295,14 @@ static bool isUncRoot(const QString &server) return localPath.isEmpty(); } +#if !defined(Q_OS_WINCE) static bool isUncPath(const QString &path) { - // Starts with // or \\, but not \\. or //. - return (path.startsWith(QLatin1String("//")) - || path.startsWith(QLatin1String("\\\\"))) - && (path.size() > 2 && path.at(2) != QLatin1Char('.')); + // Starts with \\, but not \\. + return (path.startsWith(QLatin1String("\\\\")) + && path.size() > 2 && path.at(2) != QLatin1Char('.')); } +#endif static bool isRelativePath(const QString &path) { @@ -398,7 +399,7 @@ QString QFSFileEnginePrivate::longFileName(const QString &path) #if !defined(Q_OS_WINCE) QString prefix = QLatin1String("\\\\?\\"); if (isUncPath(absPath)) { - prefix = QLatin1String("\\\\?\\UNC\\"); + prefix.append(QLatin1String("UNC\\")); // "\\\\?\\UNC\\" absPath.remove(0, 2); } return prefix + absPath; -- cgit v0.12 From 085d1cb57d240e5335517ccd08da699d4faeed6a Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:42 +0200 Subject: minor optimizations -in most cases GetFullPathName returns string with at least path.size() chars; -". " isn't valid path; ". " isn't valid path too...should we to pay more? Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index a6c2c17..3a5e9f4 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -349,7 +349,7 @@ static QString nativeAbsoluteFilePathCore(const QString &path) { QString ret; #if !defined(Q_OS_WINCE) - QVarLengthArray buf(MAX_PATH); + QVarLengthArray buf(qMax(MAX_PATH, path.size() + 1)); wchar_t *fileName = 0; DWORD retLen = GetFullPathName((wchar_t*)path.utf16(), buf.size(), buf.data(), &fileName); if (retLen > (DWORD)buf.size()) { @@ -375,15 +375,8 @@ static QString nativeAbsoluteFilePath(const QString &path) // (which is an invalid filename) this function will strip the space off and viola, // the file is later reported as existing. Therefore, we re-add the whitespace that // was at the end of path in order to keep the filename invalid. - int i = path.size() - 1; - while (i >= 0 && path.at(i) == QLatin1Char(' ')) --i; - int extraws = path.size() - 1 - i; - if (extraws >= 0) { - while (extraws) { - absPath.append(QLatin1Char(' ')); - --extraws; - } - } + if (!path.isEmpty() && path.at(path.size() - 1) == QLatin1Char(' ')) + absPath.append(QLatin1Char(' ')); return absPath; } -- cgit v0.12 From 7c46245633a1edfbdc1ff770a28a7d5e7a5739bf Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:44 +0200 Subject: optimize inlines in QFSFileEngine un-inline isDirPath() since it too large for this (reduce size of QtCore binary in a few kilobytes) Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_unix.cpp | 6 +++--- src/corelib/io/qfsfileengine_win.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index ff10a44..50ed46d 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE Returns the stdlib open string corresponding to a QIODevice::OpenMode. */ -static QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QString &fileName = QString()) +static inline QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QString &fileName) { QByteArray mode; if ((flags & QIODevice::ReadOnly) && !(flags & QIODevice::Truncate)) { @@ -109,7 +109,7 @@ static QByteArray openModeToFopenMode(QIODevice::OpenMode flags, const QString & Returns the stdio open flags corresponding to a QIODevice::OpenMode. */ -static int openModeToOpenFlags(QIODevice::OpenMode mode) +static inline int openModeToOpenFlags(QIODevice::OpenMode mode) { int oflags = QT_OPEN_RDONLY; #ifdef QT_LARGEFILE_SUPPORT @@ -138,7 +138,7 @@ static int openModeToOpenFlags(QIODevice::OpenMode mode) Sets the file descriptor to close on exec. That is, the file descriptor is not inherited by child processes. */ -static bool setCloseOnExec(int fd) +static inline bool setCloseOnExec(int fd) { return fd != -1 && fcntl(fd, F_SETFD, FD_CLOEXEC) != -1; } diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 3a5e9f4..e669752 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -296,7 +296,7 @@ static bool isUncRoot(const QString &server) } #if !defined(Q_OS_WINCE) -static bool isUncPath(const QString &path) +static inline bool isUncPath(const QString &path) { // Starts with \\, but not \\. return (path.startsWith(QLatin1String("\\\\")) @@ -304,7 +304,7 @@ static bool isUncPath(const QString &path) } #endif -static bool isRelativePath(const QString &path) +static inline bool isRelativePath(const QString &path) { return !(path.startsWith(QLatin1Char('/')) || (path.length() >= 2 @@ -338,7 +338,7 @@ static bool uncShareExists(const QString &server) return false; } -static bool isDriveRoot(const QString &path) +static inline bool isDriveRoot(const QString &path) { return (path.length() == 3 && path.at(0).isLetter() && path.at(1) == QLatin1Char(':') @@ -894,7 +894,7 @@ static inline bool rmDir(const QString &path) return ::RemoveDirectory((wchar_t*)QFSFileEnginePrivate::longFileName(path).utf16()); } -static inline bool isDirPath(const QString &dirPath, bool *existed) +static bool isDirPath(const QString &dirPath, bool *existed) { QString path = dirPath; if (path.length() == 2 && path.at(1) == QLatin1Char(':')) -- cgit v0.12 From 96a578afeaf2ee08db3eeea0f0250e8b08bcf9b6 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:46 +0200 Subject: merge nativeAbsoluteFilePath and nativeAbsoluteFilePathCore Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_win.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index e669752..edf65d2 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -345,9 +345,9 @@ static inline bool isDriveRoot(const QString &path) && path.at(2) == QLatin1Char('/')); } -static QString nativeAbsoluteFilePathCore(const QString &path) +static QString nativeAbsoluteFilePath(const QString &path) { - QString ret; + QString absPath; #if !defined(Q_OS_WINCE) QVarLengthArray buf(qMax(MAX_PATH, path.size() + 1)); wchar_t *fileName = 0; @@ -357,19 +357,13 @@ static QString nativeAbsoluteFilePathCore(const QString &path) retLen = GetFullPathName((wchar_t*)path.utf16(), buf.size(), buf.data(), &fileName); } if (retLen != 0) - ret = QString::fromWCharArray(buf.data(), retLen); + absPath = QString::fromWCharArray(buf.data(), retLen); #else if (path.startsWith(QLatin1Char('/')) || path.startsWith(QLatin1Char('\\'))) - ret = QDir::toNativeSeparators(path); + absPath = QDir::toNativeSeparators(path); else - ret = QDir::toNativeSeparators(QDir::cleanPath(qfsPrivateCurrentDir + QLatin1Char('/') + path)); + absPath = QDir::toNativeSeparators(QDir::cleanPath(qfsPrivateCurrentDir + QLatin1Char('/') + path)); #endif - return ret; -} - -static QString nativeAbsoluteFilePath(const QString &path) -{ - QString absPath = nativeAbsoluteFilePathCore(path); // This is really ugly, but GetFullPathName strips off whitespace at the end. // If you for instance write ". " in the lineedit of QFileDialog, // (which is an invalid filename) this function will strip the space off and viola, -- cgit v0.12 From 1693931ac92a6a7d98eb28acda371f2d7c9c6dc2 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 11 Aug 2009 18:11:48 +0200 Subject: code clean-up and style fixes remove unused includes; tabs -> whitespaces; clean extra whitespaces Merge-request: 1176 Reviewed-by: Joerg Bornemann --- src/corelib/io/qfsfileengine_iterator.cpp | 1 - src/corelib/io/qfsfileengine_iterator_p.h | 2 +- src/corelib/io/qfsfileengine_iterator_unix.cpp | 2 +- src/corelib/io/qfsfileengine_iterator_win.cpp | 12 +++----- src/corelib/io/qfsfileengine_unix.cpp | 4 +-- src/corelib/io/qfsfileengine_win.cpp | 41 +++++++++++--------------- 6 files changed, 25 insertions(+), 37 deletions(-) diff --git a/src/corelib/io/qfsfileengine_iterator.cpp b/src/corelib/io/qfsfileengine_iterator.cpp index 35b388f..52fc80d 100644 --- a/src/corelib/io/qfsfileengine_iterator.cpp +++ b/src/corelib/io/qfsfileengine_iterator.cpp @@ -79,4 +79,3 @@ QFileInfo QFSFileEngineIterator::currentFileInfo() const QT_END_NAMESPACE #endif // QT_NO_FSFILEENGINE - diff --git a/src/corelib/io/qfsfileengine_iterator_p.h b/src/corelib/io/qfsfileengine_iterator_p.h index 7829fff..342ef8d 100644 --- a/src/corelib/io/qfsfileengine_iterator_p.h +++ b/src/corelib/io/qfsfileengine_iterator_p.h @@ -89,4 +89,4 @@ QT_END_NAMESPACE #endif // QT_NO_FSFILEENGINE -#endif +#endif // QFSFILEENGINE_ITERATOR_P_H diff --git a/src/corelib/io/qfsfileengine_iterator_unix.cpp b/src/corelib/io/qfsfileengine_iterator_unix.cpp index a6c965c..107a500 100644 --- a/src/corelib/io/qfsfileengine_iterator_unix.cpp +++ b/src/corelib/io/qfsfileengine_iterator_unix.cpp @@ -56,7 +56,7 @@ public: #if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) , mt_file(0) #endif - { } + {} DIR *dir; dirent *dirEntry; diff --git a/src/corelib/io/qfsfileengine_iterator_win.cpp b/src/corelib/io/qfsfileengine_iterator_win.cpp index dd4ddf3..3d9c20e 100644 --- a/src/corelib/io/qfsfileengine_iterator_win.cpp +++ b/src/corelib/io/qfsfileengine_iterator_win.cpp @@ -39,14 +39,11 @@ ** ****************************************************************************/ -#include "qdebug.h" #include "qfsfileengine_iterator_p.h" #include "qfsfileengine_p.h" #include "qplatformdefs.h" #include -#include -#include QT_BEGIN_NAMESPACE @@ -56,7 +53,7 @@ public: inline QFSFileEngineIteratorPlatformSpecificData() : uncShareIndex(-1), findFileHandle(INVALID_HANDLE_VALUE), done(false), uncFallback(false) - { } + {} QFSFileEngineIterator *it; @@ -68,7 +65,6 @@ public: bool done; bool uncFallback; - void advance(); void saveCurrentFileName(); }; @@ -116,10 +112,10 @@ bool QFSFileEngineIterator::hasNext() const { if (platform->done) return false; - + if (platform->uncFallback) return platform->uncShareIndex > 0 && platform->uncShareIndex <= platform->uncShares.size(); - + if (platform->findFileHandle == INVALID_HANDLE_VALUE) { QString path = this->path(); // Local directory @@ -151,7 +147,7 @@ bool QFSFileEngineIterator::hasNext() const platform->done = true; } } else { - platform->done = true; + platform->done = true; } } diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index 50ed46d..7d91764 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -582,7 +582,7 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const { Q_D(const QFSFileEngine); // Force a stat, so that we're guaranteed to get up-to-date results - if (type & QAbstractFileEngine::FileFlag(QAbstractFileEngine::Refresh)) { + if (type & Refresh) { d->tried_stat = 0; d->need_lstat = 1; } @@ -777,7 +777,7 @@ QString QFSFileEngine::fileName(FileName file) const s[len] = '\0'; ret += QFile::decodeName(QByteArray(s)); #if defined(__GLIBC__) && !defined(PATH_MAX) - ::free(s); + ::free(s); #endif if (!ret.startsWith(QLatin1Char('/'))) { diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index edf65d2..0cddee3 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -47,10 +47,6 @@ #include "qfile.h" #include "qdir.h" -#include "qtemporaryfile.h" -#ifndef QT_NO_REGEXP -# include "qregexp.h" -#endif #include "private/qmutexpool_p.h" #include "qvarlengtharray.h" #include "qdatetime.h" @@ -125,7 +121,7 @@ static TRUSTEE_W currentUserTrusteeW; typedef BOOL (WINAPI *PtrOpenProcessToken)(HANDLE, DWORD, PHANDLE ); static PtrOpenProcessToken ptrOpenProcessToken = 0; -typedef BOOL (WINAPI *PtrGetUserProfileDirectoryW)( HANDLE, LPWSTR, LPDWORD); +typedef BOOL (WINAPI *PtrGetUserProfileDirectoryW)(HANDLE, LPWSTR, LPDWORD); static PtrGetUserProfileDirectoryW ptrGetUserProfileDirectoryW = 0; typedef BOOL (WINAPI *PtrSetFilePointerEx)(HANDLE, LARGE_INTEGER, PLARGE_INTEGER, DWORD); static PtrSetFilePointerEx ptrSetFilePointerEx = 0; @@ -266,7 +262,7 @@ bool QFSFileEnginePrivate::uncListSharesOnServer(const QString &server, QStringL do { res = ptrNetShareEnum((wchar_t*)server.utf16(), 1, (LPBYTE *)&BufPtr, DWORD(-1), &er, &tr, &resume); if (res == ERROR_SUCCESS || res == ERROR_MORE_DATA) { - p=BufPtr; + p = BufPtr; for (i = 1; i <= er; ++i) { if (list && p->shi1_type == 0) list->append(QString::fromWCharArray(p->shi1_netname)); @@ -276,7 +272,6 @@ bool QFSFileEnginePrivate::uncListSharesOnServer(const QString &server, QStringL ptrNetApiBufferFree(BufPtr); } while (res==ERROR_MORE_DATA); return res == ERROR_SUCCESS; - } return false; } @@ -306,10 +301,11 @@ static inline bool isUncPath(const QString &path) static inline bool isRelativePath(const QString &path) { + // drive, e.g. "a:", or UNC root, e.q. "//" return !(path.startsWith(QLatin1Char('/')) || (path.length() >= 2 && ((path.at(0).isLetter() && path.at(1) == QLatin1Char(':')) - || (path.at(0) == QLatin1Char('/') && path.at(1) == QLatin1Char('/'))))); // drive, e.g. a: + || (path.at(0) == QLatin1Char('/') && path.at(1) == QLatin1Char('/'))))); } static QString fixIfRelativeUncPath(const QString &path) @@ -328,12 +324,8 @@ static bool uncShareExists(const QString &server) QStringList parts = server.split(QLatin1Char('\\'), QString::SkipEmptyParts); if (parts.count()) { QStringList shares; - if (QFSFileEnginePrivate::uncListSharesOnServer(QLatin1String("\\\\") + parts.at(0), &shares)) { - if (parts.count() >= 2) - return shares.contains(parts.at(1), Qt::CaseInsensitive); - else - return true; - } + if (QFSFileEnginePrivate::uncListSharesOnServer(QLatin1String("\\\\") + parts.at(0), &shares)) + return parts.count() >= 2 ? shares.contains(parts.at(1), Qt::CaseInsensitive) : true; } return false; } @@ -400,8 +392,8 @@ QString QFSFileEnginePrivate::longFileName(const QString &path) */ void QFSFileEnginePrivate::nativeInitFileName() { - QString path = longFileName(QDir::toNativeSeparators(fixIfRelativeUncPath(filePath))); - nativeFilePath = QByteArray((const char *)path.utf16(), path.size() * 2 + 1); + QString path = longFileName(QDir::toNativeSeparators(fixIfRelativeUncPath(filePath))); + nativeFilePath = QByteArray((const char *)path.utf16(), path.size() * 2 + 1); } /* @@ -423,8 +415,7 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode) SECURITY_ATTRIBUTES securityAtts = { sizeof(SECURITY_ATTRIBUTES), NULL, FALSE }; // WriteOnly can create files, ReadOnly cannot. - DWORD creationDisp = (openMode & QIODevice::WriteOnly) - ? OPEN_ALWAYS : OPEN_EXISTING; + DWORD creationDisp = (openMode & QIODevice::WriteOnly) ? OPEN_ALWAYS : OPEN_EXISTING; // Create the file handle. fileHandle = CreateFile((const wchar_t*)nativeFilePath.constData(), @@ -1145,10 +1136,10 @@ QFileInfoList QFSFileEngine::drives() char driveName[] = "A:/"; while(driveBits) { - if(driveBits & 1) - ret.append(QString::fromLatin1(driveName)); - driveName[0]++; - driveBits = driveBits >> 1; + if(driveBits & 1) + ret.append(QString::fromLatin1(driveName)); + driveName[0]++; + driveBits = driveBits >> 1; } return ret; #else @@ -1501,7 +1492,7 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(QAbstractFileEngine::Fil Q_D(const QFSFileEngine); QAbstractFileEngine::FileFlags ret = 0; // Force a stat, so that we're guaranteed to get up-to-date results - if (type & QAbstractFileEngine::FileFlag(QAbstractFileEngine::Refresh)) { + if (type & Refresh) { d->tried_stat = 0; } @@ -1647,10 +1638,11 @@ QString QFSFileEngine::fileName(FileName file) const bool QFSFileEngine::isRelativePath() const { Q_D(const QFSFileEngine); + // drive, e.g. "a:", or UNC root, e.q. "//" return !(d->filePath.startsWith(QLatin1Char('/')) || (d->filePath.length() >= 2 && ((d->filePath.at(0).isLetter() && d->filePath.at(1) == QLatin1Char(':')) - || (d->filePath.at(0) == QLatin1Char('/') && d->filePath.at(1) == QLatin1Char('/'))))); // drive, e.g. a: + || (d->filePath.at(0) == QLatin1Char('/') && d->filePath.at(1) == QLatin1Char('/'))))); } uint QFSFileEngine::ownerId(FileOwner /*own*/) const @@ -1966,4 +1958,5 @@ void QFSFileEnginePrivate::mapHandleClose() } } #endif + QT_END_NAMESPACE -- cgit v0.12 From e0059d1d01a7c1d76ed86cccf8253d0ebd18f575 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 6 Apr 2009 18:28:13 +0200 Subject: Handle multi-length strings in the low-level formatting code Patch originally from Oswald on Jira QT-10, with few a modifications. If a string contains multiple variants sorted by decreasing length, separated by \x9c, it will try to paint the longest variant which fits into the bounding box. Reviewed-by: Oswald Buddenhagen Task-Number: QT-10 --- src/gui/painting/qpainter.cpp | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 8192fb7..c3fc14b 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7486,12 +7486,14 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, int *underlinePositions = underlinePositionStack; QFontMetricsF fm(fnt); - QString text = str; + int offset = 0; +start_lenghtVariant: + bool hasMoreLenghtVariants = false; // compatible behaviour to the old implementation. Replace // tabs by spaces - QChar *chr = text.data(); - const QChar *end = chr + str.length(); + QChar *chr = text.data() + offset; + QChar *end = text.data() + text.length(); bool has_tab = false; while (chr != end) { if (*chr == QLatin1Char('\r') || (singleline && *chr == QLatin1Char('\n'))) { @@ -7502,12 +7504,17 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, ++maxUnderlines; } else if (*chr == QLatin1Char('\t')) { has_tab = true; + } else if (*chr == QChar(ushort(0x9c))) { + // string with multiple length variants + end = chr; + hasMoreLenghtVariants = true; + break; } ++chr; } if (has_tab) { if (!expandtabs) { - chr = text.data(); + chr = text.data() + offset; while (chr != end) { if (*chr == QLatin1Char('\t')) *chr = QLatin1Char(' '); @@ -7518,12 +7525,13 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, } } + QChar *cout = end; if (hidemnmemonic || showmnemonic) { if (maxUnderlines > 32) underlinePositions = new int[maxUnderlines]; - QChar *cout = text.data(); + cout = text.data() + offset; QChar *cin = cout; - int l = str.length(); + int l = end - cout; while (l) { if (*cin == QLatin1Char('&')) { ++cin; @@ -7538,9 +7546,6 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, ++cin; --l; } - int newlen = cout - text.unicode(); - if (newlen != text.length()) - text.resize(newlen); } // no need to do extra work for underlines if we don't paint @@ -7551,13 +7556,12 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, qreal height = 0; qreal width = 0; - QStackTextEngine engine(text, fnt); + QString finalText = text.mid(offset, cout - (text.data() + offset)); + QStackTextEngine engine(finalText, fnt); if (option) { engine.option = *option; } - - engine.option.setTextDirection(layout_direction); if (tf & Qt::AlignJustify) engine.option.setAlignment(Qt::AlignJustify); @@ -7573,7 +7577,7 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, textLayout.setCacheEnabled(true); textLayout.engine()->underlinePositions = underlinePositions; - if (text.isEmpty()) { + if (finalText.isEmpty()) { height = fm.height(); width = 0; tf |= Qt::TextDontPrint; @@ -7638,6 +7642,10 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, } } QRectF bounds = QRectF(r.x() + xoff, r.y() + yoff, width, height); + if (hasMoreLenghtVariants && !r.contains(bounds)) { + offset = end - text.data() + 1; + goto start_lenghtVariant; + } if (brect) *brect = bounds; -- cgit v0.12 From c225767b9b50336432e39cd589637df4fe721d62 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 11 May 2009 12:45:51 +0200 Subject: Add the Qt::TextLongestVariant flag so QFontMetrics::size returns the size of the biggest string In case the strings contains multiple strings separated by \x9c Reviewed-by: Oswald Buddenhagen Task-number: QT-10 --- doc/src/classes/qnamespace.qdoc | 1 + src/corelib/global/qnamespace.h | 3 ++- src/gui/painting/qpainter.cpp | 3 ++- src/gui/text/qfontmetrics.cpp | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/src/classes/qnamespace.qdoc b/doc/src/classes/qnamespace.qdoc index 18ecd7b..5872d04 100644 --- a/doc/src/classes/qnamespace.qdoc +++ b/doc/src/classes/qnamespace.qdoc @@ -490,6 +490,7 @@ \omitvalue WordBreak \omitvalue TextForceLeftToRight \omitvalue TextForceRightToLeft + \omitvalue TextLongestVariant Always use the longest variant when computing the size of a multi-variant string You can use as many modifier flags as you want, except that Qt::TextSingleLine and Qt::TextWordWrap cannot be combined. diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index f172d77..4024fce 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -233,7 +233,8 @@ public: TextHideMnemonic = 0x8000, TextJustificationForced = 0x10000, TextForceLeftToRight = 0x20000, - TextForceRightToLeft = 0x40000 + TextForceRightToLeft = 0x40000, + TextLongestVariant = 0x80000 #if defined(QT3_SUPPORT) && !defined(Q_MOC_RUN) ,SingleLine = TextSingleLine, diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index c3fc14b..4d9b43a 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7642,7 +7642,8 @@ start_lenghtVariant: } } QRectF bounds = QRectF(r.x() + xoff, r.y() + yoff, width, height); - if (hasMoreLenghtVariants && !r.contains(bounds)) { + + if (hasMoreLenghtVariants && !(tf & Qt::TextLongestVariant) && !r.contains(bounds)) { offset = end - text.data() + 1; goto start_lenghtVariant; } diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 012c0f6..47d3864 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -798,7 +798,7 @@ QRect QFontMetrics::boundingRect(const QRect &rect, int flags, const QString &te */ QSize QFontMetrics::size(int flags, const QString &text, int tabStops, int *tabArray) const { - return boundingRect(QRect(0,0,0,0), flags, text, tabStops, tabArray).size(); + return boundingRect(QRect(0,0,0,0), flags | Qt::TextLongestVariant, text, tabStops, tabArray).size(); } /*! -- cgit v0.12 From caebd2676dda37fb7ab11c3b994fd341f88b0de0 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 11 May 2009 12:46:58 +0200 Subject: Make QFontMetrics::elidedText aware of multi-length strings Reviewed-by: Oswald Buddenhagen Task-number: QT-10 --- src/gui/text/qfontmetrics.cpp | 17 ++++++++++++++-- tests/auto/qfontmetrics/tst_qfontmetrics.cpp | 30 +++++++++++++++++++++++++--- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 47d3864..5c5320f 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -859,8 +859,21 @@ QRect QFontMetrics::tightBoundingRect(const QString &text) const language. */ -QString QFontMetrics::elidedText(const QString &text, Qt::TextElideMode mode, int width, int flags) const -{ +QString QFontMetrics::elidedText(const QString &_text, Qt::TextElideMode mode, int width, int flags) const +{ + QString text = _text; + if (!(flags & Qt::TextLongestVariant)) { + int posA = 0; + int posB = text.indexOf(QLatin1Char('\x9c')); + while (posB >= 0) { + QString portion = text.mid(posA, posB - posA); + if (size(flags, portion).width() <= width) + return portion; + posA = posB + 1; + posB = text.indexOf(QLatin1Char('\x9c'), posA); + } + text = text.mid(posA); + } QStackTextEngine engine(text, QFont(d)); return engine.elidedText(mode, width, flags); } diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp index 5658055..cae1126 100644 --- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp +++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp @@ -71,6 +71,7 @@ private slots: void elidedText(); void veryNarrowElidedText(); void averageCharWidth(); + void elidedMultiLenght(); }; tst_QFontMetrics::tst_QFontMetrics() @@ -168,7 +169,8 @@ void tst_QFontMetrics::elidedText_data() QTest::addColumn("font"); QTest::addColumn("text"); - QTest::newRow("helvetica hello") << QFont("helvetica",10) << QString("hello"); + QTest::newRow("helvetica hello") << QFont("helvetica",10) << QString("hello") ; + QTest::newRow("helvetica hello &Bye") << QFont("helvetica",10) << QString("hello&Bye") ; } @@ -178,9 +180,9 @@ void tst_QFontMetrics::elidedText() QFETCH(QString, text); QFontMetrics fm(font); int w = fm.width(text); - QString newtext = fm.elidedText(text,Qt::ElideRight,w); + QString newtext = fm.elidedText(text,Qt::ElideRight,w, 0); QCOMPARE(text,newtext); // should not elide - newtext = fm.elidedText(text,Qt::ElideRight,w-1); + newtext = fm.elidedText(text,Qt::ElideRight,w-1, 0); QVERIFY(text != newtext); // should elide } @@ -201,5 +203,27 @@ void tst_QFontMetrics::averageCharWidth() QVERIFY(fmf.averageCharWidth() != 0); } +void tst_QFontMetrics::elidedMultiLenght() +{ + QString text1 = "Long Text 1\x9cShorter\x9csmall"; + QString text1_long = "Long Text 1"; + QString text1_short = "Shorter"; + QString text1_small = "small"; + QFontMetrics fm = QFontMetrics(QFont()); + int width_long = fm.width(text1_long); + QCOMPARE(fm.elidedText(text1,Qt::ElideRight, 8000), text1_long); + QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long), text1_long); + QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_long - 1), text1_short); + int width_short = fm.width(text1_short); + QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short), text1_short); + QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short - 1), text1_small); + + QChar ellipsisChar(0x2026); + QString text1_el = QString::fromLatin1("sm") + ellipsisChar; + int width_small = fm.width(text1_el); + QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_small + 1), text1_el); + +} + QTEST_MAIN(tst_QFontMetrics) #include "tst_qfontmetrics.moc" -- cgit v0.12 From 60ca03709c7e9845b997520dab70ac1ac76787dd Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 20 Apr 2009 12:51:57 +0200 Subject: Change QFontMetrics::width to return the width of the longest variant if the string is a multi-length one Task-number: QT-10 Reviewed-by: Oswald Buddenhagen --- src/gui/text/qfontmetrics.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 5c5320f..4229d5b 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -528,12 +528,14 @@ int QFontMetrics::rightBearing(QChar ch) const */ int QFontMetrics::width(const QString &text, int len) const { + int pos = text.indexOf(QLatin1Char('\x9c')); + QString txt = (pos == -1) ? text : text.left(pos); if (len < 0) - len = text.length(); + len = txt.length(); if (len == 0) return 0; - QTextEngine layout(text, d); + QTextEngine layout(txt, d); layout.ignoreBidi = true; return qRound(layout.width(0, len)); } -- cgit v0.12 From 5c4c47facfcb75b0277872a0fac813ab41700e5e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 11 Aug 2009 19:12:07 +0200 Subject: Optimize qt_format_text test operations: try not to detach Reviewed-by: Oswald Buddenhagen --- src/gui/painting/qpainter.cpp | 68 ++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 4d9b43a..cd4ea86 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7480,10 +7480,9 @@ void qt_format_text(const QFont &fnt, const QRectF &_r, if (!painter) tf |= Qt::TextDontPrint; - int maxUnderlines = 0; + uint maxUnderlines = 0; int numUnderlines = 0; - int underlinePositionStack[32]; - int *underlinePositions = underlinePositionStack; + QVarLengthArray underlinePositions(1); QFontMetricsF fm(fnt); QString text = str; @@ -7492,54 +7491,46 @@ start_lenghtVariant: bool hasMoreLenghtVariants = false; // compatible behaviour to the old implementation. Replace // tabs by spaces - QChar *chr = text.data() + offset; - QChar *end = text.data() + text.length(); bool has_tab = false; - while (chr != end) { - if (*chr == QLatin1Char('\r') || (singleline && *chr == QLatin1Char('\n'))) { - *chr = QLatin1Char(' '); - } else if (*chr == QLatin1Char('\n')) { - *chr = QChar::LineSeparator; - } else if (*chr == QLatin1Char('&')) { + int old_offset = offset; + for (; offset < text.length(); offset++) { + QChar chr = text.at(offset); + if (chr == QLatin1Char('\r') || (singleline && chr == QLatin1Char('\n'))) { + text[offset] = QLatin1Char(' '); + } else if (chr == QLatin1Char('\n')) { + chr = QChar::LineSeparator; + } else if (chr == QLatin1Char('&')) { ++maxUnderlines; - } else if (*chr == QLatin1Char('\t')) { + } else if (chr == QLatin1Char('\t')) { + if (!expandtabs) { + text[offset] = QLatin1Char(' '); + } else if (!tabarraylen && !tabstops) { + tabstops = qRound(fm.width(QLatin1Char('x'))*8); + } has_tab = true; - } else if (*chr == QChar(ushort(0x9c))) { + } else if (chr == QChar(ushort(0x9c))) { // string with multiple length variants - end = chr; hasMoreLenghtVariants = true; break; } - ++chr; - } - if (has_tab) { - if (!expandtabs) { - chr = text.data() + offset; - while (chr != end) { - if (*chr == QLatin1Char('\t')) - *chr = QLatin1Char(' '); - ++chr; - } - } else if (!tabarraylen && !tabstops) { - tabstops = qRound(fm.width(QLatin1Char('x'))*8); - } } - QChar *cout = end; - if (hidemnmemonic || showmnemonic) { - if (maxUnderlines > 32) - underlinePositions = new int[maxUnderlines]; - cout = text.data() + offset; + int length = offset - old_offset; + if ((hidemnmemonic || showmnemonic) && maxUnderlines > 0) { + underlinePositions.resize(maxUnderlines + 1); + + QChar *cout = text.data() + old_offset; QChar *cin = cout; - int l = end - cout; + int l = length; while (l) { if (*cin == QLatin1Char('&')) { ++cin; + --length; --l; if (!l) break; if (*cin != QLatin1Char('&') && !hidemnmemonic) - underlinePositions[numUnderlines++] = cout - text.unicode(); + underlinePositions[numUnderlines++] = cout - text.data() - old_offset; } *cout = *cin; ++cout; @@ -7556,7 +7547,7 @@ start_lenghtVariant: qreal height = 0; qreal width = 0; - QString finalText = text.mid(offset, cout - (text.data() + offset)); + QString finalText = text.mid(old_offset, length); QStackTextEngine engine(finalText, fnt); if (option) { engine.option = *option; @@ -7575,7 +7566,7 @@ start_lenghtVariant: engine.forceJustification = true; QTextLayout textLayout(&engine); textLayout.setCacheEnabled(true); - textLayout.engine()->underlinePositions = underlinePositions; + textLayout.engine()->underlinePositions = underlinePositions.data(); if (finalText.isEmpty()) { height = fm.height(); @@ -7644,7 +7635,7 @@ start_lenghtVariant: QRectF bounds = QRectF(r.x() + xoff, r.y() + yoff, width, height); if (hasMoreLenghtVariants && !(tf & Qt::TextLongestVariant) && !r.contains(bounds)) { - offset = end - text.data() + 1; + offset++; goto start_lenghtVariant; } if (brect) @@ -7673,9 +7664,6 @@ start_lenghtVariant: painter->restore(); } } - - if (underlinePositions != underlinePositionStack) - delete [] underlinePositions; } /*! -- cgit v0.12 From 9605898c99490c9ad2b8cc1eb367d5531a18d1e3 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 11 Aug 2009 20:30:16 +0200 Subject: Doc: Fixed code snippets in QReadLocker and QWriteLocker documentation. Reviewed-by: Trust Me --- doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp b/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp index f0f4935..dd4f533 100644 --- a/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp +++ b/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp @@ -38,9 +38,9 @@ QReadWriteLock lock; QByteArray readData() { - locker.lockForRead(); + lock.lockForRead(); ... - locker.unlock(); + lock.unlock(); return data; } //! [2] @@ -62,8 +62,8 @@ QReadWriteLock lock; void writeData(const QByteArray &data) { - locker.lockForWrite(); + lock.lockForWrite(); ... - locker.unlock(); + lock.unlock(); } //! [4] -- cgit v0.12 From 4d2436df6e4af090158adaa916dedf7ee5f757f0 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 11 Aug 2009 21:02:29 +0200 Subject: Update the css_borderimage test to test the menubar as well The menu bar is currently broken with border-image, fix is about to be commited Task-number: 230363 --- .../baseline/css_borderimage_allwidgets.ui | 399 +++++++++++---------- 1 file changed, 218 insertions(+), 181 deletions(-) diff --git a/tests/auto/uiloader/baseline/css_borderimage_allwidgets.ui b/tests/auto/uiloader/baseline/css_borderimage_allwidgets.ui index baba66b..0ece79a 100644 --- a/tests/auto/uiloader/baseline/css_borderimage_allwidgets.ui +++ b/tests/auto/uiloader/baseline/css_borderimage_allwidgets.ui @@ -1,209 +1,246 @@ - Form - + MainWindow + 0 0 - 553 - 368 + 606 + 388 - Form + MainWindow * { border-image: url("images/pushbutton.png") 6 6 6 6; border-width:6px; } - - - - - - - - - - Each widget should have a background image. including the top level - - - true - - - - - - - PushButton - - - - - - - 24 - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - PushButton - - - - - - - - - - RadioButton - - - - - - - true - - - - - 0 - 0 - 260 - 197 - + + + + + + + + + + + Each widget should have a background image. including the top level + + + true - - - - - Qt::Horizontal - - - - - - - - - - RadioButton - - - - - - - RadioButton - - - - - - - CheckBox - - - - - - - CheckBox - - - - - - - - - - - - - GroupBox - - - - - - CheckBox - - - - - - - Line Edit - - - - - - + + + - New Item + PushButton + + + + + + + 24 + + + + + + + Qt::Vertical + + + + 20 + 40 + - - + + + + + + + + + + - New Item + PushButton - - + + + + + + + - New Item + RadioButton + + + + + + + true - - + + + + 0 + 0 + 260 + 197 + + + + + + + Qt::Horizontal + + + + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + CheckBox + + + + + + + CheckBox + + + + + + + + + + + + + + GroupBox + + + + - New Item + CheckBox - - + + + + - New Item + Line Edit - - - - - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - + + + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + New Item + + + + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + 0 + 0 + 606 + 36 + + + + + File + + + + + + + Edit + + + + + + + + + Open + + + + + Close + + -- cgit v0.12 From b564809ddc3d894b31eff58833e4b71f9e7ae7a2 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 11 Aug 2009 21:02:51 +0200 Subject: QMenuBar does not respect the border-image stylesheet property Added WA_StyledBackground to QMenuBar when using style sheets. This also implies that CE_PanelMenuBar (drawing only the menubar border) no longer needs to be drawn. Tested in uiloader/baselne/css_borderimage_allwidgets.ui. Task-number: 230363 Reviewed-by: olivier --- src/gui/styles/qstylesheetstyle.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 5f6d4ab..7523883 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -2734,6 +2734,9 @@ void QStyleSheetStyle::polish(QWidget *w) #ifndef QT_NO_MDIAREA || qobject_cast(w) #endif +#ifndef QT_NO_MENUBAR + || qobject_cast(w) +#endif || qobject_cast(w)) { w->setAttribute(Qt::WA_StyledBackground, true); } @@ -3456,6 +3459,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q case CE_MenuEmptyArea: case CE_MenuBarEmptyArea: if (rule.hasDrawable()) { + // Drawn by PE_Widget return; } break; @@ -3606,6 +3610,11 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q subRule.drawRule(p, opt->rect); QCommonStyle::drawControl(ce, &mi, p, w); } else { + if (rule.hasDrawable() && !(opt->state & QStyle::State_Selected)) { + // So that the menu bar background is not hidden by the items + mi.palette.setColor(QPalette::Window, Qt::transparent); + mi.palette.setColor(QPalette::Button, Qt::transparent); + } baseStyle()->drawControl(ce, &mi, p, w); } } @@ -4189,7 +4198,6 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op #endif //fall tghought case PE_PanelMenu: - case PE_PanelMenuBar: case PE_PanelStatusBar: if(rule.hasDrawable()) { rule.drawRule(p, opt->rect); @@ -4197,6 +4205,13 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op } break; + case PE_PanelMenuBar: + if (rule.hasDrawable()) { + // Drawn by PE_Widget + return; + } + break; + case PE_IndicatorToolBarSeparator: case PE_IndicatorToolBarHandle: { PseudoElement ps = pe == PE_IndicatorToolBarHandle ? PseudoElement_ToolBarHandle : PseudoElement_ToolBarSeparator; -- cgit v0.12 From 84ff44e7ecf9ef28ebedfedf170ec45fe0cb9ffd Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 12 Aug 2009 12:45:52 +1000 Subject: Update stale license headers. Reviewed-by: Trust Me --- tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp | 41 ++++++++++++++++++---- tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h | 41 ++++++++++++++++++---- .../xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp | 41 ++++++++++++++++++---- .../auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.h | 41 ++++++++++++++++++---- 4 files changed, 140 insertions(+), 24 deletions(-) diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp b/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp index b19eb91..b18e4f7 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp +++ b/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.cpp @@ -1,14 +1,43 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Patternist project on Trolltech Labs. +** This file is part of the autotests of the Qt Toolkit. ** -** $TROLLTECH_GPL_LICENSE$ +** $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 either Technology Preview License Agreement or the +** Beta Release License Agreement. ** -*************************************************************************** -*/ +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include #include diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h b/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h index ce84988..30b5a02 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h +++ b/tests/auto/xmlpatternsxqts/lib/XSDTSTestCase.h @@ -1,14 +1,43 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Patternist project on Trolltech Labs. +** This file is part of the autotests of the Qt Toolkit. ** -** $TROLLTECH_GPL_LICENSE$ +** $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 either Technology Preview License Agreement or the +** Beta Release License Agreement. ** -*************************************************************************** -*/ +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #ifndef PatternistSDK_XSDTSTestCase_H #define PatternistSDK_XSDTSTestCase_H diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp b/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp index b6ee379..a0e30a0 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp +++ b/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.cpp @@ -1,14 +1,43 @@ /**************************************************************************** ** -** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Patternist project on Trolltech Labs. +** This file is part of the autotests of the Qt Toolkit. ** -** $TROLLTECH_GPL_LICENSE$ +** $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 either Technology Preview License Agreement or the +** Beta Release License Agreement. ** -*************************************************************************** -*/ +** 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.0, 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 are unsure which license is appropriate for your use, please +** contact the sales department at http://qt.nokia.com/contact. +** $QT_END_LICENSE$ +** +****************************************************************************/ #include diff --git a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.h b/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandler.h index 8c57e82..7b039f4 100644 --- a/tests/auto/xmlpatternsxqts/lib/XSDTestSuiteHandle