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 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 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 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 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 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 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 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 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 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 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 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