summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-16 12:16:23 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-16 12:16:23 (GMT)
commit714a62490fd30986dc86559e6f14194a34b3a5bc (patch)
treec5c189fb22eb2f20a6cf70c176f02dd348c83610
parentaa1120804708c44ac72e20e228d5ef383a1cd62a (diff)
parentc41591d57377cd7c520efc93d9c087ad34d2bb6f (diff)
downloadQt-714a62490fd30986dc86559e6f14194a34b3a5bc.zip
Qt-714a62490fd30986dc86559e6f14194a34b3a5bc.tar.gz
Qt-714a62490fd30986dc86559e6f14194a34b3a5bc.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Conflicts: doc/src/qnamespace.qdoc doc/src/snippets/code/src_gui_qproxystyle.cpp src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebKit/qt/ChangeLog src/gui/graphicsview/qgraphicsscene.cpp src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication_x11.cpp src/gui/kernel/qt_x11_p.h src/gui/kernel/qwidget.cpp src/gui/styles/qproxystyle.cpp src/gui/styles/qstyle.cpp src/scripttools/debugging/qscriptdebugger.cpp src/scripttools/debugging/qscriptenginedebugger.cpp src/sql/drivers/odbc/qsql_odbc.cpp src/sql/kernel/qsqldatabase.cpp src/sql/kernel/qsqldriver.cpp
-rw-r--r--doc/src/introtodbus.qdoc2
-rw-r--r--doc/src/snippets/code/src_gui_qproxystyle.cpp32
-rw-r--r--src/3rdparty/webkit/VERSION4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog21
-rw-r--r--src/corelib/io/qabstractfileengine.cpp2
-rw-r--r--src/corelib/io/qabstractfileengine.h3
-rw-r--r--src/corelib/io/qdiriterator.cpp117
-rw-r--r--src/corelib/io/qfileinfo.cpp7
-rw-r--r--src/corelib/io/qfileinfo_p.h5
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp44
-rw-r--r--src/gui/kernel/qapplication.cpp2
-rw-r--r--src/gui/kernel/qapplication_x11.cpp17
-rw-r--r--src/gui/kernel/qt_x11_p.h2
-rw-r--r--src/gui/kernel/qwidget.cpp4
-rw-r--r--src/gui/math3d/qgenericmatrix.cpp2
-rw-r--r--src/gui/painting/qmatrix.cpp11
-rw-r--r--src/gui/painting/qmatrix.h11
-rw-r--r--src/gui/painting/qregion.cpp4
-rw-r--r--src/gui/painting/qtransform.cpp25
-rw-r--r--src/gui/painting/qtransform.h14
-rw-r--r--src/gui/styles/qproxystyle.cpp144
-rw-r--r--src/gui/styles/qstyle.cpp32
-rw-r--r--src/gui/widgets/qmenu_mac.mm59
-rw-r--r--src/gui/widgets/qmenu_p.h5
-rw-r--r--src/gui/widgets/qplaintextedit.cpp1
-rw-r--r--src/gui/widgets/qtextedit.cpp1
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp14
-rw-r--r--src/opengl/qgl_x11.cpp12
-rw-r--r--src/opengl/qgraphicssystem_gl.cpp1
-rw-r--r--src/opengl/qpixmapdata_gl.cpp3
-rw-r--r--src/opengl/qwindowsurface_gl.cpp12
-rw-r--r--src/scripttools/debugging/qscriptdebugger.cpp41
-rw-r--r--src/scripttools/debugging/qscriptdebugger_p.h5
-rw-r--r--src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp16
-rw-r--r--src/scripttools/debugging/qscriptenginedebugger.cpp43
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp16
-rw-r--r--src/sql/kernel/qsqldatabase.cpp11
-rw-r--r--src/sql/kernel/qsqldriver.cpp9
-rw-r--r--tests/auto/qscriptable/tst_qscriptable.cpp18
-rw-r--r--tests/auto/qscriptcontext/tst_qscriptcontext.cpp18
-rw-r--r--tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp20
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp128
-rw-r--r--tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp14
-rw-r--r--tests/auto/qscriptqobject/tst_qscriptqobject.cpp16
-rw-r--r--tests/auto/qscriptvalue/tst_qscriptvalue.cpp34
-rw-r--r--tests/auto/qtransform/tst_qtransform.cpp2
-rw-r--r--tests/benchmarks/qdir/qdir.pro8
-rw-r--r--tests/benchmarks/qdir/tst_qdir.cpp98
-rw-r--r--tools/linguist/linguist/globals.cpp55
-rw-r--r--tools/linguist/linguist/globals.h50
-rw-r--r--tools/linguist/linguist/linguist.pro2
-rw-r--r--tools/linguist/linguist/main.cpp5
-rw-r--r--tools/linguist/linguist/mainwindow.cpp46
-rw-r--r--tools/linguist/linguist/mainwindow.h2
-rw-r--r--tools/linguist/linguist/messageeditor.cpp216
-rw-r--r--tools/linguist/linguist/messageeditor.h27
-rw-r--r--tools/linguist/linguist/messageeditorwidgets.cpp19
-rw-r--r--tools/linguist/linguist/messageeditorwidgets.h8
-rw-r--r--tools/linguist/linguist/phraseview.cpp3
-rw-r--r--tools/linguist/linguist/recentfiles.cpp5
-rw-r--r--tools/linguist/lupdate/cpp.cpp4
-rw-r--r--tools/linguist/shared/qph.cpp22
-rw-r--r--translations/assistant_adp_de.ts34
-rw-r--r--translations/assistant_de.ts34
-rw-r--r--translations/designer_de.ts16
-rw-r--r--translations/linguist_de.ts90
-rw-r--r--translations/qt_de.ts16
-rw-r--r--translations/qt_help_de.ts88
68 files changed, 1266 insertions, 586 deletions
diff --git a/doc/src/introtodbus.qdoc b/doc/src/introtodbus.qdoc
index 1edc6eb..1cd874c 100644
--- a/doc/src/introtodbus.qdoc
+++ b/doc/src/introtodbus.qdoc
@@ -207,7 +207,7 @@
This feature can be enabled on a per-application basis by setting the
\c QDBUS_DEBUG environment variable before running each application.
For example, we can enable debugging only for the car in the
- \l{Remote Controlled Car Example} by running the controller and the
+ \l{D-Bus Remote Controlled Car Example} by running the controller and the
car in the following way:
\snippet doc/src/snippets/code/doc_src_introtodbus.qdoc QDBUS_DEBUG
diff --git a/doc/src/snippets/code/src_gui_qproxystyle.cpp b/doc/src/snippets/code/src_gui_qproxystyle.cpp
index 7633160..46a2a5f 100644
--- a/doc/src/snippets/code/src_gui_qproxystyle.cpp
+++ b/doc/src/snippets/code/src_gui_qproxystyle.cpp
@@ -3,7 +3,7 @@ class MyProxyStyle : public QProxyStyle
{
public:
- int styleHint(StyleHint hint, const QStyleOption *option = 0,
+ int styleHint(StyleHint hint, const QStyleOption *option = 0,
const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const
{
if (hint == QStyle::SH_UnderlineShortcut)
@@ -13,3 +13,33 @@ public:
};
//! [0]
+
+//! [1]
+#include "textedit.h"
+#include <QApplication>
+#include <QProxyStyle>
+
+class MyProxyStyle : public QProxyStyle
+{
+ public:
+ int styleHint(StyleHint hint, const QStyleOption *option = 0,
+ const QWidget *widget = 0, QStyleHintReturn *returnData = 0) const
+ {
+ if (hint == QStyle::SH_UnderlineShortcut)
+ return 0;
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+};
+
+int main(int argc, char **argv)
+{
+ Q_INIT_RESOURCE(textedit);
+
+ QApplication a(argc, argv);
+ a.setStyle(new MyProxyStyle);
+ TextEdit mw;
+ mw.resize(700, 800);
+ mw.show();
+ //...
+}
+//! [1]
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index a0f039b..f3e81c1 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -4,8 +4,8 @@ This is a snapshot of the Qt port of WebKit from
The commit imported was from the
- qtwebkit-4.6-snapshot-15062009 branch/tag
+ origin/qtwebkit-4.6-staging branch/tag
and has the sha1 checksum
- 65232bf00dc494ebfd978f998c88f58d18ecce1e
+ 751940f0f1fb2599250632d7f0a3ead3930466af
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index f3bac73..8d50ddd 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,24 @@
+2009-06-16 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Fixed QWebPage::forwardUnsupportedContent documentation and added
+ more information about Web plugins.
+
+ * Api/qwebpage.cpp:
+ * Api/qwebsettings.cpp:
+ * docs/qtwebkit.qdoc:
+
+2009-06-16 Morten Engvoldsen <morten.engvoldsen@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ Clearifying QWebFrame docs
+
+ Adding docs to toHtml() and toPlainText()
+
+ * Api/qwebframe.cpp:
+
2009-06-10 Antonio Gomes <antonio.gomes@openbossa.org>
Reviewed by Ariya Hidayat.
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index bedc121..379c932 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -252,6 +252,8 @@ QAbstractFileEngine *QAbstractFileEngine::create(const QString &fileName)
\value CanonicalPathName Same as CanonicalName, excluding the base name.
\value BundleName Returns the name of the bundle implies BundleType is set.
+ \omitvalue NFileNames
+
\sa fileName(), setFileName()
*/
diff --git a/src/corelib/io/qabstractfileengine.h b/src/corelib/io/qabstractfileengine.h
index d742467..f60a5eb 100644
--- a/src/corelib/io/qabstractfileengine.h
+++ b/src/corelib/io/qabstractfileengine.h
@@ -100,7 +100,8 @@ public:
LinkName,
CanonicalName,
CanonicalPathName,
- BundleName
+ BundleName,
+ NFileNames = 9
};
enum FileOwner {
OwnerUser,
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 81bfb27..ac08e7b 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -110,7 +110,7 @@ public:
QDir::Filters filters);
void advance();
bool shouldFollowDirectory(const QFileInfo &);
- bool matchesFilters(const QAbstractFileEngineIterator *it) const;
+ bool matchesFilters(const QString &fileName, const QFileInfo &fi) const;
QSet<QString> visitedLinks;
QAbstractFileEngine *engine;
@@ -135,14 +135,13 @@ public:
*/
QDirIteratorPrivate::QDirIteratorPrivate(const QString &path, const QStringList &nameFilters,
QDir::Filters filters, QDirIterator::IteratorFlags flags)
- : engine(0), path(path), iteratorFlags(flags), followNextDir(false), first(true), done(false)
+ : engine(0), path(path), nextFileInfo(path), iteratorFlags(flags), followNextDir(false), first(true), done(false)
{
if (filters == QDir::NoFilter)
filters = QDir::AllEntries;
this->filters = filters;
this->nameFilters = nameFilters;
- nextFileInfo.setFile(path);
pushSubDirectory(nextFileInfo.isSymLink() ? nextFileInfo.canonicalFilePath() : path,
nameFilters, filters);
}
@@ -214,23 +213,23 @@ void QDirIteratorPrivate::advance()
bool foundDirectory = false;
while (it->hasNext()) {
it->next();
- if (matchesFilters(it)) {
+ const QFileInfo info = it->currentFileInfo();
+ if (matchesFilters(it->currentFileName(), info)) {
currentFileInfo = nextFileInfo;
- nextFileInfo = it->currentFileInfo();
+ nextFileInfo = info;
// Signal that we want to follow this entry.
followNextDir = shouldFollowDirectory(nextFileInfo);
//We found a matching entry.
return;
} else if (iteratorFlags & QDirIterator::Subdirectories) {
- QFileInfo fileInfo = it->currentFileInfo();
- if (!shouldFollowDirectory(fileInfo))
+ if (!shouldFollowDirectory(info))
continue;
QString subDir = it->currentFilePath();
#ifdef Q_OS_WIN
- if (fileInfo.isSymLink())
- subDir = fileInfo.canonicalFilePath();
+ if (info.isSymLink())
+ subDir = info.canonicalFilePath();
#endif
pushSubDirectory(subDir, it->nameFilters(), it->filters());
@@ -288,48 +287,32 @@ bool QDirIteratorPrivate::shouldFollowDirectory(const QFileInfo &fileInfo)
current entry will be returned as part of the directory iteration);
otherwise, false is returned.
*/
-bool QDirIteratorPrivate::matchesFilters(const QAbstractFileEngineIterator *it) const
+bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInfo &fi) const
{
- const bool filterPermissions = ((filters & QDir::PermissionMask)
- && (filters & QDir::PermissionMask) != QDir::PermissionMask);
- const bool skipDirs = !(filters & (QDir::Dirs | QDir::AllDirs));
- const bool skipFiles = !(filters & QDir::Files);
- const bool skipSymlinks = (filters & QDir::NoSymLinks);
- const bool doReadable = !filterPermissions || (filters & QDir::Readable);
- const bool doWritable = !filterPermissions || (filters & QDir::Writable);
- const bool doExecutable = !filterPermissions || (filters & QDir::Executable);
- const bool includeHidden = (filters & QDir::Hidden);
- const bool includeSystem = (filters & QDir::System);
-
-#ifndef QT_NO_REGEXP
- // Prepare name filters
- QList<QRegExp> regexps;
- bool hasNameFilters = !nameFilters.isEmpty() && !(nameFilters.contains(QLatin1String("*")));
- if (hasNameFilters) {
- for (int i = 0; i < nameFilters.size(); ++i) {
- regexps << QRegExp(nameFilters.at(i),
- (filters & QDir::CaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive,
- QRegExp::Wildcard);
- }
- }
-#endif
-
- QString fileName = it->currentFileName();
if (fileName.isEmpty()) {
// invalid entry
return false;
}
- QFileInfo fi = it->currentFileInfo();
- QString filePath = it->currentFilePath();
+ // filter . and ..?
+ const int fileNameSize = fileName.size();
+ const bool dotOrDotDot = fileName[0] == QLatin1Char('.')
+ && ((fileNameSize == 1)
+ ||(fileNameSize == 2 && fileName[1] == QLatin1Char('.')));
+ if ((filters & QDir::NoDotAndDotDot) && dotOrDotDot)
+ return false;
-#ifndef QT_NO_REGEXP
+ // name filter
+#ifndef QT_NO_REGEXP
+ const bool hasNameFilters = !nameFilters.isEmpty() && !(nameFilters.contains(QLatin1String("*")));
// Pass all entries through name filters, except dirs if the AllDirs
- // filter is passed.
if (hasNameFilters && !((filters & QDir::AllDirs) && fi.isDir())) {
bool matched = false;
- for (int i = 0; i < regexps.size(); ++i) {
- if (regexps.at(i).exactMatch(fileName)) {
+ for (int i = 0; i < nameFilters.size(); ++i) {
+ QRegExp regexp(nameFilters.at(i),
+ (filters & QDir::CaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive,
+ QRegExp::Wildcard);
+ if (regexp.exactMatch(fileName)) {
matched = true;
break;
}
@@ -338,47 +321,53 @@ bool QDirIteratorPrivate::matchesFilters(const QAbstractFileEngineIterator *it)
return false;
}
#endif
-
- bool dotOrDotDot = (fileName == QLatin1String(".") || fileName == QLatin1String(".."));
- if ((filters & QDir::NoDotAndDotDot) && dotOrDotDot)
- return false;
- bool isHidden = !dotOrDotDot && fi.isHidden();
- if (!includeHidden && isHidden)
+ // filter hidden
+ const bool includeHidden = (filters & QDir::Hidden);
+ if (!includeHidden && !dotOrDotDot && fi.isHidden())
return false;
- bool isSystem = (!fi.isFile() && !fi.isDir() && !fi.isSymLink())
- || (!fi.exists() && fi.isSymLink());
- if (!includeSystem && isSystem)
+ // filter system files
+ const bool includeSystem = (filters & QDir::System);
+ if (!includeSystem && ((!fi.isFile() && !fi.isDir() && !fi.isSymLink())
+ || (!fi.exists() && fi.isSymLink())))
return false;
- bool alwaysShow = (filters & QDir::TypeMask) == 0
- && ((isHidden && includeHidden)
- || (includeSystem && isSystem));
- // Skip files and directories
- if ((filters & QDir::AllDirs) == 0 && skipDirs && fi.isDir()) {
- if (!alwaysShow)
+ if (!includeSystem && !dotOrDotDot && ((fi.exists() && !fi.isFile() && !fi.isDir() && !fi.isSymLink())
+ || (!fi.exists() && fi.isSymLink()))) {
+ return false;
+ }
+
+ // skip directories
+ const bool skipDirs = !(filters & (QDir::Dirs | QDir::AllDirs));
+ if (skipDirs && fi.isDir()) {
+ if (!(includeHidden && !dotOrDotDot && fi.isHidden())
+ || (includeSystem && !fi.exists() && fi.isSymLink()))
return false;
}
- if ((skipFiles && (fi.isFile() || !fi.exists()))
- || (skipSymlinks && fi.isSymLink())) {
- if (!alwaysShow)
+ // skip files
+ const bool skipFiles = !(filters & QDir::Files);
+ const bool skipSymlinks = (filters & QDir::NoSymLinks);
+ if ((skipFiles && (fi.isFile() || !fi.exists())) || (skipSymlinks && fi.isSymLink())) {
+ if (!((includeHidden && !dotOrDotDot && fi.isHidden())
+ || (includeSystem && !fi.exists() && fi.isSymLink())))
return false;
}
+ // filter permissions
+ const bool filterPermissions = ((filters & QDir::PermissionMask)
+ && (filters & QDir::PermissionMask) != QDir::PermissionMask);
+ const bool doWritable = !filterPermissions || (filters & QDir::Writable);
+ const bool doExecutable = !filterPermissions || (filters & QDir::Executable);
+ const bool doReadable = !filterPermissions || (filters & QDir::Readable);
if (filterPermissions
&& ((doReadable && !fi.isReadable())
|| (doWritable && !fi.isWritable())
|| (doExecutable && !fi.isExecutable()))) {
return false;
}
-
- if (!includeSystem && !dotOrDotDot && ((fi.exists() && !fi.isFile() && !fi.isDir() && !fi.isSymLink())
- || (!fi.exists() && fi.isSymLink()))) {
- return false;
- }
return true;
}
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 4f1b943..3442a1e 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -59,7 +59,6 @@ QFileInfoPrivate::QFileInfoPrivate(const QFileInfo *copy)
data = copy->d_func()->data;
} else {
data = new QFileInfoPrivate::Data;
- data->clear();
}
}
@@ -134,11 +133,11 @@ void QFileInfoPrivate::detach()
QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const
{
- if(data->cache_enabled && data->fileNames.contains((int)name))
- return data->fileNames.value(name);
+ if(data->cache_enabled && !data->fileNames[(int)name].isNull())
+ return data->fileNames[(int)name];
QString ret = data->fileEngine->fileName(name);
if(data->cache_enabled)
- data->fileNames.insert((int)name, ret);
+ data->fileNames[(int)name] = ret;
return ret;
}
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index 8155bcb..e46365d 100644
--- a/src/corelib/io/qfileinfo_p.h
+++ b/src/corelib/io/qfileinfo_p.h
@@ -95,14 +95,15 @@ public:
(void)fileEngine->fileFlags(QFSFileEngine::Refresh);
}
inline void clear() {
- fileNames.clear();
clearFlags();
+ for (int i = QAbstractFileEngine::NFileNames - 1 ; i >= 0 ; --i)
+ fileNames[i].clear();
}
mutable QAtomicInt ref;
QAbstractFileEngine *fileEngine;
mutable QString fileName;
- mutable QHash<int, QString> fileNames;
+ mutable QString fileNames[QAbstractFileEngine::NFileNames];
mutable uint cachedFlags : 31;
mutable uint cache_enabled : 1;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 494eab2..e40796b 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5197,6 +5197,9 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
opacity = parentOpacity;
}
+ // Item is invisible.
+ bool invisible = !item || ((item->d_ptr->flags & QGraphicsItem::ItemHasNoContents) || invisibleButChildIgnoresParentOpacity);
+
// Calculate the full transform for this item.
bool wasDirtyParentSceneTransform = false;
bool dontDrawItem = true;
@@ -5216,16 +5219,18 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
transform *= viewTransform;
}
- QRectF brect = item->boundingRect();
- // ### This does not take the clip into account.
- _q_adjustRect(&brect);
- QRect viewBoundingRect = transform.mapRect(brect).toRect();
- item->d_ptr->paintedViewBoundingRects.insert(widget, viewBoundingRect);
- viewBoundingRect.adjust(-1, -1, 1, 1);
- if (exposedRegion)
- dontDrawItem = !exposedRegion->intersects(viewBoundingRect);
- else
- dontDrawItem = viewBoundingRect.isEmpty();
+ if (!invisible) {
+ QRectF brect = item->boundingRect();
+ // ### This does not take the clip into account.
+ _q_adjustRect(&brect);
+ QRect viewBoundingRect = transform.mapRect(brect).toRect();
+ item->d_ptr->paintedViewBoundingRects.insert(widget, viewBoundingRect);
+ viewBoundingRect.adjust(-1, -1, 1, 1);
+ if (exposedRegion)
+ dontDrawItem = !exposedRegion->intersects(viewBoundingRect);
+ else
+ dontDrawItem = viewBoundingRect.isEmpty();
+ }
}
// Find and sort children.
@@ -5282,7 +5287,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
bool childClip = (item && (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape));
bool dontDrawChildren = item && dontDrawItem && childClip;
childClip &= !dontDrawChildren && !children->isEmpty();
- if (item && ((item->d_ptr->flags & QGraphicsItem::ItemHasNoContents) || invisibleButChildIgnoresParentOpacity))
+ if (item && invisible)
dontDrawItem = true;
// Clip children.
@@ -5291,7 +5296,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter *
painter->setWorldTransform(transform);
painter->setClipPath(item->shape(), Qt::IntersectClip);
}
-
+
if (!dontDrawChildren) {
if (item && item->d_ptr->needSortChildren) {
item->d_ptr->needSortChildren = 0;
@@ -5401,11 +5406,14 @@ void QGraphicsScenePrivate::markDirty(QGraphicsItem *item, const QRectF &rect, b
return;
}
- item->d_ptr->dirty = 1;
- if (fullItemUpdate)
- item->d_ptr->fullUpdatePending = 1;
- else if (!item->d_ptr->fullUpdatePending)
- item->d_ptr->needsRepaint |= rect;
+ bool hasNoContents = item->d_ptr->flags & QGraphicsItem::ItemHasNoContents;
+ if (!hasNoContents) {
+ item->d_ptr->dirty = 1;
+ if (fullItemUpdate)
+ item->d_ptr->fullUpdatePending = 1;
+ else if (!item->d_ptr->fullUpdatePending)
+ item->d_ptr->needsRepaint |= rect;
+ }
if (invalidateChildren) {
item->d_ptr->allChildrenDirty = 1;
@@ -5971,7 +5979,7 @@ void QGraphicsScenePrivate::updateTouchPointsForItem(QGraphicsItem *item, QTouch
{
QList<QTouchEvent::TouchPoint> touchPoints = touchEvent->touchPoints();
for (int i = 0; i < touchPoints.count(); ++i) {
- QTouchEvent::TouchPoint &touchPoint = touchPoints[i];
+ QTouchEvent::TouchPoint &touchPoint = touchPoints[i];
touchPoint.setRect(item->mapFromScene(touchPoint.sceneRect()).boundingRect());
touchPoint.setStartPos(item->d_ptr->genericMapFromScene(touchPoint.startScenePos(), touchEvent->widget()));
touchPoint.setLastPos(item->d_ptr->genericMapFromScene(touchPoint.lastScenePos(), touchEvent->widget()));
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 5269841..509f5fd 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -1400,7 +1400,7 @@ void QApplication::setStyle(QStyle *style)
#endif // QT_NO_STYLE_STYLESHEET
QApplicationPrivate::app_style = style;
QApplicationPrivate::app_style->setParent(qApp); // take ownership
-
+
// take care of possible palette requirements of certain gui
// styles. Do it before polishing the application since the style
// might call QApplication::setPalette() itself
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 9d8625c..27ee6d8 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -134,7 +134,7 @@ extern "C" {
# include <errno.h>
#endif
-#if defined(Q_OS_BSD4) || _POSIX_VERSION+0 < 200112L
+#if _POSIX_VERSION+0 < 200112L && !defined(Q_OS_BSD4)
# define QT_NO_UNSETENV
#endif
@@ -1767,7 +1767,7 @@ void qt_init(QApplicationPrivate *priv, int,
X11->pattern_fills[i].screen = -1;
#endif
- X11->startupId = X11->originalStartupId = X11->startupIdString = 0;
+ X11->startupId = 0;
int argc = priv->argc;
char **argv = priv->argv;
@@ -2565,15 +2565,13 @@ void qt_init(QApplicationPrivate *priv, int,
#endif // QT_NO_TABLET
X11->startupId = getenv("DESKTOP_STARTUP_ID");
- X11->originalStartupId = X11->startupId;
if (X11->startupId) {
#ifndef QT_NO_UNSETENV
unsetenv("DESKTOP_STARTUP_ID");
#else
// it's a small memory leak, however we won't crash if Qt is
// unloaded and someones tries to use the envoriment.
- X11->startupIdString = strdup("DESKTOP_STARTUP_ID=");
- putenv(X11->startupIdString);
+ putenv(strdup("DESKTOP_STARTUP_ID="));
#endif
}
} else {
@@ -2707,15 +2705,6 @@ void qt_cleanup()
#endif
}
-#ifdef QT_NO_UNSETENV
- // restore original value back.
- if (X11->originalStartupId && X11->startupIdString) {
- putenv(X11->originalStartupId);
- free(X11->startupIdString);
- X11->startupIdString = 0;
- }
-#endif
-
#ifndef QT_NO_XRENDER
for (int i = 0; i < X11->solid_fill_count; ++i) {
if (X11->solid_fills[i].picture)
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
index b480f34..3493a8b 100644
--- a/src/gui/kernel/qt_x11_p.h
+++ b/src/gui/kernel/qt_x11_p.h
@@ -506,8 +506,6 @@ struct QX11Data
int fc_hint_style;
char *startupId;
- char *originalStartupId;
- char *startupIdString;
DesktopEnvironment desktopEnvironment;
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index f95372b..6e12540 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1,4 +1,4 @@
-/****************************************************************************
+****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
@@ -5638,7 +5638,7 @@ bool QWidget::hasFocus() const
called from focusOutEvent() or focusInEvent(), you may get an
infinite recursion.
- \sa focus(), hasFocus(), clearFocus(), focusInEvent(), focusOutEvent(),
+ \sa hasFocus(), clearFocus(), focusInEvent(), focusOutEvent(),
setFocusPolicy(), focusWidget(), QApplication::focusWidget(), grabKeyboard(),
grabMouse(), {Keyboard Focus}
*/
diff --git a/src/gui/math3d/qgenericmatrix.cpp b/src/gui/math3d/qgenericmatrix.cpp
index 19a0f6e..82be256 100644
--- a/src/gui/math3d/qgenericmatrix.cpp
+++ b/src/gui/math3d/qgenericmatrix.cpp
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
But they can be different if the user wants to store elements
internally in a fixed-point format for the underlying hardware.
- \sa QMatrix4x4, QFixedPt
+ \sa QMatrix4x4
*/
/*!
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp
index 030415d..7e26a99 100644
--- a/src/gui/painting/qmatrix.cpp
+++ b/src/gui/painting/qmatrix.cpp
@@ -1194,4 +1194,15 @@ QDebug operator<<(QDebug dbg, const QMatrix &m)
Use the mapRect() function instead.
*/
+
+/*!
+ \fn bool qFuzzyCompare(const QMatrix& m1, const QMatrix& m2)
+
+ \relates QMatrix
+ \since 4.6
+
+ Returns true if \a m1 and \a m2 are equal, allowing for a small
+ fuzziness factor for floating-point comparisons; false otherwise.
+*/
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index 1df2395..4a4e91f 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -165,6 +165,17 @@ inline bool QMatrix::isIdentity() const
&& qFuzzyIsNull(_m21) && qFuzzyIsNull(_dx) && qFuzzyIsNull(_dy);
}
+inline bool qFuzzyCompare(const QMatrix& m1, const QMatrix& m2)
+{
+ return qFuzzyCompare(m1.m11(), m2.m11())
+ && qFuzzyCompare(m1.m12(), m2.m12())
+ && qFuzzyCompare(m1.m21(), m2.m21())
+ && qFuzzyCompare(m1.m22(), m2.m22())
+ && qFuzzyCompare(m1.dx(), m2.dx())
+ && qFuzzyCompare(m1.dy(), m2.dy());
+}
+
+
/*****************************************************************************
QMatrix stream functions
*****************************************************************************/
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index c4cd77a..03e01c9 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -698,6 +698,8 @@ bool QRegion::intersects(const QRegion &region) const
if (!rect_intersects(boundingRect(), region.boundingRect()))
return false;
+ if (numRects() == 1 && region.numRects() == 1)
+ return true;
const QVector<QRect> myRects = rects();
const QVector<QRect> otherRects = region.rects();
@@ -723,6 +725,8 @@ bool QRegion::intersects(const QRect &rect) const
const QRect r = rect.normalized();
if (!rect_intersects(boundingRect(), r))
return false;
+ if (numRects() == 1)
+ return true;
const QVector<QRect> myRects = rects();
for (QVector<QRect>::const_iterator it = myRects.constBegin(); it < myRects.constEnd(); ++it)
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 4bc20f6..385fde1 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -708,11 +708,15 @@ QTransform & QTransform::rotateRadians(qreal a, Qt::Axis axis)
*/
bool QTransform::operator==(const QTransform &o) const
{
-#define qFZ qFuzzyCompare
- return qFZ(affine._m11, o.affine._m11) && qFZ(affine._m12, o.affine._m12) && qFZ(m_13, o.m_13)
- && qFZ(affine._m21, o.affine._m21) && qFZ(affine._m22, o.affine._m22) && qFZ(m_23, o.m_23)
- && qFZ(affine._dx, o.affine._dx) && qFZ(affine._dy, o.affine._dy) && qFZ(m_33, o.m_33);
-#undef qFZ
+ return affine._m11 == o.affine._m11 &&
+ affine._m12 == o.affine._m12 &&
+ affine._m21 == o.affine._m21 &&
+ affine._m22 == o.affine._m22 &&
+ affine._dx == o.affine._dx &&
+ affine._dy == o.affine._dy &&
+ m_13 == o.m_13 &&
+ m_23 == o.m_23 &&
+ m_33 == o.m_33;
}
/*!
@@ -2178,6 +2182,17 @@ QTransform::operator QVariant() const
\sa reset()
*/
+/*!
+ \fn bool qFuzzyCompare(const QTransform& t1, const QTransform& t2)
+
+ \relates QTransform
+ \since 4.6
+
+ Returns true if \a t1 and \a t2 are equal, allowing for a small
+ fuzziness factor for floating-point comparisons; false otherwise.
+*/
+
+
// returns true if the transform is uniformly scaling
// (same scale in x and y direction)
// scale is set to the max of x and y scaling factors
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index a5002ca..57ec826 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -331,6 +331,20 @@ inline QTransform &QTransform::operator-=(qreal num)
return *this;
}
+inline bool qFuzzyCompare(const QTransform& t1, const QTransform& t2)
+{
+ return qFuzzyCompare(t1.m11(), t2.m11())
+ && qFuzzyCompare(t1.m12(), t2.m12())
+ && qFuzzyCompare(t1.m13(), t2.m13())
+ && qFuzzyCompare(t1.m21(), t2.m21())
+ && qFuzzyCompare(t1.m22(), t2.m22())
+ && qFuzzyCompare(t1.m23(), t2.m23())
+ && qFuzzyCompare(t1.m31(), t2.m31())
+ && qFuzzyCompare(t1.m32(), t2.m32())
+ && qFuzzyCompare(t1.m33(), t2.m33());
+}
+
+
/****** stream functions *******************/
#ifndef QT_NO_DATASTREAM
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTransform &);
diff --git a/src/gui/styles/qproxystyle.cpp b/src/gui/styles/qproxystyle.cpp
index f36ad64..37f25be 100644
--- a/src/gui/styles/qproxystyle.cpp
+++ b/src/gui/styles/qproxystyle.cpp
@@ -53,27 +53,28 @@ QT_BEGIN_NAMESPACE
/*!
\class QProxyStyle
- \brief The QProxyStyle is a convenience class that simplifies
- the creation of proxy styles in Qt.
+ \brief The QProxyStyle class is a convenience class that simplifies
+ the overriding of QStyle elements.
\since 4.6
- A proxy style is a style that wraps a different,
- usually the default system style, to override the painting or
- behavior of only specific parts.
+ A QProxyStyle wraps a QStyle (usually the default system style) for the
+ purpose of overriding the painting or other specific behavior of the
+ wrapped style.
- Here's an example allowing you to override the shortcut underline
+ Below is an example that overrides the shortcut underline
behavior on all platforms:
- \snippet doc/src/snippets/code/src_gui_proxystyle.cpp 0
+ \snippet doc/src/snippets/code/src_gui_qproxystyle.cpp 1
- Warning: Note that even though Qt's internal styles should respect this.
- hint, there is no guarantee that it will work for all styles.
- The example above would for instance not work on Mac since menus are
- handled by the operating system.
+ Warning: Although Qt's internal styles should respect this hint,
+ there is no guarantee that it will work for all styles. It would
+ not work on a Mac, for example, because menus are handled by the
+ operating system on the Mac.
\sa QStyle
*/
+
void QProxyStylePrivate::ensureBaseStyle() const
{
Q_Q(const QProxyStyle);
@@ -92,7 +93,7 @@ void QProxyStylePrivate::ensureBaseStyle() const
baseStyle = 0;
}
}
- }
+ }
if (!baseStyle) // Use application desktop style
baseStyle = QStyleFactory::create(QApplicationPrivate::desktopStyleKey());
@@ -105,12 +106,12 @@ void QProxyStylePrivate::ensureBaseStyle() const
}
/*!
- Constructs a QProxyStyle object.
-
- If no base style is provided, the current application style
- will be used as the base style.
+ Constructs a QProxyStyle object for overriding behavior in \a style
+ or in the current application \l{QStyle}{style} if \a style is 0
+ (default). Normally \a style is 0, because you want to override
+ behavior in the system style.
- Ownership of \style is transferred to QProxyStyle.
+ Ownership of \a style is transferred to QProxyStyle.
*/
QProxyStyle::QProxyStyle(QStyle *style) :
QCommonStyle(*new QProxyStylePrivate())
@@ -147,7 +148,7 @@ QStyle *QProxyStyle::baseStyle() const
/*!
Sets the base style that should be proxied.
- Ownership of \style is transferred to QProxyStyle.
+ Ownership of \a style is transferred to QProxyStyle.
If style is zero, a desktop-dependant style will be
assigned automatically.
@@ -167,7 +168,8 @@ void QProxyStyle::setBaseStyle(QStyle *style)
}
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -175,7 +177,9 @@ void QProxyStyle::drawPrimitive(PrimitiveElement element, const QStyleOption *op
d->baseStyle->drawPrimitive(element, option, painter, widget);
}
-/*! reimp */
+/*!
+ \reimp
+ */
void QProxyStyle::drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -183,7 +187,8 @@ void QProxyStyle::drawControl(ControlElement element, const QStyleOption *option
d->baseStyle->drawControl(element, option, painter, widget);
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -191,7 +196,8 @@ void QProxyStyle::drawComplexControl(ComplexControl control, const QStyleOptionC
d->baseStyle->drawComplexControl(control, option, painter, widget);
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled,
const QString &text, QPalette::ColorRole textRole) const
{
@@ -200,7 +206,8 @@ void QProxyStyle::drawItemText(QPainter *painter, const QRect &rect, int flags,
d->baseStyle->drawItemText(painter, rect, flags, pal, enabled, text, textRole);
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const
{
Q_D (const QProxyStyle);
@@ -208,7 +215,8 @@ void QProxyStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int align
d->baseStyle->drawItemPixmap(painter, rect, alignment, pixmap);
}
-/*! reimp */
+/*! \reimp
+ */
QSize QProxyStyle::sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -216,7 +224,8 @@ QSize QProxyStyle::sizeFromContents(ContentsType type, const QStyleOption *optio
return d->baseStyle->sizeFromContents(type, option, size, widget);
}
-/*! reimp */
+/*! \reimp
+ */
QRect QProxyStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -224,7 +233,8 @@ QRect QProxyStyle::subElementRect(SubElement element, const QStyleOption *option
return d->baseStyle->subElementRect(element, option, widget);
}
-/*! reimp */
+/*! \reimp
+ */
QRect QProxyStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *option, SubControl sc, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -232,7 +242,8 @@ QRect QProxyStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *
return d->baseStyle->subControlRect(cc, option, sc, widget);
}
-/*! reimp */
+/*! \reimp
+ */
QRect QProxyStyle::itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const
{
Q_D (const QProxyStyle);
@@ -240,7 +251,8 @@ QRect QProxyStyle::itemTextRect(const QFontMetrics &fm, const QRect &r, int flag
return d->baseStyle->itemTextRect(fm, r, flags, enabled, text);
}
-/*! reimp */
+/*! \reimp
+ */
QRect QProxyStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const
{
Q_D (const QProxyStyle);
@@ -248,7 +260,8 @@ QRect QProxyStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixm
return d->baseStyle->itemPixmapRect(r, flags, pixmap);
}
-/*! reimp */
+/*! \reimp
+ */
QStyle::SubControl QProxyStyle::hitTestComplexControl(ComplexControl control, const QStyleOptionComplex *option, const QPoint &pos, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -256,7 +269,8 @@ QStyle::SubControl QProxyStyle::hitTestComplexControl(ComplexControl control, co
return d->baseStyle->hitTestComplexControl(control, option, pos, widget);
}
-/*! reimp */
+/*! \reimp
+ */
int QProxyStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const
{
Q_D (const QProxyStyle);
@@ -264,7 +278,8 @@ int QProxyStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWi
return d->baseStyle->styleHint(hint, option, widget, returnData);
}
-/*! reimp */
+/*! \reimp
+ */
int QProxyStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -272,7 +287,8 @@ int QProxyStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, con
return d->baseStyle->pixelMetric(metric, option, widget);
}
-/*! reimp */
+/*! \reimp
+ */
QPixmap QProxyStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const
{
Q_D (const QProxyStyle);
@@ -280,7 +296,8 @@ QPixmap QProxyStyle::standardPixmap(StandardPixmap standardPixmap, const QStyleO
return d->baseStyle->standardPixmap(standardPixmap, opt, widget);
}
-/*! reimp */
+/*! \reimp
+ */
QPixmap QProxyStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
{
Q_D (const QProxyStyle);
@@ -288,7 +305,8 @@ QPixmap QProxyStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pi
return d->baseStyle->generatedIconPixmap(iconMode, pixmap, opt);
}
-/*! reimp */
+/*! \reimp
+ */
QPalette QProxyStyle::standardPalette() const
{
Q_D (const QProxyStyle);
@@ -296,7 +314,8 @@ QPalette QProxyStyle::standardPalette() const
return d->baseStyle->standardPalette();
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::polish(QWidget *widget)
{
Q_D (QProxyStyle);
@@ -304,7 +323,8 @@ void QProxyStyle::polish(QWidget *widget)
d->baseStyle->polish(widget);
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::polish(QPalette &pal)
{
Q_D (QProxyStyle);
@@ -312,7 +332,8 @@ void QProxyStyle::polish(QPalette &pal)
d->baseStyle->polish(pal);
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::polish(QApplication *app)
{
Q_D (QProxyStyle);
@@ -320,7 +341,8 @@ void QProxyStyle::polish(QApplication *app)
d->baseStyle->polish(app);
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::unpolish(QWidget *widget)
{
Q_D (QProxyStyle);
@@ -328,7 +350,8 @@ void QProxyStyle::unpolish(QWidget *widget)
d->baseStyle->unpolish(widget);
}
-/*! reimp */
+/*! \reimp
+ */
void QProxyStyle::unpolish(QApplication *app)
{
Q_D (QProxyStyle);
@@ -336,7 +359,8 @@ void QProxyStyle::unpolish(QApplication *app)
d->baseStyle->unpolish(app);
}
-/*! reimp */
+/*! \reimp
+ */
bool QProxyStyle::event(QEvent *e)
{
Q_D (QProxyStyle);
@@ -344,17 +368,47 @@ bool QProxyStyle::event(QEvent *e)
return d->baseStyle->event(e);
}
-/*! reimp */
-QIcon QProxyStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
+/*!
+ Returns an icon for the given \a standardIcon.
+
+ Reimplement this slot to provide your own icons in a QStyle
+ subclass. The \a option argument can be used to pass extra
+ information required to find the appropriate icon. The \a widget
+ argument is optional and can also be used to help find the icon.
+
+ \note Because of binary compatibility constraints, standardIcon()
+ introduced in Qt 4.1 is not virtual. Therefore it must dynamically
+ detect and call \e this slot. This default implementation simply
+ calls standardIcon() with the given parameters.
+
+ \sa standardIcon()
+ */
+QIcon QProxyStyle::standardIconImplementation(StandardPixmap standardIcon,
+ const QStyleOption *option,
+ const QWidget *widget) const
{
Q_D (const QProxyStyle);
d->ensureBaseStyle();
return d->baseStyle->standardIcon(standardIcon, option, widget);
}
-/*! reimp */
-int QProxyStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
- Qt::Orientation orientation, const QStyleOption *option, const QWidget *widget) const
+/*!
+ This slot is called by layoutSpacing() to determine the spacing that
+ should be used between \a control1 and \a control2 in a layout. \a
+ orientation specifies whether the controls are laid out side by side
+ or stacked vertically. The \a option parameter can be used to pass
+ extra information about the parent widget. The \a widget parameter
+ is optional and can also be used if \a option is 0.
+
+ The default implementation returns -1.
+
+ \sa layoutSpacing(), combinedLayoutSpacing()
+ */
+int QProxyStyle::layoutSpacingImplementation(QSizePolicy::ControlType control1,
+ QSizePolicy::ControlType control2,
+ Qt::Orientation orientation,
+ const QStyleOption *option,
+ const QWidget *widget) const
{
Q_D (const QProxyStyle);
d->ensureBaseStyle();
diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index c0fdc83..c848022 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -168,12 +168,21 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C
\section1 Creating a Custom Style
- If you want to design a custom look and feel for your application,
- the first step is to pick one of the styles provided with Qt to
- build your custom style from. The choice will depend on which
- existing style resembles your style the most. The most general
- class that you can use as base is QCommonStyle (and not QStyle).
- This is because Qt requires its styles to be \l{QCommonStyle}s.
+ You can create a custom look and feel for your application by
+ creating a custom style. There are two approaches to creating a
+ custom style. In the static approach, you either choose an
+ existing QStyle class, subclass it, and reimplement virtual
+ functions to provide the custom behavior, or you create an entire
+ QStyle class from scratch. In the dynamic approach, you modify the
+ behavior of your system style at runtime. The static approach is
+ described below. The dynamic approach is described in QProxyStyle.
+
+ The first step in the static approach is to pick one of the styles
+ provided by Qt from which you will build your custom style. Your
+ choice of QStyle class will depend on which style resembles your
+ desired style the most. The most general class that you can use as
+ a base is QCommonStyle (not QStyle). This is because Qt requires
+ its styles to be \l{QCommonStyle}s.
Depending on which parts of the base style you want to change,
you must reimplement the functions that are used to draw those
@@ -222,7 +231,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C
\section1 Using a Custom Style
There are several ways of using a custom style in a Qt
- application. The simplest way is call the
+ application. The simplest way is to pass the custom style to the
QApplication::setStyle() static function before creating the
QApplication object:
@@ -232,8 +241,8 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C
it before the constructor, you ensure that the user's preference,
set using the \c -style command-line option, is respected.
- You may want to make your style available for use in other
- applications, some of which may not be yours and are not available for
+ You may want to make your custom style available for use in other
+ applications, which may not be yours and hence not available for
you to recompile. The Qt Plugin system makes it possible to create
styles as plugins. Styles created as plugins are loaded as shared
objects at runtime by Qt itself. Please refer to the \link
@@ -1182,6 +1191,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SC_All Special value that matches all sub-controls.
\omitvalue SC_Q3ListViewBranch
+ \omitvalue SC_CustomBase
\sa ComplexControl
*/
@@ -2450,14 +2460,12 @@ QDebug operator<<(QDebug debug, QStyle::State state)
/*!
\since 4.6
- \fn const QStyle * proxy() const
+ \fn const QStyle *QStyle::proxy() const
This function returns the current proxy for this style.
By default most styles will return themselves. However
when a proxy style is in use, it will allow the style to
call back into its proxy.
-
- \sa setProxyStyle
*/
const QStyle * QStyle::proxy() const
{
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index 67656b4..9b496ef 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -972,7 +972,7 @@ void Q_GUI_EXPORT qt_mac_set_menubar_merge(bool b) { qt_mac_no_menubar_merge = !
/*****************************************************************************
QMenu bindings
*****************************************************************************/
-QMenuPrivate::QMacMenuPrivate::QMacMenuPrivate() : menu(0)
+QMenuPrivate::QMacMenuPrivate::QMacMenuPrivate(QMenuPrivate *menu) : menu(0), qmenu(menu)
{
}
@@ -1300,22 +1300,61 @@ QMenuPrivate::QMacMenuPrivate::syncAction(QMacMenuAction *action)
#else
int itemIndex = [menu indexOfItem:item];
Q_ASSERT(itemIndex != -1);
- if (action->action->isSeparator()) {
+
+ // Separator handling: Menu items and separators can be added to a QMenu in
+ // any order (for example, add all the separators first and then "fill inn"
+ // the menu items). Create NSMenuItem seperatorItems for the Qt separators,
+ // and make sure that there are no double separators and no seprators
+ // at the top or bottom of the menu.
+ bool itemIsSeparator = action->action->isSeparator();
+ bool previousItemIsSeparator = false;
+ if (itemIndex > 0) {
+ if ([[menu itemAtIndex : itemIndex - 1] isSeparatorItem])
+ previousItemIsSeparator = true;
+ }
+ bool nexItemIsSeparator = false;
+ if (itemIndex > 0 && itemIndex < [menu numberOfItems] -1) {
+ if ([[menu itemAtIndex : itemIndex + 1] isSeparatorItem])
+ nexItemIsSeparator = true;
+ }
+ bool itemIsAtBottomOfMenu = (itemIndex == [menu numberOfItems] - 1);
+ bool itemIsAtTopOfMenu = (itemIndex == 0);
+
+
+ if (itemIsSeparator) {
+ // Create separators items for actions that are now separators
action->menuItem = [NSMenuItem separatorItem];
[action->menuItem retain];
+
+ // Hide duplicate/top/bottom separators.
+ if (qmenu->collapsibleSeparators && (previousItemIsSeparator || itemIsAtBottomOfMenu || itemIsAtTopOfMenu)) {
+ [action->menuItem setHidden : true];
+ }
+
[menu insertItem: action->menuItem atIndex:itemIndex];
[menu removeItem:item];
[item release];
item = action->menuItem;
return;
- } else if ([item isSeparatorItem]) {
- // I'm no longer a separator...
- action->menuItem = createNSMenuItem(action->action->text());
- [menu insertItem:action->menuItem atIndex:itemIndex];
- [menu removeItem:item];
- [item release];
- item = action->menuItem;
+ } else {
+ // Create standard menu items for actions that are no longer separators
+ if ([item isSeparatorItem]) {
+ action->menuItem = createNSMenuItem(action->action->text());
+ [menu insertItem:action->menuItem atIndex:itemIndex];
+ [menu removeItem:item];
+ [item release];
+ item = action->menuItem;
+ }
+
+ // Show separators that should now be visible since a non-separator
+ // item (the current item) was added.
+ if (previousItemIsSeparator) {
+ [[menu itemAtIndex : itemIndex - 1] setHidden : false];
+ } else if (itemIsAtTopOfMenu && nexItemIsSeparator) {
+ [[menu itemAtIndex : itemIndex + 1] setHidden : false];
+ }
}
+
#endif
//find text (and accel)
@@ -1499,7 +1538,7 @@ QMenuPrivate::macMenu(OSMenuRef merge)
if (mac_menu && mac_menu->menu)
return mac_menu->menu;
if (!mac_menu)
- mac_menu = new QMacMenuPrivate;
+ mac_menu = new QMacMenuPrivate(this);
mac_menu->menu = qt_mac_create_menu(q);
if (merge) {
#ifndef QT_MAC_USE_COCOA
diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h
index 1dfe701..20c63fe 100644
--- a/src/gui/widgets/qmenu_p.h
+++ b/src/gui/widgets/qmenu_p.h
@@ -263,8 +263,9 @@ public:
struct QMacMenuPrivate {
QList<QMacMenuAction*> actionItems;
OSMenuRef menu;
- QMacMenuPrivate();
- ~QMacMenuPrivate();
+ QMenuPrivate *qmenu;
+ QMacMenuPrivate(QMenuPrivate *menu);
+ ~QMacMenuPrivate();
bool merged(const QAction *action) const;
void addAction(QAction *, QMacMenuAction* =0, QMenuPrivate *qmenu = 0);
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index ca7dffd..827acac 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -2020,6 +2020,7 @@ void QPlainTextEdit::inputMethodEvent(QInputMethodEvent *e)
}
#endif
d->sendControlEvent(e);
+ ensureCursorVisible();
}
/*!\reimp
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index 1c4df93..61cd0ce 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -1659,6 +1659,7 @@ void QTextEdit::inputMethodEvent(QInputMethodEvent *e)
}
#endif
d->sendControlEvent(e);
+ ensureCursorVisible();
}
/*!\reimp
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 19cb02a..9663dd6 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -982,6 +982,14 @@ void QGL2PaintEngineEx::compositionModeChanged()
void QGL2PaintEngineEx::renderHintsChanged()
{
+#if !defined(QT_OPENGL_ES_2)
+ if ((state()->renderHints & QPainter::Antialiasing)
+ || (state()->renderHints & QPainter::HighQualityAntialiasing))
+ glEnable(GL_MULTISAMPLE);
+ else
+ glDisable(GL_MULTISAMPLE);
+#endif
+
// qDebug("QGL2PaintEngineEx::renderHintsChanged() not implemented!");
}
@@ -1180,6 +1188,10 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
glDepthFunc(GL_LEQUAL);
glDepthMask(false);
+#if !defined(QT_OPENGL_ES_2)
+ glDisable(GL_MULTISAMPLE);
+#endif
+
QGLPixmapData *source = d->drawable.copyOnBegin();
if (d->drawable.context()->d_func()->clear_on_painter_begin && d->drawable.autoFillBackground()) {
if (d->drawable.hasTransparentBackground())
@@ -1485,6 +1497,8 @@ void QGL2PaintEngineEx::setState(QPainterState *new_state)
return;
}
+ renderHintsChanged();
+
d->matrixDirty = true;
d->compositionModeDirty = true;
d->brushTextureDirty = true;
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index da61634..f241e61 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -522,7 +522,11 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
const QX11Info *xinfo = qt_x11Info(d->paintDevice);
bool useFBConfig = false;
-#if defined(GLX_VERSION_1_3) && !defined(QT_NO_XRENDER)
+#if defined(GLX_VERSION_1_3) && !defined(QT_NO_XRENDER) && !defined(Q_OS_HPUX)
+ /*
+ HPUX defines GLX_VERSION_1_3 but does not implement the corresponding functions.
+ Specifically glXChooseFBConfig and glXGetVisualFromFBConfig are not implemented.
+ */
QWidget* widget = 0;
if (d->paintDevice->devType() == QInternal::Widget)
widget = static_cast<QWidget*>(d->paintDevice);
@@ -565,7 +569,7 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
}
#endif
-#if defined(GLX_VERSION_1_3)
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
// GLX_RENDER_TYPE is only in glx >=1.3
if (useFBConfig) {
spec[i++] = GLX_RENDER_TYPE;
@@ -627,7 +631,7 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
spec[i++] = f.samples() == -1 ? 4 : f.samples();
}
-#if defined(GLX_VERSION_1_3)
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
if (useFBConfig) {
spec[i++] = GLX_DRAWABLE_TYPE;
switch(d->paintDevice->devType()) {
@@ -652,7 +656,7 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
XVisualInfo* chosenVisualInfo = 0;
-#if defined(GLX_VERSION_1_3)
+#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX)
while (useFBConfig) {
GLXFBConfig *configs;
int configCount = 0;
diff --git a/src/opengl/qgraphicssystem_gl.cpp b/src/opengl/qgraphicssystem_gl.cpp
index ce8ad7a..a75f3a5 100644
--- a/src/opengl/qgraphicssystem_gl.cpp
+++ b/src/opengl/qgraphicssystem_gl.cpp
@@ -44,6 +44,7 @@
#include "private/qpixmap_raster_p.h"
#include "private/qpixmapdata_gl_p.h"
#include "private/qwindowsurface_gl_p.h"
+#include "private/qgl_p.h"
#include <private/qwindowsurface_raster_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 48feb82..e641d2c 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -398,7 +398,8 @@ static TextureBuffer createTextureBuffer(const QSize &size, QGL2PaintEngineEx *e
bool QGLPixmapData::useFramebufferObjects()
{
return QGLFramebufferObject::hasOpenGLFramebufferObjects()
- && QGLFramebufferObject::hasOpenGLFramebufferBlit();
+ && QGLFramebufferObject::hasOpenGLFramebufferBlit()
+ && qt_gl_preferGL2Engine();
}
QPaintEngine* QGLPixmapData::paintEngine() const
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 01974a2..cdfaa3c 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -72,6 +72,10 @@
#include <private/qpaintengineex_opengl2_p.h>
+#ifndef QT_OPENGL_ES_2
+#include <private/qpaintengine_opengl_p.h>
+#endif
+
#ifndef GLX_ARB_multisample
#define GLX_SAMPLE_BUFFERS_ARB 100000
#define GLX_SAMPLES_ARB 100001
@@ -315,9 +319,17 @@ void QGLWindowSurface::hijackWindow(QWidget *widget)
Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_window_surface_2_engine)
+#if !defined (QT_OPENGL_ES_2)
+Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_window_surface_engine)
+#endif
+
/*! \reimp */
QPaintEngine *QGLWindowSurface::paintEngine() const
{
+#if !defined(QT_OPENGL_ES_2)
+ if (!qt_gl_preferGL2Engine())
+ return qt_gl_window_surface_engine();
+#endif
return qt_gl_window_surface_2_engine();
}
diff --git a/src/scripttools/debugging/qscriptdebugger.cpp b/src/scripttools/debugging/qscriptdebugger.cpp
index 454d051..181f4ae 100644
--- a/src/scripttools/debugging/qscriptdebugger.cpp
+++ b/src/scripttools/debugging/qscriptdebugger.cpp
@@ -94,6 +94,8 @@
#include <QtGui/qevent.h>
#include <QtGui/qicon.h>
#include <QtGui/qinputdialog.h>
+#include <QtGui/qmenu.h>
+#include <QtGui/qtoolbar.h>
#include <QtGui/qtooltip.h>
QT_BEGIN_NAMESPACE
@@ -1905,6 +1907,45 @@ QAction *QScriptDebugger::goToLineAction(QObject *parent) const
return d->goToLineAction;
}
+QMenu *QScriptDebugger::createStandardMenu(QWidget *widgetParent, QObject *actionParent)
+{
+ QMenu *menu = new QMenu(widgetParent);
+ menu->setTitle(QObject::tr("Debug"));
+ menu->addAction(action(ContinueAction, actionParent));
+ menu->addAction(action(InterruptAction, actionParent));
+ menu->addAction(action(StepIntoAction, actionParent));
+ menu->addAction(action(StepOverAction, actionParent));
+ menu->addAction(action(StepOutAction, actionParent));
+ menu->addAction(action(RunToCursorAction, actionParent));
+ menu->addAction(action(RunToNewScriptAction, actionParent));
+
+ menu->addSeparator();
+ menu->addAction(action(ToggleBreakpointAction, actionParent));
+
+ menu->addSeparator();
+ menu->addAction(action(ClearDebugOutputAction, actionParent));
+ menu->addAction(action(ClearErrorLogAction, actionParent));
+ menu->addAction(action(ClearConsoleAction, actionParent));
+
+ return menu;
+}
+
+QToolBar *QScriptDebugger::createStandardToolBar(QWidget *widgetParent, QObject *actionParent)
+{
+ QToolBar *tb = new QToolBar(widgetParent);
+ tb->setObjectName(QLatin1String("qtscriptdebugger_standardToolBar"));
+ tb->addAction(action(ContinueAction, actionParent));
+ tb->addAction(action(InterruptAction, actionParent));
+ tb->addAction(action(StepIntoAction, actionParent));
+ tb->addAction(action(StepOverAction, actionParent));
+ tb->addAction(action(StepOutAction, actionParent));
+ tb->addAction(action(RunToCursorAction, actionParent));
+ tb->addAction(action(RunToNewScriptAction, actionParent));
+ tb->addSeparator();
+ tb->addAction(action(FindInScriptAction, actionParent));
+ return tb;
+}
+
/*!
\reimp
*/
diff --git a/src/scripttools/debugging/qscriptdebugger_p.h b/src/scripttools/debugging/qscriptdebugger_p.h
index 6d8fcab..e8fcf21 100644
--- a/src/scripttools/debugging/qscriptdebugger_p.h
+++ b/src/scripttools/debugging/qscriptdebugger_p.h
@@ -70,6 +70,8 @@ class QScriptErrorLogWidgetInterface;
class QScriptDebuggerWidgetFactoryInterface;
class QAction;
class QEvent;
+class QMenu;
+class QToolBar;
class QScriptDebuggerPrivate;
class Q_AUTOTEST_EXPORT QScriptDebugger : public QObject
@@ -165,6 +167,9 @@ public:
QAction *clearConsoleAction(QObject *parent) const;
QAction *clearErrorLogAction(QObject *parent) const;
+ QMenu *createStandardMenu(QWidget *widgetParent, QObject *actionParent);
+ QToolBar *createStandardToolBar(QWidget *widgetParent, QObject *actionParent);
+
bool eventFilter(QObject *, QEvent *e);
Q_SIGNALS:
diff --git a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
index e096ba8..94b085d 100644
--- a/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
+++ b/src/scripttools/debugging/qscriptdebuggerlocalsmodel.cpp
@@ -136,6 +136,7 @@ public:
const QScriptDebuggerValuePropertyList &props);
void deleteObjectSnapshots(const QList<qint64> &snapshotIds);
+ void deleteAllObjectSnapshots();
QScriptDebuggerJobSchedulerInterface *jobScheduler;
QScriptDebuggerCommandSchedulerInterface *commandScheduler;
@@ -240,6 +241,14 @@ void QScriptDebuggerLocalsModelPrivate::deleteObjectSnapshots(const QList<qint64
frontend.scheduleDeleteScriptObjectSnapshot(snapshotIds.at(i));
}
+void QScriptDebuggerLocalsModelPrivate::deleteAllObjectSnapshots()
+{
+ QList<qint64> snapshotIds;
+ for (int i = 0; i < invisibleRootNode->children.count(); ++i)
+ snapshotIds += findSnapshotIdsRecursively(invisibleRootNode->children.at(i));
+ deleteObjectSnapshots(snapshotIds);
+}
+
QScriptDebuggerLocalsModelPrivate *QScriptDebuggerLocalsModelPrivate::get(QScriptDebuggerLocalsModel *q)
{
return q->d_func();
@@ -442,13 +451,6 @@ QScriptDebuggerLocalsModel::QScriptDebuggerLocalsModel(
QScriptDebuggerLocalsModel::~QScriptDebuggerLocalsModel()
{
- Q_D(QScriptDebuggerLocalsModel);
- QList<qint64> snapshotIds;
- for (int i = 0; i < d->invisibleRootNode->children.count(); ++i)
- snapshotIds += findSnapshotIdsRecursively(d->invisibleRootNode->children.at(i));
- QScriptDebuggerCommandSchedulerFrontend frontend(d->commandScheduler, 0);
- for (int j = 0; j < snapshotIds.size(); ++j)
- frontend.scheduleDeleteScriptObjectSnapshot(snapshotIds.at(j));
}
QModelIndex QScriptDebuggerLocalsModelPrivate::addTopLevelObject(const QString &name, const QScriptDebuggerValue &object)
diff --git a/src/scripttools/debugging/qscriptenginedebugger.cpp b/src/scripttools/debugging/qscriptenginedebugger.cpp
index a278e14..b09c79a 100644
--- a/src/scripttools/debugging/qscriptenginedebugger.cpp
+++ b/src/scripttools/debugging/qscriptenginedebugger.cpp
@@ -49,9 +49,7 @@
#include <QtGui/qapplication.h>
#include <QtGui/qdockwidget.h>
#include <QtGui/qmainwindow.h>
-#include <QtGui/qmenu.h>
#include <QtGui/qmenubar.h>
-#include <QtGui/qtoolbar.h>
#include <QtGui/qboxlayout.h>
// this has to be outside the namespace
@@ -412,7 +410,7 @@ QWidget *QScriptEngineDebugger::widget(DebuggerWidget widget) const
{
Q_D(const QScriptEngineDebugger);
const_cast<QScriptEngineDebuggerPrivate*>(d)->createDebugger();
- return d->debugger->widget(static_cast<QScriptDebugger::DebuggerWidget>(widget));
+ return d->debugger->widget(static_cast<QScriptDebugger::DebuggerWidget>(static_cast<int>(widget)));
}
/*!
@@ -436,7 +434,7 @@ QAction *QScriptEngineDebugger::action(DebuggerAction action) const
Q_D(const QScriptEngineDebugger);
QScriptEngineDebugger *that = const_cast<QScriptEngineDebugger*>(this);
that->d_func()->createDebugger();
- return d->debugger->action(static_cast<QScriptDebugger::DebuggerAction>(action), that);
+ return d->debugger->action(static_cast<QScriptDebugger::DebuggerAction>(static_cast<int>(action)), that);
}
/*!
@@ -589,25 +587,9 @@ QMainWindow *QScriptEngineDebugger::standardWindow() const
*/
QMenu *QScriptEngineDebugger::createStandardMenu(QWidget *parent)
{
- QMenu *menu = new QMenu(parent);
- menu->setTitle(QObject::tr("Debug"));
- menu->addAction(action(ContinueAction));
- menu->addAction(action(InterruptAction));
- menu->addAction(action(StepIntoAction));
- menu->addAction(action(StepOverAction));
- menu->addAction(action(StepOutAction));
- menu->addAction(action(RunToCursorAction));
- menu->addAction(action(RunToNewScriptAction));
-
- menu->addSeparator();
- menu->addAction(action(ToggleBreakpointAction));
-
- menu->addSeparator();
- menu->addAction(action(ClearDebugOutputAction));
- menu->addAction(action(ClearErrorLogAction));
- menu->addAction(action(ClearConsoleAction));
-
- return menu;
+ Q_D(QScriptEngineDebugger);
+ d->createDebugger();
+ return d->debugger->createStandardMenu(parent, this);
}
/*!
@@ -618,18 +600,9 @@ QMenu *QScriptEngineDebugger::createStandardMenu(QWidget *parent)
*/
QToolBar *QScriptEngineDebugger::createStandardToolBar(QWidget *parent)
{
- QToolBar *tb = new QToolBar(parent);
- tb->setObjectName(QLatin1String("qtscriptdebugger_standardToolBar"));
- tb->addAction(action(ContinueAction));
- tb->addAction(action(InterruptAction));
- tb->addAction(action(StepIntoAction));
- tb->addAction(action(StepOverAction));
- tb->addAction(action(StepOutAction));
- tb->addAction(action(RunToCursorAction));
- tb->addAction(action(RunToNewScriptAction));
- tb->addSeparator();
- tb->addAction(action(FindInScriptAction));
- return tb;
+ Q_D(QScriptEngineDebugger);
+ d->createDebugger();
+ return d->debugger->createStandardToolBar(parent, this);
}
/*!
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index f60c33c..6667c91 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -446,7 +446,7 @@ static QVariant qGetIntData(SQLHANDLE hStmt, int column, bool isSigned = true)
static QVariant qGetDoubleData(SQLHANDLE hStmt, int column)
{
SQLDOUBLE dblbuf;
- SQLINTEGER lengthIndicator = 0;
+ QSQLLEN lengthIndicator = 0;
SQLRETURN r = SQLGetData(hStmt,
column+1,
SQL_C_DOUBLE,
@@ -572,7 +572,7 @@ static int qGetODBCVersion(const QString &connOpts)
#ifndef Q_ODBC_VERSION_2
if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"), Qt::CaseInsensitive))
return SQL_OV_ODBC3;
-#endif
+#endif
return SQL_OV_ODBC2;
}
@@ -984,7 +984,7 @@ bool QODBCResult::fetchFirst()
r = SQLFetchScroll(d->hStmt,
SQL_FETCH_FIRST,
0);
- if (r != SQL_SUCCESS) {
+ if (r != SQL_SUCCESS) {
if (r != SQL_NO_DATA)
setLastError(qMakeError(QCoreApplication::translate("QODBCResult",
"Unable to fetch first"), QSqlError::ConnectionError, d));
@@ -1003,7 +1003,7 @@ bool QODBCResult::fetchPrevious()
r = SQLFetchScroll(d->hStmt,
SQL_FETCH_PRIOR,
0);
- if (r != SQL_SUCCESS) {
+ if (r != SQL_SUCCESS) {
if (r != SQL_NO_DATA)
setLastError(qMakeError(QCoreApplication::translate("QODBCResult",
"Unable to fetch previous"), QSqlError::ConnectionError, d));
@@ -1034,7 +1034,7 @@ bool QODBCResult::fetchLast()
r = SQLFetchScroll(d->hStmt,
SQL_FETCH_LAST,
0);
- if (r != SQL_SUCCESS) {
+ if (r != SQL_SUCCESS) {
if (r != SQL_NO_DATA)
setLastError(qMakeError(QCoreApplication::translate("QODBCResult",
"Unable to fetch last"), QSqlError::ConnectionError, d));
@@ -1469,7 +1469,7 @@ bool QODBCResult::exec()
if (*ind != SQL_NULL_DATA)
*ind = str.length();
int strSize = str.length();
-
+
r = SQLBindParameter(d->hStmt,
i + 1,
qParamType[(QFlag)(bindValueType(i)) & QSql::InOut],
@@ -1759,7 +1759,7 @@ bool QODBCDriver::open(const QString & db,
// support the "DRIVER={SQL SERVER};SERVER=blah" syntax
if (db.contains(QLatin1String(".dsn"), Qt::CaseInsensitive))
connQStr = QLatin1String("FILEDSN=") + db;
- else if (db.contains(QLatin1String("DRIVER="), Qt::CaseInsensitive)
+ else if (db.contains(QLatin1String("DRIVER="), Qt::CaseInsensitive)
|| db.contains(QLatin1String("SERVER="), Qt::CaseInsensitive))
connQStr = db;
else
@@ -1769,7 +1769,7 @@ bool QODBCDriver::open(const QString & db,
connQStr += QLatin1String(";UID=") + user;
if (!password.isEmpty())
connQStr += QLatin1String(";PWD=") + password;
-
+
SQLSMALLINT cb;
SQLTCHAR connOut[1024];
r = SQLDriverConnect(d->hDbc,
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index 990ad9a..06df473 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -960,7 +960,7 @@ bool QSqlDatabase::rollback()
connection, set the database name, and call open() again. \note
The \e{database name} is not the \e{connection name}. The
connection name must be passed to addDatabase() at connection
- object create time.
+ object create time.
For the QOCI (Oracle) driver, the database name is the TNS
Service Name.
@@ -1481,17 +1481,16 @@ QString QSqlDatabase::connectionName() const
}
/*!
-
- Sets the default numerical precision policy that queries use when created
- on this database connection.
+ Sets the default numerical precision policy used by queries created
+ on this database connection to \a precisionPolicy.
Note: Drivers that don't support fetching numerical values with low
precision will ignore the precision policy. You can use
QSqlDriver::hasFeature() to find out whether a driver supports this
feature.
- Note: Setting the default precision policy doesn't affect any currently
- active queries.
+ Note: Setting the default precision policy to \a precisionPolicy
+ doesn't affect any currently active queries.
\sa QSql::NumericalPrecisionPolicy, numericalPrecisionPolicy(), QSqlQuery::setNumericalPrecisionPolicy(), QSqlQuery::numericalPrecisionPolicy()
*/
diff --git a/src/sql/kernel/qsqldriver.cpp b/src/sql/kernel/qsqldriver.cpp
index f7492c3..48ef6a2 100644
--- a/src/sql/kernel/qsqldriver.cpp
+++ b/src/sql/kernel/qsqldriver.cpp
@@ -914,12 +914,11 @@ QString QSqlDriver::stripDelimitersImplementation(const QString &identifier, Ide
}
/*!
+ Sets the default numerical precision policy used by queries created
+ by this driver to \a precisionPolicy.
- Sets the default numerical precision policy that queries use when created
- by this driver.
-
- Note: Setting the default precision policy doesn't affect any currently
- active queries.
+ Note: Setting the default precision policy to \a precisionPolicy
+ doesn't affect any currently active queries.
\sa QSql::NumericalPrecisionPolicy, numericalPrecisionPolicy(), QSqlQuery::setNumericalPrecisionPolicy(), QSqlQuery::numericalPrecisionPolicy()
*/
diff --git a/tests/auto/qscriptable/tst_qscriptable.cpp b/tests/auto/qscriptable/tst_qscriptable.cpp
index 5eabbee..1dd975a 100644
--- a/tests/auto/qscriptable/tst_qscriptable.cpp
+++ b/tests/auto/qscriptable/tst_qscriptable.cpp
@@ -49,7 +49,7 @@
//TESTED_CLASS=
//TESTED_FILES=
-class MyScriptable : public QObject, protected QScriptable
+class MyScriptable : public QObject, public QScriptable
{
Q_OBJECT
Q_PROPERTY(int baz READ baz WRITE setBaz)
@@ -87,6 +87,7 @@ public slots:
QObject *zab();
QObject *setZab(QObject *);
QScriptValue getArguments();
+ int getArgumentCount();
signals:
void sig(int);
@@ -128,6 +129,11 @@ QScriptValue MyScriptable::getArguments()
return context()->argumentsObject();
}
+int MyScriptable::getArgumentCount()
+{
+ return context()->argumentCount();
+}
+
void MyScriptable::foo()
{
m_lastEngine = engine();
@@ -224,6 +230,8 @@ void tst_QScriptable::cleanupTestCase()
void tst_QScriptable::engine()
{
+ QCOMPARE(m_scriptable.engine(), (QScriptEngine*)0);
+ QCOMPARE(m_scriptable.context(), (QScriptContext*)0);
QCOMPARE(m_scriptable.lastEngine(), (QScriptEngine *)0);
// reading property
@@ -360,6 +368,14 @@ void tst_QScriptable::arguments()
QVERIFY(args.property("1").strictlyEquals(QScriptValue(&m_engine, 20)));
QVERIFY(args.property("2").strictlyEquals(QScriptValue(&m_engine, 30)));
QVERIFY(args.property("3").strictlyEquals(QScriptValue(&m_engine, "hi")));
+
+ QScriptValue argc = m_engine.evaluate("scriptable.getArgumentCount(1, 2, 3)");
+ QVERIFY(argc.isNumber());
+ QCOMPARE(argc.toInt32(), 3);
+
+ QCOMPARE(m_scriptable.argumentCount(), -1);
+ QVERIFY(!m_scriptable.argument(-1).isValid());
+ QVERIFY(!m_scriptable.argument(0).isValid());
}
void tst_QScriptable::throwError()
diff --git a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
index bfcd6ee..e2eb8cf0 100644
--- a/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
+++ b/tests/auto/qscriptcontext/tst_qscriptcontext.cpp
@@ -72,6 +72,7 @@ private slots:
void scopeChain();
void pushAndPopScope();
void getSetActivationObject();
+ void toString();
};
tst_QScriptContext::tst_QScriptContext()
@@ -438,6 +439,7 @@ void tst_QScriptContext::pushAndPopContext()
QCOMPARE(ctx->isCalledAsConstructor(), false);
QCOMPARE(ctx->argumentCount(), 0);
QCOMPARE(ctx->argument(0).isUndefined(), true);
+ QVERIFY(!ctx->argument(-1).isValid());
QCOMPARE(ctx->argumentsObject().isObject(), true);
QCOMPARE(ctx->activationObject().isObject(), true);
QCOMPARE(ctx->callee().isValid(), false);
@@ -687,5 +689,21 @@ void tst_QScriptContext::getSetActivationObject()
}
}
+static QScriptValue parentContextToString(QScriptContext *ctx, QScriptEngine *)
+{
+ return ctx->parentContext()->toString();
+}
+
+void tst_QScriptContext::toString()
+{
+ QScriptEngine eng;
+ eng.globalObject().setProperty("parentContextToString", eng.newFunction(parentContextToString));
+ QScriptValue ret = eng.evaluate("function foo(first, second, third) {\n"
+ " return parentContextToString();\n"
+ "}; foo(1, 2, 3)", "script.qs");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("foo (first=1, second=2, third=3) at script.qs:2"));
+}
+
QTEST_MAIN(tst_QScriptContext)
#include "tst_qscriptcontext.moc"
diff --git a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp
index df1e14f..82c66f8 100644
--- a/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp
+++ b/tests/auto/qscriptcontextinfo/tst_qscriptcontextinfo.cpp
@@ -95,6 +95,7 @@ private slots:
void builtinFunctionNames();
void nullContext();
void streaming();
+ void assignmentAndComparison();
};
tst_QScriptContextInfo::tst_QScriptContextInfo()
@@ -553,5 +554,24 @@ void tst_QScriptContextInfo::streaming()
}
}
+void tst_QScriptContextInfo::assignmentAndComparison()
+{
+ QScriptEngine eng;
+ eng.globalObject().setProperty("getContextInfoList", eng.newFunction(getContextInfoList));
+ QString fileName = "ciao.qs";
+ int lineNumber = 456;
+ QScriptValue ret = eng.evaluate("function bar(a, b, c) {\n return getContextInfoList();\n}\nbar()",
+ fileName, lineNumber);
+ QList<QScriptContextInfo> lst = qscriptvalue_cast<QList<QScriptContextInfo> >(ret);
+ QCOMPARE(lst.size(), 3);
+ QScriptContextInfo ci = lst.at(0);
+ QScriptContextInfo same = ci;
+ QVERIFY(ci == same);
+ QVERIFY(!(ci != same));
+ QScriptContextInfo other = lst.at(1);
+ QVERIFY(!(ci == other));
+ QVERIFY(ci != other);
+}
+
QTEST_MAIN(tst_QScriptContextInfo)
#include "tst_qscriptcontextinfo.moc"
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index fe60cd0..230f889 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -64,6 +64,7 @@ public:
virtual ~tst_QScriptEngine();
private slots:
+ void constructWithParent();
void currentContext();
void pushPopContext();
void getSetDefaultPrototype();
@@ -119,6 +120,7 @@ private slots:
void getSetAgent();
void reentrancy();
void incDecNonObjectProperty();
+ void installTranslatorFunctions();
};
tst_QScriptEngine::tst_QScriptEngine()
@@ -129,6 +131,17 @@ tst_QScriptEngine::~tst_QScriptEngine()
{
}
+void tst_QScriptEngine::constructWithParent()
+{
+ QPointer<QScriptEngine> ptr;
+ {
+ QObject obj;
+ QScriptEngine *engine = new QScriptEngine(&obj);
+ ptr = engine;
+ }
+ QVERIFY(ptr == 0);
+}
+
void tst_QScriptEngine::currentContext()
{
QScriptEngine eng;
@@ -945,6 +958,22 @@ void tst_QScriptEngine::checkSyntax()
QCOMPARE(result.errorLineNumber(), errorLineNumber);
QCOMPARE(result.errorColumnNumber(), errorColumnNumber);
QCOMPARE(result.errorMessage(), errorMessage);
+
+ // assignment
+ {
+ QScriptSyntaxCheckResult copy = result;
+ QCOMPARE(copy.state(), result.state());
+ QCOMPARE(copy.errorLineNumber(), result.errorLineNumber());
+ QCOMPARE(copy.errorColumnNumber(), result.errorColumnNumber());
+ QCOMPARE(copy.errorMessage(), result.errorMessage());
+ }
+ {
+ QScriptSyntaxCheckResult copy(result);
+ QCOMPARE(copy.state(), result.state());
+ QCOMPARE(copy.errorLineNumber(), result.errorLineNumber());
+ QCOMPARE(copy.errorColumnNumber(), result.errorColumnNumber());
+ QCOMPARE(copy.errorMessage(), result.errorMessage());
+ }
}
void tst_QScriptEngine::canEvaluate_data()
@@ -1467,6 +1496,61 @@ void tst_QScriptEngine::valueConversion()
Foo foo = qScriptValueToValue<Foo>(str);
QCOMPARE(foo.x, 123);
}
+
+ // more built-in types
+ {
+ QScriptValue val = qScriptValueFromValue(&eng, uint(123));
+ QVERIFY(val.isNumber());
+ QCOMPARE(val.toInt32(), 123);
+ }
+ {
+ QScriptValue val = qScriptValueFromValue(&eng, qulonglong(123));
+ QVERIFY(val.isNumber());
+ QCOMPARE(val.toInt32(), 123);
+ }
+ {
+ QScriptValue val = qScriptValueFromValue(&eng, float(123));
+ QVERIFY(val.isNumber());
+ QCOMPARE(val.toInt32(), 123);
+ }
+ {
+ QScriptValue val = qScriptValueFromValue(&eng, short(123));
+ QVERIFY(val.isNumber());
+ QCOMPARE(val.toInt32(), 123);
+ }
+ {
+ QScriptValue val = qScriptValueFromValue(&eng, ushort(123));
+ QVERIFY(val.isNumber());
+ QCOMPARE(val.toInt32(), 123);
+ }
+ {
+ QScriptValue val = qScriptValueFromValue(&eng, char(123));
+ QVERIFY(val.isNumber());
+ QCOMPARE(val.toInt32(), 123);
+ }
+ {
+ QScriptValue val = qScriptValueFromValue(&eng, uchar(123));
+ QVERIFY(val.isNumber());
+ QCOMPARE(val.toInt32(), 123);
+ }
+ {
+ QDateTime in = QDateTime::currentDateTime();
+ QScriptValue val = qScriptValueFromValue(&eng, in);
+ QVERIFY(val.isDate());
+ QCOMPARE(val.toDateTime(), in);
+ }
+ {
+ QDate in = QDate::currentDate();
+ QScriptValue val = qScriptValueFromValue(&eng, in);
+ QVERIFY(val.isDate());
+ QCOMPARE(val.toDateTime().date(), in);
+ }
+ {
+ QRegExp in = QRegExp("foo");
+ QScriptValue val = qScriptValueFromValue(&eng, in);
+ QVERIFY(val.isRegExp());
+ QCOMPARE(val.toRegExp(), in);
+ }
}
static QScriptValue __import__(QScriptContext *ctx, QScriptEngine *eng)
@@ -3415,5 +3499,49 @@ void tst_QScriptEngine:: incDecNonObjectProperty()
}
}
+void tst_QScriptEngine::installTranslatorFunctions()
+{
+ QScriptEngine eng;
+ QScriptValue global = eng.globalObject();
+ QVERIFY(!global.property("qsTranslate").isValid());
+ QVERIFY(!global.property("QT_TRANSLATE_NOOP").isValid());
+ QVERIFY(!global.property("qsTr").isValid());
+ QVERIFY(!global.property("QT_TR_NOOP").isValid());
+ QVERIFY(!global.property("String").property("prototype").property("arg").isValid());
+
+ eng.installTranslatorFunctions();
+ QVERIFY(global.property("qsTranslate").isFunction());
+ QVERIFY(global.property("QT_TRANSLATE_NOOP").isFunction());
+ QVERIFY(global.property("qsTr").isFunction());
+ QVERIFY(global.property("QT_TR_NOOP").isFunction());
+ QVERIFY(global.property("String").property("prototype").property("arg").isFunction());
+
+ {
+ QScriptValue ret = eng.evaluate("qsTr('foo')");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("foo"));
+ }
+ {
+ QScriptValue ret = eng.evaluate("qsTranslate('foo', 'bar')");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("bar"));
+ }
+ {
+ QScriptValue ret = eng.evaluate("QT_TR_NOOP('foo')");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("foo"));
+ }
+ {
+ QScriptValue ret = eng.evaluate("QT_TRANSLATE_NOOP('foo', 'bar')");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("bar"));
+ }
+ {
+ QScriptValue ret = eng.evaluate("'foo%0'.arg('bar')");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("foobar"));
+ }
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
diff --git a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
index aa5da04..41e14ce 100644
--- a/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
+++ b/tests/auto/qscriptenginedebugger/tst_qscriptenginedebugger.cpp
@@ -118,8 +118,22 @@ void tst_QScriptEngineDebugger::attachAndDetach()
{
QScriptEngineDebugger debugger;
QScriptEngine engine;
+ QScriptValue oldPrint = engine.globalObject().property("print");
+ QVERIFY(oldPrint.isFunction());
+ QVERIFY(!engine.globalObject().property("__FILE__").isValid());
+ QVERIFY(!engine.globalObject().property("__LINE__").isValid());
+
debugger.attachTo(&engine);
+ QVERIFY(engine.globalObject().property("__FILE__").isUndefined());
+ QVERIFY(engine.globalObject().property("__LINE__").isNumber());
+ QVERIFY(!engine.globalObject().property("print").strictlyEquals(oldPrint));
+
debugger.detach();
+ QEXPECT_FAIL("", "Task 256184", Continue);
+ QVERIFY(!engine.globalObject().property("print").isValid());
+ QEXPECT_FAIL("", "Task 256184", Continue);
+ QVERIFY(!engine.globalObject().property("__FILE__").isValid());
+// QVERIFY(!engine.globalObject().property("__LINE__").isValid());
}
{
QScriptEngineDebugger debugger;
diff --git a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
index 2c47c49..24c283e 100644
--- a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
+++ b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp
@@ -1906,6 +1906,22 @@ void tst_QScriptExtQObject::cppConnectAndDisconnect()
QVERIFY(qScriptDisconnect(m_myObject, SIGNAL(mySignal()), QScriptValue(), fun));
QCOMPARE(m_myObject->disconnectedSignal().constData(), SIGNAL(mySignal()));
}
+
+ // bad args
+ QVERIFY(!qScriptConnect(0, SIGNAL(foo()), QScriptValue(), fun));
+ QVERIFY(!qScriptConnect(&edit, 0, QScriptValue(), fun));
+ QVERIFY(!qScriptConnect(&edit, SIGNAL(foo()), QScriptValue(), fun));
+ QVERIFY(!qScriptConnect(&edit, SIGNAL(textChanged(QString)), QScriptValue(), QScriptValue()));
+ QVERIFY(!qScriptDisconnect(0, SIGNAL(foo()), QScriptValue(), fun));
+ QVERIFY(!qScriptDisconnect(&edit, 0, QScriptValue(), fun));
+ QVERIFY(!qScriptDisconnect(&edit, SIGNAL(foo()), QScriptValue(), fun));
+ QVERIFY(!qScriptDisconnect(&edit, SIGNAL(textChanged(QString)), QScriptValue(), QScriptValue()));
+ {
+ QScriptEngine eng2;
+ QScriptValue receiverInDifferentEngine = eng2.newObject();
+ QVERIFY(!qScriptConnect(&edit, SIGNAL(textChanged(QString)), receiverInDifferentEngine, fun));
+ QVERIFY(!qScriptDisconnect(&edit, SIGNAL(textChanged(QString)), receiverInDifferentEngine, fun));
+ }
}
void tst_QScriptExtQObject::classEnums()
diff --git a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
index ad1080a..7901b65 100644
--- a/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
+++ b/tests/auto/qscriptvalue/tst_qscriptvalue.cpp
@@ -1482,21 +1482,43 @@ void tst_QScriptValue::toObject()
{
QScriptValue undefined = QScriptValue(QScriptValue::UndefinedValue);
QVERIFY(!undefined.toObject().isValid());
+ QVERIFY(!eng.toObject(undefined).isValid());
QScriptValue null = QScriptValue(QScriptValue::NullValue);
QVERIFY(!null.toObject().isValid());
+ QVERIFY(!eng.toObject(null).isValid());
QScriptValue falskt = QScriptValue(false);
QVERIFY(!falskt.toObject().isValid());
+ {
+ QScriptValue tmp = eng.toObject(falskt);
+ QVERIFY(tmp.isObject());
+ QVERIFY(tmp.toBool());
+ }
QScriptValue sant = QScriptValue(true);
QVERIFY(!sant.toObject().isValid());
+ {
+ QScriptValue tmp = eng.toObject(sant);
+ QVERIFY(tmp.isObject());
+ QVERIFY(tmp.toBool());
+ }
QScriptValue number = QScriptValue(123.0);
QVERIFY(!number.toObject().isValid());
+ {
+ QScriptValue tmp = eng.toObject(number);
+ QVERIFY(tmp.isObject());
+ QCOMPARE(tmp.toInt32(), number.toInt32());
+ }
- QScriptValue str = QScriptValue(QString("ciao"));
+ QScriptValue str = QScriptValue(QString::fromLatin1("ciao"));
QVERIFY(!str.toObject().isValid());
+ {
+ QScriptValue tmp = eng.toObject(str);
+ QVERIFY(tmp.isObject());
+ QCOMPARE(tmp.toString(), QString::fromLatin1("ciao"));
+ }
}
}
@@ -2360,6 +2382,16 @@ void tst_QScriptValue::call()
QCOMPARE(qIsNaN(ret.toNumber()), true);
}
}
+ {
+ QScriptValue fun = eng.evaluate("Object");
+ QVERIFY(fun.isFunction());
+ QScriptEngine eng2;
+ QScriptValue objectInDifferentEngine = eng2.newObject();
+ QScriptValueList args;
+ args << objectInDifferentEngine;
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::call() failed: cannot call function with argument created in a different engine");
+ fun.call(QScriptValue(), args);
+ }
// test that invalid return value is handled gracefully
{
diff --git a/tests/auto/qtransform/tst_qtransform.cpp b/tests/auto/qtransform/tst_qtransform.cpp
index 3b13a41..99a449a 100644
--- a/tests/auto/qtransform/tst_qtransform.cpp
+++ b/tests/auto/qtransform/tst_qtransform.cpp
@@ -654,7 +654,7 @@ void tst_QTransform::transform()
d.rotate(30);
e.shear(0.5, 0.5);
- QCOMPARE(t, e * d * c * b * a);
+ QVERIFY(qFuzzyCompare(t, e * d * c * b * a));
}
void tst_QTransform::mapEmptyPath()
diff --git a/tests/benchmarks/qdir/qdir.pro b/tests/benchmarks/qdir/qdir.pro
new file mode 100644
index 0000000..2cdebfd
--- /dev/null
+++ b/tests/benchmarks/qdir/qdir.pro
@@ -0,0 +1,8 @@
+load(qttest_p4)
+TEMPLATE = app
+TARGET = tst_qdir
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+SOURCES += tst_qdir.cpp
diff --git a/tests/benchmarks/qdir/tst_qdir.cpp b/tests/benchmarks/qdir/tst_qdir.cpp
new file mode 100644
index 0000000..6405645
--- /dev/null
+++ b/tests/benchmarks/qdir/tst_qdir.cpp
@@ -0,0 +1,98 @@
+#include <QtTest/QtTest>
+
+#include<dirent.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+class Test : public QObject{
+ Q_OBJECT
+public slots:
+ void initTestCase() {
+ QDir testdir = QDir::tempPath();
+
+ const QString subfolder_name = QLatin1String("test_speed");
+ QVERIFY(testdir.mkdir(subfolder_name));
+ QVERIFY(testdir.cd(subfolder_name));
+
+ for (uint i=0; i<10000; ++i) {
+ QFile file(testdir.absolutePath() + "/testfile_" + QString::number(i));
+ file.open(QIODevice::WriteOnly);
+ }
+ }
+ void cleanupTestCase() {
+ {
+ QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
+
+ foreach (const QString &filename, testdir.entryList()) {
+ testdir.remove(filename);
+ }
+ }
+ const QDir temp = QDir(QDir::tempPath());
+ temp.rmdir(QLatin1String("test_speed"));
+ }
+private slots:
+ void sizeSpeed() {
+ QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
+ QBENCHMARK {
+ QFileInfoList fileInfoList = testdir.entryInfoList(QDir::Files, QDir::Unsorted);
+ foreach (const QFileInfo &fileInfo, fileInfoList) {
+ fileInfo.isDir();
+ fileInfo.size();
+ }
+ }
+ }
+ void sizeSpeedWithoutFilter() {
+ QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
+ QBENCHMARK {
+ QFileInfoList fileInfoList = testdir.entryInfoList(QDir::NoFilter, QDir::Unsorted);
+ foreach (const QFileInfo &fileInfo, fileInfoList) {
+ fileInfo.size();
+ }
+ }
+ }
+ void sizeSpeedWithoutFileInfoList() {
+ QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
+ testdir.setSorting(QDir::Unsorted);
+ QBENCHMARK {
+ QStringList fileList = testdir.entryList(QDir::NoFilter, QDir::Unsorted);
+ foreach (const QString &filename, fileList) {
+ QFileInfo fileInfo(filename);
+ fileInfo.size();
+ }
+ }
+ }
+ void iDontWantAnyStat() {
+ QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
+ testdir.setSorting(QDir::Unsorted);
+ testdir.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden);
+ QBENCHMARK {
+ QStringList fileList = testdir.entryList(QDir::NoFilter, QDir::Unsorted);
+ foreach (const QString &filename, fileList) {
+
+ }
+ }
+ }
+#ifndef Q_OS_WIN
+ void testLowLevel() {
+ QDir testdir(QDir::tempPath() + QLatin1String("/test_speed"));
+ DIR *dir = opendir(qPrintable(testdir.absolutePath()));
+ QVERIFY(!chdir(qPrintable(testdir.absolutePath())));
+ QBENCHMARK {
+ struct dirent *item = readdir(dir);
+ while (item) {
+ char *fileName = item->d_name;
+
+ struct stat fileStat;
+ QVERIFY(!stat(fileName, &fileStat));
+
+ item = readdir(dir);
+ }
+ }
+ closedir(dir);
+ }
+#endif
+};
+
+QTEST_MAIN(Test)
+#include "tst_qdir.moc"
diff --git a/tools/linguist/linguist/globals.cpp b/tools/linguist/linguist/globals.cpp
new file mode 100644
index 0000000..697b28b
--- /dev/null
+++ b/tools/linguist/linguist/globals.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Qt Linguist 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$
+**
+****************************************************************************/
+
+#include "globals.h"
+
+const QString &settingsPrefix()
+{
+ static QString prefix = QString(QLatin1String("%1.%2/"))
+ .arg((QT_VERSION >> 16) & 0xff)
+ .arg((QT_VERSION >> 8) & 0xff);
+ return prefix;
+}
+
+QString settingPath(const char *path)
+{
+ return settingsPrefix() + QLatin1String(path);
+}
diff --git a/tools/linguist/linguist/globals.h b/tools/linguist/linguist/globals.h
new file mode 100644
index 0000000..6b7293f
--- /dev/null
+++ b/tools/linguist/linguist/globals.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the Qt Linguist 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 GLOBALS_H
+#define GLOBALS_H
+
+#include <QString>
+
+const QString &settingsPrefix();
+QString settingPath(const char *path);
+
+#endif // GLOBALS_H
diff --git a/tools/linguist/linguist/linguist.pro b/tools/linguist/linguist/linguist.pro
index 968293a..234b0b1 100644
--- a/tools/linguist/linguist/linguist.pro
+++ b/tools/linguist/linguist/linguist.pro
@@ -26,6 +26,7 @@ SOURCES += \
errorsview.cpp \
finddialog.cpp \
formpreviewview.cpp \
+ globals.cpp \
main.cpp \
mainwindow.cpp \
messageeditor.cpp \
@@ -49,6 +50,7 @@ HEADERS += \
errorsview.h \
finddialog.h \
formpreviewview.h \
+ globals.h \
mainwindow.h \
messageeditor.h \
messageeditorwidgets.h \
diff --git a/tools/linguist/linguist/main.cpp b/tools/linguist/linguist/main.cpp
index a6a0d27..98cd876 100644
--- a/tools/linguist/linguist/main.cpp
+++ b/tools/linguist/linguist/main.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "mainwindow.h"
+#include "globals.h"
#include <QtCore/QFile>
#include <QtCore/QLibraryInfo>
@@ -92,13 +93,11 @@ int main(int argc, char **argv)
app.setOrganizationName(QLatin1String("Trolltech"));
app.setApplicationName(QLatin1String("Linguist"));
- QString keybase(QString::number( (QT_VERSION >> 16) & 0xff ) +
- QLatin1Char('.') + QString::number( (QT_VERSION >> 8) & 0xff ) + QLatin1Char('/') );
QSettings config;
QWidget tmp;
- tmp.restoreGeometry(config.value(keybase + QLatin1String("Geometry/WindowGeometry")).toByteArray());
+ tmp.restoreGeometry(config.value(settingPath("Geometry/WindowGeometry")).toByteArray());
QSplashScreen *splash = 0;
int screenId = QApplication::desktop()->screenNumber(tmp.geometry().center());
diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp
index f91175d..783587c 100644
--- a/tools/linguist/linguist/mainwindow.cpp
+++ b/tools/linguist/linguist/mainwindow.cpp
@@ -50,6 +50,7 @@
#include "errorsview.h"
#include "finddialog.h"
#include "formpreviewview.h"
+#include "globals.h"
#include "messageeditor.h"
#include "messagemodel.h"
#include "phrasebookbox.h"
@@ -96,14 +97,6 @@ QT_BEGIN_NAMESPACE
static const int MessageMS = 2500;
-const QString &settingsPrefix()
-{
- static QString prefix = QString(QLatin1String("%1.%2/"))
- .arg((QT_VERSION >> 16) & 0xff)
- .arg((QT_VERSION >> 8) & 0xff);
- return prefix;
-}
-
enum Ending {
End_None,
End_FullStop,
@@ -121,11 +114,10 @@ static bool hasFormPreview(const QString &fileName)
static Ending ending(QString str, QLocale::Language lang)
{
str = str.simplified();
- int ch = 0;
- if (!str.isEmpty())
- ch = str.right(1)[0].unicode();
+ if (str.isEmpty())
+ return End_None;
- switch (ch) {
+ switch (str.at(str.length() - 1).unicode()) {
case 0x002e: // full stop
if (str.endsWith(QLatin1String("...")))
return End_Ellipsis;
@@ -2494,25 +2486,24 @@ void MainWindow::updateDanger(const MultiDataIndex &index, bool verbose)
void MainWindow::readConfig()
{
- QString keybase = settingsPrefix();
QSettings config;
QRect r(pos(), size());
- restoreGeometry(config.value(keybase + QLatin1String("Geometry/WindowGeometry")).toByteArray());
- restoreState(config.value(keybase + QLatin1String("MainWindowState")).toByteArray());
+ restoreGeometry(config.value(settingPath("Geometry/WindowGeometry")).toByteArray());
+ restoreState(config.value(settingPath("MainWindowState")).toByteArray());
m_ui.actionAccelerators->setChecked(
- config.value(keybase + QLatin1String("Validators/Accelerator"), true).toBool());
+ config.value(settingPath("Validators/Accelerator"), true).toBool());
m_ui.actionEndingPunctuation->setChecked(
- config.value(keybase + QLatin1String("Validators/EndingPunctuation"), true).toBool());
+ config.value(settingPath("Validators/EndingPunctuation"), true).toBool());
m_ui.actionPhraseMatches->setChecked(
- config.value(keybase + QLatin1String("Validators/PhraseMatch"), true).toBool());
+ config.value(settingPath("Validators/PhraseMatch"), true).toBool());
m_ui.actionPlaceMarkerMatches->setChecked(
- config.value(keybase + QLatin1String("Validators/PlaceMarkers"), true).toBool());
+ config.value(settingPath("Validators/PlaceMarkers"), true).toBool());
recentFiles().readConfig();
- int size = config.beginReadArray(keybase + QLatin1String("OpenedPhraseBooks"));
+ int size = config.beginReadArray(settingPath("OpenedPhraseBooks"));
for (int i = 0; i < size; ++i) {
config.setArrayIndex(i);
openPhraseBook(config.value(QLatin1String("FileName")).toString());
@@ -2522,23 +2513,22 @@ void MainWindow::readConfig()
void MainWindow::writeConfig()
{
- QString keybase = settingsPrefix();
QSettings config;
- config.setValue(keybase + QLatin1String("Geometry/WindowGeometry"),
+ config.setValue(settingPath("Geometry/WindowGeometry"),
saveGeometry());
- config.setValue(keybase + QLatin1String("Validators/Accelerator"),
+ config.setValue(settingPath("Validators/Accelerator"),
m_ui.actionAccelerators->isChecked());
- config.setValue(keybase + QLatin1String("Validators/EndingPunctuation"),
+ config.setValue(settingPath("Validators/EndingPunctuation"),
m_ui.actionEndingPunctuation->isChecked());
- config.setValue(keybase + QLatin1String("Validators/PhraseMatch"),
+ config.setValue(settingPath("Validators/PhraseMatch"),
m_ui.actionPhraseMatches->isChecked());
- config.setValue(keybase + QLatin1String("Validators/PlaceMarkers"),
+ config.setValue(settingPath("Validators/PlaceMarkers"),
m_ui.actionPlaceMarkerMatches->isChecked());
- config.setValue(keybase + QLatin1String("MainWindowState"),
+ config.setValue(settingPath("MainWindowState"),
saveState());
recentFiles().writeConfig();
- config.beginWriteArray(keybase + QLatin1String("OpenedPhraseBooks"),
+ config.beginWriteArray(settingPath("OpenedPhraseBooks"),
m_phraseBooks.size());
for (int i = 0; i < m_phraseBooks.size(); ++i) {
config.setArrayIndex(i);
diff --git a/tools/linguist/linguist/mainwindow.h b/tools/linguist/linguist/mainwindow.h
index 9f6b4d9..6eed8ac 100644
--- a/tools/linguist/linguist/mainwindow.h
+++ b/tools/linguist/linguist/mainwindow.h
@@ -79,8 +79,6 @@ class Statistics;
class TranslateDialog;
class TranslationSettingsDialog;
-const QString &settingsPrefix();
-
class MainWindow : public QMainWindow
{
Q_OBJECT
diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp
index 6351577..aacf482 100644
--- a/tools/linguist/linguist/messageeditor.cpp
+++ b/tools/linguist/linguist/messageeditor.cpp
@@ -91,9 +91,8 @@ MessageEditor::MessageEditor(MultiDataModel *dataModel, QMainWindow *parent)
m_redoAvail(false),
m_cutAvail(false),
m_copyAvail(false),
- m_sourceSelected(false),
- m_pluralSourceSelected(false),
- m_currentSelected(false)
+ m_selectionHolder(0),
+ m_focusWidget(0)
{
setObjectName(QLatin1String("scroll area"));
@@ -144,12 +143,14 @@ void MessageEditor::setupEditorPage()
m_source = new FormWidget(tr("Source text"), false);
m_source->setHideWhenEmpty(true);
m_source->setWhatsThis(tr("This area shows the source text."));
- connect(m_source, SIGNAL(selectionChanged()), SLOT(selectionChanged()));
+ connect(m_source, SIGNAL(selectionChanged(QTextEdit *)),
+ SLOT(selectionChanged(QTextEdit *)));
m_pluralSource = new FormWidget(tr("Source text (Plural)"), false);
m_pluralSource->setHideWhenEmpty(true);
m_pluralSource->setWhatsThis(tr("This area shows the plural form of the source text."));
- connect(m_pluralSource, SIGNAL(selectionChanged()), SLOT(selectionChanged()));
+ connect(m_pluralSource, SIGNAL(selectionChanged(QTextEdit *)),
+ SLOT(selectionChanged(QTextEdit *)));
m_commentText = new FormWidget(tr("Developer comments"), false);
m_commentText->setHideWhenEmpty(true);
@@ -216,9 +217,11 @@ void MessageEditor::messageModelAppended()
ed.transCommentText->setWhatsThis(tr("Here you can enter comments for your own use."
" They have no effect on the translated applications.") );
ed.transCommentText->getEditor()->installEventFilter(this);
- connect(ed.transCommentText, SIGNAL(selectionChanged()), SLOT(selectionChanged()));
- connect(ed.transCommentText, SIGNAL(textChanged()), SLOT(emitTranslatorCommentChanged()));
- connect(ed.transCommentText, SIGNAL(textChanged()), SLOT(resetHoverSelection()));
+ connect(ed.transCommentText, SIGNAL(selectionChanged(QTextEdit *)),
+ SLOT(selectionChanged(QTextEdit *)));
+ connect(ed.transCommentText, SIGNAL(textChanged(QTextEdit *)),
+ SLOT(emitTranslatorCommentChanged(QTextEdit *)));
+ connect(ed.transCommentText, SIGNAL(textChanged(QTextEdit *)), SLOT(resetHoverSelection()));
connect(ed.transCommentText, SIGNAL(cursorPositionChanged()), SLOT(resetHoverSelection()));
QBoxLayout *box = new QVBoxLayout(ed.container);
box->setMargin(5);
@@ -250,7 +253,7 @@ void MessageEditor::messageModelDeleted(int model)
if (m_currentModel >= 0) {
if (m_currentNumerus >= m_editors[m_currentModel].transTexts.size())
m_currentNumerus = m_editors[m_currentModel].transTexts.size() - 1;
- activeEditor()->getEditor()->setFocus();
+ activeEditor()->setFocus();
} else {
m_currentNumerus = -1;
}
@@ -277,9 +280,11 @@ void MessageEditor::addPluralForm(int model, const QString &label, bool writable
m_editors[model].transTexts.count(), transEditor);
transEditor->getEditor()->installEventFilter(this);
- connect(transEditor, SIGNAL(selectionChanged()), SLOT(selectionChanged()));
- connect(transEditor, SIGNAL(textChanged()), SLOT(emitTranslationChanged()));
- connect(transEditor, SIGNAL(textChanged()), SLOT(resetHoverSelection()));
+ connect(transEditor, SIGNAL(selectionChanged(QTextEdit *)),
+ SLOT(selectionChanged(QTextEdit *)));
+ connect(transEditor, SIGNAL(textChanged(QTextEdit *)),
+ SLOT(emitTranslationChanged(QTextEdit *)));
+ connect(transEditor, SIGNAL(textChanged(QTextEdit *)), SLOT(resetHoverSelection()));
connect(transEditor, SIGNAL(cursorPositionChanged()), SLOT(resetHoverSelection()));
m_editors[model].transTexts << transEditor;
@@ -300,69 +305,52 @@ QStringList MessageEditor::translations(int model) const
return translations;
}
-static bool clearFormSelection(FormWidget *fw, FormWidget *te)
+static void clearSelection(QTextEdit *t)
{
- if (fw != te) {
- QTextEdit *t = fw->getEditor();
- bool oldBlockState = t->blockSignals(true);
- QTextCursor c = t->textCursor();
- c.clearSelection();
- t->setTextCursor(c);
- t->blockSignals(oldBlockState);
- return true;
- }
- return false;
+ bool oldBlockState = t->blockSignals(true);
+ QTextCursor c = t->textCursor();
+ c.clearSelection();
+ t->setTextCursor(c);
+ t->blockSignals(oldBlockState);
}
-// Clear the selection for all textedits except the sender
-void MessageEditor::selectionChanged()
+void MessageEditor::selectionChanged(QTextEdit *te)
{
- if (!resetSelection(qobject_cast<FormWidget *>(sender())))
+ if (te != m_selectionHolder) {
+ if (m_selectionHolder)
+ clearSelection(m_selectionHolder);
+ m_selectionHolder = (te->textCursor().hasSelection() ? te : 0);
updateCanCutCopy();
+ }
}
-bool MessageEditor::resetHoverSelection(FormWidget *fw)
+void MessageEditor::resetHoverSelection()
{
- if (m_sourceSelected) {
- if (clearFormSelection(m_source, fw)) {
- updateCanCutCopy();
- return true;
- }
- } else if (m_pluralSourceSelected) {
- if (clearFormSelection(m_pluralSource, fw)) {
- updateCanCutCopy();
- return true;
- }
- }
- return false;
+ if (m_selectionHolder &&
+ (m_selectionHolder == m_source->getEditor()
+ || m_selectionHolder == m_pluralSource->getEditor()))
+ resetSelection();
}
-bool MessageEditor::resetSelection(FormWidget *fw)
+void MessageEditor::resetSelection()
{
- if (resetHoverSelection(fw))
- return true;
- if (m_currentSelected) {
- MessageEditorData &ed = m_editors[m_currentModel];
- FormWidget *cfw = (m_currentNumerus < 0) ? ed.transCommentText
- : ed.transTexts[m_currentNumerus];
- if (clearFormSelection(cfw, fw)) {
- updateCanCutCopy();
- return true;
- }
+ if (m_selectionHolder) {
+ clearSelection(m_selectionHolder);
+ m_selectionHolder = 0;
+ updateCanCutCopy();
}
- return false;
}
void MessageEditor::activeModelAndNumerus(int *model, int *numerus) const
{
for (int j = 0; j < m_editors.count(); ++j) {
for (int i = 0; i < m_editors[j].transTexts.count(); ++i)
- if (m_editors[j].transTexts[i]->getEditor()->hasFocus()) {
+ if (m_focusWidget == m_editors[j].transTexts[i]->getEditor()) {
*model = j;
*numerus = i;
return;
}
- if (m_editors[j].transCommentText->getEditor()->hasFocus()) {
+ if (m_focusWidget == m_editors[j].transCommentText->getEditor()) {
*model = j;
*numerus = -1;
return;
@@ -372,43 +360,43 @@ void MessageEditor::activeModelAndNumerus(int *model, int *numerus) const
*numerus = -1;
}
-FormWidget *MessageEditor::activeTranslation() const
+QTextEdit *MessageEditor::activeTranslation() const
{
if (m_currentNumerus < 0)
return 0;
- return m_editors[m_currentModel].transTexts[m_currentNumerus];
+ return m_editors[m_currentModel].transTexts[m_currentNumerus]->getEditor();
}
-FormWidget *MessageEditor::activeOr1stTranslation() const
+QTextEdit *MessageEditor::activeOr1stTranslation() const
{
if (m_currentNumerus < 0) {
for (int i = 0; i < m_editors.size(); ++i)
if (m_editors[i].container->isVisible()
&& !m_editors[i].transTexts[0]->getEditor()->isReadOnly())
- return m_editors[i].transTexts[0];
+ return m_editors[i].transTexts[0]->getEditor();
return 0;
}
- return m_editors[m_currentModel].transTexts[m_currentNumerus];
+ return m_editors[m_currentModel].transTexts[m_currentNumerus]->getEditor();
}
-FormWidget *MessageEditor::activeTransComment() const
+QTextEdit *MessageEditor::activeTransComment() const
{
if (m_currentModel < 0 || m_currentNumerus >= 0)
return 0;
- return m_editors[m_currentModel].transCommentText;
+ return m_editors[m_currentModel].transCommentText->getEditor();
}
-FormWidget *MessageEditor::activeEditor() const
+QTextEdit *MessageEditor::activeEditor() const
{
- if (FormWidget *fw = activeTransComment())
- return fw;
+ if (QTextEdit *te = activeTransComment())
+ return te;
return activeTranslation();
}
-FormWidget *MessageEditor::activeOr1stEditor() const
+QTextEdit *MessageEditor::activeOr1stEditor() const
{
- if (FormWidget *fw = activeTransComment())
- return fw;
+ if (QTextEdit *te = activeTransComment())
+ return te;
return activeOr1stTranslation();
}
@@ -528,22 +516,39 @@ bool MessageEditor::eventFilter(QObject *o, QEvent *e)
return decFont(modelForWidget(o));
}
} else if (e->type() == QEvent::FocusIn) {
- int model, numerus;
- activeModelAndNumerus(&model, &numerus);
- if (model != m_currentModel || numerus != m_currentNumerus) {
- resetSelection();
- m_currentModel = model;
- m_currentNumerus = numerus;
- emit activeModelChanged(activeModel());
- updateBeginFromSource();
- updateUndoRedo();
- updateCanPaste();
- }
+ QWidget *widget = static_cast<QWidget *>(o);
+ if (widget != m_focusWidget)
+ trackFocus(widget);
}
return QScrollArea::eventFilter(o, e);
}
+void MessageEditor::grabFocus(QWidget *widget)
+{
+ if (widget != m_focusWidget) {
+ widget->setFocus();
+ trackFocus(widget);
+ }
+}
+
+void MessageEditor::trackFocus(QWidget *widget)
+{
+ m_focusWidget = widget;
+
+ int model, numerus;
+ activeModelAndNumerus(&model, &numerus);
+ if (model != m_currentModel || numerus != m_currentNumerus) {
+ resetSelection();
+ m_currentModel = model;
+ m_currentNumerus = numerus;
+ emit activeModelChanged(activeModel());
+ updateBeginFromSource();
+ updateUndoRedo();
+ updateCanPaste();
+ }
+}
+
void MessageEditor::showNothing()
{
m_source->clearTranslation();
@@ -672,20 +677,20 @@ void MessageEditor::setEditingEnabled(int model, bool enabled)
void MessageEditor::undo()
{
- activeEditor()->getEditor()->document()->undo();
+ activeEditor()->document()->undo();
}
void MessageEditor::redo()
{
- activeEditor()->getEditor()->document()->redo();
+ activeEditor()->document()->redo();
}
void MessageEditor::updateUndoRedo()
{
bool newUndoAvail = false;
bool newRedoAvail = false;
- if (FormWidget *fw = activeEditor()) {
- QTextDocument *doc = fw->getEditor()->document();
+ if (QTextEdit *te = activeEditor()) {
+ QTextDocument *doc = te->document();
newUndoAvail = doc->isUndoAvailable();
newRedoAvail = doc->isRedoAvailable();
}
@@ -703,18 +708,12 @@ void MessageEditor::updateUndoRedo()
void MessageEditor::cut()
{
- QTextEdit *editor = activeEditor()->getEditor();
- if (editor->textCursor().hasSelection())
- editor->cut();
+ m_selectionHolder->cut();
}
void MessageEditor::copy()
{
- QTextEdit *te;
- if ((te = m_source->getEditor())->textCursor().hasSelection()
- || (te = m_pluralSource->getEditor())->textCursor().hasSelection()
- || (te = activeEditor()->getEditor())->textCursor().hasSelection())
- te->copy();
+ m_selectionHolder->copy();
}
void MessageEditor::updateCanCutCopy()
@@ -722,19 +721,9 @@ void MessageEditor::updateCanCutCopy()
bool newCopyState = false;
bool newCutState = false;
- m_sourceSelected = m_source->getEditor()->textCursor().hasSelection();
- m_pluralSourceSelected = m_pluralSource->getEditor()->textCursor().hasSelection();
- m_currentSelected = false;
-
- if (m_sourceSelected || m_pluralSourceSelected) {
+ if (m_selectionHolder) {
newCopyState = true;
- } else if (FormWidget *fw = activeEditor()) {
- QTextEdit *te = fw->getEditor();
- if (te->textCursor().hasSelection()) {
- m_currentSelected = true;
- newCopyState = true;
- newCutState = !te->isReadOnly();
- }
+ newCutState = !m_selectionHolder->isReadOnly();
}
if (newCopyState != m_copyAvail) {
@@ -750,14 +739,14 @@ void MessageEditor::updateCanCutCopy()
void MessageEditor::paste()
{
- activeEditor()->getEditor()->paste();
+ activeEditor()->paste();
}
void MessageEditor::updateCanPaste()
{
- FormWidget *fw;
+ QTextEdit *te;
emit pasteAvailable(!m_clipboardEmpty
- && (fw = activeEditor()) && !fw->getEditor()->isReadOnly());
+ && (te = activeEditor()) && !te->isReadOnly());
}
void MessageEditor::clipboardChanged()
@@ -772,24 +761,23 @@ void MessageEditor::selectAll()
// make sure we don't select the selection of a translator textedit,
// if we really want the source text editor to be selected.
QTextEdit *te;
- FormWidget *fw;
if ((te = m_source->getEditor())->underMouse()
|| (te = m_pluralSource->getEditor())->underMouse()
- || ((fw = activeEditor()) && (te = fw->getEditor())->hasFocus()))
+ || ((te = activeEditor()) && te->hasFocus()))
te->selectAll();
}
-void MessageEditor::emitTranslationChanged()
+void MessageEditor::emitTranslationChanged(QTextEdit *widget)
{
- static_cast<FormWidget *>(sender())->getEditor()->setFocus(); // DND proofness
+ grabFocus(widget); // DND proofness
updateBeginFromSource();
updateUndoRedo();
emit translationChanged(translations(m_currentModel));
}
-void MessageEditor::emitTranslatorCommentChanged()
+void MessageEditor::emitTranslatorCommentChanged(QTextEdit *widget)
{
- static_cast<FormWidget *>(sender())->getEditor()->setFocus(); // DND proofness
+ grabFocus(widget); // DND proofness
updateUndoRedo();
emit translatorCommentChanged(m_editors[m_currentModel].transCommentText->getTranslation());
}
@@ -797,11 +785,9 @@ void MessageEditor::emitTranslatorCommentChanged()
void MessageEditor::updateBeginFromSource()
{
bool overwrite = false;
- if (FormWidget *transForm = activeTranslation()) {
- QTextEdit *activeEditor = transForm->getEditor();
+ if (QTextEdit *activeEditor = activeTranslation())
overwrite = !activeEditor->isReadOnly()
&& activeEditor->toPlainText().trimmed().isEmpty();
- }
emit beginFromSourceAvailable(overwrite);
}
@@ -816,8 +802,8 @@ void MessageEditor::beginFromSource()
void MessageEditor::setEditorFocus()
{
if (!widget()->hasFocus())
- if (FormWidget *transForm = activeOr1stEditor())
- transForm->getEditor()->setFocus();
+ if (QTextEdit *activeEditor = activeOr1stEditor())
+ activeEditor->setFocus();
}
void MessageEditor::setEditorFocus(int model)
diff --git a/tools/linguist/linguist/messageeditor.h b/tools/linguist/linguist/messageeditor.h
index de563ec..9dd26f9 100644
--- a/tools/linguist/linguist/messageeditor.h
+++ b/tools/linguist/linguist/messageeditor.h
@@ -110,10 +110,10 @@ public slots:
void setTranslation(int latestModel, const QString &translation);
private slots:
- void selectionChanged();
- bool resetHoverSelection(FormWidget *fw = 0);
- void emitTranslationChanged();
- void emitTranslatorCommentChanged();
+ void selectionChanged(QTextEdit *);
+ void resetHoverSelection();
+ void emitTranslationChanged(QTextEdit *);
+ void emitTranslatorCommentChanged(QTextEdit *);
void updateCanPaste();
void clipboardChanged();
void messageModelAppended();
@@ -125,13 +125,15 @@ private:
void setupEditorPage();
void setEditingEnabled(int model, bool enabled);
bool focusNextUnfinished(int start);
- bool resetSelection(FormWidget *fw = 0);
+ void resetSelection();
+ void grabFocus(QWidget *widget);
+ void trackFocus(QWidget *widget);
void activeModelAndNumerus(int *model, int *numerus) const;
- FormWidget *activeTranslation() const;
- FormWidget *activeOr1stTranslation() const;
- FormWidget *activeTransComment() const;
- FormWidget *activeEditor() const;
- FormWidget *activeOr1stEditor() const;
+ QTextEdit *activeTranslation() const;
+ QTextEdit *activeOr1stTranslation() const;
+ QTextEdit *activeTransComment() const;
+ QTextEdit *activeEditor() const;
+ QTextEdit *activeOr1stEditor() const;
MessageEditorData *modelForWidget(const QObject *o);
int activeTranslationNumerus() const;
QStringList translations(int model) const;
@@ -151,12 +153,11 @@ private:
bool m_redoAvail;
bool m_cutAvail;
bool m_copyAvail;
- bool m_sourceSelected;
- bool m_pluralSourceSelected;
- bool m_currentSelected;
bool m_clipboardEmpty;
+ QTextEdit *m_selectionHolder;
+ QWidget *m_focusWidget;
QBoxLayout *m_layout;
FormWidget *m_source;
FormWidget *m_pluralSource;
diff --git a/tools/linguist/linguist/messageeditorwidgets.cpp b/tools/linguist/linguist/messageeditorwidgets.cpp
index 7412571..d23d42e 100644
--- a/tools/linguist/linguist/messageeditorwidgets.cpp
+++ b/tools/linguist/linguist/messageeditorwidgets.cpp
@@ -145,16 +145,15 @@ void FormatTextEdit::setEditable(bool editable)
void FormatTextEdit::setPlainText(const QString &text, bool userAction)
{
- bool oldBlockState = false;
if (!userAction) {
// Prevent contentsChanged signal
- oldBlockState = document()->blockSignals(true);
+ bool oldBlockState = blockSignals(true);
document()->setUndoRedoEnabled(false);
ExpandingTextEdit::setPlainText(text);
// highlighter is out of sync because of blocked signals
m_highlighter->rehighlight();
document()->setUndoRedoEnabled(true);
- document()->blockSignals(oldBlockState);
+ blockSignals(oldBlockState);
} else {
ExpandingTextEdit::setPlainText(text);
}
@@ -178,11 +177,21 @@ FormWidget::FormWidget(const QString &label, bool isEditable, QWidget *parent)
setLayout(layout);
- connect(m_editor->document(), SIGNAL(contentsChanged()), SIGNAL(textChanged()));
- connect(m_editor, SIGNAL(selectionChanged()), SIGNAL(selectionChanged()));
+ connect(m_editor, SIGNAL(textChanged()), SLOT(slotTextChanged()));
+ connect(m_editor, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
connect(m_editor, SIGNAL(cursorPositionChanged()), SIGNAL(cursorPositionChanged()));
}
+void FormWidget::slotSelectionChanged()
+{
+ emit selectionChanged(m_editor);
+}
+
+void FormWidget::slotTextChanged()
+{
+ emit textChanged(m_editor);
+}
+
void FormWidget::setTranslation(const QString &text, bool userAction)
{
m_editor->setPlainText(text, userAction);
diff --git a/tools/linguist/linguist/messageeditorwidgets.h b/tools/linguist/linguist/messageeditorwidgets.h
index b1609e5..fa65f3b 100644
--- a/tools/linguist/linguist/messageeditorwidgets.h
+++ b/tools/linguist/linguist/messageeditorwidgets.h
@@ -115,10 +115,14 @@ public:
FormatTextEdit *getEditor() { return m_editor; }
signals:
- void textChanged();
- void selectionChanged();
+ void textChanged(QTextEdit *);
+ void selectionChanged(QTextEdit *);
void cursorPositionChanged();
+private slots:
+ void slotSelectionChanged();
+ void slotTextChanged();
+
private:
QLabel *m_label;
FormatTextEdit *m_editor;
diff --git a/tools/linguist/linguist/phraseview.cpp b/tools/linguist/linguist/phraseview.cpp
index 72c27dc..e5c3508 100644
--- a/tools/linguist/linguist/phraseview.cpp
+++ b/tools/linguist/linguist/phraseview.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include "globals.h"
#include "mainwindow.h"
#include "messagemodel.h"
#include "phrase.h"
@@ -61,7 +62,7 @@ static const int MaxCandidates = 5;
static QString phraseViewHeaderKey()
{
- return settingsPrefix() + QLatin1String("PhraseViewHeader");
+ return settingPath("PhraseViewHeader");
}
PhraseView::PhraseView(MultiDataModel *model, QList<QHash<QString, QList<Phrase *> > > *phraseDict, QWidget *parent)
diff --git a/tools/linguist/linguist/recentfiles.cpp b/tools/linguist/linguist/recentfiles.cpp
index 6fc72f7..568f5c2 100644
--- a/tools/linguist/linguist/recentfiles.cpp
+++ b/tools/linguist/linguist/recentfiles.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "recentfiles.h"
+#include "globals.h"
#include <QtCore/QDebug>
#include <QtCore/QFileInfo>
@@ -49,11 +50,9 @@
QT_BEGIN_NAMESPACE
-const QString &settingsPrefix();
-
static QString configKey()
{
- return settingsPrefix() + QLatin1String("RecentlyOpenedFiles");
+ return settingPath("RecentlyOpenedFiles");
}
diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp
index b9e8406..7f52c53 100644
--- a/tools/linguist/lupdate/cpp.cpp
+++ b/tools/linguist/lupdate/cpp.cpp
@@ -1153,7 +1153,9 @@ bool CppParser::matchString(QString *s)
s->clear();
while (yyTok == Tok_String) {
*s += yyString;
- yyTok = getToken();
+ do {
+ yyTok = getToken();
+ } while (yyTok == Tok_Comment);
}
return matches;
}
diff --git a/tools/linguist/shared/qph.cpp b/tools/linguist/shared/qph.cpp
index 799bf7d..77e74ef 100644
--- a/tools/linguist/shared/qph.cpp
+++ b/tools/linguist/shared/qph.cpp
@@ -54,33 +54,19 @@ QT_BEGIN_NAMESPACE
class QPHReader : public QXmlStreamReader
{
public:
- QPHReader(QIODevice &dev, ConversionData &cd)
- : QXmlStreamReader(&dev), m_cd(cd)
+ QPHReader(QIODevice &dev)
+ : QXmlStreamReader(&dev)
{}
// the "real thing"
bool read(Translator &translator);
private:
- bool elementStarts(const QString &str) const
- {
- return isStartElement() && name() == str;
- }
-
bool isWhiteSpace() const
{
return isCharacters() && text().toString().trimmed().isEmpty();
}
- // needed to expand <byte ... />
- QString readContents();
- // needed to join <lengthvariant>s
- QString readTransContents();
-
- void handleError();
-
- ConversionData &m_cd;
-
enum DataField { NoField, SourceField, TargetField, DefinitionField };
DataField m_currentField;
QString m_currentSource;
@@ -126,10 +112,10 @@ bool QPHReader::read(Translator &translator)
return true;
}
-static bool loadQPH(Translator &translator, QIODevice &dev, ConversionData &cd)
+static bool loadQPH(Translator &translator, QIODevice &dev, ConversionData &)
{
translator.setLocationsType(Translator::NoLocations);
- QPHReader reader(dev, cd);
+ QPHReader reader(dev);
return reader.read(translator);
}
diff --git a/translations/assistant_adp_de.ts b/translations/assistant_adp_de.ts
index db2005a..80b76d3 100644
--- a/translations/assistant_adp_de.ts
+++ b/translations/assistant_adp_de.ts
@@ -939,7 +939,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location/>
<source>Quit Qt Assistant.</source>
- <translation>Beende Qt Assistant.</translation>
+ <translation>Qt Assistant beenden.</translation>
</message>
<message>
<location/>
@@ -949,7 +949,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location/>
<source>Copy the selected text to the clipboard.</source>
- <translation>Kopiere den markierten Text in die Zwischenablage.</translation>
+ <translation>Den markierten Text in die Zwischenablage kopieren.</translation>
</message>
<message>
<location/>
@@ -959,7 +959,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location/>
<source>Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter.</source>
- <translation>Öffne den Suchdialog. Qt Assistant sucht in der aktuellen Seite nach dem eingegebenen Text.</translation>
+ <translation>Den Suchdialog öffnen. Qt Assistant sucht in der aktuellen Seite nach dem eingegebenen Text.</translation>
</message>
<message>
<location/>
@@ -969,7 +969,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location/>
<source>Go to the home page. Qt Assistant&apos;s home page is the Qt Reference Documentation.</source>
- <translation>Gehe zur Startseite. Qt Assistants Startseite ist die Qt Referenzdokumentation.</translation>
+ <translation>Zur Startseite gehen. Startseite im Qt Assistant ist die Qt-Referenzdokumentation.</translation>
</message>
<message>
<location/>
@@ -999,7 +999,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location/>
<source>Display further information about Qt Assistant.</source>
- <translation>Zeigt das Qt Designer Handbuch an.</translation>
+ <translation>Zeigt das Handbuch zum Qt Designer an.</translation>
</message>
<message>
<location/>
@@ -1052,7 +1052,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location/>
<source>Qt Assistant Manual</source>
- <translation>Zeigt das Qt Assistant Handbuch an.</translation>
+ <translation>Handbuch zu Qt Assistant</translation>
</message>
<message>
<location/>
@@ -1062,7 +1062,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location/>
<source>Add the currently displayed page as a new bookmark.</source>
- <translation>Füge aktuelle Seite zu den Lesezeichen hinzu.</translation>
+ <translation>Aktuelle Seite zu den Lesezeichen hinzufügen.</translation>
</message>
<message>
<location/>
@@ -1087,7 +1087,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location line="-33"/>
<source>Initializing Qt Assistant...</source>
- <translation>Initialisiere Qt Assistant...</translation>
+ <translation>Qt Assistant wird initialisiert...</translation>
</message>
<message>
<location filename="../tools/assistant/compat/mainwindow.ui"/>
@@ -1170,7 +1170,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location filename="../tools/assistant/compat/mainwindow.cpp" line="+191"/>
<source>Failed to open about application contents in file: &apos;%1&apos;</source>
- <translation>Fehler beim öffnen des Inhalts in Datei: &apos;%1&apos;</translation>
+ <translation>Fehler beim Öffnen des Inhalts in Datei: &apos;%1&apos;</translation>
</message>
<message>
<source>Error...</source>
@@ -1252,7 +1252,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location line="+0"/>
<source>Cannot open file for writing!</source>
- <translation>Die Datei konnte nicht zum schreiben geöffnet werden!</translation>
+ <translation>Die Datei konnte nicht zum Schreiben geöffnet werden.</translation>
</message>
<message>
<location filename="../tools/assistant/compat/mainwindow.ui"/>
@@ -1267,12 +1267,12 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location/>
<source>Sync with Table of Contents</source>
- <translation>Seite mit Inhalt Tab syncronisieren</translation>
+ <translation>Seite mit Inhalt-Tab syncronisieren</translation>
</message>
<message>
<location/>
<source>Select the page in contents tab.</source>
- <translation>Wählt die Seite im Inhalt Tab aus.</translation>
+ <translation>Wählt die Seite im Inhalt-Tab aus.</translation>
</message>
<message>
<location/>
@@ -1289,7 +1289,7 @@ Bitte überprüfen Sie, das dieser an der angegeben Stelle existiert.</translati
<message>
<location filename="../tools/assistant/compat/config.cpp" line="+350"/>
<source>Qt Assistant by Nokia</source>
- <translation type="unfinished"></translation>
+ <translation>Qt Assistant von Nokia</translation>
</message>
</context>
<context>
@@ -1497,22 +1497,22 @@ Es müssen zuerst alle Inhalte gelöscht werden.</translation>
<message>
<location filename="../tools/assistant/compat/tabbedbrowser.ui"/>
<source>Previous</source>
- <translation>Vorherige</translation>
+ <translation>Vorheriger</translation>
</message>
<message>
<location/>
<source>Next</source>
- <translation>Nächste</translation>
+ <translation>Nächster</translation>
</message>
<message>
<location/>
<source>Case Sensitive</source>
- <translation>Groß/ Kleinschreibung beachten</translation>
+ <translation>Groß-/Kleinschreibung beachten</translation>
</message>
<message>
<location/>
<source>Whole words</source>
- <translation>Gesamte Worte</translation>
+ <translation>Ganze Wörter</translation>
</message>
<message>
<location/>
diff --git a/translations/assistant_de.ts b/translations/assistant_de.ts
index 9b0d628..72b24b6 100644
--- a/translations/assistant_de.ts
+++ b/translations/assistant_de.ts
@@ -409,12 +409,12 @@
<message>
<location line="-70"/>
<source>Documentation info file is corrupt!</source>
- <translation>Die Dokumentationsdatei ist beschädigt!</translation>
+ <translation>Die Dokumentationsdatei ist beschädigt.</translation>
</message>
<message>
<location line="+37"/>
<source>Download failed: Downloaded file is corrupted.</source>
- <translation>Herunterladen fehlgeschlagen: Die Datei ist warscheinlich beschädigt!</translation>
+ <translation>Herunterladen fehlgeschlagen: Die Datei ist warscheinlich beschädigt.</translation>
</message>
<message>
<location line="+2"/>
@@ -775,7 +775,7 @@
<message>
<location line="-601"/>
<source>Looking for Qt Documentation...</source>
- <translation>Suche nach Qt Dokumentationen...</translation>
+ <translation>Suche nach Qt-Dokumentation...</translation>
</message>
<message>
<location line="+195"/>
@@ -858,7 +858,7 @@
</message>
<message>
<source>Download from Help Server...</source>
- <translation type="obsolete">Von Helpserver herunterladen...</translation>
+ <translation type="obsolete">Von Hilfe-Server herunterladen...</translation>
</message>
<message>
<location filename="../tools/assistant/tools/assistant/preferencesdialog.cpp" line="+256"/>
@@ -869,17 +869,17 @@
<message>
<location line="-43"/>
<source>Qt Compressed Help Files (*.qch)</source>
- <translation>Komprimierte Hilfe Dateien (*.qch)</translation>
+ <translation>Komprimierte Hilfe-Dateien (*.qch)</translation>
</message>
<message>
<location line="+37"/>
<source>The specified file is not a valid Qt Help File!</source>
- <translation>Die angegebene Datei ist keine Qt Hilfe Datei!</translation>
+ <translation>Die angegebene Datei ist keine Qt-Hilfe-Datei.</translation>
</message>
<message>
<location line="-8"/>
<source>The namespace %1 is already registered!</source>
- <translation>Der Namespace %1 ist bereits registriert!</translation>
+ <translation>Der Namespace %1 ist bereits registriert.</translation>
</message>
<message>
<location line="+31"/>
@@ -1025,22 +1025,22 @@
<message>
<location filename="../tools/assistant/tools/assistant/cmdlineparser.cpp" line="+112"/>
<source>The specified collection file does not exist!</source>
- <translation>Die angegeben Katalogdatei (collection file) konnte nicht gefunden werden!</translation>
+ <translation>Die angegebene Katalogdatei (collection file) kann nicht gefunden werden.</translation>
</message>
<message>
<location line="+4"/>
<source>Missing collection file!</source>
- <translation>Fehlende Katalogdatei (collection file)!</translation>
+ <translation>Fehlende Katalogdatei.</translation>
</message>
<message>
<location line="+9"/>
<source>Invalid URL!</source>
- <translation>Unbekannte URL!</translation>
+ <translation>Unbekannte URL.</translation>
</message>
<message>
<location line="+4"/>
<source>Missing URL!</source>
- <translation>Fehlende URL!</translation>
+ <translation>Fehlende URL.</translation>
</message>
<message>
<location line="+17"/>
@@ -1054,24 +1054,24 @@
<location line="+19"/>
<location line="+19"/>
<source>Missing widget!</source>
- <translation>Fehlendes Objekt!</translation>
+ <translation>Fehlendes Objekt.</translation>
</message>
<message>
<location line="+7"/>
<location line="+12"/>
<source>The specified Qt help file does not exist!</source>
- <translation>Die angegeben Hilfe Datei konnte nicht gefunden werden!</translation>
+ <translation>Die angegebene Hilfedatei kann nicht gefunden werden.</translation>
</message>
<message>
<location line="-7"/>
<location line="+12"/>
<source>Missing help file!</source>
- <translation>Fehlende Hilfedatei!</translation>
+ <translation>Fehlende Hilfedatei.</translation>
</message>
<message>
<location line="+7"/>
<source>Missing filter argument!</source>
- <translation>Das Filter-Argument fehlt!</translation>
+ <translation>Das Filter-Argument fehlt.</translation>
</message>
<message>
<location line="+12"/>
@@ -1115,12 +1115,12 @@ Reason:
<message>
<location line="+40"/>
<source>Cannot load sqlite database driver!</source>
- <translation>Der Datenbanktreiber für SQLite kann nicht geladen werden!</translation>
+ <translation>Der Datenbanktreiber für SQLite kann nicht geladen werden.</translation>
</message>
<message>
<location line="+9"/>
<source>The specified collection file could not be read!</source>
- <translation>Die angegeben Katalogdatei (collection file) konnte nicht gelesen werden!</translation>
+ <translation>Die angegebene Katalogdatei (collection file) kann nicht gelesen werden.</translation>
</message>
<message>
<location filename="../tools/assistant/tools/assistant/bookmarkmanager.cpp" line="+167"/>
diff --git a/translations/designer_de.ts b/translations/designer_de.ts
index 002fc8d..5109544 100644
--- a/translations/designer_de.ts
+++ b/translations/designer_de.ts
@@ -1703,7 +1703,7 @@ Script: %3</source>
<message>
<location line="+31"/>
<source>Qt Designer &amp;Help</source>
- <translation>Qt Designer &amp;Hilfe</translation>
+ <translation>&amp;Hilfe zum Qt Designer</translation>
</message>
<message>
<location line="+7"/>
@@ -1713,7 +1713,7 @@ Script: %3</source>
<message>
<location line="+7"/>
<source>What&apos;s New in Qt Designer?</source>
- <translation>Was gibt es Neues beim Qt Designer?</translation>
+ <translation>Was gibt es Neues beim Qt Designer?</translation>
</message>
<message>
<location line="+7"/>
@@ -1742,14 +1742,14 @@ Script: %3</source>
<location line="+37"/>
<location line="+160"/>
<source>Designer UI files (*.%1);;All Files (*)</source>
- <translation>Designer UI-Dateien (*.%1);;Alle Dateien (*)</translation>
+ <translation>Designer-UI-Dateien (*.%1);;Alle Dateien (*)</translation>
</message>
<message>
<location line="-615"/>
<source>%1 already exists.
Do you want to replace it?</source>
<translation>Die Datei %1 existiert bereits.
-Wollen Sie sie überschreiben?</translation>
+Möchten Sie sie überschreiben?</translation>
</message>
<message>
<location line="-26"/>
@@ -1769,7 +1769,7 @@ Wollen Sie sie überschreiben?</translation>
<message>
<location line="+0"/>
<source>Feature not implemented yet!</source>
- <translation>Diese Funktionalität ist noch nicht implementiert!</translation>
+ <translation>Diese Funktionalität ist noch nicht implementiert.</translation>
</message>
<message>
<location line="+59"/>
@@ -5750,12 +5750,12 @@ Please select another name.</source>
<message>
<location line="+1"/>
<source>Scan for newly installed custom widget plugins.</source>
- <translation>Sucht nach neuinstallierten Plugins mit benutzerdefinierten Widgets.</translation>
+ <translation>Nach neu installierten Plugins mit benutzerdefinierten Widgets suchen.</translation>
</message>
<message>
<location line="+48"/>
<source>Qt Designer couldn&apos;t find any plugins</source>
- <translation>Qt Designer konnte keine plugins finden</translation>
+ <translation>Qt Designer kann keine Plugins finden</translation>
</message>
<message>
<location line="+3"/>
@@ -6420,7 +6420,7 @@ Klasse: %2</translation>
<message>
<location line="-50"/>
<source>&lt;html&gt;Enter a Qt Script snippet to be executed while loading the form.&lt;br&gt;The widget and its children are accessible via the variables &lt;i&gt;widget&lt;/i&gt; and &lt;i&gt;childWidgets&lt;/i&gt;, respectively.</source>
- <translation>&lt;html&gt;Geben Sie ein Qt Script zur Ausführung während des Formularaufbaus ein.&lt;br&gt;Auf das Widget und seine untergeordneten Widgets kann durch die Variablen &lt;i&gt;widget&lt;/i&gt; und &lt;i&gt;childWidgets&lt;/i&gt; zugegriffen werden.</translation>
+ <translation>&lt;html&gt;Geben Sie ein Qt-Skript zur Ausführung während des Formularaufbaus ein.&lt;br&gt;Auf das Widget und seine untergeordneten Widgets kann durch die Variablen &lt;i&gt;widget&lt;/i&gt; und &lt;i&gt;childWidgets&lt;/i&gt; zugegriffen werden.</translation>
</message>
</context>
<context>
diff --git a/translations/linguist_de.ts b/translations/linguist_de.ts
index cb8e4d2..5e9712c 100644
--- a/translations/linguist_de.ts
+++ b/translations/linguist_de.ts
@@ -21,7 +21,7 @@
<message>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="+1357"/>
<source>Qt Linguist</source>
- <translation>QT Linguist</translation>
+ <translation>Qt Linguist</translation>
</message>
</context>
<context>
@@ -577,7 +577,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Open a Qt translation source file (TS file) for editing</source>
- <translation>Öffne eine QT Übersetzungsdatei (TS Datei) zum bearbeiten</translation>
+ <translation>Qt-Übersetzungsdatei (TS-Datei) zum Bearbeiten öffnen</translation>
</message>
<message>
<location/>
@@ -592,7 +592,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Close this window and exit.</source>
- <translation>Beende das Programm.</translation>
+ <translation>Dieses Fenster schließen und das Programm beenden.</translation>
</message>
<message>
<location/>
@@ -608,7 +608,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>Save changes made to this Qt translation source file</source>
- <translation>Sichere Änderungen an der Qt Übersetzungsdatei</translation>
+ <translation>Änderungen an der Qt-Übersetzungsdatei speichern</translation>
</message>
<message>
<location/>
@@ -618,7 +618,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Move to the previous unfinished item.</source>
- <translation>Gehe zum vorangehenden unerledigten Eintrag.</translation>
+ <translation>Zum vorherigen unerledigten Eintrag gehen.</translation>
</message>
<message>
<location/>
@@ -628,77 +628,77 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Move to the next unfinished item.</source>
- <translation>Gehe zum nächsten unerledigten Eintrag.</translation>
+ <translation>Zum nächsten unerledigten Eintrag gehen.</translation>
</message>
<message>
<location/>
<source>Move to previous item.</source>
- <translation>Gehe zum vorigen Eintrag.</translation>
+ <translation>Zum vorigen Eintrag gehen.</translation>
</message>
<message>
<location/>
<source>Move to the previous item.</source>
- <translation>Gehe zum vorigen Eintrag.</translation>
+ <translation>Zum vorigen Eintrag gehen.</translation>
</message>
<message>
<location/>
<source>Next item.</source>
- <translation>Nächster EIntrag.</translation>
+ <translation>Nächster Eintrag.</translation>
</message>
<message>
<location/>
<source>Move to the next item.</source>
- <translation>Gehe zum nächsten Eintrag.</translation>
+ <translation>Zum nächsten Eintrag gehen.</translation>
</message>
<message>
<location/>
<source>Mark item as done and move to the next unfinished item.</source>
- <translation>Markiere Eintrag als erledigt und gehe zum nächsten unerledigten Eintrag.</translation>
+ <translation>Eintrag als erledigt markieren und zum nächsten unerledigten Eintrag gehen.</translation>
</message>
<message>
<location/>
<source>Mark this item as done and move to the next unfinished item.</source>
- <translation>Markiert diesen Eintrag als erledigt und geht zum nächsten unerledigten Eintrag.</translation>
+ <translation>Diesen Eintrag als erledigt markieren und zum nächsten unerledigten Eintrag gehen.</translation>
</message>
<message>
<location/>
<source>Copy from source text</source>
- <translation>Übernehme &amp;Ursprungstext</translation>
+ <translation>&amp;Ursprungstext übernehmen</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of accelerators.</source>
- <translation>Schalte Prüfung der Tastenkürzel um.</translation>
+ <translation>Prüfung der Tastenkürzel ein- bzw. ausschalten.</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window.</source>
- <translation>Schalte Prüfung der Tastenkürzel um; das heisst, die Übereinstimmung der kaufmännischen Und-Zeichen in Quelle und Übersetzung. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
+ <translation>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.</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of ending punctuation.</source>
- <translation>Schalte Prüfung der Satzendezeichen am Ende des Textes um.</translation>
+ <translation>Prüfung der Satzendezeichen am Ende des Textes ein- bzw. ausschalten.</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window.</source>
- <translation>Schaltet die Prüfung der Satzendezeichen am Ende des Textes um. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
+ <translation>Die Prüfung der Satzendezeichen am Ende des Textes ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
</message>
<message>
<location/>
<source>Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window.</source>
- <translation>Schaltet die Prüfung der Verwendung der Wörterbuchvorschläge um. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
+ <translation>Die Prüfung der Verwendung der Wörterbuchvorschläge ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of place markers.</source>
- <translation>Schaltet die Prüfung der Platzhalter um.</translation>
+ <translation>Prüfung der Platzhalter ein- bzw. ausschalten.</translation>
</message>
<message>
<location/>
<source>Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window.</source>
- <translation>Schaltet die Prüfung der Platzhalter um; das heisst, ob %1, %2,... in Quelltext und Übersetzung übereinstimmend verwendet werden. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
+ <translation>Die Prüfung der Platzhalter, das heißt, ob %1, %2 usw. in Quelltext und Übersetzung übereinstimmend verwendet werden, ein- bzw. ausschalten. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt.</translation>
</message>
<message>
<location/>
@@ -708,7 +708,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>&amp;Save All</source>
- <translation>&amp;Alles Speichern</translation>
+ <translation>&amp;Alles speichern</translation>
</message>
<message>
<location/>
@@ -730,7 +730,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Save changes made to this Qt translation source file into a new file.</source>
- <translation>Speichere Änderungen an dieser Qt Übersetzungsdatei in einer neuen Datei.</translation>
+ <translation>Änderungen an dieser Qt-Übersetzungsdatei in einer neuen Datei speichern.</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="+4"/>
@@ -740,7 +740,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>Create a Qt message file suitable for released applications from the current message file.</source>
- <translation>Erzeuge eine Qt Nachrichtendatei (qm) aus der aktuellen Übersetzungsdatei.</translation>
+ <translation>Qt-Nachrichtendatei (QM-Datei) aus der aktuellen Übersetzungsdatei erzeugen.</translation>
</message>
<message>
<location/>
@@ -783,7 +783,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Undo the last editing operation performed on the current translation.</source>
- <translation>Mache die letzte Änderung an der Übersetzung rückgängig.</translation>
+ <translation>Die letzte Änderung an der Übersetzung rückgängig machen.</translation>
</message>
<message>
<location/>
@@ -798,7 +798,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Redo an undone editing operation performed on the translation.</source>
- <translation>Stelle letzte rückgängig gemachte Änderung wieder her.</translation>
+ <translation>Die letzte rückgängig gemachte Änderung wieder herstellen.</translation>
</message>
<message>
<location/>
@@ -813,7 +813,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Copy the selected translation text to the clipboard and deletes it.</source>
- <translation>Kopiere den ausgewählten Übersetzungstext in die Zwischenablage und lösche ihn.</translation>
+ <translation>Den ausgewählten Übersetzungstext in die Zwischenablage kopieren und löschen.</translation>
</message>
<message>
<location/>
@@ -828,7 +828,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Copy the selected translation text to the clipboard.</source>
- <translation>Kopiere den ausgewählten Übersetzungstext zur Zwischenablage.</translation>
+ <translation>Den ausgewählten Übersetzungstext in die Zwischenablage kopieren.</translation>
</message>
<message>
<location/>
@@ -843,7 +843,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Paste the clipboard text into the translation.</source>
- <translation>Füge den Text aus der Zwischenablage in die Übersetzung ein</translation>
+ <translation>Text aus der Zwischenablage in die Übersetzung einfügen.</translation>
</message>
<message>
<location/>
@@ -858,7 +858,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Select the whole translation text.</source>
- <translation>Den gesamte Übersetzungstext auswählen.</translation>
+ <translation>Den gesamten Übersetzungstext auswählen.</translation>
</message>
<message>
<location/>
@@ -1107,7 +1107,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Display information about the Qt toolkit by Trolltech.</source>
- <translation>Zeige Informationen über das Qt Toolkit von Trolltech an.</translation>
+ <translation>Informationen über das Qt-Toolkit von Trolltech an.</translation>
</message>
<message>
<location/>
@@ -1122,7 +1122,7 @@ p, li { white-space: pre-wrap; }
<message>
<location/>
<source>Enter What&apos;s This? mode.</source>
- <translation>Aktiviere den Direkthilfemodus.</translation>
+ <translation>Direkthilfe-Modus aktivieren.</translation>
</message>
<message>
<location/>
@@ -1148,7 +1148,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>Batch translate all entries using the information in the phrase books.</source>
- <translation>Übersetze alle Einträge automatisch mit Hilfe des Wörterbuchs.</translation>
+ <translation>Alle Einträge automatisch mit Hilfe des Wörterbuchs übersetzen.</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="-34"/>
@@ -1160,7 +1160,7 @@ p, li { white-space: pre-wrap; }
<message>
<location filename="../tools/linguist/linguist/mainwindow.ui"/>
<source>Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the .ts file.</source>
- <translation>Eryeuge eine Qt Nachrichtendatei aus der aktuellen Übersetzungsdatei. Der Dateiname wird automatisch aus dem Namen der .ts Datei abgeleitet.</translation>
+ <translation>Eine Qt-Nachrichtendatei aus der aktuellen Übersetzungsdatei erzeugen. Der Dateiname wird automatisch aus dem Namen der .ts-Datei abgeleitet.</translation>
</message>
<message>
<location filename="../tools/linguist/linguist/mainwindow.cpp" line="-2004"/>
@@ -1285,7 +1285,7 @@ Soll die erstgenannte Datei übersprungen werden?</translation>
<location line="-1163"/>
<source>Qt message files for released applications (*.qm)
All files (*)</source>
- <translation>Qt Nachrichtendateien (*.qm)
+ <translation>Qt-Nachrichtendateien (*.qm)
Alle Dateien (*)</translation>
</message>
<message>
@@ -1373,7 +1373,7 @@ Alle Dateien (*)</translation>
<message>
<location line="-82"/>
<source>Search And Translate in &apos;%1&apos; - Qt Linguist</source>
- <translation>Suchen und übersetzen &apos;%1&apos; - Qt Linguist</translation>
+ <translation>Suchen und übersetzen in &apos;%1&apos; - Qt Linguist</translation>
</message>
<message>
<location line="+34"/>
@@ -1393,7 +1393,7 @@ Alle Dateien (*)</translation>
<message>
<location line="+23"/>
<source>No more occurrences of &apos;%1&apos;. Start over?</source>
- <translation>Keine weiteren Fundstellen von &apos;%1&apos;. Von vorn beginnen?</translation>
+ <translation>Keine weiteren Fundstellen von &apos;%1&apos;. Von vorne beginnen?</translation>
</message>
<message>
<location line="+30"/>
@@ -1404,7 +1404,7 @@ Alle Dateien (*)</translation>
<location line="+1"/>
<source>Qt phrase books (*.qph)
All files (*)</source>
- <translation>Qt Wörterbücher (*.qph)
+ <translation>Qt-Wörterbücher (*.qph)
Alle Dateien (*)</translation>
</message>
<message>
@@ -1415,12 +1415,12 @@ Alle Dateien (*)</translation>
<message>
<location line="+17"/>
<source>Open Phrase Book</source>
- <translation>Öffne Wörterbuch</translation>
+ <translation>Wörterbuch öffnen</translation>
</message>
<message>
<location line="+1"/>
<source>Qt phrase books (*.qph);;All files (*)</source>
- <translation>Qt Wörterbücher (*.qph);;Alle Dateien (*)</translation>
+ <translation>Qt-Wörterbücher (*.qph);;Alle Dateien (*)</translation>
</message>
<message numerus="yes">
<location line="+7"/>
@@ -1455,7 +1455,7 @@ Alle Dateien (*)</translation>
<message>
<location line="+29"/>
<source>Unable to launch Qt Assistant (%1)</source>
- <translation>Kann Qt Assistant nicht starten (%1)</translation>
+ <translation>Qt Assistant kann nicht gestartet werden (%1)</translation>
</message>
<message>
<location line="+17"/>
@@ -1469,7 +1469,7 @@ Alle Dateien (*)</translation>
<message>
<location line="+6"/>
<source>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist is a tool for adding translations to Qt applications.&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</source>
- <translation>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist ist ein Werkzeug zum Übersetzen von Qt Anwendungen.&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</translation>
+ <translation>&lt;center&gt;&lt;img src=&quot;:/images/splash.png&quot;/&gt;&lt;/img&gt;&lt;p&gt;%1&lt;/p&gt;&lt;/center&gt;&lt;p&gt;Qt Linguist ist ein Werkzeug zum Übersetzen von Qt-Anwendungen.&lt;/p&gt;&lt;p&gt;%2&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.&lt;/p&gt;</translation>
</message>
<message>
<location line="+41"/>
@@ -2114,22 +2114,22 @@ Zeile: %2</translation>
<message>
<location filename="../tools/linguist/shared/ui.cpp" line="+213"/>
<source>Qt Designer form files</source>
- <translation>Qt Designer Formulardateien</translation>
+ <translation>Formulardateien für Qt Designer</translation>
</message>
<message>
<location line="+9"/>
<source>Qt Jambi form files</source>
- <translation>Qt Jambi Formulardateien</translation>
+ <translation>Formulardateien für Qt Jambi</translation>
</message>
<message>
<location filename="../tools/linguist/shared/xliff.cpp" line="+817"/>
<source>XLIFF localization files</source>
- <translation>XLIFF Übersetzungsdateien</translation>
+ <translation>XLIFF-Übersetzungsdateien</translation>
</message>
<message>
<location filename="../tools/linguist/shared/qph.cpp" line="+192"/>
<source>Qt Linguist &apos;Phrase Book&apos;</source>
- <translation>Qt Linguist-Wörterbuch</translation>
+ <translation>Qt-Linguist-Wörterbuch</translation>
</message>
</context>
<context>
diff --git a/translations/qt_de.ts b/translations/qt_de.ts
index f623925..0d3686c 100644
--- a/translations/qt_de.ts
+++ b/translations/qt_de.ts
@@ -2983,7 +2983,7 @@ Möchten Sie die Datei trotzdem löschen?</translation>
<message>
<location line="+1573"/>
<source>&lt;h3&gt;About Qt&lt;/h3&gt;&lt;p&gt;This program uses Qt version %1.&lt;/p&gt;&lt;p&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;&lt;p&gt;Qt provides single-source portability across MS&amp;nbsp;Windows, Mac&amp;nbsp;OS&amp;nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.&lt;/p&gt;&lt;p&gt;Qt is available under three different licensing options designed to accommodate the needs of our various users.&lt;/p&gt;Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.&lt;/p&gt;&lt;p&gt;Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.&lt;/p&gt;&lt;p&gt;Please see &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).&lt;/p&gt;&lt;p&gt;Qt is a Nokia product. See &lt;a href=&quot;http://www.qtsoftware.com/qt/&quot;&gt;www.qtsoftware.com/qt&lt;/a&gt; for more information.&lt;/p&gt;</source>
- <translation type="unfinished"></translation>
+ <translation>&lt;h3&gt;Über Qt&lt;/h3&gt;&lt;p&gt;Dieses Programm verwendet Qt in Version %1.&lt;/p&gt;&lt;p&gt;Qt ist ein C++-Toolkit zur plattformübergreifenden Anwendungsentwicklung.&lt;/p&gt;&lt;p&gt;Qt bietet Single-Source-Übertragbarkeit von MS&amp;nbsp;Windows über Mac&amp;nbsp;OS&amp;nbsp;X bis zu Linux und alle großen kommerziellen Unix-Varianten. Zudem ist Qt für Embedded Linux und Windows CE für eingebettete Systeme verfügbar.&lt;/p&gt;&lt;p&gt;Qt wird unter drei verschiedenen Lizenzen angeboten, um den Wünschen unserer Kunden zu entsprechen.&lt;/p&gt;&lt;p&gt;Qt unter unserer kommerziellen Lizenz dient der Entwicklung proprietärer/kommerzieller Software, deren Quelltexte Sie nicht offenlegen möchten, oder wenn sie auf andere Weise nicht den Vereinbarungen der GNU LGPL Version 2.1 oder der GNU GPL Version 3.0 erfüllen können.&lt;/p&gt;&lt;p&gt;Qt unter der GNU LGPL Version 2.1 dient der Entwicklung von Qt-Anwendungen (proprietär oder quelloffen), sofern Sie den Vereinbarungen der GNU LGPL Version 2.1 entsprechen können.&lt;/p&gt;&lt;p&gt;Qt unter der GNU General Public License Version 3.0 dient der Entwicklung von Qt-Anwendungen, die in Verbindung mit Software verwendet werden soll, die den Vereinbarungen der GNU GPL Version 3.0 entspricht, oder die aus anderen Gründen den Bestimmungen der GNU GPL Version 3.0 unterliegen soll.&lt;/p&gt;&lt;p&gt;Auf &lt;a href=&quot;http://www.qtsoftware.com/products/licensing&quot;&gt;www.qtsoftware.com/products/licensing&lt;/a&gt; finden Sie eine Übersicht der Lizenzen.&lt;/p&gt;&lt;p&gt;Copyright (C) 2009 Nokia Corporation und/oder ihre Tochtergesellschaft(en).&lt;/p&gt;&lt;p&gt;Qt ist ein Produkt der Firma Nokia. Auf &lt;a href=&quot;http://www.qtsoftware.com/qt/&quot;&gt;www.qtsoftware.com/qt&lt;/a&gt; erhalten Sie weitere Informationen.&lt;/p&gt;</translation>
</message>
</context>
<context>
@@ -6152,32 +6152,32 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location line="+3"/>
<source>Select to the next character</source>
- <translation>Bis zum folgenden Zeichen markieren</translation>
+ <translation>Bis zum nächsten Zeichen markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the previous character</source>
- <translation>Bis zum vorangehenden Zeichen markieren</translation>
+ <translation>Bis zum vorherigen Zeichen markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the next word</source>
- <translation>Bis zum folgenden Wort markieren</translation>
+ <translation>Bis zum nachsten Wort markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the previous word</source>
- <translation>Bis zum vorangehenden Wort markieren</translation>
+ <translation>Bis zum vorherigen Wort markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the next line</source>
- <translation>Bis zur folgenden Zeile markieren</translation>
+ <translation>Bis zur nächsten Zeile markieren</translation>
</message>
<message>
<location line="+3"/>
<source>Select to the previous line</source>
- <translation>Bis zur vorangehenden Zeile markieren</translation>
+ <translation>Bis zur vorherigen Zeile markieren</translation>
</message>
<message>
<location line="+3"/>
@@ -7087,7 +7087,7 @@ Bitte wählen Sie einen anderen Dateinamen.</translation>
<message>
<location filename="../src/xmlpatterns/expr/qattributenamevalidator.cpp" line="+66"/>
<source>The namespace URI in the name for a computed attribute cannot be %1.</source>
- <translation>Der Namensraum-URI im Namen eines berechneten Attributes darf nicht %1 sein</translation>
+ <translation>Der Namensraum-URI im Namen eines berechneten Attributes darf nicht %1 sein.</translation>
</message>
<message>
<location line="+9"/>
diff --git a/translations/qt_help_de.ts b/translations/qt_help_de.ts
index 8f67ec3..9d48661 100644
--- a/translations/qt_help_de.ts
+++ b/translations/qt_help_de.ts
@@ -6,7 +6,7 @@
<message>
<location filename="../tools/assistant/lib/qhelpsearchresultwidget.cpp" line="+110"/>
<source>Search Results</source>
- <translation>Ergebnisse</translation>
+ <translation>Suchergebnisse</translation>
</message>
<message>
<location line="+7"/>
@@ -16,7 +16,7 @@
<message>
<location line="+1"/>
<source>The search results may not be complete since the documentation is still being indexed!</source>
- <translation>Es können nicht alle möglichen Ergebnisse angezeigt werden, da die Dokumentation noch indiziert wird!</translation>
+ <translation>Es können nicht alle möglichen Ergebnisse angezeigt werden, da die Dokumentation noch indiziert wird.</translation>
</message>
<message>
<location line="+11"/>
@@ -26,7 +26,7 @@
<message>
<location line="+4"/>
<source>(The reason for this might be that the documentation is still being indexed.)</source>
- <translation>(Ein Möglichkeit dafür könnte sein, das die Dokumentation noch nicht vollständig indiziert ist.)</translation>
+ <translation>(Ein Grund dafür könnte sein, das die Dokumentation noch nicht vollständig indiziert ist.)</translation>
</message>
</context>
<context>
@@ -34,78 +34,78 @@
<message>
<location filename="../tools/assistant/lib/qhelpcollectionhandler.cpp" line="+79"/>
<source>The collection file is not set up yet!</source>
- <translation>Das &quot;Collection File&quot; ist noch nicht eingerichtet.</translation>
+ <translation>Die Katalogdatei ist noch nicht eingerichtet.</translation>
</message>
<message>
<location line="+22"/>
<source>Cannot load sqlite database driver!</source>
- <translation>Der Datenbanktreiber für SQLite kann nicht geladen werden!</translation>
+ <translation>Der Datenbanktreiber für SQLite kann nicht geladen werden.</translation>
</message>
<message>
<location line="+11"/>
<location line="+48"/>
<source>Cannot open collection file: %1</source>
- <translation>Kann &quot;Collection File&quot; nicht öffnen: %1</translation>
+ <translation>Katalogdatei kann nicht geöffnet werden: %1</translation>
</message>
<message>
<location line="-39"/>
<source>Cannot create tables in file %1!</source>
- <translation>Kann keine Tabellen in Datei %1 anlegen!</translation>
+ <translation>In Datei %1 können keine Tabellen angelegt werden.</translation>
</message>
<message>
<location line="+16"/>
<source>The specified collection file already exists!</source>
- <translation>Das angegebene &quot;Collection File&quot; existiert bereits!</translation>
+ <translation>Die angegebene Katalogdatei existiert bereits.</translation>
</message>
<message>
<location line="+5"/>
<source>Cannot create directory: %1</source>
- <translation>Kann Verzeichnis nicht anlegen: %1</translation>
+ <translation>Das Verzeichnis kann nicht angelegt werden: %1</translation>
</message>
<message>
<location line="+23"/>
<source>Cannot copy collection file: %1</source>
- <translation>Kann &quot;Collection File&quot; nicht kopieren: %1</translation>
+ <translation>Die Katalogdatei kann nicht kopiert werden: %1</translation>
</message>
<message>
<location line="+119"/>
<source>Unknown filter!</source>
- <translation>Unbekannter Filter!</translation>
+ <translation>Unbekannter Filter.</translation>
</message>
<message>
<location line="+55"/>
<source>Cannot register filter %1!</source>
- <translation>Kann Filter nicht registrieren: %1</translation>
+ <translation>Der Filter kann nicht registriert werden: %1</translation>
</message>
<message>
<location line="+44"/>
<source>Cannot open documentation file %1!</source>
- <translation>Kann Dokumentations-Datei nicht öffnen: %1</translation>
+ <translation>Die Dokumentationsdatei kann nicht geöffnet werden: %1</translation>
</message>
<message>
<location line="+6"/>
<source>Invalid documentation file!</source>
- <translation>Ungültige Dokumentations-Datei!</translation>
+ <translation>Ungültige Dokumentationsdatei.</translation>
</message>
<message>
<location line="+34"/>
<source>The namespace %1 was not registered!</source>
- <translation>Der Namensraum %1 wurde nicht registriert!</translation>
+ <translation>Der Namensraum %1 wurde nicht registriert.</translation>
</message>
<message>
<location line="+120"/>
<source>Namespace %1 already exists!</source>
- <translation>Der Namensraum %1 existiert bereits!</translation>
+ <translation>Der Namensraum %1 existiert bereits.</translation>
</message>
<message>
<location line="+13"/>
<source>Cannot register namespace!</source>
- <translation>Kann den Namensraum nicht registrieren!</translation>
+ <translation>Der Namensraum kann nicht registriert werden.</translation>
</message>
<message>
<location line="+24"/>
<source>Cannot open database to optimize!</source>
- <translation>Kann die Datenbank zur Optimierung nicht öffnen!</translation>
+ <translation>Die Datenbank kann nicht zur Optimierung geöffnet werden.</translation>
</message>
</context>
<context>
@@ -121,7 +121,7 @@
<message>
<location filename="../tools/assistant/lib/qhelpenginecore.cpp" line="+516"/>
<source>The specified namespace does not exist!</source>
- <translation>Der angegebene Namensraum existiert nicht!</translation>
+ <translation>Der angegebene Namensraum existiert nicht.</translation>
</message>
</context>
<context>
@@ -129,7 +129,7 @@
<message>
<location line="-394"/>
<source>Cannot open documentation file %1: %2!</source>
- <translation>Kann Dokumentations-Datei nicht öffnen: %1: %2!</translation>
+ <translation>Die Dokumentationsdatei %1 kann nicht geöffnet werden: %2.</translation>
</message>
</context>
<context>
@@ -137,42 +137,42 @@
<message>
<location filename="../tools/assistant/lib/qhelpgenerator.cpp" line="+157"/>
<source>Invalid help data!</source>
- <translation>Ungültige Hilfe-Daten!</translation>
+ <translation>Ungültige Hilfe-Daten.</translation>
</message>
<message>
<location line="+6"/>
<source>No output file name specified!</source>
- <translation>Name für die Ausgabe-Datei wurde nicht angegeben!</translation>
+ <translation>Für die Ausgabe-Datei wurde kein Name angegeben.</translation>
</message>
<message>
<location line="+14"/>
<source>Building up file structure...</source>
- <translation>Erzeuge Dateistruktur...</translation>
+ <translation>Dateistruktur wird erzeugt...</translation>
</message>
<message>
<location line="-7"/>
<source>The file %1 cannot be overwritten!</source>
- <translation>Die Datei %1 kann nicht überschrieben werden!</translation>
+ <translation>Die Datei %1 kann nicht überschrieben werden.</translation>
</message>
<message>
<location line="+18"/>
<source>Cannot open data base file %1!</source>
- <translation>Kann Datenbank-Datei nicht öffnen: %1!</translation>
+ <translation>Die Datenbank-Datei %1 kann nicht geöffnet werden.</translation>
</message>
<message>
<location line="+11"/>
<source>Cannot register namespace %1!</source>
- <translation>Kann Namensraum %1 nicht registrieren!</translation>
+ <translation>Der Namensraum %1 kann nicht registriert werden.</translation>
</message>
<message>
<location line="+6"/>
<source>Insert custom filters...</source>
- <translation>Füge benutzerdefinierte Filter ein...</translation>
+ <translation>Benutzerdefinierte Filter einfügen...</translation>
</message>
<message>
<location line="+12"/>
<source>Insert help data for filter section (%1 of %2)...</source>
- <translation>Füge Hilfe-Daten für Filter-Sektion (%1 von %2) ein...</translation>
+ <translation>Hilfe-Daten für Filter-Sektion (%1 von %2) einfügen...</translation>
</message>
<message>
<location line="+18"/>
@@ -182,62 +182,62 @@
<message>
<location line="+76"/>
<source>Some tables already exist!</source>
- <translation>Einige Tabellen existieren bereits!</translation>
+ <translation>Einige Tabellen existieren bereits.</translation>
</message>
<message>
<location line="+61"/>
<source>Cannot create tables!</source>
- <translation>Kann keine Tabellen erstellen!</translation>
+ <translation>Tabellen können nicht erstellt werden.</translation>
</message>
<message>
<location line="+86"/>
<source>Cannot register virtual folder!</source>
- <translation>Kann virtuelles Verzeichnis nicht registrieren!</translation>
+ <translation>Virtuelles Verzeichnis nicht registriert werden.</translation>
</message>
<message>
<location line="+10"/>
<source>Insert files...</source>
- <translation>Füge Dateien ein...</translation>
+ <translation>Dateien einfügen...</translation>
</message>
<message>
<location line="+41"/>
<source>The file %1 does not exist! Skipping it.</source>
- <translation>Die Datei %1 existiert nicht! Überspringe sie.</translation>
+ <translation>Die Datei %1 existiert nicht. Wird übersprungen.</translation>
</message>
<message>
<location line="+7"/>
<source>Cannot open file %1! Skipping it.</source>
- <translation>Kann Datei %1 nicht öffnen! Überspringe sie.</translation>
+ <translation>Die Datei %1 kann nicht geöffnet werden. Wird übersprungen.</translation>
</message>
<message>
<location line="+134"/>
<source>The filter %1 is already registered!</source>
- <translation>Der Filter %1 is bereits registriert!</translation>
+ <translation>Der Filter %1 ist bereits registriert.</translation>
</message>
<message>
<location line="+5"/>
<source>Cannot register filter %1!</source>
- <translation>Kann filter nicht registrieren: %1!</translation>
+ <translation>Der Filter %1 kann nicht registriert werden.</translation>
</message>
<message>
<location line="+24"/>
<source>Insert indices...</source>
- <translation>Füge Indizes ein...</translation>
+ <translation>Indizes einfügen...</translation>
</message>
<message>
<location line="+80"/>
<source>Insert contents...</source>
- <translation>Füge Inhalt ein...</translation>
+ <translation>Inhalt einfügen...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot insert contents!</source>
- <translation>Kann Inhalt nicht einfügen!</translation>
+ <translation>Inhalt kann nicht eingefügt werden.</translation>
</message>
<message>
<location line="+12"/>
<source>Cannot register contents!</source>
- <translation>Kann Inhalt nicht registrieren!</translation>
+ <translation>Inhalt kann nicht registriert werden.</translation>
</message>
</context>
<context>
@@ -314,7 +314,7 @@
<message>
<location line="+13"/>
<source>Unknown token. Expected &quot;QtHelpProject&quot;!</source>
- <translation>Unbekanntes Token. Erwartete &quot;QtHelpProject&quot;!</translation>
+ <translation>Unbekanntes Token. &quot;QtHelpProject&quot; erwartet.</translation>
</message>
<message>
<location line="+5"/>
@@ -324,12 +324,12 @@
<message>
<location line="+13"/>
<source>A virtual folder must not contain a &apos;/&apos; character!</source>
- <translation>Ein virtuelles Verzeichnis darf kein &apos;/&apos;-Zeichen enthalten!</translation>
+ <translation>Ein virtuelles Verzeichnis darf kein &apos;/&apos;-Zeichen enthalten.</translation>
</message>
<message>
<location line="+4"/>
<source>A namespace must not contain a &apos;/&apos; character!</source>
- <translation>Ein Namensraum darf kein &apos;/&apos;-Zeichen enthalten!</translation>
+ <translation>Ein Namensraum darf kein &apos;/&apos;-Zeichen enthalten.</translation>
</message>
<message>
<location line="+16"/>
@@ -349,7 +349,7 @@
<message>
<location line="+83"/>
<source>The input file %1 could not be opened!</source>
- <translation>Die Eingabe-Datei %1 konnte nicht geöffnet werden!</translation>
+ <translation>Die Eingabe-Datei %1 kann nicht geöffnet werden.</translation>
</message>
</context>
</TS>