From 16488d6e1073ce311c173d78c16be8da1f57f94e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 30 Mar 2009 16:44:55 +0200 Subject: Doc: Synchronized the QTransform constructor arguments with the class documentation and updated a diagram. Task-number: 228201 Reviewed-by: TrustMe --- doc/src/diagrams/qtransform-representation.sk | 103 ++++++++++++++++++++++++++ src/gui/painting/qtransform.cpp | 19 +++-- 2 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 doc/src/diagrams/qtransform-representation.sk diff --git a/doc/src/diagrams/qtransform-representation.sk b/doc/src/diagrams/qtransform-representation.sk new file mode 100644 index 0000000..17dcbfe --- /dev/null +++ b/doc/src/diagrams/qtransform-representation.sk @@ -0,0 +1,103 @@ +##Sketch 1 2 +document() +layout('A4',0) +layer('Layer 1',1,1,0,0,(0,0,0)) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,190,760) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,190,695) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,190,630) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,320,760) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,320,695) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,320,630) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,255,760) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,255,695) +lp((0,0,1)) +lw(2) +r(65,0,0,-65,255,630) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m33',(329.16,589.968)) +G() +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('dy',(274.828,577.768)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m32',(264.16,602.768)) +G_() +G() +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m31',(199.16,602.768)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('dx',(209.828,577.8)) +G_() +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m11',(199.16,719.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m12',(264.16,719.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m13',(329.16,719.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m21',(199.16,654.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m22',(264.16,654.968)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(24) +txt('m23',(329.16,654.968)) +guidelayer('Guide Lines',1,0,0,1,(0,0,1)) +grid((0,0,5,5),1,(0,0,1),'Grid') diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index da8c428..c70208c 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -168,10 +168,10 @@ QT_BEGIN_NAMESPACE \image qtransform-representation.png - A QTransform object contains a 3 x 3 matrix. The \c dx and \c dy - elements specify horizontal and vertical translation. The \c m11 - and \c m22 elements specify horizontal and vertical scaling. The - \c m21 and \c m12 elements specify horizontal and vertical \e shearing. + A QTransform object contains a 3 x 3 matrix. The \c m31 (\c dx) and + \c m32 (\c dy) elements specify horizontal and vertical translation. + The \c m11 and \c m22 elements specify horizontal and vertical scaling. + The \c m21 and \c m12 elements specify horizontal and vertical \e shearing. And finally, the \c m13 and \c m23 elements specify horizontal and vertical projection, with \c m33 as an additional projection factor. @@ -246,8 +246,10 @@ QTransform::QTransform() } /*! - Constructs a matrix with the elements, \a h11, \a h12, \a h13, - \a h21, \a h22, \a h23, \a h31, \a h32, \a h33. + \fn QTransform::QTransform(qreal m11, qreal m12, qreal m13, qreal m21, qreal m22, qreal m23, qreal m31, qreal m32, qreal m33) + + Constructs a matrix with the elements, \a m11, \a m12, \a m13, + \a m21, \a m22, \a m23, \a m31, \a m32, \a m33. \sa setMatrix() */ @@ -263,8 +265,9 @@ QTransform::QTransform(qreal h11, qreal h12, qreal h13, } /*! - Constructs a matrix with the elements, \a h11, \a h12, \a h21, \a - h22, \a dx and \a dy. + \fn QTransform::QTransform(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy) + + Constructs a matrix with the elements, \a m11, \a m12, \a m21, \a m22, \a dx and \a dy. \sa setMatrix() */ -- cgit v0.12 From 1e2fdb56ce6025b34b88b1da1386f8c79464b412 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 30 Mar 2009 16:48:26 +0200 Subject: Doc: Synchronized the QTransform constructor arguments with the class documentation and updated a diagram. Task-number: 228201 Reviewed-by: TrustMe --- doc/src/images/qtransform-representation.png | Bin 17892 -> 17385 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/doc/src/images/qtransform-representation.png b/doc/src/images/qtransform-representation.png index 2608872..883d5dc 100644 Binary files a/doc/src/images/qtransform-representation.png and b/doc/src/images/qtransform-representation.png differ -- cgit v0.12 From 87f1ea14ae7e245dd7589b1d992f67b0058ae1b5 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 30 Mar 2009 17:03:01 +0200 Subject: Doc: Fixed typo. Reviewed-by: TrustMe --- src/corelib/kernel/qmetatype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 4d7d309..ce10bae 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -1255,7 +1255,7 @@ void QMetaType::destroy(int type, void *data) \relates QMetaType \threadsafe - Registers the type name \a typeName to the type \c{T}. Returns + Registers the type name \a typeName for the type \c{T}. Returns the internal ID used by QMetaType. Any class or struct that has a public default constructor, a public copy constructor and a public destructor can be registered. -- cgit v0.12 From 577853b93dd4cf848abbd95abfed7e5a9d48688b Mon Sep 17 00:00:00 2001 From: David Boddie Date: Mon, 30 Mar 2009 18:11:04 +0200 Subject: Doc: Added a code snippet to illustrate the opening of local files. Task-number: 223087 Reviewed-by: TrustMe --- doc/src/snippets/code/src_gui_util_qdesktopservices.cpp | 5 ++++- src/gui/util/qdesktopservices.cpp | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp b/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp index a9c630b..5001984 100644 --- a/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp +++ b/doc/src/snippets/code/src_gui_util_qdesktopservices.cpp @@ -11,7 +11,10 @@ public slots: QDesktopServices::setUrlHandler("help", helpInstance, "showHelp"); //! [0] - //! [1] mailto:user@foo.com?subject=Test&body=Just a test //! [1] + +//! [2] +QDesktopServices::openUrl(QUrl("file:///C:/Documents and Settings/All Users/Desktop", QUrl::TolerantMode)); +//! [2] diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 0fe1d69..84aa16e 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -157,6 +157,11 @@ void QOpenUrlHandlerRegistry::handlerDestroyed(QObject *handler) If the URL is a reference to a local file (i.e., the URL scheme is "file") then it will be opened with a suitable application instead of a Web browser. + The following example opens a file on the Windows file system residing on a path + that contains spaces: + + \snippet doc/src/snippets/code/src_gui_util_qdesktopservices.cpp 2 + If a \c mailto URL is specified, the user's e-mail client will be used to open a composer window containing the options specified in the URL, similar to the way \c mailto links are handled by a Web browser. -- cgit v0.12 From 22ee1110301b228bbcbe9d39a9bcebe9ab4cdad0 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 31 Mar 2009 14:55:33 +0200 Subject: Doc: Removed a reference to a deprecated function. Reported by a former Doc Manager. Reviewed-by: TrustMe --- src/gui/dialogs/qcolordialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp index b744dca..3aa04f6 100644 --- a/src/gui/dialogs/qcolordialog.cpp +++ b/src/gui/dialogs/qcolordialog.cpp @@ -1523,10 +1523,10 @@ static const Qt::WindowFlags DefaultWindowFlags = If you require a modeless dialog, use the QColorDialog constructor. \endomit - The static getColor() function shows the dialog, and allows the - user to specify a color. The getRgba() function does the same, but - also allows the user to specify a color with an alpha channel - (transparency) value. + The static getColor() function shows the dialog, and allows the user to + specify a color. This function can also be used to let users choose a + color with a level of transparency: pass the ShowAlphaChannel option as + an additional argument. The user can store customCount() different custom colors. The custom colors are shared by all color dialogs, and remembered -- cgit v0.12 From 94c3e15e0fd04a178c319c2bc151b492a46380ee Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 31 Mar 2009 16:53:36 +0200 Subject: Doc: Clarified that the main use case for QRegion is as a clipping primitive not as a rendering primitive. Task-number: 183493 Reviewed-by: TrustMe --- src/gui/painting/qregion.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 8169ef8..c88af7c 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -65,9 +65,17 @@ QT_BEGIN_NAMESPACE \ingroup shared QRegion is used with QPainter::setClipRegion() to limit the paint - area to what needs to be painted. There is also a - QWidget::repaint() function that takes a QRegion parameter. - QRegion is the best tool for reducing flicker. + area to what needs to be painted. There is also a QWidget::repaint() + function that takes a QRegion parameter. QRegion is the best tool for + minimizing the amount of screen area to be updated by a repaint. + + This class is not suitable for constructing shapes for rendering, especially + as outlines. Use QPainterPath to create paths and shapes for use with + QPainter. + + QRegion is an \l{implicitly shared} class. + + \section1 Creating and Using Regions A region can be created from a rectangle, an ellipse, a polygon or a bitmap. Complex regions may be created by combining simple @@ -84,8 +92,6 @@ QT_BEGIN_NAMESPACE Example of using complex regions: \snippet doc/src/snippets/code/src_gui_painting_qregion.cpp 0 - QRegion is an \l{implicitly shared} class. - \warning Due to window system limitations, the whole coordinate space for a region is limited to the points between -32767 and 32767 on Windows 95/98/ME. You can circumvent this limitation by using a QPainterPath. @@ -93,7 +99,7 @@ QT_BEGIN_NAMESPACE \section1 Additional License Information On Embedded Linux, Windows CE and X11 platforms, parts of this class rely on - code obtained under the following license: + code obtained under the following licenses: \legalese Copyright (c) 1987 X Consortium @@ -120,9 +126,7 @@ QT_BEGIN_NAMESPACE in this Software without prior written authorization from the X Consortium. \endlegalese - \raw HTML -
- \endraw + \br \legalese Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. -- cgit v0.12 From cf4d9e09afc72dfb474b497a95c872965335e341 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 31 Mar 2009 17:35:33 +0200 Subject: Doc: Noted the difference between the qLowerBound() functions. Task-number: 160621 Reviewed-by: TrustMe --- doc/src/qalgorithms.qdoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/src/qalgorithms.qdoc b/doc/src/qalgorithms.qdoc index 459fb81..b33c250 100644 --- a/doc/src/qalgorithms.qdoc +++ b/doc/src/qalgorithms.qdoc @@ -490,7 +490,10 @@ of \a value in the variable passed as a reference in argument \a n. \overload - This is the same as qLowerBound(\a{container}.begin(), \a{container}.end(), value); + For read-only iteration over containers, this function is broadly equivalent to + qLowerBound(\a{container}.begin(), \a{container}.end(), value). However, since it + returns a const iterator, you cannot use it to modify the container; for example, + to insert items. */ /*! \fn RandomAccessIterator qUpperBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value) -- cgit v0.12 From 93ca19a8ff7570606b4c01cfb9953921f897aa6e Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 31 Mar 2009 17:38:40 +0200 Subject: Doc: Made it clearer that QProcess::start() only starts a new process if one is not already running. Task-number: 231513 Reviewed-by: TrustMe --- src/corelib/io/qprocess.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index a9d8ee2..18618fc 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1476,11 +1476,15 @@ QByteArray QProcess::readAllStandardError() } /*! - Starts the program \a program in a new process, passing the - command line arguments in \a arguments. The OpenMode is set to \a - mode. QProcess will immediately enter the Starting state. If the - process starts successfully, QProcess will emit started(); - otherwise, error() will be emitted. + Starts the program \a program in a new process, if one is not already + running, passing the command line arguments in \a arguments. The OpenMode + is set to \a mode. + + The QProcess object will immediately enter the Starting state. If the + process starts successfully, QProcess will emit started(); otherwise, + error() will be emitted. If the QProcess object is already running a + process, a warning may be printed at the console, and the existing + process will continue running. Note that arguments that contain spaces are not passed to the process as separate arguments. @@ -1577,10 +1581,10 @@ static QStringList parseCombinedArgString(const QString &program) /*! \overload - Starts the program \a program in a new process. \a program is a - single string of text containing both the program name and its - arguments. The arguments are separated by one or more - spaces. For example: + Starts the program \a program in a new process, if one is not already + running. \a program is a single string of text containing both the + program name and its arguments. The arguments are separated by one or + more spaces. For example: \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 5 @@ -1589,6 +1593,9 @@ static QStringList parseCombinedArgString(const QString &program) \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 6 + If the QProcess object is already running a process, a warning may be + printed at the console, and the existing process will continue running. + Note that, on Windows, quotes need to be both escaped and quoted. For example, the above code would be specified in the following way to ensure that \c{"My Documents"} is used as the argument to -- cgit v0.12 From 65c16391fff38e28e4a9db215758b1df6c868a32 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 31 Mar 2009 19:53:21 +0200 Subject: Doc: Fixed the screenshots and example description to match the code. Task-number: 242369 Reviewed-by: TrustMe --- doc/src/examples/extension.qdoc | 11 +++++------ doc/src/images/extension-example.png | Bin 7676 -> 9929 bytes doc/src/images/extension_more.png | Bin 9309 -> 13523 bytes 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/src/examples/extension.qdoc b/doc/src/examples/extension.qdoc index 8a0ca3a..02e0698 100644 --- a/doc/src/examples/extension.qdoc +++ b/doc/src/examples/extension.qdoc @@ -80,9 +80,9 @@ user type a word to search for, we need several \l {QCheckBox}{QCheckBox}es to facilitate the search options, and we need three \l {QPushButton}{QPushButton}s: the \gui Find button to - start a search, the \gui More button to enable an advanced search, - and the \gui Close button to exit the application. Finally, we - need a QWidget representing the application's extension part. + start a search and the \gui More button to enable an advanced search. + Finally, we need a QWidget representing the application's extension + part. \section1 FindDialog Class Implementation @@ -128,8 +128,7 @@ the connection makes sure that the extension widget is shown depending on the state of \gui More button. - We also connect the \gui Close button to the QWidget::close() - slot, and we put the checkboxes associated with the advanced + We also put the check boxes associated with the advanced search options into a layout we install on the extension widget. \snippet examples/dialogs/extension/finddialog.cpp 4 @@ -137,7 +136,7 @@ Before we create the main layout, we create several child layouts for the widgets: First we allign the QLabel ans its buddy, the QLineEdit, using a QHBoxLayout. Then we vertically allign the - QLabel and QLineEdit with the checkboxes associated with the + QLabel and QLineEdit with the check boxes associated with the simple search, using a QVBoxLayout. We also create a QVBoxLayout for the buttons. In the end we lay out the two latter layouts and the extension widget using a QGridLayout. diff --git a/doc/src/images/extension-example.png b/doc/src/images/extension-example.png index dfaacc0..18fab52 100644 Binary files a/doc/src/images/extension-example.png and b/doc/src/images/extension-example.png differ diff --git a/doc/src/images/extension_more.png b/doc/src/images/extension_more.png index 2b06809..407af27 100644 Binary files a/doc/src/images/extension_more.png and b/doc/src/images/extension_more.png differ -- cgit v0.12 From 23174985c19c61fbce412965ecc1ba49c1cb5582 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Apr 2009 16:36:19 +0200 Subject: Doc: Minor language fixes and tidying. Reviewed-by: TrustMe --- doc/src/phonon-api.qdoc | 2 +- doc/src/phonon.qdoc | 2 +- doc/src/qnamespace.qdoc | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc index 147ded3..3d04c68 100644 --- a/doc/src/phonon-api.qdoc +++ b/doc/src/phonon-api.qdoc @@ -2568,7 +2568,7 @@ details. Phonon also provides EffectWidget, which lets the user modify the - parameters of an effect an the fly, e.g., with comboboxes. + parameters of an effect an the fly; e.g., with combo boxes. \sa {Phonon Module}, EffectWidget */ diff --git a/doc/src/phonon.qdoc b/doc/src/phonon.qdoc index fa84b96..9470e61 100644 --- a/doc/src/phonon.qdoc +++ b/doc/src/phonon.qdoc @@ -49,7 +49,7 @@ \section1 Introduction Qt uses the Phonon multimedia framework to provide functionality - for playback of the most common multimedia formats.The media can + for playback of the most common multimedia formats. The media can be read from files or streamed over a network, using a QURL to a file. diff --git a/doc/src/qnamespace.qdoc b/doc/src/qnamespace.qdoc index 6220795..e6a1a36 100644 --- a/doc/src/qnamespace.qdoc +++ b/doc/src/qnamespace.qdoc @@ -508,11 +508,11 @@ \value DirectConnection When emitted, the signal is immediately delivered to the slot. \value QueuedConnection When emitted, the signal is queued until the event loop is able to deliver it to the slot. - \value - BlockingQueuedConnection Same as QueuedConnection, except that the current thread blocks + \value BlockingQueuedConnection + Same as QueuedConnection, except that the current thread blocks until the slot has been delivered. This connection type should only be used for receivers in a different thread. Note that misuse - of this type can lead to dead locks in your application. + of this type can lead to deadlocks in your application. \value AutoConnection If the signal is emitted from the thread in which the receiving object lives, the slot is invoked directly, as with -- cgit v0.12 From 80293b874047c028e47d91d33c2afe157d9e6785 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Apr 2009 16:37:14 +0200 Subject: Doc: Trivial fixes. Reviewed-by: TrustMe --- src/corelib/global/qglobal.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 1645279..8324d05 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2944,12 +2944,12 @@ bool QInternal::callFunction(InternalFunction func, void **args) Compares the floating point value \a p1 and \a p2 and returns \c true if they are considered equal, otherwise \c false. - + Note that comparing values where either \a p1 or \a p2 is 0.0 will not work. - The solution to this is to compare against values greater than or equal to 1.0 - + The solution to this is to compare against values greater than or equal to 1.0. + \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 46 - + The two numbers are compared in a relative way, where the exactness is stronger the smaller the numbers are. */ -- cgit v0.12 From 244daeabfb55160387985d0ff3f057aa03d4d2da Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Apr 2009 16:38:15 +0200 Subject: Doc: Updated the deployment documentation with the QtScriptTools module and references to Phonon documentation. Task-number: 212939 Reviewed-by: TrustMe --- doc/src/deployment.qdoc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/src/deployment.qdoc b/doc/src/deployment.qdoc index 7e02f1a..d9f7c1a 100644 --- a/doc/src/deployment.qdoc +++ b/doc/src/deployment.qdoc @@ -91,7 +91,7 @@ The disadvantage with the shared library approach is that you will get more files to deploy. For more information, see \l{sharedlibrary.html}{Creating Shared Libraries}. - + \section1 Deploying Qt's Libraries \table @@ -111,13 +111,14 @@ \o \l {QtNetwork} \o \l {QtOpenGL} \o \l {QtScript} - \o \l {QtSql} + \o \l {QtScriptTools} \row + \o \l {QtSql} \o \l {QtSvg} \o \l {QtWebKit} \o \l {QtXml} - \o \l {QtXmlPatterns} \row + \o \l {QtXmlPatterns} \o \l {Phonon Module}{Phonon} \o \l {Qt3Support} \endtable @@ -178,11 +179,13 @@ Please see \l{QtWebKit Module#License Information}{the QtWebKit module documentation} for more information. - \row \o Phonon \o Phonon + \row \o \l{Phonon Module}{Phonon} \o Phonon \o Phonon relies on the native multimedia engines on different platforms. Phonon itself is licensed under the GNU LGPL version 2. Please see \l{Phonon Module#License Information}{the Phonon module documentation} - for more information. + for more information on licensing and the + \l{Phonon Overview#Backends}{Phonon Overview} for details of the backends + in use on different platforms. \endtable \section1 Platform-Specific Notes -- cgit v0.12 From 10d0536fd3b08a394c41de349e67325183328ec6 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 1 Apr 2009 16:59:51 +0200 Subject: Doc: Clarified the usage of QImage::dotsPerMeterX() and QImage::dotsPerMeterY(). Task-number: 240164 Reviewed-by: Jan Erik Hanssen --- src/gui/image/qimage.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 558d574..dc236e4 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4937,10 +4937,12 @@ int QImage::dotsPerMeterY() const meter, to \a x. Together with dotsPerMeterY(), this number defines the intended - scale and aspect ratio of the image. + scale and aspect ratio of the image, and determines the scale + at which QPainter will draw graphics on the image. It does not + change the scale or aspect ratio of the image when it is rendered + on other paint devices. - \sa dotsPerMeterX(), {QImage#Image Information}{Image - Information} + \sa dotsPerMeterX(), {QImage#Image Information}{Image Information} */ void QImage::setDotsPerMeterX(int x) { @@ -4957,10 +4959,12 @@ void QImage::setDotsPerMeterX(int x) to \a y. Together with dotsPerMeterX(), this number defines the intended - scale and aspect ratio of the image. + scale and aspect ratio of the image, and determines the scale + at which QPainter will draw graphics on the image. It does not + change the scale or aspect ratio of the image when it is rendered + on other paint devices. - \sa dotsPerMeterY(), {QImage#Image Information}{Image - Information} + \sa dotsPerMeterY(), {QImage#Image Information}{Image Information} */ void QImage::setDotsPerMeterY(int y) { -- cgit v0.12 From e9c8a4cf013906a54b1b05796d6007d878e85398 Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Mon, 11 May 2009 15:55:59 +0200 Subject: typos in docs: double "the" --- doc/src/accessible.qdoc | 2 +- doc/src/deployment.qdoc | 2 +- doc/src/examples/codeeditor.qdoc | 2 +- doc/src/examples/containerextension.qdoc | 2 +- doc/src/examples/fortuneserver.qdoc | 2 +- doc/src/examples/ftp.qdoc | 4 ++-- doc/src/examples/icons.qdoc | 2 +- doc/src/examples/musicplayerexample.qdoc | 2 +- doc/src/examples/qobjectxmlmodel.qdoc | 2 +- doc/src/examples/tabdialog.qdoc | 2 +- doc/src/examples/tooltips.qdoc | 2 +- doc/src/examples/transformations.qdoc | 2 +- doc/src/examples/trollprint.qdoc | 2 +- doc/src/licenses.qdoc | 2 +- doc/src/mac-differences.qdoc | 2 +- doc/src/phonon-api.qdoc | 2 +- doc/src/q3valuelist.qdoc | 2 +- doc/src/qalgorithms.qdoc | 2 +- doc/src/qtdesigner.qdoc | 2 +- doc/src/qtscriptdebugger-manual.qdoc | 2 +- doc/src/stylesheet.qdoc | 8 ++++---- doc/src/tech-preview/known-issues.html | 2 +- doc/src/timers.qdoc | 4 ++-- doc/src/xquery-introduction.qdoc | 2 +- 24 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/src/accessible.qdoc b/doc/src/accessible.qdoc index 090da86..ad9f4f1 100644 --- a/doc/src/accessible.qdoc +++ b/doc/src/accessible.qdoc @@ -527,7 +527,7 @@ on plugins, consult the plugins \l{How to Create Qt Plugins}{overview document}. - You can omit the the first macro unless you want the plugin + You can omit the first macro unless you want the plugin to be statically linked with the application. \section2 Implementing Interface Factories diff --git a/doc/src/deployment.qdoc b/doc/src/deployment.qdoc index bcfa93d..446c91b 100644 --- a/doc/src/deployment.qdoc +++ b/doc/src/deployment.qdoc @@ -1247,7 +1247,7 @@ \snippet doc/src/snippets/code/doc_src_deployment.qdoc 48 Then we update the source code in \c tools/plugandpaint/main.cpp - to look for the the new plugins. After constructing the + to look for the new plugins. After constructing the QApplication, we add the following code: \snippet doc/src/snippets/code/doc_src_deployment.qdoc 49 diff --git a/doc/src/examples/codeeditor.qdoc b/doc/src/examples/codeeditor.qdoc index 669ab45..d218d0d 100644 --- a/doc/src/examples/codeeditor.qdoc +++ b/doc/src/examples/codeeditor.qdoc @@ -67,7 +67,7 @@ QTextEdit because it is optimized for handling plain text. See the QPlainTextEdit class description for details. - QPlainTextEdit lets us add selections in addition to the the + QPlainTextEdit lets us add selections in addition to the selection the user can make with the mouse or keyboard. We use this functionality to highlight the current line. More on this later. diff --git a/doc/src/examples/containerextension.qdoc b/doc/src/examples/containerextension.qdoc index a4fbcea..6d29cf6 100644 --- a/doc/src/examples/containerextension.qdoc +++ b/doc/src/examples/containerextension.qdoc @@ -305,7 +305,7 @@ MultiPageWidget class \l {designer/containerextension/multipagewidget.cpp}{implementation}). Finally, we implicitly force an update of the page's property - sheet by calling the the + sheet by calling the QDesignerPropertySheetExtension::setChanged() function. \snippet examples/designer/containerextension/multipagewidgetplugin.cpp 4 diff --git a/doc/src/examples/fortuneserver.qdoc b/doc/src/examples/fortuneserver.qdoc index e6a7f85..848a3a3 100644 --- a/doc/src/examples/fortuneserver.qdoc +++ b/doc/src/examples/fortuneserver.qdoc @@ -45,7 +45,7 @@ The Fortune Server example shows how to create a server for a simple network service. It is intended to be run alongside the - \l{network/fortuneclient}{Fortune Client} example or the the + \l{network/fortuneclient}{Fortune Client} example or the \l{network/blockingfortuneclient}{Blocking Fortune Client} example. \image fortuneserver-example.png Screenshot of the Fortune Server example diff --git a/doc/src/examples/ftp.qdoc b/doc/src/examples/ftp.qdoc index 9cc9cd1..7a74a37 100644 --- a/doc/src/examples/ftp.qdoc +++ b/doc/src/examples/ftp.qdoc @@ -172,7 +172,7 @@ no entries were found (in which case our \c addToList() function would not have been called). - Let's continue with the the \c addToList() slot: + Let's continue with the \c addToList() slot: \snippet examples/network/ftp/ftpwindow.cpp 10 @@ -190,7 +190,7 @@ \snippet examples/network/ftp/ftpwindow.cpp 12 - \c cdToParent() is invoked when the the user requests to go to the + \c cdToParent() is invoked when the user requests to go to the parent directory of the one displayed in the file list. After changing the directory, we QFtp::List its contents. diff --git a/doc/src/examples/icons.qdoc b/doc/src/examples/icons.qdoc index 750ef2e..a81ddb9 100644 --- a/doc/src/examples/icons.qdoc +++ b/doc/src/examples/icons.qdoc @@ -479,7 +479,7 @@ QTableWidget::openPersistentEditor() function to create comboboxes for the mode and state columns of the items. - Due to the the connection between the table widget's \l + Due to the connection between the table widget's \l {QTableWidget::itemChanged()}{itemChanged()} signal and the \c changeIcon() slot, the new image is automatically converted into a pixmap and made part of the set of pixmaps available to the icon diff --git a/doc/src/examples/musicplayerexample.qdoc b/doc/src/examples/musicplayerexample.qdoc index d23c1f1..9f04bf6 100644 --- a/doc/src/examples/musicplayerexample.qdoc +++ b/doc/src/examples/musicplayerexample.qdoc @@ -154,7 +154,7 @@ \snippet examples/phonon/musicplayer/mainwindow.cpp 5 - We move on to the the slots of \c MainWindow, starting with \c + We move on to the slots of \c MainWindow, starting with \c addFiles(): \snippet examples/phonon/musicplayer/mainwindow.cpp 6 diff --git a/doc/src/examples/qobjectxmlmodel.qdoc b/doc/src/examples/qobjectxmlmodel.qdoc index ce1dab6..37c66bc 100644 --- a/doc/src/examples/qobjectxmlmodel.qdoc +++ b/doc/src/examples/qobjectxmlmodel.qdoc @@ -71,7 +71,7 @@ The query engine can only traverse two dimensional trees, because an XML document is always a two dimensional tree. If we want to add the QMetaObject tree to the node model, we have to somehow flatten it - into the the same plane as the QObject tree. This requires that the + into the same plane as the QObject tree. This requires that the node model class must build an auxiliary data structure and make it part of the two dimensional QObject node model. How to do this is explained in \l{Including The QMetaObject Tree}. diff --git a/doc/src/examples/tabdialog.qdoc b/doc/src/examples/tabdialog.qdoc index c9500af..5394b82 100644 --- a/doc/src/examples/tabdialog.qdoc +++ b/doc/src/examples/tabdialog.qdoc @@ -91,7 +91,7 @@ \snippet examples/dialogs/tabdialog/tabdialog.cpp 1 \snippet examples/dialogs/tabdialog/tabdialog.cpp 3 - We arrange the the tab widget above the buttons in the dialog: + We arrange the tab widget above the buttons in the dialog: \snippet examples/dialogs/tabdialog/tabdialog.cpp 4 diff --git a/doc/src/examples/tooltips.qdoc b/doc/src/examples/tooltips.qdoc index 5daa2b2..78b350b 100644 --- a/doc/src/examples/tooltips.qdoc +++ b/doc/src/examples/tooltips.qdoc @@ -353,7 +353,7 @@ Whenever the user creates a new shape item, we want the new item to appear at a random position, and we use the \c randomItemPosition() function to calculate such a position. We - make sure that the item appears within the the visible area of the + make sure that the item appears within the visible area of the \c SortingBox widget, using the widget's current width and heigth when calculating the random coordinates. diff --git a/doc/src/examples/transformations.qdoc b/doc/src/examples/transformations.qdoc index eabb803..58c8b80 100644 --- a/doc/src/examples/transformations.qdoc +++ b/doc/src/examples/transformations.qdoc @@ -208,7 +208,7 @@ After transforming the coordinate system, we draw the \c RenderArea's shape, and then we restore the painter state using - the the QPainter::restore() function (i.e. popping the saved state off + the QPainter::restore() function (i.e. popping the saved state off the stack). \snippet examples/painting/transformations/renderarea.cpp 7 diff --git a/doc/src/examples/trollprint.qdoc b/doc/src/examples/trollprint.qdoc index 38251ee..489012e 100644 --- a/doc/src/examples/trollprint.qdoc +++ b/doc/src/examples/trollprint.qdoc @@ -142,7 +142,7 @@ We can easily determine which file must be changed because the translator's "context" is in fact the class name for the class where the texts that must be changed appears. In this case the file is \c - printpanel.cpp, where the there are four lines to change. Add the + printpanel.cpp, where there are four lines to change. Add the second argument "two-sided" in the appropriate \c tr() calls to the first pair of radio buttons: diff --git a/doc/src/licenses.qdoc b/doc/src/licenses.qdoc index 1c3f6d2..a11c071 100644 --- a/doc/src/licenses.qdoc +++ b/doc/src/licenses.qdoc @@ -45,7 +45,7 @@ \ingroup licensing \brief Information about other licenses used for Qt components and third-party code. - Qt contains some code that is not provided under the the + Qt contains some code that is not provided under the \l{GNU General Public License (GPL)}, \l{GNU Lesser General Public License (LGPL)} or the \l{Qt Commercial Editions}{Qt Commercial License Agreement}, but rather under diff --git a/doc/src/mac-differences.qdoc b/doc/src/mac-differences.qdoc index 573e62d..5849850 100644 --- a/doc/src/mac-differences.qdoc +++ b/doc/src/mac-differences.qdoc @@ -128,7 +128,7 @@ If you want to build a new dynamic library combining the Qt 4 dynamic libraries, you need to introduce the \c{ld -r} flag. Then - relocation information is stored in the the output file, so that + relocation information is stored in the output file, so that this file could be the subject of another \c ld run. This is done by setting the \c -r flag in the \c .pro file, and the \c LFLAGS settings. diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc index 501b5a5..dd37fe2 100644 --- a/doc/src/phonon-api.qdoc +++ b/doc/src/phonon-api.qdoc @@ -2973,7 +2973,7 @@ \value ToggledHint If this hint is set it means that - the the control has only two states: zero and non-zero + the control has only two states: zero and non-zero (see isToggleControl()). \value LogarithmicHint diff --git a/doc/src/q3valuelist.qdoc b/doc/src/q3valuelist.qdoc index be315c2..e3681af 100644 --- a/doc/src/q3valuelist.qdoc +++ b/doc/src/q3valuelist.qdoc @@ -108,7 +108,7 @@ pointing to the removed member become invalid. Inserting into the list does not invalidate any iterator. For convenience, the function last() returns a reference to the last item in the list, - and first() returns a reference to the the first item. If the + and first() returns a reference to the first item. If the list is empty(), both last() and first() have undefined behavior (your application will crash or do unpredictable things). Use last() and first() with caution, for example: diff --git a/doc/src/qalgorithms.qdoc b/doc/src/qalgorithms.qdoc index b33c250..90289f9 100644 --- a/doc/src/qalgorithms.qdoc +++ b/doc/src/qalgorithms.qdoc @@ -59,7 +59,7 @@ If STL is available on all your target platforms, you can use the STL algorithms instead of their Qt counterparts. One reason why - you might want to use the the STL algorithms is that STL provides + you might want to use the STL algorithms is that STL provides dozens and dozens of algorithms, whereas Qt only provides the most important ones, making no attempt to duplicate functionality that is already provided by the C++ standard. diff --git a/doc/src/qtdesigner.qdoc b/doc/src/qtdesigner.qdoc index 7e3b619..9699c5b 100644 --- a/doc/src/qtdesigner.qdoc +++ b/doc/src/qtdesigner.qdoc @@ -632,7 +632,7 @@ /*! \fn void QDesignerContainerExtension::setCurrentIndex(int index) - Sets the the currently selected page in the container to be the + Sets the currently selected page in the container to be the page at the given \a index in the extension's list of pages. \sa currentIndex() diff --git a/doc/src/qtscriptdebugger-manual.qdoc b/doc/src/qtscriptdebugger-manual.qdoc index 3dfe879..75d87f8 100644 --- a/doc/src/qtscriptdebugger-manual.qdoc +++ b/doc/src/qtscriptdebugger-manual.qdoc @@ -367,7 +367,7 @@ \section3 continue Continues execution normally, i.e, gives the execution control over - the script back the the QScriptEngine. + the script back to the QScriptEngine. \section3 eval diff --git a/doc/src/stylesheet.qdoc b/doc/src/stylesheet.qdoc index c0d13da..7d4b05d 100644 --- a/doc/src/stylesheet.qdoc +++ b/doc/src/stylesheet.qdoc @@ -332,7 +332,7 @@ respect to the reference element. Once positioned, they are treated the same as widgets and can be styled - using the the \l{box model}. + using the \l{box model}. See the \l{List of Sub-Controls} below for a list of supported sub-controls, and \l{Customizing the QPushButton's Menu Indicator @@ -671,7 +671,7 @@ \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} properties. - Once positioned, sub-controls can be styled using the the \l{box model}. + Once positioned, sub-controls can be styled using the \l{box model}. \note With complex widgets such as QComboBox and QScrollBar, if one property or sub-control is customized, \bold{all} the other properties or @@ -1154,7 +1154,7 @@ \l{#pane-sub}{::pane} subcontrol. The left and right corners are styled using the \l{#left-corner-sub}{::left-corner} and \l{#right-corner-sub}{::right-corner} respectively. - The position of the the tab bar is controlled using the + The position of the tab bar is controlled using the \l{#tab-bar-sub}{::tab-bar} subcontrol. By default, the subcontrols have positions of a QTabWidget in @@ -1254,7 +1254,7 @@ the \l{#menu-button-sub}{::menu-button} subcontrol is used to draw the menu button. \l{#menu-arrow-sub}{::menu-arrow} subcontrol is used to draw the menu arrow inside the menu-button. By default, it is - positioned in the center of the Contents rectangle of the the + positioned in the center of the Contents rectangle of the menu-button subcontrol. When the QToolButton displays arrows, the \l{#up-arrow-sub}{::up-arrow}, diff --git a/doc/src/tech-preview/known-issues.html b/doc/src/tech-preview/known-issues.html index 05df69e..885104e 100644 --- a/doc/src/tech-preview/known-issues.html +++ b/doc/src/tech-preview/known-issues.html @@ -16,7 +16,7 @@

Known Issues: Qt 4.0.0 Technology Preview 1

- This is the list of known and reported issues for the the Qt 4.0.0 + This is the list of known and reported issues for the Qt 4.0.0 Technology Preview 1. This list is updated daily.



diff --git a/doc/src/timers.qdoc b/doc/src/timers.qdoc index 4f54343..1b48d7d 100644 --- a/doc/src/timers.qdoc +++ b/doc/src/timers.qdoc @@ -62,7 +62,7 @@ In multithreaded applications, you can use the timer mechanism in any thread that has an event loop. To start an event loop from a - non-GUI thread, use QThread::exec(). Qt uses the the object's + non-GUI thread, use QThread::exec(). Qt uses the object's \l{QObject::thread()}{thread affinity} to determine which thread will deliver the QTimerEvent. Because of this, you must start and stop all timers in the object's thread; it is not possible to @@ -105,7 +105,7 @@ In multithreaded applications, you can use QTimer in any thread that has an event loop. To start an event loop from a non-GUI - thread, use QThread::exec(). Qt uses the the timer's + thread, use QThread::exec(). Qt uses the timer's \l{QObject::thread()}{thread affinity} to determine which thread will emit the \l{QTimer::}{timeout()} signal. Because of this, you must start and stop the timer in its thread; it is not possible to diff --git a/doc/src/xquery-introduction.qdoc b/doc/src/xquery-introduction.qdoc index 37a45ac..fe541e2 100644 --- a/doc/src/xquery-introduction.qdoc +++ b/doc/src/xquery-introduction.qdoc @@ -347,7 +347,7 @@ has a more detailed section on the shorthand form, which it calls the \l{http://www.w3.org/TR/xquery/#abbrev} {abbreviated syntax}. More examples of path expressions written in the shorthand form are found there. There is also a section listing examples of path expressions -written in the the \l{http://www.w3.org/TR/xquery/#unabbrev} {longhand +written in the \l{http://www.w3.org/TR/xquery/#unabbrev} {longhand form}. \target Name Tests -- cgit v0.12 From 17e1bca1ce366395f8331e16aa96b7176ca1abac Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 11 May 2009 15:21:14 -0400 Subject: Optimize rendering in the GL engine By using REPLACE we don't have to clean the stencil on every draw, effectively optimizing the rendering by 200%. --- src/opengl/qpaintengine_opengl.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index aee351d..4259a5c 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -2233,7 +2233,7 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule) // Enable color writes. glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glStencilMask(0); + glStencilMask(stencilMask); setGradientOps(cbrush, QRectF(QPointF(min_x, min_y), QSizeF(max_x - min_x, max_y - min_y))); @@ -2245,12 +2245,14 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule) // Enable stencil func. glStencilFunc(GL_NOTEQUAL, 0, stencilMask); + glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); composite(rect); } else { DEBUG_ONCE qDebug() << "QOpenGLPaintEnginePrivate: Drawing polygon using stencil method (no fragment programs)"; // Enable stencil func. glStencilFunc(GL_NOTEQUAL, 0, stencilMask); + glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE); #ifndef QT_OPENGL_ES glBegin(GL_QUADS); glVertex2f(min_x, min_y); @@ -2261,24 +2263,6 @@ void QOpenGLPaintEnginePrivate::fillVertexArray(Qt::FillRule fillRule) #endif } - glStencilMask(~0); - glStencilFunc(GL_ALWAYS, 0, 0); - glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO); - - // clear all stencil values to 0 - glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); - -#ifndef QT_OPENGL_ES - glBegin(GL_QUADS); - glVertex2f(min_x, min_y); - glVertex2f(max_x, min_y); - glVertex2f(max_x, max_y); - glVertex2f(min_x, max_y); - glEnd(); -#endif - - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - // Disable stencil writes. glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); glStencilMask(0); -- cgit v0.12 From 56191830cdad9cbaa81c2ed8f22f1b2650a5608a Mon Sep 17 00:00:00 2001 From: Marius Storm-Olsen Date: Wed, 13 May 2009 13:58:18 +0200 Subject: Turn off Link Time Code Generation (/LTCG) by default Turning on LTCG affected too many projects, where customers applications would take a long time linking, severly affecting their development time (even though it was only added for release builds) We turn it off by default, and add a -ltcg configuration option, and the possibility to also do CONFIG+=ltcg in projects, should they not want it for Qt, but in their own projects. (Same, they can build Qt with it, and do CONFIG-=ltcg for their project) Reviewed-by: andy --- configure.exe | Bin 860160 -> 856064 bytes mkspecs/features/win32/ltcg.prf | 5 +++++ mkspecs/win32-msvc2005/qmake.conf | 7 +++++-- mkspecs/win32-msvc2008/qmake.conf | 7 +++++-- tools/configure/configureapp.cpp | 13 +++++++++++++ 5 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 mkspecs/features/win32/ltcg.prf diff --git a/configure.exe b/configure.exe index ff71f08..40843b4 100644 Binary files a/configure.exe and b/configure.exe differ diff --git a/mkspecs/features/win32/ltcg.prf b/mkspecs/features/win32/ltcg.prf new file mode 100644 index 0000000..f6f1299 --- /dev/null +++ b/mkspecs/features/win32/ltcg.prf @@ -0,0 +1,5 @@ +CONFIG(release, debug|release) { + QMAKE_CFLAGS *= $$QMAKE_CFLAGS_LTCG + QMAKE_CXXFLAGS *= $$QMAKE_CXXFLAGS_LTCG + QMAKE_LFLAGS *= $$QMAKE_LFLAGS_LTCG +} diff --git a/mkspecs/win32-msvc2005/qmake.conf b/mkspecs/win32-msvc2005/qmake.conf index 00287cb..5ed8e01 100644 --- a/mkspecs/win32-msvc2005/qmake.conf +++ b/mkspecs/win32-msvc2005/qmake.conf @@ -19,9 +19,10 @@ QMAKE_YACCFLAGS = -d QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 -QMAKE_CFLAGS_RELEASE = -O2 -MD -GL +QMAKE_CFLAGS_RELEASE = -O2 -MD QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = +QMAKE_CFLAGS_LTCG = -GL QMAKE_CXX = $$QMAKE_CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS @@ -30,6 +31,7 @@ QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_CXXFLAGS_STL_ON = -EHsc QMAKE_CXXFLAGS_STL_OFF = QMAKE_CXXFLAGS_RTTI_ON = -GR @@ -50,11 +52,12 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO -QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /LTCG +QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" QMAKE_LFLAGS_DLL = /DLL +QMAKE_LFLAGS_LTCG = /LTCG QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib ws2_32.lib ole32.lib user32.lib advapi32.lib diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf index b56b41c..373a36d 100644 --- a/mkspecs/win32-msvc2008/qmake.conf +++ b/mkspecs/win32-msvc2008/qmake.conf @@ -19,9 +19,10 @@ QMAKE_YACCFLAGS = -d QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t- QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 -QMAKE_CFLAGS_RELEASE = -O2 -MD -GL +QMAKE_CFLAGS_RELEASE = -O2 -MD QMAKE_CFLAGS_DEBUG = -Zi -MDd QMAKE_CFLAGS_YACC = +QMAKE_CFLAGS_LTCG = -GL QMAKE_CXX = $$QMAKE_CC QMAKE_CXXFLAGS = $$QMAKE_CFLAGS @@ -30,6 +31,7 @@ QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_CXXFLAGS_STL_ON = -EHsc QMAKE_CXXFLAGS_STL_OFF = QMAKE_CXXFLAGS_RTTI_ON = -GR @@ -50,11 +52,12 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<< QMAKE_LINK = link QMAKE_LFLAGS = /NOLOGO -QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO /LTCG +QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO QMAKE_LFLAGS_DEBUG = /DEBUG QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\" QMAKE_LFLAGS_DLL = /DLL +QMAKE_LFLAGS_LTCG = /LTCG QMAKE_LIBS_CORE = kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib ws2_32.lib ole32.lib user32.lib advapi32.lib diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index bcbf557..91344c8 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -351,6 +351,7 @@ Configure::Configure( int& argc, char** argv ) dictionary[ "QMAKESPEC" ] = tmp; dictionary[ "INCREDIBUILD_XGE" ] = "auto"; + dictionary[ "LTCG" ] = "no"; } Configure::~Configure() @@ -487,6 +488,12 @@ void Configure::parseCmdLine() else if( configCmdLine.at(i) == "-commercial" ) { dictionary[ "BUILDTYPE" ] = "commercial"; } + else if( configCmdLine.at(i) == "-ltcg" ) { + dictionary[ "LTCG" ] = "yes"; + } + else if( configCmdLine.at(i) == "-no-ltcg" ) { + dictionary[ "LTCG" ] = "no"; + } #endif else if( configCmdLine.at(i) == "-platform" ) { @@ -1465,6 +1472,9 @@ bool Configure::displayHelp() desc("SHARED", "yes", "-shared", "Create and use shared Qt libraries."); desc("SHARED", "no", "-static", "Create and use static Qt libraries.\n"); + desc("LTCG", "yes", "-ltcg", "Use Link Time Code Generation. (Release builds only)"); + desc("LTCG", "no", "-no-ltcg", "Do not use Link Time Code Generation.\n"); + desc("FAST", "no", "-no-fast", "Configure Qt normally by generating Makefiles for all project files."); desc("FAST", "yes", "-fast", "Configure Qt quickly by generating Makefiles only for library and " "subdirectory targets. All other Makefiles are created as wrappers " @@ -2494,6 +2504,8 @@ void Configure::generateCachefile() else configStream << " static"; + if( dictionary[ "LTCG" ] == "yes" ) + configStream << " ltcg"; if( dictionary[ "STL" ] == "yes" ) configStream << " stl"; if ( dictionary[ "EXCEPTIONS" ] == "yes" ) @@ -2916,6 +2928,7 @@ void Configure::displayConfig() cout << "Architecture................" << dictionary[ "ARCHITECTURE" ] << endl; cout << "Maketool...................." << dictionary[ "MAKE" ] << endl; cout << "Debug symbols..............." << (dictionary[ "BUILD" ] == "debug" ? "yes" : "no") << endl; + cout << "Link Time Code Generation..." << dictionary[ "LTCG" ] << endl; cout << "Accessibility support......." << dictionary[ "ACCESSIBILITY" ] << endl; cout << "STL support................." << dictionary[ "STL" ] << endl; cout << "Exception support..........." << dictionary[ "EXCEPTIONS" ] << endl; -- cgit v0.12 From bb000e03fc1e876eb6ee0d02de15a0bc9a6ea1b8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 May 2009 14:53:24 +0200 Subject: Added API for quietly saving a form. Task-number: 163220 Added to FormWindowBase. Required among other things for Qt Creator code completion for uic-generated-headers. Acked-by: dt --- tools/designer/src/lib/shared/formwindowbase.cpp | 10 +++++++++- tools/designer/src/lib/shared/formwindowbase_p.h | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/designer/src/lib/shared/formwindowbase.cpp b/tools/designer/src/lib/shared/formwindowbase.cpp index 3e7e17b..b569b51 100644 --- a/tools/designer/src/lib/shared/formwindowbase.cpp +++ b/tools/designer/src/lib/shared/formwindowbase.cpp @@ -55,7 +55,7 @@ TRANSLATOR qdesigner_internal::FormWindowBase #include "deviceprofile_p.h" #include "qdesigner_utils_p.h" -#include +#include "qsimpleresource_p.h" #include #include @@ -482,6 +482,14 @@ void FormWindowBase::setupDefaultAction(QDesignerFormWindowInterface *fw) QObject::connect(fw, SIGNAL(activated(QWidget*)), fw, SLOT(triggerDefaultAction(QWidget*))); } +QString FormWindowBase::fileContents() const +{ + const bool oldValue = QSimpleResource::setWarningsEnabled(false); + const QString rc = contents(); + QSimpleResource::setWarningsEnabled(oldValue); + return rc; +} + } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/tools/designer/src/lib/shared/formwindowbase_p.h b/tools/designer/src/lib/shared/formwindowbase_p.h index 68e977e..0891f6e 100644 --- a/tools/designer/src/lib/shared/formwindowbase_p.h +++ b/tools/designer/src/lib/shared/formwindowbase_p.h @@ -90,6 +90,9 @@ public: QVariantMap formData(); void setFormData(const QVariantMap &vm); + // Return contents without warnings. Should be 'contents(bool quiet)' + QString fileContents() const; + // Return the widget containing the form. This is used to // apply embedded design settings to that are inherited (for example font). // These are meant to be applied to the form only and not to the other editors -- cgit v0.12 From 960d2a7639062b6582d460aaae140b4d2e0a8b70 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Wed, 13 May 2009 14:59:52 +0200 Subject: Adding details to QVariant docs Adding note about requriements for converting QVariants Task-number: 192607 Rev-by: David Boddie --- src/corelib/kernel/qvariant.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index b4427c0..0a0500d 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1187,8 +1187,9 @@ const QVariant::Handler *QVariant::handler = &qt_kernel_variant_handler; and versatile, but may prove less memory and speed efficient than storing specific types in standard data structures. - QVariant also supports the notion of null values, where you have - a defined type with no value set. + QVariant also supports the notion of null values, where you can + have a defined type with no value set. However, note that QVariant + types can only be cast when they have had a value set. \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 1 -- cgit v0.12 From 62677589caf8b2f45f369cfc9df30ded323c4155 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Wed, 13 May 2009 15:13:10 +0200 Subject: Cleaning docs Highlight part of the general description in QTimeLine Task-number: 218487 Rev-by: Geir Vattekar --- src/corelib/tools/qtimeline.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qtimeline.cpp b/src/corelib/tools/qtimeline.cpp index 2979a09..3a03558 100644 --- a/src/corelib/tools/qtimeline.cpp +++ b/src/corelib/tools/qtimeline.cpp @@ -225,7 +225,9 @@ void QTimeLinePrivate::setCurrentTime(int msecs) valueForTime() and emitting valueChanged(). By default, valueForTime() applies an interpolation algorithm to generate these value. You can choose from a set of predefined timeline algorithms by calling - setCurveShape(). By default, QTimeLine uses the EaseInOut curve shape, + setCurveShape(). + + Note that by default, QTimeLine uses the EaseInOut curve shape, which provides a value that grows slowly, then grows steadily, and finally grows slowly. For a custom timeline, you can reimplement valueForTime(), in which case QTimeLine's curveShape property is ignored. -- cgit v0.12 From 1c22d96f15d46c222bf5f1720e3e49e202a6c941 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 12 May 2009 17:58:27 +0200 Subject: HTTP backend / network cache: only cache responses to GET by default responses to POST might be cacheable, but are not cacheable by default; responses to PUT or DELETE are never cacheable. Reviewed-by: Thiago Macieira Task-number: 252281 --- src/network/access/qnetworkaccesshttpbackend.cpp | 42 +++++++++++++++++------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index a52b5a0..f214699 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -1036,21 +1036,39 @@ QNetworkCacheMetaData QNetworkAccessHttpBackend::fetchCacheMetaData(const QNetwo if (it != cacheHeaders.rawHeaders.constEnd()) metaData.setLastModified(QNetworkHeadersPrivate::fromHttpDate(it->second)); - bool canDiskCache = true; // Everything defaults to being cacheable on disk - - // 14.32 - // HTTP/1.1 caches SHOULD treat "Pragma: no-cache" as if the client - // had sent "Cache-Control: no-cache". - it = cacheHeaders.findRawHeader("pragma"); - if (it != cacheHeaders.rawHeaders.constEnd() - && it->second == "no-cache") - canDiskCache = false; + bool canDiskCache; + // only cache GET replies by default, all other replies (POST, PUT, DELETE) + // are not cacheable by default (according to RFC 2616 section 9) + if (httpReply->request().operation() == QHttpNetworkRequest::Get) { + + canDiskCache = true; + // 14.32 + // HTTP/1.1 caches SHOULD treat "Pragma: no-cache" as if the client + // had sent "Cache-Control: no-cache". + it = cacheHeaders.findRawHeader("pragma"); + if (it != cacheHeaders.rawHeaders.constEnd() + && it->second == "no-cache") + canDiskCache = false; + + // HTTP/1.1. Check the Cache-Control header + if (cacheControl.contains("no-cache")) + canDiskCache = false; + else if (cacheControl.contains("no-store")) + canDiskCache = false; + + // responses to POST might be cacheable + } else if (httpReply->request().operation() == QHttpNetworkRequest::Post) { - // HTTP/1.1. Check the Cache-Control header - if (cacheControl.contains("no-cache")) canDiskCache = false; - else if (cacheControl.contains("no-store")) + // some pages contain "expires:" and "cache-control: no-cache" field, + // so we only might cache POST requests if we get "cache-control: max-age ..." + if (cacheControl.contains("max-age")) + canDiskCache = true; + + // responses to PUT and DELETE are not cacheable + } else { canDiskCache = false; + } metaData.setSaveToDisk(canDiskCache); int statusCode = httpReply->statusCode(); -- cgit v0.12 From 484ad0eccc84488b57d58a1223760623c70389a5 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Wed, 13 May 2009 17:10:43 +0200 Subject: Correcting bug in cardLayout example Adding the count() function to the example. Task-number: 220766 Rev-by: Geir Vattekar --- doc/src/layout.qdoc | 16 +++++++----- doc/src/snippets/code/doc_src_layout.qdoc | 41 +++++++++++++++++-------------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/doc/src/layout.qdoc b/doc/src/layout.qdoc index 55dfd8b..196999b 100644 --- a/doc/src/layout.qdoc +++ b/doc/src/layout.qdoc @@ -315,7 +315,11 @@ \snippet doc/src/snippets/code/doc_src_layout.qdoc 1 - First we define two functions that iterate over the layout: \c{itemAt()} + First we define \c{count()} to fetch the number of items in the list. + + \snippet doc/src/snippets/code/doc_src_layout.qdoc 2 + + Then we define two functions that iterate over the layout: \c{itemAt()} and \c{takeAt()}. These functions are used internally by the layout system to handle deletion of widgets. They are also available for application programmers. @@ -326,7 +330,7 @@ structure, we may have to spend more effort defining a linear order for the items. - \snippet doc/src/snippets/code/doc_src_layout.qdoc 2 + \snippet doc/src/snippets/code/doc_src_layout.qdoc 3 \c{addItem()} implements the default placement strategy for layout items. This function must be implemented. It is used by QLayout::add(), by the @@ -336,26 +340,26 @@ QGridLayout::addItem(), QGridLayout::addWidget(), and QGridLayout::addLayout(). - \snippet doc/src/snippets/code/doc_src_layout.qdoc 3 + \snippet doc/src/snippets/code/doc_src_layout.qdoc 4 The layout takes over responsibility of the items added. Since QLayoutItem does not inherit QObject, we must delete the items manually. The function QLayout::deleteAllItems() uses \c{takeAt()} defined above to delete all the items in the layout. - \snippet doc/src/snippets/code/doc_src_layout.qdoc 4 + \snippet doc/src/snippets/code/doc_src_layout.qdoc 5 The \c{setGeometry()} function actually performs the layout. The rectangle supplied as an argument does not include \c{margin()}. If relevant, use \c{spacing()} as the distance between items. - \snippet doc/src/snippets/code/doc_src_layout.qdoc 5 + \snippet doc/src/snippets/code/doc_src_layout.qdoc 6 \c{sizeHint()} and \c{minimumSize()} are normally very similar in implementation. The sizes returned by both functions should include \c{spacing()}, but not \c{margin()}. - \snippet doc/src/snippets/code/doc_src_layout.qdoc 6 + \snippet doc/src/snippets/code/doc_src_layout.qdoc 7 \section2 Further Notes diff --git a/doc/src/snippets/code/doc_src_layout.qdoc b/doc/src/snippets/code/doc_src_layout.qdoc index 48e10e9..fedcf0c 100644 --- a/doc/src/snippets/code/doc_src_layout.qdoc +++ b/doc/src/snippets/code/doc_src_layout.qdoc @@ -2,23 +2,21 @@ #ifndef CARD_H #define CARD_H -#include +#include #include class CardLayout : public QLayout { public: - CardLayout(QWidget *parent, int dist) - : QLayout(parent, 0, dist) {} - CardLayout(QLayout *parent, int dist) - : QLayout(parent, dist) {} - CardLayout(int dist) - : QLayout(dist) {} + CardLayout(QWidget *parent, int dist): QLayout(parent, 0, dist) {} + CardLayout(QLayout *parent, int dist): QLayout(parent, dist) {} + CardLayout(int dist): QLayout(dist) {} ~CardLayout(); void addItem(QLayoutItem *item); QSize sizeHint() const; QSize minimumSize() const; + QLayoutItem *count() const; QLayoutItem *itemAt(int) const; QLayoutItem *takeAt(int); void setGeometry(const QRect &rect); @@ -31,11 +29,18 @@ private: //! [1] -#include "card.h" +//#include "card.h" //! [1] - //! [2] +QLayoutItem *CardLayout::count() const +{ + // QList::size() returns the number of QLayoutItems in the list + return list.size(); +} +//! [2] + +//! [3] QLayoutItem *CardLayout::itemAt(int idx) const { // QList::value() performs index checking, and returns 0 if we are @@ -48,26 +53,26 @@ QLayoutItem *CardLayout::takeAt(int idx) // QList::take does not do index checking return idx >= 0 && idx < list.size() ? list.takeAt(idx) : 0; } -//! [2] +//! [3] -//! [3] +//! [4] void CardLayout::addItem(QLayoutItem *item) { list.append(item); } -//! [3] +//! [4] -//! [4] +//! [5] CardLayout::~CardLayout() { deleteAllItems(); } -//! [4] +//! [5] -//! [5] +//! [6] void CardLayout::setGeometry(const QRect &r) { QLayout::setGeometry(r); @@ -85,10 +90,10 @@ void CardLayout::setGeometry(const QRect &r) ++i; } } -//! [5] +//! [6] -//! [6] +//! [7] QSize CardLayout::sizeHint() const { QSize s(0,0); @@ -116,4 +121,4 @@ QSize CardLayout::minimumSize() const } return s + n*QSize(spacing(), spacing()); } -//! [6] +//! [7] \ No newline at end of file -- cgit v0.12 From 54ad50c99fee0db0dc9a64ee16dfcc4315b9d86d Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 14 May 2009 09:41:08 +1000 Subject: Fix broken wince build. The WinCE build was failing due to a spelling error in an #ifdef directive. Reviewed-by: Trust Me --- src/gui/widgets/qmenu_wince.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp index fbe54fe..42a4e0b 100644 --- a/src/gui/widgets/qmenu_wince.cpp +++ b/src/gui/widgets/qmenu_wince.cpp @@ -214,7 +214,7 @@ static HWND qt_wce_create_menubar(HWND parentHandle, HINSTANCE resourceHandle, i mbi.nToolBarId = toolbarID; if (ptrCreateMenuBar(&mbi)) { -#ifdef Q_WS_WINCE_WM +#ifdef Q_OS_WINCE_WM // Tell the menu bar that we want to override hot key behaviour. LPARAM lparam = MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, SHMBOF_NODEFAULT | SHMBOF_NOTIFY); -- cgit v0.12 From 4cfe2b57d97488b4f312ad2ec2985f619b4984b6 Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 14 May 2009 14:15:21 +1000 Subject: Use newer safer error function if available. Uses fb_interpret instead of isc_interprete if using firebird. Closes a potential security hole/buffer overrun. Reviewed-by: Justin McPherson --- src/sql/drivers/ibase/qsql_ibase.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index 6834d9a..4f3d79d 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -66,8 +66,11 @@ QT_BEGIN_NAMESPACE enum { QIBaseChunkSize = SHRT_MAX / 2 }; -static bool getIBaseError(QString& msg, ISC_STATUS* status, ISC_LONG &sqlcode, - QTextCodec *tc) +#if defined(FB_API_VER) && FB_API_VER >= 20 +static bool getIBaseError(QString& msg, const ISC_STATUS* status, ISC_LONG &sqlcode, QTextCodec *tc) +#else +static bool getIBaseError(QString& msg, ISC_STATUS* status, ISC_LONG &sqlcode, QTextCodec *tc) +#endif { if (status[0] != 1 || status[1] <= 0) return false; @@ -75,7 +78,11 @@ static bool getIBaseError(QString& msg, ISC_STATUS* status, ISC_LONG &sqlcode, msg.clear(); sqlcode = isc_sqlcode(status); char buf[512]; +#if defined(FB_API_VER) && FB_API_VER >= 20 + while(fb_interpret(buf, 512, &status)) { +#else while(isc_interprete(buf, &status)) { +#endif if(!msg.isEmpty()) msg += QLatin1String(" - "); if (tc) -- cgit v0.12 From ffecdf0bf9f25f7ab9aa4f69e37507dd595fecea Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Tue, 12 May 2009 14:18:58 +0200 Subject: Makes the layout of many of the areas be in aligned columns to immensely increase readability Unfortunately the patch causes quite some regressions and I think some refectoring of this class would be needed. I didn't do that since there is no API docs, the variable naming is not very clarifying and the code is hard to read due to it not using the coding style and mixing tabs as well as spaces. --- tools/qdoc3/htmlgenerator.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 13d52bf..7702628 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2079,17 +2079,7 @@ void HtmlGenerator::generateSectionList(const Section& section, const Node *rela CodeMarker *marker, CodeMarker::SynopsisStyle style) { if (!section.members.isEmpty()) { - bool twoColumn = false; - if (style == CodeMarker::SeparateList) { - twoColumn = (section.members.count() >= 16); - } else if (section.members.first()->type() == Node::Property) { - twoColumn = (section.members.count() >= 5); - } - if (twoColumn) - out() << "

\n" - << "
"; - out() << "
    \n"; + out() << "\n"; int i = 0; NodeList::ConstIterator m = section.members.begin(); @@ -2099,22 +2089,17 @@ void HtmlGenerator::generateSectionList(const Section& section, const Node *rela continue; } - if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "\n"; i++; ++m; } - out() << "\n"; - if (twoColumn) - out() << "\n
      \n"; - - out() << "
    • "; + out() << "
    "; if (style == CodeMarker::Accessors) out() << ""; generateSynopsis(*m, relative, marker, style); if (style == CodeMarker::Accessors) out() << ""; - out() << "\n"; + out() << "

    \n"; + out() << "
\n"; } if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { @@ -2129,7 +2114,7 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section, const N { QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { - out() << "

  • "; + out() << "
  • "; out() << (*p).second << " "; if ((*p).second == 1) { out() << section.singularMember; @@ -2425,7 +2410,9 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" static const QString linkTag("link"); for (int i = 0, n = src.size(); i < n;) { - if (src.at(i) == charLangle && src.at(i + 1) == charAt) { + if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { + if (i != 0) + html += " "; i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { QString link = linkForNode( -- cgit v0.12 From 8a97b3b9e506580b4a89c1277068b274794a858c Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 14 May 2009 10:37:37 +0200 Subject: Sheets misbehaviour on Carbon - Mac OS X Seems like some old legacy code was left behind when sheets behaved as application modal. This is not the case anymore, so this patch just removes the special case code for enforcing the old behaviour, and let carbon do the correct thing instead. Task-number: 252379 Reviewed-by: Trenton Schulz --- src/gui/kernel/qwidget_mac.mm | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index b315eaf..0e021dc 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -786,16 +786,6 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event, // By also setting the current modal window back into the event, we // help Carbon determining which window is supposed to be raised. handled_event = qApp->activePopupWidget() ? true : false; - QWidget *top = 0; - if (!QApplicationPrivate::tryModalHelper(widget, &top) && top && top != widget){ - if(!qt_mac_is_macsheet(top) || top->parentWidget() != widget) { - handled_event = true; - WindowPtr topWindowRef = qt_mac_window_for(top); - SetEventParameter(event, kEventParamModalWindow, typeWindowRef, sizeof(topWindowRef), &topWindowRef); - HIModalClickResult clickResult = kHIModalClickIsModal; - SetEventParameter(event, kEventParamModalClickResult, typeModalClickResult, sizeof(clickResult), &clickResult); - } - } #endif } else if(ekind == kEventWindowClose) { widget->d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent); -- cgit v0.12 From 8a0272a37aa44ed7583cce40eeff1b030c07741e Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 14 May 2009 10:57:22 +0200 Subject: Small updates to the .hgignore file. This is handy in cases where you are maybe using something like the hg-git extension in Mercurial or just storing release in Mercurial for patch queues or what have you. --- .hgignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.hgignore b/.hgignore index 784d507..eb6ff05 100755 --- a/.hgignore +++ b/.hgignore @@ -5,6 +5,8 @@ syntax: glob *~ *.a +*.la +*.pc *.core *.moc *.o @@ -45,7 +47,9 @@ bin/rcc* bin/uic* bin/qcollectiongenerator bin/qhelpgenerator +bin/macdeployqt tools/qdoc3/qdoc3* +tools/macdeployqt/macchangeqt/macchangeqt #configure.cache mkspecs/default mkspecs/qconfig.pri -- cgit v0.12 From b038c1ac6bdac15b123946821bbff3ee25bfad2b Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 14 May 2009 05:09:58 -0700 Subject: Fixes combobox menu separator on XP While the delegate is somewhat abusing the ToolbarSeparator here, we should make sure we draw something for small heights as well. It seems microsoft requires us to allocate a few more pixels for the separator to actually be visible. Task-number: 249192 Reviewed-by: ogoffart --- src/gui/styles/qwindowsxpstyle.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index 639eff0..3dac9f5 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -1792,7 +1792,12 @@ case PE_Frame: return; case PE_IndicatorToolBarSeparator: - + if (option->rect.height() < 3) { + // XP style requires a few pixels for the separator + // to be visible. + QWindowsStyle::drawPrimitive(pe, option, p, widget); + return; + } name = QLatin1String("TOOLBAR"); partId = TP_SEPARATOR; -- cgit v0.12 From d6e87c332c721bbcb86bebc6f4daa8a3125e80c6 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 14 May 2009 15:07:25 +0200 Subject: Fixes build issue with WinCE and MSVC 2008 and MIPS-II Reviewed-by: Maurice --- mkspecs/wince50standard-mipsii-msvc2008/default_post.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/wince50standard-mipsii-msvc2008/default_post.prf b/mkspecs/wince50standard-mipsii-msvc2008/default_post.prf index a232ba3..d423784 100644 --- a/mkspecs/wince50standard-mipsii-msvc2008/default_post.prf +++ b/mkspecs/wince50standard-mipsii-msvc2008/default_post.prf @@ -1 +1 @@ -include(../wince50standard-mipsii-msvc2005/qmake.conf) +include(../wince50standard-mipsii-msvc2005/default_post.prf) -- cgit v0.12 From 7179792bbbc34a091bfc18ebc3e5bd2e401faa65 Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Thu, 14 May 2009 15:06:48 +0200 Subject: Fix QGraphicsItem::deviceTransform() to also work with normal items. QGraphicsItem::deviceTransform() returns the item-to-device transform, provided with the device-to-scene transform, and combining it with the item's scene transform. This function is meant to handle items that enable ItemIgnoresTransformations, but it happened to not work properly for items that _don't_ enable that flag. Unfortunately this bug is hard to work around for users from the outside, as it requires you to check if the item or any ancestor enables ItemIgnoresTransformations. The fix also removes unnecessary branchs inside QGV so that we use the same function for all items. Reviewed-by: bnilsen --- src/gui/graphicsview/qgraphicsitem.cpp | 4 + src/gui/graphicsview/qgraphicsscene.cpp | 21 +---- src/gui/graphicsview/qgraphicsview.cpp | 13 +-- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 110 +++++++++++++++++++++++++ 4 files changed, 120 insertions(+), 28 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 30c15bc..4908296 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2572,6 +2572,10 @@ QTransform QGraphicsItem::sceneTransform() const */ QTransform QGraphicsItem::deviceTransform(const QTransform &viewportTransform) const { + // Ensure we return the standard transform if we're not untransformable. + if (!d_ptr->itemIsUntransformable()) + return sceneTransform() * viewportTransform; + // Find the topmost item that ignores view transformations. const QGraphicsItem *untransformedAncestor = this; QList parents; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 13f70e5..b89e352 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2289,12 +2289,7 @@ void QGraphicsScene::render(QPainter *painter, const QRectF &target, const QRect // Calculate a simple level-of-detail metric. // ### almost identical code in QGraphicsView::paintEvent() // and QGraphicsView::render() - consider refactoring - QTransform itemToDeviceTransform; - if (item->d_ptr->itemIsUntransformable()) { - itemToDeviceTransform = item->deviceTransform(painterTransform); - } else { - itemToDeviceTransform = item->sceneTransform() * painterTransform; - } + QTransform itemToDeviceTransform = item->deviceTransform(painterTransform); option.levelOfDetail = qSqrt(itemToDeviceTransform.map(v1).length() * itemToDeviceTransform.map(v2).length()); option.matrix = itemToDeviceTransform.toAffine(); //### discards perspective @@ -5078,11 +5073,7 @@ void QGraphicsScene::drawItems(QPainter *painter, // optimization, but it's hit very rarely. for (int i = clippers.size() - 1; i >= 0; --i) { QGraphicsItem *clipper = clippers[i]; - if (clipper->d_ptr->itemIsUntransformable()) { - painter->setWorldTransform(clipper->deviceTransform(viewTransform), false); - } else { - painter->setWorldTransform(clipper->sceneTransform() * viewTransform, false); - } + painter->setWorldTransform(clipper->deviceTransform(viewTransform), false); childClippers.append(clipper); painter->save(); @@ -5093,12 +5084,8 @@ void QGraphicsScene::drawItems(QPainter *painter, } // Set up the painter transform - if (item->d_ptr->itemIsUntransformable()) { - painter->setWorldTransform(item->deviceTransform(viewTransform), false); - } else { - painter->setWorldTransform(item->sceneTransform() * viewTransform, false); - } - + painter->setWorldTransform(item->deviceTransform(viewTransform), false); + // Save painter bool saveState = (d->painterStateProtection || (item->flags() & QGraphicsItem::ItemClipsToShape)); if (saveState) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 8b133f3..a795fb4 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1153,11 +1153,7 @@ void QGraphicsViewPrivate::generateStyleOptions(const QList &it // Calculate a simple level-of-detail metric. // ### almost identical code in QGraphicsScene::render() // and QGraphicsView::render() - consider refactoring - if (item->d_ptr->itemIsUntransformable()) { - itemToViewportTransform = item->deviceTransform(worldTransform); - } else { - itemToViewportTransform = item->sceneTransform() * worldTransform; - } + itemToViewportTransform = item->deviceTransform(worldTransform); if (itemToViewportTransform.type() <= QTransform::TxTranslate) { // Translation and rotation only? The LOD is 1. @@ -2160,12 +2156,7 @@ void QGraphicsView::render(QPainter *painter, const QRectF &target, const QRect // Calculate a simple level-of-detail metric. // ### almost identical code in QGraphicsScene::render() // and QGraphicsView::paintEvent() - consider refactoring - QTransform itemToViewportTransform; - if (item->d_ptr->itemIsUntransformable()) { - itemToViewportTransform = item->deviceTransform(painterMatrix); - } else { - itemToViewportTransform = item->sceneTransform() * painterMatrix; - } + QTransform itemToViewportTransform = item->deviceTransform(painterMatrix); option->levelOfDetail = qSqrt(itemToViewportTransform.map(v1).length() * itemToViewportTransform.map(v2).length()); option->matrix = itemToViewportTransform.toAffine(); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 6d150cb..58a17ea 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -215,6 +215,8 @@ private slots: void tabChangesFocus_data(); void cacheMode(); void updateCachedItemAfterMove(); + void deviceTransform_data(); + void deviceTransform(); // task specific tests below me void task141694_textItemEnsureVisible(); @@ -6200,5 +6202,113 @@ void tst_QGraphicsItem::updateCachedItemAfterMove() QCOMPARE(tester->repaints, 1); } +class Track : public QGraphicsRectItem +{ +public: + Track(const QRectF &rect) + : QGraphicsRectItem(rect) + { + setAcceptHoverEvents(true); + } + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) + { + QGraphicsRectItem::paint(painter, option, widget); + painter->drawText(boundingRect(), Qt::AlignCenter, QString("%1x%2\n%3x%4").arg(p.x()).arg(p.y()).arg(sp.x()).arg(sp.y())); + } + +protected: + void hoverMoveEvent(QGraphicsSceneHoverEvent *event) + { + p = event->pos(); + sp = event->widget()->mapFromGlobal(event->screenPos()); + update(); + } +private: + QPointF p; + QPoint sp; +}; + +void tst_QGraphicsItem::deviceTransform_data() +{ + QTest::addColumn("untransformable1"); + QTest::addColumn("untransformable2"); + QTest::addColumn("untransformable3"); + QTest::addColumn("rotation1"); + QTest::addColumn("rotation2"); + QTest::addColumn("rotation3"); + QTest::addColumn("deviceX"); + QTest::addColumn("mapResult1"); + QTest::addColumn("mapResult2"); + QTest::addColumn("mapResult3"); + + QTest::newRow("nil") << false << false << false + << qreal(0.0) << qreal(0.0) << qreal(0.0) + << QTransform() + << QPointF(150, 150) << QPointF(250, 250) << QPointF(350, 350); + QTest::newRow("deviceX rot 90") << false << false << false + << qreal(0.0) << qreal(0.0) << qreal(0.0) + << QTransform().rotate(90) + << QPointF(-150, 150) << QPointF(-250, 250) << QPointF(-350, 350); + QTest::newRow("deviceX rot 90 100") << true << false << false + << qreal(0.0) << qreal(0.0) << qreal(0.0) + << QTransform().rotate(90) + << QPointF(-50, 150) << QPointF(50, 250) << QPointF(150, 350); + QTest::newRow("deviceX rot 90 010") << false << true << false + << qreal(0.0) << qreal(0.0) << qreal(0.0) + << QTransform().rotate(90) + << QPointF(-150, 150) << QPointF(-150, 250) << QPointF(-50, 350); + QTest::newRow("deviceX rot 90 001") << false << false << true + << qreal(0.0) << qreal(0.0) << qreal(0.0) + << QTransform().rotate(90) + << QPointF(-150, 150) << QPointF(-250, 250) << QPointF(-250, 350); + QTest::newRow("deviceX rot 90 111") << true << true << true + << qreal(0.0) << qreal(0.0) << qreal(0.0) + << QTransform().rotate(90) + << QPointF(-50, 150) << QPointF(50, 250) << QPointF(150, 350); + QTest::newRow("deviceX rot 90 101") << true << false << true + << qreal(0.0) << qreal(0.0) << qreal(0.0) + << QTransform().rotate(90) + << QPointF(-50, 150) << QPointF(50, 250) << QPointF(150, 350); +} + +void tst_QGraphicsItem::deviceTransform() +{ + QFETCH(bool, untransformable1); + QFETCH(bool, untransformable2); + QFETCH(bool, untransformable3); + QFETCH(qreal, rotation1); + QFETCH(qreal, rotation2); + QFETCH(qreal, rotation3); + QFETCH(QTransform, deviceX); + QFETCH(QPointF, mapResult1); + QFETCH(QPointF, mapResult2); + QFETCH(QPointF, mapResult3); + + QGraphicsScene scene; + Track *rect1 = new Track(QRectF(0, 0, 100, 100)); + Track *rect2 = new Track(QRectF(0, 0, 100, 100)); + Track *rect3 = new Track(QRectF(0, 0, 100, 100)); + rect2->setParentItem(rect1); + rect3->setParentItem(rect2); + rect1->setPos(100, 100); + rect2->setPos(100, 100); + rect3->setPos(100, 100); + rect1->rotate(rotation1); + rect2->rotate(rotation2); + rect3->rotate(rotation3); + rect1->setFlag(QGraphicsItem::ItemIgnoresTransformations, untransformable1); + rect2->setFlag(QGraphicsItem::ItemIgnoresTransformations, untransformable2); + rect3->setFlag(QGraphicsItem::ItemIgnoresTransformations, untransformable3); + rect1->setBrush(Qt::red); + rect2->setBrush(Qt::green); + rect3->setBrush(Qt::blue); + scene.addItem(rect1); + + QCOMPARE(rect1->deviceTransform(deviceX).map(QPointF(50, 50)), mapResult1); + QCOMPARE(rect2->deviceTransform(deviceX).map(QPointF(50, 50)), mapResult2); + QCOMPARE(rect3->deviceTransform(deviceX).map(QPointF(50, 50)), mapResult3); +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" -- cgit v0.12 From ed52c2f402b99541553aac163029d217f1dcd419 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 14 May 2009 06:28:47 -0700 Subject: Remove snapback/maximum drag distance from QSlider This feature was only intended for QScrollBar and was incorrectly inherited by QSlider. The only supported platform that use this feature seems to be Windows so instead of doing a nasty qobject cast in the styling it makes more sense to remove the functionality from QSlider entirely. Task-number: 245681 Reviewed-by: ogoffart --- src/gui/styles/qstyle.cpp | 2 +- src/gui/widgets/qslider.cpp | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index b73332f..514f67b 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -1332,7 +1332,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value PM_LayoutVerticalSpacing Default \l{QLayout::spacing}{vertical spacing} for a QLayout. \value PM_MaximumDragDistance The maximum allowed distance between - the mouse and a slider when dragging. Exceeding the specified + the mouse and a scrollbar when dragging. Exceeding the specified distance will cause the slider to jump back to the original position; a value of -1 disables this behavior. diff --git a/src/gui/widgets/qslider.cpp b/src/gui/widgets/qslider.cpp index 32b9021..5b9c8a4 100644 --- a/src/gui/widgets/qslider.cpp +++ b/src/gui/widgets/qslider.cpp @@ -62,7 +62,6 @@ public: int tickInterval; QSlider::TickPosition tickPosition; int clickOffset; - int snapBackPosition; void init(); void resetLayoutItemMargins(); int pixelPosToRangeValue(int pos) const; @@ -493,7 +492,6 @@ void QSlider::mousePressEvent(QMouseEvent *ev) setRepeatAction(SliderNoAction); QRect sr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this); d->clickOffset = d->pick(ev->pos() - sr.topLeft()); - d->snapBackPosition = d->position; update(sr); setSliderDown(true); } @@ -513,14 +511,6 @@ void QSlider::mouseMoveEvent(QMouseEvent *ev) int newPosition = d->pixelPosToRangeValue(d->pick(ev->pos()) - d->clickOffset); QStyleOptionSlider opt; initStyleOption(&opt); - int m = style()->pixelMetric(QStyle::PM_MaximumDragDistance, &opt, this); - if (m >= 0) { - QRect r = rect(); - r.adjust(-m, -m, m, m); - if (!r.contains(ev->pos())) { - newPosition = d->snapBackPosition; - } - } setSliderPosition(newPosition); } -- cgit v0.12 From d755bb5e8cfd88d0cd909f32d240d18e856bbd36 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 14 May 2009 15:37:00 +0200 Subject: Prevent duplicate entries in the sidebar when the paths are the same If two urls were added to the sidebar that only differed in how they referenced the added url (i.e. /foo/bar/. and /foo/bar) then only one entry should appear. Task-number: 253532 Reviewed-by: Alexis --- src/gui/dialogs/qsidebar.cpp | 4 ++-- tests/auto/qsidebar/tst_qsidebar.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp index 26108d7..9abefdf 100644 --- a/src/gui/dialogs/qsidebar.cpp +++ b/src/gui/dialogs/qsidebar.cpp @@ -249,9 +249,9 @@ void QUrlModel::addUrls(const QList &list, int row, bool move) continue; for (int j = 0; move && j < rowCount(); ++j) { #if defined(Q_OS_WIN) - if (index(j, 0).data(UrlRole).toUrl().toLocalFile().toLower() == url.toLocalFile().toLower()) { + if (QDir::cleanPath(index(j, 0).data(UrlRole).toUrl().toLocalFile()).toLower() == QDir::cleanPath(url.toLocalFile()).toLower()) { #else - if (index(j, 0).data(UrlRole) == url) { + if (QDir::cleanPath(index(j, 0).data(UrlRole)) == QDir::cleanPath(url)) { #endif removeRow(j); if (j <= row) diff --git a/tests/auto/qsidebar/tst_qsidebar.cpp b/tests/auto/qsidebar/tst_qsidebar.cpp index 705e222..1384391 100644 --- a/tests/auto/qsidebar/tst_qsidebar.cpp +++ b/tests/auto/qsidebar/tst_qsidebar.cpp @@ -185,6 +185,13 @@ void tst_QSidebar::addUrls() qsidebar.addUrls(doubleUrls, 1); QCOMPARE(qsidebar.urls().size(), 1); + // Two paths that are effectively pointing to the same location + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath() + "/."); + qsidebar.setUrls(emptyUrls); + qsidebar.addUrls(doubleUrls, 1); + QCOMPARE(qsidebar.urls().size(), 1); + #if defined(Q_OS_WIN) //Windows is case insensitive so no duplicate entries in that case doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); @@ -200,8 +207,6 @@ void tst_QSidebar::addUrls() qsidebar.addUrls(doubleUrls, 1); QCOMPARE(qsidebar.urls().size(), 2); #endif - - } void tst_QSidebar::goToUrl() -- cgit v0.12 From d45795809de0d5c4bb7a8c4dfd0b786373350c14 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 14 May 2009 15:45:20 +0200 Subject: Ensure style option for drawing blank area in scrollarea is initialized. Then you can actually influence it's palette. Task-number: 253495 Reviewed-by: Jens Bache-Wiig --- src/gui/widgets/qabstractscrollarea.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 9886969..0d8b4de 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -873,21 +873,22 @@ bool QAbstractScrollArea::event(QEvent *e) case QEvent::Resize: d->layoutChildren(); break; - case QEvent::Paint: + case QEvent::Paint: { + QStyleOption option; + option.initFrom(this); if (d->cornerPaintingRect.isValid()) { - QStyleOption option; option.rect = d->cornerPaintingRect; QPainter p(this); style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this); } #ifdef Q_WS_MAC if (d->reverseCornerPaintingRect.isValid()) { - QStyleOption option; option.rect = d->reverseCornerPaintingRect; QPainter p(this); style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this); } #endif + } QFrame::paintEvent((QPaintEvent*)e); break; #ifndef QT_NO_CONTEXTMENU -- cgit v0.12 From f09304d46bac91f3e8329cb7147f8df44898d1e0 Mon Sep 17 00:00:00 2001 From: jasplin Date: Thu, 14 May 2009 15:45:21 +0200 Subject: Fixed regression that prevented any widget from having focus when graphics view was disabled. A bug in Commit d5c018f7b014ab794e49d6e1f24e02233555847d prevented any widget from having focus when QT_NO_GRAPHICSVIEW was defined. This patch fixes the bug. Reviewed-by: bnilsen Task-number: 249589 --- src/gui/kernel/qapplication.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index f3bd57b..4cf0ad7 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2032,12 +2032,10 @@ QWidget *QApplication::focusWidget() void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) { - if (focus && focus->window() #ifndef QT_NO_GRAPHICSVIEW - && focus->window()->graphicsProxyWidget() -#endif - ) + if (focus && focus->window()->graphicsProxyWidget()) return; +#endif hidden_focus_widget = 0; -- cgit v0.12 From 8e9b041f0081cd5af67c5c5f3cee0cf2b70ffe11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20Thomsch=C3=BCtz?= Date: Thu, 14 May 2009 15:48:31 +0200 Subject: Use isNull() for strings instead of comparing against QString(). foo == QString() should be foo.isNull(). Fixes 7 warnings in the Norwegian Breakfast Network Reviewed-by: Samuel --- qmake/generators/xmloutput.cpp | 2 +- src/corelib/concurrent/qfuturewatcher.cpp | 2 +- src/corelib/kernel/qcoreapplication.cpp | 4 ++-- tools/macdeployqt/shared/shared.cpp | 4 ++-- tools/porting/src/portingrules.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp index 68d22e1..d77dd4b 100644 --- a/qmake/generators/xmloutput.cpp +++ b/qmake/generators/xmloutput.cpp @@ -277,7 +277,7 @@ void XmlOutput::closeTag() void XmlOutput::closeTo(const QString &tag) { bool cont = true; - if (!tagStack.contains(tag) && tag != QString()) { + if (!tagStack.contains(tag) && !tag.isNull()) { //warn_msg(WarnLogic, "<%s>: Cannot close to tag <%s>, not on stack", tagStack.last().latin1(), tag.latin1()); qDebug("<%s>: Cannot close to tag <%s>, not on stack", tagStack.last().toLatin1().constData(), tag.toLatin1().constData()); return; diff --git a/src/corelib/concurrent/qfuturewatcher.cpp b/src/corelib/concurrent/qfuturewatcher.cpp index ea35e9e..39d7698 100644 --- a/src/corelib/concurrent/qfuturewatcher.cpp +++ b/src/corelib/concurrent/qfuturewatcher.cpp @@ -465,7 +465,7 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event) break; emit q->progressValueChanged(event->index1); - if (event->text != QString()) // ### + if (!event->text.isNull()) // ### q->progressTextChanged(event->text); break; case QFutureCallOutEvent::ProgressRange: diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index a23b2dd..f6ce4b3 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1696,7 +1696,7 @@ QString QCoreApplication::applicationDirPath() } QCoreApplicationPrivate *d = self->d_func(); - if (d->cachedApplicationDirPath == QString()) + if (d->cachedApplicationDirPath.isNull()) d->cachedApplicationDirPath = QFileInfo(applicationFilePath()).path(); return d->cachedApplicationDirPath; } @@ -1724,7 +1724,7 @@ QString QCoreApplication::applicationFilePath() } QCoreApplicationPrivate *d = self->d_func(); - if (d->cachedApplicationFilePath != QString()) + if (!d->cachedApplicationFilePath.isNull()) return d->cachedApplicationFilePath; #if defined( Q_WS_WIN ) diff --git a/tools/macdeployqt/shared/shared.cpp b/tools/macdeployqt/shared/shared.cpp index db76ef2..1faa63a 100644 --- a/tools/macdeployqt/shared/shared.cpp +++ b/tools/macdeployqt/shared/shared.cpp @@ -343,7 +343,7 @@ DeploymentInfo deployQtFrameworks(QList frameworks, const QString copiedFrameworks.append(framework.frameworkName); // Get the qt path from one of the Qt frameworks; - if (deploymenInfo.qtPath == QString() && framework.frameworkName.contains("Qt") + if (deploymenInfo.qtPath.isNull() && framework.frameworkName.contains("Qt") && framework.frameworkDirectory.contains("/lib")) { deploymenInfo.qtPath = framework.frameworkDirectory; @@ -364,7 +364,7 @@ DeploymentInfo deployQtFrameworks(QList frameworks, const QString // Copy farmework to app bundle. const QString deployedBinaryPath = copyFramework(framework, bundlePath); // Skip the rest if already was deployed. - if (deployedBinaryPath == QString()) + if (deployedBinaryPath.isNull()) continue; runStrip(deployedBinaryPath); diff --git a/tools/porting/src/portingrules.cpp b/tools/porting/src/portingrules.cpp index 4931064..cd29403 100644 --- a/tools/porting/src/portingrules.cpp +++ b/tools/porting/src/portingrules.cpp @@ -189,7 +189,7 @@ void PortingRules::parseXml(QString fileName) QString includeFile = xml[QLatin1String("Rules")][QLatin1String("Include")].text(); - if(includeFile != QString()) { + if(!includeFile.isNull()) { QString resolvedIncludeFile = resolveFileName(fileName, includeFile); if (!resolvedIncludeFile.isEmpty()) parseXml(resolvedIncludeFile); -- cgit v0.12 From a2f9d610c5cfd80819dc9a11c9452fcadba6ebb4 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 14 May 2009 16:09:41 +0200 Subject: Fix missing update of edit geometry on QSpinBox When showing or hiding spinbox buttons we did not update the child line edit geometry. This would on windows basically mean that the buttons would not show up as they were completely covered by the edit. Task-number: 235747 Reviewed-by: ogoffart --- src/gui/widgets/qabstractspinbox.cpp | 1 + tests/auto/qspinbox/tst_qspinbox.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/gui/widgets/qabstractspinbox.cpp b/src/gui/widgets/qabstractspinbox.cpp index 347f89a..d640c70 100644 --- a/src/gui/widgets/qabstractspinbox.cpp +++ b/src/gui/widgets/qabstractspinbox.cpp @@ -193,6 +193,7 @@ void QAbstractSpinBox::setButtonSymbols(ButtonSymbols buttonSymbols) Q_D(QAbstractSpinBox); if (d->buttonSymbols != buttonSymbols) { d->buttonSymbols = buttonSymbols; + d->updateEditFieldGeometry(); update(); } } diff --git a/tests/auto/qspinbox/tst_qspinbox.cpp b/tests/auto/qspinbox/tst_qspinbox.cpp index 1867356..575f261 100644 --- a/tests/auto/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/qspinbox/tst_qspinbox.cpp @@ -241,6 +241,12 @@ void tst_QSpinBox::getSetCheck() QCOMPARE(0.0, obj2.value()); obj2.setValue(1.0); QCOMPARE(1.0, obj2.value()); + + // Make sure we update line edit geometry when updating + // buttons - see task 235747 + QRect oldEditGeometry = obj1.childrenRect(); + obj1.setButtonSymbols(QAbstractSpinBox::NoButtons); + QVERIFY(obj1.childrenRect() != oldEditGeometry); } tst_QSpinBox::tst_QSpinBox() -- cgit v0.12 From d644a9a89ff4f7bf8866b69af5334ea1c696e4a7 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Thu, 14 May 2009 16:19:22 +0200 Subject: Compile. Need the proper types. Reviewed-by: Andy --- src/gui/dialogs/qsidebar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp index 9abefdf..000a06b 100644 --- a/src/gui/dialogs/qsidebar.cpp +++ b/src/gui/dialogs/qsidebar.cpp @@ -251,7 +251,7 @@ void QUrlModel::addUrls(const QList &list, int row, bool move) #if defined(Q_OS_WIN) if (QDir::cleanPath(index(j, 0).data(UrlRole).toUrl().toLocalFile()).toLower() == QDir::cleanPath(url.toLocalFile()).toLower()) { #else - if (QDir::cleanPath(index(j, 0).data(UrlRole)) == QDir::cleanPath(url)) { + if (QDir::cleanPath(index(j, 0).data(UrlRole).toUrl().toLocalFile()) == QDir::cleanPath(url.toLocalFile())) { #endif removeRow(j); if (j <= row) -- cgit v0.12 From d8a5799de2be228c10faaaa3e6f4c7eb07793b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Thu, 14 May 2009 16:45:17 +0200 Subject: Find chart.exe on windows. --- src/testlib/qtestcase.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 8c76c5d..041f2db 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1465,8 +1465,12 @@ int QTest::qExec(QObject *testObject, int argc, char **argv) #if !defined(QT_NO_PROCESS) || !defined(QT_NO_SETTINGS) if (QBenchmarkGlobalData::current->createChart) { - QString chartLocation = QLibraryInfo::location(QLibraryInfo::BinariesPath) - + QLatin1String("/../tools/qtestlib/chart/chart"); + QString chartLocation = QLibraryInfo::location(QLibraryInfo::BinariesPath); +#ifdef Q_OS_WIN + chartLocation += QLatin1String("/../tools/qtestlib/chart/release/chart.exe"); +#else + chartLocation += QLatin1String("/../tools/qtestlib/chart/chart"); +#endif if (QFile::exists(chartLocation)) { QProcess p; p.setProcessChannelMode(QProcess::ForwardedChannels); -- cgit v0.12 From bacdcc7d2ed4816688c19ddbffa8d3aab98b2123 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 14 May 2009 16:42:13 +0200 Subject: Fix QSplitter::setHandleWidth to work with motif style Motif style was incorrectly adjusting it's size in sizeFromConents. This is wrong and prevents the function from overriding the huge minimum size on the widget. PM_SplitterWidth already ensures the proper default size for the splitter. Task-number: 194542 Reviewed-by: ogoffart --- src/gui/styles/qmotifstyle.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/styles/qmotifstyle.cpp b/src/gui/styles/qmotifstyle.cpp index 7d4fab8..be0e3eb 100644 --- a/src/gui/styles/qmotifstyle.cpp +++ b/src/gui/styles/qmotifstyle.cpp @@ -2026,10 +2026,6 @@ QMotifStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, QSize sz(contentsSize); switch(ct) { - case CT_Splitter: - sz = QSize(10, 10); - break; - case CT_RadioButton: case CT_CheckBox: sz = QCommonStyle::sizeFromContents(ct, opt, contentsSize, widget); -- cgit v0.12 From 85f98acaa3a38079071bea711e43c9a86edec1f6 Mon Sep 17 00:00:00 2001 From: Trond Kjernaasen Date: Thu, 14 May 2009 17:38:56 +0200 Subject: Fixed an issue with text drawing under Windows. Some text drawn with OpenType fonts where cut off by a pixel or two under certain circumstances. This adds an additional 2 pixel pad margin to the glyph cache entries. The padding behaves slightly different when ClearType is enabled/disabled, hence the general 2 pixel padding. Task-number: 246196 Reviewed-by: Samuel --- src/gui/painting/qtextureglyphcache.cpp | 11 ++++------- src/gui/text/qfontengine_win.cpp | 6 +++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 1ea40ba..3fd1ffb 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -88,11 +88,12 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti, ti.ascent.toReal(), ti.descent.toReal()); #endif - int glyph_width = metrics.width.ceil().toInt() + margin * 2; - int glyph_height = metrics.height.ceil().toInt() + margin * 2; + int glyph_width = metrics.width.ceil().toInt(); + int glyph_height = metrics.height.ceil().toInt(); if (glyph_height == 0 || glyph_width == 0) continue; - + glyph_width += margin * 2 + 2; + glyph_height += margin * 2 + 2; // align to 8-bit boundary if (m_type == QFontEngineGlyphCache::Raster_Mono) glyph_width = (glyph_width+7)&~7; @@ -188,11 +189,7 @@ void QImageTextureGlyphCache::createTextureData(int width, int height) int QImageTextureGlyphCache::glyphMargin() const { -#ifdef Q_WS_MAC return 2; -#else - return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; -#endif } void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g) diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 1996d44..bf3a176 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -1406,8 +1406,8 @@ QNativeImage *QFontEngineWin::drawGDIGlyph(HFONT font, glyph_t glyph, int margin #endif #endif - QNativeImage *ni = new QNativeImage(iw + 2 * margin, - ih + 2 * margin, + QNativeImage *ni = new QNativeImage(iw + 2 * margin + 2, + ih + 2 * margin + 2, QNativeImage::systemFormat(), true); ni->image.fill(0xffffffff); @@ -1449,7 +1449,7 @@ QImage QFontEngineWin::alphaMapForGlyph(glyph_t glyph, const QTransform &xform) font = CreateFontIndirectW(&lf); } - QNativeImage *mask = drawGDIGlyph(font, glyph, 0, xform); + QNativeImage *mask = drawGDIGlyph(font, glyph, 2, xform); if (mask == 0) return QImage(); -- cgit v0.12 From ae3f20e9ce7f592c22c23e8dea6bb9feb52c8b90 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 14 May 2009 18:40:03 +0200 Subject: QColor::toCmyk() does not convert the color if it is already in CMYK QColor::toCmyk() converted the color to RGB and then to CMYK. If the color was already in CMYK, this conversion change it. The color is now returned directly if it is in CMYK Reviewed-by: Ariya Task-number: 253625 --- src/gui/painting/qcolor.cpp | 4 ++-- tests/auto/qcolor/tst_qcolor.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 5d7d4ab..1723a19 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -1369,7 +1369,7 @@ QColor QColor::toRgb() const */ QColor QColor::toHsv() const { - if (!isValid()) + if (!isValid() || cspec == Hsv) return *this; if (cspec != Rgb) @@ -1421,7 +1421,7 @@ QColor QColor::toHsv() const */ QColor QColor::toCmyk() const { - if (!isValid()) + if (!isValid() || cspec == Cmyk) return *this; if (cspec != Rgb) return toRgb().toCmyk(); diff --git a/tests/auto/qcolor/tst_qcolor.cpp b/tests/auto/qcolor/tst_qcolor.cpp index 7608a15..684d5b5 100644 --- a/tests/auto/qcolor/tst_qcolor.cpp +++ b/tests/auto/qcolor/tst_qcolor.cpp @@ -111,12 +111,15 @@ private slots: void toRgb_data(); void toRgb(); + void toRgbNonDestructive(); void toHsv_data(); void toHsv(); + void toHsvNonDestructive(); void toCmyk_data(); void toCmyk(); + void toCmykNonDestructive(); void convertTo(); @@ -1124,6 +1127,12 @@ void tst_QColor::toHsv_data() << QColor::fromCmykF(0., 1., 1., 0.); } +void tst_QColor::toRgbNonDestructive() +{ + QColor aColor = QColor::fromRgbF(0.11, 0.22, 0.33, 0.44); + QCOMPARE(aColor, aColor.toRgb()); +} + void tst_QColor::toHsv() { // invalid should remain invalid @@ -1136,6 +1145,12 @@ void tst_QColor::toHsv() QCOMPARE(cmykColor.toHsv(), expectedColor); } +void tst_QColor::toHsvNonDestructive() +{ + QColor aColor = QColor::fromHsvF(0.11, 0.22, 0.33, 0.44); + QCOMPARE(aColor, aColor.toHsv()); +} + void tst_QColor::toCmyk_data() { QTest::addColumn("expectedColor"); @@ -1165,6 +1180,12 @@ void tst_QColor::toCmyk() QCOMPARE(hsvColor.toCmyk(), expectedColor); } +void tst_QColor::toCmykNonDestructive() +{ + QColor aColor = QColor::fromCmykF(0.11, 0.22, 0.33, 0.44); + QCOMPARE(aColor, aColor.toCmyk()); +} + void tst_QColor::convertTo() { QColor color(Qt::black); -- cgit v0.12 From 38f8b6d63aa88bb4b05c164632e5058beed9a7db Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 14 May 2009 18:40:03 +0200 Subject: QColor::toCmyk() does not convert the color if it is already in CMYK QColor::toCmyk() converted the color to RGB and then to CMYK. If the color was already in CMYK, this conversion change it. The color is now returned directly if it is in CMYK Reviewed-by: Ariya Task-number: 253625 --- src/gui/painting/qcolor.cpp | 4 ++-- tests/auto/qcolor/tst_qcolor.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 24d167e..534a425 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -1369,7 +1369,7 @@ QColor QColor::toRgb() const */ QColor QColor::toHsv() const { - if (!isValid()) + if (!isValid() || cspec == Hsv) return *this; if (cspec != Rgb) @@ -1421,7 +1421,7 @@ QColor QColor::toHsv() const */ QColor QColor::toCmyk() const { - if (!isValid()) + if (!isValid() || cspec == Cmyk) return *this; if (cspec != Rgb) return toRgb().toCmyk(); diff --git a/tests/auto/qcolor/tst_qcolor.cpp b/tests/auto/qcolor/tst_qcolor.cpp index 7608a15..684d5b5 100644 --- a/tests/auto/qcolor/tst_qcolor.cpp +++ b/tests/auto/qcolor/tst_qcolor.cpp @@ -111,12 +111,15 @@ private slots: void toRgb_data(); void toRgb(); + void toRgbNonDestructive(); void toHsv_data(); void toHsv(); + void toHsvNonDestructive(); void toCmyk_data(); void toCmyk(); + void toCmykNonDestructive(); void convertTo(); @@ -1124,6 +1127,12 @@ void tst_QColor::toHsv_data() << QColor::fromCmykF(0., 1., 1., 0.); } +void tst_QColor::toRgbNonDestructive() +{ + QColor aColor = QColor::fromRgbF(0.11, 0.22, 0.33, 0.44); + QCOMPARE(aColor, aColor.toRgb()); +} + void tst_QColor::toHsv() { // invalid should remain invalid @@ -1136,6 +1145,12 @@ void tst_QColor::toHsv() QCOMPARE(cmykColor.toHsv(), expectedColor); } +void tst_QColor::toHsvNonDestructive() +{ + QColor aColor = QColor::fromHsvF(0.11, 0.22, 0.33, 0.44); + QCOMPARE(aColor, aColor.toHsv()); +} + void tst_QColor::toCmyk_data() { QTest::addColumn("expectedColor"); @@ -1165,6 +1180,12 @@ void tst_QColor::toCmyk() QCOMPARE(hsvColor.toCmyk(), expectedColor); } +void tst_QColor::toCmykNonDestructive() +{ + QColor aColor = QColor::fromCmykF(0.11, 0.22, 0.33, 0.44); + QCOMPARE(aColor, aColor.toCmyk()); +} + void tst_QColor::convertTo() { QColor color(Qt::black); -- cgit v0.12 From f36d2e5cd0655cee2a1bfb84a66400a4b7a4c454 Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Thu, 14 May 2009 23:29:28 +0200 Subject: Only build the QWS keymap converter in embedded builds. Reviewed-by: TrustMe --- tools/tools.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools.pro b/tools/tools.pro index 0a56cfb..d034dcd 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -22,7 +22,7 @@ mac { SUBDIRS += macdeployqt } -SUBDIRS += kmap2qmap +embedded:SUBDIRS += kmap2qmap contains(QT_CONFIG, dbus):SUBDIRS += qdbus !wince*:contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns -- cgit v0.12 From ac98ab496ecfba9493e93f0e0323822a1c9ed2d6 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 15 May 2009 14:10:44 +1000 Subject: compile (rand()) --- examples/tools/contiguouscache/randomlistmodel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/tools/contiguouscache/randomlistmodel.cpp b/examples/tools/contiguouscache/randomlistmodel.cpp index 0f58c0e..b1c7204 100644 --- a/examples/tools/contiguouscache/randomlistmodel.cpp +++ b/examples/tools/contiguouscache/randomlistmodel.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ #include "randomlistmodel.h" +#include static const int bufferSize(500); static const int lookAhead(100); -- cgit v0.12 From ad679a7993042f1df8da8c2d90d325be3cf0113d Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 15 May 2009 18:51:54 +1000 Subject: Fix syntax error in demos.pro. Reviewed-by: Lincoln Ramsay --- demos/demos.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/demos.pro b/demos/demos.pro index 9248ab8..6084550 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -30,7 +30,7 @@ contains(QT_BUILD_PARTS, tools):{ wince*: SUBDIRS += demos_sqlbrowser } } -contains(QT_CONFIG, phonon)!static:SUBDIRS += demos_mediaplayer +contains(QT_CONFIG, phonon):!static:SUBDIRS += demos_mediaplayer contains(QT_CONFIG, webkit):contains(QT_CONFIG, svg):SUBDIRS += demos_browser # install -- cgit v0.12 From 7c40487dce7c11c93444dc3c74fce84b09901d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Fri, 15 May 2009 11:39:15 +0200 Subject: Make the charts work on internet explorer (tested on IE8) --- tools/qtestlib/chart/benchmark_template.html | 16 +++++++++++++--- tools/qtestlib/chart/reportgenerator.cpp | 3 +-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tools/qtestlib/chart/benchmark_template.html b/tools/qtestlib/chart/benchmark_template.html index 11efd92..a7e48be 100644 --- a/tools/qtestlib/chart/benchmark_template.html +++ b/tools/qtestlib/chart/benchmark_template.html @@ -108,15 +108,25 @@ function checkform() this.createChart(); } +function createElement(nodeName, name) { + var node; + try { + node = document.createElement("<"+nodeName+" name="+name+">"); + } catch (e) { + node = document.createElement(nodeName); + node.name = name; + } + return node; +} + function createFormSelector(form, value, text, type) { - var selector = document.createElement('input'); - form.appendChild(selector); + var selector = createElement('input', 'list'); selector.type = type; - selector.name = 'list'; selector.defaultChecked = true; selector.value = value; + form.appendChild(selector); form.appendChild(document.createTextNode(text)); form.appendChild(document.createElement("BR")); } diff --git a/tools/qtestlib/chart/reportgenerator.cpp b/tools/qtestlib/chart/reportgenerator.cpp index bf5bf94..94661ba 100644 --- a/tools/qtestlib/chart/reportgenerator.cpp +++ b/tools/qtestlib/chart/reportgenerator.cpp @@ -253,7 +253,7 @@ QByteArray printSeriesLabels(const QString &tableName, const QString &seriesColu output += "["; foreach(const QString &serie, series) { - output += "\"" + serie.toLocal8Bit() + "\", "; + output += "\"" + serie.toLocal8Bit() + "\","; } output.chop(1); //remove last comma output += "]\n"; @@ -446,7 +446,6 @@ void ReportGenerator::writeReports() } */ writeReport("Results", "results.html", false); - qDebug() << "Supported browsers: Firefox, Safari, Opera, Qt Demo Browser (IE and KDE 3 Konqueror are not supported)"; } QString ReportGenerator::fileName() -- cgit v0.12 From 9c3f5040bc9b80619ebe167c352ac8f0394f9b41 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Fri, 15 May 2009 11:43:09 +0200 Subject: Cleaning bug in custom layout example. The example was using deleteAllItems() to delete items from the layout. This method is now part of the QT3_SUPPORT and shold not be used if not needed. Replaced by deleting all items one by one. Task-number: 220656 Rev-by: janarve --- doc/src/layout.qdoc | 6 +++--- doc/src/snippets/code/doc_src_layout.qdoc | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/src/layout.qdoc b/doc/src/layout.qdoc index 196999b..d97fcfc 100644 --- a/doc/src/layout.qdoc +++ b/doc/src/layout.qdoc @@ -343,9 +343,9 @@ \snippet doc/src/snippets/code/doc_src_layout.qdoc 4 The layout takes over responsibility of the items added. Since QLayoutItem - does not inherit QObject, we must delete the items manually. The function - QLayout::deleteAllItems() uses \c{takeAt()} defined above to delete all the - items in the layout. + does not inherit QObject, we must delete the items manually. In the + destructor, we remove each item from the list using \c{takeAt()}, and + then delete it. \snippet doc/src/snippets/code/doc_src_layout.qdoc 5 diff --git a/doc/src/snippets/code/doc_src_layout.qdoc b/doc/src/snippets/code/doc_src_layout.qdoc index fedcf0c..60f36b0 100644 --- a/doc/src/snippets/code/doc_src_layout.qdoc +++ b/doc/src/snippets/code/doc_src_layout.qdoc @@ -67,7 +67,9 @@ void CardLayout::addItem(QLayoutItem *item) //! [5] CardLayout::~CardLayout() { - deleteAllItems(); + QLayoutItem *item; + while ((item = takeAt(0))) + delete item; } //! [5] @@ -121,4 +123,4 @@ QSize CardLayout::minimumSize() const } return s + n*QSize(spacing(), spacing()); } -//! [7] \ No newline at end of file +//! [7] -- cgit v0.12 From d216c0fd62a879fd1eb84e087f70c7f542d75d58 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 14 May 2009 11:21:25 +0200 Subject: HTTP authentication: return error if authentication cannot be handled return error upon receiving an unknown authentication method (e.g. WSSE); before we were just silently returning. Reviewed-by: Thiago Macieira --- src/network/access/qhttpnetworkconnection.cpp | 20 +++++++--- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 52 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index f558f2b..ae518df 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -643,10 +643,21 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN switch (statusCode) { case 401: case 407: - handleAuthenticateChallenge(socket, reply, (statusCode == 407), resend); - if (resend) { - eraseData(reply); - sendRequest(socket); + if (handleAuthenticateChallenge(socket, reply, (statusCode == 407), resend)) { + if (resend) { + eraseData(reply); + sendRequest(socket); + } + } else { + int i = indexOf(socket); + emit channels[i].reply->headerChanged(); + emit channels[i].reply->readyRead(); + QNetworkReply::NetworkError errorCode = (statusCode == 407) + ? QNetworkReply::ProxyAuthenticationRequiredError + : QNetworkReply::AuthenticationRequiredError; + reply->d_func()->errorString = errorDetail(errorCode, socket); + emit q->error(errorCode, reply->d_func()->errorString); + emit channels[i].reply->finished(); } break; default: @@ -749,7 +760,6 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket // authentication is cancelled, send the current contents to the user. emit channels[i].reply->headerChanged(); emit channels[i].reply->readyRead(); - emit channels[i].reply->finished(); QNetworkReply::NetworkError errorCode = isProxy ? QNetworkReply::ProxyAuthenticationRequiredError diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 4be0863..bb199b9 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -217,6 +217,8 @@ private Q_SLOTS: void httpProxyCommands_data(); void httpProxyCommands(); void proxyChange(); + void authorizationError_data(); + void authorizationError(); }; QT_BEGIN_NAMESPACE @@ -3012,5 +3014,55 @@ void tst_QNetworkReply::proxyChange() QVERIFY(int(reply3->error()) > 0); } +void tst_QNetworkReply::authorizationError_data() +{ + + QTest::addColumn("url"); + QTest::addColumn("errorSignalCount"); + QTest::addColumn("finishedSignalCount"); + QTest::addColumn("error"); + QTest::addColumn("httpStatusCode"); + QTest::addColumn("httpBody"); + + QTest::newRow("unknown-authorization-method") << "http://" + QtNetworkSettings::serverName() + + "/cgi-bin/http-unknown-authentication-method.cgi?401-authorization-required" << 1 << 1 + << int(QNetworkReply::AuthenticationRequiredError) << 401 << "authorization required"; + QTest::newRow("unknown-proxy-authorization-method") << "http://" + QtNetworkSettings::serverName() + + "/cgi-bin/http-unknown-authentication-method.cgi?407-proxy-authorization-required" << 1 << 1 + << int(QNetworkReply::ProxyAuthenticationRequiredError) << 407 + << "authorization required"; +} + +void tst_QNetworkReply::authorizationError() +{ + QFETCH(QString, url); + QNetworkRequest request(url); + QNetworkReplyPtr reply = manager.get(request); + + QCOMPARE(reply->error(), QNetworkReply::NoError); + + qRegisterMetaType("QNetworkReply::NetworkError"); + QSignalSpy errorSpy(reply, SIGNAL(error(QNetworkReply::NetworkError))); + QSignalSpy finishedSpy(reply, SIGNAL(finished())); + // now run the request: + connect(reply, SIGNAL(finished()), + &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); + + QFETCH(int, errorSignalCount); + QCOMPARE(errorSpy.count(), errorSignalCount); + QFETCH(int, finishedSignalCount); + QCOMPARE(finishedSpy.count(), finishedSignalCount); + QFETCH(int, error); + QCOMPARE(reply->error(), QNetworkReply::NetworkError(error)); + + QFETCH(int, httpStatusCode); + QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), httpStatusCode); + + QFETCH(QString, httpBody); + QCOMPARE(QString(reply->readAll()), httpBody); +} + QTEST_MAIN(tst_QNetworkReply) #include "tst_qnetworkreply.moc" -- cgit v0.12 From 3875cd2b0a81c190939ea2803a2efbe890ae38ec Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 15 May 2009 14:53:23 +0200 Subject: Cocoa: Window flickers when resized with a QTabWidget Seems like we were not using the correct functions for setting the max/min size on a cocoa window. The version we used before included the unified toolbar, which is wrong. The new one does not. Task-number: 252642 Reviewed-by: Trenton Schulz --- src/gui/kernel/qwidget_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 0e021dc..f863428 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4035,8 +4035,8 @@ void QWidgetPrivate::applyMaxAndMinSizeOnWindow() NSSize max = NSMakeSize(SF(extra->maxw), SF(extra->maxh)); NSSize min = NSMakeSize(SF(extra->minw), SF(extra->minh)); #undef SF - [qt_mac_window_for(q) setMinSize:min]; - [qt_mac_window_for(q) setMaxSize:max]; + [qt_mac_window_for(q) setContentMinSize:min]; + [qt_mac_window_for(q) setContentMaxSize:max]; #endif } -- cgit v0.12 From b0095f7f8925cf571224d348124f08c56f7f46e9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 15 May 2009 15:14:09 +0200 Subject: qdoc: Added name alignment for summaries. --- tools/qdoc3/htmlgenerator.cpp | 875 ++++++++++++++++++++++++++++-------------- tools/qdoc3/htmlgenerator.h | 30 +- 2 files changed, 618 insertions(+), 287 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 13d52bf..295cdab 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -61,6 +61,127 @@ QT_BEGIN_NAMESPACE static bool showBrokenLinks = false; +static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*()"); +static QRegExp funcTag("(<@func target=\"([^\"]*)\">)(.*)()"); +static QRegExp typeTag("(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()"); +static QRegExp spanTag(""); +static QRegExp unknownTag("]*>"); + +bool parseArg(const QString &src, + const QString &tag, + int *pos, + int n, + QStringRef *contents, + QStringRef *par1 = 0, + bool debug = false) +{ +#define SKIP_CHAR(c) \ + if (debug) \ + qDebug() << "looking for " << c << " at " << QString(src.data() + i, n - i); \ + if (i >= n || src[i] != c) { \ + if (debug) \ + qDebug() << " char '" << c << "' not found"; \ + return false; \ + } \ + ++i; + + +#define SKIP_SPACE \ + while (i < n && src[i] == ' ') \ + ++i; + + int i = *pos; + int j = i; + + // assume "<@" has been parsed outside + //SKIP_CHAR('<'); + //SKIP_CHAR('@'); + + if (tag != QStringRef(&src, i, tag.length())) { + if (0 && debug) + qDebug() << "tag " << tag << " not found at " << i; + return false; + } + + if (debug) + qDebug() << "haystack:" << src << "needle:" << tag << "i:" <).*()"); + if (par1) { + SKIP_SPACE; + // read parameter name + j = i; + while (i < n && src[i].isLetter()) + ++i; + if (src[i] == '=') { + if (debug) + qDebug() << "read parameter" << QString(src.data() + j, i - j); + SKIP_CHAR('='); + SKIP_CHAR('"'); + // skip parameter name + j = i; + while (i < n && src[i] != '"') + ++i; + *par1 = QStringRef(&src, j, i - j); + SKIP_CHAR('"'); + SKIP_SPACE; + } else { + if (debug) + qDebug() << "no optional parameter found"; + } + } + SKIP_SPACE; + SKIP_CHAR('>'); + + // find contents up to closing " + j = i; + for (; true; ++i) { + if (i + 4 + tag.length() > n) + return false; + if (src[i] != '<') + continue; + if (src[i + 1] != '/') + continue; + if (src[i + 2] != '@') + continue; + if (tag != QStringRef(&src, i + 3, tag.length())) + continue; + if (src[i + 3 + tag.length()] != '>') + continue; + break; + } + + *contents = QStringRef(&src, j, i - j); + + i += tag.length() + 4; + + *pos = i; + if (debug) + qDebug() << " tag " << tag << " found: pos now: " << i; + return true; +#undef SKIP_CHAR +} + +static void addLink(const QString &linkTarget, + const QStringRef &nestedStuff, + QString *res) +{ + if (!linkTarget.isEmpty()) { + *res += ""; + *res += nestedStuff; + *res += ""; + } + else { + *res += nestedStuff; + } +} + + HtmlGenerator::HtmlGenerator() : helpProjectWriter(0), inLink(false), inContents(false), inSectionHeading(false), inTableHeader(false), numTableRows(0), @@ -1928,40 +2049,6 @@ void HtmlGenerator::generateLegaleseList(const Node *relative, CodeMarker *marke } } -void HtmlGenerator::generateSynopsis(const Node *node, const Node *relative, - CodeMarker *marker, CodeMarker::SynopsisStyle style) -{ - QString marked = marker->markedUpSynopsis(node, relative, style); - QRegExp templateTag("(<[^@>]*>)"); - if (marked.indexOf(templateTag) != -1) { - QString contents = protect(marked.mid(templateTag.pos(1), - templateTag.cap(1).length())); - marked.replace(templateTag.pos(1), templateTag.cap(1).length(), - contents); - } - marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), "\\1\\2"); - marked.replace("<@param>", ""); - marked.replace("", ""); - - if (style == CodeMarker::Summary) - marked.replace("@name>", "b>"); - - if (style == CodeMarker::SeparateList) { - QRegExp extraRegExp("<@extra>.*"); - extraRegExp.setMinimal(true); - marked.replace(extraRegExp, ""); - } else { - marked.replace("<@extra>", "  "); - marked.replace("", ""); - } - - if (style != CodeMarker::Detailed) { - marked.replace("<@type>", ""); - marked.replace("", ""); - } - out() << highlightedCode(marked, marker, relative); -} - void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* marker */) { QMap > fakeNodeMap; @@ -2075,21 +2162,35 @@ void HtmlGenerator::generateOverviewList(const Node *relative, CodeMarker * /* m } } -void HtmlGenerator::generateSectionList(const Section& section, const Node *relative, - CodeMarker *marker, CodeMarker::SynopsisStyle style) +#ifdef QDOC_NAME_ALIGNMENT +void HtmlGenerator::generateSectionList(const Section& section, + const Node *relative, + CodeMarker *marker, + CodeMarker::SynopsisStyle style) { + bool name_alignment = true; if (!section.members.isEmpty()) { bool twoColumn = false; if (style == CodeMarker::SeparateList) { + name_alignment = false; twoColumn = (section.members.count() >= 16); - } else if (section.members.first()->type() == Node::Property) { + } + else if (section.members.first()->type() == Node::Property) { twoColumn = (section.members.count() >= 5); + name_alignment = false; + } + if (name_alignment) { + out() << "\n"; + } + else { + if (twoColumn) + out() << "

    \n" + << "
    "; + out() << "
      \n"; } - if (twoColumn) - out() << "

      \n" - << "\n"; + else + out() << "\n"; i++; ++m; } - out() << "\n"; - if (twoColumn) - out() << "\n
      "; - out() << "
        \n"; int i = 0; NodeList::ConstIterator m = section.members.begin(); @@ -2099,41 +2200,59 @@ void HtmlGenerator::generateSectionList(const Section& section, const Node *rela continue; } - if (twoColumn && i == (int) (section.members.count() + 1) / 2) - out() << "
        \n"; + if (name_alignment) { + out() << "
      "; + } + else { + if (twoColumn && i == (int) (section.members.count() + 1) / 2) + out() << "
        \n"; + out() << "
      • "; + } - out() << "
      • "; if (style == CodeMarker::Accessors) out() << ""; - generateSynopsis(*m, relative, marker, style); + generateSynopsis(*m, relative, marker, style, name_alignment); if (style == CodeMarker::Accessors) out() << ""; - out() << "
      • \n"; + if (name_alignment) + out() << "

      \n"; + if (name_alignment) + out() << "
    \n"; + else { + out() << "\n"; + if (twoColumn) + out() << "\n

    \n"; + } } if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { out() << "
      \n"; - generateSectionInheritedList(section, relative, marker); + generateSectionInheritedList(section, relative, marker, name_alignment); out() << "
    \n"; } } -void HtmlGenerator::generateSectionInheritedList(const Section& section, const Node *relative, - CodeMarker *marker) +void HtmlGenerator::generateSectionInheritedList(const Section& section, + const Node *relative, + CodeMarker *marker, + bool nameAlignment) { QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { - out() << "
  • "; - out() << (*p).second << " "; + if (nameAlignment) + out() << "
  • "; + else + out() << (*p).second << " "; if ((*p).second == 1) { out() << section.singularMember; - } else { + } + else { out() << section.pluralMember; } out() << " inherited from markedUpSynopsis(node, relative, style); + QRegExp templateTag("(<[^@>]*>)"); + if (marked.indexOf(templateTag) != -1) { + QString contents = protect(marked.mid(templateTag.pos(1), + templateTag.cap(1).length())); + marked.replace(templateTag.pos(1), templateTag.cap(1).length(), + contents); + } + marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), + "\\1\\2"); + marked.replace("<@param>", ""); + marked.replace("", ""); - if (funcLeftParen.indexIn(atom->string()) != -1 && marker->recognizeLanguage("Cpp")) { - // hack for C++: move () outside of link - int k = funcLeftParen.pos(1); - out() << protect(atom->string().left(k)); - if (link.isEmpty()) { - if (showBrokenLinks) - out() << ""; - } else { - out() << ""; - } - inLink = false; - out() << protect(atom->string().mid(k)); - } else if (marker->recognizeLanguage("Java")) { - // hack for Java: remove () and use when appropriate - bool func = atom->string().endsWith("()"); - bool tt = (func || atom->string().contains(camelCase)); - if (tt) - out() << ""; - if (func) { - out() << protect(atom->string().left(atom->string().length() - 2)); - } else { - out() << protect(atom->string()); - } - out() << ""; + if (style == CodeMarker::Summary) + marked.replace("@name>", "b>"); + + if (style == CodeMarker::SeparateList) { + QRegExp extraRegExp("<@extra>.*"); + extraRegExp.setMinimal(true); + marked.replace(extraRegExp, ""); } else { - out() << protect(atom->string()); + marked.replace("<@extra>", "  "); + marked.replace("", ""); + } + + if (style != CodeMarker::Detailed) { + marked.replace("<@type>", ""); + marked.replace("", ""); } + out() << highlightedCode(marked, marker, relative, nameAlignment); } -QString HtmlGenerator::cleanRef(const QString& ref) +QString HtmlGenerator::highlightedCode(const QString& markedCode, + CodeMarker *marker, + const Node *relative, + bool nameAlignment) { - QString clean; - - if (ref.isEmpty()) - return clean; + QString src = markedCode; + QString html; + QStringRef arg; + QStringRef par1; - clean.reserve(ref.size() + 20); - const QChar c = ref[0]; - const uint u = c.unicode(); + const QChar charLangle = '<'; + const QChar charAt = '@'; - if ((u >= 'a' && u <= 'z') || - (u >= 'A' && u <= 'Z') || - (u >= '0' && u <= '9')) { - clean += c; - } else if (u == '~') { - clean += "dtor."; - } else if (u == '_') { - clean += "underscore."; - } else { - clean += "A"; - } - - for (int i = 1; i < (int) ref.length(); i++) { - const QChar c = ref[i]; - const uint u = c.unicode(); - if ((u >= 'a' && u <= 'z') || - (u >= 'A' && u <= 'Z') || - (u >= '0' && u <= '9') || u == '-' || - u == '_' || u == ':' || u == '.') { - clean += c; - } else if (c.isSpace()) { - clean += "-"; - } else if (u == '!') { - clean += "-not"; - } else if (u == '&') { - clean += "-and"; - } else if (u == '<') { - clean += "-lt"; - } else if (u == '=') { - clean += "-eq"; - } else if (u == '>') { - clean += "-gt"; - } else if (u == '#') { - clean += "#"; - } else { - clean += "-"; - clean += QString::number((int)u, 16); + // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" + static const QString linkTag("link"); + for (int i = 0, n = src.size(); i < n;) { + if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { + if (nameAlignment && (i != 0)) + html += " "; + i += 2; + if (parseArg(src, linkTag, &i, n, &arg, &par1)) { + QString link = linkForNode( + CodeMarker::nodeForString(par1.toString()), relative); + addLink(link, arg, &html); + } + else { + html += charLangle; + html += charAt; + } + } + else { + html += src.at(i++); } } - return clean; -} -QString HtmlGenerator::registerRef(const QString& ref) -{ - QString clean = HtmlGenerator::cleanRef(ref); - for (;;) { - QString& prevRef = refMap[clean.toLower()]; - if (prevRef.isEmpty()) { - prevRef = ref; - break; - } else if (prevRef == ref) { - break; + if (slow) { + // is this block ever used at all? + // replace all <@func> tags: "(<@func target=\"([^\"]*)\">)(.*)()" + src = html; + html = QString(); + static const QString funcTag("func"); + for (int i = 0, n = src.size(); i < n;) { + if (src.at(i) == charLangle && src.at(i + 1) == charAt) { + i += 2; + if (parseArg(src, funcTag, &i, n, &arg, &par1)) { + QString link = linkForNode( + marker->resolveTarget(par1.toString(), + tre, + relative), + relative); + addLink(link, arg, &html); + par1 = QStringRef(); + } + else { + html += charLangle; + html += charAt; + } + } + else { + html += src.at(i++); + } } - clean += "x"; } - return clean; -} -QString HtmlGenerator::protect(const QString& string) -{ -#define APPEND(x) \ - if (html.isEmpty()) { \ - html = string; \ - html.truncate(i); \ - } \ - html += (x); - - QString html; - int n = string.length(); - - for (int i = 0; i < n; ++i) { - QChar ch = string.at(i); - - if (ch == QLatin1Char('&')) { - APPEND("&"); - } else if (ch == QLatin1Char('<')) { - APPEND("<"); - } else if (ch == QLatin1Char('>')) { - APPEND(">"); - } else if (ch == QLatin1Char('"')) { - APPEND("""); - } else if (ch.unicode() > 0x007F - || (ch == QLatin1Char('*') && i + 1 < n && string.at(i) == QLatin1Char('/')) - || (ch == QLatin1Char('.') && i > 2 && string.at(i - 2) == QLatin1Char('.'))) { - // we escape '*/' and the last dot in 'e.g.' and 'i.e.' for the Javadoc generator - APPEND("&#x"); - html += QString::number(ch.unicode(), 16); - html += QLatin1Char(';'); - } else { - if (!html.isEmpty()) - html += ch; + // replace all "(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()" tags + src = html; + html = QString(); + static const QString typeTags[] = { "type", "headerfile", "func" }; + for (int i = 0, n = src.size(); i < n;) { + if (src.at(i) == charLangle && src.at(i + 1) == charAt) { + i += 2; + bool handled = false; + for (int k = 0; k != 3; ++k) { + if (parseArg(src, typeTags[k], &i, n, &arg, &par1)) { + par1 = QStringRef(); + QString link = linkForNode( + marker->resolveTarget(arg.toString(), tre, relative), + relative); + addLink(link, arg, &html); + handled = true; + break; + } + } + if (!handled) { + html += charLangle; + html += charAt; + } + } + else { + html += src.at(i++); } } - if (!html.isEmpty()) - return html; - return string; + // replace all + // "<@comment>" -> ""; + // "<@preprocessor>" -> ""; + // "<@string>" -> ""; + // "<@char>" -> ""; + // "" -> "" + src = html; + html = QString(); + static const QString spanTags[] = { + "<@comment>", "", + "<@preprocessor>", "", + "<@string>", "", + "<@char>", "", + "", "", + "","", + "", "", + "", "" + // "<@char>", "", + // "", "", + // "<@func>", "", + // "", "", + // "<@id>", "", + // "", "", + // "<@keyword>", "", + // "", "", + // "<@number>", "", + // "", "", + // "<@op>", "", + // "", "", + // "<@param>", "", + // "", "", + // "<@string>", "", + // "", "", + }; + for (int i = 0, n = src.size(); i < n;) { + if (src.at(i) == charLangle) { + bool handled = false; + for (int k = 0; k != 8; ++k) { + const QString & tag = spanTags[2 * k]; + if (tag == QStringRef(&src, i, tag.length())) { + html += spanTags[2 * k + 1]; + i += tag.length(); + handled = true; + break; + } + } + if (!handled) { + ++i; + if (src.at(i) == charAt || + (src.at(i) == QLatin1Char('/') && src.at(i + 1) == charAt)) { + // drop 'our' unknown tags (the ones still containing '@') + while (i < n && src.at(i) != QLatin1Char('>')) + ++i; + ++i; + } + else { + // retain all others + html += charLangle; + } + } + } + else { + html += src.at(i); + ++i; + } + } -#undef APPEND + return html; } -static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*()"); -static QRegExp funcTag("(<@func target=\"([^\"]*)\">)(.*)()"); -static QRegExp typeTag("(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)()"); -static QRegExp spanTag(""); -static QRegExp unknownTag("]*>"); - -bool parseArg(const QString &src, - const QString &tag, - int *pos, - int n, - QStringRef *contents, - QStringRef *par1 = 0, - bool debug = false) +#else +void HtmlGenerator::generateSectionList(const Section& section, + const Node *relative, + CodeMarker *marker, + CodeMarker::SynopsisStyle style) { -#define SKIP_CHAR(c) \ - if (debug) \ - qDebug() << "looking for " << c << " at " << QString(src.data() + i, n - i); \ - if (i >= n || src[i] != c) { \ - if (debug) \ - qDebug() << " char '" << c << "' not found"; \ - return false; \ - } \ - ++i; - + if (!section.members.isEmpty()) { + bool twoColumn = false; + if (style == CodeMarker::SeparateList) { + twoColumn = (section.members.count() >= 16); + } else if (section.members.first()->type() == Node::Property) { + twoColumn = (section.members.count() >= 5); + } + if (twoColumn) + out() << "

    \n" + << "\n
    "; + out() << "
      \n"; -#define SKIP_SPACE \ - while (i < n && src[i] == ' ') \ - ++i; + int i = 0; + NodeList::ConstIterator m = section.members.begin(); + while (m != section.members.end()) { + if ((*m)->access() == Node::Private) { + ++m; + continue; + } - int i = *pos; - int j = i; + if (twoColumn && i == (int) (section.members.count() + 1) / 2) + out() << "
      \n"; - // assume "<@" has been parsed outside - //SKIP_CHAR('<'); - //SKIP_CHAR('@'); + out() << "
    • "; + if (style == CodeMarker::Accessors) + out() << ""; + generateSynopsis(*m, relative, marker, style); + if (style == CodeMarker::Accessors) + out() << ""; + out() << "
    • \n"; + i++; + ++m; + } + out() << "
    \n"; + if (twoColumn) + out() << "

    \n"; + } - if (tag != QStringRef(&src, i, tag.length())) { - if (0 && debug) - qDebug() << "tag " << tag << " not found at " << i; - return false; + if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { + out() << "
      \n"; + generateSectionInheritedList(section, relative, marker); + out() << "
    \n"; } +} - if (debug) - qDebug() << "haystack:" << src << "needle:" << tag << "i:" <).*()"); - if (par1) { - SKIP_SPACE; - // read parameter name - j = i; - while (i < n && src[i].isLetter()) - ++i; - if (src[i] == '=') { - if (debug) - qDebug() << "read parameter" << QString(src.data() + j, i - j); - SKIP_CHAR('='); - SKIP_CHAR('"'); - // skip parameter name - j = i; - while (i < n && src[i] != '"') - ++i; - *par1 = QStringRef(&src, j, i - j); - SKIP_CHAR('"'); - SKIP_SPACE; +void HtmlGenerator::generateSectionInheritedList(const Section& section, + const Node *relative, + CodeMarker *marker) +{ + QList >::ConstIterator p = section.inherited.begin(); + while (p != section.inherited.end()) { + out() << "
  • "; + out() << (*p).second << " "; + if ((*p).second == 1) { + out() << section.singularMember; } else { - if (debug) - qDebug() << "no optional parameter found"; + out() << section.pluralMember; } + out() << " inherited from " + << protect(marker->plainFullName((*p).first, relative)) + << "
  • \n"; + ++p; } - SKIP_SPACE; - SKIP_CHAR('>'); +} - // find contents up to closing " - j = i; - for (; true; ++i) { - if (i + 4 + tag.length() > n) - return false; - if (src[i] != '<') - continue; - if (src[i + 1] != '/') - continue; - if (src[i + 2] != '@') - continue; - if (tag != QStringRef(&src, i + 3, tag.length())) - continue; - if (src[i + 3 + tag.length()] != '>') - continue; - break; +void HtmlGenerator::generateSynopsis(const Node *node, + const Node *relative, + CodeMarker *marker, + CodeMarker::SynopsisStyle style) +{ + QString marked = marker->markedUpSynopsis(node, relative, style); + QRegExp templateTag("(<[^@>]*>)"); + if (marked.indexOf(templateTag) != -1) { + QString contents = protect(marked.mid(templateTag.pos(1), + templateTag.cap(1).length())); + marked.replace(templateTag.pos(1), templateTag.cap(1).length(), + contents); } + marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])"), "\\1\\2"); + marked.replace("<@param>", ""); + marked.replace("", ""); - *contents = QStringRef(&src, j, i - j); - - i += tag.length() + 4; - - *pos = i; - if (debug) - qDebug() << " tag " << tag << " found: pos now: " << i; - return true; -#undef SKIP_CHAR -} + if (style == CodeMarker::Summary) + marked.replace("@name>", "b>"); -static void addLink(const QString &linkTarget, - const QStringRef &nestedStuff, - QString *res) -{ - if (!linkTarget.isEmpty()) { - *res += ""; - *res += nestedStuff; - *res += ""; + if (style == CodeMarker::SeparateList) { + QRegExp extraRegExp("<@extra>.*"); + extraRegExp.setMinimal(true); + marked.replace(extraRegExp, ""); + } else { + marked.replace("<@extra>", "  "); + marked.replace("", ""); } - else { - *res += nestedStuff; + + if (style != CodeMarker::Detailed) { + marked.replace("<@type>", ""); + marked.replace("", ""); } + out() << highlightedCode(marked, marker, relative); } QString HtmlGenerator::highlightedCode(const QString& markedCode, @@ -2570,6 +2734,153 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, return html; } +#endif + +void HtmlGenerator::generateLink(const Atom *atom, const Node * /* relative */, CodeMarker *marker) +{ + static QRegExp camelCase("[A-Z][A-Z][a-z]|[a-z][A-Z0-9]|_"); + + if (funcLeftParen.indexIn(atom->string()) != -1 && marker->recognizeLanguage("Cpp")) { + // hack for C++: move () outside of link + int k = funcLeftParen.pos(1); + out() << protect(atom->string().left(k)); + if (link.isEmpty()) { + if (showBrokenLinks) + out() << ""; + } else { + out() << ""; + } + inLink = false; + out() << protect(atom->string().mid(k)); + } else if (marker->recognizeLanguage("Java")) { + // hack for Java: remove () and use when appropriate + bool func = atom->string().endsWith("()"); + bool tt = (func || atom->string().contains(camelCase)); + if (tt) + out() << ""; + if (func) { + out() << protect(atom->string().left(atom->string().length() - 2)); + } else { + out() << protect(atom->string()); + } + out() << ""; + } else { + out() << protect(atom->string()); + } +} + +QString HtmlGenerator::cleanRef(const QString& ref) +{ + QString clean; + + if (ref.isEmpty()) + return clean; + + clean.reserve(ref.size() + 20); + const QChar c = ref[0]; + const uint u = c.unicode(); + + if ((u >= 'a' && u <= 'z') || + (u >= 'A' && u <= 'Z') || + (u >= '0' && u <= '9')) { + clean += c; + } else if (u == '~') { + clean += "dtor."; + } else if (u == '_') { + clean += "underscore."; + } else { + clean += "A"; + } + + for (int i = 1; i < (int) ref.length(); i++) { + const QChar c = ref[i]; + const uint u = c.unicode(); + if ((u >= 'a' && u <= 'z') || + (u >= 'A' && u <= 'Z') || + (u >= '0' && u <= '9') || u == '-' || + u == '_' || u == ':' || u == '.') { + clean += c; + } else if (c.isSpace()) { + clean += "-"; + } else if (u == '!') { + clean += "-not"; + } else if (u == '&') { + clean += "-and"; + } else if (u == '<') { + clean += "-lt"; + } else if (u == '=') { + clean += "-eq"; + } else if (u == '>') { + clean += "-gt"; + } else if (u == '#') { + clean += "#"; + } else { + clean += "-"; + clean += QString::number((int)u, 16); + } + } + return clean; +} + +QString HtmlGenerator::registerRef(const QString& ref) +{ + QString clean = HtmlGenerator::cleanRef(ref); + + for (;;) { + QString& prevRef = refMap[clean.toLower()]; + if (prevRef.isEmpty()) { + prevRef = ref; + break; + } else if (prevRef == ref) { + break; + } + clean += "x"; + } + return clean; +} + +QString HtmlGenerator::protect(const QString& string) +{ +#define APPEND(x) \ + if (html.isEmpty()) { \ + html = string; \ + html.truncate(i); \ + } \ + html += (x); + + QString html; + int n = string.length(); + + for (int i = 0; i < n; ++i) { + QChar ch = string.at(i); + + if (ch == QLatin1Char('&')) { + APPEND("&"); + } else if (ch == QLatin1Char('<')) { + APPEND("<"); + } else if (ch == QLatin1Char('>')) { + APPEND(">"); + } else if (ch == QLatin1Char('"')) { + APPEND("""); + } else if (ch.unicode() > 0x007F + || (ch == QLatin1Char('*') && i + 1 < n && string.at(i) == QLatin1Char('/')) + || (ch == QLatin1Char('.') && i > 2 && string.at(i - 2) == QLatin1Char('.'))) { + // we escape '*/' and the last dot in 'e.g.' and 'i.e.' for the Javadoc generator + APPEND("&#x"); + html += QString::number(ch.unicode(), 16); + html += QLatin1Char(';'); + } else { + if (!html.isEmpty()) + html += ch; + } + } + + if (!html.isEmpty()) + return html; + return string; + +#undef APPEND +} QString HtmlGenerator::fileBase(const Node *node) { diff --git a/tools/qdoc3/htmlgenerator.h b/tools/qdoc3/htmlgenerator.h index de64190..ec9532f 100644 --- a/tools/qdoc3/htmlgenerator.h +++ b/tools/qdoc3/htmlgenerator.h @@ -46,6 +46,8 @@ #ifndef HTMLGENERATOR_H #define HTMLGENERATOR_H +#define QDOC_NAME_ALIGNMENT + #include #include @@ -139,17 +141,36 @@ class HtmlGenerator : public PageGenerator void generateFunctionIndex(const Node *relative, CodeMarker *marker); void generateLegaleseList(const Node *relative, CodeMarker *marker); void generateOverviewList(const Node *relative, CodeMarker *marker); - void generateSynopsis(const Node *node, - const Node *relative, - CodeMarker *marker, - CodeMarker::SynopsisStyle style); void generateSectionList(const Section& section, const Node *relative, CodeMarker *marker, CodeMarker::SynopsisStyle style); +#ifdef QDOC_NAME_ALIGNMENT + void generateSynopsis(const Node *node, + const Node *relative, + CodeMarker *marker, + CodeMarker::SynopsisStyle style, + bool nameAlignment = false); + void generateSectionInheritedList(const Section& section, + const Node *relative, + CodeMarker *marker, + bool nameAlignment = false); + QString highlightedCode(const QString& markedCode, + CodeMarker *marker, + const Node *relative, + bool nameAlignment = false); +#else + void generateSynopsis(const Node *node, + const Node *relative, + CodeMarker *marker, + CodeMarker::SynopsisStyle style); void generateSectionInheritedList(const Section& section, const Node *relative, CodeMarker *marker); + QString highlightedCode(const QString& markedCode, + CodeMarker *marker, + const Node *relative); +#endif void generateFullName(const Node *apparentNode, const Node *relative, CodeMarker *marker, @@ -159,7 +180,6 @@ class HtmlGenerator : public PageGenerator void generateStatus(const Node *node, CodeMarker *marker); QString registerRef(const QString& ref); - QString highlightedCode(const QString& markedCode, CodeMarker *marker, const Node *relative); QString fileBase(const Node *node); #if 0 QString fileBase(const Node *node, const SectionIterator& section); -- cgit v0.12 From a830e5f22a42d00b0b92544cfcb56c79b2c3b6cd Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 15 May 2009 15:20:35 +0200 Subject: Doc: Updated description of QMainWindow::unifiedTitleAndToolBarOnMac to include info on Cocoa. Task-number: 252658 Reviewed-by: Trenton Schulz --- src/gui/widgets/qmainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 502c1e9..558ba42 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -1408,10 +1408,10 @@ bool QMainWindow::event(QEvent *event) This property is false by default and only has any effect on Mac OS X 10.4 or higher. - If set to true, then the top toolbar area is replaced with a Carbon - HIToolbar and all toolbars in the top toolbar area are moved to that. Any - toolbars added afterwards will also be added to the Carbon HIToolbar. This - means a couple of things. + If set to true, then the top toolbar area is replaced with a Carbon HIToolbar + or a Cocoa NSToolbar (depending on whether Qt was built with Carbon or Cocoa). + All toolbars in the top toolbar area and any toolbars added afterwards are + moved to that. This means a couple of things. \list \i QToolBars in this toolbar area are not movable and you cannot drag other -- cgit v0.12 From 4573bc08a280be8f8dfd4659146b6d4b1afc185a Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Fri, 15 May 2009 15:38:35 +0200 Subject: Initialize variable to avoid valgrind error. For some reason it's only sometimes hit and cannot be deterministically reproduced. Task-number: 253722 Reviewed-by: TrustMe --- src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp b/src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp index ef77c76..104c5cc 100644 --- a/src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp +++ b/src/xmlpatterns/expr/qxsltsimplecontentconstructor.cpp @@ -105,7 +105,7 @@ Item XSLTSimpleContentConstructor::evaluateSingleton(const DynamicContext::Ptr & QString result; bool previousIsText = false; - bool discard; + bool discard = false; if(next) { -- cgit v0.12 From b3db2368b63f3d7f0a8abbb0620232d8aa079ad7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 15 May 2009 17:01:51 +0200 Subject: Adapted uic test-baseline to the icon generation change 251248) Task-number: 251248 --- tests/auto/uic/baseline/languagesdialog.ui.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/uic/baseline/languagesdialog.ui.h b/tests/auto/uic/baseline/languagesdialog.ui.h index a0b9cae..fbe57ca 100644 --- a/tests/auto/uic/baseline/languagesdialog.ui.h +++ b/tests/auto/uic/baseline/languagesdialog.ui.h @@ -1,8 +1,8 @@ /******************************************************************************** ** Form generated from reading ui file 'languagesdialog.ui' ** -** Created: Mon Jun 16 17:57:32 2008 -** by: Qt User Interface Compiler version 4.5.0 +** Created: Fri May 15 16:58:03 2009 +** by: Qt User Interface Compiler version 4.5.2 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! ********************************************************************************/ @@ -57,7 +57,7 @@ public: upButton->setObjectName(QString::fromUtf8("upButton")); upButton->setEnabled(false); QIcon icon; - icon.addPixmap(QPixmap(QString::fromUtf8(":/images/up.png")), QIcon::Normal, QIcon::Off); + icon.addFile(QString::fromUtf8(":/images/up.png"), QSize(), QIcon::Normal, QIcon::Off); upButton->setIcon(icon); hboxLayout->addWidget(upButton); @@ -66,7 +66,7 @@ public: downButton->setObjectName(QString::fromUtf8("downButton")); downButton->setEnabled(false); QIcon icon1; - icon1.addPixmap(QPixmap(QString::fromUtf8(":/images/down.png")), QIcon::Normal, QIcon::Off); + icon1.addFile(QString::fromUtf8(":/images/down.png"), QSize(), QIcon::Normal, QIcon::Off); downButton->setIcon(icon1); hboxLayout->addWidget(downButton); @@ -75,7 +75,7 @@ public: removeButton->setObjectName(QString::fromUtf8("removeButton")); removeButton->setEnabled(false); QIcon icon2; - icon2.addPixmap(QPixmap(QString::fromUtf8(":/images/editdelete.png")), QIcon::Normal, QIcon::Off); + icon2.addFile(QString::fromUtf8(":/images/editdelete.png"), QSize(), QIcon::Normal, QIcon::Off); removeButton->setIcon(icon2); hboxLayout->addWidget(removeButton); @@ -84,7 +84,7 @@ public: openFileButton->setObjectName(QString::fromUtf8("openFileButton")); openFileButton->setEnabled(true); QIcon icon3; - icon3.addPixmap(QPixmap(QString::fromUtf8(":/images/mac/fileopen.png")), QIcon::Normal, QIcon::Off); + icon3.addFile(QString::fromUtf8(":/images/mac/fileopen.png"), QSize(), QIcon::Normal, QIcon::Off); openFileButton->setIcon(icon3); hboxLayout->addWidget(openFileButton); -- cgit v0.12 From 59cc08796bfb88bc0010006f365f1361462761aa Mon Sep 17 00:00:00 2001 From: Bjoern Erik Nilsen Date: Fri, 8 May 2009 16:00:57 +0200 Subject: Graphics View Optimization: Use a simple style option by default. QStyleOptionGraphicsItem extends QStyleOption with three values: 1) matrix, 2) levelOfDetail, 3) exposedRect, and they all involve expensive QTranform operations when calculated. We pass style option(s) to drawItems() and paint(), but the extended values are usually not in use. We can therefore gain quite some nice speedup by making them opt-in with the QGraphicsItem::ItemUsesExtendedStyleOption flag. Additionally, QStyleOptionGraphicsItem::levelOfDetail has been obsoleted, and a new function QStyleOptionGraphicsItem:: levelOfDetailFromTransform(const QTransform &) has been added. Me and Andreas don't consider this change to be too controversial even though it changes the behavior. Auto tests still pass. Reviewed-by: Andreas --- demos/chip/chip.cpp | 17 ++-- dist/changes-4.6.0 | 12 ++- src/gui/graphicsview/qgraphicsitem.cpp | 67 +++++++++++++- src/gui/graphicsview/qgraphicsitem.h | 4 +- src/gui/graphicsview/qgraphicsitem_p.h | 13 +-- src/gui/graphicsview/qgraphicsscene.cpp | 34 +------ src/gui/graphicsview/qgraphicsview.cpp | 120 +++---------------------- src/gui/graphicsview/qgraphicsview_p.h | 7 -- src/gui/graphicsview/qgraphicswidget_p.cpp | 1 + src/gui/styles/qstyleoption.cpp | 44 ++++++--- src/gui/styles/qstyleoption.h | 1 + tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 13 ++- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 2 +- 13 files changed, 155 insertions(+), 180 deletions(-) diff --git a/demos/chip/chip.cpp b/demos/chip/chip.cpp index c2b22da..4b6579e 100644 --- a/demos/chip/chip.cpp +++ b/demos/chip/chip.cpp @@ -74,8 +74,9 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid if (option->state & QStyle::State_MouseOver) fillColor = fillColor.light(125); - if (option->levelOfDetail < 0.2) { - if (option->levelOfDetail < 0.125) { + const qreal lod = option->levelOfDetailFromTransform(painter->worldTransform()); + if (lod < 0.2) { + if (lod < 0.125) { painter->fillRect(QRectF(0, 0, 110, 70), fillColor); return; } @@ -100,7 +101,7 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid painter->drawRect(QRect(14, 14, 79, 39)); painter->setBrush(b); - if (option->levelOfDetail >= 1) { + if (lod >= 1) { painter->setPen(QPen(Qt::gray, 1)); painter->drawLine(15, 54, 94, 54); painter->drawLine(94, 53, 94, 15); @@ -108,7 +109,7 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid } // Draw text - if (option->levelOfDetail >= 2) { + if (lod >= 2) { QFont font("Times", 10); font.setStyleStrategy(QFont::ForceOutline); painter->setFont(font); @@ -122,17 +123,17 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid // Draw lines QVarLengthArray lines; - if (option->levelOfDetail >= 0.5) { - for (int i = 0; i <= 10; i += (option->levelOfDetail > 0.5 ? 1 : 2)) { + if (lod >= 0.5) { + for (int i = 0; i <= 10; i += (lod > 0.5 ? 1 : 2)) { lines.append(QLineF(18 + 7 * i, 13, 18 + 7 * i, 5)); lines.append(QLineF(18 + 7 * i, 54, 18 + 7 * i, 62)); } - for (int i = 0; i <= 6; i += (option->levelOfDetail > 0.5 ? 1 : 2)) { + for (int i = 0; i <= 6; i += (lod > 0.5 ? 1 : 2)) { lines.append(QLineF(5, 18 + i * 5, 13, 18 + i * 5)); lines.append(QLineF(94, 18 + i * 5, 102, 18 + i * 5)); } } - if (option->levelOfDetail >= 0.4) { + if (lod >= 0.4) { const QLineF lineData[] = { QLineF(25, 35, 35, 35), QLineF(35, 30, 35, 40), diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index db4ab5f..6a94f26 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -38,4 +38,14 @@ information about a particular change. - The experimental Direct3D paint engine has been removed. The reasons for this is that Qt Software focuses on OpenGL for desktop - hardware accelerated rendering. \ No newline at end of file + hardware accelerated rendering. + + - QStyleOptionGraphicsItem::exposedRect and QStyleOptionGraphicsItem::matrix + does no longer contain fine-grained values when passed in drawItems()/paint() + unless the QGraphicsItem::ItemUsesExtendedStyleOptions flag is enabled. + By default, exposedRect is initialized to the item's bounding rect + and the matrix is untransformed. + + - QStyleOptionGraphicsItem::levelOfDetails is obsoleted and its value + is always initialized to 1. For a more fine-grained value use + QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &). diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index aa55908..ec08aaf 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -274,6 +274,15 @@ this flag, the child will be stacked behind it. This flag is useful for drop shadow effects and for decoration objects that follow the parent item's geometry without drawing on top of it. + + \value ItemUsesExtendedStyleOption The item makes use of either + QStyleOptionGraphicsItem::exposedRect or QStyleOptionGraphicsItem::matrix. + By default, the exposedRect is initialized to the item's boundingRect and + the matrix is untransformed. Enable this flag for more fine-grained values. + Note that QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag + and is always initialized to 1. + Use QStyleOptionGraphicsItem::levelOfDetailFromTransform for a more + fine-grained value. */ /*! @@ -914,6 +923,53 @@ void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rec } } +void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, + const QRegion &exposedRegion, bool allItems) const +{ + Q_ASSERT(option); + Q_Q(const QGraphicsItem); + + // Initialize standard QStyleOption values. + const QRectF brect = q->boundingRect(); + option->state = QStyle::State_None; + option->rect = brect.toRect(); + option->levelOfDetail = 1; + option->exposedRect = brect; + if (selected) + option->state |= QStyle::State_Selected; + if (enabled) + option->state |= QStyle::State_Enabled; + if (q->hasFocus()) + option->state |= QStyle::State_HasFocus; + if (scene) { + if (scene->d_func()->hoverItems.contains(q_ptr)) + option->state |= QStyle::State_MouseOver; + if (q == scene->mouseGrabberItem()) + option->state |= QStyle::State_Sunken; + } + + if (!(flags & QGraphicsItem::ItemUsesExtendedStyleOption)) + return; + + // Initialize QStyleOptionGraphicsItem specific values (matrix, exposedRect). + + const QTransform itemToViewportTransform = q->deviceTransform(worldTransform); + option->matrix = itemToViewportTransform.toAffine(); //### discards perspective + + if (!allItems) { + // Determine the item's exposed area + option->exposedRect = QRectF(); + const QTransform reverseMap = itemToViewportTransform.inverted(); + const QVector exposedRects(exposedRegion.rects()); + for (int i = 0; i < exposedRects.size(); ++i) { + option->exposedRect |= reverseMap.mapRect(exposedRects.at(i)); + if (option->exposedRect.contains(brect)) + break; + } + option->exposedRect &= brect; + } +} + /*! \internal @@ -3671,7 +3727,7 @@ void QGraphicsItem::setBoundingRegionGranularity(qreal granularity) All painting is done in local coordinates. - \sa setCacheMode(), QPen::width(), {Item Coordinates} + \sa setCacheMode(), QPen::width(), {Item Coordinates}, ItemUsesExtendedStyleOption */ /*! @@ -7635,9 +7691,7 @@ void QGraphicsPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsIte painter->setRenderHint(QPainter::SmoothPixmapTransform, (d->transformationMode == Qt::SmoothTransformation)); - QRectF exposed = option->exposedRect.adjusted(-1, -1, 1, 1); - exposed &= QRectF(d->offset.x(), d->offset.y(), d->pixmap.width(), d->pixmap.height()); - painter->drawPixmap(exposed, d->pixmap, exposed.translated(-d->offset)); + painter->drawPixmap(d->offset, d->pixmap); if (option->state & QStyle::State_Selected) qt_graphicsItem_highlightSelected(this, painter, option); @@ -7803,6 +7857,7 @@ QGraphicsTextItem::QGraphicsTextItem(const QString &text, QGraphicsItem *parent setPlainText(text); setAcceptDrops(true); setAcceptHoverEvents(true); + setFlags(ItemUsesExtendedStyleOption); } /*! @@ -7822,6 +7877,7 @@ QGraphicsTextItem::QGraphicsTextItem(QGraphicsItem *parent dd->qq = this; setAcceptDrops(true); setAcceptHoverEvents(true); + setFlag(ItemUsesExtendedStyleOption); } /*! @@ -9167,6 +9223,9 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemFlag flag) case QGraphicsItem::ItemStacksBehindParent: str = "ItemStacksBehindParent"; break; + case QGraphicsItem::ItemUsesExtendedStyleOption: + str = "ItemUsesExtendedStyleOption"; + break; } debug << str; return debug; diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h index b98882d..0a0179e 100644 --- a/src/gui/graphicsview/qgraphicsitem.h +++ b/src/gui/graphicsview/qgraphicsitem.h @@ -94,7 +94,9 @@ public: ItemIgnoresTransformations = 0x20, ItemIgnoresParentOpacity = 0x40, ItemDoesntPropagateOpacityToChildren = 0x80, - ItemStacksBehindParent = 0x100 + ItemStacksBehindParent = 0x100, + ItemUsesExtendedStyleOption = 0x200 + // NB! Don't forget to increase the d_ptr->flags bit field by 1 when adding a new flag. }; Q_DECLARE_FLAGS(GraphicsItemFlags, GraphicsItemFlag) diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 2936cf1..82a48fb 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -132,7 +132,6 @@ public: ancestorFlags(0), cacheMode(0), hasBoundingRegionGranularity(0), - flags(0), hasOpacity(0), hasEffectiveOpacity(0), isWidget(0), @@ -142,6 +141,7 @@ public: dirtyClipPath(1), emptyClipPath(0), inSetPosHelper(0), + flags(0), allChildrenCombineOpacity(1), globalStackingOrder(-1), sceneTransformIndex(-1), @@ -178,6 +178,8 @@ public: void removeChild(QGraphicsItem *child); void setParentItemHelper(QGraphicsItem *parent, bool deleting); void childrenBoundingRectHelper(QTransform *x, QRectF *rect); + void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, + const QRegion &exposedRegion, bool allItems = false) const; virtual void resolveFont(uint inheritedMask) { @@ -297,7 +299,7 @@ public: int index; int depth; - // Packed 32 bytes + // Packed 32 bits quint32 acceptedMouseButtons : 5; quint32 visible : 1; quint32 explicitlyHidden : 1; @@ -314,9 +316,6 @@ public: quint32 ancestorFlags : 3; quint32 cacheMode : 2; quint32 hasBoundingRegionGranularity : 1; - quint32 flags : 9; - - // New 32 bytes quint32 hasOpacity : 1; quint32 hasEffectiveOpacity : 1; quint32 isWidget : 1; @@ -326,7 +325,11 @@ public: quint32 dirtyClipPath : 1; quint32 emptyClipPath : 1; quint32 inSetPosHelper : 1; + + // New 32 bits + quint32 flags : 10; quint32 allChildrenCombineOpacity : 1; + quint32 padding : 21; // feel free to use // Optional stacking order int globalStackingOrder; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index c421f05..7318fa5 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -2247,8 +2247,6 @@ void QGraphicsScene::setSceneRect(const QRectF &rect) void QGraphicsScene::render(QPainter *painter, const QRectF &target, const QRectF &source, Qt::AspectRatioMode aspectRatioMode) { - Q_D(QGraphicsScene); - // Default source rect = scene rect QRectF sourceRect = source; if (sourceRect.isNull()) @@ -2305,36 +2303,8 @@ void QGraphicsScene::render(QPainter *painter, const QRectF &target, const QRect // Generate the style options QStyleOptionGraphicsItem *styleOptionArray = new QStyleOptionGraphicsItem[numItems]; - for (int i = 0; i < numItems; ++i) { - QGraphicsItem *item = itemArray[i]; - - QStyleOptionGraphicsItem option; - option.state = QStyle::State_None; - option.rect = item->boundingRect().toRect(); - if (item->isSelected()) - option.state |= QStyle::State_Selected; - if (item->isEnabled()) - option.state |= QStyle::State_Enabled; - if (item->hasFocus()) - option.state |= QStyle::State_HasFocus; - if (d->hoverItems.contains(item)) - option.state |= QStyle::State_MouseOver; - if (item == mouseGrabberItem()) - option.state |= QStyle::State_Sunken; - - // Calculate a simple level-of-detail metric. - // ### almost identical code in QGraphicsView::paintEvent() - // and QGraphicsView::render() - consider refactoring - QTransform itemToDeviceTransform = item->deviceTransform(painterTransform); - - option.levelOfDetail = qSqrt(itemToDeviceTransform.map(v1).length() * itemToDeviceTransform.map(v2).length()); - option.matrix = itemToDeviceTransform.toAffine(); //### discards perspective - - option.exposedRect = item->boundingRect(); - option.exposedRect &= itemToDeviceTransform.inverted().mapRect(targetRect); - - styleOptionArray[i] = option; - } + for (int i = 0; i < numItems; ++i) + itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], painterTransform, targetRect.toRect()); // Render the scene. drawBackground(painter, sourceRect); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 7181045..396618c 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1127,69 +1127,6 @@ QList QGraphicsViewPrivate::findItems(const QRegion &exposedReg return itemsInArea(exposedPath, Qt::IntersectsItemBoundingRect, Qt::DescendingOrder); } -void QGraphicsViewPrivate::generateStyleOptions(const QList &itemList, - QGraphicsItem **itemArray, - QStyleOptionGraphicsItem *styleOptionArray, - const QTransform &worldTransform, - bool allItems, - const QRegion &exposedRegion) const -{ - // Two unit vectors. - QLineF v1(0, 0, 1, 0); - QLineF v2(0, 0, 0, 1); - QTransform itemToViewportTransform; - QRectF brect; - QTransform reverseMap; - - for (int i = 0; i < itemList.size(); ++i) { - QGraphicsItem *item = itemArray[i] = itemList[i]; - - QStyleOptionGraphicsItem &option = styleOptionArray[i]; - brect = item->boundingRect(); - option.state = QStyle::State_None; - option.rect = brect.toRect(); - option.exposedRect = QRectF(); - if (item->d_ptr->selected) - option.state |= QStyle::State_Selected; - if (item->d_ptr->enabled) - option.state |= QStyle::State_Enabled; - if (item->hasFocus()) - option.state |= QStyle::State_HasFocus; - if (scene->d_func()->hoverItems.contains(item)) - option.state |= QStyle::State_MouseOver; - if (item == scene->mouseGrabberItem()) - option.state |= QStyle::State_Sunken; - - // Calculate a simple level-of-detail metric. - // ### almost identical code in QGraphicsScene::render() - // and QGraphicsView::render() - consider refactoring - itemToViewportTransform = item->deviceTransform(worldTransform); - - if (itemToViewportTransform.type() <= QTransform::TxTranslate) { - // Translation and rotation only? The LOD is 1. - option.levelOfDetail = 1; - } else { - // LOD is the transformed area of a 1x1 rectangle. - option.levelOfDetail = qSqrt(itemToViewportTransform.map(v1).length() * itemToViewportTransform.map(v2).length()); - } - option.matrix = itemToViewportTransform.toAffine(); //### discards perspective - - if (!allItems) { - // Determine the item's exposed area - reverseMap = itemToViewportTransform.inverted(); - foreach (const QRect &rect, exposedRegion.rects()) { - option.exposedRect |= reverseMap.mapRect(QRectF(rect.adjusted(-1, -1, 1, 1))); - if (option.exposedRect.contains(brect)) - break; - } - option.exposedRect &= brect; - } else { - // The whole item is exposed - option.exposedRect = brect; - } - } -} - /*! Constructs a QGraphicsView. \a parent is passed to QWidget's constructor. */ @@ -2146,40 +2083,10 @@ void QGraphicsView::render(QPainter *painter, const QRectF &target, const QRect .scale(xratio, yratio) .translate(-sourceRect.left(), -sourceRect.top()); - // Two unit vectors. - QLineF v1(0, 0, 1, 0); - QLineF v2(0, 0, 0, 1); - // Generate the style options QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(numItems); - QStyleOptionGraphicsItem* option = styleOptionArray; - for (int i = 0; i < numItems; ++i, ++option) { - QGraphicsItem *item = itemArray[i]; - - option->state = QStyle::State_None; - option->rect = item->boundingRect().toRect(); - if (item->isSelected()) - option->state |= QStyle::State_Selected; - if (item->isEnabled()) - option->state |= QStyle::State_Enabled; - if (item->hasFocus()) - option->state |= QStyle::State_HasFocus; - if (d->scene->d_func()->hoverItems.contains(item)) - option->state |= QStyle::State_MouseOver; - if (item == d->scene->mouseGrabberItem()) - option->state |= QStyle::State_Sunken; - - // Calculate a simple level-of-detail metric. - // ### almost identical code in QGraphicsScene::render() - // and QGraphicsView::paintEvent() - consider refactoring - QTransform itemToViewportTransform = item->deviceTransform(painterMatrix); - - option->levelOfDetail = qSqrt(itemToViewportTransform.map(v1).length() * itemToViewportTransform.map(v2).length()); - option->matrix = itemToViewportTransform.toAffine(); - - option->exposedRect = item->boundingRect(); - option->exposedRect &= itemToViewportTransform.inverted().mapRect(targetRect); - } + for (int i = 0; i < numItems; ++i) + itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], painterMatrix, targetRect.toRect()); painter->save(); @@ -3538,15 +3445,17 @@ void QGraphicsView::paintEvent(QPaintEvent *event) int backgroundTime = stopWatch.elapsed() - exposedTime; #endif - // Generate the style options - QGraphicsItem **itemArray = new QGraphicsItem *[itemList.size()]; - QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(itemList.size()); - - d->generateStyleOptions(itemList, itemArray, styleOptionArray, viewTransform, - allItems, exposedRegion); - - // Items - drawItems(&painter, itemList.size(), itemArray, styleOptionArray); + if (!itemList.isEmpty()) { + // Generate the style options. + const int numItems = itemList.size(); + QGraphicsItem **itemArray = &itemList[0]; // Relies on QList internals, but is perfectly valid. + QStyleOptionGraphicsItem *styleOptionArray = d->allocStyleOptionsArray(numItems); + for (int i = 0; i < numItems; ++i) + itemArray[i]->d_ptr->initStyleOption(&styleOptionArray[i], viewTransform, exposedRegion, allItems); + // Draw the items. + drawItems(&painter, numItems, itemArray, styleOptionArray); + d->freeStyleOptionsArray(styleOptionArray); + } #ifdef QGRAPHICSVIEW_DEBUG int itemsTime = stopWatch.elapsed() - exposedTime - backgroundTime; @@ -3555,9 +3464,6 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Foreground drawForeground(&painter, exposedSceneRect); - delete [] itemArray; - d->freeStyleOptionsArray(styleOptionArray); - #ifdef QGRAPHICSVIEW_DEBUG int foregroundTime = stopWatch.elapsed() - exposedTime - backgroundTime - itemsTime; #endif diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h index d573e8f..c18f85d 100644 --- a/src/gui/graphicsview/qgraphicsview_p.h +++ b/src/gui/graphicsview/qgraphicsview_p.h @@ -174,13 +174,6 @@ public: bool updateSceneSlotReimplementedChecked; QList findItems(const QRegion &exposedRegion, bool *allItems) const; - - void generateStyleOptions(const QList &itemList, - QGraphicsItem **itemArray, - QStyleOptionGraphicsItem *styleOptionArray, - const QTransform &worldTransform, - bool allItems, - const QRegion &exposedRegion) const; }; QT_END_NAMESPACE diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp index 8ced47a..a435758 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.cpp +++ b/src/gui/graphicsview/qgraphicswidget_p.cpp @@ -76,6 +76,7 @@ void QGraphicsWidgetPrivate::init(QGraphicsItem *parentItem, Qt::WindowFlags wFl resolveLayoutDirection(); q->unsetWindowFrameMargins(); + q->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption); } qreal QGraphicsWidgetPrivate::titleBarHeight(const QStyleOptionTitleBar &options) const { diff --git a/src/gui/styles/qstyleoption.cpp b/src/gui/styles/qstyleoption.cpp index ce053ae..5b1bc61 100644 --- a/src/gui/styles/qstyleoption.cpp +++ b/src/gui/styles/qstyleoption.cpp @@ -48,6 +48,7 @@ #ifndef QT_NO_DEBUG #include #endif +#include QT_BEGIN_NAMESPACE @@ -4998,6 +4999,34 @@ QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version) } /*! + \since 4.6 + + Returns the level of detail from the \a worldTransform. + + Its value represents the maximum value of the height and + width of a unity rectangle, mapped using the \a worldTransform + of the painter used to draw the item. By default, if no + transformations are applied, its value is 1. If zoomed out 1:2, the level + of detail will be 0.5, and if zoomed in 2:1, its value is 2. + + For more advanced level-of-detail metrics, use + QStyleOptionGraphicsItem::matrix directly. + + \sa QStyleOptionGraphicsItem::matrix +*/ +qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform) +{ + if (worldTransform.type() <= QTransform::TxTranslate) + return 1; // Translation only? The LOD is 1. + + // Two unit vectors. + QLineF v1(0, 0, 1, 0); + QLineF v2(0, 0, 0, 1); + // LOD is the transformed area of a 1x1 rectangle. + return qSqrt(worldTransform.map(v1).length() * worldTransform.map(v2).length()); +} + +/*! \fn QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) Constructs a copy of \a other. @@ -5029,19 +5058,10 @@ QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version) /*! \variable QStyleOptionGraphicsItem::levelOfDetail - \brief a simple metric for determining an item's level of detail - - This simple metric provides an easy way to determine the level of detail - for an item. Its value represents the maximum value of the height and - width of a unity rectangle, mapped using the complete transformation - matrix of the painter used to draw the item. By default, if no - transformations are applied, its value is 1. If zoomed out 1:2, the level - of detail will be 0.5, and if zoomed in 2:1, its value is 2. - - For more advanced level-of-detail metrics, use - QStyleOptionGraphicsItem::matrix directly. + \obsolete - \sa QStyleOptionGraphicsItem::matrix + Use QStyleOptionGraphicsItem::levelOfDetailFromTransform + together with QPainter::worldTransform() instead. */ /*! diff --git a/src/gui/styles/qstyleoption.h b/src/gui/styles/qstyleoption.h index 5759a05..eb05324 100644 --- a/src/gui/styles/qstyleoption.h +++ b/src/gui/styles/qstyleoption.h @@ -856,6 +856,7 @@ public: QStyleOptionGraphicsItem(); QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) : QStyleOption(Version, Type) { *this = other; } + static qreal levelOfDetailFromTransform(const QTransform &worldTransform); protected: QStyleOptionGraphicsItem(int version); }; diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 8602307..b3ae60a 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -247,50 +247,59 @@ void tst_QGraphicsItem::construction() QCOMPARE(int(item->type()), int(QGraphicsEllipseItem::Type)); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsEllipseItem *)item); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsRectItem *)0); + QCOMPARE(item->flags(), 0); break; case 1: item = new QGraphicsLineItem; QCOMPARE(int(item->type()), int(QGraphicsLineItem::Type)); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsLineItem *)item); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsRectItem *)0); + QCOMPARE(item->flags(), 0); break; case 2: item = new QGraphicsPathItem; QCOMPARE(int(item->type()), int(QGraphicsPathItem::Type)); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsPathItem *)item); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsRectItem *)0); + QCOMPARE(item->flags(), 0); break; case 3: item = new QGraphicsPixmapItem; QCOMPARE(int(item->type()), int(QGraphicsPixmapItem::Type)); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsPixmapItem *)item); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsRectItem *)0); + QCOMPARE(item->flags(), 0); break; case 4: item = new QGraphicsPolygonItem; QCOMPARE(int(item->type()), int(QGraphicsPolygonItem::Type)); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsPolygonItem *)item); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsRectItem *)0); + QCOMPARE(item->flags(), 0); break; case 5: item = new QGraphicsRectItem; QCOMPARE(int(item->type()), int(QGraphicsRectItem::Type)); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsRectItem *)item); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsLineItem *)0); + QCOMPARE(item->flags(), 0); break; case 6: - default: item = new QGraphicsTextItem; QCOMPARE(int(item->type()), int(QGraphicsTextItem::Type)); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsTextItem *)item); QCOMPARE(qgraphicsitem_cast(item), (QGraphicsRectItem *)0); + // This is the only item that uses an extended style option. + QCOMPARE(item->flags(), QGraphicsItem::GraphicsItemFlags(QGraphicsItem::ItemUsesExtendedStyleOption)); + break; + default: + qFatal("You broke the logic, please fix!"); break; } QCOMPARE(item->scene(), (QGraphicsScene *)0); QCOMPARE(item->parentItem(), (QGraphicsItem *)0); QVERIFY(item->children().isEmpty()); - QCOMPARE(item->flags(), 0); QVERIFY(item->isVisible()); QVERIFY(item->isEnabled()); QVERIFY(!item->isSelected()); diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 920cba7..8e490ad 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -2371,7 +2371,7 @@ public: void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *viewport) { - lastLod = option->levelOfDetail; + lastLod = option->levelOfDetailFromTransform(painter->worldTransform()); QGraphicsRectItem::paint(painter, option, viewport); } -- cgit v0.12 From 97d0f8f43db98e1c5ae49bd32dfc027e6d3a1349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 18 May 2009 09:59:06 +0200 Subject: Fixed a bug which implicitly closed perspective transformed poly lines. When the end point of a line in a path is clipped, only closed paths should have the closing line. Task-number: 253663 Reviewed-by: Samuel --- src/gui/painting/qtransform.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 2383272..cec2d16 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1355,7 +1355,8 @@ static inline QHomogeneousCoordinate mapHomogeneous(const QTransform &transform, return c; } -static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, bool needsMoveTo) +static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, + bool needsMoveTo, bool needsLineTo = true) { QHomogeneousCoordinate ha = mapHomogeneous(transform, a); QHomogeneousCoordinate hb = mapHomogeneous(transform, b); @@ -1388,7 +1389,8 @@ static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transfor if (needsMoveTo) path.moveTo(ha.toPoint()); - path.lineTo(hb.toPoint()); + if (needsLineTo) + path.lineTo(hb.toPoint()); return true; } @@ -1455,7 +1457,7 @@ static QPainterPath mapProjective(const QTransform &transform, const QPainterPat } if (path.elementCount() > 0 && lastMoveTo != last) - lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo); + lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo, false); return result; } -- cgit v0.12 From 8dfb09c26d228388fba5318b6f61b4edbf67cdc2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 10:55:52 +0200 Subject: Updated German translations for 4.5.2 --- translations/assistant_de.qm | Bin 20332 -> 18688 bytes translations/assistant_de.ts | 110 +++++++------ translations/designer_de.qm | Bin 152455 -> 151189 bytes translations/designer_de.ts | 12 +- translations/linguist_de.qm | Bin 47074 -> 45915 bytes translations/linguist_de.ts | 365 ++++++++++++++++++++++--------------------- translations/qt_de.qm | Bin 181913 -> 181348 bytes translations/qt_de.ts | 110 ++++++------- translations/qt_help_de.qm | Bin 9381 -> 9583 bytes translations/qt_help_de.ts | 2 +- 10 files changed, 300 insertions(+), 299 deletions(-) diff --git a/translations/assistant_de.qm b/translations/assistant_de.qm index 54146f6..5b31aea 100644 Binary files a/translations/assistant_de.qm and b/translations/assistant_de.qm differ diff --git a/translations/assistant_de.ts b/translations/assistant_de.ts index 0411ef1..9b0d628 100644 --- a/translations/assistant_de.ts +++ b/translations/assistant_de.ts @@ -163,7 +163,7 @@ CentralWidget - + Add new page Neue Seite hinzufügen @@ -173,38 +173,38 @@ Aktuelle Seite schließen - + Print Document Drucken - + unknown unbekannt - + Add New Page Neue Seite hinzufügen - + Close This Page Aktuelle Seite schließen - + Close Other Pages Andere Seiten schließen - + Add Bookmark for this Page... Lesezeichen für diese Seite hinzufügen... - + Search Suchen @@ -242,17 +242,17 @@ FindWidget - + Previous Vorherige - + Next Nächste - + Case Sensitive Gross/ Kleinschreibung beachten @@ -298,7 +298,7 @@ HelpViewer - + Help Hilfe @@ -329,12 +329,12 @@ Link in neuem Tab öffnen - + Open Link in New Tab Link in neuem Tab öffnen - + Unable to launch external application. Fehler beim Starten der externen Anwendung. @@ -463,38 +463,37 @@ MainWindow - + Index Index - - + + Contents Inhalt - - + + Bookmarks Lesezeichen - - + Search Suchen - - - + + + Qt Assistant Qt Assistant - - + + Unfiltered Ohne Filter @@ -718,7 +717,7 @@ Navigationsleiste - + Toolbars Werkzeugleisten @@ -743,7 +742,7 @@ Adresse: - + Could not find the associated content item. Der zugehörige Inhaltseintrag konnte nicht gefunden werden. @@ -769,12 +768,12 @@ Über %1 - + Updating search index Suchindex wird aufgebaut - + Looking for Qt Documentation... Suche nach Qt Dokumentationen... @@ -862,46 +861,45 @@ Von Helpserver herunterladen... - - - + + Add Documentation Dokumentation hinzufügen - + Qt Compressed Help Files (*.qch) Komprimierte Hilfe Dateien (*.qch) - + The specified file is not a valid Qt Help File! Die angegebene Datei ist keine Qt Hilfe Datei! - + The namespace %1 is already registered! Der Namespace %1 ist bereits registriert! - + Remove Documentation - + Dokumentation entfernen Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. - + Einige der gegenwärtig geöffneten Dokumente stammen aus der Dokumentation, die Sie gerade zu löschen versuchen. Sie werden beim Löschen geschlossen. Cancel - Abbrechen + Abbrechen OK - OK + OK @@ -1000,22 +998,22 @@ Options - + Einstellungen Current Page - + Aktuelle Seite Restore to default - + Vorgabe wiederherstellen Homepage - + Startseite @@ -1025,7 +1023,7 @@ Neuer Ordner - + The specified collection file does not exist! Die angegeben Katalogdatei (collection file) konnte nicht gefunden werden! @@ -1073,10 +1071,10 @@ Missing filter argument! - + Das Filter-Argument fehlt! - + Unknown option: %1 Unbekannte Option: %1 @@ -1087,7 +1085,7 @@ Qt Assistant - + Could not register documentation file %1 @@ -1115,9 +1113,9 @@ Reason: Dokumentation erfolgreich entfernt. - + Cannot load sqlite database driver! - + Der Datenbanktreiber für SQLite kann nicht geladen werden! @@ -1147,7 +1145,7 @@ Reason: SearchWidget - + &Copy &Kopieren @@ -1157,20 +1155,18 @@ Reason: &Link Adresse kopieren - - + Open Link in New Tab Link in neuem Tab öffnen - + Select All Alles markieren - Open Link - Link öffnen + Link öffnen diff --git a/translations/designer_de.qm b/translations/designer_de.qm index d51c51d..f9b0a03 100644 Binary files a/translations/designer_de.qm and b/translations/designer_de.qm differ diff --git a/translations/designer_de.ts b/translations/designer_de.ts index 4cd9914..002fc8d 100644 --- a/translations/designer_de.ts +++ b/translations/designer_de.ts @@ -339,7 +339,7 @@ ate the goose who was loose. Change signal-slot connection - + Signale-Slotverbindung ändern @@ -1384,7 +1384,7 @@ ate the goose who was loose. Plugin Information - Plugins + Plugins @@ -4026,7 +4026,7 @@ Möchten Sie sie überschreiben? Go to slot... - Slot anzeigen... + Slot anzeigen... @@ -5963,14 +5963,14 @@ Please select another name. Detailansicht - + Object: %1 Class: %2 Objekt: %1 Klasse: %2 - + Sorting Sortiert @@ -5980,7 +5980,7 @@ Klasse: %2 Farbige Hervorhebung - + Configure Property Editor Anzeige der Eigenschaften konfigurieren diff --git a/translations/linguist_de.qm b/translations/linguist_de.qm index f411122..a39c3bf 100644 Binary files a/translations/linguist_de.qm and b/translations/linguist_de.qm differ diff --git a/translations/linguist_de.ts b/translations/linguist_de.ts index 712f75d..cb8e4d2 100644 --- a/translations/linguist_de.ts +++ b/translations/linguist_de.ts @@ -6,7 +6,7 @@ (New Entry) - + (Neuer Eintrag) @@ -29,7 +29,7 @@ Batch Translation of '%1' - Qt Linguist - + Automatische Übersetzung von '%1' - Qt Linguist @@ -57,62 +57,62 @@ Qt Linguist - Batch Translation - Qt Linguist - Automatische Übersetzung + Qt Linguist - Automatische Übersetzung Options - Optionen + Optionen Set translated entries to finished - Markiere Übersetzung als erledigt + Markiere Übersetzung als erledigt Retranslate entries with existing translation - + Einträge mit bereits existierender Übersetzung neu übersetzen Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked. - + Beachten Sie, dass die geänderten Einträge in den Status 'unerledigt' zurückgesetzt werden, wenn 'Markiere Übersetzung als erledigt' deaktiviert ist. Translate also finished entries - + Erledigte Einträge übersetzen Phrase book preference - Wörterbücher + Wörterbücher Move up - Nach oben + Nach oben Move down - Nach unten + Nach unten The batch translator will search through the selected phrase books in the order given above. - + Der automatische Übersetzer wird in der angegebenen Reihenfolge durch die ausgewählten Wörterbücher gehen. &Run - &Ausführen + &Ausführen Cancel - Abbrechen + Abbrechen @@ -120,38 +120,39 @@ <qt>Duplicate messages found in '%1': - + <qt>Mehrfach vorhandene Meldungen in '%1': <p>[more duplicates omitted] - + <p>[weitere mehrfach vorhandene Nachrichten weggelassen] <p>* Context: %1<br>* Source: %2 - + <p>* Kontext: %1<br>* Quelle: %2 <br>* Comment: %3 - + <br>* Kommentar: %3 Linguist does not know the plural rules for '%1'. Will assume a single universal form. - + Die Regeln zur Pluralbildung der Sprache '%1' sind in Linguist nicht definiert. +Es wird mit einer einfachen Universalform gearbeitet. Cannot create '%2': %1 - + '%2' kann nicht erzeugt werden: %1 Universal Form - + Universalform @@ -239,7 +240,7 @@ Will assume a single universal form. Translation does not contain the necessary %n place marker. - + Der erforderliche Platzhalter (%n) fehlt in der Übersetzung. @@ -311,37 +312,37 @@ Will assume a single universal form. Find - + Suchen &Find what: - + &Suchmuster: &Source texts - + &Quelltexte &Translations - + &Übersetzungen &Match case - + &Groß-/Kleinschreibung beachten &Comments - + &Kommentare Ignore &accelerators - + Tastenkürzel &ignorieren @@ -612,102 +613,102 @@ p, li { white-space: pre-wrap; } Previous unfinished item. - + Vorherige Unerledigte Move to the previous unfinished item. - + Gehe zum vorangehenden unerledigten Eintrag. Next unfinished item. - + Nächste Unerledigte Move to the next unfinished item. - + Gehe zum nächsten unerledigten Eintrag. Move to previous item. - + Gehe zum vorigen Eintrag. Move to the previous item. - + Gehe zum vorigen Eintrag. Next item. - + Nächster EIntrag. Move to the next item. - + Gehe zum nächsten Eintrag. Mark item as done and move to the next unfinished item. - + Markiere Eintrag als erledigt und gehe zum nächsten unerledigten Eintrag. Mark this item as done and move to the next unfinished item. - + Markiert diesen Eintrag als erledigt und geht zum nächsten unerledigten Eintrag. Copy from source text - + Übernehme &Ursprungstext Toggle the validity check of accelerators. - + Schalte Prüfung der Tastenkürzel um. 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. - + 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. Toggle the validity check of ending punctuation. - + Schalte Prüfung der Satzendezeichen am Ende des Textes um. Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. - + Schaltet die Prüfung der Satzendezeichen am Ende des Textes um. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window. - + Schaltet die Prüfung der Verwendung der Wörterbuchvorschläge um. Bei Fehlschlag wird eine Warnung im Hinweis-Fenster angezeigt. Toggle the validity check of place markers. - + Schaltet die Prüfung der Platzhalter um. 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. - + 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. Open Read-O&nly... - + Schr&eibgeschützt öffnen... &Save All - + &Alles Speichern @@ -767,22 +768,22 @@ p, li { white-space: pre-wrap; } Recently Opened &Files - + Zu&letzt bearbeitete Dateien Save - + Speichern Print a list of all the translation units in the current translation source file. - + Liste aller Übersetzungseinheiten in der aktuellen Übersetzungsdatei drucken. Undo the last editing operation performed on the current translation. - + Mache die letzte Änderung an der Übersetzung rückgängig. @@ -902,12 +903,12 @@ p, li { white-space: pre-wrap; } Close - Schließen + Schließen &Close All - + A&lle schließen @@ -1170,49 +1171,49 @@ p, li { white-space: pre-wrap; } Source text - Ursprungstext + Ursprungstext Index - Index + Index Context - Kontext + Kontext Items - Einträge + Einträge This panel lists the source contexts. - Dieser Bereich zeigt die Kontexte an. + Dieser Bereich zeigt die Kontexte an. Strings - Zeichenketten + Zeichenketten Phrases and guesses - Wörterbuch und Vorschläge + Wörterbuch und Vorschläge Sources and Forms - + Quelldateien und Formulare Warnings - Warnungen + Hinweise @@ -1223,120 +1224,124 @@ p, li { white-space: pre-wrap; } Loading... - Lade... + Lade... Loading File - Qt Linguist - + Laden - Qt Linguist The file '%1' does not seem to be related to the currently open file(s) '%2'. Close the open file(s) first? - + Die Datei '%1' scheint nicht zu den bereits geöffneten Dateien '%2' zu passen. + +Sollen die bereits geöffneten Dateien vorher geschlossen werden? The file '%1' does not seem to be related to the file '%2' which is being loaded as well. Skip loading the first named file? - + Die Datei '%1' scheint nicht zu der Datei '%2' zu passen, die ebenfalls geladen wird. + +Soll die erstgenannte Datei übersprungen werden? %n translation unit(s) loaded. - - - + + Eine Übersetzungseinheit geladen. + %n Übersetzungseinheiten geladen. Related files (%1);; - + Verwandte Dateien (%1);; Open Translation Files - + Übersetzungsdateien öffnen File saved. - Datei gespeichert. + Datei gespeichert. Release - Freigeben + Freigeben Qt message files for released applications (*.qm) All files (*) - Qt Nachrichtendateien (*.qm) + Qt Nachrichtendateien (*.qm) Alle Dateien (*) File created. - Datei erzeugt. + Datei erzeugt. Printing... - Drucke... + Drucke... Context: %1 - Kontext: %1 + Kontext: %1 finished - erledigt + erledigt unresolved - ungelöst + ungelöst obsolete - veraltet + veraltet Printing... (page %1) - Drucke... (Seite %1) + Drucke... (Seite %1) Printing completed - Drucken beendet + Drucken beendet Printing aborted - Drucken abgebrochen + Drucken abgebrochen Search wrapped. - Suche beginnt von oben. + Suche beginnt von oben. @@ -1356,7 +1361,7 @@ Alle Dateien (*) Cannot find the string '%1'. - Kann Zeichenkette '%1' nicht finden. + Kann Zeichenkette '%1' nicht finden. Translated %n entries to '%1' @@ -1368,59 +1373,59 @@ Alle Dateien (*) Search And Translate in '%1' - Qt Linguist - + Suchen und übersetzen '%1' - Qt Linguist Translate - Qt Linguist - + Übersetzung - Qt Linguist Translated %n entry(s) - - - + + Ein Eintrag übersetzt + %n Einträge übersetzt No more occurrences of '%1'. Start over? - + Keine weiteren Fundstellen von '%1'. Von vorn beginnen? Create New Phrase Book - Erzeugen eines neuen Wörterbuchs + Erzeugen eines neuen Wörterbuchs Qt phrase books (*.qph) All files (*) - Qt Wörterbücher (*.qph) + Qt Wörterbücher (*.qph) Alle Dateien (*) Phrase book created. - Wörterbuch erzeugt. + Wörterbuch erzeugt. Open Phrase Book - Öffne Wörterbuch + Öffne Wörterbuch Qt phrase books (*.qph);;All files (*) - Qt Wörterbücher (*.qph);;Alle Dateien (*) + Qt Wörterbücher (*.qph);;Alle Dateien (*) %n phrase(s) loaded. - + Ein Wörterbucheintrag geladen. %n Wörterbucheinträge geladen. @@ -1430,32 +1435,32 @@ Alle Dateien (*) Add to phrase book - Hinzufügen zum Wörterbuch + Hinzufügen zum Wörterbuch No appropriate phrasebook found. - + Es wurde kein geeignetes Wörterbuch gefunden. Adding entry to phrasebook %1 - + Eintrag zu Wörterbuch %1 hinzufügen Select phrase book to add to - Zu welchem Wörterbuch soll der Eintrag hinzugefügt werden? + Zu welchem Wörterbuch soll der Eintrag hinzugefügt werden? Unable to launch Qt Assistant (%1) - Kann Qt Assistant nicht starten (%1) + Kann Qt Assistant nicht starten (%1) Version %1 - Version %1 + Version %1 Open Source Edition @@ -1464,17 +1469,17 @@ Alle Dateien (*) <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist is a tool for adding translations to Qt applications.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> - <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist ist ein Werkzeug zum Übersetzen von Qt Anwendungen.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> + <center><img src=":/images/splash.png"/></img><p>%1</p></center><p>Qt Linguist ist ein Werkzeug zum Übersetzen von Qt Anwendungen.</p><p>%2</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.</p> Do you want to save the modified files? - + Möchten Sie die geänderten Dateien speichern? Do you want to save '%1'? - Wollen Sie '%1' speichern? + Möchten Sie '%1' speichern? @@ -1490,99 +1495,99 @@ Alle Dateien (*) No untranslated translation units left. - + Es wurden alle Übersetzungseinheiten abgearbeitet. &Window - &Fenster + &Fenster Minimize - Minimieren + Minimieren Ctrl+M - Ctrl+M + Display the manual for %1. - Zeige Handbuch für %1 an. + Zeige Handbuch für %1 an. Display information about %1. - Zeige Informationen über %1 an. + Zeige Informationen über %1 an. &Save '%1' - + '%1' &Speichern Save '%1' &As... - + Speichere '%1' &unter... Release '%1' - + '%1' freigeben Release '%1' As... - + Gebe '%1'frei unter ... &Close '%1' - + '%1' &Schließen &Close - &Schließen + &Schließen Save All - + Alles speichern &Release All - + Alles f&reigeben Close All - Alle schließen + Alle schließen Translation File &Settings for '%1'... - + Einstellungen der Übersetzungs&datei für '%1'... &Batch Translation of '%1'... - + &Automatische Übersetzung von '%1'... Search And &Translate in '%1'... - + Suchen und &Übersetzen in '%1'... Search And &Translate... - + Suchen und &Übersetzen... @@ -1617,37 +1622,37 @@ Alle Dateien (*) Cannot read from phrase book '%1'. - Kann Wörterbuch '%1' nicht lesen. + Kann Wörterbuch '%1' nicht lesen. Close this phrase book. - Schließe dieses Wörterbuch. + Schließe dieses Wörterbuch. Enables you to add, modify, or delete entries in this phrase book. - + Erlaubt das Hinzufügen, Ändern und Entfernen von Einträgen aus dem Wörterbuch. Print the entries in this phrase book. - + Drucke die Einträge des Wörterbuchs. Cannot create phrase book '%1'. - Kann Wörterbuch '%1' nicht erzeugen. + Kann Wörterbuch '%1' nicht erzeugen. Do you want to save phrase book '%1'? - + Möchten Sie das Wörterbuch '%1' speichern? All - + Alle @@ -1704,27 +1709,27 @@ Alle Dateien (*) German - Deutsch + Deutsch Japanese - Japanisch + Japanisch French - Französisch + Französisch Polish - Polnisch + Polnisch Chinese - Chinesisch + Chinesisch @@ -1732,59 +1737,59 @@ Alle Dateien (*) Dieser Bereich erlaubt die Darstellung und Änderung der Übersetzung eines Textes. - + Source text - Ursprungstext + Ursprungstext This area shows the source text. - Dieser Bereich zeigt den Ursprungstext. + Dieser Bereich zeigt den Ursprungstext. Source text (Plural) - + Ursprungstext (Plural) This area shows the plural form of the source text. - + Dieser Bereich zeigt die Pluralform des Ursprungstexts. Developer comments - + Hinweise des Entwicklers This area shows a comment that may guide you, and the context in which the text occurs. - Dieser Bereich zeigt eventuelle Kommentare und den Kontext, in dem der Text auftritt. + Dieser Bereich zeigt eventuelle Kommentare und den Kontext, in dem der Text auftritt. Here you can enter comments for your own use. They have no effect on the translated applications. - + Hier können Sie Hinweise für den eigenen Gebrauch eintragen. Diese haben keinen Einflusse auf die Übersetzung. %1 translation (%2) - Übersetzung %1 (%2) + Übersetzung %1 (%2) This is where you can enter or modify the translation of the above source text. - + Hier können Sie die Übersetzung des Ursprungstextes eingeben bzw. ändern. %1 translation - Übersetzung %1 + Übersetzung %1 %1 translator comments - + %1 Hinweise des Übersetzers @@ -1839,22 +1844,22 @@ Zeile: %2 Completion status for %1 - + Bearbeitungsstand von %1 <file header> - + <Dateikopf> <context comment> - + <Kontexthinweis> <unnamed context> - + <unbenannter Kontext> @@ -1867,7 +1872,7 @@ Zeile: %2 MsgEdit - + This is the right panel of the main window. @@ -1912,7 +1917,7 @@ Zeile: %2 This window allows you to add, modify, or delete entries in a phrase book. - + Dieses Fenster erlaubt das Hinzufügen, Ändern und Entfernen von Einträgen aus dem Wörterbuch. @@ -1952,22 +1957,22 @@ Zeile: %2 &New Entry - + &Neuer Eintrag Click here to remove the entry from the phrase book. - + Entferne den Eintrag aus dem Wörterbuch. &Remove Entry - + &Entferne Eintrag Settin&gs... - + &Einstellungen... &New Phrase @@ -2053,12 +2058,12 @@ Zeile: %2 Translation files (%1);; - + Übersetzungsdateien (%1);; All files (*) - + Alle Dateien (*) @@ -2074,57 +2079,57 @@ Zeile: %2 C++ source files - + C++-Quelltextdateien' Java source files - + Java-Quelltextdateien GNU Gettext localization files - + GNU-Gettext Übersetzungsdateien Qt Script source files - + Qt-Skript-Quelltextdateien Qt translation sources (format 1.1) - + Qt-Übersetzungsdateien (Formatversion 1.1) Qt translation sources (format 2.0) - + Qt-Übersetzungsdateien (Formatversion 2.0) Qt translation sources (latest format) - + Qt Übersetzungsdateien (aktuelles Format) Qt Designer form files - + Qt Designer Formulardateien Qt Jambi form files - + Qt Jambi Formulardateien XLIFF localization files - + XLIFF Übersetzungsdateien Qt Linguist 'Phrase Book' - + Qt Linguist-Wörterbuch @@ -2223,7 +2228,7 @@ Zeile: %2 Close - Schließen + Schließen @@ -2727,27 +2732,27 @@ Alle Dateien (*) Settings for '%1' - Qt Linguist - + Einstellungen für '%1' - Qt Linguist Source language - + Ursprungssprache Language - Sprache + Sprache Country/Region - Land/Region + Land/Region Target language - Zielsprache + Zielsprache diff --git a/translations/qt_de.qm b/translations/qt_de.qm index 5d68bf7..9ea09a7 100644 Binary files a/translations/qt_de.qm and b/translations/qt_de.qm differ diff --git a/translations/qt_de.ts b/translations/qt_de.ts index 70cf6f3..33f9ea8 100644 --- a/translations/qt_de.ts +++ b/translations/qt_de.ts @@ -22,7 +22,7 @@ CloseButton - + Close Tab Schließen @@ -186,7 +186,7 @@ Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Pa Q3FileDialog - + Copy or Move a File Datei kopieren oder verschieben @@ -203,7 +203,7 @@ Bitte prüfen Sie die Gstreamer-Installation und stellen Sie sicher, dass das Pa - + Cancel Abbrechen @@ -886,7 +886,7 @@ nach QApplication - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. LTR @@ -1170,7 +1170,7 @@ nach QDialogButtonBox - + OK @@ -1392,7 +1392,7 @@ nach Cannot remove source file - + Die Quelldatei kann nicht entfernt werden @@ -1418,8 +1418,8 @@ nach QFileDialog - - + + All Files (*) Alle Dateien (*) @@ -1448,7 +1448,7 @@ nach Datei - + Open Öffnen @@ -1458,26 +1458,26 @@ nach Speichern unter - + - + &Open &Öffnen - + &Save S&peichern - + Recent Places Zuletzt besucht - + &Rename &Umbenennen @@ -1492,17 +1492,17 @@ nach &Versteckte Dateien anzeigen - + New Folder Neues Verzeichnis - + Find Directory Verzeichnis suchen - + Directories Verzeichnisse @@ -1512,13 +1512,13 @@ nach Alle Dateien (*.*) - - + + Directory: Verzeichnis: - + %1 already exists. Do you want to replace it? Die Datei %1 existiert bereits. @@ -1552,7 +1552,7 @@ Stellen Sie sicher, dass der Dateiname richtig ist. - + %1 Directory not found. Please verify the correct directory name was given. @@ -1588,7 +1588,7 @@ Möchten sie die Datei trotzdem löschen? Unbekannt - + Show Anzeigen @@ -1604,19 +1604,19 @@ Möchten sie die Datei trotzdem löschen? &Neues Verzeichnis - + &Choose &Auswählen - + Remove Löschen - - + + File &name: Datei&name: @@ -1698,7 +1698,7 @@ Möchten sie die Datei trotzdem löschen? Änderungsdatum - + My Computer Mein Computer @@ -2161,7 +2161,7 @@ Möchten sie die Datei trotzdem löschen? QHttp - + Connection refused Verbindung verweigert @@ -2253,7 +2253,7 @@ Möchten sie die Datei trotzdem löschen? Unknown authentication method - + Unbekannte Authentifizierungsmethode @@ -2365,7 +2365,7 @@ Möchten sie die Datei trotzdem löschen? QIBaseDriver - + Error opening database Die Datenbankverbindung konnte nicht geöffnet werden @@ -2643,7 +2643,7 @@ Möchten sie die Datei trotzdem löschen? QLocalServer - + %1: Name error %1: Fehlerhafter Name @@ -2738,7 +2738,7 @@ Möchten sie die Datei trotzdem löschen? QMYSQLDriver - + Unable to open database ' Die Datenbankverbindung konnte nicht geöffnet werden ' @@ -2766,12 +2766,12 @@ Möchten sie die Datei trotzdem löschen? QMYSQLResult - + Unable to fetch data Es konnten keine Daten abgeholt werden - + Unable to execute query Die Abfrage konnte nicht ausgeführt werden @@ -2781,13 +2781,13 @@ Möchten sie die Datei trotzdem löschen? Das Ergebnis konnte nicht gespeichert werden - + Unable to prepare statement Der Befehl konnte nicht initialisiert werden - + Unable to reset statement Der Befehl konnte nicht zurückgesetzt werden @@ -2813,7 +2813,7 @@ Möchten sie die Datei trotzdem löschen? Die Ergebnisse des Befehls konnten nicht gespeichert werden - + Unable to execute next query Die folgende Abfrage kann nicht ausgeführt werden @@ -2971,7 +2971,7 @@ Möchten sie die Datei trotzdem löschen? <p>Dieses Programm verwendet Qt-Version %1.</p> - + Show Details... Details einblenden... @@ -2981,7 +2981,7 @@ Möchten sie die Datei trotzdem löschen? Details ausblenden... - + <h3>About Qt</h3><p>This program uses Qt version %1.</p><p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://www.qtsoftware.com/qt/">www.qtsoftware.com/qt</a> for more information.</p> @@ -3310,7 +3310,7 @@ Möchten sie die Datei trotzdem löschen? QODBCDriver - + Unable to connect Es kann keine Verbindung aufgebaut werden @@ -3444,7 +3444,7 @@ Möchten sie die Datei trotzdem löschen? QPPDOptionsModel - + Name Name @@ -4009,7 +4009,7 @@ Bitte wählen Sie einen anderen Dateinamen. Benutzerdefiniert - + &Options >> &Einstellungen >> @@ -4030,7 +4030,7 @@ Bitte wählen Sie einen anderen Dateinamen. Druck in Postscript-Datei - + Local file Lokale Datei @@ -4040,7 +4040,7 @@ Bitte wählen Sie einen anderen Dateinamen. Schreiben der Datei %1 - + &Print &Drucken @@ -4373,7 +4373,7 @@ Bitte wählen Sie einen anderen Dateinamen. No program defined - + Es wurde kein Programm angegeben @@ -5985,7 +5985,7 @@ Bitte wählen Sie einen anderen Dateinamen. %1 (%2x%3 Pixel) - + Bad HTTP request Ungültige HTTP-Anforderung @@ -6077,15 +6077,15 @@ Bitte wählen Sie einen anderen Dateinamen. JavaScript Confirm - %1 - JavaScript-Bestätigung - %1 + JavaScript-Bestätigung - %1 JavaScript Prompt - %1 - JavaScript-Eingabeaufforderung - %1 + JavaScript-Eingabeaufforderung - %1 - + Move the cursor to the next character Positionsmarke auf folgendes Zeichen setzen @@ -6147,7 +6147,7 @@ Bitte wählen Sie einen anderen Dateinamen. Select all - + Alles auswählen @@ -6222,12 +6222,12 @@ Bitte wählen Sie einen anderen Dateinamen. Insert a new paragraph - + Neuen Abschnitt einfügen Insert a new line - + Neue Zeile einfügen @@ -6241,7 +6241,7 @@ Bitte wählen Sie einen anderen Dateinamen. QWidget - + * * @@ -6787,7 +6787,7 @@ Bitte wählen Sie einen anderen Dateinamen. %1 ist kein gültiger regulärer Ausdruck: %2 - + It will not be possible to retrieve %1. %1 kann nicht bestimmt werden. @@ -7508,7 +7508,7 @@ Bitte wählen Sie einen anderen Dateinamen. In a namespace constructor, the value for a namespace cannot be an empty string. - + Im Konstruktor eines Namensraums darf der Wert des Namensraumes keine leere Zeichenkette sein. diff --git a/translations/qt_help_de.qm b/translations/qt_help_de.qm index e28a97e..e3d8d87 100644 Binary files a/translations/qt_help_de.qm and b/translations/qt_help_de.qm differ diff --git a/translations/qt_help_de.ts b/translations/qt_help_de.ts index ed8a3c3..8f67ec3 100644 --- a/translations/qt_help_de.ts +++ b/translations/qt_help_de.ts @@ -39,7 +39,7 @@ Cannot load sqlite database driver! - + Der Datenbanktreiber für SQLite kann nicht geladen werden! -- cgit v0.12 From 44d0dbcc350ddd2ab3459aea78628409a1aef0d5 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Mon, 18 May 2009 10:48:11 +0200 Subject: Fix QSoundServer on Big-Endian machines. Task-number: 253619 Reviewed-by: Paul --- src/gui/embedded/qsoundqss_qws.cpp | 40 +++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/gui/embedded/qsoundqss_qws.cpp b/src/gui/embedded/qsoundqss_qws.cpp index c72ea91..283bbd3 100644 --- a/src/gui/embedded/qsoundqss_qws.cpp +++ b/src/gui/embedded/qsoundqss_qws.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -335,7 +336,13 @@ public: virtual int readySamples(int) = 0; int getSample(int off, int bps) { - return (bps == 1) ? (data[out+off] - 128) * 128 : ((short*)data)[(out/2)+off]; + + // + // 16-bit audio data is converted to native endian so that it can be scaled + // Yes, this is ugly on a BigEndian machine + // Perhaps it shouldn't be scaled at all + // + return (bps == 1) ? (data[out+off] - 128) * 128 : qToLittleEndian(((short*)data)[(out/2)+off]); } int add(int* mixl, int* mixr, int count) @@ -547,7 +554,7 @@ public: wavedata_remaining = 0; mFinishedRead = true; } else if ( qstrncmp(chunk.id,"data",4) == 0 ) { - wavedata_remaining = chunk.size; + wavedata_remaining = qToLittleEndian( chunk.size ); //out = max = sound_buffer_size; @@ -572,10 +579,23 @@ public: //qDebug("couldn't ready chunkdata"); mFinishedRead = true; } + #define WAVE_FORMAT_PCM 1 - else if ( chunkdata.formatTag != WAVE_FORMAT_PCM ) { - //qDebug("WAV file: UNSUPPORTED FORMAT %d",chunkdata.formatTag); - mFinishedRead = true; + else + { + /* + ** Endian Fix the chuck data + */ + chunkdata.formatTag = qToLittleEndian( chunkdata.formatTag ); + chunkdata.channels = qToLittleEndian( chunkdata.channels ); + chunkdata.samplesPerSec = qToLittleEndian( chunkdata.samplesPerSec ); + chunkdata.avgBytesPerSec = qToLittleEndian( chunkdata.avgBytesPerSec ); + chunkdata.blockAlign = qToLittleEndian( chunkdata.blockAlign ); + chunkdata.wBitsPerSample = qToLittleEndian( chunkdata.wBitsPerSample ); + if ( chunkdata.formatTag != WAVE_FORMAT_PCM ) { + qWarning("WAV file: UNSUPPORTED FORMAT %d",chunkdata.formatTag); + mFinishedRead = true; + } } } else { // ignored chunk @@ -1166,9 +1186,15 @@ bool QWSSoundServerPrivate::openDevice() if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &v)) qWarning("Could not set fragments to %08x",v); #ifdef QT_QWS_SOUND_16BIT - v=AFMT_S16_LE; if (ioctl(fd, SNDCTL_DSP_SETFMT, &v)) + // + // Use native endian + // Since we have manipulated the data volume the data + // is now in native format, even though its stored + // as little endian in the WAV file + // + v=AFMT_S16_NE; if (ioctl(fd, SNDCTL_DSP_SETFMT, &v)) qWarning("Could not set format %d",v); - if (AFMT_S16_LE != v) + if (AFMT_S16_NE != v) qDebug("Want format %d got %d", AFMT_S16_LE, v); #else v=AFMT_U8; if (ioctl(fd, SNDCTL_DSP_SETFMT, &v)) -- cgit v0.12 From 7133b932ac2af6e5a09323f09ee8024d0042bce3 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 11:00:10 +0200 Subject: Made it possible to set string properties using QDesignerFormWindowCursor::setProperty. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure the text does not get clobbered by the subproperty handling. Reviewed-by: Kai Köhne Task-number: 253278 --- tools/designer/src/lib/shared/qdesigner_propertycommand.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp b/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp index ff3b50b..94e8044 100644 --- a/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp +++ b/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp @@ -316,6 +316,10 @@ Qt::Alignment variantToAlignment(const QVariant & q) // find changed subproperties of a variant unsigned compareSubProperties(const QVariant & q1, const QVariant & q2, qdesigner_internal::SpecialProperty specialProperty) { + // Do not clobber new value in the comparison function in + // case someone sets a QString on a PropertySheetStringValue. + if (q1.type() != q2.type()) + return SubPropertyAll; switch (q1.type()) { case QVariant::Rect: return compareSubProperties(q1.toRect(), q2.toRect()); -- cgit v0.12 From 76504e5e5ee51665ddd37d36e220c9266d84aa53 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 11:06:06 +0200 Subject: Fixed a bug caused by forms with a sizepolicy of 'Fixed' on the main container. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore 4.4 behaviour by using a QStackedLayout as the layout containing the actual form (as was in 4.4). The difference in behaviour was caused by insertion of an additional widget with a QVBoxLayout which is supposed to ease setting of inheritable properties (style, etc). Reviewed-by: Kai Köhne Task-number: 253236 --- tools/designer/src/components/formeditor/formwindow_widgetstack.cpp | 6 +++++- tools/designer/src/components/formeditor/formwindow_widgetstack.h | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp b/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp index 7270628..58127b0 100644 --- a/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp +++ b/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp @@ -57,16 +57,20 @@ using namespace qdesigner_internal; FormWindowWidgetStack::FormWindowWidgetStack(QObject *parent) : QObject(parent), m_formContainer(new QWidget), - m_formContainerLayout(new QVBoxLayout), + m_formContainerLayout(new QStackedLayout), m_layout(new QStackedLayout) { m_layout->setMargin(0); m_layout->setSpacing(0); m_layout->setStackingMode(QStackedLayout::StackAll); + // We choose a QStackedLayout as immediate layout for + // the form windows as it ignores the sizePolicy of + // its child (for example, Fixed would cause undesired side effects). m_formContainerLayout->setMargin(0); m_formContainer->setObjectName(QLatin1String("formContainer")); m_formContainer->setLayout(m_formContainerLayout); + m_formContainerLayout->setStackingMode(QStackedLayout::StackAll); // System settings might have different background colors, autofill them // (affects for example mainwindow status bars) m_formContainer->setAutoFillBackground(true); diff --git a/tools/designer/src/components/formeditor/formwindow_widgetstack.h b/tools/designer/src/components/formeditor/formwindow_widgetstack.h index 92323c5..f21c4f0 100644 --- a/tools/designer/src/components/formeditor/formwindow_widgetstack.h +++ b/tools/designer/src/components/formeditor/formwindow_widgetstack.h @@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE class QDesignerFormWindowToolInterface; class QStackedLayout; -class QVBoxLayout; class QWidget; namespace qdesigner_internal { @@ -92,7 +91,7 @@ protected: private: QList m_tools; QWidget *m_formContainer; - QVBoxLayout *m_formContainerLayout; + QStackedLayout *m_formContainerLayout; QStackedLayout *m_layout; }; -- cgit v0.12 From 968c3e34b97769c0917325ce8b2b3b34b87a4e48 Mon Sep 17 00:00:00 2001 From: axasia Date: Sun, 17 May 2009 00:02:02 +0900 Subject: Update japanese translation of Qt Assistant. --- translations/assistant_ja.ts | 395 ++++++++++++++++++++++--------------------- 1 file changed, 203 insertions(+), 192 deletions(-) diff --git a/translations/assistant_ja.ts b/translations/assistant_ja.ts index 1853155..5e4d2c9 100644 --- a/translations/assistant_ja.ts +++ b/translations/assistant_ja.ts @@ -1,12 +1,12 @@ - + AboutDialog &Close - + 閉じる(&C) @@ -14,18 +14,19 @@ Warning - + 警告 Unable to launch external application. - + 外部アプリケーションを起動できません。 + OK - + OK @@ -37,42 +38,42 @@ Bookmarks - + ブックマーク Add Bookmark - + ブックマークの追加 Bookmark: - + ブックマーク: Add in Folder: - + 追加先フォルダ: + - + + New Folder - + 新しいフォルダ Delete Folder - + フォルダを削除 Rename Folder - + フォルダの名前変更 @@ -80,23 +81,23 @@ Bookmarks - + ブックマーク Remove - + 削除 You are going to delete a Folder, this will also<br>remove it's content. Are you sure to continue? - + フォルダを削除すると中身も削除されますが、続けてよろしいですか? New Folder - + 新しいフォルダ @@ -104,47 +105,47 @@ Filter: - + フィルタ: Remove - + 削除 Delete Folder - + フォルダを削除 Rename Folder - + フォルダの名前変更 Show Bookmark - + ブックマークを開く Show Bookmark in New Tab - + ブックマークを新しいタブで開く Delete Bookmark - + ブックマークを削除 Rename Bookmark - + ブックマークの名前変更 Add - + 追加 @@ -152,48 +153,48 @@ Add new page - + 新しいページの追加 Close current page - + 現在のページを閉じる Print Document - + ドキュメントを印刷 unknown - + 不明 Add New Page - + 新しいページの追加 Close This Page - + このページを閉じる Close Other Pages - + 他のページを閉じる Add Bookmark for this Page... - + このページをブックマークに追加... Search - + 検索 @@ -201,12 +202,12 @@ Open Link - + リンクを開く Open Link in New Tab - + リンクを新しいタブで開く @@ -214,12 +215,12 @@ Add Filter Name - + フィルタ名を追加 Filter Name: - + フィルタ名: @@ -227,27 +228,27 @@ Previous - + 戻る Next - + 進む Case Sensitive - + 大文字/小文字を区別する Whole words - + 単語単位で検索する <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped - + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;見つからなければ先頭から検索する @@ -255,27 +256,27 @@ Font - + フォント &Writing system - + 文字セット(&W) &Family - + フォント名(&F) &Style - + スタイル(&S) &Point size - + サイズ(&P) @@ -283,38 +284,39 @@ Help - + ヘルプ OK - + OK <title>Error 404...</title><div align="center"><br><br><h1>The page could not be found</h1><br><h3>'%1'</h3></div> - + <title>Error 404...</title><div align="center"><br><br><h1>ページが見つかりませんでした</h1><br><h3>'%1'</h3></div> Copy &Link Location - + リンクのURLをコピー(&L) Open Link in New Tab Ctrl+LMB - + リンクを新しいタブで開く Ctrl+LMB Open Link in New Tab - + リンクを新しいタブで開く Unable to launch external application. - + 外部アプリケーションを起動できません。 + @@ -322,17 +324,17 @@ &Look for: - + 検索文字列(&L): Open Link - + リンクを開く Open Link in New Tab - + リンクを新しいタブで開く @@ -341,97 +343,98 @@ Install Documentation - + ドキュメントのインストール Downloading documentation info... - + ドキュメント情報をダウンロード中... Download canceled. - + ダウンロードを中止しました。 Done. - + 完了. The file %1 already exists. Do you want to overwrite it? - + %1 は既に存在します。上書きしますか? Unable to save the file %1: %2. - + ファイルを保存できません。%1: %2. Downloading %1... - + %1 をダウンロード中... Download failed: %1. - + ダウンロード失敗: %1. Documentation info file is corrupt! - + ドキュメント情報ファイルが不正です! Download failed: Downloaded file is corrupted. - + ダウンロード失敗: ダウンロードしたファイルが不正です。 Installing documentation %1... - + %1 のドキュメントをインストール中... Error while installing documentation: %1 - + ドキュメントのインストール中にエラーが発生しました: +%1 Available Documentation: - + 使用可能なドキュメント: Install - + インストール Cancel - + キャンセル Close - + 閉じる Installation Path: - + インストール先のパス: ... - + ... @@ -440,298 +443,298 @@ Index - + インデックス Contents - + コンテンツ Bookmarks - + ブックマーク Search - + 検索 Qt Assistant - + Qt Assistant Unfiltered - + フィルタなし Page Set&up... - + ページ設定(&U)... Print Preview... - + 印刷プレビュー... &Print... - + 印刷(&P)... New &Tab - + 新しいタブ(&T) &Close Tab - + タブを閉じる(&C) &Quit - + 終了(&Q) CTRL+Q - + CTRL+Q &Copy selected Text - + 選択中の文字をコピー(&C) &Find in Text... - + 検索(&F)... Find &Next - + 次を検索(&N) Find &Previous - + 前を検索(&P) Preferences... - + 設定... Zoom &in - + 拡大(&I) Zoom &out - + 縮小(&O) Normal &Size - + 普通の大きさ(&S) Ctrl+0 - + Ctrl+0 ALT+C - + ALT+C ALT+I - + ALT+I ALT+S - + ALT+S &Home - + ホーム(&H) Ctrl+Home - + Ctrl+Home &Back - + 戻る(&B) &Forward - + 進む(&F) Sync with Table of Contents - + 内容と目次を同期する Next Page - + 次のページ Ctrl+Alt+Right - + Ctrl+Alt+Right Previous Page - + 前のページ Ctrl+Alt+Left - + Ctrl+Alt+Left Add Bookmark... - + ブックマークの追加... About... - + Qt Assistant について... Navigation Toolbar - + ナビゲーション ツールバー Toolbars - + ツールバー Filter Toolbar - + フィルター ツールバー Filtered by: - + フィルタ条件: Address Toolbar - + アドレス ツールバー Address: - + アドレス: Could not find the associated content item. - + 関連付いた内容が見つかりません。 About %1 - + %1 について Updating search index - + 検索インデックスを更新中 Looking for Qt Documentation... - + Qt ドキュメントを探しています... &Window - + ウィンドウ(&W) Minimize - + 最小化 Ctrl+M - + Ctrl+M Zoom - + ズーム &File - + ファイル(&F) &Edit - + 編集(&E) &View - + 表示(&V) &Go - + ジャンプ(&G) &Bookmarks - + ブックマーク(&B) &Help - + ヘルプ(&H) ALT+O - + ALT+O CTRL+D - + CTRL+D @@ -741,47 +744,47 @@ Add Documentation - + ドキュメントの追加 Qt Compressed Help Files (*.qch) - + 圧縮済み Qt ヘルプファイル (*.qch) The specified file is not a valid Qt Help File! - + 指定されたファイルは有効な Qt ヘルプ ファイルではありません! The namespace %1 is already registered! - + ネームスペース %1 は既に登録済みです! Remove Documentation - + ドキュメントの除去 Some documents currently opened in Assistant reference the documentation you are attempting to remove. Removing the documentation will close those documents. - + 除去しようとしているいくつかのドキュメントは Assistant 上で参照されています。除去すると、これらのドキュメントは閉じられます。 Cancel - + キャンセル OK - + OK Use custom settings - + 独自設定を使用する @@ -789,92 +792,92 @@ Preferences - + 設定 Fonts - + フォント Font settings: - + フォント設定: Browser - + ブラウザー Application - + アプリケーション Filters - + フィルタ Filter: - + フィルタ: Attributes: - + 属性: 1 - + 1 Add - + 追加 Remove - + 削除 Documentation - + ドキュメント Registered Documentation: - + 登録済みドキュメント: Add... - + 追加... Options - + オプション Current Page - + 現在のページ Restore to default - + デフォルト設定に戻す Homepage - + ホームページ @@ -882,64 +885,64 @@ The specified collection file does not exist! - + 指定されたコレクションファイルは存在しません! Missing collection file! - + コレクションファイルが見つかりません! Invalid URL! - + 不正なURLです! Missing URL! - + URLが見つかりません! Unknown widget: %1 - + 不明なウィジェット: %1 Missing widget! - + ウィジェットが見つかりません! The specified Qt help file does not exist! - + 指定された Qt ヘルプ ファイルが存在しません! Missing help file! - + ヘルプファイルが見つかりません! Missing filter argument! - + フィルタ引数が不足しています! Unknown option: %1 - + 不明なオプション: %1 Qt Assistant - + Qt Assistant @@ -948,12 +951,16 @@ Reason: %2 - + ドキュメントファイルを登録できませんでした。 +%1 + +原因: +%2 Documentation successfully registered. - + ドキュメントの登録に成功しました。 @@ -962,28 +969,32 @@ Reason: Reason: %2 - + ドキュメントファイルを解除できませんでした。 +%1 + +原因: +%2 Documentation successfully unregistered. - + ドキュメントの解放に成功しました。 Cannot load sqlite database driver! - + SQLite データベース ドライバーをロードできません! The specified collection file could not be read! - + 指定されたコレクションファイルは読み込めません! Bookmark - + ブックマーク @@ -991,12 +1002,12 @@ Reason: Debugging Remote Control - + リモート コントロールをデバッグ中 Received Command: %1 %2 - + 受信したコマンド: %1 %2 @@ -1004,28 +1015,28 @@ Reason: &Copy - + コピー(&C) Copy &Link Location - + リンクのURLをコピー(&L) Open Link in New Tab - + リンクを新しいタブで開く Select All - + すべてを選択 Open Link - + リンクを開く @@ -1033,27 +1044,27 @@ Reason: Choose a topic for <b>%1</b>: - + <b>%1</b> の検索先トピックを選択してください: Choose Topic - + トピックを選択 &Topics - + トピック(&T) &Display - + 表示(&D) &Close - + 閉じる(&C) -- cgit v0.12 From 3cc966afd45ac727126ea89bafa7c1aa1295226b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 18 May 2009 11:07:36 +0200 Subject: less inefficient --- qmake/project.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/project.cpp b/qmake/project.cpp index 00bb2f0..8ae0fe2 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -2412,7 +2412,7 @@ QMakeProject::doProjectTest(QString func, QList args_list, QMap rhs_int; return lhs_int < rhs_int; } -- cgit v0.12 From 60a17320d39eed9cd82f38d07495161b2b2d5e42 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Mon, 18 May 2009 11:23:05 +0200 Subject: Add an extension to QPixmapCache to get rid of strings. This commit add a new API to add/find/remove pixmaps into QPixmapCache. This new extension is based on a key that the cache give you during the insertion. This key is internally a int which makes all operations in the cache much more faster that the string approach. Auto-tests has been extended as well and a benchmark has been added to compare both approach. I also depecrate the find method for the string API to have a method pointer based and not reference based like the Qt policy says. Reviewed-by: bnilsen Reviewed-by: andreas Followed-deeply-by: trond --- .../snippets/code/src_gui_image_qpixmapcache.cpp | 2 +- src/gui/graphicsview/qgraphicsitem.cpp | 11 +- src/gui/graphicsview/qgraphicsitem_p.h | 6 +- src/gui/graphicsview/qgraphicsscene.cpp | 31 +- src/gui/image/image.pri | 1 + src/gui/image/qpixmapcache.cpp | 365 ++++++++++++++++++--- src/gui/image/qpixmapcache.h | 27 +- src/gui/image/qpixmapcache_p.h | 92 ++++++ tests/auto/qpixmapcache/tst_qpixmapcache.cpp | 258 ++++++++++++++- .../benchmarks/qgraphicsview/tst_qgraphicsview.cpp | 1 - tests/benchmarks/qpixmapcache/qpixmapcache.pro | 6 + tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp | 226 +++++++++++++ 12 files changed, 935 insertions(+), 91 deletions(-) create mode 100644 src/gui/image/qpixmapcache_p.h create mode 100644 tests/benchmarks/qpixmapcache/qpixmapcache.pro create mode 100644 tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp diff --git a/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp b/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp index c4b6353..2a04f64 100644 --- a/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp +++ b/doc/src/snippets/code/src_gui_image_qpixmapcache.cpp @@ -13,7 +13,7 @@ painter->drawPixmap(0, 0, p); //! [1] QPixmap pm; -if (!QPixmapCache::find("my_big_image", pm)) { +if (!QPixmapCache::find("my_big_image", &pm)) { pm.load("bigimage.png"); QPixmapCache::insert("my_big_image", pm); } diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index ec08aaf..72b832a 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -978,6 +978,7 @@ void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, con void QGraphicsItemCache::purge() { QPixmapCache::remove(key); + key = QPixmapCache::Key(); QMutableMapIterator it(deviceData); while (it.hasNext()) { DeviceData &data = it.next().value(); @@ -1426,12 +1427,6 @@ void QGraphicsItem::setCacheMode(CacheMode mode, const QSize &logicalCacheSize) cache->purge(); if (mode == ItemCoordinateCache) { - if (cache->key.isEmpty()) { - // Generate new simple pixmap cache key. - QString tmp; - tmp.sprintf("qgv-%p", this); - cache->key = tmp; - } if (lastMode == mode && cache->fixedSize == logicalCacheSize) noVisualChange = true; cache->fixedSize = logicalCacheSize; @@ -4205,7 +4200,7 @@ void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect) && (d->cacheMode == ItemCoordinateCache && !c->fixedSize.isValid()); if (scrollCache) { QPixmap pix; - if (QPixmapCache::find(c->key, pix)) { + if (QPixmapCache::find(c->key, &pix)) { // Adjust with 2 pixel margin. Notice the loss of precision // when converting to QRect. int adjust = 2; @@ -4214,7 +4209,7 @@ void QGraphicsItem::scroll(qreal dx, qreal dy, const QRectF &rect) _q_scrollPixmap(&pix, irect, dx, dy); - QPixmapCache::insert(c->key, pix); + QPixmapCache::replace(c->key, pix); // Translate the existing expose. foreach (QRectF exposedRect, c->exposed) diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 82a48fb..820ef04 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -54,6 +54,7 @@ // #include "qgraphicsitem.h" +#include "qpixmapcache.h" #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW @@ -69,13 +70,14 @@ public: // ItemCoordinateCache only QRect boundingRect; QSize fixedSize; - QString key; + QPixmapCache::Key key; // DeviceCoordinateCache only struct DeviceData { + DeviceData() {} QTransform lastTransform; QPoint cacheIndent; - QString key; + QPixmapCache::Key key; }; QMap deviceData; diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 7318fa5..1fbda85 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4743,8 +4743,9 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte return; // Fetch the off-screen transparent buffer and exposed area info. - QString pixmapKey; + QPixmapCache::Key pixmapKey; QPixmap pix; + bool pixmapFound; QGraphicsItemCache *itemCache = itemd->extraItemCache(); if (cacheMode == QGraphicsItem::ItemCoordinateCache) { if (itemCache->boundingRect != brect.toRect()) { @@ -4754,17 +4755,14 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte } pixmapKey = itemCache->key; } else { - if ((pixmapKey = itemCache->deviceData.value(widget).key).isEmpty()) { - pixmapKey.sprintf("qgv-%p-%p", item, widget); - QGraphicsItemCache::DeviceData data; - data.key = pixmapKey; - itemCache->deviceData.insert(widget, data); - } + pixmapKey = itemCache->deviceData.value(widget).key; } // Find pixmap in cache. if (!itemCache->allExposed) - QPixmapCache::find(pixmapKey, pix); + pixmapFound = QPixmapCache::find(pixmapKey, &pix); + else + pixmapFound = false; // Render using item coordinate cache mode. if (cacheMode == QGraphicsItem::ItemCoordinateCache) { @@ -4817,8 +4815,12 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte _q_paintIntoCache(&pix, item, pixmapExposed, itemToPixmap, painter->renderHints(), &cacheOption, painterStateProtection); - // Reinsert this pixmap into the cache. - QPixmapCache::insert(pixmapKey, pix); + if (!pixmapFound) { + // insert this pixmap into the cache. + itemCache->key = QPixmapCache::insert(pix); + } else { + QPixmapCache::replace(pixmapKey, pix); + } // Reset expose data. itemCache->allExposed = false; @@ -4985,8 +4987,13 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte } if (pixModified) { - // Reinsert this pixmap into the cache - QPixmapCache::insert(pixmapKey, pix); + if (!pixmapFound) { + // Insert this pixmap into the cache. + deviceData->key = QPixmapCache::insert(pix); + } else { + //otherwise we replace the pixmap in the cache + QPixmapCache::replace(pixmapKey, pix); + } } // Redraw the exposed area using an untransformed painter. This diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri index ca52974..bf348af 100644 --- a/src/gui/image/image.pri +++ b/src/gui/image/image.pri @@ -22,6 +22,7 @@ HEADERS += \ image/qpixmap.h \ image/qpixmap_raster_p.h \ image/qpixmapcache.h \ + image/qpixmapcache_p.h \ image/qpixmapdata_p.h \ image/qpixmapdatafactory_p.h \ image/qpixmapfilter_p.h diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 4916489..810ce65 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -40,13 +40,9 @@ ****************************************************************************/ #include "qpixmapcache.h" -#include "qcache.h" #include "qobject.h" #include "qdebug.h" - -#include "qpaintengine.h" -#include -#include +#include "qpixmapcache_p.h" QT_BEGIN_NAMESPACE @@ -68,15 +64,17 @@ QT_BEGIN_NAMESPACE access the global pixmap cache. It creates an internal QCache object for caching the pixmaps. - The cache associates a pixmap with a string (key). If two pixmaps - are inserted into the cache using equal keys, then the last pixmap - will hide the first pixmap. The QHash and QCache classes do + The cache associates a pixmap with a string as a key or with a QPixmapCache::Key. + The QPixmapCache::Key is faster than using strings as key. + If two pixmaps are inserted into the cache using equal keys, then the + last pixmap will hide the first pixmap. The QHash and QCache classes do exactly the same. The cache becomes full when the total size of all pixmaps in the - cache exceeds cacheLimit(). The initial cache limit is 1024 KB (1 - MB); it is changed with setCacheLimit(). A pixmap takes roughly - (\e{width} * \e{height} * \e{depth})/8 bytes of memory. + cache exceeds cacheLimit(). The initial cache limit is + 2048 KB(2 MB) for Embedded, 10240 KB (10 + MB) for Desktops; it is changed with setCacheLimit(). + A pixmap takes roughly (\e{width} * \e{height} * \e{depth})/8 bytes of memory. The \e{Qt Quarterly} article \l{http://doc.trolltech.com/qq/qq12-qpixmapcache.html}{Optimizing @@ -92,52 +90,117 @@ static int cache_limit = 2048; // 2048 KB cache limit for embedded static int cache_limit = 10240; // 10 MB cache limit for desktop #endif -// XXX: hw: is this a general concept we need to abstract? -class QDetachedPixmap : public QPixmap +/*! + Constructs an empty Key object. +*/ +QPixmapCache::Key::Key() : d(0) { -public: - QDetachedPixmap(const QPixmap &pix) : QPixmap(pix) - { - if (data && data->classId() == QPixmapData::RasterClass) { - QRasterPixmapData *d = static_cast(data); - if (!d->image.isNull() && d->image.d->paintEngine - && !d->image.d->paintEngine->isActive()) - { - delete d->image.d->paintEngine; - d->image.d->paintEngine = 0; - } - } +} + +/*! + \internal + Constructs a copy of \a other. +*/ +QPixmapCache::Key::Key(const Key &other) +{ + if (other.d) + ++(other.d->ref); + d = other.d; +} + +/*! + Destructor; called immediately before the object is deleted. +*/ +QPixmapCache::Key::~Key() +{ + if (d && --(d->ref) == 0) + delete d; +} + +/*! + \internal + + Returns true if this key is the same as the given \a key. +*/ +bool QPixmapCache::Key::operator ==(const Key &key) const +{ + return (d == key.d); +} + +/*! + \internal +*/ +QPixmapCache::Key &QPixmapCache::Key::operator =(const Key &other) +{ + if (d != other.d) { + if (other.d) + ++(other.d->ref); + if (d && --(d->ref) == 0) + delete d; + d = other.d; } -}; + return *this; +} -class QPMCache : public QObject, public QCache +class QPMCache : public QObject, public QCache { Q_OBJECT public: - QPMCache() - : QObject(0), - QCache(cache_limit * 1024), - theid(0), ps(0), t(false) { } - ~QPMCache() { } + QPMCache(); + ~QPMCache(); void timerEvent(QTimerEvent *); bool insert(const QString& key, const QPixmap &pixmap, int cost); + QPixmapCache::Key insert(const QPixmap &pixmap, int cost); + bool replace(const QPixmapCache::Key &key, const QPixmap &pixmap, int cost); bool remove(const QString &key); + bool remove(const QPixmapCache::Key &key); + + void resizeKeyArray(int size); + QPixmapCache::Key createKey(); + void releaseKey(const QPixmapCache::Key &key); + void clear(); QPixmap *object(const QString &key) const; + QPixmap *object(const QPixmapCache::Key &key) const; + + static inline QPixmapCache::KeyData *get(const QPixmapCache::Key &key) + {return key.d;} + + static QPixmapCache::KeyData* getKeyData(QPixmapCache::Key *key); private: - QHash cacheKeys; + int *keyArray; int theid; int ps; + int keyArraySize; + int freeKey; + QHash cacheKeys; bool t; }; + QT_BEGIN_INCLUDE_NAMESPACE #include "qpixmapcache.moc" QT_END_INCLUDE_NAMESPACE +static uint qHash(const QPixmapCache::Key &k) +{ + return qHash(QPMCache::get(k)->key); +} + +QPMCache::QPMCache() + : QObject(0), + QCache(cache_limit * 1024), + keyArray(0), theid(0), ps(0), keyArraySize(0), freeKey(0), t(false) +{ +} +QPMCache::~QPMCache() +{ + free(keyArray); +} + /* - This is supposed to cut the cache size down by about 80-90% in a + This is supposed to cut the cache size down by about 25% in a minute once the application becomes idle, to let any inserted pixmap remain in the cache for some time before it becomes a candidate for cleaning-up, and to not cut down the size of the cache while the @@ -146,23 +209,28 @@ QT_END_INCLUDE_NAMESPACE When the last pixmap has been deleted from the cache, kill the timer so Qt won't keep the CPU from going into sleep mode. */ - void QPMCache::timerEvent(QTimerEvent *) { int mc = maxCost(); bool nt = totalCost() == ps; + QList keys = QCache::keys(); setMaxCost(nt ? totalCost() * 3 / 4 : totalCost() -1); setMaxCost(mc); ps = totalCost(); - QHash::iterator it = cacheKeys.begin(); + QHash::iterator it = cacheKeys.begin(); while (it != cacheKeys.end()) { if (!contains(it.value())) { + releaseKey(it.value()); it = cacheKeys.erase(it); } else { ++it; } } + for (int i = 0; i < keys.size(); ++i) { + if (!contains(keys.at(i))) + releaseKey(keys.at(i)); + } if (!size()) { killTimer(theid); @@ -176,38 +244,154 @@ void QPMCache::timerEvent(QTimerEvent *) QPixmap *QPMCache::object(const QString &key) const { - return QCache::object(cacheKeys.value(key, -1)); + QPixmapCache::Key cacheKey = cacheKeys.value(key); + if (!cacheKey.d || !cacheKey.d->isValid) { + const_cast(this)->cacheKeys.remove(key); + return 0; + } + QPixmap *ptr = QCache::object(cacheKey); + //We didn't find the pixmap in the cache, the key is not valid anymore + if (!ptr) { + const_cast(this)->cacheKeys.remove(key); + const_cast(this)->releaseKey(cacheKey); + } + return ptr; } +QPixmap *QPMCache::object(const QPixmapCache::Key &key) const +{ + Q_ASSERT(key.d->isValid); + QPixmap *ptr = QCache::object(key); + //We didn't find the pixmap in the cache, the key is not valid anymore + if (!ptr) + const_cast(this)->releaseKey(key); + return ptr; +} bool QPMCache::insert(const QString& key, const QPixmap &pixmap, int cost) { - qint64 cacheKey = pixmap.cacheKey(); - if (QCache::object(cacheKey)) { + QPixmapCache::Key cacheKey; + QPixmapCache::Key oldCacheKey = cacheKeys.value(key); + //If for the same key we add already a pixmap we should delete it + if (oldCacheKey.d) { + QCache::remove(oldCacheKey); + cacheKey = oldCacheKey; + } else { + cacheKey = createKey(); + } + + bool success = QCache::insert(cacheKey, new QDetachedPixmap(pixmap), cost); + if (success) { cacheKeys.insert(key, cacheKey); - return true; + if (!theid) { + theid = startTimer(30000); + t = false; + } + } else { + //Insertion failed we released the new allocated key + releaseKey(cacheKey); } - qint64 oldCacheKey = cacheKeys.value(key, -1); - //If for the same key we add already a pixmap we should delete it - if (oldCacheKey != -1) - QCache::remove(oldCacheKey); + return success; +} - bool success = QCache::insert(cacheKey, new QDetachedPixmap(pixmap), cost); +QPixmapCache::Key QPMCache::insert(const QPixmap &pixmap, int cost) +{ + QPixmapCache::Key cacheKey = createKey(); + bool success = QCache::insert(cacheKey, new QDetachedPixmap(pixmap), cost); if (success) { - cacheKeys.insert(key, cacheKey); if (!theid) { theid = startTimer(30000); t = false; } + } else { + //Insertion failed we released the key and return an invalid one + releaseKey(cacheKey); + } + return cacheKey; +} + +bool QPMCache::replace(const QPixmapCache::Key &key, const QPixmap &pixmap, int cost) +{ + Q_ASSERT(key.d->isValid); + //If for the same key we add already a pixmap we should delete it + QCache::remove(key); + + bool success = QCache::insert(key, new QDetachedPixmap(pixmap), cost); + if (success && !theid) { + theid = startTimer(30000); + t = false; } return success; } bool QPMCache::remove(const QString &key) { - qint64 cacheKey = cacheKeys.value(key, -1); + QPixmapCache::Key cacheKey = cacheKeys.value(key); + //The key was not in the cache + if (!cacheKey.d) + return false; cacheKeys.remove(key); - return QCache::remove(cacheKey); + releaseKey(cacheKey); + return QCache::remove(cacheKey); +} + +bool QPMCache::remove(const QPixmapCache::Key &key) +{ + releaseKey(key); + return QCache::remove(key); +} + +void QPMCache::resizeKeyArray(int size) +{ + if (size <= keyArraySize || size == 0) + return; + keyArray = reinterpret_cast(realloc(keyArray, size * sizeof(int))); + for (int i = keyArraySize; i != size; ++i) + keyArray[i] = i + 1; + keyArraySize = size; +} + +QPixmapCache::Key QPMCache::createKey() +{ + if (freeKey == keyArraySize) + resizeKeyArray(keyArraySize ? keyArraySize << 1 : 2); + int id = freeKey; + freeKey = keyArray[id]; + QPixmapCache::Key key; + QPixmapCache::KeyData *d = QPMCache::getKeyData(&key); + d->key = ++id; + return key; +} + +void QPMCache::releaseKey(const QPixmapCache::Key &key) +{ + if (key.d->key > keyArraySize || key.d->key <= 0) + return; + key.d->key--; + keyArray[key.d->key] = freeKey; + freeKey = key.d->key; + key.d->isValid = false; + key.d->key = 0; +} + +void QPMCache::clear() +{ + free(keyArray); + keyArray = 0; + freeKey = 0; + keyArraySize = 0; + //Mark all keys as invalid + QList keys = QCache::keys(); + for (int i = 0; i < keys.size(); ++i) + keys.at(i).d->isValid = false; + QCache::clear(); +} + +QPixmapCache::KeyData* QPMCache::getKeyData(QPixmapCache::Key *key) +{ + if (!key->d) + key->d = new QPixmapCache::KeyData; + return key->d; } Q_GLOBAL_STATIC(QPMCache, pm_cache) @@ -222,7 +406,7 @@ Q_GLOBAL_STATIC(QPMCache, pm_cache) \warning If valid, you should copy the pixmap immediately (this is fast). Subsequent insertions into the cache could cause the pointer to become invalid. For this reason, we recommend you use - find(const QString&, QPixmap&) instead. + bool find(const QString&, QPixmap*) instead. Example: \snippet doc/src/snippets/code/src_gui_image_qpixmapcache.cpp 0 @@ -235,6 +419,17 @@ QPixmap *QPixmapCache::find(const QString &key) /*! + \obsolete + + Use bool find(const QString&, QPixmap*) instead. +*/ + +bool QPixmapCache::find(const QString &key, QPixmap& pixmap) +{ + return find(key, &pixmap); +} + +/*! Looks for a cached pixmap associated with the \a key in the cache. If the pixmap is found, the function sets \a pm to that pixmap and returns true; otherwise it leaves \a pm alone and returns false. @@ -243,14 +438,31 @@ QPixmap *QPixmapCache::find(const QString &key) \snippet doc/src/snippets/code/src_gui_image_qpixmapcache.cpp 1 */ -bool QPixmapCache::find(const QString &key, QPixmap& pm) +bool QPixmapCache::find(const QString &key, QPixmap* pixmap) { QPixmap *ptr = pm_cache()->object(key); - if (ptr) - pm = *ptr; + if (ptr && pixmap) + *pixmap = *ptr; return ptr != 0; } +/*! + Looks for a cached pixmap associated with the \a key in the cache. + If the pixmap is found, the function sets \a pm to that pixmap and + returns true; otherwise it leaves \a pm alone and returns false. If + the pixmap is not found, it means that the \a key is not valid anymore, + so it will be released for the next insertion. +*/ +bool QPixmapCache::find(const Key &key, QPixmap* pixmap) +{ + //The key is not valid anymore, a flush happened before probably + if (!key.d || !key.d->isValid) + return false; + QPixmap *ptr = pm_cache()->object(key); + if (ptr && pixmap) + *pixmap = *ptr; + return ptr != 0; +} /*! Inserts a copy of the pixmap \a pm associated with the \a key into @@ -272,9 +484,43 @@ bool QPixmapCache::find(const QString &key, QPixmap& pm) \sa setCacheLimit() */ -bool QPixmapCache::insert(const QString &key, const QPixmap &pm) +bool QPixmapCache::insert(const QString &key, const QPixmap &pixmap) +{ + return pm_cache()->insert(key, pixmap, pixmap.width() * pixmap.height() * pixmap.depth() / 8); +} + +/*! + Inserts a copy of the pixmap \a pm into + the cache and return you the key. The key is always greater than 0. + If the key is equals 0 then the insertion failed. + + When a pixmap is inserted and the cache is about to exceed its + limit, it removes pixmaps until there is enough room for the + pixmap to be inserted. + + The oldest pixmaps (least recently accessed in the cache) are + deleted when more space is needed. + + \sa setCacheLimit(), replace() +*/ +QPixmapCache::Key QPixmapCache::insert(const QPixmap &pixmap) +{ + return pm_cache()->insert(pixmap, pixmap.width() * pixmap.height() * pixmap.depth() / 8); +} + +/*! + Replace the pixmap associated to the \a key into + the cache. It return true if the pixmap \a pm has been correctly + inserted into the cache false otherwise. + + \sa setCacheLimit(), insert() +*/ +bool QPixmapCache::replace(const Key &key, const QPixmap &pixmap) { - return pm_cache()->insert(key, pm, pm.width() * pm.height() * pm.depth() / 8); + //The key is not valid anymore, a flush happened before probably + if (!key.d || !key.d->isValid) + return false; + return pm_cache()->replace(key, pixmap, pixmap.width() * pixmap.height() * pixmap.depth() / 8); } /*! @@ -314,6 +560,17 @@ void QPixmapCache::remove(const QString &key) pm_cache()->remove(key); } +/*! + Removes the pixmap associated with \a key from the cache and release + the key for a future insertion. +*/ +void QPixmapCache::remove(const Key &key) +{ + //The key is not valid anymore, a flush happened before probably + if (!key.d || !key.d->isValid) + return; + pm_cache()->remove(key); +} /*! Removes all pixmaps from the cache. diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h index 2750a88..ae64310 100644 --- a/src/gui/image/qpixmapcache.h +++ b/src/gui/image/qpixmapcache.h @@ -53,12 +53,35 @@ QT_MODULE(Gui) class Q_GUI_EXPORT QPixmapCache { public: + class KeyData; + class Key + { + public: + Key(); + Key(const Key &other); + ~Key(); + bool operator ==(const Key &key) const; + inline bool operator !=(const Key &key) const + { return !operator==(key); } + Key &operator =(const Key &other); + + private: + KeyData *d; + friend class QPMCache; + friend class QPixmapCache; + }; + static int cacheLimit(); static void setCacheLimit(int); static QPixmap *find(const QString &key); - static bool find(const QString &key, QPixmap&); - static bool insert(const QString &key, const QPixmap&); + static bool find(const QString &key, QPixmap &pixmap); + static bool find(const QString &key, QPixmap *pixmap); + static bool find(const Key &key, QPixmap *pixmap); + static bool insert(const QString &key, const QPixmap &pixmap); + static Key insert(const QPixmap &pixmap); + static bool replace(const Key &key, const QPixmap &pixmap); static void remove(const QString &key); + static void remove(const Key &key); static void clear(); }; diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h new file mode 100644 index 0000000..66b30d2 --- /dev/null +++ b/src/gui/image/qpixmapcache_p.h @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QPIXMAPCACHE_P_H +#define QPIXMAPCACHE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. This header +// file may change from version to version without notice, or even be removed. +// +// We mean it. +// + +#include "qpixmapcache.h" +#include "qpaintengine.h" +#include +#include +#include "qcache.h" + +class QPixmapCache::KeyData +{ +public: + KeyData() : isValid(true), key(0), ref(1) {} + KeyData(const KeyData &other) + : isValid(other.isValid), key(other.key), ref(1) {} + ~KeyData() {} + + bool isValid; + int key; + int ref; +}; + +// XXX: hw: is this a general concept we need to abstract? +class QDetachedPixmap : public QPixmap +{ +public: + QDetachedPixmap(const QPixmap &pix) : QPixmap(pix) + { + if (data && data->classId() == QPixmapData::RasterClass) { + QRasterPixmapData *d = static_cast(data); + if (!d->image.isNull() && d->image.d->paintEngine + && !d->image.d->paintEngine->isActive()) + { + delete d->image.d->paintEngine; + d->image.d->paintEngine = 0; + } + } + } +}; + +#endif // QPIXMAPCACHE_P_H diff --git a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp index 1f515ff..405ac34 100644 --- a/tests/auto/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/auto/qpixmapcache/tst_qpixmapcache.cpp @@ -44,9 +44,7 @@ #include - - - +#include "../../../src/gui/image/qpixmapcache_p.h" //TESTED_CLASS= @@ -68,10 +66,21 @@ private slots: void setCacheLimit(); void find(); void insert(); + void replace(); void remove(); void clear(); + void pixmapKey(); }; +static QPixmapCache::KeyData* getPrivate(QPixmapCache::Key &key) +{ + return (*reinterpret_cast(&key)); +} + +static QPixmapCache::KeyData** getPrivateRef(QPixmapCache::Key &key) +{ + return (reinterpret_cast(&key)); +} static int originalCacheLimit; @@ -119,6 +128,72 @@ void tst_QPixmapCache::setCacheLimit() QVERIFY(QPixmapCache::find("P1") != 0); delete p1; + + //The int part of the API + p1 = new QPixmap(2, 3); + QPixmapCache::Key key = QPixmapCache::insert(*p1); + QVERIFY(QPixmapCache::find(key, p1) != 0); + delete p1; + + QPixmapCache::setCacheLimit(0); + QVERIFY(QPixmapCache::find(key, p1) == 0); + + p1 = new QPixmap(2, 3); + QPixmapCache::setCacheLimit(1000); + QPixmapCache::replace(key, *p1); + QVERIFY(QPixmapCache::find(key, p1) == 0); + + delete p1; + + //Let check if keys are released when the pixmap cache is + //full or has been flushed. + QPixmapCache::clear(); + p1 = new QPixmap(2, 3); + key = QPixmapCache::insert(*p1); + QVERIFY(QPixmapCache::find(key, p1) != 0); + QPixmapCache::setCacheLimit(0); + QVERIFY(QPixmapCache::find(key, p1) == 0); + QPixmapCache::setCacheLimit(1000); + key = QPixmapCache::insert(*p1); + QCOMPARE(getPrivate(key)->isValid, true); + QCOMPARE(getPrivate(key)->key, 1); + + delete p1; + + //Let check if removing old entries doesn't let you get + // wrong pixmaps + QPixmapCache::clear(); + QPixmap p2; + p1 = new QPixmap(2, 3); + key = QPixmapCache::insert(*p1); + QVERIFY(QPixmapCache::find(key, &p2) != 0); + //we flush the cache + QPixmapCache::setCacheLimit(0); + QPixmapCache::setCacheLimit(1000); + QPixmapCache::Key key2 = QPixmapCache::insert(*p1); + QCOMPARE(getPrivate(key2)->key, 2); + QVERIFY(QPixmapCache::find(key, &p2) == 0); + QVERIFY(QPixmapCache::find(key2, &p2) != 0); + QCOMPARE(p2, *p1); + + delete p1; + + //Here we simulate the flushing when the app is idle + /*QPixmapCache::clear(); + QPixmapCache::setCacheLimit(originalCacheLimit); + p1 = new QPixmap(300, 300); + key = QPixmapCache::insert(*p1); + QCOMPARE(getPrivate(key)->key, 1); + key2 = QPixmapCache::insert(*p1); + key2 = QPixmapCache::insert(*p1); + QPixmapCache::Key key3 = QPixmapCache::insert(*p1); + QTest::qWait(32000); + key2 = QPixmapCache::insert(*p1); + QCOMPARE(getPrivate(key2)->key, 1); + //This old key is not valid anymore after the flush + QCOMPARE(getPrivate(key)->isValid, false); + QVERIFY(QPixmapCache::find(key, &p2) == 0); + delete p1;*/ } void tst_QPixmapCache::find() @@ -137,6 +212,28 @@ void tst_QPixmapCache::find() QPixmap *p3 = QPixmapCache::find("P1"); QVERIFY(p3); QCOMPARE(p1, *p3); + + //The int part of the API + QPixmapCache::Key key = QPixmapCache::insert(p1); + + QVERIFY(QPixmapCache::find(key, &p2)); + QCOMPARE(p2.width(), 10); + QCOMPARE(p2.height(), 10); + QCOMPARE(p1, p2); + + QPixmapCache::clear(); + + key = QPixmapCache::insert(p1); + + //The int part of the API + // make sure it doesn't explode + QList keys; + for (int i = 0; i < 40000; ++i) + QPixmapCache::insert(p1); + + //at that time the first key has been erase because no more place in the cache + QVERIFY(QPixmapCache::find(key, &p1) == 0); + QCOMPARE(getPrivate(key)->isValid, false); } void tst_QPixmapCache::insert() @@ -152,18 +249,22 @@ void tst_QPixmapCache::insert() QPixmapCache::insert("0", p1); // ditto - for (int j = 0; j < 20000; ++j) + for (int j = 0; j < 40000; ++j) QPixmapCache::insert(QString::number(j), p1); int num = 0; - for (int k = 0; k < 20000; ++k) { + for (int k = 0; k < 40000; ++k) { if (QPixmapCache::find(QString::number(k))) ++num; } + if (QPixmapCache::find("0")) + ++num; + int estimatedNum = (1024 * QPixmapCache::cacheLimit()) / ((p1.width() * p1.height() * p1.depth()) / 8); - QVERIFY(estimatedNum - 1 <= num <= estimatedNum + 1); + + QVERIFY(num <= estimatedNum); QPixmap p3; QPixmapCache::insert("null", p3); @@ -176,6 +277,50 @@ void tst_QPixmapCache::insert() QPixmapCache::insert("custom", c2); //We have deleted the old pixmap in the cache for the same key QVERIFY(c1.isDetached()); + + //The int part of the API + // make sure it doesn't explode + QList keys; + for (int i = 0; i < 40000; ++i) + keys.append(QPixmapCache::insert(p1)); + + num = 0; + for (int k = 0; k < 40000; ++k) { + if (QPixmapCache::find(keys.at(k), &p2)) + ++num; + } + + estimatedNum = (1024 * QPixmapCache::cacheLimit()) + / ((p1.width() * p1.height() * p1.depth()) / 8); + QVERIFY(num <= estimatedNum); + QPixmapCache::insert(p3); + +} + +void tst_QPixmapCache::replace() +{ + //The int part of the API + QPixmap p1(10, 10); + p1.fill(Qt::red); + + QPixmap p2(10, 10); + p2.fill(Qt::yellow); + + QPixmapCache::Key key = QPixmapCache::insert(p1); + + QPixmap p3; + QVERIFY(QPixmapCache::find(key, &p3) == 1); + + QPixmapCache::replace(key,p2); + + QVERIFY(QPixmapCache::find(key, &p3) == 1); + + QCOMPARE(p3.width(), 10); + QCOMPARE(p3.height(), 10); + QCOMPARE(p3, p2); + + //Broken keys + QCOMPARE(QPixmapCache::replace(QPixmapCache::Key(), p2), false); } void tst_QPixmapCache::remove() @@ -198,6 +343,40 @@ void tst_QPixmapCache::remove() QPixmapCache::remove("green"); QVERIFY(QPixmapCache::find("green") == 0); + + //The int part of the API + QPixmapCache::clear(); + p1.fill(Qt::red); + QPixmapCache::Key key = QPixmapCache::insert(p1); + p1.fill(Qt::yellow); + + QVERIFY(QPixmapCache::find(key, &p2)); + QVERIFY(p1.toImage() != p2.toImage()); + QVERIFY(p1.toImage() == p1.toImage()); // sanity check + + QPixmapCache::remove(key); + QVERIFY(QPixmapCache::find(key, &p1) == 0); + + //Broken key + QPixmapCache::remove(QPixmapCache::Key()); + QVERIFY(QPixmapCache::find(QPixmapCache::Key(), &p1) == 0); + + //Test if keys are release + QPixmapCache::clear(); + key = QPixmapCache::insert(p1); + QCOMPARE(getPrivate(key)->key, 1); + QPixmapCache::remove(key); + key = QPixmapCache::insert(p1); + QCOMPARE(getPrivate(key)->key, 1); + + //We mix both part of the API + QPixmapCache::clear(); + p1.fill(Qt::red); + QPixmapCache::insert("red", p1); + key = QPixmapCache::insert(p1); + QPixmapCache::remove(key); + QVERIFY(QPixmapCache::find(key, &p1) == 0); + QVERIFY(QPixmapCache::find("red") != 0); } void tst_QPixmapCache::clear() @@ -205,12 +384,11 @@ void tst_QPixmapCache::clear() QPixmap p1(10, 10); p1.fill(Qt::red); - for (int i = 0; i < 20000; ++i) { + for (int i = 0; i < 20000; ++i) QVERIFY(QPixmapCache::find("x" + QString::number(i)) == 0); - } - for (int j = 0; j < 20000; ++j) { + + for (int j = 0; j < 20000; ++j) QPixmapCache::insert(QString::number(j), p1); - } int num = 0; for (int k = 0; k < 20000; ++k) { @@ -221,10 +399,68 @@ void tst_QPixmapCache::clear() QPixmapCache::clear(); - for (int k = 0; k < 20000; ++k) { + for (int k = 0; k < 20000; ++k) QVERIFY(QPixmapCache::find(QString::number(k)) == 0); + + //The int part of the API + QPixmap p2(10, 10); + p2.fill(Qt::red); + + QList keys; + for (int k = 0; k < 20000; ++k) + keys.append(QPixmapCache::insert(p2)); + + QPixmapCache::clear(); + + for (int k = 0; k < 20000; ++k) { + QVERIFY(QPixmapCache::find(keys.at(k), &p1) == 0); + QCOMPARE(getPrivate(keys[k])->isValid, false); } } +void tst_QPixmapCache::pixmapKey() +{ + QPixmapCache::Key key; + //Default constructed keys have no d pointer unless + //we use them + QVERIFY(!getPrivate(key)); + //Let's put a d pointer + QPixmapCache::KeyData** keyd = getPrivateRef(key); + *keyd = new QPixmapCache::KeyData; + QCOMPARE(getPrivate(key)->ref, 1); + QPixmapCache::Key key2; + //Let's put a d pointer + QPixmapCache::KeyData** key2d = getPrivateRef(key2); + *key2d = new QPixmapCache::KeyData; + QCOMPARE(getPrivate(key2)->ref, 1); + key = key2; + QCOMPARE(getPrivate(key2)->ref, 2); + QCOMPARE(getPrivate(key)->ref, 2); + QPixmapCache::Key key3; + //Let's put a d pointer + QPixmapCache::KeyData** key3d = getPrivateRef(key3); + *key3d = new QPixmapCache::KeyData; + QPixmapCache::Key key4 = key3; + QCOMPARE(getPrivate(key3)->ref, 2); + QCOMPARE(getPrivate(key4)->ref, 2); + key4 = key; + QCOMPARE(getPrivate(key4)->ref, 3); + QCOMPARE(getPrivate(key3)->ref, 1); + QPixmapCache::Key key5(key3); + QCOMPARE(getPrivate(key3)->ref, 2); + QCOMPARE(getPrivate(key5)->ref, 2); + + //let test default constructed keys + QPixmapCache::Key key6; + QVERIFY(!getPrivate(key6)); + QPixmapCache::Key key7; + QVERIFY(!getPrivate(key7)); + key6 = key7; + QVERIFY(!getPrivate(key6)); + QVERIFY(!getPrivate(key7)); + QPixmapCache::Key key8(key7); + QVERIFY(!getPrivate(key8)); +} + QTEST_MAIN(tst_QPixmapCache) #include "tst_qpixmapcache.moc" diff --git a/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp index a293de4..a06e033 100644 --- a/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/qgraphicsview/tst_qgraphicsview.cpp @@ -705,7 +705,6 @@ public: QGraphicsPixmapItem::paint(painter,option,widget); //We just want to wait, and we don't want to process the event loop with qWait QTest::qSleep(3); - } protected: void advance(int i) diff --git a/tests/benchmarks/qpixmapcache/qpixmapcache.pro b/tests/benchmarks/qpixmapcache/qpixmapcache.pro new file mode 100644 index 0000000..e0d7543 --- /dev/null +++ b/tests/benchmarks/qpixmapcache/qpixmapcache.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +TEMPLATE = app +TARGET = tst_qpixmapcache +TEMPLATE = app +# Input +SOURCES += tst_qpixmapcache.cpp diff --git a/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp new file mode 100644 index 0000000..f3c1134 --- /dev/null +++ b/tests/benchmarks/qpixmapcache/tst_qpixmapcache.cpp @@ -0,0 +1,226 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +//TESTED_FILES= + +class tst_QPixmapCache : public QObject +{ + Q_OBJECT + +public: + tst_QPixmapCache(); + virtual ~tst_QPixmapCache(); + +public slots: + void init(); + void cleanup(); + +private slots: + void insert_data(); + void insert(); + void find_data(); + void find(); + void styleUseCaseComplexKey(); + void styleUseCaseComplexKey_data(); +}; + +tst_QPixmapCache::tst_QPixmapCache() +{ +} + +tst_QPixmapCache::~tst_QPixmapCache() +{ +} + +void tst_QPixmapCache::init() +{ +} + +void tst_QPixmapCache::cleanup() +{ +} + +void tst_QPixmapCache::insert_data() +{ + QTest::addColumn("cacheType"); + QTest::newRow("QPixmapCache") << true; + QTest::newRow("QPixmapCache (int API)") << false; +} + +QList keys; + +void tst_QPixmapCache::insert() +{ + QFETCH(bool, cacheType); + QPixmap p; + if (cacheType) { + QBENCHMARK { + for (int i = 0 ; i <= 10000 ; i++) + { + QString tmp; + tmp.sprintf("my-key-%d", i); + QPixmapCache::insert(tmp, p); + } + } + } else { + QBENCHMARK { + for (int i = 0 ; i <= 10000 ; i++) + keys.append(QPixmapCache::insert(p)); + } + } +} + +void tst_QPixmapCache::find_data() +{ + QTest::addColumn("cacheType"); + QTest::newRow("QPixmapCache") << true; + QTest::newRow("QPixmapCache (int API)") << false; +} + +void tst_QPixmapCache::find() +{ + QFETCH(bool, cacheType); + QPixmap p; + if (cacheType) { + QBENCHMARK { + QString tmp; + for (int i = 0 ; i <= 10000 ; i++) + { + tmp.sprintf("my-key-%d", i); + QPixmapCache::find(tmp, p); + } + } + } else { + QBENCHMARK { + for (int i = 0 ; i <= 10000 ; i++) + QPixmapCache::find(keys.at(i), &p); + } + } + +} + +void tst_QPixmapCache::styleUseCaseComplexKey_data() +{ + QTest::addColumn("cacheType"); + QTest::newRow("QPixmapCache") << true; + QTest::newRow("QPixmapCache (int API)") << false; +} + +struct styleStruct { + QString key; + uint state; + uint direction; + uint complex; + uint palette; + int width; + int height; + bool operator==(const styleStruct &str) const + { + return str.key == key && str.state == state && str.direction == direction + && str.complex == complex && str.palette == palette && str.width == width + && str.height == height; + } +}; + +uint qHash(const styleStruct &myStruct) +{ + return qHash(myStruct.state); +} + +void tst_QPixmapCache::styleUseCaseComplexKey() +{ + QFETCH(bool, cacheType); + QPixmap p; + if (cacheType) { + QBENCHMARK { + for (int i = 0 ; i <= 10000 ; i++) + { + QString tmp; + tmp.sprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200); + QPixmapCache::insert(tmp, p); + } + + for (int i = 0 ; i <= 10000 ; i++) + { + QString tmp; + tmp.sprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200); + QPixmapCache::find(tmp, p); + } + } + } else { + QHash hash; + QBENCHMARK { + for (int i = 0 ; i <= 10000 ; i++) + { + styleStruct myStruct; + myStruct.key = QString("my-progressbar-%1").arg(i); + myStruct.key = 5; + myStruct.key = 4; + myStruct.key = 3; + myStruct.palette = 358; + myStruct.width = 100; + myStruct.key = 200; + QPixmapCache::Key key = QPixmapCache::insert(p); + hash.insert(myStruct, key); + } + for (int i = 0 ; i <= 10000 ; i++) + { + styleStruct myStruct; + myStruct.key = QString("my-progressbar-%1").arg(i); + myStruct.key = 5; + myStruct.key = 4; + myStruct.key = 3; + myStruct.palette = 358; + myStruct.width = 100; + myStruct.key = 200; + QPixmapCache::Key key = hash.value(myStruct); + QPixmapCache::find(key, &p); + } + } + } + +} + + +QTEST_MAIN(tst_QPixmapCache) +#include "tst_qpixmapcache.moc" -- cgit v0.12 From cfcf72970cd58282aff9aac76f421915d287dc09 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 11:27:13 +0200 Subject: Wrote Designer/uic changelog for 4.5.2. --- dist/changes-4.5.2 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index a772bf7..3180b7c 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -78,7 +78,17 @@ Qt for Windows CE - Designer - + * [248769] Fixed a bug affecting the display of keyboard shortcuts in + the detailed view of the action editor. + * [251092] Fixed a bug preventing entering local file names for QUrl-type + properties on Windows. + * [251691] Fixed dynamic re-translation of table headers. + * [252251] Improved readability of the property editor when using the + KDE Obsidian Coast theme. + * [253236] Fixed a regression bug triggered by forms with a size policy + of 'Fixed' on the main cointainer. + * [253278] Made it possible to set QString-type properties using + QDesignerFormWindowCursor::setProperty(). - Linguist - Linguist GUI @@ -95,7 +105,8 @@ Qt for Windows CE - uic - + * [252333] Fixed a regression crash triggered by using icons with + different pixmaps for QIcon states. - uic3 -- cgit v0.12 From dcf8e8a44867377f6f46b85aca862b48d3da5612 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 18 May 2009 13:16:47 +0200 Subject: qdoc: Added back the list count that was lost in translation. --- tools/qdoc3/htmlgenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 295cdab..d7770bb 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2248,7 +2248,8 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section, if (nameAlignment) out() << "
  • "; else - out() << (*p).second << " "; + out() << "
  • "; + out() << (*p).second << " "; if ((*p).second == 1) { out() << section.singularMember; } -- cgit v0.12 From 7008bfe80e0466ed2978b39e7e698bbd52fb690f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 18 May 2009 13:05:14 +0200 Subject: Fixed the SVG parser to handle CSS properties with multiple values. CSS properties with more than 1 value was ignored. E.g. the 'stroke-dasharray' attribute is specified by a comma separates list of numbers. This was previously ignored because the CSS parser split it into a value array. Task-number: 253614 Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 433a3ad..6a897e8 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -1673,10 +1673,19 @@ static void parseCSStoXMLAttrs(const QVector &declarations, const QCss::Declaration &decl = declarations.at(i); if (decl.d->property.isEmpty()) continue; - if (decl.d->values.count() != 1) - continue; QCss::Value val = decl.d->values.first(); - QString valueStr = val.toString(); + QString valueStr; + if (decl.d->values.count() != 1) { + for (int i=0; ivalues.count(); ++i) { + const QString &value = decl.d->values[i].toString(); + if (value.isEmpty()) + valueStr += QLatin1Char(','); + else + valueStr += value; + } + } else { + valueStr = val.toString(); + } if (val.type == QCss::Value::Uri) { valueStr.prepend(QLatin1String("url(")); valueStr.append(QLatin1Char(')')); -- cgit v0.12 From e7653f2d2cef626b1dc9ad07753b99c38b015eac Mon Sep 17 00:00:00 2001 From: jasplin Date: Mon, 18 May 2009 14:20:48 +0200 Subject: Fixed regression introduced by fix for Task 177022. The fix for Task 177022 broke the fix for Task 163334. This commit fixes the regression. Reviewed-by: janarve --- src/gui/dialogs/qwizard.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index 6f2ab0a..2c29ebf 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -1241,8 +1241,10 @@ void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info) #endif QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight); QSize maximumSize; + bool skipMaxSize = false; #if defined(Q_WS_WIN) - if (QSysInfo::WindowsVersion > QSysInfo::WV_Me) // ### See Tasks 164078 and 161660 + if (QSysInfo::WindowsVersion <= QSysInfo::WV_Me) // ### See Tasks 164078 and 161660 + skipMaxSize = true; #endif maximumSize = mainLayout->totalMaximumSize(); if (info.header && headerWidget->maximumWidth() != QWIDGETSIZE_MAX) { @@ -1263,11 +1265,13 @@ void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info) } if (q->maximumWidth() == maximumWidth) { maximumWidth = maximumSize.width(); - q->setMaximumWidth(maximumWidth); + if (!skipMaxSize) + q->setMaximumWidth(maximumWidth); } if (q->maximumHeight() == maximumHeight) { maximumHeight = maximumSize.height(); - q->setMaximumHeight(maximumHeight); + if (!skipMaxSize) + q->setMaximumHeight(maximumHeight); } } -- cgit v0.12 From 6f81986c3e5022fb6a873c6d60bede460bf6a4dd Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 18 May 2009 14:33:03 +0200 Subject: Fix incorrect signal referred to in the docs Fix the documentation to state sortIndicatorChanged() should be used and not sectionClicked() for connecting to the sortByColumn() slot as the sortByColumn() takes two parameters, not one. Reviewed-by: Kavindra Palaraja --- doc/src/model-view-programming.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/model-view-programming.qdoc b/doc/src/model-view-programming.qdoc index bf0c1c8..8874cfa 100644 --- a/doc/src/model-view-programming.qdoc +++ b/doc/src/model-view-programming.qdoc @@ -249,7 +249,7 @@ provide an API that allows you to sort your model data programmatically. In addition, you can enable interactive sorting (i.e. allowing the users to sort the data by clicking the view's - headers), by connecting the QHeaderView::sectionClicked() signal + headers), by connecting the QHeaderView::sortIndicatorChanged() signal to the QTableView::sortByColumn() slot or the QTreeView::sortByColumn() slot, respectively. -- cgit v0.12 From 0ff3bb25df3626a8112def75fc3ff048c70ebdb2 Mon Sep 17 00:00:00 2001 From: jasplin Date: Mon, 18 May 2009 14:30:09 +0200 Subject: Fixed crash in QWizard running on old Windows systems. When compiling the QWizard on a Windows system where QT_NO_STYLE_WINDOWSVISTA is not set and running the app on an old system that has no Vista support, the app would crash in the paint event of the Vista Back button. In this scenario, the Vista Back button is not needed (i.e. the regular Back button next to the Next button is used), so the fix is simply to avoid instanciating it altogether. Reviewed-by: janarve Task-number: 252662 --- src/gui/dialogs/qwizard.cpp | 4 ++-- src/gui/dialogs/qwizard_win.cpp | 5 ++++- src/gui/dialogs/qwizard_win_p.h | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gui/dialogs/qwizard.cpp b/src/gui/dialogs/qwizard.cpp index 32395c4..298f23f 100644 --- a/src/gui/dialogs/qwizard.cpp +++ b/src/gui/dialogs/qwizard.cpp @@ -1465,7 +1465,7 @@ void QWizardPrivate::handleAeroStyleChange() return; // prevent recursion inHandleAeroStyleChange = true; - vistaHelper->backButton()->disconnect(); + vistaHelper->disconnectBackButton(); q->removeEventFilter(vistaHelper); if (isVistaThemeEnabled()) { @@ -1491,7 +1491,7 @@ void QWizardPrivate::handleAeroStyleChange() q->setMouseTracking(true); // ### original value possibly different q->unsetCursor(); // ### ditto antiFlickerWidget->move(0, 0); - vistaHelper->backButton()->hide(); + vistaHelper->hideBackButton(); vistaHelper->setTitleBarIconAndCaptionVisible(true); } diff --git a/src/gui/dialogs/qwizard_win.cpp b/src/gui/dialogs/qwizard_win.cpp index 64696de..8aad4af 100644 --- a/src/gui/dialogs/qwizard_win.cpp +++ b/src/gui/dialogs/qwizard_win.cpp @@ -239,9 +239,11 @@ void QVistaBackButton::paintEvent(QPaintEvent *) QVistaHelper::QVistaHelper(QWizard *wizard) : pressed(false) , wizard(wizard) + , backButton_(0) { is_vista = resolveSymbols(); - backButton_ = new QVistaBackButton(wizard); + if (is_vista) + backButton_ = new QVistaBackButton(wizard); } QVistaHelper::~QVistaHelper() @@ -310,6 +312,7 @@ void QVistaHelper::drawTitleBar(QPainter *painter) QRect(0, 0, wizard->width(), titleBarSize() + topOffset()), painter->paintEngine()->getDC()); + Q_ASSERT(backButton_); const int btnTop = backButton_->mapToParent(QPoint()).y(); const int btnHeight = backButton_->size().height(); const int verticalCenter = (btnTop + btnHeight / 2); diff --git a/src/gui/dialogs/qwizard_win_p.h b/src/gui/dialogs/qwizard_win_p.h index cbb3b17..148be26 100644 --- a/src/gui/dialogs/qwizard_win_p.h +++ b/src/gui/dialogs/qwizard_win_p.h @@ -94,6 +94,8 @@ public: void resizeEvent(QResizeEvent *event); void paintEvent(QPaintEvent *event); QVistaBackButton *backButton() const { return backButton_; } + void disconnectBackButton() { if (backButton_) backButton_->disconnect(); } + void hideBackButton() { if (backButton_) backButton_->hide(); } void setWindowPosHack(); QColor basicWindowFrameColor(); enum VistaState { VistaAero, VistaBasic, Classic, Dirty }; -- cgit v0.12 From 6c16cb557205c8cf33bcf0493b3d9436c6f43236 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Mon, 18 May 2009 14:39:14 +0200 Subject: QCalendarWidget::setDateTextFormat() reset the format is the date is invalid According to the documentation, QCalendarWidget::setDateTextFormat() should reset the format if the date is not valid. New tests included for the formating of this widget. Task-number: 252943 Reviewed-by: Olivier --- src/gui/widgets/qcalendarwidget.cpp | 2 +- tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp | 53 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qcalendarwidget.cpp b/src/gui/widgets/qcalendarwidget.cpp index 92c12a5..4436c04 100644 --- a/src/gui/widgets/qcalendarwidget.cpp +++ b/src/gui/widgets/qcalendarwidget.cpp @@ -2791,7 +2791,7 @@ QTextCharFormat QCalendarWidget::dateTextFormat(const QDate &date) const void QCalendarWidget::setDateTextFormat(const QDate &date, const QTextCharFormat &format) { Q_D(QCalendarWidget); - if ( date.isNull() && !format.isValid() ) + if (date.isNull()) d->m_model->m_dateFormats.clear(); else d->m_model->m_dateFormats[date] = format; diff --git a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp index 67a822f..617832b 100644 --- a/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp +++ b/tests/auto/qcalendarwidget/tst_qcalendarwidget.cpp @@ -47,6 +47,8 @@ #include #include #include +#include +#include //TESTED_CLASS= @@ -68,6 +70,11 @@ public slots: private slots: void getSetCheck(); void buttonClickCheck(); + + void setTextFormat(); + void resetTextFormat(); + + void setWeekdayFormat(); }; // Testing get/set functions @@ -215,6 +222,52 @@ void tst_QCalendarWidget::buttonClickCheck() } +void tst_QCalendarWidget::setTextFormat() +{ + QCalendarWidget calendar; + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + const QDate date(1984, 10, 20); + calendar.setDateTextFormat(date, format); + QCOMPARE(calendar.dateTextFormat(date), format); +} + +void tst_QCalendarWidget::resetTextFormat() +{ + QCalendarWidget calendar; + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + const QDate date(1984, 10, 20); + calendar.setDateTextFormat(date, format); + + calendar.setDateTextFormat(QDate(), QTextCharFormat()); + QCOMPARE(calendar.dateTextFormat(date), QTextCharFormat()); +} + +void tst_QCalendarWidget::setWeekdayFormat() +{ + QCalendarWidget calendar; + + QTextCharFormat format; + format.setFontItalic(true); + format.setForeground(Qt::green); + + calendar.setWeekdayTextFormat(Qt::Wednesday, format); + + // check the format of the a given month + for (int i = 1; i <= 31; ++i) { + const QDate date(1984, 10, i); + const Qt::DayOfWeek dayOfWeek = static_cast(date.dayOfWeek()); + if (dayOfWeek == Qt::Wednesday) + QCOMPARE(calendar.weekdayTextFormat(dayOfWeek), format); + else + QVERIFY(calendar.weekdayTextFormat(dayOfWeek) != format); + } +} tst_QCalendarWidget::tst_QCalendarWidget() { -- cgit v0.12 From 3c40b1af35319f1fd1b10c97b954adff3abbe9b0 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 15 May 2009 13:54:44 +0200 Subject: Fix race condition in ~QObject while using QOrderedMutexLocker::relock we might unlock our mutex protecting the 'senders' list for a short moment. Another thread may then modify or remove element on the list. Therefore, we need to recheck the consistency of the list once we did that. Also, we cannot call removeSender because that will remove every connections, making impossible for another object destroyed in the same time to clean up the senders list, so call derefSender instead. Reviewed-by: Brad --- src/corelib/kernel/qobject.cpp | 30 ++++------ src/corelib/kernel/qobject_p.h | 1 - tests/auto/qobjectrace/tst_qobjectrace.cpp | 89 ++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 20 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 05015c0..f1a1eb5 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -345,18 +345,6 @@ void QObjectPrivate::derefSender(QObject *sender, int signal) // Q_ASSERT_X(false, "QObjectPrivate::derefSender", "sender not found"); } -void QObjectPrivate::removeSender(QObject *sender, int signal) -{ - for (int i = 0; i < senders.count(); ++i) { - Sender &s = senders[i]; - if (s.sender == sender && s.signal == signal) { - senders.removeAt(i); - return; - } - } - // Q_ASSERT_X(false, "QObjectPrivate::removeSender", "sender not found"); -} - QObjectPrivate::Sender *QObjectPrivate::setCurrentSender(QObject *receiver, Sender *sender) { @@ -790,7 +778,7 @@ QObject::~QObject() bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); c = &connectionList[i]; if (c->receiver) - c->receiver->d_func()->removeSender(this, signal); + c->receiver->d_func()->derefSender(this, signal); if (needToUnlock) m->unlock(); @@ -811,18 +799,22 @@ QObject::~QObject() } // disconnect all senders - for (int i = 0; i < d->senders.count(); ++i) { + for (int i = 0; i < d->senders.count(); ) { QObjectPrivate::Sender *s = &d->senders[i]; - if (!s->sender) - continue; QMutex *m = &s->sender->d_func()->threadData->mutex; bool needToUnlock = QOrderedMutexLocker::relock(locker.mutex(), m); - s = &d->senders[i]; - if (s->sender) - s->sender->d_func()->removeReceiver(s->signal, this); + if (m < locker.mutex()) { + if (i >= d->senders.count() || s != &d->senders[i]) { + if (needToUnlock) + m->unlock(); + continue; + } + } + s->sender->d_func()->removeReceiver(s->signal, this); if (needToUnlock) m->unlock(); + ++i; } d->senders.clear(); diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index b324334..0eed938 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -163,7 +163,6 @@ public: QList senders; void refSender(QObject *sender, int signal); void derefSender(QObject *sender, int signal); - void removeSender(QObject *sender, int signal); static Sender *setCurrentSender(QObject *receiver, Sender *sender); diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index 0c88f29..fcfd528 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -50,6 +50,7 @@ class tst_QObjectRace: public QObject Q_OBJECT private slots: void moveToThreadRace(); + void destroyRace(); }; class RaceObject : public QObject @@ -147,5 +148,93 @@ void tst_QObjectRace::moveToThreadRace() delete object; } + +class MyObject : public QObject +{ Q_OBJECT + public slots: + void slot1() { emit signal1(); } + void slot2() { emit signal2(); } + void slot3() { emit signal3(); } + void slot4() { emit signal4(); } + void slot5() { emit signal5(); } + void slot6() { emit signal6(); } + void slot7() { emit signal7(); } + signals: + void signal1(); + void signal2(); + void signal3(); + void signal4(); + void signal5(); + void signal6(); + void signal7(); +}; + + + +class DestroyThread : public QThread +{ + Q_OBJECT + QObject **objects; + int number; + +public: + void setObjects(QObject **o, int n) + { + objects = o; + number = n; + for(int i = 0; i < number; i++) + objects[i]->moveToThread(this); + } + + void run() { + for(int i = 0; i < number; i++) + delete objects[i]; + } +}; + +void tst_QObjectRace::destroyRace() +{ + enum { ThreadCount = 10, ObjectCountPerThread = 733, + ObjectCount = ThreadCount * ObjectCountPerThread }; + + const char *_slots[] = { SLOT(slot1()) , SLOT(slot2()) , SLOT(slot3()), + SLOT(slot4()) , SLOT(slot5()) , SLOT(slot6()), + SLOT(slot7()) }; + + const char *_signals[] = { SIGNAL(signal1()), SIGNAL(signal2()), SIGNAL(signal3()), + SIGNAL(signal4()), SIGNAL(signal5()), SIGNAL(signal6()), + SIGNAL(signal7()) }; + + QObject *objects[ObjectCount]; + for (int i = 0; i < ObjectCount; ++i) + objects[i] = new MyObject; + + + for (int i = 0; i < ObjectCount * 11; ++i) { + connect(objects[(i*13) % ObjectCount], _signals[(2*i)%7], + objects[((i+2)*17) % ObjectCount], _slots[(3*i+2)%7] ); + connect(objects[((i+6)*23) % ObjectCount], _signals[(5*i+4)%7], + objects[((i+8)*41) % ObjectCount], _slots[(i+6)%7] ); + } + + DestroyThread *threads[ThreadCount]; + for (int i = 0; i < ThreadCount; ++i) { + threads[i] = new DestroyThread; + threads[i]->setObjects(objects + i*ObjectCountPerThread, ObjectCountPerThread); + } + + for (int i = 0; i < ThreadCount; ++i) + threads[i]->start(); + + QVERIFY(threads[0]->wait(TwoMinutes)); + // the other threads should finish pretty quickly now + for (int i = 1; i < ThreadCount; ++i) + QVERIFY(threads[i]->wait(3000)); + + for (int i = 0; i < ThreadCount; ++i) + delete threads[i]; +} + + QTEST_MAIN(tst_QObjectRace) #include "tst_qobjectrace.moc" -- cgit v0.12 From e8ac2b958d92319da7c725f0c30f8ba5fe06497b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 18 May 2009 14:59:14 +0200 Subject: QCss: font-family handle fallback font specs if one specify more than one parameter in font-family, e.g., font-family: Verdana, Arial Qt should fallback on the second font if the first cannot be found. QFont::setFamily handle the case when the family name contains a comas, so we do not need to handle that specially in the css parser code. Task-number: 252311 Reviewed-by: Thomas Zander --- doc/src/stylesheet.qdoc | 4 ---- src/gui/text/qcssparser.cpp | 19 ++++++++++++------- tests/auto/qcssparser/tst_cssparser.cpp | 13 +++++++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/doc/src/stylesheet.qdoc b/doc/src/stylesheet.qdoc index c0d13da..f895918 100644 --- a/doc/src/stylesheet.qdoc +++ b/doc/src/stylesheet.qdoc @@ -1872,10 +1872,6 @@ \snippet doc/src/snippets/code/doc_src_stylesheet.qdoc 54 - \note If you specify more than one parameter in \c font-family, - e.g., \c{font-family: Verdana, Arial}, Qt will only use the first - font. If it cannot be found, Qt uses the system fallbacks instead. - \row \o \c font-size \o \l{#Font Size}{Font Size} diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 8214e54..38621c1 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -1161,13 +1161,20 @@ static bool setFontWeightFromValue(const Value &value, QFont *font) return true; } -static bool setFontFamilyFromValues(const QVector &values, QFont *font) +/** \internal + * parse the font family from the values (starting from index \a start) + * and set it the \a font + * \returns true if a family was extracted. + */ +static bool setFontFamilyFromValues(const QVector &values, QFont *font, int start = 0) { QString family; - for (int i = 0; i < values.count(); ++i) { + for (int i = start; i < values.count(); ++i) { const Value &v = values.at(i); - if (v.type == Value::TermOperatorComma) - break; + if (v.type == Value::TermOperatorComma) { + family += QLatin1Char(','); + continue; + } const QString str = v.variant.toString(); if (str.isEmpty()) break; @@ -1221,9 +1228,7 @@ static void parseShorthandFontProperty(const QVector &values, QFont *font } if (i < values.count()) { - QString fam = values.at(i).variant.toString(); - if (!fam.isEmpty()) - font->setFamily(fam); + setFontFamilyFromValues(values, font, i); } } diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp index ab6bad6..7c4fac1 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_cssparser.cpp @@ -123,7 +123,7 @@ static void debug(const QVector &symbols, int index = -1) qDebug() << "failure at index" << index; } -static void debug(const QCss::Parser &p) { debug(p.symbols); } +//static void debug(const QCss::Parser &p) { debug(p.symbols); } void tst_CssParser::scanner() { @@ -1473,7 +1473,12 @@ void tst_CssParser::extractFontFamily_data() QTest::newRow("quoted-family-name") << "font-family: 'Times New Roman'" << QString("Times New Roman"); QTest::newRow("unquoted-family-name") << "font-family: Times New Roman" << QString("Times New Roman"); QTest::newRow("unquoted-family-name2") << "font-family: Times New Roman" << QString("Times New Roman"); - QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman"); + QTest::newRow("multiple") << "font-family: Times New Roman , foobar, 'baz'" << QString("Times New Roman"); + QTest::newRow("multiple2") << "font-family: invalid, Times New Roman " << QString("Times New Roman"); + QTest::newRow("invalid") << "font-family: invalid" << QFont().family(); + QTest::newRow("shorthand") << "font: 12pt Times New Roman" << QString("Times New Roman"); + QTest::newRow("shorthand multiple quote") << "font: 12pt invalid, \"Times New Roman\" " << QString("Times New Roman"); + QTest::newRow("shorthand multiple") << "font: 12pt invalid, Times New Roman " << QString("Times New Roman"); } void tst_CssParser::extractFontFamily() @@ -1497,8 +1502,8 @@ void tst_CssParser::extractFontFamily() int adjustment = 0; QFont fnt; extractor.extractFont(&fnt, &adjustment); - - QTEST(fnt.family(), "expectedFamily"); + QFontInfo info(fnt); + QTEST(info.family(), "expectedFamily"); } void tst_CssParser::extractBorder_data() -- cgit v0.12 From 5c25207628fbcc94e92b129ac7660af14613ad85 Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Mon, 18 May 2009 15:00:59 +0200 Subject: Adding change details in to Qt 3 to Qt 4 porting guide Adding details about QCloseEvents being acceptet by default in Qt 4 opposed to Qt 3 Task-number: 192607 Rev-by: msorvig --- doc/src/porting4-overview.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/src/porting4-overview.qdoc b/doc/src/porting4-overview.qdoc index b0146a6..462f849 100644 --- a/doc/src/porting4-overview.qdoc +++ b/doc/src/porting4-overview.qdoc @@ -364,4 +364,10 @@ In Qt 4.2 and later, \l{Qt Style Sheets} can be used to implement many common modifications to existing styles, and this may be sufficient for Qt 3 applications. + + \section2 Events + In Qt 3, QCloseEvents were not accepted by default. In Qt 4, + the event handler QWidget::closeEvent() receives QCloseEvents, + and accepts them by default closing the application. To avoid + this, please reimplement QWidget::closeEvent(). */ -- cgit v0.12 From 020b02a16aa69fad173a3b32ec98f05e9a33034d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 14 May 2009 16:34:52 +0200 Subject: Fixed: No margin between the text and the shortcut in menu with stylesheet If padding, margin border are set on an menu item with stylesheet, no space appeared between the text and the shortcut. Fix that by adding the 12px space, same as in QCommonStyle equivalent function Note that this patch also remove unused code, since the variable with and height were not used. example to reproduce the bug: the following stylesheet on a mainwindow that contains a menu with one action with a shortcut QMenu::item { border: 1px solid red; } Task-number: 252610 Reveiwed-by: jbache --- src/gui/styles/qstylesheetstyle.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index cd44bfd..fdd51c3 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -4806,13 +4806,10 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op if ((pe == PseudoElement_MenuSeparator) && subRule.hasContentsSize()) { return QSize(sz.width(), subRule.size().height()); } else if ((pe == PseudoElement_Item) && (subRule.hasBox() || subRule.hasBorder())) { - int width = csz.width(), height = qMax(csz.height(), mi->fontMetrics.height()); - if (!mi->icon.isNull()) { - int iconExtent = pixelMetric(PM_SmallIconSize); - height = qMax(height, mi->icon.actualSize(QSize(iconExtent, iconExtent)).height()); - } - width += mi->tabWidth; - return subRule.boxSize(csz.expandedTo(subRule.minimumContentsSize())); + int width = csz.width(); + if (mi->text.contains(QLatin1Char('\t'))) + width += 12; //as in QCommonStyle + return subRule.boxSize(subRule.adjustSize(QSize(width, csz.height()))); } } break; -- cgit v0.12 From a07385de15636e41de51d5d9df1faeb0c76a5537 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 11 May 2009 16:59:29 +0200 Subject: Fix warning on QVector with gcc4.4 Use QVectorData whenever possible instead of QVectorTypedData. It is not safe to convert the shared_null to QVectorTypedData as different instance of qvector with different type may cast it in the same function (because everything is inline) and that would break strict aliasing. Reviewed-by: Thiago Reviewed-by: Brad --- src/corelib/tools/qvector.h | 154 ++++++++++++++++++++++---------------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 1f047b8..8aa61ff 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -104,14 +104,14 @@ template class QVector { typedef QVectorTypedData Data; - union { QVectorData *p; QVectorTypedData *d; }; + union { QVectorData *d; Data *p; }; public: - inline QVector() : p(&QVectorData::shared_null) { d->ref.ref(); } + inline QVector() : d(&QVectorData::shared_null) { d->ref.ref(); } explicit QVector(int size); QVector(int size, const T &t); inline QVector(const QVector &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); } - inline ~QVector() { if (!d) return; if (!d->ref.deref()) free(d); } + inline ~QVector() { if (!d) return; if (!d->ref.deref()) free(p); } QVector &operator=(const QVector &v); bool operator==(const QVector &v) const; inline bool operator!=(const QVector &v) const { return !(*this == v); } @@ -130,9 +130,9 @@ public: inline bool isDetached() const { return d->ref == 1; } inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; } - inline T *data() { detach(); return d->array; } - inline const T *data() const { return d->array; } - inline const T *constData() const { return d->array; } + inline T *data() { detach(); return p->array; } + inline const T *data() const { return p->array; } + inline const T *constData() const { return p->array; } void clear(); const T &at(int i) const; @@ -225,12 +225,12 @@ public: typedef T* iterator; typedef const T* const_iterator; #endif - inline iterator begin() { detach(); return d->array; } - inline const_iterator begin() const { return d->array; } - inline const_iterator constBegin() const { return d->array; } - inline iterator end() { detach(); return d->array + d->size; } - inline const_iterator end() const { return d->array + d->size; } - inline const_iterator constEnd() const { return d->array + d->size; } + inline iterator begin() { detach(); return p->array; } + inline const_iterator begin() const { return p->array; } + inline const_iterator constBegin() const { return p->array; } + inline iterator end() { detach(); return p->array + d->size; } + inline const_iterator end() const { return p->array + d->size; } + inline const_iterator constEnd() const { return p->array + d->size; } iterator insert(iterator before, int n, const T &x); inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); } iterator erase(iterator begin, iterator end); @@ -327,11 +327,11 @@ inline void QVector::clear() template inline const T &QVector::at(int i) const { Q_ASSERT_X(i >= 0 && i < d->size, "QVector::at", "index out of range"); - return d->array[i]; } + return p->array[i]; } template inline const T &QVector::operator[](int i) const { Q_ASSERT_X(i >= 0 && i < d->size, "QVector::operator[]", "index out of range"); - return d->array[i]; } + return p->array[i]; } template inline T &QVector::operator[](int i) { Q_ASSERT_X(i >= 0 && i < d->size, "QVector::operator[]", "index out of range"); @@ -369,7 +369,7 @@ QVector &QVector::operator=(const QVector &v) { v.d->ref.ref(); if (!d->ref.deref()) - free(d); + free(p); d = v.d; if (!d->sharable) detach_helper(); @@ -385,31 +385,31 @@ inline QVectorData *QVector::malloc(int aalloc) template QVector::QVector(int asize) { - p = malloc(asize); + d = malloc(asize); d->ref = 1; d->alloc = d->size = asize; d->sharable = true; d->capacity = false; if (QTypeInfo::isComplex) { - T* b = d->array; - T* i = d->array + d->size; + T* b = p->array; + T* i = p->array + d->size; while (i != b) new (--i) T; } else { - qMemSet(d->array, 0, asize * sizeof(T)); + qMemSet(p->array, 0, asize * sizeof(T)); } } template QVector::QVector(int asize, const T &t) { - p = malloc(asize); + d = malloc(asize); d->ref = 1; d->alloc = d->size = asize; d->sharable = true; d->capacity = false; - T* i = d->array + d->size; - while (i != d->array) + T* i = p->array + d->size; + while (i != p->array) new (--i) T(t); } @@ -418,7 +418,7 @@ void QVector::free(Data *x) { if (QTypeInfo::isComplex) { T* b = x->array; - T* i = b + x->size; + T* i = b + reinterpret_cast(x)->size; while (i-- != b) i->~T(); } @@ -429,13 +429,13 @@ template void QVector::realloc(int asize, int aalloc) { T *j, *i, *b; - union { QVectorData *p; Data *d; } x; + union { QVectorData *d; Data *p; } x; x.d = d; if (QTypeInfo::isComplex && aalloc == d->alloc && d->ref == 1) { // pure resize - i = d->array + d->size; - j = d->array + asize; + i = p->array + d->size; + j = p->array + asize; if (i > j) { while (i-- != j) i->~T(); @@ -450,22 +450,22 @@ void QVector::realloc(int asize, int aalloc) if (aalloc != d->alloc || d->ref != 1) { // (re)allocate memory if (QTypeInfo::isStatic) { - x.p = malloc(aalloc); + x.d = malloc(aalloc); } else if (d->ref != 1) { - x.p = QVectorData::malloc(sizeOfTypedData(), aalloc, sizeof(T), p); + x.d = QVectorData::malloc(sizeOfTypedData(), aalloc, sizeof(T), d); } else { if (QTypeInfo::isComplex) { // call the destructor on all objects that need to be // destroyed when shrinking if (asize < d->size) { - j = d->array + asize; - i = d->array + d->size; + j = p->array + asize; + i = p->array + d->size; while (i-- != j) i->~T(); - i = d->array + asize; + i = p->array + asize; } } - x.p = p = static_cast(qRealloc(p, sizeOfTypedData() + (aalloc - 1) * sizeof(T))); + x.d = d = static_cast(qRealloc(d, sizeOfTypedData() + (aalloc - 1) * sizeof(T))); } x.d->ref = 1; x.d->sharable = true; @@ -474,31 +474,31 @@ void QVector::realloc(int asize, int aalloc) } if (QTypeInfo::isComplex) { if (asize < d->size) { - j = d->array + asize; - i = x.d->array + asize; + j = p->array + asize; + i = x.p->array + asize; } else { // construct all new objects when growing - i = x.d->array + asize; - j = x.d->array + d->size; + i = x.p->array + asize; + j = x.p->array + d->size; while (i != j) new (--i) T; - j = d->array + d->size; + j = p->array + d->size; } if (i != j) { // copy objects from the old array into the new array - b = x.d->array; + b = x.p->array; while (i != b) new (--i) T(*--j); } } else if (asize > d->size) { // initialize newly allocated memory to 0 - qMemSet(x.d->array + d->size, 0, (asize - d->size) * sizeof(T)); + qMemSet(x.p->array + d->size, 0, (asize - d->size) * sizeof(T)); } x.d->size = asize; x.d->alloc = aalloc; if (d != x.d) { if (!d->ref.deref()) - free(d); + free(p); d = x.d; } } @@ -506,15 +506,15 @@ void QVector::realloc(int asize, int aalloc) template Q_OUTOFLINE_TEMPLATE T QVector::value(int i) const { - if (i < 0 || i >= p->size) { + if (i < 0 || i >= d->size) { return T(); } - return d->array[i]; + return p->array[i]; } template Q_OUTOFLINE_TEMPLATE T QVector::value(int i, const T &defaultValue) const { - return ((i < 0 || i >= p->size) ? defaultValue : d->array[i]); + return ((i < 0 || i >= d->size) ? defaultValue : p->array[i]); } template @@ -525,14 +525,14 @@ void QVector::append(const T &t) realloc(d->size, QVectorData::grow(sizeOfTypedData(), d->size + 1, sizeof(T), QTypeInfo::isStatic)); if (QTypeInfo::isComplex) - new (d->array + d->size) T(copy); + new (p->array + d->size) T(copy); else - d->array[d->size] = copy; + p->array[d->size] = copy; } else { if (QTypeInfo::isComplex) - new (d->array + d->size) T(t); + new (p->array + d->size) T(t); else - d->array[d->size] = t; + p->array[d->size] = t; } ++d->size; } @@ -540,27 +540,27 @@ void QVector::append(const T &t) template Q_TYPENAME QVector::iterator QVector::insert(iterator before, size_type n, const T &t) { - int offset = before - d->array; + int offset = before - p->array; if (n != 0) { const T copy(t); if (d->ref != 1 || d->size + n > d->alloc) realloc(d->size, QVectorData::grow(sizeOfTypedData(), d->size + n, sizeof(T), QTypeInfo::isStatic)); if (QTypeInfo::isStatic) { - T *b = d->array + d->size; - T *i = d->array + d->size + n; + T *b = p->array + d->size; + T *i = p->array + d->size + n; while (i != b) new (--i) T; - i = d->array + d->size; + i = p->array + d->size; T *j = i + n; - b = d->array + offset; + b = p->array + offset; while (i != b) *--j = *--i; i = b+n; while (i != b) *--i = copy; } else { - T *b = d->array + offset; + T *b = p->array + offset; T *i = b + n; memmove(i, b, (d->size - offset) * sizeof(T)); while (i != b) @@ -568,29 +568,29 @@ Q_TYPENAME QVector::iterator QVector::insert(iterator before, size_type n, } d->size += n; } - return d->array + offset; + return p->array + offset; } template Q_TYPENAME QVector::iterator QVector::erase(iterator abegin, iterator aend) { - int f = abegin - d->array; - int l = aend - d->array; + int f = abegin - p->array; + int l = aend - p->array; int n = l - f; detach(); if (QTypeInfo::isComplex) { - qCopy(d->array+l, d->array+d->size, d->array+f); - T *i = d->array+d->size; - T* b = d->array+d->size-n; + qCopy(p->array+l, p->array+d->size, p->array+f); + T *i = p->array+d->size; + T* b = p->array+d->size-n; while (i != b) { --i; i->~T(); } } else { - memmove(d->array + f, d->array + l, (d->size-l)*sizeof(T)); + memmove(p->array + f, p->array + l, (d->size-l)*sizeof(T)); } d->size -= n; - return d->array + f; + return p->array + f; } template @@ -600,9 +600,9 @@ bool QVector::operator==(const QVector &v) const return false; if (d == v.d) return true; - T* b = d->array; + T* b = p->array; T* i = b + d->size; - T* j = v.d->array + d->size; + T* j = v.p->array + d->size; while (i != b) if (!(*--i == *--j)) return false; @@ -615,8 +615,8 @@ QVector &QVector::fill(const T &from, int asize) const T copy(from); resize(asize < 0 ? d->size : asize); if (d->size) { - T *i = d->array + d->size; - T *b = d->array; + T *i = p->array + d->size; + T *b = p->array; while (i != b) *--i = copy; } @@ -629,9 +629,9 @@ QVector &QVector::operator+=(const QVector &l) int newSize = d->size + l.d->size; realloc(d->size, newSize); - T *w = d->array + newSize; - T *i = l.d->array + l.d->size; - T *b = l.d->array; + T *w = p->array + newSize; + T *i = l.p->array + l.d->size; + T *b = l.p->array; while (i != b) { if (QTypeInfo::isComplex) new (--w) T(*--i); @@ -648,11 +648,11 @@ int QVector::indexOf(const T &t, int from) const if (from < 0) from = qMax(from + d->size, 0); if (from < d->size) { - T* n = d->array + from - 1; - T* e = d->array + d->size; + T* n = p->array + from - 1; + T* e = p->array + d->size; while (++n != e) if (*n == t) - return n - d->array; + return n - p->array; } return -1; } @@ -665,8 +665,8 @@ int QVector::lastIndexOf(const T &t, int from) const else if (from >= d->size) from = d->size-1; if (from >= 0) { - T* b = d->array; - T* n = d->array + from + 1; + T* b = p->array; + T* n = p->array + from + 1; while (n != b) { if (*--n == t) return n - b; @@ -678,8 +678,8 @@ int QVector::lastIndexOf(const T &t, int from) const template bool QVector::contains(const T &t) const { - T* b = d->array; - T* i = d->array + d->size; + T* b = p->array; + T* i = p->array + d->size; while (i != b) if (*--i == t) return true; @@ -690,8 +690,8 @@ template int QVector::count(const T &t) const { int c = 0; - T* b = d->array; - T* i = d->array + d->size; + T* b = p->array; + T* i = p->array + d->size; while (i != b) if (*--i == t) ++c; -- cgit v0.12 From 343e848abc19f15a30e73f53117a0c001b081e7f Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 14 May 2009 16:50:17 +0200 Subject: Make QVectorTypedData inheriting from QVectorData This way the content of QVectorData is not duplicated in the code. Reviewed-by: Thiago Reviewed-by: Brad --- src/corelib/tools/qvector.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 8aa61ff..7bdcba0 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -82,19 +82,9 @@ struct Q_CORE_EXPORT QVectorData }; template -struct QVectorTypedData -{ - QBasicAtomicInt ref; - int alloc; - int size; -#if defined(QT_ARCH_SPARC) && defined(Q_CC_GNU) && defined(__LP64__) && defined(QT_BOOTSTRAPPED) - // workaround for bug in gcc 3.4.2 - uint sharable; - uint capacity; -#else - uint sharable : 1; - uint capacity : 1; -#endif +struct QVectorTypedData : private QVectorData +{ // private inheritance as we must not access QVectorData member thought QVectorTypedData + // as this would break strict aliasing rules. (in the case of shared_null) T array[1]; }; -- cgit v0.12 From 7e4d4474d10cb17047d95e3a4820388468c74507 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 18 May 2009 11:22:05 +0200 Subject: Fix compilation of the cssparser test the Q_GUI_EXPORT macro have been removed, but we still need to export the classes for the test --- src/gui/text/qcssparser_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h index fbd6c16..72bd637 100644 --- a/src/gui/text/qcssparser_p.h +++ b/src/gui/text/qcssparser_p.h @@ -403,7 +403,7 @@ struct BorderData { // 4. QVector - { prop1: value1; prop2: value2; } // 5. Declaration - prop1: value1; -struct Declaration +struct Q_AUTOTEST_EXPORT Declaration { struct DeclarationData : public QSharedData { @@ -539,7 +539,7 @@ struct BasicSelector Relation relationToNext; }; -struct Selector +struct Q_AUTOTEST_EXPORT Selector { QVector basicSelectors; int specificity() const; @@ -552,7 +552,7 @@ struct MediaRule; struct PageRule; struct ImportRule; -struct ValueExtractor +struct Q_AUTOTEST_EXPORT ValueExtractor { ValueExtractor(const QVector &declarations, const QPalette & = QPalette()); -- cgit v0.12 From ef310a8cf2067a2fe21d6812cf34fb8aaad74f48 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Mon, 18 May 2009 15:40:51 +0200 Subject: Prevent a crash with brushed metal windows and a qApp style sheet My great metal hack simply needs to hack more and not do the "extra" assign since I'm doing this through a back door in set attribute. We probably should have had the brushed metal go via an actual QStyle subclass instead of through the attribute. Task-number: 253448 Reviewed-by: ogoffart --- src/gui/kernel/qwidget.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index d911b48..4cb9380 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -2343,13 +2343,26 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool ) { Q_Q(QWidget); - createExtra(); - QStyle *oldStyle = q->style(); #ifndef QT_NO_STYLE_STYLESHEET - QStyle *origStyle = extra->style; + QStyle *origStyle = 0; +#endif + +#ifdef Q_WS_MAC + // the metalhack boolean allows Qt/Mac to do a proper re-polish depending + // on how the Qt::WA_MacBrushedMetal attribute is set. It is only ever + // set when changing that attribute and passes the widget's CURRENT style. + // therefore no need to do a reassignment. + if (!metalHack) #endif - extra->style = newStyle; + { + createExtra(); + +#ifndef QT_NO_STYLE_STYLESHEET + origStyle = extra->style; +#endif + extra->style = newStyle; + } // repolish if (q->windowType() != Qt::Desktop) { -- cgit v0.12 From e5755e131952ab5c3c8dd0fd6a88dbaa7148898a Mon Sep 17 00:00:00 2001 From: Benjamin C Meyer Date: Wed, 29 Apr 2009 11:15:25 -0400 Subject: Fix QNetworkDiskCache to expire the oldest files first. When expiring cache files use a QMultiMap, when using a QMap not all files are put into the map because often many files (downloaded or updated at the same time) will have the same creation QDateTime and so only one will go into the QMap who's key is QDateTime. Reviewed-By: Thiago Macieira Reviewed-By: Peter Hartmann --- src/network/access/qnetworkdiskcache.cpp | 6 +++--- tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 892929e..44a8298 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -494,21 +494,21 @@ qint64 QNetworkDiskCache::expire() QDir::Filters filters = QDir::AllDirs | QDir:: Files | QDir::NoDotAndDotDot; QDirIterator it(cacheDirectory(), filters, QDirIterator::Subdirectories); - QMap cacheItems; + QMultiMap cacheItems; qint64 totalSize = 0; while (it.hasNext()) { QString path = it.next(); QFileInfo info = it.fileInfo(); QString fileName = info.fileName(); if (fileName.endsWith(CACHE_POSTFIX) && fileName.startsWith(CACHE_PREFIX)) { - cacheItems[info.created()] = path; + cacheItems.insert(info.created(), path); totalSize += info.size(); } } int removedFiles = 0; qint64 goal = (maximumCacheSize() * 9) / 10; - QMap::const_iterator i = cacheItems.constBegin(); + QMultiMap::const_iterator i = cacheItems.constBegin(); while (i != cacheItems.constEnd()) { if (totalSize < goal) break; diff --git a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp index fc15437..2383767 100644 --- a/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp +++ b/tests/auto/qnetworkdiskcache/tst_qnetworkdiskcache.cpp @@ -389,7 +389,8 @@ void tst_QNetworkDiskCache::expire() qint64 max = cache.maximumCacheSize(); QCOMPARE(max, limit); for (int i = 0; i < 10; ++i) { - QTest::qWait(2000); + if (i % 3 == 0) + QTest::qWait(2000); QNetworkCacheMetaData m; m.setUrl(QUrl("http://www.foo.com/" + QString::number(i))); QIODevice *d = cache.prepare(m); -- cgit v0.12 From d13162dd4695274dc4bdb286ce85bf198391d94b Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Mon, 11 May 2009 15:55:59 +0200 Subject: Fix some typos in the documentation. Usually, "the the" is not proper English Reviewed-By: Thiago Macieira --- doc/src/accessible.qdoc | 2 +- doc/src/deployment.qdoc | 2 +- doc/src/examples/codeeditor.qdoc | 2 +- doc/src/examples/containerextension.qdoc | 2 +- doc/src/examples/fortuneserver.qdoc | 2 +- doc/src/examples/ftp.qdoc | 4 ++-- doc/src/examples/icons.qdoc | 2 +- doc/src/examples/musicplayerexample.qdoc | 2 +- doc/src/examples/qobjectxmlmodel.qdoc | 2 +- doc/src/examples/tabdialog.qdoc | 2 +- doc/src/examples/tooltips.qdoc | 2 +- doc/src/examples/transformations.qdoc | 2 +- doc/src/examples/trollprint.qdoc | 2 +- doc/src/licenses.qdoc | 2 +- doc/src/mac-differences.qdoc | 2 +- doc/src/phonon-api.qdoc | 2 +- doc/src/q3valuelist.qdoc | 2 +- doc/src/qalgorithms.qdoc | 2 +- doc/src/qtdesigner.qdoc | 2 +- doc/src/qtscriptdebugger-manual.qdoc | 2 +- doc/src/stylesheet.qdoc | 8 ++++---- doc/src/tech-preview/known-issues.html | 2 +- doc/src/timers.qdoc | 4 ++-- doc/src/xquery-introduction.qdoc | 2 +- src/corelib/io/qsettings.cpp | 2 +- src/corelib/kernel/qtimer.cpp | 2 +- src/corelib/tools/qrect.cpp | 2 +- src/corelib/tools/qsize.cpp | 2 +- src/corelib/tools/qstringlist.cpp | 2 +- src/gui/embedded/qscreen_qws.cpp | 2 +- src/gui/graphicsview/qgraphicslayoutitem.cpp | 2 +- src/gui/graphicsview/qgraphicssceneevent.cpp | 14 +++++++------- src/gui/image/qicon.cpp | 2 +- src/gui/image/qimage.cpp | 2 +- src/gui/image/qpixmap.cpp | 2 +- src/gui/itemviews/qabstractitemview.cpp | 2 +- src/gui/itemviews/qlistwidget.cpp | 2 +- src/gui/kernel/qclipboard.cpp | 2 +- src/gui/kernel/qwidget.cpp | 2 +- src/gui/painting/qpainterpath.cpp | 2 +- src/gui/text/qfontdatabase_x11.cpp | 2 +- src/gui/text/qtextformat.cpp | 2 +- src/gui/util/qundostack.cpp | 2 +- src/gui/widgets/qlcdnumber.cpp | 2 +- src/gui/widgets/qlineedit.cpp | 2 +- src/gui/widgets/qmdiarea.cpp | 2 +- src/gui/widgets/qmenubar.cpp | 2 +- src/gui/widgets/qscrollarea.cpp | 2 +- src/gui/widgets/qsplitter.cpp | 2 +- src/gui/widgets/qtabwidget.cpp | 2 +- src/gui/widgets/qtoolbox.cpp | 2 +- src/network/access/qhttp.cpp | 2 +- src/network/kernel/qnetworkinterface.cpp | 2 +- src/network/socket/qabstractsocket.cpp | 2 +- src/opengl/qgl.cpp | 2 +- src/qt3support/network/q3http.cpp | 2 +- src/qt3support/network/q3urloperator.cpp | 2 +- src/qt3support/widgets/q3action.cpp | 2 +- src/qt3support/widgets/q3groupbox.cpp | 4 ++-- src/qt3support/widgets/q3popupmenu.cpp | 2 +- src/qt3support/widgets/q3progressbar.cpp | 2 +- src/qt3support/widgets/q3scrollview.cpp | 2 +- src/sql/kernel/qsqlquery.cpp | 2 +- src/xml/sax/qxml.cpp | 2 +- 64 files changed, 76 insertions(+), 76 deletions(-) diff --git a/doc/src/accessible.qdoc b/doc/src/accessible.qdoc index 090da86..ad9f4f1 100644 --- a/doc/src/accessible.qdoc +++ b/doc/src/accessible.qdoc @@ -527,7 +527,7 @@ on plugins, consult the plugins \l{How to Create Qt Plugins}{overview document}. - You can omit the the first macro unless you want the plugin + You can omit the first macro unless you want the plugin to be statically linked with the application. \section2 Implementing Interface Factories diff --git a/doc/src/deployment.qdoc b/doc/src/deployment.qdoc index bcfa93d..446c91b 100644 --- a/doc/src/deployment.qdoc +++ b/doc/src/deployment.qdoc @@ -1247,7 +1247,7 @@ \snippet doc/src/snippets/code/doc_src_deployment.qdoc 48 Then we update the source code in \c tools/plugandpaint/main.cpp - to look for the the new plugins. After constructing the + to look for the new plugins. After constructing the QApplication, we add the following code: \snippet doc/src/snippets/code/doc_src_deployment.qdoc 49 diff --git a/doc/src/examples/codeeditor.qdoc b/doc/src/examples/codeeditor.qdoc index 669ab45..d218d0d 100644 --- a/doc/src/examples/codeeditor.qdoc +++ b/doc/src/examples/codeeditor.qdoc @@ -67,7 +67,7 @@ QTextEdit because it is optimized for handling plain text. See the QPlainTextEdit class description for details. - QPlainTextEdit lets us add selections in addition to the the + QPlainTextEdit lets us add selections in addition to the selection the user can make with the mouse or keyboard. We use this functionality to highlight the current line. More on this later. diff --git a/doc/src/examples/containerextension.qdoc b/doc/src/examples/containerextension.qdoc index a4fbcea..6d29cf6 100644 --- a/doc/src/examples/containerextension.qdoc +++ b/doc/src/examples/containerextension.qdoc @@ -305,7 +305,7 @@ MultiPageWidget class \l {designer/containerextension/multipagewidget.cpp}{implementation}). Finally, we implicitly force an update of the page's property - sheet by calling the the + sheet by calling the QDesignerPropertySheetExtension::setChanged() function. \snippet examples/designer/containerextension/multipagewidgetplugin.cpp 4 diff --git a/doc/src/examples/fortuneserver.qdoc b/doc/src/examples/fortuneserver.qdoc index e6a7f85..848a3a3 100644 --- a/doc/src/examples/fortuneserver.qdoc +++ b/doc/src/examples/fortuneserver.qdoc @@ -45,7 +45,7 @@ The Fortune Server example shows how to create a server for a simple network service. It is intended to be run alongside the - \l{network/fortuneclient}{Fortune Client} example or the the + \l{network/fortuneclient}{Fortune Client} example or the \l{network/blockingfortuneclient}{Blocking Fortune Client} example. \image fortuneserver-example.png Screenshot of the Fortune Server example diff --git a/doc/src/examples/ftp.qdoc b/doc/src/examples/ftp.qdoc index 9cc9cd1..7a74a37 100644 --- a/doc/src/examples/ftp.qdoc +++ b/doc/src/examples/ftp.qdoc @@ -172,7 +172,7 @@ no entries were found (in which case our \c addToList() function would not have been called). - Let's continue with the the \c addToList() slot: + Let's continue with the \c addToList() slot: \snippet examples/network/ftp/ftpwindow.cpp 10 @@ -190,7 +190,7 @@ \snippet examples/network/ftp/ftpwindow.cpp 12 - \c cdToParent() is invoked when the the user requests to go to the + \c cdToParent() is invoked when the user requests to go to the parent directory of the one displayed in the file list. After changing the directory, we QFtp::List its contents. diff --git a/doc/src/examples/icons.qdoc b/doc/src/examples/icons.qdoc index 750ef2e..a81ddb9 100644 --- a/doc/src/examples/icons.qdoc +++ b/doc/src/examples/icons.qdoc @@ -479,7 +479,7 @@ QTableWidget::openPersistentEditor() function to create comboboxes for the mode and state columns of the items. - Due to the the connection between the table widget's \l + Due to the connection between the table widget's \l {QTableWidget::itemChanged()}{itemChanged()} signal and the \c changeIcon() slot, the new image is automatically converted into a pixmap and made part of the set of pixmaps available to the icon diff --git a/doc/src/examples/musicplayerexample.qdoc b/doc/src/examples/musicplayerexample.qdoc index d23c1f1..9f04bf6 100644 --- a/doc/src/examples/musicplayerexample.qdoc +++ b/doc/src/examples/musicplayerexample.qdoc @@ -154,7 +154,7 @@ \snippet examples/phonon/musicplayer/mainwindow.cpp 5 - We move on to the the slots of \c MainWindow, starting with \c + We move on to the slots of \c MainWindow, starting with \c addFiles(): \snippet examples/phonon/musicplayer/mainwindow.cpp 6 diff --git a/doc/src/examples/qobjectxmlmodel.qdoc b/doc/src/examples/qobjectxmlmodel.qdoc index ce1dab6..37c66bc 100644 --- a/doc/src/examples/qobjectxmlmodel.qdoc +++ b/doc/src/examples/qobjectxmlmodel.qdoc @@ -71,7 +71,7 @@ The query engine can only traverse two dimensional trees, because an XML document is always a two dimensional tree. If we want to add the QMetaObject tree to the node model, we have to somehow flatten it - into the the same plane as the QObject tree. This requires that the + into the same plane as the QObject tree. This requires that the node model class must build an auxiliary data structure and make it part of the two dimensional QObject node model. How to do this is explained in \l{Including The QMetaObject Tree}. diff --git a/doc/src/examples/tabdialog.qdoc b/doc/src/examples/tabdialog.qdoc index c9500af..5394b82 100644 --- a/doc/src/examples/tabdialog.qdoc +++ b/doc/src/examples/tabdialog.qdoc @@ -91,7 +91,7 @@ \snippet examples/dialogs/tabdialog/tabdialog.cpp 1 \snippet examples/dialogs/tabdialog/tabdialog.cpp 3 - We arrange the the tab widget above the buttons in the dialog: + We arrange the tab widget above the buttons in the dialog: \snippet examples/dialogs/tabdialog/tabdialog.cpp 4 diff --git a/doc/src/examples/tooltips.qdoc b/doc/src/examples/tooltips.qdoc index 5daa2b2..78b350b 100644 --- a/doc/src/examples/tooltips.qdoc +++ b/doc/src/examples/tooltips.qdoc @@ -353,7 +353,7 @@ Whenever the user creates a new shape item, we want the new item to appear at a random position, and we use the \c randomItemPosition() function to calculate such a position. We - make sure that the item appears within the the visible area of the + make sure that the item appears within the visible area of the \c SortingBox widget, using the widget's current width and heigth when calculating the random coordinates. diff --git a/doc/src/examples/transformations.qdoc b/doc/src/examples/transformations.qdoc index eabb803..58c8b80 100644 --- a/doc/src/examples/transformations.qdoc +++ b/doc/src/examples/transformations.qdoc @@ -208,7 +208,7 @@ After transforming the coordinate system, we draw the \c RenderArea's shape, and then we restore the painter state using - the the QPainter::restore() function (i.e. popping the saved state off + the QPainter::restore() function (i.e. popping the saved state off the stack). \snippet examples/painting/transformations/renderarea.cpp 7 diff --git a/doc/src/examples/trollprint.qdoc b/doc/src/examples/trollprint.qdoc index 38251ee..489012e 100644 --- a/doc/src/examples/trollprint.qdoc +++ b/doc/src/examples/trollprint.qdoc @@ -142,7 +142,7 @@ We can easily determine which file must be changed because the translator's "context" is in fact the class name for the class where the texts that must be changed appears. In this case the file is \c - printpanel.cpp, where the there are four lines to change. Add the + printpanel.cpp, where there are four lines to change. Add the second argument "two-sided" in the appropriate \c tr() calls to the first pair of radio buttons: diff --git a/doc/src/licenses.qdoc b/doc/src/licenses.qdoc index 1c3f6d2..a11c071 100644 --- a/doc/src/licenses.qdoc +++ b/doc/src/licenses.qdoc @@ -45,7 +45,7 @@ \ingroup licensing \brief Information about other licenses used for Qt components and third-party code. - Qt contains some code that is not provided under the the + Qt contains some code that is not provided under the \l{GNU General Public License (GPL)}, \l{GNU Lesser General Public License (LGPL)} or the \l{Qt Commercial Editions}{Qt Commercial License Agreement}, but rather under diff --git a/doc/src/mac-differences.qdoc b/doc/src/mac-differences.qdoc index 573e62d..5849850 100644 --- a/doc/src/mac-differences.qdoc +++ b/doc/src/mac-differences.qdoc @@ -128,7 +128,7 @@ If you want to build a new dynamic library combining the Qt 4 dynamic libraries, you need to introduce the \c{ld -r} flag. Then - relocation information is stored in the the output file, so that + relocation information is stored in the output file, so that this file could be the subject of another \c ld run. This is done by setting the \c -r flag in the \c .pro file, and the \c LFLAGS settings. diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc index 501b5a5..dd37fe2 100644 --- a/doc/src/phonon-api.qdoc +++ b/doc/src/phonon-api.qdoc @@ -2973,7 +2973,7 @@ \value ToggledHint If this hint is set it means that - the the control has only two states: zero and non-zero + the control has only two states: zero and non-zero (see isToggleControl()). \value LogarithmicHint diff --git a/doc/src/q3valuelist.qdoc b/doc/src/q3valuelist.qdoc index be315c2..e3681af 100644 --- a/doc/src/q3valuelist.qdoc +++ b/doc/src/q3valuelist.qdoc @@ -108,7 +108,7 @@ pointing to the removed member become invalid. Inserting into the list does not invalidate any iterator. For convenience, the function last() returns a reference to the last item in the list, - and first() returns a reference to the the first item. If the + and first() returns a reference to the first item. If the list is empty(), both last() and first() have undefined behavior (your application will crash or do unpredictable things). Use last() and first() with caution, for example: diff --git a/doc/src/qalgorithms.qdoc b/doc/src/qalgorithms.qdoc index b33c250..90289f9 100644 --- a/doc/src/qalgorithms.qdoc +++ b/doc/src/qalgorithms.qdoc @@ -59,7 +59,7 @@ If STL is available on all your target platforms, you can use the STL algorithms instead of their Qt counterparts. One reason why - you might want to use the the STL algorithms is that STL provides + you might want to use the STL algorithms is that STL provides dozens and dozens of algorithms, whereas Qt only provides the most important ones, making no attempt to duplicate functionality that is already provided by the C++ standard. diff --git a/doc/src/qtdesigner.qdoc b/doc/src/qtdesigner.qdoc index 7e3b619..9699c5b 100644 --- a/doc/src/qtdesigner.qdoc +++ b/doc/src/qtdesigner.qdoc @@ -632,7 +632,7 @@ /*! \fn void QDesignerContainerExtension::setCurrentIndex(int index) - Sets the the currently selected page in the container to be the + Sets the currently selected page in the container to be the page at the given \a index in the extension's list of pages. \sa currentIndex() diff --git a/doc/src/qtscriptdebugger-manual.qdoc b/doc/src/qtscriptdebugger-manual.qdoc index 3dfe879..75d87f8 100644 --- a/doc/src/qtscriptdebugger-manual.qdoc +++ b/doc/src/qtscriptdebugger-manual.qdoc @@ -367,7 +367,7 @@ \section3 continue Continues execution normally, i.e, gives the execution control over - the script back the the QScriptEngine. + the script back to the QScriptEngine. \section3 eval diff --git a/doc/src/stylesheet.qdoc b/doc/src/stylesheet.qdoc index f895918..46ec041 100644 --- a/doc/src/stylesheet.qdoc +++ b/doc/src/stylesheet.qdoc @@ -332,7 +332,7 @@ respect to the reference element. Once positioned, they are treated the same as widgets and can be styled - using the the \l{box model}. + using the \l{box model}. See the \l{List of Sub-Controls} below for a list of supported sub-controls, and \l{Customizing the QPushButton's Menu Indicator @@ -671,7 +671,7 @@ \l{Qt Style Sheets Reference#subcontrol-origin-prop}{subcontrol-origin} properties. - Once positioned, sub-controls can be styled using the the \l{box model}. + Once positioned, sub-controls can be styled using the \l{box model}. \note With complex widgets such as QComboBox and QScrollBar, if one property or sub-control is customized, \bold{all} the other properties or @@ -1154,7 +1154,7 @@ \l{#pane-sub}{::pane} subcontrol. The left and right corners are styled using the \l{#left-corner-sub}{::left-corner} and \l{#right-corner-sub}{::right-corner} respectively. - The position of the the tab bar is controlled using the + The position of the tab bar is controlled using the \l{#tab-bar-sub}{::tab-bar} subcontrol. By default, the subcontrols have positions of a QTabWidget in @@ -1254,7 +1254,7 @@ the \l{#menu-button-sub}{::menu-button} subcontrol is used to draw the menu button. \l{#menu-arrow-sub}{::menu-arrow} subcontrol is used to draw the menu arrow inside the menu-button. By default, it is - positioned in the center of the Contents rectangle of the the + positioned in the center of the Contents rectangle of the menu-button subcontrol. When the QToolButton displays arrows, the \l{#up-arrow-sub}{::up-arrow}, diff --git a/doc/src/tech-preview/known-issues.html b/doc/src/tech-preview/known-issues.html index 05df69e..885104e 100644 --- a/doc/src/tech-preview/known-issues.html +++ b/doc/src/tech-preview/known-issues.html @@ -16,7 +16,7 @@

    Known Issues: Qt 4.0.0 Technology Preview 1

    - This is the list of known and reported issues for the the Qt 4.0.0 + This is the list of known and reported issues for the Qt 4.0.0 Technology Preview 1. This list is updated daily.



    diff --git a/doc/src/timers.qdoc b/doc/src/timers.qdoc index 4f54343..1b48d7d 100644 --- a/doc/src/timers.qdoc +++ b/doc/src/timers.qdoc @@ -62,7 +62,7 @@ In multithreaded applications, you can use the timer mechanism in any thread that has an event loop. To start an event loop from a - non-GUI thread, use QThread::exec(). Qt uses the the object's + non-GUI thread, use QThread::exec(). Qt uses the object's \l{QObject::thread()}{thread affinity} to determine which thread will deliver the QTimerEvent. Because of this, you must start and stop all timers in the object's thread; it is not possible to @@ -105,7 +105,7 @@ In multithreaded applications, you can use QTimer in any thread that has an event loop. To start an event loop from a non-GUI - thread, use QThread::exec(). Qt uses the the timer's + thread, use QThread::exec(). Qt uses the timer's \l{QObject::thread()}{thread affinity} to determine which thread will emit the \l{QTimer::}{timeout()} signal. Because of this, you must start and stop the timer in its thread; it is not possible to diff --git a/doc/src/xquery-introduction.qdoc b/doc/src/xquery-introduction.qdoc index 37a45ac..fe541e2 100644 --- a/doc/src/xquery-introduction.qdoc +++ b/doc/src/xquery-introduction.qdoc @@ -347,7 +347,7 @@ has a more detailed section on the shorthand form, which it calls the \l{http://www.w3.org/TR/xquery/#abbrev} {abbreviated syntax}. More examples of path expressions written in the shorthand form are found there. There is also a section listing examples of path expressions -written in the the \l{http://www.w3.org/TR/xquery/#unabbrev} {longhand +written in the \l{http://www.w3.org/TR/xquery/#unabbrev} {longhand form}. \target Name Tests diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 484e79a..14fc2d4 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2295,7 +2295,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, As mentioned in the \l{Fallback Mechanism} section, QSettings stores settings for an application in up to four locations, depending on whether the settings are user-specific or - system-wide and whether the the settings are application-specific + system-wide and whether the settings are application-specific or organization-wide. For simplicity, we're assuming the organization is called MySoft and the application is called Star Runner. diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 01e81ab..4b3feb0 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -77,7 +77,7 @@ QT_BEGIN_NAMESPACE In multithreaded applications, you can use QTimer in any thread that has an event loop. To start an event loop from a non-GUI - thread, use QThread::exec(). Qt uses the the timer's + thread, use QThread::exec(). Qt uses the timer's \l{QObject::thread()}{thread affinity} to determine which thread will emit the \l{QTimer::}{timeout()} signal. Because of this, you must start and stop the timer in its thread; it is not possible to diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp index 3930a0d..5602170 100644 --- a/src/corelib/tools/qrect.cpp +++ b/src/corelib/tools/qrect.cpp @@ -901,7 +901,7 @@ void QRect::moveCenter(const QPoint &p) /*! \fn bool QRect::contains(const QPoint &point, bool proper) const - Returns true if the the given \a point is inside or on the edge of + Returns true if the given \a point is inside or on the edge of the rectangle, otherwise returns false. If \a proper is true, this function only returns true if the given \a point is \e inside the rectangle (i.e., not on the edge). diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp index 76a5484..bbf6c2a 100644 --- a/src/corelib/tools/qsize.cpp +++ b/src/corelib/tools/qsize.cpp @@ -781,7 +781,7 @@ void QSizeF::scale(const QSizeF &s, Qt::AspectRatioMode mode) \fn QDataStream &operator<<(QDataStream &stream, const QSizeF &size) \relates QSizeF - Writes the the given \a size to the given \a stream and returns a + Writes the given \a size to the given \a stream and returns a reference to the stream. \sa {Format of the QDataStream Operators} diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index 386321f1..e22f122 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -397,7 +397,7 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegExp &r \fn QString QStringList::join(const QString &separator) const Joins all the string list's strings into a single string with each - element separated by the the given \a separator (which can be an + element separated by the given \a separator (which can be an empty string). \sa QString::split() diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp index 6741f2c..39a74d5 100644 --- a/src/gui/embedded/qscreen_qws.cpp +++ b/src/gui/embedded/qscreen_qws.cpp @@ -1394,7 +1394,7 @@ QImage::Format QScreenPrivate::preferredImageFormat() const altered. Note that the default implementations of these functions do nothing. - Reimplement the the mapFromDevice() and mapToDevice() functions to + Reimplement the mapFromDevice() and mapToDevice() functions to map objects from the framebuffer coordinate system to the coordinate space used by the application, and vice versa. Be aware that the default implementations simply return the given objects diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp index eaa97ff..b46e05e 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.cpp +++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp @@ -255,7 +255,7 @@ QGraphicsItem *QGraphicsLayoutItemPrivate::parentItem() const passing a QGraphicsLayoutItem pointer to QGraphicsLayoutItem's protected constructor, or by calling setParentLayoutItem(). The parentLayoutItem() function returns a pointer to the item's layoutItem - parent. If the item's parent is 0 or if the the parent does not inherit + parent. If the item's parent is 0 or if the parent does not inherit from QGraphicsItem, the parentLayoutItem() function then returns 0. isLayout() returns true if the QGraphicsLayoutItem subclass is itself a layout, or false otherwise. diff --git a/src/gui/graphicsview/qgraphicssceneevent.cpp b/src/gui/graphicsview/qgraphicssceneevent.cpp index b819c2c..0ffd2b1 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.cpp +++ b/src/gui/graphicsview/qgraphicssceneevent.cpp @@ -844,7 +844,7 @@ QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent() /*! Returns the position of the mouse cursor in item coordinates at the moment - the the context menu was requested. + the context menu was requested. \sa scenePos(), screenPos() */ @@ -992,7 +992,7 @@ QGraphicsSceneHoverEvent::~QGraphicsSceneHoverEvent() /*! Returns the position of the mouse cursor in item coordinates at the moment - the the hover event was sent. + the hover event was sent. \sa scenePos(), screenPos() */ @@ -1017,7 +1017,7 @@ void QGraphicsSceneHoverEvent::setPos(const QPointF &pos) /*! Returns the position of the mouse cursor in scene coordinates at the - moment the the hover event was sent. + moment the hover event was sent. \sa pos(), screenPos() */ @@ -1042,7 +1042,7 @@ void QGraphicsSceneHoverEvent::setScenePos(const QPointF &pos) /*! Returns the position of the mouse cursor in screen coordinates at the - moment the the hover event was sent. + moment the hover event was sent. \sa pos(), scenePos() */ @@ -1138,7 +1138,7 @@ void QGraphicsSceneHoverEvent::setLastScreenPos(const QPoint &pos) /*! \since 4.4 - Returns the keyboard modifiers at the moment the the hover event was sent. + Returns the keyboard modifiers at the moment the hover event was sent. */ Qt::KeyboardModifiers QGraphicsSceneHoverEvent::modifiers() const { @@ -1184,7 +1184,7 @@ QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent() /*! Returns the position of the mouse cursor in scene coordinates at the - moment the the help event was sent. + moment the help event was sent. \sa screenPos() */ @@ -1209,7 +1209,7 @@ void QGraphicsSceneHelpEvent::setScenePos(const QPointF &pos) /*! Returns the position of the mouse cursor in screen coordinates at the - moment the the help event was sent. + moment the help event was sent. \sa scenePos() */ diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 53430ab..a880a13 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -922,7 +922,7 @@ QList QIcon::availableSizes(Mode mode, State state) const \relates QIcon \since 4.2 - Writes the given \a icon to the the given \a stream as a PNG + Writes the given \a icon to the given \a stream as a PNG image. If the icon contains more than one image, all images will be written to the stream. Note that writing the stream to a file will not produce a valid image file. diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index c7a20db..70d4e2c 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4996,7 +4996,7 @@ QPoint QImage::offset() const /*! \fn void QImage::setOffset(const QPoint& offset) - Sets the the number of pixels by which the image is intended to be + Sets the number of pixels by which the image is intended to be offset by when positioning relative to other images, to \a offset. \sa offset(), {QImage#Image Information}{Image Information} diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index efb8260..0f6b649 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1232,7 +1232,7 @@ bool QPixmap::convertFromImage(const QImage &image, ColorMode mode) /*! \relates QPixmap - Writes the given \a pixmap to the the given \a stream as a PNG + Writes the given \a pixmap to the given \a stream as a PNG image. Note that writing the stream to a file will not produce a valid image file. diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 83e05b4..7a3d674 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -1338,7 +1338,7 @@ QSize QAbstractItemView::iconSize() const /*! \property QAbstractItemView::textElideMode - \brief the the position of the "..." in elided text. + \brief the position of the "..." in elided text. The default value for all item views is Qt::ElideRight. */ diff --git a/src/gui/itemviews/qlistwidget.cpp b/src/gui/itemviews/qlistwidget.cpp index 7a366d1..bf3b43c 100644 --- a/src/gui/itemviews/qlistwidget.cpp +++ b/src/gui/itemviews/qlistwidget.cpp @@ -1158,7 +1158,7 @@ void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft, /*! \fn void QListWidget::addItem(QListWidgetItem *item) - Inserts the \a item at the the end of the list widget. + Inserts the \a item at the end of the list widget. \warning A QListWidgetItem can only be added to a QListWidget once. Adding the same QListWidgetItem multiple diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp index 917b5d5..bab3449 100644 --- a/src/gui/kernel/qclipboard.cpp +++ b/src/gui/kernel/qclipboard.cpp @@ -466,7 +466,7 @@ void QClipboard::setPixmap(const QPixmap &pixmap, Mode mode) The \a mode argument is used to control which part of the system clipboard is used. If \a mode is QClipboard::Clipboard, this - function clears the the global clipboard contents. If \a mode is + function clears the global clipboard contents. If \a mode is QClipboard::Selection, this function clears the global mouse selection contents. If \a mode is QClipboard::FindBuffer, this function clears the search string buffer. diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 4cb9380..bbf6758 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -6282,7 +6282,7 @@ QByteArray QWidget::saveGeometry() const returns false. If the restored geometry is off-screen, it will be modified to be - inside the the available screen geometry. + inside the available screen geometry. To restore geometry saved using QSettings, you can use code like this: diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index e1f5eea..9ce16d3 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -1006,7 +1006,7 @@ void QPainterPath::addPolygon(const QPolygonF &polygon) /*! \fn void QPainterPath::addEllipse(const QRectF &boundingRectangle) - Creates an ellipse within the the specified \a boundingRectangle + Creates an ellipse within the specified \a boundingRectangle and adds it to the painter path as a closed subpath. The ellipse is composed of a clockwise curve, starting and diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index 15e626e..70e1599 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -494,7 +494,7 @@ static inline bool isFixedPitch(char **tokens) Fills in a font definition (QFontDef) from an XLFD (X Logical Font Description). - Returns true if the the given xlfd is valid. + Returns true if the given xlfd is valid. */ bool qt_fillFontDef(const QByteArray &xlfd, QFontDef *fd, int dpi, QtFontDesc *desc) { diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 21bfc4d..38ac4ca 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -1449,7 +1449,7 @@ void QTextCharFormat::setUnderlineStyle(UnderlineStyle style) /*! \since 4.5 \fn bool QTextCharFormat::fontKerning() const - Returns true if the the font kerning is enabled. + Returns true if the font kerning is enabled. \sa setFontKerning() \sa font() diff --git a/src/gui/util/qundostack.cpp b/src/gui/util/qundostack.cpp index 11f65e3..a6b9c23 100644 --- a/src/gui/util/qundostack.cpp +++ b/src/gui/util/qundostack.cpp @@ -715,7 +715,7 @@ int QUndoStack::index() const } /*! - Repeatedly calls undo() or redo() until the the current command index reaches + Repeatedly calls undo() or redo() until the current command index reaches \a idx. This function can be used to roll the state of the document forwards of backwards. indexChanged() is emitted only once. diff --git a/src/gui/widgets/qlcdnumber.cpp b/src/gui/widgets/qlcdnumber.cpp index 0136f1a..af80963 100644 --- a/src/gui/widgets/qlcdnumber.cpp +++ b/src/gui/widgets/qlcdnumber.cpp @@ -1271,7 +1271,7 @@ bool QLCDNumber::event(QEvent *e) /*! \fn int QLCDNumber::margin() const - Returns the with of the the margin around the contents of the widget. + Returns the width of the margin around the contents of the widget. Use QWidget::getContentsMargins() instead. \sa setMargin(), QWidget::getContentsMargins() diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index b03df9e..b76d019 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -3673,7 +3673,7 @@ void QLineEditPrivate::redo() { /*! \fn int QLineEdit::margin() const - Returns the with of the the margin around the contents of the widget. + Returns the width of the margin around the contents of the widget. Use QWidget::getContentsMargins() instead. \sa setMargin(), QWidget::getContentsMargins() diff --git a/src/gui/widgets/qmdiarea.cpp b/src/gui/widgets/qmdiarea.cpp index 598d3b5..6acd977 100644 --- a/src/gui/widgets/qmdiarea.cpp +++ b/src/gui/widgets/qmdiarea.cpp @@ -81,7 +81,7 @@ subwindows. This information could be used in a popup menu containing a list of windows, for example. - The subwindows are sorted by the the current + The subwindows are sorted by the current \l{QMdiArea::}{WindowOrder}. This is used for the subWindowList() and for activateNextSubWindow() and acivatePreviousSubWindow(). Also, it is used when cascading or tiling the windows with diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index ccf37db..c63da64 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -2379,7 +2379,7 @@ int QMenuBar::findIdForAction(QAction *act) const /*! \fn int QMenuBar::margin() const - Returns the with of the the margin around the contents of the widget. + Returns the width of the margin around the contents of the widget. Use QWidget::getContentsMargins() instead. \sa setMargin(), QWidget::getContentsMargins() diff --git a/src/gui/widgets/qscrollarea.cpp b/src/gui/widgets/qscrollarea.cpp index 6aca7d3..8b01453 100644 --- a/src/gui/widgets/qscrollarea.cpp +++ b/src/gui/widgets/qscrollarea.cpp @@ -127,7 +127,7 @@ QT_BEGIN_NAMESPACE setting the layout's \l{QLayout::sizeConstraint}{size constraint} property to one which provides constraints on the minimum and/or maximum size of the layout (e.g., QLayout::SetMinAndMaxSize) will - cause the size of the the scroll area to be updated whenever the + cause the size of the scroll area to be updated whenever the contents of the layout changes. For a complete example using the QScrollArea class, see the \l diff --git a/src/gui/widgets/qsplitter.cpp b/src/gui/widgets/qsplitter.cpp index bf8af35..45e838f 100644 --- a/src/gui/widgets/qsplitter.cpp +++ b/src/gui/widgets/qsplitter.cpp @@ -1517,7 +1517,7 @@ void QSplitter::setOpaqueResize(bool on) /*! \fn int QSplitter::margin() const - Returns the with of the the margin around the contents of the widget. + Returns the width of the margin around the contents of the widget. Use QWidget::getContentsMargins() instead. \sa setMargin(), QWidget::getContentsMargins() diff --git a/src/gui/widgets/qtabwidget.cpp b/src/gui/widgets/qtabwidget.cpp index c16e000..43b2f54 100644 --- a/src/gui/widgets/qtabwidget.cpp +++ b/src/gui/widgets/qtabwidget.cpp @@ -504,7 +504,7 @@ QIcon QTabWidget::tabIcon(int index) const } /*! - Returns true if the the page at position \a index is enabled; otherwise returns false. + Returns true if the page at position \a index is enabled; otherwise returns false. \sa setTabEnabled(), QWidget::isEnabled() */ diff --git a/src/gui/widgets/qtoolbox.cpp b/src/gui/widgets/qtoolbox.cpp index 81935a5..271130a 100644 --- a/src/gui/widgets/qtoolbox.cpp +++ b/src/gui/widgets/qtoolbox.cpp @@ -802,7 +802,7 @@ void QToolBox::itemRemoved(int index) /*! \fn int QToolBox::margin() const - Returns the with of the the margin around the contents of the widget. + Returns the width of the margin around the contents of the widget. Use QWidget::getContentsMargins() instead. \sa setMargin(), QWidget::getContentsMargins() diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp index 96ccc91..7d14ab6 100644 --- a/src/network/access/qhttp.cpp +++ b/src/network/access/qhttp.cpp @@ -950,7 +950,7 @@ void QHttpHeader::setContentLength(int len) } /*! - Returns true if the header has an entry for the the special HTTP + Returns true if the header has an entry for the special HTTP header field \c content-type; otherwise returns false. \sa contentType() setContentType() diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp index 670745b..960999e 100644 --- a/src/network/kernel/qnetworkinterface.cpp +++ b/src/network/kernel/qnetworkinterface.cpp @@ -397,7 +397,7 @@ QNetworkInterface::~QNetworkInterface() } /*! - Creates a copy of the the QNetworkInterface object contained in \a + Creates a copy of the QNetworkInterface object contained in \a other. */ QNetworkInterface::QNetworkInterface(const QNetworkInterface &other) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index f9750f2..336a7e7 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1127,7 +1127,7 @@ bool QAbstractSocketPrivate::readFromSocket() /*! \internal - Sets up the the internal state after the connection has succeeded. + Sets up the internal state after the connection has succeeded. */ void QAbstractSocketPrivate::fetchConnectionParameters() { diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 04bc611..8f963f8 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2588,7 +2588,7 @@ const QGLContext* QGLContext::currentContext() \i paintGL() - Renders the OpenGL scene. Gets called whenever the widget needs to be updated. \i resizeGL() - Sets up the OpenGL viewport, projection, etc. Gets - called whenever the the widget has been resized (and also when it + called whenever the widget has been resized (and also when it is shown for the first time because all newly created widgets get a resize event automatically). \i initializeGL() - Sets up the OpenGL rendering context, defines display diff --git a/src/qt3support/network/q3http.cpp b/src/qt3support/network/q3http.cpp index f1590a6..591b381 100644 --- a/src/qt3support/network/q3http.cpp +++ b/src/qt3support/network/q3http.cpp @@ -626,7 +626,7 @@ void Q3HttpHeader::setContentLength( int len ) } /*! - Returns true if the header has an entry for the the special HTTP + Returns true if the header has an entry for the special HTTP header field \c content-type; otherwise returns false. \sa contentType() setContentType() diff --git a/src/qt3support/network/q3urloperator.cpp b/src/qt3support/network/q3urloperator.cpp index 3f334a8..b415e12 100644 --- a/src/qt3support/network/q3urloperator.cpp +++ b/src/qt3support/network/q3urloperator.cpp @@ -543,7 +543,7 @@ const Q3NetworkOperation *Q3UrlOperator::rename( const QString &oldname, const Q in mind that the get() and put() operations emit this signal through the Q3UrlOperator. The number of transferred bytes and the total bytes that you receive as arguments in this signal do not - relate to the the whole copy operation; they relate first to the + relate to the whole copy operation; they relate first to the get() and then to the put() operation. Always check what type of operation the signal comes from; this is given in the signal's last argument. diff --git a/src/qt3support/widgets/q3action.cpp b/src/qt3support/widgets/q3action.cpp index 4e1a1bf..311212a 100644 --- a/src/qt3support/widgets/q3action.cpp +++ b/src/qt3support/widgets/q3action.cpp @@ -497,7 +497,7 @@ Q3Action::Q3Action(const QIcon& icon, const QString& menuText, QKeySequence acce } /*! - This constructor results in an icon-less action with the the menu + This constructor results in an icon-less action with the menu text \a menuText and keyboard accelerator \a accel. It is a child of \a parent and called \a name. diff --git a/src/qt3support/widgets/q3groupbox.cpp b/src/qt3support/widgets/q3groupbox.cpp index 1fa7e7c..e0b609a 100644 --- a/src/qt3support/widgets/q3groupbox.cpp +++ b/src/qt3support/widgets/q3groupbox.cpp @@ -382,7 +382,7 @@ int Q3GroupBox::insideSpacing() const } /*! - Sets the the width of the inside margin to \a m pixels. + Sets the width of the inside margin to \a m pixels. \sa insideMargin() */ @@ -954,7 +954,7 @@ int Q3GroupBox::frameWidth() const \fn int Q3GroupBox::margin() const \since 4.2 - Returns the width of the the margin around the contents of the widget. + Returns the width of the margin around the contents of the widget. This function uses QWidget::getContentsMargins() to get the margin. diff --git a/src/qt3support/widgets/q3popupmenu.cpp b/src/qt3support/widgets/q3popupmenu.cpp index 7f890b5..0b3a524 100644 --- a/src/qt3support/widgets/q3popupmenu.cpp +++ b/src/qt3support/widgets/q3popupmenu.cpp @@ -134,7 +134,7 @@ QT_BEGIN_NAMESPACE \fn int Q3PopupMenu::margin() const \since 4.2 - Returns the with of the the margin around the contents of the widget. + Returns the width of the margin around the contents of the widget. This function uses QWidget::getContentsMargins() to get the margin. \sa setMargin(), QWidget::getContentsMargins() diff --git a/src/qt3support/widgets/q3progressbar.cpp b/src/qt3support/widgets/q3progressbar.cpp index caae460..81f0dbf 100644 --- a/src/qt3support/widgets/q3progressbar.cpp +++ b/src/qt3support/widgets/q3progressbar.cpp @@ -455,7 +455,7 @@ void Q3ProgressBar::paintEvent(QPaintEvent *) \fn int Q3ProgressBar::margin() const \since 4.2 - Returns the with of the the margin around the contents of the widget. + Returns the width of the margin around the contents of the widget. This function uses QWidget::getContentsMargins() to get the margin. \sa setMargin(), QWidget::getContentsMargins() diff --git a/src/qt3support/widgets/q3scrollview.cpp b/src/qt3support/widgets/q3scrollview.cpp index 91a9203..5a91027 100644 --- a/src/qt3support/widgets/q3scrollview.cpp +++ b/src/qt3support/widgets/q3scrollview.cpp @@ -2038,7 +2038,7 @@ void Q3ScrollView::center(int x, int y) \list \i Margin 0.0 allows (x, y) to be on the edge of the visible area. \i Margin 0.5 ensures that (x, y) is in middle 50% of the visible area. - \i Margin 1.0 ensures that (x, y) is in the center of the the visible area. + \i Margin 1.0 ensures that (x, y) is in the center of the visible area. \endlist */ void Q3ScrollView::center(int x, int y, float xmargin, float ymargin) diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp index e6729a5..2a07e28 100644 --- a/src/sql/kernel/qsqlquery.cpp +++ b/src/sql/kernel/qsqlquery.cpp @@ -1195,7 +1195,7 @@ void QSqlQuery::finish() The query will be repositioned on an \e invalid record in the new result set and must be navigated to a valid record before data values can be retrieved. If a new result set isn't available the - function returns false and the the query is set to inactive. In any + function returns false and the query is set to inactive. In any case the old result set will be discarded. When one of the statements is a non-select statement a count of diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index c78d4ba..ade0339 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -2107,7 +2107,7 @@ events are reported. You can set the lexical handler with QXmlReader::setLexicalHandler(). - This interface's design is based on the the SAX2 extension + This interface's design is based on the SAX2 extension LexicalHandler. The interface provides the startDTD(), endDTD(), startEntity(), -- cgit v0.12 From d76c5fb7feda66621b435263353f49e9b4b34308 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 14 May 2009 18:30:57 +0200 Subject: Fix handling of dynamic casts in QSharedPointer. It's wrong to assume that static_cast<> is allowed everywhere where dynamic_cast<> is allowed. For example, if class C derives from both A and B, then you can dynamic_cast(ptr_to_A), but you can't static_cast. So introduce a helper for dynamic casts that doesn't do static_cast. Reviewed-by: Olivier Goffart --- src/corelib/tools/qsharedpointer_impl.h | 21 ++-- tests/auto/qsharedpointer/tst_qsharedpointer.cpp | 137 +++++++++++++++++++++-- 2 files changed, 140 insertions(+), 18 deletions(-) diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index f1b35ee..ad2d9f2 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -238,6 +238,7 @@ namespace QtSharedPointer { template friend class ExternalRefCount; template friend class QWeakPointer; template friend QSharedPointer qSharedPointerCastHelper(const QSharedPointer &src, X *); + template friend QSharedPointer qSharedPointerDynamicCastHelper(const QSharedPointer &src, X *); template friend QSharedPointer qSharedPointerConstCastHelper(const QSharedPointer &src, X *); template friend QSharedPointer QtSharedPointer::qStrongRefFromWeakHelper(const QWeakPointer &src, X *); #endif @@ -509,6 +510,14 @@ namespace QtSharedPointer { return result; } template + Q_INLINE_TEMPLATE QSharedPointer qSharedPointerDynamicCastHelper(const QSharedPointer &src, X *) + { + QSharedPointer result; + register T *ptr = src.data(); + result.internalSet(src.d, dynamic_cast(ptr)); + return result; + } + template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerConstCastHelper(const QSharedPointer &src, X *) { QSharedPointer result; @@ -544,9 +553,7 @@ template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerDynamicCast(const QSharedPointer &src) { X *x = 0; - if (QtSharedPointer::qVerifyDynamicCast(src.data(), x)) - return QtSharedPointer::qSharedPointerCastHelper(src, x); - return QSharedPointer(); + return QtSharedPointer::qSharedPointerDynamicCastHelper(src, x); } template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerDynamicCast(const QWeakPointer &src) @@ -558,17 +565,13 @@ template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerConstCast(const QSharedPointer &src) { X *x = 0; - if (QtSharedPointer::qVerifyConstCast(src.data(), x)) - return QtSharedPointer::qSharedPointerConstCastHelper(src, x); - return QSharedPointer(); + return QtSharedPointer::qSharedPointerConstCastHelper(src, x); } template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerConstCast(const QWeakPointer &src) { X *x = 0; - if (QtSharedPointer::qVerifyConstCast(src.data(), x)) - return QtSharedPointer::qSharedPointerCastHelper(src, x); - return QSharedPointer(); + return QtSharedPointer::qSharedPointerConstCastHelper(src, x); } template diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp index 64439fb..a52bb3e 100644 --- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp +++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp @@ -57,8 +57,11 @@ private slots: void downCast(); void upCast(); void differentPointers(); + void virtualBaseDifferentPointers(); #ifndef QTEST_NO_RTTI void dynamicCast(); + void dynamicCastDifferentPointers(); + void dynamicCastVirtualBase(); void dynamicCastFailure(); #endif void customDeleter(); @@ -321,6 +324,10 @@ class DiffPtrDerivedData: public Stuffing, public Data { }; +class VirtualDerived: virtual public Data +{ +}; + void tst_QSharedPointer::downCast() { { @@ -439,7 +446,7 @@ void tst_QSharedPointer::differentPointers() DiffPtrDerivedData *aData = new DiffPtrDerivedData; Data *aBase = aData; Q_ASSERT(aData == aBase); - Q_ASSERT(quintptr(&aData) != quintptr(&aBase)); + Q_ASSERT(*reinterpret_cast(&aData) != *reinterpret_cast(&aBase)); QSharedPointer baseptr = QSharedPointer(aData); QSharedPointer ptr = qSharedPointerCast(baseptr); @@ -453,7 +460,7 @@ void tst_QSharedPointer::differentPointers() DiffPtrDerivedData *aData = new DiffPtrDerivedData; Data *aBase = aData; Q_ASSERT(aData == aBase); - Q_ASSERT(quintptr(&aData) != quintptr(&aBase)); + Q_ASSERT(*reinterpret_cast(&aData) != *reinterpret_cast(&aBase)); QSharedPointer ptr = QSharedPointer(aData); QSharedPointer baseptr = ptr; @@ -464,23 +471,53 @@ void tst_QSharedPointer::differentPointers() QVERIFY(baseptr == aData); QVERIFY(baseptr == aBase); } +} + +void tst_QSharedPointer::virtualBaseDifferentPointers() +{ + { + VirtualDerived *aData = new VirtualDerived; + Data *aBase = aData; + Q_ASSERT(aData == aBase); + Q_ASSERT(*reinterpret_cast(&aData) != *reinterpret_cast(&aBase)); + + QSharedPointer ptr = QSharedPointer(aData); + QSharedPointer baseptr = qSharedPointerCast(ptr); + QVERIFY(ptr == baseptr); + QVERIFY(ptr.data() == baseptr.data()); + QVERIFY(ptr == aBase); + QVERIFY(ptr == aData); + QVERIFY(baseptr == aData); + QVERIFY(baseptr == aBase); + } + + { + VirtualDerived *aData = new VirtualDerived; + Data *aBase = aData; + Q_ASSERT(aData == aBase); + Q_ASSERT(*reinterpret_cast(&aData) != *reinterpret_cast(&aBase)); - // there is no possibility for different pointers in - // internal reference counting right now - // - // to do that, it's necessary to first implement the ability to - // call (virtual) functions, so that the two differing bases have - // the same reference counter + QSharedPointer ptr = QSharedPointer(aData); + QSharedPointer baseptr = ptr; + QVERIFY(ptr == baseptr); + QVERIFY(ptr.data() == baseptr.data()); + QVERIFY(ptr == aBase); + QVERIFY(ptr == aData); + QVERIFY(baseptr == aData); + QVERIFY(baseptr == aBase); + } } #ifndef QTEST_NO_RTTI void tst_QSharedPointer::dynamicCast() { - QSharedPointer baseptr = QSharedPointer(new DerivedData); + DerivedData *aData = new DerivedData; + QSharedPointer baseptr = QSharedPointer(aData); { QSharedPointer derivedptr = qSharedPointerDynamicCast(baseptr); QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); } QCOMPARE(int(baseptr.d->weakref), 1); @@ -490,6 +527,7 @@ void tst_QSharedPointer::dynamicCast() QWeakPointer weakptr = baseptr; QSharedPointer derivedptr = qSharedPointerDynamicCast(weakptr); QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); } QCOMPARE(int(baseptr.d->weakref), 1); @@ -498,6 +536,87 @@ void tst_QSharedPointer::dynamicCast() { QSharedPointer derivedptr = baseptr.dynamicCast(); QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); + QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); + } + QCOMPARE(int(baseptr.d->weakref), 1); + QCOMPARE(int(baseptr.d->strongref), 1); +} + +void tst_QSharedPointer::dynamicCastDifferentPointers() +{ + // DiffPtrDerivedData derives from both Data and Stuffing + DiffPtrDerivedData *aData = new DiffPtrDerivedData; + QSharedPointer baseptr = QSharedPointer(aData); + + { + QSharedPointer derivedptr = qSharedPointerDynamicCast(baseptr); + QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); + QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); + } + QCOMPARE(int(baseptr.d->weakref), 1); + QCOMPARE(int(baseptr.d->strongref), 1); + + { + QWeakPointer weakptr = baseptr; + QSharedPointer derivedptr = qSharedPointerDynamicCast(weakptr); + QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); + QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); + } + QCOMPARE(int(baseptr.d->weakref), 1); + QCOMPARE(int(baseptr.d->strongref), 1); + + { + QSharedPointer derivedptr = baseptr.dynamicCast(); + QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); + QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); + } + QCOMPARE(int(baseptr.d->weakref), 1); + QCOMPARE(int(baseptr.d->strongref), 1); + + { + Stuffing *nakedptr = dynamic_cast(baseptr.data()); + QVERIFY(nakedptr); + + QSharedPointer otherbaseptr = qSharedPointerDynamicCast(baseptr); + QVERIFY(!otherbaseptr.isNull()); + QVERIFY(otherbaseptr == nakedptr); + QCOMPARE(otherbaseptr.data(), nakedptr); + QCOMPARE(static_cast(otherbaseptr.data()), aData); + } +} + +void tst_QSharedPointer::dynamicCastVirtualBase() +{ + VirtualDerived *aData = new VirtualDerived; + QSharedPointer baseptr = QSharedPointer(aData); + + { + QSharedPointer derivedptr = qSharedPointerDynamicCast(baseptr); + QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); + QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); + } + QCOMPARE(int(baseptr.d->weakref), 1); + QCOMPARE(int(baseptr.d->strongref), 1); + + { + QWeakPointer weakptr = baseptr; + QSharedPointer derivedptr = qSharedPointerDynamicCast(weakptr); + QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); + QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); + } + QCOMPARE(int(baseptr.d->weakref), 1); + QCOMPARE(int(baseptr.d->strongref), 1); + + { + QSharedPointer derivedptr = baseptr.dynamicCast(); + QVERIFY(baseptr == derivedptr); + QCOMPARE(derivedptr.data(), aData); QCOMPARE(static_cast(derivedptr.data()), baseptr.data()); } QCOMPARE(int(baseptr.d->weakref), 1); -- cgit v0.12 From 03069de9c398fe7a787388e61badb09ae1b1e6b7 Mon Sep 17 00:00:00 2001 From: Andre Haupt Date: Thu, 14 May 2009 04:44:19 +0200 Subject: Replace all occurences of "heirarchy" with "hierarchy" Signed-off-by: Andre Haupt Reviewed-By: Thiago Macieira --- doc/src/stylesheet.qdoc | 4 ++-- src/corelib/io/qresource.cpp | 2 +- src/gui/widgets/qmenu_p.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/stylesheet.qdoc b/doc/src/stylesheet.qdoc index 46ec041..4060f33 100644 --- a/doc/src/stylesheet.qdoc +++ b/doc/src/stylesheet.qdoc @@ -398,7 +398,7 @@ (usually) refers to a single object, not to all instances of a class. - Similarly, selectors with pseudo-states are more specific that + Similarly, selectors with pseudo-states are more specific than ones that do not specify pseudo-states. Thus, the following style sheet specifies that a \l{QPushButton} should have white text when the mouse is hovering over it, otherwise red text: @@ -653,7 +653,7 @@ \target sub controls \section1 Sub-controls - A widget is considered as a heirarchy (tree) of subcontrols drawn on top + A widget is considered as a hierarchy (tree) of subcontrols drawn on top of each other. For example, the QComboBox draws the drop-down sub-control followed by the down-arrow sub-control. A QComboBox is thus rendered as follows: diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index a1f921e..1f77caa 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -406,7 +406,7 @@ QString QResource::absoluteFilePath() const } /*! - Returns true if the resource really exists in the resource heirarchy, + Returns true if the resource really exists in the resource hierarchy, false otherwise. */ diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index e3c4890..74367c4 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -208,7 +208,7 @@ public: QString searchBuffer; QBasicTimer searchBufferTimer; - //passing of mouse events up the parent heirarchy + //passing of mouse events up the parent hierarchy QPointer activeMenu; bool mouseEventTaken(QMouseEvent *); -- cgit v0.12 From 4bdee921aaaeb0ed150f0a9041a92566499a7936 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 18 May 2009 16:45:41 +0200 Subject: Fix compilation after merge --- src/network/access/qhttpnetworkconnection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 161e6e9..43fbb16 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -723,6 +723,7 @@ void QHttpNetworkConnectionPrivate::handleStatus(QAbstractSocket *socket, QHttpN // proxy or server connections.. channels[i].resendCurrent = true; QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); + } } else { int i = indexOf(socket); emit channels[i].reply->headerChanged(); -- cgit v0.12 From f5322311fa5f93e995d4c9dc35c778b11413abf5 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 18 May 2009 16:49:08 +0200 Subject: Fix compilation with strict iterators --- src/corelib/tools/qmap.h | 2 +- tests/auto/qmap/tst_qmap.cpp | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 5f13e5a..32c8d17 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -990,7 +990,7 @@ Q_INLINE_TEMPLATE int QMultiMap::remove(const Key &key, const T &value) { int n = 0; typename QMap::iterator i(find(key)); - typename QMap::const_iterator end(QMap::constEnd()); + typename QMap::iterator end(QMap::end()); while (i != end && !qMapLessThanKey(key, i.key())) { if (i.value() == value) { i = erase(i); diff --git a/tests/auto/qmap/tst_qmap.cpp b/tests/auto/qmap/tst_qmap.cpp index 99efc80..68ac8d6 100644 --- a/tests/auto/qmap/tst_qmap.cpp +++ b/tests/auto/qmap/tst_qmap.cpp @@ -39,6 +39,7 @@ ** ****************************************************************************/ +#define QT_STRICT_ITERATORS #include #include @@ -400,7 +401,7 @@ void tst_QMap::operator_eq() QVERIFY(a == b); QVERIFY(!(a != b)); - + a.insert(1,1); b.insert(1,1); QVERIFY(a == b); @@ -422,7 +423,7 @@ void tst_QMap::operator_eq() b.insert(-1, -1); QVERIFY(a != b); - QVERIFY(!(a == b)); + QVERIFY(!(a == b)); } { @@ -468,7 +469,7 @@ void tst_QMap::operator_eq() b.insert("willy", 1); QVERIFY(a != b); QVERIFY(!(a == b)); - } + } } void tst_QMap::empty() @@ -523,9 +524,9 @@ void tst_QMap::find() map1.insertMulti(4, compareString); } - QMap::const_iterator it=map1.find(4); + QMap::const_iterator it=map1.constFind(4); - for(i = 9; i > 2 && it != map1.end() && it.key() == 4; --i) { + for(i = 9; i > 2 && it != map1.constEnd() && it.key() == 4; --i) { compareString = testString.arg(i); QVERIFY(it.value() == compareString); ++it; @@ -546,9 +547,9 @@ void tst_QMap::constFind() map1.insert(1,"Mensch"); map1.insert(1,"Mayer"); map1.insert(2,"Hej"); - + QVERIFY(map1.constFind(4) == map1.constEnd()); - + QVERIFY(map1.constFind(1).value() == "Mayer"); QVERIFY(map1.constFind(2).value() == "Hej"); @@ -677,7 +678,7 @@ void tst_QMap::iterators() cstlIt--; QVERIFY(cstlIt.value() == "Teststring 3"); - for(cstlIt = map.begin(), i = 1; cstlIt != map.constEnd(), i < 100; ++cstlIt, ++i) + for(cstlIt = map.constBegin(), i = 1; cstlIt != map.constEnd(), i < 100; ++cstlIt, ++i) QVERIFY(cstlIt.value() == testString.arg(i)); //Java-Style iterators -- cgit v0.12 From a860dfbd20ac99492bb30c646b672e72283bb810 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Mon, 18 May 2009 16:54:01 +0200 Subject: Add src/corelib/kernel/qpointer.cpp to src/corelib/kernel/kernel.pri Makes it possible to find it when using QtCreator :) --- src/corelib/kernel/kernel.pri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index d90ecae..68649a6 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -53,7 +53,8 @@ SOURCES += \ kernel/qvariant.cpp \ kernel/qcoreglobaldata.cpp \ kernel/qsharedmemory.cpp \ - kernel/qsystemsemaphore.cpp + kernel/qsystemsemaphore.cpp \ + kernel/qpointer.cpp win32 { SOURCES += \ -- cgit v0.12 From 0266129d26695987e93c3c3f856e8353a5d7cd89 Mon Sep 17 00:00:00 2001 From: kh Date: Mon, 18 May 2009 17:23:34 +0200 Subject: Make sure we add the progress bar only once. --- tools/assistant/tools/assistant/mainwindow.cpp | 30 ++++++++++++++------------ 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index b0c2c6b..582eef3 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -926,25 +926,27 @@ void MainWindow::expandTOC(int depth) void MainWindow::indexingStarted() { - m_progressWidget = new QWidget(); - QLayout* hlayout = new QHBoxLayout(m_progressWidget); + if (!m_progressWidget) { + m_progressWidget = new QWidget(); + QLayout* hlayout = new QHBoxLayout(m_progressWidget); - QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); + QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); - QLabel *label = new QLabel(tr("Updating search index")); - label->setSizePolicy(sizePolicy); - hlayout->addWidget(label); + QLabel *label = new QLabel(tr("Updating search index")); + label->setSizePolicy(sizePolicy); + hlayout->addWidget(label); - QProgressBar *progressBar = new QProgressBar(); - progressBar->setRange(0, 0); - progressBar->setTextVisible(false); - progressBar->setSizePolicy(sizePolicy); + QProgressBar *progressBar = new QProgressBar(); + progressBar->setRange(0, 0); + progressBar->setTextVisible(false); + progressBar->setSizePolicy(sizePolicy); - hlayout->setSpacing(6); - hlayout->setMargin(0); - hlayout->addWidget(progressBar); + hlayout->setSpacing(6); + hlayout->setMargin(0); + hlayout->addWidget(progressBar); - statusBar()->addPermanentWidget(m_progressWidget); + statusBar()->addPermanentWidget(m_progressWidget); + } } void MainWindow::indexingFinished() -- cgit v0.12 From a13ef81dbd66472e7fb0c18ea528502295aa24ab Mon Sep 17 00:00:00 2001 From: kh Date: Mon, 18 May 2009 17:26:34 +0200 Subject: Make ctrl+lmb and mmb work in a same way everywhere (like in browsers). --- .../assistant/tools/assistant/bookmarkmanager.cpp | 77 +++++++++++----------- tools/assistant/tools/assistant/contentwindow.cpp | 9 ++- tools/assistant/tools/assistant/indexwindow.cpp | 9 ++- 3 files changed, 51 insertions(+), 44 deletions(-) diff --git a/tools/assistant/tools/assistant/bookmarkmanager.cpp b/tools/assistant/tools/assistant/bookmarkmanager.cpp index 6f5732f..66475a4 100644 --- a/tools/assistant/tools/assistant/bookmarkmanager.cpp +++ b/tools/assistant/tools/assistant/bookmarkmanager.cpp @@ -536,58 +536,57 @@ void BookmarkWidget::focusInEvent(QFocusEvent *e) bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) { - if (object == this && e->type() == QEvent::KeyPress) { - QKeyEvent *ke = static_cast(e); + if ((object == this) || (object == treeView->viewport())) { QModelIndex index = treeView->currentIndex(); - switch (ke->key()) { + if (e->type() == QEvent::KeyPress) { + QKeyEvent *ke = static_cast(e); if (index.isValid() && searchField->text().isEmpty()) { - case Qt::Key_F2: { - const QModelIndex& source = filterBookmarkModel->mapToSource(index); - QStandardItem *item = - bookmarkManager->treeBookmarkModel()->itemFromIndex(source); + if (ke->key() == Qt::Key_F2) { + QStandardItem *item = bookmarkManager->treeBookmarkModel() + ->itemFromIndex(filterBookmarkModel->mapToSource(index)); if (item) { item->setEditable(true); treeView->edit(index); item->setEditable(false); } - } break; - - case Qt::Key_Delete: { + } else if (ke->key() == Qt::Key_Delete) { bookmarkManager->removeBookmarkItem(treeView, filterBookmarkModel->mapToSource(index)); - } break; + } } - case Qt::Key_Up: - case Qt::Key_Down: - treeView->subclassKeyPressEvent(ke); - break; - - case Qt::Key_Enter: { - case Qt::Key_Return: - index = treeView->selectionModel()->currentIndex(); - if (index.isValid()) { - QString data = index.data(Qt::UserRole + 10).toString(); - if (!data.isEmpty() && data != QLatin1String("Folder")) - emit requestShowLink(data); - } - } break; + switch (ke->key()) { + default: break; + case Qt::Key_Up: { + case Qt::Key_Down: + treeView->subclassKeyPressEvent(ke); + } break; - case Qt::Key_Escape: - emit escapePressed(); - break; + case Qt::Key_Enter: { + case Qt::Key_Return: + index = treeView->selectionModel()->currentIndex(); + if (index.isValid()) { + QString data = index.data(Qt::UserRole + 10).toString(); + if (!data.isEmpty() && data != QLatin1String("Folder")) + emit requestShowLink(data); + } + } break; - default: - break; - } - } - else if (object == treeView->viewport() && e->type() == QEvent::MouseButtonRelease) { - const QModelIndex& index = treeView->currentIndex(); - QMouseEvent *me = static_cast(e); - if (index.isValid() && (me->button() == Qt::MidButton)) { - QString data = index.data(Qt::UserRole + 10).toString(); - if (!data.isEmpty() && data != QLatin1String("Folder")) - CentralWidget::instance()->setSourceInNewTab(data); + case Qt::Key_Escape: { + emit escapePressed(); + } break; + } + } else if (e->type() == QEvent::MouseButtonRelease) { + if (index.isValid()) { + QMouseEvent *me = static_cast(e); + bool controlPressed = me->modifiers() & Qt::ControlModifier; + if(((me->button() == Qt::LeftButton) && controlPressed) + || (me->button() == Qt::MidButton)) { + QString data = index.data(Qt::UserRole + 10).toString(); + if (!data.isEmpty() && data != QLatin1String("Folder")) + CentralWidget::instance()->setSourceInNewTab(data); + } + } } } return QWidget::eventFilter(object, e); diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp index 89060bd..9f39de5 100644 --- a/tools/assistant/tools/assistant/contentwindow.cpp +++ b/tools/assistant/tools/assistant/contentwindow.cpp @@ -124,10 +124,10 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e) QModelIndex index = m_contentWidget->indexAt(me->pos()); QItemSelectionModel *sm = m_contentWidget->selectionModel(); + Qt::MouseButtons button = me->button(); if (index.isValid() && (sm && sm->isSelected(index))) { - if (me->button() == Qt::LeftButton) { - itemClicked(index); - } else if (me->button() == Qt::MidButton) { + if ((button == Qt::LeftButton && (me->modifiers() & Qt::ControlModifier)) + || (button == Qt::MidButton)) { QHelpContentModel *contentModel = qobject_cast(m_contentWidget->model()); if (contentModel) { @@ -135,12 +135,15 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e) if (itm && !isPdfFile(itm)) CentralWidget::instance()->setSourceInNewTab(itm->url()); } + } else if (button == Qt::LeftButton) { + itemClicked(index); } } } return QWidget::eventFilter(o, e); } + void ContentWindow::showContextMenu(const QPoint &pos) { if (!m_contentWidget->indexAt(pos).isValid()) diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp index a2c0950..1117ae0 100644 --- a/tools/assistant/tools/assistant/indexwindow.cpp +++ b/tools/assistant/tools/assistant/indexwindow.cpp @@ -146,8 +146,13 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e) && e->type() == QEvent::MouseButtonRelease) { QMouseEvent *mouseEvent = static_cast(e); QModelIndex idx = m_indexWidget->indexAt(mouseEvent->pos()); - if (idx.isValid() && mouseEvent->button()==Qt::MidButton) - open(m_indexWidget, idx); + if (idx.isValid()) { + Qt::MouseButtons button = mouseEvent->button(); + if (((button == Qt::LeftButton) && (mouseEvent->modifiers() & Qt::ControlModifier)) + || (button == Qt::MidButton)) { + open(m_indexWidget, idx); + } + } } #ifdef Q_OS_MAC else if (obj == m_indexWidget && e->type() == QEvent::KeyPress) { -- cgit v0.12 From 9824e4a9afed9591175b07d22cd130c64b5457cf Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 18 May 2009 17:50:17 +0200 Subject: Added doc about QSharedMemory and other applications Task-number: 253835 Reviewed-by: David Boddie --- src/corelib/kernel/qsharedmemory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp index 9853079..87e154f 100644 --- a/src/corelib/kernel/qsharedmemory.cpp +++ b/src/corelib/kernel/qsharedmemory.cpp @@ -129,6 +129,10 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key, detached from the segment, and no references to the segment remain. Do not mix using QtSharedMemory and QSharedMemory. Port everything to QSharedMemory. + + \warning QSharedMemory changes the key in a Qt-specific way. + It is therefore currently not possible to use the shared memory of + non-Qt applications with QSharedMemory. */ /*! -- cgit v0.12 From 64e46dd18c2dcfe26107a41ee1cc48ed2f9c6f97 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Mon, 18 May 2009 20:22:12 +0200 Subject: Updated WebKit from /home/ariya/dev/webkit/qtwebkit-4.5 to origin/qtwebkit-4.5 ( 1f83e4058bffd5a3fe7e44cf45add01953a772d4 ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit since the last update: ++ b/LayoutTests/ChangeLog 2009-05-12 Ariya Hidayat Reviewed by Dimitri Glazkov. Added Qt-specific expected result for toDataURL test, since Qt does not support saving pixmaps to GIF. * platform/qt/fast/canvas/toDataURL-supportedTypes-expected.txt: Added. 2009-05-12 Ariya Hidayat Rubber-stamped by Simon Hausmann. Added Qt-specific expected result for Canvas getImageData's test. https://bugs.webkit.org/show_bug.cgi?id=22150 Since Qt is internally using premultiplied ARGB32 for doing alpha-blending painting, reading the color back will not necessarily give the same exact color. * platform/qt/Skipped: Excluded canvas-getImageData. * platform/qt/fast/canvas/canvas-getImageData-expected.txt: Added. 2009-04-29 Ariya Hidayat Reviewed by Simon Fraser. Updated expected results after Qt's GraphicsContext fixes. * platform/qt/fast/canvas/set-colors-expected.txt: 2009-04-24 Ariya Hidayat Reviewed by Simon Hausmann. Added Qt-specific expected result for color conversion. This is to compensate the lack of color profile in Qt to do color conversion, hence CMYK 0,0,0,1 always give pure black (#000) instead of very dark black. * platform/qt/fast/canvas/set-colors-expected.txt: Added. ++ b/WebCore/ChangeLog 2009-05-18 Ariya Hidayat Reviewed by Simon Hausmann. Done together with Balazs Kelemen . https://bugs.webkit.org/show_bug.cgi?id=24551 [Qt] Reuse FontPlatformData for the same FontDescription. This effectively prevents growing heap usage for loading every web page. * platform/graphics/qt/FontCacheQt.cpp: (WebCore::qHash): Necessary for FontPlatformDataCache. (WebCore::FontCache::getCachedFontPlatformData): Reuse the instance if it exists, otherwise create a new one and insert it in the cache. 2009-05-18 Balazs Kelemen Reviewed by Ariya Hidayat. https://bugs.webkit.org/show_bug.cgi?id=24551 [Qt] Fix the leak in FontFallbackList::fontDataAt() function. When creating a new instance of SimpleFontData, put it in the font list so that it can deleted later on. * platform/graphics/qt/FontFallbackListQt.cpp: (WebCore::FontFallbackList::invalidate): (WebCore::FontFallbackList::releaseFontData): (WebCore::FontFallbackList::fontDataAt): 2009-05-15 Ariya Hidayat Reviewed by Holger Freyther. [Qt] In the image decoder, remove the raw image data represented as QImage once the image is converted to QPixmap and inserted in the pixmap cache. This effectively reduces the heap usage when running on graphics system other than raster (i.e the case where QImage != QPixmap). * platform/graphics/qt/ImageDecoderQt.cpp: (WebCore::ImageDecoderQt::imageAtIndex): Nullified the image on purpose. * platform/graphics/qt/ImageDecoderQt.h: Made m_imageList mutable. 2009-05-15 Ariya Hidayat Reviewed by Holger Freyther. [Qt] Refactor alpha channel detection the image decoder. Sets the boolean flag as soon as the image is being read. * platform/graphics/qt/ImageDecoderQt.cpp: (WebCore::ImageDecoderQt::ImageDecoderQt): Initialized m_hasAlphaChannel. (WebCore::ImageDecoderQt::setData): Set the flag when appropriate. (WebCore::ImageDecoderQt::supportsAlpha): Simplified. (WebCore::ImageDecoderQt::reset): Resetted the flag. * platform/graphics/qt/ImageDecoderQt.h: Added m_hasAlphaChannel. 2009-05-13 Ariya Hidayat Reviewed by Sam Weinig. [Qt] Fix "lighther" composition mode. QPainter::CompositionMode_Plus is the right match. * platform/graphics/qt/GraphicsContextQt.cpp: (WebCore::toQtCompositionMode): 2009-04-29 Ariya Hidayat Reviewed by Simon Fraser. [Qt] Initialize GraphicsContext's and ImageBuffer's QPainter to match the default values of canvas attributes. * platform/graphics/qt/ImageBufferQt.cpp: (WebCore::ImageBufferData::ImageBufferData): 2009-04-27 Ariya Hidayat Reviewed by Tor Arne Vestbø. https://bugs.webkit.org/show_bug.cgi?id=18475 [Qt] Widget painting should follow the layout direction (LTR, RTL) of the element style, not the application layout direction. * platform/qt/RenderThemeQt.cpp: (WebCore::RenderThemeQt::applyTheme): --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 90 ++++++++++++++++++++++ .../WebCore/platform/graphics/qt/FontCacheQt.cpp | 27 ++++++- .../platform/graphics/qt/FontFallbackListQt.cpp | 12 ++- .../platform/graphics/qt/GraphicsContextQt.cpp | 2 +- .../WebCore/platform/graphics/qt/ImageBufferQt.cpp | 19 ++++- .../platform/graphics/qt/ImageDecoderQt.cpp | 13 +++- .../WebCore/platform/graphics/qt/ImageDecoderQt.h | 3 +- .../webkit/WebCore/platform/qt/RenderThemeQt.cpp | 4 + 9 files changed, 162 insertions(+), 10 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 26ce489..f5402ce 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - a6ebe3865025e2bb4d767a79435af4daf5a9b4db + 1f83e4058bffd5a3fe7e44cf45add01953a772d4 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 00bd427..23f3ca6 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,93 @@ +2009-05-18 Ariya Hidayat + + Reviewed by Simon Hausmann. + + Done together with Balazs Kelemen . + + https://bugs.webkit.org/show_bug.cgi?id=24551 + + [Qt] Reuse FontPlatformData for the same FontDescription. + This effectively prevents growing heap usage for loading every web page. + + * platform/graphics/qt/FontCacheQt.cpp: + (WebCore::qHash): Necessary for FontPlatformDataCache. + (WebCore::FontCache::getCachedFontPlatformData): Reuse the instance if + it exists, otherwise create a new one and insert it in the cache. + +2009-05-18 Balazs Kelemen + + Reviewed by Ariya Hidayat. + + https://bugs.webkit.org/show_bug.cgi?id=24551 + + [Qt] Fix the leak in FontFallbackList::fontDataAt() function. + When creating a new instance of SimpleFontData, put it in the font list + so that it can deleted later on. + + * platform/graphics/qt/FontFallbackListQt.cpp: + (WebCore::FontFallbackList::invalidate): + (WebCore::FontFallbackList::releaseFontData): + (WebCore::FontFallbackList::fontDataAt): + +2009-05-15 Ariya Hidayat + + Reviewed by Holger Freyther. + + [Qt] In the image decoder, remove the raw image data represented as QImage + once the image is converted to QPixmap and inserted in the pixmap cache. + This effectively reduces the heap usage when running on graphics system + other than raster (i.e the case where QImage != QPixmap). + + * platform/graphics/qt/ImageDecoderQt.cpp: + (WebCore::ImageDecoderQt::imageAtIndex): Nullified the image on purpose. + * platform/graphics/qt/ImageDecoderQt.h: Made m_imageList mutable. + +2009-05-15 Ariya Hidayat + + Reviewed by Holger Freyther. + + [Qt] Refactor alpha channel detection the image decoder. + Sets the boolean flag as soon as the image is being read. + + * platform/graphics/qt/ImageDecoderQt.cpp: + (WebCore::ImageDecoderQt::ImageDecoderQt): Initialized m_hasAlphaChannel. + (WebCore::ImageDecoderQt::setData): Set the flag when appropriate. + (WebCore::ImageDecoderQt::supportsAlpha): Simplified. + (WebCore::ImageDecoderQt::reset): Resetted the flag. + * platform/graphics/qt/ImageDecoderQt.h: Added m_hasAlphaChannel. + +2009-05-13 Ariya Hidayat + + Reviewed by Sam Weinig. + + [Qt] Fix "lighther" composition mode. + QPainter::CompositionMode_Plus is the right match. + + * platform/graphics/qt/GraphicsContextQt.cpp: + (WebCore::toQtCompositionMode): + +2009-04-29 Ariya Hidayat + + Reviewed by Simon Fraser. + + [Qt] Initialize GraphicsContext's and ImageBuffer's QPainter to match + the default values of canvas attributes. + + * platform/graphics/qt/ImageBufferQt.cpp: + (WebCore::ImageBufferData::ImageBufferData): + +2009-04-27 Ariya Hidayat + + Reviewed by Tor Arne Vestbø. + + https://bugs.webkit.org/show_bug.cgi?id=18475 + + [Qt] Widget painting should follow the layout direction (LTR, RTL) + of the element style, not the application layout direction. + + * platform/qt/RenderThemeQt.cpp: + (WebCore::RenderThemeQt::applyTheme): + 2009-03-13 Adam Bergkvist Reviewed by Alexey Proskuryakov. diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp index 8a31861..5d1f147 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp @@ -26,6 +26,9 @@ #include "FontDescription.h" #include "FontPlatformData.h" #include "Font.h" +#include "StringHash.h" + +#include namespace WebCore { @@ -33,9 +36,31 @@ void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector FontPlatformDataCache; + +// using Q_GLOBAL_STATIC leads to crash. TODO investigate the way to fix this. +static FontPlatformDataCache* gFontPlatformDataCache; + +uint qHash(const FontDescription& key) +{ + uint value = CaseFoldingHash::hash(key.family().family()); + value ^= key.computedPixelSize(); + value ^= static_cast(key.weight()); + return value; +} + FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& description, const AtomicString& family, bool checkingAlternateName) { - return new FontPlatformData(description); + if (!gFontPlatformDataCache) + gFontPlatformDataCache = new FontPlatformDataCache; + + FontPlatformData* fontData = gFontPlatformDataCache->value(description, 0); + if (!fontData) { + fontData = new FontPlatformData(description); + gFontPlatformDataCache->insert(description, fontData); + } + + return fontData; } SimpleFontData* FontCache::getCachedFontData(const FontPlatformData*) diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp index 22ae205..50627b7 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp @@ -42,8 +42,6 @@ FontFallbackList::FontFallbackList() void FontFallbackList::invalidate(WTF::PassRefPtr fontSelector) { - releaseFontData(); - m_fontList.clear(); m_familyIndex = 0; m_pitch = UnknownPitch; m_loadingCustomFonts = false; @@ -53,6 +51,9 @@ void FontFallbackList::invalidate(WTF::PassRefPtr fontSel void FontFallbackList::releaseFontData() { + if (m_fontList.size()) + delete m_fontList[0].first; + m_fontList.clear(); } void FontFallbackList::determinePitch(const WebCore::Font* font) const @@ -90,7 +91,12 @@ const FontData* FontFallbackList::fontDataAt(const WebCore::Font* _font, unsigne family = family->next(); } - return new SimpleFontData(FontPlatformData(description), _font->wordSpacing(), _font->letterSpacing()); + if (m_fontList.size()) + return m_fontList[0].first; + + const FontData* result = new SimpleFontData(FontPlatformData(description), _font->wordSpacing(), _font->letterSpacing()); + m_fontList.append(pair(result, result->isCustomFont())); + return result; } const FontData* FontFallbackList::fontDataForCharacters(const WebCore::Font* font, const UChar*, int) const diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index 6c90ea3..490b54b 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -98,7 +98,7 @@ static inline QPainter::CompositionMode toQtCompositionMode(CompositeOperator op case CompositeHighlight: return QPainter::CompositionMode_SourceOver; case CompositePlusLighter: - return QPainter::CompositionMode_SourceOver; + return QPainter::CompositionMode_Plus; } return QPainter::CompositionMode_SourceOver; diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp index 29a02d4..333269e 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp @@ -47,7 +47,24 @@ ImageBufferData::ImageBufferData(const IntSize& size) : m_pixmap(size) { m_pixmap.fill(QColor(Qt::transparent)); - m_painter.set(new QPainter(&m_pixmap)); + + QPainter* painter = new QPainter(&m_pixmap); + m_painter.set(painter); + + // Since ImageBuffer is used mainly for Canvas, explicitly initialize + // its painter's pen and brush with the corresponding canvas defaults + // NOTE: keep in sync with CanvasRenderingContext2D::State + QPen pen = painter->pen(); + pen.setColor(Qt::black); + pen.setWidth(1); + pen.setCapStyle(Qt::FlatCap); + pen.setJoinStyle(Qt::MiterJoin); + pen.setMiterLimit(10); + painter->setPen(pen); + QBrush brush = painter->brush(); + brush.setColor(Qt::black); + painter->setBrush(brush); + painter->setCompositionMode(QPainter::CompositionMode_SourceOver); } ImageBuffer::ImageBuffer(const IntSize& size, bool grayScale, bool& success) diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp index 394c7a7..cd32428 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp @@ -197,7 +197,8 @@ ImageDecoderQt* ImageDecoderQt::create(const SharedBuffer& data) } ImageDecoderQt::ImageDecoderQt(const QString &imageFormat) - : m_imageFormat(imageFormat) + : m_hasAlphaChannel(false) + , m_imageFormat(imageFormat) { } @@ -212,6 +213,7 @@ bool ImageDecoderQt::hasFirstImageHeader() const void ImageDecoderQt::reset() { + m_hasAlphaChannel = false; m_failed = false; m_imageList.clear(); m_pixmapCache.clear(); @@ -230,6 +232,9 @@ void ImageDecoderQt::setData(const IncomingData &data, bool allDataReceived) const ReadContext::ReadResult readResult = readContext.read(allDataReceived); + if (hasFirstImageHeader()) + m_hasAlphaChannel = m_imageList[0].m_image.hasAlphaChannel(); + if (debugImageDecoderQt) qDebug() << " read returns " << readResult; @@ -280,7 +285,7 @@ int ImageDecoderQt::repetitionCount() const bool ImageDecoderQt::supportsAlpha() const { - return hasFirstImageHeader() && m_imageList[0].m_image.hasAlphaChannel(); + return m_hasAlphaChannel; } int ImageDecoderQt::duration(size_t index) const @@ -314,6 +319,10 @@ QPixmap* ImageDecoderQt::imageAtIndex(size_t index) const if (!m_pixmapCache.contains(index)) { m_pixmapCache.insert(index, QPixmap::fromImage(m_imageList[index].m_image)); + + // store null image since the converted pixmap is already in pixmap cache + Q_ASSERT(m_imageList[index].m_imageState == ImageComplete); + m_imageList[index].m_image = QImage(); } return &m_pixmapCache[index]; } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h index a2eb6aa..b8c3edd 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.h @@ -81,8 +81,9 @@ private: int m_duration; }; + bool m_hasAlphaChannel; typedef QList ImageList; - ImageList m_imageList; + mutable ImageList m_imageList; mutable QHash m_pixmapCache; int m_loopCount; QString m_imageFormat; diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp index a9da76b..02d17ed 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp @@ -737,6 +737,10 @@ ControlPart RenderThemeQt::applyTheme(QStyleOption& option, RenderObject* o) con if (isHovered(o)) option.state |= QStyle::State_MouseOver; + option.direction = Qt::LeftToRight; + if (o->style() && o->style()->direction() == WebCore::RTL) + option.direction = Qt::RightToLeft; + ControlPart result = o->style()->appearance(); switch (result) { -- cgit v0.12 From 56ffcd446d7b4a411fbada3a63d06c6a3e262a36 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Mon, 18 May 2009 20:43:28 +0200 Subject: Update QtWebKit changes for the next patch release. Reviewed-by: TrustMe --- dist/changes-4.5.2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dist/changes-4.5.2 b/dist/changes-4.5.2 index 3180b7c..a132028 100644 --- a/dist/changes-4.5.2 +++ b/dist/changes-4.5.2 @@ -33,6 +33,16 @@ Third party components * Library * **************************************************************************** +- QtWebKit + * Backported fixes for critical bugs, memory leaks, and crashes from + WebKit trunk (with revision numbers) related to: + Canvas (r40546, r41221 r41355, r42996, r43645) + Memory (r41527, r43764, r43828, r43830) + JavaScript (r39882, r40086, r40131, r40133) + Rendering (r41285, r41296, r41659, r42887) + Network (r41664, r42516) + Plugins (r41346) + Clipboard (r41360) **************************************************************************** * Database Drivers * -- cgit v0.12 From ba7e2d913deb4adeef071002e3518f43949e6a08 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Tue, 19 May 2009 13:33:21 +1000 Subject: Fixed incorrect pass/fail semantics for xpass/xfail when using xunitxml testlib logger. In the testlib plain logger, xfail is considered a pass and xpass considered a fail. xunitxml had the opposite behavior; change it to be the same. Autotest: included --- src/testlib/qtestlogger.cpp | 21 +++++++++++++++------ tests/auto/selftests/expected_xunit.txt | 13 ++++++++++++- tests/auto/selftests/xunit/tst_xunit.cpp | 29 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index 2249e8a..46af232 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -180,7 +180,7 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, switch (type) { case QAbstractTestLogger::XPass: - ++passCounter; + ++failureCounter; typeBuf = "xpass"; break; case QAbstractTestLogger::Pass: @@ -188,7 +188,7 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, typeBuf = "pass"; break; case QAbstractTestLogger::XFail: - ++failureCounter; + ++passCounter; typeBuf = "xfail"; break; case QAbstractTestLogger::Fail: @@ -200,7 +200,8 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, break; } - if (type == QAbstractTestLogger::Fail || type == QAbstractTestLogger::XFail) { + if (type == QAbstractTestLogger::Fail || type == QAbstractTestLogger::XPass + || ((format != TLF_XunitXml) && (type == QAbstractTestLogger::XFail))) { QTestElement *failureElement = new QTestElement(QTest::LET_Failure); failureElement->addAttribute(QTest::AI_Result, typeBuf); if(file) @@ -230,10 +231,10 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, if (!strcmp(oldResult, "pass")) { overwrite = true; } - else if (!strcmp(oldResult, "xpass")) { - overwrite = (type == QAbstractTestLogger::XFail || type == QAbstractTestLogger::Fail); - } else if (!strcmp(oldResult, "xfail")) { + overwrite = (type == QAbstractTestLogger::XPass || type == QAbstractTestLogger::Fail); + } + else if (!strcmp(oldResult, "xpass")) { overwrite = (type == QAbstractTestLogger::Fail); } if (overwrite) { @@ -251,6 +252,14 @@ void QTestLogger::addIncident(IncidentTypes type, const char *description, QTest::qt_snprintf(buf, sizeof(buf), "%i", line); currentLogElement->addAttribute(QTest::AI_Line, buf); + + /* + Since XFAIL does not add a failure to the testlog in xunitxml, add a message, so we still + have some information about the expected failure. + */ + if (format == TLF_XunitXml && type == QAbstractTestLogger::XFail) { + QTestLogger::addMessage(QAbstractTestLogger::Info, description, file, line); + } } void QTestLogger::addBenchmarkResult(const QBenchmarkResult &result) diff --git a/tests/auto/selftests/expected_xunit.txt b/tests/auto/selftests/expected_xunit.txt index 875dda6..cb74491 100644 --- a/tests/auto/selftests/expected_xunit.txt +++ b/tests/auto/selftests/expected_xunit.txt @@ -1,5 +1,5 @@ - + @@ -20,10 +20,21 @@ + + + + + + + + + ]]> + + diff --git a/tests/auto/selftests/xunit/tst_xunit.cpp b/tests/auto/selftests/xunit/tst_xunit.cpp index dbe9fec..c3c90ab 100644 --- a/tests/auto/selftests/xunit/tst_xunit.cpp +++ b/tests/auto/selftests/xunit/tst_xunit.cpp @@ -53,6 +53,9 @@ private slots: void testFunc2(); void testFunc3(); void testFunc4(); + void testFunc5(); + void testFunc6(); + void testFunc7(); }; tst_Xunit::tst_Xunit() @@ -81,6 +84,32 @@ void tst_Xunit::testFunc4() QFAIL("a forced failure!"); } +/* + Note there are two testfunctions which give expected failures. + This is so we can test that expected failures don't add to failure + counts and unexpected passes do. If we had one xfail and one xpass + testfunction, we couldn't test which one of them adds to the failure + count. +*/ + +void tst_Xunit::testFunc5() +{ + QEXPECT_FAIL("", "this failure is expected", Abort); + QVERIFY(false); +} + +void tst_Xunit::testFunc6() +{ + QEXPECT_FAIL("", "this failure is also expected", Abort); + QVERIFY(false); +} + +void tst_Xunit::testFunc7() +{ + QEXPECT_FAIL("", "this pass is unexpected", Abort); + QVERIFY(true); +} + QTEST_APPLESS_MAIN(tst_Xunit) #include "tst_xunit.moc" -- cgit v0.12 From d6127efabb74e2004608f53d0be3b7c4a6df768d Mon Sep 17 00:00:00 2001 From: jasplin Date: Tue, 19 May 2009 08:11:19 +0200 Subject: Fixed typo. Reviewed-by: TrustMe --- src/network/access/qhttp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/access/qhttp.cpp b/src/network/access/qhttp.cpp index 96ccc91..2002641 100644 --- a/src/network/access/qhttp.cpp +++ b/src/network/access/qhttp.cpp @@ -1446,7 +1446,7 @@ QString QHttpRequestHeader::toString() const that indicates if the request finished with an error. To make an HTTP request you must set up suitable HTTP headers. The - following example demonstrates, how to request the main HTML page + following example demonstrates how to request the main HTML page from the Trolltech home page (i.e., the URL \c http://qtsoftware.com/index.html): -- cgit v0.12 From 6a94214e691966874faaab0bacd5d787850e0546 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Tomoyuki Date: Tue, 19 May 2009 16:48:10 +0900 Subject: Update japanese translation file "translations/qt_ja_JP.ts". QtXmlPatterns is not completed. --- translations/qt_ja_JP.ts | 5920 +++++++++++++++++++++++----------------------- 1 file changed, 2993 insertions(+), 2927 deletions(-) diff --git a/translations/qt_ja_JP.ts b/translations/qt_ja_JP.ts index 7c8b874..55b21d0 100644 --- a/translations/qt_ja_JP.ts +++ b/translations/qt_ja_JP.ts @@ -2,29 +2,12 @@ - AudioOutput - - - <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> - - - - - <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> - - - - - Revert back to device '%1' - - - - CloseButton - + Close Tab - + ToolTip + タブを閉じる @@ -43,32 +26,50 @@ Notifications - + 通知 Music - + 音楽 Video - + 動画 Communication - + コミュニケーション Games - + ゲーム Accessibility - + アクセシビリティ + + + + Phonon::AudioOutput + + + <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> + <html>オーディオ再生デバイス<b>%1</b>が動作しません。<br/><b>%2</b>を使用します。</html> + + + + <html>Switching to the audio playback device <b>%1</b><br/>which just became available and has higher preference.</html> + <html>より高いパフォーマンスを得られるオーディオデバイス <b>%1</b> が使用可能となったので、使用します。</html> + + + + Revert back to device '%1' + デバイス '%1' に戻す @@ -77,13 +78,13 @@ Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. Some video features have been disabled. - + 警告: gstreamer0.10-plugins-good がインストールされていません。幾つかの動画機能は使用できません。 Warning: You do not seem to have the base GStreamer plugins installed. All audio and video support has been disabled - + 警告: GStreamer plugin がインストールされていません。すべての音声、動画機能は使用できません @@ -94,12 +95,14 @@ Check your Gstreamer installation and make sure you have libgstreamer-plugins-base installed. - + 再生できません。 + +Gstreamer と libgstreamer-plugins-base が正しくインストールされているか確認してください。 A required codec is missing. You need to install the following codec(s) to play this content: %0 - + 必要なコーデックがみつかりません。このコンテンツを再生するためには、以下のコーデックをインストールする必要があります: %0 @@ -111,27 +114,27 @@ have libgstreamer-plugins-base installed. Could not open media source. - + メディアソースを開くことができません。 Invalid source type. - + 無効なソースの形式です。 Could not locate media source. - + メディアソースがみつかりません。 Could not open audio device. The device is already in use. - + オーディオデバイスを開くことができません。デバイスは既に他のプロセスにより使用されています。 Could not decode media source. - + メディアソースを開くことができません。見つからないか、未知の形式です。 @@ -139,15 +142,22 @@ have libgstreamer-plugins-base installed. + + Volume: %1% - + 音量: %1% - + Use this slider to adjust the volume. The leftmost position is 0%, the rightmost is %1% - + スライダを用いて音量を指定してください。左端が0%、右端が%1%になります + + + + Muted + ミュート @@ -168,12 +178,12 @@ have libgstreamer-plugins-base installed. True - True + False - False + @@ -209,7 +219,7 @@ have libgstreamer-plugins-base installed. ディレクトリを選択 - + Copy or Move a File ファイルをコピーまたは移動 @@ -226,7 +236,7 @@ have libgstreamer-plugins-base installed. - + Cancel キャンセル @@ -344,17 +354,17 @@ have libgstreamer-plugins-base installed. Symlink to File - ファイルへのSymlink + ファイルへのシンボリックリンク Symlink to Directory - ディレクトリへのSymlink + ディレクトリへのシンボリックリンク Symlink to Special - スペシャルへのSymlink + スペシャルファイルへのシンボリックリンク @@ -455,7 +465,7 @@ have libgstreamer-plugins-base installed. the symlink - Symlink + シンボリックリンク @@ -465,7 +475,7 @@ have libgstreamer-plugins-base installed. <qt>Are you sure you wish to delete %1 "%2"?</qt> - <qt>%1「%2」を削除しますか?</qt> + <qt>%1 "%2" を削除しますか?</qt> @@ -556,8 +566,9 @@ to %2 名前を変更できませんでした %1 -へ -%2 +を +%2 +へ @@ -607,13 +618,13 @@ to Q3TabDialog - - + + OK OK - + Apply 適用 @@ -737,7 +748,7 @@ to Displays the name of the window and contains controls to manipulate it - ウィンドウの名前を表示し、ウィンドウを操作するコントロールを含みます + ウィンドウの名前と、ウィンドウを操作するコントロールを表示します @@ -755,43 +766,43 @@ to The protocol `%1' is not supported - プロトコル「%1」はサポートされていません + プロトコル '%1' はサポートされていません The protocol `%1' does not support listing directories - プロトコル「%1」ではディレクトリのリストをサポートしていません + プロトコル '%1' はディレクトリのリスティングをサポートしていません The protocol `%1' does not support creating new directories - プロトコル「%1」では新しいディレクトリの作成をサポートしていません + プロトコル '%1' は新しいディレクトリの作成をサポートしていません The protocol `%1' does not support removing files or directories - プロトコル「%1」ではファイルまたはディレクトリの削除をサポートしていません + プロトコル '%1' はファイルまたはディレクトリの削除をサポートしていません The protocol `%1' does not support renaming files or directories - プロトコル「%1」ではファイルまたはディレクトリの名前の変更をサポートしていません + プロトコル '%1' はファイルまたはディレクトリの名前の変更をサポートしていません The protocol `%1' does not support getting files - プロトコル「%1」ではファイルの取得をサポートしていません + プロトコル '%1' はファイルの取得をサポートしていません The protocol `%1' does not support putting files - プロトコル「%1」ではファイルの送信をサポートしていません + プロトコル '%1' はファイルの送信をサポートしていません The protocol `%1' does not support copying or moving files or directories - プロトコル「%1」ではファイルまたはディレクトリのコピーまたは移動をサポートしていません + プロトコル '%1' はファイルまたはディレクトリのコピーまたは移動をサポートしていません @@ -848,14 +859,15 @@ to Connection timed out - 接続がタイムアウトしました + 接続がタイムアウトしました Operation on socket is not supported - + 抽象ソケットクラスでのソケットのエラー + このソケットへのこの操作はサポートされていません @@ -870,13 +882,13 @@ to Network unreachable - ネットワークへ到達できません + ネットワークへ到達できません QAbstractSpinBox - + &Step up 上(&S) @@ -888,7 +900,7 @@ to &Select All - + すべてを選択(&S) @@ -914,7 +926,7 @@ to 互換性のないQtライブラリエラー - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. LTR @@ -940,7 +952,7 @@ to COM &Object: - COM オブジェクト(&O) + COM オブジェクト(&O): @@ -1001,7 +1013,7 @@ to Select Color - + @@ -1046,17 +1058,17 @@ to False - False + True - True + Close - 閉じる + 閉じる @@ -1065,19 +1077,19 @@ to %1: key is empty QSystemSemaphore - + %1: キーが空です %1: unable to make key QSystemSemaphore - + %1: キーを作成できません %1: ftok failed QSystemSemaphore - + %1: fork に失敗しました @@ -1165,17 +1177,17 @@ to QDial - + ダイヤル SpeedoMeter - + スピードメータ SliderHandle - + スライダハンドル @@ -1183,12 +1195,12 @@ to What's This? - ヒント + ヒント? Done - + 終了 @@ -1203,7 +1215,7 @@ to Cancel - キャンセル + キャンセル @@ -1233,12 +1245,12 @@ to Save - 保存 + 保存 &Save - 保存(&S) + 保存(&S) @@ -1248,17 +1260,17 @@ to &Cancel - キャンセル(&C) + キャンセル(&C) Close - 閉じる + 閉じる &Close - 閉じる(&C) + 閉じる(&C) @@ -1313,13 +1325,13 @@ to &OK - OK(&O) + OK(&O) QDirModel - + Name 名前 @@ -1351,17 +1363,17 @@ to Close - 閉じる + 閉じる Dock - + ドック Float - + フロート @@ -1369,12 +1381,12 @@ to More - 増やす + 増やす Less - 減らす + 減らす @@ -1392,7 +1404,7 @@ to Fatal Error: - 致命的エラー: + 致命的なエラー: @@ -1409,41 +1421,41 @@ to QFile - + Destination file exists - + 新しい名前のファイルは既に存在します Cannot remove source file - + 元のファイルを削除できません - + Cannot open %1 for input - + コピー元ファイル %1 を読めません Cannot open for output - + コピー先のファイルをオープンできません Failure to write block - + 書き込みに失敗しました Cannot create %1 for output - + コピー先として %1 を作成できません QFileDialog - - + + All Files (*) すべてのファイル(*) @@ -1453,33 +1465,33 @@ to ディレクトリ - - + + Directory: ディレクトリ: - - + + File &name: - ファイル名: + ファイル名(&N): - + &Open オープン(&O) - + &Save 保存(&S) - + Open オープン @@ -1499,7 +1511,7 @@ Please verify the correct file name was given %1 already exists. Do you want to replace it? - %1はすでに存在します。 + %1 はすでに存在します。 置き換えますか? @@ -1518,7 +1530,7 @@ Please verify the correct file name was given. - + %1 Directory not found. Please verify the correct directory name was given. @@ -1531,7 +1543,7 @@ Please verify the correct directory name was given. ソート - + &Rename 名前の変更(&R) @@ -1619,14 +1631,38 @@ Please verify the correct directory name was given. ファイル - + + File Folder + Match Windows Explorer + ファイルフォルダ + + + + Folder + All other platforms + フォルダ + + + + Alias + Mac OS X Finder + エイリアス + + + + Shortcut + All other platforms + ショートカット + + + Unknown 不明 All Files (*.*) - すべてのファイル(*.*) + すべてのファイル(*.*) @@ -1642,16 +1678,16 @@ Please verify the correct directory name was given. ディレクトリを選択 - + '%1' is write protected. Do you want to delete it anyway? '%1' は書き込みが禁止されています。 -本当に削除しますか? +本当に削除しますか? Are sure you want to delete '%1'? - '%1' を本当に削除しますか? + '%1' を本当に削除しますか? @@ -1659,46 +1695,46 @@ Do you want to delete it anyway? ディレクトリを削除できませんでした。 - + Find Directory - ディレクトリの検索 + ディレクトリの検索 Show - + 表示 &New Folder - + 新しいフォルダ(&N) - + &Choose - + 選択(&C) - + New Folder - 新しいフォルダ + 新しいフォルダ Recent Places - + 履歴 Forward - 進む + 進む - + Remove - + 削除 @@ -1732,48 +1768,53 @@ Do you want to delete it anyway? + %1 TB - + %1 TB + %1 GB - + %1 GB + %1 MB - + %1 MB + %1 KB - + %1 KB + %1 bytes - + %1 バイト Invalid filename - + 無効なファイル名 <b>The name "%1" can not be used.</b><p>Try using another name, with fewer characters or no punctuations marks. - + <b>ファイル名 "%1" は使用できません。</b><p>名前を短くしたり、アクセント記号などを削除して再度試してください。 - + My Computer - マイ コンピュータ + マイ コンピュータ Computer - + コンピュータ @@ -1782,215 +1823,216 @@ Do you want to delete it anyway? Normal - + ここはどう訳すべきか... + 明朝 Bold - + ゴシック Demi Bold - + Demi Bold Black - + 太字 Demi - + Demi Light - + 細字 Italic - + イタリック Oblique - + 斜体 Any - + すべて Latin - + ラテン Greek - + ギリシャ Cyrillic - + キリル Armenian - + アルメニア Hebrew - + ヘブライ Arabic - + アラビア Syriac - + シリア Thaana - + ターナ Devanagari - + デーヴァナーガリー Bengali - + ベンガル Gurmukhi - + グルムキー Gujarati - + グジャラート Oriya - + オリヤー Tamil - + タミル Telugu - + テルグ Kannada - + カンナダ Malayalam - + マラヤーラム Sinhala - + シンハラ Thai - + タイ Lao - + ラーオ Tibetan - + チベット Myanmar - + ビルマ Georgian - + グルジア Khmer - + クメール Simplified Chinese - + 簡体中国 Traditional Chinese - + 繁体中国 Japanese - + 日本 Korean - + ハングル Vietnamese - + ベトナム Symbol - + 記号 Ogham - + オガム Runic - + ルーン @@ -2065,7 +2107,7 @@ Do you want to delete it anyway? Connection timed out to host %1 - + ホスト %1 への接続がタイムアウトしました @@ -2231,7 +2273,7 @@ Do you want to delete it anyway? HTTPS connection requested but SSL support not compiled in - + HTTPSによる接続が要求されましたが、SSLのサポートがコンパイル時に組み込まれていないため、接続できません @@ -2268,15 +2310,15 @@ Do you want to delete it anyway? Unknown authentication method - + 非対応の認証方法が要求されました Error writing response to device - + デバイスへの書き込み時にエラーが発生しました - + Connection refused 接続が拒否されました @@ -2344,42 +2386,42 @@ Do you want to delete it anyway? Proxy authentication required - + プロキシーの認証が必要です Authentication required - + 認証が必要です Connection refused (or timed out) - + 接続が拒否されたか、タイムアウトしました Proxy requires authentication - + プロキシーの認証が必要です Host requires authentication - + ホストの認証が必要です Data corrupted - + データが破損しています Unknown protocol specified - + 未対応のプロトコルです SSL handshake failed - + SSLのハンドシェークに失敗しました @@ -2387,53 +2429,53 @@ Do you want to delete it anyway? Did not receive HTTP response from proxy - + プロキシーからHTTPレスポンスを受信できませんでした Error parsing authentication request from proxy - + プロキシーからの認証要求のパースに失敗しました Authentication required - + 認証が必要です Proxy denied connection - + プロキシーが接続を拒否しました Error communicating with HTTP proxy - + HTTP プロキシーとの通信にて、エラーが発生しました Proxy server not found - + プロキシーサーバが見つかりません Proxy connection refused - + プロキシーが接続を拒否しました Proxy server connection timed out - + プロキシーとの接続がタイムアウトしました Proxy connection closed prematurely - + プロキシーの接続が通信の終了前に切断されました QIBaseDriver - + Error opening database データベースのオープンでエラーが発生しました @@ -2566,7 +2608,7 @@ Do you want to delete it anyway? デバイスの残り容量がありません - + Unknown error 不明なエラー @@ -2599,7 +2641,7 @@ Do you want to delete it anyway? Enter a value: - + 数値を入力: @@ -2650,35 +2692,35 @@ Do you want to delete it anyway? The shared library was not found. - + 共有ライブラリがみつかりません。 The file '%1' is not a valid Qt plugin. - + ファイル '%1' は Qt プラグインではありません。 The plugin '%1' uses incompatible Qt library. (Cannot mix debug and release libraries.) - + プラグイン '%1' はこの Qt と互換性のないライブラリを使用しています。 (デバック版とリリース版のライブラリを同時に使用することはできません) Cannot load library %1: %2 - + ライブラリ '%1' を読み込むことができません: %2 Cannot unload library %1: %2 - + ライブラリ %1 を解放することができません: %2 Cannot resolve symbol "%1" in %2: %3 - + '%2'に含まれる識別子 "%1" を解決できません: %3 @@ -2723,25 +2765,24 @@ Do you want to delete it anyway? QLocalServer - + %1: Name error - + %1: 名前の解決に失敗 %1: Permission denied - + %1: 許可されていません %1: Address in use - + %1: アドレスは既に使用されています - %1: Unknown error %2 - + %1: 未知のエラー %2 @@ -2750,13 +2791,13 @@ Do you want to delete it anyway? %1: Connection refused - + %1: 接続が拒否されました %1: Remote closed - + %1: リモートにより接続が閉じられました @@ -2764,61 +2805,61 @@ Do you want to delete it anyway? %1: Invalid name - + %1: 無効な名前です %1: Socket access error - + %1: ソケットアクセスのエラーです %1: Socket resource error - + %1: ソケットリソースのエラーです %1: Socket operation timed out - + %1: ソケット操作がタイムアウトしました %1: Datagram too large - + %1: データグラムが大きすぎます %1: Connection error - + %1: 接続のエラーが発生しました %1: The socket operation is not supported - + %1: そのソケット操作はサポートされていません %1: Unknown error - + %1: 未知のエラーです %1: Unknown error %2 - + %1: 未知のエラー %2 QMYSQLDriver - + Unable to open database ' データベースをオープンできません ' @@ -2846,12 +2887,12 @@ Do you want to delete it anyway? QMYSQLResult - + Unable to fetch data データをフェッチできません - + Unable to execute query クエリーを実行できません @@ -2861,13 +2902,13 @@ Do you want to delete it anyway? 実行結果を記録できません - + Unable to prepare statement プリペアステートメントを使えません - + Unable to reset statement ステートメントをリセットできません @@ -2893,14 +2934,14 @@ Do you want to delete it anyway? ステートメントの実行結果を記録できません - + Unable to execute next query - + 次のクエリーを実行できません Unable to store next result - + 次の結果を記録できません @@ -2908,7 +2949,7 @@ Do you want to delete it anyway? (Untitled) - + (タイトルなし) @@ -2916,92 +2957,93 @@ Do you want to delete it anyway? %1 - [%2] - %1 - [%2] + %1 - [%2] Close - 閉じる + 閉じる Minimize - 最小化 + 最小化 Restore Down - 元に戻す + 元に戻す &Restore - 元に戻す(&R) + 元に戻す(&R) &Move - 移動(&M) + 移動(&M) &Size - + サイズ(&S) Mi&nimize - 最小化(&N) + 最小化(&N) Ma&ximize - 最大化(&X) + 最大化(&X) Stay on &Top - 常に手前に表示(&T) + 常に手前に表示(&T) &Close - 閉じる(&C) + 閉じる(&C) - [%1] - + - [%1] Maximize - 最大化 + 最大化 Unshade - + たぶん選択・非選択状態のウィンドウのことだと思うけど。fvwmなどのx11で使われている用語 + 非選択 Shade - + 選択 Restore - + 元に戻す Help - ヘルプ + ヘルプ Menu - メニュー + メニュー @@ -3082,7 +3124,32 @@ Do you want to delete it anyway? <h3>About Qt</h3><p>This program uses Qt version %1.</p><p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qt for Embedded Linux and Qt for Windows CE.</p><p>Qt is available under three different licensing options designed to accommodate the needs of our various users.</p>Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 2.1 or GNU GPL version 3.0.</p><p>Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications (proprietary or open source) provided you can comply with the terms and conditions of the GNU LGPL version 2.1.</p><p>Qt licensed under the GNU General Public License version 3.0 is appropriate for the development of Qt applications where you wish to use such applications in combination with software subject to the terms of the GNU GPL version 3.0 or where you are otherwise willing to comply with the terms of the GNU GPL version 3.0.</p><p>Please see <a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> for an overview of Qt licensing.</p><p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p><p>Qt is a Nokia product. See <a href="http://www.qtsoftware.com/qt/">www.qtsoftware.com/qt</a> for more information.</p> - + <h3>Qtについて</h3> +<p>このプログラムは Qt バージョン %1 を使用しています。</p> +<p>Qt は、クロスプラットホームのアプリケーション開発に使用される C++ のツールキットです。</p> +<p>Qt は、 MS&nbsp;Windows, Mac&nbsp;OS&nbsp;X, Linux, そして多数の Unix 系OS環境に対して、単一のソースからバイナリを生成します。 +また、 Linux および Windows CE を元とした組み込み環境にも対応しています。</p> +<p>Qt は様々なユーザの要望に応じるために、3つの異なるライセンスで提供されています。</p> +<p> +Qt 商用ライセンスは、プロプライエタリまたは商用ソフトウェアに適用できます。 +この場合は、他者とのソースコードの共有を拒否し、 GNU LGP バージョン 2.1 または GNU GPL バージョン 3.0 を許容できないソフトウェアにおいて Qt を使用できます。 +</p> +<p> +Qt GNU LGPL バージョン 2.1 ライセンスは、プロプライエタリまたはオープンソースソフトウェアに適用できます。 +この場合は、 GNU LGPL バージョン 2.1 に従う必要があります。 +</p> +<p> +Qt GNU General Public License バージョン 3.0 ライセンスは、GNU GPL バージョン 3.0 または GPL 3.0 と互換性のあるライセンスを採用しているソフトウェアに適用されます。 +この場合は、GNU GPL バージョン 3.0 に従う必要があります。 +</p> +<p> +ライセンスの詳細については、<a href="http://www.qtsoftware.com/products/licensing">www.qtsoftware.com/products/licensing</a> +を参照してください。</p> +<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p> +<p>Qt は Nokia の製品です。詳細については<a href="http://www.qtsoftware.com/qt/">www.qtsoftware.com/qt</a> を参照してください。</p> +<p> +訳注: ライセンスはここにある翻訳は参考のためのものであり、オリジナルの(英語の)ものが正式なものとなります。 +</p> @@ -3090,7 +3157,7 @@ Do you want to delete it anyway? Select IM - 入力メソッドを選択 + インプットメソッドを選択 @@ -3098,12 +3165,12 @@ Do you want to delete it anyway? Multiple input method switcher - 複数の入力メソッドを切り替え + 複数のインプットメソッドを切り替え Multiple input method switcher that uses the context menu of the text widgets - テキストウィジェットのコンテキストメニューを使った複数の入力メソッドの切り替えです + テキストウィジェットのコンテキストメニューを使った複数のインプットメソッドの切り替えです @@ -3111,7 +3178,7 @@ Do you want to delete it anyway? Unable to initialize non-blocking socket - ノンブロッキングソケットを初期化できません + 非ブロック型ソケットを初期化できません @@ -3236,7 +3303,7 @@ Do you want to delete it anyway? The proxy type is invalid for this operation - + このプロキシーは、この操作に対応していません @@ -3244,93 +3311,101 @@ Do you want to delete it anyway? Error opening %1 - + オープンのエラー %1 + + + + QNetworkAccessDebugPipeBackend + + + Write error writing to %1: %2 + %1 への書き込み時にエラーが発生しました: %2 QNetworkAccessFileBackend - + Request for opening non-local file %1 - + 非ローカルファイル %1 をオープンするよう要求されましたが、ローカルファイルのみオープンできます - + Error opening %1: %2 - + %1 をオープンする時にエラーが発生しました: %2 - + Write error writing to %1: %2 - + %1 への書き込み時にエラーが発生しました: %2 - + Cannot open %1: Path is a directory - + %1 をオープンできません。指定されたパスはディレクトリです Read error reading from %1: %2 - + %1 を読み込み時にエラーが発生しました: %2 QNetworkAccessFtpBackend - + No suitable proxy found - + 適切なプロキシーがみつかりません Cannot open %1: is a directory - + %1 をオープンできません。指定されたパスはディレクトリです - + Logging in to %1 failed: authentication required - + %1 へのログインに失敗しました。認証が必要です Error while downloading %1: %2 - + %1 をダウンロード中にエラーが発生しました: %2 Error while uploading %1: %2 - + %1 をアップロード中にエラーが発生しました: %2 QNetworkAccessHttpBackend - + No suitable proxy found - + 適切なプロキシーがみつかりません QNetworkReply - + Error downloading %1 - server replied: %2 - + %1 をダウンロード中にエラーが発生しました。サーバの返答: %2 - + Protocol "%1" is unknown - + プロトコル "%1" はサポートされていません QNetworkReplyImpl - + Operation canceled - + 操作はキャンセルされました @@ -3349,17 +3424,17 @@ Do you want to delete it anyway? Unable to begin transaction - トランザクションを開始できません + トランザクションを開始できません Unable to commit transaction - トランザクションをコミットできません + トランザクションをコミットできません Unable to rollback transaction - トランザクションをロールバックできません + トランザクションをロールバックできません @@ -3409,7 +3484,7 @@ Do you want to delete it anyway? QODBCDriver - + Unable to connect 接続できません @@ -3466,29 +3541,29 @@ Do you want to delete it anyway? QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration - QODBCResult::reset: ステートメントの属性として 'SQL_CURSOR_STATUS' を設定できません。ODBC ドライバの構成をチェックしてください。 + QODBCResult::reset: ステートメントの属性として 'SQL_CURSOR_STATUS' を設定できません。ODBC ドライバの構成をチェックしてください Unable to fetch last - + リストを取得できません Unable to fetch - + フェッチできません Unable to fetch first - 最初のレコードをフェッチできません + 最初のレコードをフェッチできません Unable to fetch previous - + 前のレコードをフェッチできません @@ -3509,56 +3584,41 @@ Do you want to delete it anyway? Operation not supported on %1 - + %1 ではこの操作はサポートされていません Invalid URI: %1 - - - - - Write error writing to %1: %2 - - - - - Read error reading from %1: %2 - + 無効なURIです: %1 - + Socket error on %1: %2 - + %1 のソケットにおいてエラーが発生しました: %2 Remote host closed the connection prematurely on %1 - - - - - Protocol error: packet of size 0 received - + リモートホスト %1 との接続が通信の終了前に切断されました No host name given - + ホストネームが与えられていません QPPDOptionsModel - + Name - 名前 + 名前 Value - + @@ -3586,12 +3646,12 @@ Do you want to delete it anyway? Unable to subscribe - + subscribe できません Unable to unsubscribe - + unsubscribe できません @@ -3604,7 +3664,7 @@ Do you want to delete it anyway? Unable to prepare statement - プリペアステートメントを使えません + プリペアステートメントを使えません @@ -3612,4355 +3672,4361 @@ Do you want to delete it anyway? Centimeters (cm) - + センチメートル (cm) Millimeters (mm) - + ミリメートル (mm) Inches (in) - + インチ (in) Points (pt) - + ポイント (pt) Form - + 書式設定 Paper - + 用紙 Page size: - ページサイズ: + ページサイズ: Width: - + 幅: Height: - + 高さ: Paper source: - 給紙装置: + 給紙装置: Orientation - + 印刷方向 Portrait - + 縦 (ポートレート) Landscape - + 横 (ランドスケープ) Reverse landscape - + 横 反転 (リバースランドスケープ) Reverse portrait - + 縦 反転 (リバースポートレート) Margins - + 余白 top margin - + 上端余白 left margin - + 左端余白 right margin - + 右端余白 bottom margin - + 下端余白 - QPluginLoader + QPatternist::QtXmlPatterns - - Unknown error - 不明なエラー + + An %1-attribute with value %2 has already been declared. + 属性 %1 の値 %2 は既に宣言されています。 - - The plugin was not loaded. - + + An %1-attribute must have a valid %2 as value, which %3 isn't. + 属性 %1 の値は %2 の型でなければなりませんが、 %3 が指定されました。 - - - QPrintDialog - Page size: - ページサイズ: + + %1 is an unsupported encoding. + %1 はサポートされていないエンコーディングです。 - Orientation: - 方向: + + %1 contains octets which are disallowed in the requested encoding %2. + エンコーディング %2 では許可されていないオクテットが %1 に含まれています。 - Paper source: - 給紙装置: + + The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. + %2 で使用されているエンコード %3 では、コードポイント %1 は有効な XML 表現ではありません。 - - OK - OK + + Network timeout. + ネットワーク接続がタイムアウトしました。 - Cancel - キャンセル + + Element %1 can't be serialized because it appears outside the document element. + エレメント %1 はシリアライズできません。このドキュメントの範囲を越えるエレメントを含んでいます。 - Portrait - + + Attribute %1 can't be serialized because it appears at the top level. + 属性 %1 はシリアライズできません。トップレベルに現れているためです。 - Landscape - + + Year %1 is invalid because it begins with %2. + %1 年はむこうです。%2 で始まっています。 - - locally connected - ローカルに接続しています + + Day %1 is outside the range %2..%3. + %1 日は、有効な範囲 %2..%3 を逸脱しています。 - - - Aliases: %1 - エイリアス: %1 + + Month %1 is outside the range %2..%3. + %1 月は、有効な範囲 %2..%3 を逸脱しています。 - - - unknown - 不明 + + Overflow: Can't represent date %1. + オーバーフロー: 日付 %1 を再現できません。 - Print in color if available - 可能であればカラーで印刷 + + Day %1 is invalid for month %2. + %2 月には、%1 日は存在しません。 - Print to file - ファイルに出力: + + Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; + 24:%1:%2.%3 は無効です。24時0分0秒のみ使用できます - Browse - 参照... + + Time %1:%2:%3.%4 is invalid. + 時刻 %1時%2分%3.%4秒は無効です。 - - Print all - すべて印刷 + + Overflow: Date can't be represented. + オーバーフロー: 日付を再現できません。 - Selection - 選択した部分を印刷 + + + At least one component must be present. + 年、月、日のうちいずれかを指定しなければなりません。 - - Print range - 印刷範囲 + + At least one time component must appear after the %1-delimiter. + %1 の後には、時刻を指定しなければなりません。 - Pages from - 先頭のページ: + + No operand in an integer division, %1, can be %2. + ゼロ除算? NaN? + 整数の除算のためのオペランドが不足しています。%1 は %2 でなければなりません。 - to - 末尾のページ: + + The first operand in an integer division, %1, cannot be infinity (%2). + 整数の除算における最初のオペランド %1 を認識できません (%2)。 - Print last page first - 末尾のページから印刷 + + The second operand in a division, %1, cannot be zero (%2). + 整数の除算における二つ目のオペランド %1 はゼロであってはいけまん(%2)。 - Number of copies: - 部数: + + %1 is not a valid value of type %2. + %1 は、%2 の型に対して有効な値ではありません。 - Paper format - 用紙の形式 + + When casting to %1 from %2, the source value cannot be %3. + %2 から %1 への型変換に際しては、値 %3 は有効な値ではありません。 - - A0 (841 x 1189 mm) - A0 (841 x 1189mm) + + Integer division (%1) by zero (%2) is undefined. + 整数の除算において %1 をゼロ (%2) で割った結果は定義されていません。 - - A1 (594 x 841 mm) - A1 (594 x 841mm) + + Division (%1) by zero (%2) is undefined. + 除算において %1 をゼロ (%2) で割った結果は定義されていません。 - - A2 (420 x 594 mm) - A2 (420 x 594mm) + + Modulus division (%1) by zero (%2) is undefined. + 剰余を求めるに際し、%1 をゼロ (%2) で除した結果は定義されていません。 - - A3 (297 x 420 mm) - A3 (297 x 420mm) + + + Dividing a value of type %1 by %2 (not-a-number) is not allowed. + 型 %1 を非数 %2 (NaN) で除すことはできません。 - - A4 (210 x 297 mm, 8.26 x 11.7 inches) - A4 (210 x 297mm、8.26 x 11.7インチ) + + Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. + 型 %1 を%2 または %3 (正または負のゼロ) で除することはできません。 - - A5 (148 x 210 mm) - A5 (148 x 210mm) - - - - A6 (105 x 148 mm) - A6 (105 x 148mm) + + Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. + 型 %1 を %2 または %3 (正または負のゼロ)で乗ずることはできません。 - - A7 (74 x 105 mm) - A7 (74 x 105mm) + + A value of type %1 cannot have an Effective Boolean Value. + 型 %1 は有効な論理型(bool)ではありません。 - - A8 (52 x 74 mm) - A8 (52 x 74mm) + + Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. + ?? + 論理型は、論理型以外の複数の値からなる計算によって求めることはできません。 - - A9 (37 x 52 mm) - A9 (37 x 52mm) + + Value %1 of type %2 exceeds maximum (%3). + 型 %2 の値 %1 は、上限 (%3) を越えています。 - - B0 (1000 x 1414 mm) - B0 (1000 x 1414mm) + + Value %1 of type %2 is below minimum (%3). + 型 %2 の値 %1 は、下限 (%3) を越えています。 - - B1 (707 x 1000 mm) - B1 (707 x 1000mm) + + A value of type %1 must contain an even number of digits. The value %2 does not. + 型 %1 の値は偶数個の十進数文字を必要とします。しかし、%2 はそうではありません。 - - B2 (500 x 707 mm) - B2 (500 x 707mm) + + %1 is not valid as a value of type %2. + 型 %2 に対して、値 %1 は有効ではありません。 - - B3 (353 x 500 mm) - B3 (353 x 500mm) + + Ambiguous rule match. + 曖昧なルールにマッチしました。 - - B4 (250 x 353 mm) - B4 (250 x 353mm) + + Operator %1 cannot be used on type %2. + 型 %2 に対して、オペレータ %1 は使用できません。 - - B5 (176 x 250 mm, 6.93 x 9.84 inches) - B5 (176 x 250mm、6.93 x 9.84インチ) + + Operator %1 cannot be used on atomic values of type %2 and %3. + アトミックな型 %2 と %3 に対して、オペレータ %1 は使用できません。 - - B6 (125 x 176 mm) - B6 (125 x 176mm) + + The namespace URI in the name for a computed attribute cannot be %1. + computed attrib. ってなんてやくすのが適当かな。 + 結合された属性に対する名前空間のURIとして、%1 を使用することはできません。 - - B7 (88 x 125 mm) - B7 (88 x 125mm) + + The name for a computed attribute cannot have the namespace URI %1 with the local name %2. + 結合された属性の名前空間URI %1 は、ローカルな名前である %2 と併用できません。 - - B8 (62 x 88 mm) - B8 (62 x 88mm) + + Type error in cast, expected %1, received %2. + 型変換時のエラーです。望んでいた %1 ではなく、%2 になりました。 - - B9 (44 x 62 mm) - B9 (44 x 62mm) + + When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. + %1 またはそれを継承している型への型変換においては、元の値の型は同じ型か、リテラルな文字列である必要があります。型 %2 は許可されていません。 - - B10 (31 x 44 mm) - B10 (31 x 44mm) + + No casting is possible with %1 as the target type. + 目標とする型に %1 を型変換することはできません。 - - C5E (163 x 229 mm) - C5E (163 x 229mm) + + It is not possible to cast from %1 to %2. + 型 %1 を型 %2 に型変換することはできません。 - - DLE (110 x 220 mm) - DLE (110 x 220mm) + + Casting to %1 is not possible because it is an abstract type, and can therefore never be instantiated. + 型 %1 への型変換はできません。抽象型であり、インスタンス化することができないからです。 - - Executive (7.5 x 10 inches, 191 x 254 mm) - Executive (7.5 x 10インチ、191 x 254mm) + + It's not possible to cast the value %1 of type %2 to %3 + 型 %2 の値 %1 を、型 %3 に型変換することはできません - - Folio (210 x 330 mm) - Folio (210 x 330mm) + + Failure when casting from %1 to %2: %3 + %1 を %2 に型変換することができません: %3 - - Ledger (432 x 279 mm) - Ledger (432 x 279mm) + + A comment cannot contain %1 + コメントが %1 を含むことはできません - - Legal (8.5 x 14 inches, 216 x 356 mm) - Legal (8.5 x 14インチ、216 x 356mm) + + A comment cannot end with a %1. + コメントは %1 で終了することはできません。 - - Letter (8.5 x 11 inches, 216 x 279 mm) - Letter (8.5 x 11インチ、216 x 279mm) + + No comparisons can be done involving the type %1. + 型 %1 に対して比較を行うことはできません。 - - Tabloid (279 x 432 mm) - Tabloid (279 x 432mm) + + Operator %1 is not available between atomic values of type %2 and %3. + オペレータ %1 は、アトミックな型である %2 と %3 には適用できません。 - - US Common #10 Envelope (105 x 241 mm) - US Common #10 Envelope (105 x 241mm) + + In a namespace constructor, the value for a namespace cannot be an empty string. + 名前空間のスントラクトにおいて、空白の文字列を名前空間の値として使用することはできません。 - Print dialog - プリントダイアログ + + The prefix must be a valid %1, which %2 is not. + プレフィックスは %1 でなければなりません。%2 は無効です。 - Size: - サイズ: + + The prefix %1 cannot be bound. + プレフィックス %1 はバウンドできません。 - Printer - プリンタ + + Only the prefix %1 can be bound to %2 and vice versa. + プレフィックス %1 は、%2 にのみバウンドできます。逆も同じです。 - Properties - プロパティ + + An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. + ドキュメントノードの子として属性ノードを指定することはできません。属性 %1 は誤った場所にあります。 - Printer info: - プリンタ情報: + + Circularity detected + 循環を検出しました - Copies - 印刷部数 + + A library module cannot be evaluated directly. It must be imported from a main module. + ライブラリモジュールを直接評価することはできません。メインモジュールからインポートする必要があります。 - Collate - 丁合い + + No template by name %1 exists. + テンプレート名 %1 は存在しません。 - Other - その他 + + A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. + 型 %1 は述部として使用できません。数値型か、論理型である必要があります。 - Double side printing - 両面印刷 + + A positional predicate must evaluate to a single numeric value. + positional? + 述部は評価されたとき、単一の数値になるようにしなければなりません。 - - - - Print - 印刷 + + The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid. + ターゲットとしている名前は、%1 であってはなりません。%2 は無効です。 - File - ファイル + + %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. + %1 はターゲットとして無効です。%2 である必要があります。例えば "%3" のようにです。 - - Print To File ... - ファイルへ出力... + + The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. + バスの末端であるリーフは、単一のノードかアトミックな値である必要があります。複数の型の組み合わせであってはいけません。 - - File %1 is not writable. -Please choose a different file name. - ファイル %1 は書き込み可能ではありません。 -別のファイル名を選んでください。 + + The data of a processing instruction cannot contain the string %1 + 処理中のデータは、以下の文字列を含んでいてはなりません: %1 - - %1 already exists. -Do you want to overwrite it? - %1 はすでに存在します。 -上書きしますか? + + No namespace binding exists for the prefix %1 + プレフィックス %1 にバインドされたネームスペースがありません - - File exists - + + No namespace binding exists for the prefix %1 in %2 + %2 におけるプレフィックス %1 にバインディングされたネームスペースが存在しません - - <qt>Do you want to overwrite it?</qt> - + + + %1 is an invalid %2 + 型 %2 に対し、値 %1 は無効です - - Print selection - + + The parameter %1 is passed, but no corresponding %2 exists. + パラメータ %1 を処理しました。しかし、対応する %2 が存在しません。 - - %1 is a directory. -Please choose a different file name. - + + The parameter %1 is required, but no corresponding %2 is supplied. + パメータ %1 が必要です。しかし、対応する %2 がありません。 - - - A0 - + + + %1 takes at most %n argument(s). %2 is therefore invalid. + + %1 は、最大で %n 個の引数をとることができます。%2 は無効です。 + - - - A1 - + + + %1 requires at least %n argument(s). %2 is therefore invalid. + + %1 は、少くとも %n 個の引数を必要とします。%2 は無効です。 + - - A2 - + + The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. + %1 への最初の引数は、型 %2 であってはなりません。数値型、xs:yerMonthDuration、xs:dayTimeDurationである必要があります。 - - A3 - + + The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + %1 への最初の引数は、型 %2 であってはなりません。%3, %4, %5 のいずれかである必要があります。 - - A4 - + + The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. + %1 への二つ目の引数は、型 %2 であってはなりません。%3, %4, %5 のいずれかである必要があります。 - - A5 - + + %1 is not a valid XML 1.0 character. + %1 は XML 1.0 において有効な文字ではありません。 - - A6 - + + The first argument to %1 cannot be of type %2. + %1 への最初の引数は、型 %2 であってはなりません。 - - A7 - + + The root node of the second argument to function %1 must be a document node. %2 is not a document node. + %1 への二つ目の引数のルートノードは、ドキュメントノードでなければなりません。しかし、%2 はドキュメントノードではありません。 - - A8 - + + If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. + ゾーンオフセットってなに? xmlにそんなのあったっけ? + もし二つの値がゾーンオフセットをもつ場合、両者は同じゾーンオフセットでなければなりません。%1 と %2 は同一ではありません。 - - A9 - + + %1 was called. + %1 が呼ばれました。 - - B0 - + + %1 must be followed by %2 or %3, not at the end of the replacement string. + %1 の後には、%2 か %3 が続かなければなりません。 - - B1 - + + In the replacement string, %1 must be followed by at least one digit when not escaped. + 置換操作において、%1 には少くとも一文字以上の数値が続く必要があります(エスケープされている場合を除く)。 - - B2 - + + In the replacement string, %1 can only be used to escape itself or %2, not %3 + 置換操作において、%1 はそれ自身または %2 をエスケープする為にのみ使用できます。%3 に対しては使用できません - - B3 - + + %1 matches newline characters + %1 は改行文字(列)にマッチしました - - B4 - + + %1 and %2 match the start and end of a line. + %1 と %2 は、行の先頭と末尾にマッチしました。 - - B5 - + + Matches are case insensitive + マッチは大文字小文字を区別しません - - B6 - + + Whitespace characters are removed, except when they appear in character classes + CDATA? + 空白文字は削除されました。ただし、キャラクタークラスに属するものは除きます - - B7 - + + %1 is an invalid regular expression pattern: %2 + %1 は有効な正規表現ではありません。: %2 - - B8 - + + %1 is an invalid flag for regular expressions. Valid flags are: + %1 は正規表現において無効なフラグです。使用可能なフラグは次の通りです: - - B9 - + + If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. + もし、最初の引数が空白からなる文字列か、長さが0 (名前空間をともなわない)である場合、プレフィックスを指定することはできません。しかし、プレフィックスとして %1 が指定されています。 - - B10 - + + It will not be possible to retrieve %1. + %1 を取得することはできないかもしれません。 - - C5E - + + The default collection is undefined + デフォルトのコレクションが定義されていません - - DLE - + + %1 cannot be retrieved + %1 を取得できません - - Executive - + + The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). + つまり、空白の文字です、はどうでもいいよね。 + 正規化された表現 %1 はサポートされていません。サポートされている表現は、%2, %3, %4, %5 のみです。 - - Folio - + + A zone offset must be in the range %1..%2 inclusive. %3 is out of range. + ゾーンオフセットは、%1 から %2 の範囲である必要があります(境界を含む)。%3 は範囲外です。 - - Ledger - + + %1 is not a whole number of minutes. + %1 は、分を現す値ではありません。 - - Legal - + + The URI cannot have a fragment + この URI はフラグメントをもつことはできません - - Letter - + + Required cardinality is %1; got cardinality %2. + カーディナリティ %1 が必要です。%2 ではありません。 - - Tabloid - + + The item %1 did not match the required type %2. + アイテム %1 は、要求された型 %2 にマッチしません。 - - US Common #10 Envelope - + + Attribute %1 cannot appear on the element %2. Only the standard attributes can appear. + エレメント %2 に属性 %1 を指定することはできません。標準の属性のみが許可されています。 - - Custom - + + Attribute %1 cannot appear on the element %2. Only %3 is allowed, and the standard attributes. + エレメント %2 に属性 %1 を指定することはできません。%3 と標準の属性のみが許可されています。 - - - &Options >> - + + Attribute %1 cannot appear on the element %2. Allowed is %3, %4, and the standard attributes. + エレメント %2 に属性 %1 を指定することはできません。%3, %4 と標準の属性のみが許可されています。 - - &Print - + + Attribute %1 cannot appear on the element %2. Allowed is %3, and the standard attributes. + エレメント %2 に %1 は指定できません。%3 と標準の属性のみが指定できます。 - - &Options << - + + XSL-T attributes on XSL-T elements must be in the null namespace, not in the XSL-T namespace which %1 is. + XSLT エレメントに対するXSLT属性は、名前空間がnullでなければなりません。%1 は使用できません。 - - Print to File (PDF) - + + The attribute %1 must appear on element %2. + 属性 %1 は、エレメント %2 にのみ記述できます。 - - Print to File (Postscript) - + + The element with local name %1 does not exist in XSL-T. + ローカル名 %1 のエレメントは、XSLTに存在しません。 - - Local file - + + The variable %1 is unused + 値 %1 は使用されませんでした - - Write %1 file - + + A construct was encountered which only is allowed in XQuery. + XQuery でのみ許可されている construct に遭遇しました。 - - The 'From' value cannot be greater than the 'To' value. - + + + %1 is an unknown schema type. + %1 はサポートされていないスキーマのタイプです。 - - - QPrintPreviewDialog - - - Page Setup - + + A template by name %1 has already been declared. + テンプレート名 '%1' は、既に宣言されています。 - - %1% - + + %1 is not a valid numeric literal. + %1 は数値リテラルとして無効です。 - - Print Preview - + + Only one %1 declaration can occur in the query prolog. + クェリーのプロローグでは、%1 は一回のみ宣言できます。 - - Next page - + + The initialization of variable %1 depends on itself + 再帰? + 値 %1 の初期化は、それ自身に依存しています - - Previous page - + + No variable by name %1 exists + 変数 %1 は存在しません - - First page - + + Version %1 is not supported. The supported XQuery version is 1.0. + バージョン %1 はサポートされていません。XQuery バージョン 1.0 のみサポートされています。 - - Last page - + + The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. + エンコーディング '%1' は無効です。ラテン文字 (空白を除く) からなるもので、正規表現 '%2' にマッチするもののみ使用できます。 - - Fit width - + + No function with signature %1 is available + シグネチャ %1 をもつ関数がみつかりません - - Fit page - + + + A default namespace declaration must occur before function, variable, and option declarations. + 標準の名前空間の宣言は、関数、変数、オプションの宣言の前にしなければなりません。 + + + + Namespace declarations must occur before function, variable, and option declarations. + 名前空間の宣言は、関数、変数、オプションの宣言の前にしなければなりません。 - Zoom in - + Module imports must occur before function, variable, and option declarations. + モジュールのインポートは、関数、変数、オプションの宣言の前にしなければなりません。 - - Zoom out - + + The keyword %1 cannot occur with any other mode name. + キーワード %1 は、他の名をともなって使用することはできません。 - - Portrait - + + The value of attribute %1 must of type %2, which %3 isn't. + 属性 '%1' の値として '%3' が指定されましたが、型 '%2' でなければなりません。 - - Landscape - + + It is not possible to redeclare prefix %1. + プレフィックス '%1' を再定義することはできません。 - - Show single page - + + The prefix %1 can not be bound. By default, it is already bound to the namespace %2. + プレフィックス '%1' はバウンドできません。デフォルトでは、それは既に名前空間 '%2' にバウンドされています。 - - Show facing pages - + + Prefix %1 is already declared in the prolog. + プロローグ部において、プレフィックス '%1' はすでに宣言されています。 - - Show overview of all pages - + + The name of an option must have a prefix. There is no default namespace for options. + オプションの名前はプレフィックスをもたなければなりません。このオプションに対するデフォルトの名前空間は存在しません。 - - Print - + + The Schema Import feature is not supported, and therefore %1 declarations cannot occur. + このスキーマのインポート機能は使用できません。また、'%1' 宣言も使用できません。 - - Page setup - + + The target namespace of a %1 cannot be empty. + 名前空間 '%1' は、空であってはなりません。 - - Close - 閉じる + + The module import feature is not supported + モジュールインポートの機能はサポートされていません - - Export to PDF - + + A variable by name %1 has already been declared. + 名前 '%1' の変数は、すでに宣言されています。 - - Export to PostScript - + + No value is available for the external variable by name %1. + 外部変数 '%1' の値がみつかりません。 - - - QPrintPropertiesDialog - PPD Properties - 印刷プロパティのダイアログのプロパティ + + A stylesheet function must have a prefixed name. + スタイルシート関数は、プレフィックス名を持たなければなりません。 - Save - 保存 + + The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) + ユーザ定義の関数の名前空間は、空であってはなりません。(すでに定義されているプレフィックス '%1' が使用できます) - OK - OK + + The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. + 名前空間 '%1' は予約済です。ユーザ定義の関数では使用することはできません。プレフィックス '%2' が使用できます。 - - - QPrintPropertiesWidget - - Form - + + The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 + ライブラリモジュールで使用されている名前空間は、モジュールの名前空間と同一でなければなりません。つまり、'%2' ではなく、'%1' でなければなりません - - Page - + + A function already exists with the signature %1. + シグネチャー '%1' の関数はすでに存在しています。 - - Advanced - + + No external functions are supported. All supported functions can be used directly, without first declaring them as external + 外部関数はサポートされていません。すべてのサポートされている関数は、外部宣言をすることなく、直接使用することができます - - - QPrintSettingsOutput - - Form - + + An argument by name %1 has already been declared. Every argument name must be unique. + 引数名 '%1' は既に宣言されています。すべての引数名はユニークである必要があります。 - - Copies - 印刷部数 + + When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. + パターン一致の内側で関数 '%1' を使用する場合、引数はリテラルな文字列を参照する値でなければなりません。 - - Print range - 印刷範囲 + + In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. + XSL-T パターンマッチングにおいて、関数 '%1' の最初の引数は、リテラルな文字列でなければなりません。 - - Print all - すべて印刷 + + In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. + variable ref? + XSL-T パターンマッチングにおいて、関数 '%1' への最初の引数は、リテラルか変数でなければなりません。 - - Pages from - 先頭のページ: + + In an XSL-T pattern, function %1 cannot have a third argument. + XSL-T パターンにおいて、関数 '%1' は三つの引数をもつことはできません。 - - to - 末尾のページ: + + In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. + XSL-T パターンマッチングにおいて、関数 '%1' と '%2' のみ使用できます。'%3' は使用できません。 - - Selection - 選択した部分を印刷 + + In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. + XSL-T パターンにおいて、axis %1 は使用できません。%2 または %3 のみ使用できます。 - - Output Settings - + + %1 is an invalid template mode name. + %1 はテンプレートモジュール名として無効です。 - - Copies: - + + The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. + for 構文において使用する変数は、場所に関する変数とは異なる必要があります。つまり、'%1' が重複して使用されています。 - - Collate - 丁合い + + The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. + スキーマの検証機能はサポートされていません。よって、'%1' 構文は使用できません。 - - Reverse - + + None of the pragma expressions are supported. Therefore, a fallback expression must be present + pragma 構文はサポートされていません。fallback 構文でなければなりません - - Options - + + Each name of a template parameter must be unique; %1 is duplicated. + テンプレートパラメータ名はユニークである必要があります。'%1' は重複しています。 - - Color Mode - + + The %1-axis is unsupported in XQuery + XQuery において、%1 axis はサポートされていません - - Color - + + No function by name %1 is available. + 関数名 '%1' はみつかりません。 - - Grayscale - + + The namespace URI cannot be the empty string when binding to a prefix, %1. + プレフィックス '%1' にバインディングする名前空間の URI は、空であってはなりません。 - - Duplex Printing - + + %1 is an invalid namespace URI. + %1 は名前空間 URI として無効です。 - - None - + + It is not possible to bind to the prefix %1 + プレフィックス %1 にバインドすることはできません - - Long side - + + Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). + ? + 名前空間 %1 は %2 にのみバウンドできます。 - - Short side - + + Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). + プリフィックス %1 は %2 にのみバウンドできます。 - - - QPrintWidget - - Form - + + Two namespace declaration attributes have the same name: %1. + 二つの名前空間宣言の属性が、同じ名前 '%1' をもっています。 - - Printer - プリンタ + + The namespace URI must be a constant and cannot use enclosed expressions. + 名前空間 URI は、constantでなければなりません。式を含むことはできません。 - - &Name: - + + An attribute by name %1 has already appeared on this element. + 属性名 '%1' は、すでにこのエレメントで使用されています。 - - P&roperties - + + A direct element constructor is not well-formed. %1 is ended with %2. + 直積的な指定のエレメントがwell formedではありません。'%1' が、'%2' で終わっています。 - - Location: - + + The name %1 does not refer to any schema type. + 名前 '%1' は、なんのスキーマタイプも参照していません。 - - Preview - + + %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. + '%1' は complex 型です。complex 型への型変換はできません。しかし、アトミックな型である '%2' への変換はできます。 - - Type: - + + %1 is not an atomic type. Casting is only possible to atomic types. + '%1' はアトミックな型ではありません。型変換はアトミックな型に対してのみ可能です。 - - Output &file: - + + %1 is not a valid name for a processing-instruction. + 処理指定において、'%1' は無効です。 - - ... - + + + %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. + '%1' は、スコープ属性宣言ではありません。スキーマインポート機能はサポートされていません。 - - - QProcess - - - Could not open input redirection for reading - + + The name of an extension expression must be in a namespace. + 拡張式 (extension expression) の名前は、名前空間の中になければなりません。 - - - Could not open output redirection for writing - + + Element %1 is not allowed at this location. + この場所にエレメント '%1' をおくことは許されていません。 - - Resource error (fork failure): %1 - + + Text nodes are not allowed at this location. + この場所にテキストノードをおくことは許されていません。 - - - - - - - - - - Process operation timed out - + + Parse error: %1 + パースエラー: %1 - - - - - Error reading from process - + + The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. + XSL-T バージョン属性の値は、'%1' 型でなければなりません。'%2' はそうではありません。 - - - - Error writing to process - + + Running an XSL-T 1.0 stylesheet with a 2.0 processor. + XSL-T 1.0 のスタイルシートを 2.0 のプロセッサで使用します。 - - Process crashed - + + Unknown XSL-T attribute %1. + 未知の XSL-T 属性 %1 があります。 - - No program defined - + + Attribute %1 and %2 are mutually exclusive. + 属性 '%1' と '%2' は排他的にのみ使用できます。 - - Process failed to start - + + In a simplified stylesheet module, attribute %1 must be present. + simplified stylesheet モジュールにおいては、属性 '%1' を指定されなければなりません。 - - - QProgressDialog - - Cancel - キャンセル + + If element %1 has no attribute %2, it cannot have attribute %3 or %4. + エレメント '%1' が属性 '%2' を持たない場合は、属性 '%3' や '%4' を使用することはできません。 - - - QPushButton - - Open - オープン + + Element %1 must have at least one of the attributes %2 or %3. + エレメント '%1' は、属性 '%2' か '%3' のいずれかを持たなければなりません。 - - - QRadioButton - - Check - 選択 + + At least one mode must be specified in the %1-attribute on element %2. + エレメント '%2' において、'%1' 属性は少くとも一つのモードを指定しなければなりません。 - - - QRegExp - - no error occurred - エラーは発生しませんでした + + Element %1 must come last. + エレメント %1 は最後になければなりません。 - - disabled feature used - 無効な機能が使用されました + + At least one %1-element must occur before %2. + %2 の前に、少くとも一つは %1 エレメントが存在しなければなりません。 - - bad char class syntax - 不正なcharクラス構文 + + Only one %1-element can appear. + %1 エレメントは一つのみ存在しなければなりません。 - - bad lookahead syntax - 不正なlookahead構文 + + At least one %1-element must occur inside %2. + %2 の内側には、少くとも一つの '%1' エレメントが存在しなければなりません。 - - bad repetition syntax - 不正なrepetition構文 + + When attribute %1 is present on %2, a sequence constructor cannot be used. + %2 に属性 %1 がある場合、sequence constructor は使用できません。 - - invalid octal value - 無効な8進値 + + Element %1 must have either a %2-attribute or a sequence constructor. + エレメント %1 には、%2 属性またはsequence constructorがなければなりません。 - - missing left delim - 左の区切り文字がありません + + When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. + パラメータが要求されているときには、デフォルトの値は、%1 属性または sequence constructor によって指定されていてはなりません。 - - unexpected end - 予期しない末尾です + + Element %1 cannot have children. + エレメント %1 は、子要素を持つことができません。 - - met internal limit - 内部制限を満たしました + + Element %1 cannot have a sequence constructor. + エレメント %1 は、sequence constructor を含むことができません。 - - - QSQLite2Driver - - Error to open database - データベースのオープンでエラーが発生しました + + + The attribute %1 cannot appear on %2, when it is a child of %3. + %2 が %3 の子要素であるときは、属性 %1 を使用してはなりません。 - - Unable to begin transaction - トランザクションを開始できません + + A parameter in a function cannot be declared to be a tunnel. + 関数へのパラメータは、トンネルであってはなりません。 - - Unable to commit transaction - トランザクションをコミットできません + + This processor is not Schema-aware and therefore %1 cannot be used. + この処理系は、Schema-aware ではありません。よって、%1 は使用できません。 - - Unable to rollback Transaction - トランザクションをロールバックできません + + Top level stylesheet elements must be in a non-null namespace, which %1 isn't. + トップレベルのスタイルシートのエレメントは、non-nullな名前空間を持っていなければなりません。しかし、%1 はそうではありません。 - - - QSQLite2Result - - Unable to fetch results - 実行結果をフェッチできません + + The value for attribute %1 on element %2 must either be %3 or %4, not %5. + エレメント %2 の属性 %1 の値は、%3 または %4 でなければなりません。%5 は異なります。 - - Unable to execute statement - ステートメントを実行できません + + Attribute %1 cannot have the value %2. + 属性 %1 に、値 %2 を指定することはできません。 - - - QSQLiteDriver - - Error opening database - データベースのオープンでエラーが発生しました + + The attribute %1 can only appear on the first %2 element. + 属性 %1 は、最初の %2 エレメントにのみ指定できます。 - - Error closing database - データベースのクローズでエラーが発生しました + + At least one %1 element must appear as child of %2. + %2 の子要素としては、少くとも一つは %1 エレメントがなければなりません。 - - Unable to begin transaction - トランザクションを開始できません + + empty + - - Unable to commit transaction - トランザクションをコミットできません + + zero or one + ゼロまたは一つ - Unable to roll back transaction - トランザクションをロールバックできません + + exactly one + 厳密に一つ - - Unable to rollback transaction - トランザクションをロールバックできません + + one or more + 一つまたは複数 - - - QSQLiteResult - - - - Unable to fetch row - レコードをフェッチできません + + zero or more + ゼロまたはそれ以上 - - Unable to execute statement - ステートメントを実行できません + + Required type is %1, but %2 was found. + 要求されている型は %1 ですが、 %2 があります。 - - Unable to reset statement - ステートメントをリセットできません + + Promoting %1 to %2 may cause loss of precision. + %1 を %2 に変換する際に、精度のロスが生じます。 - - Unable to bind parameters - パラメータをバインドできません + + The focus is undefined. + フォーカスが定義されていません。 + + + + It's not possible to add attributes after any other kind of node. + 他の種類のノードの中では、属性を追加することはできません。 - Parameter count mismatch - パラメータの数が合っていません + An attribute by name %1 has already been created. + 名前 '%1' の属性は、すでに生成されています。 - - No query - + + Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. + UNICODE Codepoint Collection のみ使用できます(%1)。 %2 はサポートされていません。 - QScrollBar + QPluginLoader - - Scroll here - ここにスクロール + + Unknown error + 不明なエラー - - Left edge - 左端 + + The plugin was not loaded. + そのプラグインはロードされていません。 + + + QPrintDialog - - Top - 上端 + Page size: + ページサイズ: - - Right edge - 右端 + Orientation: + 方向: - - Bottom - 下端 + Paper source: + 給紙装置: - - Page left - 1ページ左へスクロール + + OK + OK - - - Page up - 1ページ戻る + Cancel + キャンセル - - Page right - 1ページ右へスクロール + Portrait + - - - Page down - 1ページ進む + Landscape + - - Scroll left - 左へスクロール + + locally connected + ローカルに接続しています - - Scroll up - 上へスクロール + + + Aliases: %1 + エイリアス: %1 - - Scroll right - 右へスクロール + + + unknown + 不明 - - Scroll down - 下へスクロール + Print in color if available + 可能であればカラーで印刷 - - Line up - 1行上へ + Print to file + ファイルに出力: - - Position - 位置 + Browse + 参照... - - Line down - 1行下へ + + Print all + すべて印刷 - - - QSharedMemory - - %1: unable to set key on lock - + Selection + 選択した部分を印刷 - - %1: create size is less then 0 - + + Print range + 印刷範囲 - - - %1: unable to lock - + Pages from + 先頭のページ: - - %1: unable to unlock - + to + 末尾のページ: - - - %1: permission denied - + Print last page first + 末尾のページから印刷 - - - %1: already exists - + Number of copies: + 部数: - - - %1: doesn't exists - + Paper format + 用紙の形式 - - - %1: out of resources - + + A0 (841 x 1189 mm) + A0 (841 x 1189mm) - - - %1: unknown error %2 - + + A1 (594 x 841 mm) + A1 (594 x 841mm) - - %1: key is empty - + + A2 (420 x 594 mm) + A2 (420 x 594mm) - - %1: unix key file doesn't exists - + + A3 (297 x 420 mm) + A3 (297 x 420mm) - - %1: ftok failed - + + A4 (210 x 297 mm, 8.26 x 11.7 inches) + A4 (210 x 297mm、8.26 x 11.7インチ) - - - %1: unable to make key - + + A5 (148 x 210 mm) + A5 (148 x 210mm) - - %1: system-imposed size restrictions - + + A6 (105 x 148 mm) + A6 (105 x 148mm) - - %1: not attached - + + A7 (74 x 105 mm) + A7 (74 x 105mm) - - %1: invalid size - + + A8 (52 x 74 mm) + A8 (52 x 74mm) - - %1: key error - + + A9 (37 x 52 mm) + A9 (37 x 52mm) - - %1: size query failed - + + B0 (1000 x 1414 mm) + B0 (1000 x 1414mm) - - - QShortcut - - Space - Space + + B1 (707 x 1000 mm) + B1 (707 x 1000mm) - Esc - Esc + B2 (500 x 707 mm) + B2 (500 x 707mm) - Tab - Tab + B3 (353 x 500 mm) + B3 (353 x 500mm) - Backtab - Backtab + B4 (250 x 353 mm) + B4 (250 x 353mm) - Backspace - Backspace + B5 (176 x 250 mm, 6.93 x 9.84 inches) + B5 (176 x 250mm、6.93 x 9.84インチ) - Return - Return + B6 (125 x 176 mm) + B6 (125 x 176mm) - Enter - Enter + B7 (88 x 125 mm) + B7 (88 x 125mm) - Ins - Ins + B8 (62 x 88 mm) + B8 (62 x 88mm) - Del - Del + B9 (44 x 62 mm) + B9 (44 x 62mm) - Pause - Pause + B10 (31 x 44 mm) + B10 (31 x 44mm) - Print - Print + C5E (163 x 229 mm) + C5E (163 x 229mm) - SysReq - SysReq + DLE (110 x 220 mm) + DLE (110 x 220mm) - Home - Home + Executive (7.5 x 10 inches, 191 x 254 mm) + Executive (7.5 x 10インチ、191 x 254mm) - End - End + Folio (210 x 330 mm) + Folio (210 x 330mm) - Left - + Ledger (432 x 279 mm) + Ledger (432 x 279mm) - Up - + Legal (8.5 x 14 inches, 216 x 356 mm) + Legal (8.5 x 14インチ、216 x 356mm) - Right - + Letter (8.5 x 11 inches, 216 x 279 mm) + Letter (8.5 x 11インチ、216 x 279mm) - Down - + Tabloid (279 x 432 mm) + Tabloid (279 x 432mm) - PgUp - PgUp + US Common #10 Envelope (105 x 241 mm) + US Common #10 Envelope (105 x 241mm) - - PgDown - PgDown + Print dialog + プリントダイアログ - - CapsLock - CapsLock + Size: + サイズ: - - NumLock - NumLock + Printer + プリンタ - - ScrollLock - ScrollLock + Properties + プロパティ - - Menu - メニュー + Printer info: + プリンタ情報: - - Help - ヘルプ + Copies + 印刷部数 - - Back - 戻る + Collate + 丁合い - - Forward - 進む + Other + その他 - - Stop - 停止 + Double side printing + 両面印刷 - - Refresh - 更新間隔 + + + + Print + 印刷 - - Volume Down - 音量を下げる + File + ファイル - - Volume Mute - 消音 + + Print To File ... + ファイルへ出力... - - Volume Up - 音量を上げる + + File %1 is not writable. +Please choose a different file name. + ファイル %1 は書き込み可能ではありません。 +別のファイル名を選んでください。 - - Bass Boost - 低音ブースト + + %1 already exists. +Do you want to overwrite it? + %1 はすでに存在します。 +上書きしますか? - - Bass Up - 低音を上げる + + File exists + ファイルは既に存在しています - Bass Down - 低音を下げる + <qt>Do you want to overwrite it?</qt> + <qt>ファイルを上書きしてもよろしいですか?</qt> - - Treble Up - 高音を上げる + + Print selection + 選択された範囲を印刷 - - Treble Down - 高音を下げる + + %1 is a directory. +Please choose a different file name. + %1 はディレクトリです。 +ファイル名を指定してください。 + + + + A0 + A0 - Media Play - メディアの再生 + A1 + A1 - Media Stop - メディアの停止 + A2 + A2 - Media Previous - 前のメディア + A3 + A3 - Media Next - 次のメディア + A4 + A4 - Media Record - メディアの録音 + A5 + A5 - Home Page - ホームページ + A6 + A6 - Favorites - お気に入り + A7 + A7 - Search - 検索 + A8 + A8 - Standby - スタンバイ + A9 + A9 - Open URL - URLを開く + B0 + B0 - Launch Mail - メールの起動 + B1 + B1 - Launch Media - メディアの起動 + B2 + B2 - Launch (0) - (0)の起動 + B3 + B3 - Launch (1) - (1)の起動 + B4 + B4 - Launch (2) - (2)の起動 + B5 + B5 - Launch (3) - (3)の起動 + B6 + B6 - Launch (4) - (4)の起動 + B7 + B7 - Launch (5) - (5)の起動 + B8 + B8 - Launch (6) - (6)の起動 + B9 + B9 - Launch (7) - (7)の起動 + B10 + B10 - Launch (8) - (8)の起動 + C5E + C5E - Launch (9) - (9)の起動 + DLE + DLE - Launch (A) - (A)の起動 + Executive + Exclusive - Launch (B) - (B)の起動 + Folio + Folio - Launch (C) - (C)の起動 + Ledger + Ledger - Launch (D) - (D)の起動 + Legal + リーガルサイズ - Launch (E) - (E)の起動 + Letter + レターサイズ - Launch (F) - (F)の起動 + Tabloid + タブロイドサイズ - - Print Screen - Print Screen + + US Common #10 Envelope + US標準#10封筒 - Page Up - Page Up + Custom + カスタム - - Page Down - Page Down + + + &Options >> + オプション(&O) >> - - Caps Lock - Caps Lock + + &Print + 印刷(&P) - - Num Lock - Num Lock + + &Options << + オプション(&O) << - - Number Lock - Number Lock + + Print to File (PDF) + PDFファイルに出力 - Scroll Lock - Scroll Lock + Print to File (Postscript) + Postscriptファイルに出力 + + + + Local file + ローカルファイル - Insert - Insert + Write %1 file + ファイル %1 に書き込みました + + + + The 'From' value cannot be greater than the 'To' value. + QPrintPropertiesWidgetにFromとToがあってそれを指している + 印刷開始ページ番号は、印刷終了ページ番号より小さくなければなりません。 + + + + QPrintPreviewDialog + + + + Page Setup + ページの設定 + + + + %1% + %1% + + + + Print Preview + 印刷のプレビュー + + + + Next page + 次のページ - Delete - Delete + Previous page + 前のページ - Escape - Escape + First page + 最初のページ - System Request - System Request + Last page + 最後のページ - - Select - Select + + Fit width + 幅をあわせる - Yes - はい + Fit page + 高さをあわせる + + + + Zoom in + 拡大 - No - いいえ + Zoom out + 縮小 - - Context1 - Context1 + + Portrait + - Context2 - Context2 + Landscape + - - Context3 - Context3 + + Show single page + 一枚のページを表示する - Context4 - Context4 + Show facing pages + 見開きのページを表示する - Call - Call + Show overview of all pages + すべてのページを表示する - - Hangup - Hangup + + Print + 印刷 - Flip - Flip + Page setup + ページの設定 - - - Ctrl - Ctrl + Close + 閉じる - - - Shift - Shift + + Export to PDF + PDFに出力 - - - Alt - Alt + + Export to PostScript + Postscriptに出力 + + + QPrintPropertiesDialog - - - Meta - Meta + PPD Properties + 印刷プロパティのダイアログのプロパティ - - + - + + Save + 保存 - - F%1 - F%1 + OK + OK - QSlider + QPrintPropertiesWidget - - Page left - 1ページ左へスクロール + + Form + 書式 - - Page up - 1ページ戻る + + Page + ページ - - Position - 位置 + + Advanced + 高度な設定 + + + QPrintSettingsOutput - - Page right - 1ページ右へスクロール - + + Form + 書式 - - Page down - 1ページ進む + + Copies + 印刷部数 - - - QSocks5SocketEngine - - Connection to proxy refused - + + Print range + 印刷範囲 - - Connection to proxy closed prematurely - + + Print all + すべて印刷 - - Proxy host not found - + + Pages from + 先頭のページ - - Connection to proxy timed out - + + to + 末尾のページ - - Proxy authentication failed - + + Selection + 選択した部分を印刷 - - Proxy authentication failed: %1 - + + Output Settings + 出力設定 - - SOCKS version 5 protocol error - + + Copies: + 印刷部数: - - General SOCKSv5 server failure - + + Collate + 丁合い - - Connection not allowed by SOCKSv5 server - + + Reverse + 逆順 - - TTL expired - + + Options + オプション - - SOCKSv5 command not supported - + + Color Mode + - - Address type not supported - + + Color + カラー - - Unknown SOCKSv5 proxy error code 0x%1 - + + Grayscale + グレースケール - Socks5 timeout error connecting to socks server - Socks5 はソックスサーバ接続しようとしてタイムアウトになりました + + Duplex Printing + 両面印刷 - - Network operation timed out - ネットワーク操作がタイムアウトしました + + None + なし - - - QSpinBox - - More - 増やす + + Long side + 長辺綴じ - - Less - 減らす + + Short side + 短辺綴じ - QSql + QPrintWidget - - Delete - 削除 + + Form + 書式 - - Delete this record? - このレコードを削除しますか? + + Printer + プリンタ - - - - Yes - はい - - - - - - No - いいえ + + &Name: + 名前(&N): - - Insert - 挿入 + + P&roperties + プロパティ(&r) - - Update - アップデート + + Location: + 設置場所: - - Save edits? - 編集内容を保存しますか? + + Preview + プレビュー - - Cancel - キャンセル + + Type: + タイプ: - - Confirm - 確認 + + Output &file: + 出力ファイル名(&f): - - Cancel your edits? - 編集をキャンセルしますか? + + ... + ... - QSslSocket - - - Error creating SSL context (%1) - - - - - Invalid or empty cipher list (%1) - - - - - Cannot provide a certificate with no key, %1 - - + QProcess - - Error loading local certificate, %1 - + + + Could not open input redirection for reading + 標準入力リダイレクトを読み込みのためにオープンすることができません - Error loading private key, %1 - - - - - Private key does not certificate public key, %1 - - - - - Error creating SSL session, %1 - - - - - Error creating SSL session: %1 - - - - - Unable to write data: %1 - + + Could not open output redirection for writing + 標準出力リダイレクトを書き込みのためにオープンすることができません - - Error while reading: %1 - + + Resource error (fork failure): %1 + リソースエラー (fork に失敗しました): %1 - - Error during SSL handshake: %1 - + + + + + + + + + + Process operation timed out + プロセス処理がタイムアウトしました - - - QSystemSemaphore - - - %1: out of resources - + + + + + Error reading from process + プロセスからの読み込みにおいてエラーが発生しました - - - %1: permission denied - + + + + Error writing to process + プロセスへの書き込みにおいてエラーが発生しました - - %1: already exists - + + Process crashed + プロセスがクラッシュしました - - %1: does not exist - + + No program defined + プログラム名が指定されていません - - - %1: unknown error %2 - + + Process failed to start + プロセスのスタートに失敗しました - QTDSDriver - - - Unable to open connection - 接続をオープンできません - + QProgressDialog - - Unable to use database - データベースを使用できません + + Cancel + キャンセル - QTabBar - - - Scroll Left - 左へスクロール - + QPushButton - - Scroll Right - 右へスクロール + + Open + オープン - QTcpServer - - Socket operation unsupported - ソケット操作はサポートされていません - + QRadioButton - - Operation on socket is not supported - + + Check + 選択 - QTextControl - - - &Undo - 元に戻す(&U) - + QRegExp - - &Redo - やり直す(&R) + + no error occurred + エラーは発生しませんでした - - Cu&t - 切り取り(&T) + + disabled feature used + 無効な機能が使用されました - - &Copy - コピー(&C) + + bad char class syntax + 不正なcharクラス構文 - - Copy &Link Location - リンクの場所をコピー(&L) + + bad lookahead syntax + 不正なlookahead構文 - - &Paste - 貼り付け(&P) + + bad repetition syntax + 不正なrepetition構文 - - Delete - 削除 + + invalid octal value + 無効な8進値 - - Select All - すべてを選択 + + missing left delim + 左の区切り文字がありません - - - QToolButton - - - Press - 押す + + unexpected end + 予期しない末尾です - - - Open - オープン + + met internal limit + 内部制限を満たしました - QUdpSocket + QSQLite2Driver - - This platform does not support IPv6 - このプラットフォームは IPv6 をサポートしていません + + Error to open database + データベースのオープンでエラーが発生しました - - - QUndoGroup - - Undo - 元に戻す + + Unable to begin transaction + トランザクションを開始できません - - Redo - やり直す + + Unable to commit transaction + トランザクションをコミットできません - - - QUndoModel - - <empty> - <空> + + Unable to rollback Transaction + トランザクションをロールバックできません - QUndoStack + QSQLite2Result - - Undo - 元に戻す + + Unable to fetch results + 実行結果をフェッチできません - - Redo - やり直す + + Unable to execute statement + ステートメントを実行できません - QUnicodeControlCharacterMenu - - - LRM Left-to-right mark - - - - - RLM Right-to-left mark - - - - - ZWJ Zero width joiner - - + QSQLiteDriver - - ZWNJ Zero width non-joiner - + + Error opening database + データベースのオープンでエラーが発生しました - - ZWSP Zero width space - + + Error closing database + データベースのクローズでエラーが発生しました - - LRE Start of left-to-right embedding - + + Unable to begin transaction + トランザクションを開始できません - - RLE Start of right-to-left embedding - + + Unable to commit transaction + トランザクションをコミットできません - - LRO Start of left-to-right override - + Unable to roll back transaction + トランザクションをロールバックできません - - RLO Start of right-to-left override - + + Unable to rollback transaction + トランザクションをロールバックできません + + + QSQLiteResult - - PDF Pop directional formatting - + + + + Unable to fetch row + レコードをフェッチできません - - Insert Unicode control character - Unicode制御文字を挿入 + + Unable to execute statement + ステートメントを実行できません - - - QWebFrame - - Request cancelled - + + Unable to reset statement + ステートメントをリセットできません - - Request blocked - + + Unable to bind parameters + パラメータをバインドできません - Cannot show URL - + Parameter count mismatch + パラメータの数が合っていません - - Frame load interruped by policy change - + + No query + クェリーがありません + + + QScrollBar - - Cannot show mimetype - + + Scroll here + ここにスクロール - - File does not exist - + + Left edge + 左端 - - - QWebPage - - Bad HTTP request - + + Top + 上端 - - Submit - default label for Submit buttons in forms on web pages - + + Right edge + 右端 - - Submit - Submit (input element) alt text for <input> elements with no alt, title, or value - + + Bottom + 下端 - - Reset - default label for Reset buttons in forms on web pages - リセット + + Page left + 1ページ左へスクロール - - This is a searchable index. Enter search keywords: - text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' - + + + Page up + 1ページ戻る - - Choose File - title for file button used in HTML forms - + + Page right + 1ページ右へスクロール - - No file selected - text to display in file button used in HTML forms when no file is selected - + + + Page down + 1ページ進む - - Open in New Window - Open in New Window context menu item - + + Scroll left + 左へスクロール - - Save Link... - Download Linked File context menu item - + + Scroll up + 上へスクロール - - Copy Link - Copy Link context menu item - + + Scroll right + 右へスクロール - - Open Image - Open Image in New Window context menu item - + + Scroll down + 下へスクロール - - Save Image - Download Image context menu item - + + Line up + 1行上へ - - Copy Image - Copy Link context menu item - + + Position + 位置 - - Open Frame - Open Frame in New Window context menu item - + + Line down + 1行下へ + + + QSharedMemory - - Copy - Copy context menu item - + + %1: unable to set key on lock + 共有メモリ関連 + %1: ロックするためのキーを設定できません - - Go Back - Back context menu item - + + %1: create size is less then 0 + %1: 0より小さいサイズの共有メモリは作成できません - - Go Forward - Forward context menu item - + + + %1: unable to lock + %1: ロックできません - - Stop - Stop context menu item - 停止 + + %1: unable to unlock + %1: アンロックできません - - Reload - Reload context menu item - + + + %1: permission denied + %1: 許可されていません - - Cut - Cut context menu item - + + + %1: already exists + %1: 既に存在します - - Paste - Paste context menu item - + + + %1: doesn't exists + %1: 存在しません - - No Guesses Found - No Guesses Found context menu item - + + + %1: out of resources + %1: リソース不足です - - Ignore - Ignore Spelling context menu item - 無視 + + + %1: unknown error %2 + %1: 未知のエラー %2 - - Add To Dictionary - Learn Spelling context menu item - + + %1: key is empty + %1: キーが空です - - Search The Web - Search The Web context menu item - + + %1: unix key file doesn't exists + ? + %1: UNIX key file が存在しません - - Look Up In Dictionary - Look Up in Dictionary context menu item - + + %1: ftok failed + %1: fork に失敗しました - - Open Link - Open Link context menu item - + + + %1: unable to make key + %1: キーを作成できません - - Ignore - Ignore Grammar context menu item - 無視 + + %1: system-imposed size restrictions + EINVAL + %1: 指定されたサイズはシステムにより拒否されました - - Spelling - Spelling and Grammar context sub-menu item - + + %1: not attached + %1: アタッチしていません - - Show Spelling and Grammar - menu item title - + + %1: invalid size + %1: 無効なサイズです - - Hide Spelling and Grammar - menu item title - + + %1: key error + safekey.isEmpty()==true + %1: キーかありません - - Check Spelling - Check spelling context menu item - + + %1: size query failed + %1: サイズのクェリーに失敗しました + + + QShortcut - - Check Spelling While Typing - Check spelling while typing context menu item - + + Space + Space - - Check Grammar With Spelling - Check grammar with spelling context menu item - + + Esc + Esc - - Fonts - Font context sub-menu item - + + Tab + Tab - - Bold - Bold context menu item - + + Backtab + Backtab - - Italic - Italic context menu item - + + Backspace + Backspace - - Underline - Underline context menu item - + + Return + Return - - Outline - Outline context menu item - + + Enter + Enter - - Direction - Writing direction context sub-menu item - + + Ins + Ins - - Text Direction - Text direction context sub-menu item - + + Del + Del - - Default - Default writing direction context menu item - + + Pause + Pause - - LTR - Left to Right context menu item - + + Print + Print - - RTL - Right to Left context menu item - + + SysReq + SysReq - - Inspect - Inspect Element context menu item - + + Home + Home - - No recent searches - Label for only item in menu that appears when clicking on the search field image, when no searches have been performed - + + End + End - - Recent searches - label for first item in the menu that appears when clicking on the search field image, used as embedded menu title - + + Left + - - Clear recent searches - menu item in Recent Searches menu that empties menu's contents - + + Up + - - Unknown - Unknown filesize FTP directory listing item - 不明 + + Right + - - %1 (%2x%3 pixels) - Title string for images - + + Down + - - Web Inspector - %2 - + + PgUp + PgUp - - Scroll here - ここにスクロール + + PgDown + PgDown - - Left edge - 左端 + + CapsLock + CapsLock - - Top - 上端 + + NumLock + NumLock - Right edge - 右端 + ScrollLock + ScrollLock - - Bottom - 下端 + + Menu + メニュー + + + + Help + ヘルプ - Page left - 1ページ左へスクロール + Back + 戻る - - Page up - 1ページ戻る + + Forward + 進む - Page right - + Stop + 停止 - - Page down - 1ページ進む + + Refresh + 更新間隔 - - Scroll left - 左へスクロール + + Volume Down + 音量を下げる - - Scroll up - 上へスクロール + + Volume Mute + 消音 - Scroll right - 右へスクロール + Volume Up + 音量を上げる - - Scroll down - 下へスクロール + + Bass Boost + 低音ブースト - - - %n file(s) - number of chosen file - - - + + + Bass Up + 低音を上げる - - JavaScript Alert - %1 - + + Bass Down + 低音を下げる - - JavaScript Confirm - %1 - + + Treble Up + 高音を上げる - - JavaScript Prompt - %1 - + + Treble Down + 高音を下げる - - Move the cursor to the next character - + + Media Play + メディアの再生 - - Move the cursor to the previous character - + + Media Stop + メディアの停止 - - Move the cursor to the next word - + + Media Previous + 前のメディア - - Move the cursor to the previous word - + + Media Next + 次のメディア - - Move the cursor to the next line - + + Media Record + メディアの録音 - - Move the cursor to the previous line - + + Home Page + ホームページ - - Move the cursor to the start of the line - + + Favorites + お気に入り - - Move the cursor to the end of the line - + + Search + 検索 - - Move the cursor to the start of the block - + + Standby + スタンバイ - - Move the cursor to the end of the block - + + Open URL + URLを開く - - Move the cursor to the start of the document - + + Launch Mail + メールの起動 - - Move the cursor to the end of the document - + + Launch Media + メディアの起動 - - Select all - + + Launch (0) + (0)の起動 - - Select to the next character - + + Launch (1) + (1)の起動 - - Select to the previous character - + + Launch (2) + (2)の起動 - - Select to the next word - + + Launch (3) + (3)の起動 - - Select to the previous word - + + Launch (4) + (4)の起動 - - Select to the next line - + + Launch (5) + (5)の起動 - - Select to the previous line - + + Launch (6) + (6)の起動 - - Select to the start of the line - + + Launch (7) + (7)の起動 - - Select to the end of the line - + + Launch (8) + (8)の起動 - - Select to the start of the block - + + Launch (9) + (9)の起動 - - Select to the end of the block - + + Launch (A) + (A)の起動 - - Select to the start of the document - + + Launch (B) + (B)の起動 - - Select to the end of the document - + + Launch (C) + (C)の起動 - - Delete to the start of the word - + + Launch (D) + (D)の起動 - - Delete to the end of the word - + + Launch (E) + (E)の起動 - - Insert a new paragraph - + + Launch (F) + (F)の起動 - - Insert a new line - + + Print Screen + Print Screen - - - QWhatsThisAction - - What's This? - ヒント + + Page Up + Page Up - - - QWidget - - * - * + + Page Down + Page Down - - - QWizard - - Go Back - + + Caps Lock + Caps Lock - - Continue - + + Num Lock + Num Lock - - Commit - + + Number Lock + Number Lock - - Done - + + Scroll Lock + Scroll Lock - - Help - ヘルプ + + Insert + Insert - - < &Back - < 戻る(&B) + + Delete + Delete - - &Finish - 完了(&F) + + Escape + Escape - - Cancel - キャンセル + + System Request + System Request - - &Help - ヘルプ(&H) + + Select + Select - - &Next - + + Yes + はい - - &Next > - 次へ(&N) > + + No + いいえ - - - QWorkspace - - &Restore - 元に戻す(&R) + + Context1 + Context1 - &Move - 移動(&M) + Context2 + Context2 - &Size - サイズを変更(&S) + Context3 + Context3 - - Mi&nimize - 最小化(&N) + + Context4 + Context4 - - Ma&ximize - 最大化(&X) + + Call + Call - - &Close - 閉じる(&C) + + Hangup + Hangup - - Stay on &Top - 常に手前に表示(&T) + + Flip + Flip - - - Sh&ade - シェード(&A) + + + Ctrl + Ctrl - - - %1 - [%2] - %1 - [%2] + + + Shift + Shift - - Minimize - 最小化 + + + Alt + Alt - - Restore Down - 元に戻す + + + Meta + Meta - - Close - 閉じる + + + + + - - &Unshade - シェードを解除(&U) + + F%1 + F%1 - QXml - - - no error occurred - エラーは発生しませんでした - + QSlider - - error triggered by consumer - 消費者によってエラーが誘発されました + + Page left + 1ページ左へスクロール - - unexpected end of file - 予期せぬファイルの終りです + + Page up + 1ページ戻る - - more than one document type definition - ドキュメントタイプの定義が複数あります + + Position + 位置 - - error occurred while parsing element - 要素の解析中にエラーが発生しました + + Page right + 1ページ右へスクロール - - tag mismatch - タグが一致しません + + Page down + 1ページ進む + + + QSocks5SocketEngine - - error occurred while parsing content - コンテンツの解析中にエラーが発生しました + + Connection to proxy refused + プロキシーへの接続が拒否されました - - unexpected character - 予期しない文字です + + Connection to proxy closed prematurely + プロキシーの接続が通信の終了前に切断されました - - invalid name for processing instruction - 処理の指示に無効な名前です + + Proxy host not found + プロキシーホストが見つかりません - - version expected while reading the XML declaration - XML宣言を読み込むにはバージョンが必要です + + Connection to proxy timed out + プロキシーとの接続がタイムアウトしました - - wrong value for standalone declaration - スタンドアロン宣言として正しくない値です + + Proxy authentication failed + プロキシーの認証に失敗しました - encoding declaration or standalone declaration expected while reading the XML declaration - XML宣言を読み込むにはエンコーディング宣言かスタンドアローン宣言が必要です + Proxy authentication failed: %1 + プロキシーの認証に失敗しました: %1 - - standalone declaration expected while reading the XML declaration - XML宣言を読み込むにはスタンドアローン宣言が必要です + + SOCKS version 5 protocol error + SOCKS バージョン 5 プロトコルのエラーです - - error occurred while parsing document type definition - ドキュメントタイプの定義を解析中にエラーが発生しました + + General SOCKSv5 server failure + SOCKS バージョン 5 サーバのエラーです - - letter is expected - 文字が必要です + + Connection not allowed by SOCKSv5 server + SOCKSv5 サーバより接続を拒否されました - - error occurred while parsing comment - コメントの解析中にエラーが発生しました + + TTL expired + 実際はホップ数です + 有効期限(TTL)がきれました - - error occurred while parsing reference - 参照の解析中にエラーが発生しました + + SOCKSv5 command not supported + この SOCKSv5 コマンドはサポートされていません - - internal general entity reference not allowed in DTD - 内部一般エンティティ参照はDTDで許されていません + + Address type not supported + 指定されたアドレスタイプはサポートされていません - - external parsed general entity reference not allowed in attribute value - 解析された外部一般エンティティ参照は属性値で許されていません + + Unknown SOCKSv5 proxy error code 0x%1 + 未知の SOCKSv5 プロキシーエラーです: 0x%1 - - external parsed general entity reference not allowed in DTD - 解析された外部一般エンティティ参照はDTDで許されていません + Socks5 timeout error connecting to socks server + Socks5 はソックスサーバ接続しようとしてタイムアウトになりました - - unparsed entity reference in wrong context - 不正な文脈で解析されないエンティティ参照です + + Network operation timed out + ネットワーク操作がタイムアウトしました + + + QSpinBox - - recursive entities - 再帰的エンティティ + + More + 増やす - - error in the text declaration of an external entity - 外部エンティティのテキスト宣言にエラーがあります + + Less + 減らす - QXmlStream + QSql - - - Extra content at end of document. - + + Delete + 削除 - - Invalid entity value. - + + Delete this record? + このレコードを削除しますか? - - Invalid XML character. - + + + + Yes + はい - - Sequence ']]>' not allowed in content. - + + + + No + いいえ - - - Encountered incorrectly encoded content. - + + Insert + 挿入 - - Namespace prefix '%1' not declared - + + Update + アップデート - - Attribute redefined. - + + Save edits? + 編集内容を保存しますか? - - Unexpected character '%1' in public id literal. - + + Cancel + キャンセル - - Invalid XML version string. - + + Confirm + 確認 - - Unsupported XML version. - + + Cancel your edits? + 編集をキャンセルしますか? + + + + QSslSocket + + + Error creating SSL context (%1) + SSL content の作成に失敗しました (%1) - - The standalone pseudo attribute must appear after the encoding. - + + Invalid or empty cipher list (%1) + 暗号方式リストが無効または空です (%1) - - %1 is an invalid encoding name. - + + Cannot provide a certificate with no key, %1 + 鍵が指定されていないため、証明書を扱えません。 %1 - Encoding %1 is unsupported - + Error loading local certificate, %1 + ローカルの証明書をロードできません。 %1 - - Standalone accepts only yes or no. - + + Error loading private key, %1 + プライベートキーをロードできません。 %1 - - Invalid attribute in XML declaration. - + + Private key does not certificate public key, %1 + プライベートキーが、パブリックキーの証明書となっていません %1 - - Premature end of document. - + + Error creating SSL session, %1 + SSL セッションを作成できません。 %1 - - Invalid document. - + + Error creating SSL session: %1 + SSL セッションを作成できません: %1 - - Expected - + + Unable to write data: %1 + 書き込みできません: %1 - - , but got ' - + + Error while reading: %1 + 読み込み時にエラーが発生しました: %1 - - Unexpected ' - + + Error during SSL handshake: %1 + SSL ハンドシェーク時にエラーが発生しました: %1 + + + QSystemSemaphore - - Expected character data. - + + + %1: out of resources + %1: リソース不足です - - Recursive entity detected. - + + + %1: permission denied + %1: 許可されていません - - Start tag expected. - + + %1: already exists + %1: 既に存在します - - NDATA in parameter entity declaration. - + + %1: does not exist + %1: 存在しません - - XML declaration not at start of document. - + + + %1: unknown error %2 + %1: 未知のエラーです %2 + + + QTDSDriver - - %1 is an invalid processing instruction name. - + + Unable to open connection + 接続をオープンできません - - Invalid processing instruction name. - + + Unable to use database + データベースを使用できません + + + QTabBar - - %1 is an invalid PUBLIC identifier. - + + Scroll Left + 左へスクロール - - - - - Illegal namespace declaration. - + + Scroll Right + 右へスクロール + + + QTcpServer - - Invalid XML name. - + Socket operation unsupported + ソケット操作はサポートされていません - - Opening and ending tag mismatch. - + + Operation on socket is not supported + このソケットへの操作はサポートされていません + + + + QTextControl + + + &Undo + 元に戻す(&U) - - Reference to unparsed entity '%1'. - + + &Redo + やり直す(&R) - - - - Entity '%1' not declared. - + + Cu&t + 切り取り(&T) - - Reference to external entity '%1' in attribute value. - + + &Copy + コピー(&C) - - Invalid character reference. - + + Copy &Link Location + リンクの場所をコピー(&L) - - - QtXmlPatterns - - An %1-attribute with value %2 has already been declared. - + + &Paste + 貼り付け(&P) - - An %1-attribute must have a valid %2 as value, which %3 isn't. - + + Delete + 削除 - - Network timeout. - + + Select All + すべてを選択 + + + QToolButton - - Element %1 can't be serialized because it appears outside the document element. - + + + Press + 押す - - Attribute %1 can't be serialized because it appears at the top level. - + + + Open + オープン + + + QUdpSocket - - Year %1 is invalid because it begins with %2. - + + This platform does not support IPv6 + このプラットフォームは IPv6 をサポートしていません + + + QUndoGroup - - Day %1 is outside the range %2..%3. - + + Undo + 元に戻す - - Month %1 is outside the range %2..%3. - + + Redo + やり直す + + + QUndoModel - - Overflow: Can't represent date %1. - + + <empty> + <空> + + + QUndoStack - - Day %1 is invalid for month %2. - + + Undo + 元に戻す - - Time 24:%1:%2.%3 is invalid. Hour is 24, but minutes, seconds, and milliseconds are not all 0; - + + Redo + やり直す + + + QUnicodeControlCharacterMenu - - Time %1:%2:%3.%4 is invalid. - + + LRM Left-to-right mark + LRM (左横書き指定) - - Overflow: Date can't be represented. - + + RLM Right-to-left mark + RLM (右横書き指定) - - - At least one component must be present. - + + ZWJ Zero width joiner + ZWJ (幅のない接続文字) - - At least one time component must appear after the %1-delimiter. - + + ZWNJ Zero width non-joiner + ZWNJ (幅のない非接続文字) - - No operand in an integer division, %1, can be %2. - + + ZWSP Zero width space + ZWSP (幅の無い空白) - - The first operand in an integer division, %1, cannot be infinity (%2). - + + LRE Start of left-to-right embedding + LRE (左横書き開始指定) - - The second operand in a division, %1, cannot be zero (%2). - + + RLE Start of right-to-left embedding + RLE (右横書き開始指定) - - %1 is not a valid value of type %2. - + + LRO Start of left-to-right override + LRO (左横書き上書き開始指定) - - When casting to %1 from %2, the source value cannot be %3. - + + RLO Start of right-to-left override + RLO (右横書き上書き開始指定) - - Integer division (%1) by zero (%2) is undefined. - + + PDF Pop directional formatting + PDF (方向上書きの終了指定) - - Division (%1) by zero (%2) is undefined. - + + Insert Unicode control character + Unicode制御文字を挿入 + + + QWebFrame - - Modulus division (%1) by zero (%2) is undefined. - + + Request cancelled + リクエストはキャンセルされました - - - Dividing a value of type %1 by %2 (not-a-number) is not allowed. - + + Request blocked + リクエストはブロックされました - - Dividing a value of type %1 by %2 or %3 (plus or minus zero) is not allowed. - + + Cannot show URL + URL を表示できません - - Multiplication of a value of type %1 by %2 or %3 (plus or minus infinity) is not allowed. - + + Frame load interruped by policy change + ポリシーの変更により、フレームのロードが中断しました - - A value of type %1 cannot have an Effective Boolean Value. - + + Cannot show mimetype + MIME Type を表示できません - - Effective Boolean Value cannot be calculated for a sequence containing two or more atomic values. - + + File does not exist + ファイルが存在しません + + + QWebPage - - Value %1 of type %2 exceeds maximum (%3). - + + Bad HTTP request + 誤った HTTP のリクエストです - - Value %1 of type %2 is below minimum (%3). - + + Submit + default label for Submit buttons in forms on web pages + 送信 - - A value of type %1 must contain an even number of digits. The value %2 does not. - + + Submit + Submit (input element) alt text for <input> elements with no alt, title, or value + 送信 - - %1 is not valid as a value of type %2. - + + Reset + default label for Reset buttons in forms on web pages + リセット - - Operator %1 cannot be used on type %2. - + + This is a searchable index. Enter search keywords: + text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' + 検索が可能です。検索のためのキーワードを入力してください: - - Operator %1 cannot be used on atomic values of type %2 and %3. - + + Choose File + title for file button used in HTML forms + ファイルを選ぶ - - The namespace URI in the name for a computed attribute cannot be %1. - + + No file selected + text to display in file button used in HTML forms when no file is selected + ファイルが選択されていません - - The name for a computed attribute cannot have the namespace URI %1 with the local name %2. - + + Open in New Window + Open in New Window context menu item + 新しいウィンドウで開く - - Type error in cast, expected %1, received %2. - + + Save Link... + Download Linked File context menu item + リンク先を保存... - - When casting to %1 or types derived from it, the source value must be of the same type, or it must be a string literal. Type %2 is not allowed. - + + Copy Link + Copy Link context menu item + リンク先をコピー - - No casting is possible with %1 as the target type. - + + Open Image + Open Image in New Window context menu item + イメージを開く - - It is not possible to cast from %1 to %2. - + + Save Image + Download Image context menu item + 画像を保存 - - Casting to %1 is not possible because it is an abstract type, and can therefore never be instantiated. - + + Copy Image + Copy Link context menu item + 画像をコピー - - It's not possible to cast the value %1 of type %2 to %3 - + + Open Frame + Open Frame in New Window context menu item + フレームを新しいウィンドウで開く - - Failure when casting from %1 to %2: %3 - + + Copy + Copy context menu item + コピー - - A comment cannot contain %1 - + + Go Back + Back context menu item + 戻る - - A comment cannot end with a %1. - + + Go Forward + Forward context menu item + 進む - - No comparisons can be done involving the type %1. - + + Stop + Stop context menu item + 停止 - - Operator %1 is not available between atomic values of type %2 and %3. - + + Reload + Reload context menu item + リロード - - An attribute node cannot be a child of a document node. Therefore, the attribute %1 is out of place. - + + Cut + Cut context menu item + 切り取り - - A library module cannot be evaluated directly. It must be imported from a main module. - + + Paste + Paste context menu item + 貼り付け - - No template by name %1 exists. - + + No Guesses Found + No Guesses Found context menu item + 推測候補はありません - - A value of type %1 cannot be a predicate. A predicate must have either a numeric type or an Effective Boolean Value type. - + + Ignore + Ignore Spelling context menu item + 無視 - - A positional predicate must evaluate to a single numeric value. - + + Add To Dictionary + Learn Spelling context menu item + 辞書に追加 - - The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid. - + + Search The Web + Search The Web context menu item + Web を検索 - - %1 is not a valid target name in a processing instruction. It must be a %2 value, e.g. %3. - + + Look Up In Dictionary + Look Up in Dictionary context menu item + 辞書から探す - - The last step in a path must contain either nodes or atomic values. It cannot be a mixture between the two. - + + Open Link + Open Link context menu item + リンクを開く - - The data of a processing instruction cannot contain the string %1 - + + Ignore + Ignore Grammar context menu item + 無視 - - No namespace binding exists for the prefix %1 - + + Spelling + Spelling and Grammar context sub-menu item + スペル - - No namespace binding exists for the prefix %1 in %2 - + + Show Spelling and Grammar + menu item title + スペルと文法を表示 - - - %1 is an invalid %2 - - - - - %1 takes at most %n argument(s). %2 is therefore invalid. - - - + + Hide Spelling and Grammar + menu item title + スペルと文法を隠す - - - %1 requires at least %n argument(s). %2 is therefore invalid. - - - + + + Check Spelling + Check spelling context menu item + スペルをチェックする - - The first argument to %1 cannot be of type %2. It must be a numeric type, xs:yearMonthDuration or xs:dayTimeDuration. - + + Check Spelling While Typing + Check spelling while typing context menu item + 入力中にスペルをチェックする - - The first argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - + + Check Grammar With Spelling + Check grammar with spelling context menu item + スペルおよび文法をチェックする - - The second argument to %1 cannot be of type %2. It must be of type %3, %4, or %5. - + + Fonts + Font context sub-menu item + フォント - - %1 is not a valid XML 1.0 character. - + + Bold + Bold context menu item + 太字 - - The first argument to %1 cannot be of type %2. - + + Italic + Italic context menu item + イタリック - - If both values have zone offsets, they must have the same zone offset. %1 and %2 are not the same. - + + Underline + Underline context menu item + 下線 - - %1 was called. - + + Outline + Outline context menu item + アウトライン - - %1 must be followed by %2 or %3, not at the end of the replacement string. - + + Direction + Writing direction context sub-menu item + 方向 - - In the replacement string, %1 must be followed by at least one digit when not escaped. - + + Text Direction + Text direction context sub-menu item + テキストの方向 - - In the replacement string, %1 can only be used to escape itself or %2, not %3 - + + Default + Default writing direction context menu item + デフォルト - - %1 matches newline characters - + + LTR + Left to Right context menu item + 左横書き - - %1 and %2 match the start and end of a line. - + + RTL + Right to Left context menu item + 右横書き - - Matches are case insensitive - + + Inspect + Inspect Element context menu item + ? + 検査 - - Whitespace characters are removed, except when they appear in character classes - + + No recent searches + Label for only item in menu that appears when clicking on the search field image, when no searches have been performed + 検索の履歴はありません - - %1 is an invalid regular expression pattern: %2 - + + Recent searches + label for first item in the menu that appears when clicking on the search field image, used as embedded menu title + 検索の履歴 - - %1 is an invalid flag for regular expressions. Valid flags are: - + + Clear recent searches + menu item in Recent Searches menu that empties menu's contents + 検索の履歴をクリア - - If the first argument is the empty sequence or a zero-length string (no namespace), a prefix cannot be specified. Prefix %1 was specified. - + + Unknown + Unknown filesize FTP directory listing item + 不明 - - It will not be possible to retrieve %1. - + + %1 (%2x%3 pixels) + Title string for images + %1 (%2x%3 ピクセル) - - The root node of the second argument to function %1 must be a document node. %2 is not a document node. - + + Web Inspector - %2 + Web の検査 - %2 - - The default collection is undefined - + + Scroll here + ここにスクロール - - %1 cannot be retrieved - + + Left edge + 左端 - - The normalization form %1 is unsupported. The supported forms are %2, %3, %4, and %5, and none, i.e. the empty string (no normalization). - + + Top + 上端 - - A zone offset must be in the range %1..%2 inclusive. %3 is out of range. - + + Right edge + 右端 - - %1 is not a whole number of minutes. - + + Bottom + 下端 - - Required cardinality is %1; got cardinality %2. - + + Page left + 1ページ左へスクロール - - The item %1 did not match the required type %2. - + + Page up + 1ページ戻る - - - %1 is an unknown schema type. - + + Page right + 1ページ右へスクロール - - Only one %1 declaration can occur in the query prolog. - + + Page down + 1ページ進む - - The initialization of variable %1 depends on itself - + + Scroll left + 左へスクロール - - No variable by name %1 exists - + + Scroll up + 上へスクロール - - The variable %1 is unused - + + Scroll right + 右へスクロール - - Version %1 is not supported. The supported XQuery version is 1.0. - + + Scroll down + 下へスクロール + + + + %n file(s) + number of chosen file + + %n 個のファイル + - - The encoding %1 is invalid. It must contain Latin characters only, must not contain whitespace, and must match the regular expression %2. - + + JavaScript Alert - %1 + JavaScript アラート - %1 - - No function with signature %1 is available - + + JavaScript Confirm - %1 + JavaScript 確認 - %1 - - - A default namespace declaration must occur before function, variable, and option declarations. - + + JavaScript Prompt - %1 + JavaScript 質問 - %1 - - Namespace declarations must occur before function, variable, and option declarations. - + + Move the cursor to the next character + 次の文字へカーソルを移動 - - Module imports must occur before function, variable, and option declarations. - + + Move the cursor to the previous character + 前の文字にカーソルを移動 - - It is not possible to redeclare prefix %1. - + + Move the cursor to the next word + 次の単語にカーソルを移動 - - Prefix %1 is already declared in the prolog. - + + Move the cursor to the previous word + 前の単語にカーソルを移動 - - The name of an option must have a prefix. There is no default namespace for options. - + + Move the cursor to the next line + 次の行にカーソルを移動 - - The Schema Import feature is not supported, and therefore %1 declarations cannot occur. - + + Move the cursor to the previous line + 前の行にカーソルを移動 - - The target namespace of a %1 cannot be empty. - + + Move the cursor to the start of the line + 文なのか行なのか + 文頭にカーソルを移動 - - The module import feature is not supported - + + Move the cursor to the end of the line + 文末にカーソルを移動 - - No value is available for the external variable by name %1. - + + Move the cursor to the start of the block + ブロックの先頭にカーソルを移動 - - A construct was encountered which only is allowed in XQuery. - + + Move the cursor to the end of the block + ブロックの末尾にカーソルを移動 - - A template by name %1 has already been declared. - + + Move the cursor to the start of the document + 文章の先頭にカーソルを移動 - - The keyword %1 cannot occur with any other mode name. - + + Move the cursor to the end of the document + 文章の末尾にカーソルを移動 - - The value of attribute %1 must of type %2, which %3 isn't. - + + Select all + すべてを選択 - - The prefix %1 can not be bound. By default, it is already bound to the namespace %2. - + + Select to the next character + 次の文字を選択 - - A variable by name %1 has already been declared. - + + Select to the previous character + 前の文字を選択 - - A stylesheet function must have a prefixed name. - + + Select to the next word + 次の単語を選択 - - The namespace for a user defined function cannot be empty (try the predefined prefix %1 which exists for cases like this) - + + Select to the previous word + 前の単語を選択 - - The namespace %1 is reserved; therefore user defined functions may not use it. Try the predefined prefix %2, which exists for these cases. - + + Select to the next line + 次の行を選択 - - The namespace of a user defined function in a library module must be equivalent to the module namespace. In other words, it should be %1 instead of %2 - + + Select to the previous line + 前の行を選択 - - A function already exists with the signature %1. - + + Select to the start of the line + 文頭から選択 - - No external functions are supported. All supported functions can be used directly, without first declaring them as external - + + Select to the end of the line + 文末まで選択 - - An argument by name %1 has already been declared. Every argument name must be unique. - + + Select to the start of the block + ブロックの先頭から選択 - - When function %1 is used for matching inside a pattern, the argument must be a variable reference or a string literal. - + + Select to the end of the block + ブロックの末尾まで選択 - - In an XSL-T pattern, the first argument to function %1 must be a string literal, when used for matching. - + + Select to the start of the document + ドキュメントの先頭から選択 - - In an XSL-T pattern, the first argument to function %1 must be a literal or a variable reference, when used for matching. - + + Select to the end of the document + ドキュメントの末尾まで選択 - - In an XSL-T pattern, function %1 cannot have a third argument. - + + Delete to the start of the word + 単語の先頭まで削除 - - In an XSL-T pattern, only function %1 and %2, not %3, can be used for matching. - + + Delete to the end of the word + 単語の末尾まで削除 - - In an XSL-T pattern, axis %1 cannot be used, only axis %2 or %3 can. - + + Insert a new paragraph + 新しい段落を挿入 - - %1 is an invalid template mode name. - + + Insert a new line + 新しい行を挿入 + + + QWhatsThisAction - - The name of a variable bound in a for-expression must be different from the positional variable. Hence, the two variables named %1 collide. - + + What's This? + ヒント? + + + QWidget - - The Schema Validation Feature is not supported. Hence, %1-expressions may not be used. - + + * + * + + + QWizard - - None of the pragma expressions are supported. Therefore, a fallback expression must be present - + + Go Back + 戻る - - Each name of a template parameter must be unique; %1 is duplicated. - + + Continue + 続き - - The %1-axis is unsupported in XQuery - + + Commit + 適用 - - %1 is not a valid name for a processing-instruction. - + + Done + 終了 - - %1 is not a valid numeric literal. - + + Help + ヘルプ - - No function by name %1 is available. - + + < &Back + < 戻る(&B) - - The namespace URI cannot be the empty string when binding to a prefix, %1. - + + &Finish + 完了(&F) - - %1 is an invalid namespace URI. - + + Cancel + キャンセル - - It is not possible to bind to the prefix %1 - + + &Help + ヘルプ(&H) - - Namespace %1 can only be bound to %2 (and it is, in either case, pre-declared). - + + &Next + 次へ(&N) - - Prefix %1 can only be bound to %2 (and it is, in either case, pre-declared). - + + &Next > + 次へ(&N) > + + + QWorkspace - - Two namespace declaration attributes have the same name: %1. - + + &Restore + 元に戻す(&R) - - The namespace URI must be a constant and cannot use enclosed expressions. - + + &Move + 移動(&M) - - An attribute by name %1 has already appeared on this element. - + + &Size + サイズを変更(&S) - - A direct element constructor is not well-formed. %1 is ended with %2. - + + Mi&nimize + 最小化(&N) - - The name %1 does not refer to any schema type. - + + Ma&ximize + 最大化(&X) - - %1 is an complex type. Casting to complex types is not possible. However, casting to atomic types such as %2 works. - + + &Close + 閉じる(&C) - - %1 is not an atomic type. Casting is only possible to atomic types. - + + Stay on &Top + 常に手前に表示(&T) - - - %1 is not in the in-scope attribute declarations. Note that the schema import feature is not supported. - + + + Sh&ade + シェード(&A) - - The name of an extension expression must be in a namespace. - + + + %1 - [%2] + %1 - [%2] - - empty - + + Minimize + 最小化 - zero or one - + Restore Down + 元に戻す - - exactly one - + + Close + 閉じる - - one or more - + + &Unshade + シェードを解除(&U) + + + + QXml + + + no error occurred + エラーは発生しませんでした + + + + error triggered by consumer + 消費者によってエラーが誘発されました - - zero or more - + + unexpected end of file + 予期せぬファイルの終りです - - Required type is %1, but %2 was found. - + + more than one document type definition + ドキュメントタイプの定義が複数あります - - Promoting %1 to %2 may cause loss of precision. - + + error occurred while parsing element + 要素の解析中にエラーが発生しました - - The focus is undefined. - + + tag mismatch + タグが一致しません - - It's not possible to add attributes after any other kind of node. - + + error occurred while parsing content + コンテンツの解析中にエラーが発生しました - - An attribute by name %1 has already been created. - + + unexpected character + 予期しない文字です - - Only the Unicode Codepoint Collation is supported(%1). %2 is unsupported. - + + invalid name for processing instruction + 処理の指示に無効な名前です - - %1 is an unsupported encoding. - + + version expected while reading the XML declaration + XML宣言を読み込むにはバージョンが必要です - - %1 contains octets which are disallowed in the requested encoding %2. - + + wrong value for standalone declaration + スタンドアロン宣言として正しくない値です - - The codepoint %1, occurring in %2 using encoding %3, is an invalid XML character. - + + encoding declaration or standalone declaration expected while reading the XML declaration + XML宣言を読み込むにはエンコーディング宣言かスタンドアローン宣言が必要です - - Ambiguous rule match. - + + standalone declaration expected while reading the XML declaration + XML宣言を読み込むにはスタンドアローン宣言が必要です - - In a namespace constructor, the value for a namespace cannot be an empty string. - + + error occurred while parsing document type definition + ドキュメントタイプの定義を解析中にエラーが発生しました - - The prefix must be a valid %1, which %2 is not. - + + letter is expected + 文字が必要です - - The prefix %1 cannot be bound. - + + error occurred while parsing comment + コメントの解析中にエラーが発生しました - - Only the prefix %1 can be bound to %2 and vice versa. - + + error occurred while parsing reference + 参照の解析中にエラーが発生しました - - Circularity detected - + + internal general entity reference not allowed in DTD + 内部一般エンティティ参照はDTDで許されていません - - The parameter %1 is required, but no corresponding %2 is supplied. - + + external parsed general entity reference not allowed in attribute value + 解析された外部一般エンティティ参照は属性値で許されていません - - The parameter %1 is passed, but no corresponding %2 exists. - + + external parsed general entity reference not allowed in DTD + 解析された外部一般エンティティ参照はDTDで許されていません - - The URI cannot have a fragment - + + unparsed entity reference in wrong context + 不正な文脈で解析されないエンティティ参照です - - Element %1 is not allowed at this location. - + + recursive entities + 再帰的エンティティ - - Text nodes are not allowed at this location. - + + error in the text declaration of an external entity + 外部エンティティのテキスト宣言にエラーがあります + + + QXmlStream - - Parse error: %1 - + + + Extra content at end of document. + ドキュメントの末尾に余計なものがついています。 - - The value of the XSL-T version attribute must be a value of type %1, which %2 isn't. - + + Invalid entity value. + エンティティの値が無効です。 - - Running an XSL-T 1.0 stylesheet with a 2.0 processor. - + + Invalid XML character. + 無効な XML 文字です。 - - Unknown XSL-T attribute %1. - + + Sequence ']]>' not allowed in content. + このコンテキストでは、']]>' は許可されていません。 - - Attribute %1 and %2 are mutually exclusive. - + + + Encountered incorrectly encoded content. + 正しくないエンコードの文脈に遭遇しました。 - - In a simplified stylesheet module, attribute %1 must be present. - + + Namespace prefix '%1' not declared + 名前空間のブリフィックス '%1' は宣言されていません - - If element %1 has no attribute %2, it cannot have attribute %3 or %4. - + + Attribute redefined. + 属性が再度指定されています。 - - Element %1 must have at least one of the attributes %2 or %3. - + + Unexpected character '%1' in public id literal. + DTD宣言の部分 + 公開 ID 指定に使用できない文字 '%1' が使用されています。 - At least one mode must be specified in the %1-attribute on element %2. - + Invalid XML version string. + 無効な XML バージョン指定です。 - - Attribute %1 cannot appear on the element %2. Only the standard attributes can appear. - + + Unsupported XML version. + この XML のバージョンはサポートされていません。 - - Attribute %1 cannot appear on the element %2. Only %3 is allowed, and the standard attributes. - + + The standalone pseudo attribute must appear after the encoding. + &ddd; は、エンコーディングを指定していないと使えないということかな。utf8だとおもうけど。 + 仮想属性指定は、エンコーディング指定の後にのみ使用できます。 - - Attribute %1 cannot appear on the element %2. Allowed is %3, %4, and the standard attributes. - + + %1 is an invalid encoding name. + %1 は無効なエンコーディングの名前です。 - - Attribute %1 cannot appear on the element %2. Allowed is %3, and the standard attributes. - + + Encoding %1 is unsupported + エンコーディング '%1' はサポートされていません - - XSL-T attributes on XSL-T elements must be in the null namespace, not in the XSL-T namespace which %1 is. - + + Standalone accepts only yes or no. + standalone の指定は yes または no のみ指定できます。 - - The attribute %1 must appear on element %2. - + + Invalid attribute in XML declaration. + XML 宣言に無効な属性がついています。 - - The element with local name %1 does not exist in XSL-T. - + + Premature end of document. + ドキュメントが途中で終わっています。 - - Element %1 must come last. - + + Invalid document. + 無効なドキュメントです。 - - At least one %1-element must occur before %2. - + + Expected + 予期していた表現は、 - - Only one %1-element can appear. - + + , but got ' + ですが、取得した表現は以下のものでした ' - - At least one %1-element must occur inside %2. - + + Unexpected ' + 予期していなかった表現 ' - - When attribute %1 is present on %2, a sequence constructor cannot be used. - + + Expected character data. + 予期していた文字列。 - - Element %1 must have either a %2-attribute or a sequence constructor. - + + Recursive entity detected. + 再帰しているエンティティを発見しました。 - - When a parameter is required, a default value cannot be supplied through a %1-attribute or a sequence constructor. - + + Start tag expected. + 開始タグをよきしていましたが、みつかりません。 - - Element %1 cannot have children. - + + NDATA in parameter entity declaration. + パラメータエンティティの宣言において NDATA があります。 - - Element %1 cannot have a sequence constructor. - + + XML declaration not at start of document. + XML 宣言がドキュメントの先頭にありません。 - - - The attribute %1 cannot appear on %2, when it is a child of %3. - + + %1 is an invalid processing instruction name. + XMLにそんなのあったっけ? + %1 は無効な処理指定の名前です。 - - A parameter in a function cannot be declared to be a tunnel. - + + Invalid processing instruction name. + 無効な処理命令です。 - - This processor is not Schema-aware and therefore %1 cannot be used. - + + %1 is an invalid PUBLIC identifier. + %1 は、公開 (PUBLIC) 識別子として無効です。 - - Top level stylesheet elements must be in a non-null namespace, which %1 isn't. - + + + + + Illegal namespace declaration. + 無効な名前空間の指定です。 - - The value for attribute %1 on element %2 must either be %3 or %4, not %5. - + + Invalid XML name. + 無効な XML 名です。 - - Attribute %1 cannot have the value %2. - + + Opening and ending tag mismatch. + 開始タグと、終了タグがマッチしません。 - - The attribute %1 can only appear on the first %2 element. - + + Reference to unparsed entity '%1'. + まだパースしていないエンティティ '%1' を参照しています。 - - At least one %1 element must appear as child of %2. - + + + + Entity '%1' not declared. + エンティティ '%1' は宣言されていません。 - - - VolumeSlider - - Muted - + + Reference to external entity '%1' in attribute value. + 属性値として、外部エンティティ '%1' を再度指定しています。 - - - Volume: %1% - + + Invalid character reference. + 無効な文字への参照です。 -- cgit v0.12 From aef98360bfa5a5f3013c8fb29ed589545bb7a3cf Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 19 May 2009 10:20:53 +0200 Subject: Fix compiler warning: use C++ cast operator, not the old-style C cast. Reviewed-by: Marius Storm-Olsen --- src/corelib/tools/qbytearraymatcher.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h index 633e92c..970cbcc 100644 --- a/src/corelib/tools/qbytearraymatcher.h +++ b/src/corelib/tools/qbytearraymatcher.h @@ -70,7 +70,7 @@ public: inline QByteArray pattern() const { if (q_pattern.isNull()) - return QByteArray((const char*)p.p, p.l); + return QByteArray(reinterpret_cast(p.p), p.l); return q_pattern; } -- cgit v0.12 From 4bcc39e50b68d69f6b94b1095b35f678c42c5aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 19 May 2009 10:15:19 +0200 Subject: Fixed autotest failure in tst_QImage::smoothScale3() Some optimized smooth scaling functions were introduced in 4.5, so increase the tolerance level a small bit. Reviewed-by: Trond --- tests/auto/qimage/tst_qimage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp index ee4ece2..88bbb50 100644 --- a/tests/auto/qimage/tst_qimage.cpp +++ b/tests/auto/qimage/tst_qimage.cpp @@ -1454,9 +1454,9 @@ void tst_QImage::smoothScale3() QRgb cb = b.pixel(x, y); // tolerate a little bit of rounding errors - QVERIFY(compare(qRed(ca), qRed(cb), 2)); - QVERIFY(compare(qGreen(ca), qGreen(cb), 2)); - QVERIFY(compare(qBlue(ca), qBlue(cb), 2)); + QVERIFY(compare(qRed(ca), qRed(cb), 3)); + QVERIFY(compare(qGreen(ca), qGreen(cb), 3)); + QVERIFY(compare(qBlue(ca), qBlue(cb), 3)); } } } -- cgit v0.12 From 9f9ede616079998f8ba7bf6fd446f39ce74b0400 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Mon, 18 May 2009 16:04:15 +0200 Subject: Modernize the output of qdoc a bit. Now we have explicit columns we cann make our docs look a bit better using some simple css additions. This adds light backgrounds in targetted places to make the text more readable. --- tools/qdoc3/test/classic.css | 64 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 6cf7377..3704a15 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -1,7 +1,29 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} + h3.fn,span.fn { - margin-left: 1cm; - text-indent: -1cm; + background-color: #d5e1e8; + border-width: 1px; + border-style: solid; + border-color: #84b0c7; + font-weight: bold; + -moz-border-radius: 8px 8px 8px 8px; + padding: 6px 0px 6px 10px; } a:link @@ -56,6 +78,44 @@ body color: black } +table td.memItemLeft { + width: 200px; + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +table td.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} + table tr.odd { background: #f0f0f0; color: black; -- cgit v0.12 From 48328daeb082385bd8f8074ee77c7cbee9cde637 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 19 May 2009 10:51:30 +0200 Subject: Fix autotest compile for qitemview on windows Reviewed-by: Thomas Zander --- tests/auto/qitemview/tst_qitemview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qitemview/tst_qitemview.cpp b/tests/auto/qitemview/tst_qitemview.cpp index 748bd50..3317c1d 100644 --- a/tests/auto/qitemview/tst_qitemview.cpp +++ b/tests/auto/qitemview/tst_qitemview.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include "viewstotest.cpp" #include #if defined(Q_OS_WIN) -- cgit v0.12 From 46f776a1c6b7e72ebe69ecde130d514b69fe4319 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 19 May 2009 10:51:19 +0200 Subject: Fixed autotest tst_QPrinter::printDialogCompleter on Windows. QApplication::activeWindow() returns null for native dialogs, so null cannot be passed as the target widget when calling QTest::keyClick(). --- tests/auto/qprinter/tst_qprinter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp index cde4ae5..221e3b0 100644 --- a/tests/auto/qprinter/tst_qprinter.cpp +++ b/tests/auto/qprinter/tst_qprinter.cpp @@ -953,8 +953,9 @@ void tst_QPrinter::printDialogCompleter() QTest::qWait(100); - QTest::keyClick(0, Qt::Key_Tab); - QTest::keyClick(0, 'P'); + QTest::keyClick(&dialog, Qt::Key_Tab); + QTest::keyClick(&dialog, 'P'); + // The test passes if it doesn't crash. #endif } -- cgit v0.12 From 589a8689705dc0572990b416f7ef085986ff2f57 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 19 May 2009 11:00:41 +0200 Subject: Fix autotest for qitemmodel on windows Fixed a broken include Reviewed-by: Thomas Zander --- tests/auto/qitemmodel/tst_qitemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qitemmodel/tst_qitemmodel.cpp b/tests/auto/qitemmodel/tst_qitemmodel.cpp index ea1972e..d29a3e3 100644 --- a/tests/auto/qitemmodel/tst_qitemmodel.cpp +++ b/tests/auto/qitemmodel/tst_qitemmodel.cpp @@ -54,7 +54,7 @@ #include #include #include -#include +#include "modelstotest.cpp" #include Q_DECLARE_METATYPE(QModelIndex) -- cgit v0.12 From ba5fb9f05c891feac8ab69006189de1aaafebc18 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 19 May 2009 11:40:45 +0200 Subject: Cocoa 64: ssl does not work The reason is the tha config.test ssl failed building. And the reason for that was a bad makefile flag (i386_64). Task-number: 253887 Reviewed-by: Trenton Schulz --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index bd77174..20bf457 100755 --- a/configure +++ b/configure @@ -2717,6 +2717,7 @@ if [ "$PLATFORM_MAC" = "yes" ]; then # Build commmand line arguments we can pass to the compiler during configure tests # by prefixing each arch with "-arch". CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS/x86/i386}" + CFG_MAC_ARCHS_GCC_FORMAT="${CFG_MAC_ARCHS/i386_64/x86_64}" for ARCH in $CFG_MAC_ARCHS_GCC_FORMAT; do MAC_ARCHS_COMMANDLINE="$MAC_ARCHS_COMMANDLINE -arch $ARCH" done -- cgit v0.12 From 30f7edc0aab629499b74263391ae529ad31b2ff8 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 19 May 2009 10:42:46 +0200 Subject: Ignore GCC warning of unsafe floating point comparisons. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to optimizations, there are few cases where comparing with a constant is needed, e.g. in operator*=. G++ will give us a warning for this. Since we know what we are doing, surpress the warning. The only drawback for this workaround is if somebody includes qtransform.h in his code and disable the float-equal warning since the warning will be activated again. Reviewed-by: Samuel Rødal --- src/gui/painting/qtransform.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h index c76409b..4ea1be3 100644 --- a/src/gui/painting/qtransform.h +++ b/src/gui/painting/qtransform.h @@ -255,6 +255,13 @@ inline qreal QTransform::dy() const return affine._dy; } +#if defined(Q_CC_GNU) +# define Q_CC_GNU_VERSION (((__GNUC__)<<16)|((__GNUC_MINOR__)<<8)|(__GNUC_PATCHLEVEL__)) +# if Q_CC_GNU_VERSION >= 0x040201 +# pragma GCC diagnostic ignored "-Wfloat-equal" +# endif +#endif + inline QTransform &QTransform::operator*=(qreal num) { if (num == 1.) @@ -311,6 +318,13 @@ inline QTransform &QTransform::operator-=(qreal num) return *this; } +#if defined(Q_CC_GNU_VERSION) +# if Q_CC_GNU_VERSION >= 0x040201 +# pragma GCC diagnostic warning "-Wfloat-equal" +# endif +# undef Q_GCC_GNU_VERSION +#endif + /****** stream functions *******************/ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTransform &); Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTransform &); -- cgit v0.12 From ec9606bc65aaee81a4defea64afe58594349472a Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 19 May 2009 12:19:40 +0200 Subject: compile fixes with namespaces --- src/gui/image/qpixmapcache_p.h | 4 ++++ tools/kmap2qmap/main.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h index 66b30d2..5aa6eaf 100644 --- a/src/gui/image/qpixmapcache_p.h +++ b/src/gui/image/qpixmapcache_p.h @@ -58,6 +58,8 @@ #include #include "qcache.h" +QT_BEGIN_NAMESPACE + class QPixmapCache::KeyData { public: @@ -89,4 +91,6 @@ public: } }; +QT_END_NAMESPACE + #endif // QPIXMAPCACHE_P_H diff --git a/tools/kmap2qmap/main.cpp b/tools/kmap2qmap/main.cpp index b518392..12d91c6 100644 --- a/tools/kmap2qmap/main.cpp +++ b/tools/kmap2qmap/main.cpp @@ -384,10 +384,12 @@ static const symbol_synonyms_t symbol_synonyms[] = { static const int symbol_synonyms_size = sizeof(symbol_synonyms)/sizeof(symbol_synonyms_t); // makes the generated array in --header mode a bit more human readable +QT_BEGIN_NAMESPACE static bool operator<(const QWSKeyboard::Mapping &m1, const QWSKeyboard::Mapping &m2) { return m1.keycode != m2.keycode ? m1.keycode < m2.keycode : m1.modifiers < m2.modifiers; } +QT_END_NAMESPACE class KeymapParser { public: -- cgit v0.12 From c8f8405d154cf1c24b50777e5db2ac2ab1609b39 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 19 May 2009 12:29:55 +0200 Subject: qdoc: Corrected an escape sequence in the credits file. --- doc/src/credits.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/credits.qdoc b/doc/src/credits.qdoc index 114e28d..b492967 100644 --- a/doc/src/credits.qdoc +++ b/doc/src/credits.qdoc @@ -188,7 +188,7 @@ Jesper K. Pedersen \br Jim Lauchlan \br Joachim Backes \br - Jochen Römmler \br + Jochen \ouml\c{}mmler \br Jochen Scharrlach \br Joe Croft \br Joel Lindholm \br -- cgit v0.12 From e5608cd95684a010510b136361415d47cfc53e8a Mon Sep 17 00:00:00 2001 From: Morten Engvoldsen Date: Tue, 19 May 2009 12:38:16 +0200 Subject: Clearifying QUrl docs Adding more details on QUrl::addQueryItem() Task-number: 234125 Rev-by: Thiago Macieira --- src/corelib/io/qurl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 9ce9a2e..d1a5cdd 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -4759,6 +4759,12 @@ void QUrl::setEncodedQueryItems(const QList > &que Inserts the pair \a key = \a value into the query string of the URL. + The key/value pair is encoded before it is added to the query. The + pair is converted into separate strings internally. The \a key and + \a value is first encoded into UTF-8 and then delimited by the + character returned by valueDelimiter(). Each key/value pair is + delimited by the character returned by pairDelimiter(). + \sa addEncodedQueryItem() */ void QUrl::addQueryItem(const QString &key, const QString &value) -- cgit v0.12 From 01fd310f47a4a0cf7a72366105cc36e07550494c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 19 May 2009 10:59:02 +0200 Subject: fix compiler warnings when qreal == float in tessellator autotest Reviewed-by: mauricek --- tests/auto/qtessellator/tst_tessellator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qtessellator/tst_tessellator.cpp b/tests/auto/qtessellator/tst_tessellator.cpp index 8958ac3..8899285 100644 --- a/tests/auto/qtessellator/tst_tessellator.cpp +++ b/tests/auto/qtessellator/tst_tessellator.cpp @@ -218,8 +218,8 @@ void tst_QTessellator::testArc() const int stop = 1000; #endif for (int i = 0; i < stop; ++i) { - mat.rotate(.01); - mat.scale(.99, .99); + mat.rotate(qreal(.01)); + mat.scale(qreal(.99), qreal(.99)); QPolygonF poly = arc.at(0); QPolygonF vec = poly * mat; QVERIFY(test_arc(vec, true)); @@ -361,11 +361,11 @@ void tst_QTessellator::testRects() QVector v(5); for (int i = 0; i < 5; ++i) v[i] = vec[5 * rect + i]; - if (!test(v.data(), v.size(), false, test_tessellate_polygon_rect, 0.05)) { + if (!test(v.data(), v.size(), false, test_tessellate_polygon_rect, qreal(0.05))) { simplifyTestFailure(v, false); ++failures; } - if (!test(v.data(), v.size(), true, test_tessellate_polygon_rect, 0.05)) { + if (!test(v.data(), v.size(), true, test_tessellate_polygon_rect, qreal(0.05))) { simplifyTestFailure(v, true); ++failures; } -- cgit v0.12 From ad9d9a93e1f63e2509e9cdb8c245853fb3c8674a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 19 May 2009 11:00:31 +0200 Subject: Windows CE autotest compile fixes Not always is "." in the includes path... Reviewed-by: mauricek --- tests/auto/qfuture/tst_qfuture.cpp | 2 +- tests/auto/qtessellator/testtessellator.cpp | 2 +- tests/auto/qtessellator/utils.cpp | 2 +- tests/auto/qthreadonce/tst_qthreadonce.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qfuture/tst_qfuture.cpp b/tests/auto/qfuture/tst_qfuture.cpp index 43fd614..383ecba 100644 --- a/tests/auto/qfuture/tst_qfuture.cpp +++ b/tests/auto/qfuture/tst_qfuture.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include "versioncheck.h" #include #include #include diff --git a/tests/auto/qtessellator/testtessellator.cpp b/tests/auto/qtessellator/testtessellator.cpp index bd2795c..423c1e8 100644 --- a/tests/auto/qtessellator/testtessellator.cpp +++ b/tests/auto/qtessellator/testtessellator.cpp @@ -38,7 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include +#include "testtessellator.h" #include #include "math.h" diff --git a/tests/auto/qtessellator/utils.cpp b/tests/auto/qtessellator/utils.cpp index 8a9dc1e..d408193 100644 --- a/tests/auto/qtessellator/utils.cpp +++ b/tests/auto/qtessellator/utils.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include "qnum.h" #define FloatToXFixed(i) (int)((i) * 65536) #define IntToXFixed(i) ((i) << 16) diff --git a/tests/auto/qthreadonce/tst_qthreadonce.cpp b/tests/auto/qthreadonce/tst_qthreadonce.cpp index 7e67dc3..f20788a 100644 --- a/tests/auto/qthreadonce/tst_qthreadonce.cpp +++ b/tests/auto/qthreadonce/tst_qthreadonce.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include "qthreadonce.h" //TESTED_CLASS= //TESTED_FILES=corelib/thread/qthreadonce.h corelib/thread/qthreadonce.cpp -- cgit v0.12 From c73a5b4abfb1f05f8f976c526e0954680a3ed00e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 19 May 2009 12:48:50 +0200 Subject: qdoc: Corrected a misspelled name. --- doc/src/credits.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/credits.qdoc b/doc/src/credits.qdoc index b492967..6b48514 100644 --- a/doc/src/credits.qdoc +++ b/doc/src/credits.qdoc @@ -188,7 +188,7 @@ Jesper K. Pedersen \br Jim Lauchlan \br Joachim Backes \br - Jochen \ouml\c{}mmler \br + Jochen R\ouml\c{}mmler \br Jochen Scharrlach \br Joe Croft \br Joel Lindholm \br -- cgit v0.12 From 29b1965fd198b35d8f1af20becf9ed9cab54a49f Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Tue, 19 May 2009 12:45:31 +0200 Subject: Updated WebKit from /home/ariya/dev/webkit/qtwebkit-4.5 to origin/qtwebkit-4.5 ( 7b8d6ab6f2b73862d11c2a41ab0223e55585d88f ) Changes in WebKit since the last update: ++ b/WebKit/qt/ChangeLog 2009-03-27 Erik L. Bunce Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=24746 Improved selection tests. * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::textSelection): --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebKit/qt/ChangeLog | 11 ++++++ .../WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 39 ++++++++++++++++------ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index f5402ce..9f85d76 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - 1f83e4058bffd5a3fe7e44cf45add01953a772d4 + 7b8d6ab6f2b73862d11c2a41ab0223e55585d88f diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index c3bd633..2aeb8da 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,14 @@ +2009-03-27 Erik L. Bunce + + Reviewed by Simon Hausmann. + + https://bugs.webkit.org/show_bug.cgi?id=24746 + + Improved selection tests. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::textSelection): + 2009-04-24 Simon Hausmann Rubber-stamped by Ariya Hidayat. diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index fe74fac..620aa31 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -872,14 +872,6 @@ void tst_QWebPage::textSelection() "

    May the source
    be with you!

    "); page->mainFrame()->setHtml(content); - // this will select the first paragraph - QString script = "var range = document.createRange(); " \ - "var node = document.getElementById(\"one\"); " \ - "range.selectNode(node); " \ - "getSelection().addRange(range);"; - page->mainFrame()->evaluateJavaScript(script); - QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox")); - // these actions must exist QVERIFY(page->action(QWebPage::SelectAll) != 0); QVERIFY(page->action(QWebPage::SelectNextChar) != 0); @@ -895,7 +887,8 @@ void tst_QWebPage::textSelection() QVERIFY(page->action(QWebPage::SelectStartOfDocument) != 0); QVERIFY(page->action(QWebPage::SelectEndOfDocument) != 0); - // right now they are disabled because contentEditable is false + // right now they are disabled because contentEditable is false and + // there isn't an existing selection to modify QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), false); QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), false); QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), false); @@ -912,11 +905,37 @@ void tst_QWebPage::textSelection() // ..but SelectAll is awalys enabled QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true); + // this will select the first paragraph + QString selectScript = "var range = document.createRange(); " \ + "var node = document.getElementById(\"one\"); " \ + "range.selectNode(node); " \ + "getSelection().addRange(range);"; + page->mainFrame()->evaluateJavaScript(selectScript); + QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox")); + + // here the actions are enabled after a selection has been created + QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectPreviousWord)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectNextLine)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectPreviousLine)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectStartOfLine)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectEndOfLine)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectStartOfBlock)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectEndOfBlock)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectStartOfDocument)->isEnabled(), true); + QCOMPARE(page->action(QWebPage::SelectEndOfDocument)->isEnabled(), true); + // make it editable before navigating the cursor page->setContentEditable(true); + // cursor will be before the word "The", this makes sure there is a charet + page->triggerAction(QWebPage::MoveToStartOfDocument); + QVERIFY(page->isSelectionCollapsed()); + QCOMPARE(page->selectionStartOffset(), 0); + // here the actions are enabled after contentEditable is true - QCOMPARE(page->action(QWebPage::SelectAll)->isEnabled(), true); QCOMPARE(page->action(QWebPage::SelectNextChar)->isEnabled(), true); QCOMPARE(page->action(QWebPage::SelectPreviousChar)->isEnabled(), true); QCOMPARE(page->action(QWebPage::SelectNextWord)->isEnabled(), true); -- cgit v0.12 From cf427e8dcbfc63cbad67117d2da6d554aea495a9 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 19 May 2009 12:49:29 +0200 Subject: make splitter autotest pass on mac too It's not enough to call processEvents() just once on all platforms. --- tests/auto/qsplitter/tst_qsplitter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/auto/qsplitter/tst_qsplitter.cpp b/tests/auto/qsplitter/tst_qsplitter.cpp index b463f7f..51bd99f 100644 --- a/tests/auto/qsplitter/tst_qsplitter.cpp +++ b/tests/auto/qsplitter/tst_qsplitter.cpp @@ -55,6 +55,7 @@ #include #include #include // for file error messages +#include "../../shared/util.h" //TESTED_CLASS= //TESTED_FILES= @@ -1341,9 +1342,7 @@ void tst_QSplitter::task187373_addAbstractScrollAreas() if (addOutsideConstructor) splitter->addWidget(w); - qApp->processEvents(); - - QVERIFY(w->isVisible()); + QTRY_VERIFY(w->isVisible()); QVERIFY(!w->isHidden()); QVERIFY(w->viewport()->isVisible()); QVERIFY(!w->viewport()->isHidden()); -- cgit v0.12 From 071709fb6f3988f29767074c759436cccb33bcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 19 May 2009 12:04:15 +0200 Subject: qmake autotest: Remove dependency on Qt3 Support on Windows Reviewed-by: jbache --- tests/auto/qmake/testcompiler.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/auto/qmake/testcompiler.cpp b/tests/auto/qmake/testcompiler.cpp index 122a2b8..7255d93 100644 --- a/tests/auto/qmake/testcompiler.cpp +++ b/tests/auto/qmake/testcompiler.cpp @@ -56,10 +56,8 @@ static QString targetName( BuildType buildMode, const QString& target, const QSt targetName.append(".exe"); break; case Dll: // dll - if (version != "") { - QStringList ver = QStringList::split(".", version); - targetName.append(ver.first()); - } + if (!version.empty()) + targetName.append(version.section(".", 0, 0)); targetName.append(".dll"); break; case Lib: // lib -- cgit v0.12 From 41ba7d4a000181607004d450a8130be902a42274 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Tue, 19 May 2009 10:39:50 +0200 Subject: grabWindow in MacGui test was grabbing the wrong area. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I think grabWindow was borken and we were compensating for it in the auto test. Now that it works as documented our workaround broke. Reviewed-by: Morten Sørvig --- tests/auto/macgui/tst_gui.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/auto/macgui/tst_gui.cpp b/tests/auto/macgui/tst_gui.cpp index b302f8b..641e596 100644 --- a/tests/auto/macgui/tst_gui.cpp +++ b/tests/auto/macgui/tst_gui.cpp @@ -69,8 +69,7 @@ private slots: QPixmap grabWindowContents(QWidget * widget) { - const int titleBarHeight = widget->frameGeometry().height() - widget->height(); - return QPixmap::grabWindow(widget->winId(), 0, titleBarHeight, -1, widget->height()); + return QPixmap::grabWindow(widget->winId()); } /* @@ -79,10 +78,6 @@ QPixmap grabWindowContents(QWidget * widget) */ void tst_gui::scrollbarPainting() { -#if defined (Q_WS_MAC) && defined (__i386__) - QSKIP("This test fails on scruffy when run by the autotest system (but not when you run it manually).", SkipAll); -#endif - ColorWidget colorWidget; colorWidget.resize(400, 400); -- cgit v0.12 From 8413073fe3946ed37f6424f179898af63767f060 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Tue, 19 May 2009 13:08:16 +0200 Subject: Don't "hope" that a connection gets picked up; do it right! While downloadProgress and uploadProgress both work on local files. There still may be a delay before the connection is actually picked up. This usually is caught by the processEvents(), but could be missed. Therefore, do a wait if we don't have any pending connections and work in ALL cases. Reviewed-by: Markus Goetz --- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index bb199b9..d651ce5 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -2637,7 +2637,8 @@ void tst_QNetworkReply::downloadProgress() QVERIFY(spy.isValid()); QCoreApplication::instance()->processEvents(); - server.waitForNewConnection(0); // ignore result, since processEvents may have got it + if (!server.hasPendingConnections()) + server.waitForNewConnection(1000); QVERIFY(server.hasPendingConnections()); QCOMPARE(spy.count(), 0); @@ -2691,7 +2692,8 @@ void tst_QNetworkReply::uploadProgress() QVERIFY(finished.isValid()); QCoreApplication::instance()->processEvents(); - server.waitForNewConnection(0); // ignore result, since processEvents may have got it + if (!server.hasPendingConnections()) + server.waitForNewConnection(1000); QVERIFY(server.hasPendingConnections()); QTcpSocket *receiver = server.nextPendingConnection(); -- cgit v0.12 From 3fe79f2524b7d37ddbc93edbbd0530a7499b5450 Mon Sep 17 00:00:00 2001 From: Nils Christian Roscher-Nielsen Date: Tue, 19 May 2009 13:27:59 +0200 Subject: Clarifying what QLocale::C is and is not Reviewed-by: David Boddie --- src/corelib/tools/qlocale.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 559ba81..ab26945 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1589,7 +1589,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l) defaults to the default locale (see setDefault()). \endlist - The "C" locale is identical to \l{English}/\l{UnitedStates}. + The "C" locale is identical in behavior to \l{English}/\l{UnitedStates}. Use language() and country() to determine the actual language and country values used. @@ -1632,7 +1632,7 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l) This enumerated type is used to specify a language. - \value C The "C" locale is English/UnitedStates. + \value C The "C" locale is identical in behavior to English/UnitedStates. \value Abkhazian \value Afan \value Afar -- cgit v0.12 From e85bab636c2ab5d5b538363150433f6a0269a659 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 19 May 2009 13:29:39 +0200 Subject: Use QtNetworkSettings, don't hard code IMAP host name. This should fix failures in Berlin. --- tests/auto/qiodevice/tst_qiodevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp index 03a0665..367a2e0 100644 --- a/tests/auto/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/qiodevice/tst_qiodevice.cpp @@ -120,7 +120,7 @@ void tst_QIODevice::constructing_QTcpSocket() QVERIFY(!device->isOpen()); - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForConnected(5000)); QVERIFY(device->isOpen()); @@ -134,7 +134,7 @@ void tst_QIODevice::constructing_QTcpSocket() QCOMPARE(socket.pos(), qlonglong(0)); socket.close(); - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForConnected(5000)); while (!device->canReadLine()) -- cgit v0.12 From 78e46412675ba15ab16965d651e35c94c5861f90 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Tue, 19 May 2009 13:29:45 +0200 Subject: network autotests: do not use imap.troll.no for testing ... but use the test server instead Reviewed-by: Frans Englich --- tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp | 8 ++++---- tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp index 9ef8f9a..df83efe 100644 --- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -451,14 +451,14 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest() QTcpSocket socket; // Connect - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForConnected()); QCOMPARE(socket.state(), QTcpSocket::ConnectedState); // Read greeting QVERIFY(socket.waitForReadyRead(5000)); QString s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write NOOP QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8); @@ -508,7 +508,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest() tcpSocketNonBlocking_socket = &socket; // Connect - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QCOMPARE(socket.state(), QTcpSocket::HostLookupState); QTestEventLoop::instance().enterLoop(30); @@ -533,7 +533,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest() // Read greeting QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); tcpSocketNonBlocking_data.clear(); tcpSocketNonBlocking_totalWritten = 0; diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp index 86333e0..f8c2fdb 100644 --- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -589,14 +589,14 @@ void tst_QSocks5SocketEngine::tcpSocketBlockingTest() QTcpSocket socket; // Connect - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForConnected()); QCOMPARE(socket.state(), QTcpSocket::ConnectedState); // Read greeting QVERIFY(socket.waitForReadyRead(5000)); QString s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write NOOP QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8); @@ -646,7 +646,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest() tcpSocketNonBlocking_socket = &socket; // Connect - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QCOMPARE(socket.state(), QTcpSocket::HostLookupState); QTestEventLoop::instance().enterLoop(30); @@ -671,7 +671,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest() // Read greeting QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); tcpSocketNonBlocking_data.clear(); tcpSocketNonBlocking_totalWritten = 0; -- cgit v0.12 From fdce2331a7491b5452c63666267ca2b8b98d1298 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 19 May 2009 13:53:12 +0200 Subject: Use QtNetworkSettings for IMAP server, instead of hard coding. Reviewed-by: Peter Hartmann --- tests/auto/qsslsocket/tst_qsslsocket.cpp | 6 +++--- tests/auto/qtcpserver/tst_qtcpserver.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 432092a..79fbf1b 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -416,7 +416,7 @@ void tst_QSslSocket::simpleConnect() connect(&socket, SIGNAL(sslErrors(const QList &)), this, SLOT(exitLoop())); // Start connecting - socket.connectToHost("imap.troll.no", 993); + socket.connectToHost(QtNetworkSettings::serverName(), 993); QCOMPARE(socket.state(), QAbstractSocket::HostLookupState); enterLoop(10); @@ -471,7 +471,7 @@ void tst_QSslSocket::simpleConnectWithIgnore() connect(&socket, SIGNAL(sslErrors(const QList &)), this, SLOT(exitLoop())); // Start connecting - socket.connectToHost("imap.troll.no", 993); + socket.connectToHost(QtNetworkSettings::serverName(), 993); QCOMPARE(socket.state(), QAbstractSocket::HostLookupState); enterLoop(10); @@ -490,7 +490,7 @@ void tst_QSslSocket::simpleConnectWithIgnore() if (!socket.canReadLine()) enterLoop(10); - QCOMPARE(socket.readAll(), QByteArray("* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n")); + QCOMPARE(socket.readAll(), QByteArray("* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n")); socket.disconnectFromHost(); } diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index 50b293d..4fd1827 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -364,7 +364,7 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest() void tst_QTcpServer::ipv4PerformanceTest() { QTcpSocket probeSocket; - probeSocket.connectToHost("imap.troll.no", 143); + probeSocket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(probeSocket.waitForConnected(5000)); QTcpServer server; -- cgit v0.12 From ac70ce3f2598f0f3aae64c2e39c580375fd62df0 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Tue, 19 May 2009 13:59:54 +0200 Subject: Set the resolution when saving a tiff file The resolution was not saved when the image was saved as tiff. This fix add the resolution, and try to guess if the user have set it in dpi or dot per centimeter Task-number: 245242 Reviewed-by: Samuel --- src/plugins/imageformats/tiff/qtiffhandler.cpp | 20 +++++++++++++- tests/auto/qimagewriter/tst_qimagewriter.cpp | 38 +++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp index 518e6d1..77dfeb3 100644 --- a/src/plugins/imageformats/tiff/qtiffhandler.cpp +++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp @@ -168,7 +168,7 @@ bool QTiffHandler::read(QImage *image) break; default: // do nothing as defaults have already - // been set within the QImage class + // been set within the QImage class break; } for (uint32 y=0; y(image.logicalDpiX())) + && TIFFSetField(tiff, TIFFTAG_YRESOLUTION, static_cast(image.logicalDpiY())); + } + if (!resolutionSet) { + TIFFClose(tiff); + return false; + } // try to do the ARGB32 conversion in chunks no greater than 16 MB int chunks = (width * height * 4 / (1024 * 1024 * 16)) + 1; int chunkHeight = qMax(height / chunks, 1); diff --git a/tests/auto/qimagewriter/tst_qimagewriter.cpp b/tests/auto/qimagewriter/tst_qimagewriter.cpp index 878d398..70d9e70 100644 --- a/tests/auto/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/qimagewriter/tst_qimagewriter.cpp @@ -97,6 +97,9 @@ private slots: void saveWithNoFormat_data(); void saveWithNoFormat(); + void resolution_data(); + void resolution(); + void saveToTemporaryFile(); }; @@ -162,7 +165,7 @@ tst_QImageWriter::tst_QImageWriter() tst_QImageWriter::~tst_QImageWriter() { - QDir dir("images"); + QDir dir(prefix + QLatin1String("images")); QStringList filesToDelete = dir.entryList(QStringList() << "gen-*" , QDir::NoDotAndDotDot | QDir::Files); foreach( QString file, filesToDelete) { QFile::remove(dir.absoluteFilePath(file)); @@ -530,6 +533,39 @@ void tst_QImageWriter::saveWithNoFormat() QVERIFY2(!outImage.isNull(), qPrintable(reader.errorString())); } +void tst_QImageWriter::resolution_data() +{ + QTest::addColumn("filename"); + QTest::addColumn("expectedDotsPerMeterX"); + QTest::addColumn("expectedDotsPerMeterY"); +#if defined QTEST_HAVE_TIFF + QTest::newRow("TIFF: 100 dpi") << ("image_100dpi.tif") << qRound(100 * (100 / 2.54)) << qRound(100 * (100 / 2.54)); + QTest::newRow("TIFF: 50 dpi") << ("image_50dpi.tif") << qRound(50 * (100 / 2.54)) << qRound(50 * (100 / 2.54)); + QTest::newRow("TIFF: 300 dot per meter") << ("image_300dpm.tif") << 300 << 300; +#endif +} + +void tst_QImageWriter::resolution() +{ + QFETCH(QString, filename); + QFETCH(int, expectedDotsPerMeterX); + QFETCH(int, expectedDotsPerMeterY); + + QImage image(prefix + QLatin1String("colorful.bmp")); + image.setDotsPerMeterX(expectedDotsPerMeterX); + image.setDotsPerMeterY(expectedDotsPerMeterY); + const QString generatedFilepath = prefix + "gen-" + filename; + { + QImageWriter writer(generatedFilepath); + QVERIFY(writer.write(image)); + } + QImageReader reader(generatedFilepath); + const QImage generatedImage = reader.read(); + + QCOMPARE(expectedDotsPerMeterX, generatedImage.dotsPerMeterX()); + QCOMPARE(expectedDotsPerMeterY, generatedImage.dotsPerMeterY()); +} + void tst_QImageWriter::saveToTemporaryFile() { QImage image(prefix + "kollada.png"); -- cgit v0.12 From 6402c393764c884e3e113a2bf155bf38ebcd9aa1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 19 May 2009 14:38:27 +0200 Subject: Fix webkit import on cygwin and gentoo Use .XXXXX in mktemp. Reviewed-by: Janne Koskinen --- util/webkit/mkdist-webkit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/webkit/mkdist-webkit b/util/webkit/mkdist-webkit index d4e6d9e..c26fdc1 100755 --- a/util/webkit/mkdist-webkit +++ b/util/webkit/mkdist-webkit @@ -185,7 +185,7 @@ fi rev=`git ls-remote $repository | grep -E "^.+$tag$" | awk '{print $1}'` -tarball=`mktemp /tmp/webkit-snapshot.tar` || exit 1 +tarball=`mktemp /tmp/webkit-snapshot.tar.XXXXXX` || exit 1 echo "creating $tarball" echo "archiving webkit from $repository $tag ( $rev )" -- cgit v0.12 From 70429c33f0687afd489e1055bc0e1f1f340e13b9 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 19 May 2009 15:06:46 +0200 Subject: Adpot more code to use QtNetworkSettings instead of hard coded names. Reviewed-By: Peter Hartmann --- tests/auto/network-settings.h | 9 ++++++ tests/auto/q3socketdevice/tst_q3socketdevice.cpp | 7 +++-- .../qhttpsocketengine/tst_qhttpsocketengine.cpp | 23 ++++++--------- .../tst_qnativesocketengine.cpp | 16 ++++------- .../tst_qsocks5socketengine.cpp | 31 +++++++++----------- tests/auto/qsslsocket/tst_qsslsocket.cpp | 33 ++++++++++++---------- 6 files changed, 59 insertions(+), 60 deletions(-) diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index b2a449a..5a2f9c3 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -39,6 +39,7 @@ ** ****************************************************************************/ #include +#include class QtNetworkSettings { @@ -63,4 +64,12 @@ public: { return "qt-test-server.wildcard.dev." + serverDomainName(); } + +#ifdef QT_NETWORK_LIB + static QHostAddress serverIP() + { + return QHostInfo::fromName(serverName()).addresses().first(); + } +#endif + }; diff --git a/tests/auto/q3socketdevice/tst_q3socketdevice.cpp b/tests/auto/q3socketdevice/tst_q3socketdevice.cpp index 2b0c606..6255aee 100644 --- a/tests/auto/q3socketdevice/tst_q3socketdevice.cpp +++ b/tests/auto/q3socketdevice/tst_q3socketdevice.cpp @@ -45,6 +45,8 @@ #include +#include "../network-settings.h" + //TESTED_CLASS= //TESTED_FILES= @@ -97,8 +99,7 @@ void tst_Q3SocketDevice::readNull() int attempts = 10; while (attempts--) { - // connect to imap.troll.no - if (device.connect(QHostAddress("62.70.27.18"), 143)) + if (device.connect(QtNetworkSettings::serverIP(), 143)) break; } @@ -117,7 +118,7 @@ void tst_Q3SocketDevice::readNull() #endif QCOMPARE(device.peerPort(), quint16(143)); QCOMPARE(device.peerAddress().toString(), - QHostAddress("62.70.27.18").toString()); + QtNetworkSettings::serverIP().toString()); QCOMPARE(device.error(), Q3SocketDevice::NoError); // write a logout notice diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp index 9ef8f9a..4c92119 100644 --- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -137,8 +137,6 @@ public slots: } }; -static const char *IMAP_IP = "62.70.27.18"; - tst_QHttpSocketEngine::tst_QHttpSocketEngine() { } @@ -307,12 +305,11 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128)); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); QVERIFY(!socketDevice.localAddress().isNull()); QVERIFY(socketDevice.localPort() > 0); @@ -328,7 +325,7 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -369,7 +366,6 @@ void tst_QHttpSocketEngine::simpleErrorsAndStates() QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverName()), 8088)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); if (socketDevice.waitForWrite(15000)) { - qDebug() << socketDevice.state(); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState || socketDevice.state() == QAbstractSocket::UnconnectedState); } else { @@ -451,14 +447,14 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest() QTcpSocket socket; // Connect - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForConnected()); QCOMPARE(socket.state(), QTcpSocket::ConnectedState); // Read greeting QVERIFY(socket.waitForReadyRead(5000)); QString s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write NOOP QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8); @@ -508,7 +504,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest() tcpSocketNonBlocking_socket = &socket; // Connect - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QCOMPARE(socket.state(), QTcpSocket::HostLookupState); QTestEventLoop::instance().enterLoop(30); @@ -696,12 +692,11 @@ void tst_QHttpSocketEngine::passwordAuth() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128, "qsockstest", "password")); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -715,7 +710,7 @@ void tst_QHttpSocketEngine::passwordAuth() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; diff --git a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp index 68ec414..90276f2 100644 --- a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp +++ b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp @@ -100,8 +100,6 @@ private slots: void receiveUrgentData(); }; -static const char *IMAP_IP = "62.70.27.18"; - tst_QNativeSocketEngine::tst_QNativeSocketEngine() { } @@ -155,15 +153,14 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP() QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol)); QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState); - // Connect to imap.trolltech.com's IP - bool connected = socketDevice.connectToHost(QHostAddress(IMAP_IP), 143); - if (!connected) { + const bool isConnected = socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143); + if (!isConnected) { QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); } QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -176,7 +173,7 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP() QVERIFY(socketDevice.read(array.data(), array.size()) == available); // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + QCOMPARE(array.constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "ZZZ LOGOUT\r\n"; @@ -580,9 +577,8 @@ void tst_QNativeSocketEngine::networkError() QVERIFY(client.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol)); - // Connect to imap.trolltech.com's IP - bool connected = client.connectToHost(QHostAddress(IMAP_IP), 143); - if (!connected) { + const bool isConnected = client.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143); + if (!isConnected) { QVERIFY(client.state() == QAbstractSocket::ConnectingState); QVERIFY(client.waitForWrite()); QVERIFY(client.state() == QAbstractSocket::ConnectedState); diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp index 86333e0..470f897 100644 --- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -145,8 +145,6 @@ private slots: } }; -static const char *IMAP_IP = "62.70.27.18"; - tst_QSocks5SocketEngine::tst_QSocks5SocketEngine() { } @@ -321,12 +319,11 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080)); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -340,7 +337,7 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -589,7 +586,7 @@ void tst_QSocks5SocketEngine::tcpSocketBlockingTest() QTcpSocket socket; // Connect - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForConnected()); QCOMPARE(socket.state(), QTcpSocket::ConnectedState); @@ -646,7 +643,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest() tcpSocketNonBlocking_socket = &socket; // Connect - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QCOMPARE(socket.state(), QTcpSocket::HostLookupState); QTestEventLoop::instance().enterLoop(30); @@ -834,15 +831,14 @@ void tst_QSocks5SocketEngine::passwordAuth() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080, "qsockstest", "password")); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); - if (!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)) { + if (!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)) { qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData()); } QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -856,7 +852,7 @@ void tst_QSocks5SocketEngine::passwordAuth() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -902,17 +898,16 @@ void tst_QSocks5SocketEngine::passwordAuth2() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081)); socketDevice.setReceiver(this); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); while (socketDevice.state() == QAbstractSocket::ConnectingState) { QVERIFY(socketDevice.waitForWrite()); - socketDevice.connectToHost(QHostAddress(IMAP_IP), 143); + socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143); } if (socketDevice.state() != QAbstractSocket::ConnectedState) qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -926,7 +921,7 @@ void tst_QSocks5SocketEngine::passwordAuth2() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 79fbf1b..d87ab7b 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -499,36 +499,39 @@ void tst_QSslSocket::sslErrors_data() { QTest::addColumn("host"); QTest::addColumn("port"); - QTest::addColumn("errors"); - - QTest::newRow("imap.troll.no") << "imap.troll.no" << 993 - << (SslErrorList() - << QSslError::HostNameMismatch - << QSslError::SelfSignedCertificateInChain); - QTest::newRow("imap.trolltech.com") << "imap.trolltech.com" << 993 - << (SslErrorList() - << QSslError::SelfSignedCertificateInChain); + QTest::addColumn("expected"); + + QTest::newRow(qPrintable(QtNetworkSettings::serverLocalName())) + << QtNetworkSettings::serverLocalName() + << 993 + << (SslErrorList() << QSslError::HostNameMismatch + << QSslError::SelfSignedCertificate); + + QTest::newRow("imap.trolltech.com") + << "imap.trolltech.com" + << 993 + << (SslErrorList() << QSslError::SelfSignedCertificateInChain); } void tst_QSslSocket::sslErrors() { QFETCH(QString, host); QFETCH(int, port); - QFETCH(SslErrorList, errors); + QFETCH(SslErrorList, expected); QSslSocketPtr socket = newSocket(); socket->connectToHostEncrypted(host, port); socket->waitForEncrypted(5000); - SslErrorList list; + SslErrorList output; foreach (QSslError error, socket->sslErrors()) - list << error.error(); + output << error.error(); #ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND - if (list.last() == QSslError::CertificateUntrusted) - list.takeLast(); + if (output.last() == QSslError::CertificateUntrusted) + output.takeLast(); #endif - QCOMPARE(list, errors); + QCOMPARE(output, expected); } void tst_QSslSocket::addCaCertificate() -- cgit v0.12 From bc5cf95c9622fee5bdcc97736dee11923aa9daf4 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 19 May 2009 13:29:39 +0200 Subject: Use QtNetworkSettings, don't hard code IMAP host name. This should fix failures in Berlin. --- tests/auto/qiodevice/tst_qiodevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qiodevice/tst_qiodevice.cpp b/tests/auto/qiodevice/tst_qiodevice.cpp index 03a0665..367a2e0 100644 --- a/tests/auto/qiodevice/tst_qiodevice.cpp +++ b/tests/auto/qiodevice/tst_qiodevice.cpp @@ -120,7 +120,7 @@ void tst_QIODevice::constructing_QTcpSocket() QVERIFY(!device->isOpen()); - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForConnected(5000)); QVERIFY(device->isOpen()); @@ -134,7 +134,7 @@ void tst_QIODevice::constructing_QTcpSocket() QCOMPARE(socket.pos(), qlonglong(0)); socket.close(); - socket.connectToHost("imap.troll.no", 143); + socket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(socket.waitForConnected(5000)); while (!device->canReadLine()) -- cgit v0.12 From 879d5cf234bb06657b67a39969ea16d68f79fbeb Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 19 May 2009 13:53:12 +0200 Subject: Use QtNetworkSettings for IMAP server, instead of hard coding. Reviewed-by: Peter Hartmann --- tests/auto/qsslsocket/tst_qsslsocket.cpp | 6 +++--- tests/auto/qtcpserver/tst_qtcpserver.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 4f98624..3100dd5 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -415,7 +415,7 @@ void tst_QSslSocket::simpleConnect() connect(&socket, SIGNAL(sslErrors(const QList &)), this, SLOT(exitLoop())); // Start connecting - socket.connectToHost("imap.troll.no", 993); + socket.connectToHost(QtNetworkSettings::serverName(), 993); QCOMPARE(socket.state(), QAbstractSocket::HostLookupState); enterLoop(10); @@ -470,7 +470,7 @@ void tst_QSslSocket::simpleConnectWithIgnore() connect(&socket, SIGNAL(sslErrors(const QList &)), this, SLOT(exitLoop())); // Start connecting - socket.connectToHost("imap.troll.no", 993); + socket.connectToHost(QtNetworkSettings::serverName(), 993); QCOMPARE(socket.state(), QAbstractSocket::HostLookupState); enterLoop(10); @@ -489,7 +489,7 @@ void tst_QSslSocket::simpleConnectWithIgnore() if (!socket.canReadLine()) enterLoop(10); - QCOMPARE(socket.readAll(), QByteArray("* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n")); + QCOMPARE(socket.readAll(), QByteArray("* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID AUTH=PLAIN SASL-IR] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n")); socket.disconnectFromHost(); } diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index 50b293d..4fd1827 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -364,7 +364,7 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest() void tst_QTcpServer::ipv4PerformanceTest() { QTcpSocket probeSocket; - probeSocket.connectToHost("imap.troll.no", 143); + probeSocket.connectToHost(QtNetworkSettings::serverName(), 143); QVERIFY(probeSocket.waitForConnected(5000)); QTcpServer server; -- cgit v0.12 From 07e5f5f3b3b1936c5f5090b02cc2c02e344822b5 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 19 May 2009 15:06:46 +0200 Subject: Adpot more code to use QtNetworkSettings instead of hard coded names. Reviewed-By: Peter Hartmann --- tests/auto/network-settings.h | 9 ++++++ tests/auto/q3socketdevice/tst_q3socketdevice.cpp | 7 +++-- .../qhttpsocketengine/tst_qhttpsocketengine.cpp | 17 ++++------- .../tst_qnativesocketengine.cpp | 16 ++++------- .../tst_qsocks5socketengine.cpp | 27 ++++++++---------- tests/auto/qsslsocket/tst_qsslsocket.cpp | 33 ++++++++++++---------- 6 files changed, 54 insertions(+), 55 deletions(-) diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h index b2a449a..5a2f9c3 100644 --- a/tests/auto/network-settings.h +++ b/tests/auto/network-settings.h @@ -39,6 +39,7 @@ ** ****************************************************************************/ #include +#include class QtNetworkSettings { @@ -63,4 +64,12 @@ public: { return "qt-test-server.wildcard.dev." + serverDomainName(); } + +#ifdef QT_NETWORK_LIB + static QHostAddress serverIP() + { + return QHostInfo::fromName(serverName()).addresses().first(); + } +#endif + }; diff --git a/tests/auto/q3socketdevice/tst_q3socketdevice.cpp b/tests/auto/q3socketdevice/tst_q3socketdevice.cpp index 2b0c606..6255aee 100644 --- a/tests/auto/q3socketdevice/tst_q3socketdevice.cpp +++ b/tests/auto/q3socketdevice/tst_q3socketdevice.cpp @@ -45,6 +45,8 @@ #include +#include "../network-settings.h" + //TESTED_CLASS= //TESTED_FILES= @@ -97,8 +99,7 @@ void tst_Q3SocketDevice::readNull() int attempts = 10; while (attempts--) { - // connect to imap.troll.no - if (device.connect(QHostAddress("62.70.27.18"), 143)) + if (device.connect(QtNetworkSettings::serverIP(), 143)) break; } @@ -117,7 +118,7 @@ void tst_Q3SocketDevice::readNull() #endif QCOMPARE(device.peerPort(), quint16(143)); QCOMPARE(device.peerAddress().toString(), - QHostAddress("62.70.27.18").toString()); + QtNetworkSettings::serverIP().toString()); QCOMPARE(device.error(), Q3SocketDevice::NoError); // write a logout notice diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp index df83efe..7eaf7c7 100644 --- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -137,8 +137,6 @@ public slots: } }; -static const char *IMAP_IP = "62.70.27.18"; - tst_QHttpSocketEngine::tst_QHttpSocketEngine() { } @@ -307,12 +305,11 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128)); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); QVERIFY(!socketDevice.localAddress().isNull()); QVERIFY(socketDevice.localPort() > 0); @@ -328,7 +325,7 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -369,7 +366,6 @@ void tst_QHttpSocketEngine::simpleErrorsAndStates() QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverName()), 8088)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); if (socketDevice.waitForWrite(15000)) { - qDebug() << socketDevice.state(); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState || socketDevice.state() == QAbstractSocket::UnconnectedState); } else { @@ -696,12 +692,11 @@ void tst_QHttpSocketEngine::passwordAuth() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128, "qsockstest", "password")); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -715,7 +710,7 @@ void tst_QHttpSocketEngine::passwordAuth() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; diff --git a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp index 68ec414..90276f2 100644 --- a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp +++ b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp @@ -100,8 +100,6 @@ private slots: void receiveUrgentData(); }; -static const char *IMAP_IP = "62.70.27.18"; - tst_QNativeSocketEngine::tst_QNativeSocketEngine() { } @@ -155,15 +153,14 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP() QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol)); QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState); - // Connect to imap.trolltech.com's IP - bool connected = socketDevice.connectToHost(QHostAddress(IMAP_IP), 143); - if (!connected) { + const bool isConnected = socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143); + if (!isConnected) { QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); } QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -176,7 +173,7 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP() QVERIFY(socketDevice.read(array.data(), array.size()) == available); // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + QCOMPARE(array.constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "ZZZ LOGOUT\r\n"; @@ -580,9 +577,8 @@ void tst_QNativeSocketEngine::networkError() QVERIFY(client.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol)); - // Connect to imap.trolltech.com's IP - bool connected = client.connectToHost(QHostAddress(IMAP_IP), 143); - if (!connected) { + const bool isConnected = client.connectToHost(QHostAddress(QtNetworkSettings::serverIP()), 143); + if (!isConnected) { QVERIFY(client.state() == QAbstractSocket::ConnectingState); QVERIFY(client.waitForWrite()); QVERIFY(client.state() == QAbstractSocket::ConnectedState); diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp index f8c2fdb..f501e78 100644 --- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -145,8 +145,6 @@ private slots: } }; -static const char *IMAP_IP = "62.70.27.18"; - tst_QSocks5SocketEngine::tst_QSocks5SocketEngine() { } @@ -321,12 +319,11 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080)); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -340,7 +337,7 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -834,15 +831,14 @@ void tst_QSocks5SocketEngine::passwordAuth() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080, "qsockstest", "password")); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); QVERIFY(socketDevice.waitForWrite()); - if (!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)) { + if (!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)) { qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData()); } QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -856,7 +852,7 @@ void tst_QSocks5SocketEngine::passwordAuth() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -902,17 +898,16 @@ void tst_QSocks5SocketEngine::passwordAuth2() socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081)); socketDevice.setReceiver(this); - // Connect to imap.trolltech.com's IP - QVERIFY(!socketDevice.connectToHost(QHostAddress(IMAP_IP), 143)); + QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState); while (socketDevice.state() == QAbstractSocket::ConnectingState) { QVERIFY(socketDevice.waitForWrite()); - socketDevice.connectToHost(QHostAddress(IMAP_IP), 143); + socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143); } if (socketDevice.state() != QAbstractSocket::ConnectedState) qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData()); QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState); - QVERIFY(socketDevice.peerAddress() == QHostAddress(IMAP_IP)); + QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP()); // Wait for the greeting QVERIFY(socketDevice.waitForRead()); @@ -926,7 +921,7 @@ void tst_QSocks5SocketEngine::passwordAuth2() // Check that the greeting is what we expect it to be QCOMPARE(array.constData(), - "* OK esparsett Cyrus IMAP4 v2.2.8 server ready\r\n"); + "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] qt-test-server.qt-test-net Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 3100dd5..5c99164 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -498,36 +498,39 @@ void tst_QSslSocket::sslErrors_data() { QTest::addColumn("host"); QTest::addColumn("port"); - QTest::addColumn("errors"); - - QTest::newRow("imap.troll.no") << "imap.troll.no" << 993 - << (SslErrorList() - << QSslError::HostNameMismatch - << QSslError::SelfSignedCertificateInChain); - QTest::newRow("imap.trolltech.com") << "imap.trolltech.com" << 993 - << (SslErrorList() - << QSslError::SelfSignedCertificateInChain); + QTest::addColumn("expected"); + + QTest::newRow(qPrintable(QtNetworkSettings::serverLocalName())) + << QtNetworkSettings::serverLocalName() + << 993 + << (SslErrorList() << QSslError::HostNameMismatch + << QSslError::SelfSignedCertificate); + + QTest::newRow("imap.trolltech.com") + << "imap.trolltech.com" + << 993 + << (SslErrorList() << QSslError::SelfSignedCertificateInChain); } void tst_QSslSocket::sslErrors() { QFETCH(QString, host); QFETCH(int, port); - QFETCH(SslErrorList, errors); + QFETCH(SslErrorList, expected); QSslSocketPtr socket = newSocket(); socket->connectToHostEncrypted(host, port); socket->waitForEncrypted(5000); - SslErrorList list; + SslErrorList output; foreach (QSslError error, socket->sslErrors()) - list << error.error(); + output << error.error(); #ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND - if (list.last() == QSslError::CertificateUntrusted) - list.takeLast(); + if (output.last() == QSslError::CertificateUntrusted) + output.takeLast(); #endif - QCOMPARE(list, errors); + QCOMPARE(output, expected); } void tst_QSslSocket::addCaCertificate() -- cgit v0.12 From 04fa2a69545fddbf96454972ebf243d4c6f7b6b2 Mon Sep 17 00:00:00 2001 From: Kavindra Devi Palaraja Date: Tue, 19 May 2009 15:37:18 +0200 Subject: Doc - changing the stylesheet to use a greeny color. Reviewed-By: David Boddie --- tools/qdoc3/test/classic.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index 3704a15..e53ea29 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -17,7 +17,7 @@ H3 { h3.fn,span.fn { - background-color: #d5e1e8; + background-color: #d5e1d5; border-width: 1px; border-style: solid; border-color: #84b0c7; @@ -112,7 +112,7 @@ table td.memItemRight { border-right-style: none; border-bottom-style: none; border-left-style: none; - background-color: #FAFAFA; + background-color: #d5e1d5; font-size: 80%; } -- cgit v0.12 From 1096c69365d14df903ad1dd0e842764146aee01d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 19 May 2009 15:44:33 +0200 Subject: Fix stopping link loops in QDirIterator on Windows currentFileInfo is only used for returning from the public functions since the file info used in the algorithm is one step ahead. nextFileInfo is the one actually used in the algorithm. The bug was introduced in a compile fix for Windows and broke the stopLinkLoop test for QDirIterator. Reviewed-by: Olivier --- src/corelib/io/qdiriterator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index b14f436..81bfb27 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -201,8 +201,8 @@ void QDirIteratorPrivate::advance() QString subDir = it->currentFilePath(); #ifdef Q_OS_WIN - if (currentFileInfo.isSymLink()) - subDir = currentFileInfo.canonicalFilePath(); + if (nextFileInfo.isSymLink()) + subDir = nextFileInfo.canonicalFilePath(); #endif pushSubDirectory(subDir, it->nameFilters(), it->filters()); } -- cgit v0.12 From 9a512ee004535983e12a1dd38dc2e28eb35c1d5c Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Tue, 19 May 2009 15:52:55 +0200 Subject: make the changedSignal test more robust On some platforms (e.g. Mac) it's not sufficient to call processEvents() only once. Reviewed-by: Andreas Aardal Hanssen --- tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index da99c30..0c5ebf6 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -47,6 +47,7 @@ #include #include +#include "../../shared/util.h" #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) #include @@ -3537,8 +3538,7 @@ void tst_QGraphicsScene::changedSignal() scene.addItem(rect); QCOMPARE(cl.changes.size(), 0); - qApp->processEvents(); - QCOMPARE(cl.changes.size(), 1); + QTRY_COMPARE(cl.changes.size(), 1); QCOMPARE(cl.changes.at(0).size(), 1); QCOMPARE(cl.changes.at(0).first(), QRectF(0, 0, 10, 10)); -- cgit v0.12 From bff689f3c5b127add96c50e4b2fdb2eadbf498a9 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 19 May 2009 16:15:32 +0200 Subject: qwidget autotest fixed for Windows CE translucentWidget: On Windows mobile the ColorRedWidget is initially moved to the taskbar position where it cannot be grabbed. Reviewed-by: mauricek --- tests/auto/qwidget/tst_qwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 5896df9..5afaebf 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -8371,6 +8371,7 @@ void tst_QWidget::translucentWidget() ColorRedWidget label; label.setFixedSize(16,16); label.setAttribute(Qt::WA_TranslucentBackground); + label.move(qApp->desktop()->availableGeometry().topLeft()); label.show(); #ifdef Q_WS_X11 qt_x11_wait_for_window_manager(&label); -- cgit v0.12 From a29ede629a18f9e107bae5e9ca03059a66f25de5 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 2 Apr 2009 12:49:13 +0200 Subject: Doc: Added a note about copying by value in QMetaProperty and included details about BlockingQueuedConnection in QMetaObject::invokeMethod(). Task-number: 187869 Task-number: 216742 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qmetaobject.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 719398c..b65f956 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1007,6 +1007,11 @@ enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value a QEvent will be sent and the member is invoked as soon as the application enters the main event loop. + \o If \a type is Qt::BlockingQueuedConnection, the method will be invoked in + the same way as for Qt::QueuedConnection, except that the current thread + will block until the event is delivered. Using this connection type to + communicate between objects in the same thread will lead to deadlocks. + \o If \a type is Qt::AutoConnection, the member is invoked synchronously if \a obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously. @@ -1897,6 +1902,12 @@ static QByteArray qualifiedName(const QMetaEnum &e) \ingroup objectmodel + Property meta-data is obtained from an object's meta-object. See + QMetaObject::property() and QMetaObject::propertyCount() for + details. + + \section1 Property Meta-Data + A property has a name() and a type(), as well as various attributes that specify its behavior: isReadable(), isWritable(), isDesignable(), isScriptable(), and isStored(). @@ -1912,9 +1923,10 @@ static QByteArray qualifiedName(const QMetaEnum &e) functions. See QObject::setProperty() and QObject::property() for details. - You get property meta-data through an object's meta-object. See - QMetaObject::property() and QMetaObject::propertyCount() for - details. + \section1 Copying and Assignment + + QMetaProperty objects can be copied by value. However, each copy will + refer to the same underlying property meta-data. \sa QMetaObject, QMetaEnum, QMetaMethod, {Qt's Property System} */ -- cgit v0.12 From 2c5b7fe040575aa2ee560117c1c3455724c2f9ae Mon Sep 17 00:00:00 2001 From: David Boddie Date: Thu, 2 Apr 2009 12:49:13 +0200 Subject: Doc: Added a note about copying by value in QMetaProperty and included details about BlockingQueuedConnection in QMetaObject::invokeMethod(). Task-number: 187869 Task-number: 216742 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qmetaobject.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 719398c..b65f956 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1007,6 +1007,11 @@ enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value a QEvent will be sent and the member is invoked as soon as the application enters the main event loop. + \o If \a type is Qt::BlockingQueuedConnection, the method will be invoked in + the same way as for Qt::QueuedConnection, except that the current thread + will block until the event is delivered. Using this connection type to + communicate between objects in the same thread will lead to deadlocks. + \o If \a type is Qt::AutoConnection, the member is invoked synchronously if \a obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously. @@ -1897,6 +1902,12 @@ static QByteArray qualifiedName(const QMetaEnum &e) \ingroup objectmodel + Property meta-data is obtained from an object's meta-object. See + QMetaObject::property() and QMetaObject::propertyCount() for + details. + + \section1 Property Meta-Data + A property has a name() and a type(), as well as various attributes that specify its behavior: isReadable(), isWritable(), isDesignable(), isScriptable(), and isStored(). @@ -1912,9 +1923,10 @@ static QByteArray qualifiedName(const QMetaEnum &e) functions. See QObject::setProperty() and QObject::property() for details. - You get property meta-data through an object's meta-object. See - QMetaObject::property() and QMetaObject::propertyCount() for - details. + \section1 Copying and Assignment + + QMetaProperty objects can be copied by value. However, each copy will + refer to the same underlying property meta-data. \sa QMetaObject, QMetaEnum, QMetaMethod, {Qt's Property System} */ -- cgit v0.12 From 92b47ba61809de30eed205e7d1eafb1cde1087e1 Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Tue, 19 May 2009 16:35:49 +0200 Subject: Ensure that the export symbols are correct. Patch supplied by Saleem/Dallas team. Reviewed-By: Thiago Reviewed-By: jbache --- src/3rdparty/phonon/phonon/phonon_export.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/phonon/phonon/phonon_export.h b/src/3rdparty/phonon/phonon/phonon_export.h index e579f67..5f93ea0 100644 --- a/src/3rdparty/phonon/phonon/phonon_export.h +++ b/src/3rdparty/phonon/phonon/phonon_export.h @@ -32,7 +32,11 @@ # define PHONON_EXPORT Q_DECL_IMPORT # endif # else /* UNIX */ -# define PHONON_EXPORT Q_DECL_EXPORT +# ifdef MAKE_PHONON_LIB /* We are building this library */ +# define PHONON_EXPORT Q_DECL_EXPORT +# else /* We are using this library */ +# define PHONON_EXPORT Q_DECL_IMPORT +# endif # endif #endif -- cgit v0.12 From 90b4f0ca7b9fe21f6c4b39a80f8f9cf98626690a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 19 May 2009 17:53:38 +0200 Subject: Revert "Makes the layout of many of the areas be in aligned columns to immensely increase readability" This was pushed accidentially. This reverts commit ffecdf0bf9f25f7ab9aa4f69e37507dd595fecea. --- tools/qdoc3/htmlgenerator.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 7702628..13d52bf 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2079,7 +2079,17 @@ void HtmlGenerator::generateSectionList(const Section& section, const Node *rela CodeMarker *marker, CodeMarker::SynopsisStyle style) { if (!section.members.isEmpty()) { - out() << "\n"; + bool twoColumn = false; + if (style == CodeMarker::SeparateList) { + twoColumn = (section.members.count() >= 16); + } else if (section.members.first()->type() == Node::Property) { + twoColumn = (section.members.count() >= 5); + } + if (twoColumn) + out() << "

    \n" + << "\n"; + out() << "\n"; i++; ++m; } - out() << "
    "; + out() << "
      \n"; int i = 0; NodeList::ConstIterator m = section.members.begin(); @@ -2089,17 +2099,22 @@ void HtmlGenerator::generateSectionList(const Section& section, const Node *rela continue; } - out() << "
    "; + if (twoColumn && i == (int) (section.members.count() + 1) / 2) + out() << "
      \n"; + + out() << "
    • "; if (style == CodeMarker::Accessors) out() << ""; generateSynopsis(*m, relative, marker, style); if (style == CodeMarker::Accessors) out() << ""; - out() << "
    \n"; + out() << "\n"; + if (twoColumn) + out() << "\n

    \n"; } if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { @@ -2114,7 +2129,7 @@ void HtmlGenerator::generateSectionInheritedList(const Section& section, const N { QList >::ConstIterator p = section.inherited.begin(); while (p != section.inherited.end()) { - out() << "
  • "; + out() << "
  • "; out() << (*p).second << " "; if ((*p).second == 1) { out() << section.singularMember; @@ -2410,9 +2425,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode, // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*()" static const QString linkTag("link"); for (int i = 0, n = src.size(); i < n;) { - if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') { - if (i != 0) - html += " "; + if (src.at(i) == charLangle && src.at(i + 1) == charAt) { i += 2; if (parseArg(src, linkTag, &i, n, &arg, &par1)) { QString link = linkForNode( -- cgit v0.12 From c51204359b7c9c2e63e4101f771d07774b921fee Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 20 May 2009 17:00:37 +1000 Subject: Remove unused variables from various About dialogs. Reviewed-by: Trust Me --- tools/assistant/compat/mainwindow.cpp | 11 ++--------- tools/assistant/tools/assistant/mainwindow.cpp | 13 +++---------- tools/designer/src/designer/versiondialog.cpp | 6 +----- tools/linguist/linguist/mainwindow.cpp | 6 +----- tools/qdbus/qdbusviewer/qdbusviewer.cpp | 11 ++--------- 5 files changed, 9 insertions(+), 38 deletions(-) diff --git a/tools/assistant/compat/mainwindow.cpp b/tools/assistant/compat/mainwindow.cpp index 9f91f9b..5de0d3c 100644 --- a/tools/assistant/compat/mainwindow.cpp +++ b/tools/assistant/compat/mainwindow.cpp @@ -312,21 +312,14 @@ void MainWindow::about() { QMessageBox box(this); - // TODO: Remove these variables for 4.6.0. Must keep this way for 4.5.x due to string freeze. - QString edition; - QString info; - QString moreInfo; - box.setText(QString::fromLatin1("
    " "

    %1

    " - "

    Version %2 %3

    " - "

    %4

    " - "

    %5

    " + "

    Version %2

    " "

    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).

    " "

    The program is provided AS IS with NO WARRANTY OF ANY KIND," " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" " PARTICULAR PURPOSE.

    ") - .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR)).arg(edition).arg(info).arg(moreInfo)); + .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR))); box.setWindowTitle(tr("Qt Assistant")); box.setIcon(QMessageBox::NoIcon); box.exec(); diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 1db3bc2..2b53f09 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -797,23 +797,16 @@ void MainWindow::showAboutDialog() aboutDia.setPixmap(pix); aboutDia.setWindowTitle(aboutDia.documentTitle()); } else { - // TODO: Remove these variables for 4.6.0. Must keep this way for 4.5.x due to string freeze. - QString edition; - QString info; - QString moreInfo; - QByteArray resources; aboutDia.setText(QString::fromLatin1("

    " "

    %1

    " - "

    Version %2 %3

    " - "

    %4

    " - "

    %5

    " + "

    Version %2

    " "

    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)" ".

    The program is provided AS IS with NO WARRANTY OF ANY KIND," " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" " PARTICULAR PURPOSE.

    ") - .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR)) - .arg(edition).arg(info).arg(moreInfo), resources); + .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR)), + resources); QLatin1String path(":/trolltech/assistant/images/assistant-128.png"); aboutDia.setPixmap(QString(path)); } diff --git a/tools/designer/src/designer/versiondialog.cpp b/tools/designer/src/designer/versiondialog.cpp index c21912b..97dc5a1 100644 --- a/tools/designer/src/designer/versiondialog.cpp +++ b/tools/designer/src/designer/versiondialog.cpp @@ -172,15 +172,11 @@ VersionDialog::VersionDialog(QWidget *parent) version = version.arg(tr("Qt Designer")).arg(QLatin1String(QT_VERSION_STR)); version.append(tr("
    Qt Designer is a graphical user interface designer for Qt applications.
    ")); - // TODO: Remove this variable for 4.6.0. Must keep this way for 4.5.x due to string freeze - QString edition; - lbl->setText(tr("%1" - "
    %2" "
    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)." "

    The program is provided AS IS with NO WARRANTY OF ANY KIND," " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" - " PARTICULAR PURPOSE.
    ").arg(version).arg(edition)); + " PARTICULAR PURPOSE.
    ").arg(version)); lbl->setWordWrap(true); lbl->setOpenExternalLinks(true); diff --git a/tools/linguist/linguist/mainwindow.cpp b/tools/linguist/linguist/mainwindow.cpp index 5157fbe..921b8b6 100644 --- a/tools/linguist/linguist/mainwindow.cpp +++ b/tools/linguist/linguist/mainwindow.cpp @@ -1342,17 +1342,13 @@ void MainWindow::about() QString version = tr("Version %1"); version = version.arg(QLatin1String(QT_VERSION_STR)); - // TODO: Remove this variable for 4.6.0. Must keep this way for 4.5.x due to string freeze. - QString edition; - box.setText(tr("

    %1

    " "

    Qt Linguist is a tool for adding translations to Qt " "applications.

    " - "

    %2

    " "

    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)." "

    The program is provided AS IS with NO WARRANTY OF ANY KIND," " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" - " PARTICULAR PURPOSE.

    ").arg(version).arg(edition)); + " PARTICULAR PURPOSE.

    ").arg(version)); box.setWindowTitle(QApplication::translate("AboutDialog", "Qt Linguist")); box.setIcon(QMessageBox::NoIcon); diff --git a/tools/qdbus/qdbusviewer/qdbusviewer.cpp b/tools/qdbus/qdbusviewer/qdbusviewer.cpp index 9c25a89..fcb63a8 100644 --- a/tools/qdbus/qdbusviewer/qdbusviewer.cpp +++ b/tools/qdbus/qdbusviewer/qdbusviewer.cpp @@ -441,21 +441,14 @@ void QDBusViewer::about() { QMessageBox box(this); - // TODO: Remove these variables for 4.6.0. Must keep this way for 4.5.x due to string freeze. - QString edition; - QString info; - QString moreInfo; - box.setText(QString::fromLatin1("
    " "

    %1

    " - "

    Version %2 %3

    " - "

    %4

    " - "

    %5

    " + "

    Version %2

    " "

    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).

    " "

    The program is provided AS IS with NO WARRANTY OF ANY KIND," " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" " PARTICULAR PURPOSE.

    ") - .arg(tr("D-Bus Viewer")).arg(QLatin1String(QT_VERSION_STR)).arg(edition).arg(info).arg(moreInfo)); + .arg(tr("D-Bus Viewer")).arg(QLatin1String(QT_VERSION_STR))); box.setWindowTitle(tr("D-Bus Viewer")); box.exec(); } -- cgit v0.12 From ba71f22dbee3e5bd4e0db0054b8ba57bde89d224 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Wed, 20 May 2009 10:21:11 +0200 Subject: Refactor the qimagereader autotest to work with shadow build Refactor the test of QImageReader to work with shadow build. Add two tests for the TIFF format Fix an error of the test of QImageWriter that prevented the cleaning of the created files after the test. Reviewed-by: Olivier --- tests/auto/qimage/images/image.tif | Bin 0 -> 2242 bytes tests/auto/qimage/tst_qimage.cpp | 3 + tests/auto/qimagereader/images/image_100dpi.tif | Bin 0 -> 2242 bytes tests/auto/qimagereader/qimagereader.pro | 2 + tests/auto/qimagereader/qimagereader.qrc | 1 + tests/auto/qimagereader/tst_qimagereader.cpp | 421 ++++++++++++------------ tests/auto/qimagewriter/tst_qimagewriter.cpp | 8 +- 7 files changed, 224 insertions(+), 211 deletions(-) create mode 100644 tests/auto/qimage/images/image.tif create mode 100644 tests/auto/qimagereader/images/image_100dpi.tif diff --git a/tests/auto/qimage/images/image.tif b/tests/auto/qimage/images/image.tif new file mode 100644 index 0000000..ee0637c Binary files /dev/null and b/tests/auto/qimage/images/image.tif differ diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp index 88bbb50..c6b0560 100644 --- a/tests/auto/qimage/tst_qimage.cpp +++ b/tests/auto/qimage/tst_qimage.cpp @@ -274,6 +274,9 @@ void tst_QImage::formatHandlersInput_data() QTest::newRow("PPM") << "PPM" << prefix + "image.ppm"; QTest::newRow("XBM") << "XBM" << prefix + "image.xbm"; QTest::newRow("XPM") << "XPM" << prefix + "image.xpm"; +#if defined QTEST_HAVE_TIFF + QTest::newRow("TIFF") << "TIFF" << prefix + "image.tif"; +#endif } void tst_QImage::formatHandlersInput() diff --git a/tests/auto/qimagereader/images/image_100dpi.tif b/tests/auto/qimagereader/images/image_100dpi.tif new file mode 100644 index 0000000..fcf3cd8 Binary files /dev/null and b/tests/auto/qimagereader/images/image_100dpi.tif differ diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index b178823..2c9510e 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -3,6 +3,7 @@ SOURCES += tst_qimagereader.cpp MOC_DIR=tmp QT += network RESOURCES += qimagereader.qrc +DEFINES += SRCDIR=\\\"$$PWD\\\" !contains(QT_CONFIG, no-gif):DEFINES += QTEST_HAVE_GIF !contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG @@ -22,5 +23,6 @@ wince*: { imagePlugins.path = imageformats DEPLOYMENT += images imagePlugins + DEFINES += SRCDIR=\\\".\\\" } diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc index 13ce582..3c674ad 100644 --- a/tests/auto/qimagereader/qimagereader.qrc +++ b/tests/auto/qimagereader/qimagereader.qrc @@ -30,6 +30,7 @@ images/image.pgm images/image.png images/image.ppm + images/image.tif images/kollada.png images/marble.xpm images/namedcolors.xpm diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index 8f7094c..f5313eb 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -158,6 +158,8 @@ private slots: void pixelCompareWithBaseline(); }; +static const QLatin1String prefix(SRCDIR "/images/"); + // Testing get/set functions void tst_QImageReader::getSetCheck() { @@ -232,7 +234,7 @@ void tst_QImageReader::readImage() QFETCH(QByteArray, format); for (int i = 0; i < 2; ++i) { - QImageReader io("images/" + fileName, i ? QByteArray() : format); + QImageReader io(prefix + fileName, i ? QByteArray() : format); if (success) { if (!io.supportsAnimation()) QVERIFY(io.imageCount() > 0); @@ -248,16 +250,16 @@ void tst_QImageReader::readImage() QVERIFY2(!image.isNull(), io.errorString().toLatin1().constData()); // No format - QImageReader io2("images/" + fileName); + QImageReader io2(prefix + fileName); QVERIFY2(!io2.read().isNull(), io.errorString().toLatin1().constData()); // No extension, no format - QImageReader io3("images/" + fileName.left(fileName.lastIndexOf(QLatin1Char('.')))); + QImageReader io3(prefix + fileName.left(fileName.lastIndexOf(QLatin1Char('.')))); QVERIFY2(!io3.read().isNull(), io.errorString().toLatin1().constData()); // Read into \a image2 QImage image2; - QImageReader image2Reader("images/" + fileName, i ? QByteArray() : format); + QImageReader image2Reader(prefix + fileName, i ? QByteArray() : format); QCOMPARE(image2Reader.format(), format); QVERIFY(image2Reader.read(&image2)); if (image2Reader.canRead()) { @@ -281,8 +283,8 @@ void tst_QImageReader::readImage() void tst_QImageReader::jpegRgbCmyk() { - QImage image1(QLatin1String("images/YCbCr_cmyk.jpg")); - QImage image2(QLatin1String("images/YCbCr_cmyk.png")); + QImage image1(prefix + QLatin1String("YCbCr_cmyk.jpg")); + QImage image2(prefix + QLatin1String("YCbCr_cmyk.png")); QCOMPARE(image1, image2); } @@ -293,24 +295,24 @@ void tst_QImageReader::setScaledSize_data() QTest::addColumn("newSize"); QTest::addColumn("format"); - QTest::newRow("BMP: colorful") << "images/colorful" << QSize(200, 200) << QByteArray("bmp"); - QTest::newRow("BMP: font") << "images/font" << QSize(200, 200) << QByteArray("bmp"); - QTest::newRow("XPM: marble") << "images/marble" << QSize(200, 200) << QByteArray("xpm"); - QTest::newRow("PNG: kollada") << "images/kollada" << QSize(200, 200) << QByteArray("png"); - QTest::newRow("PPM: teapot") << "images/teapot" << QSize(200, 200) << QByteArray("ppm"); - QTest::newRow("PPM: runners") << "images/runners.ppm" << QSize(400, 400) << QByteArray("ppm"); - QTest::newRow("PPM: test") << "images/test.ppm" << QSize(10, 10) << QByteArray("ppm"); - QTest::newRow("XBM: gnus") << "images/gnus" << QSize(200, 200) << QByteArray("xbm"); + QTest::newRow("BMP: colorful") << "colorful" << QSize(200, 200) << QByteArray("bmp"); + QTest::newRow("BMP: font") << "font" << QSize(200, 200) << QByteArray("bmp"); + QTest::newRow("XPM: marble") << "marble" << QSize(200, 200) << QByteArray("xpm"); + QTest::newRow("PNG: kollada") << "kollada" << QSize(200, 200) << QByteArray("png"); + QTest::newRow("PPM: teapot") << "teapot" << QSize(200, 200) << QByteArray("ppm"); + QTest::newRow("PPM: runners") << "runners.ppm" << QSize(400, 400) << QByteArray("ppm"); + QTest::newRow("PPM: test") << "test.ppm" << QSize(10, 10) << QByteArray("ppm"); + QTest::newRow("XBM: gnus") << "gnus" << QSize(200, 200) << QByteArray("xbm"); #ifdef QTEST_HAVE_JPEG - QTest::newRow("JPEG: beavis") << "images/beavis" << QSize(200, 200) << QByteArray("jpeg"); + QTest::newRow("JPEG: beavis") << "beavis" << QSize(200, 200) << QByteArray("jpeg"); #endif // QTEST_HAVE_JPEG #ifdef QTEST_HAVE_GIF - QTest::newRow("GIF: earth") << "images/earth" << QSize(200, 200) << QByteArray("gif"); - QTest::newRow("GIF: trolltech") << "images/trolltech" << QSize(200, 200) << QByteArray("gif"); + QTest::newRow("GIF: earth") << "earth" << QSize(200, 200) << QByteArray("gif"); + QTest::newRow("GIF: trolltech") << "trolltech" << QSize(200, 200) << QByteArray("gif"); #endif // QTEST_HAVE_GIF #ifdef QTEST_HAVE_MNG - QTest::newRow("MNG: ball") << "images/ball" << QSize(200, 200) << QByteArray("mng"); - QTest::newRow("MNG: fire") << "images/fire" << QSize(200, 200) << QByteArray("mng"); + QTest::newRow("MNG: ball") << "ball" << QSize(200, 200) << QByteArray("mng"); + QTest::newRow("MNG: fire") << "fire" << QSize(200, 200) << QByteArray("mng"); #endif // QTEST_HAVE_MNG } @@ -323,7 +325,7 @@ void tst_QImageReader::setScaledSize() if (!format.isEmpty() && !QImageReader::supportedImageFormats().contains(format)) QSKIP("Qt does not support reading the \"" + format + "\" format", SkipSingle); - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); reader.setScaledSize(newSize); QImage image = reader.read(); QVERIFY(!image.isNull()); @@ -336,25 +338,25 @@ void tst_QImageReader::setClipRect_data() QTest::addColumn("fileName"); QTest::addColumn("newRect"); QTest::addColumn("format"); - QTest::newRow("BMP: colorful") << "images/colorful" << QRect(0, 0, 50, 50) << QByteArray("bmp"); - QTest::newRow("BMP: font") << "images/font" << QRect(0, 0, 50, 50) << QByteArray("bmp"); - QTest::newRow("BMP: 4bpp uncompressed") << "images/tst7.bmp" << QRect(0, 0, 31, 31) << QByteArray("bmp"); - QTest::newRow("XPM: marble") << "images/marble" << QRect(0, 0, 50, 50) << QByteArray("xpm"); - QTest::newRow("PNG: kollada") << "images/kollada" << QRect(0, 0, 50, 50) << QByteArray("png"); - QTest::newRow("PPM: teapot") << "images/teapot" << QRect(0, 0, 50, 50) << QByteArray("ppm"); - QTest::newRow("PPM: runners") << "images/runners.ppm" << QRect(0, 0, 50, 50) << QByteArray("ppm"); - QTest::newRow("PPM: test") << "images/test.ppm" << QRect(0, 0, 50, 50) << QByteArray("ppm"); - QTest::newRow("XBM: gnus") << "images/gnus" << QRect(0, 0, 50, 50) << QByteArray("xbm"); + QTest::newRow("BMP: colorful") << "colorful" << QRect(0, 0, 50, 50) << QByteArray("bmp"); + QTest::newRow("BMP: font") << "font" << QRect(0, 0, 50, 50) << QByteArray("bmp"); + QTest::newRow("BMP: 4bpp uncompressed") << "tst7.bmp" << QRect(0, 0, 31, 31) << QByteArray("bmp"); + QTest::newRow("XPM: marble") << "marble" << QRect(0, 0, 50, 50) << QByteArray("xpm"); + QTest::newRow("PNG: kollada") << "kollada" << QRect(0, 0, 50, 50) << QByteArray("png"); + QTest::newRow("PPM: teapot") << "teapot" << QRect(0, 0, 50, 50) << QByteArray("ppm"); + QTest::newRow("PPM: runners") << "runners.ppm" << QRect(0, 0, 50, 50) << QByteArray("ppm"); + QTest::newRow("PPM: test") << "test.ppm" << QRect(0, 0, 50, 50) << QByteArray("ppm"); + QTest::newRow("XBM: gnus") << "gnus" << QRect(0, 0, 50, 50) << QByteArray("xbm"); #ifdef QTEST_HAVE_JPEG - QTest::newRow("JPEG: beavis") << "images/beavis" << QRect(0, 0, 50, 50) << QByteArray("jpeg"); + QTest::newRow("JPEG: beavis") << "beavis" << QRect(0, 0, 50, 50) << QByteArray("jpeg"); #endif // QTEST_HAVE_JPEG #ifdef QTEST_HAVE_GIF - QTest::newRow("GIF: earth") << "images/earth" << QRect(0, 0, 50, 50) << QByteArray("gif"); - QTest::newRow("GIF: trolltech") << "images/trolltech" << QRect(0, 0, 50, 50) << QByteArray("gif"); + QTest::newRow("GIF: earth") << "earth" << QRect(0, 0, 50, 50) << QByteArray("gif"); + QTest::newRow("GIF: trolltech") << "trolltech" << QRect(0, 0, 50, 50) << QByteArray("gif"); #endif // QTEST_HAVE_GIF #ifdef QTEST_HAVE_MNG - QTest::newRow("MNG: ball") << "images/ball" << QRect(0, 0, 50, 50) << QByteArray("mng"); - QTest::newRow("MNG: fire") << "images/fire" << QRect(0, 0, 50, 50) << QByteArray("mng"); + QTest::newRow("MNG: ball") << "ball" << QRect(0, 0, 50, 50) << QByteArray("mng"); + QTest::newRow("MNG: fire") << "fire" << QRect(0, 0, 50, 50) << QByteArray("mng"); #endif // QTEST_HAVE_MNG } @@ -367,13 +369,13 @@ void tst_QImageReader::setClipRect() if (!format.isEmpty() && !QImageReader::supportedImageFormats().contains(format)) QSKIP("Qt does not support reading the \"" + format + "\" format", SkipSingle); - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); reader.setClipRect(newRect); QImage image = reader.read(); QVERIFY(!image.isNull()); QCOMPARE(image.rect(), newRect); - QImageReader originalReader(fileName); + QImageReader originalReader(prefix + fileName); QImage originalImage = originalReader.read(); QCOMPARE(originalImage.copy(newRect), image); } @@ -384,24 +386,24 @@ void tst_QImageReader::setScaledClipRect_data() QTest::addColumn("newRect"); QTest::addColumn("format"); - QTest::newRow("BMP: colorful") << "images/colorful" << QRect(0, 0, 50, 50) << QByteArray("bmp"); - QTest::newRow("BMP: font") << "images/font" << QRect(0, 0, 50, 50) << QByteArray("bmp"); - QTest::newRow("XPM: marble") << "images/marble" << QRect(0, 0, 50, 50) << QByteArray("xpm"); - QTest::newRow("PNG: kollada") << "images/kollada" << QRect(0, 0, 50, 50) << QByteArray("png"); - QTest::newRow("PPM: teapot") << "images/teapot" << QRect(0, 0, 50, 50) << QByteArray("ppm"); - QTest::newRow("PPM: runners") << "images/runners.ppm" << QRect(0, 0, 50, 50) << QByteArray("ppm"); - QTest::newRow("PPM: test") << "images/test.ppm" << QRect(0, 0, 50, 50) << QByteArray("ppm"); - QTest::newRow("XBM: gnus") << "images/gnus" << QRect(0, 0, 50, 50) << QByteArray("xbm"); + QTest::newRow("BMP: colorful") << "colorful" << QRect(0, 0, 50, 50) << QByteArray("bmp"); + QTest::newRow("BMP: font") << "font" << QRect(0, 0, 50, 50) << QByteArray("bmp"); + QTest::newRow("XPM: marble") << "marble" << QRect(0, 0, 50, 50) << QByteArray("xpm"); + QTest::newRow("PNG: kollada") << "kollada" << QRect(0, 0, 50, 50) << QByteArray("png"); + QTest::newRow("PPM: teapot") << "teapot" << QRect(0, 0, 50, 50) << QByteArray("ppm"); + QTest::newRow("PPM: runners") << "runners.ppm" << QRect(0, 0, 50, 50) << QByteArray("ppm"); + QTest::newRow("PPM: test") << "test.ppm" << QRect(0, 0, 50, 50) << QByteArray("ppm"); + QTest::newRow("XBM: gnus") << "gnus" << QRect(0, 0, 50, 50) << QByteArray("xbm"); #ifdef QTEST_HAVE_JPEG - QTest::newRow("JPEG: beavis") << "images/beavis" << QRect(0, 0, 50, 50) << QByteArray("jpeg"); + QTest::newRow("JPEG: beavis") << "beavis" << QRect(0, 0, 50, 50) << QByteArray("jpeg"); #endif // QTEST_HAVE_JPEG #ifdef QTEST_HAVE_GIF - QTest::newRow("GIF: earth") << "images/earth" << QRect(0, 0, 50, 50) << QByteArray("gif"); - QTest::newRow("GIF: trolltech") << "images/trolltech" << QRect(0, 0, 50, 50) << QByteArray("gif"); + QTest::newRow("GIF: earth") << "earth" << QRect(0, 0, 50, 50) << QByteArray("gif"); + QTest::newRow("GIF: trolltech") << "trolltech" << QRect(0, 0, 50, 50) << QByteArray("gif"); #endif // QTEST_HAVE_GIF #ifdef QTEST_HAVE_MNG - QTest::newRow("MNG: ball") << "images/ball" << QRect(0, 0, 50, 50) << QByteArray("mng"); - QTest::newRow("MNG: fire") << "images/fire" << QRect(0, 0, 50, 50) << QByteArray("mng"); + QTest::newRow("MNG: ball") << "ball" << QRect(0, 0, 50, 50) << QByteArray("mng"); + QTest::newRow("MNG: fire") << "fire" << QRect(0, 0, 50, 50) << QByteArray("mng"); #endif // QTEST_HAVE_MNG } @@ -414,14 +416,14 @@ void tst_QImageReader::setScaledClipRect() if (!format.isEmpty() && !QImageReader::supportedImageFormats().contains(format)) QSKIP("Qt does not support reading the \"" + format + "\" format", SkipSingle); - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); reader.setScaledSize(QSize(300, 300)); reader.setScaledClipRect(newRect); QImage image = reader.read(); QVERIFY(!image.isNull()); QCOMPARE(image.rect(), newRect); - QImageReader originalReader(fileName); + QImageReader originalReader(prefix + fileName); originalReader.setScaledSize(QSize(300, 300)); QImage originalImage = originalReader.read(); QCOMPARE(originalImage.copy(newRect), image); @@ -433,29 +435,29 @@ void tst_QImageReader::imageFormat_data() QTest::addColumn("format"); QTest::addColumn("imageFormat"); - QTest::newRow("pbm") << QString("images/image.pbm") << QByteArray("pbm") << QImage::Format_Mono; - QTest::newRow("pgm") << QString("images/image.pgm") << QByteArray("pgm") << QImage::Format_Indexed8; - QTest::newRow("ppm-1") << QString("images/image.ppm") << QByteArray("ppm") << QImage::Format_RGB32; - QTest::newRow("ppm-2") << QString("images/teapot.ppm") << QByteArray("ppm") << QImage::Format_RGB32; - QTest::newRow("ppm-3") << QString("images/runners.ppm") << QByteArray("ppm") << QImage::Format_RGB32; - QTest::newRow("ppm-4") << QString("images/test.ppm") << QByteArray("ppm") << QImage::Format_RGB32; + QTest::newRow("pbm") << QString("image.pbm") << QByteArray("pbm") << QImage::Format_Mono; + QTest::newRow("pgm") << QString("image.pgm") << QByteArray("pgm") << QImage::Format_Indexed8; + QTest::newRow("ppm-1") << QString("image.ppm") << QByteArray("ppm") << QImage::Format_RGB32; + QTest::newRow("ppm-2") << QString("teapot.ppm") << QByteArray("ppm") << QImage::Format_RGB32; + QTest::newRow("ppm-3") << QString("runners.ppm") << QByteArray("ppm") << QImage::Format_RGB32; + QTest::newRow("ppm-4") << QString("test.ppm") << QByteArray("ppm") << QImage::Format_RGB32; #ifdef QTEST_HAVE_JPEG - QTest::newRow("jpeg-1") << QString("images/beavis.jpg") << QByteArray("jpeg") << QImage::Format_Indexed8; - QTest::newRow("jpeg-2") << QString("images/YCbCr_cmyk.jpg") << QByteArray("jpeg") << QImage::Format_RGB32; - QTest::newRow("jpeg-3") << QString("images/YCbCr_rgb.jpg") << QByteArray("jpeg") << QImage::Format_RGB32; + QTest::newRow("jpeg-1") << QString("beavis.jpg") << QByteArray("jpeg") << QImage::Format_Indexed8; + QTest::newRow("jpeg-2") << QString("YCbCr_cmyk.jpg") << QByteArray("jpeg") << QImage::Format_RGB32; + QTest::newRow("jpeg-3") << QString("YCbCr_rgb.jpg") << QByteArray("jpeg") << QImage::Format_RGB32; #endif #if defined QTEST_HAVE_GIF - QTest::newRow("gif-1") << QString("images/earth.gif") << QByteArray("gif") << QImage::Format_Invalid; - QTest::newRow("gif-2") << QString("images/trolltech.gif") << QByteArray("gif") << QImage::Format_Invalid; + QTest::newRow("gif-1") << QString("earth.gif") << QByteArray("gif") << QImage::Format_Invalid; + QTest::newRow("gif-2") << QString("trolltech.gif") << QByteArray("gif") << QImage::Format_Invalid; #endif - QTest::newRow("xbm") << QString("images/gnus.xbm") << QByteArray("xbm") << QImage::Format_MonoLSB; - QTest::newRow("xpm") << QString("images/marble.xpm") << QByteArray("xpm") << QImage::Format_Indexed8; - QTest::newRow("bmp-1") << QString("images/colorful.bmp") << QByteArray("bmp") << QImage::Format_Indexed8; - QTest::newRow("bmp-2") << QString("images/font.bmp") << QByteArray("bmp") << QImage::Format_Indexed8; - QTest::newRow("png") << QString("images/kollada.png") << QByteArray("png") << QImage::Format_ARGB32; - QTest::newRow("png-2") << QString("images/YCbCr_cmyk.png") << QByteArray("png") << QImage::Format_RGB32; - QTest::newRow("mng-1") << QString("images/ball.mng") << QByteArray("mng") << QImage::Format_Invalid; - QTest::newRow("mng-2") << QString("images/fire.mng") << QByteArray("mng") << QImage::Format_Invalid; + QTest::newRow("xbm") << QString("gnus.xbm") << QByteArray("xbm") << QImage::Format_MonoLSB; + QTest::newRow("xpm") << QString("marble.xpm") << QByteArray("xpm") << QImage::Format_Indexed8; + QTest::newRow("bmp-1") << QString("colorful.bmp") << QByteArray("bmp") << QImage::Format_Indexed8; + QTest::newRow("bmp-2") << QString("font.bmp") << QByteArray("bmp") << QImage::Format_Indexed8; + QTest::newRow("png") << QString("kollada.png") << QByteArray("png") << QImage::Format_ARGB32; + QTest::newRow("png-2") << QString("YCbCr_cmyk.png") << QByteArray("png") << QImage::Format_RGB32; + QTest::newRow("mng-1") << QString("ball.mng") << QByteArray("mng") << QImage::Format_Invalid; + QTest::newRow("mng-2") << QString("fire.mng") << QByteArray("mng") << QImage::Format_Invalid; } void tst_QImageReader::imageFormat() @@ -463,7 +465,8 @@ void tst_QImageReader::imageFormat() QFETCH(QString, fileName); QFETCH(QByteArray, format); QFETCH(QImage::Format, imageFormat); - if (QImageReader::imageFormat(fileName).isEmpty()) { + + if (QImageReader::imageFormat(prefix + fileName).isEmpty()) { if (QByteArray("jpeg") == format) #ifndef QTEST_HAVE_JPEG return; @@ -478,31 +481,31 @@ void tst_QImageReader::imageFormat() #endif // !QTEST_HAVE_MNG QSKIP(("Qt does not support the " + format + " format.").constData(), SkipSingle); } else { - QCOMPARE(QImageReader::imageFormat(fileName), format); + QCOMPARE(QImageReader::imageFormat(prefix + fileName), format); } - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); QCOMPARE(reader.imageFormat(), imageFormat); } void tst_QImageReader::blackXPM() { - QImage image(QLatin1String("images/black.xpm")); - QImage image2(QLatin1String("images/black.png")); + QImage image(prefix + QLatin1String("black.xpm")); + QImage image2(prefix + QLatin1String("black.png")); QCOMPARE(image.pixel(25, 25), qRgb(190, 190, 190)); QCOMPARE(image.pixel(25, 25), image2.pixel(25, 25)); } void tst_QImageReader::transparentXPM() { - QImage image(QLatin1String("images/nontransparent.xpm")); - QImage image2(QLatin1String("images/transparent.xpm")); + QImage image(prefix + QLatin1String("nontransparent.xpm")); + QImage image2(prefix + QLatin1String("transparent.xpm")); QCOMPARE(image.format(), QImage::Format_RGB32); QCOMPARE(image2.format(), QImage::Format_ARGB32); } void tst_QImageReader::multiWordNamedColorXPM() { - QImage image(QLatin1String("images/namedcolors.xpm")); + QImage image(prefix + QLatin1String("namedcolors.xpm")); QCOMPARE(image.pixel(0, 0), qRgb(102, 139, 139)); // pale turquoise 4 QCOMPARE(image.pixel(0, 1), qRgb(250, 250, 210)); // light golden rod yellow QCOMPARE(image.pixel(0, 2), qRgb(255, 250, 205)); // lemon chiffon @@ -593,7 +596,7 @@ void tst_QImageReader::supportsAnimation() { QFETCH(QString, fileName); QFETCH(bool, success); - QImageReader io("images/" + fileName); + QImageReader io(prefix + fileName); QCOMPARE(io.supportsAnimation(), success); } @@ -606,7 +609,7 @@ void tst_QImageReader::sizeBeforeRead() { QFETCH(QString, fileName); QFETCH(QByteArray, format); - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); QVERIFY(reader.canRead()); if (format == "mng") { QCOMPARE(reader.size(), QSize()); @@ -644,7 +647,7 @@ void tst_QImageReader::imageFormatBeforeRead() void tst_QImageReader::gifHandlerBugs() { { - QImageReader io("images/trolltech.gif"); + QImageReader io(prefix + "trolltech.gif"); QVERIFY(io.loopCount() != 1); int count=0; for (; io.canRead(); io.read(), ++count) ; @@ -653,8 +656,8 @@ void tst_QImageReader::gifHandlerBugs() // Task 95166 { - QImageReader io1("images/bat1.gif"); - QImageReader io2("images/bat2.gif"); + QImageReader io1(prefix + "bat1.gif"); + QImageReader io2(prefix + "bat2.gif"); QVERIFY(io1.canRead()); QVERIFY(io2.canRead()); QImage im1 = io1.read(); @@ -666,8 +669,8 @@ void tst_QImageReader::gifHandlerBugs() // Task 9994 { - QImageReader io1("images/noclearcode.gif"); - QImageReader io2("images/noclearcode.bmp"); + QImageReader io1(prefix + "noclearcode.gif"); + QImageReader io2(prefix + "noclearcode.bmp"); QVERIFY(io1.canRead()); QVERIFY(io2.canRead()); QImage im1 = io1.read(); QImage im2 = io2.read(); QVERIFY(!im1.isNull()); QVERIFY(!im2.isNull()); @@ -731,29 +734,29 @@ void tst_QImageReader::readFromDevice_data() QTest::addColumn("fileName"); QTest::addColumn("format"); - QTest::newRow("pbm") << QString("images/image.pbm") << QByteArray("pbm"); - QTest::newRow("pgm") << QString("images/image.pgm") << QByteArray("pgm"); - QTest::newRow("ppm-1") << QString("images/image.ppm") << QByteArray("ppm"); - QTest::newRow("ppm-2") << QString("images/teapot.ppm") << QByteArray("ppm"); - QTest::newRow("ppm-3") << QString("images/teapot.ppm") << QByteArray("ppm"); - QTest::newRow("ppm-4") << QString("images/runners.ppm") << QByteArray("ppm"); + QTest::newRow("pbm") << QString("image.pbm") << QByteArray("pbm"); + QTest::newRow("pgm") << QString("image.pgm") << QByteArray("pgm"); + QTest::newRow("ppm-1") << QString("image.ppm") << QByteArray("ppm"); + QTest::newRow("ppm-2") << QString("teapot.ppm") << QByteArray("ppm"); + QTest::newRow("ppm-3") << QString("teapot.ppm") << QByteArray("ppm"); + QTest::newRow("ppm-4") << QString("runners.ppm") << QByteArray("ppm"); #ifdef QTEST_HAVE_JPEG - QTest::newRow("jpeg-1") << QString("images/beavis.jpg") << QByteArray("jpeg"); - QTest::newRow("jpeg-2") << QString("images/YCbCr_cmyk.jpg") << QByteArray("jpeg"); - QTest::newRow("jpeg-3") << QString("images/YCbCr_rgb.jpg") << QByteArray("jpeg"); + QTest::newRow("jpeg-1") << QString("beavis.jpg") << QByteArray("jpeg"); + QTest::newRow("jpeg-2") << QString("YCbCr_cmyk.jpg") << QByteArray("jpeg"); + QTest::newRow("jpeg-3") << QString("YCbCr_rgb.jpg") << QByteArray("jpeg"); #endif // QTEST_HAVE_JPEG #ifdef QTEST_HAVE_GIF - QTest::newRow("gif-1") << QString("images/earth.gif") << QByteArray("gif"); - QTest::newRow("gif-2") << QString("images/trolltech.gif") << QByteArray("gif"); + QTest::newRow("gif-1") << QString("earth.gif") << QByteArray("gif"); + QTest::newRow("gif-2") << QString("trolltech.gif") << QByteArray("gif"); #endif // QTEST_HAVE_GIF - QTest::newRow("xbm") << QString("images/gnus.xbm") << QByteArray("xbm"); - QTest::newRow("xpm") << QString("images/marble.xpm") << QByteArray("xpm"); - QTest::newRow("bmp-1") << QString("images/colorful.bmp") << QByteArray("bmp"); - QTest::newRow("bmp-2") << QString("images/font.bmp") << QByteArray("bmp"); - QTest::newRow("png") << QString("images/kollada.png") << QByteArray("png"); + QTest::newRow("xbm") << QString("gnus.xbm") << QByteArray("xbm"); + QTest::newRow("xpm") << QString("marble.xpm") << QByteArray("xpm"); + QTest::newRow("bmp-1") << QString("colorful.bmp") << QByteArray("bmp"); + QTest::newRow("bmp-2") << QString("font.bmp") << QByteArray("bmp"); + QTest::newRow("png") << QString("kollada.png") << QByteArray("png"); #ifdef QTEST_HAVE_MNG - QTest::newRow("mng-1") << QString("images/ball.mng") << QByteArray("mng"); - QTest::newRow("mng-2") << QString("images/fire.mng") << QByteArray("mng"); + QTest::newRow("mng-1") << QString("ball.mng") << QByteArray("mng"); + QTest::newRow("mng-2") << QString("fire.mng") << QByteArray("mng"); #endif // QTEST_HAVE_MNG } @@ -762,9 +765,9 @@ void tst_QImageReader::readFromDevice() QFETCH(QString, fileName); QFETCH(QByteArray, format); - QImage expectedImage(fileName, format); + QImage expectedImage(prefix + fileName, format); - QFile file(fileName); + QFile file(prefix + fileName); QVERIFY(file.open(QFile::ReadOnly)); QByteArray imageData = file.readAll(); QVERIFY(!imageData.isEmpty()); @@ -813,26 +816,26 @@ void tst_QImageReader::readFromFileAfterJunk_data() QTest::addColumn("fileName"); QTest::addColumn("format"); - QTest::newRow("pbm") << QString("images/image.pbm") << QByteArray("pbm"); - QTest::newRow("pgm") << QString("images/image.pgm") << QByteArray("pgm"); - QTest::newRow("ppm-1") << QString("images/image.ppm") << QByteArray("ppm"); - QTest::newRow("ppm-2") << QString("images/teapot.ppm") << QByteArray("ppm"); - QTest::newRow("ppm-3") << QString("images/teapot.ppm") << QByteArray("ppm"); - QTest::newRow("ppm-4") << QString("images/runners.ppm") << QByteArray("ppm"); + QTest::newRow("pbm") << QString("image.pbm") << QByteArray("pbm"); + QTest::newRow("pgm") << QString("image.pgm") << QByteArray("pgm"); + QTest::newRow("ppm-1") << QString("image.ppm") << QByteArray("ppm"); + QTest::newRow("ppm-2") << QString("teapot.ppm") << QByteArray("ppm"); + QTest::newRow("ppm-3") << QString("teapot.ppm") << QByteArray("ppm"); + QTest::newRow("ppm-4") << QString("runners.ppm") << QByteArray("ppm"); #ifdef QTEST_HAVE_JPEG - QTest::newRow("jpeg-1") << QString("images/beavis.jpg") << QByteArray("jpeg"); - QTest::newRow("jpeg-2") << QString("images/YCbCr_cmyk.jpg") << QByteArray("jpeg"); - QTest::newRow("jpeg-3") << QString("images/YCbCr_rgb.jpg") << QByteArray("jpeg"); + QTest::newRow("jpeg-1") << QString("beavis.jpg") << QByteArray("jpeg"); + QTest::newRow("jpeg-2") << QString("YCbCr_cmyk.jpg") << QByteArray("jpeg"); + QTest::newRow("jpeg-3") << QString("YCbCr_rgb.jpg") << QByteArray("jpeg"); #endif #if defined QTEST_HAVE_GIF // QTest::newRow("gif-1") << QString("images/earth.gif") << QByteArray("gif"); // QTest::newRow("gif-2") << QString("images/trolltech.gif") << QByteArray("gif"); #endif - QTest::newRow("xbm") << QString("images/gnus.xbm") << QByteArray("xbm"); - QTest::newRow("xpm") << QString("images/marble.xpm") << QByteArray("xpm"); - QTest::newRow("bmp-1") << QString("images/colorful.bmp") << QByteArray("bmp"); - QTest::newRow("bmp-2") << QString("images/font.bmp") << QByteArray("bmp"); - QTest::newRow("png") << QString("images/kollada.png") << QByteArray("png"); + QTest::newRow("xbm") << QString("gnus.xbm") << QByteArray("xbm"); + QTest::newRow("xpm") << QString("marble.xpm") << QByteArray("xpm"); + QTest::newRow("bmp-1") << QString("colorful.bmp") << QByteArray("bmp"); + QTest::newRow("bmp-2") << QString("font.bmp") << QByteArray("bmp"); + QTest::newRow("png") << QString("kollada.png") << QByteArray("png"); // QTest::newRow("mng-1") << QString("images/ball.mng") << QByteArray("mng"); // QTest::newRow("mng-2") << QString("images/fire.mng") << QByteArray("mng"); } @@ -851,7 +854,7 @@ void tst_QImageReader::readFromFileAfterJunk() QFile junkFile("junk"); QVERIFY(junkFile.open(QFile::WriteOnly)); - QFile imageFile(fileName); + QFile imageFile(prefix + fileName); QVERIFY(imageFile.open(QFile::ReadOnly)); QByteArray imageData = imageFile.readAll(); QVERIFY(!imageData.isNull()); @@ -869,7 +872,7 @@ void tst_QImageReader::readFromFileAfterJunk() for (int i = 0; i < iterations; ++i) { QImageWriter writer(&junkFile, format); junkFile.write("deadbeef", 9); - QVERIFY(writer.write(QImage(fileName))); + QVERIFY(writer.write(QImage(prefix + fileName))); } } junkFile.close(); @@ -903,8 +906,8 @@ void tst_QImageReader::description_data() willem["Software"] = "Created on a NeXTstation color using \"pnmtopng\"."; willem["Disclaimer"] = "Freeware."; - QTest::newRow("PNG") << QString("images/pngwithtext.png") << willem; - QTest::newRow("PNG Compressed") << QString("images/pngwithcompressedtext.png") << willem; + QTest::newRow("PNG") << QString("pngwithtext.png") << willem; + QTest::newRow("PNG Compressed") << QString("pngwithcompressedtext.png") << willem; } void tst_QImageReader::description() @@ -913,9 +916,9 @@ void tst_QImageReader::description() QFETCH(QStringMap, description); // Sanity check - QVERIFY(!QImage(fileName).isNull()); + QVERIFY(!QImage(prefix + fileName).isNull()); - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); foreach (QString key, description.keys()) QCOMPARE(reader.text(key), description.value(key)); @@ -940,143 +943,143 @@ void tst_QImageReader::readFromResources_data() QTest::addColumn("size"); QTest::addColumn("message"); - QTest::newRow("images/corrupt.bmp") << QString("images/corrupt.bmp") + QTest::newRow("corrupt.bmp") << QString("corrupt.bmp") << QByteArray("bmp") << QSize(0, 0) << QString(""); - QTest::newRow("images/negativeheight.bmp") << QString("images/negativeheight.bmp") + QTest::newRow("negativeheight.bmp") << QString("negativeheight.bmp") << QByteArray("bmp") << QSize(127, 64) << QString(""); - QTest::newRow("images/font.bmp") << QString("images/font.bmp") + QTest::newRow("font.bmp") << QString("font.bmp") << QByteArray("bmp") << QSize(240, 8) << QString(""); - QTest::newRow("images/noclearcode.bmp") << QString("images/noclearcode.bmp") + QTest::newRow("noclearcode.bmp") << QString("noclearcode.bmp") << QByteArray("bmp") << QSize(29, 18) << QString(""); - QTest::newRow("images/colorful.bmp") << QString("images/colorful.bmp") + QTest::newRow("colorful.bmp") << QString("colorful.bmp") << QByteArray("bmp") << QSize(320, 200) << QString(""); - QTest::newRow("images/16bpp.bmp") << QString("images/16bpp.bmp") + QTest::newRow("16bpp.bmp") << QString("16bpp.bmp") << QByteArray("bmp") << QSize(320, 240) << QString(""); - QTest::newRow("images/crash-signed-char.bmp") << QString("images/crash-signed-char.bmp") + QTest::newRow("crash-signed-char.bmp") << QString("crash-signed-char.bmp") << QByteArray("bmp") << QSize(360, 280) << QString(""); - QTest::newRow("images/4bpp-rle.bmp") << QString("images/4bpp-rle.bmp") + QTest::newRow("4bpp-rle.bmp") << QString("4bpp-rle.bmp") << QByteArray("bmp") << QSize(640, 480) << QString(""); #ifdef QTEST_HAVE_GIF - QTest::newRow("images/corrupt.gif") << QString("images/corrupt.gif") + QTest::newRow("corrupt.gif") << QString("corrupt.gif") << QByteArray("gif") << QSize(0, 0) << QString(""); - QTest::newRow("images/trolltech.gif") << QString("images/trolltech.gif") + QTest::newRow("trolltech.gif") << QString("trolltech.gif") << QByteArray("gif") << QSize(128, 64) << QString(""); - QTest::newRow("images/noclearcode.gif") << QString("images/noclearcode.gif") + QTest::newRow("noclearcode.gif") << QString("noclearcode.gif") << QByteArray("gif") << QSize(29, 18) << QString(""); - QTest::newRow("images/earth.gif") << QString("images/earth.gif") + QTest::newRow("earth.gif") << QString("earth.gif") << QByteArray("gif") << QSize(320, 200) << QString(""); - QTest::newRow("images/bat1.gif") << QString("images/bat1.gif") + QTest::newRow("bat1.gif") << QString("bat1.gif") << QByteArray("gif") << QSize(32, 32) << QString(""); - QTest::newRow("images/bat2.gif") << QString("images/bat2.gif") + QTest::newRow("bat2.gif") << QString("bat2.gif") << QByteArray("gif") << QSize(32, 32) << QString(""); #endif #ifdef QTEST_HAVE_JPEG - QTest::newRow("images/corrupt.jpg") << QString("images/corrupt.jpg") + QTest::newRow("corrupt.jpg") << QString("corrupt.jpg") << QByteArray("jpg") << QSize(0, 0) << QString("JPEG datastream contains no image"); - QTest::newRow("images/beavis.jpg") << QString("images/beavis.jpg") + QTest::newRow("beavis.jpg") << QString("beavis.jpg") << QByteArray("jpg") << QSize(350, 350) << QString(""); - QTest::newRow("images/YCbCr_cmyk.jpg") << QString("images/YCbCr_cmyk.jpg") + QTest::newRow("YCbCr_cmyk.jpg") << QString("YCbCr_cmyk.jpg") << QByteArray("jpg") << QSize(75, 50) << QString(""); - QTest::newRow("images/YCbCr_rgb.jpg") << QString("images/YCbCr_rgb.jpg") + QTest::newRow("YCbCr_rgb.jpg") << QString("YCbCr_rgb.jpg") << QByteArray("jpg") << QSize(75, 50) << QString(""); #endif #ifdef QTEST_HAVE_MNG - QTest::newRow("images/corrupt.mng") << QString("images/corrupt.mng") + QTest::newRow("corrupt.mng") << QString("corrupt.mng") << QByteArray("mng") << QSize(0, 0) << QString("MNG error 901: Application signalled I/O error; chunk IHDR; subcode 0:0"); - QTest::newRow("images/fire.mng") << QString("images/fire.mng") + QTest::newRow("fire.mng") << QString("fire.mng") << QByteArray("mng") << QSize(30, 60) << QString(""); - QTest::newRow("images/ball.mng") << QString("images/ball.mng") + QTest::newRow("ball.mng") << QString("ball.mng") << QByteArray("mng") << QSize(32, 32) << QString(""); #endif - QTest::newRow("images/image.pbm") << QString("images/image.pbm") + QTest::newRow("image.pbm") << QString("image.pbm") << QByteArray("pbm") << QSize(16, 6) << QString(""); - QTest::newRow("images/image.pgm") << QString("images/image.pgm") + QTest::newRow("image.pgm") << QString("image.pgm") << QByteArray("pgm") << QSize(24, 7) << QString(""); - QTest::newRow("images/corrupt.png") << QString("images/corrupt.png") + QTest::newRow("corrupt.png") << QString("corrupt.png") << QByteArray("png") << QSize(0, 0) << QString(""); - QTest::newRow("images/away.png") << QString("images/away.png") + QTest::newRow("away.png") << QString("away.png") << QByteArray("png") << QSize(16, 16) << QString(""); - QTest::newRow("images/image.png") << QString("images/image.png") + QTest::newRow("image.png") << QString("image.png") << QByteArray("png") << QSize(22, 22) << QString(""); - QTest::newRow("images/pngwithcompressedtext.png") << QString("images/pngwithcompressedtext.png") + QTest::newRow("pngwithcompressedtext.png") << QString("pngwithcompressedtext.png") << QByteArray("png") << QSize(32, 32) << QString(""); - QTest::newRow("images/pngwithtext.png") << QString("images/pngwithtext.png") + QTest::newRow("pngwithtext.png") << QString("pngwithtext.png") << QByteArray("png") << QSize(32, 32) << QString(""); - QTest::newRow("images/kollada.png") << QString("images/kollada.png") + QTest::newRow("kollada.png") << QString("kollada.png") << QByteArray("png") << QSize(436, 160) << QString(""); - QTest::newRow("images/black.png") << QString("images/black.png") + QTest::newRow("black.png") << QString("black.png") << QByteArray("png") << QSize(48, 48) << QString(""); - QTest::newRow("images/YCbCr_cmyk.png") << QString("images/YCbCr_cmyk.png") + QTest::newRow("YCbCr_cmyk.png") << QString("YCbCr_cmyk.png") << QByteArray("png") << QSize(75, 50) << QString(""); - QTest::newRow("images/teapot.ppm") << QString("images/teapot.ppm") + QTest::newRow("teapot.ppm") << QString("teapot.ppm") << QByteArray("ppm") << QSize(256, 256) << QString(""); - QTest::newRow("images/image.ppm") << QString("images/image.ppm") + QTest::newRow("image.ppm") << QString("image.ppm") << QByteArray("ppm") << QSize(4, 4) << QString(""); - QTest::newRow("images/runners.ppm") << QString("images/runners.ppm") + QTest::newRow("runners.ppm") << QString("runners.ppm") << QByteArray("ppm") << QSize(400, 400) << QString(""); - QTest::newRow("images/test.ppm") << QString("images/test.ppm") + QTest::newRow("test.ppm") << QString("test.ppm") << QByteArray("ppm") << QSize(10, 10) << QString(""); -// QTest::newRow("images/corrupt.xbm") << QString("images/corrupt.xbm") << QByteArray("xbm") << QSize(0, 0); - QTest::newRow("images/gnus.xbm") << QString("images/gnus.xbm") +// QTest::newRow("corrupt.xbm") << QString("corrupt.xbm") << QByteArray("xbm") << QSize(0, 0); + QTest::newRow("gnus.xbm") << QString("gnus.xbm") << QByteArray("xbm") << QSize(271, 273) << QString(""); - QTest::newRow("images/corrupt-colors.xpm") << QString("images/corrupt-colors.xpm") + QTest::newRow("corrupt-colors.xpm") << QString("corrupt-colors.xpm") << QByteArray("xpm") << QSize(0, 0) << QString("QImage: XPM color specification is missing: bla9an.n#x"); - QTest::newRow("images/corrupt-pixels.xpm") << QString("images/corrupt-pixels.xpm") + QTest::newRow("corrupt-pixels.xpm") << QString("corrupt-pixels.xpm") << QByteArray("xpm") << QSize(0, 0) << QString("QImage: XPM pixels missing on image line 3"); - QTest::newRow("images/marble.xpm") << QString("images/marble.xpm") + QTest::newRow("marble.xpm") << QString("marble.xpm") << QByteArray("xpm") << QSize(240, 240) << QString(""); - QTest::newRow("images/test.xpm") << QString("images/test.xpm") + QTest::newRow("test.xpm") << QString("test.xpm") << QByteArray("xpm") << QSize(256, 256) << QString(""); - QTest::newRow("images/black.xpm") << QString("images/black.xpm") + QTest::newRow("black.xpm") << QString("black.xpm") << QByteArray("xpm") << QSize(48, 48) << QString(""); - QTest::newRow("images/namedcolors.xpm") << QString("images/namedcolors.xpm") + QTest::newRow("namedcolors.xpm") << QString("namedcolors.xpm") << QByteArray("xpm") << QSize(8, 8) << QString(""); - QTest::newRow("images/nontransparent.xpm") << QString("images/nontransparent.xpm") + QTest::newRow("nontransparent.xpm") << QString("nontransparent.xpm") << QByteArray("xpm") << QSize(8, 8) << QString(""); - QTest::newRow("images/transparent.xpm") << QString("images/transparent.xpm") + QTest::newRow("transparent.xpm") << QString("transparent.xpm") << QByteArray("xpm") << QSize(8, 8) << QString(""); } @@ -1087,9 +1090,8 @@ void tst_QImageReader::readFromResources() QFETCH(QByteArray, format); QFETCH(QSize, size); QFETCH(QString, message); - for (int i = 0; i < 2; ++i) { - QString file = i ? (":/" + fileName) : fileName; + QString file = i ? (":/images/" + fileName) : (prefix + fileName); { // suppress warnings if we expect them if (!message.isEmpty()) { @@ -1153,7 +1155,7 @@ void tst_QImageReader::readFromResources() QTest::ignoreMessage(QtWarningMsg, message.toLatin1()); QTest::ignoreMessage(QtWarningMsg, message.toLatin1()); } - QCOMPARE(QImageReader(fileName).read(), QImageReader(":/" + fileName).read()); + QCOMPARE(QImageReader(prefix + fileName).read(), QImageReader(":/images/" + fileName).read()); } void tst_QImageReader::readCorruptImage_data() @@ -1162,25 +1164,25 @@ void tst_QImageReader::readCorruptImage_data() QTest::addColumn("shouldFail"); QTest::addColumn("message"); #if defined QTEST_HAVE_JPEG - QTest::newRow("corrupt jpeg") << QString("images/corrupt.jpg") << true + QTest::newRow("corrupt jpeg") << QString("corrupt.jpg") << true << QString("JPEG datastream contains no image"); #endif #if defined QTEST_HAVE_GIF - QTest::newRow("corrupt gif") << QString("images/corrupt.gif") << true << QString(""); + QTest::newRow("corrupt gif") << QString("corrupt.gif") << true << QString(""); #endif #ifdef QTEST_HAVE_MNG - QTest::newRow("corrupt mng") << QString("images/corrupt.mng") << true + QTest::newRow("corrupt mng") << QString("corrupt.mng") << true << QString("MNG error 901: Application signalled I/O error; chunk IHDR; subcode 0:0"); #endif - QTest::newRow("corrupt png") << QString("images/corrupt.png") << true << QString(""); - QTest::newRow("corrupt bmp") << QString("images/corrupt.bmp") << true << QString(""); - QTest::newRow("corrupt xpm (colors)") << QString("images/corrupt-colors.xpm") << true + QTest::newRow("corrupt png") << QString("corrupt.png") << true << QString(""); + QTest::newRow("corrupt bmp") << QString("corrupt.bmp") << true << QString(""); + QTest::newRow("corrupt xpm (colors)") << QString("corrupt-colors.xpm") << true << QString("QImage: XPM color specification is missing: bla9an.n#x"); - QTest::newRow("corrupt xpm (pixels)") << QString("images/corrupt-pixels.xpm") << true + QTest::newRow("corrupt xpm (pixels)") << QString("corrupt-pixels.xpm") << true << QString("QImage: XPM pixels missing on image line 3"); - QTest::newRow("corrupt xbm") << QString("images/corrupt.xbm") << false << QString(""); + QTest::newRow("corrupt xbm") << QString("corrupt.xbm") << false << QString(""); #if defined QTEST_HAVE_TIFF - QTest::newRow("corrupt tiff") << QString("images/corrupt-data.tif") << true << QString(""); + QTest::newRow("corrupt tiff") << QString("corrupt-data.tif") << true << QString(""); #endif } @@ -1189,16 +1191,17 @@ void tst_QImageReader::readCorruptImage() QFETCH(QString, fileName); QFETCH(bool, shouldFail); QFETCH(QString, message); + if (!message.isEmpty()) QTest::ignoreMessage(QtWarningMsg, message.toLatin1()); - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); QVERIFY(reader.canRead()); QCOMPARE(reader.read().isNull(), shouldFail); } void tst_QImageReader::readCorruptBmp() { - QCOMPARE(QImage("images/tst7.bmp").convertToFormat(QImage::Format_ARGB32_Premultiplied), QImage("images/tst7.png").convertToFormat(QImage::Format_ARGB32_Premultiplied)); + QCOMPARE(QImage("tst7.bmp").convertToFormat(QImage::Format_ARGB32_Premultiplied), QImage("images/tst7.png").convertToFormat(QImage::Format_ARGB32_Premultiplied)); } void tst_QImageReader::supportsOption_data() @@ -1206,7 +1209,7 @@ void tst_QImageReader::supportsOption_data() QTest::addColumn("fileName"); QTest::addColumn("options"); - QTest::newRow("png") << QString("images/black.png") + QTest::newRow("png") << QString("black.png") << (QIntList() << QImageIOHandler::Gamma << QImageIOHandler::Description << QImageIOHandler::Quality @@ -1234,7 +1237,7 @@ void tst_QImageReader::supportsOption() << QImageIOHandler::Animation << QImageIOHandler::BackgroundColor; - QImageReader reader(fileName); + QImageReader reader(prefix + fileName); for (int i = 0; i < options.size(); ++i) { QVERIFY(reader.supportsOption(QImageIOHandler::ImageOption(options.at(i)))); allOptions.remove(QImageIOHandler::ImageOption(options.at(i))); @@ -1250,14 +1253,14 @@ void tst_QImageReader::tiffCompression_data() QTest::addColumn("uncompressedFile"); QTest::addColumn("compressedFile"); - QTest::newRow("TIFF: adobedeflate") << "images/rgba_nocompression_littleendian.tif" - << "images/rgba_adobedeflate_littleendian.tif"; - QTest::newRow("TIFF: lzw") << "images/rgba_nocompression_littleendian.tif" - << "images/rgba_lzw_littleendian.tif"; - QTest::newRow("TIFF: packbits") << "images/rgba_nocompression_littleendian.tif" - << "images/rgba_packbits_littleendian.tif"; - QTest::newRow("TIFF: zipdeflate") << "images/rgba_nocompression_littleendian.tif" - << "images/rgba_zipdeflate_littleendian.tif"; + QTest::newRow("TIFF: adobedeflate") << "rgba_nocompression_littleendian.tif" + << "rgba_adobedeflate_littleendian.tif"; + QTest::newRow("TIFF: lzw") << "rgba_nocompression_littleendian.tif" + << "rgba_lzw_littleendian.tif"; + QTest::newRow("TIFF: packbits") << "rgba_nocompression_littleendian.tif" + << "rgba_packbits_littleendian.tif"; + QTest::newRow("TIFF: zipdeflate") << "rgba_nocompression_littleendian.tif" + << "rgba_zipdeflate_littleendian.tif"; } void tst_QImageReader::tiffCompression() @@ -1265,16 +1268,16 @@ void tst_QImageReader::tiffCompression() QFETCH(QString, uncompressedFile); QFETCH(QString, compressedFile); - QImage uncompressedImage(uncompressedFile); - QImage compressedImage(compressedFile); + QImage uncompressedImage(prefix + uncompressedFile); + QImage compressedImage(prefix + compressedFile); QCOMPARE(uncompressedImage, compressedImage); } void tst_QImageReader::tiffEndianness() { - QImage littleEndian("images/rgba_nocompression_littleendian.tif"); - QImage bigEndian("images/rgba_nocompression_bigendian.tif"); + QImage littleEndian(prefix + "rgba_nocompression_littleendian.tif"); + QImage bigEndian(prefix + "rgba_nocompression_bigendian.tif"); QCOMPARE(littleEndian, bigEndian); } @@ -1286,8 +1289,10 @@ void tst_QImageReader::dotsPerMeter_data() QTest::addColumn("fileName"); QTest::addColumn("expectedDotsPerMeterX"); QTest::addColumn("expectedDotsPerMeterY"); - - QTest::newRow("TIFF: 72 dpi") << "images/rgba_nocompression_littleendian.tif" << qRound(72 * (100 / 2.54)) << qRound(72 * (100 / 2.54)); +#if defined QTEST_HAVE_TIFF + QTest::newRow("TIFF: 72 dpi") << ("rgba_nocompression_littleendian.tif") << qRound(72 * (100 / 2.54)) << qRound(72 * (100 / 2.54)); + QTest::newRow("TIFF: 100 dpi") << ("image_100dpi.tif") << qRound(100 * (100 / 2.54)) << qRound(100 * (100 / 2.54)); +#endif } void tst_QImageReader::dotsPerMeter() @@ -1296,7 +1301,7 @@ void tst_QImageReader::dotsPerMeter() QFETCH(int, expectedDotsPerMeterX); QFETCH(int, expectedDotsPerMeterY); - QImage image(fileName); + QImage image(prefix + fileName); QCOMPARE(image.dotsPerMeterX(), expectedDotsPerMeterX); QCOMPARE(image.dotsPerMeterY(), expectedDotsPerMeterY); @@ -1307,8 +1312,10 @@ void tst_QImageReader::physicalDpi_data() QTest::addColumn("fileName"); QTest::addColumn("expectedPhysicalDpiX"); QTest::addColumn("expectedPhysicalDpiY"); - - QTest::newRow("TIFF: 72 dpi") << "images/rgba_nocompression_littleendian.tif" << 72 << 72; +#if defined QTEST_HAVE_TIFF + QTest::newRow("TIFF: 72 dpi") << "rgba_nocompression_littleendian.tif" << 72 << 72; + QTest::newRow("TIFF: 100 dpi") << "image_100dpi.tif" << 100 << 100; +#endif } void tst_QImageReader::physicalDpi() @@ -1317,7 +1324,7 @@ void tst_QImageReader::physicalDpi() QFETCH(int, expectedPhysicalDpiX); QFETCH(int, expectedPhysicalDpiY); - QImage image(fileName); + QImage image(prefix + fileName); QCOMPARE(image.physicalDpiX(), expectedPhysicalDpiX); QCOMPARE(image.physicalDpiY(), expectedPhysicalDpiY); @@ -1328,7 +1335,7 @@ void tst_QImageReader::autoDetectImageFormat() // Assume PNG is supported :-) { // Disables file name extension probing - QImageReader reader("images/kollada"); + QImageReader reader(prefix + "kollada"); reader.setAutoDetectImageFormat(false); QVERIFY(!reader.canRead()); QVERIFY(reader.read().isNull()); @@ -1338,7 +1345,7 @@ void tst_QImageReader::autoDetectImageFormat() } { // Disables detection based on suffix - QImageReader reader("images/kollada.png"); + QImageReader reader(prefix + "kollada.png"); reader.setAutoDetectImageFormat(false); QVERIFY(!reader.canRead()); QVERIFY(reader.read().isNull()); @@ -1348,7 +1355,7 @@ void tst_QImageReader::autoDetectImageFormat() } { // Disables detection based on content - QImageReader reader("images/kollada-noext"); + QImageReader reader(prefix + "kollada-noext"); reader.setAutoDetectImageFormat(false); QVERIFY(!reader.canRead()); QVERIFY(reader.read().isNull()); diff --git a/tests/auto/qimagewriter/tst_qimagewriter.cpp b/tests/auto/qimagewriter/tst_qimagewriter.cpp index 70d9e70..349afa5 100644 --- a/tests/auto/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/qimagewriter/tst_qimagewriter.cpp @@ -165,7 +165,7 @@ tst_QImageWriter::tst_QImageWriter() tst_QImageWriter::~tst_QImageWriter() { - QDir dir(prefix + QLatin1String("images")); + QDir dir(prefix); QStringList filesToDelete = dir.entryList(QStringList() << "gen-*" , QDir::NoDotAndDotDot | QDir::Files); foreach( QString file, filesToDelete) { QFile::remove(dir.absoluteFilePath(file)); @@ -445,13 +445,13 @@ void tst_QImageWriter::supportsOption_data() QTest::addColumn("fileName"); QTest::addColumn("options"); - QTest::newRow("png") << QString(prefix + "gen-black.png") + QTest::newRow("png") << QString("gen-black.png") << (QIntList() << QImageIOHandler::Gamma << QImageIOHandler::Description << QImageIOHandler::Quality << QImageIOHandler::Size); #if defined QTEST_HAVE_TIFF - QTest::newRow("tiff") << QString("images/gen-black.tiff") + QTest::newRow("tiff") << QString("gen-black.tiff") << (QIntList() << QImageIOHandler::Size << QImageIOHandler::CompressionRatio); #endif @@ -478,7 +478,7 @@ void tst_QImageWriter::supportsOption() << QImageIOHandler::Animation << QImageIOHandler::BackgroundColor; - QImageWriter writer(fileName); + QImageWriter writer(prefix + fileName); for (int i = 0; i < options.size(); ++i) { QVERIFY(writer.supportsOption(QImageIOHandler::ImageOption(options.at(i)))); allOptions.remove(QImageIOHandler::ImageOption(options.at(i))); -- cgit v0.12 From e2d70563652a89384d13c9a1d7ac1c839a81e9be Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Wed, 20 May 2009 10:40:46 +0200 Subject: Inject some more Qt colors into the css to make it look a bit more QtSoftware Reviewed-By: Kavindra Palaraja --- tools/qdoc3/test/classic.css | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/tools/qdoc3/test/classic.css b/tools/qdoc3/test/classic.css index e53ea29..8e9eb78 100644 --- a/tools/qdoc3/test/classic.css +++ b/tools/qdoc3/test/classic.css @@ -1,5 +1,5 @@ BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { - font-family: Geneva, Arial, Helvetica, sans-serif; + font-family: Arial, Geneva, Helvetica, sans-serif; } BODY,TD { font-size: 90%; @@ -20,7 +20,7 @@ h3.fn,span.fn background-color: #d5e1d5; border-width: 1px; border-style: solid; - border-color: #84b0c7; + border-color: #66bc29; font-weight: bold; -moz-border-radius: 8px 8px 8px 8px; padding: 6px 0px 6px 10px; @@ -28,7 +28,7 @@ h3.fn,span.fn a:link { - color: #004faf; + color: #0046ad; text-decoration: none } @@ -62,16 +62,6 @@ a.compat:visited text-decoration: none } -td.postheader -{ - font-family: sans-serif -} - -tr.address -{ - font-family: sans-serif -} - body { background: #ffffff; @@ -86,10 +76,10 @@ table td.memItemLeft { border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; + border-top-color: #66bc29; + border-right-color: #66bc29; + border-bottom-color: #66bc29; + border-left-color: #66bc29; border-top-style: solid; border-right-style: none; border-bottom-style: none; @@ -104,15 +94,15 @@ table td.memItemRight { border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; + border-top-color: #66bc29; + border-right-color: #66bc29; + border-bottom-color: #66bc29; + border-left-color: #66bc29; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; - background-color: #d5e1d5; + background-color: #FAFAFA; font-size: 80%; } -- cgit v0.12 From 691e83425ac5883922837bc5fd1efb5385db9871 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 20 May 2009 11:57:08 +0200 Subject: Add string-->enum conversion for properties and slots --- src/script/qscriptengine_p.cpp | 5 ++ src/script/qscriptenginefwd_p.h | 1 + src/script/qscriptextqobject.cpp | 33 +++++++++--- tests/auto/qscriptqobject/tst_qscriptqobject.cpp | 66 +++++++++++++++++++++++- 4 files changed, 96 insertions(+), 9 deletions(-) diff --git a/src/script/qscriptengine_p.cpp b/src/script/qscriptengine_p.cpp index a2e58de..84a420d 100644 --- a/src/script/qscriptengine_p.cpp +++ b/src/script/qscriptengine_p.cpp @@ -1662,6 +1662,11 @@ bool QScriptEnginePrivate::convert(const QScriptValueImpl &value, return false; } +QScriptEngine::DemarshalFunction QScriptEnginePrivate::demarshalFunction(int type) const +{ + return m_customTypes.value(type).demarshal; +} + QScriptValuePrivate *QScriptEnginePrivate::registerValue(const QScriptValueImpl &value) { if (value.isString()) { diff --git a/src/script/qscriptenginefwd_p.h b/src/script/qscriptenginefwd_p.h index 2ea66c5..855317c 100644 --- a/src/script/qscriptenginefwd_p.h +++ b/src/script/qscriptenginefwd_p.h @@ -350,6 +350,7 @@ public: QScriptValueImpl create(int type, const void *ptr); static bool convert(const QScriptValueImpl &value, int type, void *ptr, QScriptEnginePrivate *eng); + QScriptEngine::DemarshalFunction demarshalFunction(int type) const; QScriptValueImpl arrayFromStringList(const QStringList &lst); static QStringList stringListFromArray(const QScriptValueImpl &arr); diff --git a/src/script/qscriptextqobject.cpp b/src/script/qscriptextqobject.cpp index d18c3da..4522807 100644 --- a/src/script/qscriptextqobject.cpp +++ b/src/script/qscriptextqobject.cpp @@ -425,7 +425,7 @@ static void callQtMethod(QScriptContextPrivate *context, QMetaMethod::MethodType matchDistance += 10; } } - } else if (actual.isNumber()) { + } else if (actual.isNumber() || actual.isString()) { // see if it's an enum value QMetaEnum m; if (argType.isMetaEnum()) { @@ -436,11 +436,21 @@ static void callQtMethod(QScriptContextPrivate *context, QMetaMethod::MethodType m = meta->enumerator(mi); } if (m.isValid()) { - int ival = actual.toInt32(); - if (m.valueToKey(ival) != 0) { - qVariantSetValue(v, ival); - converted = true; - matchDistance += 10; + if (actual.isNumber()) { + int ival = actual.toInt32(); + if (m.valueToKey(ival) != 0) { + qVariantSetValue(v, ival); + converted = true; + matchDistance += 10; + } + } else { + QString sval = actual.toString(); + int ival = m.keyToValue(sval.toLatin1()); + if (ival != -1) { + qVariantSetValue(v, ival); + converted = true; + matchDistance += 10; + } } } } @@ -1809,7 +1819,16 @@ void QScript::QtPropertyFunction::execute(QScriptContextPrivate *context) } } else { // set - QVariant v = variantFromValue(eng_p, prop.userType(), context->argument(0)); + QScriptValueImpl arg = context->argument(0); + QVariant v; + if (prop.isEnumType() && arg.isString() + && !eng_p->demarshalFunction(prop.userType())) { + // give QMetaProperty::write() a chance to convert from + // string to enum value + v = arg.toString(); + } else { + v = variantFromValue(eng_p, prop.userType(), arg); + } QScriptable *scriptable = scriptableFromQObject(qobject); QScriptEngine *oldEngine = 0; diff --git a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp index 9b9dd16..1025d2a 100644 --- a/tests/auto/qscriptqobject/tst_qscriptqobject.cpp +++ b/tests/auto/qscriptqobject/tst_qscriptqobject.cpp @@ -107,6 +107,7 @@ class MyQObject : public QObject Q_PROPERTY(int readOnlyProperty READ readOnlyProperty) Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut) Q_PROPERTY(CustomType propWithCustomType READ propWithCustomType WRITE setPropWithCustomType) + Q_PROPERTY(Policy enumProperty READ enumProperty WRITE setEnumProperty) Q_ENUMS(Policy Strategy) Q_FLAGS(Ability) @@ -144,6 +145,7 @@ public: m_hiddenValue(456.0), m_writeOnlyValue(789), m_readOnlyValue(987), + m_enumValue(BarPolicy), m_qtFunctionInvoked(-1) { } @@ -205,6 +207,11 @@ public: void setPropWithCustomType(const CustomType &c) { m_customType = c; } + Policy enumProperty() const + { return m_enumValue; } + void setEnumProperty(Policy policy) + { m_enumValue = policy; } + int qtFunctionInvoked() const { return m_qtFunctionInvoked; } @@ -255,8 +262,8 @@ public: { m_qtFunctionInvoked = 36; m_actuals << policy; } Q_INVOKABLE Policy myInvokableReturningEnum() { m_qtFunctionInvoked = 37; return BazPolicy; } - Q_INVOKABLE MyQObject::Policy myInvokableReturningQualifiedEnum() - { m_qtFunctionInvoked = 38; return BazPolicy; } + Q_INVOKABLE MyQObject::Strategy myInvokableReturningQualifiedEnum() + { m_qtFunctionInvoked = 38; return BazStrategy; } Q_INVOKABLE QVector myInvokableReturningVectorOfInt() { m_qtFunctionInvoked = 11; return QVector(); } Q_INVOKABLE void myInvokableWithVectorOfIntArg(const QVector &) @@ -410,6 +417,7 @@ protected: int m_readOnlyValue; QKeySequence m_shortcut; CustomType m_customType; + Policy m_enumValue; int m_qtFunctionInvoked; QVariantList m_actuals; QByteArray m_connectedSignal; @@ -417,6 +425,7 @@ protected: }; Q_DECLARE_METATYPE(MyQObject*) +Q_DECLARE_METATYPE(MyQObject::Policy) class MyOtherQObject : public MyQObject { @@ -530,6 +539,24 @@ static QScriptValue getSetProperty(QScriptContext *ctx, QScriptEngine *) return ctx->callee().property("value"); } +static QScriptValue policyToScriptValue(QScriptEngine *engine, const MyQObject::Policy &policy) +{ + return qScriptValueFromValue(engine, policy); +} + +static void policyFromScriptValue(const QScriptValue &value, MyQObject::Policy &policy) +{ + QString str = value.toString(); + if (str == QLatin1String("red")) + policy = MyQObject::FooPolicy; + else if (str == QLatin1String("green")) + policy = MyQObject::BarPolicy; + else if (str == QLatin1String("blue")) + policy = MyQObject::BazPolicy; + else + policy = (MyQObject::Policy)-1; +} + void tst_QScriptExtQObject::getSetStaticProperty() { QCOMPARE(m_engine->evaluate("myObject.noSuchProperty").isUndefined(), true); @@ -751,6 +778,31 @@ void tst_QScriptExtQObject::getSetStaticProperty() QScriptValue::ReadOnly); } + // enum property + QCOMPARE(m_myObject->enumProperty(), MyQObject::BarPolicy); + { + QScriptValue val = m_engine->evaluate("myObject.enumProperty"); + QVERIFY(val.isNumber()); + QCOMPARE(val.toInt32(), (int)MyQObject::BarPolicy); + } + m_engine->evaluate("myObject.enumProperty = 2"); + QCOMPARE(m_myObject->enumProperty(), MyQObject::BazPolicy); + m_engine->evaluate("myObject.enumProperty = 'BarPolicy'"); + QCOMPARE(m_myObject->enumProperty(), MyQObject::BarPolicy); + m_engine->evaluate("myObject.enumProperty = 'ScoobyDoo'"); + // ### ouch! Shouldn't QMetaProperty::write() rather not change the value...? + QCOMPARE(m_myObject->enumProperty(), (MyQObject::Policy)-1); + // enum property with custom conversion + qScriptRegisterMetaType(m_engine, policyToScriptValue, policyFromScriptValue); + m_engine->evaluate("myObject.enumProperty = 'red'"); + QCOMPARE(m_myObject->enumProperty(), MyQObject::FooPolicy); + m_engine->evaluate("myObject.enumProperty = 'green'"); + QCOMPARE(m_myObject->enumProperty(), MyQObject::BarPolicy); + m_engine->evaluate("myObject.enumProperty = 'blue'"); + QCOMPARE(m_myObject->enumProperty(), MyQObject::BazPolicy); + m_engine->evaluate("myObject.enumProperty = 'nada'"); + QCOMPARE(m_myObject->enumProperty(), (MyQObject::Policy)-1); + // auto-dereferencing of pointers { QBrush b = QColor(0xCA, 0xFE, 0xBA, 0xBE); @@ -1879,6 +1931,16 @@ void tst_QScriptExtQObject::classEnums() QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), int(MyQObject::BazPolicy)); m_myObject->resetQtFunctionInvoked(); + QCOMPARE(m_engine->evaluate("myObject.myInvokableWithEnumArg('BarPolicy')").isUndefined(), true); + QCOMPARE(m_myObject->qtFunctionInvoked(), 10); + QCOMPARE(m_myObject->qtFunctionActuals().size(), 1); + QCOMPARE(m_myObject->qtFunctionActuals().at(0).toInt(), int(MyQObject::BarPolicy)); + + m_myObject->resetQtFunctionInvoked(); + QVERIFY(m_engine->evaluate("myObject.myInvokableWithEnumArg('NoSuchPolicy')").isError()); + QCOMPARE(m_myObject->qtFunctionInvoked(), -1); + + m_myObject->resetQtFunctionInvoked(); QCOMPARE(m_engine->evaluate("myObject.myInvokableWithQualifiedEnumArg(MyQObject.BazPolicy)").isUndefined(), true); QCOMPARE(m_myObject->qtFunctionInvoked(), 36); QCOMPARE(m_myObject->qtFunctionActuals().size(), 1); -- cgit v0.12